@douyinfe/semi-ui 2.50.0-beta.0 → 2.50.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 +173 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +29 -18
- 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/image/previewInner.d.ts +1 -1
- package/lib/cjs/image/previewInner.js +5 -2
- package/lib/cjs/tree/treeNode.js +1 -0
- package/lib/es/image/previewInner.d.ts +1 -1
- package/lib/es/image/previewInner.js +5 -2
- package/lib/es/tree/treeNode.js +1 -0
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -88641,6 +88641,7 @@ class TreeNode extends external_root_React_commonjs2_react_commonjs_react_amd_re
|
|
|
88641
88641
|
const dragOverGapBottom = dragOverNodeKey === eventKey && dropPosition === 1;
|
|
88642
88642
|
const nodeCls = classnames_default()(treeNode_prefixcls, {
|
|
88643
88643
|
[`${treeNode_prefixcls}-level-${level + 1}`]: true,
|
|
88644
|
+
[`${treeNode_prefixcls}-fullLabel-level-${level + 1}`]: renderFullLabel,
|
|
88644
88645
|
[`${treeNode_prefixcls}-collapsed`]: !expanded,
|
|
88645
88646
|
[`${treeNode_prefixcls}-disabled`]: Boolean(disabled),
|
|
88646
88647
|
[`${treeNode_prefixcls}-selected`]: selected,
|
|
@@ -99642,7 +99643,9 @@ const DefaultDOMRect = {
|
|
|
99642
99643
|
};
|
|
99643
99644
|
class PreviewImageFoundation extends foundation {
|
|
99644
99645
|
constructor(adapter) {
|
|
99646
|
+
var _this;
|
|
99645
99647
|
super(Object.assign({}, adapter));
|
|
99648
|
+
_this = this;
|
|
99646
99649
|
this.startMouseOffset = {
|
|
99647
99650
|
x: 0,
|
|
99648
99651
|
y: 0
|
|
@@ -99693,7 +99696,9 @@ class PreviewImageFoundation extends foundation {
|
|
|
99693
99696
|
this.setState({
|
|
99694
99697
|
loading: false
|
|
99695
99698
|
});
|
|
99696
|
-
|
|
99699
|
+
// 图片初次加载,计算 zoom,zoom 改变不需要通过回调透出
|
|
99700
|
+
// When the image is loaded for the first time, zoom is calculated, and zoom changes do not need to be exposed through callbacks.
|
|
99701
|
+
this.handleResizeImage(false);
|
|
99697
99702
|
}
|
|
99698
99703
|
const {
|
|
99699
99704
|
src,
|
|
@@ -99711,24 +99716,25 @@ class PreviewImageFoundation extends foundation {
|
|
|
99711
99716
|
});
|
|
99712
99717
|
onError && onError(src);
|
|
99713
99718
|
};
|
|
99714
|
-
this.handleResizeImage = ()
|
|
99715
|
-
|
|
99719
|
+
this.handleResizeImage = function () {
|
|
99720
|
+
let notify = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
99721
|
+
const horizontal = !_this._isImageVertical();
|
|
99716
99722
|
const {
|
|
99717
99723
|
currZoom
|
|
99718
|
-
} =
|
|
99719
|
-
const imgWidth = horizontal ?
|
|
99720
|
-
const imgHeight = horizontal ?
|
|
99724
|
+
} = _this.getStates();
|
|
99725
|
+
const imgWidth = horizontal ? _this.originImageWidth : _this.originImageHeight;
|
|
99726
|
+
const imgHeight = horizontal ? _this.originImageHeight : _this.originImageWidth;
|
|
99721
99727
|
const {
|
|
99722
99728
|
onZoom,
|
|
99723
99729
|
setRatio,
|
|
99724
99730
|
ratio
|
|
99725
|
-
} =
|
|
99726
|
-
const containerDOM =
|
|
99731
|
+
} = _this.getProps();
|
|
99732
|
+
const containerDOM = _this._adapter.getContainer();
|
|
99727
99733
|
if (containerDOM) {
|
|
99728
99734
|
const {
|
|
99729
99735
|
width: containerWidth,
|
|
99730
99736
|
height: containerHeight
|
|
99731
|
-
} =
|
|
99737
|
+
} = _this._getContainerBounds();
|
|
99732
99738
|
const reservedWidth = containerWidth - 80;
|
|
99733
99739
|
const reservedHeight = containerHeight - 80;
|
|
99734
99740
|
let _zoom = 1;
|
|
@@ -99736,9 +99742,9 @@ class PreviewImageFoundation extends foundation {
|
|
|
99736
99742
|
_zoom = Number(Math.min(reservedWidth / imgWidth, reservedHeight / imgHeight).toFixed(2));
|
|
99737
99743
|
}
|
|
99738
99744
|
if (currZoom === _zoom) {
|
|
99739
|
-
|
|
99745
|
+
_this.calculatePreviewImage(_zoom, null);
|
|
99740
99746
|
} else {
|
|
99741
|
-
onZoom(_zoom);
|
|
99747
|
+
onZoom(_zoom, notify);
|
|
99742
99748
|
}
|
|
99743
99749
|
}
|
|
99744
99750
|
};
|
|
@@ -100177,7 +100183,9 @@ const NOT_CLOSE_TARGETS = ["icon", "footer"];
|
|
|
100177
100183
|
const STOP_CLOSE_TARGET = (/* unused pure expression or super */ null && (["icon", "footer", "header"]));
|
|
100178
100184
|
class PreviewInnerFoundation extends foundation {
|
|
100179
100185
|
constructor(adapter) {
|
|
100186
|
+
var _this;
|
|
100180
100187
|
super(Object.assign({}, adapter));
|
|
100188
|
+
_this = this;
|
|
100181
100189
|
this._timer = null;
|
|
100182
100190
|
this._startMouseDown = {
|
|
100183
100191
|
x: 0,
|
|
@@ -100324,7 +100332,6 @@ class PreviewInnerFoundation extends foundation {
|
|
|
100324
100332
|
direction,
|
|
100325
100333
|
rotation: 0
|
|
100326
100334
|
});
|
|
100327
|
-
this._adapter.notifyRotateChange(0);
|
|
100328
100335
|
};
|
|
100329
100336
|
this.handleDownload = () => {
|
|
100330
100337
|
const {
|
|
@@ -100357,13 +100364,14 @@ class PreviewInnerFoundation extends foundation {
|
|
|
100357
100364
|
});
|
|
100358
100365
|
this._adapter.notifyRotateChange(newRotation);
|
|
100359
100366
|
};
|
|
100360
|
-
this.handleZoomImage = newZoom
|
|
100367
|
+
this.handleZoomImage = function (newZoom) {
|
|
100368
|
+
let notify = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
100361
100369
|
const {
|
|
100362
100370
|
zoom
|
|
100363
|
-
} =
|
|
100371
|
+
} = _this.getStates();
|
|
100364
100372
|
if (zoom !== newZoom) {
|
|
100365
|
-
|
|
100366
|
-
|
|
100373
|
+
notify && _this._adapter.notifyZoom(newZoom, newZoom > zoom);
|
|
100374
|
+
_this.setState({
|
|
100367
100375
|
zoom: newZoom
|
|
100368
100376
|
});
|
|
100369
100377
|
}
|
|
@@ -100612,7 +100620,9 @@ class PreviewInner extends BaseComponent {
|
|
|
100612
100620
|
});
|
|
100613
100621
|
}
|
|
100614
100622
|
constructor(props) {
|
|
100623
|
+
var _this;
|
|
100615
100624
|
super(props);
|
|
100625
|
+
_this = this;
|
|
100616
100626
|
this.viewVisibleChange = () => {
|
|
100617
100627
|
this.foundation.handleViewVisibleChange();
|
|
100618
100628
|
};
|
|
@@ -100631,8 +100641,9 @@ class PreviewInner extends BaseComponent {
|
|
|
100631
100641
|
this.handleRotateImage = direction => {
|
|
100632
100642
|
this.foundation.handleRotateImage(direction);
|
|
100633
100643
|
};
|
|
100634
|
-
this.handleZoomImage = newZoom
|
|
100635
|
-
|
|
100644
|
+
this.handleZoomImage = function (newZoom) {
|
|
100645
|
+
let notify = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
100646
|
+
_this.foundation.handleZoomImage(newZoom, notify);
|
|
100636
100647
|
};
|
|
100637
100648
|
this.handleMouseUp = e => {
|
|
100638
100649
|
this.foundation.handleMouseUp(e.nativeEvent);
|