@douyinfe/semi-ui 2.23.0 → 2.23.1
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 +6 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +49 -76
- 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/locale/source/vi_VN.js +1 -1
- package/lib/cjs/modal/Modal.js +6 -19
- package/lib/cjs/sideSheet/index.js +6 -19
- package/lib/cjs/tagInput/index.js +2 -0
- package/lib/cjs/transfer/index.js +30 -25
- package/lib/es/locale/source/vi_VN.js +1 -1
- package/lib/es/modal/Modal.js +6 -19
- package/lib/es/sideSheet/index.js +6 -19
- package/lib/es/tagInput/index.js +2 -0
- package/lib/es/transfer/index.js +30 -25
- package/package.json +7 -7
package/dist/umd/semi-ui.js
CHANGED
|
@@ -43518,8 +43518,8 @@ function sortableElement(WrappedComponent) {
|
|
|
43518
43518
|
|
|
43519
43519
|
|
|
43520
43520
|
|
|
43521
|
-
const
|
|
43522
|
-
const
|
|
43521
|
+
const SortableItem = sortableElement(props => props.item);
|
|
43522
|
+
const SortableList = sortableContainer(_ref => {
|
|
43523
43523
|
let {
|
|
43524
43524
|
items
|
|
43525
43525
|
} = _ref;
|
|
@@ -43531,7 +43531,7 @@ const tagInput_SortableList = sortableContainer(_ref => {
|
|
|
43531
43531
|
}, items.map((item, index) =>
|
|
43532
43532
|
/*#__PURE__*/
|
|
43533
43533
|
// @ts-ignore skip SortableItem type check
|
|
43534
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
|
43534
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(SortableItem, {
|
|
43535
43535
|
key: item.key,
|
|
43536
43536
|
index: index,
|
|
43537
43537
|
item: item.item
|
|
@@ -43920,9 +43920,11 @@ class tagInput_TagInput extends baseComponent_BaseComponent {
|
|
|
43920
43920
|
}));
|
|
43921
43921
|
|
|
43922
43922
|
if (active && draggable && sortableListItems.length > 0) {
|
|
43923
|
+
// helperClass:add styles to the helper(item being dragged) https://github.com/clauderic/react-sortable-hoc/issues/87
|
|
43923
43924
|
// @ts-ignore skip SortableItem type check
|
|
43924
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
|
43925
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(SortableList, {
|
|
43925
43926
|
useDragHandle: true,
|
|
43927
|
+
helperClass: "".concat(tagInput_prefixCls, "-drag-item-move"),
|
|
43926
43928
|
items: sortableListItems,
|
|
43927
43929
|
onSortEnd: this.onSortEnd,
|
|
43928
43930
|
axis: "xy"
|
|
@@ -59060,10 +59062,6 @@ class modalFoundation_ModalFoundation extends foundation {
|
|
|
59060
59062
|
this.toggleDisplayNone = (displayNone, callback) => {
|
|
59061
59063
|
this._adapter.toggleDisplayNone(displayNone, callback);
|
|
59062
59064
|
};
|
|
59063
|
-
|
|
59064
|
-
this.setShouldRender = shouldRender => {
|
|
59065
|
-
this._adapter.setShouldRender(shouldRender);
|
|
59066
|
-
};
|
|
59067
59065
|
}
|
|
59068
59066
|
|
|
59069
59067
|
destroy() {
|
|
@@ -60026,8 +60024,6 @@ class Modal_Modal extends baseComponent_BaseComponent {
|
|
|
60026
60024
|
visible
|
|
60027
60025
|
} = this.props;
|
|
60028
60026
|
this.foundation.toggleDisplayNone(!visible);
|
|
60029
|
-
const shouldRender = this.props.visible || this.props.keepDOM && (!this.props.lazyRender || this._haveRendered);
|
|
60030
|
-
this.foundation.setShouldRender(shouldRender);
|
|
60031
60027
|
};
|
|
60032
60028
|
|
|
60033
60029
|
this.renderFooter = () => {
|
|
@@ -60109,8 +60105,11 @@ class Modal_Modal extends baseComponent_BaseComponent {
|
|
|
60109
60105
|
const classList = classnames_default()(className, {
|
|
60110
60106
|
["".concat(modal_constants_cssClasses.DIALOG, "-displayNone")]: keepDOM && this.state.displayNone
|
|
60111
60107
|
});
|
|
60108
|
+
const shouldRender = this.props.visible || this.props.keepDOM && (!this.props.lazyRender || this._haveRendered) || this.props.motion && !this.state.displayNone
|
|
60109
|
+
/* When there is animation, we use displayNone to judge whether animation is ended and judge whether to unmount content */
|
|
60110
|
+
;
|
|
60112
60111
|
|
|
60113
|
-
if (
|
|
60112
|
+
if (shouldRender) {
|
|
60114
60113
|
this._haveRendered = true;
|
|
60115
60114
|
}
|
|
60116
60115
|
|
|
@@ -60141,7 +60140,7 @@ class Modal_Modal extends baseComponent_BaseComponent {
|
|
|
60141
60140
|
animationClassName: maskAnimationClassName,
|
|
60142
60141
|
animationEventsNeedBind: maskAnimationEventsNeedBind
|
|
60143
60142
|
} = _ref2;
|
|
60144
|
-
return
|
|
60143
|
+
return shouldRender ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ModalContent_ModalContent, Object.assign({}, restProps, {
|
|
60145
60144
|
contentExtraProps: animationEventsNeedBind,
|
|
60146
60145
|
maskExtraProps: maskAnimationEventsNeedBind,
|
|
60147
60146
|
isFullScreen: this.state.isFullScreen,
|
|
@@ -60161,8 +60160,7 @@ class Modal_Modal extends baseComponent_BaseComponent {
|
|
|
60161
60160
|
|
|
60162
60161
|
this.state = {
|
|
60163
60162
|
displayNone: !props.visible,
|
|
60164
|
-
isFullScreen: props.fullScreen
|
|
60165
|
-
shouldRender: this.props.visible || this.props.keepDOM && !this.props.lazyRender
|
|
60163
|
+
isFullScreen: props.fullScreen
|
|
60166
60164
|
};
|
|
60167
60165
|
this.foundation = new modalFoundation_ModalFoundation(this.adapter);
|
|
60168
60166
|
this.modalRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
@@ -60217,13 +60215,6 @@ class Modal_Modal extends baseComponent_BaseComponent {
|
|
|
60217
60215
|
isFullScreen
|
|
60218
60216
|
});
|
|
60219
60217
|
}
|
|
60220
|
-
},
|
|
60221
|
-
setShouldRender: shouldRender => {
|
|
60222
|
-
if (shouldRender !== this.state.shouldRender) {
|
|
60223
|
-
this.setState({
|
|
60224
|
-
shouldRender
|
|
60225
|
-
});
|
|
60226
|
-
}
|
|
60227
60218
|
}
|
|
60228
60219
|
});
|
|
60229
60220
|
}
|
|
@@ -60269,12 +60260,6 @@ class Modal_Modal extends baseComponent_BaseComponent {
|
|
|
60269
60260
|
this.foundation.beforeShow();
|
|
60270
60261
|
}
|
|
60271
60262
|
|
|
60272
|
-
const shouldRender = this.props.visible || this.props.keepDOM && (!this.props.lazyRender || this._haveRendered);
|
|
60273
|
-
|
|
60274
|
-
if (shouldRender === true && this.state.shouldRender === false) {
|
|
60275
|
-
this.foundation.setShouldRender(true);
|
|
60276
|
-
}
|
|
60277
|
-
|
|
60278
60263
|
if (!prevState.displayNone && this.state.displayNone) {
|
|
60279
60264
|
this.foundation.afterHide();
|
|
60280
60265
|
}
|
|
@@ -76248,10 +76233,6 @@ class sideSheetFoundation_SideSheetFoundation extends foundation {
|
|
|
76248
76233
|
}
|
|
76249
76234
|
}
|
|
76250
76235
|
|
|
76251
|
-
setShouldRender(shouldRender) {
|
|
76252
|
-
this._adapter.setShouldRender(shouldRender);
|
|
76253
|
-
}
|
|
76254
|
-
|
|
76255
76236
|
onVisibleChange(visible) {
|
|
76256
76237
|
this._adapter.notifyVisibleChange(visible);
|
|
76257
76238
|
}
|
|
@@ -76303,14 +76284,11 @@ class sideSheet_SideSheet extends baseComponent_BaseComponent {
|
|
|
76303
76284
|
};
|
|
76304
76285
|
|
|
76305
76286
|
this.updateState = () => {
|
|
76306
|
-
const shouldRender = this.props.visible || this.props.keepDOM;
|
|
76307
|
-
this.foundation.setShouldRender(shouldRender);
|
|
76308
76287
|
this.foundation.toggleDisplayNone(!this.props.visible);
|
|
76309
76288
|
};
|
|
76310
76289
|
|
|
76311
76290
|
this.state = {
|
|
76312
|
-
displayNone: !this.props.visible
|
|
76313
|
-
shouldRender: this.props.visible
|
|
76291
|
+
displayNone: !this.props.visible
|
|
76314
76292
|
};
|
|
76315
76293
|
this.foundation = new sideSheetFoundation_SideSheetFoundation(this.adapter);
|
|
76316
76294
|
}
|
|
@@ -76357,13 +76335,6 @@ class sideSheet_SideSheet extends baseComponent_BaseComponent {
|
|
|
76357
76335
|
displayNone: displayNone
|
|
76358
76336
|
});
|
|
76359
76337
|
}
|
|
76360
|
-
},
|
|
76361
|
-
setShouldRender: shouldRender => {
|
|
76362
|
-
if (shouldRender !== this.state.shouldRender) {
|
|
76363
|
-
this.setState({
|
|
76364
|
-
shouldRender
|
|
76365
|
-
});
|
|
76366
|
-
}
|
|
76367
76338
|
}
|
|
76368
76339
|
});
|
|
76369
76340
|
}
|
|
@@ -76399,12 +76370,6 @@ class sideSheet_SideSheet extends baseComponent_BaseComponent {
|
|
|
76399
76370
|
this.foundation.afterHide();
|
|
76400
76371
|
}
|
|
76401
76372
|
|
|
76402
|
-
const shouldRender = this.props.visible || this.props.keepDOM;
|
|
76403
|
-
|
|
76404
|
-
if (shouldRender === true && this.state.shouldRender === false) {
|
|
76405
|
-
this.foundation.setShouldRender(true);
|
|
76406
|
-
}
|
|
76407
|
-
|
|
76408
76373
|
if (prevState.displayNone !== this.state.displayNone) {
|
|
76409
76374
|
this.foundation.onVisibleChange(!this.state.displayNone);
|
|
76410
76375
|
}
|
|
@@ -76456,7 +76421,10 @@ class sideSheet_SideSheet extends baseComponent_BaseComponent {
|
|
|
76456
76421
|
width: sheetWidth,
|
|
76457
76422
|
height: sheetHeight,
|
|
76458
76423
|
onClose: this.handleCancel
|
|
76459
|
-
});
|
|
76424
|
+
});
|
|
76425
|
+
const shouldRender = this.props.visible || this.props.keepDOM || this.props.motion && !this.state.displayNone
|
|
76426
|
+
/* When there is animation, we use displayNone to judge whether animation is ended and judge whether to unmount content */
|
|
76427
|
+
; // Since user could change animate duration , we don't know which animation end first. So we call updateState func twice.
|
|
76460
76428
|
|
|
76461
76429
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(_cssAnimation, {
|
|
76462
76430
|
motion: this.props.motion,
|
|
@@ -76481,7 +76449,7 @@ class sideSheet_SideSheet extends baseComponent_BaseComponent {
|
|
|
76481
76449
|
animationStyle,
|
|
76482
76450
|
animationEventsNeedBind
|
|
76483
76451
|
} = _ref2;
|
|
76484
|
-
return
|
|
76452
|
+
return shouldRender ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(SideSheetContent_SideSheetContent, Object.assign({}, contentProps, {
|
|
76485
76453
|
maskExtraProps: maskAnimationEventsNeedBind,
|
|
76486
76454
|
wrapperExtraProps: animationEventsNeedBind,
|
|
76487
76455
|
dialogClassName: animationClassName,
|
|
@@ -97243,7 +97211,30 @@ var transfer = __webpack_require__("mo0a");
|
|
|
97243
97211
|
|
|
97244
97212
|
|
|
97245
97213
|
|
|
97246
|
-
const transfer_prefixcls = transfer_constants_cssClasses.PREFIX;
|
|
97214
|
+
const transfer_prefixcls = transfer_constants_cssClasses.PREFIX; // SortableItem & SortableList should not be assigned inside of the render function
|
|
97215
|
+
|
|
97216
|
+
const transfer_SortableItem = sortableElement(props => props.item.node);
|
|
97217
|
+
const transfer_SortableList = sortableContainer(_ref => {
|
|
97218
|
+
let {
|
|
97219
|
+
items
|
|
97220
|
+
} = _ref;
|
|
97221
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
97222
|
+
className: "".concat(transfer_prefixcls, "-right-list"),
|
|
97223
|
+
role: "list",
|
|
97224
|
+
"aria-label": "Selected list"
|
|
97225
|
+
}, items.map((item, index) =>
|
|
97226
|
+
/*#__PURE__*/
|
|
97227
|
+
// @ts-ignore skip SortableItem type check
|
|
97228
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(transfer_SortableItem, {
|
|
97229
|
+
key: item.label,
|
|
97230
|
+
index: index,
|
|
97231
|
+
item: item
|
|
97232
|
+
}))) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
97233
|
+
// @ts-ignore see reasons: https://github.com/clauderic/react-sortable-hoc/issues/206
|
|
97234
|
+
;
|
|
97235
|
+
}, {
|
|
97236
|
+
distance: 10
|
|
97237
|
+
});
|
|
97247
97238
|
|
|
97248
97239
|
class transfer_Transfer extends baseComponent_BaseComponent {
|
|
97249
97240
|
constructor(props) {
|
|
@@ -97686,34 +97677,16 @@ class transfer_Transfer extends baseComponent_BaseComponent {
|
|
|
97686
97677
|
}
|
|
97687
97678
|
|
|
97688
97679
|
renderRightSortableList(selectedData) {
|
|
97689
|
-
|
|
97690
|
-
|
|
97691
|
-
|
|
97692
|
-
|
|
97693
|
-
items
|
|
97694
|
-
} = _ref;
|
|
97695
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
97696
|
-
className: "".concat(transfer_prefixcls, "-right-list"),
|
|
97697
|
-
role: "list",
|
|
97698
|
-
"aria-label": "Selected list"
|
|
97699
|
-
}, items.map((item, index) =>
|
|
97700
|
-
/*#__PURE__*/
|
|
97701
|
-
// @ts-ignore skip SortableItem type check
|
|
97702
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(SortableItem, {
|
|
97703
|
-
key: item.label,
|
|
97704
|
-
index: index,
|
|
97705
|
-
item: item
|
|
97706
|
-
}))) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
97707
|
-
// @ts-ignore see reasons: https://github.com/clauderic/react-sortable-hoc/issues/206
|
|
97708
|
-
;
|
|
97709
|
-
}, {
|
|
97710
|
-
distance: 10
|
|
97711
|
-
}); // @ts-ignore skip SortableItem type check
|
|
97680
|
+
const sortableListItems = selectedData.map(item => Object.assign(Object.assign({}, item), {
|
|
97681
|
+
node: this.renderRightItem(item)
|
|
97682
|
+
})); // helperClass:add styles to the helper(item being dragged) https://github.com/clauderic/react-sortable-hoc/issues/87
|
|
97683
|
+
// @ts-ignore skip SortableItem type check
|
|
97712
97684
|
|
|
97713
|
-
const sortList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
|
97685
|
+
const sortList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(transfer_SortableList, {
|
|
97714
97686
|
useDragHandle: true,
|
|
97687
|
+
helperClass: "".concat(transfer_prefixcls, "-right-item-drag-item-move"),
|
|
97715
97688
|
onSortEnd: this.onSortEnd,
|
|
97716
|
-
items:
|
|
97689
|
+
items: sortableListItems
|
|
97717
97690
|
});
|
|
97718
97691
|
return sortList;
|
|
97719
97692
|
}
|