@lcap/nasl 1.0.0-alpha.2 → 1.0.0-alpha.5
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 +3 -3
- package/docs/assets/search.js +1 -1
- package/docs/classes/Entity.html +2832 -204
- package/docs/classes/View.html +4567 -365
- package/out/common/BaseNode.d.ts +1 -1
- package/out/common/BaseNode.js +38 -23
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +77 -15
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +2 -1
- package/out/concepts/Argument__.js +2 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +2 -1
- package/out/concepts/Assignment__.js +3 -8
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +2 -1
- package/out/concepts/BinaryExpression__.js +5 -5
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +2 -1
- package/out/concepts/BindAttribute__.js +9 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +2 -1
- package/out/concepts/BindDirective__.js +2 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +2 -1
- package/out/concepts/BindEvent__.js +4 -3
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +2 -1
- package/out/concepts/BooleanLiteral__.js +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +57 -1
- package/out/concepts/CallFunction__.js +119 -11
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -1
- package/out/concepts/CallInterface__.js +2 -2
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +57 -1
- package/out/concepts/CallLogic__.js +117 -10
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +1 -1
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +120 -0
- package/out/concepts/ConfigGroup__.js +214 -0
- package/out/concepts/ConfigGroup__.js.map +1 -0
- package/out/concepts/ConfigPropertyValue__.d.ts +43 -0
- package/out/concepts/ConfigPropertyValue__.js +103 -0
- package/out/concepts/ConfigPropertyValue__.js.map +1 -0
- package/out/concepts/ConfigProperty__.d.ts +128 -0
- package/out/concepts/ConfigProperty__.js +236 -0
- package/out/concepts/ConfigProperty__.js.map +1 -0
- package/out/concepts/Configuration__.d.ts +120 -0
- package/out/concepts/Configuration__.js +210 -0
- package/out/concepts/Configuration__.js.map +1 -0
- package/out/concepts/Constant__.d.ts +2 -1
- package/out/concepts/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +2 -1
- package/out/concepts/Destination__.js +4 -3
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +8 -0
- package/out/concepts/EntityIndex__.js +18 -0
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +5 -5
- package/out/concepts/EntityProperty__.js +10 -9
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +30 -26
- package/out/concepts/Entity__.js +44 -36
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +8 -8
- package/out/concepts/Enum__.js +10 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +35 -33
- package/out/concepts/ForEachStatement__.js +103 -36
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -1
- package/out/concepts/Identifier__.js +15 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +1 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +5 -1
- package/out/concepts/Interface__.js +19 -5
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -1
- package/out/concepts/LogicItem__.js +2 -2
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +9 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +2 -5
- package/out/concepts/MemberExpression__.js +12 -18
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +121 -126
- package/out/concepts/Module__.js +10 -17
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +12 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +2 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +2 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -1
- package/out/concepts/Param__.js +2 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +2 -2
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +82 -81
- package/out/concepts/ProcessElement__.js +19 -6
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.d.ts +1 -0
- package/out/concepts/Process__.js +10 -4
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +2 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +5 -0
- package/out/concepts/Role__.js +19 -2
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +2 -0
- package/out/concepts/SqlQueryComponent__.js +16 -0
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +2 -1
- package/out/concepts/StringLiteral__.js +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +1 -1
- package/out/concepts/StructureProperty__.js +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -1
- package/out/concepts/Structure__.js +4 -4
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +3 -0
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +2 -1
- package/out/concepts/UnaryExpression__.js +3 -3
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +2 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +2 -1
- package/out/concepts/ValidationRule__.js +2 -2
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +6 -5
- package/out/concepts/Variable__.js +3 -3
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +5 -5
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +5 -4
- package/out/concepts/ViewElement__.js +109 -65
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +97 -90
- package/out/concepts/View__.js +153 -118
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +2 -2
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +3 -137
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +21 -5
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.validation.js +527 -0
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
- package/out/concepts/index__.d.ts +4 -0
- package/out/concepts/index__.js +4 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/data/Module.d.ts +34 -0
- package/out/data/Module.js +53 -0
- package/out/data/Module.js.map +1 -0
- package/out/generator/compileComponent.d.ts +1 -1
- package/out/generator/genBundleFiles.d.ts +0 -1
- package/out/generator/genBundleFiles.js +1 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +35 -0
- package/out/generator/genMetaData.js +78 -0
- package/out/generator/genMetaData.js.map +1 -0
- package/out/generator/index.d.ts +1 -0
- package/out/generator/index.js +1 -0
- package/out/generator/index.js.map +1 -1
- package/out/index.d.ts +2 -2
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/server/createUiTs.d.ts +7 -0
- package/out/server/createUiTs.js +157 -0
- package/out/server/createUiTs.js.map +1 -0
- package/out/server/entity2LogicNamespace.d.ts +9 -1
- package/out/server/entity2LogicNamespace.js +11 -1
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/getExtensionModules.d.ts +3 -0
- package/out/server/getExtensionModules.js +18 -0
- package/out/server/getExtensionModules.js.map +1 -0
- package/out/server/getLogics.js +18 -15
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +3 -2
- package/out/server/getMemberIdentifier.js +47 -15
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +4 -1
- package/out/server/getProcesses.js +16 -7
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getValidates.js +1 -1
- package/out/server/getValidates.js.map +1 -1
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +23 -5
- package/out/server/naslServer.js +199 -25
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.d.ts +15 -1
- package/out/server/process2LogicNamespace.js +30 -3
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.js +28 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +5 -0
- package/out/service/storage/init.js +60 -52
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCallComponentLogic.js +2 -2
- package/out/templator/genCallComponentLogic.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -8
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +3 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -4
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -3
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +2 -2
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +1 -1
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +8 -12
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +20 -20
- package/out/templator/utils.js +22 -22
- package/out/templator/utils.js.map +1 -1
- package/package.json +3 -1
- package/src/automate/engine/index.js +37 -3
- package/src/automate/engine/utils.js +68 -64
- package/src/common/BaseNode.ts +43 -28
- package/src/concepts/App__.ts +93 -17
- package/src/concepts/Argument__.ts +4 -2
- package/src/concepts/Assignment__.ts +5 -7
- package/src/concepts/Attribute__.ts +1 -0
- package/src/concepts/BinaryExpression__.ts +7 -5
- package/src/concepts/BindAttribute__.ts +9 -4
- package/src/concepts/BindDirective__.ts +4 -2
- package/src/concepts/BindEvent__.ts +6 -4
- package/src/concepts/BooleanLiteral__.ts +3 -1
- package/src/concepts/CallFunction__.ts +195 -11
- package/src/concepts/CallInterface__.ts +4 -2
- package/src/concepts/CallLogic__.ts +211 -12
- package/src/concepts/CallQueryComponent__.ts +2 -1
- package/src/concepts/Comment__.ts +1 -0
- package/src/concepts/CompletionProperty__.ts +1 -0
- package/src/concepts/ConfigGroup__.ts +290 -0
- package/src/concepts/ConfigPropertyValue__.ts +112 -0
- package/src/concepts/ConfigProperty__.ts +306 -0
- package/src/concepts/Configuration__.ts +286 -0
- package/src/concepts/Constant__.ts +3 -1
- package/src/concepts/DataElement__.ts +1 -0
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/EntityIndex__.ts +19 -0
- package/src/concepts/EntityProperty__.ts +9 -8
- package/src/concepts/Entity__.ts +66 -59
- package/src/concepts/EnumItem__.ts +1 -0
- package/src/concepts/Enum__.ts +32 -12
- package/src/concepts/Event__.ts +2 -1
- package/src/concepts/ForEachStatement__.ts +115 -69
- package/src/concepts/Function__.ts +2 -1
- package/src/concepts/Identifier__.ts +18 -1
- package/src/concepts/IfStatement__.ts +1 -0
- package/src/concepts/InterfaceParam__.ts +2 -1
- package/src/concepts/Interface__.ts +21 -5
- package/src/concepts/JSBlock__.ts +1 -0
- package/src/concepts/LogicItem__.ts +9 -40
- package/src/concepts/Logic__.ts +48 -9
- package/src/concepts/MemberExpression__.ts +14 -17
- package/src/concepts/Module__.ts +158 -139
- package/src/concepts/Namespace__.ts +13 -12
- package/src/concepts/NullLiteral__.ts +3 -1
- package/src/concepts/NumericLiteral__.ts +3 -1
- package/src/concepts/Param__.ts +3 -2
- package/src/concepts/Point__.ts +1 -0
- package/src/concepts/ProcessComponent__.ts +3 -2
- package/src/concepts/ProcessElement__.ts +102 -107
- package/src/concepts/ProcessOutcome__.ts +1 -0
- package/src/concepts/Process__.ts +12 -4
- package/src/concepts/QueryAggregateExpression__.ts +1 -0
- package/src/concepts/QueryFieldExpression__.ts +2 -1
- package/src/concepts/QueryFromExpression__.ts +1 -0
- package/src/concepts/QueryGroupByExpression__.ts +1 -0
- package/src/concepts/QueryJoinExpression__.ts +2 -1
- package/src/concepts/QueryLimitExpression__.ts +1 -0
- package/src/concepts/QueryOrderByExpression__.ts +1 -0
- package/src/concepts/QuerySelectExpression__.ts +2 -1
- package/src/concepts/Rect__.ts +1 -0
- package/src/concepts/Return__.ts +3 -2
- package/src/concepts/Role__.ts +19 -2
- package/src/concepts/Slot__.ts +1 -0
- package/src/concepts/SqlQueryComponent__.ts +11 -1
- package/src/concepts/Start__.ts +1 -0
- package/src/concepts/StringLiteral__.ts +3 -1
- package/src/concepts/StructureProperty__.ts +2 -1
- package/src/concepts/Structure__.ts +5 -4
- package/src/concepts/SwitchCase__.ts +1 -0
- package/src/concepts/SwitchStatement__.ts +1 -0
- package/src/concepts/Theme__.ts +1 -0
- package/src/concepts/Transactional__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +4 -0
- package/src/concepts/TypeParam__.ts +1 -0
- package/src/concepts/UnaryExpression__.ts +6 -3
- package/src/concepts/Unparsed__.ts +3 -1
- package/src/concepts/UseComponent__.ts +1 -0
- package/src/concepts/ValidationRule__.ts +5 -2
- package/src/concepts/Variable__.ts +12 -6
- package/src/concepts/ViewComponent__.ts +6 -5
- package/src/concepts/ViewElement__.ts +109 -80
- package/src/concepts/View__.ts +245 -206
- package/src/concepts/WhileStatement__.ts +1 -0
- package/src/concepts/basics/stdlib/index.ts +2 -2
- package/src/concepts/basics/stdlib/nasl.ui.ts +3 -137
- package/src/concepts/basics/stdlib/nasl.util.ts +21 -5
- package/src/concepts/basics/stdlib/{nasl.validate.ts → nasl.validation.ts} +28 -28
- package/src/concepts/index__.ts +4 -0
- package/src/generator/compileComponent.ts +1 -1
- package/src/generator/genBundleFiles.ts +1 -2
- package/src/generator/genMetaData.ts +111 -0
- package/src/generator/index.ts +1 -0
- package/src/index.ts +2 -2
- package/src/server/createUiTs.ts +153 -0
- package/src/server/entity2LogicNamespace.ts +17 -1
- package/src/server/getExtensionModules.ts +13 -0
- package/src/server/getLogics.ts +19 -18
- package/src/server/getMemberIdentifier.ts +60 -19
- package/src/server/getProcesses.ts +15 -8
- package/src/server/getValidates.ts +1 -1
- package/src/server/index.ts +2 -1
- package/src/server/naslServer.ts +204 -24
- package/src/server/process2LogicNamespace.ts +44 -3
- package/src/server/translator.ts +121 -97
- package/src/service/config/api.js +32 -0
- package/src/service/config/index.js +6 -0
- package/src/service/creator/index.js +2 -2
- package/src/service/logic/checktypeSocket.js +49 -0
- package/src/service/modules/api.js +20 -0
- package/src/service/modules/index.js +6 -0
- package/src/service/storage/init.ts +62 -54
- package/src/templator/genCallComponentLogic.ts +2 -2
- package/src/templator/genCreateBlock.ts +19 -25
- package/src/templator/genCurdEditMultipleKeyBlock.ts +3 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -4
- package/src/templator/genEditTableBlock.ts +3 -3
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genListViewBlock.ts +2 -2
- package/src/templator/genSelectBlock.ts +1 -1
- package/src/templator/genUpdateBlock.ts +19 -25
- package/src/templator/utils.ts +25 -153
package/src/concepts/App__.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
11
11
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
12
12
|
|
|
13
13
|
import * as utils from '../utils';
|
|
14
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
14
15
|
import BaseNode from '../common/BaseNode';
|
|
15
16
|
import classMap from '../common/classMap';
|
|
16
17
|
import Entity from './Entity__';
|
|
@@ -22,6 +23,7 @@ import View from './View__';
|
|
|
22
23
|
import Process from './Process__';
|
|
23
24
|
import Role from './Role__';
|
|
24
25
|
import Theme from './Theme__';
|
|
26
|
+
import Configuration from './Configuration__';
|
|
25
27
|
import Module from './Module__';
|
|
26
28
|
|
|
27
29
|
/**
|
|
@@ -149,6 +151,12 @@ export class App extends BaseNode {
|
|
|
149
151
|
@property('Theme')
|
|
150
152
|
theme: Theme = new Theme();
|
|
151
153
|
|
|
154
|
+
/**
|
|
155
|
+
* 配置管理
|
|
156
|
+
*/
|
|
157
|
+
@property('Configuration')
|
|
158
|
+
configuration: Configuration = new Configuration();
|
|
159
|
+
|
|
152
160
|
/**
|
|
153
161
|
* 扩展模块列表
|
|
154
162
|
*/
|
|
@@ -197,7 +205,7 @@ export class App extends BaseNode {
|
|
|
197
205
|
|
|
198
206
|
getEntityExistingNames(excludedList: Array<Entity> = []) {
|
|
199
207
|
const excludedSet = new Set(excludedList);
|
|
200
|
-
return this.entities.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
208
|
+
return (this.entities || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
201
209
|
}
|
|
202
210
|
getEntityUniqueName(name = 'Entity1') {
|
|
203
211
|
return utils.unique(name, this.getEntityExistingNames());
|
|
@@ -339,7 +347,7 @@ export class App extends BaseNode {
|
|
|
339
347
|
|
|
340
348
|
getStructureExistingNames(excludedList: Array<Structure> = []) {
|
|
341
349
|
const excludedSet = new Set(excludedList);
|
|
342
|
-
return this.structures.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
350
|
+
return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
343
351
|
}
|
|
344
352
|
getStructureUniqueName(name = 'Structure1') {
|
|
345
353
|
return utils.unique(name, this.getStructureExistingNames());
|
|
@@ -481,7 +489,7 @@ export class App extends BaseNode {
|
|
|
481
489
|
|
|
482
490
|
getEnumExistingNames(excludedList: Array<Enum> = []) {
|
|
483
491
|
const excludedSet = new Set(excludedList);
|
|
484
|
-
return this.enums.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
492
|
+
return (this.enums || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
485
493
|
}
|
|
486
494
|
getEnumUniqueName(name = 'Enum1') {
|
|
487
495
|
return utils.unique(name, this.getEnumExistingNames());
|
|
@@ -623,7 +631,7 @@ export class App extends BaseNode {
|
|
|
623
631
|
|
|
624
632
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
625
633
|
const excludedSet = new Set(excludedList);
|
|
626
|
-
return this.logics.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
634
|
+
return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
627
635
|
}
|
|
628
636
|
getLogicUniqueName(name = 'logic1') {
|
|
629
637
|
return utils.unique(name, this.getLogicExistingNames());
|
|
@@ -765,7 +773,7 @@ export class App extends BaseNode {
|
|
|
765
773
|
|
|
766
774
|
getInterfaceExistingNames(excludedList: Array<Interface> = []) {
|
|
767
775
|
const excludedSet = new Set(excludedList);
|
|
768
|
-
return this.interfaces.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
776
|
+
return (this.interfaces || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
769
777
|
}
|
|
770
778
|
getInterfaceUniqueName(name = 'Interface1') {
|
|
771
779
|
return utils.unique(name, this.getInterfaceExistingNames());
|
|
@@ -907,7 +915,7 @@ export class App extends BaseNode {
|
|
|
907
915
|
|
|
908
916
|
getViewExistingNames(excludedList: Array<View> = []) {
|
|
909
917
|
const excludedSet = new Set(excludedList);
|
|
910
|
-
return this.views.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
918
|
+
return (this.views || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
911
919
|
}
|
|
912
920
|
getViewUniqueName(name = 'view1') {
|
|
913
921
|
return utils.unique(name, this.getViewExistingNames());
|
|
@@ -1049,7 +1057,7 @@ export class App extends BaseNode {
|
|
|
1049
1057
|
|
|
1050
1058
|
getProcessExistingNames(excludedList: Array<Process> = []) {
|
|
1051
1059
|
const excludedSet = new Set(excludedList);
|
|
1052
|
-
return this.processes.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1060
|
+
return (this.processes || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1053
1061
|
}
|
|
1054
1062
|
getProcessUniqueName(name = 'Process1') {
|
|
1055
1063
|
return utils.unique(name, this.getProcessExistingNames());
|
|
@@ -1191,7 +1199,7 @@ export class App extends BaseNode {
|
|
|
1191
1199
|
|
|
1192
1200
|
getRoleExistingNames(excludedList: Array<Role> = []) {
|
|
1193
1201
|
const excludedSet = new Set(excludedList);
|
|
1194
|
-
return this.roles.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1202
|
+
return (this.roles || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1195
1203
|
}
|
|
1196
1204
|
getRoleUniqueName(name = 'role1') {
|
|
1197
1205
|
return utils.unique(name, this.getRoleExistingNames());
|
|
@@ -1333,7 +1341,7 @@ export class App extends BaseNode {
|
|
|
1333
1341
|
|
|
1334
1342
|
getModuleExistingNames(excludedList: Array<Module> = []) {
|
|
1335
1343
|
const excludedSet = new Set(excludedList);
|
|
1336
|
-
return this.dependencies.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1344
|
+
return (this.dependencies || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1337
1345
|
}
|
|
1338
1346
|
getModuleUniqueName(name = 'module1') {
|
|
1339
1347
|
return utils.unique(name, this.getModuleExistingNames());
|
|
@@ -2191,6 +2199,56 @@ export class App extends BaseNode {
|
|
|
2191
2199
|
|
|
2192
2200
|
|
|
2193
2201
|
|
|
2202
|
+
/**
|
|
2203
|
+
* 删除配置管理
|
|
2204
|
+
* @param name 配置管理名称
|
|
2205
|
+
*/
|
|
2206
|
+
removeConfiguration(name: string): void;
|
|
2207
|
+
|
|
2208
|
+
/**
|
|
2209
|
+
* 删除配置管理
|
|
2210
|
+
* @param configuration 已有的配置管理实例
|
|
2211
|
+
*/
|
|
2212
|
+
removeConfiguration(configuration: Configuration): void;
|
|
2213
|
+
|
|
2214
|
+
removeConfiguration(options: string | Configuration) {
|
|
2215
|
+
let configuration: Configuration;
|
|
2216
|
+
if (typeof options === 'string') {
|
|
2217
|
+
configuration = this.configuration;
|
|
2218
|
+
if (!configuration) {
|
|
2219
|
+
throw new Error('找不到配置管理 ' + options);
|
|
2220
|
+
}
|
|
2221
|
+
} else {
|
|
2222
|
+
configuration = options;
|
|
2223
|
+
}
|
|
2224
|
+
return configuration.delete();
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
__removeConfiguration(configuration: Configuration) {
|
|
2228
|
+
const parentKey = configuration.parentKey;
|
|
2229
|
+
const params: Params = {
|
|
2230
|
+
parentNode: this,
|
|
2231
|
+
parentKey,
|
|
2232
|
+
index: -1,
|
|
2233
|
+
object: null,
|
|
2234
|
+
oldObject: configuration,
|
|
2235
|
+
};
|
|
2236
|
+
if (parentKey) {
|
|
2237
|
+
params.parentKey = parentKey;
|
|
2238
|
+
if (Array.isArray((this as any)[parentKey])) {
|
|
2239
|
+
const index = (this as any)[parentKey].indexOf(configuration);
|
|
2240
|
+
~index && (this as any)[parentKey].splice(index, 1);
|
|
2241
|
+
params.index = index;
|
|
2242
|
+
} else if ((this as any)[parentKey] === configuration) {
|
|
2243
|
+
params.index = 0;
|
|
2244
|
+
(this as any)[parentKey] = undefined;
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
return params;
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
|
|
2251
|
+
|
|
2194
2252
|
/**
|
|
2195
2253
|
* 删除模块
|
|
2196
2254
|
* @param name 模块名称
|
|
@@ -2297,6 +2355,9 @@ export class App extends BaseNode {
|
|
|
2297
2355
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
2298
2356
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
2299
2357
|
//================================================================================
|
|
2358
|
+
findComponentDependencyByName(name: string) {
|
|
2359
|
+
return this.componentDependencies.find((componentDependency) => componentDependency.name === name);
|
|
2360
|
+
}
|
|
2300
2361
|
|
|
2301
2362
|
findEntityByName(name: string) {
|
|
2302
2363
|
return this.entities.find((entity) => entity.name === name);
|
|
@@ -2399,6 +2460,22 @@ export class App extends BaseNode {
|
|
|
2399
2460
|
return node;
|
|
2400
2461
|
}
|
|
2401
2462
|
|
|
2463
|
+
/**
|
|
2464
|
+
* @param path 路径
|
|
2465
|
+
* path 为要查找路径:如 /dashboard/student/list、/dashboard/student/list
|
|
2466
|
+
*/
|
|
2467
|
+
findViewByPath(path: string) {
|
|
2468
|
+
const arr = path.split('/');
|
|
2469
|
+
if (arr[0] === '')
|
|
2470
|
+
arr.shift();
|
|
2471
|
+
|
|
2472
|
+
if (!arr.length)
|
|
2473
|
+
throw Error('Cannot find View ' + path);
|
|
2474
|
+
const childName = arr.shift();
|
|
2475
|
+
const subView = this.views.find((child) => child.name === childName);
|
|
2476
|
+
return arr.length ? subView.findViewByPath(arr.join('/')) : subView;
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2402
2479
|
loadEnvList() {
|
|
2403
2480
|
this.envList = ['dev', 'online'];
|
|
2404
2481
|
}
|
|
@@ -2444,7 +2521,7 @@ export class App extends BaseNode {
|
|
|
2444
2521
|
|
|
2445
2522
|
scope === 'h5' ? `${prefix}/packages/@lcap/mobile-ui@${packageInfo.ui.version}/dist-theme/index.js` : `${prefix}/packages/cloud-ui.vusion@${packageInfo.ui.version}/dist-theme/index.js`,
|
|
2446
2523
|
|
|
2447
|
-
scope === 'h5' ? `${prefix}/packages/@lcap/mobile-template
|
|
2524
|
+
scope === 'h5' ? `${prefix}/packages/@lcap/mobile-template@0.7.10-beta/cloudAdminDesigner.umd.min.js` : `${prefix}/packages/lcap-pc-template@0.4.13-beta/cloudAdminDesigner.umd.min.js`,
|
|
2448
2525
|
],
|
|
2449
2526
|
css: [
|
|
2450
2527
|
scope === 'h5' ? `${prefix}/packages/@lcap/mobile-ui@${packageInfo.ui.version}/dist-theme/index.css` : `${prefix}/packages/cloud-ui.vusion@${packageInfo.ui.version}/dist-theme/index.css`,
|
|
@@ -2457,23 +2534,22 @@ export class App extends BaseNode {
|
|
|
2457
2534
|
names: [],
|
|
2458
2535
|
},
|
|
2459
2536
|
};
|
|
2460
|
-
|
|
2461
2537
|
this.componentDependencies.forEach((dep) => {
|
|
2462
|
-
|
|
2463
|
-
result.custom.
|
|
2464
|
-
result.custom.
|
|
2538
|
+
const { name, version } = dep;
|
|
2539
|
+
result.custom.js.push(`${prefix}/packages/${name}@${version}/dist-theme/index.js`);
|
|
2540
|
+
result.custom.css.push(`${prefix}/packages/${name}@${version}/dist-theme/index.css`);
|
|
2541
|
+
result.custom.names.push(name);
|
|
2465
2542
|
});
|
|
2466
|
-
|
|
2467
2543
|
return result;
|
|
2468
2544
|
}
|
|
2469
2545
|
|
|
2470
2546
|
genThemeCSS() {
|
|
2471
|
-
const keys = Object.keys(this.theme
|
|
2547
|
+
const keys = Object.keys(this.theme?.variableMap || {});
|
|
2472
2548
|
if (!keys.length)
|
|
2473
2549
|
return;
|
|
2474
2550
|
|
|
2475
2551
|
return `:root {
|
|
2476
|
-
${keys.map((key) => ` ${key}: ${this.theme
|
|
2552
|
+
${keys.map((key) => ` ${key}: ${this.theme?.variableMap[key]};`).join('\n')}
|
|
2477
2553
|
}
|
|
2478
2554
|
`;
|
|
2479
2555
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
2
3
|
//================================================================================
|
|
3
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -7,6 +8,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
7
8
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
8
9
|
|
|
9
10
|
import * as utils from '../utils';
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
12
|
import BaseNode from '../common/BaseNode';
|
|
11
13
|
import classMap from '../common/classMap';
|
|
12
14
|
import LogicItem from './LogicItem__';
|
|
@@ -140,10 +142,10 @@ export class Argument extends LogicItem {
|
|
|
140
142
|
});
|
|
141
143
|
}
|
|
142
144
|
|
|
143
|
-
toVue(
|
|
145
|
+
toVue(options?: ElementToVueOptions) {
|
|
144
146
|
let code = this.spread ? '...' : '';
|
|
145
147
|
if (this.expression) {
|
|
146
|
-
code += this.expression.toVue(
|
|
148
|
+
code += this.expression.toVue(options);
|
|
147
149
|
} else {
|
|
148
150
|
code += '';
|
|
149
151
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
2
|
import Identifier from './Identifier__';
|
|
3
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
3
4
|
|
|
4
5
|
//================================================================================
|
|
5
6
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -9,6 +10,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
9
10
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
10
11
|
|
|
11
12
|
import * as utils from '../utils';
|
|
13
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
12
14
|
import BaseNode from '../common/BaseNode';
|
|
13
15
|
import classMap from '../common/classMap';
|
|
14
16
|
import LogicItem from './LogicItem__';
|
|
@@ -181,11 +183,11 @@ export class Assignment extends LogicItem {
|
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
185
|
|
|
184
|
-
toVue(
|
|
186
|
+
toVue(options?: ElementToVueOptions) {
|
|
185
187
|
let code = '';
|
|
186
|
-
code += this.left ? this.left.toVue(
|
|
188
|
+
code += this.left ? this.left.toVue(options) : '';
|
|
187
189
|
code += ' = ';
|
|
188
|
-
code += this.right ? this.right.toVue(
|
|
190
|
+
code += this.right ? this.right.toVue(options) : '';
|
|
189
191
|
code += ';';
|
|
190
192
|
return code;
|
|
191
193
|
}
|
|
@@ -215,10 +217,6 @@ export class Assignment extends LogicItem {
|
|
|
215
217
|
code += this.left ? this.left.toEmbeddedTS(shiftState(state, code, { inline: true })) : '__LEFT__';
|
|
216
218
|
code += ' = ';
|
|
217
219
|
|
|
218
|
-
// 因为右侧枚举要赋值就得new 一下;
|
|
219
|
-
if (this.right && this.right instanceof Identifier && this.right.namespace && this.right.namespace.endsWith('enums')) {
|
|
220
|
-
code += 'new ';
|
|
221
|
-
}
|
|
222
220
|
code += this.right ? this.right.toEmbeddedTS(shiftState(state, code, { inline: true })) : '__RIGHT__';
|
|
223
221
|
code += ';';
|
|
224
222
|
return code;
|
|
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
6
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
7
|
|
|
8
8
|
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import BaseNode from '../common/BaseNode';
|
|
10
11
|
import classMap from '../common/classMap';
|
|
11
12
|
import TypeAnnotation from './TypeAnnotation__';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
2
3
|
|
|
3
4
|
//================================================================================
|
|
4
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -8,6 +9,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
8
9
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
9
10
|
|
|
10
11
|
import * as utils from '../utils';
|
|
12
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
13
|
import BaseNode from '../common/BaseNode';
|
|
12
14
|
import classMap from '../common/classMap';
|
|
13
15
|
import LogicItem from './LogicItem__';
|
|
@@ -171,7 +173,7 @@ export class BinaryExpression extends LogicItem {
|
|
|
171
173
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
172
174
|
//================================================================================
|
|
173
175
|
|
|
174
|
-
toVue(
|
|
176
|
+
toVue(options?: ElementToVueOptions) {
|
|
175
177
|
if (['startwith', 'endwith'].includes(this.operator)) {
|
|
176
178
|
const operatorMap = {
|
|
177
179
|
startwith: 'startsWith',
|
|
@@ -179,16 +181,16 @@ export class BinaryExpression extends LogicItem {
|
|
|
179
181
|
};
|
|
180
182
|
const fnName = operatorMap[this.operator as keyof typeof operatorMap];
|
|
181
183
|
let code = '';
|
|
182
|
-
code += this.left?.toVue ? this.left.toVue(
|
|
184
|
+
code += this.left?.toVue ? this.left.toVue(options) : '';
|
|
183
185
|
code += '.' + fnName + '(';
|
|
184
|
-
code += this.right?.toVue ? this.right.toVue(
|
|
186
|
+
code += this.right?.toVue ? this.right.toVue(options) : '';
|
|
185
187
|
code += ')';
|
|
186
188
|
return code;
|
|
187
189
|
}
|
|
188
190
|
let code = '';
|
|
189
|
-
code += this.left?.toVue ? this.left.toVue(
|
|
191
|
+
code += this.left?.toVue ? this.left.toVue() : '';
|
|
190
192
|
code += ` ${this.operator} `;
|
|
191
|
-
code += this.right?.toVue ? this.right.toVue(
|
|
193
|
+
code += this.right?.toVue ? this.right.toVue() : '';
|
|
192
194
|
return code;
|
|
193
195
|
}
|
|
194
196
|
|
|
@@ -9,6 +9,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
9
9
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
10
10
|
|
|
11
11
|
import * as utils from '../utils';
|
|
12
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
12
13
|
import BaseNode from '../common/BaseNode';
|
|
13
14
|
import classMap from '../common/classMap';
|
|
14
15
|
import LogicItem from './LogicItem__';
|
|
@@ -197,7 +198,7 @@ export class BindAttribute extends BaseNode {
|
|
|
197
198
|
|
|
198
199
|
getValidationRuleExistingNames(excludedList: Array<ValidationRule> = []) {
|
|
199
200
|
const excludedSet = new Set(excludedList);
|
|
200
|
-
return this.rules.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
201
|
+
return (this.rules || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
201
202
|
}
|
|
202
203
|
getValidationRuleUniqueName(name = 'validationRule1') {
|
|
203
204
|
return utils.unique(name, this.getValidationRuleExistingNames());
|
|
@@ -462,16 +463,20 @@ export class BindAttribute extends BaseNode {
|
|
|
462
463
|
/**
|
|
463
464
|
* 转换成 Vue 的模板格式
|
|
464
465
|
*/
|
|
465
|
-
toVue() {
|
|
466
|
+
toVue(options?: ElementToVueOptions) {
|
|
466
467
|
let value = this.value;
|
|
467
468
|
if (this.type === 'dynamic' && this.expression) {
|
|
468
|
-
value = this.expression.toVue();
|
|
469
|
+
value = this.expression.toVue(options);
|
|
469
470
|
}
|
|
470
471
|
if (value !== undefined && value !== null && typeof value === 'string') {
|
|
471
472
|
value = value.replace(/"/g, "'");
|
|
472
473
|
}
|
|
473
474
|
if (this.name === 'destination' && this.destination) {
|
|
474
|
-
return this.destination.toVue();
|
|
475
|
+
return this.destination.toVue(options);
|
|
476
|
+
} else if (this.name === 'rules' && this.rules) {
|
|
477
|
+
const ruleStrs = this.rules.map((rule) => rule.toVue());
|
|
478
|
+
value = ruleStrs.join(' | ');
|
|
479
|
+
return value !== undefined && value !== null ? `${this.name}="${value}"` : '';
|
|
475
480
|
} else if (this.type === 'string') {
|
|
476
481
|
return value !== undefined && value !== null ? `${this.name}="${value}"` : '';
|
|
477
482
|
} else {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
1
2
|
//================================================================================
|
|
2
3
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
4
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -6,6 +7,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
7
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
8
|
|
|
8
9
|
import * as utils from '../utils';
|
|
10
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
11
|
import BaseNode from '../common/BaseNode';
|
|
10
12
|
import classMap from '../common/classMap';
|
|
11
13
|
import LogicItem from './LogicItem__';
|
|
@@ -204,7 +206,7 @@ export class BindDirective extends BaseNode {
|
|
|
204
206
|
/**
|
|
205
207
|
* 转换成 Vue 的模板格式
|
|
206
208
|
*/
|
|
207
|
-
toVue() {
|
|
209
|
+
toVue(options?: ElementToVueOptions) {
|
|
208
210
|
let modifiersString = '';
|
|
209
211
|
Object.keys(this.modifiers || {}).forEach((key) => {
|
|
210
212
|
const value = (this.modifiers as any)[key];
|
|
@@ -214,7 +216,7 @@ export class BindDirective extends BaseNode {
|
|
|
214
216
|
// eslint-disable-next-line no-nested-ternary
|
|
215
217
|
let value = this.type !== 'string' ? this.value : this.value ? `'${this.value}'` : '';
|
|
216
218
|
if (this.expression) {
|
|
217
|
-
value = this.expression.toVue();
|
|
219
|
+
value = this.expression.toVue(options);
|
|
218
220
|
if (this.expression.concept === 'StringLiteral') {
|
|
219
221
|
value = `'${value}'`;
|
|
220
222
|
}
|
|
@@ -3,7 +3,7 @@ import Logic from './Logic__';
|
|
|
3
3
|
import LogicItem from './LogicItem__';
|
|
4
4
|
import Namespace from './Namespace__';
|
|
5
5
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, embeddedTSEmitter } from '../translator';
|
|
6
|
-
|
|
6
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
7
7
|
//================================================================================
|
|
8
8
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
9
9
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -12,6 +12,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
12
12
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
13
13
|
|
|
14
14
|
import * as utils from '../utils';
|
|
15
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
15
16
|
import BaseNode from '../common/BaseNode';
|
|
16
17
|
import classMap from '../common/classMap';
|
|
17
18
|
import Argument from './Argument__';
|
|
@@ -304,7 +305,8 @@ export class BindEvent extends BaseNode {
|
|
|
304
305
|
if (/^\d/.test(tsName)) {
|
|
305
306
|
tsName = '$' + tsName;
|
|
306
307
|
}
|
|
307
|
-
|
|
308
|
+
// 匹配所有特殊字符都转为_
|
|
309
|
+
tsName = tsName.replace(/\W/g, '_');
|
|
308
310
|
return tsName;
|
|
309
311
|
}
|
|
310
312
|
return '';
|
|
@@ -376,7 +378,7 @@ export class BindEvent extends BaseNode {
|
|
|
376
378
|
/**
|
|
377
379
|
* 转换成 Vue 的模板格式
|
|
378
380
|
*/
|
|
379
|
-
toVue() {
|
|
381
|
+
toVue(options?: ElementToVueOptions) {
|
|
380
382
|
const calleeName = this.calleeName;
|
|
381
383
|
let code = '';
|
|
382
384
|
if (calleeName) {
|
|
@@ -390,8 +392,8 @@ export class BindEvent extends BaseNode {
|
|
|
390
392
|
});
|
|
391
393
|
code += ')';
|
|
392
394
|
}
|
|
395
|
+
code += `"`;
|
|
393
396
|
}
|
|
394
|
-
code += `"`;
|
|
395
397
|
return code;
|
|
396
398
|
}
|
|
397
399
|
//================================================================================
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
2
3
|
//================================================================================
|
|
3
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -7,6 +8,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
7
8
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
8
9
|
|
|
9
10
|
import * as utils from '../utils';
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
12
|
import BaseNode from '../common/BaseNode';
|
|
11
13
|
import classMap from '../common/classMap';
|
|
12
14
|
import LogicItem from './LogicItem__';
|
|
@@ -54,7 +56,7 @@ export class BooleanLiteral extends LogicItem {
|
|
|
54
56
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
55
57
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
56
58
|
//================================================================================
|
|
57
|
-
toVue(): string {
|
|
59
|
+
toVue(options?: ElementToVueOptions): string {
|
|
58
60
|
return this.value;
|
|
59
61
|
}
|
|
60
62
|
|