@leafer-ui/display 1.9.2 → 1.9.4
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/package.json +8 -8
- package/src/Box.ts +11 -14
- package/types/index.d.ts +1 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/display",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"description": "@leafer-ui/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.9.
|
|
26
|
-
"@leafer-ui/data": "1.9.
|
|
27
|
-
"@leafer-ui/display-module": "1.9.
|
|
28
|
-
"@leafer-ui/decorator": "1.9.
|
|
29
|
-
"@leafer-ui/external": "1.9.
|
|
25
|
+
"@leafer/core": "1.9.4",
|
|
26
|
+
"@leafer-ui/data": "1.9.4",
|
|
27
|
+
"@leafer-ui/display-module": "1.9.4",
|
|
28
|
+
"@leafer-ui/decorator": "1.9.4",
|
|
29
|
+
"@leafer-ui/external": "1.9.4"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@leafer/interface": "1.9.
|
|
33
|
-
"@leafer-ui/interface": "1.9.
|
|
32
|
+
"@leafer/interface": "1.9.4",
|
|
33
|
+
"@leafer-ui/interface": "1.9.4"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/Box.ts
CHANGED
|
@@ -40,7 +40,7 @@ export class Box extends Group implements IBox {
|
|
|
40
40
|
|
|
41
41
|
public isOverflow?: boolean
|
|
42
42
|
|
|
43
|
-
// scroller rewrite
|
|
43
|
+
// scroller will rewrite
|
|
44
44
|
public scrollConfig?: IScrollConfig
|
|
45
45
|
|
|
46
46
|
public scroller?: IScroller
|
|
@@ -99,39 +99,36 @@ export class Box extends Group implements IBox {
|
|
|
99
99
|
public __updateStrokeBounds(): void { }
|
|
100
100
|
|
|
101
101
|
public __updateRenderBounds(): void {
|
|
102
|
-
let isOverflow: boolean
|
|
102
|
+
let isOverflow: boolean, isScrollMode: boolean
|
|
103
103
|
|
|
104
104
|
if (this.children.length) {
|
|
105
|
-
const data = this.__, layout = this.__layout, { renderBounds, boxBounds } = layout
|
|
105
|
+
const data = this.__, layout = this.__layout, { renderBounds, boxBounds } = layout, { overflow } = data
|
|
106
106
|
|
|
107
107
|
const childrenRenderBounds = layout.childrenRenderBounds || (layout.childrenRenderBounds = getBoundsData())
|
|
108
108
|
super.__updateRenderBounds(childrenRenderBounds)
|
|
109
|
-
|
|
109
|
+
|
|
110
|
+
if (isScrollMode = overflow.includes('scroll')) { // 检查滚动逻辑
|
|
111
|
+
add(childrenRenderBounds, boxBounds)
|
|
112
|
+
scroll(childrenRenderBounds, data as IScrollPointData)
|
|
113
|
+
}
|
|
110
114
|
|
|
111
115
|
this.__updateRectRenderBounds()
|
|
112
116
|
|
|
113
117
|
isOverflow = !includes(boxBounds, childrenRenderBounds)
|
|
114
|
-
if (isOverflow &&
|
|
118
|
+
if (isOverflow && overflow === 'show') add(renderBounds, childrenRenderBounds)
|
|
115
119
|
} else this.__updateRectRenderBounds()
|
|
116
120
|
|
|
117
121
|
DataHelper.stintSet(this, 'isOverflow', isOverflow)
|
|
118
122
|
|
|
119
|
-
this.__checkScroll()
|
|
123
|
+
this.__checkScroll(isScrollMode)
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
@rewrite(rect.__updateRenderBounds)
|
|
123
127
|
public __updateRectRenderBounds(): void { }
|
|
124
128
|
|
|
125
|
-
public __updateWorldBounds(): void {
|
|
126
|
-
if (this.hasScroller) this.__updateScroll()
|
|
127
|
-
super.__updateWorldBounds()
|
|
128
|
-
}
|
|
129
|
-
|
|
130
129
|
|
|
131
130
|
// scroller will rewrite
|
|
132
|
-
public __checkScroll(): void { }
|
|
133
|
-
|
|
134
|
-
public __updateScroll(): void { }
|
|
131
|
+
public __checkScroll(_isScrollMode: boolean): void { }
|
|
135
132
|
|
|
136
133
|
|
|
137
134
|
@rewrite(rect.__updateChange)
|
package/types/index.d.ts
CHANGED
|
@@ -298,9 +298,7 @@ declare class Box extends Group implements IBox {
|
|
|
298
298
|
__updateStrokeBounds(): void;
|
|
299
299
|
__updateRenderBounds(): void;
|
|
300
300
|
__updateRectRenderBounds(): void;
|
|
301
|
-
|
|
302
|
-
__checkScroll(): void;
|
|
303
|
-
__updateScroll(): void;
|
|
301
|
+
__checkScroll(_isScrollMode: boolean): void;
|
|
304
302
|
__updateRectChange(): void;
|
|
305
303
|
__updateChange(): void;
|
|
306
304
|
__renderRect(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
|