@lcap/nasl 3.7.1-beta.1 → 3.7.1-beta.3
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/common/BaseNode.js +3 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +9 -27
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +1 -1
- package/out/concepts/Argument__.js +2 -6
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/AssigneeV2__.js +0 -2
- package/out/concepts/AssigneeV2__.js.map +1 -1
- package/out/concepts/Assignee__.js +0 -2
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js +0 -2
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js +2 -4
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +1 -1
- package/out/concepts/Attribute__.js +7 -23
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthInterface__.js +1 -3
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +7 -7
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.js +1 -3
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +2 -2
- package/out/concepts/BackendVariable__.js +3 -9
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.js +1 -3
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +1 -3
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +4 -4
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +6 -58
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +6 -6
- package/out/concepts/BindDirective__.js +7 -21
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +3 -3
- package/out/concepts/BindEvent__.js +3 -13
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +1 -3
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js +1 -3
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/BusinessComponent__.js +11 -19
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.js +8 -10
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallConnector__.js +2 -6
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallEvent__.js +2 -6
- package/out/concepts/CallEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +1 -1
- package/out/concepts/CallFunction__.js +3 -13
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +1 -1
- package/out/concepts/CallInterface__.js +3 -9
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +4 -4
- package/out/concepts/CallLogic__.js +8 -23
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +2 -2
- package/out/concepts/CallQueryComponent__.js +2 -13
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +1 -3
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +5 -15
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +1 -3
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.d.ts +0 -1
- package/out/concepts/ConfigPropertyValue__.js +2 -13
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +3 -9
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.js +3 -9
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorLogic__.js +1 -3
- package/out/concepts/ConnectorLogic__.js.map +1 -1
- package/out/concepts/ConnectorTriggerLauncher__.js +6 -9
- package/out/concepts/ConnectorTriggerLauncher__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.js +2 -6
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.js +3 -9
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.js +2 -6
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/CountersignPolicyV2__.js +1 -3
- package/out/concepts/CountersignPolicyV2__.js.map +1 -1
- package/out/concepts/CountersignPolicy__.js +1 -3
- package/out/concepts/CountersignPolicy__.js.map +1 -1
- package/out/concepts/DataSource__.js +6 -12
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js +6 -6
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.js +3 -9
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +2 -2
- package/out/concepts/EntityIndex__.js +4 -13
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +10 -12
- package/out/concepts/EntityProperty__.js +25 -44
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +2 -2
- package/out/concepts/Entity__.js +7 -17
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +1 -1
- package/out/concepts/EnumItem__.js +1 -7
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +3 -9
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/EventDeclaration__.js +4 -16
- package/out/concepts/EventDeclaration__.js.map +1 -1
- package/out/concepts/Event__.js +5 -15
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +1 -1
- package/out/concepts/ExternalDestination__.js +1 -3
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/FieldPermissionV2__.js +2 -6
- package/out/concepts/FieldPermissionV2__.js.map +1 -1
- package/out/concepts/FlowConditionV2__.js +1 -3
- package/out/concepts/FlowConditionV2__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js +2 -6
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/FrontendType__.d.ts +0 -4
- package/out/concepts/FrontendType__.js +2 -15
- package/out/concepts/FrontendType__.js.map +1 -1
- package/out/concepts/FrontendVariable__.js +1 -3
- package/out/concepts/FrontendVariable__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +0 -2
- package/out/concepts/Frontend__.js +8 -31
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +2 -6
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/HistoryProcessV2__.js +4 -12
- package/out/concepts/HistoryProcessV2__.js.map +1 -1
- package/out/concepts/I18nInfo__.d.ts +1 -1
- package/out/concepts/I18nInfo__.js +5 -9
- package/out/concepts/I18nInfo__.js.map +1 -1
- package/out/concepts/IconSetter__.js +1 -7
- package/out/concepts/IconSetter__.js.map +1 -1
- package/out/concepts/Identifier__.js +7 -7
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/ImportedInterface__.d.ts +1 -1
- package/out/concepts/ImportedInterface__.js +1 -3
- package/out/concepts/ImportedInterface__.js.map +1 -1
- package/out/concepts/InputSetter__.js +1 -7
- package/out/concepts/InputSetter__.js.map +1 -1
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +4 -12
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +8 -18
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +1 -3
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.js +3 -9
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicDeclaration__.js +3 -13
- package/out/concepts/LogicDeclaration__.js.map +1 -1
- package/out/concepts/LogicItem__.js +5 -31
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +6 -6
- package/out/concepts/Logic__.js +25 -36
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +2 -2
- package/out/concepts/MatchCase__.js +11 -11
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +1 -3
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +6 -2
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +1 -1
- package/out/concepts/MetadataType__.js +4 -12
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/MicroApp__.js +7 -21
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.d.ts +2 -2
- package/out/concepts/Module__.js +8 -24
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +4 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.js +6 -10
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +1 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +1 -1
- package/out/concepts/NewMap__.js +5 -2
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/NumberInputSetter__.js +5 -35
- package/out/concepts/NumberInputSetter__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -3
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OperatePermissionV2__.js +4 -12
- package/out/concepts/OperatePermissionV2__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +1 -1
- package/out/concepts/OqlQueryComponent__.js +2 -6
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +12 -26
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/ParamWithGroup__.js +2 -6
- package/out/concepts/ParamWithGroup__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -1
- package/out/concepts/Param__.js +2 -14
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +2 -6
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessBindV2__.js +2 -6
- package/out/concepts/ProcessBindV2__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +4 -12
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElementV2__.js +8 -24
- package/out/concepts/ProcessElementV2__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +10 -22
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -3
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js +0 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/ProcessV2__.js +6 -18
- package/out/concepts/ProcessV2__.js.map +1 -1
- package/out/concepts/Process__.js +3 -9
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/PropDeclaration__.d.ts +4 -0
- package/out/concepts/PropDeclaration__.js +19 -84
- package/out/concepts/PropDeclaration__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +2 -6
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +4 -12
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +3 -9
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +4 -12
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +12 -4
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +6 -2
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +5 -7
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js +4 -12
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +2 -10
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +4 -4
- package/out/concepts/Role__.js +6 -14
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +1 -3
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/SetterOption__.js +6 -34
- package/out/concepts/SetterOption__.js.map +1 -1
- package/out/concepts/SlotDeclaration__.js +5 -23
- package/out/concepts/SlotDeclaration__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +4 -12
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StaticString__.d.ts +1 -1
- package/out/concepts/StaticString__.js +6 -10
- package/out/concepts/StaticString__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -6
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +5 -5
- package/out/concepts/StructureProperty__.js +5 -13
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +0 -4
- package/out/concepts/Structure__.js +9 -18
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +1 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/ThemeVariable__.js +1 -3
- package/out/concepts/ThemeVariable__.js.map +1 -1
- package/out/concepts/Theme__.js +2 -6
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +2 -2
- package/out/concepts/Transactional__.js +6 -12
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TriggerEvent__.js +1 -3
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.js +3 -9
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +2 -2
- package/out/concepts/TypeAnnotation__.js +24 -31
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +1 -3
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +1 -3
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js +1 -3
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +2 -6
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +3 -17
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -1
- package/out/concepts/Variable__.js +2 -10
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlockWithImage__.js +2 -6
- package/out/concepts/ViewBlockWithImage__.js.map +1 -1
- package/out/concepts/ViewBlock__.js +3 -13
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponentDeclaration__.d.ts +1 -1
- package/out/concepts/ViewComponentDeclaration__.js +8 -36
- package/out/concepts/ViewComponentDeclaration__.js.map +1 -1
- package/out/concepts/ViewElement__.js +82 -72
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +22 -40
- package/out/concepts/View__.js.map +1 -1
- package/out/generator/genBundleFiles.js +1 -0
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/release-body/utils.js +2 -1
- package/out/generator/release-body/utils.js.map +1 -1
- package/out/natural/genNaturalTS.js +1 -0
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/server/naslServer.js +24 -10
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +54 -0
- package/out/server/translator.js.map +1 -1
- package/out/utils/env.d.ts +2 -0
- package/out/utils/env.js +3 -1
- package/out/utils/env.js.map +1 -1
- package/package.json +1 -1
- package/src/common/BaseNode.ts +3 -1
- package/src/concepts/AnonymousFunction__.ts +1 -1
- package/src/concepts/App__.ts +9 -27
- package/src/concepts/Argument__.ts +3 -7
- package/src/concepts/AssigneeV2__.ts +0 -2
- package/src/concepts/Assignee__.ts +0 -2
- package/src/concepts/AssignmentLine__.ts +0 -2
- package/src/concepts/Assignment__.ts +2 -4
- package/src/concepts/Attribute__.ts +9 -21
- package/src/concepts/AuthInterface__.ts +1 -3
- package/src/concepts/AuthLogicForCallInterface__.ts +4 -5
- package/src/concepts/AuthLogic__.ts +1 -3
- package/src/concepts/BackendVariable__.ts +5 -11
- package/src/concepts/Backend__.ts +1 -3
- package/src/concepts/BatchAssignment__.ts +4 -4
- package/src/concepts/BinaryExpression__.ts +9 -7
- package/src/concepts/BindAttribute__.ts +26 -38
- package/src/concepts/BindDirective__.ts +13 -27
- package/src/concepts/BindEvent__.ts +7 -13
- package/src/concepts/BindStyle__.ts +1 -3
- package/src/concepts/BooleanLiteral__.ts +1 -3
- package/src/concepts/BusinessComponent__.ts +16 -20
- package/src/concepts/BusinessLogic__.ts +7 -10
- package/src/concepts/CallConnector__.ts +3 -7
- package/src/concepts/CallEvent__.ts +2 -6
- package/src/concepts/CallFunction__.ts +6 -13
- package/src/concepts/CallInterface__.ts +8 -15
- package/src/concepts/CallLogic__.ts +37 -44
- package/src/concepts/CallQueryComponent__.ts +9 -22
- package/src/concepts/Comment__.ts +1 -3
- package/src/concepts/CompletionProperty__.ts +5 -15
- package/src/concepts/ConfigGroup__.ts +2 -7
- package/src/concepts/ConfigPropertyValue__.ts +3 -15
- package/src/concepts/ConfigProperty__.ts +3 -9
- package/src/concepts/Configuration__.ts +1 -4
- package/src/concepts/Connection__.ts +3 -9
- package/src/concepts/ConnectorLogic__.ts +2 -4
- package/src/concepts/ConnectorTriggerLauncher__.ts +13 -11
- package/src/concepts/ConnectorTrigger__.ts +12 -12
- package/src/concepts/Connector__.ts +3 -9
- package/src/concepts/Constant__.ts +2 -6
- package/src/concepts/CountersignPolicyV2__.ts +1 -3
- package/src/concepts/CountersignPolicy__.ts +1 -3
- package/src/concepts/DataSource__.ts +16 -18
- package/src/concepts/DatabaseTypeAnnotation__.ts +6 -11
- package/src/concepts/Destination__.ts +3 -9
- package/src/concepts/EntityIndex__.ts +6 -15
- package/src/concepts/EntityProperty__.ts +35 -56
- package/src/concepts/Entity__.ts +7 -17
- package/src/concepts/EnumItem__.ts +7 -9
- package/src/concepts/Enum__.ts +3 -9
- package/src/concepts/EventDeclaration__.ts +5 -13
- package/src/concepts/Event__.ts +5 -15
- package/src/concepts/ExternalDestination__.ts +2 -4
- package/src/concepts/FieldPermissionV2__.ts +2 -6
- package/src/concepts/FlowConditionV2__.ts +1 -3
- package/src/concepts/ForEachStatement__.ts +1 -1
- package/src/concepts/FrontendLibrary__.ts +2 -6
- package/src/concepts/FrontendType__.ts +2 -14
- package/src/concepts/FrontendVariable__.ts +1 -3
- package/src/concepts/Frontend__.ts +11 -35
- package/src/concepts/Function__.ts +2 -6
- package/src/concepts/HistoryProcessV2__.ts +4 -12
- package/src/concepts/I18nInfo__.ts +8 -15
- package/src/concepts/IconSetter__.ts +2 -4
- package/src/concepts/Identifier__.ts +9 -10
- package/src/concepts/ImportedInterface__.ts +2 -4
- package/src/concepts/InputSetter__.ts +2 -4
- package/src/concepts/Integration__.ts +0 -1
- package/src/concepts/InterfaceParam__.ts +4 -12
- package/src/concepts/InterfaceTriggerEvent__.ts +1 -1
- package/src/concepts/Interface__.ts +10 -21
- package/src/concepts/JSBlock__.ts +1 -3
- package/src/concepts/JavaLogic__.ts +3 -9
- package/src/concepts/LogicDeclaration__.ts +4 -10
- package/src/concepts/LogicItem__.ts +9 -19
- package/src/concepts/Logic__.ts +43 -47
- package/src/concepts/MatchCase__.ts +12 -12
- package/src/concepts/Match__.ts +11 -8
- package/src/concepts/MemberExpression__.ts +8 -2
- package/src/concepts/MetadataType__.ts +9 -16
- package/src/concepts/MicroApp__.ts +7 -21
- package/src/concepts/Module__.ts +10 -26
- package/src/concepts/Namespace__.ts +4 -12
- package/src/concepts/NewComposite__.ts +18 -16
- package/src/concepts/NewList__.ts +1 -1
- package/src/concepts/NewMap__.ts +15 -6
- package/src/concepts/NumberInputSetter__.ts +10 -20
- package/src/concepts/NumericLiteral__.ts +1 -3
- package/src/concepts/OperatePermissionV2__.ts +4 -12
- package/src/concepts/OqlQueryComponent__.ts +3 -7
- package/src/concepts/OverriddenLogic__.ts +15 -25
- package/src/concepts/ParamWithGroup__.ts +2 -6
- package/src/concepts/Param__.ts +5 -9
- package/src/concepts/Point__.ts +2 -6
- package/src/concepts/ProcessBindV2__.ts +2 -6
- package/src/concepts/ProcessComponent__.ts +4 -12
- package/src/concepts/ProcessElementV2__.ts +11 -27
- package/src/concepts/ProcessElement__.ts +13 -23
- package/src/concepts/ProcessOutcome__.ts +1 -3
- package/src/concepts/ProcessOutcomes__.ts +0 -1
- package/src/concepts/ProcessV2__.ts +11 -19
- package/src/concepts/Process__.ts +3 -9
- package/src/concepts/PropDeclaration__.ts +31 -57
- package/src/concepts/QueryAggregateExpression__.ts +3 -8
- package/src/concepts/QueryFieldExpression__.ts +23 -30
- package/src/concepts/QueryFromExpression__.ts +3 -9
- package/src/concepts/QueryJoinExpression__.ts +5 -14
- package/src/concepts/QueryLimitExpression__.ts +16 -4
- package/src/concepts/QueryOrderByExpression__.ts +22 -13
- package/src/concepts/QuerySelectExpression__.ts +8 -13
- package/src/concepts/Rect__.ts +4 -12
- package/src/concepts/Return__.ts +4 -8
- package/src/concepts/Role__.ts +8 -16
- package/src/concepts/SelectMembers__.ts +1 -3
- package/src/concepts/SetterOption__.ts +10 -22
- package/src/concepts/SlotDeclaration__.ts +7 -17
- package/src/concepts/SqlQueryComponent__.ts +5 -13
- package/src/concepts/StaticString__.ts +9 -16
- package/src/concepts/StringLiteral__.ts +5 -11
- package/src/concepts/StructureProperty__.ts +10 -18
- package/src/concepts/Structure__.ts +10 -18
- package/src/concepts/SwitchCase__.ts +1 -1
- package/src/concepts/SwitchStatement__.ts +1 -1
- package/src/concepts/ThemeVariable__.ts +1 -3
- package/src/concepts/Theme__.ts +2 -6
- package/src/concepts/Transactional__.ts +10 -19
- package/src/concepts/TriggerEvent__.ts +1 -3
- package/src/concepts/TriggerLauncher__.ts +11 -15
- package/src/concepts/TypeAnnotation__.ts +50 -41
- package/src/concepts/TypeParam__.ts +1 -3
- package/src/concepts/UnaryExpression__.ts +1 -3
- package/src/concepts/Unparsed__.ts +1 -3
- package/src/concepts/UseComponent__.ts +2 -6
- package/src/concepts/ValidationRule__.ts +5 -11
- package/src/concepts/Variable__.ts +4 -8
- package/src/concepts/ViewBlockWithImage__.ts +2 -6
- package/src/concepts/ViewBlock__.ts +4 -10
- package/src/concepts/ViewComponentDeclaration__.ts +11 -27
- package/src/concepts/ViewElement__.ts +219 -146
- package/src/concepts/View__.ts +40 -54
- package/src/generator/genBundleFiles.ts +2 -1
- package/src/generator/release-body/utils.ts +2 -1
- package/src/natural/genNaturalTS.ts +1 -0
- package/src/server/naslServer.ts +24 -10
- package/src/server/translator.ts +56 -0
- package/src/utils/env.ts +2 -0
|
@@ -34,7 +34,22 @@ export interface ParseContext {
|
|
|
34
34
|
/**
|
|
35
35
|
* 自闭合标签
|
|
36
36
|
*/
|
|
37
|
-
const selfClosingTag = [
|
|
37
|
+
const selfClosingTag = [
|
|
38
|
+
'base',
|
|
39
|
+
'meta',
|
|
40
|
+
'area',
|
|
41
|
+
'embed',
|
|
42
|
+
'link',
|
|
43
|
+
'img',
|
|
44
|
+
'input',
|
|
45
|
+
'param',
|
|
46
|
+
'hr',
|
|
47
|
+
'br',
|
|
48
|
+
'source',
|
|
49
|
+
'track',
|
|
50
|
+
'wbr',
|
|
51
|
+
'col',
|
|
52
|
+
];
|
|
38
53
|
|
|
39
54
|
function genArgumentMemberExpression(arr: string[]) {
|
|
40
55
|
let expressionNode: any;
|
|
@@ -70,7 +85,11 @@ export interface ElementToVueOptions {
|
|
|
70
85
|
aslIdAttr?: string | boolean;
|
|
71
86
|
nodePathAttr?: string | boolean;
|
|
72
87
|
getExtraParts?: (element?: ViewElement) => Array<string>;
|
|
73
|
-
attrFormat?: (
|
|
88
|
+
attrFormat?: (
|
|
89
|
+
attr: BindAttribute | BindEvent | BindDirective,
|
|
90
|
+
element?: ViewElement,
|
|
91
|
+
defaultResult?: string,
|
|
92
|
+
) => string | false;
|
|
74
93
|
bindStylesFormat?: (bindStyles: BindStyle[], element?: ViewElement, defaultResult?: string) => string | false;
|
|
75
94
|
finalCode?: boolean;
|
|
76
95
|
currentList?: string[];
|
|
@@ -98,7 +117,9 @@ function transAstNodeToNaslNode(astNode: any, namespace?: string): any {
|
|
|
98
117
|
expression: transAstNodeToNaslNode(Object.assign({}, argument)),
|
|
99
118
|
}))
|
|
100
119
|
.filter((item: any) => item.expression),
|
|
101
|
-
typeArguments: astNode.arguments
|
|
120
|
+
typeArguments: astNode.arguments
|
|
121
|
+
.map((argument: any) => transAstNodeToNaslTypeNode(Object.assign({}, argument)))
|
|
122
|
+
.filter((item: any) => item),
|
|
102
123
|
};
|
|
103
124
|
} else if (astNode.type === 'MemberExpression') {
|
|
104
125
|
if (astNode.object?.name === '$global') {
|
|
@@ -226,7 +247,7 @@ function transAstNodeToNaslNode(astNode: any, namespace?: string): any {
|
|
|
226
247
|
...tempNode,
|
|
227
248
|
},
|
|
228
249
|
undefined,
|
|
229
|
-
'logics'
|
|
250
|
+
'logics',
|
|
230
251
|
);
|
|
231
252
|
} else if (astNode.type === 'LogicalExpression' || astNode.type === 'BinaryExpression') {
|
|
232
253
|
node = {
|
|
@@ -261,7 +282,9 @@ function transAstNodeToNaslTypeNode(astNode: any, namespace?: string): any {
|
|
|
261
282
|
|
|
262
283
|
function isLockField(node?: any): boolean {
|
|
263
284
|
if (!node || node.concept !== 'ViewElement') return false;
|
|
264
|
-
const attr = node?.bindAttrs?.find((attr: any) =>
|
|
285
|
+
const attr = node?.bindAttrs?.find((attr: any) =>
|
|
286
|
+
['FormDesignerLocked', 'TableDesignerLocked'].includes(attr.name),
|
|
287
|
+
)?.value;
|
|
265
288
|
if (attr === undefined) return !!isLockField(node?.parentNode);
|
|
266
289
|
else return !!attr;
|
|
267
290
|
}
|
|
@@ -310,58 +333,44 @@ export class ViewElement extends BaseNode {
|
|
|
310
333
|
/**
|
|
311
334
|
* 元素标签
|
|
312
335
|
*/
|
|
313
|
-
@property(
|
|
314
|
-
objectRef: '',
|
|
315
|
-
})
|
|
336
|
+
@property()
|
|
316
337
|
tag: string;
|
|
317
338
|
|
|
318
339
|
/**
|
|
319
340
|
* 页面元素名称
|
|
320
341
|
*/
|
|
321
|
-
@property(
|
|
322
|
-
objectRef: '',
|
|
323
|
-
})
|
|
342
|
+
@property()
|
|
324
343
|
name: string = '';
|
|
325
344
|
|
|
326
345
|
/**
|
|
327
346
|
* 静态 class 名
|
|
328
347
|
*/
|
|
329
|
-
@property(
|
|
330
|
-
|
|
331
|
-
})
|
|
332
|
-
staticClass?: string = null;
|
|
348
|
+
@property()
|
|
349
|
+
staticClass?: string;
|
|
333
350
|
|
|
334
351
|
/**
|
|
335
352
|
* 静态 style
|
|
336
353
|
*/
|
|
337
|
-
@property(
|
|
338
|
-
|
|
339
|
-
})
|
|
340
|
-
staticStyle?: string = null;
|
|
354
|
+
@property()
|
|
355
|
+
staticStyle?: string;
|
|
341
356
|
|
|
342
357
|
/**
|
|
343
358
|
* 权限资源描述
|
|
344
359
|
*/
|
|
345
|
-
@property(
|
|
346
|
-
|
|
347
|
-
})
|
|
348
|
-
authDescription?: string = null;
|
|
360
|
+
@property()
|
|
361
|
+
authDescription?: string;
|
|
349
362
|
|
|
350
363
|
/**
|
|
351
364
|
* 插槽目标
|
|
352
365
|
*/
|
|
353
|
-
@property(
|
|
354
|
-
|
|
355
|
-
})
|
|
356
|
-
slotTarget?: string = null;
|
|
366
|
+
@property()
|
|
367
|
+
slotTarget?: string;
|
|
357
368
|
|
|
358
369
|
/**
|
|
359
370
|
* 插槽 scope 表达式
|
|
360
371
|
*/
|
|
361
|
-
@property(
|
|
362
|
-
|
|
363
|
-
})
|
|
364
|
-
slotScope?: string = null;
|
|
372
|
+
@property()
|
|
373
|
+
slotScope?: string;
|
|
365
374
|
|
|
366
375
|
/**
|
|
367
376
|
* 元素绑定属性列表
|
|
@@ -397,7 +406,6 @@ export class ViewElement extends BaseNode {
|
|
|
397
406
|
* 绑定的角色
|
|
398
407
|
*/
|
|
399
408
|
@property({
|
|
400
|
-
objectRef: '',
|
|
401
409
|
isArray: true,
|
|
402
410
|
defaultValue: [],
|
|
403
411
|
})
|
|
@@ -471,7 +479,9 @@ export class ViewElement extends BaseNode {
|
|
|
471
479
|
|
|
472
480
|
getBindAttributeExistingNames(excludedList: Array<BindAttribute> = []) {
|
|
473
481
|
const excludedSet = new Set(excludedList);
|
|
474
|
-
return ((this.bindAttrs as BindAttribute[]) || [])
|
|
482
|
+
return ((this.bindAttrs as BindAttribute[]) || [])
|
|
483
|
+
.filter((item) => !excludedSet.has(item))
|
|
484
|
+
.map((item) => item.name);
|
|
475
485
|
}
|
|
476
486
|
getBindAttributeUniqueName(name = 'bindAttribute1') {
|
|
477
487
|
return utils.unique(name, this.getBindAttributeExistingNames(), undefined, false);
|
|
@@ -510,7 +520,7 @@ export class ViewElement extends BaseNode {
|
|
|
510
520
|
name: this.getBindAttributeUniqueName(),
|
|
511
521
|
},
|
|
512
522
|
this,
|
|
513
|
-
'bindAttrs'
|
|
523
|
+
'bindAttrs',
|
|
514
524
|
);
|
|
515
525
|
} else if (typeof options === 'string') {
|
|
516
526
|
bindAttribute = BindAttribute.from(
|
|
@@ -519,7 +529,7 @@ export class ViewElement extends BaseNode {
|
|
|
519
529
|
name: options,
|
|
520
530
|
},
|
|
521
531
|
this,
|
|
522
|
-
'bindAttrs'
|
|
532
|
+
'bindAttrs',
|
|
523
533
|
);
|
|
524
534
|
} else if (asserts.isBindAttribute(options)) {
|
|
525
535
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
@@ -532,7 +542,7 @@ export class ViewElement extends BaseNode {
|
|
|
532
542
|
...options,
|
|
533
543
|
},
|
|
534
544
|
this,
|
|
535
|
-
'bindAttrs'
|
|
545
|
+
'bindAttrs',
|
|
536
546
|
);
|
|
537
547
|
}
|
|
538
548
|
this.bindAttrs.splice(index, 0, bindAttribute);
|
|
@@ -664,7 +674,7 @@ export class ViewElement extends BaseNode {
|
|
|
664
674
|
name: this.getBindEventUniqueName(),
|
|
665
675
|
},
|
|
666
676
|
this,
|
|
667
|
-
'bindEvents'
|
|
677
|
+
'bindEvents',
|
|
668
678
|
);
|
|
669
679
|
} else if (typeof options === 'string') {
|
|
670
680
|
bindEvent = BindEvent.from(
|
|
@@ -673,7 +683,7 @@ export class ViewElement extends BaseNode {
|
|
|
673
683
|
name: options,
|
|
674
684
|
},
|
|
675
685
|
this,
|
|
676
|
-
'bindEvents'
|
|
686
|
+
'bindEvents',
|
|
677
687
|
);
|
|
678
688
|
} else if (asserts.isBindEvent(options)) {
|
|
679
689
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
@@ -686,7 +696,7 @@ export class ViewElement extends BaseNode {
|
|
|
686
696
|
...options,
|
|
687
697
|
},
|
|
688
698
|
this,
|
|
689
|
-
'bindEvents'
|
|
699
|
+
'bindEvents',
|
|
690
700
|
);
|
|
691
701
|
}
|
|
692
702
|
this.bindEvents.splice(index, 0, bindEvent);
|
|
@@ -779,7 +789,9 @@ export class ViewElement extends BaseNode {
|
|
|
779
789
|
|
|
780
790
|
getBindDirectiveExistingNames(excludedList: Array<BindDirective> = []) {
|
|
781
791
|
const excludedSet = new Set(excludedList);
|
|
782
|
-
return ((this.bindDirectives as BindDirective[]) || [])
|
|
792
|
+
return ((this.bindDirectives as BindDirective[]) || [])
|
|
793
|
+
.filter((item) => !excludedSet.has(item))
|
|
794
|
+
.map((item) => item.name);
|
|
783
795
|
}
|
|
784
796
|
getBindDirectiveUniqueName(name = 'bindDirective1') {
|
|
785
797
|
return utils.unique(name, this.getBindDirectiveExistingNames(), undefined, false);
|
|
@@ -818,7 +830,7 @@ export class ViewElement extends BaseNode {
|
|
|
818
830
|
name: this.getBindDirectiveUniqueName(),
|
|
819
831
|
},
|
|
820
832
|
this,
|
|
821
|
-
'bindDirectives'
|
|
833
|
+
'bindDirectives',
|
|
822
834
|
);
|
|
823
835
|
} else if (typeof options === 'string') {
|
|
824
836
|
bindDirective = BindDirective.from(
|
|
@@ -827,7 +839,7 @@ export class ViewElement extends BaseNode {
|
|
|
827
839
|
name: options,
|
|
828
840
|
},
|
|
829
841
|
this,
|
|
830
|
-
'bindDirectives'
|
|
842
|
+
'bindDirectives',
|
|
831
843
|
);
|
|
832
844
|
} else if (asserts.isBindDirective(options)) {
|
|
833
845
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
@@ -840,7 +852,7 @@ export class ViewElement extends BaseNode {
|
|
|
840
852
|
...options,
|
|
841
853
|
},
|
|
842
854
|
this,
|
|
843
|
-
'bindDirectives'
|
|
855
|
+
'bindDirectives',
|
|
844
856
|
);
|
|
845
857
|
}
|
|
846
858
|
this.bindDirectives.splice(index, 0, bindDirective);
|
|
@@ -972,7 +984,7 @@ export class ViewElement extends BaseNode {
|
|
|
972
984
|
name: this.getBindStyleUniqueName(),
|
|
973
985
|
},
|
|
974
986
|
this,
|
|
975
|
-
'bindStyles'
|
|
987
|
+
'bindStyles',
|
|
976
988
|
);
|
|
977
989
|
} else if (typeof options === 'string') {
|
|
978
990
|
bindStyle = BindStyle.from(
|
|
@@ -981,7 +993,7 @@ export class ViewElement extends BaseNode {
|
|
|
981
993
|
name: options,
|
|
982
994
|
},
|
|
983
995
|
this,
|
|
984
|
-
'bindStyles'
|
|
996
|
+
'bindStyles',
|
|
985
997
|
);
|
|
986
998
|
} else if (asserts.isBindStyle(options)) {
|
|
987
999
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
@@ -994,7 +1006,7 @@ export class ViewElement extends BaseNode {
|
|
|
994
1006
|
...options,
|
|
995
1007
|
},
|
|
996
1008
|
this,
|
|
997
|
-
'bindStyles'
|
|
1009
|
+
'bindStyles',
|
|
998
1010
|
);
|
|
999
1011
|
}
|
|
1000
1012
|
this.bindStyles.splice(index, 0, bindStyle);
|
|
@@ -1118,7 +1130,7 @@ export class ViewElement extends BaseNode {
|
|
|
1118
1130
|
name: this.getViewElementUniqueName(),
|
|
1119
1131
|
},
|
|
1120
1132
|
this,
|
|
1121
|
-
'children'
|
|
1133
|
+
'children',
|
|
1122
1134
|
);
|
|
1123
1135
|
} else if (typeof options === 'string') {
|
|
1124
1136
|
viewElement = ViewElement.from(
|
|
@@ -1127,7 +1139,7 @@ export class ViewElement extends BaseNode {
|
|
|
1127
1139
|
name: options,
|
|
1128
1140
|
},
|
|
1129
1141
|
this,
|
|
1130
|
-
'children'
|
|
1142
|
+
'children',
|
|
1131
1143
|
);
|
|
1132
1144
|
} else if (asserts.isViewElement(options)) {
|
|
1133
1145
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
@@ -1140,7 +1152,7 @@ export class ViewElement extends BaseNode {
|
|
|
1140
1152
|
...options,
|
|
1141
1153
|
},
|
|
1142
1154
|
this,
|
|
1143
|
-
'children'
|
|
1155
|
+
'children',
|
|
1144
1156
|
);
|
|
1145
1157
|
}
|
|
1146
1158
|
this.children.splice(index, 0, viewElement);
|
|
@@ -1387,7 +1399,9 @@ export class ViewElement extends BaseNode {
|
|
|
1387
1399
|
get parentAuth() {
|
|
1388
1400
|
const _nameSpace = this.view.getNamespace();
|
|
1389
1401
|
const mainViewName = _nameSpace.split('.')[2];
|
|
1390
|
-
return this.view.parentNode.concept === 'App'
|
|
1402
|
+
return this.view.parentNode.concept === 'App'
|
|
1403
|
+
? this.view.auth
|
|
1404
|
+
: this.frontend.views.find((item) => item.name === mainViewName)?.auth;
|
|
1391
1405
|
}
|
|
1392
1406
|
|
|
1393
1407
|
// IDE内展示需要屏蔽掉“系统统一路径前缀”
|
|
@@ -1605,7 +1619,9 @@ export class ViewElement extends BaseNode {
|
|
|
1605
1619
|
|
|
1606
1620
|
return t;
|
|
1607
1621
|
};
|
|
1608
|
-
const hasDataSource =
|
|
1622
|
+
const hasDataSource =
|
|
1623
|
+
config?.allNodesAPI?.[self.tag]?.props?.findIndex((prop) => ['dataSource', 'data-source'].includes(prop.name)) >
|
|
1624
|
+
-1;
|
|
1609
1625
|
// 有数据源属性的组件 才需要生成 item
|
|
1610
1626
|
if (hasDataSource && T) {
|
|
1611
1627
|
const key = T1 ? '__columnItem' : '__item';
|
|
@@ -1629,9 +1645,9 @@ export class ViewElement extends BaseNode {
|
|
|
1629
1645
|
inElementsRefTree: true,
|
|
1630
1646
|
}
|
|
1631
1647
|
: {
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1648
|
+
// 业务组件需要特殊处理
|
|
1649
|
+
inElementsRefTree: true,
|
|
1650
|
+
},
|
|
1635
1651
|
),
|
|
1636
1652
|
);
|
|
1637
1653
|
|
|
@@ -1739,7 +1755,11 @@ export class ViewElement extends BaseNode {
|
|
|
1739
1755
|
code += indent((state?.tabSize || 0) + 4);
|
|
1740
1756
|
code += `children: {\n`;
|
|
1741
1757
|
yield* wrapForEach(self.children, function* warpForEachGenerator(element) {
|
|
1742
|
-
code += yield* element.toEmbeddedTSRefTree(
|
|
1758
|
+
code += yield* element.toEmbeddedTSRefTree(
|
|
1759
|
+
shiftState({ ...state, tabSize: state.tabSize + 2 }, code),
|
|
1760
|
+
{ elementsPathMap },
|
|
1761
|
+
levelIndex,
|
|
1762
|
+
);
|
|
1743
1763
|
});
|
|
1744
1764
|
code += indent((state?.tabSize || 0) + 4);
|
|
1745
1765
|
code += `},\n`;
|
|
@@ -1796,14 +1816,20 @@ export class ViewElement extends BaseNode {
|
|
|
1796
1816
|
if (attr && attr.expression) {
|
|
1797
1817
|
const datasourceName = `datasourceName${element.name}`;
|
|
1798
1818
|
(element as any).__tsDataSourceTypeName = datasourceName;
|
|
1799
|
-
if (
|
|
1819
|
+
if (
|
|
1820
|
+
asserts.isMemberExpression(attr.expression) ||
|
|
1821
|
+
asserts.isIdentifier(attr.expression) ||
|
|
1822
|
+
asserts.isCallLogic(attr.expression)
|
|
1823
|
+
) {
|
|
1800
1824
|
const extraParams = {
|
|
1801
1825
|
tabSize: 4,
|
|
1802
1826
|
inline: true,
|
|
1803
1827
|
noNeedParams: true,
|
|
1804
1828
|
callLogicNoIife: true,
|
|
1805
1829
|
};
|
|
1806
|
-
const value = yield* attr.expression.toEmbeddedTS(
|
|
1830
|
+
const value = yield* attr.expression.toEmbeddedTS(
|
|
1831
|
+
shiftState(state, code, attr.expression.concept === 'CallLogic' ? extraParams : {}),
|
|
1832
|
+
);
|
|
1807
1833
|
code += `type ${datasourceName} = `;
|
|
1808
1834
|
code += `nasl.ui.GetItemTypeFromDataSource<typeof ${value}>;\n`;
|
|
1809
1835
|
} else {
|
|
@@ -1867,7 +1893,7 @@ export class ViewElement extends BaseNode {
|
|
|
1867
1893
|
},
|
|
1868
1894
|
{
|
|
1869
1895
|
node: this,
|
|
1870
|
-
}
|
|
1896
|
+
},
|
|
1871
1897
|
);
|
|
1872
1898
|
return excludedSet;
|
|
1873
1899
|
}
|
|
@@ -1887,7 +1913,9 @@ export class ViewElement extends BaseNode {
|
|
|
1887
1913
|
};
|
|
1888
1914
|
// 过滤模板的登录中的一些翻译,这里只过滤h5表格中的两个列
|
|
1889
1915
|
if (
|
|
1890
|
-
(parentNode.concept === 'ViewElement' &&
|
|
1916
|
+
(parentNode.concept === 'ViewElement' &&
|
|
1917
|
+
(parentNode as any).tag &&
|
|
1918
|
+
this.toHump((parentNode as any).tag) === 'lcapLogin') ||
|
|
1891
1919
|
staticClass === 'login-cell'
|
|
1892
1920
|
) {
|
|
1893
1921
|
return '';
|
|
@@ -1902,7 +1930,7 @@ export class ViewElement extends BaseNode {
|
|
|
1902
1930
|
code += yield* event.toEmbeddedTS(
|
|
1903
1931
|
shiftState(state, code, {
|
|
1904
1932
|
tabSize: (state?.tabSize || 0) + 2,
|
|
1905
|
-
})
|
|
1933
|
+
}),
|
|
1906
1934
|
);
|
|
1907
1935
|
code += '\n';
|
|
1908
1936
|
});
|
|
@@ -1921,7 +1949,7 @@ export class ViewElement extends BaseNode {
|
|
|
1921
1949
|
shiftState(state, code, {
|
|
1922
1950
|
tabSize: state?.tabSize || 0,
|
|
1923
1951
|
}),
|
|
1924
|
-
levelIndex
|
|
1952
|
+
levelIndex,
|
|
1925
1953
|
);
|
|
1926
1954
|
});
|
|
1927
1955
|
return code;
|
|
@@ -1966,7 +1994,7 @@ export class ViewElement extends BaseNode {
|
|
|
1966
1994
|
code += yield* event.toEmbeddedTS(
|
|
1967
1995
|
shiftState(state, code, {
|
|
1968
1996
|
tabSize: (state?.tabSize || 0) + 2,
|
|
1969
|
-
})
|
|
1997
|
+
}),
|
|
1970
1998
|
);
|
|
1971
1999
|
code += '\n';
|
|
1972
2000
|
});
|
|
@@ -2046,24 +2074,24 @@ export class ViewElement extends BaseNode {
|
|
|
2046
2074
|
// 先把插槽翻译了
|
|
2047
2075
|
yield* wrapForEach(children, function* warpForEachGenerator(element) {
|
|
2048
2076
|
if (element.tag === 'template' && element.slotTarget && element.slotTarget !== 'default') {
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2077
|
+
const hasScope = element.haveScope();
|
|
2078
|
+
const slotTarget = `slot${element.toFirstUpper(element.toHump(element.slotTarget))}`;
|
|
2079
|
+
if (hasScope) {
|
|
2080
|
+
code += `${slotTarget}: (current${levelIndex === 0 ? '' : levelIndex}) => [\n`;
|
|
2081
|
+
} else {
|
|
2082
|
+
code += `${slotTarget}: () => [\n`;
|
|
2083
|
+
}
|
|
2084
|
+
const levelIndexDelta = Number(hasScope);
|
|
2085
|
+
yield* wrapForEach(element.children, function* warpForEachGenerator(e) {
|
|
2086
|
+
code += yield* e.toEmbeddedTS(
|
|
2087
|
+
shiftState(state, code, {
|
|
2088
|
+
tabSize: state?.tabSize || 0,
|
|
2089
|
+
}),
|
|
2090
|
+
levelIndex + levelIndexDelta,
|
|
2091
|
+
);
|
|
2092
|
+
});
|
|
2093
|
+
code += indent((state?.tabSize || 0) + 2);
|
|
2094
|
+
code += '\n],\n';
|
|
2067
2095
|
} else {
|
|
2068
2096
|
defaultArr.push(element);
|
|
2069
2097
|
}
|
|
@@ -2071,8 +2099,8 @@ export class ViewElement extends BaseNode {
|
|
|
2071
2099
|
// 翻译其余的子元素
|
|
2072
2100
|
if (defaultArr.length) {
|
|
2073
2101
|
code += indent((state?.tabSize || 0) + 2);
|
|
2074
|
-
const hasScope = defaultArr.some(x=>x.haveScope());
|
|
2075
|
-
const param = hasScope ? `current${levelIndex === 0 ? '' : levelIndex}` :
|
|
2102
|
+
const hasScope = defaultArr.some((x) => x.haveScope());
|
|
2103
|
+
const param = hasScope ? `current${levelIndex === 0 ? '' : levelIndex}` : '';
|
|
2076
2104
|
const levelIndexDelta = Number(hasScope);
|
|
2077
2105
|
code += `slotDefault: (${param}) => [\n`;
|
|
2078
2106
|
yield* wrapForEach(defaultArr, function* warpForEachGenerator(element) {
|
|
@@ -2080,7 +2108,7 @@ export class ViewElement extends BaseNode {
|
|
|
2080
2108
|
shiftState(state, code, {
|
|
2081
2109
|
tabSize: (state?.tabSize || 0) + 2,
|
|
2082
2110
|
}),
|
|
2083
|
-
levelIndex + levelIndexDelta
|
|
2111
|
+
levelIndex + levelIndexDelta,
|
|
2084
2112
|
);
|
|
2085
2113
|
code += '\n';
|
|
2086
2114
|
});
|
|
@@ -2090,8 +2118,8 @@ export class ViewElement extends BaseNode {
|
|
|
2090
2118
|
}
|
|
2091
2119
|
} else if (children?.length) {
|
|
2092
2120
|
code += indent((state?.tabSize || 0) + 2);
|
|
2093
|
-
const hasScope = children.some(x=>x.haveScope());
|
|
2094
|
-
const param = hasScope ? `current${levelIndex === 0 ? '' : levelIndex}` :
|
|
2121
|
+
const hasScope = children.some((x) => x.haveScope());
|
|
2122
|
+
const param = hasScope ? `current${levelIndex === 0 ? '' : levelIndex}` : '';
|
|
2095
2123
|
const levelIndexDelta = Number(hasScope);
|
|
2096
2124
|
code += `slotDefault: (${param}) => [\n`;
|
|
2097
2125
|
yield* wrapForEach(children, function* warpForEachGenerator(element) {
|
|
@@ -2099,7 +2127,7 @@ export class ViewElement extends BaseNode {
|
|
|
2099
2127
|
shiftState(state, code, {
|
|
2100
2128
|
tabSize: (state?.tabSize || 0) + 2,
|
|
2101
2129
|
}),
|
|
2102
|
-
levelIndex + levelIndexDelta
|
|
2130
|
+
levelIndex + levelIndexDelta,
|
|
2103
2131
|
);
|
|
2104
2132
|
code += '\n';
|
|
2105
2133
|
});
|
|
@@ -2128,7 +2156,7 @@ export class ViewElement extends BaseNode {
|
|
|
2128
2156
|
code += attr.toNaturalTS(
|
|
2129
2157
|
shiftState(state, code, {
|
|
2130
2158
|
tabSize: state.tabSize + 1,
|
|
2131
|
-
})
|
|
2159
|
+
}),
|
|
2132
2160
|
);
|
|
2133
2161
|
code += ',\n';
|
|
2134
2162
|
});
|
|
@@ -2137,7 +2165,7 @@ export class ViewElement extends BaseNode {
|
|
|
2137
2165
|
code += event.toNaturalTS(
|
|
2138
2166
|
shiftState(state, code, {
|
|
2139
2167
|
tabSize: state.tabSize + 1,
|
|
2140
|
-
})
|
|
2168
|
+
}),
|
|
2141
2169
|
);
|
|
2142
2170
|
code += ',\n';
|
|
2143
2171
|
});
|
|
@@ -2156,7 +2184,7 @@ export class ViewElement extends BaseNode {
|
|
|
2156
2184
|
code += element.toNaturalTS(
|
|
2157
2185
|
shiftState(state, code, {
|
|
2158
2186
|
tabSize: state.tabSize + 2,
|
|
2159
|
-
})
|
|
2187
|
+
}),
|
|
2160
2188
|
);
|
|
2161
2189
|
code += ',\n';
|
|
2162
2190
|
});
|
|
@@ -2176,7 +2204,7 @@ export class ViewElement extends BaseNode {
|
|
|
2176
2204
|
code += element.toNaturalTS(
|
|
2177
2205
|
shiftState(state, code, {
|
|
2178
2206
|
tabSize: state.tabSize + 2,
|
|
2179
|
-
})
|
|
2207
|
+
}),
|
|
2180
2208
|
);
|
|
2181
2209
|
code += ',\n';
|
|
2182
2210
|
});
|
|
@@ -2191,7 +2219,7 @@ export class ViewElement extends BaseNode {
|
|
|
2191
2219
|
code += element.toNaturalTS(
|
|
2192
2220
|
shiftState(state, code, {
|
|
2193
2221
|
tabSize: state.tabSize + 2,
|
|
2194
|
-
})
|
|
2222
|
+
}),
|
|
2195
2223
|
);
|
|
2196
2224
|
code += ',\n';
|
|
2197
2225
|
});
|
|
@@ -2216,7 +2244,7 @@ export class ViewElement extends BaseNode {
|
|
|
2216
2244
|
code += attr.toTextualNASL(
|
|
2217
2245
|
shiftState(state, code, {
|
|
2218
2246
|
tabSize: state.tabSize + 1,
|
|
2219
|
-
})
|
|
2247
|
+
}),
|
|
2220
2248
|
);
|
|
2221
2249
|
code += ',\n';
|
|
2222
2250
|
});
|
|
@@ -2225,7 +2253,7 @@ export class ViewElement extends BaseNode {
|
|
|
2225
2253
|
code += event.toTextualNASL(
|
|
2226
2254
|
shiftState(state, code, {
|
|
2227
2255
|
tabSize: state.tabSize + 1,
|
|
2228
|
-
})
|
|
2256
|
+
}),
|
|
2229
2257
|
);
|
|
2230
2258
|
code += ',\n';
|
|
2231
2259
|
});
|
|
@@ -2248,7 +2276,7 @@ export class ViewElement extends BaseNode {
|
|
|
2248
2276
|
code += element.toTextualNASL(
|
|
2249
2277
|
shiftState(state, code, {
|
|
2250
2278
|
tabSize: state.tabSize + 2,
|
|
2251
|
-
})
|
|
2279
|
+
}),
|
|
2252
2280
|
// levelIndex,
|
|
2253
2281
|
);
|
|
2254
2282
|
});
|
|
@@ -2278,7 +2306,7 @@ export class ViewElement extends BaseNode {
|
|
|
2278
2306
|
code += element.toTextualNASL(
|
|
2279
2307
|
shiftState(state, code, {
|
|
2280
2308
|
tabSize: state.tabSize + 2,
|
|
2281
|
-
})
|
|
2309
|
+
}),
|
|
2282
2310
|
// levelIndex,
|
|
2283
2311
|
);
|
|
2284
2312
|
code += ',\n';
|
|
@@ -2337,7 +2365,7 @@ export class ViewElement extends BaseNode {
|
|
|
2337
2365
|
}
|
|
2338
2366
|
},
|
|
2339
2367
|
{ node: element },
|
|
2340
|
-
{ mode: 'anyObject', excludedKeySet: element.JSON_EXCLUDED_KEYS }
|
|
2368
|
+
{ mode: 'anyObject', excludedKeySet: element.JSON_EXCLUDED_KEYS },
|
|
2341
2369
|
);
|
|
2342
2370
|
|
|
2343
2371
|
this.likeComponent?.existingViewElement.clear();
|
|
@@ -2359,7 +2387,7 @@ export class ViewElement extends BaseNode {
|
|
|
2359
2387
|
(current) => {
|
|
2360
2388
|
cb(current.node);
|
|
2361
2389
|
},
|
|
2362
|
-
{ node: this }
|
|
2390
|
+
{ node: this },
|
|
2363
2391
|
);
|
|
2364
2392
|
}
|
|
2365
2393
|
|
|
@@ -2398,7 +2426,10 @@ export class ViewElement extends BaseNode {
|
|
|
2398
2426
|
const ast = babelParser.parseExpression(value) as any;
|
|
2399
2427
|
const validationNamespace = getStdlibNamespace().findChild('validation');
|
|
2400
2428
|
if (ast.type === 'CallExpression') {
|
|
2401
|
-
calleeName = (ast.callee?.property?.name ?? ast.callee?.property?.value ?? ast.callee?.name).replace(
|
|
2429
|
+
calleeName = (ast.callee?.property?.name ?? ast.callee?.property?.value ?? ast.callee?.name).replace(
|
|
2430
|
+
/\(.*/,
|
|
2431
|
+
'',
|
|
2432
|
+
);
|
|
2402
2433
|
const func = validationNamespace.functions.find((item) => item.name === calleeName);
|
|
2403
2434
|
args = ast.arguments.map((argument: any, index: number) => ({
|
|
2404
2435
|
concept: 'Argument',
|
|
@@ -2430,9 +2461,18 @@ export class ViewElement extends BaseNode {
|
|
|
2430
2461
|
// 临时处理组件的 text
|
|
2431
2462
|
//h5-mock
|
|
2432
2463
|
if (
|
|
2433
|
-
[
|
|
2434
|
-
|
|
2435
|
-
|
|
2464
|
+
[
|
|
2465
|
+
'u-text',
|
|
2466
|
+
'van-text',
|
|
2467
|
+
'u-link',
|
|
2468
|
+
'u-button',
|
|
2469
|
+
'u-label',
|
|
2470
|
+
'u-radio',
|
|
2471
|
+
'u-checkbox',
|
|
2472
|
+
'u-navbar-item',
|
|
2473
|
+
'u-sidebar-item',
|
|
2474
|
+
'u-menu-item',
|
|
2475
|
+
].includes(astNode.tag) &&
|
|
2436
2476
|
astNode.children.length === 1 &&
|
|
2437
2477
|
astNode.children[0].type === 3
|
|
2438
2478
|
) {
|
|
@@ -2497,7 +2537,9 @@ export class ViewElement extends BaseNode {
|
|
|
2497
2537
|
staticStyle: astNode.attrsMap.style,
|
|
2498
2538
|
slotTarget: astNode.slotTarget && json5.parse(astNode.slotTarget),
|
|
2499
2539
|
slotScope: astNode.slotScope === '_empty_' ? '' : astNode.slotScope,
|
|
2500
|
-
children: astNode.children.map((item) =>
|
|
2540
|
+
children: astNode.children.map((item) =>
|
|
2541
|
+
this._fromASTNode(item as compiler.ASTElement, newContext),
|
|
2542
|
+
) as unknown as Array<ViewElement>,
|
|
2501
2543
|
});
|
|
2502
2544
|
const attrName2Camel = (name: string) => {
|
|
2503
2545
|
if (name.startsWith('vusion-')) return name;
|
|
@@ -2506,7 +2548,10 @@ export class ViewElement extends BaseNode {
|
|
|
2506
2548
|
astNode?.attrs?.forEach((oldAttr) => {
|
|
2507
2549
|
let attr: BindAttribute;
|
|
2508
2550
|
// 获取原始属性
|
|
2509
|
-
const orginAttrCode = (context?.code || '').substr(
|
|
2551
|
+
const orginAttrCode = (context?.code || '').substr(
|
|
2552
|
+
(oldAttr as any).start,
|
|
2553
|
+
(oldAttr as any).end - (oldAttr as any).start,
|
|
2554
|
+
);
|
|
2510
2555
|
if (oldAttr.value === '""' && orginAttrCode.trim() === oldAttr.name) {
|
|
2511
2556
|
attr = new BindAttribute({
|
|
2512
2557
|
type: 'static',
|
|
@@ -2588,7 +2633,7 @@ export class ViewElement extends BaseNode {
|
|
|
2588
2633
|
calleeName: '',
|
|
2589
2634
|
arguments: args,
|
|
2590
2635
|
logics: [currentLogic],
|
|
2591
|
-
})
|
|
2636
|
+
}),
|
|
2592
2637
|
);
|
|
2593
2638
|
}
|
|
2594
2639
|
});
|
|
@@ -2606,7 +2651,7 @@ export class ViewElement extends BaseNode {
|
|
|
2606
2651
|
value: expression ? '' : directive.value,
|
|
2607
2652
|
expression,
|
|
2608
2653
|
sync: true,
|
|
2609
|
-
})
|
|
2654
|
+
}),
|
|
2610
2655
|
);
|
|
2611
2656
|
}
|
|
2612
2657
|
} else {
|
|
@@ -2620,7 +2665,7 @@ export class ViewElement extends BaseNode {
|
|
|
2620
2665
|
expression,
|
|
2621
2666
|
arg: directive.arg,
|
|
2622
2667
|
// modifiers: directive.modifiers,
|
|
2623
|
-
})
|
|
2668
|
+
}),
|
|
2624
2669
|
);
|
|
2625
2670
|
}
|
|
2626
2671
|
});
|
|
@@ -2633,7 +2678,7 @@ export class ViewElement extends BaseNode {
|
|
|
2633
2678
|
rawName: 'v-if',
|
|
2634
2679
|
value: '',
|
|
2635
2680
|
expression: <any>this._parseExpression(astNode.if),
|
|
2636
|
-
})
|
|
2681
|
+
}),
|
|
2637
2682
|
);
|
|
2638
2683
|
}
|
|
2639
2684
|
} else if (astNode.type === 2) {
|
|
@@ -2651,7 +2696,7 @@ export class ViewElement extends BaseNode {
|
|
|
2651
2696
|
name: 'text',
|
|
2652
2697
|
value: expression ? '' : value,
|
|
2653
2698
|
expression,
|
|
2654
|
-
})
|
|
2699
|
+
}),
|
|
2655
2700
|
);
|
|
2656
2701
|
} else if (astNode.type === 3) {
|
|
2657
2702
|
const tagName = config.scope === 'h5' ? 'van-text' : 'u-text';
|
|
@@ -2665,7 +2710,7 @@ export class ViewElement extends BaseNode {
|
|
|
2665
2710
|
name: 'text',
|
|
2666
2711
|
type: 'string',
|
|
2667
2712
|
value: astNode.text?.trim(),
|
|
2668
|
-
})
|
|
2713
|
+
}),
|
|
2669
2714
|
);
|
|
2670
2715
|
}
|
|
2671
2716
|
return element;
|
|
@@ -2711,7 +2756,10 @@ export class ViewElement extends BaseNode {
|
|
|
2711
2756
|
finalCode: false,
|
|
2712
2757
|
nodePathAttr: true,
|
|
2713
2758
|
attrFormat: (attr: BindAttribute | BindEvent | BindDirective, element?: ViewElement, defaultResult?: string) => {
|
|
2714
|
-
if (
|
|
2759
|
+
if (
|
|
2760
|
+
attr.concept === 'BindAttribute' &&
|
|
2761
|
+
!['href', 'destination', 'externalDestination', 'download'].includes(attr.name)
|
|
2762
|
+
) {
|
|
2715
2763
|
const api = config?.allNodesAPI?.[element.tag];
|
|
2716
2764
|
const apiOfAttr = api && api.props && api.props.find((_attr) => _attr.name === attr.name);
|
|
2717
2765
|
if (['u-form-item', 'u-validator', 'van-field'].includes(element.tag) && attr.name === 'rules') {
|
|
@@ -2744,7 +2792,10 @@ export class ViewElement extends BaseNode {
|
|
|
2744
2792
|
) {
|
|
2745
2793
|
return `${attr.name}="{{ ${attr.expression.toUI()} }}"`;
|
|
2746
2794
|
}
|
|
2747
|
-
if (
|
|
2795
|
+
if (
|
|
2796
|
+
(attr as BindAttribute).type === 'dynamic' &&
|
|
2797
|
+
!(element.tag === 'u-cascade-select' && attr.name === 'categories')
|
|
2798
|
+
)
|
|
2748
2799
|
return defaultResult.replace(/:?([\w-]+)(?:.*?)="([\s\S]*)"/, (m, name, value) => {
|
|
2749
2800
|
try {
|
|
2750
2801
|
const tempValue = json5.parse(value);
|
|
@@ -2778,11 +2829,14 @@ export class ViewElement extends BaseNode {
|
|
|
2778
2829
|
const parts = [];
|
|
2779
2830
|
|
|
2780
2831
|
const api = config?.allNodesAPI?.[el?.tag];
|
|
2781
|
-
const emptySlot =
|
|
2832
|
+
const emptySlot =
|
|
2833
|
+
api && api.slots && api.slots.find((slot) => slot.name === 'default' && slot['emptyBackground']);
|
|
2782
2834
|
const hasSupport = api && api.slots && api.slots.some((slot) => slot.support);
|
|
2783
2835
|
if (emptySlot || hasSupport) {
|
|
2784
2836
|
// 有些限制的组件如侧边栏分组有title插槽但要限制子元素放入
|
|
2785
|
-
const validChildren = el.children.filter(
|
|
2837
|
+
const validChildren = el.children.filter(
|
|
2838
|
+
(elem) => !(elem.tag === 'template' && elem.slotTarget !== 'default'),
|
|
2839
|
+
);
|
|
2786
2840
|
let childEmpty = !validChildren.length;
|
|
2787
2841
|
const defaultSlot = el.children.find((elem) => elem.tag === 'template' && elem.slotTarget === 'default');
|
|
2788
2842
|
if (defaultSlot) {
|
|
@@ -2930,7 +2984,8 @@ export class ViewElement extends BaseNode {
|
|
|
2930
2984
|
aslIdAttr: false,
|
|
2931
2985
|
nodePathAttr: false,
|
|
2932
2986
|
getExtraParts: () => [],
|
|
2933
|
-
attrFormat: (attr: BindAttribute | BindEvent | BindDirective, element?: ViewElement, defaultResult?: string) =>
|
|
2987
|
+
attrFormat: (attr: BindAttribute | BindEvent | BindDirective, element?: ViewElement, defaultResult?: string) =>
|
|
2988
|
+
defaultResult,
|
|
2934
2989
|
bindStylesFormat: (bindStyles: BindStyle[], element?: ViewElement) => {
|
|
2935
2990
|
if (bindStyles.length === 0) return false;
|
|
2936
2991
|
|
|
@@ -2943,7 +2998,7 @@ export class ViewElement extends BaseNode {
|
|
|
2943
2998
|
options,
|
|
2944
2999
|
{
|
|
2945
3000
|
currentList,
|
|
2946
|
-
}
|
|
3001
|
+
},
|
|
2947
3002
|
);
|
|
2948
3003
|
const tabString = ' '.repeat(newOptions.tabSize * newOptions.indentLevel);
|
|
2949
3004
|
const insideTabString = ' '.repeat(newOptions.tabSize * (newOptions.indentLevel + 1));
|
|
@@ -2980,27 +3035,30 @@ export class ViewElement extends BaseNode {
|
|
|
2980
3035
|
this.staticClass && parts.push(`class="${this.staticClass}"`);
|
|
2981
3036
|
|
|
2982
3037
|
const vIfs: string[] = [];
|
|
2983
|
-
[]
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
3038
|
+
[]
|
|
3039
|
+
.concat(this.bindAttrs, this.bindDirectives, this.bindEvents)
|
|
3040
|
+
.forEach((attr: BindAttribute | BindDirective | BindEvent) => {
|
|
3041
|
+
let result = newOptions.attrFormat(attr, this, attr?.toVue(newOptions));
|
|
3042
|
+
if (
|
|
3043
|
+
options?.isExport &&
|
|
3044
|
+
attr?.concept === 'BindAttribute' &&
|
|
3045
|
+
attr?.name === 'src' &&
|
|
3046
|
+
/^\/assets\/(.*?)$/.test(attr?.value) &&
|
|
3047
|
+
// && attr.value.includes('/assets/')
|
|
3048
|
+
this.app?.sysPrefixPath?.length > 0
|
|
3049
|
+
) {
|
|
3050
|
+
result = (result as string)?.replace('/assets/', `${this.app?.sysPrefixPath}/assets/`);
|
|
3051
|
+
}
|
|
2994
3052
|
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
3053
|
+
// v-auth v-if 都翻译成 v-if
|
|
3054
|
+
if (asserts.isBindDirective(attr) && ['if', 'auth'].includes(attr.name) && result !== false) {
|
|
3055
|
+
const expr = result.replace(/v-(if|auth)="(.*)"/, (match, p1, p2) => p2);
|
|
3056
|
+
if (expr) vIfs.push(attr.name === 'if' ? expr : `$auth.has(${expr})`);
|
|
2999
3057
|
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3058
|
+
return;
|
|
3059
|
+
}
|
|
3060
|
+
result && parts.push(result);
|
|
3061
|
+
});
|
|
3004
3062
|
|
|
3005
3063
|
if (vIfs.length === 2) parts.push(`v-if="(${vIfs[0]}) && (${vIfs[1]})"`);
|
|
3006
3064
|
else if (vIfs.length === 1) parts.push(`v-if="${vIfs[0]}"`);
|
|
@@ -3018,7 +3076,10 @@ export class ViewElement extends BaseNode {
|
|
|
3018
3076
|
});
|
|
3019
3077
|
}
|
|
3020
3078
|
// 部分组件增加 key 唯一标识,防止 vue 判断重复节点,导致渲染异常
|
|
3021
|
-
if (
|
|
3079
|
+
if (
|
|
3080
|
+
this.name &&
|
|
3081
|
+
['u-table-view', 'u-list-view', 'u-grid-view', 'u-list-components', 'u-form', 'u-select'].includes(this.tag)
|
|
3082
|
+
) {
|
|
3022
3083
|
this.name && parts.push(`key="${this.name}"`);
|
|
3023
3084
|
}
|
|
3024
3085
|
let tag = this.tag;
|
|
@@ -3066,8 +3127,8 @@ export class ViewElement extends BaseNode {
|
|
|
3066
3127
|
color: var(--font-second-color);
|
|
3067
3128
|
text-align: center;`;
|
|
3068
3129
|
}
|
|
3069
|
-
if(options?.isExport && staticStyle?.includes(`url('/assets/`) && this.app.sysPrefixPath?.length > 0
|
|
3070
|
-
staticStyle = staticStyle.replace(/url\('\/assets\/(.*?)'\)/, `url('${this.app.sysPrefixPath}/assets/$1')`)
|
|
3130
|
+
if (options?.isExport && staticStyle?.includes(`url('/assets/`) && this.app.sysPrefixPath?.length > 0) {
|
|
3131
|
+
staticStyle = staticStyle.replace(/url\('\/assets\/(.*?)'\)/, `url('${this.app.sysPrefixPath}/assets/$1')`);
|
|
3071
3132
|
}
|
|
3072
3133
|
staticStyle && parts.push(`style="${staticStyle}"`);
|
|
3073
3134
|
if (!content.length) {
|
|
@@ -3084,7 +3145,11 @@ export class ViewElement extends BaseNode {
|
|
|
3084
3145
|
partsLength += part.length;
|
|
3085
3146
|
});
|
|
3086
3147
|
|
|
3087
|
-
let htmlContent =
|
|
3148
|
+
let htmlContent =
|
|
3149
|
+
`<${tag}${partsString.length ? partsString : ''}>` +
|
|
3150
|
+
content +
|
|
3151
|
+
(shouldIndent ? '\n' + tabString : '') +
|
|
3152
|
+
`</${tag}>`;
|
|
3088
3153
|
if (!content.trim() && selfClosingTag.includes(tag)) {
|
|
3089
3154
|
htmlContent = `<${tag}${partsString.length ? partsString : ''} />`;
|
|
3090
3155
|
}
|
|
@@ -3110,7 +3175,7 @@ export class ViewElement extends BaseNode {
|
|
|
3110
3175
|
(current) => {
|
|
3111
3176
|
if (current.node.name === name) return current.node;
|
|
3112
3177
|
},
|
|
3113
|
-
{ node: this }
|
|
3178
|
+
{ node: this },
|
|
3114
3179
|
);
|
|
3115
3180
|
}
|
|
3116
3181
|
|
|
@@ -3119,7 +3184,7 @@ export class ViewElement extends BaseNode {
|
|
|
3119
3184
|
(current) => {
|
|
3120
3185
|
if (current.node.tag === tag) return current.node;
|
|
3121
3186
|
},
|
|
3122
|
-
{ node: this }
|
|
3187
|
+
{ node: this },
|
|
3123
3188
|
);
|
|
3124
3189
|
}
|
|
3125
3190
|
|
|
@@ -3128,7 +3193,7 @@ export class ViewElement extends BaseNode {
|
|
|
3128
3193
|
(current) => {
|
|
3129
3194
|
if (current.node.bindAttrs.some((attr) => attr.name === name && attr.value === value)) return current.node;
|
|
3130
3195
|
},
|
|
3131
|
-
{ node: this }
|
|
3196
|
+
{ node: this },
|
|
3132
3197
|
);
|
|
3133
3198
|
}
|
|
3134
3199
|
// 查找element下有没有某个类型的元素,有就返回
|
|
@@ -3178,7 +3243,7 @@ export class ViewElement extends BaseNode {
|
|
|
3178
3243
|
ops: {
|
|
3179
3244
|
beforeSetStyleCb?: (newStyleObj: Record<string, any>) => void;
|
|
3180
3245
|
isUpdateConstraintRule?: boolean;
|
|
3181
|
-
} = {}
|
|
3246
|
+
} = {},
|
|
3182
3247
|
) {
|
|
3183
3248
|
if (!positionData) {
|
|
3184
3249
|
return;
|
|
@@ -3188,8 +3253,12 @@ export class ViewElement extends BaseNode {
|
|
|
3188
3253
|
const staticHeight = Math.round(nodeRect.height);
|
|
3189
3254
|
const staticLeft = Math.round(nodeRect.left - parentRect.left - parentBorder.left);
|
|
3190
3255
|
const staticTop = Math.round(nodeRect.top - parentRect.top - parentBorder.top);
|
|
3191
|
-
const staticRight = Math.round(
|
|
3192
|
-
|
|
3256
|
+
const staticRight = Math.round(
|
|
3257
|
+
parentRect.width - nodeRect.width - staticLeft - parentBorder.right - parentBorder.left,
|
|
3258
|
+
);
|
|
3259
|
+
const staticBottom = Math.round(
|
|
3260
|
+
parentRect.height - nodeRect.height - staticTop - parentBorder.bottom - parentBorder.top,
|
|
3261
|
+
);
|
|
3193
3262
|
const styleObj = this.parseStyleToObject(this.staticStyle);
|
|
3194
3263
|
let constraintX = styleObj['--constraint-x'] || 'left';
|
|
3195
3264
|
let constraintY = styleObj['--constraint-y'] || 'top';
|
|
@@ -3291,7 +3360,7 @@ export class ViewElement extends BaseNode {
|
|
|
3291
3360
|
this.stringifyStyleAttr({
|
|
3292
3361
|
...this.parseStyleToObject(this.staticStyle),
|
|
3293
3362
|
...styleObj,
|
|
3294
|
-
})
|
|
3363
|
+
}),
|
|
3295
3364
|
);
|
|
3296
3365
|
}
|
|
3297
3366
|
parseStyleToObject(styleStr: string = '') {
|
|
@@ -3337,7 +3406,11 @@ export class ViewElement extends BaseNode {
|
|
|
3337
3406
|
* 是否是流程表单
|
|
3338
3407
|
*/
|
|
3339
3408
|
isProcessForm() {
|
|
3340
|
-
return
|
|
3409
|
+
return (
|
|
3410
|
+
this.tag.endsWith('-form') &&
|
|
3411
|
+
this.getBindAttribute('id')?.value === 'dynamicRenderContainer' &&
|
|
3412
|
+
this.getBindAttribute('processPrefix')
|
|
3413
|
+
);
|
|
3341
3414
|
}
|
|
3342
3415
|
//================================================================================
|
|
3343
3416
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|