@lcap/nasl 2.20.0-beta.4 → 2.20.1-beta.1
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/out/automate/engine/2.14-components.d.ts +1115 -0
- package/out/automate/engine/2.14-components.js +1087 -0
- package/out/automate/engine/2.14-components.js.map +1 -0
- package/out/automate/engine/operators.d.ts +0 -9
- package/out/automate/engine/viewCache.d.ts +0 -1
- package/out/automate/template/myProcess.d.ts +0 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.d.ts +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +13 -0
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +9 -14
- package/out/concepts/Attribute__.js +12 -39
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +1 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +13 -6
- package/out/concepts/CallLogic__.js.map +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__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +8 -6
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.js +1 -1
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +1 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js +1 -1
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +212 -0
- package/out/concepts/FrontendLibrary__.js +349 -0
- package/out/concepts/FrontendLibrary__.js.map +1 -0
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +26 -13
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +49 -49
- package/out/concepts/Module__.js +50 -50
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +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.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js +3 -0
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.d.ts +16 -0
- package/out/concepts/Slot__.js +43 -0
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +1 -1
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- 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 +1 -1
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +3 -0
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.d.ts +34 -0
- package/out/concepts/ViewBlock__.js +82 -0
- package/out/concepts/ViewBlock__.js.map +1 -0
- package/out/concepts/ViewComponent__.d.ts +85 -0
- package/out/concepts/ViewComponent__.js +104 -0
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -0
- package/out/concepts/View__.js +13 -8
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/index__.d.ts +2 -0
- package/out/concepts/index__.js +2 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/config.d.ts +1 -1
- package/out/decorators/index.d.ts +2 -2
- package/out/generator/permission.d.ts +1 -1
- package/out/server/getLogics.js +12 -0
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getProcesses.d.ts +3 -3
- package/out/server/getScope.d.ts +1 -1
- package/out/server/naslServer.d.ts +1 -1
- package/out/server/naslServer.js +70 -36
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +1 -1
- package/out/service/storage/init.js +1 -1
- package/out/service/storage/init.js.map +1 -1
- package/out/translator/index.d.ts +1 -1
- package/out/translator/lsp.d.ts +3 -3
- package/out/utils/index.d.ts +4 -4
- package/package.json +1 -1
- package/src/concepts/App__.ts +13 -0
- package/src/concepts/Attribute__.ts +10 -59
- package/src/concepts/BindAttribute__.ts +11 -12
- package/src/concepts/BindDirective__.ts +16 -1
- package/src/concepts/BindStyle__.ts +16 -1
- package/src/concepts/CallLogic__.ts +12 -37
- package/src/concepts/ConfigProperty__.ts +8 -6
- package/src/concepts/Destination__.ts +19 -1
- package/src/concepts/ExternalDestination__.ts +6 -6
- package/src/concepts/FrontendLibrary__.ts +518 -0
- package/src/concepts/Frontend__.ts +12 -1
- package/src/concepts/Identifier__.ts +9 -0
- package/src/concepts/Logic__.ts +27 -14
- package/src/concepts/Module__.ts +92 -121
- package/src/concepts/Param__.ts +4 -0
- package/src/concepts/ProcessElement__.ts +23 -1
- package/src/concepts/Process__.ts +16 -1
- package/src/concepts/Return__.ts +2 -0
- package/src/concepts/Slot__.ts +55 -0
- package/src/concepts/StringInterpolation__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +9 -9
- package/src/concepts/Variable__.ts +2 -0
- package/src/concepts/ViewBlock__.ts +91 -0
- package/src/concepts/ViewComponent__.ts +199 -0
- package/src/concepts/View__.ts +39 -10
- package/src/concepts/index__.ts +2 -0
- package/src/server/getLogics.ts +13 -0
- package/src/server/naslServer.ts +66 -34
- package/src/server/translator.ts +1 -1
- package/src/service/storage/init.ts +1 -1
- package/yarn-error.log +2087 -0
- package/sandbox/stdlib/dist/nasl.logging.js +0 -0
- package/sandbox/stdlib/dist/nasl.util.js +0 -0
- package/src/automate/engine/dist/index.dev.js +0 -517
- package/src/common/dist/BaseNode.js +0 -1101
- package/src/concepts/basics/stdlib/dist/nasl.util.js +0 -1602
- package/src/concepts/basics/stdlib/dist/reference2TypeAnnotationList.js +0 -24
- package/src/concepts/dist/BindAttribute__.js +0 -795
- package/src/concepts/dist/BindEvent__.js +0 -732
- package/src/concepts/dist/CallFunction__.js +0 -527
- package/src/concepts/dist/CallLogic__.js +0 -932
- package/src/concepts/dist/Destination__.js +0 -708
- package/src/concepts/dist/ExternalDestination__.js +0 -298
- package/src/concepts/dist/Identifier__.js +0 -311
- package/src/concepts/dist/StringInterpolation__.js +0 -231
- package/src/concepts/dist/TypeAnnotation__.js +0 -834
- package/src/concepts/dist/ViewElement__.js +0 -1692
- package/src/concepts/dist/View__.js +0 -1601
- package/src/generator/dist/genBundleFiles.js +0 -261
- package/src/generator/dist/genMetaData.js +0 -245
- package/src/generator/dist/permission.js +0 -405
- package/src/service/storage/dist/init.js +0 -579
- package/src/templator/dist/genEditTableBlock.js +0 -204
- package/src/templator/dist/genGridViewBlock.js +0 -265
- package/src/templator/dist/genListViewBlock.js +0 -84
- package/src/templator/dist/genTableBlock.js +0 -209
- package/src/templator/dist/utils.js +0 -527
|
@@ -257,7 +257,7 @@ export class ProcessElement extends BaseNode {
|
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
getBindEventExistingNames(excludedList: Array<BindEvent> = []) {
|
|
261
261
|
const excludedSet = new Set(excludedList);
|
|
262
262
|
return ((this.bindEvents as BindEvent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
263
263
|
}
|
|
@@ -398,6 +398,7 @@ export class ProcessElement extends BaseNode {
|
|
|
398
398
|
return node;
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
+
|
|
401
402
|
getPointExistingNames(excludedList: Array<Point> = []) {
|
|
402
403
|
const excludedSet = new Set(excludedList);
|
|
403
404
|
return ((this.waypoints as Point[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -539,6 +540,7 @@ export class ProcessElement extends BaseNode {
|
|
|
539
540
|
return node;
|
|
540
541
|
}
|
|
541
542
|
|
|
543
|
+
|
|
542
544
|
getVariableExistingNames(excludedList: Array<Variable> = []) {
|
|
543
545
|
const excludedSet = new Set(excludedList);
|
|
544
546
|
return ((this.variables as Variable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -680,6 +682,7 @@ export class ProcessElement extends BaseNode {
|
|
|
680
682
|
return node;
|
|
681
683
|
}
|
|
682
684
|
|
|
685
|
+
|
|
683
686
|
getReturnExistingNames(excludedList: Array<Return> = []) {
|
|
684
687
|
const excludedSet = new Set(excludedList);
|
|
685
688
|
return ((this.returns as Return[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -821,6 +824,7 @@ export class ProcessElement extends BaseNode {
|
|
|
821
824
|
return node;
|
|
822
825
|
}
|
|
823
826
|
|
|
827
|
+
|
|
824
828
|
getConstantExistingNames(excludedList: Array<Constant> = []) {
|
|
825
829
|
const excludedSet = new Set(excludedList);
|
|
826
830
|
return ((this.constants as Constant[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -962,6 +966,7 @@ export class ProcessElement extends BaseNode {
|
|
|
962
966
|
return node;
|
|
963
967
|
}
|
|
964
968
|
|
|
969
|
+
|
|
965
970
|
getBindAttributeExistingNames(excludedList: Array<BindAttribute> = []) {
|
|
966
971
|
const excludedSet = new Set(excludedList);
|
|
967
972
|
return ((this.bindAttrs as BindAttribute[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1103,6 +1108,9 @@ export class ProcessElement extends BaseNode {
|
|
|
1103
1108
|
return node;
|
|
1104
1109
|
}
|
|
1105
1110
|
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
|
|
1106
1114
|
/**
|
|
1107
1115
|
* 删除元素绑定事件
|
|
1108
1116
|
* @param name 元素绑定事件名称
|
|
@@ -1151,6 +1159,8 @@ export class ProcessElement extends BaseNode {
|
|
|
1151
1159
|
return params;
|
|
1152
1160
|
}
|
|
1153
1161
|
|
|
1162
|
+
|
|
1163
|
+
|
|
1154
1164
|
/**
|
|
1155
1165
|
* 删除矩形信息
|
|
1156
1166
|
* @param name 矩形信息名称
|
|
@@ -1199,6 +1209,8 @@ export class ProcessElement extends BaseNode {
|
|
|
1199
1209
|
return params;
|
|
1200
1210
|
}
|
|
1201
1211
|
|
|
1212
|
+
|
|
1213
|
+
|
|
1202
1214
|
/**
|
|
1203
1215
|
* 删除点信息
|
|
1204
1216
|
* @param name 点信息名称
|
|
@@ -1247,6 +1259,8 @@ export class ProcessElement extends BaseNode {
|
|
|
1247
1259
|
return params;
|
|
1248
1260
|
}
|
|
1249
1261
|
|
|
1262
|
+
|
|
1263
|
+
|
|
1250
1264
|
/**
|
|
1251
1265
|
* 删除逻辑
|
|
1252
1266
|
* @param name 逻辑名称
|
|
@@ -1295,6 +1309,8 @@ export class ProcessElement extends BaseNode {
|
|
|
1295
1309
|
return params;
|
|
1296
1310
|
}
|
|
1297
1311
|
|
|
1312
|
+
|
|
1313
|
+
|
|
1298
1314
|
/**
|
|
1299
1315
|
* 删除变量
|
|
1300
1316
|
* @param name 变量名称
|
|
@@ -1343,6 +1359,8 @@ export class ProcessElement extends BaseNode {
|
|
|
1343
1359
|
return params;
|
|
1344
1360
|
}
|
|
1345
1361
|
|
|
1362
|
+
|
|
1363
|
+
|
|
1346
1364
|
/**
|
|
1347
1365
|
* 删除输出参数
|
|
1348
1366
|
* @param name 输出参数名称
|
|
@@ -1391,6 +1409,8 @@ export class ProcessElement extends BaseNode {
|
|
|
1391
1409
|
return params;
|
|
1392
1410
|
}
|
|
1393
1411
|
|
|
1412
|
+
|
|
1413
|
+
|
|
1394
1414
|
/**
|
|
1395
1415
|
* 删除常量
|
|
1396
1416
|
* @param name 常量名称
|
|
@@ -1439,6 +1459,8 @@ export class ProcessElement extends BaseNode {
|
|
|
1439
1459
|
return params;
|
|
1440
1460
|
}
|
|
1441
1461
|
|
|
1462
|
+
|
|
1463
|
+
|
|
1442
1464
|
/**
|
|
1443
1465
|
* 删除元素绑定属性
|
|
1444
1466
|
* @param name 元素绑定属性名称
|
|
@@ -157,7 +157,7 @@ export class Process extends BaseNode {
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
getBindEventExistingNames(excludedList: Array<BindEvent> = []) {
|
|
161
161
|
const excludedSet = new Set(excludedList);
|
|
162
162
|
return ((this.bindEvents as BindEvent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
163
163
|
}
|
|
@@ -298,6 +298,7 @@ export class Process extends BaseNode {
|
|
|
298
298
|
return node;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
|
|
301
302
|
getParamExistingNames(excludedList: Array<Param> = []) {
|
|
302
303
|
const excludedSet = new Set(excludedList);
|
|
303
304
|
return ((this.params as Param[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -439,6 +440,7 @@ export class Process extends BaseNode {
|
|
|
439
440
|
return node;
|
|
440
441
|
}
|
|
441
442
|
|
|
443
|
+
|
|
442
444
|
getReturnExistingNames(excludedList: Array<Return> = []) {
|
|
443
445
|
const excludedSet = new Set(excludedList);
|
|
444
446
|
return ((this.returns as Return[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -580,6 +582,7 @@ export class Process extends BaseNode {
|
|
|
580
582
|
return node;
|
|
581
583
|
}
|
|
582
584
|
|
|
585
|
+
|
|
583
586
|
getConstantExistingNames(excludedList: Array<Constant> = []) {
|
|
584
587
|
const excludedSet = new Set(excludedList);
|
|
585
588
|
return ((this.constants as Constant[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -721,6 +724,7 @@ export class Process extends BaseNode {
|
|
|
721
724
|
return node;
|
|
722
725
|
}
|
|
723
726
|
|
|
727
|
+
|
|
724
728
|
getElementExistingNames(excludedList: Array<ProcessElement> = []) {
|
|
725
729
|
const excludedSet = new Set(excludedList);
|
|
726
730
|
return ((this.elements as ProcessElement[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -862,6 +866,9 @@ export class Process extends BaseNode {
|
|
|
862
866
|
return node;
|
|
863
867
|
}
|
|
864
868
|
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
865
872
|
/**
|
|
866
873
|
* 删除元素绑定事件
|
|
867
874
|
* @param name 元素绑定事件名称
|
|
@@ -910,6 +917,8 @@ export class Process extends BaseNode {
|
|
|
910
917
|
return params;
|
|
911
918
|
}
|
|
912
919
|
|
|
920
|
+
|
|
921
|
+
|
|
913
922
|
/**
|
|
914
923
|
* 删除输入参数
|
|
915
924
|
* @param name 输入参数名称
|
|
@@ -958,6 +967,8 @@ export class Process extends BaseNode {
|
|
|
958
967
|
return params;
|
|
959
968
|
}
|
|
960
969
|
|
|
970
|
+
|
|
971
|
+
|
|
961
972
|
/**
|
|
962
973
|
* 删除输出参数
|
|
963
974
|
* @param name 输出参数名称
|
|
@@ -1006,6 +1017,8 @@ export class Process extends BaseNode {
|
|
|
1006
1017
|
return params;
|
|
1007
1018
|
}
|
|
1008
1019
|
|
|
1020
|
+
|
|
1021
|
+
|
|
1009
1022
|
/**
|
|
1010
1023
|
* 删除常量
|
|
1011
1024
|
* @param name 常量名称
|
|
@@ -1054,6 +1067,8 @@ export class Process extends BaseNode {
|
|
|
1054
1067
|
return params;
|
|
1055
1068
|
}
|
|
1056
1069
|
|
|
1070
|
+
|
|
1071
|
+
|
|
1057
1072
|
/**
|
|
1058
1073
|
* 删除流程元素
|
|
1059
1074
|
* @param name 流程元素名称
|
package/src/concepts/Return__.ts
CHANGED
package/src/concepts/Slot__.ts
CHANGED
|
@@ -9,6 +9,7 @@ import * as utils from '../utils';
|
|
|
9
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
10
10
|
import BaseNode from '../common/BaseNode';
|
|
11
11
|
import classMap from '../common/classMap';
|
|
12
|
+
import Param from './Param__';
|
|
12
13
|
import ViewComponent from './ViewComponent__';
|
|
13
14
|
import Module from './Module__';
|
|
14
15
|
import App from './App__';
|
|
@@ -54,6 +55,12 @@ export class Slot extends BaseNode {
|
|
|
54
55
|
@property()
|
|
55
56
|
advanced: boolean = undefined;
|
|
56
57
|
|
|
58
|
+
/**
|
|
59
|
+
* 是否为高级功能,不在低代码中显示
|
|
60
|
+
*/
|
|
61
|
+
@property('Param')
|
|
62
|
+
slotProps: Param = undefined;
|
|
63
|
+
|
|
57
64
|
/**
|
|
58
65
|
* 祖先 ViewComponent
|
|
59
66
|
*/
|
|
@@ -103,6 +110,54 @@ export class Slot extends BaseNode {
|
|
|
103
110
|
|
|
104
111
|
|
|
105
112
|
|
|
113
|
+
/**
|
|
114
|
+
* 删除输入参数
|
|
115
|
+
* @param name 输入参数名称
|
|
116
|
+
*/
|
|
117
|
+
removeSlotProps(name: string): void;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 删除输入参数
|
|
121
|
+
* @param slotProps 已有的输入参数实例
|
|
122
|
+
*/
|
|
123
|
+
removeSlotProps(slotProps: Param): void;
|
|
124
|
+
|
|
125
|
+
removeSlotProps(options: string | Param) {
|
|
126
|
+
let slotProps: Param;
|
|
127
|
+
if (typeof options === 'string') {
|
|
128
|
+
slotProps = this.slotProps;
|
|
129
|
+
if (!slotProps) {
|
|
130
|
+
throw new Error('找不到输入参数 ' + options);
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
slotProps = options;
|
|
134
|
+
}
|
|
135
|
+
return slotProps.delete();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
__removeParam(param: Param) {
|
|
139
|
+
const parentKey = param.parentKey;
|
|
140
|
+
const params: Params = {
|
|
141
|
+
parentNode: this,
|
|
142
|
+
parentKey,
|
|
143
|
+
index: -1,
|
|
144
|
+
object: null,
|
|
145
|
+
oldObject: param,
|
|
146
|
+
};
|
|
147
|
+
if (parentKey) {
|
|
148
|
+
params.parentKey = parentKey;
|
|
149
|
+
if (Array.isArray((this as any)[parentKey])) {
|
|
150
|
+
const index = (this as any)[parentKey].indexOf(param);
|
|
151
|
+
~index && (this as any)[parentKey].splice(index, 1);
|
|
152
|
+
params.index = index;
|
|
153
|
+
} else if ((this as any)[parentKey] === param) {
|
|
154
|
+
params.index = 0;
|
|
155
|
+
(this as any)[parentKey] = undefined;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return params;
|
|
159
|
+
}
|
|
160
|
+
|
|
106
161
|
//================================================================================
|
|
107
162
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
108
163
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
@@ -280,7 +280,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
280
280
|
|
|
281
281
|
toJS(): string {
|
|
282
282
|
if (!this.expressions.length)
|
|
283
|
-
return ''
|
|
283
|
+
return `''`;
|
|
284
284
|
return this.expressions.map((exp: any) => {
|
|
285
285
|
const expTypeAnnotation = exp.typeAnnotation || exp.__TypeAnnotation;
|
|
286
286
|
return `this.$utils['ToString'](${exp.toJS()}, '${expTypeAnnotation?.sortedTypeKey}')`;
|
|
@@ -608,7 +608,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
608
608
|
get sortedTypeKey(): string {
|
|
609
609
|
if (this.typeKind === 'anonymousStructure') {
|
|
610
610
|
// 按匿名数据结构的key排序
|
|
611
|
-
return `{${this.properties.sort(({ name: name1 }, { name: name2 }) => name1 > name2 ? 1 : -1).map(({ name, typeAnnotation }) =>
|
|
611
|
+
return `{${[...this.properties].sort(({ name: name1 }, { name: name2 }) => name1 > name2 ? 1 : -1).map(({ name, typeAnnotation }) =>
|
|
612
612
|
(`${name}: ${typeAnnotation ? typeAnnotation.sortedTypeKey : '未知'}`)).join(', ')}}`;
|
|
613
613
|
} else if (this.typeKind === 'union') {
|
|
614
614
|
// 按返回的每个具体项排序
|
|
@@ -60,7 +60,7 @@ export class ValidationRule extends LogicItem {
|
|
|
60
60
|
@property('LogicItem')
|
|
61
61
|
errorMessage: LogicItem = undefined;
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* @param source 需要合并的部分参数
|
|
@@ -75,7 +75,7 @@ export class ValidationRule extends LogicItem {
|
|
|
75
75
|
return super.from(source, parentNode, parentKey) as ValidationRule;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
/**
|
|
80
80
|
* 设置错误信息
|
|
81
81
|
*/
|
|
@@ -91,9 +91,9 @@ export class ValidationRule extends LogicItem {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* 插入实际参数
|
|
@@ -127,7 +127,7 @@ export class ValidationRule extends LogicItem {
|
|
|
127
127
|
return argument;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
133
|
* 插入实际参数
|
|
@@ -151,7 +151,7 @@ export class ValidationRule extends LogicItem {
|
|
|
151
151
|
return node;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
157
|
* 添加实际参数
|
|
@@ -172,7 +172,7 @@ export class ValidationRule extends LogicItem {
|
|
|
172
172
|
return this._insertArgumentAt(options as any, index);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* 添加实际参数
|
|
@@ -198,7 +198,7 @@ export class ValidationRule extends LogicItem {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* 删除实际参数
|
|
@@ -211,7 +211,7 @@ export class ValidationRule extends LogicItem {
|
|
|
211
211
|
return argument.delete();
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
217
|
* 删除逻辑项
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
//================================================================================
|
|
2
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
4
|
+
//================================================================================
|
|
5
|
+
import { EventPayload, Params } from '../common/EventEmitter';
|
|
6
|
+
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
|
+
|
|
8
|
+
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import BaseNode from '../common/BaseNode';
|
|
11
|
+
import classMap from '../common/classMap';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 代码块
|
|
16
|
+
*/
|
|
17
|
+
@concept('代码块')
|
|
18
|
+
export class ViewBlock extends BaseNode {
|
|
19
|
+
/**
|
|
20
|
+
* 产品概念
|
|
21
|
+
*/
|
|
22
|
+
@property()
|
|
23
|
+
concept: 'ViewBlock' = 'ViewBlock';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 描述
|
|
27
|
+
*/
|
|
28
|
+
@property()
|
|
29
|
+
description: string = undefined;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 标题
|
|
33
|
+
*/
|
|
34
|
+
@property()
|
|
35
|
+
title: string = undefined;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 代码
|
|
39
|
+
*/
|
|
40
|
+
@property()
|
|
41
|
+
code: string = undefined;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param source 需要合并的部分参数
|
|
47
|
+
*/
|
|
48
|
+
constructor(source?: Partial<ViewBlock>) {
|
|
49
|
+
source = Object.assign({}, ViewBlock.getDefaultOptions(), source);
|
|
50
|
+
super(source);
|
|
51
|
+
super.subConstructor(source);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static from(source: any, parentNode?: any, parentKey?: string): ViewBlock {
|
|
55
|
+
return super.from(source, parentNode, parentKey) as ViewBlock;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 从父级删除该节点
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
_delete() {
|
|
63
|
+
let params: Params = null;
|
|
64
|
+
if (this.parentNode) {
|
|
65
|
+
params = (this.parentNode as any)?.__removeViewBlock?.(this);
|
|
66
|
+
}
|
|
67
|
+
return params;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
//================================================================================
|
|
76
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
77
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
78
|
+
//================================================================================
|
|
79
|
+
|
|
80
|
+
//================================================================================
|
|
81
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
82
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
83
|
+
//================================================================================
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
classMap.ViewBlock = ViewBlock;
|
|
87
|
+
export default ViewBlock;
|
|
88
|
+
//================================================================================
|
|
89
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
90
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
91
|
+
//================================================================================
|
|
@@ -13,6 +13,7 @@ import Attribute from './Attribute__';
|
|
|
13
13
|
import Event from './Event__';
|
|
14
14
|
import Slot from './Slot__';
|
|
15
15
|
import Logic from './Logic__';
|
|
16
|
+
import ViewBlock from './ViewBlock__';
|
|
16
17
|
import Module from './Module__';
|
|
17
18
|
import App from './App__';
|
|
18
19
|
|
|
@@ -81,6 +82,12 @@ export class ViewComponent extends BaseNode {
|
|
|
81
82
|
@property('ViewComponent')
|
|
82
83
|
children: Array<ViewComponent> = [];
|
|
83
84
|
|
|
85
|
+
/**
|
|
86
|
+
* 代码块列表
|
|
87
|
+
*/
|
|
88
|
+
@property('ViewBlock')
|
|
89
|
+
blocks: Array<ViewBlock> = [];
|
|
90
|
+
|
|
84
91
|
/**
|
|
85
92
|
* 祖先 Module
|
|
86
93
|
*/
|
|
@@ -830,6 +837,148 @@ export class ViewComponent extends BaseNode {
|
|
|
830
837
|
}
|
|
831
838
|
|
|
832
839
|
|
|
840
|
+
getViewBlockExistingNames(excludedList: Array<ViewBlock> = []) {
|
|
841
|
+
const excludedSet = new Set(excludedList);
|
|
842
|
+
return ((this.blocks as ViewBlock[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
843
|
+
}
|
|
844
|
+
getViewBlockUniqueName(name = 'viewBlock1') {
|
|
845
|
+
return utils.unique(name, this.getViewBlockExistingNames(), undefined, false);
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* 插入代码块
|
|
850
|
+
* @internal
|
|
851
|
+
* @param name 代码块名称,如果不填会自动生成一个唯一名称
|
|
852
|
+
*/
|
|
853
|
+
_insertViewBlockAt(name: string, index: number): ViewBlock;
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* 插入代码块
|
|
857
|
+
* @internal
|
|
858
|
+
* @param viewBlockOptions 代码块参数
|
|
859
|
+
*/
|
|
860
|
+
_insertViewBlockAt(viewBlockOptions: Partial<ViewBlock>, index: number): ViewBlock;
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* 插入代码块
|
|
864
|
+
* @internal
|
|
865
|
+
* @param viewBlock 已有的代码块实例
|
|
866
|
+
*/
|
|
867
|
+
_insertViewBlockAt(viewBlock: ViewBlock, index: number): ViewBlock;
|
|
868
|
+
|
|
869
|
+
_insertViewBlockAt(options: string | Partial<ViewBlock> | ViewBlock, index: number) {
|
|
870
|
+
const viewBlockOptions: any = {};
|
|
871
|
+
const relationOptions = { parentNode: this, parentKey: 'blocks' };
|
|
872
|
+
let viewBlock: ViewBlock;
|
|
873
|
+
if (!options) {
|
|
874
|
+
viewBlock = ViewBlock.from({
|
|
875
|
+
...viewBlockOptions,
|
|
876
|
+
name: this.getViewBlockUniqueName(),
|
|
877
|
+
}, this, 'blocks');
|
|
878
|
+
} else if (typeof options === 'string') {
|
|
879
|
+
viewBlock = ViewBlock.from({
|
|
880
|
+
...viewBlockOptions,
|
|
881
|
+
name: options,
|
|
882
|
+
}, this, 'blocks');
|
|
883
|
+
} else if (options instanceof ViewBlock) {
|
|
884
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
885
|
+
viewBlock = options;
|
|
886
|
+
Object.assign(viewBlock, relationOptions);
|
|
887
|
+
} else {
|
|
888
|
+
viewBlock = ViewBlock.from({
|
|
889
|
+
...viewBlockOptions,
|
|
890
|
+
...options,
|
|
891
|
+
}, this, 'blocks');
|
|
892
|
+
}
|
|
893
|
+
this.blocks.splice(index, 0, viewBlock);
|
|
894
|
+
return viewBlock;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* 插入代码块
|
|
899
|
+
* @param name 代码块名称,如果不填会自动生成一个唯一名称
|
|
900
|
+
*/
|
|
901
|
+
insertViewBlockAt(name: string, index: number): ViewBlock;
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* 插入代码块
|
|
905
|
+
* @param viewBlockOptions 代码块参数
|
|
906
|
+
*/
|
|
907
|
+
insertViewBlockAt(viewBlockOptions: Partial<ViewBlock>, index: number): ViewBlock;
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* 插入代码块
|
|
911
|
+
* @param viewBlock 已有的代码块实例
|
|
912
|
+
*/
|
|
913
|
+
insertViewBlockAt(viewBlock: ViewBlock, index: number): ViewBlock;
|
|
914
|
+
|
|
915
|
+
insertViewBlockAt(options: string | Partial<ViewBlock> | ViewBlock, index: number) {
|
|
916
|
+
const node = this._insertViewBlockAt(options as any, index);
|
|
917
|
+
node.create({
|
|
918
|
+
index,
|
|
919
|
+
parentNode: this,
|
|
920
|
+
parentKey: 'blocks',
|
|
921
|
+
});
|
|
922
|
+
return node;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* 添加代码块
|
|
927
|
+
* @internal
|
|
928
|
+
* @param name 代码块名称,如果不填会自动生成一个唯一名称
|
|
929
|
+
*/
|
|
930
|
+
_addViewBlock(name?: string): ViewBlock;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* 添加代码块
|
|
934
|
+
* @internal
|
|
935
|
+
* @param viewBlockOptions 代码块参数
|
|
936
|
+
*/
|
|
937
|
+
_addViewBlock(viewBlockOptions: Partial<ViewBlock>): ViewBlock;
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* 添加代码块
|
|
941
|
+
* @internal
|
|
942
|
+
* @param viewBlock 已有的代码块实例
|
|
943
|
+
*/
|
|
944
|
+
_addViewBlock(viewBlock: ViewBlock): ViewBlock;
|
|
945
|
+
|
|
946
|
+
_addViewBlock(options?: string | Partial<ViewBlock> | ViewBlock) {
|
|
947
|
+
const index = this.blocks.length;
|
|
948
|
+
return this._insertViewBlockAt(options as any, index);
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* 添加代码块
|
|
953
|
+
* @internal
|
|
954
|
+
* @param name 代码块名称,如果不填会自动生成一个唯一名称
|
|
955
|
+
*/
|
|
956
|
+
addViewBlock(name?: string): ViewBlock;
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* 添加代码块
|
|
960
|
+
* @param viewBlockOptions 代码块参数
|
|
961
|
+
*/
|
|
962
|
+
addViewBlock(viewBlockOptions: Partial<ViewBlock>): ViewBlock;
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* 添加代码块
|
|
966
|
+
* @param viewBlock 已有的代码块实例
|
|
967
|
+
*/
|
|
968
|
+
addViewBlock(viewBlock: ViewBlock): ViewBlock;
|
|
969
|
+
|
|
970
|
+
addViewBlock(options?: string | Partial<ViewBlock> | ViewBlock) {
|
|
971
|
+
const node = this._addViewBlock(options as any);
|
|
972
|
+
const index = this.blocks.indexOf(node);
|
|
973
|
+
node.create({
|
|
974
|
+
index,
|
|
975
|
+
parentNode: this,
|
|
976
|
+
parentKey: 'blocks',
|
|
977
|
+
});
|
|
978
|
+
return node;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
|
|
833
982
|
|
|
834
983
|
|
|
835
984
|
/**
|
|
@@ -1080,6 +1229,56 @@ export class ViewComponent extends BaseNode {
|
|
|
1080
1229
|
return params;
|
|
1081
1230
|
}
|
|
1082
1231
|
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
/**
|
|
1235
|
+
* 删除代码块
|
|
1236
|
+
* @param name 代码块名称
|
|
1237
|
+
*/
|
|
1238
|
+
removeViewBlock(name: string): void;
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* 删除代码块
|
|
1242
|
+
* @param viewBlock 已有的代码块实例
|
|
1243
|
+
*/
|
|
1244
|
+
removeViewBlock(viewBlock: ViewBlock): void;
|
|
1245
|
+
|
|
1246
|
+
removeViewBlock(options: string | ViewBlock) {
|
|
1247
|
+
let viewBlock: ViewBlock;
|
|
1248
|
+
if (typeof options === 'string') {
|
|
1249
|
+
viewBlock = (this.blocks as ViewBlock[]).find((item) => item.name === options);
|
|
1250
|
+
if (!viewBlock) {
|
|
1251
|
+
throw new Error('找不到代码块 ' + options);
|
|
1252
|
+
}
|
|
1253
|
+
} else {
|
|
1254
|
+
viewBlock = options;
|
|
1255
|
+
}
|
|
1256
|
+
return viewBlock.delete();
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
__removeViewBlock(viewBlock: ViewBlock) {
|
|
1260
|
+
const parentKey = viewBlock.parentKey;
|
|
1261
|
+
const params: Params = {
|
|
1262
|
+
parentNode: this,
|
|
1263
|
+
parentKey,
|
|
1264
|
+
index: -1,
|
|
1265
|
+
object: null,
|
|
1266
|
+
oldObject: viewBlock,
|
|
1267
|
+
};
|
|
1268
|
+
if (parentKey) {
|
|
1269
|
+
params.parentKey = parentKey;
|
|
1270
|
+
if (Array.isArray((this as any)[parentKey])) {
|
|
1271
|
+
const index = (this as any)[parentKey].indexOf(viewBlock);
|
|
1272
|
+
~index && (this as any)[parentKey].splice(index, 1);
|
|
1273
|
+
params.index = index;
|
|
1274
|
+
} else if ((this as any)[parentKey] === viewBlock) {
|
|
1275
|
+
params.index = 0;
|
|
1276
|
+
(this as any)[parentKey] = undefined;
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
return params;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1083
1282
|
//================================================================================
|
|
1084
1283
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1085
1284
|
// 自动生成的代码已结束。下面可以手动编写。
|