@douyinfe/semi-ui 2.30.1 → 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 +203 -71
- 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/form/baseForm.js +9 -4
- package/lib/cjs/layout/index.d.ts +1 -1
- package/lib/cjs/modal/confirm.d.ts +303 -26
- package/lib/cjs/modal/confirm.js +7 -2
- 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 +6 -3
- 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/form/baseForm.js +9 -4
- package/lib/es/layout/index.d.ts +1 -1
- package/lib/es/modal/confirm.d.ts +303 -26
- package/lib/es/modal/confirm.js +6 -2
- 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 +9 -3
- 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 +9 -9
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;
|
|
@@ -41357,11 +41409,12 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
|
|
|
41357
41409
|
|
|
41358
41410
|
const a11yProps = {
|
|
41359
41411
|
role: 'button',
|
|
41360
|
-
tabIndex: tabIndex
|
|
41412
|
+
tabIndex: tabIndex || 0,
|
|
41361
41413
|
onKeyDown: this.handleKeyDown
|
|
41362
41414
|
};
|
|
41363
41415
|
const baseProps = Object.assign(Object.assign({}, attr), {
|
|
41364
41416
|
onClick,
|
|
41417
|
+
tabIndex: tabIndex,
|
|
41365
41418
|
className: classnames_default()(tag_prefixCls, {
|
|
41366
41419
|
[`${tag_prefixCls}-default`]: size === 'default',
|
|
41367
41420
|
[`${tag_prefixCls}-small`]: size === 'small',
|
|
@@ -41385,10 +41438,14 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
|
|
|
41385
41438
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, {
|
|
41386
41439
|
size: "small"
|
|
41387
41440
|
})) : null;
|
|
41441
|
+
|
|
41442
|
+
const stringChild = isString_default()(children);
|
|
41443
|
+
|
|
41444
|
+
const contentCls = classnames_default()(`${tag_prefixCls}-content`, `${tag_prefixCls}-content-${stringChild ? 'ellipsis' : 'center'}`);
|
|
41388
41445
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", Object.assign({
|
|
41389
|
-
"aria-label": this.props['aria-label'] ||
|
|
41446
|
+
"aria-label": this.props['aria-label'] || stringChild ? `${closable ? 'Closable ' : ''}Tag: ${children}` : ''
|
|
41390
41447
|
}, wrapProps), avatarSrc ? this.renderAvatar() : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41391
|
-
className:
|
|
41448
|
+
className: contentCls
|
|
41392
41449
|
}, children), closeIcon);
|
|
41393
41450
|
}
|
|
41394
41451
|
|
|
@@ -43830,15 +43887,13 @@ class tagInput_TagInput extends baseComponent_BaseComponent {
|
|
|
43830
43887
|
key: elementKey,
|
|
43831
43888
|
visible: true,
|
|
43832
43889
|
"aria-label": `${!disabled ? 'Closable ' : ''}Tag: ${value}`
|
|
43833
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
43834
|
-
className: `${tagInput_prefixCls}-tag-content-wrapper`
|
|
43835
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, {
|
|
43836
43891
|
className: typoCls,
|
|
43837
43892
|
ellipsis: {
|
|
43838
43893
|
showTooltip: showContentTooltip,
|
|
43839
43894
|
rows: 1
|
|
43840
43895
|
}
|
|
43841
|
-
}, value))
|
|
43896
|
+
}, value));
|
|
43842
43897
|
}
|
|
43843
43898
|
});
|
|
43844
43899
|
};
|
|
@@ -45199,7 +45254,8 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
45199
45254
|
onChange: this.handleInputChange
|
|
45200
45255
|
};
|
|
45201
45256
|
const wrappercls = classnames_default()({
|
|
45202
|
-
[`${cascader_prefixcls}-search-wrapper`]: true
|
|
45257
|
+
[`${cascader_prefixcls}-search-wrapper`]: true,
|
|
45258
|
+
[`${cascader_prefixcls}-search-wrapper-${size}`]: size !== 'default'
|
|
45203
45259
|
});
|
|
45204
45260
|
const displayText = this.renderDisplayText();
|
|
45205
45261
|
const spanCls = classnames_default()({
|
|
@@ -60158,6 +60214,7 @@ const ConfirmModal = props => {
|
|
|
60158
60214
|
|
|
60159
60215
|
|
|
60160
60216
|
|
|
60217
|
+
|
|
60161
60218
|
function confirm_confirm(props) {
|
|
60162
60219
|
// create a dom in adapter?
|
|
60163
60220
|
const div = document.createElement('div');
|
|
@@ -60236,8 +60293,11 @@ function withWarning(props) {
|
|
|
60236
60293
|
function withError(props) {
|
|
60237
60294
|
return Object.assign({
|
|
60238
60295
|
type: 'error',
|
|
60239
|
-
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconAlertCircle, null)
|
|
60240
|
-
|
|
60296
|
+
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconAlertCircle, null),
|
|
60297
|
+
okButtonProps: Object.assign({
|
|
60298
|
+
type: 'danger'
|
|
60299
|
+
}, props.okButtonProps)
|
|
60300
|
+
}, omit_default()(props, ['okButtonProps']));
|
|
60241
60301
|
}
|
|
60242
60302
|
function withConfirm(props) {
|
|
60243
60303
|
return Object.assign({
|
|
@@ -80401,14 +80461,14 @@ function isAnyFixed(columns) {
|
|
|
80401
80461
|
function isAnyFixedRight(columns) {
|
|
80402
80462
|
return some_default()(columns, col => col.fixed === 'right');
|
|
80403
80463
|
}
|
|
80404
|
-
function
|
|
80464
|
+
function utils_isFixedLeft(column) {
|
|
80405
80465
|
return ['left', true].includes(get_default()(column, 'fixed'));
|
|
80406
80466
|
}
|
|
80407
|
-
function
|
|
80467
|
+
function utils_isFixedRight(column) {
|
|
80408
80468
|
return ['right'].includes(get_default()(column, 'fixed'));
|
|
80409
80469
|
}
|
|
80410
80470
|
function isFixed(column) {
|
|
80411
|
-
return
|
|
80471
|
+
return utils_isFixedLeft(column) || utils_isFixedRight(column);
|
|
80412
80472
|
}
|
|
80413
80473
|
function isInnerColumnKey(key) {
|
|
80414
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);
|
|
@@ -80797,6 +80857,22 @@ function isTreeTable(_ref2) {
|
|
|
80797
80857
|
|
|
80798
80858
|
return flag;
|
|
80799
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
|
+
}
|
|
80800
80876
|
// CONCATENATED MODULE: ../semi-foundation/utils/Store.ts
|
|
80801
80877
|
/* istanbul ignore next */
|
|
80802
80878
|
class Store {
|
|
@@ -82215,7 +82291,8 @@ const TableContextProvider = _ref => {
|
|
|
82215
82291
|
renderExpandIcon,
|
|
82216
82292
|
renderSelection,
|
|
82217
82293
|
getVirtualizedListRef,
|
|
82218
|
-
setBodyHasScrollbar
|
|
82294
|
+
setBodyHasScrollbar,
|
|
82295
|
+
direction
|
|
82219
82296
|
} = _ref;
|
|
82220
82297
|
const tableContextValue = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["useMemo"])(() => ({
|
|
82221
82298
|
anyColumnFixed,
|
|
@@ -82229,8 +82306,9 @@ const TableContextProvider = _ref => {
|
|
|
82229
82306
|
tableWidth,
|
|
82230
82307
|
handleRowExpanded,
|
|
82231
82308
|
getVirtualizedListRef,
|
|
82232
|
-
setBodyHasScrollbar
|
|
82233
|
-
|
|
82309
|
+
setBodyHasScrollbar,
|
|
82310
|
+
direction
|
|
82311
|
+
}), [anyColumnFixed, flattenedColumns, renderExpandIcon, renderSelection, setHeadWidths, getHeadWidths, getCellWidths, headWidths, tableWidth, handleRowExpanded, getVirtualizedListRef, setBodyHasScrollbar, direction]);
|
|
82234
82312
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(table_context.Provider, {
|
|
82235
82313
|
value: tableContextValue
|
|
82236
82314
|
}, children);
|
|
@@ -82827,8 +82905,10 @@ class TableHeaderRow_TableHeaderRow extends baseComponent_BaseComponent {
|
|
|
82827
82905
|
columns
|
|
82828
82906
|
} = this.props;
|
|
82829
82907
|
const {
|
|
82830
|
-
getCellWidths
|
|
82908
|
+
getCellWidths,
|
|
82909
|
+
direction
|
|
82831
82910
|
} = this.context;
|
|
82911
|
+
const isRTL = direction === 'rtl';
|
|
82832
82912
|
const slicedColumns = sliceColumnsByLevel(columns, index);
|
|
82833
82913
|
const headWidths = getCellWidths(slicedColumns);
|
|
82834
82914
|
|
|
@@ -82850,35 +82930,52 @@ class TableHeaderRow_TableHeaderRow extends baseComponent_BaseComponent {
|
|
|
82850
82930
|
let cellStyle = Object.assign({}, customProps.style);
|
|
82851
82931
|
|
|
82852
82932
|
if (column.align) {
|
|
82933
|
+
const textAlign = getRTLAlign(column.align, direction);
|
|
82853
82934
|
cellStyle = Object.assign(Object.assign({}, cellStyle), {
|
|
82854
|
-
textAlign
|
|
82935
|
+
textAlign
|
|
82855
82936
|
});
|
|
82856
82937
|
customProps.className = classnames_default()(customProps.className, column.className, {
|
|
82857
|
-
[`${prefixCls}-align-${
|
|
82938
|
+
[`${prefixCls}-align-${textAlign}`]: Boolean(textAlign)
|
|
82858
82939
|
});
|
|
82859
82940
|
}
|
|
82860
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
|
+
|
|
82861
82956
|
customProps.className = classnames_default()(`${prefixCls}-row-head`, column.className, customProps.className, // `${prefixCls}-fixed-columns`,
|
|
82862
82957
|
{
|
|
82863
|
-
[`${prefixCls}-cell-fixed-left`]:
|
|
82864
|
-
[`${prefixCls}-cell-fixed-left-last`]:
|
|
82865
|
-
[`${prefixCls}-cell-fixed-right`]:
|
|
82866
|
-
[`${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
|
|
82867
82962
|
});
|
|
82868
82963
|
|
|
82869
82964
|
if (headWidths.length && slicedColumns.length) {
|
|
82870
82965
|
const indexOfSlicedColumns = findIndex_default()(slicedColumns, item => item && item.key != null && item.key === column.key);
|
|
82871
82966
|
|
|
82872
82967
|
if (indexOfSlicedColumns > -1) {
|
|
82873
|
-
if (
|
|
82968
|
+
if (utils_isFixedLeft(column)) {
|
|
82969
|
+
const xPositionKey = isRTL ? 'right' : 'left';
|
|
82874
82970
|
cellStyle = Object.assign(Object.assign({}, cellStyle), {
|
|
82875
82971
|
position: 'sticky',
|
|
82876
|
-
|
|
82972
|
+
[xPositionKey]: arrayAdd(headWidths, 0, indexOfSlicedColumns)
|
|
82877
82973
|
});
|
|
82878
|
-
} else if (
|
|
82974
|
+
} else if (utils_isFixedRight(column)) {
|
|
82975
|
+
const xPositionKey = isRTL ? 'left' : 'right';
|
|
82879
82976
|
cellStyle = Object.assign(Object.assign({}, cellStyle), {
|
|
82880
82977
|
position: 'sticky',
|
|
82881
|
-
|
|
82978
|
+
[xPositionKey]: arrayAdd(headWidths, indexOfSlicedColumns + 1)
|
|
82882
82979
|
});
|
|
82883
82980
|
}
|
|
82884
82981
|
}
|
|
@@ -83660,13 +83757,17 @@ class TableCell_TableCell extends baseComponent_BaseComponent {
|
|
|
83660
83757
|
} = this.props;
|
|
83661
83758
|
let tdProps = {};
|
|
83662
83759
|
let customCellProps = {};
|
|
83760
|
+
const {
|
|
83761
|
+
direction
|
|
83762
|
+
} = this.context;
|
|
83763
|
+
const isRTL = direction === 'rtl';
|
|
83663
83764
|
const fixedLeftFlag = fixedLeft || typeof fixedLeft === 'number';
|
|
83664
83765
|
const fixedRightFlag = fixedRight || typeof fixedRight === 'number';
|
|
83665
83766
|
|
|
83666
83767
|
if (fixedLeftFlag) {
|
|
83667
|
-
set_default()(tdProps, 'style.left', typeof fixedLeft === 'number' ? fixedLeft : 0);
|
|
83768
|
+
set_default()(tdProps, isRTL ? 'style.right' : 'style.left', typeof fixedLeft === 'number' ? fixedLeft : 0);
|
|
83668
83769
|
} else if (fixedRightFlag) {
|
|
83669
|
-
set_default()(tdProps, 'style.right', typeof fixedRight === 'number' ? fixedRight : 0);
|
|
83770
|
+
set_default()(tdProps, isRTL ? 'style.left' : 'style.right', typeof fixedRight === 'number' ? fixedRight : 0);
|
|
83670
83771
|
}
|
|
83671
83772
|
|
|
83672
83773
|
if (width != null) {
|
|
@@ -83686,8 +83787,9 @@ class TableCell_TableCell extends baseComponent_BaseComponent {
|
|
|
83686
83787
|
}
|
|
83687
83788
|
|
|
83688
83789
|
if (column.align) {
|
|
83790
|
+
const textAlign = getRTLAlign(column.align, direction);
|
|
83689
83791
|
tdProps.style = Object.assign(Object.assign({}, tdProps.style), {
|
|
83690
|
-
textAlign
|
|
83792
|
+
textAlign
|
|
83691
83793
|
});
|
|
83692
83794
|
}
|
|
83693
83795
|
|
|
@@ -83825,6 +83927,10 @@ class TableCell_TableCell extends baseComponent_BaseComponent {
|
|
|
83825
83927
|
firstFixedRight,
|
|
83826
83928
|
colIndex
|
|
83827
83929
|
} = this.props;
|
|
83930
|
+
const {
|
|
83931
|
+
direction
|
|
83932
|
+
} = this.context;
|
|
83933
|
+
const isRTL = direction === 'rtl';
|
|
83828
83934
|
const {
|
|
83829
83935
|
className
|
|
83830
83936
|
} = column;
|
|
@@ -83855,11 +83961,25 @@ class TableCell_TableCell extends baseComponent_BaseComponent {
|
|
|
83855
83961
|
}
|
|
83856
83962
|
|
|
83857
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
|
+
|
|
83858
83978
|
const columnCls = classnames_default()(className, `${prefixCls}-row-cell`, get_default()(customCellProps, 'className'), {
|
|
83859
|
-
[`${prefixCls}-cell-fixed-left`]:
|
|
83860
|
-
[`${prefixCls}-cell-fixed-left-last`]:
|
|
83861
|
-
[`${prefixCls}-cell-fixed-right`]:
|
|
83862
|
-
[`${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
|
|
83863
83983
|
});
|
|
83864
83984
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(BodyCell, Object.assign({
|
|
83865
83985
|
role: "gridcell",
|
|
@@ -84132,9 +84252,9 @@ class BaseRow_TableRow extends baseComponent_BaseComponent {
|
|
|
84132
84252
|
index: index,
|
|
84133
84253
|
record: record,
|
|
84134
84254
|
component: BodyCell,
|
|
84135
|
-
fixedLeft:
|
|
84255
|
+
fixedLeft: utils_isFixedLeft(column) && arrayAdd(cellWidths, 0, columnIndex),
|
|
84136
84256
|
lastFixedLeft: isLastLeftFixed(columns, column),
|
|
84137
|
-
fixedRight:
|
|
84257
|
+
fixedRight: utils_isFixedRight(column) && arrayAdd(cellWidths, columnIndex + 1),
|
|
84138
84258
|
firstFixedRight: isFirstFixedRight(columns, column),
|
|
84139
84259
|
selected: selected,
|
|
84140
84260
|
expanded: expanded,
|
|
@@ -84678,7 +84798,6 @@ var Body_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
84678
84798
|
|
|
84679
84799
|
|
|
84680
84800
|
|
|
84681
|
-
|
|
84682
84801
|
class Body_Body extends baseComponent_BaseComponent {
|
|
84683
84802
|
constructor(props, context) {
|
|
84684
84803
|
var _this;
|
|
@@ -85442,12 +85561,10 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
85442
85561
|
const {
|
|
85443
85562
|
virtualized
|
|
85444
85563
|
} = this.props;
|
|
85445
|
-
|
|
85446
|
-
|
|
85447
|
-
|
|
85448
|
-
|
|
85449
|
-
return virtualized ? this.renderVirtualizedBody(direction) : this.renderBody(direction);
|
|
85450
|
-
});
|
|
85564
|
+
const {
|
|
85565
|
+
direction
|
|
85566
|
+
} = this.context;
|
|
85567
|
+
return virtualized ? this.renderVirtualizedBody(direction) : this.renderBody(direction);
|
|
85451
85568
|
}
|
|
85452
85569
|
|
|
85453
85570
|
}
|
|
@@ -85760,8 +85877,9 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
85760
85877
|
const node = this.bodyWrapRef.current;
|
|
85761
85878
|
|
|
85762
85879
|
if (node && node.children && node.children.length) {
|
|
85763
|
-
const scrollToLeft = node.scrollLeft === 0;
|
|
85764
|
-
|
|
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;
|
|
85765
85883
|
|
|
85766
85884
|
if (scrollToLeft && scrollToRight) {
|
|
85767
85885
|
this.setScrollPosition('both');
|
|
@@ -86952,11 +87070,13 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
86952
87070
|
});
|
|
86953
87071
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
86954
87072
|
ref: this.rootWrapRef,
|
|
86955
|
-
className: classnames_default()(className, `${prefixCls}-wrapper`),
|
|
87073
|
+
className: classnames_default()(className, `${prefixCls}-wrapper`, `${prefixCls}-wrapper-${props.direction}`),
|
|
86956
87074
|
"data-column-fixed": anyColumnFixed,
|
|
86957
87075
|
style: wrapStyle,
|
|
86958
87076
|
id: id
|
|
86959
|
-
}, /*#__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, {
|
|
86960
87080
|
spinning: loading,
|
|
86961
87081
|
size: "large"
|
|
86962
87082
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
@@ -87344,6 +87464,7 @@ const ResizableTable = function () {
|
|
|
87344
87464
|
|
|
87345
87465
|
|
|
87346
87466
|
|
|
87467
|
+
|
|
87347
87468
|
class table_Table_0 extends external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.PureComponent {
|
|
87348
87469
|
constructor(props) {
|
|
87349
87470
|
super(props);
|
|
@@ -87354,16 +87475,21 @@ class table_Table_0 extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
87354
87475
|
}
|
|
87355
87476
|
|
|
87356
87477
|
render() {
|
|
87357
|
-
// eslint-disable-next-line prefer-destructuring
|
|
87478
|
+
var _a; // eslint-disable-next-line prefer-destructuring
|
|
87479
|
+
|
|
87480
|
+
|
|
87358
87481
|
const props = this.props;
|
|
87482
|
+
const direction = (_a = this.props.direction) !== null && _a !== void 0 ? _a : this.context.direction;
|
|
87359
87483
|
|
|
87360
87484
|
if (props.resizable) {
|
|
87361
87485
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(table_ResizableTable, Object.assign({}, props, {
|
|
87362
|
-
ref: this.tableRef
|
|
87486
|
+
ref: this.tableRef,
|
|
87487
|
+
direction: direction
|
|
87363
87488
|
}));
|
|
87364
87489
|
} else {
|
|
87365
87490
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(table_Table, Object.assign({}, props, {
|
|
87366
|
-
ref: this.tableRef
|
|
87491
|
+
ref: this.tableRef,
|
|
87492
|
+
direction: direction
|
|
87367
87493
|
}));
|
|
87368
87494
|
}
|
|
87369
87495
|
}
|
|
@@ -87379,6 +87505,7 @@ table_Table_0.propTypes = Object.assign(Object.assign({}, table_Table.propTypes)
|
|
|
87379
87505
|
table_Table_0.defaultProps = {
|
|
87380
87506
|
hideExpandedColumn: true
|
|
87381
87507
|
};
|
|
87508
|
+
table_Table_0.contextType = configProvider_context;
|
|
87382
87509
|
|
|
87383
87510
|
/* harmony default export */ var table_0 = (table_Table_0);
|
|
87384
87511
|
// CONCATENATED MODULE: ../semi-foundation/tabs/constants.ts
|
|
@@ -101256,7 +101383,11 @@ class baseForm_Form extends baseComponent_BaseComponent {
|
|
|
101256
101383
|
const {
|
|
101257
101384
|
formId
|
|
101258
101385
|
} = this.state;
|
|
101259
|
-
|
|
101386
|
+
const {
|
|
101387
|
+
id
|
|
101388
|
+
} = this.props;
|
|
101389
|
+
const xId = id ? id : formId;
|
|
101390
|
+
return document.querySelectorAll(`form[x-form-id="${xId}"] .${form_constants_cssClasses.PREFIX}-field-error-message`);
|
|
101260
101391
|
},
|
|
101261
101392
|
getFieldDOM: field => document.querySelector(`.${form_constants_cssClasses.PREFIX}-field[x-field-id="${field}"]`)
|
|
101262
101393
|
});
|
|
@@ -101331,9 +101462,10 @@ class baseForm_Form extends baseComponent_BaseComponent {
|
|
|
101331
101462
|
allowEmpty,
|
|
101332
101463
|
autoScrollToError,
|
|
101333
101464
|
showValidateIcon,
|
|
101334
|
-
extraTextPosition
|
|
101465
|
+
extraTextPosition,
|
|
101466
|
+
id
|
|
101335
101467
|
} = _a,
|
|
101336
|
-
rest = baseForm_rest(_a, ["children", "getFormApi", "onChange", "onSubmit", "onSubmitFail", "onValueChange", "component", "render", "validateFields", "initValues", "layout", "style", "className", "labelPosition", "labelWidth", "labelAlign", "labelCol", "wrapperCol", "allowEmpty", "autoScrollToError", "showValidateIcon", "extraTextPosition"]);
|
|
101468
|
+
rest = baseForm_rest(_a, ["children", "getFormApi", "onChange", "onSubmit", "onSubmitFail", "onValueChange", "component", "render", "validateFields", "initValues", "layout", "style", "className", "labelPosition", "labelWidth", "labelAlign", "labelCol", "wrapperCol", "allowEmpty", "autoScrollToError", "showValidateIcon", "extraTextPosition", "id"]);
|
|
101337
101469
|
|
|
101338
101470
|
const formCls = classnames_default()(baseForm_prefix, className, {
|
|
101339
101471
|
[baseForm_prefix + '-vertical']: layout === 'vertical',
|
|
@@ -101346,7 +101478,7 @@ class baseForm_Form extends baseComponent_BaseComponent {
|
|
|
101346
101478
|
onReset: this.reset,
|
|
101347
101479
|
onSubmit: this.submit,
|
|
101348
101480
|
className: formCls,
|
|
101349
|
-
"x-form-id": formId
|
|
101481
|
+
"x-form-id": id ? id : formId
|
|
101350
101482
|
}), this.content);
|
|
101351
101483
|
const withRowForm = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(grid_row, null, formContent);
|
|
101352
101484
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(FormUpdaterContext.Provider, {
|