@leafer-ui/display 1.9.3 → 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 +7 -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,15 +99,15 @@ 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 (
|
|
110
|
+
if (isScrollMode = overflow.includes('scroll')) { // 检查滚动逻辑
|
|
111
111
|
add(childrenRenderBounds, boxBounds)
|
|
112
112
|
scroll(childrenRenderBounds, data as IScrollPointData)
|
|
113
113
|
}
|
|
@@ -115,27 +115,20 @@ export class Box extends Group implements IBox {
|
|
|
115
115
|
this.__updateRectRenderBounds()
|
|
116
116
|
|
|
117
117
|
isOverflow = !includes(boxBounds, childrenRenderBounds)
|
|
118
|
-
if (isOverflow &&
|
|
118
|
+
if (isOverflow && overflow === 'show') add(renderBounds, childrenRenderBounds)
|
|
119
119
|
} else this.__updateRectRenderBounds()
|
|
120
120
|
|
|
121
121
|
DataHelper.stintSet(this, 'isOverflow', isOverflow)
|
|
122
122
|
|
|
123
|
-
this.__checkScroll()
|
|
123
|
+
this.__checkScroll(isScrollMode)
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
@rewrite(rect.__updateRenderBounds)
|
|
127
127
|
public __updateRectRenderBounds(): void { }
|
|
128
128
|
|
|
129
|
-
public __updateWorldBounds(): void {
|
|
130
|
-
if (this.hasScroller) this.__updateScroll()
|
|
131
|
-
super.__updateWorldBounds()
|
|
132
|
-
}
|
|
133
|
-
|
|
134
129
|
|
|
135
130
|
// scroller will rewrite
|
|
136
|
-
public __checkScroll(): void { }
|
|
137
|
-
|
|
138
|
-
public __updateScroll(): void { }
|
|
131
|
+
public __checkScroll(_isScrollMode: boolean): void { }
|
|
139
132
|
|
|
140
133
|
|
|
141
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;
|