sapdon 3.0.3 → 3.2.0
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/README.md +11 -3
- package/doc/api.md +2 -2
- package/doc/oc/index.md +0 -0
- package/doc/sapdon-ts.md +7 -5
- package/package.json +18 -19
- package/{dist/cli/dev-server/server.d.ts → prod/cli/index.d.ts} +9 -3
- package/prod/cli/index.js +1 -0
- package/prod/cli/start.js +1428 -0
- package/{dist → prod}/core/index.d.ts +2325 -1643
- package/prod/core/index.js +59017 -0
- package/{dist → prod}/oc/index.d.ts +3 -3
- package/prod/oc/index.js +1 -0
- package/prod/utils/index.d.ts +41 -0
- package/prod/utils/index.js +1 -0
- package/dist/cli/build.d.ts +0 -7
- package/dist/cli/build.js +0 -234
- package/dist/cli/dev-server/client.d.ts +0 -2
- package/dist/cli/dev-server/client.js +0 -21
- package/dist/cli/dev-server/config.d.ts +0 -3
- package/dist/cli/dev-server/config.js +0 -3
- package/dist/cli/dev-server/handles.d.ts +0 -4
- package/dist/cli/dev-server/handles.js +0 -5
- package/dist/cli/dev-server/hmr.d.ts +0 -1
- package/dist/cli/dev-server/hmr.js +0 -13
- package/dist/cli/dev-server/index.d.ts +0 -4
- package/dist/cli/dev-server/index.js +0 -17
- package/dist/cli/dev-server/server.js +0 -59
- package/dist/cli/dev-server/syncFiles.d.ts +0 -3
- package/dist/cli/dev-server/syncFiles.js +0 -37
- package/dist/cli/index.d.ts +0 -23
- package/dist/cli/index.js +0 -1
- package/dist/cli/init.d.ts +0 -9
- package/dist/cli/init.js +0 -80
- package/dist/cli/load.d.ts +0 -3
- package/dist/cli/load.js +0 -94
- package/dist/cli/start.d.ts +0 -2
- package/dist/cli/start.js +0 -2
- package/dist/cli/tools/textureSet.d.ts +0 -13
- package/dist/cli/tools/textureSet.js +0 -103
- package/dist/cli/utils.d.ts +0 -13
- package/dist/cli/utils.js +0 -89
- package/dist/core/addon/biome.d.ts +0 -22
- package/dist/core/addon/biome.js +0 -27
- package/dist/core/addon/block/block.d.ts +0 -41
- package/dist/core/addon/block/block.js +0 -46
- package/dist/core/addon/controllers/animationController.d.ts +0 -43
- package/dist/core/addon/controllers/animationController.js +0 -73
- package/dist/core/addon/entity/clientEntity.d.ts +0 -107
- package/dist/core/addon/entity/clientEntity.js +0 -149
- package/dist/core/addon/entity/entity.d.ts +0 -42
- package/dist/core/addon/entity/entity.js +0 -50
- package/dist/core/addon/feature/oreFeature.d.ts +0 -19
- package/dist/core/addon/feature/oreFeature.js +0 -24
- package/dist/core/addon/featureRule.d.ts +0 -20
- package/dist/core/addon/featureRule.js +0 -25
- package/dist/core/addon/item/attachable.d.ts +0 -94
- package/dist/core/addon/item/attachable.js +0 -134
- package/dist/core/addon/item/item.d.ts +0 -19
- package/dist/core/addon/item/item.js +0 -26
- package/dist/core/addon/manifest.d.ts +0 -49
- package/dist/core/addon/manifest.js +0 -65
- package/dist/core/addon/menuCategory.d.ts +0 -6
- package/dist/core/addon/menuCategory.js +0 -7
- package/dist/core/addon/recipe/baseRecipe.d.ts +0 -12
- package/dist/core/addon/recipe/baseRecipe.js +0 -23
- package/dist/core/addon/recipe/data.d.ts +0 -66
- package/dist/core/addon/recipe/data.js +0 -74
- package/dist/core/addon/recipe/furnace.d.ts +0 -17
- package/dist/core/addon/recipe/furnace.js +0 -43
- package/dist/core/addon/recipe/shaped.d.ts +0 -26
- package/dist/core/addon/recipe/shaped.js +0 -53
- package/dist/core/addon/recipe/shapeless.d.ts +0 -18
- package/dist/core/addon/recipe/shapeless.js +0 -36
- package/dist/core/biome/biome.d.ts +0 -14
- package/dist/core/biome/biome.js +0 -23
- package/dist/core/biome/biomeComponent.d.ts +0 -46
- package/dist/core/biome/biomeComponent.js +0 -77
- package/dist/core/block/basicBlock.d.ts +0 -48
- package/dist/core/block/basicBlock.js +0 -105
- package/dist/core/block/block.d.ts +0 -32
- package/dist/core/block/block.js +0 -92
- package/dist/core/block/blockComponent.d.ts +0 -187
- package/dist/core/block/blockComponent.js +0 -500
- package/dist/core/block/cropBlock.d.ts +0 -4
- package/dist/core/block/cropBlock.js +0 -27
- package/dist/core/block/geometryBlock.d.ts +0 -12
- package/dist/core/block/geometryBlock.js +0 -16
- package/dist/core/block/oreBlock.d.ts +0 -9
- package/dist/core/block/oreBlock.js +0 -25
- package/dist/core/block/rotatableBlock.d.ts +0 -27
- package/dist/core/block/rotatableBlock.js +0 -107
- package/dist/core/block/tileBlock.d.ts +0 -17
- package/dist/core/block/tileBlock.js +0 -125
- package/dist/core/entity/basicEntity.d.ts +0 -111
- package/dist/core/entity/basicEntity.js +0 -170
- package/dist/core/entity/behavior/followMob.d.ts +0 -12
- package/dist/core/entity/behavior/followMob.js +0 -35
- package/dist/core/entity/behavior/followParent.d.ts +0 -7
- package/dist/core/entity/behavior/followParent.js +0 -15
- package/dist/core/entity/behavior/randomStroll.d.ts +0 -31
- package/dist/core/entity/behavior/randomStroll.js +0 -63
- package/dist/core/entity/behavior/tempt.d.ts +0 -73
- package/dist/core/entity/behavior/tempt.js +0 -134
- package/dist/core/entity/bundles/basicBundle.d.ts +0 -13
- package/dist/core/entity/bundles/basicBundle.js +0 -45
- package/dist/core/entity/clientEntity.d.ts +0 -20
- package/dist/core/entity/clientEntity.js +0 -37
- package/dist/core/entity/componets/entityComponet.d.ts +0 -202
- package/dist/core/entity/componets/entityComponet.js +0 -347
- package/dist/core/entity/data/nativeEntityData.d.ts +0 -9
- package/dist/core/entity/data/nativeEntityData.js +0 -38
- package/dist/core/entity/entity.d.ts +0 -15
- package/dist/core/entity/entity.js +0 -18
- package/dist/core/entity/nativeEntity.d.ts +0 -8
- package/dist/core/entity/nativeEntity.js +0 -28
- package/dist/core/entity/navigation/walk.d.ts +0 -23
- package/dist/core/entity/navigation/walk.js +0 -56
- package/dist/core/entity/projectile.d.ts +0 -3
- package/dist/core/entity/projectile.js +0 -7
- package/dist/core/factory/biomeFactory.d.ts +0 -4
- package/dist/core/factory/biomeFactory.js +0 -13
- package/dist/core/factory/blockFactory.d.ts +0 -34
- package/dist/core/factory/blockFactory.js +0 -143
- package/dist/core/factory/entityFactory.d.ts +0 -17
- package/dist/core/factory/entityFactory.js +0 -75
- package/dist/core/factory/featureFactory.d.ts +0 -6
- package/dist/core/factory/featureFactory.js +0 -23
- package/dist/core/factory/itemExtra.d.ts +0 -8
- package/dist/core/factory/itemExtra.js +0 -9
- package/dist/core/factory/itemFactory.d.ts +0 -27
- package/dist/core/factory/itemFactory.js +0 -112
- package/dist/core/factory/recipeFactory.d.ts +0 -18
- package/dist/core/factory/recipeFactory.js +0 -39
- package/dist/core/factory/uiFactory.d.ts +0 -12
- package/dist/core/factory/uiFactory.js +0 -32
- package/dist/core/feature/oreFeature.d.ts +0 -10
- package/dist/core/feature/oreFeature.js +0 -11
- package/dist/core/feature-rule/condition/biomeFilter.d.ts +0 -26
- package/dist/core/feature-rule/condition/biomeFilter.js +0 -36
- package/dist/core/feature-rule/condition/featureConditions.d.ts +0 -27
- package/dist/core/feature-rule/condition/featureConditions.js +0 -37
- package/dist/core/feature-rule/distribution/coordinateDistribution.d.ts +0 -17
- package/dist/core/feature-rule/distribution/coordinateDistribution.js +0 -23
- package/dist/core/feature-rule/distribution/featureDistribution.d.ts +0 -31
- package/dist/core/feature-rule/distribution/featureDistribution.js +0 -41
- package/dist/core/feature-rule/featureRule.d.ts +0 -17
- package/dist/core/feature-rule/featureRule.js +0 -26
- package/dist/core/index.js +0 -1
- package/dist/core/item/armor.d.ts +0 -21
- package/dist/core/item/armor.js +0 -90
- package/dist/core/item/attachable.d.ts +0 -6
- package/dist/core/item/attachable.js +0 -26
- package/dist/core/item/food.d.ts +0 -24
- package/dist/core/item/food.js +0 -38
- package/dist/core/item/item.d.ts +0 -36
- package/dist/core/item/item.js +0 -69
- package/dist/core/item/itemComponents.d.ts +0 -113
- package/dist/core/item/itemComponents.js +0 -225
- package/dist/core/registry.d.ts +0 -12
- package/dist/core/registry.js +0 -16
- package/dist/core/texture.d.ts +0 -18
- package/dist/core/texture.js +0 -38
- package/dist/core/ui/buttonMapping.d.ts +0 -97
- package/dist/core/ui/buttonMapping.js +0 -132
- package/dist/core/ui/dataBindingObject.d.ts +0 -97
- package/dist/core/ui/dataBindingObject.js +0 -134
- package/dist/core/ui/elements/button.d.ts +0 -21
- package/dist/core/ui/elements/button.js +0 -101
- package/dist/core/ui/elements/collectionPanel.d.ts +0 -12
- package/dist/core/ui/elements/collectionPanel.js +0 -53
- package/dist/core/ui/elements/grid.d.ts +0 -8
- package/dist/core/ui/elements/grid.js +0 -33
- package/dist/core/ui/elements/image.d.ts +0 -13
- package/dist/core/ui/elements/image.js +0 -55
- package/dist/core/ui/elements/label.d.ts +0 -14
- package/dist/core/ui/elements/label.js +0 -61
- package/dist/core/ui/elements/panel.d.ts +0 -11
- package/dist/core/ui/elements/panel.js +0 -49
- package/dist/core/ui/elements/scrollingPanel.d.ts +0 -14
- package/dist/core/ui/elements/scrollingPanel.js +0 -59
- package/dist/core/ui/elements/stackPanel.d.ts +0 -14
- package/dist/core/ui/elements/stackPanel.js +0 -37
- package/dist/core/ui/elements/uiElement.d.ts +0 -53
- package/dist/core/ui/elements/uiElement.js +0 -129
- package/dist/core/ui/properties/control.d.ts +0 -214
- package/dist/core/ui/properties/control.js +0 -286
- package/dist/core/ui/properties/dataBinding.d.ts +0 -6
- package/dist/core/ui/properties/dataBinding.js +0 -16
- package/dist/core/ui/properties/factory.d.ts +0 -37
- package/dist/core/ui/properties/factory.js +0 -62
- package/dist/core/ui/properties/gridProp.d.ts +0 -65
- package/dist/core/ui/properties/gridProp.js +0 -90
- package/dist/core/ui/properties/input.d.ts +0 -97
- package/dist/core/ui/properties/input.js +0 -134
- package/dist/core/ui/properties/layout.d.ts +0 -105
- package/dist/core/ui/properties/layout.js +0 -145
- package/dist/core/ui/properties/scrollView.d.ts +0 -105
- package/dist/core/ui/properties/scrollView.js +0 -145
- package/dist/core/ui/properties/sound.d.ts +0 -47
- package/dist/core/ui/properties/sound.js +0 -66
- package/dist/core/ui/properties/sprite.d.ts +0 -161
- package/dist/core/ui/properties/sprite.js +0 -222
- package/dist/core/ui/properties/text.d.ts +0 -135
- package/dist/core/ui/properties/text.js +0 -187
- package/dist/core/ui/registry/uiSystemRegistry.d.ts +0 -8
- package/dist/core/ui/registry/uiSystemRegistry.js +0 -26
- package/dist/core/ui/systems/chest.d.ts +0 -5
- package/dist/core/ui/systems/chest.js +0 -21
- package/dist/core/ui/systems/containerUISystem.d.ts +0 -67
- package/dist/core/ui/systems/containerUISystem.js +0 -214
- package/dist/core/ui/systems/guidebook.d.ts +0 -9
- package/dist/core/ui/systems/guidebook.js +0 -206
- package/dist/core/ui/systems/serverForm.d.ts +0 -13
- package/dist/core/ui/systems/serverForm.js +0 -116
- package/dist/core/ui/systems/system.d.ts +0 -16
- package/dist/core/ui/systems/system.js +0 -37
- package/dist/oc/index.js +0 -1
- package/doc/cli.md +0 -24
- /package/doc/hello_sapdon/{sapdon/344/275/277/347/224/250/346/225/231/347/250/213.md" → hello_sapdon.md} +0 -0
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ButtonMapping 类
|
|
3
|
-
*
|
|
4
|
-
* 该类表示按钮映射配置,用于定义输入事件的映射关系。
|
|
5
|
-
*
|
|
6
|
-
* 属性:
|
|
7
|
-
* - ignored: boolean - 是否忽略映射(默认值:false)
|
|
8
|
-
* - from_button_id: string - 触发事件的按钮 ID
|
|
9
|
-
* - to_button_id: string - 事件触发时执行的按钮 ID
|
|
10
|
-
* - mapping_type: enum - 映射类型(可能值:global, pressed, double_pressed, focused)
|
|
11
|
-
* - scope: enum - 映射范围(可能值:view, controller)
|
|
12
|
-
* - input_mode_condition: enum - 输入模式条件(可能值:not_gaze, not_gamepad, gamepad_and_not_gaze)
|
|
13
|
-
* - ignore_input_scope: boolean - 是否忽略输入范围
|
|
14
|
-
* - consume_event: boolean - 是否消耗事件
|
|
15
|
-
* - handle_select: boolean - 是否处理选择事件
|
|
16
|
-
* - handle_deselect: boolean - 是否处理取消选择事件
|
|
17
|
-
* - button_up_right_of_first_refusal: boolean - 是否在首次拒绝后处理按钮释放事件
|
|
18
|
-
*/
|
|
19
|
-
export class ButtonMapping {
|
|
20
|
-
constructor() {
|
|
21
|
-
this.ignored = false;
|
|
22
|
-
this.from_button_id = '';
|
|
23
|
-
this.to_button_id = '';
|
|
24
|
-
this.mapping_type = null;
|
|
25
|
-
this.scope = null;
|
|
26
|
-
this.input_mode_condition = null;
|
|
27
|
-
this.ignore_input_scope = false;
|
|
28
|
-
this.consume_event = false;
|
|
29
|
-
this.handle_select = false;
|
|
30
|
-
this.handle_deselect = false;
|
|
31
|
-
this.button_up_right_of_first_refusal = false;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* 设置是否忽略映射。
|
|
35
|
-
* @param {boolean} ignored - 是否忽略映射(默认值:false)
|
|
36
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
37
|
-
*/
|
|
38
|
-
setIgnored(ignored = false) {
|
|
39
|
-
this.ignored = ignored;
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* 设置触发事件的按钮 ID。
|
|
44
|
-
* @param {string} fromButtonId - 触发事件的按钮 ID
|
|
45
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
46
|
-
*/
|
|
47
|
-
setFromButtonId(fromButtonId) {
|
|
48
|
-
this.from_button_id = fromButtonId;
|
|
49
|
-
return this;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* 设置事件触发时执行的按钮 ID。
|
|
53
|
-
* @param {string} toButtonId - 事件触发时执行的按钮 ID
|
|
54
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
55
|
-
*/
|
|
56
|
-
setToButtonId(toButtonId) {
|
|
57
|
-
this.to_button_id = toButtonId;
|
|
58
|
-
return this;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* 设置映射类型。
|
|
62
|
-
* @param {string} mappingType - 映射类型(可能值:global, pressed, double_pressed, focused)
|
|
63
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
64
|
-
*/
|
|
65
|
-
setMappingType(mappingType) {
|
|
66
|
-
this.mapping_type = mappingType;
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* 设置映射范围。
|
|
71
|
-
* @param {string} scope - 映射范围(可能值:view, controller)
|
|
72
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
73
|
-
*/
|
|
74
|
-
setScope(scope) {
|
|
75
|
-
this.scope = scope;
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* 设置输入模式条件。
|
|
80
|
-
* @param {string} condition - 输入模式条件(可能值:not_gaze, not_gamepad, gamepad_and_not_gaze)
|
|
81
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
82
|
-
*/
|
|
83
|
-
setInputModeCondition(condition) {
|
|
84
|
-
this.input_mode_condition = condition;
|
|
85
|
-
return this;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* 设置是否忽略输入范围。
|
|
89
|
-
* @param {boolean} ignore - 是否忽略输入范围
|
|
90
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
91
|
-
*/
|
|
92
|
-
setIgnoreInputScope(ignore = false) {
|
|
93
|
-
this.ignore_input_scope = ignore;
|
|
94
|
-
return this;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* 设置是否消耗事件。
|
|
98
|
-
* @param {boolean} consume - 是否消耗事件
|
|
99
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
100
|
-
*/
|
|
101
|
-
setConsumeEvent(consume = false) {
|
|
102
|
-
this.consume_event = consume;
|
|
103
|
-
return this;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* 设置是否处理选择事件。
|
|
107
|
-
* @param {boolean} handle - 是否处理选择事件
|
|
108
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
109
|
-
*/
|
|
110
|
-
setHandleSelect(handle = false) {
|
|
111
|
-
this.handle_select = handle;
|
|
112
|
-
return this;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* 设置是否处理取消选择事件。
|
|
116
|
-
* @param {boolean} handle - 是否处理取消选择事件
|
|
117
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
118
|
-
*/
|
|
119
|
-
setHandleDeselect(handle = false) {
|
|
120
|
-
this.handle_deselect = handle;
|
|
121
|
-
return this;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* 设置是否在首次拒绝后处理按钮释放事件。
|
|
125
|
-
* @param {boolean} handle - 是否处理按钮释放事件
|
|
126
|
-
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
127
|
-
*/
|
|
128
|
-
setButtonUpRightOfFirstRefusal(handle = false) {
|
|
129
|
-
this.button_up_right_of_first_refusal = handle;
|
|
130
|
-
return this;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DataBinding 类
|
|
3
|
-
*
|
|
4
|
-
* 该类表示数据绑定配置,用于将硬编码值或变量绑定到元素属性。
|
|
5
|
-
*
|
|
6
|
-
* 属性:
|
|
7
|
-
* - ignored: boolean - 是否忽略绑定(默认值:false)
|
|
8
|
-
* - binding_type: enum - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
9
|
-
* - binding_name: string - 数据绑定名称或条件的值
|
|
10
|
-
* - binding_name_override: string - 应用 binding_name 值的 UI 元素属性名称
|
|
11
|
-
* - binding_collection_name: string - 要使用的集合名称
|
|
12
|
-
* - binding_collection_prefix: string - 集合前缀
|
|
13
|
-
* - binding_condition: enum - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
14
|
-
* - source_control_name: string - 要观察其属性值的 UI 元素名称
|
|
15
|
-
* - source_property_name: string - 存储 source_control_name 引用的 UI 元素的属性值
|
|
16
|
-
* - target_property_name: string - 应用 source_property_name 值的 UI 元素属性
|
|
17
|
-
* - resolve_sibling_scope: boolean - 是否允许选择同级元素而非子元素(默认值:false)
|
|
18
|
-
*/
|
|
19
|
-
export class DataBindingObject {
|
|
20
|
-
/**
|
|
21
|
-
* 设置是否忽略绑定。
|
|
22
|
-
* @param {boolean} ignored - 是否忽略绑定(默认值:false)
|
|
23
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
24
|
-
*/
|
|
25
|
-
setIgnored(ignored?: boolean): DataBindingObject;
|
|
26
|
-
ignored: boolean | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* 设置绑定类型。
|
|
29
|
-
* @param {string} type - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
30
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
31
|
-
*/
|
|
32
|
-
setBindingType(type: string): DataBindingObject;
|
|
33
|
-
binding_type: string | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* 设置数据绑定名称或条件的值。
|
|
36
|
-
* @param {string} name - 数据绑定名称或条件的值
|
|
37
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
38
|
-
*/
|
|
39
|
-
setBindingName(name: string): DataBindingObject;
|
|
40
|
-
binding_name: string | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* 设置应用 binding_name 值的 UI 元素属性名称。
|
|
43
|
-
* @param {string} nameOverride - 应用 binding_name 值的 UI 元素属性名称
|
|
44
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
45
|
-
*/
|
|
46
|
-
setBindingNameOverride(nameOverride: string): DataBindingObject;
|
|
47
|
-
binding_name_override: string | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* 设置要使用的集合名称。
|
|
50
|
-
* @param {string} collectionName - 集合名称
|
|
51
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
52
|
-
*/
|
|
53
|
-
setBindingCollectionName(collectionName: string): DataBindingObject;
|
|
54
|
-
binding_collection_name: string | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* 设置集合前缀。
|
|
57
|
-
* @param {string} prefix - 集合前缀
|
|
58
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
59
|
-
*/
|
|
60
|
-
setBindingCollectionPrefix(prefix: string): DataBindingObject;
|
|
61
|
-
binding_collection_prefix: string | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* 设置数据绑定的条件。
|
|
64
|
-
* @param {string} condition - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
65
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
66
|
-
*/
|
|
67
|
-
setBindingCondition(condition: string): DataBindingObject;
|
|
68
|
-
binding_condition: string | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* 设置要观察其属性值的 UI 元素名称。
|
|
71
|
-
* @param {string} controlName - UI 元素名称
|
|
72
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
73
|
-
*/
|
|
74
|
-
setSourceControlName(controlName: string): DataBindingObject;
|
|
75
|
-
source_control_name: string | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* 设置存储 source_control_name 引用的 UI 元素的属性值。
|
|
78
|
-
* @param {string} propertyName - 属性名称
|
|
79
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
80
|
-
*/
|
|
81
|
-
setSourcePropertyName(propertyName: string): DataBindingObject;
|
|
82
|
-
source_property_name: string | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* 设置应用 source_property_name 值的 UI 元素属性。
|
|
85
|
-
* @param {string} propertyName - 属性名称
|
|
86
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
87
|
-
*/
|
|
88
|
-
setTargetPropertyName(propertyName: string): DataBindingObject;
|
|
89
|
-
target_property_name: string | undefined;
|
|
90
|
-
/**
|
|
91
|
-
* 设置是否允许选择同级元素而非子元素。
|
|
92
|
-
* @param {boolean} resolve - 是否允许选择同级元素(默认值:false)
|
|
93
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
94
|
-
*/
|
|
95
|
-
setResolveSiblingScope(resolve?: boolean): DataBindingObject;
|
|
96
|
-
resolve_sibling_scope: boolean | undefined;
|
|
97
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DataBinding 类
|
|
3
|
-
*
|
|
4
|
-
* 该类表示数据绑定配置,用于将硬编码值或变量绑定到元素属性。
|
|
5
|
-
*
|
|
6
|
-
* 属性:
|
|
7
|
-
* - ignored: boolean - 是否忽略绑定(默认值:false)
|
|
8
|
-
* - binding_type: enum - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
9
|
-
* - binding_name: string - 数据绑定名称或条件的值
|
|
10
|
-
* - binding_name_override: string - 应用 binding_name 值的 UI 元素属性名称
|
|
11
|
-
* - binding_collection_name: string - 要使用的集合名称
|
|
12
|
-
* - binding_collection_prefix: string - 集合前缀
|
|
13
|
-
* - binding_condition: enum - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
14
|
-
* - source_control_name: string - 要观察其属性值的 UI 元素名称
|
|
15
|
-
* - source_property_name: string - 存储 source_control_name 引用的 UI 元素的属性值
|
|
16
|
-
* - target_property_name: string - 应用 source_property_name 值的 UI 元素属性
|
|
17
|
-
* - resolve_sibling_scope: boolean - 是否允许选择同级元素而非子元素(默认值:false)
|
|
18
|
-
*/
|
|
19
|
-
export class DataBindingObject {
|
|
20
|
-
constructor() {
|
|
21
|
-
/*
|
|
22
|
-
this.ignored = false;
|
|
23
|
-
this.binding_type = null;
|
|
24
|
-
this.binding_name = '';
|
|
25
|
-
this.binding_name_override = '';
|
|
26
|
-
this.binding_collection_name = '';
|
|
27
|
-
this.binding_collection_prefix = '';
|
|
28
|
-
this.binding_condition = null;
|
|
29
|
-
this.source_control_name = '';
|
|
30
|
-
this.source_property_name = '';
|
|
31
|
-
this.target_property_name = '';
|
|
32
|
-
this.resolve_sibling_scope = false;
|
|
33
|
-
*/
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 设置是否忽略绑定。
|
|
37
|
-
* @param {boolean} ignored - 是否忽略绑定(默认值:false)
|
|
38
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
39
|
-
*/
|
|
40
|
-
setIgnored(ignored = false) {
|
|
41
|
-
this.ignored = ignored;
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* 设置绑定类型。
|
|
46
|
-
* @param {string} type - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
47
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
48
|
-
*/
|
|
49
|
-
setBindingType(type) {
|
|
50
|
-
this.binding_type = type;
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* 设置数据绑定名称或条件的值。
|
|
55
|
-
* @param {string} name - 数据绑定名称或条件的值
|
|
56
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
57
|
-
*/
|
|
58
|
-
setBindingName(name) {
|
|
59
|
-
this.binding_name = name;
|
|
60
|
-
return this;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* 设置应用 binding_name 值的 UI 元素属性名称。
|
|
64
|
-
* @param {string} nameOverride - 应用 binding_name 值的 UI 元素属性名称
|
|
65
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
66
|
-
*/
|
|
67
|
-
setBindingNameOverride(nameOverride) {
|
|
68
|
-
this.binding_name_override = nameOverride;
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* 设置要使用的集合名称。
|
|
73
|
-
* @param {string} collectionName - 集合名称
|
|
74
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
75
|
-
*/
|
|
76
|
-
setBindingCollectionName(collectionName) {
|
|
77
|
-
this.binding_collection_name = collectionName;
|
|
78
|
-
return this;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* 设置集合前缀。
|
|
82
|
-
* @param {string} prefix - 集合前缀
|
|
83
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
84
|
-
*/
|
|
85
|
-
setBindingCollectionPrefix(prefix) {
|
|
86
|
-
this.binding_collection_prefix = prefix;
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* 设置数据绑定的条件。
|
|
91
|
-
* @param {string} condition - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
92
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
93
|
-
*/
|
|
94
|
-
setBindingCondition(condition) {
|
|
95
|
-
this.binding_condition = condition;
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* 设置要观察其属性值的 UI 元素名称。
|
|
100
|
-
* @param {string} controlName - UI 元素名称
|
|
101
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
102
|
-
*/
|
|
103
|
-
setSourceControlName(controlName) {
|
|
104
|
-
this.source_control_name = controlName;
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* 设置存储 source_control_name 引用的 UI 元素的属性值。
|
|
109
|
-
* @param {string} propertyName - 属性名称
|
|
110
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
111
|
-
*/
|
|
112
|
-
setSourcePropertyName(propertyName) {
|
|
113
|
-
this.source_property_name = propertyName;
|
|
114
|
-
return this;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* 设置应用 source_property_name 值的 UI 元素属性。
|
|
118
|
-
* @param {string} propertyName - 属性名称
|
|
119
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
120
|
-
*/
|
|
121
|
-
setTargetPropertyName(propertyName) {
|
|
122
|
-
this.target_property_name = propertyName;
|
|
123
|
-
return this;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* 设置是否允许选择同级元素而非子元素。
|
|
127
|
-
* @param {boolean} resolve - 是否允许选择同级元素(默认值:false)
|
|
128
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
129
|
-
*/
|
|
130
|
-
setResolveSiblingScope(resolve = false) {
|
|
131
|
-
this.resolve_sibling_scope = resolve;
|
|
132
|
-
return this;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export class Button extends UIElement {
|
|
2
|
-
constructor(id: any, template: any);
|
|
3
|
-
input: Input;
|
|
4
|
-
sound: Sound;
|
|
5
|
-
layout: Layout;
|
|
6
|
-
dataBinding: DataBinding;
|
|
7
|
-
factory: Factory;
|
|
8
|
-
setDefaultControl(default_control: any): this;
|
|
9
|
-
setHoverControl(hover_control: any): this;
|
|
10
|
-
setPressedControl(pressed_control: any): this;
|
|
11
|
-
setLockedControl(locked_control: any): this;
|
|
12
|
-
setInput(input: any): this;
|
|
13
|
-
setSound(sound: any): this;
|
|
14
|
-
setLayout(layout: any): this;
|
|
15
|
-
}
|
|
16
|
-
import { UIElement } from "./uiElement.js";
|
|
17
|
-
import { Input } from "../properties/input.js";
|
|
18
|
-
import { Sound } from "../properties/sound.js";
|
|
19
|
-
import { Layout } from "../properties/layout.js";
|
|
20
|
-
import { DataBinding } from "../properties/dataBinding.js";
|
|
21
|
-
import { Factory } from "../properties/factory.js";
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Button
|
|
3
|
-
Property Name Type Default Value Description
|
|
4
|
-
default_control string Name of the child control that will be displayed only in the default state
|
|
5
|
-
hover_control string Name of the child control that will be displayed only in the hover state
|
|
6
|
-
pressed_control string Name of the child control that will be displayed only in the pressed state
|
|
7
|
-
locked_control string Name of the child control that will be displayed only in the locked state
|
|
8
|
-
*/
|
|
9
|
-
import { Control } from "../properties/control.js";
|
|
10
|
-
import { DataBinding } from "../properties/dataBinding.js";
|
|
11
|
-
import { Factory } from "../properties/factory.js";
|
|
12
|
-
import { Input } from "../properties/input.js";
|
|
13
|
-
import { Layout } from "../properties/layout.js";
|
|
14
|
-
import { Sound } from "../properties/sound.js";
|
|
15
|
-
import { UIElement } from "./uiElement.js";
|
|
16
|
-
export class Button extends UIElement {
|
|
17
|
-
constructor(id, template) {
|
|
18
|
-
super(id, "button", template);
|
|
19
|
-
this.input = new Input();
|
|
20
|
-
this.sound = new Sound();
|
|
21
|
-
this.control = new Control();
|
|
22
|
-
this.layout = new Layout();
|
|
23
|
-
this.dataBinding = new DataBinding();
|
|
24
|
-
this.factory = new Factory();
|
|
25
|
-
}
|
|
26
|
-
setDefaultControl(default_control) {
|
|
27
|
-
this.addProp("default_control", default_control);
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
setHoverControl(hover_control) {
|
|
31
|
-
this.addProp("hover_control", hover_control);
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
setPressedControl(pressed_control) {
|
|
35
|
-
this.addProp("pressed_control", pressed_control);
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
setLockedControl(locked_control) {
|
|
39
|
-
this.addProp("locked_control", locked_control);
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
setInput(input) {
|
|
43
|
-
if (!(input instanceof Input))
|
|
44
|
-
new Error("需求Input类");
|
|
45
|
-
this.input = input;
|
|
46
|
-
return this;
|
|
47
|
-
}
|
|
48
|
-
setSound(sound) {
|
|
49
|
-
if (!(sound instanceof Sound))
|
|
50
|
-
new Error("需求Sound类");
|
|
51
|
-
this.sound = sound;
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
setLayout(layout) {
|
|
55
|
-
if (!(layout instanceof Layout))
|
|
56
|
-
new Error("参数需要Layout类");
|
|
57
|
-
this.layout = layout;
|
|
58
|
-
return this;
|
|
59
|
-
}
|
|
60
|
-
serialize() {
|
|
61
|
-
//序列化
|
|
62
|
-
// 复制Layout的属性
|
|
63
|
-
for (const key in this.layout) {
|
|
64
|
-
if (this.layout.hasOwnProperty(key)) {
|
|
65
|
-
this.properties.set(key, this.layout[key]);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
// 复制input的属性
|
|
69
|
-
for (const key in this.input) {
|
|
70
|
-
if (this.input.hasOwnProperty(key)) {
|
|
71
|
-
this.properties.set(key, this.input[key]);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// 复制sound的属性
|
|
75
|
-
for (const key in this.sound) {
|
|
76
|
-
if (this.sound.hasOwnProperty(key)) {
|
|
77
|
-
this.properties.set(key, this.sound[key]);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// 复制DataBinding的属性
|
|
81
|
-
for (const key in this.dataBinding) {
|
|
82
|
-
if (this.dataBinding.hasOwnProperty(key)) {
|
|
83
|
-
this.properties.set(key, this.dataBinding[key]);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
// 复制Factory的属性
|
|
87
|
-
for (const key in this.factory) {
|
|
88
|
-
if (this.factory.hasOwnProperty(key)) {
|
|
89
|
-
this.properties.set(key, this.factory[key]);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
// 复制Control的属性
|
|
93
|
-
for (const key in this.control) {
|
|
94
|
-
if (this.control.hasOwnProperty(key)) {
|
|
95
|
-
this.properties.set(key, this.control[key]);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
// 调用父类的serialize方法
|
|
99
|
-
return super.serialize();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export class CollectionPanel extends UIElement {
|
|
2
|
-
constructor(id: any, template: any);
|
|
3
|
-
layout: Layout;
|
|
4
|
-
dataBinding: DataBinding;
|
|
5
|
-
factory: Factory;
|
|
6
|
-
setCollectionName(collection_name: any): this;
|
|
7
|
-
setLayout(layout: any): this;
|
|
8
|
-
}
|
|
9
|
-
import { UIElement } from "./uiElement.js";
|
|
10
|
-
import { Layout } from "../properties/layout.js";
|
|
11
|
-
import { DataBinding } from "../properties/dataBinding.js";
|
|
12
|
-
import { Factory } from "../properties/factory.js";
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Control } from "../properties/control.js";
|
|
2
|
-
import { DataBinding } from "../properties/dataBinding.js";
|
|
3
|
-
import { Factory } from "../properties/factory.js";
|
|
4
|
-
import { Layout } from "../properties/layout.js";
|
|
5
|
-
import { UIElement } from "./uiElement.js";
|
|
6
|
-
export class CollectionPanel extends UIElement {
|
|
7
|
-
constructor(id, template) {
|
|
8
|
-
super(id, "collection_panel", template);
|
|
9
|
-
this.control = new Control();
|
|
10
|
-
this.layout = new Layout();
|
|
11
|
-
this.dataBinding = new DataBinding();
|
|
12
|
-
this.factory = new Factory();
|
|
13
|
-
}
|
|
14
|
-
setCollectionName(collection_name) {
|
|
15
|
-
this.addProp("collection_name", collection_name);
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
setLayout(layout) {
|
|
19
|
-
if (!(layout instanceof Layout))
|
|
20
|
-
new Error("参数需要Layout类");
|
|
21
|
-
this.layout = layout;
|
|
22
|
-
return this;
|
|
23
|
-
}
|
|
24
|
-
serialize() {
|
|
25
|
-
//序列化
|
|
26
|
-
// 复制Layout的属性
|
|
27
|
-
for (const key in this.layout) {
|
|
28
|
-
if (this.layout.hasOwnProperty(key)) {
|
|
29
|
-
this.properties.set(key, this.layout[key]);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
// 复制DataBinding的属性
|
|
33
|
-
for (const key in this.dataBinding) {
|
|
34
|
-
if (this.dataBinding.hasOwnProperty(key)) {
|
|
35
|
-
this.properties.set(key, this.dataBinding[key]);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// 复制Factory的属性
|
|
39
|
-
for (const key in this.factory) {
|
|
40
|
-
if (this.factory.hasOwnProperty(key)) {
|
|
41
|
-
this.properties.set(key, this.factory[key]);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// 复制Control的属性
|
|
45
|
-
for (const key in this.control) {
|
|
46
|
-
if (this.control.hasOwnProperty(key)) {
|
|
47
|
-
this.properties.set(key, this.control[key]);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// 调用父类的serialize方法
|
|
51
|
-
return super.serialize();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export class Grid extends CollectionPanel {
|
|
2
|
-
gridNum: number;
|
|
3
|
-
grid: GridProp;
|
|
4
|
-
setGridProp(grid_prop: any): this;
|
|
5
|
-
addGridItem(grid_position: any, content: any): this;
|
|
6
|
-
}
|
|
7
|
-
import { CollectionPanel } from "./collectionPanel.js";
|
|
8
|
-
import { GridProp } from "../properties/gridProp.js";
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { GridProp } from "../properties/gridProp.js";
|
|
2
|
-
import { CollectionPanel } from "./collectionPanel.js";
|
|
3
|
-
import { Panel } from "./panel.js";
|
|
4
|
-
export class Grid extends CollectionPanel {
|
|
5
|
-
constructor(id, template) {
|
|
6
|
-
super(id, template);
|
|
7
|
-
this.gridNum = 0;
|
|
8
|
-
this.grid = new GridProp();
|
|
9
|
-
}
|
|
10
|
-
setGridProp(grid_prop) {
|
|
11
|
-
this.grid = grid_prop;
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
addGridItem(grid_position, content) {
|
|
15
|
-
const grid_item = new Panel(`grid_item_${this.gridNum}`);
|
|
16
|
-
grid_item.addProp("grid_position", grid_position);
|
|
17
|
-
grid_item.addControl(content);
|
|
18
|
-
this.addControl(grid_item);
|
|
19
|
-
this.gridNum++;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
serialize() {
|
|
23
|
-
// 复制grid的属性
|
|
24
|
-
for (const key in this.grid) {
|
|
25
|
-
if (this.grid.hasOwnProperty(key)) {
|
|
26
|
-
this.properties.set(key, this.grid[key]);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
//类型修正
|
|
30
|
-
this.properties.set("type", "grid");
|
|
31
|
-
return super.serialize();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class Image extends UIElement {
|
|
2
|
-
constructor(id: any, template: any);
|
|
3
|
-
sprite: Sprite;
|
|
4
|
-
layout: Layout;
|
|
5
|
-
dataBinding: DataBinding;
|
|
6
|
-
factory: Factory;
|
|
7
|
-
setSprite(sprite: any): this;
|
|
8
|
-
}
|
|
9
|
-
import { UIElement } from "./uiElement.js";
|
|
10
|
-
import { Sprite } from "../properties/sprite.js";
|
|
11
|
-
import { Layout } from "../properties/layout.js";
|
|
12
|
-
import { DataBinding } from "../properties/dataBinding.js";
|
|
13
|
-
import { Factory } from "../properties/factory.js";
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Control } from "../properties/control.js";
|
|
2
|
-
import { DataBinding } from "../properties/dataBinding.js";
|
|
3
|
-
import { Factory } from "../properties/factory.js";
|
|
4
|
-
import { Layout } from "../properties/layout.js";
|
|
5
|
-
import { Sprite } from "../properties/sprite.js";
|
|
6
|
-
import { UIElement } from "./uiElement.js";
|
|
7
|
-
export class Image extends UIElement {
|
|
8
|
-
constructor(id, template) {
|
|
9
|
-
super(id, "image", template);
|
|
10
|
-
this.sprite = new Sprite();
|
|
11
|
-
this.control = new Control();
|
|
12
|
-
this.layout = new Layout();
|
|
13
|
-
this.dataBinding = new DataBinding();
|
|
14
|
-
this.factory = new Factory();
|
|
15
|
-
}
|
|
16
|
-
setSprite(sprite) {
|
|
17
|
-
this.sprite = sprite;
|
|
18
|
-
return this;
|
|
19
|
-
}
|
|
20
|
-
serialize() {
|
|
21
|
-
//合并属性
|
|
22
|
-
// 复制Sprite的属性
|
|
23
|
-
for (const key in this.sprite) {
|
|
24
|
-
if (this.sprite.hasOwnProperty(key)) {
|
|
25
|
-
this.properties.set(key, this.sprite[key]);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// 复制Layout的属性
|
|
29
|
-
for (const key in this.layout) {
|
|
30
|
-
if (this.layout.hasOwnProperty(key)) {
|
|
31
|
-
this.properties.set(key, this.layout[key]);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
// 复制DataBinding的属性
|
|
35
|
-
for (const key in this.dataBinding) {
|
|
36
|
-
if (this.dataBinding.hasOwnProperty(key)) {
|
|
37
|
-
this.properties.set(key, this.dataBinding[key]);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
// 复制Factory的属性
|
|
41
|
-
for (const key in this.factory) {
|
|
42
|
-
if (this.factory.hasOwnProperty(key)) {
|
|
43
|
-
this.properties.set(key, this.factory[key]);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// 复制Control的属性
|
|
47
|
-
for (const key in this.control) {
|
|
48
|
-
if (this.control.hasOwnProperty(key)) {
|
|
49
|
-
this.properties.set(key, this.control[key]);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// 调用父类的serialize方法
|
|
53
|
-
return super.serialize();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class Label extends UIElement {
|
|
2
|
-
constructor(id: any, template: any);
|
|
3
|
-
text: Text;
|
|
4
|
-
layout: Layout;
|
|
5
|
-
dataBinding: DataBinding;
|
|
6
|
-
factory: Factory;
|
|
7
|
-
setLayout(layout: any): this;
|
|
8
|
-
setText(text: any): this;
|
|
9
|
-
}
|
|
10
|
-
import { UIElement } from "./uiElement.js";
|
|
11
|
-
import { Text } from "../properties/text.js";
|
|
12
|
-
import { Layout } from "../properties/layout.js";
|
|
13
|
-
import { DataBinding } from "../properties/dataBinding.js";
|
|
14
|
-
import { Factory } from "../properties/factory.js";
|