lyb-pixi-js 1.12.18 → 1.12.19
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/Components/Custom/LibPixiArrangeLinearV2.d.ts +23 -0
- package/Components/Custom/LibPixiArrangeLinearV2.js +68 -0
- package/Components/Custom/LibPixiScrollContainerY.d.ts +7 -5
- package/Components/Custom/LibPixiScrollContainerY.js +17 -10
- package/README.md +4 -0
- package/libPixiJs.d.ts +3 -0
- package/libPixiJs.js +3 -0
- package/lyb-pixi.js +183 -94
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Container } from "pixi.js";
|
|
2
|
+
export interface GridLayoutParams {
|
|
3
|
+
gap?: number | number[];
|
|
4
|
+
direction?: "x" | "y";
|
|
5
|
+
colNum?: number;
|
|
6
|
+
elementList?: any[];
|
|
7
|
+
}
|
|
8
|
+
/** @description 线性排列 */
|
|
9
|
+
export declare class LibPixiArrangeLinearV2<T extends Container> extends Container {
|
|
10
|
+
/** 参数 */
|
|
11
|
+
private _params;
|
|
12
|
+
/** 元素列表 */
|
|
13
|
+
private _elementList;
|
|
14
|
+
constructor(params?: GridLayoutParams);
|
|
15
|
+
/** @description 追加元素 */
|
|
16
|
+
push(element: T): void;
|
|
17
|
+
/** @description 布局 */
|
|
18
|
+
layout(): void;
|
|
19
|
+
/** @description 获取列表元素 */
|
|
20
|
+
getList(): T[];
|
|
21
|
+
/** @description 销毁列表元素 */
|
|
22
|
+
destroyList(): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Container } from "pixi.js";
|
|
2
|
+
/** @description 线性排列 */
|
|
3
|
+
export class LibPixiArrangeLinearV2 extends Container {
|
|
4
|
+
constructor(params) {
|
|
5
|
+
super();
|
|
6
|
+
/** 元素列表 */
|
|
7
|
+
this._elementList = [];
|
|
8
|
+
this._params = params || {};
|
|
9
|
+
this._elementList = this._params.elementList || [];
|
|
10
|
+
}
|
|
11
|
+
/** @description 追加元素 */
|
|
12
|
+
push(element) {
|
|
13
|
+
this.addChild(element);
|
|
14
|
+
this._elementList.push(element);
|
|
15
|
+
}
|
|
16
|
+
/** @description 布局 */
|
|
17
|
+
layout() {
|
|
18
|
+
const { colNum = this._elementList.length, gap = 10, direction = "x" } = this._params;
|
|
19
|
+
let lastRowMax = 0; // 当前行(或列)的最大高度(或宽度),用于多行/多列换行时计算偏移
|
|
20
|
+
let rowOffset = 0; // 累计偏移量,控制换行后的整体偏移位置
|
|
21
|
+
this._elementList.forEach((item, index) => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const row = Math.floor(index / colNum); // 当前行号
|
|
24
|
+
const col = index % colNum; // 当前列号
|
|
25
|
+
if (direction === "x") {
|
|
26
|
+
//间隔
|
|
27
|
+
const gapValue = Array.isArray(gap) ? ((_a = gap[index - 1]) !== null && _a !== void 0 ? _a : 0) : gap;
|
|
28
|
+
//在每行第一列重置列偏移量
|
|
29
|
+
if (col === 0 && row > 0) {
|
|
30
|
+
rowOffset += lastRowMax + gapValue;
|
|
31
|
+
lastRowMax = 0;
|
|
32
|
+
}
|
|
33
|
+
// 横向位置 = 前一个元素的右侧 + 间隔;首列则从 0 开始
|
|
34
|
+
item.x = col === 0 ? 0 : this._elementList[index - 1].x + this._elementList[index - 1].width + gapValue;
|
|
35
|
+
// 纵向位置 = 当前累计的行偏移
|
|
36
|
+
rowOffset && (item.y = rowOffset);
|
|
37
|
+
// 更新当前行的最大高度
|
|
38
|
+
lastRowMax = Math.max(lastRowMax, item.height);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
//间隔
|
|
42
|
+
const gapValue = Array.isArray(gap) ? ((_b = gap[index - 1]) !== null && _b !== void 0 ? _b : 0) : gap;
|
|
43
|
+
//在每列第一行重置行偏移
|
|
44
|
+
if (col === 0 && row > 0) {
|
|
45
|
+
rowOffset += lastRowMax + gapValue;
|
|
46
|
+
lastRowMax = 0;
|
|
47
|
+
}
|
|
48
|
+
// 纵向位置 = 首列则从 0 开始,其余从前一个元素的y坐标 + 高度 + 间隔;
|
|
49
|
+
item.y = col === 0 ? 0 : this._elementList[index - 1].y + this._elementList[index - 1].height + gapValue;
|
|
50
|
+
// 横向位置 = 当前累计的列偏移
|
|
51
|
+
rowOffset && (item.x = rowOffset);
|
|
52
|
+
// 更新当前列的最大宽度
|
|
53
|
+
lastRowMax = Math.max(lastRowMax, item.width);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/** @description 获取列表元素 */
|
|
58
|
+
getList() {
|
|
59
|
+
return this._elementList;
|
|
60
|
+
}
|
|
61
|
+
/** @description 销毁列表元素 */
|
|
62
|
+
destroyList() {
|
|
63
|
+
this._elementList.forEach((item) => {
|
|
64
|
+
item.destroy();
|
|
65
|
+
});
|
|
66
|
+
this._elementList = [];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Container } from "pixi.js";
|
|
1
|
+
import { Container, Texture } from "pixi.js";
|
|
2
2
|
import { LibPixiContainer } from "../Base/LibPixiContainer";
|
|
3
3
|
export interface LibPixiScrollContainerYParams {
|
|
4
4
|
/** 宽度 */
|
|
@@ -7,10 +7,6 @@ export interface LibPixiScrollContainerYParams {
|
|
|
7
7
|
height: number;
|
|
8
8
|
/** 滚动内容 */
|
|
9
9
|
scrollContent: Container;
|
|
10
|
-
/** 顶部边距 */
|
|
11
|
-
topMargin?: number;
|
|
12
|
-
/** 底部边距 */
|
|
13
|
-
bottomMargin?: number;
|
|
14
10
|
/** 背景色,用于定位 */
|
|
15
11
|
bgColor?: string;
|
|
16
12
|
/** 是否需要滚动条 */
|
|
@@ -21,6 +17,12 @@ export interface LibPixiScrollContainerYParams {
|
|
|
21
17
|
scrollbarWidth?: number;
|
|
22
18
|
/** 滚动条颜色 */
|
|
23
19
|
scrollbarColor?: string;
|
|
20
|
+
/** 自定义遮罩贴图 */
|
|
21
|
+
maskTexture?: Texture;
|
|
22
|
+
/** 遮罩X坐标 */
|
|
23
|
+
maskX?: number;
|
|
24
|
+
/** 遮罩Y坐标 */
|
|
25
|
+
maskY?: number;
|
|
24
26
|
/** 滚动触发 */
|
|
25
27
|
onScroll?: (y: number) => void;
|
|
26
28
|
}
|
|
@@ -8,7 +8,7 @@ import { LibPixiRectangle } from "../Base/LibPixiRectangle";
|
|
|
8
8
|
*/
|
|
9
9
|
export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
10
10
|
constructor(params) {
|
|
11
|
-
const { width, height, scrollbar = false, scrollContent, scrollbarRgiht = 0, scrollbarWidth = 10, scrollbarColor = "#ffffff", onScroll, bgColor, } = params;
|
|
11
|
+
const { width, height, scrollbar = false, scrollContent, scrollbarRgiht = 0, scrollbarWidth = 10, scrollbarColor = "#ffffff", onScroll, bgColor, maskTexture, maskX = 0, maskY = 0, } = params;
|
|
12
12
|
super(width, height, bgColor);
|
|
13
13
|
/** 开始位置 */
|
|
14
14
|
this._startY = 0;
|
|
@@ -36,10 +36,20 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
36
36
|
this._content = new Container();
|
|
37
37
|
this.addChild(this._content);
|
|
38
38
|
this._content.addChild(this._scrollContent);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
//自定义遮罩
|
|
40
|
+
if (maskTexture) {
|
|
41
|
+
this._maskGraphics = new Sprite(maskTexture);
|
|
42
|
+
this.addChild(this._maskGraphics);
|
|
43
|
+
this._maskGraphics.width = width;
|
|
44
|
+
this._maskGraphics.height = height;
|
|
45
|
+
this._maskGraphics.position.set(maskX, maskY);
|
|
46
|
+
this.mask = this._maskGraphics;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this._maskGraphics = new LibPixiRectangle(width, height, "#000");
|
|
50
|
+
this.addChild(this._maskGraphics);
|
|
51
|
+
this.mask = this._maskGraphics;
|
|
52
|
+
}
|
|
43
53
|
// 创建滚动条
|
|
44
54
|
this._scrollbar = new LibPixiRectangle(scrollbarWidth, height, this._scrollbarColor);
|
|
45
55
|
this._scrollbar.x = width - (scrollbarRgiht || scrollbarWidth);
|
|
@@ -104,11 +114,8 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
104
114
|
* @param height 高度
|
|
105
115
|
*/
|
|
106
116
|
setDimensions(width, height) {
|
|
107
|
-
|
|
108
|
-
this._maskGraphics.
|
|
109
|
-
this._maskGraphics.beginFill(0x000000);
|
|
110
|
-
this._maskGraphics.drawRect(0, 0, width, height);
|
|
111
|
-
this._maskGraphics.endFill();
|
|
117
|
+
this._maskGraphics.width = width;
|
|
118
|
+
this._maskGraphics.height = height;
|
|
112
119
|
this.setSize(width, height);
|
|
113
120
|
this._scrollbar.x = width - (this._scrollbarRgiht || this._scrollbarWidth);
|
|
114
121
|
}
|
package/README.md
CHANGED
package/libPixiJs.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ import { LibPixiRoundedRect } from "./Components/Base/LibPixiRoundedRect";
|
|
|
35
35
|
import { LibPixiInput } from "./Components/Custom/LibPixiInput";
|
|
36
36
|
import { LibPixiGridLayoutV2 } from "./Utils/LibPixiGridLayoutV2";
|
|
37
37
|
import { LibPixiTicker } from "./Utils/LibPixiTicker";
|
|
38
|
+
import { LibPixiArrangeLinearV2 } from "./Components/Custom/LibPixiArrangeLinearV2";
|
|
38
39
|
/** @description 组件 */
|
|
39
40
|
export declare const Components: {
|
|
40
41
|
Base: {
|
|
@@ -150,6 +151,8 @@ export declare const Components: {
|
|
|
150
151
|
LibPixiTurntable: (num: number, distance: number, layoutCallback: (x: number, y: number, rotation: number, index: number) => void) => void;
|
|
151
152
|
/** @description 输入框 */
|
|
152
153
|
LibPixiInput: typeof LibPixiInput;
|
|
154
|
+
/** @description 线性排列 */
|
|
155
|
+
LibPixiArrangeLinearV2: typeof LibPixiArrangeLinearV2;
|
|
153
156
|
};
|
|
154
157
|
};
|
|
155
158
|
/** @description 方法 */
|
package/libPixiJs.js
CHANGED
|
@@ -54,6 +54,7 @@ import { LibPixiRoundedRect } from "./Components/Base/LibPixiRoundedRect";
|
|
|
54
54
|
import { LibPixiInput } from "./Components/Custom/LibPixiInput";
|
|
55
55
|
import { LibPixiGridLayoutV2 } from "./Utils/LibPixiGridLayoutV2";
|
|
56
56
|
import { LibPixiTicker } from "./Utils/LibPixiTicker";
|
|
57
|
+
import { LibPixiArrangeLinearV2 } from "./Components/Custom/LibPixiArrangeLinearV2";
|
|
57
58
|
/** @description 组件 */
|
|
58
59
|
export const Components = {
|
|
59
60
|
Base: {
|
|
@@ -169,6 +170,8 @@ export const Components = {
|
|
|
169
170
|
LibPixiTurntable,
|
|
170
171
|
/** @description 输入框 */
|
|
171
172
|
LibPixiInput,
|
|
173
|
+
/** @description 线性排列 */
|
|
174
|
+
LibPixiArrangeLinearV2,
|
|
172
175
|
},
|
|
173
176
|
};
|
|
174
177
|
/** @description 方法 */
|
package/lyb-pixi.js
CHANGED
|
@@ -1315,7 +1315,7 @@
|
|
|
1315
1315
|
var ys = arrObjKeys(obj, inspect2);
|
|
1316
1316
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
1317
1317
|
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
1318
|
-
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr
|
|
1318
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
|
|
1319
1319
|
var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
|
|
1320
1320
|
var tag2 = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
1321
1321
|
if (ys.length === 0) {
|
|
@@ -1337,25 +1337,25 @@
|
|
|
1337
1337
|
return $replace$1.call(String(s2), /"/g, """);
|
|
1338
1338
|
}
|
|
1339
1339
|
function isArray$3(obj) {
|
|
1340
|
-
return toStr
|
|
1340
|
+
return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1341
1341
|
}
|
|
1342
1342
|
function isDate(obj) {
|
|
1343
|
-
return toStr
|
|
1343
|
+
return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1344
1344
|
}
|
|
1345
1345
|
function isRegExp$1(obj) {
|
|
1346
|
-
return toStr
|
|
1346
|
+
return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1347
1347
|
}
|
|
1348
1348
|
function isError(obj) {
|
|
1349
|
-
return toStr
|
|
1349
|
+
return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1350
1350
|
}
|
|
1351
1351
|
function isString(obj) {
|
|
1352
|
-
return toStr
|
|
1352
|
+
return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1353
1353
|
}
|
|
1354
1354
|
function isNumber(obj) {
|
|
1355
|
-
return toStr
|
|
1355
|
+
return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1356
1356
|
}
|
|
1357
1357
|
function isBoolean(obj) {
|
|
1358
|
-
return toStr
|
|
1358
|
+
return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1359
1359
|
}
|
|
1360
1360
|
function isSymbol(obj) {
|
|
1361
1361
|
if (hasShammedSymbols) {
|
|
@@ -1391,7 +1391,7 @@
|
|
|
1391
1391
|
function has$3(obj, key) {
|
|
1392
1392
|
return hasOwn$1.call(obj, key);
|
|
1393
1393
|
}
|
|
1394
|
-
function toStr
|
|
1394
|
+
function toStr(obj) {
|
|
1395
1395
|
return objectToString.call(obj);
|
|
1396
1396
|
}
|
|
1397
1397
|
function nameOf(f2) {
|
|
@@ -1700,7 +1700,7 @@
|
|
|
1700
1700
|
var uri = URIError;
|
|
1701
1701
|
var abs$2 = Math.abs;
|
|
1702
1702
|
var floor$2 = Math.floor;
|
|
1703
|
-
var max$
|
|
1703
|
+
var max$2 = Math.max;
|
|
1704
1704
|
var min$2 = Math.min;
|
|
1705
1705
|
var pow$2 = Math.pow;
|
|
1706
1706
|
var round$3 = Math.round;
|
|
@@ -1833,78 +1833,102 @@
|
|
|
1833
1833
|
Object_getPrototypeOf = $Object2.getPrototypeOf || null;
|
|
1834
1834
|
return Object_getPrototypeOf;
|
|
1835
1835
|
}
|
|
1836
|
-
var
|
|
1837
|
-
var
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
var slicy = function slicy2(arrLike, offset) {
|
|
1851
|
-
var arr = [];
|
|
1852
|
-
for (var i2 = offset || 0, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
|
|
1853
|
-
arr[j2] = arrLike[i2];
|
|
1854
|
-
}
|
|
1855
|
-
return arr;
|
|
1856
|
-
};
|
|
1857
|
-
var joiny = function(arr, joiner) {
|
|
1858
|
-
var str = "";
|
|
1859
|
-
for (var i2 = 0; i2 < arr.length; i2 += 1) {
|
|
1860
|
-
str += arr[i2];
|
|
1861
|
-
if (i2 + 1 < arr.length) {
|
|
1862
|
-
str += joiner;
|
|
1836
|
+
var implementation;
|
|
1837
|
+
var hasRequiredImplementation;
|
|
1838
|
+
function requireImplementation() {
|
|
1839
|
+
if (hasRequiredImplementation)
|
|
1840
|
+
return implementation;
|
|
1841
|
+
hasRequiredImplementation = 1;
|
|
1842
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
1843
|
+
var toStr2 = Object.prototype.toString;
|
|
1844
|
+
var max2 = Math.max;
|
|
1845
|
+
var funcType = "[object Function]";
|
|
1846
|
+
var concatty = function concatty2(a2, b2) {
|
|
1847
|
+
var arr = [];
|
|
1848
|
+
for (var i2 = 0; i2 < a2.length; i2 += 1) {
|
|
1849
|
+
arr[i2] = a2[i2];
|
|
1863
1850
|
}
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
if (
|
|
1881
|
-
|
|
1851
|
+
for (var j2 = 0; j2 < b2.length; j2 += 1) {
|
|
1852
|
+
arr[j2 + a2.length] = b2[j2];
|
|
1853
|
+
}
|
|
1854
|
+
return arr;
|
|
1855
|
+
};
|
|
1856
|
+
var slicy = function slicy2(arrLike, offset) {
|
|
1857
|
+
var arr = [];
|
|
1858
|
+
for (var i2 = offset || 0, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
|
|
1859
|
+
arr[j2] = arrLike[i2];
|
|
1860
|
+
}
|
|
1861
|
+
return arr;
|
|
1862
|
+
};
|
|
1863
|
+
var joiny = function(arr, joiner) {
|
|
1864
|
+
var str = "";
|
|
1865
|
+
for (var i2 = 0; i2 < arr.length; i2 += 1) {
|
|
1866
|
+
str += arr[i2];
|
|
1867
|
+
if (i2 + 1 < arr.length) {
|
|
1868
|
+
str += joiner;
|
|
1882
1869
|
}
|
|
1883
|
-
return this;
|
|
1884
1870
|
}
|
|
1885
|
-
return
|
|
1886
|
-
that,
|
|
1887
|
-
concatty(args, arguments)
|
|
1888
|
-
);
|
|
1871
|
+
return str;
|
|
1889
1872
|
};
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
var
|
|
1873
|
+
implementation = function bind2(that) {
|
|
1874
|
+
var target = this;
|
|
1875
|
+
if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
|
|
1876
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
1877
|
+
}
|
|
1878
|
+
var args = slicy(arguments, 1);
|
|
1879
|
+
var bound;
|
|
1880
|
+
var binder = function() {
|
|
1881
|
+
if (this instanceof bound) {
|
|
1882
|
+
var result = target.apply(
|
|
1883
|
+
this,
|
|
1884
|
+
concatty(args, arguments)
|
|
1885
|
+
);
|
|
1886
|
+
if (Object(result) === result) {
|
|
1887
|
+
return result;
|
|
1888
|
+
}
|
|
1889
|
+
return this;
|
|
1890
|
+
}
|
|
1891
|
+
return target.apply(
|
|
1892
|
+
that,
|
|
1893
|
+
concatty(args, arguments)
|
|
1894
|
+
);
|
|
1898
1895
|
};
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1896
|
+
var boundLength = max2(0, target.length - args.length);
|
|
1897
|
+
var boundArgs = [];
|
|
1898
|
+
for (var i2 = 0; i2 < boundLength; i2++) {
|
|
1899
|
+
boundArgs[i2] = "$" + i2;
|
|
1900
|
+
}
|
|
1901
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
1902
|
+
if (target.prototype) {
|
|
1903
|
+
var Empty = function Empty2() {
|
|
1904
|
+
};
|
|
1905
|
+
Empty.prototype = target.prototype;
|
|
1906
|
+
bound.prototype = new Empty();
|
|
1907
|
+
Empty.prototype = null;
|
|
1908
|
+
}
|
|
1909
|
+
return bound;
|
|
1910
|
+
};
|
|
1911
|
+
return implementation;
|
|
1912
|
+
}
|
|
1913
|
+
var functionBind;
|
|
1914
|
+
var hasRequiredFunctionBind;
|
|
1915
|
+
function requireFunctionBind() {
|
|
1916
|
+
if (hasRequiredFunctionBind)
|
|
1917
|
+
return functionBind;
|
|
1918
|
+
hasRequiredFunctionBind = 1;
|
|
1919
|
+
var implementation2 = requireImplementation();
|
|
1920
|
+
functionBind = Function.prototype.bind || implementation2;
|
|
1921
|
+
return functionBind;
|
|
1922
|
+
}
|
|
1923
|
+
var functionCall;
|
|
1924
|
+
var hasRequiredFunctionCall;
|
|
1925
|
+
function requireFunctionCall() {
|
|
1926
|
+
if (hasRequiredFunctionCall)
|
|
1927
|
+
return functionCall;
|
|
1928
|
+
hasRequiredFunctionCall = 1;
|
|
1929
|
+
functionCall = Function.prototype.call;
|
|
1930
|
+
return functionCall;
|
|
1931
|
+
}
|
|
1908
1932
|
var functionApply;
|
|
1909
1933
|
var hasRequiredFunctionApply;
|
|
1910
1934
|
function requireFunctionApply() {
|
|
@@ -1915,14 +1939,14 @@
|
|
|
1915
1939
|
return functionApply;
|
|
1916
1940
|
}
|
|
1917
1941
|
var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
|
|
1918
|
-
var bind$2 =
|
|
1942
|
+
var bind$2 = requireFunctionBind();
|
|
1919
1943
|
var $apply$1 = requireFunctionApply();
|
|
1920
|
-
var $call$2 =
|
|
1944
|
+
var $call$2 = requireFunctionCall();
|
|
1921
1945
|
var $reflectApply = reflectApply;
|
|
1922
1946
|
var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
|
|
1923
|
-
var bind$1 =
|
|
1947
|
+
var bind$1 = requireFunctionBind();
|
|
1924
1948
|
var $TypeError$4 = type;
|
|
1925
|
-
var $call$1 =
|
|
1949
|
+
var $call$1 = requireFunctionCall();
|
|
1926
1950
|
var $actualApply = actualApply;
|
|
1927
1951
|
var callBindApplyHelpers = function callBindBasic2(args) {
|
|
1928
1952
|
if (args.length < 1 || typeof args[0] !== "function") {
|
|
@@ -1991,7 +2015,7 @@
|
|
|
1991
2015
|
hasRequiredHasown = 1;
|
|
1992
2016
|
var call = Function.prototype.call;
|
|
1993
2017
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
1994
|
-
var bind2 =
|
|
2018
|
+
var bind2 = requireFunctionBind();
|
|
1995
2019
|
hasown = bind2.call(call, $hasOwn);
|
|
1996
2020
|
return hasown;
|
|
1997
2021
|
}
|
|
@@ -2006,7 +2030,7 @@
|
|
|
2006
2030
|
var $URIError = uri;
|
|
2007
2031
|
var abs$1 = abs$2;
|
|
2008
2032
|
var floor$1 = floor$2;
|
|
2009
|
-
var max$1 = max$
|
|
2033
|
+
var max$1 = max$2;
|
|
2010
2034
|
var min$1 = min$2;
|
|
2011
2035
|
var pow$1 = pow$2;
|
|
2012
2036
|
var round$2 = round$3;
|
|
@@ -2040,7 +2064,7 @@
|
|
|
2040
2064
|
var $ObjectGPO = requireObject_getPrototypeOf();
|
|
2041
2065
|
var $ReflectGPO = requireReflect_getPrototypeOf();
|
|
2042
2066
|
var $apply = requireFunctionApply();
|
|
2043
|
-
var $call =
|
|
2067
|
+
var $call = requireFunctionCall();
|
|
2044
2068
|
var needsEval = {};
|
|
2045
2069
|
var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
2046
2070
|
var INTRINSICS = {
|
|
@@ -2210,7 +2234,7 @@
|
|
|
2210
2234
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
2211
2235
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
2212
2236
|
};
|
|
2213
|
-
var bind =
|
|
2237
|
+
var bind = requireFunctionBind();
|
|
2214
2238
|
var hasOwn = requireHasown();
|
|
2215
2239
|
var $concat = bind.call($call, Array.prototype.concat);
|
|
2216
2240
|
var $spliceApply = bind.call($apply, Array.prototype.splice);
|
|
@@ -49335,7 +49359,10 @@ void main(void)\r
|
|
|
49335
49359
|
scrollbarWidth = 10,
|
|
49336
49360
|
scrollbarColor = "#ffffff",
|
|
49337
49361
|
onScroll,
|
|
49338
|
-
bgColor
|
|
49362
|
+
bgColor,
|
|
49363
|
+
maskTexture,
|
|
49364
|
+
maskX = 0,
|
|
49365
|
+
maskY = 0
|
|
49339
49366
|
} = params;
|
|
49340
49367
|
super(width, height, bgColor);
|
|
49341
49368
|
this._startY = 0;
|
|
@@ -49355,9 +49382,18 @@ void main(void)\r
|
|
|
49355
49382
|
this._content = new Container();
|
|
49356
49383
|
this.addChild(this._content);
|
|
49357
49384
|
this._content.addChild(this._scrollContent);
|
|
49358
|
-
|
|
49359
|
-
|
|
49360
|
-
|
|
49385
|
+
if (maskTexture) {
|
|
49386
|
+
this._maskGraphics = new Sprite(maskTexture);
|
|
49387
|
+
this.addChild(this._maskGraphics);
|
|
49388
|
+
this._maskGraphics.width = width;
|
|
49389
|
+
this._maskGraphics.height = height;
|
|
49390
|
+
this._maskGraphics.position.set(maskX, maskY);
|
|
49391
|
+
this.mask = this._maskGraphics;
|
|
49392
|
+
} else {
|
|
49393
|
+
this._maskGraphics = new LibPixiRectangle(width, height, "#000");
|
|
49394
|
+
this.addChild(this._maskGraphics);
|
|
49395
|
+
this.mask = this._maskGraphics;
|
|
49396
|
+
}
|
|
49361
49397
|
this._scrollbar = new LibPixiRectangle(
|
|
49362
49398
|
scrollbarWidth,
|
|
49363
49399
|
height,
|
|
@@ -49427,10 +49463,8 @@ void main(void)\r
|
|
|
49427
49463
|
* @param height 高度
|
|
49428
49464
|
*/
|
|
49429
49465
|
setDimensions(width, height) {
|
|
49430
|
-
this._maskGraphics.
|
|
49431
|
-
this._maskGraphics.
|
|
49432
|
-
this._maskGraphics.drawRect(0, 0, width, height);
|
|
49433
|
-
this._maskGraphics.endFill();
|
|
49466
|
+
this._maskGraphics.width = width;
|
|
49467
|
+
this._maskGraphics.height = height;
|
|
49434
49468
|
this.setSize(width, height);
|
|
49435
49469
|
this._scrollbar.x = width - (this._scrollbarRgiht || this._scrollbarWidth);
|
|
49436
49470
|
}
|
|
@@ -58401,6 +58435,59 @@ void main(void){
|
|
|
58401
58435
|
};
|
|
58402
58436
|
_LibPixiTicker._callbacks = /* @__PURE__ */ new Map();
|
|
58403
58437
|
let LibPixiTicker = _LibPixiTicker;
|
|
58438
|
+
class LibPixiArrangeLinearV2 extends Container {
|
|
58439
|
+
constructor(params) {
|
|
58440
|
+
super();
|
|
58441
|
+
this._elementList = [];
|
|
58442
|
+
this._params = params || {};
|
|
58443
|
+
this._elementList = this._params.elementList || [];
|
|
58444
|
+
}
|
|
58445
|
+
/** @description 追加元素 */
|
|
58446
|
+
push(element) {
|
|
58447
|
+
this.addChild(element);
|
|
58448
|
+
this._elementList.push(element);
|
|
58449
|
+
}
|
|
58450
|
+
/** @description 布局 */
|
|
58451
|
+
layout() {
|
|
58452
|
+
const { colNum = this._elementList.length, gap = 10, direction = "x" } = this._params;
|
|
58453
|
+
let lastRowMax = 0;
|
|
58454
|
+
let rowOffset = 0;
|
|
58455
|
+
this._elementList.forEach((item, index) => {
|
|
58456
|
+
const row = Math.floor(index / colNum);
|
|
58457
|
+
const col = index % colNum;
|
|
58458
|
+
if (direction === "x") {
|
|
58459
|
+
const gapValue = Array.isArray(gap) ? gap[index - 1] ?? 0 : gap;
|
|
58460
|
+
if (col === 0 && row > 0) {
|
|
58461
|
+
rowOffset += lastRowMax + gapValue;
|
|
58462
|
+
lastRowMax = 0;
|
|
58463
|
+
}
|
|
58464
|
+
item.x = col === 0 ? 0 : this._elementList[index - 1].x + this._elementList[index - 1].width + gapValue;
|
|
58465
|
+
rowOffset && (item.y = rowOffset);
|
|
58466
|
+
lastRowMax = Math.max(lastRowMax, item.height);
|
|
58467
|
+
} else {
|
|
58468
|
+
const gapValue = Array.isArray(gap) ? gap[index - 1] ?? 0 : gap;
|
|
58469
|
+
if (col === 0 && row > 0) {
|
|
58470
|
+
rowOffset += lastRowMax + gapValue;
|
|
58471
|
+
lastRowMax = 0;
|
|
58472
|
+
}
|
|
58473
|
+
item.y = col === 0 ? 0 : this._elementList[index - 1].y + this._elementList[index - 1].height + gapValue;
|
|
58474
|
+
rowOffset && (item.x = rowOffset);
|
|
58475
|
+
lastRowMax = Math.max(lastRowMax, item.width);
|
|
58476
|
+
}
|
|
58477
|
+
});
|
|
58478
|
+
}
|
|
58479
|
+
/** @description 获取列表元素 */
|
|
58480
|
+
getList() {
|
|
58481
|
+
return this._elementList;
|
|
58482
|
+
}
|
|
58483
|
+
/** @description 销毁列表元素 */
|
|
58484
|
+
destroyList() {
|
|
58485
|
+
this._elementList.forEach((item) => {
|
|
58486
|
+
item.destroy();
|
|
58487
|
+
});
|
|
58488
|
+
this._elementList = [];
|
|
58489
|
+
}
|
|
58490
|
+
}
|
|
58404
58491
|
const Components = {
|
|
58405
58492
|
Base: {
|
|
58406
58493
|
/** (已废弃)
|
|
@@ -58514,7 +58601,9 @@ void main(void){
|
|
|
58514
58601
|
/** @description 转盘布局 */
|
|
58515
58602
|
LibPixiTurntable,
|
|
58516
58603
|
/** @description 输入框 */
|
|
58517
|
-
LibPixiInput
|
|
58604
|
+
LibPixiInput,
|
|
58605
|
+
/** @description 线性排列 */
|
|
58606
|
+
LibPixiArrangeLinearV2
|
|
58518
58607
|
}
|
|
58519
58608
|
};
|
|
58520
58609
|
const Utils = {
|