@eva/plugin-ui 2.1.0-beta.3 → 2.1.0-beta.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/dist/EVA.plugin.ui.js +9177 -0
- package/dist/EVA.plugin.ui.min.js +1 -0
- package/dist/plugin-ui.cjs.js +2921 -0
- package/dist/plugin-ui.cjs.prod.js +1 -0
- package/dist/plugin-ui.d.ts +875 -0
- package/dist/plugin-ui.esm.js +2895 -0
- package/package.json +4 -4
|
@@ -0,0 +1,875 @@
|
|
|
1
|
+
import { Component } from '@eva/eva.js';
|
|
2
|
+
import { ComponentChanged } from '@eva/eva.js';
|
|
3
|
+
import type { Container } from 'pixi.js';
|
|
4
|
+
import { System } from '@eva/eva.js';
|
|
5
|
+
|
|
6
|
+
export declare const Button: UiComponentClass<ButtonParams>;
|
|
7
|
+
|
|
8
|
+
export declare interface ButtonParams {
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
view?: ViewRef;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export declare const CheckBox: UiComponentClass<CheckBoxParams>;
|
|
14
|
+
|
|
15
|
+
export declare interface CheckBoxParams {
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
checked?: boolean;
|
|
18
|
+
text?: string;
|
|
19
|
+
bindToStore?: string;
|
|
20
|
+
views?: {
|
|
21
|
+
checked?: ViewRef;
|
|
22
|
+
unchecked?: ViewRef;
|
|
23
|
+
};
|
|
24
|
+
textStyle?: {
|
|
25
|
+
fontFamily?: string;
|
|
26
|
+
fontSize?: number;
|
|
27
|
+
fill?: string | number;
|
|
28
|
+
};
|
|
29
|
+
textOffset?: {
|
|
30
|
+
x?: number;
|
|
31
|
+
y?: number;
|
|
32
|
+
};
|
|
33
|
+
disabledStyle?: CheckBoxStateStyle;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export declare interface CheckBoxStateStyle {
|
|
37
|
+
alpha?: number;
|
|
38
|
+
scale?: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** 圆形样式 */
|
|
42
|
+
export declare interface CircleStyle extends ShapeStyle {
|
|
43
|
+
x?: number;
|
|
44
|
+
y?: number;
|
|
45
|
+
radius: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export declare const CircularProgressBar: UiComponentClass<CircularProgressBarParams>;
|
|
49
|
+
|
|
50
|
+
export declare interface CircularProgressBarParams {
|
|
51
|
+
value?: number;
|
|
52
|
+
valueRange?: [number, number];
|
|
53
|
+
radius?: number;
|
|
54
|
+
lineWidth?: number;
|
|
55
|
+
startAngle?: number;
|
|
56
|
+
backgroundColor?: number | string;
|
|
57
|
+
fillColor?: number | string;
|
|
58
|
+
backgroundAlpha?: number;
|
|
59
|
+
fillAlpha?: number;
|
|
60
|
+
cap?: 'round' | 'butt' | 'square';
|
|
61
|
+
bindToStore?: string;
|
|
62
|
+
rotation?: number;
|
|
63
|
+
offset?: {
|
|
64
|
+
x?: number;
|
|
65
|
+
y?: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare const COMPONENT_DEFINITIONS: Record<string, ComponentDefinition>;
|
|
70
|
+
|
|
71
|
+
export declare interface ComponentDefinition<TParams = any, TInstance = any> {
|
|
72
|
+
/** Eva ECS component name(必须与 PIXI class import 名 / DSL type 字符串一致) */
|
|
73
|
+
name: string;
|
|
74
|
+
/** signal-bridge prefix(通常 = name.toLowerCase()) */
|
|
75
|
+
signalPrefix: string;
|
|
76
|
+
/** @pixi/ui 类构造器(或自定义构造函数) */
|
|
77
|
+
pixiClass: new (...args: any[]) => TInstance;
|
|
78
|
+
/** 字段表 - field name -> spec */
|
|
79
|
+
fields: Record<string, FieldSpec>;
|
|
80
|
+
/** view ref schema */
|
|
81
|
+
views?: ViewSchema;
|
|
82
|
+
/** 由字段值 + 解析后 views 生成 PIXI 实例构造参数(options 对象 | 位置参数数组) */
|
|
83
|
+
optionsBuilder: (component: TParams & Record<string, any>, views: ResolvedViews) => unknown[] | unknown;
|
|
84
|
+
/** 是否用位置参数构造(@pixi/ui Switcher),默认 false 走 options 对象 */
|
|
85
|
+
positional?: boolean;
|
|
86
|
+
/** 创建后立即同步的 prop(enabled / initial state)*/
|
|
87
|
+
postCreate?: (instance: TInstance, component: TParams & Record<string, any>) => void;
|
|
88
|
+
/** Signal -> 写回 component 字段的桥接 map(供 bridgeSignals) */
|
|
89
|
+
signalMap?: (component: TParams & Record<string, any>) => Record<string, true | ((...args: any[]) => Record<string, any>)>;
|
|
90
|
+
/** CHANGE 事件触发,把字段写回 PIXI 实例 */
|
|
91
|
+
syncOnChange?: (instance: TInstance, component: TParams & Record<string, any>) => void;
|
|
92
|
+
/** Transform.size -> @pixi/ui 实例尺寸同步。未提供时由 UISystem 使用通用 setSize/width/height 策略。 */
|
|
93
|
+
applySize?: (instance: TInstance, size: UiRenderSize, component: TParams & Record<string, any>, context: UiSizeSyncContext) => void;
|
|
94
|
+
/** ADD 完成后跑(Dialog 挂 content / MaskedFrame 挂 border)*/
|
|
95
|
+
onAttachedExtra?: (instance: TInstance, component: TParams & Record<string, any>, go: any, game: any) => void;
|
|
96
|
+
/** 实例方法 mixin(注入到 wrapper class.prototype) */
|
|
97
|
+
mixin?: Record<string, Function>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export declare function defineUiComponent<TParams = any, TInstance = any>(def: ComponentDefinition<TParams, TInstance>): UiComponentClass<TParams>;
|
|
101
|
+
|
|
102
|
+
export declare const Dialog: UiComponentClass<DialogParams>;
|
|
103
|
+
|
|
104
|
+
declare interface DialogButtonParams {
|
|
105
|
+
kind?: 'button' | 'fancy';
|
|
106
|
+
text?: string;
|
|
107
|
+
value?: string | number;
|
|
108
|
+
closeOnPress?: boolean;
|
|
109
|
+
reopenDelay?: number;
|
|
110
|
+
width?: number;
|
|
111
|
+
height?: number;
|
|
112
|
+
radius?: number;
|
|
113
|
+
color?: number | string;
|
|
114
|
+
hoverColor?: number | string;
|
|
115
|
+
pressedColor?: number | string;
|
|
116
|
+
disabledColor?: number | string;
|
|
117
|
+
defaultView?: string;
|
|
118
|
+
hoverView?: string;
|
|
119
|
+
pressedView?: string;
|
|
120
|
+
disabledView?: string;
|
|
121
|
+
nineSliceSprite?: [number, number, number, number];
|
|
122
|
+
textStyle?: {
|
|
123
|
+
fontFamily?: string;
|
|
124
|
+
fontSize?: number;
|
|
125
|
+
fill?: string | number;
|
|
126
|
+
fontWeight?: string;
|
|
127
|
+
};
|
|
128
|
+
disabled?: boolean;
|
|
129
|
+
animations?: unknown;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
declare interface DialogCheckBoxParams {
|
|
133
|
+
text?: string;
|
|
134
|
+
size?: number;
|
|
135
|
+
radius?: number;
|
|
136
|
+
checked?: boolean;
|
|
137
|
+
uncheckedColor?: number | string;
|
|
138
|
+
checkedColor?: number | string;
|
|
139
|
+
strokeColor?: number | string;
|
|
140
|
+
strokeWidth?: number;
|
|
141
|
+
textStyle?: {
|
|
142
|
+
fontFamily?: string;
|
|
143
|
+
fontSize?: number;
|
|
144
|
+
fill?: string | number;
|
|
145
|
+
fontWeight?: string;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export declare interface DialogParams {
|
|
150
|
+
open?: boolean;
|
|
151
|
+
title?: string;
|
|
152
|
+
width?: number;
|
|
153
|
+
height?: number;
|
|
154
|
+
padding?: number;
|
|
155
|
+
backdropColor?: number | string;
|
|
156
|
+
backdropAlpha?: number;
|
|
157
|
+
backdropView?: ViewRef;
|
|
158
|
+
backgroundView?: ViewRef;
|
|
159
|
+
closeOnBackdropClick?: boolean;
|
|
160
|
+
contentChildName?: string;
|
|
161
|
+
nineSliceSprite?: [number, number, number, number];
|
|
162
|
+
bindToStore?: string;
|
|
163
|
+
titleStyle?: {
|
|
164
|
+
fontFamily?: string;
|
|
165
|
+
fontSize?: number;
|
|
166
|
+
fill?: string | number;
|
|
167
|
+
fontWeight?: string;
|
|
168
|
+
lineHeight?: number;
|
|
169
|
+
dropShadow?: unknown;
|
|
170
|
+
};
|
|
171
|
+
content?: string;
|
|
172
|
+
contentStyle?: {
|
|
173
|
+
fontFamily?: string;
|
|
174
|
+
fontSize?: number;
|
|
175
|
+
fill?: string | number;
|
|
176
|
+
fontWeight?: string;
|
|
177
|
+
align?: 'left' | 'center' | 'right';
|
|
178
|
+
wordWrap?: boolean;
|
|
179
|
+
wordWrapWidth?: number;
|
|
180
|
+
lineHeight?: number;
|
|
181
|
+
dropShadow?: unknown;
|
|
182
|
+
};
|
|
183
|
+
contentButtons?: DialogButtonParams[];
|
|
184
|
+
contentCheckBoxes?: DialogCheckBoxParams[];
|
|
185
|
+
buttons?: DialogButtonParams[];
|
|
186
|
+
buttonList?: {
|
|
187
|
+
elementsMargin?: number;
|
|
188
|
+
type?: ListType;
|
|
189
|
+
padding?: number;
|
|
190
|
+
};
|
|
191
|
+
buttonListOffset?: {
|
|
192
|
+
x?: number;
|
|
193
|
+
y?: number;
|
|
194
|
+
};
|
|
195
|
+
scrollBox?: Partial<ScrollBoxParams> & {
|
|
196
|
+
type?: ListType;
|
|
197
|
+
offset?: {
|
|
198
|
+
x?: number;
|
|
199
|
+
y?: number;
|
|
200
|
+
};
|
|
201
|
+
size?: {
|
|
202
|
+
width?: number;
|
|
203
|
+
height?: number;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
animations?: unknown;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export declare const DoubleSlider: UiComponentClass<DoubleSliderParams>;
|
|
210
|
+
|
|
211
|
+
export declare interface DoubleSliderParams {
|
|
212
|
+
enabled?: boolean;
|
|
213
|
+
value1?: number;
|
|
214
|
+
value2?: number;
|
|
215
|
+
min?: number;
|
|
216
|
+
max?: number;
|
|
217
|
+
step?: number;
|
|
218
|
+
showValue?: boolean;
|
|
219
|
+
views?: {
|
|
220
|
+
bg?: ViewRef;
|
|
221
|
+
fill?: ViewRef;
|
|
222
|
+
slider1?: ViewRef;
|
|
223
|
+
slider2?: ViewRef;
|
|
224
|
+
};
|
|
225
|
+
nineSliceSprite?: {
|
|
226
|
+
bg?: [number, number, number, number];
|
|
227
|
+
fill?: [number, number, number, number];
|
|
228
|
+
};
|
|
229
|
+
fillPaddings?: ProgressBarFillPaddings;
|
|
230
|
+
valueTextStyle?: {
|
|
231
|
+
fontFamily?: string;
|
|
232
|
+
fontSize?: number;
|
|
233
|
+
fill?: string | number;
|
|
234
|
+
};
|
|
235
|
+
valueTextOffset?: {
|
|
236
|
+
x?: number;
|
|
237
|
+
y?: number;
|
|
238
|
+
};
|
|
239
|
+
width?: number;
|
|
240
|
+
height?: number;
|
|
241
|
+
bindToStore1?: string;
|
|
242
|
+
bindToStore2?: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** 椭圆样式 */
|
|
246
|
+
export declare interface EllipseStyle extends ShapeStyle {
|
|
247
|
+
x?: number;
|
|
248
|
+
y?: number;
|
|
249
|
+
width: number;
|
|
250
|
+
height: number;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export declare const FancyButton: UiComponentClass<FancyButtonParams>;
|
|
254
|
+
|
|
255
|
+
export declare type FancyButtonOffset = {
|
|
256
|
+
x?: number;
|
|
257
|
+
y?: number;
|
|
258
|
+
default?: {
|
|
259
|
+
x?: number;
|
|
260
|
+
y?: number;
|
|
261
|
+
};
|
|
262
|
+
hover?: {
|
|
263
|
+
x?: number;
|
|
264
|
+
y?: number;
|
|
265
|
+
};
|
|
266
|
+
pressed?: {
|
|
267
|
+
x?: number;
|
|
268
|
+
y?: number;
|
|
269
|
+
};
|
|
270
|
+
disabled?: {
|
|
271
|
+
x?: number;
|
|
272
|
+
y?: number;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export declare interface FancyButtonParams {
|
|
277
|
+
enabled?: boolean;
|
|
278
|
+
state?: FancyButtonState;
|
|
279
|
+
selected?: boolean;
|
|
280
|
+
text?: string;
|
|
281
|
+
views?: FancyButtonViewRefs;
|
|
282
|
+
offset?: FancyButtonOffset;
|
|
283
|
+
textOffset?: FancyButtonOffset;
|
|
284
|
+
iconOffset?: FancyButtonOffset;
|
|
285
|
+
padding?: number;
|
|
286
|
+
nineSliceSprite?: [number, number, number, number];
|
|
287
|
+
selectedTint?: string;
|
|
288
|
+
textStyle?: {
|
|
289
|
+
fontFamily?: string;
|
|
290
|
+
fontSize?: number;
|
|
291
|
+
fill?: string | number;
|
|
292
|
+
fontWeight?: string;
|
|
293
|
+
dropShadow?: unknown;
|
|
294
|
+
};
|
|
295
|
+
textClass?: 'text' | 'html' | 'bitmap';
|
|
296
|
+
bitmapFontName?: string;
|
|
297
|
+
defaultTextScale?: {
|
|
298
|
+
x?: number;
|
|
299
|
+
y?: number;
|
|
300
|
+
} | number;
|
|
301
|
+
defaultIconScale?: {
|
|
302
|
+
x?: number;
|
|
303
|
+
y?: number;
|
|
304
|
+
} | number;
|
|
305
|
+
defaultTextAnchor?: {
|
|
306
|
+
x?: number;
|
|
307
|
+
y?: number;
|
|
308
|
+
} | number;
|
|
309
|
+
defaultIconAnchor?: {
|
|
310
|
+
x?: number;
|
|
311
|
+
y?: number;
|
|
312
|
+
} | number;
|
|
313
|
+
anchor?: number;
|
|
314
|
+
anchorX?: number;
|
|
315
|
+
anchorY?: number;
|
|
316
|
+
scale?: number;
|
|
317
|
+
animations?: unknown;
|
|
318
|
+
contentFittingMode?: 'default' | 'fill' | 'none';
|
|
319
|
+
ignoreRefitting?: boolean;
|
|
320
|
+
width?: number;
|
|
321
|
+
height?: number;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export declare type FancyButtonState = 'default' | 'hover' | 'pressed' | 'disabled' | 'selected';
|
|
325
|
+
|
|
326
|
+
export declare interface FancyButtonViewRefs {
|
|
327
|
+
default?: ViewRef;
|
|
328
|
+
hover?: ViewRef;
|
|
329
|
+
pressed?: ViewRef;
|
|
330
|
+
disabled?: ViewRef;
|
|
331
|
+
icon?: ViewRef;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export declare type FieldKind = 'scalar' | 'shallowMerge' | 'arrayCopy' | 'tuple' | 'opaque';
|
|
335
|
+
|
|
336
|
+
export declare interface FieldSpec {
|
|
337
|
+
kind: FieldKind;
|
|
338
|
+
/** tuple 长度 / 默认值 */
|
|
339
|
+
tupleLength?: number;
|
|
340
|
+
/** Inspector metadata 字段定义,用于生成 getInspectorMetadata */
|
|
341
|
+
inspector?: InspectorChild;
|
|
342
|
+
/** 默认值(field initial state) */
|
|
343
|
+
default?: unknown;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export declare interface InlineShape {
|
|
347
|
+
type: 'rect' | 'roundedRect' | 'circle' | 'ellipse';
|
|
348
|
+
style: {
|
|
349
|
+
x?: number;
|
|
350
|
+
y?: number;
|
|
351
|
+
width?: number;
|
|
352
|
+
height?: number;
|
|
353
|
+
radius?: number;
|
|
354
|
+
fill?: number | string;
|
|
355
|
+
stroke?: number | string;
|
|
356
|
+
lineWidth?: number;
|
|
357
|
+
alpha?: number;
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export declare const Input: UiComponentClass<InputParams>;
|
|
362
|
+
|
|
363
|
+
export declare interface InputParams {
|
|
364
|
+
enabled?: boolean;
|
|
365
|
+
value?: string;
|
|
366
|
+
placeholder?: string;
|
|
367
|
+
maxLength?: number;
|
|
368
|
+
secure?: boolean;
|
|
369
|
+
align?: 'left' | 'center' | 'right';
|
|
370
|
+
padding?: [number, number, number, number];
|
|
371
|
+
textStyle?: InputStyle;
|
|
372
|
+
bgView?: ViewRef;
|
|
373
|
+
nineSliceSprite?: [number, number, number, number];
|
|
374
|
+
cleanOnFocus?: boolean;
|
|
375
|
+
addMask?: boolean;
|
|
376
|
+
bindToStore?: string;
|
|
377
|
+
width?: number;
|
|
378
|
+
height?: number;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export declare interface InputStyle {
|
|
382
|
+
fontFamily?: string;
|
|
383
|
+
fontSize?: number;
|
|
384
|
+
fill?: string | number;
|
|
385
|
+
align?: 'left' | 'center' | 'right';
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
declare interface InspectorChild {
|
|
389
|
+
name: string;
|
|
390
|
+
type: string;
|
|
391
|
+
isArray?: boolean;
|
|
392
|
+
isFolder?: boolean;
|
|
393
|
+
step?: number;
|
|
394
|
+
children?: InspectorChild[];
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
declare interface InspectorFieldMetadata {
|
|
398
|
+
name: string;
|
|
399
|
+
type: string;
|
|
400
|
+
isArray: boolean;
|
|
401
|
+
children?: InspectorFieldMetadata[];
|
|
402
|
+
isFolder?: boolean;
|
|
403
|
+
step?: number;
|
|
404
|
+
label?: unknown;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
declare interface InspectorFieldMetadata_2 {
|
|
408
|
+
name: string;
|
|
409
|
+
type: string;
|
|
410
|
+
isArray: boolean;
|
|
411
|
+
children?: InspectorFieldMetadata_2[];
|
|
412
|
+
isFolder?: boolean;
|
|
413
|
+
step?: number;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export declare const List: UiComponentClass<ListParams>;
|
|
417
|
+
|
|
418
|
+
export declare interface ListParams {
|
|
419
|
+
type?: ListType;
|
|
420
|
+
elementsMargin?: number;
|
|
421
|
+
padding?: number;
|
|
422
|
+
vertPadding?: number;
|
|
423
|
+
horPadding?: number;
|
|
424
|
+
topPadding?: number;
|
|
425
|
+
bottomPadding?: number;
|
|
426
|
+
leftPadding?: number;
|
|
427
|
+
rightPadding?: number;
|
|
428
|
+
maxWidth?: number;
|
|
429
|
+
maxHeight?: number;
|
|
430
|
+
itemsChildName?: string;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export declare type ListType = 'horizontal' | 'vertical' | 'bidirectional';
|
|
434
|
+
|
|
435
|
+
export declare const MaskedFrame: UiComponentClass<MaskedFrameParams>;
|
|
436
|
+
|
|
437
|
+
export declare interface MaskedFrameParams {
|
|
438
|
+
targetView?: ViewRef;
|
|
439
|
+
maskView?: ViewRef;
|
|
440
|
+
borderView?: ViewRef;
|
|
441
|
+
borderWidth?: number;
|
|
442
|
+
borderColor?: number | string;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* 由 defineUiComponent 创建的 wrapper class 基础形状。
|
|
447
|
+
* 所有由 factory 生成的 class 共享下面这套 init / applyDeclarativeProps / getInspectorMetadata
|
|
448
|
+
* / 内部状态计数器逻辑。
|
|
449
|
+
*/
|
|
450
|
+
export declare class PixiUiComponent<TParams = any> extends Component<TParams> {
|
|
451
|
+
/** runtime 计数,供 spec / debug 验证(toggleCount / pressCount / hoverCount / ...)*/
|
|
452
|
+
toggleCount: number;
|
|
453
|
+
pressCount: number;
|
|
454
|
+
downCount: number;
|
|
455
|
+
upCount: number;
|
|
456
|
+
hoverCount: number;
|
|
457
|
+
outCount: number;
|
|
458
|
+
upOutCount: number;
|
|
459
|
+
changeCount: number;
|
|
460
|
+
updateCount: number;
|
|
461
|
+
selectCount: number;
|
|
462
|
+
lastSignal: string;
|
|
463
|
+
visualState: string;
|
|
464
|
+
/** Input 私有 focused */
|
|
465
|
+
focused: boolean;
|
|
466
|
+
/** DSL/constructor 中显式传入过的字段,用于区分 metadata default 与用户配置。 */
|
|
467
|
+
__evaExplicitFields: Set<string>;
|
|
468
|
+
/** 由 factory 通过 metadata 注入的动态字段(views / value / checked / ...)*/
|
|
469
|
+
[key: string]: any;
|
|
470
|
+
init(p?: TParams): void;
|
|
471
|
+
applyDeclarativeProps(next: TParams, _prev?: TParams): void;
|
|
472
|
+
/** 通用字段 apply 循环:按 fieldSpec 走对应分支 */
|
|
473
|
+
protected applyParams(p: Record<string, any>): void;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export declare const ProgressBar: UiComponentClass<ProgressBarParams>;
|
|
477
|
+
|
|
478
|
+
export declare interface ProgressBarFillPaddings {
|
|
479
|
+
top?: number;
|
|
480
|
+
right?: number;
|
|
481
|
+
bottom?: number;
|
|
482
|
+
left?: number;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export declare interface ProgressBarParams {
|
|
486
|
+
value?: number;
|
|
487
|
+
valueRange?: [number, number];
|
|
488
|
+
bgView?: ViewRef;
|
|
489
|
+
fillView?: ViewRef;
|
|
490
|
+
nineSliceSprite?: {
|
|
491
|
+
bg?: [number, number, number, number];
|
|
492
|
+
fill?: [number, number, number, number];
|
|
493
|
+
};
|
|
494
|
+
fillPaddings?: ProgressBarFillPaddings;
|
|
495
|
+
bindToStore?: string;
|
|
496
|
+
width?: number;
|
|
497
|
+
height?: number;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export declare class RadioGroup extends Component<RadioGroupParams> {
|
|
501
|
+
static componentName: string;
|
|
502
|
+
componentName?: string;
|
|
503
|
+
selectedId: string | undefined;
|
|
504
|
+
childNames: string[] | undefined;
|
|
505
|
+
direction: 'horizontal' | 'vertical' | 'bidirectional';
|
|
506
|
+
elementsMargin: number;
|
|
507
|
+
/** runtime: 已绑定的子 CheckBox(System 填充) */
|
|
508
|
+
boundCheckBoxes: {
|
|
509
|
+
name: string;
|
|
510
|
+
cb: any;
|
|
511
|
+
}[];
|
|
512
|
+
static getInspectorMetadata(): InspectorFieldMetadata_2;
|
|
513
|
+
init(p?: RadioGroupParams): void;
|
|
514
|
+
applyDeclarativeProps(next: RadioGroupParams, _prev?: RadioGroupParams): void;
|
|
515
|
+
applySelection(): void;
|
|
516
|
+
private applyParams;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export declare interface RadioGroupParams {
|
|
520
|
+
selectedId?: string;
|
|
521
|
+
childNames?: string[];
|
|
522
|
+
direction?: 'horizontal' | 'vertical' | 'bidirectional';
|
|
523
|
+
elementsMargin?: number;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/** 矩形样式 */
|
|
527
|
+
export declare interface RectStyle extends ShapeStyle {
|
|
528
|
+
x?: number;
|
|
529
|
+
y?: number;
|
|
530
|
+
width: number;
|
|
531
|
+
height: number;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
export declare interface ResolvedViews {
|
|
535
|
+
/** single key -> Container | null */
|
|
536
|
+
single?: Container | null;
|
|
537
|
+
/** object folder -> { [key]: Container | null } */
|
|
538
|
+
object?: Record<string, Container | null>;
|
|
539
|
+
/** array key -> Container[] */
|
|
540
|
+
array?: Container[];
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/** 圆角矩形样式 */
|
|
544
|
+
export declare interface RoundedRectStyle extends ShapeStyle {
|
|
545
|
+
x?: number;
|
|
546
|
+
y?: number;
|
|
547
|
+
width: number;
|
|
548
|
+
height: number;
|
|
549
|
+
radius?: number;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export declare const ScrollBox: UiComponentClass<ScrollBoxParams>;
|
|
553
|
+
|
|
554
|
+
export declare interface ScrollBoxParams {
|
|
555
|
+
width?: number;
|
|
556
|
+
height?: number;
|
|
557
|
+
direction?: ScrollDirection;
|
|
558
|
+
contentChildName?: string;
|
|
559
|
+
background?: number | string;
|
|
560
|
+
radius?: number;
|
|
561
|
+
elementsMargin?: number;
|
|
562
|
+
disableDynamicRendering?: boolean;
|
|
563
|
+
disableEasing?: boolean;
|
|
564
|
+
padding?: number;
|
|
565
|
+
vertPadding?: number;
|
|
566
|
+
horPadding?: number;
|
|
567
|
+
topPadding?: number;
|
|
568
|
+
bottomPadding?: number;
|
|
569
|
+
leftPadding?: number;
|
|
570
|
+
rightPadding?: number;
|
|
571
|
+
globalScroll?: boolean;
|
|
572
|
+
shiftScroll?: boolean;
|
|
573
|
+
proximityRange?: number;
|
|
574
|
+
proximityDebounce?: number;
|
|
575
|
+
inertia?: boolean;
|
|
576
|
+
inertiaDecay?: number;
|
|
577
|
+
bounceFactor?: number;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export declare type ScrollDirection = 'horizontal' | 'vertical' | 'both';
|
|
581
|
+
|
|
582
|
+
export declare const Select: UiComponentClass<SelectParams>;
|
|
583
|
+
|
|
584
|
+
export declare interface SelectItem {
|
|
585
|
+
text: string;
|
|
586
|
+
id?: string;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export declare interface SelectParams {
|
|
590
|
+
items?: SelectItem[];
|
|
591
|
+
selectedIndex?: number;
|
|
592
|
+
placeholder?: string;
|
|
593
|
+
closedView?: ViewRef;
|
|
594
|
+
openView?: ViewRef;
|
|
595
|
+
textStyle?: {
|
|
596
|
+
fontFamily?: string;
|
|
597
|
+
fontSize?: number;
|
|
598
|
+
fill?: string | number;
|
|
599
|
+
};
|
|
600
|
+
nineSliceSprite?: [number, number, number, number];
|
|
601
|
+
bindToStore?: string;
|
|
602
|
+
width?: number;
|
|
603
|
+
height?: number;
|
|
604
|
+
radius?: number;
|
|
605
|
+
visibleItems?: number;
|
|
606
|
+
itemWidth?: number;
|
|
607
|
+
itemHeight?: number;
|
|
608
|
+
itemBackgroundColor?: number | string;
|
|
609
|
+
itemHoverColor?: number | string;
|
|
610
|
+
selectedTextOffset?: {
|
|
611
|
+
x?: number;
|
|
612
|
+
y?: number;
|
|
613
|
+
};
|
|
614
|
+
scrollBox?: Partial<ScrollBoxParams> & {
|
|
615
|
+
offset?: {
|
|
616
|
+
x?: number;
|
|
617
|
+
y?: number;
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
textClass?: 'text' | 'html';
|
|
621
|
+
open?: boolean;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Shape 组件
|
|
626
|
+
*
|
|
627
|
+
* 基于 `@eva/plugin-renderer-graphics` 实现 rect/circle/ellipse/roundedRect 的
|
|
628
|
+
* 矢量绘制,支持纯色 / linear-gradient 填充与描边。`shapes` 数组允许在同一个
|
|
629
|
+
* GameObject 上层叠多个形状。
|
|
630
|
+
*/
|
|
631
|
+
declare class Shape extends Component<ShapeParams> {
|
|
632
|
+
/** 组件名称 */
|
|
633
|
+
static componentName: string;
|
|
634
|
+
/** 实例侧 componentName,DSL 序列化时使用 */
|
|
635
|
+
componentName?: string;
|
|
636
|
+
private shapes;
|
|
637
|
+
/** 编辑器 Inspector 元数据,主仓 ComponentInspector 通过静态方法读取 */
|
|
638
|
+
static getInspectorMetadata(): InspectorFieldMetadata;
|
|
639
|
+
init(params?: ShapeParams): void;
|
|
640
|
+
awake(): void;
|
|
641
|
+
start(): void;
|
|
642
|
+
/**
|
|
643
|
+
* 解析 linear-gradient 字符串
|
|
644
|
+
* 支持格式: linear-gradient(180deg, #340033 4%, #93005D 83%, #CB2269 99%)
|
|
645
|
+
*/
|
|
646
|
+
private parseLinearGradient;
|
|
647
|
+
/**
|
|
648
|
+
* 创建 PixiJS FillGradient 对象
|
|
649
|
+
* CSS linear-gradient 角度定义:
|
|
650
|
+
* - 0deg = 从下到上(↑)
|
|
651
|
+
* - 90deg = 从左到右(→)
|
|
652
|
+
* - 180deg = 从上到下(↓)
|
|
653
|
+
* - 270deg = 从右到左(←)
|
|
654
|
+
*
|
|
655
|
+
* FillGradient 的坐标范围是 0~1 的相对坐标
|
|
656
|
+
*/
|
|
657
|
+
private createGradient;
|
|
658
|
+
/** 计算形状包围盒,供渐变坐标使用 */
|
|
659
|
+
private getShapeBounds;
|
|
660
|
+
/** 重新绘制所有形状 */
|
|
661
|
+
redraw(): void;
|
|
662
|
+
/** 绘制单个形状 */
|
|
663
|
+
private drawShape;
|
|
664
|
+
private drawRect;
|
|
665
|
+
private drawCircle;
|
|
666
|
+
private drawEllipse;
|
|
667
|
+
private drawRoundedRect;
|
|
668
|
+
/** 追加一个形状 */
|
|
669
|
+
addShape(type: ShapeType, style: RectStyle | CircleStyle | EllipseStyle | RoundedRectStyle): void;
|
|
670
|
+
/** 清除所有形状 */
|
|
671
|
+
clearShapes(): void;
|
|
672
|
+
/** 更新指定索引的形状 */
|
|
673
|
+
updateShape(index: number, type: ShapeType, style: RectStyle | CircleStyle | EllipseStyle | RoundedRectStyle): void;
|
|
674
|
+
/** 移除指定索引的形状 */
|
|
675
|
+
removeShape(index: number): void;
|
|
676
|
+
/** 获取形状数量 */
|
|
677
|
+
getShapeCount(): number;
|
|
678
|
+
/** 获取指定索引的形状(只读视图) */
|
|
679
|
+
getShape(index: number): ShapeDefinition | null;
|
|
680
|
+
/** 设置所有形状的透明度 */
|
|
681
|
+
setAlpha(alpha: number): void;
|
|
682
|
+
/** 设置所有形状的填充色 */
|
|
683
|
+
setFill(fill: string): void;
|
|
684
|
+
/** 设置所有形状的描边 */
|
|
685
|
+
setStroke(stroke: string, lineWidth?: number): void;
|
|
686
|
+
}
|
|
687
|
+
export { Shape }
|
|
688
|
+
export { Shape as UI }
|
|
689
|
+
|
|
690
|
+
/** 单个 shape 描述 */
|
|
691
|
+
export declare interface ShapeDefinition {
|
|
692
|
+
type: ShapeType;
|
|
693
|
+
style: RectStyle | CircleStyle | EllipseStyle | RoundedRectStyle;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/** Shape component params */
|
|
697
|
+
export declare interface ShapeParams {
|
|
698
|
+
componentName?: string;
|
|
699
|
+
shapes?: ShapeDefinition[];
|
|
700
|
+
/** 单形状简化用法:type + style */
|
|
701
|
+
type?: ShapeType;
|
|
702
|
+
style?: RectStyle | CircleStyle | EllipseStyle | RoundedRectStyle;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/** Shape base style */
|
|
706
|
+
export declare interface ShapeStyle {
|
|
707
|
+
/** 填充颜色,支持 #RRGGBB / rgb()/rgba() / linear-gradient(...) */
|
|
708
|
+
fill?: string;
|
|
709
|
+
/** 描边颜色 */
|
|
710
|
+
stroke?: string;
|
|
711
|
+
/** 描边宽度 */
|
|
712
|
+
lineWidth?: number;
|
|
713
|
+
/** 透明度 0~1 */
|
|
714
|
+
alpha?: number;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/** Shape primitive type enum */
|
|
718
|
+
export declare enum ShapeType {
|
|
719
|
+
RECT = "rect",
|
|
720
|
+
CIRCLE = "circle",
|
|
721
|
+
ELLIPSE = "ellipse",
|
|
722
|
+
ROUNDED_RECT = "roundedRect"
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export declare const Slider: UiComponentClass<SliderParams>;
|
|
726
|
+
|
|
727
|
+
export declare type SliderOrientation = 'horizontal' | 'vertical';
|
|
728
|
+
|
|
729
|
+
export declare interface SliderParams {
|
|
730
|
+
enabled?: boolean;
|
|
731
|
+
value?: number;
|
|
732
|
+
min?: number;
|
|
733
|
+
max?: number;
|
|
734
|
+
step?: number;
|
|
735
|
+
orientation?: SliderOrientation;
|
|
736
|
+
showValue?: boolean;
|
|
737
|
+
views?: {
|
|
738
|
+
bg?: ViewRef;
|
|
739
|
+
fill?: ViewRef;
|
|
740
|
+
thumb?: ViewRef;
|
|
741
|
+
};
|
|
742
|
+
nineSliceSprite?: {
|
|
743
|
+
bg?: [number, number, number, number];
|
|
744
|
+
fill?: [number, number, number, number];
|
|
745
|
+
};
|
|
746
|
+
fillPaddings?: ProgressBarFillPaddings;
|
|
747
|
+
valueTextStyle?: {
|
|
748
|
+
fontFamily?: string;
|
|
749
|
+
fontSize?: number;
|
|
750
|
+
fill?: string | number;
|
|
751
|
+
};
|
|
752
|
+
valueTextOffset?: {
|
|
753
|
+
x?: number;
|
|
754
|
+
y?: number;
|
|
755
|
+
};
|
|
756
|
+
width?: number;
|
|
757
|
+
height?: number;
|
|
758
|
+
bindToStore?: string;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
export declare const Switcher: UiComponentClass<SwitcherParams>;
|
|
762
|
+
|
|
763
|
+
export declare interface SwitcherParams {
|
|
764
|
+
active?: number;
|
|
765
|
+
views?: ViewRef[];
|
|
766
|
+
triggerEvent?: SwitcherTriggerEvent | SwitcherTriggerEvent[];
|
|
767
|
+
bindToStore?: string;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
export declare type SwitcherTriggerEvent = 'onPress' | 'onDown' | 'onUp' | 'onHover' | 'onOut' | 'onUpOut';
|
|
771
|
+
|
|
772
|
+
declare type UiComponentClass<TParams = any> = new () => PixiUiComponent<TParams>;
|
|
773
|
+
|
|
774
|
+
export declare type UIComponentParams = ShapeParams;
|
|
775
|
+
|
|
776
|
+
/** Backward-compatible aliases kept for existing TS imports. */
|
|
777
|
+
export declare type UIParams = ShapeParams;
|
|
778
|
+
|
|
779
|
+
declare interface UiRenderSize {
|
|
780
|
+
width?: number;
|
|
781
|
+
height?: number;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export declare type UIShape = ShapeDefinition;
|
|
785
|
+
|
|
786
|
+
/** Backward-compatible enum value alias for existing TypeScript consumers. */
|
|
787
|
+
export declare const UIShapeType: typeof ShapeType;
|
|
788
|
+
|
|
789
|
+
export declare type UIShapeType = ShapeType;
|
|
790
|
+
|
|
791
|
+
declare interface UiSizeSyncContext {
|
|
792
|
+
componentName: string;
|
|
793
|
+
component?: Record<string, any>;
|
|
794
|
+
gameObject?: any;
|
|
795
|
+
source: 'initial-transform' | 'transform-change' | 'component-change';
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
export declare type UIStyle = ShapeStyle;
|
|
799
|
+
|
|
800
|
+
declare class UISystem extends System {
|
|
801
|
+
static systemName: string;
|
|
802
|
+
name: string;
|
|
803
|
+
/** componentName -> instance map(generic 共享一份) */
|
|
804
|
+
private instances;
|
|
805
|
+
private signalCleanups;
|
|
806
|
+
private transformSizeAuthorities;
|
|
807
|
+
/** 给 RadioGroup 反查 PixiCheckBox 实例用 */
|
|
808
|
+
private get checkBoxInstances();
|
|
809
|
+
private radioGroupInstances;
|
|
810
|
+
update(_e?: any): void;
|
|
811
|
+
componentChanged(changed: ComponentChanged): void;
|
|
812
|
+
private handleShape;
|
|
813
|
+
private handleGeneric;
|
|
814
|
+
private attachGeneric;
|
|
815
|
+
private detachGeneric;
|
|
816
|
+
private handleRadioGroup;
|
|
817
|
+
private attachRadioGroup;
|
|
818
|
+
private getInstanceMap;
|
|
819
|
+
private gameRef;
|
|
820
|
+
private handleTransformSizeChanged;
|
|
821
|
+
private relayoutLayoutInstances;
|
|
822
|
+
private applyTransientTransformSize;
|
|
823
|
+
}
|
|
824
|
+
export { UISystem as PluginUiSystem }
|
|
825
|
+
export { UISystem }
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* DSL 中 plugin-ui 组件用 ViewRef 引用视觉资源,而不是 Eva v2.0 的 *ChildName 模式。
|
|
829
|
+
*
|
|
830
|
+
* - { entityName: "background" } — 引用同 GameObject 的子 entity 的 PIXI.Container,
|
|
831
|
+
* 这个 child entity 必须先 ADD,然后我们把它的 Container "借走" 交给 @pixi/ui 实例。
|
|
832
|
+
* 原 child entity 仍然存在(Transform/逻辑组件还在),只是 PIXI 显示对象被重新 parent。
|
|
833
|
+
* - { shape: { type, style } } — 内联 shape,生成一个新的 PIXI.Graphics(临时,与 Shape 组件不同源)
|
|
834
|
+
* - { texture: "loading.png" } — 从已加载的 Eva 资源池查 texture,生成 PIXI.Sprite
|
|
835
|
+
* - { color: 0xRRGGBB, width, height } — 生成纯色矩形 Graphics
|
|
836
|
+
* - { fallback: <ViewRef> } — 当主 ref 解析失败时使用
|
|
837
|
+
*/
|
|
838
|
+
export declare type ViewRef = {
|
|
839
|
+
entityName: string;
|
|
840
|
+
fallback?: ViewRef;
|
|
841
|
+
} | {
|
|
842
|
+
shape: InlineShape;
|
|
843
|
+
fallback?: ViewRef;
|
|
844
|
+
} | {
|
|
845
|
+
ui: InlineShape;
|
|
846
|
+
fallback?: ViewRef;
|
|
847
|
+
} | {
|
|
848
|
+
texture: string;
|
|
849
|
+
fallback?: ViewRef;
|
|
850
|
+
} | {
|
|
851
|
+
color: number | string;
|
|
852
|
+
width: number;
|
|
853
|
+
height: number;
|
|
854
|
+
radius?: number;
|
|
855
|
+
fallback?: ViewRef;
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
export declare type ViewSchema = {
|
|
859
|
+
kind: 'single';
|
|
860
|
+
key: string;
|
|
861
|
+
required: boolean;
|
|
862
|
+
} | {
|
|
863
|
+
kind: 'object';
|
|
864
|
+
folder: string;
|
|
865
|
+
keys: {
|
|
866
|
+
name: string;
|
|
867
|
+
required: boolean;
|
|
868
|
+
}[];
|
|
869
|
+
} | {
|
|
870
|
+
kind: 'array';
|
|
871
|
+
key: string;
|
|
872
|
+
minLength: number;
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
export { }
|