@lcap/nasl 3.1.0-beta.2 → 3.1.0-beta.4
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/breakpoint/shared/constants.js +2 -0
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/common/Command.d.ts +1 -1
- package/out/common/Command.js +1 -1
- package/out/common/Command.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +8 -9
- package/out/concepts/AnonymousFunction__.js +15 -14
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/Argument__.js +7 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +0 -2
- package/out/concepts/AuthInterface__.js +0 -58
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +3 -2
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +10 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +0 -1
- package/out/concepts/CallAuthInterface__.js +5 -8
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallFunction__.js +4 -3
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +3 -1
- package/out/concepts/CallInterface__.js +21 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +2 -0
- package/out/concepts/CallLogic__.js +74 -14
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +29 -29
- package/out/concepts/FrontendLibrary__.js +2 -2
- package/out/concepts/Function__.js +3 -3
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +6 -6
- package/out/concepts/LogicItem__.js +6 -6
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +19 -4
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +29 -29
- package/out/concepts/Namespace__.js +2 -2
- package/out/concepts/NewComposite__.d.ts +1 -0
- package/out/concepts/NewComposite__.js +67 -3
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +1 -0
- package/out/concepts/NewList__.js +17 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +2 -0
- package/out/concepts/QueryJoinExpression__.js +11 -0
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +1 -0
- package/out/concepts/TypeAnnotation__.js +37 -4
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/ViewComponent__.d.ts +33 -33
- package/out/concepts/ViewComponent__.js +7 -7
- package/out/concepts/ViewElement__.d.ts +4 -1
- package/out/concepts/ViewElement__.js +51 -3
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +4 -4
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.http.js +28 -26
- package/out/concepts/basics/stdlib/nasl.http.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +17 -9
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/types/index.js +1 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/concepts/types__.d.ts +1 -2
- package/out/generator/genBundleFiles.js +32 -27
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.js +8 -0
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/genReleaseBody.js +6 -6
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/sentry/index.js +8 -1
- package/out/sentry/index.js.map +1 -1
- package/out/server/getInterfaces.js +1 -1
- package/out/server/getInterfaces.js.map +1 -1
- package/out/server/naslServer.d.ts +10 -2
- package/out/server/naslServer.js +55 -12
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +0 -12
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +102 -65
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +2 -2
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +2 -2
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.d.ts +1 -1
- package/out/templator/genEditTableBlock.js +6 -2
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +2 -2
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.d.ts +2 -2
- package/out/templator/genGridViewBlock.js +14 -8
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.d.ts +2 -2
- package/out/templator/genListViewBlock.js +9 -5
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.d.ts +2 -2
- package/out/templator/genSelectBlock.js +18 -11
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +1 -1
- package/out/templator/genTableBlock.js +7 -3
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -2
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/package.json +13 -13
- package/sandbox/stdlib/nasl.util.ts +2 -2
- package/src/automate/engine/utils.js +3 -0
- package/src/breakpoint/shared/constants.ts +2 -0
- package/src/common/BaseNode.ts +10 -5
- package/src/common/Command.ts +1 -1
- package/src/concepts/AnonymousFunction__.ts +2 -1
- package/src/concepts/Argument__.ts +5 -5
- package/src/concepts/Assignment__.ts +2 -1
- package/src/concepts/AuthInterface__.ts +3 -53
- package/src/concepts/BindEvent__.ts +5 -6
- package/src/concepts/CallAuthInterface__.ts +5 -8
- package/src/concepts/CallFunction__.ts +2 -1
- package/src/concepts/CallInterface__.ts +84 -63
- package/src/concepts/CallLogic__.ts +89 -67
- package/src/concepts/CompletionProperty__.ts +6 -1
- package/src/concepts/ConfigPropertyValue__.ts +2 -2
- package/src/concepts/Function__.ts +2 -2
- package/src/concepts/QueryJoinExpression__.ts +13 -0
- package/src/concepts/TypeAnnotation__.ts +31 -0
- package/src/concepts/ViewElement__.ts +80 -33
- package/src/concepts/basics/stdlib/nasl.http.ts +26 -24
- package/src/concepts/types__.ts +1 -3
- package/src/generator/genBundleFiles.ts +32 -27
- package/src/generator/genReleaseBody.ts +10 -7
- package/src/generator/permission.ts +6 -6
- package/src/server/getInterfaces.ts +1 -1
- package/src/server/naslServer.ts +58 -8
- package/src/server/translator.ts +0 -12
- package/src/service/storage/init.ts +106 -67
- package/src/templator/genCreateBlock.ts +2 -2
- package/src/templator/genEnumSelectBlock.ts +2 -2
- package/src/templator/genSelectBlock.ts +4 -3
- package/src/templator/genUpdateBlock.ts +2 -2
- package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +71 -0
- package/test/concepts/call-interface/__snapshots__/toJS.spec.ts.snap +140 -0
- package/test/concepts/call-interface/constant.ts +5 -0
- package/test/concepts/call-interface/fixtures/only-interface.json +158 -0
- package/test/concepts/call-interface/fixtures/with-body-complex-argument.json +455 -0
- package/test/concepts/call-interface/fixtures/with-body-no-argument.json +187 -0
- package/test/concepts/call-interface/fixtures/with-body-simple-argument.json +225 -0
- package/test/concepts/call-interface/fixtures/with-headers-no-argument.json +213 -0
- package/test/concepts/call-interface/fixtures/with-headers.json +192 -0
- package/test/concepts/call-interface/fixtures/with-query-no-argument.json +213 -0
- package/test/concepts/call-interface/fixtures/with-query.json +192 -0
- package/test/concepts/call-interface/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/call-interface/toJS.spec.ts +14 -0
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +74 -0
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +141 -0
- package/test/concepts/call-logic/constant.ts +5 -0
- package/test/concepts/call-logic/fixtures/entries-get-with-arguments.json +223 -0
- package/test/concepts/call-logic/fixtures/entries-update-with-arguments.json +359 -0
- package/test/concepts/call-logic/fixtures/global-logic-argument-no-expression.json +209 -0
- package/test/concepts/call-logic/fixtures/global-logic-argument-some-expression.json +311 -0
- package/test/concepts/call-logic/fixtures/only-call-logic.json +10 -0
- package/test/concepts/call-logic/fixtures/view-buildin-logic-with-argument.json +128 -0
- package/test/concepts/call-logic/fixtures/view-component-logic-no-argument.json +126 -0
- package/test/concepts/call-logic/fixtures/view-component-with-validation.json +244 -0
- package/test/concepts/call-logic/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/call-logic/toJS.spec.ts +14 -0
- package/test/concepts/utils.ts +76 -3
- package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +3 -3
- package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +16 -0
- package/test/concepts/validation-rule/constant.ts +5 -0
- package/test/concepts/validation-rule/toEmbeddedTS.spec.ts +10 -17
- package/test/concepts/validation-rule/toJS.spec.ts +14 -0
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +89 -0
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +44 -0
- package/test/concepts/view-element/constant.ts +5 -0
- package/test/concepts/view-element/fixtures/default-not-found.json +322 -0
- package/test/concepts/view-element/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/view-element/toVue.spec.ts +14 -0
- package/test/setup.ts +6 -0
- package/ts-worker/lib/tsserver.js +5 -6
- package/ts-worker/package-lock.json +2 -1
- package/bin/naslc +0 -3
- package/out/src/automate/engine/index.d.ts +0 -4
- package/out/src/automate/engine/index.js +0 -443
- package/out/src/automate/engine/index.js.map +0 -1
- package/out/src/automate/engine/operators.d.ts +0 -24
- package/out/src/automate/engine/operators.js +0 -252
- package/out/src/automate/engine/operators.js.map +0 -1
- package/out/src/automate/engine/uniqueName.d.ts +0 -12
- package/out/src/automate/engine/uniqueName.js +0 -112
- package/out/src/automate/engine/uniqueName.js.map +0 -1
- package/out/src/automate/engine/utils.d.ts +0 -25
- package/out/src/automate/engine/utils.js +0 -440
- package/out/src/automate/engine/utils.js.map +0 -1
- package/out/src/automate/engine/viewCache.d.ts +0 -19
- package/out/src/automate/engine/viewCache.js +0 -45
- package/out/src/automate/engine/viewCache.js.map +0 -1
- package/out/src/automate/template/myProcess.d.ts +0 -10
- package/out/src/automate/template/myProcess.js +0 -11498
- package/out/src/automate/template/myProcess.js.map +0 -1
- package/out/src/automate/upgrader/2.12.d.ts +0 -7
- package/out/src/automate/upgrader/2.12.js +0 -63
- package/out/src/automate/upgrader/2.12.js.map +0 -1
- package/out/src/automate/upgrader/2.14-components.d.ts +0 -1115
- package/out/src/automate/upgrader/2.14-components.js +0 -1087
- package/out/src/automate/upgrader/2.14-components.js.map +0 -1
- package/out/src/automate/upgrader/2.14.d.ts +0 -10
- package/out/src/automate/upgrader/2.14.js +0 -236
- package/out/src/automate/upgrader/2.14.js.map +0 -1
- package/out/src/automate/upgrader/2.14.old.d.ts +0 -1
- package/out/src/automate/upgrader/2.14.old.js +0 -125
- package/out/src/automate/upgrader/2.14.old.js.map +0 -1
- package/out/src/automate/upgrader/2.16.d.ts +0 -10
- package/out/src/automate/upgrader/2.16.js +0 -75
- package/out/src/automate/upgrader/2.16.js.map +0 -1
- package/out/src/automate/upgrader/2.17.d.ts +0 -21
- package/out/src/automate/upgrader/2.17.js +0 -557
- package/out/src/automate/upgrader/2.17.js.map +0 -1
- package/out/src/automate/upgrader/2.18.d.ts +0 -10
- package/out/src/automate/upgrader/2.18.js +0 -107
- package/out/src/automate/upgrader/2.18.js.map +0 -1
- package/out/src/automate/upgrader/2.20.d.ts +0 -17
- package/out/src/automate/upgrader/2.20.js +0 -68
- package/out/src/automate/upgrader/2.20.js.map +0 -1
- package/out/src/bak/translator.d.ts +0 -1
- package/out/src/bak/translator.js +0 -119
- package/out/src/bak/translator.js.map +0 -1
- package/out/src/breakpoint/generator/AfterStartNode.d.ts +0 -7
- package/out/src/breakpoint/generator/AfterStartNode.js +0 -27
- package/out/src/breakpoint/generator/AfterStartNode.js.map +0 -1
- package/out/src/breakpoint/generator/BeforeEndNode.d.ts +0 -7
- package/out/src/breakpoint/generator/BeforeEndNode.js +0 -27
- package/out/src/breakpoint/generator/BeforeEndNode.js.map +0 -1
- package/out/src/breakpoint/generator/BreakpointNode.d.ts +0 -14
- package/out/src/breakpoint/generator/BreakpointNode.js +0 -200
- package/out/src/breakpoint/generator/BreakpointNode.js.map +0 -1
- package/out/src/breakpoint/generator/index.d.ts +0 -4
- package/out/src/breakpoint/generator/index.js +0 -98
- package/out/src/breakpoint/generator/index.js.map +0 -1
- package/out/src/breakpoint/index.d.ts +0 -3
- package/out/src/breakpoint/index.js +0 -20
- package/out/src/breakpoint/index.js.map +0 -1
- package/out/src/breakpoint/shared/constants.d.ts +0 -31
- package/out/src/breakpoint/shared/constants.js +0 -91
- package/out/src/breakpoint/shared/constants.js.map +0 -1
- package/out/src/breakpoint/shared/index.d.ts +0 -3
- package/out/src/breakpoint/shared/index.js +0 -33
- package/out/src/breakpoint/shared/index.js.map +0 -1
- package/out/src/breakpoint/shared/operations.d.ts +0 -10
- package/out/src/breakpoint/shared/operations.js +0 -25
- package/out/src/breakpoint/shared/operations.js.map +0 -1
- package/out/src/breakpoint/shared/socket.d.ts +0 -47
- package/out/src/breakpoint/shared/socket.js +0 -210
- package/out/src/breakpoint/shared/socket.js.map +0 -1
- package/out/src/breakpoint/shared/utils.d.ts +0 -23
- package/out/src/breakpoint/shared/utils.js +0 -165
- package/out/src/breakpoint/shared/utils.js.map +0 -1
- package/out/src/breakpoint/store/core.d.ts +0 -32
- package/out/src/breakpoint/store/core.js +0 -388
- package/out/src/breakpoint/store/core.js.map +0 -1
- package/out/src/breakpoint/store/dock.d.ts +0 -1
- package/out/src/breakpoint/store/dock.js +0 -127
- package/out/src/breakpoint/store/dock.js.map +0 -1
- package/out/src/breakpoint/store/index.d.ts +0 -2
- package/out/src/breakpoint/store/index.js +0 -19
- package/out/src/breakpoint/store/index.js.map +0 -1
- package/out/src/common/BaseNode.d.ts +0 -317
- package/out/src/common/BaseNode.js +0 -1156
- package/out/src/common/BaseNode.js.map +0 -1
- package/out/src/common/Command.d.ts +0 -9
- package/out/src/common/Command.js +0 -36
- package/out/src/common/Command.js.map +0 -1
- package/out/src/common/ComponentAPI.d.ts +0 -110
- package/out/src/common/ComponentAPI.js +0 -3
- package/out/src/common/ComponentAPI.js.map +0 -1
- package/out/src/common/EventEmitter.d.ts +0 -59
- package/out/src/common/EventEmitter.js +0 -71
- package/out/src/common/EventEmitter.js.map +0 -1
- package/out/src/common/Messager.d.ts +0 -91
- package/out/src/common/Messager.js +0 -208
- package/out/src/common/Messager.js.map +0 -1
- package/out/src/common/asyncFuncMap.d.ts +0 -2
- package/out/src/common/asyncFuncMap.js +0 -16
- package/out/src/common/asyncFuncMap.js.map +0 -1
- package/out/src/common/classMap.d.ts +0 -4
- package/out/src/common/classMap.js +0 -5
- package/out/src/common/classMap.js.map +0 -1
- package/out/src/common/index.d.ts +0 -4
- package/out/src/common/index.js +0 -21
- package/out/src/common/index.js.map +0 -1
- package/out/src/concepts/Abort__.d.ts +0 -25
- package/out/src/concepts/Abort__.js +0 -80
- package/out/src/concepts/Abort__.js.map +0 -1
- package/out/src/concepts/Anchor__.d.ts +0 -44
- package/out/src/concepts/Anchor__.js +0 -182
- package/out/src/concepts/Anchor__.js.map +0 -1
- package/out/src/concepts/AnonymousFunction__.d.ts +0 -172
- package/out/src/concepts/AnonymousFunction__.js +0 -490
- package/out/src/concepts/AnonymousFunction__.js.map +0 -1
- package/out/src/concepts/App__.d.ts +0 -1510
- package/out/src/concepts/App__.js +0 -2268
- package/out/src/concepts/App__.js.map +0 -1
- package/out/src/concepts/Argument__.d.ts +0 -65
- package/out/src/concepts/Argument__.js +0 -265
- package/out/src/concepts/Argument__.js.map +0 -1
- package/out/src/concepts/Assignee__.d.ts +0 -288
- package/out/src/concepts/Assignee__.js +0 -427
- package/out/src/concepts/Assignee__.js.map +0 -1
- package/out/src/concepts/AssignmentLine__.d.ts +0 -41
- package/out/src/concepts/AssignmentLine__.js +0 -112
- package/out/src/concepts/AssignmentLine__.js.map +0 -1
- package/out/src/concepts/Assignment__.d.ts +0 -73
- package/out/src/concepts/Assignment__.js +0 -286
- package/out/src/concepts/Assignment__.js.map +0 -1
- package/out/src/concepts/Attribute__.d.ts +0 -97
- package/out/src/concepts/Attribute__.js +0 -197
- package/out/src/concepts/Attribute__.js.map +0 -1
- package/out/src/concepts/AuthInterface__.d.ts +0 -37
- package/out/src/concepts/AuthInterface__.js +0 -141
- package/out/src/concepts/AuthInterface__.js.map +0 -1
- package/out/src/concepts/AuthLogicForCallInterface__.d.ts +0 -138
- package/out/src/concepts/AuthLogicForCallInterface__.js +0 -493
- package/out/src/concepts/AuthLogicForCallInterface__.js.map +0 -1
- package/out/src/concepts/AuthLogic__.d.ts +0 -66
- package/out/src/concepts/AuthLogic__.js +0 -206
- package/out/src/concepts/AuthLogic__.js.map +0 -1
- package/out/src/concepts/BackendVariable__.d.ts +0 -137
- package/out/src/concepts/BackendVariable__.js +0 -422
- package/out/src/concepts/BackendVariable__.js.map +0 -1
- package/out/src/concepts/Backend__.d.ts +0 -134
- package/out/src/concepts/Backend__.js +0 -274
- package/out/src/concepts/Backend__.js.map +0 -1
- package/out/src/concepts/BatchAssignment__.d.ts +0 -251
- package/out/src/concepts/BatchAssignment__.js +0 -806
- package/out/src/concepts/BatchAssignment__.js.map +0 -1
- package/out/src/concepts/BinaryExpression__.d.ts +0 -70
- package/out/src/concepts/BinaryExpression__.js +0 -345
- package/out/src/concepts/BinaryExpression__.js.map +0 -1
- package/out/src/concepts/BindAttribute__.d.ts +0 -318
- package/out/src/concepts/BindAttribute__.js +0 -875
- package/out/src/concepts/BindAttribute__.js.map +0 -1
- package/out/src/concepts/BindDirective__.d.ts +0 -161
- package/out/src/concepts/BindDirective__.js +0 -532
- package/out/src/concepts/BindDirective__.js.map +0 -1
- package/out/src/concepts/BindEvent__.d.ts +0 -251
- package/out/src/concepts/BindEvent__.js +0 -788
- package/out/src/concepts/BindEvent__.js.map +0 -1
- package/out/src/concepts/BindStyle__.d.ts +0 -139
- package/out/src/concepts/BindStyle__.js +0 -432
- package/out/src/concepts/BindStyle__.js.map +0 -1
- package/out/src/concepts/BooleanLiteral__.d.ts +0 -34
- package/out/src/concepts/BooleanLiteral__.js +0 -100
- package/out/src/concepts/BooleanLiteral__.js.map +0 -1
- package/out/src/concepts/CallAuthInterface__.d.ts +0 -126
- package/out/src/concepts/CallAuthInterface__.js +0 -409
- package/out/src/concepts/CallAuthInterface__.js.map +0 -1
- package/out/src/concepts/CallConnector__.d.ts +0 -42
- package/out/src/concepts/CallConnector__.js +0 -198
- package/out/src/concepts/CallConnector__.js.map +0 -1
- package/out/src/concepts/CallFunction__.d.ts +0 -157
- package/out/src/concepts/CallFunction__.js +0 -503
- package/out/src/concepts/CallFunction__.js.map +0 -1
- package/out/src/concepts/CallInterface__.d.ts +0 -125
- package/out/src/concepts/CallInterface__.js +0 -677
- package/out/src/concepts/CallInterface__.js.map +0 -1
- package/out/src/concepts/CallLogic__.d.ts +0 -224
- package/out/src/concepts/CallLogic__.js +0 -1140
- package/out/src/concepts/CallLogic__.js.map +0 -1
- package/out/src/concepts/CallQueryComponent__.d.ts +0 -432
- package/out/src/concepts/CallQueryComponent__.js +0 -1264
- package/out/src/concepts/CallQueryComponent__.js.map +0 -1
- package/out/src/concepts/Comment__.d.ts +0 -31
- package/out/src/concepts/Comment__.js +0 -96
- package/out/src/concepts/Comment__.js.map +0 -1
- package/out/src/concepts/CompletionProperty__.d.ts +0 -104
- package/out/src/concepts/CompletionProperty__.js +0 -256
- package/out/src/concepts/CompletionProperty__.js.map +0 -1
- package/out/src/concepts/ConfigGroup__.d.ts +0 -124
- package/out/src/concepts/ConfigGroup__.js +0 -253
- package/out/src/concepts/ConfigGroup__.js.map +0 -1
- package/out/src/concepts/ConfigPropertyValue__.d.ts +0 -44
- package/out/src/concepts/ConfigPropertyValue__.js +0 -106
- package/out/src/concepts/ConfigPropertyValue__.js.map +0 -1
- package/out/src/concepts/ConfigProperty__.d.ts +0 -153
- package/out/src/concepts/ConfigProperty__.js +0 -322
- package/out/src/concepts/ConfigProperty__.js.map +0 -1
- package/out/src/concepts/Configuration__.d.ts +0 -123
- package/out/src/concepts/Configuration__.js +0 -229
- package/out/src/concepts/Configuration__.js.map +0 -1
- package/out/src/concepts/ConnectorTrigger__.d.ts +0 -78
- package/out/src/concepts/ConnectorTrigger__.js +0 -155
- package/out/src/concepts/ConnectorTrigger__.js.map +0 -1
- package/out/src/concepts/Connector__.d.ts +0 -464
- package/out/src/concepts/Connector__.js +0 -698
- package/out/src/concepts/Connector__.js.map +0 -1
- package/out/src/concepts/Constant__.d.ts +0 -110
- package/out/src/concepts/Constant__.js +0 -252
- package/out/src/concepts/Constant__.js.map +0 -1
- package/out/src/concepts/DataElement__.d.ts +0 -46
- package/out/src/concepts/DataElement__.js +0 -117
- package/out/src/concepts/DataElement__.js.map +0 -1
- package/out/src/concepts/DataSource__.d.ts +0 -164
- package/out/src/concepts/DataSource__.js +0 -441
- package/out/src/concepts/DataSource__.js.map +0 -1
- package/out/src/concepts/DatabaseTypeAnnotation__.d.ts +0 -31
- package/out/src/concepts/DatabaseTypeAnnotation__.js +0 -78
- package/out/src/concepts/DatabaseTypeAnnotation__.js.map +0 -1
- package/out/src/concepts/Destination__.d.ts +0 -156
- package/out/src/concepts/Destination__.js +0 -738
- package/out/src/concepts/Destination__.js.map +0 -1
- package/out/src/concepts/End__.d.ts +0 -24
- package/out/src/concepts/End__.js +0 -114
- package/out/src/concepts/End__.js.map +0 -1
- package/out/src/concepts/EntityIndex__.d.ts +0 -95
- package/out/src/concepts/EntityIndex__.js +0 -218
- package/out/src/concepts/EntityIndex__.js.map +0 -1
- package/out/src/concepts/EntityProperty__.d.ts +0 -273
- package/out/src/concepts/EntityProperty__.js +0 -804
- package/out/src/concepts/EntityProperty__.js.map +0 -1
- package/out/src/concepts/Entity__.d.ts +0 -338
- package/out/src/concepts/Entity__.js +0 -709
- package/out/src/concepts/Entity__.js.map +0 -1
- package/out/src/concepts/EnumItem__.d.ts +0 -63
- package/out/src/concepts/EnumItem__.js +0 -145
- package/out/src/concepts/EnumItem__.js.map +0 -1
- package/out/src/concepts/Enum__.d.ts +0 -137
- package/out/src/concepts/Enum__.js +0 -320
- package/out/src/concepts/Enum__.js.map +0 -1
- package/out/src/concepts/Event__.d.ts +0 -143
- package/out/src/concepts/Event__.js +0 -245
- package/out/src/concepts/Event__.js.map +0 -1
- package/out/src/concepts/ExternalDestination__.d.ts +0 -75
- package/out/src/concepts/ExternalDestination__.js +0 -285
- package/out/src/concepts/ExternalDestination__.js.map +0 -1
- package/out/src/concepts/ForEachStatement__.d.ts +0 -188
- package/out/src/concepts/ForEachStatement__.js +0 -447
- package/out/src/concepts/ForEachStatement__.js.map +0 -1
- package/out/src/concepts/FrontendLibrary__.d.ts +0 -213
- package/out/src/concepts/FrontendLibrary__.js +0 -352
- package/out/src/concepts/FrontendLibrary__.js.map +0 -1
- package/out/src/concepts/FrontendVariable__.d.ts +0 -21
- package/out/src/concepts/FrontendVariable__.js +0 -64
- package/out/src/concepts/FrontendVariable__.js.map +0 -1
- package/out/src/concepts/Frontend__.d.ts +0 -477
- package/out/src/concepts/Frontend__.js +0 -841
- package/out/src/concepts/Frontend__.js.map +0 -1
- package/out/src/concepts/Function__.d.ts +0 -416
- package/out/src/concepts/Function__.js +0 -724
- package/out/src/concepts/Function__.js.map +0 -1
- package/out/src/concepts/Identifier__.d.ts +0 -51
- package/out/src/concepts/Identifier__.js +0 -295
- package/out/src/concepts/Identifier__.js.map +0 -1
- package/out/src/concepts/IfStatement__.d.ts +0 -157
- package/out/src/concepts/IfStatement__.js +0 -305
- package/out/src/concepts/IfStatement__.js.map +0 -1
- package/out/src/concepts/Integration__.d.ts +0 -53
- package/out/src/concepts/Integration__.js +0 -143
- package/out/src/concepts/Integration__.js.map +0 -1
- package/out/src/concepts/InterfaceParam__.d.ts +0 -110
- package/out/src/concepts/InterfaceParam__.js +0 -261
- package/out/src/concepts/InterfaceParam__.js.map +0 -1
- package/out/src/concepts/Interface__.d.ts +0 -303
- package/out/src/concepts/Interface__.js +0 -811
- package/out/src/concepts/Interface__.js.map +0 -1
- package/out/src/concepts/JSBlock__.d.ts +0 -33
- package/out/src/concepts/JSBlock__.js +0 -106
- package/out/src/concepts/JSBlock__.js.map +0 -1
- package/out/src/concepts/JavaLogic__.d.ts +0 -42
- package/out/src/concepts/JavaLogic__.js +0 -122
- package/out/src/concepts/JavaLogic__.js.map +0 -1
- package/out/src/concepts/LogicItem__.d.ts +0 -145
- package/out/src/concepts/LogicItem__.js +0 -274
- package/out/src/concepts/LogicItem__.js.map +0 -1
- package/out/src/concepts/Logic__.d.ts +0 -643
- package/out/src/concepts/Logic__.js +0 -1623
- package/out/src/concepts/Logic__.js.map +0 -1
- package/out/src/concepts/MatchCase__.d.ts +0 -257
- package/out/src/concepts/MatchCase__.js +0 -592
- package/out/src/concepts/MatchCase__.js.map +0 -1
- package/out/src/concepts/Match__.d.ts +0 -122
- package/out/src/concepts/Match__.js +0 -616
- package/out/src/concepts/Match__.js.map +0 -1
- package/out/src/concepts/MemberExpression__.d.ts +0 -72
- package/out/src/concepts/MemberExpression__.js +0 -318
- package/out/src/concepts/MemberExpression__.js.map +0 -1
- package/out/src/concepts/MicroApp__.d.ts +0 -51
- package/out/src/concepts/MicroApp__.js +0 -113
- package/out/src/concepts/MicroApp__.js.map +0 -1
- package/out/src/concepts/Module__.d.ts +0 -975
- package/out/src/concepts/Module__.js +0 -1371
- package/out/src/concepts/Module__.js.map +0 -1
- package/out/src/concepts/MsgTriggerEvent__.d.ts +0 -137
- package/out/src/concepts/MsgTriggerEvent__.js +0 -228
- package/out/src/concepts/MsgTriggerEvent__.js.map +0 -1
- package/out/src/concepts/MsgTriggerLauncher__.d.ts +0 -118
- package/out/src/concepts/MsgTriggerLauncher__.js +0 -204
- package/out/src/concepts/MsgTriggerLauncher__.js.map +0 -1
- package/out/src/concepts/Namespace__.d.ts +0 -1068
- package/out/src/concepts/Namespace__.js +0 -1377
- package/out/src/concepts/Namespace__.js.map +0 -1
- package/out/src/concepts/NewComposite__.d.ts +0 -345
- package/out/src/concepts/NewComposite__.js +0 -1086
- package/out/src/concepts/NewComposite__.js.map +0 -1
- package/out/src/concepts/NewList__.d.ts +0 -132
- package/out/src/concepts/NewList__.js +0 -378
- package/out/src/concepts/NewList__.js.map +0 -1
- package/out/src/concepts/NewMap__.d.ts +0 -223
- package/out/src/concepts/NewMap__.js +0 -522
- package/out/src/concepts/NewMap__.js.map +0 -1
- package/out/src/concepts/New__.d.ts +0 -20
- package/out/src/concepts/New__.js +0 -69
- package/out/src/concepts/New__.js.map +0 -1
- package/out/src/concepts/NullLiteral__.d.ts +0 -26
- package/out/src/concepts/NullLiteral__.js +0 -82
- package/out/src/concepts/NullLiteral__.js.map +0 -1
- package/out/src/concepts/NumericLiteral__.d.ts +0 -55
- package/out/src/concepts/NumericLiteral__.js +0 -173
- package/out/src/concepts/NumericLiteral__.js.map +0 -1
- package/out/src/concepts/OqlQueryComponent__.d.ts +0 -72
- package/out/src/concepts/OqlQueryComponent__.js +0 -323
- package/out/src/concepts/OqlQueryComponent__.js.map +0 -1
- package/out/src/concepts/OverriddenLogic__.d.ts +0 -643
- package/out/src/concepts/OverriddenLogic__.js +0 -1602
- package/out/src/concepts/OverriddenLogic__.js.map +0 -1
- package/out/src/concepts/Param__.d.ts +0 -171
- package/out/src/concepts/Param__.js +0 -446
- package/out/src/concepts/Param__.js.map +0 -1
- package/out/src/concepts/Point__.d.ts +0 -31
- package/out/src/concepts/Point__.js +0 -78
- package/out/src/concepts/Point__.js.map +0 -1
- package/out/src/concepts/ProcessComponent__.d.ts +0 -219
- package/out/src/concepts/ProcessComponent__.js +0 -336
- package/out/src/concepts/ProcessComponent__.js.map +0 -1
- package/out/src/concepts/ProcessElement__.d.ts +0 -646
- package/out/src/concepts/ProcessElement__.js +0 -1212
- package/out/src/concepts/ProcessElement__.js.map +0 -1
- package/out/src/concepts/ProcessOutcome__.d.ts +0 -31
- package/out/src/concepts/ProcessOutcome__.js +0 -90
- package/out/src/concepts/ProcessOutcome__.js.map +0 -1
- package/out/src/concepts/ProcessOutcomes__.d.ts +0 -31
- package/out/src/concepts/ProcessOutcomes__.js +0 -90
- package/out/src/concepts/ProcessOutcomes__.js.map +0 -1
- package/out/src/concepts/Process__.d.ts +0 -616
- package/out/src/concepts/Process__.js +0 -1023
- package/out/src/concepts/Process__.js.map +0 -1
- package/out/src/concepts/QueryAggregateExpression__.d.ts +0 -51
- package/out/src/concepts/QueryAggregateExpression__.js +0 -147
- package/out/src/concepts/QueryAggregateExpression__.js.map +0 -1
- package/out/src/concepts/QueryFieldExpression__.d.ts +0 -53
- package/out/src/concepts/QueryFieldExpression__.js +0 -158
- package/out/src/concepts/QueryFieldExpression__.js.map +0 -1
- package/out/src/concepts/QueryFromExpression__.d.ts +0 -96
- package/out/src/concepts/QueryFromExpression__.js +0 -195
- package/out/src/concepts/QueryFromExpression__.js.map +0 -1
- package/out/src/concepts/QueryGroupByExpression__.d.ts +0 -46
- package/out/src/concepts/QueryGroupByExpression__.js +0 -142
- package/out/src/concepts/QueryGroupByExpression__.js.map +0 -1
- package/out/src/concepts/QueryJoinExpression__.d.ts +0 -183
- package/out/src/concepts/QueryJoinExpression__.js +0 -315
- package/out/src/concepts/QueryJoinExpression__.js.map +0 -1
- package/out/src/concepts/QueryLimitExpression__.d.ts +0 -57
- package/out/src/concepts/QueryLimitExpression__.js +0 -159
- package/out/src/concepts/QueryLimitExpression__.js.map +0 -1
- package/out/src/concepts/QueryOrderByExpression__.d.ts +0 -68
- package/out/src/concepts/QueryOrderByExpression__.js +0 -172
- package/out/src/concepts/QueryOrderByExpression__.js.map +0 -1
- package/out/src/concepts/QuerySelectExpression__.d.ts +0 -203
- package/out/src/concepts/QuerySelectExpression__.js +0 -296
- package/out/src/concepts/QuerySelectExpression__.js.map +0 -1
- package/out/src/concepts/Rect__.d.ts +0 -39
- package/out/src/concepts/Rect__.js +0 -92
- package/out/src/concepts/Rect__.js.map +0 -1
- package/out/src/concepts/Return__.d.ts +0 -133
- package/out/src/concepts/Return__.js +0 -348
- package/out/src/concepts/Return__.js.map +0 -1
- package/out/src/concepts/Role__.d.ts +0 -62
- package/out/src/concepts/Role__.js +0 -168
- package/out/src/concepts/Role__.js.map +0 -1
- package/out/src/concepts/SelectMembers__.d.ts +0 -142
- package/out/src/concepts/SelectMembers__.js +0 -293
- package/out/src/concepts/SelectMembers__.js.map +0 -1
- package/out/src/concepts/Slot__.d.ts +0 -74
- package/out/src/concepts/Slot__.js +0 -160
- package/out/src/concepts/Slot__.js.map +0 -1
- package/out/src/concepts/SqlQueryComponent__.d.ts +0 -70
- package/out/src/concepts/SqlQueryComponent__.js +0 -268
- package/out/src/concepts/SqlQueryComponent__.js.map +0 -1
- package/out/src/concepts/Start__.d.ts +0 -24
- package/out/src/concepts/Start__.js +0 -74
- package/out/src/concepts/Start__.js.map +0 -1
- package/out/src/concepts/StringInterpolation__.d.ts +0 -114
- package/out/src/concepts/StringInterpolation__.js +0 -242
- package/out/src/concepts/StringInterpolation__.js.map +0 -1
- package/out/src/concepts/StringLiteral__.d.ts +0 -37
- package/out/src/concepts/StringLiteral__.js +0 -135
- package/out/src/concepts/StringLiteral__.js.map +0 -1
- package/out/src/concepts/StructureProperty__.d.ts +0 -130
- package/out/src/concepts/StructureProperty__.js +0 -297
- package/out/src/concepts/StructureProperty__.js.map +0 -1
- package/out/src/concepts/Structure__.d.ts +0 -251
- package/out/src/concepts/Structure__.js +0 -444
- package/out/src/concepts/Structure__.js.map +0 -1
- package/out/src/concepts/SwitchCase__.d.ts +0 -93
- package/out/src/concepts/SwitchCase__.js +0 -232
- package/out/src/concepts/SwitchCase__.js.map +0 -1
- package/out/src/concepts/SwitchStatement__.d.ts +0 -83
- package/out/src/concepts/SwitchStatement__.js +0 -178
- package/out/src/concepts/SwitchStatement__.js.map +0 -1
- package/out/src/concepts/Theme__.d.ts +0 -37
- package/out/src/concepts/Theme__.js +0 -89
- package/out/src/concepts/Theme__.js.map +0 -1
- package/out/src/concepts/Transactional__.d.ts +0 -87
- package/out/src/concepts/Transactional__.js +0 -166
- package/out/src/concepts/Transactional__.js.map +0 -1
- package/out/src/concepts/TriggerEvent__.d.ts +0 -120
- package/out/src/concepts/TriggerEvent__.js +0 -222
- package/out/src/concepts/TriggerEvent__.js.map +0 -1
- package/out/src/concepts/TriggerLauncher__.d.ts +0 -88
- package/out/src/concepts/TriggerLauncher__.js +0 -235
- package/out/src/concepts/TriggerLauncher__.js.map +0 -1
- package/out/src/concepts/TypeAnnotation__.d.ts +0 -293
- package/out/src/concepts/TypeAnnotation__.js +0 -878
- package/out/src/concepts/TypeAnnotation__.js.map +0 -1
- package/out/src/concepts/TypeParam__.d.ts +0 -24
- package/out/src/concepts/TypeParam__.js +0 -73
- package/out/src/concepts/TypeParam__.js.map +0 -1
- package/out/src/concepts/UnaryExpression__.d.ts +0 -48
- package/out/src/concepts/UnaryExpression__.js +0 -175
- package/out/src/concepts/UnaryExpression__.js.map +0 -1
- package/out/src/concepts/Unparsed__.d.ts +0 -31
- package/out/src/concepts/Unparsed__.js +0 -94
- package/out/src/concepts/Unparsed__.js.map +0 -1
- package/out/src/concepts/UseComponent__.d.ts +0 -31
- package/out/src/concepts/UseComponent__.js +0 -78
- package/out/src/concepts/UseComponent__.js.map +0 -1
- package/out/src/concepts/ValidationRule__.d.ts +0 -147
- package/out/src/concepts/ValidationRule__.js +0 -480
- package/out/src/concepts/ValidationRule__.js.map +0 -1
- package/out/src/concepts/Variable__.d.ts +0 -153
- package/out/src/concepts/Variable__.js +0 -401
- package/out/src/concepts/Variable__.js.map +0 -1
- package/out/src/concepts/ViewBlock__.d.ts +0 -35
- package/out/src/concepts/ViewBlock__.js +0 -85
- package/out/src/concepts/ViewBlock__.js.map +0 -1
- package/out/src/concepts/ViewComponent__.d.ts +0 -565
- package/out/src/concepts/ViewComponent__.js +0 -758
- package/out/src/concepts/ViewComponent__.js.map +0 -1
- package/out/src/concepts/ViewElement__.d.ts +0 -604
- package/out/src/concepts/ViewElement__.js +0 -1910
- package/out/src/concepts/ViewElement__.js.map +0 -1
- package/out/src/concepts/View__.d.ts +0 -713
- package/out/src/concepts/View__.js +0 -1693
- package/out/src/concepts/View__.js.map +0 -1
- package/out/src/concepts/WhileStatement__.d.ts +0 -96
- package/out/src/concepts/WhileStatement__.js +0 -211
- package/out/src/concepts/WhileStatement__.js.map +0 -1
- package/out/src/concepts/basics/stdlib/index.d.ts +0 -4
- package/out/src/concepts/basics/stdlib/index.js +0 -29
- package/out/src/concepts/basics/stdlib/index.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.auth.d.ts +0 -7
- package/out/src/concepts/basics/stdlib/nasl.auth.js +0 -164
- package/out/src/concepts/basics/stdlib/nasl.auth.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.browser.d.ts +0 -3
- package/out/src/concepts/basics/stdlib/nasl.browser.js +0 -96
- package/out/src/concepts/basics/stdlib/nasl.browser.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.collection.d.ts +0 -7
- package/out/src/concepts/basics/stdlib/nasl.collection.js +0 -52
- package/out/src/concepts/basics/stdlib/nasl.collection.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.configuration.d.ts +0 -3
- package/out/src/concepts/basics/stdlib/nasl.configuration.js +0 -33
- package/out/src/concepts/basics/stdlib/nasl.configuration.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.core.d.ts +0 -5
- package/out/src/concepts/basics/stdlib/nasl.core.js +0 -49
- package/out/src/concepts/basics/stdlib/nasl.core.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.http.d.ts +0 -7
- package/out/src/concepts/basics/stdlib/nasl.http.js +0 -167
- package/out/src/concepts/basics/stdlib/nasl.http.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.interface.d.ts +0 -7
- package/out/src/concepts/basics/stdlib/nasl.interface.js +0 -43
- package/out/src/concepts/basics/stdlib/nasl.interface.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.io.d.ts +0 -3
- package/out/src/concepts/basics/stdlib/nasl.io.js +0 -52
- package/out/src/concepts/basics/stdlib/nasl.io.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.logging.d.ts +0 -3
- package/out/src/concepts/basics/stdlib/nasl.logging.js +0 -56
- package/out/src/concepts/basics/stdlib/nasl.logging.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.process.d.ts +0 -7
- package/out/src/concepts/basics/stdlib/nasl.process.js +0 -638
- package/out/src/concepts/basics/stdlib/nasl.process.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.ui.d.ts +0 -7
- package/out/src/concepts/basics/stdlib/nasl.ui.js +0 -1018
- package/out/src/concepts/basics/stdlib/nasl.ui.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.util.d.ts +0 -3
- package/out/src/concepts/basics/stdlib/nasl.util.js +0 -2238
- package/out/src/concepts/basics/stdlib/nasl.util.js.map +0 -1
- package/out/src/concepts/basics/stdlib/nasl.validation.d.ts +0 -3
- package/out/src/concepts/basics/stdlib/nasl.validation.js +0 -565
- package/out/src/concepts/basics/stdlib/nasl.validation.js.map +0 -1
- package/out/src/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +0 -5
- package/out/src/concepts/basics/stdlib/reference2TypeAnnotationList.js +0 -26
- package/out/src/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +0 -1
- package/out/src/concepts/basics/types/coreTypeList.d.ts +0 -2
- package/out/src/concepts/basics/types/coreTypeList.js +0 -15
- package/out/src/concepts/basics/types/coreTypeList.js.map +0 -1
- package/out/src/concepts/basics/types/index.d.ts +0 -16
- package/out/src/concepts/basics/types/index.js +0 -35
- package/out/src/concepts/basics/types/index.js.map +0 -1
- package/out/src/concepts/index.d.ts +0 -6
- package/out/src/concepts/index.js +0 -25
- package/out/src/concepts/index.js.map +0 -1
- package/out/src/concepts/index__.d.ts +0 -122
- package/out/src/concepts/index__.js +0 -139
- package/out/src/concepts/index__.js.map +0 -1
- package/out/src/concepts/types__.d.ts +0 -124
- package/out/src/concepts/types__.js +0 -3
- package/out/src/concepts/types__.js.map +0 -1
- package/out/src/config.d.ts +0 -43
- package/out/src/config.js +0 -72
- package/out/src/config.js.map +0 -1
- package/out/src/decorators/index.d.ts +0 -55
- package/out/src/decorators/index.js +0 -153
- package/out/src/decorators/index.js.map +0 -1
- package/out/src/enums/KEYWORDS.d.ts +0 -6
- package/out/src/enums/KEYWORDS.js +0 -1244
- package/out/src/enums/KEYWORDS.js.map +0 -1
- package/out/src/enums/LEVEL_NAME_MAP.d.ts +0 -26
- package/out/src/enums/LEVEL_NAME_MAP.js +0 -30
- package/out/src/enums/LEVEL_NAME_MAP.js.map +0 -1
- package/out/src/eventBus.d.ts +0 -3
- package/out/src/eventBus.js +0 -7
- package/out/src/eventBus.js.map +0 -1
- package/out/src/generator/compileComponent.d.ts +0 -11
- package/out/src/generator/compileComponent.js +0 -12
- package/out/src/generator/compileComponent.js.map +0 -1
- package/out/src/generator/genBundleFiles.d.ts +0 -31
- package/out/src/generator/genBundleFiles.js +0 -432
- package/out/src/generator/genBundleFiles.js.map +0 -1
- package/out/src/generator/genHash.d.ts +0 -7
- package/out/src/generator/genHash.js +0 -39
- package/out/src/generator/genHash.js.map +0 -1
- package/out/src/generator/genMetaData.d.ts +0 -31
- package/out/src/generator/genMetaData.js +0 -274
- package/out/src/generator/genMetaData.js.map +0 -1
- package/out/src/generator/genReleaseBody.d.ts +0 -70
- package/out/src/generator/genReleaseBody.js +0 -268
- package/out/src/generator/genReleaseBody.js.map +0 -1
- package/out/src/generator/icestark.d.ts +0 -2
- package/out/src/generator/icestark.js +0 -48
- package/out/src/generator/icestark.js.map +0 -1
- package/out/src/generator/index.d.ts +0 -7
- package/out/src/generator/index.js +0 -24
- package/out/src/generator/index.js.map +0 -1
- package/out/src/generator/microApp.d.ts +0 -2
- package/out/src/generator/microApp.js +0 -35
- package/out/src/generator/microApp.js.map +0 -1
- package/out/src/generator/permission.d.ts +0 -10
- package/out/src/generator/permission.js +0 -267
- package/out/src/generator/permission.js.map +0 -1
- package/out/src/generator/qiankun.d.ts +0 -2
- package/out/src/generator/qiankun.js +0 -52
- package/out/src/generator/qiankun.js.map +0 -1
- package/out/src/generator/styleReplacer.d.ts +0 -3
- package/out/src/generator/styleReplacer.js +0 -71
- package/out/src/generator/styleReplacer.js.map +0 -1
- package/out/src/index.d.ts +0 -14
- package/out/src/index.js +0 -65
- package/out/src/index.js.map +0 -1
- package/out/src/manager/diagnostic.d.ts +0 -35
- package/out/src/manager/diagnostic.js +0 -63
- package/out/src/manager/diagnostic.js.map +0 -1
- package/out/src/manager/stepRecorder.d.ts +0 -20
- package/out/src/manager/stepRecorder.js +0 -110
- package/out/src/manager/stepRecorder.js.map +0 -1
- package/out/src/sentry/index.d.ts +0 -33
- package/out/src/sentry/index.js +0 -141
- package/out/src/sentry/index.js.map +0 -1
- package/out/src/server/createUiTs.d.ts +0 -16
- package/out/src/server/createUiTs.js +0 -248
- package/out/src/server/createUiTs.js.map +0 -1
- package/out/src/server/entity2LogicNamespace.d.ts +0 -10
- package/out/src/server/entity2LogicNamespace.js +0 -380
- package/out/src/server/entity2LogicNamespace.js.map +0 -1
- package/out/src/server/event.d.ts +0 -18
- package/out/src/server/event.js +0 -127
- package/out/src/server/event.js.map +0 -1
- package/out/src/server/extendBaseNode.d.ts +0 -1
- package/out/src/server/extendBaseNode.js +0 -528
- package/out/src/server/extendBaseNode.js.map +0 -1
- package/out/src/server/formatTsUtils.d.ts +0 -37
- package/out/src/server/formatTsUtils.js +0 -857
- package/out/src/server/formatTsUtils.js.map +0 -1
- package/out/src/server/getConnector.d.ts +0 -11
- package/out/src/server/getConnector.js +0 -42
- package/out/src/server/getConnector.js.map +0 -1
- package/out/src/server/getExtensionModules.d.ts +0 -3
- package/out/src/server/getExtensionModules.js +0 -34
- package/out/src/server/getExtensionModules.js.map +0 -1
- package/out/src/server/getFunctions.d.ts +0 -3
- package/out/src/server/getFunctions.js +0 -20
- package/out/src/server/getFunctions.js.map +0 -1
- package/out/src/server/getInterfaces.d.ts +0 -2
- package/out/src/server/getInterfaces.js +0 -48
- package/out/src/server/getInterfaces.js.map +0 -1
- package/out/src/server/getLogging.d.ts +0 -1
- package/out/src/server/getLogging.js +0 -9
- package/out/src/server/getLogging.js.map +0 -1
- package/out/src/server/getLogics.d.ts +0 -4
- package/out/src/server/getLogics.js +0 -335
- package/out/src/server/getLogics.js.map +0 -1
- package/out/src/server/getMemberIdentifier.d.ts +0 -16
- package/out/src/server/getMemberIdentifier.js +0 -317
- package/out/src/server/getMemberIdentifier.js.map +0 -1
- package/out/src/server/getProcessComponents.d.ts +0 -2
- package/out/src/server/getProcessComponents.js +0 -13
- package/out/src/server/getProcessComponents.js.map +0 -1
- package/out/src/server/getProcesses.d.ts +0 -33
- package/out/src/server/getProcesses.js +0 -605
- package/out/src/server/getProcesses.js.map +0 -1
- package/out/src/server/getScope.d.ts +0 -13
- package/out/src/server/getScope.js +0 -61
- package/out/src/server/getScope.js.map +0 -1
- package/out/src/server/getValidates.d.ts +0 -3
- package/out/src/server/getValidates.js +0 -14
- package/out/src/server/getValidates.js.map +0 -1
- package/out/src/server/index.d.ts +0 -5
- package/out/src/server/index.js +0 -41
- package/out/src/server/index.js.map +0 -1
- package/out/src/server/naslServer.d.ts +0 -357
- package/out/src/server/naslServer.js +0 -4369
- package/out/src/server/naslServer.js.map +0 -1
- package/out/src/server/naslStdlibMap.d.ts +0 -2
- package/out/src/server/naslStdlibMap.js +0 -50
- package/out/src/server/naslStdlibMap.js.map +0 -1
- package/out/src/server/process2LogicNamespace.d.ts +0 -26
- package/out/src/server/process2LogicNamespace.js +0 -109
- package/out/src/server/process2LogicNamespace.js.map +0 -1
- package/out/src/server/translator.d.ts +0 -26
- package/out/src/server/translator.js +0 -805
- package/out/src/server/translator.js.map +0 -1
- package/out/src/service/creator/add.configs.d.ts +0 -1
- package/out/src/service/creator/add.configs.js +0 -74
- package/out/src/service/creator/add.configs.js.map +0 -1
- package/out/src/service/creator/errHandles.d.ts +0 -18
- package/out/src/service/creator/errHandles.js +0 -75
- package/out/src/service/creator/errHandles.js.map +0 -1
- package/out/src/service/creator/index.d.ts +0 -1
- package/out/src/service/creator/index.js +0 -74
- package/out/src/service/creator/index.js.map +0 -1
- package/out/src/service/datasource/api.d.ts +0 -12
- package/out/src/service/datasource/api.js +0 -14
- package/out/src/service/datasource/api.js.map +0 -1
- package/out/src/service/datasource/index.d.ts +0 -2
- package/out/src/service/datasource/index.js +0 -10
- package/out/src/service/datasource/index.js.map +0 -1
- package/out/src/service/defaultErrorMessage.json +0 -98
- package/out/src/service/logic/api.d.ts +0 -9
- package/out/src/service/logic/api.js +0 -11
- package/out/src/service/logic/api.js.map +0 -1
- package/out/src/service/logic/checktypeSocket.d.ts +0 -5
- package/out/src/service/logic/checktypeSocket.js +0 -55
- package/out/src/service/logic/checktypeSocket.js.map +0 -1
- package/out/src/service/logic/index.d.ts +0 -2
- package/out/src/service/logic/index.js +0 -10
- package/out/src/service/logic/index.js.map +0 -1
- package/out/src/service/storage/api.d.ts +0 -54
- package/out/src/service/storage/api.js +0 -42
- package/out/src/service/storage/api.js.map +0 -1
- package/out/src/service/storage/index.d.ts +0 -2
- package/out/src/service/storage/index.js +0 -10
- package/out/src/service/storage/index.js.map +0 -1
- package/out/src/service/storage/init.d.ts +0 -68
- package/out/src/service/storage/init.js +0 -784
- package/out/src/service/storage/init.js.map +0 -1
- package/out/src/service/storage/jsoner.d.ts +0 -36
- package/out/src/service/storage/jsoner.js +0 -131
- package/out/src/service/storage/jsoner.js.map +0 -1
- package/out/src/service/storage/map.d.ts +0 -4
- package/out/src/service/storage/map.js +0 -54
- package/out/src/service/storage/map.js.map +0 -1
- package/out/src/service/storage/service.d.ts +0 -25
- package/out/src/service/storage/service.js +0 -80
- package/out/src/service/storage/service.js.map +0 -1
- package/out/src/service/storage/storagePoint.d.ts +0 -17
- package/out/src/service/storage/storagePoint.js +0 -76
- package/out/src/service/storage/storagePoint.js.map +0 -1
- package/out/src/service/video/BaseService.d.ts +0 -7
- package/out/src/service/video/BaseService.js +0 -61
- package/out/src/service/video/BaseService.js.map +0 -1
- package/out/src/service/video/MainCallbackService.d.ts +0 -12
- package/out/src/service/video/MainCallbackService.js +0 -183
- package/out/src/service/video/MainCallbackService.js.map +0 -1
- package/out/src/service/video/VideoTranscribe.d.ts +0 -15
- package/out/src/service/video/VideoTranscribe.js +0 -96
- package/out/src/service/video/VideoTranscribe.js.map +0 -1
- package/out/src/service/video/publishService.d.ts +0 -1
- package/out/src/service/video/publishService.js +0 -58
- package/out/src/service/video/publishService.js.map +0 -1
- package/out/src/templator/genCallComponentLogic.d.ts +0 -17
- package/out/src/templator/genCallComponentLogic.js +0 -30
- package/out/src/templator/genCallComponentLogic.js.map +0 -1
- package/out/src/templator/genCreateBlock.d.ts +0 -10
- package/out/src/templator/genCreateBlock.js +0 -336
- package/out/src/templator/genCreateBlock.js.map +0 -1
- package/out/src/templator/genCurdEditMultipleKeyBlock.d.ts +0 -8
- package/out/src/templator/genCurdEditMultipleKeyBlock.js +0 -514
- package/out/src/templator/genCurdEditMultipleKeyBlock.js.map +0 -1
- package/out/src/templator/genCurdMultipleKeyBlock.d.ts +0 -34
- package/out/src/templator/genCurdMultipleKeyBlock.js +0 -707
- package/out/src/templator/genCurdMultipleKeyBlock.js.map +0 -1
- package/out/src/templator/genEditTableBlock.d.ts +0 -51
- package/out/src/templator/genEditTableBlock.js +0 -299
- package/out/src/templator/genEditTableBlock.js.map +0 -1
- package/out/src/templator/genEnumSelectBlock.d.ts +0 -10
- package/out/src/templator/genEnumSelectBlock.js +0 -26
- package/out/src/templator/genEnumSelectBlock.js.map +0 -1
- package/out/src/templator/genGetBlock.d.ts +0 -6
- package/out/src/templator/genGetBlock.js +0 -138
- package/out/src/templator/genGetBlock.js.map +0 -1
- package/out/src/templator/genGridViewBlock.d.ts +0 -55
- package/out/src/templator/genGridViewBlock.js +0 -350
- package/out/src/templator/genGridViewBlock.js.map +0 -1
- package/out/src/templator/genListViewBlock.d.ts +0 -19
- package/out/src/templator/genListViewBlock.js +0 -143
- package/out/src/templator/genListViewBlock.js.map +0 -1
- package/out/src/templator/genQueryComponent.d.ts +0 -34
- package/out/src/templator/genQueryComponent.js +0 -342
- package/out/src/templator/genQueryComponent.js.map +0 -1
- package/out/src/templator/genSelectBlock.d.ts +0 -45
- package/out/src/templator/genSelectBlock.js +0 -406
- package/out/src/templator/genSelectBlock.js.map +0 -1
- package/out/src/templator/genTableBlock.d.ts +0 -53
- package/out/src/templator/genTableBlock.js +0 -280
- package/out/src/templator/genTableBlock.js.map +0 -1
- package/out/src/templator/genUpdateBlock.d.ts +0 -6
- package/out/src/templator/genUpdateBlock.js +0 -378
- package/out/src/templator/genUpdateBlock.js.map +0 -1
- package/out/src/templator/index.d.ts +0 -17
- package/out/src/templator/index.js +0 -38
- package/out/src/templator/index.js.map +0 -1
- package/out/src/templator/utils.d.ts +0 -676
- package/out/src/templator/utils.js +0 -459
- package/out/src/templator/utils.js.map +0 -1
- package/out/src/test/fixtures/env.d.ts +0 -5
- package/out/src/test/fixtures/env.js +0 -20
- package/out/src/test/fixtures/env.js.map +0 -1
- package/out/src/test/integration/connect-create-file.d.ts +0 -1
- package/out/src/test/integration/connect-create-file.js +0 -39
- package/out/src/test/integration/connect-create-file.js.map +0 -1
- package/out/src/test/integration/connect-file.d.ts +0 -1
- package/out/src/test/integration/connect-file.js +0 -49
- package/out/src/test/integration/connect-file.js.map +0 -1
- package/out/src/test/integration/node-nasl-server.d.ts +0 -1
- package/out/src/test/integration/node-nasl-server.js +0 -13
- package/out/src/test/integration/node-nasl-server.js.map +0 -1
- package/out/src/test/units/baseTypes/Assignment.spec.d.ts +0 -1
- package/out/src/test/units/baseTypes/Assignment.spec.js +0 -43
- package/out/src/test/units/baseTypes/Assignment.spec.js.map +0 -1
- package/out/src/test/units/baseTypes/CallLogic.spec.d.ts +0 -1
- package/out/src/test/units/baseTypes/CallLogic.spec.js +0 -44
- package/out/src/test/units/baseTypes/CallLogic.spec.js.map +0 -1
- package/out/src/test/units/baseTypes/StringLiteral.spec.d.ts +0 -1
- package/out/src/test/units/baseTypes/StringLiteral.spec.js +0 -75
- package/out/src/test/units/baseTypes/StringLiteral.spec.js.map +0 -1
- package/out/src/test/units/baseTypes/new.spec.d.ts +0 -1
- package/out/src/test/units/baseTypes/new.spec.js +0 -37
- package/out/src/test/units/baseTypes/new.spec.js.map +0 -1
- package/out/src/test/units/common/Vertex.spec.d.ts +0 -1
- package/out/src/test/units/common/Vertex.spec.js +0 -22
- package/out/src/test/units/common/Vertex.spec.js.map +0 -1
- package/out/src/test/units/data/Entity.spec.d.ts +0 -1
- package/out/src/test/units/data/Entity.spec.js +0 -12
- package/out/src/test/units/data/Entity.spec.js.map +0 -1
- package/out/src/test/units/login.spec.d.ts +0 -1
- package/out/src/test/units/login.spec.js +0 -12
- package/out/src/test/units/login.spec.js.map +0 -1
- package/out/src/test/units/page/Block.spec.d.ts +0 -0
- package/out/src/test/units/page/Block.spec.js +0 -13
- package/out/src/test/units/page/Block.spec.js.map +0 -1
- package/out/src/test/units/page/Element.spec.d.ts +0 -1
- package/out/src/test/units/page/Element.spec.js +0 -44
- package/out/src/test/units/page/Element.spec.js.map +0 -1
- package/out/src/test/units/temp/temp.spec.d.ts +0 -1
- package/out/src/test/units/temp/temp.spec.js +0 -68
- package/out/src/test/units/temp/temp.spec.js.map +0 -1
- package/out/src/translator/index.d.ts +0 -48
- package/out/src/translator/index.js +0 -114
- package/out/src/translator/index.js.map +0 -1
- package/out/src/translator/lsp.d.ts +0 -45
- package/out/src/translator/lsp.js +0 -6
- package/out/src/translator/lsp.js.map +0 -1
- package/out/src/translator/tsp.d.ts +0 -12
- package/out/src/translator/tsp.js +0 -3
- package/out/src/translator/tsp.js.map +0 -1
- package/out/src/utils/index.d.ts +0 -39
- package/out/src/utils/index.js +0 -191
- package/out/src/utils/index.js.map +0 -1
- package/out/src/utils/logger.d.ts +0 -3
- package/out/src/utils/logger.js +0 -11
- package/out/src/utils/logger.js.map +0 -1
- package/out/src/utils/sortTsString.d.ts +0 -1
- package/out/src/utils/sortTsString.js +0 -36
- package/out/src/utils/sortTsString.js.map +0 -1
- package/out/src/utils/string.d.ts +0 -51
- package/out/src/utils/string.js +0 -110
- package/out/src/utils/string.js.map +0 -1
- package/out/src/utils/traverse.d.ts +0 -36
- package/out/src/utils/traverse.js +0 -145
- package/out/src/utils/traverse.js.map +0 -1
- package/out/test/concepts/utils.d.ts +0 -2
- package/out/test/concepts/utils.js +0 -20
- package/out/test/concepts/utils.js.map +0 -1
- package/out/test/concepts/validation-rule/toEmbeddedTS.spec.d.ts +0 -1
- package/out/test/concepts/validation-rule/toEmbeddedTS.spec.js +0 -23
- package/out/test/concepts/validation-rule/toEmbeddedTS.spec.js.map +0 -1
- package/out/test/setup.d.ts +0 -1
- package/out/test/setup.js +0 -6
- package/out/test/setup.js.map +0 -1
|
@@ -1,1910 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
-
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
-
};
|
|
34
|
-
var ViewElement_1;
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ViewElement = void 0;
|
|
37
|
-
const translator_1 = require("../translator");
|
|
38
|
-
const concepts_1 = require("../concepts");
|
|
39
|
-
const babelParser = __importStar(require("@babel/parser"));
|
|
40
|
-
const json5 = __importStar(require("json5"));
|
|
41
|
-
const compiler = __importStar(require("vue-template-compiler"));
|
|
42
|
-
const LogicItem__1 = __importDefault(require("./LogicItem__"));
|
|
43
|
-
const utils_1 = require("../utils");
|
|
44
|
-
const __1 = require("..");
|
|
45
|
-
const MemberExpression__1 = __importDefault(require("./MemberExpression__"));
|
|
46
|
-
const Identifier__1 = __importDefault(require("./Identifier__"));
|
|
47
|
-
/**
|
|
48
|
-
* 自闭合标签
|
|
49
|
-
*/
|
|
50
|
-
const selfClosingTag = [
|
|
51
|
-
'base',
|
|
52
|
-
'meta',
|
|
53
|
-
'area',
|
|
54
|
-
'embed',
|
|
55
|
-
'link',
|
|
56
|
-
'img',
|
|
57
|
-
'input',
|
|
58
|
-
'param',
|
|
59
|
-
'hr',
|
|
60
|
-
'br',
|
|
61
|
-
'source',
|
|
62
|
-
'track',
|
|
63
|
-
'wbr',
|
|
64
|
-
'col',
|
|
65
|
-
];
|
|
66
|
-
function genArgumentMemberExpression(arr) {
|
|
67
|
-
let expressionNode;
|
|
68
|
-
const propertyName = arr.pop();
|
|
69
|
-
if (arr.length >= 1) {
|
|
70
|
-
expressionNode = {
|
|
71
|
-
concept: 'MemberExpression',
|
|
72
|
-
name: '',
|
|
73
|
-
kind: 'Expression',
|
|
74
|
-
object: genArgumentMemberExpression(arr),
|
|
75
|
-
property: {
|
|
76
|
-
concept: 'Identifier',
|
|
77
|
-
kind: 'Expression',
|
|
78
|
-
name: propertyName,
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
return {
|
|
84
|
-
concept: 'Identifier',
|
|
85
|
-
kind: 'Expression',
|
|
86
|
-
name: propertyName,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
return expressionNode;
|
|
90
|
-
}
|
|
91
|
-
function transAstNodeToNaslNode(astNode, namespace) {
|
|
92
|
-
let node = null;
|
|
93
|
-
if (astNode.type === 'CallExpression' && astNode.callee.object.name === '$utils') {
|
|
94
|
-
const calleeName = astNode.callee.property.name || astNode.callee.property.value;
|
|
95
|
-
node = {
|
|
96
|
-
concept: 'CallFunction',
|
|
97
|
-
name: '',
|
|
98
|
-
label: '调用内置函数',
|
|
99
|
-
kind: 'Expression',
|
|
100
|
-
calleeNamespace: 'nasl.util',
|
|
101
|
-
calleeName,
|
|
102
|
-
arguments: astNode.arguments.map((argument) => ({
|
|
103
|
-
concept: 'Argument',
|
|
104
|
-
name: '',
|
|
105
|
-
kind: 'Statement',
|
|
106
|
-
keyword: '',
|
|
107
|
-
expression: transAstNodeToNaslNode(Object.assign({}, argument)),
|
|
108
|
-
})).filter((item) => item.expression),
|
|
109
|
-
typeArguments: astNode.arguments.map((argument) => (transAstNodeToNaslTypeNode(Object.assign({}, argument)))).filter((item) => item),
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
else if (astNode.type === 'MemberExpression') {
|
|
113
|
-
if (astNode.object?.name === '$global') {
|
|
114
|
-
if (astNode.property?.name === 'userInfo') {
|
|
115
|
-
// 目前只有权限相关的
|
|
116
|
-
node = transAstNodeToNaslNode(astNode.property, 'nasl.auth');
|
|
117
|
-
}
|
|
118
|
-
else if (astNode.property?.name === 'frontendVariables') {
|
|
119
|
-
node = 'app.frontendVariables';
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
else if (astNode.object?.name === 'frontendVariables') {
|
|
123
|
-
node = transAstNodeToNaslNode(astNode.property, 'app.frontendVariables');
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
const object = transAstNodeToNaslNode(astNode.object);
|
|
127
|
-
// object如果返回字符串,则将它当成namespace处理
|
|
128
|
-
if (Object.prototype.toString.call(object) === '[object String]') {
|
|
129
|
-
node = transAstNodeToNaslNode(astNode.property, object);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
const property = transAstNodeToNaslNode(astNode.property);
|
|
133
|
-
node = {
|
|
134
|
-
concept: 'MemberExpression',
|
|
135
|
-
name: '',
|
|
136
|
-
kind: 'Expression',
|
|
137
|
-
object,
|
|
138
|
-
property,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
else if (astNode.type === 'Identifier') {
|
|
144
|
-
node = {
|
|
145
|
-
concept: 'Identifier',
|
|
146
|
-
namespace: namespace || '',
|
|
147
|
-
name: astNode.name,
|
|
148
|
-
kind: 'Expression',
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
else if (astNode.type === 'ArrayExpression' || astNode.type === 'ObjectExpression') {
|
|
152
|
-
node = {
|
|
153
|
-
concept: 'Unparsed',
|
|
154
|
-
label: '原子项',
|
|
155
|
-
code: astNode.value,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
else if (astNode.type === 'StringLiteral') {
|
|
159
|
-
// 单独特殊处理枚举因为他不是MemberExpression,而是Identifier_
|
|
160
|
-
if (astNode?.value?.startsWith('__enumTypeAnnotation_')) {
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
node = {
|
|
165
|
-
concept: 'StringLiteral',
|
|
166
|
-
kind: 'Expression',
|
|
167
|
-
name: '',
|
|
168
|
-
value: astNode.value,
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
else if (astNode.type === 'UnaryExpression') {
|
|
173
|
-
const argument = astNode.argument;
|
|
174
|
-
if (argument.type === 'NumericLiteral') {
|
|
175
|
-
node = {
|
|
176
|
-
concept: 'NumericLiteral',
|
|
177
|
-
value: astNode.operator + argument.value,
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
node = {
|
|
182
|
-
concept: 'UnaryExpression',
|
|
183
|
-
kind: 'Expression',
|
|
184
|
-
name: '',
|
|
185
|
-
operator: astNode.operator,
|
|
186
|
-
argument: transAstNodeToNaslNode(astNode.argument),
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
else if (astNode.type === 'NumericLiteral') {
|
|
191
|
-
const numberString = typeof astNode.value === 'number' ? astNode.value.toString() : astNode.value;
|
|
192
|
-
node = {
|
|
193
|
-
concept: 'NumericLiteral',
|
|
194
|
-
value: numberString,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
node = astNode;
|
|
199
|
-
node.concept = astNode.type;
|
|
200
|
-
}
|
|
201
|
-
return node;
|
|
202
|
-
}
|
|
203
|
-
function transAstNodeToNaslTypeNode(astNode, namespace) {
|
|
204
|
-
let node = null;
|
|
205
|
-
// 单独特殊处理枚举因为他不是MemberExpression,而是Identifier_
|
|
206
|
-
if (astNode?.value?.startsWith('__enumTypeAnnotation_')) {
|
|
207
|
-
const valueArr = astNode.value.replace('__enumTypeAnnotation_', '')?.split('.');
|
|
208
|
-
const name = valueArr.pop();
|
|
209
|
-
const namespace = valueArr.join('.');
|
|
210
|
-
node = {
|
|
211
|
-
concept: 'TypeAnnotation',
|
|
212
|
-
typeNamespace: namespace || '',
|
|
213
|
-
typeName: name || '',
|
|
214
|
-
typeKind: 'reference',
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
return node;
|
|
218
|
-
}
|
|
219
|
-
const decorators_1 = require("../decorators");
|
|
220
|
-
const utils = __importStar(require("../utils"));
|
|
221
|
-
const BaseNode_1 = __importDefault(require("../common/BaseNode"));
|
|
222
|
-
const classMap_1 = __importDefault(require("../common/classMap"));
|
|
223
|
-
const BindAttribute__1 = __importDefault(require("./BindAttribute__"));
|
|
224
|
-
const BindEvent__1 = __importDefault(require("./BindEvent__"));
|
|
225
|
-
const BindDirective__1 = __importDefault(require("./BindDirective__"));
|
|
226
|
-
const BindStyle__1 = __importDefault(require("./BindStyle__"));
|
|
227
|
-
/**
|
|
228
|
-
* 页面元素
|
|
229
|
-
*/
|
|
230
|
-
let ViewElement = ViewElement_1 = class ViewElement extends BaseNode_1.default {
|
|
231
|
-
/**
|
|
232
|
-
* 产品概念
|
|
233
|
-
*/
|
|
234
|
-
concept = 'ViewElement';
|
|
235
|
-
/**
|
|
236
|
-
* 类型
|
|
237
|
-
*/
|
|
238
|
-
type = undefined;
|
|
239
|
-
/**
|
|
240
|
-
* 元素标签
|
|
241
|
-
*/
|
|
242
|
-
tag = undefined;
|
|
243
|
-
/**
|
|
244
|
-
* 页面元素名称
|
|
245
|
-
*/
|
|
246
|
-
name = undefined;
|
|
247
|
-
/**
|
|
248
|
-
* 静态 class 名
|
|
249
|
-
*/
|
|
250
|
-
staticClass = undefined;
|
|
251
|
-
/**
|
|
252
|
-
* 静态 style
|
|
253
|
-
*/
|
|
254
|
-
staticStyle = undefined;
|
|
255
|
-
/**
|
|
256
|
-
* 权限资源描述
|
|
257
|
-
*/
|
|
258
|
-
authDescription = undefined;
|
|
259
|
-
/**
|
|
260
|
-
* 插槽目标
|
|
261
|
-
*/
|
|
262
|
-
slotTarget = undefined;
|
|
263
|
-
/**
|
|
264
|
-
* 插槽 scope 表达式
|
|
265
|
-
*/
|
|
266
|
-
slotScope = undefined;
|
|
267
|
-
/**
|
|
268
|
-
* 元素绑定属性列表
|
|
269
|
-
*/
|
|
270
|
-
bindAttrs = [];
|
|
271
|
-
/**
|
|
272
|
-
* 元素绑定事件列表
|
|
273
|
-
*/
|
|
274
|
-
bindEvents = [];
|
|
275
|
-
/**
|
|
276
|
-
* 元素指令列表
|
|
277
|
-
*/
|
|
278
|
-
bindDirectives = [];
|
|
279
|
-
/**
|
|
280
|
-
* 绑定的角色
|
|
281
|
-
*/
|
|
282
|
-
bindRoles = [];
|
|
283
|
-
/**
|
|
284
|
-
* 元素绑定样式列表
|
|
285
|
-
*/
|
|
286
|
-
bindStyles = [];
|
|
287
|
-
/**
|
|
288
|
-
* 子元素列表
|
|
289
|
-
*/
|
|
290
|
-
children = [];
|
|
291
|
-
/**
|
|
292
|
-
* 祖先 View
|
|
293
|
-
*/
|
|
294
|
-
get view() {
|
|
295
|
-
return this.getAncestor('View');
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* 祖先 Module
|
|
299
|
-
*/
|
|
300
|
-
get module() {
|
|
301
|
-
return this.getAncestor('Module');
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* 祖先 App
|
|
305
|
-
*/
|
|
306
|
-
get app() {
|
|
307
|
-
return this.getAncestor('App');
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* 祖先 Frontend
|
|
311
|
-
*/
|
|
312
|
-
get frontend() {
|
|
313
|
-
return this.getAncestor('Frontend');
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* @param source 需要合并的部分参数
|
|
317
|
-
*/
|
|
318
|
-
constructor(source) {
|
|
319
|
-
source = Object.assign({}, ViewElement_1.getDefaultOptions(), source);
|
|
320
|
-
super(source);
|
|
321
|
-
super.subConstructor(source);
|
|
322
|
-
}
|
|
323
|
-
getClassName() {
|
|
324
|
-
return 'ViewElement';
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* 从父级删除该节点
|
|
328
|
-
* @internal
|
|
329
|
-
*/
|
|
330
|
-
_delete() {
|
|
331
|
-
let params = null;
|
|
332
|
-
if (this.parentNode) {
|
|
333
|
-
params = this.parentNode?.__removeViewElement?.(this);
|
|
334
|
-
}
|
|
335
|
-
return params;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* 设置页面元素名称
|
|
339
|
-
*/
|
|
340
|
-
setName(name) {
|
|
341
|
-
const object = {
|
|
342
|
-
name,
|
|
343
|
-
};
|
|
344
|
-
this.update({
|
|
345
|
-
...object,
|
|
346
|
-
field: 'name',
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* 设置静态 style
|
|
351
|
-
*/
|
|
352
|
-
setStaticStyle(staticStyle) {
|
|
353
|
-
const object = {
|
|
354
|
-
staticStyle,
|
|
355
|
-
};
|
|
356
|
-
this.update({
|
|
357
|
-
...object,
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* 设置权限资源描述
|
|
362
|
-
*/
|
|
363
|
-
setAuthDescription(authDescription) {
|
|
364
|
-
const object = {
|
|
365
|
-
authDescription,
|
|
366
|
-
};
|
|
367
|
-
this.update({
|
|
368
|
-
...object,
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
getBindAttributeExistingNames(excludedList = []) {
|
|
372
|
-
const excludedSet = new Set(excludedList);
|
|
373
|
-
return (this.bindAttrs || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
374
|
-
}
|
|
375
|
-
getBindAttributeUniqueName(name = 'bindAttribute1') {
|
|
376
|
-
return utils.unique(name, this.getBindAttributeExistingNames(), undefined, false);
|
|
377
|
-
}
|
|
378
|
-
_insertBindAttributeAt(options, index) {
|
|
379
|
-
const bindAttributeOptions = {};
|
|
380
|
-
const relationOptions = { parentNode: this, parentKey: 'bindAttrs' };
|
|
381
|
-
let bindAttribute;
|
|
382
|
-
if (!options) {
|
|
383
|
-
bindAttribute = BindAttribute__1.default.from({
|
|
384
|
-
...bindAttributeOptions,
|
|
385
|
-
name: this.getBindAttributeUniqueName(),
|
|
386
|
-
}, this, 'bindAttrs');
|
|
387
|
-
}
|
|
388
|
-
else if (typeof options === 'string') {
|
|
389
|
-
bindAttribute = BindAttribute__1.default.from({
|
|
390
|
-
...bindAttributeOptions,
|
|
391
|
-
name: options,
|
|
392
|
-
}, this, 'bindAttrs');
|
|
393
|
-
}
|
|
394
|
-
else if (options instanceof BindAttribute__1.default) {
|
|
395
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
396
|
-
bindAttribute = options;
|
|
397
|
-
Object.assign(bindAttribute, relationOptions);
|
|
398
|
-
}
|
|
399
|
-
else {
|
|
400
|
-
bindAttribute = BindAttribute__1.default.from({
|
|
401
|
-
...bindAttributeOptions,
|
|
402
|
-
...options,
|
|
403
|
-
}, this, 'bindAttrs');
|
|
404
|
-
}
|
|
405
|
-
this.bindAttrs.splice(index, 0, bindAttribute);
|
|
406
|
-
return bindAttribute;
|
|
407
|
-
}
|
|
408
|
-
insertBindAttributeAt(options, index) {
|
|
409
|
-
const node = this._insertBindAttributeAt(options, index);
|
|
410
|
-
node.create({
|
|
411
|
-
index,
|
|
412
|
-
parentNode: this,
|
|
413
|
-
parentKey: 'bindAttrs',
|
|
414
|
-
});
|
|
415
|
-
return node;
|
|
416
|
-
}
|
|
417
|
-
_addBindAttribute(options) {
|
|
418
|
-
const index = this.bindAttrs.length;
|
|
419
|
-
return this._insertBindAttributeAt(options, index);
|
|
420
|
-
}
|
|
421
|
-
addBindAttribute(options) {
|
|
422
|
-
const node = this._addBindAttribute(options);
|
|
423
|
-
const index = this.bindAttrs.indexOf(node);
|
|
424
|
-
node.create({
|
|
425
|
-
index,
|
|
426
|
-
parentNode: this,
|
|
427
|
-
parentKey: 'bindAttrs',
|
|
428
|
-
});
|
|
429
|
-
return node;
|
|
430
|
-
}
|
|
431
|
-
getBindEventExistingNames(excludedList = []) {
|
|
432
|
-
const excludedSet = new Set(excludedList);
|
|
433
|
-
return (this.bindEvents || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
434
|
-
}
|
|
435
|
-
getBindEventUniqueName(name = 'bindEvent1') {
|
|
436
|
-
return utils.unique(name, this.getBindEventExistingNames(), undefined, false);
|
|
437
|
-
}
|
|
438
|
-
_insertBindEventAt(options, index) {
|
|
439
|
-
const bindEventOptions = {};
|
|
440
|
-
const relationOptions = { parentNode: this, parentKey: 'bindEvents' };
|
|
441
|
-
let bindEvent;
|
|
442
|
-
if (!options) {
|
|
443
|
-
bindEvent = BindEvent__1.default.from({
|
|
444
|
-
...bindEventOptions,
|
|
445
|
-
name: this.getBindEventUniqueName(),
|
|
446
|
-
}, this, 'bindEvents');
|
|
447
|
-
}
|
|
448
|
-
else if (typeof options === 'string') {
|
|
449
|
-
bindEvent = BindEvent__1.default.from({
|
|
450
|
-
...bindEventOptions,
|
|
451
|
-
name: options,
|
|
452
|
-
}, this, 'bindEvents');
|
|
453
|
-
}
|
|
454
|
-
else if (options instanceof BindEvent__1.default) {
|
|
455
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
456
|
-
bindEvent = options;
|
|
457
|
-
Object.assign(bindEvent, relationOptions);
|
|
458
|
-
}
|
|
459
|
-
else {
|
|
460
|
-
bindEvent = BindEvent__1.default.from({
|
|
461
|
-
...bindEventOptions,
|
|
462
|
-
...options,
|
|
463
|
-
}, this, 'bindEvents');
|
|
464
|
-
}
|
|
465
|
-
this.bindEvents.splice(index, 0, bindEvent);
|
|
466
|
-
return bindEvent;
|
|
467
|
-
}
|
|
468
|
-
insertBindEventAt(options, index) {
|
|
469
|
-
const node = this._insertBindEventAt(options, index);
|
|
470
|
-
node.create({
|
|
471
|
-
index,
|
|
472
|
-
parentNode: this,
|
|
473
|
-
parentKey: 'bindEvents',
|
|
474
|
-
});
|
|
475
|
-
return node;
|
|
476
|
-
}
|
|
477
|
-
_addBindEvent(options) {
|
|
478
|
-
const index = this.bindEvents.length;
|
|
479
|
-
return this._insertBindEventAt(options, index);
|
|
480
|
-
}
|
|
481
|
-
addBindEvent(options) {
|
|
482
|
-
const node = this._addBindEvent(options);
|
|
483
|
-
const index = this.bindEvents.indexOf(node);
|
|
484
|
-
node.create({
|
|
485
|
-
index,
|
|
486
|
-
parentNode: this,
|
|
487
|
-
parentKey: 'bindEvents',
|
|
488
|
-
});
|
|
489
|
-
return node;
|
|
490
|
-
}
|
|
491
|
-
getBindDirectiveExistingNames(excludedList = []) {
|
|
492
|
-
const excludedSet = new Set(excludedList);
|
|
493
|
-
return (this.bindDirectives || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
494
|
-
}
|
|
495
|
-
getBindDirectiveUniqueName(name = 'bindDirective1') {
|
|
496
|
-
return utils.unique(name, this.getBindDirectiveExistingNames(), undefined, false);
|
|
497
|
-
}
|
|
498
|
-
_insertBindDirectiveAt(options, index) {
|
|
499
|
-
const bindDirectiveOptions = {};
|
|
500
|
-
const relationOptions = { parentNode: this, parentKey: 'bindDirectives' };
|
|
501
|
-
let bindDirective;
|
|
502
|
-
if (!options) {
|
|
503
|
-
bindDirective = BindDirective__1.default.from({
|
|
504
|
-
...bindDirectiveOptions,
|
|
505
|
-
name: this.getBindDirectiveUniqueName(),
|
|
506
|
-
}, this, 'bindDirectives');
|
|
507
|
-
}
|
|
508
|
-
else if (typeof options === 'string') {
|
|
509
|
-
bindDirective = BindDirective__1.default.from({
|
|
510
|
-
...bindDirectiveOptions,
|
|
511
|
-
name: options,
|
|
512
|
-
}, this, 'bindDirectives');
|
|
513
|
-
}
|
|
514
|
-
else if (options instanceof BindDirective__1.default) {
|
|
515
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
516
|
-
bindDirective = options;
|
|
517
|
-
Object.assign(bindDirective, relationOptions);
|
|
518
|
-
}
|
|
519
|
-
else {
|
|
520
|
-
bindDirective = BindDirective__1.default.from({
|
|
521
|
-
...bindDirectiveOptions,
|
|
522
|
-
...options,
|
|
523
|
-
}, this, 'bindDirectives');
|
|
524
|
-
}
|
|
525
|
-
this.bindDirectives.splice(index, 0, bindDirective);
|
|
526
|
-
return bindDirective;
|
|
527
|
-
}
|
|
528
|
-
insertBindDirectiveAt(options, index) {
|
|
529
|
-
const node = this._insertBindDirectiveAt(options, index);
|
|
530
|
-
node.create({
|
|
531
|
-
index,
|
|
532
|
-
parentNode: this,
|
|
533
|
-
parentKey: 'bindDirectives',
|
|
534
|
-
});
|
|
535
|
-
return node;
|
|
536
|
-
}
|
|
537
|
-
_addBindDirective(options) {
|
|
538
|
-
const index = this.bindDirectives.length;
|
|
539
|
-
return this._insertBindDirectiveAt(options, index);
|
|
540
|
-
}
|
|
541
|
-
addBindDirective(options) {
|
|
542
|
-
const node = this._addBindDirective(options);
|
|
543
|
-
const index = this.bindDirectives.indexOf(node);
|
|
544
|
-
node.create({
|
|
545
|
-
index,
|
|
546
|
-
parentNode: this,
|
|
547
|
-
parentKey: 'bindDirectives',
|
|
548
|
-
});
|
|
549
|
-
return node;
|
|
550
|
-
}
|
|
551
|
-
getBindStyleExistingNames(excludedList = []) {
|
|
552
|
-
const excludedSet = new Set(excludedList);
|
|
553
|
-
return (this.bindStyles || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
554
|
-
}
|
|
555
|
-
getBindStyleUniqueName(name = 'bindStyle1') {
|
|
556
|
-
return utils.unique(name, this.getBindStyleExistingNames(), undefined, false);
|
|
557
|
-
}
|
|
558
|
-
_insertBindStyleAt(options, index) {
|
|
559
|
-
const bindStyleOptions = {};
|
|
560
|
-
const relationOptions = { parentNode: this, parentKey: 'bindStyles' };
|
|
561
|
-
let bindStyle;
|
|
562
|
-
if (!options) {
|
|
563
|
-
bindStyle = BindStyle__1.default.from({
|
|
564
|
-
...bindStyleOptions,
|
|
565
|
-
name: this.getBindStyleUniqueName(),
|
|
566
|
-
}, this, 'bindStyles');
|
|
567
|
-
}
|
|
568
|
-
else if (typeof options === 'string') {
|
|
569
|
-
bindStyle = BindStyle__1.default.from({
|
|
570
|
-
...bindStyleOptions,
|
|
571
|
-
name: options,
|
|
572
|
-
}, this, 'bindStyles');
|
|
573
|
-
}
|
|
574
|
-
else if (options instanceof BindStyle__1.default) {
|
|
575
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
576
|
-
bindStyle = options;
|
|
577
|
-
Object.assign(bindStyle, relationOptions);
|
|
578
|
-
}
|
|
579
|
-
else {
|
|
580
|
-
bindStyle = BindStyle__1.default.from({
|
|
581
|
-
...bindStyleOptions,
|
|
582
|
-
...options,
|
|
583
|
-
}, this, 'bindStyles');
|
|
584
|
-
}
|
|
585
|
-
this.bindStyles.splice(index, 0, bindStyle);
|
|
586
|
-
return bindStyle;
|
|
587
|
-
}
|
|
588
|
-
insertBindStyleAt(options, index) {
|
|
589
|
-
const node = this._insertBindStyleAt(options, index);
|
|
590
|
-
node.create({
|
|
591
|
-
index,
|
|
592
|
-
parentNode: this,
|
|
593
|
-
parentKey: 'bindStyles',
|
|
594
|
-
});
|
|
595
|
-
return node;
|
|
596
|
-
}
|
|
597
|
-
_addBindStyle(options) {
|
|
598
|
-
const index = this.bindStyles.length;
|
|
599
|
-
return this._insertBindStyleAt(options, index);
|
|
600
|
-
}
|
|
601
|
-
addBindStyle(options) {
|
|
602
|
-
const node = this._addBindStyle(options);
|
|
603
|
-
const index = this.bindStyles.indexOf(node);
|
|
604
|
-
node.create({
|
|
605
|
-
index,
|
|
606
|
-
parentNode: this,
|
|
607
|
-
parentKey: 'bindStyles',
|
|
608
|
-
});
|
|
609
|
-
return node;
|
|
610
|
-
}
|
|
611
|
-
_insertViewElementAt(options, index) {
|
|
612
|
-
const viewElementOptions = {};
|
|
613
|
-
const relationOptions = { parentNode: this, parentKey: 'children' };
|
|
614
|
-
let viewElement;
|
|
615
|
-
if (!options) {
|
|
616
|
-
viewElement = ViewElement_1.from({
|
|
617
|
-
...viewElementOptions,
|
|
618
|
-
name: this.getViewElementUniqueName(),
|
|
619
|
-
}, this, 'children');
|
|
620
|
-
}
|
|
621
|
-
else if (typeof options === 'string') {
|
|
622
|
-
viewElement = ViewElement_1.from({
|
|
623
|
-
...viewElementOptions,
|
|
624
|
-
name: options,
|
|
625
|
-
}, this, 'children');
|
|
626
|
-
}
|
|
627
|
-
else if (options instanceof ViewElement_1) {
|
|
628
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
629
|
-
viewElement = options;
|
|
630
|
-
Object.assign(viewElement, relationOptions);
|
|
631
|
-
}
|
|
632
|
-
else {
|
|
633
|
-
viewElement = ViewElement_1.from({
|
|
634
|
-
...viewElementOptions,
|
|
635
|
-
...options,
|
|
636
|
-
}, this, 'children');
|
|
637
|
-
}
|
|
638
|
-
this.children.splice(index, 0, viewElement);
|
|
639
|
-
return viewElement;
|
|
640
|
-
}
|
|
641
|
-
insertViewElementAt(options, index) {
|
|
642
|
-
const node = this._insertViewElementAt(options, index);
|
|
643
|
-
node.create({
|
|
644
|
-
index,
|
|
645
|
-
parentNode: this,
|
|
646
|
-
parentKey: 'children',
|
|
647
|
-
});
|
|
648
|
-
return node;
|
|
649
|
-
}
|
|
650
|
-
_addViewElement(options) {
|
|
651
|
-
const index = this.children.length;
|
|
652
|
-
return this._insertViewElementAt(options, index);
|
|
653
|
-
}
|
|
654
|
-
addViewElement(options) {
|
|
655
|
-
const node = this._addViewElement(options);
|
|
656
|
-
const index = this.children.indexOf(node);
|
|
657
|
-
node.create({
|
|
658
|
-
index,
|
|
659
|
-
parentNode: this,
|
|
660
|
-
parentKey: 'children',
|
|
661
|
-
});
|
|
662
|
-
return node;
|
|
663
|
-
}
|
|
664
|
-
removeBindAttribute(options) {
|
|
665
|
-
let bindAttribute;
|
|
666
|
-
if (typeof options === 'string') {
|
|
667
|
-
bindAttribute = this.bindAttrs.find((item) => item.name === options);
|
|
668
|
-
if (!bindAttribute) {
|
|
669
|
-
throw new Error('找不到元素绑定属性 ' + options);
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
else {
|
|
673
|
-
bindAttribute = options;
|
|
674
|
-
}
|
|
675
|
-
return bindAttribute.delete();
|
|
676
|
-
}
|
|
677
|
-
__removeBindAttribute(bindAttribute) {
|
|
678
|
-
const parentKey = bindAttribute.parentKey;
|
|
679
|
-
const params = {
|
|
680
|
-
parentNode: this,
|
|
681
|
-
parentKey,
|
|
682
|
-
index: -1,
|
|
683
|
-
object: null,
|
|
684
|
-
oldObject: bindAttribute,
|
|
685
|
-
};
|
|
686
|
-
if (parentKey) {
|
|
687
|
-
params.parentKey = parentKey;
|
|
688
|
-
if (Array.isArray(this[parentKey])) {
|
|
689
|
-
const index = this[parentKey].indexOf(bindAttribute);
|
|
690
|
-
~index && this[parentKey].splice(index, 1);
|
|
691
|
-
params.index = index;
|
|
692
|
-
}
|
|
693
|
-
else if (this[parentKey] === bindAttribute) {
|
|
694
|
-
params.index = 0;
|
|
695
|
-
this[parentKey] = undefined;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
return params;
|
|
699
|
-
}
|
|
700
|
-
removeBindEvent(options) {
|
|
701
|
-
let bindEvent;
|
|
702
|
-
if (typeof options === 'string') {
|
|
703
|
-
bindEvent = this.bindEvents.find((item) => item.name === options);
|
|
704
|
-
if (!bindEvent) {
|
|
705
|
-
throw new Error('找不到元素绑定事件 ' + options);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
else {
|
|
709
|
-
bindEvent = options;
|
|
710
|
-
}
|
|
711
|
-
return bindEvent.delete();
|
|
712
|
-
}
|
|
713
|
-
__removeBindEvent(bindEvent) {
|
|
714
|
-
const parentKey = bindEvent.parentKey;
|
|
715
|
-
const params = {
|
|
716
|
-
parentNode: this,
|
|
717
|
-
parentKey,
|
|
718
|
-
index: -1,
|
|
719
|
-
object: null,
|
|
720
|
-
oldObject: bindEvent,
|
|
721
|
-
};
|
|
722
|
-
if (parentKey) {
|
|
723
|
-
params.parentKey = parentKey;
|
|
724
|
-
if (Array.isArray(this[parentKey])) {
|
|
725
|
-
const index = this[parentKey].indexOf(bindEvent);
|
|
726
|
-
~index && this[parentKey].splice(index, 1);
|
|
727
|
-
params.index = index;
|
|
728
|
-
}
|
|
729
|
-
else if (this[parentKey] === bindEvent) {
|
|
730
|
-
params.index = 0;
|
|
731
|
-
this[parentKey] = undefined;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
return params;
|
|
735
|
-
}
|
|
736
|
-
removeBindDirective(options) {
|
|
737
|
-
let bindDirective;
|
|
738
|
-
if (typeof options === 'string') {
|
|
739
|
-
bindDirective = this.bindDirectives.find((item) => item.name === options);
|
|
740
|
-
if (!bindDirective) {
|
|
741
|
-
throw new Error('找不到元素指令 ' + options);
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
else {
|
|
745
|
-
bindDirective = options;
|
|
746
|
-
}
|
|
747
|
-
return bindDirective.delete();
|
|
748
|
-
}
|
|
749
|
-
__removeBindDirective(bindDirective) {
|
|
750
|
-
const parentKey = bindDirective.parentKey;
|
|
751
|
-
const params = {
|
|
752
|
-
parentNode: this,
|
|
753
|
-
parentKey,
|
|
754
|
-
index: -1,
|
|
755
|
-
object: null,
|
|
756
|
-
oldObject: bindDirective,
|
|
757
|
-
};
|
|
758
|
-
if (parentKey) {
|
|
759
|
-
params.parentKey = parentKey;
|
|
760
|
-
if (Array.isArray(this[parentKey])) {
|
|
761
|
-
const index = this[parentKey].indexOf(bindDirective);
|
|
762
|
-
~index && this[parentKey].splice(index, 1);
|
|
763
|
-
params.index = index;
|
|
764
|
-
}
|
|
765
|
-
else if (this[parentKey] === bindDirective) {
|
|
766
|
-
params.index = 0;
|
|
767
|
-
this[parentKey] = undefined;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
return params;
|
|
771
|
-
}
|
|
772
|
-
removeBindStyle(options) {
|
|
773
|
-
let bindStyle;
|
|
774
|
-
if (typeof options === 'string') {
|
|
775
|
-
bindStyle = this.bindStyles.find((item) => item.name === options);
|
|
776
|
-
if (!bindStyle) {
|
|
777
|
-
throw new Error('找不到元素绑定样式 ' + options);
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
else {
|
|
781
|
-
bindStyle = options;
|
|
782
|
-
}
|
|
783
|
-
return bindStyle.delete();
|
|
784
|
-
}
|
|
785
|
-
__removeBindStyle(bindStyle) {
|
|
786
|
-
const parentKey = bindStyle.parentKey;
|
|
787
|
-
const params = {
|
|
788
|
-
parentNode: this,
|
|
789
|
-
parentKey,
|
|
790
|
-
index: -1,
|
|
791
|
-
object: null,
|
|
792
|
-
oldObject: bindStyle,
|
|
793
|
-
};
|
|
794
|
-
if (parentKey) {
|
|
795
|
-
params.parentKey = parentKey;
|
|
796
|
-
if (Array.isArray(this[parentKey])) {
|
|
797
|
-
const index = this[parentKey].indexOf(bindStyle);
|
|
798
|
-
~index && this[parentKey].splice(index, 1);
|
|
799
|
-
params.index = index;
|
|
800
|
-
}
|
|
801
|
-
else if (this[parentKey] === bindStyle) {
|
|
802
|
-
params.index = 0;
|
|
803
|
-
this[parentKey] = undefined;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
return params;
|
|
807
|
-
}
|
|
808
|
-
removeViewElement(options) {
|
|
809
|
-
let viewElement;
|
|
810
|
-
if (typeof options === 'string') {
|
|
811
|
-
viewElement = this.children.find((item) => item.name === options);
|
|
812
|
-
if (!viewElement) {
|
|
813
|
-
throw new Error('找不到页面元素 ' + options);
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
else {
|
|
817
|
-
viewElement = options;
|
|
818
|
-
}
|
|
819
|
-
return viewElement.delete();
|
|
820
|
-
}
|
|
821
|
-
__removeViewElement(viewElement) {
|
|
822
|
-
const parentKey = viewElement.parentKey;
|
|
823
|
-
const params = {
|
|
824
|
-
parentNode: this,
|
|
825
|
-
parentKey,
|
|
826
|
-
index: -1,
|
|
827
|
-
object: null,
|
|
828
|
-
oldObject: viewElement,
|
|
829
|
-
};
|
|
830
|
-
if (parentKey) {
|
|
831
|
-
params.parentKey = parentKey;
|
|
832
|
-
if (Array.isArray(this[parentKey])) {
|
|
833
|
-
const index = this[parentKey].indexOf(viewElement);
|
|
834
|
-
~index && this[parentKey].splice(index, 1);
|
|
835
|
-
params.index = index;
|
|
836
|
-
}
|
|
837
|
-
else if (this[parentKey] === viewElement) {
|
|
838
|
-
params.index = 0;
|
|
839
|
-
this[parentKey] = undefined;
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
return params;
|
|
843
|
-
}
|
|
844
|
-
//================================================================================
|
|
845
|
-
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
846
|
-
// 自动生成的代码已结束。下面可以手动编写。
|
|
847
|
-
//================================================================================
|
|
848
|
-
/* 主页面有没有权限 */
|
|
849
|
-
get parentAuth() {
|
|
850
|
-
const _nameSpace = this.view.getNamespace();
|
|
851
|
-
const mainViewName = _nameSpace.split('.')[2];
|
|
852
|
-
return this.view.parentNode.concept === 'App' ? this.view.auth : this.frontend.views.find((item) => item.name === mainViewName)?.auth;
|
|
853
|
-
}
|
|
854
|
-
// IDE内展示需要屏蔽掉“系统统一路径前缀”
|
|
855
|
-
get uiPath() {
|
|
856
|
-
return `${this.view.uiPath}/${this.name}`;
|
|
857
|
-
}
|
|
858
|
-
/**
|
|
859
|
-
* 权限领域的资源路径
|
|
860
|
-
*/
|
|
861
|
-
get authPath() {
|
|
862
|
-
return `${this.view.path}/${this.name}`;
|
|
863
|
-
}
|
|
864
|
-
get auth() {
|
|
865
|
-
return this.bindDirectives.find((directive) => directive.name === 'auth');
|
|
866
|
-
}
|
|
867
|
-
getViewElementUniqueName(name = 'viewElement1') {
|
|
868
|
-
return this.view?.getViewElementUniqueName(name);
|
|
869
|
-
}
|
|
870
|
-
static TAG_NAME_PREFIX_REG = /^([lieu]|van)[-_]/;
|
|
871
|
-
static from(source, parentNode, parentKey) {
|
|
872
|
-
const node = super.from(source, parentNode, parentKey);
|
|
873
|
-
if (!node.name) {
|
|
874
|
-
const tagName = node.tag.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
|
|
875
|
-
node.name = node.getViewElementUniqueName(`${tagName}1`);
|
|
876
|
-
}
|
|
877
|
-
return node;
|
|
878
|
-
}
|
|
879
|
-
/**
|
|
880
|
-
* 设置组件权限
|
|
881
|
-
*/
|
|
882
|
-
setBindRoles(bindRoles) {
|
|
883
|
-
const object = {
|
|
884
|
-
bindRoles,
|
|
885
|
-
};
|
|
886
|
-
this.update({
|
|
887
|
-
...object,
|
|
888
|
-
});
|
|
889
|
-
}
|
|
890
|
-
getBindAttribute(name) {
|
|
891
|
-
return this.bindAttrs.find((bindAttr) => bindAttr.name === name);
|
|
892
|
-
}
|
|
893
|
-
toHump(name) {
|
|
894
|
-
return name.replace(/-(\w)/g, (all, letter) => letter.toUpperCase());
|
|
895
|
-
}
|
|
896
|
-
toFirstUpper(name) {
|
|
897
|
-
return name.replace(/^\S/, (s) => s.toUpperCase());
|
|
898
|
-
}
|
|
899
|
-
haveScope() {
|
|
900
|
-
return Boolean(this.slotScope);
|
|
901
|
-
}
|
|
902
|
-
toEmbeddedTSDefinition(state) {
|
|
903
|
-
let code = '';
|
|
904
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
905
|
-
// 登录组件不翻译
|
|
906
|
-
if (this.toHump(this.tag) === 'lcapLogin' || this.staticClass === 'login-form') {
|
|
907
|
-
code += `${this.name}: nasl.ui.div<any>;\n`;
|
|
908
|
-
}
|
|
909
|
-
else if (this.tag === 'u-table-view-column-dynamic') {
|
|
910
|
-
code += `${this.name}: nasl.ui.${this.toHump(this.tag)}<any, any>;\n`;
|
|
911
|
-
}
|
|
912
|
-
else {
|
|
913
|
-
code += `${this.name}: nasl.ui.${this.toHump(this.tag)}<any>;\n`;
|
|
914
|
-
}
|
|
915
|
-
if (Array.isArray(this.children)) {
|
|
916
|
-
this.children.forEach((element) => {
|
|
917
|
-
code += element.toEmbeddedTSDefinition((0, translator_1.shiftState)(state, code));
|
|
918
|
-
});
|
|
919
|
-
}
|
|
920
|
-
return code;
|
|
921
|
-
}
|
|
922
|
-
getTypeArgmentsStr(state) {
|
|
923
|
-
// 登录组件不翻译
|
|
924
|
-
if (this.toHump(this.tag) === 'lcapLogin' || this.staticClass === 'login-form')
|
|
925
|
-
return '<any>';
|
|
926
|
-
let code = '';
|
|
927
|
-
// formItem的单独处理
|
|
928
|
-
if (this.tag === 'u-form-item') {
|
|
929
|
-
if (Array.isArray(this.children) && this.children.length) {
|
|
930
|
-
const tag = this.children[0].tag;
|
|
931
|
-
if (tag === 'u-input') {
|
|
932
|
-
code += '<nasl.core.String>';
|
|
933
|
-
}
|
|
934
|
-
else if (tag === 'u-input-number') {
|
|
935
|
-
code += '<nasl.core.Long>';
|
|
936
|
-
}
|
|
937
|
-
else {
|
|
938
|
-
code += '<any>';
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
return code;
|
|
942
|
-
}
|
|
943
|
-
const bindAttrs = this.bindAttrs;
|
|
944
|
-
if (bindAttrs && bindAttrs.length) {
|
|
945
|
-
const attr = bindAttrs.find((item) => item.name === 'data-source');
|
|
946
|
-
if (attr && attr.expression) {
|
|
947
|
-
if (this.tag === 'u-table-view-column-dynamic') {
|
|
948
|
-
code += `<${this.parentNode.__tsDataSourceTypeName}, ${this.__tsDataSourceTypeName}>`;
|
|
949
|
-
}
|
|
950
|
-
else {
|
|
951
|
-
code += `<${this.__tsDataSourceTypeName}>`;
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
return code;
|
|
956
|
-
}
|
|
957
|
-
getDatasourceTypeCodeStr(state, eleArr) {
|
|
958
|
-
let code = '';
|
|
959
|
-
(eleArr || []).forEach((element, index) => {
|
|
960
|
-
const bindAttrs = element.bindAttrs;
|
|
961
|
-
if (bindAttrs && bindAttrs.length) {
|
|
962
|
-
const attr = bindAttrs.find((item) => item.name === 'data-source');
|
|
963
|
-
if (attr && attr.expression) {
|
|
964
|
-
const datasourceName = `datasourceName${index}`;
|
|
965
|
-
element.__tsDataSourceTypeName = datasourceName;
|
|
966
|
-
if (attr.expression instanceof MemberExpression__1.default || attr.expression instanceof Identifier__1.default) {
|
|
967
|
-
const value = attr.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code));
|
|
968
|
-
code += `type ${datasourceName} = `;
|
|
969
|
-
code += `nasl.ui.GetItemTypeFromDataSource<typeof ${value}>;\n`;
|
|
970
|
-
}
|
|
971
|
-
else {
|
|
972
|
-
code += `const __funcName${index} = () => { return`;
|
|
973
|
-
code += attr.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code));
|
|
974
|
-
code += '};\n';
|
|
975
|
-
code += `type ${datasourceName} = `;
|
|
976
|
-
code += `nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof __funcName${index}>>;\n`;
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
});
|
|
981
|
-
code += '\n';
|
|
982
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
983
|
-
return code;
|
|
984
|
-
}
|
|
985
|
-
toEmbeddedTS(state, parentLevel) {
|
|
986
|
-
// 过滤模板的登录中的一些翻译,这里只过滤h5表格中的两个列
|
|
987
|
-
if (this.parentNode.tag && this.toHump(this.parentNode.tag) === 'lcapLogin' || this.staticClass === 'login-cell')
|
|
988
|
-
return '';
|
|
989
|
-
// pc事件翻译
|
|
990
|
-
if (this.toHump(this.tag) === 'lcapLogin') {
|
|
991
|
-
let code = `new nasl.ui.div({name: __elements.${this.name},\n`;
|
|
992
|
-
// 事件
|
|
993
|
-
if (Array.isArray(this.bindEvents)) {
|
|
994
|
-
this.bindEvents.forEach((event) => {
|
|
995
|
-
code += event.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
996
|
-
tabSize: (state?.tabSize || 0) + 2,
|
|
997
|
-
}));
|
|
998
|
-
code += '\n';
|
|
999
|
-
});
|
|
1000
|
-
}
|
|
1001
|
-
code += `}),\n`;
|
|
1002
|
-
return code;
|
|
1003
|
-
}
|
|
1004
|
-
let levelIndex = parentLevel || 0;
|
|
1005
|
-
if (this.tag === 'template' && this.haveScope()) {
|
|
1006
|
-
const slotTarget = !this.slotTarget ? 'slotDefault' : 'slot' + this.toFirstUpper(this.toHump(this.slotTarget));
|
|
1007
|
-
let code = '';
|
|
1008
|
-
code += `${slotTarget}: (current${levelIndex === 0 ? '' : levelIndex})=> {\n`;
|
|
1009
|
-
code += this.getDatasourceTypeCodeStr(state, this.children);
|
|
1010
|
-
levelIndex++;
|
|
1011
|
-
code += 'return [';
|
|
1012
|
-
this.children.forEach((element) => {
|
|
1013
|
-
code += element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1014
|
-
tabSize: (state?.tabSize || 0),
|
|
1015
|
-
}), levelIndex);
|
|
1016
|
-
});
|
|
1017
|
-
code += ']';
|
|
1018
|
-
code += '\n';
|
|
1019
|
-
code += '},\n';
|
|
1020
|
-
return code;
|
|
1021
|
-
}
|
|
1022
|
-
else if (this.tag === 'template') {
|
|
1023
|
-
const slotTarget = !this.slotTarget ? 'slotDefault' : 'slot' + this.toFirstUpper(this.toHump(this.slotTarget));
|
|
1024
|
-
let code = '';
|
|
1025
|
-
code += `${slotTarget}: ()=> {\n`;
|
|
1026
|
-
code += this.getDatasourceTypeCodeStr(state, this.children);
|
|
1027
|
-
code += 'return [';
|
|
1028
|
-
this.children.forEach((element) => {
|
|
1029
|
-
code += element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1030
|
-
tabSize: (state?.tabSize || 0),
|
|
1031
|
-
}), levelIndex);
|
|
1032
|
-
});
|
|
1033
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
1034
|
-
code += ']';
|
|
1035
|
-
code += '\n';
|
|
1036
|
-
code += '},\n';
|
|
1037
|
-
return code;
|
|
1038
|
-
}
|
|
1039
|
-
function chineseTsName(name) {
|
|
1040
|
-
let tsName = name;
|
|
1041
|
-
// 匹配所有特殊字符都转为_
|
|
1042
|
-
tsName = tsName.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, '_');
|
|
1043
|
-
if (/^\d/.test(tsName)) {
|
|
1044
|
-
tsName = '$' + tsName;
|
|
1045
|
-
}
|
|
1046
|
-
return tsName;
|
|
1047
|
-
}
|
|
1048
|
-
// 后面那个name是为了查找引用的时候用的
|
|
1049
|
-
let code = `new nasl.ui.${this.toHump(this.tag)}${this.getTypeArgmentsStr(state)}({name: __elements.${this.name},\n`;
|
|
1050
|
-
// 是否开启权限
|
|
1051
|
-
let hasAuth = false;
|
|
1052
|
-
if (Array.isArray(this.bindDirectives)) {
|
|
1053
|
-
hasAuth = !!this.bindDirectives.filter((directive) => directive.name === 'auth').length;
|
|
1054
|
-
}
|
|
1055
|
-
// 角色
|
|
1056
|
-
if (Array.isArray(this.bindRoles) && this.bindRoles.length) {
|
|
1057
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
1058
|
-
code += 'roles = [\n';
|
|
1059
|
-
this.bindRoles.forEach((role) => {
|
|
1060
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 3);
|
|
1061
|
-
code += `${this.app.getNamespace()}.roles.${chineseTsName(role)}.${chineseTsName(role)},`;
|
|
1062
|
-
code += '\n';
|
|
1063
|
-
});
|
|
1064
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
1065
|
-
code += '],\n';
|
|
1066
|
-
}
|
|
1067
|
-
// 事件
|
|
1068
|
-
if (Array.isArray(this.bindEvents)) {
|
|
1069
|
-
this.bindEvents.forEach((event) => {
|
|
1070
|
-
code += event.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1071
|
-
tabSize: (state?.tabSize || 0) + 2,
|
|
1072
|
-
}));
|
|
1073
|
-
code += '\n';
|
|
1074
|
-
});
|
|
1075
|
-
}
|
|
1076
|
-
// 子元素
|
|
1077
|
-
if (Array.isArray(this.children)) {
|
|
1078
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1079
|
-
if (Array.isArray(this.bindAttrs)) {
|
|
1080
|
-
code += `bindAttr: () => [\n`;
|
|
1081
|
-
this.bindAttrs.forEach((attr) => code += attr.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: 1 })) + ',\n');
|
|
1082
|
-
this.bindDirectives.forEach((directive) => code += directive.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: 1 })) + ',\n');
|
|
1083
|
-
this.bindStyles.forEach((bindStyle) => code += bindStyle.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: 1 })) + ',\n');
|
|
1084
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2) + '],\n';
|
|
1085
|
-
}
|
|
1086
|
-
// 如果子集中有插槽的就
|
|
1087
|
-
if (this.children.find((item) => item.tag === 'template' && item.slotTarget)) {
|
|
1088
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
1089
|
-
const defaultArr = [];
|
|
1090
|
-
// 先把插槽翻译了
|
|
1091
|
-
this.children.forEach((element) => {
|
|
1092
|
-
if (element.tag === 'template') {
|
|
1093
|
-
code += element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1094
|
-
tabSize: (state?.tabSize || 0),
|
|
1095
|
-
}), levelIndex);
|
|
1096
|
-
}
|
|
1097
|
-
else {
|
|
1098
|
-
defaultArr.push(element);
|
|
1099
|
-
}
|
|
1100
|
-
});
|
|
1101
|
-
// 翻译其余的子集
|
|
1102
|
-
if (defaultArr.length) {
|
|
1103
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
1104
|
-
code += `slotDefault: ()=> {\n`;
|
|
1105
|
-
code += this.getDatasourceTypeCodeStr(state, defaultArr);
|
|
1106
|
-
code += 'return [';
|
|
1107
|
-
defaultArr.forEach((element) => {
|
|
1108
|
-
code += element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1109
|
-
tabSize: (state?.tabSize || 0) + 2,
|
|
1110
|
-
}), levelIndex);
|
|
1111
|
-
code += '\n';
|
|
1112
|
-
});
|
|
1113
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
1114
|
-
code += ']\n';
|
|
1115
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1116
|
-
code += '}\n';
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
else {
|
|
1120
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
1121
|
-
code += `slotDefault: ()=> {\n`;
|
|
1122
|
-
code += this.getDatasourceTypeCodeStr(state, this.children);
|
|
1123
|
-
code += 'return [';
|
|
1124
|
-
this.children.forEach((element) => {
|
|
1125
|
-
code += element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1126
|
-
tabSize: (state?.tabSize || 0) + 2,
|
|
1127
|
-
}), levelIndex);
|
|
1128
|
-
code += '\n';
|
|
1129
|
-
});
|
|
1130
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
1131
|
-
code += ']\n';
|
|
1132
|
-
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1133
|
-
code += '}\n';
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
code += (0, translator_1.indent)((state?.tabSize || 0)) + '}),\n';
|
|
1137
|
-
return code;
|
|
1138
|
-
}
|
|
1139
|
-
_duplicate() {
|
|
1140
|
-
const element = ViewElement_1.from(this.toTemplateJSON());
|
|
1141
|
-
const oldName = element.name;
|
|
1142
|
-
element.deepRenameElements(this);
|
|
1143
|
-
if (element.tag === 'u-modal' || element.tag === 'u-drawer') {
|
|
1144
|
-
const cancelNode = (0, utils_1.traverse)(({ node }) => {
|
|
1145
|
-
if (node?.bindAttrs?.find((bindAttr) => (bindAttr.value === '取消' || bindAttr.value === '取 消')))
|
|
1146
|
-
return node;
|
|
1147
|
-
}, { node: element });
|
|
1148
|
-
cancelNode?.bindEvents.forEach(({ logics }) => {
|
|
1149
|
-
logics.forEach(({ body }) => {
|
|
1150
|
-
body.forEach((item) => {
|
|
1151
|
-
if (item.concept === 'CallLogic' && item.calleeName === 'close' && item.calleeNamespace.split('.')[1] === oldName)
|
|
1152
|
-
item.calleeNamespace = `elements.${element.name}.logics`;
|
|
1153
|
-
});
|
|
1154
|
-
});
|
|
1155
|
-
});
|
|
1156
|
-
}
|
|
1157
|
-
this.view.existingViewElement.clear();
|
|
1158
|
-
return element;
|
|
1159
|
-
}
|
|
1160
|
-
// 递归遍历组件
|
|
1161
|
-
traverseChildren(cb) {
|
|
1162
|
-
utils.traverse((current) => {
|
|
1163
|
-
cb(current.node);
|
|
1164
|
-
}, { node: this });
|
|
1165
|
-
}
|
|
1166
|
-
// 递归生成组件名
|
|
1167
|
-
deepRenameElements(node) {
|
|
1168
|
-
return this.traverseChildren((ele) => {
|
|
1169
|
-
const tagName = ele.tag.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
|
|
1170
|
-
ele.name = node.getViewElementUniqueName(`${tagName}1`);
|
|
1171
|
-
});
|
|
1172
|
-
}
|
|
1173
|
-
/**
|
|
1174
|
-
* 解析属性中的表达式
|
|
1175
|
-
* @param value
|
|
1176
|
-
* @param $def 目前 $def 只用来查找 $def.variables 和 $def.structures
|
|
1177
|
-
* @param dataSchema
|
|
1178
|
-
*/
|
|
1179
|
-
static _parseExpression(value) {
|
|
1180
|
-
try {
|
|
1181
|
-
const ast = babelParser.parseExpression(value);
|
|
1182
|
-
const node = transAstNodeToNaslNode(ast);
|
|
1183
|
-
return LogicItem__1.default.from(node, null, null);
|
|
1184
|
-
}
|
|
1185
|
-
catch (e) {
|
|
1186
|
-
return null;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
static _parseValidationRule(value) {
|
|
1190
|
-
let calleeName = value;
|
|
1191
|
-
let args = [];
|
|
1192
|
-
try {
|
|
1193
|
-
const ast = babelParser.parseExpression(value);
|
|
1194
|
-
const validationNamespace = concepts_1.stdlibNamespace.findChild('validation');
|
|
1195
|
-
if (ast.type === 'CallExpression') {
|
|
1196
|
-
calleeName = (ast.callee?.property?.name ?? ast.callee?.property?.value ?? ast.callee?.name).replace(/\(.*/, '');
|
|
1197
|
-
const func = validationNamespace.functions.find((item) => item.name === calleeName);
|
|
1198
|
-
args = ast.arguments.map((argument, index) => ({
|
|
1199
|
-
concept: 'Argument',
|
|
1200
|
-
name: '',
|
|
1201
|
-
kind: 'Statement',
|
|
1202
|
-
keyword: func?.params?.[index]?.name ?? '',
|
|
1203
|
-
expression: transAstNodeToNaslNode(Object.assign({}, argument)),
|
|
1204
|
-
}));
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
catch (error) { }
|
|
1208
|
-
return {
|
|
1209
|
-
concept: 'ValidationRule',
|
|
1210
|
-
name: '',
|
|
1211
|
-
label: '验证规则',
|
|
1212
|
-
kind: 'Expression',
|
|
1213
|
-
calleeNamespace: 'nasl.validation',
|
|
1214
|
-
arguments: args,
|
|
1215
|
-
calleeName,
|
|
1216
|
-
};
|
|
1217
|
-
}
|
|
1218
|
-
/**
|
|
1219
|
-
* 从 Vue 的 ASTNode 转换成 ASL 元素
|
|
1220
|
-
* @param astNode Vue 的 ASTNode
|
|
1221
|
-
*/
|
|
1222
|
-
static _fromASTNode(astNode, context) {
|
|
1223
|
-
const view = context?.view;
|
|
1224
|
-
// 临时处理组件的 text
|
|
1225
|
-
//h5-mock
|
|
1226
|
-
if (['u-text', 'van-text', 'u-link', 'u-button', 'u-label', 'u-radio', 'u-checkbox', 'u-navbar-item', 'u-sidebar-item', 'u-menu-item'].includes(astNode.tag)
|
|
1227
|
-
&& astNode.children.length === 1
|
|
1228
|
-
&& astNode.children[0].type === 3) {
|
|
1229
|
-
astNode.attrs = astNode.attrs || [];
|
|
1230
|
-
astNode.attrs.push({
|
|
1231
|
-
name: 'text',
|
|
1232
|
-
value: JSON.stringify(astNode.children[0].text),
|
|
1233
|
-
});
|
|
1234
|
-
astNode.children = [];
|
|
1235
|
-
}
|
|
1236
|
-
// 将 scopedSlots 合并到 children 中
|
|
1237
|
-
if (astNode.scopedSlots) {
|
|
1238
|
-
astNode.children = astNode.children || [];
|
|
1239
|
-
Object.keys(astNode.scopedSlots).forEach((key) => {
|
|
1240
|
-
if (!astNode.children.find((child) => key === child.slotTarget)) {
|
|
1241
|
-
astNode.children.unshift(astNode.scopedSlots[key]);
|
|
1242
|
-
}
|
|
1243
|
-
});
|
|
1244
|
-
delete astNode.scopedSlots;
|
|
1245
|
-
}
|
|
1246
|
-
// 提示不支持的属性
|
|
1247
|
-
['component', 'inlineTemplate', 'pre', 'ns', 'transition', 'transitionOnAppear', 'transitionMode', 'slotName', 'classBinding', 'styleBinding'].forEach((key) => {
|
|
1248
|
-
if (astNode[key])
|
|
1249
|
-
console.warn(`[warn] ViewElement NASL unsupports '${key}' field in node `, astNode);
|
|
1250
|
-
});
|
|
1251
|
-
let element;
|
|
1252
|
-
if (astNode.type === 1) {
|
|
1253
|
-
if (astNode.tag === 'router-view') {
|
|
1254
|
-
if (view.frontend.type === 'h5') {
|
|
1255
|
-
astNode.tag = 'van-router-view';
|
|
1256
|
-
}
|
|
1257
|
-
else {
|
|
1258
|
-
astNode.tag = 'u-router-view';
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
const tagName = astNode.tag.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
|
|
1262
|
-
let newContext = {};
|
|
1263
|
-
if (context) {
|
|
1264
|
-
newContext = {
|
|
1265
|
-
...context,
|
|
1266
|
-
};
|
|
1267
|
-
}
|
|
1268
|
-
element = new ViewElement_1({
|
|
1269
|
-
tag: astNode.tag,
|
|
1270
|
-
name: astNode.attrsMap.ref || view.getViewElementUniqueName(`${tagName}1`),
|
|
1271
|
-
staticClass: astNode.attrsMap.class,
|
|
1272
|
-
staticStyle: astNode.attrsMap.style,
|
|
1273
|
-
slotTarget: astNode.slotTarget && json5.parse(astNode.slotTarget),
|
|
1274
|
-
slotScope: astNode.slotScope === '_empty_' ? '' : astNode.slotScope,
|
|
1275
|
-
children: astNode.children.map((item) => this._fromASTNode(item, newContext)),
|
|
1276
|
-
});
|
|
1277
|
-
astNode?.attrs?.forEach((oldAttr) => {
|
|
1278
|
-
let attr;
|
|
1279
|
-
// 获取原始属性
|
|
1280
|
-
const orginAttrCode = (context?.code || '').substr(oldAttr.start, oldAttr.end - oldAttr.start);
|
|
1281
|
-
if (oldAttr.value === '""' && orginAttrCode.trim() === oldAttr.name) {
|
|
1282
|
-
attr = new BindAttribute__1.default({
|
|
1283
|
-
type: 'static',
|
|
1284
|
-
name: oldAttr.name,
|
|
1285
|
-
value: 'true',
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
else {
|
|
1289
|
-
try {
|
|
1290
|
-
const tmp = json5.parse(oldAttr.value);
|
|
1291
|
-
const source = {
|
|
1292
|
-
type: typeof tmp === 'string' ? 'string' : 'static',
|
|
1293
|
-
name: oldAttr.name,
|
|
1294
|
-
value: typeof tmp === 'string' ? tmp : oldAttr.value,
|
|
1295
|
-
};
|
|
1296
|
-
if (oldAttr.name === 'rules') {
|
|
1297
|
-
source.rules = tmp?.split('|').map((ruleStr) => this._parseValidationRule(ruleStr.trim()));
|
|
1298
|
-
}
|
|
1299
|
-
attr = new BindAttribute__1.default(source);
|
|
1300
|
-
}
|
|
1301
|
-
catch (e) {
|
|
1302
|
-
const expression = this._parseExpression(oldAttr.value);
|
|
1303
|
-
attr = new BindAttribute__1.default({
|
|
1304
|
-
type: 'dynamic',
|
|
1305
|
-
name: oldAttr.name,
|
|
1306
|
-
value: expression ? '' : oldAttr.value,
|
|
1307
|
-
expression,
|
|
1308
|
-
});
|
|
1309
|
-
if (astNode.attrsMap[`:${attr.name}.sync`]) {
|
|
1310
|
-
attr.sync = true;
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
element.addBindAttribute(attr);
|
|
1315
|
-
});
|
|
1316
|
-
// compiler 处理:value.sync 时会加上update:value事件,需要过滤
|
|
1317
|
-
astNode.events
|
|
1318
|
-
&& Object.keys(astNode.events)
|
|
1319
|
-
.filter((name) => !name.startsWith('update:'))
|
|
1320
|
-
.forEach((name) => {
|
|
1321
|
-
const oldEvent = astNode.events[name];
|
|
1322
|
-
const str = oldEvent.value;
|
|
1323
|
-
const calleeName = str.split('(')[0];
|
|
1324
|
-
const matchArr = str.match(/\(([^)]*)\)/) || [];
|
|
1325
|
-
let argsStr = '';
|
|
1326
|
-
if (matchArr?.length >= 2) {
|
|
1327
|
-
argsStr = matchArr[1];
|
|
1328
|
-
}
|
|
1329
|
-
let args = [];
|
|
1330
|
-
const argStrs = argsStr.split(',');
|
|
1331
|
-
args = argStrs
|
|
1332
|
-
.filter((argStr) => !!argStr)
|
|
1333
|
-
.map((argStr) => {
|
|
1334
|
-
const keyword = argStr.trim().split('.');
|
|
1335
|
-
return {
|
|
1336
|
-
concept: 'Argument',
|
|
1337
|
-
expression: genArgumentMemberExpression(keyword),
|
|
1338
|
-
};
|
|
1339
|
-
});
|
|
1340
|
-
const viewLogics = context?.definition?.viewLogics || [];
|
|
1341
|
-
const currentLogic = viewLogics.find((item) => item.name === calleeName);
|
|
1342
|
-
if (currentLogic) {
|
|
1343
|
-
element.addBindEvent(new BindEvent__1.default({
|
|
1344
|
-
name,
|
|
1345
|
-
calleeNamespace: '',
|
|
1346
|
-
calleeName: '',
|
|
1347
|
-
arguments: args,
|
|
1348
|
-
logics: [currentLogic],
|
|
1349
|
-
}));
|
|
1350
|
-
}
|
|
1351
|
-
});
|
|
1352
|
-
astNode.directives
|
|
1353
|
-
&& astNode.directives.forEach((directive) => {
|
|
1354
|
-
if (directive.name === 'model') {
|
|
1355
|
-
const valueAttr = astNode.attrs && astNode.attrs.find((attr) => attr.name === 'value');
|
|
1356
|
-
if (!valueAttr) {
|
|
1357
|
-
const expression = this._parseExpression(directive.value);
|
|
1358
|
-
element.addBindAttribute(new BindAttribute__1.default({
|
|
1359
|
-
type: 'dynamic',
|
|
1360
|
-
name: 'value',
|
|
1361
|
-
value: expression ? '' : directive.value,
|
|
1362
|
-
expression,
|
|
1363
|
-
sync: true,
|
|
1364
|
-
}));
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
else {
|
|
1368
|
-
const expression = this._parseExpression(directive.value);
|
|
1369
|
-
element.addBindDirective(new BindDirective__1.default({
|
|
1370
|
-
type: expression ? 'string' : 'dynamic',
|
|
1371
|
-
name: directive.name,
|
|
1372
|
-
rawName: directive.rawName,
|
|
1373
|
-
value: expression ? '' : directive.value,
|
|
1374
|
-
expression,
|
|
1375
|
-
arg: directive.arg,
|
|
1376
|
-
// modifiers: directive.modifiers,
|
|
1377
|
-
}));
|
|
1378
|
-
}
|
|
1379
|
-
});
|
|
1380
|
-
if (astNode.if) {
|
|
1381
|
-
element.addBindDirective(new BindDirective__1.default({
|
|
1382
|
-
type: 'dynamic',
|
|
1383
|
-
name: 'if',
|
|
1384
|
-
rawName: 'v-if',
|
|
1385
|
-
value: '',
|
|
1386
|
-
expression: this._parseExpression(astNode.if),
|
|
1387
|
-
}));
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
else if (astNode.type === 2) {
|
|
1391
|
-
const tagName = __1.config.scope === 'h5' ? 'van-text' : 'u-text';
|
|
1392
|
-
const baseName = tagName.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
|
|
1393
|
-
element = new ViewElement_1({
|
|
1394
|
-
tag: tagName,
|
|
1395
|
-
name: view.getViewElementUniqueName(`${baseName}1`),
|
|
1396
|
-
});
|
|
1397
|
-
const value = astNode.text?.match(/{{(.*?)}}/)[1].trim();
|
|
1398
|
-
const expression = this._parseExpression(value);
|
|
1399
|
-
element.addBindAttribute(new BindAttribute__1.default({
|
|
1400
|
-
type: 'dynamic',
|
|
1401
|
-
name: 'text',
|
|
1402
|
-
value: expression ? '' : value,
|
|
1403
|
-
expression,
|
|
1404
|
-
}));
|
|
1405
|
-
}
|
|
1406
|
-
else if (astNode.type === 3) {
|
|
1407
|
-
const tagName = __1.config.scope === 'h5' ? 'van-text' : 'u-text';
|
|
1408
|
-
const baseName = tagName.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
|
|
1409
|
-
element = new ViewElement_1({
|
|
1410
|
-
tag: tagName,
|
|
1411
|
-
name: view.getViewElementUniqueName(`${baseName}1`),
|
|
1412
|
-
});
|
|
1413
|
-
element.addBindAttribute(new BindAttribute__1.default({
|
|
1414
|
-
name: 'text',
|
|
1415
|
-
type: 'string',
|
|
1416
|
-
value: astNode.text?.trim(),
|
|
1417
|
-
}));
|
|
1418
|
-
}
|
|
1419
|
-
return element;
|
|
1420
|
-
}
|
|
1421
|
-
/**
|
|
1422
|
-
* 解析 Vue 模板
|
|
1423
|
-
* 该方法不会绑定 view 和 parent,如果是添加元素优先使用 fromHTML
|
|
1424
|
-
* @param html Vue 的模板
|
|
1425
|
-
* @TODO 处理多个元素的问题
|
|
1426
|
-
*/
|
|
1427
|
-
static parse(code, context) {
|
|
1428
|
-
code = code || '<div></div>';
|
|
1429
|
-
const compilerOptions = {
|
|
1430
|
-
preserveWhitespace: false,
|
|
1431
|
-
outputSourceRange: true,
|
|
1432
|
-
};
|
|
1433
|
-
let ast = compiler.compile(code, compilerOptions).ast;
|
|
1434
|
-
if (ast.tag === 'template' && !ast.slotTarget)
|
|
1435
|
-
ast = ast.children[0];
|
|
1436
|
-
return this._fromASTNode(ast, {
|
|
1437
|
-
...context,
|
|
1438
|
-
code,
|
|
1439
|
-
});
|
|
1440
|
-
}
|
|
1441
|
-
/**
|
|
1442
|
-
* 从模板生成规范的 ViewElement 对象
|
|
1443
|
-
*/
|
|
1444
|
-
static fromHTML(html, context) {
|
|
1445
|
-
return this.parse(html, context);
|
|
1446
|
-
}
|
|
1447
|
-
/**
|
|
1448
|
-
* 转换成设计器中使用的 Vue 文件
|
|
1449
|
-
* @param options
|
|
1450
|
-
*/
|
|
1451
|
-
toDesignerVue() {
|
|
1452
|
-
return this.toVue({
|
|
1453
|
-
finalCode: false,
|
|
1454
|
-
nodePathAttr: true,
|
|
1455
|
-
attrFormat: (attr, element, defaultResult) => {
|
|
1456
|
-
if (attr.concept === 'BindAttribute' && !['href', 'destination', 'externalDestination', 'download'].includes(attr.name)) {
|
|
1457
|
-
const api = __1.config.allNodesAPI[element.tag];
|
|
1458
|
-
const apiOfAttr = api && api.attrs && api.attrs.find((_attr) => _attr.name === attr.name);
|
|
1459
|
-
if (['u-form-item', 'u-validator', 'van-field'].includes(element.tag) && attr.name === 'rules') {
|
|
1460
|
-
return `${attr.name}=""`;
|
|
1461
|
-
}
|
|
1462
|
-
if (apiOfAttr && apiOfAttr['designer-value'] !== undefined) {
|
|
1463
|
-
let designerValue = apiOfAttr['designer-value'];
|
|
1464
|
-
//对流程模板拖拽进行特判
|
|
1465
|
-
element.bindAttrs.forEach((property) => {
|
|
1466
|
-
if (property.name === 'repeat' && property.value === '1')
|
|
1467
|
-
designerValue = '[{}, {}]';
|
|
1468
|
-
});
|
|
1469
|
-
if (typeof designerValue === 'string') {
|
|
1470
|
-
designerValue = designerValue.replace(/"/g, "'");
|
|
1471
|
-
}
|
|
1472
|
-
try {
|
|
1473
|
-
json5.parse(designerValue);
|
|
1474
|
-
return `:${attr.name}="${designerValue}"`;
|
|
1475
|
-
}
|
|
1476
|
-
catch (e) {
|
|
1477
|
-
return `${attr.name}="${designerValue}"`;
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
if (attr.type === 'dynamic' && !(element.tag === 'u-cascade-select' && attr.name === 'categories'))
|
|
1481
|
-
return defaultResult.replace(/:?([\w-]+)(?:.*?)="(.*)"/, (m, name, value) => {
|
|
1482
|
-
try {
|
|
1483
|
-
const tempValue = json5.parse(value);
|
|
1484
|
-
if (typeof tempValue === 'boolean' || typeof tempValue === 'number') {
|
|
1485
|
-
// 简单类型走属性
|
|
1486
|
-
return `:${name}="${value.replace(/"/g, "'")}"`;
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
catch (e) {
|
|
1490
|
-
if (apiOfAttr && !apiOfAttr.type.includes('string'))
|
|
1491
|
-
return '';
|
|
1492
|
-
}
|
|
1493
|
-
value = value
|
|
1494
|
-
.replace(/"/g, "'")
|
|
1495
|
-
.replace(/\$utils\['(.+?)'\]/g, '$1')
|
|
1496
|
-
.replace(/\$refs./g, 'elements.')
|
|
1497
|
-
.replace(/\$global.userInfo/g, 'nasl.auth.userInfo')
|
|
1498
|
-
.replace(/\$global./g, 'nasl.')
|
|
1499
|
-
.replace(/\bscope\.item\.\b/g, '')
|
|
1500
|
-
.replace(/\bcurrent\.item\.\b/g, '');
|
|
1501
|
-
return `${name}="{{ ${value} }}"`;
|
|
1502
|
-
});
|
|
1503
|
-
else
|
|
1504
|
-
return defaultResult;
|
|
1505
|
-
}
|
|
1506
|
-
return false;
|
|
1507
|
-
},
|
|
1508
|
-
bindStylesFormat: (bindStyles, element) => false,
|
|
1509
|
-
getExtraParts: (el) => {
|
|
1510
|
-
const parts = [];
|
|
1511
|
-
const api = __1.config.allNodesAPI[el.tag];
|
|
1512
|
-
const emptySlot = api && api.slots && api.slots.find((slot) => slot.name === 'default' && slot['empty-background']);
|
|
1513
|
-
const hasSupport = api && api.slots && api.slots.some((slot) => slot.support);
|
|
1514
|
-
if (emptySlot || hasSupport) {
|
|
1515
|
-
// 有些限制的组件如侧边栏分组有title插槽但要限制子元素放入
|
|
1516
|
-
const validChildren = el.children.filter((elem) => !(elem.tag === 'template' && elem.slotTarget !== 'default'));
|
|
1517
|
-
let childEmpty = !validChildren.length;
|
|
1518
|
-
const defaultSlot = el.children.find((elem) => elem.tag === 'template' && elem.slotTarget === 'default');
|
|
1519
|
-
if (defaultSlot) {
|
|
1520
|
-
childEmpty = !defaultSlot.children.length;
|
|
1521
|
-
}
|
|
1522
|
-
if (childEmpty) {
|
|
1523
|
-
let addEmpty = true;
|
|
1524
|
-
if (['u-grid-view',
|
|
1525
|
-
'u-list-view',
|
|
1526
|
-
'van-list-view',
|
|
1527
|
-
'van-grid-view',
|
|
1528
|
-
'u-carousel'].includes(el.tag)) {
|
|
1529
|
-
const hasDataSource = el.bindAttrs.find((attr) => attr.name === 'data-source');
|
|
1530
|
-
addEmpty = !hasDataSource;
|
|
1531
|
-
}
|
|
1532
|
-
if (el.tag === 'u-crumb') {
|
|
1533
|
-
const attrList = el.bindAttrs;
|
|
1534
|
-
const hasAuto = attrList.some((attr) => attr.name === 'auto' && String(attr.value) === 'true');
|
|
1535
|
-
if (hasAuto)
|
|
1536
|
-
addEmpty = false;
|
|
1537
|
-
}
|
|
1538
|
-
if (['u-select', 'u-dropdown', 'u-panel', 'u-toc', 'u-toc-item', 'u-tree-view-new', 'u-tree-view-node-new', 'u-tree-select', 'u-tree-select-new', 'u-anchor', 'u-drawer', 'u-timeline', 'u-tabs'].includes(el.tag)) {
|
|
1539
|
-
addEmpty = false;
|
|
1540
|
-
}
|
|
1541
|
-
const background = (emptySlot && emptySlot['empty-background']) || (hasSupport ? 'add-sub' : '');
|
|
1542
|
-
addEmpty && parts.push(`vusion-empty-background="${background}"`);
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
if (['u-router-view', 'van-router-view'].includes(el.tag)) {
|
|
1546
|
-
const excludes = ['background-color:', 'background:', 'background-image:'];
|
|
1547
|
-
if (excludes.some((key) => (el.staticStyle && el.staticStyle.includes(key)))) {
|
|
1548
|
-
parts.push(':designer="false"');
|
|
1549
|
-
}
|
|
1550
|
-
}
|
|
1551
|
-
return parts;
|
|
1552
|
-
},
|
|
1553
|
-
});
|
|
1554
|
-
}
|
|
1555
|
-
// 获取currentList
|
|
1556
|
-
getCurrentList() {
|
|
1557
|
-
const argsList = [];
|
|
1558
|
-
let parent = this.parentNode;
|
|
1559
|
-
let index = 0;
|
|
1560
|
-
while (parent && parent.concept !== 'View') {
|
|
1561
|
-
if (parent.slotScope) {
|
|
1562
|
-
argsList.push(index === 0 ? 'current' : 'current' + index);
|
|
1563
|
-
index++;
|
|
1564
|
-
}
|
|
1565
|
-
parent = parent.parentNode;
|
|
1566
|
-
}
|
|
1567
|
-
return argsList;
|
|
1568
|
-
}
|
|
1569
|
-
get refName() {
|
|
1570
|
-
let refName = this.name;
|
|
1571
|
-
const list = this.getCurrentList();
|
|
1572
|
-
if (Array.isArray(list) && list.length) {
|
|
1573
|
-
list.forEach((item) => {
|
|
1574
|
-
refName += `_\${(${item} || {}).__nodeKey || (${item} || {}).index}`;
|
|
1575
|
-
});
|
|
1576
|
-
}
|
|
1577
|
-
return refName;
|
|
1578
|
-
}
|
|
1579
|
-
/**
|
|
1580
|
-
* 转换成 Vue 的模板格式
|
|
1581
|
-
*/
|
|
1582
|
-
toVue(options) {
|
|
1583
|
-
let currentList = [];
|
|
1584
|
-
if (Array.isArray(options?.currentList)) {
|
|
1585
|
-
currentList = [...options?.currentList];
|
|
1586
|
-
}
|
|
1587
|
-
if (this.slotScope) {
|
|
1588
|
-
currentList.unshift(this.slotScope);
|
|
1589
|
-
}
|
|
1590
|
-
const newOptions = Object.assign({
|
|
1591
|
-
indentStyle: 'space',
|
|
1592
|
-
tabSize: 4,
|
|
1593
|
-
indentLevel: 0,
|
|
1594
|
-
aslIdAttr: false,
|
|
1595
|
-
nodePathAttr: false,
|
|
1596
|
-
getExtraParts: () => [],
|
|
1597
|
-
attrFormat: (attr, element, defaultResult) => defaultResult,
|
|
1598
|
-
bindStylesFormat: (bindStyles, element) => {
|
|
1599
|
-
if (bindStyles.length === 0)
|
|
1600
|
-
return false;
|
|
1601
|
-
return `:style="{${bindStyles
|
|
1602
|
-
.map((item) => item.toVue())
|
|
1603
|
-
.filter((item) => item !== undefined)
|
|
1604
|
-
.join(', ')}}"`;
|
|
1605
|
-
},
|
|
1606
|
-
}, options, {
|
|
1607
|
-
currentList,
|
|
1608
|
-
});
|
|
1609
|
-
const tabString = ' '.repeat(newOptions.tabSize * newOptions.indentLevel);
|
|
1610
|
-
const insideTabString = ' '.repeat(newOptions.tabSize * (newOptions.indentLevel + 1));
|
|
1611
|
-
let shouldIndent = true;
|
|
1612
|
-
const content = !this.children ? '' : this.children
|
|
1613
|
-
.map((element) => {
|
|
1614
|
-
const childOptions = Object.assign({}, newOptions);
|
|
1615
|
-
childOptions.indentLevel++;
|
|
1616
|
-
return (shouldIndent ? '\n' + insideTabString : '') + element?.toVue(childOptions);
|
|
1617
|
-
})
|
|
1618
|
-
.join('');
|
|
1619
|
-
if (!content.length) {
|
|
1620
|
-
shouldIndent = false;
|
|
1621
|
-
}
|
|
1622
|
-
const parts = [];
|
|
1623
|
-
if (newOptions.aslIdAttr) {
|
|
1624
|
-
if (newOptions.aslIdAttr === true) {
|
|
1625
|
-
newOptions.aslIdAttr = 'asl-id';
|
|
1626
|
-
}
|
|
1627
|
-
parts.push(`${newOptions.aslIdAttr}="${this.id}"`);
|
|
1628
|
-
}
|
|
1629
|
-
if (newOptions.nodePathAttr) {
|
|
1630
|
-
// 注入 asl 的 node-path
|
|
1631
|
-
parts.push(`vusion-node-path="${this.nodePath}"`);
|
|
1632
|
-
}
|
|
1633
|
-
// 模板里解析时候,可能会有多级嵌套的 current,所以当前有多少的长度,当前就是多大的下标
|
|
1634
|
-
this.slotTarget && parts.push(`#${this.slotTarget}` + (this.slotScope ? `="${currentList.length > 1 ? this.slotScope + (currentList.length - 1) : this.slotScope}"` : ''));
|
|
1635
|
-
this.refName && parts.push(`:ref="\`${this.refName}\`"`);
|
|
1636
|
-
this.staticClass && parts.push(`class="${this.staticClass}"`);
|
|
1637
|
-
this.staticStyle && parts.push(`style="${this.staticStyle}"`);
|
|
1638
|
-
const vIfs = [];
|
|
1639
|
-
[].concat(this.bindAttrs, this.bindDirectives, this.bindEvents).forEach((attr) => {
|
|
1640
|
-
const result = newOptions.attrFormat(attr, this, attr?.toVue(newOptions));
|
|
1641
|
-
// v-auth v-if 都翻译成 v-if
|
|
1642
|
-
if (attr instanceof BindDirective__1.default && ['if', 'auth'].includes(attr.name) && result !== false) {
|
|
1643
|
-
const expr = result.replace(/v-(if|auth)="(.*)"/, (match, p1, p2) => p2);
|
|
1644
|
-
if (expr)
|
|
1645
|
-
vIfs.push(attr.name === 'if' ? expr : `$auth.has(${expr})`);
|
|
1646
|
-
return;
|
|
1647
|
-
}
|
|
1648
|
-
result && parts.push(result);
|
|
1649
|
-
});
|
|
1650
|
-
if (vIfs.length === 2)
|
|
1651
|
-
parts.push(`v-if="(${vIfs[0]}) && (${vIfs[1]})"`);
|
|
1652
|
-
else if (vIfs.length === 1)
|
|
1653
|
-
parts.push(`v-if="${vIfs[0]}"`);
|
|
1654
|
-
const bindStyles = newOptions.bindStylesFormat(this.bindStyles, this);
|
|
1655
|
-
if (bindStyles)
|
|
1656
|
-
parts.push(bindStyles);
|
|
1657
|
-
newOptions.getExtraParts(this).forEach((part) => parts.push(part));
|
|
1658
|
-
if (['u-modal', 'u-drawer'].includes(this.tag)) {
|
|
1659
|
-
this.children.forEach((citem) => {
|
|
1660
|
-
if (citem.tag === 'template' && !citem.children.length) {
|
|
1661
|
-
parts.push(`:is-${citem.slotTarget}-slot-empty=true`);
|
|
1662
|
-
}
|
|
1663
|
-
});
|
|
1664
|
-
}
|
|
1665
|
-
// 部分组件增加 key 唯一标识,防止 vue 判断重复节点,导致渲染异常
|
|
1666
|
-
if (this.name && ['u-table-view', 'u-list-view', 'u-grid-view', 'u-list-components', 'u-form', 'u-select'].includes(this.tag)) {
|
|
1667
|
-
this.name && parts.push(`key="${this.name}"`);
|
|
1668
|
-
}
|
|
1669
|
-
let partsLength = 0;
|
|
1670
|
-
let partsString = '';
|
|
1671
|
-
parts.forEach((part) => {
|
|
1672
|
-
if (partsLength >= 120 || part.length >= 120) {
|
|
1673
|
-
partsString += '\n' + tabString + ' '.repeat(3); // ' '.repeat(el.tag.length + 1);
|
|
1674
|
-
partsLength = 0;
|
|
1675
|
-
}
|
|
1676
|
-
partsString += ' ' + part;
|
|
1677
|
-
partsLength += part.length;
|
|
1678
|
-
});
|
|
1679
|
-
let htmlContent = `<${this.tag}${partsString.length ? partsString : ''}>` + content + (shouldIndent ? '\n' + tabString : '') + `</${this.tag}>`;
|
|
1680
|
-
if (!content.trim() && selfClosingTag.includes(this.tag)) {
|
|
1681
|
-
htmlContent = `<${this.tag}${partsString.length ? partsString : ''} />`;
|
|
1682
|
-
}
|
|
1683
|
-
return htmlContent;
|
|
1684
|
-
}
|
|
1685
|
-
/**
|
|
1686
|
-
* 从父级删除该节点
|
|
1687
|
-
* @internal
|
|
1688
|
-
*/
|
|
1689
|
-
delete() {
|
|
1690
|
-
super.delete();
|
|
1691
|
-
if (this.parentNode) {
|
|
1692
|
-
this.traverseChildren((ele) => {
|
|
1693
|
-
this.view?.removeExistingViewElement(ele);
|
|
1694
|
-
});
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
findElementByName(name) {
|
|
1698
|
-
return utils.traverse((current) => {
|
|
1699
|
-
if (current.node.name === name)
|
|
1700
|
-
return current.node;
|
|
1701
|
-
}, { node: this });
|
|
1702
|
-
}
|
|
1703
|
-
findElementByTag(tag) {
|
|
1704
|
-
return utils.traverse((current) => {
|
|
1705
|
-
if (current.node.tag === tag)
|
|
1706
|
-
return current.node;
|
|
1707
|
-
}, { node: this });
|
|
1708
|
-
}
|
|
1709
|
-
findElementByAttr(name, value) {
|
|
1710
|
-
return utils.traverse((current) => {
|
|
1711
|
-
if (current.node.bindAttrs.some((attr) => attr.name === name && attr.value === value))
|
|
1712
|
-
return current.node;
|
|
1713
|
-
}, { node: this });
|
|
1714
|
-
}
|
|
1715
|
-
computedStyle = {};
|
|
1716
|
-
getCurrentName() {
|
|
1717
|
-
let current = 'current';
|
|
1718
|
-
let parent = this.parentNode;
|
|
1719
|
-
let index = 0;
|
|
1720
|
-
while (parent && parent.concept !== 'View') {
|
|
1721
|
-
if (parent.slotScope) {
|
|
1722
|
-
index++;
|
|
1723
|
-
}
|
|
1724
|
-
parent = parent.parentNode;
|
|
1725
|
-
}
|
|
1726
|
-
current = (index === 0 ? 'current' : 'current' + index);
|
|
1727
|
-
return current;
|
|
1728
|
-
}
|
|
1729
|
-
/**
|
|
1730
|
-
* 计算约束样式
|
|
1731
|
-
*/
|
|
1732
|
-
computeConstraintStyle(nodeRect, parentRect) {
|
|
1733
|
-
const staticWidth = nodeRect.width;
|
|
1734
|
-
const staticHeight = nodeRect.height;
|
|
1735
|
-
const staticLeft = nodeRect.x - parentRect.x;
|
|
1736
|
-
const staticTop = nodeRect.y - parentRect.y;
|
|
1737
|
-
const staticRight = (parentRect.width - nodeRect.width - staticLeft);
|
|
1738
|
-
const staticBottom = (parentRect.height - nodeRect.height - staticTop);
|
|
1739
|
-
const styleObj = this.parseStyleToObject(this.staticStyle);
|
|
1740
|
-
const constraintX = styleObj['--constraint-x'] || 'left';
|
|
1741
|
-
const constraintY = styleObj['--constraint-y'] || 'top';
|
|
1742
|
-
const rawWidth = styleObj.width || '';
|
|
1743
|
-
const rawHeight = styleObj.height || '';
|
|
1744
|
-
let left = '';
|
|
1745
|
-
let right = '';
|
|
1746
|
-
let top = '';
|
|
1747
|
-
let bottom = '';
|
|
1748
|
-
let transform = '';
|
|
1749
|
-
// 如果宽高被约束规则改成 auto 了,就还原为上次的宽高,防止用户设置的宽高信息在切换约束时候丢失
|
|
1750
|
-
let width = Number(styleObj['--constraint-width-auto']) ? styleObj['--last-width'] : rawWidth;
|
|
1751
|
-
let height = Number(styleObj['--constraint-height-auto']) ? styleObj['--last-height'] : rawHeight;
|
|
1752
|
-
// 用于记录宽高是否被约束规则改成 auto 了
|
|
1753
|
-
let constraintWidthAuto = 0;
|
|
1754
|
-
let constraintHeightAuto = 0;
|
|
1755
|
-
const parentWidth = staticLeft + staticWidth + staticRight;
|
|
1756
|
-
const parentHeight = staticTop + staticHeight + staticBottom;
|
|
1757
|
-
if (constraintX === 'left') {
|
|
1758
|
-
left = staticLeft + 'px';
|
|
1759
|
-
right = '';
|
|
1760
|
-
}
|
|
1761
|
-
else if (constraintX === 'right') {
|
|
1762
|
-
left = '';
|
|
1763
|
-
right = staticRight + 'px';
|
|
1764
|
-
}
|
|
1765
|
-
else if (constraintX === 'center') {
|
|
1766
|
-
const offset = staticLeft + staticWidth / 2 - parentWidth / 2;
|
|
1767
|
-
left = `calc(50% ${offset > 0 ? '+' : '-'} ${Math.abs(offset)}px)`;
|
|
1768
|
-
right = '';
|
|
1769
|
-
transform = 'translateX(-50%)';
|
|
1770
|
-
}
|
|
1771
|
-
else if (constraintX === 'scale') {
|
|
1772
|
-
left = staticLeft * 100 / parentWidth + '%';
|
|
1773
|
-
right = '';
|
|
1774
|
-
width = staticWidth * 100 / parentWidth + '%';
|
|
1775
|
-
constraintWidthAuto = 1;
|
|
1776
|
-
}
|
|
1777
|
-
else if (constraintX === 'left-right') {
|
|
1778
|
-
left = staticLeft + 'px';
|
|
1779
|
-
right = staticRight + 'px';
|
|
1780
|
-
width = 'auto';
|
|
1781
|
-
constraintWidthAuto = 1;
|
|
1782
|
-
}
|
|
1783
|
-
if (constraintY === 'top') {
|
|
1784
|
-
top = staticTop + 'px';
|
|
1785
|
-
bottom = '';
|
|
1786
|
-
}
|
|
1787
|
-
else if (constraintY === 'bottom') {
|
|
1788
|
-
top = '';
|
|
1789
|
-
bottom = staticBottom + 'px';
|
|
1790
|
-
}
|
|
1791
|
-
else if (constraintY === 'center') {
|
|
1792
|
-
const offset = staticTop + staticHeight / 2 - parentHeight / 2;
|
|
1793
|
-
top = `calc(50% ${offset > 0 ? '+' : '-'} ${Math.abs(offset)}px)`;
|
|
1794
|
-
bottom = '';
|
|
1795
|
-
transform = transform ? 'translate(-50%, -50%)' : 'translateY(-50%)';
|
|
1796
|
-
}
|
|
1797
|
-
else if (constraintY === 'scale') {
|
|
1798
|
-
top = staticTop * 100 / parentHeight + '%';
|
|
1799
|
-
bottom = '';
|
|
1800
|
-
height = staticHeight * 100 / parentHeight + '%';
|
|
1801
|
-
constraintHeightAuto = 1;
|
|
1802
|
-
}
|
|
1803
|
-
else if (constraintY === 'top-bottom') {
|
|
1804
|
-
top = staticTop + 'px';
|
|
1805
|
-
bottom = staticBottom + 'px';
|
|
1806
|
-
height = 'auto';
|
|
1807
|
-
constraintHeightAuto = 1;
|
|
1808
|
-
}
|
|
1809
|
-
const newStyleObj = {
|
|
1810
|
-
...styleObj,
|
|
1811
|
-
left,
|
|
1812
|
-
right,
|
|
1813
|
-
top,
|
|
1814
|
-
bottom,
|
|
1815
|
-
transform,
|
|
1816
|
-
width,
|
|
1817
|
-
height,
|
|
1818
|
-
'--constraint-width-auto': constraintWidthAuto,
|
|
1819
|
-
'--constraint-height-auto': constraintHeightAuto,
|
|
1820
|
-
// 如果上次已经是 auto 了,就用上上次的宽高
|
|
1821
|
-
'--last-width': rawWidth === 'auto' ? styleObj['--last-width'] : rawWidth,
|
|
1822
|
-
'--last-height': rawHeight === 'auto' ? styleObj['--last-height'] : rawHeight,
|
|
1823
|
-
};
|
|
1824
|
-
const newStaticStyle = this.stringifyStyleAttr(newStyleObj);
|
|
1825
|
-
this.update({
|
|
1826
|
-
staticStyle: newStaticStyle,
|
|
1827
|
-
});
|
|
1828
|
-
}
|
|
1829
|
-
parseStyleToObject(styleStr = '') {
|
|
1830
|
-
const styleObj = styleStr.split(/;/gim).reduce((obj, item) => {
|
|
1831
|
-
// background-image:url(http://www...)
|
|
1832
|
-
item = item.trim();
|
|
1833
|
-
const pos = item.indexOf(':');
|
|
1834
|
-
if (pos >= 0) {
|
|
1835
|
-
const key = item.slice(0, pos).trim();
|
|
1836
|
-
const value = item.slice(pos + 1).trim();
|
|
1837
|
-
obj[key] = value;
|
|
1838
|
-
}
|
|
1839
|
-
return obj;
|
|
1840
|
-
}, {});
|
|
1841
|
-
return styleObj;
|
|
1842
|
-
}
|
|
1843
|
-
stringifyStyleAttr(styleObj) {
|
|
1844
|
-
return Object.keys(styleObj)
|
|
1845
|
-
.map((key) => `${key}:${String(styleObj[key]).trim()};`)
|
|
1846
|
-
.join('');
|
|
1847
|
-
}
|
|
1848
|
-
};
|
|
1849
|
-
__decorate([
|
|
1850
|
-
(0, decorators_1.property)()
|
|
1851
|
-
], ViewElement.prototype, "concept", void 0);
|
|
1852
|
-
__decorate([
|
|
1853
|
-
(0, decorators_1.property)()
|
|
1854
|
-
], ViewElement.prototype, "type", void 0);
|
|
1855
|
-
__decorate([
|
|
1856
|
-
(0, decorators_1.property)()
|
|
1857
|
-
], ViewElement.prototype, "tag", void 0);
|
|
1858
|
-
__decorate([
|
|
1859
|
-
(0, decorators_1.property)()
|
|
1860
|
-
], ViewElement.prototype, "name", void 0);
|
|
1861
|
-
__decorate([
|
|
1862
|
-
(0, decorators_1.property)()
|
|
1863
|
-
], ViewElement.prototype, "staticClass", void 0);
|
|
1864
|
-
__decorate([
|
|
1865
|
-
(0, decorators_1.property)()
|
|
1866
|
-
], ViewElement.prototype, "staticStyle", void 0);
|
|
1867
|
-
__decorate([
|
|
1868
|
-
(0, decorators_1.property)()
|
|
1869
|
-
], ViewElement.prototype, "authDescription", void 0);
|
|
1870
|
-
__decorate([
|
|
1871
|
-
(0, decorators_1.property)()
|
|
1872
|
-
], ViewElement.prototype, "slotTarget", void 0);
|
|
1873
|
-
__decorate([
|
|
1874
|
-
(0, decorators_1.property)()
|
|
1875
|
-
], ViewElement.prototype, "slotScope", void 0);
|
|
1876
|
-
__decorate([
|
|
1877
|
-
(0, decorators_1.property)('BindAttribute')
|
|
1878
|
-
], ViewElement.prototype, "bindAttrs", void 0);
|
|
1879
|
-
__decorate([
|
|
1880
|
-
(0, decorators_1.property)('BindEvent')
|
|
1881
|
-
], ViewElement.prototype, "bindEvents", void 0);
|
|
1882
|
-
__decorate([
|
|
1883
|
-
(0, decorators_1.property)('BindDirective')
|
|
1884
|
-
], ViewElement.prototype, "bindDirectives", void 0);
|
|
1885
|
-
__decorate([
|
|
1886
|
-
(0, decorators_1.property)()
|
|
1887
|
-
], ViewElement.prototype, "bindRoles", void 0);
|
|
1888
|
-
__decorate([
|
|
1889
|
-
(0, decorators_1.property)('BindStyle')
|
|
1890
|
-
], ViewElement.prototype, "bindStyles", void 0);
|
|
1891
|
-
__decorate([
|
|
1892
|
-
(0, decorators_1.property)('ViewElement')
|
|
1893
|
-
], ViewElement.prototype, "children", void 0);
|
|
1894
|
-
__decorate([
|
|
1895
|
-
(0, translator_1.withSourceMap)()
|
|
1896
|
-
], ViewElement.prototype, "toEmbeddedTS", null);
|
|
1897
|
-
__decorate([
|
|
1898
|
-
(0, decorators_1.excludedInJSON)()
|
|
1899
|
-
], ViewElement.prototype, "computedStyle", void 0);
|
|
1900
|
-
ViewElement = ViewElement_1 = __decorate([
|
|
1901
|
-
(0, decorators_1.concept)('页面元素')
|
|
1902
|
-
], ViewElement);
|
|
1903
|
-
exports.ViewElement = ViewElement;
|
|
1904
|
-
classMap_1.default.ViewElement = ViewElement;
|
|
1905
|
-
exports.default = ViewElement;
|
|
1906
|
-
//================================================================================
|
|
1907
|
-
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1908
|
-
// 自动生成的代码已结束。下面可以手动编写。
|
|
1909
|
-
//================================================================================
|
|
1910
|
-
//# sourceMappingURL=ViewElement__.js.map
|