@lcap/nasl 3.7.0-alpha.1 → 3.7.0-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/utils.d.ts +1 -1
- package/out/automate/engine/utils.js +3 -7
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/myProcess.js +65 -65
- package/out/automate/template/myProcess.js.map +1 -1
- package/out/bak/translator.js +42 -12
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.d.ts +2 -0
- package/out/breakpoint/generator/BreakpointNode.js +7 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/shared/constants.js +1 -0
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/utils.js +1 -1
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +4 -3
- package/out/common/BaseNode.js +61 -10
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/ComponentAPI.d.ts +5 -3
- package/out/common/EventEmitter.d.ts +1 -0
- package/out/common/EventEmitter.js.map +1 -1
- package/out/concepts/Abort__.d.ts +5 -4
- package/out/concepts/Abort__.js +5 -7
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/AbstractInterface__.d.ts +9 -6
- package/out/concepts/AbstractInterface__.js +8 -11
- package/out/concepts/AbstractInterface__.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +5 -12
- package/out/concepts/Anchor__.js +5 -44
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +10 -47
- package/out/concepts/AnonymousFunction__.js +14 -159
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +321 -437
- package/out/concepts/App__.js +460 -986
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +5 -12
- package/out/concepts/Argument__.js +11 -46
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +8 -5
- package/out/concepts/Assignee__.js +9 -66
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.d.ts +5 -6
- package/out/concepts/AssignmentLine__.js +7 -11
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +5 -26
- package/out/concepts/Assignment__.js +5 -64
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +14 -51
- package/out/concepts/Attribute__.js +36 -126
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +10 -10
- package/out/concepts/AuthInterface__.js +18 -13
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +6 -3
- package/out/concepts/AuthLogicForCallInterface__.js +6 -32
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.d.ts +19 -19
- package/out/concepts/AuthLogic__.js +26 -25
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +19 -47
- package/out/concepts/BackendVariable__.js +43 -134
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +6 -13
- package/out/concepts/Backend__.js +13 -50
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BaseSetter__.d.ts +25 -0
- package/out/concepts/BaseSetter__.js +53 -0
- package/out/concepts/BaseSetter__.js.map +1 -0
- package/out/concepts/BatchAssignment__.d.ts +9 -21
- package/out/concepts/BatchAssignment__.js +11 -86
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +5 -22
- package/out/concepts/BinaryExpression__.js +32 -59
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +60 -107
- package/out/concepts/BindAttribute__.js +144 -251
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +26 -42
- package/out/concepts/BindDirective__.js +63 -105
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +27 -36
- package/out/concepts/BindEvent__.js +50 -109
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +24 -41
- package/out/concepts/BindStyle__.js +48 -88
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/Block__.d.ts +5 -2
- package/out/concepts/Block__.js +5 -31
- package/out/concepts/Block__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +5 -0
- package/out/concepts/BooleanLiteral__.js +8 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/BusinessComponent__.d.ts +47 -49
- package/out/concepts/BusinessComponent__.js +122 -444
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.d.ts +5 -0
- package/out/concepts/BusinessLogic__.js +8 -1
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +6 -4
- package/out/concepts/CallAuthInterface__.js +6 -34
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +5 -0
- package/out/concepts/CallConnector__.js +11 -2
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallEvent__.d.ts +6 -7
- package/out/concepts/CallEvent__.js +11 -40
- package/out/concepts/CallEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +17 -9
- package/out/concepts/CallFunction__.js +84 -130
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +6 -7
- package/out/concepts/CallInterface__.js +14 -41
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +11 -24
- package/out/concepts/CallLogic__.js +68 -140
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +70 -126
- package/out/concepts/CallQueryComponent__.js +134 -308
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/CapsulesSetter__.d.ts +109 -0
- package/out/concepts/CapsulesSetter__.js +163 -0
- package/out/concepts/CapsulesSetter__.js.map +1 -0
- package/out/concepts/Comment__.d.ts +5 -0
- package/out/concepts/Comment__.js +8 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts +6 -26
- package/out/concepts/CompletionProperty__.js +24 -74
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +6 -13
- package/out/concepts/ConfigGroup__.js +13 -50
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.d.ts +5 -11
- package/out/concepts/ConfigPropertyValue__.js +11 -19
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +11 -18
- package/out/concepts/ConfigProperty__.js +25 -58
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +6 -13
- package/out/concepts/Configuration__.js +6 -49
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +11 -18
- package/out/concepts/Connection__.js +25 -58
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.d.ts +28 -34
- package/out/concepts/ConnectorTrigger__.js +55 -50
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.d.ts +106 -504
- package/out/concepts/Connector__.js +134 -791
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +27 -55
- package/out/concepts/Constant__.js +45 -137
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/CountersignPolicy__.d.ts +6 -5
- package/out/concepts/CountersignPolicy__.js +8 -12
- package/out/concepts/CountersignPolicy__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +11 -18
- package/out/concepts/DataSource__.js +25 -58
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.d.ts +5 -6
- package/out/concepts/DatabaseTypeAnnotation__.js +11 -13
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/DefaultValue__.d.ts +7 -19
- package/out/concepts/DefaultValue__.js +6 -56
- package/out/concepts/DefaultValue__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +10 -21
- package/out/concepts/Destination__.js +15 -55
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +5 -4
- package/out/concepts/End__.js +7 -8
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +20 -26
- package/out/concepts/EntityIndex__.js +40 -39
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +17 -56
- package/out/concepts/EntityProperty__.js +70 -181
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +18 -26
- package/out/concepts/Entity__.js +38 -98
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +15 -21
- package/out/concepts/EnumItem__.js +27 -31
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/EnumSelectSetter__.d.ts +109 -0
- package/out/concepts/EnumSelectSetter__.js +163 -0
- package/out/concepts/EnumSelectSetter__.js.map +1 -0
- package/out/concepts/Enum__.d.ts +10 -28
- package/out/concepts/Enum__.js +35 -102
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/EventDeclaration__.d.ts +41 -0
- package/out/concepts/EventDeclaration__.js +81 -0
- package/out/concepts/EventDeclaration__.js.map +1 -0
- package/out/concepts/Event__.d.ts +16 -27
- package/out/concepts/Event__.js +37 -78
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +8 -25
- package/out/concepts/ExternalDestination__.js +8 -58
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +7 -55
- package/out/concepts/ForEachStatement__.js +6 -128
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +38 -46
- package/out/concepts/FrontendLibrary__.js +55 -121
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/FrontendType__.d.ts +8 -12
- package/out/concepts/FrontendType__.js +15 -109
- package/out/concepts/FrontendType__.js.map +1 -1
- package/out/concepts/FrontendVariable__.d.ts +5 -0
- package/out/concepts/FrontendVariable__.js +8 -1
- package/out/concepts/FrontendVariable__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +9 -41
- package/out/concepts/Frontend__.js +36 -209
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.d.ts +13 -34
- package/out/concepts/Function__.js +22 -194
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/I18nInfo__.d.ts +6 -7
- package/out/concepts/I18nInfo__.js +14 -14
- package/out/concepts/I18nInfo__.js.map +1 -1
- package/out/concepts/IconSetter__.d.ts +29 -0
- package/out/concepts/IconSetter__.js +62 -0
- package/out/concepts/IconSetter__.js.map +1 -0
- package/out/concepts/Identifier__.d.ts +5 -0
- package/out/concepts/Identifier__.js +20 -6
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +5 -12
- package/out/concepts/IfStatement__.js +5 -44
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/ImageSetter__.d.ts +25 -0
- package/out/concepts/ImageSetter__.js +53 -0
- package/out/concepts/ImageSetter__.js.map +1 -0
- package/out/concepts/ImportedInterface__.d.ts +9 -0
- package/out/concepts/ImportedInterface__.js +11 -1
- package/out/concepts/ImportedInterface__.js.map +1 -1
- package/out/concepts/InputSetter__.d.ts +29 -0
- package/out/concepts/InputSetter__.js +62 -0
- package/out/concepts/InputSetter__.js.map +1 -0
- package/out/concepts/Integration__.d.ts +7 -26
- package/out/concepts/Integration__.js +6 -93
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +34 -62
- package/out/concepts/InterfaceParam__.js +63 -147
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +42 -48
- package/out/concepts/Interface__.js +89 -158
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +5 -4
- package/out/concepts/JSBlock__.js +8 -8
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +5 -0
- package/out/concepts/JavaLogic__.js +14 -3
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicDeclaration__.d.ts +289 -0
- package/out/concepts/LogicDeclaration__.js +352 -0
- package/out/concepts/LogicDeclaration__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +39 -45
- package/out/concepts/LogicItem__.js +76 -62
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +45 -63
- package/out/concepts/Logic__.js +159 -280
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +6 -4
- package/out/concepts/MatchCase__.js +16 -68
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +8 -14
- package/out/concepts/Match__.js +17 -49
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +8 -23
- package/out/concepts/MemberExpression__.js +85 -103
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +36 -54
- package/out/concepts/MetadataType__.js +44 -119
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +5 -6
- package/out/concepts/MicroApp__.js +30 -18
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.d.ts +99 -128
- package/out/concepts/Module__.js +133 -532
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.d.ts +31 -33
- package/out/concepts/MsgTriggerEvent__.js +39 -67
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.d.ts +11 -14
- package/out/concepts/MsgTriggerLauncher__.js +18 -44
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/MultiApprovalPolicy__.d.ts +8 -9
- package/out/concepts/MultiApprovalPolicy__.js +7 -13
- package/out/concepts/MultiApprovalPolicy__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +112 -138
- package/out/concepts/Namespace__.js +122 -501
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +11 -21
- package/out/concepts/NewComposite__.js +48 -146
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +6 -14
- package/out/concepts/NewList__.js +7 -77
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +6 -14
- package/out/concepts/NewMap__.js +7 -77
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.d.ts +6 -0
- package/out/concepts/New__.js +9 -0
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +5 -0
- package/out/concepts/NullLiteral__.js +5 -0
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumberInputSetter__.d.ts +45 -0
- package/out/concepts/NumberInputSetter__.js +98 -0
- package/out/concepts/NumberInputSetter__.js.map +1 -0
- package/out/concepts/NumericLiteral__.d.ts +6 -13
- package/out/concepts/NumericLiteral__.js +8 -45
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +7 -17
- package/out/concepts/OqlQueryComponent__.js +16 -53
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +38 -59
- package/out/concepts/OverriddenLogic__.js +55 -252
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Paginate__.d.ts +59 -0
- package/out/concepts/Paginate__.js +158 -0
- package/out/concepts/Paginate__.js.map +1 -0
- package/out/concepts/ParamWithGroup__.d.ts +13 -10
- package/out/concepts/ParamWithGroup__.js +15 -6
- package/out/concepts/ParamWithGroup__.js.map +1 -1
- package/out/concepts/Param__.d.ts +33 -76
- package/out/concepts/Param__.js +63 -159
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.d.ts +5 -6
- package/out/concepts/Point__.js +11 -13
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.d.ts +12 -20
- package/out/concepts/ProcessComponent__.js +32 -90
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +21 -66
- package/out/concepts/ProcessElement__.js +48 -360
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +5 -4
- package/out/concepts/ProcessOutcome__.js +8 -8
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +5 -4
- package/out/concepts/ProcessOutcomes__.js +6 -7
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.d.ts +16 -26
- package/out/concepts/Process__.js +29 -186
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/PropDeclaration__.d.ts +99 -0
- package/out/concepts/PropDeclaration__.js +183 -0
- package/out/concepts/PropDeclaration__.js.map +1 -0
- package/out/concepts/PropertySelectSetter__.d.ts +25 -0
- package/out/concepts/PropertySelectSetter__.js +53 -0
- package/out/concepts/PropertySelectSetter__.js.map +1 -0
- package/out/concepts/QueryAggregateExpression__.d.ts +6 -13
- package/out/concepts/QueryAggregateExpression__.js +11 -46
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +5 -0
- package/out/concepts/QueryFieldExpression__.js +17 -4
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +6 -3
- package/out/concepts/QueryFromExpression__.js +14 -34
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +5 -12
- package/out/concepts/QueryGroupByExpression__.js +5 -44
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +29 -26
- package/out/concepts/QueryJoinExpression__.js +34 -52
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +5 -22
- package/out/concepts/QueryLimitExpression__.js +5 -57
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +5 -22
- package/out/concepts/QueryOrderByExpression__.js +5 -57
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +37 -34
- package/out/concepts/QuerySelectExpression__.js +37 -59
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.d.ts +5 -6
- package/out/concepts/Rect__.js +17 -15
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +28 -56
- package/out/concepts/Return__.js +50 -139
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +5 -11
- package/out/concepts/Role__.js +21 -21
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +8 -20
- package/out/concepts/SelectMembers__.js +10 -58
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/SequentialPolicy__.d.ts +5 -0
- package/out/concepts/SequentialPolicy__.js +5 -0
- package/out/concepts/SequentialPolicy__.js.map +1 -1
- package/out/concepts/SetterOption__.d.ts +49 -0
- package/out/concepts/SetterOption__.js +99 -0
- package/out/concepts/SetterOption__.js.map +1 -0
- package/out/concepts/SlotDeclaration__.d.ts +213 -0
- package/out/concepts/SlotDeclaration__.js +287 -0
- package/out/concepts/SlotDeclaration__.js.map +1 -0
- package/out/concepts/Slot__.d.ts +7 -31
- package/out/concepts/Slot__.js +27 -72
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +6 -17
- package/out/concepts/SqlQueryComponent__.js +14 -54
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +5 -4
- package/out/concepts/Start__.js +5 -7
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StaticString__.d.ts +6 -12
- package/out/concepts/StaticString__.js +14 -21
- package/out/concepts/StaticString__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +5 -2
- package/out/concepts/StringInterpolation__.js +7 -33
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +6 -1
- package/out/concepts/StringLiteral__.js +16 -2
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +13 -49
- package/out/concepts/StructureProperty__.js +35 -137
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +13 -21
- package/out/concepts/Structure__.js +28 -90
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +6 -13
- package/out/concepts/SwitchCase__.js +6 -45
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchSetter__.d.ts +25 -0
- package/out/concepts/SwitchSetter__.js +53 -0
- package/out/concepts/SwitchSetter__.js.map +1 -0
- package/out/concepts/SwitchStatement__.d.ts +6 -3
- package/out/concepts/SwitchStatement__.js +5 -31
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/ThemeVariable__.d.ts +29 -0
- package/out/concepts/ThemeVariable__.js +58 -0
- package/out/concepts/ThemeVariable__.js.map +1 -0
- package/out/concepts/Theme__.d.ts +5 -6
- package/out/concepts/Theme__.js +11 -13
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +29 -35
- package/out/concepts/Transactional__.js +54 -56
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TriggerEvent__.d.ts +8 -20
- package/out/concepts/TriggerEvent__.js +13 -57
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +12 -17
- package/out/concepts/TriggerLauncher__.js +30 -27
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -11
- package/out/concepts/TypeAnnotation__.js +40 -89
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +5 -0
- package/out/concepts/TypeParam__.js +12 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +5 -12
- package/out/concepts/UnaryExpression__.js +8 -45
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +5 -0
- package/out/concepts/Unparsed__.js +8 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.d.ts +6 -7
- package/out/concepts/UseComponent__.js +11 -13
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +7 -28
- package/out/concepts/ValidationRule__.js +18 -71
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +30 -58
- package/out/concepts/Variable__.js +51 -140
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlockWithImage__.d.ts +33 -0
- package/out/concepts/ViewBlockWithImage__.js +63 -0
- package/out/concepts/ViewBlockWithImage__.js.map +1 -0
- package/out/concepts/ViewBlock__.d.ts +11 -12
- package/out/concepts/ViewBlock__.js +22 -18
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponentDeclaration__.d.ts +721 -0
- package/out/concepts/ViewComponentDeclaration__.js +808 -0
- package/out/concepts/ViewComponentDeclaration__.js.map +1 -0
- package/out/concepts/ViewElement__.d.ts +38 -37
- package/out/concepts/ViewElement__.js +415 -432
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +39 -46
- package/out/concepts/View__.js +509 -342
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +6 -13
- package/out/concepts/WhileStatement__.js +6 -45
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +68 -33
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.js +101 -3
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +31 -31
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +24 -8
- package/out/concepts/index__.js +24 -8
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/utils/asserts.d.ts +1079 -313
- package/out/concepts/utils/asserts.js +1461 -441
- package/out/concepts/utils/asserts.js.map +1 -1
- package/out/concepts/utils/types.d.ts +82 -30
- package/out/config.d.ts +9 -0
- package/out/config.js +5 -0
- package/out/config.js.map +1 -1
- package/out/decorators/index.d.ts +1 -6
- package/out/decorators/index.js +7 -16
- package/out/decorators/index.js.map +1 -1
- package/out/enums/KEYWORDS.js +2 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +2 -0
- package/out/generator/genBundleFiles.js +105 -25
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +2 -4
- package/out/generator/genReleaseBody.js +0 -1
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/permission.d.ts +5 -1
- package/out/generator/permission.js +3 -2
- package/out/generator/permission.js.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/natural/genNaturalTS.js +2 -5
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/index.d.ts +2 -0
- package/out/natural/index.js +2 -0
- package/out/natural/index.js.map +1 -1
- package/out/natural/naslStdlibMap.d.ts +1 -2
- package/out/natural/naslStdlibMap.js +32 -23
- package/out/natural/naslStdlibMap.js.map +1 -1
- package/out/natural/prompt/analyzeClaims.d.ts +1 -0
- package/out/natural/prompt/analyzeClaims.js +21 -0
- package/out/natural/prompt/analyzeClaims.js.map +1 -0
- package/out/natural/prompt/executeClaims.d.ts +1 -0
- package/out/natural/prompt/executeClaims.js +73 -0
- package/out/natural/prompt/executeClaims.js.map +1 -0
- package/out/natural/transformTSCode.js +13 -2
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/createUiTs.d.ts +2 -1
- package/out/server/createUiTs.js +133 -161
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +1 -15
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/extendBaseNode.js +36 -9
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.js +9 -9
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getConnector.d.ts +1 -0
- package/out/server/getConnector.js +38 -35
- package/out/server/getConnector.js.map +1 -1
- package/out/server/getFunctions.js +3 -3
- package/out/server/getFunctions.js.map +1 -1
- package/out/server/getLogics.js +51 -15
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +87 -144
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +11 -1
- package/out/server/naslServer.js +118 -74
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +24 -5
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -0
- package/out/service/storage/init.js +12 -7
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +16 -16
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +23 -23
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.d.ts +2 -2
- package/out/templator/genCurdMultipleKeyBlock.js +28 -38
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +15 -15
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +8 -8
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +18 -20
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +10 -10
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +32 -37
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.js +10 -10
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +18 -10
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +15 -15
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +19 -24
- package/out/templator/utils.js +20 -30
- package/out/templator/utils.js.map +1 -1
- package/out/translator/types.d.ts +2 -0
- package/out/utils/index.d.ts +6 -1
- package/out/utils/index.js +37 -4
- package/out/utils/index.js.map +1 -1
- package/out/utils/string.d.ts +12 -0
- package/out/utils/string.js +15 -1
- package/out/utils/string.js.map +1 -1
- package/out/utils/time-slicing/performance.js +3 -3
- package/out/utils/time-slicing/performance.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.auth.ts +4 -0
- package/sandbox/stdlib/nasl.collection.ts +5 -3
- package/sandbox/stdlib/nasl.core.ts +16 -1
- package/sandbox/stdlib/nasl.oql.ts +2 -2
- package/sandbox/stdlib/nasl.process.ts +18 -0
- package/sandbox/stdlib/nasl.ui.components.h5.ts +1751 -0
- package/sandbox/stdlib/nasl.ui.components.pc.ts +3479 -0
- package/sandbox/stdlib/nasl.ui.definition.ts +53 -2688
- package/sandbox/stdlib/nasl.ui.ts +2 -1
- package/sandbox/stdlib/nasl.util.ts +7 -5
- package/sandbox-natural/stdlib/nasl.core.ts +3 -0
- package/sandbox-natural/stdlib/nasl.oql.ts +4 -3
- package/src/automate/engine/utils.js +3 -7
- package/src/automate/template/myProcess.js +65 -65
- package/src/bak/translator.js +62 -29
- package/src/breakpoint/generator/BreakpointNode.ts +9 -0
- package/src/breakpoint/shared/constants.ts +1 -0
- package/src/breakpoint/shared/utils.ts +1 -1
- package/src/common/BaseNode.ts +71 -9
- package/src/common/ComponentAPI.ts +6 -3
- package/src/common/EventEmitter.ts +1 -0
- package/src/concepts/Abort__.ts +8 -8
- package/src/concepts/AbstractInterface__.ts +14 -14
- package/src/concepts/Anchor__.ts +8 -60
- package/src/concepts/AnonymousFunction__.ts +21 -198
- package/src/concepts/App__.ts +1151 -1837
- package/src/concepts/Argument__.ts +16 -64
- package/src/concepts/Assignee__.ts +14 -72
- package/src/concepts/AssignmentLine__.ts +9 -14
- package/src/concepts/Assignment__.ts +9 -92
- package/src/concepts/Attribute__.ts +49 -176
- package/src/concepts/AuthInterface__.ts +19 -20
- package/src/concepts/AuthLogicForCallInterface__.ts +9 -36
- package/src/concepts/AuthLogic__.ts +45 -46
- package/src/concepts/BackendVariable__.ts +45 -167
- package/src/concepts/Backend__.ts +13 -57
- package/src/concepts/BaseSetter__.ts +72 -0
- package/src/concepts/BatchAssignment__.ts +18 -105
- package/src/concepts/BinaryExpression__.ts +36 -89
- package/src/concepts/BindAttribute__.ts +194 -343
- package/src/concepts/BindDirective__.ts +80 -135
- package/src/concepts/BindEvent__.ts +62 -126
- package/src/concepts/BindStyle__.ts +59 -112
- package/src/concepts/Block__.ts +8 -34
- package/src/concepts/BooleanLiteral__.ts +12 -5
- package/src/concepts/BusinessComponent__.ts +201 -502
- package/src/concepts/BusinessLogic__.ts +15 -15
- package/src/concepts/CallAuthInterface__.ts +10 -39
- package/src/concepts/CallConnector__.ts +15 -6
- package/src/concepts/CallEvent__.ts +16 -45
- package/src/concepts/CallFunction__.ts +104 -134
- package/src/concepts/CallInterface__.ts +20 -47
- package/src/concepts/CallLogic__.ts +93 -175
- package/src/concepts/CallQueryComponent__.ts +226 -520
- package/src/concepts/CapsulesSetter__.ts +254 -0
- package/src/concepts/Comment__.ts +11 -5
- package/src/concepts/CompletionProperty__.ts +29 -100
- package/src/concepts/ConfigGroup__.ts +13 -57
- package/src/concepts/ConfigPropertyValue__.ts +14 -26
- package/src/concepts/ConfigProperty__.ts +28 -68
- package/src/concepts/Configuration__.ts +9 -56
- package/src/concepts/Connection__.ts +27 -68
- package/src/concepts/ConnectorTrigger__.ts +57 -65
- package/src/concepts/Connector__.ts +339 -1448
- package/src/concepts/Constant__.ts +59 -182
- package/src/concepts/CountersignPolicy__.ts +12 -18
- package/src/concepts/DataSource__.ts +29 -68
- package/src/concepts/DatabaseTypeAnnotation__.ts +14 -19
- package/src/concepts/DefaultValue__.ts +10 -74
- package/src/concepts/Destination__.ts +28 -80
- package/src/concepts/End__.ts +11 -9
- package/src/concepts/EntityIndex__.ts +44 -51
- package/src/concepts/EntityProperty__.ts +86 -238
- package/src/concepts/Entity__.ts +43 -111
- package/src/concepts/EnumItem__.ts +29 -40
- package/src/concepts/EnumSelectSetter__.ts +254 -0
- package/src/concepts/Enum__.ts +38 -129
- package/src/concepts/EventDeclaration__.ts +95 -0
- package/src/concepts/Event__.ts +43 -92
- package/src/concepts/ExternalDestination__.ts +17 -91
- package/src/concepts/ForEachStatement__.ts +15 -198
- package/src/concepts/FrontendLibrary__.ts +111 -161
- package/src/concepts/FrontendType__.ts +21 -118
- package/src/concepts/FrontendVariable__.ts +10 -4
- package/src/concepts/Frontend__.ts +44 -250
- package/src/concepts/Function__.ts +28 -220
- package/src/concepts/I18nInfo__.ts +18 -20
- package/src/concepts/IconSetter__.ts +72 -0
- package/src/concepts/Identifier__.ts +27 -16
- package/src/concepts/IfStatement__.ts +9 -60
- package/src/concepts/ImageSetter__.ts +65 -0
- package/src/concepts/ImportedInterface__.ts +17 -4
- package/src/concepts/InputSetter__.ts +72 -0
- package/src/concepts/Integration__.ts +10 -114
- package/src/concepts/InterfaceParam__.ts +67 -186
- package/src/concepts/Interface__.ts +106 -200
- package/src/concepts/JSBlock__.ts +11 -11
- package/src/concepts/JavaLogic__.ts +19 -9
- package/src/concepts/LogicDeclaration__.ts +657 -0
- package/src/concepts/LogicItem__.ts +91 -96
- package/src/concepts/Logic__.ts +287 -434
- package/src/concepts/MatchCase__.ts +22 -72
- package/src/concepts/Match__.ts +23 -67
- package/src/concepts/MemberExpression__.ts +136 -132
- package/src/concepts/MetadataType__.ts +72 -167
- package/src/concepts/MicroApp__.ts +34 -29
- package/src/concepts/Module__.ts +259 -681
- package/src/concepts/MsgTriggerEvent__.ts +44 -79
- package/src/concepts/MsgTriggerLauncher__.ts +21 -54
- package/src/concepts/MultiApprovalPolicy__.ts +10 -18
- package/src/concepts/Namespace__.ts +278 -652
- package/src/concepts/NewComposite__.ts +62 -170
- package/src/concepts/NewList__.ts +12 -94
- package/src/concepts/NewMap__.ts +12 -94
- package/src/concepts/New__.ts +13 -2
- package/src/concepts/NullLiteral__.ts +8 -2
- package/src/concepts/NumberInputSetter__.ts +104 -0
- package/src/concepts/NumericLiteral__.ts +13 -63
- package/src/concepts/OqlQueryComponent__.ts +23 -71
- package/src/concepts/OverriddenLogic__.ts +71 -287
- package/src/concepts/Paginate__.ts +185 -0
- package/src/concepts/ParamWithGroup__.ts +26 -17
- package/src/concepts/Param__.ts +70 -211
- package/src/concepts/Point__.ts +14 -19
- package/src/concepts/ProcessComponent__.ts +33 -104
- package/src/concepts/ProcessElement__.ts +67 -422
- package/src/concepts/ProcessOutcome__.ts +12 -11
- package/src/concepts/ProcessOutcomes__.ts +9 -9
- package/src/concepts/Process__.ts +36 -200
- package/src/concepts/PropDeclaration__.ts +209 -0
- package/src/concepts/PropertySelectSetter__.ts +65 -0
- package/src/concepts/QueryAggregateExpression__.ts +18 -65
- package/src/concepts/QueryFieldExpression__.ts +22 -10
- package/src/concepts/QueryFromExpression__.ts +21 -41
- package/src/concepts/QueryGroupByExpression__.ts +8 -60
- package/src/concepts/QueryJoinExpression__.ts +64 -101
- package/src/concepts/QueryLimitExpression__.ts +9 -86
- package/src/concepts/QueryOrderByExpression__.ts +9 -86
- package/src/concepts/QuerySelectExpression__.ts +70 -118
- package/src/concepts/Rect__.ts +22 -23
- package/src/concepts/Return__.ts +60 -185
- package/src/concepts/Role__.ts +22 -29
- package/src/concepts/SelectMembers__.ts +16 -77
- package/src/concepts/SequentialPolicy__.ts +7 -2
- package/src/concepts/SetterOption__.ts +111 -0
- package/src/concepts/SlotDeclaration__.ts +488 -0
- package/src/concepts/Slot__.ts +35 -105
- package/src/concepts/SqlQueryComponent__.ts +21 -73
- package/src/concepts/Start__.ts +7 -8
- package/src/concepts/StaticString__.ts +16 -26
- package/src/concepts/StringInterpolation__.ts +9 -36
- package/src/concepts/StringLiteral__.ts +16 -7
- package/src/concepts/StructureProperty__.ts +38 -176
- package/src/concepts/Structure__.ts +32 -102
- package/src/concepts/SwitchCase__.ts +10 -62
- package/src/concepts/SwitchSetter__.ts +65 -0
- package/src/concepts/SwitchStatement__.ts +9 -35
- package/src/concepts/ThemeVariable__.ts +71 -0
- package/src/concepts/Theme__.ts +15 -17
- package/src/concepts/Transactional__.ts +67 -77
- package/src/concepts/TriggerEvent__.ts +14 -76
- package/src/concepts/TriggerLauncher__.ts +34 -38
- package/src/concepts/TypeAnnotation__.ts +50 -100
- package/src/concepts/TypeParam__.ts +10 -5
- package/src/concepts/UnaryExpression__.ts +12 -62
- package/src/concepts/Unparsed__.ts +11 -5
- package/src/concepts/UseComponent__.ts +14 -19
- package/src/concepts/ValidationRule__.ts +26 -105
- package/src/concepts/Variable__.ts +71 -195
- package/src/concepts/ViewBlockWithImage__.ts +80 -0
- package/src/concepts/ViewBlock__.ts +24 -27
- package/src/concepts/ViewComponentDeclaration__.ts +1670 -0
- package/src/concepts/ViewElement__.ts +502 -486
- package/src/concepts/View__.ts +576 -389
- package/src/concepts/WhileStatement__.ts +11 -62
- package/src/concepts/basics/stdlib/nasl.auth.ts +97 -34
- package/src/concepts/basics/stdlib/nasl.process.ts +103 -7
- package/src/concepts/basics/stdlib/nasl.util.ts +31 -31
- package/src/concepts/index__.ts +24 -8
- package/src/concepts/utils/asserts.ts +1544 -446
- package/src/concepts/utils/types.ts +121 -41
- package/src/config.ts +6 -0
- package/src/decorators/index.ts +3 -8
- package/src/enums/KEYWORDS.ts +2 -0
- package/src/generator/genBundleFiles.ts +129 -29
- package/src/generator/genReleaseBody.ts +0 -2
- package/src/generator/permission.ts +2 -2
- package/src/index.ts +1 -0
- package/src/natural/genNaturalTS.ts +2 -2
- package/src/natural/index.ts +3 -0
- package/src/natural/naslStdlibMap.ts +25 -19
- package/src/natural/prompt/analyzeClaims.ts +16 -0
- package/src/natural/prompt/executeClaims.ts +69 -0
- package/src/natural/transformTSCode.ts +12 -2
- package/src/server/createUiTs.ts +121 -155
- package/src/server/entity2LogicNamespace.ts +1 -16
- package/src/server/extendBaseNode.ts +46 -15
- package/src/server/formatTsUtils.ts +13 -13
- package/src/server/getConnector.ts +43 -35
- package/src/server/getFunctions.ts +3 -3
- package/src/server/getLogics.ts +34 -17
- package/src/server/getMemberIdentifier.ts +101 -145
- package/src/server/naslServer.ts +136 -74
- package/src/server/translator.ts +23 -5
- package/src/service/storage/init.ts +15 -8
- package/src/templator/genCreateBlock.ts +16 -16
- package/src/templator/genCurdEditMultipleKeyBlock.ts +23 -23
- package/src/templator/genCurdMultipleKeyBlock.ts +34 -44
- package/src/templator/genEditTableBlock.ts +15 -15
- package/src/templator/genEnumSelectBlock.ts +8 -8
- package/src/templator/genGridViewBlock.ts +18 -20
- package/src/templator/genListViewBlock.ts +10 -10
- package/src/templator/genQueryComponent.ts +33 -38
- package/src/templator/genSelectBlock.ts +10 -10
- package/src/templator/genTableBlock.ts +20 -12
- package/src/templator/genUpdateBlock.ts +15 -15
- package/src/templator/utils.ts +21 -30
- package/src/translator/types.ts +4 -0
- package/src/utils/index.ts +40 -5
- package/src/utils/string.ts +14 -0
- package/src/utils/time-slicing/performance.ts +3 -3
- package/test/concepts/call-interface/__snapshots__/getQuickInfoOffset.spec.ts.snap +1 -1
- package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -1
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +7 -8
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +5 -5
- package/test/concepts/entity/__snapshots__/toEmbeddedTS.spec.ts.snap +2 -2
- package/test/concepts/member-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -1
- package/test/concepts/member-expression/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/member-expression/fixtures/elements.table-view.data.json +363 -10
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +655 -611
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +127 -6
- package/test/concepts/view-element/fixtures/table-data-source-calllogic-with-server-validation.json +2074 -0
- package/test/concepts/view-element/toEmbeddedTS.spec.ts +11 -0
- package/test/concepts/view-element/toVue.spec.ts +0 -1
- package/ts-worker/src/start.js +1 -0
- package/out/concepts/ViewComponent__.d.ts +0 -568
- package/out/concepts/ViewComponent__.js +0 -809
- package/out/concepts/ViewComponent__.js.map +0 -1
- package/src/concepts/ViewComponent__.ts +0 -1444
|
@@ -23,6 +23,7 @@ import type Identifier from './Identifier__';
|
|
|
23
23
|
import { PAGE_COMPONENT_INCLUDE_TAG_MAP } from './View__';
|
|
24
24
|
import type BusinessComponent from './BusinessComponent__';
|
|
25
25
|
import type FrontendType from './FrontendType__';
|
|
26
|
+
import { ComponentCompletionPropertyMap } from './View__';
|
|
26
27
|
|
|
27
28
|
import { kebab2Camel } from '../utils';
|
|
28
29
|
export interface ParseContext {
|
|
@@ -245,6 +246,13 @@ function transAstNodeToNaslNode(astNode: any, namespace?: string): any {
|
|
|
245
246
|
undefined,
|
|
246
247
|
'logics',
|
|
247
248
|
);
|
|
249
|
+
} else if (astNode.type === 'LogicalExpression' || astNode.type === 'BinaryExpression') {
|
|
250
|
+
node = {
|
|
251
|
+
concept: 'BinaryExpression',
|
|
252
|
+
operator: astNode.operator,
|
|
253
|
+
left: transAstNodeToNaslNode(astNode.left),
|
|
254
|
+
right: transAstNodeToNaslNode(astNode.right),
|
|
255
|
+
};
|
|
248
256
|
} else {
|
|
249
257
|
node = astNode;
|
|
250
258
|
node.concept = astNode.type;
|
|
@@ -269,33 +277,34 @@ function transAstNodeToNaslTypeNode(astNode: any, namespace?: string): any {
|
|
|
269
277
|
return node;
|
|
270
278
|
}
|
|
271
279
|
|
|
272
|
-
function isLockField(node?:any):boolean {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
280
|
+
function isLockField(node?: any): boolean {
|
|
281
|
+
if (!node || node.concept !== 'ViewElement') return false;
|
|
282
|
+
const attr = node?.bindAttrs?.find((attr: any) =>
|
|
283
|
+
['FormDesignerLocked', 'TableDesignerLocked'].includes(attr.name),
|
|
284
|
+
)?.value;
|
|
285
|
+
if (attr === undefined) return !!isLockField(node?.parentNode);
|
|
286
|
+
else return !!attr;
|
|
277
287
|
}
|
|
278
288
|
|
|
289
|
+
import View from './View__';
|
|
290
|
+
import Module from './Module__';
|
|
291
|
+
import Frontend from './Frontend__';
|
|
279
292
|
//================================================================================
|
|
280
293
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
281
294
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
282
295
|
//================================================================================
|
|
283
296
|
import { EventPayload, Params } from '../common/EventEmitter';
|
|
284
|
-
import { concept, excludedInJSON, property, getConceptConstructor
|
|
297
|
+
import { concept, excludedInJSON, property, getConceptConstructor } from '../decorators';
|
|
285
298
|
|
|
286
299
|
import * as utils from '../utils';
|
|
287
300
|
import * as types from './utils/types';
|
|
288
301
|
import * as asserts from './utils/asserts';
|
|
289
302
|
import { v4 as uuidv4 } from 'uuid';
|
|
290
303
|
import BaseNode from '../common/BaseNode';
|
|
291
|
-
import
|
|
292
|
-
import
|
|
293
|
-
import
|
|
294
|
-
import
|
|
295
|
-
import type View from './View__';
|
|
296
|
-
import type Module from './Module__';
|
|
297
|
-
import type App from './App__';
|
|
298
|
-
import type Frontend from './Frontend__';
|
|
304
|
+
import BindAttribute from './BindAttribute__';
|
|
305
|
+
import BindEvent from './BindEvent__';
|
|
306
|
+
import BindDirective from './BindDirective__';
|
|
307
|
+
import BindStyle from './BindStyle__';
|
|
299
308
|
|
|
300
309
|
/**
|
|
301
310
|
* 页面元素
|
|
@@ -304,7 +313,11 @@ import type Frontend from './Frontend__';
|
|
|
304
313
|
export class ViewElement extends BaseNode {
|
|
305
314
|
/** 类名 */
|
|
306
315
|
static readonly ConceptName: string = 'ViewElement';
|
|
307
|
-
|
|
316
|
+
/**
|
|
317
|
+
* 是否为抽象类
|
|
318
|
+
* 抽象类不能产生 concept: string
|
|
319
|
+
*/
|
|
320
|
+
static isAbstract: boolean = false;
|
|
308
321
|
/** 继承链 */
|
|
309
322
|
static readonly inheritanceChain: string[] = ['BaseNode'];
|
|
310
323
|
|
|
@@ -314,54 +327,69 @@ export class ViewElement extends BaseNode {
|
|
|
314
327
|
@property('concept')
|
|
315
328
|
// @ts-ignore
|
|
316
329
|
readonly concept!: 'ViewElement';
|
|
317
|
-
|
|
318
330
|
/**
|
|
319
331
|
* 类型
|
|
320
332
|
*/
|
|
321
|
-
@property(
|
|
322
|
-
|
|
333
|
+
@property({
|
|
334
|
+
objectRef: '',
|
|
335
|
+
})
|
|
336
|
+
type: 0;
|
|
323
337
|
|
|
324
338
|
/**
|
|
325
339
|
* 元素标签
|
|
326
340
|
*/
|
|
327
|
-
@property(
|
|
328
|
-
|
|
341
|
+
@property({
|
|
342
|
+
objectRef: '',
|
|
343
|
+
})
|
|
344
|
+
tag: string;
|
|
329
345
|
|
|
330
346
|
/**
|
|
331
347
|
* 页面元素名称
|
|
332
348
|
*/
|
|
333
|
-
@property(
|
|
334
|
-
|
|
349
|
+
@property({
|
|
350
|
+
objectRef: '',
|
|
351
|
+
})
|
|
352
|
+
name: string = '';
|
|
335
353
|
|
|
336
354
|
/**
|
|
337
355
|
* 静态 class 名
|
|
338
356
|
*/
|
|
339
|
-
@property(
|
|
340
|
-
|
|
357
|
+
@property({
|
|
358
|
+
objectRef: '',
|
|
359
|
+
})
|
|
360
|
+
staticClass: string;
|
|
341
361
|
|
|
342
362
|
/**
|
|
343
363
|
* 静态 style
|
|
344
364
|
*/
|
|
345
|
-
@property(
|
|
346
|
-
|
|
365
|
+
@property({
|
|
366
|
+
objectRef: '',
|
|
367
|
+
})
|
|
368
|
+
staticStyle: string;
|
|
347
369
|
|
|
348
370
|
/**
|
|
349
371
|
* 权限资源描述
|
|
350
372
|
*/
|
|
351
|
-
@property(
|
|
352
|
-
|
|
373
|
+
@property({
|
|
374
|
+
objectRef: '',
|
|
375
|
+
})
|
|
376
|
+
authDescription: string;
|
|
353
377
|
|
|
354
378
|
/**
|
|
355
379
|
* 插槽目标
|
|
356
380
|
*/
|
|
357
|
-
@property(
|
|
358
|
-
|
|
381
|
+
@property({
|
|
382
|
+
objectRef: '',
|
|
383
|
+
})
|
|
384
|
+
slotTarget: string;
|
|
359
385
|
|
|
360
386
|
/**
|
|
361
387
|
* 插槽 scope 表达式
|
|
362
388
|
*/
|
|
363
|
-
@property(
|
|
364
|
-
|
|
389
|
+
@property({
|
|
390
|
+
objectRef: '',
|
|
391
|
+
})
|
|
392
|
+
slotScope: string;
|
|
365
393
|
|
|
366
394
|
/**
|
|
367
395
|
* 元素绑定属性列表
|
|
@@ -397,6 +425,7 @@ export class ViewElement extends BaseNode {
|
|
|
397
425
|
* 绑定的角色
|
|
398
426
|
*/
|
|
399
427
|
@property({
|
|
428
|
+
objectRef: '',
|
|
400
429
|
isArray: true,
|
|
401
430
|
defaultValue: [],
|
|
402
431
|
})
|
|
@@ -422,31 +451,6 @@ export class ViewElement extends BaseNode {
|
|
|
422
451
|
})
|
|
423
452
|
children: Array<ViewElement> = [];
|
|
424
453
|
|
|
425
|
-
/**
|
|
426
|
-
* 祖先 View
|
|
427
|
-
*/
|
|
428
|
-
get view() {
|
|
429
|
-
return this.getAncestor('View') as View;
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* 祖先 Module
|
|
433
|
-
*/
|
|
434
|
-
get module() {
|
|
435
|
-
return this.getAncestor('Module') as Module;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* 祖先 App
|
|
439
|
-
*/
|
|
440
|
-
get app() {
|
|
441
|
-
return this.getAncestor('App') as App;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* 祖先 Frontend
|
|
445
|
-
*/
|
|
446
|
-
get frontend() {
|
|
447
|
-
return this.getAncestor('Frontend') as Frontend;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
454
|
/**
|
|
451
455
|
* @param source 需要合并的部分参数
|
|
452
456
|
*/
|
|
@@ -456,17 +460,6 @@ export class ViewElement extends BaseNode {
|
|
|
456
460
|
super.subConstructor(source);
|
|
457
461
|
}
|
|
458
462
|
|
|
459
|
-
/**
|
|
460
|
-
* 从父级删除该节点
|
|
461
|
-
* @internal
|
|
462
|
-
*/
|
|
463
|
-
_delete() {
|
|
464
|
-
let params: Params = null;
|
|
465
|
-
if (this.parentNode) {
|
|
466
|
-
params = (this.parentNode as any)?.__removeViewElement?.(this);
|
|
467
|
-
}
|
|
468
|
-
return params;
|
|
469
|
-
}
|
|
470
463
|
/**
|
|
471
464
|
* 设置页面元素名称
|
|
472
465
|
*/
|
|
@@ -508,7 +501,7 @@ export class ViewElement extends BaseNode {
|
|
|
508
501
|
const excludedSet = new Set(excludedList);
|
|
509
502
|
return ((this.bindAttrs as BindAttribute[]) || [])
|
|
510
503
|
.filter((item) => !excludedSet.has(item))
|
|
511
|
-
.map((item) => item
|
|
504
|
+
.map((item) => item.name);
|
|
512
505
|
}
|
|
513
506
|
getBindAttributeUniqueName(name = 'bindAttribute1') {
|
|
514
507
|
return utils.unique(name, this.getBindAttributeExistingNames(), undefined, false);
|
|
@@ -662,7 +655,7 @@ export class ViewElement extends BaseNode {
|
|
|
662
655
|
|
|
663
656
|
getBindEventExistingNames(excludedList: Array<BindEvent> = []) {
|
|
664
657
|
const excludedSet = new Set(excludedList);
|
|
665
|
-
return ((this.bindEvents as BindEvent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
658
|
+
return ((this.bindEvents as BindEvent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
666
659
|
}
|
|
667
660
|
getBindEventUniqueName(name = 'bindEvent1') {
|
|
668
661
|
return utils.unique(name, this.getBindEventExistingNames(), undefined, false);
|
|
@@ -818,7 +811,7 @@ export class ViewElement extends BaseNode {
|
|
|
818
811
|
const excludedSet = new Set(excludedList);
|
|
819
812
|
return ((this.bindDirectives as BindDirective[]) || [])
|
|
820
813
|
.filter((item) => !excludedSet.has(item))
|
|
821
|
-
.map((item) => item
|
|
814
|
+
.map((item) => item.name);
|
|
822
815
|
}
|
|
823
816
|
getBindDirectiveUniqueName(name = 'bindDirective1') {
|
|
824
817
|
return utils.unique(name, this.getBindDirectiveExistingNames(), undefined, false);
|
|
@@ -972,7 +965,7 @@ export class ViewElement extends BaseNode {
|
|
|
972
965
|
|
|
973
966
|
getBindStyleExistingNames(excludedList: Array<BindStyle> = []) {
|
|
974
967
|
const excludedSet = new Set(excludedList);
|
|
975
|
-
return ((this.bindStyles as BindStyle[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
968
|
+
return ((this.bindStyles as BindStyle[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
976
969
|
}
|
|
977
970
|
getBindStyleUniqueName(name = 'bindStyle1') {
|
|
978
971
|
return utils.unique(name, this.getBindStyleExistingNames(), undefined, false);
|
|
@@ -1295,37 +1288,6 @@ export class ViewElement extends BaseNode {
|
|
|
1295
1288
|
return bindAttribute.delete();
|
|
1296
1289
|
}
|
|
1297
1290
|
|
|
1298
|
-
__removeBindAttribute(bindAttribute: BindAttribute) {
|
|
1299
|
-
const parentKey = bindAttribute.parentKey;
|
|
1300
|
-
const params: Params = {
|
|
1301
|
-
parentNode: this,
|
|
1302
|
-
parentKey,
|
|
1303
|
-
index: -1,
|
|
1304
|
-
object: null,
|
|
1305
|
-
oldObject: bindAttribute,
|
|
1306
|
-
};
|
|
1307
|
-
if (parentKey) {
|
|
1308
|
-
params.parentKey = parentKey;
|
|
1309
|
-
// @ts-ignore
|
|
1310
|
-
const t = this.__v_raw || this;
|
|
1311
|
-
// @ts-ignore
|
|
1312
|
-
const n = bindAttribute.__v_raw || bindAttribute;
|
|
1313
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1314
|
-
// @ts-ignore
|
|
1315
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1316
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1317
|
-
params.index = index;
|
|
1318
|
-
} else {
|
|
1319
|
-
const q = (t as any)[parentKey];
|
|
1320
|
-
if ((q.__v_raw || q) === n) {
|
|
1321
|
-
params.index = 0;
|
|
1322
|
-
(this as any)[parentKey] = undefined;
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
return params;
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
1291
|
/**
|
|
1330
1292
|
* 删除元素绑定事件
|
|
1331
1293
|
* @param name 元素绑定事件名称
|
|
@@ -1351,37 +1313,6 @@ export class ViewElement extends BaseNode {
|
|
|
1351
1313
|
return bindEvent.delete();
|
|
1352
1314
|
}
|
|
1353
1315
|
|
|
1354
|
-
__removeBindEvent(bindEvent: BindEvent) {
|
|
1355
|
-
const parentKey = bindEvent.parentKey;
|
|
1356
|
-
const params: Params = {
|
|
1357
|
-
parentNode: this,
|
|
1358
|
-
parentKey,
|
|
1359
|
-
index: -1,
|
|
1360
|
-
object: null,
|
|
1361
|
-
oldObject: bindEvent,
|
|
1362
|
-
};
|
|
1363
|
-
if (parentKey) {
|
|
1364
|
-
params.parentKey = parentKey;
|
|
1365
|
-
// @ts-ignore
|
|
1366
|
-
const t = this.__v_raw || this;
|
|
1367
|
-
// @ts-ignore
|
|
1368
|
-
const n = bindEvent.__v_raw || bindEvent;
|
|
1369
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1370
|
-
// @ts-ignore
|
|
1371
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1372
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1373
|
-
params.index = index;
|
|
1374
|
-
} else {
|
|
1375
|
-
const q = (t as any)[parentKey];
|
|
1376
|
-
if ((q.__v_raw || q) === n) {
|
|
1377
|
-
params.index = 0;
|
|
1378
|
-
(this as any)[parentKey] = undefined;
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
return params;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
1316
|
/**
|
|
1386
1317
|
* 删除元素指令
|
|
1387
1318
|
* @param name 元素指令名称
|
|
@@ -1407,37 +1338,6 @@ export class ViewElement extends BaseNode {
|
|
|
1407
1338
|
return bindDirective.delete();
|
|
1408
1339
|
}
|
|
1409
1340
|
|
|
1410
|
-
__removeBindDirective(bindDirective: BindDirective) {
|
|
1411
|
-
const parentKey = bindDirective.parentKey;
|
|
1412
|
-
const params: Params = {
|
|
1413
|
-
parentNode: this,
|
|
1414
|
-
parentKey,
|
|
1415
|
-
index: -1,
|
|
1416
|
-
object: null,
|
|
1417
|
-
oldObject: bindDirective,
|
|
1418
|
-
};
|
|
1419
|
-
if (parentKey) {
|
|
1420
|
-
params.parentKey = parentKey;
|
|
1421
|
-
// @ts-ignore
|
|
1422
|
-
const t = this.__v_raw || this;
|
|
1423
|
-
// @ts-ignore
|
|
1424
|
-
const n = bindDirective.__v_raw || bindDirective;
|
|
1425
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1426
|
-
// @ts-ignore
|
|
1427
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1428
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1429
|
-
params.index = index;
|
|
1430
|
-
} else {
|
|
1431
|
-
const q = (t as any)[parentKey];
|
|
1432
|
-
if ((q.__v_raw || q) === n) {
|
|
1433
|
-
params.index = 0;
|
|
1434
|
-
(this as any)[parentKey] = undefined;
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
return params;
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
1341
|
/**
|
|
1442
1342
|
* 删除元素绑定样式
|
|
1443
1343
|
* @param name 元素绑定样式名称
|
|
@@ -1463,37 +1363,6 @@ export class ViewElement extends BaseNode {
|
|
|
1463
1363
|
return bindStyle.delete();
|
|
1464
1364
|
}
|
|
1465
1365
|
|
|
1466
|
-
__removeBindStyle(bindStyle: BindStyle) {
|
|
1467
|
-
const parentKey = bindStyle.parentKey;
|
|
1468
|
-
const params: Params = {
|
|
1469
|
-
parentNode: this,
|
|
1470
|
-
parentKey,
|
|
1471
|
-
index: -1,
|
|
1472
|
-
object: null,
|
|
1473
|
-
oldObject: bindStyle,
|
|
1474
|
-
};
|
|
1475
|
-
if (parentKey) {
|
|
1476
|
-
params.parentKey = parentKey;
|
|
1477
|
-
// @ts-ignore
|
|
1478
|
-
const t = this.__v_raw || this;
|
|
1479
|
-
// @ts-ignore
|
|
1480
|
-
const n = bindStyle.__v_raw || bindStyle;
|
|
1481
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1482
|
-
// @ts-ignore
|
|
1483
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1484
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1485
|
-
params.index = index;
|
|
1486
|
-
} else {
|
|
1487
|
-
const q = (t as any)[parentKey];
|
|
1488
|
-
if ((q.__v_raw || q) === n) {
|
|
1489
|
-
params.index = 0;
|
|
1490
|
-
(this as any)[parentKey] = undefined;
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
return params;
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
1366
|
/**
|
|
1498
1367
|
* 删除页面元素
|
|
1499
1368
|
* @param name 页面元素名称
|
|
@@ -1519,41 +1388,28 @@ export class ViewElement extends BaseNode {
|
|
|
1519
1388
|
return viewElement.delete();
|
|
1520
1389
|
}
|
|
1521
1390
|
|
|
1522
|
-
__removeViewElement(viewElement: ViewElement) {
|
|
1523
|
-
const parentKey = viewElement.parentKey;
|
|
1524
|
-
const params: Params = {
|
|
1525
|
-
parentNode: this,
|
|
1526
|
-
parentKey,
|
|
1527
|
-
index: -1,
|
|
1528
|
-
object: null,
|
|
1529
|
-
oldObject: viewElement,
|
|
1530
|
-
};
|
|
1531
|
-
if (parentKey) {
|
|
1532
|
-
params.parentKey = parentKey;
|
|
1533
|
-
// @ts-ignore
|
|
1534
|
-
const t = this.__v_raw || this;
|
|
1535
|
-
// @ts-ignore
|
|
1536
|
-
const n = viewElement.__v_raw || viewElement;
|
|
1537
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1538
|
-
// @ts-ignore
|
|
1539
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1540
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1541
|
-
params.index = index;
|
|
1542
|
-
} else {
|
|
1543
|
-
const q = (t as any)[parentKey];
|
|
1544
|
-
if ((q.__v_raw || q) === n) {
|
|
1545
|
-
params.index = 0;
|
|
1546
|
-
(this as any)[parentKey] = undefined;
|
|
1547
|
-
}
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
return params;
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
1391
|
//================================================================================
|
|
1554
1392
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1555
1393
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
1556
1394
|
//================================================================================
|
|
1395
|
+
/**
|
|
1396
|
+
* 祖先 View
|
|
1397
|
+
*/
|
|
1398
|
+
get view() {
|
|
1399
|
+
return this.getAncestor('View') as View;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* 祖先 Module
|
|
1403
|
+
*/
|
|
1404
|
+
get module() {
|
|
1405
|
+
return this.getAncestor('Module') as Module;
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* 祖先 Frontend
|
|
1409
|
+
*/
|
|
1410
|
+
get frontend() {
|
|
1411
|
+
return this.getAncestor('Frontend') as Frontend;
|
|
1412
|
+
}
|
|
1557
1413
|
|
|
1558
1414
|
get likeComponent(): View | BusinessComponent {
|
|
1559
1415
|
return this.view || (this?.getAncestor('BusinessComponent') as BusinessComponent);
|
|
@@ -1622,6 +1478,7 @@ export class ViewElement extends BaseNode {
|
|
|
1622
1478
|
toHump(name: string): string {
|
|
1623
1479
|
return name.replace(/-(\w)/g, (all, letter) => letter.toUpperCase());
|
|
1624
1480
|
}
|
|
1481
|
+
|
|
1625
1482
|
toFirstUpper(name: string): string {
|
|
1626
1483
|
return name.replace(/^\S/, (s) => s.toUpperCase());
|
|
1627
1484
|
}
|
|
@@ -1630,6 +1487,62 @@ export class ViewElement extends BaseNode {
|
|
|
1630
1487
|
return Boolean(this.slotScope);
|
|
1631
1488
|
}
|
|
1632
1489
|
|
|
1490
|
+
getGenericTypes(tag: string) {
|
|
1491
|
+
let T;
|
|
1492
|
+
let V;
|
|
1493
|
+
let P;
|
|
1494
|
+
let M;
|
|
1495
|
+
let T1;
|
|
1496
|
+
let C;
|
|
1497
|
+
|
|
1498
|
+
const genericTypes: string[] = [];
|
|
1499
|
+
|
|
1500
|
+
if (config?.allNodesAPI[tag]) {
|
|
1501
|
+
const { tsTypeParams = '' } = config?.allNodesAPI[tag];
|
|
1502
|
+
const tsTypes = tsTypeParams?.split(',');
|
|
1503
|
+
|
|
1504
|
+
tsTypes.forEach((item) => {
|
|
1505
|
+
const reg = /^(\w+)\s?/;
|
|
1506
|
+
const result = reg.exec(item.trim());
|
|
1507
|
+
const t = result?.[1];
|
|
1508
|
+
if (t === 'T') {
|
|
1509
|
+
T = true;
|
|
1510
|
+
genericTypes.push('__item');
|
|
1511
|
+
}
|
|
1512
|
+
if (t === 'V') {
|
|
1513
|
+
V = true;
|
|
1514
|
+
genericTypes.push('__V');
|
|
1515
|
+
}
|
|
1516
|
+
if (t === 'P') {
|
|
1517
|
+
P = true;
|
|
1518
|
+
genericTypes.push('__pageable');
|
|
1519
|
+
}
|
|
1520
|
+
if (t === 'M') {
|
|
1521
|
+
M = true;
|
|
1522
|
+
genericTypes.push('__multiple');
|
|
1523
|
+
}
|
|
1524
|
+
if (t === 'C') {
|
|
1525
|
+
C = true;
|
|
1526
|
+
genericTypes.push('__converter');
|
|
1527
|
+
}
|
|
1528
|
+
if (t === 'T1') {
|
|
1529
|
+
T1 = true;
|
|
1530
|
+
genericTypes.push('__columnItem');
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
return {
|
|
1536
|
+
T,
|
|
1537
|
+
V,
|
|
1538
|
+
P,
|
|
1539
|
+
M,
|
|
1540
|
+
T1,
|
|
1541
|
+
C,
|
|
1542
|
+
genericTypes,
|
|
1543
|
+
};
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1633
1546
|
@withGenerator
|
|
1634
1547
|
*toEmbeddedTSDefinition(state = createCompilerState()): TranslatorGenerator {
|
|
1635
1548
|
const self = this;
|
|
@@ -1637,164 +1550,218 @@ export class ViewElement extends BaseNode {
|
|
|
1637
1550
|
code += indent((state?.tabSize || 0) + 1);
|
|
1638
1551
|
if (self.isCorrespondingBusinessComponent) {
|
|
1639
1552
|
code += `${self.name}: ${self.correspondingBusinessComponentNamespace}.${self.tag.replace('bs-', '')};\n`;
|
|
1640
|
-
} else if (self.toHump(self.tag) === 'lcapLogin' || self.staticClass === 'login-form') {
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
code +=
|
|
1553
|
+
} else if (self.toHump(self.tag) === 'lcapLogin' || self.staticClass === 'login-form') {
|
|
1554
|
+
// 登录组件不翻译
|
|
1555
|
+
code += `${self.name}: nasl.ui.Div;\n`;
|
|
1556
|
+
} else if (config?.allNodesAPI[self.tag]) {
|
|
1557
|
+
const { T, V, P, M, T1, C, genericTypes } = this.getGenericTypes(self.tag);
|
|
1558
|
+
|
|
1559
|
+
code += `${self.name}: nasl.ui.${utils.kebab2Pascal(self.tag)}`;
|
|
1560
|
+
|
|
1561
|
+
if (genericTypes.length > 0) {
|
|
1562
|
+
code += `<`;
|
|
1563
|
+
code += genericTypes.map((i) => `typeof __elementsRef.${self.name}.${i}`).join(', ');
|
|
1564
|
+
code += `>`;
|
|
1650
1565
|
}
|
|
1566
|
+
|
|
1567
|
+
code += ';\n';
|
|
1651
1568
|
} else {
|
|
1652
|
-
code += `${self.name}: nasl.ui.${
|
|
1569
|
+
code += `${self.name}: nasl.ui.${utils.kebab2Pascal(self.tag)};\n`;
|
|
1653
1570
|
}
|
|
1571
|
+
|
|
1654
1572
|
if (Array.isArray(self.children)) {
|
|
1655
1573
|
yield* wrapForEach(self.children, function* warpForEachGenerator(element) {
|
|
1656
1574
|
code += yield* element.toEmbeddedTSDefinition(shiftState(state, code));
|
|
1657
1575
|
});
|
|
1658
1576
|
}
|
|
1577
|
+
|
|
1659
1578
|
return code;
|
|
1660
1579
|
}
|
|
1661
1580
|
|
|
1662
|
-
|
|
1663
|
-
*toEmbeddedTSVariableDefinition(
|
|
1664
|
-
state = createCompilerState(),
|
|
1665
|
-
variableList?: string[],
|
|
1666
|
-
nameLevel?: string,
|
|
1667
|
-
): TranslatorGenerator {
|
|
1581
|
+
toEmbeddedTSRefPath(elementsPathMap: Record<string, any>) {
|
|
1668
1582
|
const self = this;
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
code += `${self.name}: {\n`;
|
|
1675
|
-
if (Array.isArray(self.bindAttrs)) {
|
|
1676
|
-
yield* wrapForEach(
|
|
1677
|
-
self.bindAttrs.filter((attr) => PAGE_COMPONENT_INCLUDE_TAG_MAP[self.tag]?.[attr.name]),
|
|
1678
|
-
function* warpForEachGenerator(attr) {
|
|
1679
|
-
code += yield* attr.toEmbeddedTSVariableDefinition(
|
|
1680
|
-
shiftState(state, code, { inline: true }),
|
|
1681
|
-
variableList,
|
|
1682
|
-
self.name,
|
|
1683
|
-
currentLevel,
|
|
1684
|
-
);
|
|
1685
|
-
},
|
|
1686
|
-
);
|
|
1687
|
-
if (['u-select', 'van-pickerson'].includes(self.tag)) {
|
|
1688
|
-
code += indent((state?.tabSize || 0) + 3);
|
|
1689
|
-
code += `pageNumber: nasl.core.Long\n`;
|
|
1690
|
-
code += indent((state?.tabSize || 0) + 3);
|
|
1691
|
-
code += `filterText: nasl.core.String\n`;
|
|
1692
|
-
} else if (
|
|
1693
|
-
['u-list-view', 'u-grid-view', 'u-table-view', 'van-list-view', 'van-grid-view'].includes(self.tag) &&
|
|
1694
|
-
self.bindAttrs?.findIndex((attr) => attr.name === 'sorting') === -1
|
|
1695
|
-
) {
|
|
1696
|
-
if (['u-list-view', 'van-grid-view', 'van-list-view'].includes(self.tag)) {
|
|
1697
|
-
code += indent((state?.tabSize || 0) + 3);
|
|
1698
|
-
code += `filterText: nasl.core.String\n`;
|
|
1699
|
-
}
|
|
1700
|
-
code += indent((state?.tabSize || 0) + 3);
|
|
1701
|
-
code += `sorting: {
|
|
1702
|
-
field: nasl.core.String
|
|
1703
|
-
order: nasl.core.String
|
|
1704
|
-
}\n`;
|
|
1705
|
-
} else if (['u-cascader', 'van-cascader'].includes(self.tag)) {
|
|
1706
|
-
code += indent((state?.tabSize || 0) + 3);
|
|
1707
|
-
code += `filterText: nasl.core.String\n`;
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
code += indent((state?.tabSize || 0) + 2);
|
|
1711
|
-
code += `};\n`;
|
|
1583
|
+
|
|
1584
|
+
if (asserts.isViewElement(self.parentNode)) {
|
|
1585
|
+
elementsPathMap[self.name] = `${elementsPathMap[self.parentNode.name]}.${self.name}`;
|
|
1586
|
+
} else {
|
|
1587
|
+
elementsPathMap[self.name] = `${self.name}`;
|
|
1712
1588
|
}
|
|
1589
|
+
|
|
1713
1590
|
if (Array.isArray(self.children)) {
|
|
1714
|
-
|
|
1715
|
-
|
|
1591
|
+
self.children.forEach((element) => {
|
|
1592
|
+
element.toEmbeddedTSRefPath(elementsPathMap);
|
|
1716
1593
|
});
|
|
1717
1594
|
}
|
|
1718
|
-
return code;
|
|
1719
1595
|
}
|
|
1720
1596
|
|
|
1721
1597
|
@withGenerator
|
|
1722
|
-
*
|
|
1598
|
+
*toEmbeddedTSRefTree(
|
|
1599
|
+
state = createCompilerState(),
|
|
1600
|
+
options: { elementsPathMap: Record<string, any> },
|
|
1601
|
+
parentLevel?: number,
|
|
1602
|
+
): TranslatorGenerator {
|
|
1723
1603
|
const self = this;
|
|
1604
|
+
|
|
1605
|
+
const { elementsPathMap } = options;
|
|
1606
|
+
|
|
1607
|
+
const { T, V, P, M, T1, C } = this.getGenericTypes(self.tag);
|
|
1608
|
+
|
|
1724
1609
|
let code = '';
|
|
1725
1610
|
code += indent((state?.tabSize || 0) + 2);
|
|
1726
1611
|
let levelIndex = parentLevel || 0;
|
|
1727
1612
|
code += `${self.name}: () => {\n`;
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
if (
|
|
1733
|
-
|
|
1734
|
-
|
|
1613
|
+
|
|
1614
|
+
const getType = (name: string) => {
|
|
1615
|
+
let t;
|
|
1616
|
+
const attr = self.bindAttrs?.find((attr) => attr.name === name);
|
|
1617
|
+
if (['static', 'string'].includes(attr?.type)) {
|
|
1618
|
+
t = attr.value ? 'true' : 'false';
|
|
1619
|
+
} else if (['dynamic'].includes(attr?.type)) {
|
|
1620
|
+
t = 'nasl.core.Boolean';
|
|
1735
1621
|
} else {
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1622
|
+
t = false;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
return t;
|
|
1626
|
+
};
|
|
1627
|
+
const hasDataSource =
|
|
1628
|
+
config?.allNodesAPI?.[self.tag]?.props?.findIndex((prop) => ['dataSource', 'data-source'].includes(prop.name)) >
|
|
1629
|
+
-1;
|
|
1630
|
+
// 有数据源属性的组件 才需要生成 item
|
|
1631
|
+
if (hasDataSource && T) {
|
|
1632
|
+
const key = T1 ? '__columnItem' : '__item';
|
|
1633
|
+
const dataSourceAttr = self.bindAttrs?.find((attr) => attr.name === 'dataSource');
|
|
1634
|
+
if (dataSourceAttr?.expression) {
|
|
1635
|
+
if (
|
|
1636
|
+
asserts.isMemberExpression(dataSourceAttr.expression) ||
|
|
1637
|
+
asserts.isIdentifier(dataSourceAttr.expression) ||
|
|
1638
|
+
asserts.isCallLogic(dataSourceAttr.expression)
|
|
1639
|
+
) {
|
|
1640
|
+
const value = yield* dataSourceAttr.expression.toEmbeddedTS(
|
|
1641
|
+
shiftState(
|
|
1642
|
+
state,
|
|
1643
|
+
code,
|
|
1644
|
+
dataSourceAttr.expression.concept === 'CallLogic'
|
|
1645
|
+
? {
|
|
1646
|
+
tabSize: 4,
|
|
1647
|
+
inline: true,
|
|
1648
|
+
noNeedParams: true,
|
|
1649
|
+
}
|
|
1650
|
+
: {},
|
|
1651
|
+
),
|
|
1652
|
+
);
|
|
1653
|
+
|
|
1654
|
+
// 用别的组件的data当数据源
|
|
1655
|
+
if (
|
|
1656
|
+
(dataSourceAttr.expression as MemberExpression)?.property?.name === 'data' &&
|
|
1657
|
+
((dataSourceAttr.expression as MemberExpression)?.object as Identifier)?.namespace?.startsWith('elements.')
|
|
1658
|
+
) {
|
|
1659
|
+
const componentName = ((dataSourceAttr.expression as MemberExpression)?.object as Identifier).name;
|
|
1660
|
+
const componentPath = elementsPathMap[componentName]?.split('.');
|
|
1661
|
+
const component = componentPath?.reduce((prev: string, cur: string) => {
|
|
1662
|
+
return `${prev}.children.${cur}()`;
|
|
1663
|
+
}, 'elementsRefTree()');
|
|
1664
|
+
|
|
1665
|
+
if (component) {
|
|
1666
|
+
code += `let t = ${component}.__item;\n`;
|
|
1667
|
+
code += `let ${key}: typeof t;\n`;
|
|
1668
|
+
} else {
|
|
1669
|
+
code += `let ${key}: any;\n`;
|
|
1670
|
+
}
|
|
1671
|
+
} else {
|
|
1672
|
+
code += `let ${key}: nasl.ui.GetItemTypeFromDataSource<typeof ${value}>;\n`;
|
|
1673
|
+
}
|
|
1674
|
+
} else {
|
|
1675
|
+
const returnCode = yield* dataSourceAttr.expression.toEmbeddedTS(shiftState(state, code));
|
|
1676
|
+
|
|
1677
|
+
code += `const _load = () => { return `;
|
|
1678
|
+
code += returnCode;
|
|
1679
|
+
code += '};\n';
|
|
1680
|
+
code += `let ${key}: nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof _load>>;\n`;
|
|
1739
1681
|
}
|
|
1740
|
-
|
|
1682
|
+
} else {
|
|
1683
|
+
code += `let ${key}: any;\n`;
|
|
1741
1684
|
}
|
|
1742
|
-
code += indent((state?.tabSize || 0) + 3);
|
|
1743
|
-
code += `let current${levelIndex === 0 ? '' : levelIndex}: nasl.ui.${currentType}${genericity}\n`;
|
|
1744
|
-
levelIndex++;
|
|
1745
1685
|
}
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
(
|
|
1750
|
-
if (
|
|
1751
|
-
|
|
1752
|
-
asserts.isIdentifier(attr.expression) ||
|
|
1753
|
-
asserts.isCallLogic(attr.expression)
|
|
1754
|
-
) {
|
|
1755
|
-
const extraParams = {
|
|
1756
|
-
tabSize: 4,
|
|
1757
|
-
inline: true,
|
|
1758
|
-
noNeedParams: true,
|
|
1759
|
-
};
|
|
1760
|
-
let value = yield* attr.expression.toEmbeddedTS(
|
|
1761
|
-
shiftState(state, code, attr.expression.concept === 'CallLogic' ? extraParams : {}),
|
|
1762
|
-
);
|
|
1763
|
-
code += indent((state?.tabSize || 0) + 3);
|
|
1764
|
-
code += `type ${datasourceName} = nasl.ui.GetItemTypeFromDataSource<typeof ${value}>;\n`;
|
|
1765
|
-
// code += `let current${levelIndex === 0 ? '' : levelIndex}: nasl.ui.${currentType}<nasl.ui.GetItemTypeFromDataSource<typeof ${value}>>;\n`;
|
|
1686
|
+
// 值
|
|
1687
|
+
let valueType: string;
|
|
1688
|
+
if (hasDataSource && V && !T1) {
|
|
1689
|
+
const valueFieldAttr = self.bindAttrs?.find((attr) => attr.name === 'valueField');
|
|
1690
|
+
if (['static', 'string'].includes(valueFieldAttr?.type)) {
|
|
1691
|
+
valueType = `typeof __item.${valueFieldAttr.value}`;
|
|
1766
1692
|
} else {
|
|
1767
|
-
|
|
1768
|
-
code += `const __funcName = () => { return `;
|
|
1769
|
-
code += yield* attr.expression.toEmbeddedTS(shiftState(state, code));
|
|
1770
|
-
code += '};\n';
|
|
1771
|
-
code += indent((state?.tabSize || 0) + 3);
|
|
1772
|
-
code += `type ${datasourceName} = nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof __funcName>>;\n`;
|
|
1773
|
-
// code += `let current${levelIndex === 0 ? '' : levelIndex}: nasl.ui.${currentType}<nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof __funcName>>>;\n`;
|
|
1693
|
+
valueType = 'any';
|
|
1774
1694
|
}
|
|
1775
|
-
} else {
|
|
1776
|
-
(self as any).__tsVariableDataSourceTypeName = 'any';
|
|
1777
1695
|
}
|
|
1696
|
+
// 分页
|
|
1697
|
+
let pageableType: string | boolean;
|
|
1698
|
+
if (hasDataSource && P && !T1) {
|
|
1699
|
+
pageableType = getType('pageable');
|
|
1700
|
+
code += `let __pageable: ${pageableType};\n`;
|
|
1701
|
+
}
|
|
1702
|
+
// 多选
|
|
1703
|
+
let multipleType: string | boolean;
|
|
1704
|
+
if (hasDataSource && M && !T1) {
|
|
1705
|
+
multipleType = getType('multiple');
|
|
1706
|
+
code += `let __multiple: ${multipleType};\n`;
|
|
1707
|
+
}
|
|
1708
|
+
if (hasDataSource && V && !T1) {
|
|
1709
|
+
code += `// @ts-ignore
|
|
1710
|
+
let __value: ${valueType}${[true, 'true'].includes(multipleType) ? '[]' : ''};\n`;
|
|
1711
|
+
code += `// @ts-ignore
|
|
1712
|
+
let __V: ${valueType};\n`;
|
|
1713
|
+
}
|
|
1714
|
+
if (C) {
|
|
1715
|
+
// code += `let converter: ${getType('converter')};\n`;
|
|
1716
|
+
code += `let __converter: any;\n`;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
if (self.tag === 'template' && self.haveScope() && asserts.isViewElement(self.parentNode)) {
|
|
1720
|
+
const currentType = self.parentNode.tag === 'u-table-view-column-dynamic' ? 'CurrentDynamic' : 'Current';
|
|
1721
|
+
code += indent((state?.tabSize || 0) + 3);
|
|
1722
|
+
code += `let current${levelIndex === 0 ? '' : levelIndex}: nasl.ui.${currentType}<typeof __item${
|
|
1723
|
+
currentType === 'CurrentDynamic' ? ', typeof __columnItem' : ''
|
|
1724
|
+
}>;\n`;
|
|
1725
|
+
levelIndex++;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1778
1728
|
code += indent((state?.tabSize || 0) + 3);
|
|
1779
1729
|
code += `return {\n`;
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
);
|
|
1730
|
+
|
|
1731
|
+
if (T) {
|
|
1732
|
+
code += `__item,\n`;
|
|
1733
|
+
}
|
|
1734
|
+
if (V) {
|
|
1735
|
+
code += `__value, __V,\n`;
|
|
1787
1736
|
}
|
|
1737
|
+
if (P) {
|
|
1738
|
+
code += `__pageable,\n`;
|
|
1739
|
+
}
|
|
1740
|
+
if (M) {
|
|
1741
|
+
code += `__multiple,\n`;
|
|
1742
|
+
}
|
|
1743
|
+
if (T1) {
|
|
1744
|
+
code += `__columnItem,\n`;
|
|
1745
|
+
}
|
|
1746
|
+
if (C) {
|
|
1747
|
+
code += `__converter,\n`;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1788
1750
|
if (Array.isArray(self.children)) {
|
|
1751
|
+
code += indent((state?.tabSize || 0) + 4);
|
|
1752
|
+
code += `children: {\n`;
|
|
1789
1753
|
yield* wrapForEach(self.children, function* warpForEachGenerator(element) {
|
|
1790
|
-
code += yield* element.
|
|
1754
|
+
code += yield* element.toEmbeddedTSRefTree(
|
|
1791
1755
|
shiftState({ ...state, tabSize: state.tabSize + 2 }, code),
|
|
1756
|
+
{ elementsPathMap },
|
|
1792
1757
|
levelIndex,
|
|
1793
1758
|
);
|
|
1794
1759
|
});
|
|
1760
|
+
code += indent((state?.tabSize || 0) + 4);
|
|
1761
|
+
code += `},\n`;
|
|
1795
1762
|
}
|
|
1796
1763
|
code += indent((state?.tabSize || 0) + 3);
|
|
1797
|
-
code += `}
|
|
1764
|
+
code += `};\n`;
|
|
1798
1765
|
code += indent((state?.tabSize || 0) + 2);
|
|
1799
1766
|
code += `},\n`;
|
|
1800
1767
|
return code;
|
|
@@ -1824,7 +1791,7 @@ export class ViewElement extends BaseNode {
|
|
|
1824
1791
|
}
|
|
1825
1792
|
const bindAttrs = this.bindAttrs;
|
|
1826
1793
|
if (bindAttrs && bindAttrs.length) {
|
|
1827
|
-
const attr = bindAttrs.find((item) => item.name === '
|
|
1794
|
+
const attr = bindAttrs.find((item) => item.name === 'dataSource');
|
|
1828
1795
|
if (attr && attr.expression) {
|
|
1829
1796
|
if (this.tag === 'u-table-view-column-dynamic') {
|
|
1830
1797
|
code += `<${(this.parentNode as any).__tsDataSourceTypeName}, ${(this as any).__tsDataSourceTypeName}>`;
|
|
@@ -1835,12 +1802,13 @@ export class ViewElement extends BaseNode {
|
|
|
1835
1802
|
}
|
|
1836
1803
|
return code;
|
|
1837
1804
|
}
|
|
1805
|
+
// 应该没有再使用了
|
|
1838
1806
|
*getDatasourceTypeCodeStr(state?: TranslatorState, eleArr?: Array<ViewElement>) {
|
|
1839
1807
|
let code = '';
|
|
1840
1808
|
yield* wrapForEach(eleArr ?? [], function* wrapForEach(element, index) {
|
|
1841
1809
|
const bindAttrs = element.bindAttrs;
|
|
1842
1810
|
if (bindAttrs && bindAttrs.length) {
|
|
1843
|
-
const attr = bindAttrs.find((item) => item.name === '
|
|
1811
|
+
const attr = bindAttrs.find((item) => item.name === 'dataSource');
|
|
1844
1812
|
if (attr && attr.expression) {
|
|
1845
1813
|
const datasourceName = `datasourceName${element.name}`;
|
|
1846
1814
|
(element as any).__tsDataSourceTypeName = datasourceName;
|
|
@@ -1853,8 +1821,9 @@ export class ViewElement extends BaseNode {
|
|
|
1853
1821
|
tabSize: 4,
|
|
1854
1822
|
inline: true,
|
|
1855
1823
|
noNeedParams: true,
|
|
1824
|
+
callLogicNoIife: true,
|
|
1856
1825
|
};
|
|
1857
|
-
|
|
1826
|
+
const value = yield* attr.expression.toEmbeddedTS(
|
|
1858
1827
|
shiftState(state, code, attr.expression.concept === 'CallLogic' ? extraParams : {}),
|
|
1859
1828
|
);
|
|
1860
1829
|
code += `type ${datasourceName} = `;
|
|
@@ -1901,6 +1870,29 @@ export class ViewElement extends BaseNode {
|
|
|
1901
1870
|
}
|
|
1902
1871
|
}
|
|
1903
1872
|
|
|
1873
|
+
// 收集页面元素中的业务组件
|
|
1874
|
+
collectExistingBusinessComponent() {
|
|
1875
|
+
const excludedSet = new Set();
|
|
1876
|
+
utils.traverse(
|
|
1877
|
+
({ node }) => {
|
|
1878
|
+
const correspondingBusinessComponent = node.correspondingBusinessComponent;
|
|
1879
|
+
if (correspondingBusinessComponent && !excludedSet.has(correspondingBusinessComponent)) {
|
|
1880
|
+
const set = correspondingBusinessComponent.collectExistingBusinessComponent();
|
|
1881
|
+
if (set.size) {
|
|
1882
|
+
set.forEach((value) => {
|
|
1883
|
+
if (!excludedSet.has(value)) {
|
|
1884
|
+
excludedSet.add(value);
|
|
1885
|
+
}
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
},
|
|
1890
|
+
{
|
|
1891
|
+
node: this,
|
|
1892
|
+
},
|
|
1893
|
+
);
|
|
1894
|
+
return excludedSet;
|
|
1895
|
+
}
|
|
1904
1896
|
|
|
1905
1897
|
@withSourceMapGenerator
|
|
1906
1898
|
*toEmbeddedTS(state = createCompilerState(), parentLevel?: number): TranslatorGenerator {
|
|
@@ -1924,9 +1916,10 @@ export class ViewElement extends BaseNode {
|
|
|
1924
1916
|
) {
|
|
1925
1917
|
return '';
|
|
1926
1918
|
}
|
|
1919
|
+
|
|
1927
1920
|
// pc事件翻译
|
|
1928
1921
|
if (self.toHump(tag) === 'lcapLogin') {
|
|
1929
|
-
let code = `new nasl.ui.
|
|
1922
|
+
let code = `new nasl.ui.Div({_name: __elements.${self.name},\n`;
|
|
1930
1923
|
// 事件
|
|
1931
1924
|
if (Array.isArray(self.bindEvents)) {
|
|
1932
1925
|
yield* wrapForEach(self.bindEvents, function* warpForEachGenerator(event) {
|
|
@@ -1941,32 +1934,21 @@ export class ViewElement extends BaseNode {
|
|
|
1941
1934
|
code += `}),\n`;
|
|
1942
1935
|
return code;
|
|
1943
1936
|
}
|
|
1937
|
+
|
|
1944
1938
|
let levelIndex = parentLevel || 0;
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
code += yield* self.getDatasourceTypeCodeStr(state, self.children);
|
|
1950
|
-
levelIndex++;
|
|
1951
|
-
code += 'return [';
|
|
1952
|
-
yield* wrapForEach(self.children, function* warpForEachGenerator(element) {
|
|
1953
|
-
code += yield* element.toEmbeddedTS(
|
|
1954
|
-
shiftState(state, code, {
|
|
1955
|
-
tabSize: state?.tabSize || 0,
|
|
1956
|
-
}),
|
|
1957
|
-
levelIndex,
|
|
1958
|
-
);
|
|
1959
|
-
});
|
|
1960
|
-
code += ']';
|
|
1961
|
-
code += '\n';
|
|
1962
|
-
code += '},\n';
|
|
1963
|
-
return code;
|
|
1964
|
-
} else if (tag === 'template') {
|
|
1965
|
-
const slotTarget = !self.slotTarget ? 'slotDefault' : 'slot' + self.toFirstUpper(self.toHump(self.slotTarget));
|
|
1939
|
+
|
|
1940
|
+
if (tag === 'template') {
|
|
1941
|
+
const hasScope = self.haveScope();
|
|
1942
|
+
const slotTarget = !self.slotTarget ? 'slotDefault' : `slot${self.toFirstUpper(self.toHump(self.slotTarget))}`;
|
|
1966
1943
|
let code = '';
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1944
|
+
|
|
1945
|
+
if (hasScope) {
|
|
1946
|
+
code += `${slotTarget}: (current${levelIndex === 0 ? '' : levelIndex}) => [\n`;
|
|
1947
|
+
levelIndex++;
|
|
1948
|
+
} else {
|
|
1949
|
+
code += `${slotTarget}: () => [\n`;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1970
1952
|
yield* wrapForEach(self.children, function* warpForEachGenerator(element) {
|
|
1971
1953
|
code += yield* element.toEmbeddedTS(
|
|
1972
1954
|
shiftState(state, code, {
|
|
@@ -1976,17 +1958,28 @@ export class ViewElement extends BaseNode {
|
|
|
1976
1958
|
);
|
|
1977
1959
|
});
|
|
1978
1960
|
code += indent((state?.tabSize || 0) + 2);
|
|
1979
|
-
code += ']';
|
|
1980
|
-
|
|
1981
|
-
code += '},\n';
|
|
1961
|
+
code += '\n],\n';
|
|
1962
|
+
|
|
1982
1963
|
return code;
|
|
1983
1964
|
}
|
|
1984
|
-
|
|
1965
|
+
|
|
1966
|
+
let namespace = `nasl.ui.${utils.kebab2Pascal(tag)}`;
|
|
1985
1967
|
if (self.isCorrespondingBusinessComponent) {
|
|
1986
1968
|
namespace = `${self.correspondingBusinessComponentNamespace}.${self.tag.replace('bs-', '')}`;
|
|
1987
1969
|
}
|
|
1988
|
-
|
|
1989
|
-
|
|
1970
|
+
|
|
1971
|
+
const { T, V, P, M, T1, C, genericTypes } = this.getGenericTypes(self.tag);
|
|
1972
|
+
|
|
1973
|
+
let code = `new ${namespace}`;
|
|
1974
|
+
if (genericTypes.length > 0) {
|
|
1975
|
+
code += `<`;
|
|
1976
|
+
code += genericTypes.map((i) => `typeof __elementsRef.${self.name}.${i}`).join(', ');
|
|
1977
|
+
code += `>`;
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
// 增加唯一name 后面那个name是为了查找引用的时候用的
|
|
1981
|
+
code += `({_name: __elements.${self.name},\n`;
|
|
1982
|
+
|
|
1990
1983
|
// 是否开启权限
|
|
1991
1984
|
// const hasAuth = Array.isArray(bindDirectives)
|
|
1992
1985
|
// ? !!bindDirectives.filter((directive) => directive.name === 'auth').length
|
|
@@ -2018,33 +2011,58 @@ export class ViewElement extends BaseNode {
|
|
|
2018
2011
|
if (Array.isArray(children)) {
|
|
2019
2012
|
code += indent((state?.tabSize || 0) + 1);
|
|
2020
2013
|
if (Array.isArray(self.bindAttrs)) {
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2014
|
+
// 属性
|
|
2015
|
+
const validAttrs = self.bindAttrs.filter((attr) => {
|
|
2016
|
+
// 特殊的一些属性不过滤
|
|
2017
|
+
if (['destination', 'externalDestination', 'rules', 'url'].includes(attr.name)) {
|
|
2018
|
+
return true;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
const com = config.allNodesAPI[self.tag];
|
|
2022
|
+
if (com) {
|
|
2023
|
+
const { props } = com;
|
|
2024
|
+
|
|
2025
|
+
const prop = props?.find((item) => item.name === attr.name);
|
|
2026
|
+
if (prop) {
|
|
2027
|
+
return true;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
return false;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
return true;
|
|
2034
|
+
});
|
|
2035
|
+
yield* wrapForEach(validAttrs, function* warpForEachGenerator(attr) {
|
|
2036
|
+
// 过滤业务组件的非表达式模式的翻译
|
|
2037
|
+
const shouldFilter = self.isCorrespondingBusinessComponent && attr.type !== 'dynamic';
|
|
2030
2038
|
if (shouldFilter) {
|
|
2031
2039
|
return;
|
|
2032
2040
|
}
|
|
2033
|
-
|
|
2041
|
+
const propCode = yield* attr.toEmbeddedTS(shiftState(state, code, { tabSize: 1 }));
|
|
2042
|
+
if (propCode.trim()) {
|
|
2043
|
+
code += `${propCode},\n`;
|
|
2044
|
+
}
|
|
2034
2045
|
});
|
|
2046
|
+
|
|
2047
|
+
// 指令v-if等
|
|
2035
2048
|
yield* wrapForEach(self.bindDirectives, function* warpForEachGenerator(directive) {
|
|
2036
|
-
|
|
2049
|
+
const directiveCode = yield* directive.toEmbeddedTS(shiftState(state, code, { tabSize: 1 }));
|
|
2050
|
+
if (directiveCode.trim()) {
|
|
2051
|
+
code += `${directiveCode},\n`;
|
|
2052
|
+
}
|
|
2037
2053
|
});
|
|
2054
|
+
|
|
2055
|
+
// 样式绑定
|
|
2038
2056
|
yield* wrapForEach(self.bindStyles, function* warpForEachGenerator(bindStyle) {
|
|
2039
|
-
|
|
2057
|
+
const styleCode = yield* bindStyle.toEmbeddedTS(shiftState(state, code, { tabSize: 1 }));
|
|
2058
|
+
if (styleCode.trim()) {
|
|
2059
|
+
code += `${styleCode},\n`;
|
|
2060
|
+
}
|
|
2040
2061
|
});
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
code += '},\n';
|
|
2044
|
-
} else {
|
|
2045
|
-
code += '],\n';
|
|
2046
|
-
}
|
|
2062
|
+
|
|
2063
|
+
code += indent((state?.tabSize || 0) + 2);
|
|
2047
2064
|
}
|
|
2065
|
+
|
|
2048
2066
|
// 如果子集中有插槽的就
|
|
2049
2067
|
if (children.find((item) => item.tag === 'template' && item.slotTarget)) {
|
|
2050
2068
|
code += indent((state?.tabSize || 0) + 2);
|
|
@@ -2065,9 +2083,7 @@ export class ViewElement extends BaseNode {
|
|
|
2065
2083
|
// 翻译其余的子集
|
|
2066
2084
|
if (defaultArr.length) {
|
|
2067
2085
|
code += indent((state?.tabSize || 0) + 2);
|
|
2068
|
-
code += `slotDefault: ()=>
|
|
2069
|
-
code += yield* self.getDatasourceTypeCodeStr(state, defaultArr);
|
|
2070
|
-
code += 'return [';
|
|
2086
|
+
code += `slotDefault: () => [\n`;
|
|
2071
2087
|
yield* wrapForEach(defaultArr, function* warpForEachGenerator(element) {
|
|
2072
2088
|
code += yield* element.toEmbeddedTS(
|
|
2073
2089
|
shiftState(state, code, {
|
|
@@ -2078,15 +2094,12 @@ export class ViewElement extends BaseNode {
|
|
|
2078
2094
|
code += '\n';
|
|
2079
2095
|
});
|
|
2080
2096
|
code += indent((state?.tabSize || 0) + 2);
|
|
2081
|
-
code += ']\n';
|
|
2082
2097
|
code += indent((state?.tabSize || 0) + 1);
|
|
2083
|
-
code += '
|
|
2098
|
+
code += ']\n';
|
|
2084
2099
|
}
|
|
2085
|
-
} else {
|
|
2100
|
+
} else if (children?.length) {
|
|
2086
2101
|
code += indent((state?.tabSize || 0) + 2);
|
|
2087
|
-
code += `slotDefault: ()=>
|
|
2088
|
-
code += yield* self.getDatasourceTypeCodeStr(state, children);
|
|
2089
|
-
code += 'return [';
|
|
2102
|
+
code += `slotDefault: () => [\n`;
|
|
2090
2103
|
yield* wrapForEach(children, function* warpForEachGenerator(element) {
|
|
2091
2104
|
code += yield* element.toEmbeddedTS(
|
|
2092
2105
|
shiftState(state, code, {
|
|
@@ -2097,9 +2110,8 @@ export class ViewElement extends BaseNode {
|
|
|
2097
2110
|
code += '\n';
|
|
2098
2111
|
});
|
|
2099
2112
|
code += indent((state?.tabSize || 0) + 2);
|
|
2100
|
-
code += ']\n';
|
|
2101
2113
|
code += indent((state?.tabSize || 0) + 1);
|
|
2102
|
-
code += '
|
|
2114
|
+
code += ']\n';
|
|
2103
2115
|
}
|
|
2104
2116
|
}
|
|
2105
2117
|
code += indent(state?.tabSize || 0) + '})';
|
|
@@ -2227,7 +2239,6 @@ export class ViewElement extends BaseNode {
|
|
|
2227
2239
|
};
|
|
2228
2240
|
this.update({
|
|
2229
2241
|
...object,
|
|
2230
|
-
|
|
2231
2242
|
});
|
|
2232
2243
|
}
|
|
2233
2244
|
|
|
@@ -2289,7 +2300,7 @@ export class ViewElement extends BaseNode {
|
|
|
2289
2300
|
expression: transAstNodeToNaslNode(Object.assign({}, argument)),
|
|
2290
2301
|
}));
|
|
2291
2302
|
}
|
|
2292
|
-
} catch (error) {
|
|
2303
|
+
} catch (error) {}
|
|
2293
2304
|
|
|
2294
2305
|
return {
|
|
2295
2306
|
concept: 'ValidationRule',
|
|
@@ -2391,6 +2402,10 @@ export class ViewElement extends BaseNode {
|
|
|
2391
2402
|
this._fromASTNode(item as compiler.ASTElement, newContext),
|
|
2392
2403
|
) as unknown as Array<ViewElement>,
|
|
2393
2404
|
});
|
|
2405
|
+
const attrName2Camel = (name: string) => {
|
|
2406
|
+
if (name.startsWith('vusion-')) return name;
|
|
2407
|
+
return name.replace(/(?:v-)([a-zA-Z0-9])/g, (m, $1) => $1.toUpperCase());
|
|
2408
|
+
};
|
|
2394
2409
|
astNode?.attrs?.forEach((oldAttr) => {
|
|
2395
2410
|
let attr: BindAttribute;
|
|
2396
2411
|
// 获取原始属性
|
|
@@ -2401,7 +2416,7 @@ export class ViewElement extends BaseNode {
|
|
|
2401
2416
|
if (oldAttr.value === '""' && orginAttrCode.trim() === oldAttr.name) {
|
|
2402
2417
|
attr = new BindAttribute({
|
|
2403
2418
|
type: 'static',
|
|
2404
|
-
name: oldAttr.name,
|
|
2419
|
+
name: attrName2Camel(oldAttr.name),
|
|
2405
2420
|
value: 'true',
|
|
2406
2421
|
});
|
|
2407
2422
|
} else {
|
|
@@ -2409,12 +2424,23 @@ export class ViewElement extends BaseNode {
|
|
|
2409
2424
|
const tmp = json5.parse(oldAttr.value);
|
|
2410
2425
|
const source: any = {
|
|
2411
2426
|
type: typeof tmp === 'string' ? 'string' : 'static',
|
|
2412
|
-
name: oldAttr.name,
|
|
2427
|
+
name: attrName2Camel(oldAttr.name),
|
|
2413
2428
|
value: typeof tmp === 'string' ? tmp : oldAttr.value,
|
|
2414
2429
|
};
|
|
2415
2430
|
if (oldAttr.name === 'rules') {
|
|
2416
|
-
|
|
2417
|
-
|
|
2431
|
+
if (Array.isArray(tmp)) {
|
|
2432
|
+
source.rules = tmp.map((rule) => ({
|
|
2433
|
+
concept: 'ValidationRule',
|
|
2434
|
+
name: '',
|
|
2435
|
+
label: '验证规则',
|
|
2436
|
+
calleeNamespace: 'nasl.validation',
|
|
2437
|
+
arguments: [],
|
|
2438
|
+
calleeName: rule?.validate,
|
|
2439
|
+
}));
|
|
2440
|
+
} else {
|
|
2441
|
+
source.rules = tmp?.split('|').map((ruleStr: string) => this._parseValidationRule(ruleStr.trim()));
|
|
2442
|
+
}
|
|
2443
|
+
} else if (['page-number', 'page-size', 'pageNumber', 'pageSize'].includes(oldAttr.name)) {
|
|
2418
2444
|
source.value = Number(source.value);
|
|
2419
2445
|
}
|
|
2420
2446
|
attr = new BindAttribute(source);
|
|
@@ -2422,7 +2448,7 @@ export class ViewElement extends BaseNode {
|
|
|
2422
2448
|
const expression = <any>this._parseExpression(oldAttr.value);
|
|
2423
2449
|
attr = new BindAttribute({
|
|
2424
2450
|
type: 'dynamic',
|
|
2425
|
-
name: oldAttr.name,
|
|
2451
|
+
name: attrName2Camel(oldAttr.name),
|
|
2426
2452
|
value: expression ? '' : oldAttr.value,
|
|
2427
2453
|
expression,
|
|
2428
2454
|
});
|
|
@@ -2596,12 +2622,12 @@ export class ViewElement extends BaseNode {
|
|
|
2596
2622
|
!['href', 'destination', 'externalDestination', 'download'].includes(attr.name)
|
|
2597
2623
|
) {
|
|
2598
2624
|
const api = config?.allNodesAPI?.[element.tag];
|
|
2599
|
-
const apiOfAttr = api && api.
|
|
2625
|
+
const apiOfAttr = api && api.props && api.props.find((_attr) => _attr.name === attr.name);
|
|
2600
2626
|
if (['u-form-item', 'u-validator', 'van-field'].includes(element.tag) && attr.name === 'rules') {
|
|
2601
2627
|
return `${attr.name}=""`;
|
|
2602
2628
|
}
|
|
2603
|
-
if (apiOfAttr && apiOfAttr['
|
|
2604
|
-
let designerValue = apiOfAttr['
|
|
2629
|
+
if (apiOfAttr && apiOfAttr['designerValue'] !== undefined) {
|
|
2630
|
+
let designerValue = apiOfAttr['designerValue'];
|
|
2605
2631
|
//对流程模板拖拽进行特判
|
|
2606
2632
|
element.bindAttrs.forEach((property) => {
|
|
2607
2633
|
if (property.name === 'repeat' && property.value === '1') designerValue = '[{}, {}]';
|
|
@@ -2610,6 +2636,9 @@ export class ViewElement extends BaseNode {
|
|
|
2610
2636
|
designerValue = designerValue.replace(/"/g, "'");
|
|
2611
2637
|
}
|
|
2612
2638
|
try {
|
|
2639
|
+
if (Array.isArray(designerValue)) {
|
|
2640
|
+
return `:${attr.name}="${JSON.stringify(designerValue)}"`;
|
|
2641
|
+
}
|
|
2613
2642
|
json5.parse(designerValue);
|
|
2614
2643
|
return `:${attr.name}="${designerValue}"`;
|
|
2615
2644
|
} catch (e) {
|
|
@@ -2636,7 +2665,7 @@ export class ViewElement extends BaseNode {
|
|
|
2636
2665
|
return `:${name}="${value.replace(/"/g, "'")}"`;
|
|
2637
2666
|
}
|
|
2638
2667
|
} catch (e) {
|
|
2639
|
-
if (apiOfAttr && !apiOfAttr.
|
|
2668
|
+
if (apiOfAttr && apiOfAttr.tsType && !apiOfAttr.tsType.includes('nasl.core.String')) return '';
|
|
2640
2669
|
}
|
|
2641
2670
|
value = value
|
|
2642
2671
|
.replace(/"/g, "'")
|
|
@@ -2647,9 +2676,9 @@ export class ViewElement extends BaseNode {
|
|
|
2647
2676
|
.replace(/\bscope\.item\.\b/g, '')
|
|
2648
2677
|
.replace(/\bcurrent\.item\.\b/g, '');
|
|
2649
2678
|
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2679
|
+
if (isLockField(element)) {
|
|
2680
|
+
return element.tag === 'u-text' ? `${name}="--"` : `${name}=""`;
|
|
2681
|
+
}
|
|
2653
2682
|
return `${name}="{{ ${value} }}"`;
|
|
2654
2683
|
});
|
|
2655
2684
|
else return defaultResult;
|
|
@@ -2662,7 +2691,7 @@ export class ViewElement extends BaseNode {
|
|
|
2662
2691
|
|
|
2663
2692
|
const api = config?.allNodesAPI?.[el?.tag];
|
|
2664
2693
|
const emptySlot =
|
|
2665
|
-
api && api.slots && api.slots.find((slot) => slot.name === 'default' && slot['
|
|
2694
|
+
api && api.slots && api.slots.find((slot) => slot.name === 'default' && slot['emptyBackground']);
|
|
2666
2695
|
const hasSupport = api && api.slots && api.slots.some((slot) => slot.support);
|
|
2667
2696
|
if (emptySlot || hasSupport) {
|
|
2668
2697
|
// 有些限制的组件如侧边栏分组有title插槽但要限制子元素放入
|
|
@@ -2677,7 +2706,7 @@ export class ViewElement extends BaseNode {
|
|
|
2677
2706
|
if (childEmpty) {
|
|
2678
2707
|
let addEmpty = true;
|
|
2679
2708
|
if (['u-grid-view', 'u-list-view', 'van-list-view', 'van-grid-view', 'u-carousel'].includes(el.tag)) {
|
|
2680
|
-
const hasDataSource = el.bindAttrs.find((attr) => attr.name === '
|
|
2709
|
+
const hasDataSource = el.bindAttrs.find((attr) => attr.name === 'dataSource');
|
|
2681
2710
|
addEmpty = !hasDataSource;
|
|
2682
2711
|
}
|
|
2683
2712
|
if (el.tag === 'u-crumb') {
|
|
@@ -2704,7 +2733,7 @@ export class ViewElement extends BaseNode {
|
|
|
2704
2733
|
) {
|
|
2705
2734
|
addEmpty = false;
|
|
2706
2735
|
}
|
|
2707
|
-
const background = (emptySlot && emptySlot['
|
|
2736
|
+
const background = (emptySlot && emptySlot['emptyBackground']) || (hasSupport ? 'add-sub' : '');
|
|
2708
2737
|
addEmpty && parts.push(`vusion-empty-background="${background}"`);
|
|
2709
2738
|
}
|
|
2710
2739
|
}
|
|
@@ -2779,7 +2808,6 @@ export class ViewElement extends BaseNode {
|
|
|
2779
2808
|
* 转换成 Vue 的模板格式
|
|
2780
2809
|
*/
|
|
2781
2810
|
toVue(options?: ElementToVueOptions) {
|
|
2782
|
-
|
|
2783
2811
|
// lockField 不翻译modal
|
|
2784
2812
|
if (options?.isDev && this?.tag === 'u-modal' && isLockField(this)) {
|
|
2785
2813
|
return ``;
|
|
@@ -2788,49 +2816,6 @@ export class ViewElement extends BaseNode {
|
|
|
2788
2816
|
const { finalCode, asCompontent } = options || {};
|
|
2789
2817
|
const parts: string[] = [];
|
|
2790
2818
|
if (finalCode === false) {
|
|
2791
|
-
if (this.tag === 'slot') {
|
|
2792
|
-
if (asCompontent) {
|
|
2793
|
-
return `<div vusion-slot-name="${this.name}">
|
|
2794
|
-
<slot name="${this.name}">
|
|
2795
|
-
<div s-empty="true" bs-empty="true" style="background: #f7f8fa;
|
|
2796
|
-
border: 1px dashed #c3c3c3;
|
|
2797
|
-
text-align: center;
|
|
2798
|
-
color: #999;
|
|
2799
|
-
min-height: 32px;
|
|
2800
|
-
min-width: 32px;
|
|
2801
|
-
width: 100%;
|
|
2802
|
-
align-items: center;
|
|
2803
|
-
display: inline-flex;
|
|
2804
|
-
justify-content: center;">
|
|
2805
|
-
+
|
|
2806
|
-
</div>
|
|
2807
|
-
</slot>
|
|
2808
|
-
</div>`;
|
|
2809
|
-
} else {
|
|
2810
|
-
return `<div vusion-node-path="${this.nodePath}"
|
|
2811
|
-
style="background: linear-gradient(-45deg,#fff 25%,#f3f5fa 0,#f3f5fa 50%,#fff 0,#fff 75%,#f3f5fa 0);
|
|
2812
|
-
background-size: 45px 45px;
|
|
2813
|
-
background-repeat: repeat;
|
|
2814
|
-
line-height: 32px;
|
|
2815
|
-
min-height: 32px;
|
|
2816
|
-
color: var(--font-second-color);
|
|
2817
|
-
text-align: center;">
|
|
2818
|
-
组件占位,可在使用业务组件时插入任意组件
|
|
2819
|
-
</div>`;
|
|
2820
|
-
}
|
|
2821
|
-
} else if (this.businessComponent?.name === this.tag) {
|
|
2822
|
-
// 组件内部使用自身的情况
|
|
2823
|
-
return `<div vusion-node-path="${this.nodePath}"
|
|
2824
|
-
style="background: linear-gradient(-45deg,#fff 25%,#f3f5fa 0,#f3f5fa 50%,#fff 0,#fff 75%,#f3f5fa 0);
|
|
2825
|
-
background-size: 45px 45px;
|
|
2826
|
-
background-repeat: repeat;
|
|
2827
|
-
line-height: 32px;
|
|
2828
|
-
min-height: 32px;
|
|
2829
|
-
color: var(--font-second-color);
|
|
2830
|
-
text-align: center;">
|
|
2831
|
-
在组件内部使用自身可能会导致循环引用,请谨慎使用
|
|
2832
|
-
</div>`;
|
|
2833
|
-
}
|
|
2834
2819
|
const isRoot = options.isRoot;
|
|
2835
2820
|
if (isRoot && !options?.asCompontent) {
|
|
2836
2821
|
parts.push('type="root"');
|
|
@@ -2879,18 +2864,15 @@ export class ViewElement extends BaseNode {
|
|
|
2879
2864
|
const tabString = ' '.repeat(newOptions.tabSize * newOptions.indentLevel);
|
|
2880
2865
|
const insideTabString = ' '.repeat(newOptions.tabSize * (newOptions.indentLevel + 1));
|
|
2881
2866
|
let shouldIndent = true;
|
|
2882
|
-
|
|
2867
|
+
let content: string = !this.children
|
|
2883
2868
|
? ''
|
|
2884
2869
|
: this.children
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
if (!content.length) {
|
|
2892
|
-
shouldIndent = false;
|
|
2893
|
-
}
|
|
2870
|
+
.map((element) => {
|
|
2871
|
+
const childOptions = Object.assign({}, newOptions);
|
|
2872
|
+
childOptions.indentLevel++;
|
|
2873
|
+
return (shouldIndent ? '\n' + insideTabString : '') + element?.toVue(childOptions);
|
|
2874
|
+
})
|
|
2875
|
+
.join('');
|
|
2894
2876
|
if (newOptions.aslIdAttr) {
|
|
2895
2877
|
if (newOptions.aslIdAttr === true) {
|
|
2896
2878
|
newOptions.aslIdAttr = 'asl-id';
|
|
@@ -2905,14 +2887,13 @@ export class ViewElement extends BaseNode {
|
|
|
2905
2887
|
this.slotTarget &&
|
|
2906
2888
|
parts.push(
|
|
2907
2889
|
`#${this.slotTarget}` +
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2890
|
+
(this.slotScope
|
|
2891
|
+
? `="${currentList.length > 1 ? this.slotScope + (currentList.length - 1) : this.slotScope}"`
|
|
2892
|
+
: ''),
|
|
2911
2893
|
);
|
|
2912
2894
|
this.refName && parts.push(`:ref="\`${this.refName}\`"`);
|
|
2913
2895
|
this.keyName && parts.push(`:key="\`${this.keyName}\`"`);
|
|
2914
2896
|
this.staticClass && parts.push(`class="${this.staticClass}"`);
|
|
2915
|
-
this.staticStyle && parts.push(`style="${this.staticStyle}"`);
|
|
2916
2897
|
|
|
2917
2898
|
const vIfs: string[] = [];
|
|
2918
2899
|
[]
|
|
@@ -2953,8 +2934,44 @@ export class ViewElement extends BaseNode {
|
|
|
2953
2934
|
) {
|
|
2954
2935
|
this.name && parts.push(`key="${this.name}"`);
|
|
2955
2936
|
}
|
|
2937
|
+
let tag = this.tag;
|
|
2938
|
+
let staticStyle = this.staticStyle ?? '';
|
|
2956
2939
|
if (this.tag === 'slot') {
|
|
2957
2940
|
this.name && parts.push(`name="${this.name}"`);
|
|
2941
|
+
if (finalCode === false) {
|
|
2942
|
+
tag = 'div';
|
|
2943
|
+
if (asCompontent) {
|
|
2944
|
+
parts.push(`vusion-slot-name="${this.name}"`);
|
|
2945
|
+
content = `<slot name="${this.name}">
|
|
2946
|
+
<div s-empty="true" bs-empty="true" style="background: #f7f8fa;
|
|
2947
|
+
border: 1px dashed #c3c3c3;
|
|
2948
|
+
text-align: center;
|
|
2949
|
+
color: #999;
|
|
2950
|
+
min-height: 32px;
|
|
2951
|
+
min-width: 32px;
|
|
2952
|
+
width: 100%;
|
|
2953
|
+
align-items: center;
|
|
2954
|
+
display: inline-flex;
|
|
2955
|
+
justify-content: center;">
|
|
2956
|
+
+
|
|
2957
|
+
</div>
|
|
2958
|
+
</slot>`;
|
|
2959
|
+
} else {
|
|
2960
|
+
parts.push(`vusion-node-path="${this.nodePath}"`);
|
|
2961
|
+
content = `组件占位,可在使用业务组件时插入任意组件`;
|
|
2962
|
+
staticStyle += `background: linear-gradient(-45deg,#fff 25%,#f3f5fa 0,#f3f5fa 50%,#fff 0,#fff 75%,#f3f5fa 0);
|
|
2963
|
+
background-size: 45px 45px;
|
|
2964
|
+
background-repeat: repeat;
|
|
2965
|
+
line-height: 32px;
|
|
2966
|
+
min-height: 32px;
|
|
2967
|
+
color: var(--font-second-color);
|
|
2968
|
+
text-align: center;`;
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
staticStyle && parts.push(`style="${staticStyle}"`);
|
|
2973
|
+
if (!content.length) {
|
|
2974
|
+
shouldIndent = false;
|
|
2958
2975
|
}
|
|
2959
2976
|
let partsLength = 0;
|
|
2960
2977
|
let partsString = '';
|
|
@@ -2967,14 +2984,13 @@ export class ViewElement extends BaseNode {
|
|
|
2967
2984
|
partsLength += part.length;
|
|
2968
2985
|
});
|
|
2969
2986
|
|
|
2970
|
-
|
|
2971
2987
|
let htmlContent =
|
|
2972
|
-
`<${
|
|
2988
|
+
`<${tag}${partsString.length ? partsString : ''}>` +
|
|
2973
2989
|
content +
|
|
2974
2990
|
(shouldIndent ? '\n' + tabString : '') +
|
|
2975
|
-
`</${
|
|
2976
|
-
if (!content.trim() && selfClosingTag.includes(
|
|
2977
|
-
htmlContent = `<${
|
|
2991
|
+
`</${tag}>`;
|
|
2992
|
+
if (!content.trim() && selfClosingTag.includes(tag)) {
|
|
2993
|
+
htmlContent = `<${tag}${partsString.length ? partsString : ''} />`;
|
|
2978
2994
|
}
|
|
2979
2995
|
|
|
2980
2996
|
return htmlContent;
|