@lcap/nasl 3.6.0-alpha.7 → 3.6.0-alpha.8

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.
Files changed (934) hide show
  1. package/out/automate/engine/index.d.ts +4 -0
  2. package/out/automate/engine/index.js +443 -0
  3. package/out/automate/engine/index.js.map +1 -0
  4. package/out/automate/engine/operators.d.ts +26 -0
  5. package/out/automate/engine/operators.js +364 -0
  6. package/out/automate/engine/operators.js.map +1 -0
  7. package/out/automate/engine/uniqueName.d.ts +12 -0
  8. package/out/automate/engine/uniqueName.js +116 -0
  9. package/out/automate/engine/uniqueName.js.map +1 -0
  10. package/out/automate/engine/utils.d.ts +25 -0
  11. package/out/automate/engine/utils.js +440 -0
  12. package/out/automate/engine/utils.js.map +1 -0
  13. package/out/automate/engine/viewCache.d.ts +19 -0
  14. package/out/automate/engine/viewCache.js +45 -0
  15. package/out/automate/engine/viewCache.js.map +1 -0
  16. package/out/automate/template/myProcess.d.ts +10 -0
  17. package/out/automate/template/myProcess.js +11502 -0
  18. package/out/automate/template/myProcess.js.map +1 -0
  19. package/out/automate/upgrader/2.12.d.ts +7 -0
  20. package/out/automate/upgrader/2.12.js +63 -0
  21. package/out/automate/upgrader/2.12.js.map +1 -0
  22. package/out/automate/upgrader/2.14-components.d.ts +1115 -0
  23. package/out/automate/upgrader/2.14-components.js +1087 -0
  24. package/out/automate/upgrader/2.14-components.js.map +1 -0
  25. package/out/automate/upgrader/2.14.d.ts +10 -0
  26. package/out/automate/upgrader/2.14.js +236 -0
  27. package/out/automate/upgrader/2.14.js.map +1 -0
  28. package/out/automate/upgrader/2.14.old.d.ts +1 -0
  29. package/out/automate/upgrader/2.14.old.js +125 -0
  30. package/out/automate/upgrader/2.14.old.js.map +1 -0
  31. package/out/automate/upgrader/2.16.d.ts +10 -0
  32. package/out/automate/upgrader/2.16.js +75 -0
  33. package/out/automate/upgrader/2.16.js.map +1 -0
  34. package/out/automate/upgrader/2.17.d.ts +21 -0
  35. package/out/automate/upgrader/2.17.js +557 -0
  36. package/out/automate/upgrader/2.17.js.map +1 -0
  37. package/out/automate/upgrader/2.18.d.ts +10 -0
  38. package/out/automate/upgrader/2.18.js +107 -0
  39. package/out/automate/upgrader/2.18.js.map +1 -0
  40. package/out/automate/upgrader/2.20.d.ts +17 -0
  41. package/out/automate/upgrader/2.20.js +68 -0
  42. package/out/automate/upgrader/2.20.js.map +1 -0
  43. package/out/bak/translator.d.ts +1 -0
  44. package/out/bak/translator.js +305 -0
  45. package/out/bak/translator.js.map +1 -0
  46. package/out/breakpoint/generator/AfterStartNode.d.ts +7 -0
  47. package/out/breakpoint/generator/AfterStartNode.js +30 -0
  48. package/out/breakpoint/generator/AfterStartNode.js.map +1 -0
  49. package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -0
  50. package/out/breakpoint/generator/BeforeEndNode.js +28 -0
  51. package/out/breakpoint/generator/BeforeEndNode.js.map +1 -0
  52. package/out/breakpoint/generator/BreakpointNode.d.ts +18 -0
  53. package/out/breakpoint/generator/BreakpointNode.js +293 -0
  54. package/out/breakpoint/generator/BreakpointNode.js.map +1 -0
  55. package/out/breakpoint/generator/CallbackNode.d.ts +4 -0
  56. package/out/breakpoint/generator/CallbackNode.js +37 -0
  57. package/out/breakpoint/generator/CallbackNode.js.map +1 -0
  58. package/out/breakpoint/generator/FragmentNode.d.ts +4 -0
  59. package/out/breakpoint/generator/FragmentNode.js +18 -0
  60. package/out/breakpoint/generator/FragmentNode.js.map +1 -0
  61. package/out/breakpoint/generator/index.d.ts +4 -0
  62. package/out/breakpoint/generator/index.js +119 -0
  63. package/out/breakpoint/generator/index.js.map +1 -0
  64. package/out/breakpoint/index.d.ts +3 -0
  65. package/out/breakpoint/index.js +20 -0
  66. package/out/breakpoint/index.js.map +1 -0
  67. package/out/breakpoint/shared/constants.d.ts +37 -0
  68. package/out/breakpoint/shared/constants.js +108 -0
  69. package/out/breakpoint/shared/constants.js.map +1 -0
  70. package/out/breakpoint/shared/index.d.ts +3 -0
  71. package/out/breakpoint/shared/index.js +33 -0
  72. package/out/breakpoint/shared/index.js.map +1 -0
  73. package/out/breakpoint/shared/operations.d.ts +10 -0
  74. package/out/breakpoint/shared/operations.js +25 -0
  75. package/out/breakpoint/shared/operations.js.map +1 -0
  76. package/out/breakpoint/shared/socket.d.ts +48 -0
  77. package/out/breakpoint/shared/socket.js +257 -0
  78. package/out/breakpoint/shared/socket.js.map +1 -0
  79. package/out/breakpoint/shared/utils.d.ts +27 -0
  80. package/out/breakpoint/shared/utils.js +217 -0
  81. package/out/breakpoint/shared/utils.js.map +1 -0
  82. package/out/breakpoint/store/core.d.ts +80 -0
  83. package/out/breakpoint/store/core.js +416 -0
  84. package/out/breakpoint/store/core.js.map +1 -0
  85. package/out/breakpoint/store/dock.d.ts +1 -0
  86. package/out/breakpoint/store/dock.js +160 -0
  87. package/out/breakpoint/store/dock.js.map +1 -0
  88. package/out/breakpoint/store/index.d.ts +2 -0
  89. package/out/breakpoint/store/index.js +19 -0
  90. package/out/breakpoint/store/index.js.map +1 -0
  91. package/out/common/BaseNode.d.ts +377 -0
  92. package/out/common/BaseNode.js +1432 -0
  93. package/out/common/BaseNode.js.map +1 -0
  94. package/out/common/Command.d.ts +21 -0
  95. package/out/common/Command.js +79 -0
  96. package/out/common/Command.js.map +1 -0
  97. package/out/common/ComponentAPI.d.ts +112 -0
  98. package/out/common/ComponentAPI.js +3 -0
  99. package/out/common/ComponentAPI.js.map +1 -0
  100. package/out/common/EventEmitter.d.ts +61 -0
  101. package/out/common/EventEmitter.js +71 -0
  102. package/out/common/EventEmitter.js.map +1 -0
  103. package/out/common/Messager.d.ts +91 -0
  104. package/out/common/Messager.js +205 -0
  105. package/out/common/Messager.js.map +1 -0
  106. package/out/common/asyncFuncMap.d.ts +2 -0
  107. package/out/common/asyncFuncMap.js +16 -0
  108. package/out/common/asyncFuncMap.js.map +1 -0
  109. package/out/common/index.d.ts +4 -0
  110. package/out/common/index.js +21 -0
  111. package/out/common/index.js.map +1 -0
  112. package/out/common/utils.d.ts +2 -0
  113. package/out/common/utils.js +18 -0
  114. package/out/common/utils.js.map +1 -0
  115. package/out/concepts/Abort__.d.ts +28 -0
  116. package/out/concepts/Abort__.js +80 -0
  117. package/out/concepts/Abort__.js.map +1 -0
  118. package/out/concepts/AbstractInterface__.d.ts +22 -0
  119. package/out/concepts/AbstractInterface__.js +56 -0
  120. package/out/concepts/AbstractInterface__.js.map +1 -0
  121. package/out/concepts/Anchor__.d.ts +48 -0
  122. package/out/concepts/Anchor__.js +200 -0
  123. package/out/concepts/Anchor__.js.map +1 -0
  124. package/out/concepts/AnonymousFunction__.d.ts +180 -0
  125. package/out/concepts/AnonymousFunction__.js +555 -0
  126. package/out/concepts/AnonymousFunction__.js.map +1 -0
  127. package/out/concepts/App__.d.ts +1818 -0
  128. package/out/concepts/App__.js +2983 -0
  129. package/out/concepts/App__.js.map +1 -0
  130. package/out/concepts/Argument__.d.ts +70 -0
  131. package/out/concepts/Argument__.js +270 -0
  132. package/out/concepts/Argument__.js.map +1 -0
  133. package/out/concepts/Assignee__.d.ts +291 -0
  134. package/out/concepts/Assignee__.js +461 -0
  135. package/out/concepts/Assignee__.js.map +1 -0
  136. package/out/concepts/AssignmentLine__.d.ts +44 -0
  137. package/out/concepts/AssignmentLine__.js +114 -0
  138. package/out/concepts/AssignmentLine__.js.map +1 -0
  139. package/out/concepts/Assignment__.d.ts +77 -0
  140. package/out/concepts/Assignment__.js +338 -0
  141. package/out/concepts/Assignment__.js.map +1 -0
  142. package/out/concepts/Attribute__.d.ts +112 -0
  143. package/out/concepts/Attribute__.js +208 -0
  144. package/out/concepts/Attribute__.js.map +1 -0
  145. package/out/concepts/AuthInterface__.d.ts +38 -0
  146. package/out/concepts/AuthInterface__.js +74 -0
  147. package/out/concepts/AuthInterface__.js.map +1 -0
  148. package/out/concepts/AuthLogicForCallInterface__.d.ts +141 -0
  149. package/out/concepts/AuthLogicForCallInterface__.js +514 -0
  150. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
  151. package/out/concepts/AuthLogic__.d.ts +69 -0
  152. package/out/concepts/AuthLogic__.js +210 -0
  153. package/out/concepts/AuthLogic__.js.map +1 -0
  154. package/out/concepts/BackendVariable__.d.ts +145 -0
  155. package/out/concepts/BackendVariable__.js +502 -0
  156. package/out/concepts/BackendVariable__.js.map +1 -0
  157. package/out/concepts/Backend__.d.ts +134 -0
  158. package/out/concepts/Backend__.js +280 -0
  159. package/out/concepts/Backend__.js.map +1 -0
  160. package/out/concepts/BatchAssignment__.d.ts +255 -0
  161. package/out/concepts/BatchAssignment__.js +881 -0
  162. package/out/concepts/BatchAssignment__.js.map +1 -0
  163. package/out/concepts/BinaryExpression__.d.ts +76 -0
  164. package/out/concepts/BinaryExpression__.js +422 -0
  165. package/out/concepts/BinaryExpression__.js.map +1 -0
  166. package/out/concepts/BindAttribute__.d.ts +329 -0
  167. package/out/concepts/BindAttribute__.js +1130 -0
  168. package/out/concepts/BindAttribute__.js.map +1 -0
  169. package/out/concepts/BindDirective__.d.ts +170 -0
  170. package/out/concepts/BindDirective__.js +573 -0
  171. package/out/concepts/BindDirective__.js.map +1 -0
  172. package/out/concepts/BindEvent__.d.ts +254 -0
  173. package/out/concepts/BindEvent__.js +959 -0
  174. package/out/concepts/BindEvent__.js.map +1 -0
  175. package/out/concepts/BindStyle__.d.ts +142 -0
  176. package/out/concepts/BindStyle__.js +453 -0
  177. package/out/concepts/BindStyle__.js.map +1 -0
  178. package/out/concepts/Block__.d.ts +84 -0
  179. package/out/concepts/Block__.js +215 -0
  180. package/out/concepts/Block__.js.map +1 -0
  181. package/out/concepts/BooleanLiteral__.d.ts +38 -0
  182. package/out/concepts/BooleanLiteral__.js +97 -0
  183. package/out/concepts/BooleanLiteral__.js.map +1 -0
  184. package/out/concepts/BusinessComponent__.d.ts +641 -0
  185. package/out/concepts/BusinessComponent__.js +1944 -0
  186. package/out/concepts/BusinessComponent__.js.map +1 -0
  187. package/out/concepts/BusinessLogic__.d.ts +38 -0
  188. package/out/concepts/BusinessLogic__.js +358 -0
  189. package/out/concepts/BusinessLogic__.js.map +1 -0
  190. package/out/concepts/CallAuthInterface__.d.ts +130 -0
  191. package/out/concepts/CallAuthInterface__.js +438 -0
  192. package/out/concepts/CallAuthInterface__.js.map +1 -0
  193. package/out/concepts/CallConnector__.d.ts +49 -0
  194. package/out/concepts/CallConnector__.js +257 -0
  195. package/out/concepts/CallConnector__.js.map +1 -0
  196. package/out/concepts/CallEvent__.d.ts +101 -0
  197. package/out/concepts/CallEvent__.js +280 -0
  198. package/out/concepts/CallEvent__.js.map +1 -0
  199. package/out/concepts/CallFunction__.d.ts +162 -0
  200. package/out/concepts/CallFunction__.js +600 -0
  201. package/out/concepts/CallFunction__.js.map +1 -0
  202. package/out/concepts/CallInterface__.d.ts +136 -0
  203. package/out/concepts/CallInterface__.js +814 -0
  204. package/out/concepts/CallInterface__.js.map +1 -0
  205. package/out/concepts/CallLogic__.d.ts +235 -0
  206. package/out/concepts/CallLogic__.js +1361 -0
  207. package/out/concepts/CallLogic__.js.map +1 -0
  208. package/out/concepts/CallQueryComponent__.d.ts +435 -0
  209. package/out/concepts/CallQueryComponent__.js +1235 -0
  210. package/out/concepts/CallQueryComponent__.js.map +1 -0
  211. package/out/concepts/Comment__.d.ts +35 -0
  212. package/out/concepts/Comment__.js +94 -0
  213. package/out/concepts/Comment__.js.map +1 -0
  214. package/out/concepts/CompletionProperty__.d.ts +107 -0
  215. package/out/concepts/CompletionProperty__.js +239 -0
  216. package/out/concepts/CompletionProperty__.js.map +1 -0
  217. package/out/concepts/ConfigGroup__.d.ts +127 -0
  218. package/out/concepts/ConfigGroup__.js +258 -0
  219. package/out/concepts/ConfigGroup__.js.map +1 -0
  220. package/out/concepts/ConfigPropertyValue__.d.ts +47 -0
  221. package/out/concepts/ConfigPropertyValue__.js +93 -0
  222. package/out/concepts/ConfigPropertyValue__.js.map +1 -0
  223. package/out/concepts/ConfigProperty__.d.ts +153 -0
  224. package/out/concepts/ConfigProperty__.js +321 -0
  225. package/out/concepts/ConfigProperty__.js.map +1 -0
  226. package/out/concepts/Configuration__.d.ts +126 -0
  227. package/out/concepts/Configuration__.js +236 -0
  228. package/out/concepts/Configuration__.js.map +1 -0
  229. package/out/concepts/Connection__.d.ts +165 -0
  230. package/out/concepts/Connection__.js +330 -0
  231. package/out/concepts/Connection__.js.map +1 -0
  232. package/out/concepts/ConnectorTrigger__.d.ts +81 -0
  233. package/out/concepts/ConnectorTrigger__.js +138 -0
  234. package/out/concepts/ConnectorTrigger__.js.map +1 -0
  235. package/out/concepts/Connector__.d.ts +929 -0
  236. package/out/concepts/Connector__.js +1343 -0
  237. package/out/concepts/Connector__.js.map +1 -0
  238. package/out/concepts/Constant__.d.ts +121 -0
  239. package/out/concepts/Constant__.js +331 -0
  240. package/out/concepts/Constant__.js.map +1 -0
  241. package/out/concepts/CountersignPolicy__.d.ts +28 -0
  242. package/out/concepts/CountersignPolicy__.js +62 -0
  243. package/out/concepts/CountersignPolicy__.js.map +1 -0
  244. package/out/concepts/DataSource__.d.ts +168 -0
  245. package/out/concepts/DataSource__.js +460 -0
  246. package/out/concepts/DataSource__.js.map +1 -0
  247. package/out/concepts/DatabaseTypeAnnotation__.d.ts +34 -0
  248. package/out/concepts/DatabaseTypeAnnotation__.js +65 -0
  249. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -0
  250. package/out/concepts/DefaultValue__.d.ts +104 -0
  251. package/out/concepts/DefaultValue__.js +242 -0
  252. package/out/concepts/DefaultValue__.js.map +1 -0
  253. package/out/concepts/Destination__.d.ts +160 -0
  254. package/out/concepts/Destination__.js +799 -0
  255. package/out/concepts/Destination__.js.map +1 -0
  256. package/out/concepts/End__.d.ts +27 -0
  257. package/out/concepts/End__.js +115 -0
  258. package/out/concepts/End__.js.map +1 -0
  259. package/out/concepts/EntityIndex__.d.ts +98 -0
  260. package/out/concepts/EntityIndex__.js +201 -0
  261. package/out/concepts/EntityIndex__.js.map +1 -0
  262. package/out/concepts/EntityProperty__.d.ts +293 -0
  263. package/out/concepts/EntityProperty__.js +824 -0
  264. package/out/concepts/EntityProperty__.js.map +1 -0
  265. package/out/concepts/Entity__.d.ts +339 -0
  266. package/out/concepts/Entity__.js +764 -0
  267. package/out/concepts/Entity__.js.map +1 -0
  268. package/out/concepts/EnumItem__.d.ts +67 -0
  269. package/out/concepts/EnumItem__.js +131 -0
  270. package/out/concepts/EnumItem__.js.map +1 -0
  271. package/out/concepts/Enum__.d.ts +138 -0
  272. package/out/concepts/Enum__.js +321 -0
  273. package/out/concepts/Enum__.js.map +1 -0
  274. package/out/concepts/Event__.d.ts +160 -0
  275. package/out/concepts/Event__.js +294 -0
  276. package/out/concepts/Event__.js.map +1 -0
  277. package/out/concepts/ExternalDestination__.d.ts +78 -0
  278. package/out/concepts/ExternalDestination__.js +309 -0
  279. package/out/concepts/ExternalDestination__.js.map +1 -0
  280. package/out/concepts/ForEachStatement__.d.ts +173 -0
  281. package/out/concepts/ForEachStatement__.js +497 -0
  282. package/out/concepts/ForEachStatement__.js.map +1 -0
  283. package/out/concepts/FrontendLibrary__.d.ts +216 -0
  284. package/out/concepts/FrontendLibrary__.js +364 -0
  285. package/out/concepts/FrontendLibrary__.js.map +1 -0
  286. package/out/concepts/FrontendType__.d.ts +308 -0
  287. package/out/concepts/FrontendType__.js +606 -0
  288. package/out/concepts/FrontendType__.js.map +1 -0
  289. package/out/concepts/FrontendVariable__.d.ts +36 -0
  290. package/out/concepts/FrontendVariable__.js +77 -0
  291. package/out/concepts/FrontendVariable__.js.map +1 -0
  292. package/out/concepts/Frontend__.d.ts +420 -0
  293. package/out/concepts/Frontend__.js +915 -0
  294. package/out/concepts/Frontend__.js.map +1 -0
  295. package/out/concepts/Function__.d.ts +420 -0
  296. package/out/concepts/Function__.js +805 -0
  297. package/out/concepts/Function__.js.map +1 -0
  298. package/out/concepts/I18nInfo__.d.ts +46 -0
  299. package/out/concepts/I18nInfo__.js +90 -0
  300. package/out/concepts/I18nInfo__.js.map +1 -0
  301. package/out/concepts/Identifier__.d.ts +59 -0
  302. package/out/concepts/Identifier__.js +326 -0
  303. package/out/concepts/Identifier__.js.map +1 -0
  304. package/out/concepts/IfStatement__.d.ts +161 -0
  305. package/out/concepts/IfStatement__.js +372 -0
  306. package/out/concepts/IfStatement__.js.map +1 -0
  307. package/out/concepts/ImportedInterface__.d.ts +20 -0
  308. package/out/concepts/ImportedInterface__.js +48 -0
  309. package/out/concepts/ImportedInterface__.js.map +1 -0
  310. package/out/concepts/Integration__.d.ts +146 -0
  311. package/out/concepts/Integration__.js +296 -0
  312. package/out/concepts/Integration__.js.map +1 -0
  313. package/out/concepts/InterfaceParam__.d.ts +146 -0
  314. package/out/concepts/InterfaceParam__.js +342 -0
  315. package/out/concepts/InterfaceParam__.js.map +1 -0
  316. package/out/concepts/Interface__.d.ts +328 -0
  317. package/out/concepts/Interface__.js +892 -0
  318. package/out/concepts/Interface__.js.map +1 -0
  319. package/out/concepts/JSBlock__.d.ts +37 -0
  320. package/out/concepts/JSBlock__.js +104 -0
  321. package/out/concepts/JSBlock__.js.map +1 -0
  322. package/out/concepts/JavaLogic__.d.ts +45 -0
  323. package/out/concepts/JavaLogic__.js +109 -0
  324. package/out/concepts/JavaLogic__.js.map +1 -0
  325. package/out/concepts/LogicItem__.d.ts +155 -0
  326. package/out/concepts/LogicItem__.js +284 -0
  327. package/out/concepts/LogicItem__.js.map +1 -0
  328. package/out/concepts/Logic__.d.ts +649 -0
  329. package/out/concepts/Logic__.js +1939 -0
  330. package/out/concepts/Logic__.js.map +1 -0
  331. package/out/concepts/MatchCase__.d.ts +261 -0
  332. package/out/concepts/MatchCase__.js +706 -0
  333. package/out/concepts/MatchCase__.js.map +1 -0
  334. package/out/concepts/Match__.d.ts +127 -0
  335. package/out/concepts/Match__.js +731 -0
  336. package/out/concepts/Match__.js.map +1 -0
  337. package/out/concepts/MemberExpression__.d.ts +80 -0
  338. package/out/concepts/MemberExpression__.js +529 -0
  339. package/out/concepts/MemberExpression__.js.map +1 -0
  340. package/out/concepts/MetadataType__.d.ts +236 -0
  341. package/out/concepts/MetadataType__.js +464 -0
  342. package/out/concepts/MetadataType__.js.map +1 -0
  343. package/out/concepts/MicroApp__.d.ts +54 -0
  344. package/out/concepts/MicroApp__.js +80 -0
  345. package/out/concepts/MicroApp__.js.map +1 -0
  346. package/out/concepts/Module__.d.ts +1171 -0
  347. package/out/concepts/Module__.js +1747 -0
  348. package/out/concepts/Module__.js.map +1 -0
  349. package/out/concepts/MsgTriggerEvent__.d.ts +140 -0
  350. package/out/concepts/MsgTriggerEvent__.js +236 -0
  351. package/out/concepts/MsgTriggerEvent__.js.map +1 -0
  352. package/out/concepts/MsgTriggerLauncher__.d.ts +129 -0
  353. package/out/concepts/MsgTriggerLauncher__.js +226 -0
  354. package/out/concepts/MsgTriggerLauncher__.js.map +1 -0
  355. package/out/concepts/MultiApprovalPolicy__.d.ts +26 -0
  356. package/out/concepts/MultiApprovalPolicy__.js +59 -0
  357. package/out/concepts/MultiApprovalPolicy__.js.map +1 -0
  358. package/out/concepts/Namespace__.d.ts +1086 -0
  359. package/out/concepts/Namespace__.js +1555 -0
  360. package/out/concepts/Namespace__.js.map +1 -0
  361. package/out/concepts/NewComposite__.d.ts +353 -0
  362. package/out/concepts/NewComposite__.js +1277 -0
  363. package/out/concepts/NewComposite__.js.map +1 -0
  364. package/out/concepts/NewList__.d.ts +141 -0
  365. package/out/concepts/NewList__.js +470 -0
  366. package/out/concepts/NewList__.js.map +1 -0
  367. package/out/concepts/NewMap__.d.ts +231 -0
  368. package/out/concepts/NewMap__.js +604 -0
  369. package/out/concepts/NewMap__.js.map +1 -0
  370. package/out/concepts/New__.d.ts +23 -0
  371. package/out/concepts/New__.js +65 -0
  372. package/out/concepts/New__.js.map +1 -0
  373. package/out/concepts/NullLiteral__.d.ts +29 -0
  374. package/out/concepts/NullLiteral__.js +77 -0
  375. package/out/concepts/NullLiteral__.js.map +1 -0
  376. package/out/concepts/NumericLiteral__.d.ts +59 -0
  377. package/out/concepts/NumericLiteral__.js +177 -0
  378. package/out/concepts/NumericLiteral__.js.map +1 -0
  379. package/out/concepts/OqlQueryComponent__.d.ts +76 -0
  380. package/out/concepts/OqlQueryComponent__.js +351 -0
  381. package/out/concepts/OqlQueryComponent__.js.map +1 -0
  382. package/out/concepts/OverriddenLogic__.d.ts +634 -0
  383. package/out/concepts/OverriddenLogic__.js +1661 -0
  384. package/out/concepts/OverriddenLogic__.js.map +1 -0
  385. package/out/concepts/Paginate__.d.ts +97 -0
  386. package/out/concepts/Paginate__.js +267 -0
  387. package/out/concepts/Paginate__.js.map +1 -0
  388. package/out/concepts/ParamWithGroup__.d.ts +39 -0
  389. package/out/concepts/ParamWithGroup__.js +85 -0
  390. package/out/concepts/ParamWithGroup__.js.map +1 -0
  391. package/out/concepts/Param__.d.ts +182 -0
  392. package/out/concepts/Param__.js +524 -0
  393. package/out/concepts/Param__.js.map +1 -0
  394. package/out/concepts/Point__.d.ts +34 -0
  395. package/out/concepts/Point__.js +65 -0
  396. package/out/concepts/Point__.js.map +1 -0
  397. package/out/concepts/ProcessComponent__.d.ts +222 -0
  398. package/out/concepts/ProcessComponent__.js +340 -0
  399. package/out/concepts/ProcessComponent__.js.map +1 -0
  400. package/out/concepts/ProcessElement__.d.ts +665 -0
  401. package/out/concepts/ProcessElement__.js +1354 -0
  402. package/out/concepts/ProcessElement__.js.map +1 -0
  403. package/out/concepts/ProcessOutcome__.d.ts +34 -0
  404. package/out/concepts/ProcessOutcome__.js +97 -0
  405. package/out/concepts/ProcessOutcome__.js.map +1 -0
  406. package/out/concepts/ProcessOutcomes__.d.ts +34 -0
  407. package/out/concepts/ProcessOutcomes__.js +104 -0
  408. package/out/concepts/ProcessOutcomes__.js.map +1 -0
  409. package/out/concepts/Process__.d.ts +615 -0
  410. package/out/concepts/Process__.js +1117 -0
  411. package/out/concepts/Process__.js.map +1 -0
  412. package/out/concepts/QueryAggregateExpression__.d.ts +54 -0
  413. package/out/concepts/QueryAggregateExpression__.js +140 -0
  414. package/out/concepts/QueryAggregateExpression__.js.map +1 -0
  415. package/out/concepts/QueryFieldExpression__.d.ts +56 -0
  416. package/out/concepts/QueryFieldExpression__.js +142 -0
  417. package/out/concepts/QueryFieldExpression__.js.map +1 -0
  418. package/out/concepts/QueryFromExpression__.d.ts +101 -0
  419. package/out/concepts/QueryFromExpression__.js +227 -0
  420. package/out/concepts/QueryFromExpression__.js.map +1 -0
  421. package/out/concepts/QueryGroupByExpression__.d.ts +50 -0
  422. package/out/concepts/QueryGroupByExpression__.js +142 -0
  423. package/out/concepts/QueryGroupByExpression__.js.map +1 -0
  424. package/out/concepts/QueryJoinExpression__.d.ts +188 -0
  425. package/out/concepts/QueryJoinExpression__.js +327 -0
  426. package/out/concepts/QueryJoinExpression__.js.map +1 -0
  427. package/out/concepts/QueryLimitExpression__.d.ts +60 -0
  428. package/out/concepts/QueryLimitExpression__.js +159 -0
  429. package/out/concepts/QueryLimitExpression__.js.map +1 -0
  430. package/out/concepts/QueryOrderByExpression__.d.ts +71 -0
  431. package/out/concepts/QueryOrderByExpression__.js +172 -0
  432. package/out/concepts/QueryOrderByExpression__.js.map +1 -0
  433. package/out/concepts/QuerySelectExpression__.d.ts +206 -0
  434. package/out/concepts/QuerySelectExpression__.js +308 -0
  435. package/out/concepts/QuerySelectExpression__.js.map +1 -0
  436. package/out/concepts/Rect__.d.ts +42 -0
  437. package/out/concepts/Rect__.js +71 -0
  438. package/out/concepts/Rect__.js.map +1 -0
  439. package/out/concepts/Return__.d.ts +147 -0
  440. package/out/concepts/Return__.js +429 -0
  441. package/out/concepts/Return__.js.map +1 -0
  442. package/out/concepts/Role__.d.ts +62 -0
  443. package/out/concepts/Role__.js +151 -0
  444. package/out/concepts/Role__.js.map +1 -0
  445. package/out/concepts/SelectMembers__.d.ts +145 -0
  446. package/out/concepts/SelectMembers__.js +300 -0
  447. package/out/concepts/SelectMembers__.js.map +1 -0
  448. package/out/concepts/SequentialPolicy__.d.ts +20 -0
  449. package/out/concepts/SequentialPolicy__.js +48 -0
  450. package/out/concepts/SequentialPolicy__.js.map +1 -0
  451. package/out/concepts/Slot__.d.ts +77 -0
  452. package/out/concepts/Slot__.js +141 -0
  453. package/out/concepts/Slot__.js.map +1 -0
  454. package/out/concepts/SqlQueryComponent__.d.ts +74 -0
  455. package/out/concepts/SqlQueryComponent__.js +269 -0
  456. package/out/concepts/SqlQueryComponent__.js.map +1 -0
  457. package/out/concepts/Start__.d.ts +27 -0
  458. package/out/concepts/Start__.js +69 -0
  459. package/out/concepts/Start__.js.map +1 -0
  460. package/out/concepts/StaticString__.d.ts +49 -0
  461. package/out/concepts/StaticString__.js +91 -0
  462. package/out/concepts/StaticString__.js.map +1 -0
  463. package/out/concepts/StringInterpolation__.d.ts +118 -0
  464. package/out/concepts/StringInterpolation__.js +284 -0
  465. package/out/concepts/StringInterpolation__.js.map +1 -0
  466. package/out/concepts/StringLiteral__.d.ts +45 -0
  467. package/out/concepts/StringLiteral__.js +159 -0
  468. package/out/concepts/StringLiteral__.js.map +1 -0
  469. package/out/concepts/StructureProperty__.d.ts +154 -0
  470. package/out/concepts/StructureProperty__.js +338 -0
  471. package/out/concepts/StructureProperty__.js.map +1 -0
  472. package/out/concepts/Structure__.d.ts +250 -0
  473. package/out/concepts/Structure__.js +508 -0
  474. package/out/concepts/Structure__.js.map +1 -0
  475. package/out/concepts/SwitchCase__.d.ts +97 -0
  476. package/out/concepts/SwitchCase__.js +305 -0
  477. package/out/concepts/SwitchCase__.js.map +1 -0
  478. package/out/concepts/SwitchStatement__.d.ts +87 -0
  479. package/out/concepts/SwitchStatement__.js +234 -0
  480. package/out/concepts/SwitchStatement__.js.map +1 -0
  481. package/out/concepts/Theme__.d.ts +40 -0
  482. package/out/concepts/Theme__.js +84 -0
  483. package/out/concepts/Theme__.js.map +1 -0
  484. package/out/concepts/Transactional__.d.ts +90 -0
  485. package/out/concepts/Transactional__.js +149 -0
  486. package/out/concepts/Transactional__.js.map +1 -0
  487. package/out/concepts/TriggerEvent__.d.ts +54 -0
  488. package/out/concepts/TriggerEvent__.js +137 -0
  489. package/out/concepts/TriggerEvent__.js.map +1 -0
  490. package/out/concepts/TriggerLauncher__.d.ts +81 -0
  491. package/out/concepts/TriggerLauncher__.js +197 -0
  492. package/out/concepts/TriggerLauncher__.js.map +1 -0
  493. package/out/concepts/TypeAnnotation__.d.ts +305 -0
  494. package/out/concepts/TypeAnnotation__.js +1095 -0
  495. package/out/concepts/TypeAnnotation__.js.map +1 -0
  496. package/out/concepts/TypeParam__.d.ts +28 -0
  497. package/out/concepts/TypeParam__.js +71 -0
  498. package/out/concepts/TypeParam__.js.map +1 -0
  499. package/out/concepts/UnaryExpression__.d.ts +52 -0
  500. package/out/concepts/UnaryExpression__.js +191 -0
  501. package/out/concepts/UnaryExpression__.js.map +1 -0
  502. package/out/concepts/Unparsed__.d.ts +36 -0
  503. package/out/concepts/Unparsed__.js +91 -0
  504. package/out/concepts/Unparsed__.js.map +1 -0
  505. package/out/concepts/UseComponent__.d.ts +34 -0
  506. package/out/concepts/UseComponent__.js +65 -0
  507. package/out/concepts/UseComponent__.js.map +1 -0
  508. package/out/concepts/ValidationRule__.d.ts +152 -0
  509. package/out/concepts/ValidationRule__.js +535 -0
  510. package/out/concepts/ValidationRule__.js.map +1 -0
  511. package/out/concepts/Variable__.d.ts +164 -0
  512. package/out/concepts/Variable__.js +505 -0
  513. package/out/concepts/Variable__.js.map +1 -0
  514. package/out/concepts/ViewBlock__.d.ts +38 -0
  515. package/out/concepts/ViewBlock__.js +68 -0
  516. package/out/concepts/ViewBlock__.js.map +1 -0
  517. package/out/concepts/ViewComponent__.d.ts +568 -0
  518. package/out/concepts/ViewComponent__.js +809 -0
  519. package/out/concepts/ViewComponent__.js.map +1 -0
  520. package/out/concepts/ViewElement__.d.ts +656 -0
  521. package/out/concepts/ViewElement__.js +2727 -0
  522. package/out/concepts/ViewElement__.js.map +1 -0
  523. package/out/concepts/View__.d.ts +747 -0
  524. package/out/concepts/View__.js +2633 -0
  525. package/out/concepts/View__.js.map +1 -0
  526. package/out/concepts/WhileStatement__.d.ts +100 -0
  527. package/out/concepts/WhileStatement__.js +269 -0
  528. package/out/concepts/WhileStatement__.js.map +1 -0
  529. package/out/concepts/basics/constants.d.ts +1 -0
  530. package/out/concepts/basics/constants.js +6 -0
  531. package/out/concepts/basics/constants.js.map +1 -0
  532. package/out/concepts/basics/stdlib/index.d.ts +16 -0
  533. package/out/concepts/basics/stdlib/index.js +90 -0
  534. package/out/concepts/basics/stdlib/index.js.map +1 -0
  535. package/out/concepts/basics/stdlib/nasl.auth.d.ts +9 -0
  536. package/out/concepts/basics/stdlib/nasl.auth.js +206 -0
  537. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -0
  538. package/out/concepts/basics/stdlib/nasl.browser.d.ts +5 -0
  539. package/out/concepts/basics/stdlib/nasl.browser.js +158 -0
  540. package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -0
  541. package/out/concepts/basics/stdlib/nasl.collection.d.ts +9 -0
  542. package/out/concepts/basics/stdlib/nasl.collection.js +57 -0
  543. package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -0
  544. package/out/concepts/basics/stdlib/nasl.configuration.d.ts +5 -0
  545. package/out/concepts/basics/stdlib/nasl.configuration.js +65 -0
  546. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -0
  547. package/out/concepts/basics/stdlib/nasl.core.d.ts +7 -0
  548. package/out/concepts/basics/stdlib/nasl.core.js +47 -0
  549. package/out/concepts/basics/stdlib/nasl.core.js.map +1 -0
  550. package/out/concepts/basics/stdlib/nasl.event.d.ts +5 -0
  551. package/out/concepts/basics/stdlib/nasl.event.js +34 -0
  552. package/out/concepts/basics/stdlib/nasl.event.js.map +1 -0
  553. package/out/concepts/basics/stdlib/nasl.http.d.ts +9 -0
  554. package/out/concepts/basics/stdlib/nasl.http.js +174 -0
  555. package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
  556. package/out/concepts/basics/stdlib/nasl.interface.d.ts +9 -0
  557. package/out/concepts/basics/stdlib/nasl.interface.js +49 -0
  558. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -0
  559. package/out/concepts/basics/stdlib/nasl.io.d.ts +5 -0
  560. package/out/concepts/basics/stdlib/nasl.io.js +61 -0
  561. package/out/concepts/basics/stdlib/nasl.io.js.map +1 -0
  562. package/out/concepts/basics/stdlib/nasl.logging.d.ts +5 -0
  563. package/out/concepts/basics/stdlib/nasl.logging.js +65 -0
  564. package/out/concepts/basics/stdlib/nasl.logging.js.map +1 -0
  565. package/out/concepts/basics/stdlib/nasl.process.d.ts +9 -0
  566. package/out/concepts/basics/stdlib/nasl.process.js +643 -0
  567. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -0
  568. package/out/concepts/basics/stdlib/nasl.ui.d.ts +9 -0
  569. package/out/concepts/basics/stdlib/nasl.ui.js +1038 -0
  570. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -0
  571. package/out/concepts/basics/stdlib/nasl.util.d.ts +6 -0
  572. package/out/concepts/basics/stdlib/nasl.util.js +2285 -0
  573. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -0
  574. package/out/concepts/basics/stdlib/nasl.validation.d.ts +5 -0
  575. package/out/concepts/basics/stdlib/nasl.validation.js +574 -0
  576. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
  577. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +4 -0
  578. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +47 -0
  579. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -0
  580. package/out/concepts/basics/stdlib/timeZone.d.ts +5 -0
  581. package/out/concepts/basics/stdlib/timeZone.js +196 -0
  582. package/out/concepts/basics/stdlib/timeZone.js.map +1 -0
  583. package/out/concepts/basics/types/coreTypeList.d.ts +2 -0
  584. package/out/concepts/basics/types/coreTypeList.js +15 -0
  585. package/out/concepts/basics/types/coreTypeList.js.map +1 -0
  586. package/out/concepts/basics/types/index.d.ts +16 -0
  587. package/out/concepts/basics/types/index.js +35 -0
  588. package/out/concepts/basics/types/index.js.map +1 -0
  589. package/out/concepts/index.d.ts +7 -0
  590. package/out/concepts/index.js +41 -0
  591. package/out/concepts/index.js.map +1 -0
  592. package/out/concepts/index__.d.ts +138 -0
  593. package/out/concepts/index__.js +155 -0
  594. package/out/concepts/index__.js.map +1 -0
  595. package/out/concepts/types__.d.ts +0 -0
  596. package/out/concepts/types__.js +1 -0
  597. package/out/concepts/types__.js.map +1 -0
  598. package/out/concepts/utils/asserts.d.ts +6982 -0
  599. package/out/concepts/utils/asserts.js +9276 -0
  600. package/out/concepts/utils/asserts.js.map +1 -0
  601. package/out/concepts/utils/quick-info.d.ts +13 -0
  602. package/out/concepts/utils/quick-info.js +51 -0
  603. package/out/concepts/utils/quick-info.js.map +1 -0
  604. package/out/concepts/utils/types.d.ts +450 -0
  605. package/out/concepts/utils/types.js +3 -0
  606. package/out/concepts/utils/types.js.map +1 -0
  607. package/out/config.d.ts +43 -0
  608. package/out/config.js +72 -0
  609. package/out/config.js.map +1 -0
  610. package/out/decorators/index.d.ts +67 -0
  611. package/out/decorators/index.js +213 -0
  612. package/out/decorators/index.js.map +1 -0
  613. package/out/decorators/promise.d.ts +7 -0
  614. package/out/decorators/promise.js +28 -0
  615. package/out/decorators/promise.js.map +1 -0
  616. package/out/enums/KEYWORDS.d.ts +6 -0
  617. package/out/enums/KEYWORDS.js +1248 -0
  618. package/out/enums/KEYWORDS.js.map +1 -0
  619. package/out/enums/LEVEL_NAME_MAP.d.ts +26 -0
  620. package/out/enums/LEVEL_NAME_MAP.js +30 -0
  621. package/out/enums/LEVEL_NAME_MAP.js.map +1 -0
  622. package/out/eventBus.d.ts +3 -0
  623. package/out/eventBus.js +7 -0
  624. package/out/eventBus.js.map +1 -0
  625. package/out/generator/compileComponent.d.ts +11 -0
  626. package/out/generator/compileComponent.js +12 -0
  627. package/out/generator/compileComponent.js.map +1 -0
  628. package/out/generator/genBundleFiles.d.ts +37 -0
  629. package/out/generator/genBundleFiles.js +678 -0
  630. package/out/generator/genBundleFiles.js.map +1 -0
  631. package/out/generator/genHash.d.ts +7 -0
  632. package/out/generator/genHash.js +39 -0
  633. package/out/generator/genHash.js.map +1 -0
  634. package/out/generator/genMetaData.d.ts +31 -0
  635. package/out/generator/genMetaData.js +365 -0
  636. package/out/generator/genMetaData.js.map +1 -0
  637. package/out/generator/genReleaseBody.d.ts +72 -0
  638. package/out/generator/genReleaseBody.js +333 -0
  639. package/out/generator/genReleaseBody.js.map +1 -0
  640. package/out/generator/icestark.d.ts +2 -0
  641. package/out/generator/icestark.js +50 -0
  642. package/out/generator/icestark.js.map +1 -0
  643. package/out/generator/index.d.ts +7 -0
  644. package/out/generator/index.js +24 -0
  645. package/out/generator/index.js.map +1 -0
  646. package/out/generator/microApp.d.ts +2 -0
  647. package/out/generator/microApp.js +36 -0
  648. package/out/generator/microApp.js.map +1 -0
  649. package/out/generator/permission.d.ts +14 -0
  650. package/out/generator/permission.js +296 -0
  651. package/out/generator/permission.js.map +1 -0
  652. package/out/generator/qiankun.d.ts +2 -0
  653. package/out/generator/qiankun.js +54 -0
  654. package/out/generator/qiankun.js.map +1 -0
  655. package/out/generator/styleReplacer.d.ts +3 -0
  656. package/out/generator/styleReplacer.js +68 -0
  657. package/out/generator/styleReplacer.js.map +1 -0
  658. package/out/index.d.ts +13 -0
  659. package/out/index.js +67 -0
  660. package/out/index.js.map +1 -0
  661. package/out/manager/diagnostic.d.ts +35 -0
  662. package/out/manager/diagnostic.js +64 -0
  663. package/out/manager/diagnostic.js.map +1 -0
  664. package/out/manager/stepRecorder.d.ts +20 -0
  665. package/out/manager/stepRecorder.js +114 -0
  666. package/out/manager/stepRecorder.js.map +1 -0
  667. package/out/natural/componentData.d.ts +31 -0
  668. package/out/natural/componentData.js +85 -0
  669. package/out/natural/componentData.js.map +1 -0
  670. package/out/natural/genNaturalTS.d.ts +3 -0
  671. package/out/natural/genNaturalTS.js +87 -0
  672. package/out/natural/genNaturalTS.js.map +1 -0
  673. package/out/natural/index.d.ts +4 -0
  674. package/out/natural/index.js +21 -0
  675. package/out/natural/index.js.map +1 -0
  676. package/out/natural/naslStdlibMap.d.ts +1 -0
  677. package/out/natural/naslStdlibMap.js +35 -0
  678. package/out/natural/naslStdlibMap.js.map +1 -0
  679. package/out/natural/prompt/analyzeClaims.d.ts +1 -0
  680. package/out/natural/prompt/analyzeClaims.js +21 -0
  681. package/out/natural/prompt/analyzeClaims.js.map +1 -0
  682. package/out/natural/prompt/executeClaims.d.ts +1 -0
  683. package/out/natural/prompt/executeClaims.js +73 -0
  684. package/out/natural/prompt/executeClaims.js.map +1 -0
  685. package/out/natural/transformTSCode.d.ts +7 -0
  686. package/out/natural/transformTSCode.js +931 -0
  687. package/out/natural/transformTSCode.js.map +1 -0
  688. package/out/sentry/index.d.ts +34 -0
  689. package/out/sentry/index.js +149 -0
  690. package/out/sentry/index.js.map +1 -0
  691. package/out/server/createUiTs.d.ts +17 -0
  692. package/out/server/createUiTs.js +268 -0
  693. package/out/server/createUiTs.js.map +1 -0
  694. package/out/server/entity2LogicNamespace.d.ts +10 -0
  695. package/out/server/entity2LogicNamespace.js +382 -0
  696. package/out/server/entity2LogicNamespace.js.map +1 -0
  697. package/out/server/event.d.ts +30 -0
  698. package/out/server/event.js +151 -0
  699. package/out/server/event.js.map +1 -0
  700. package/out/server/extendBaseNode.d.ts +1 -0
  701. package/out/server/extendBaseNode.js +605 -0
  702. package/out/server/extendBaseNode.js.map +1 -0
  703. package/out/server/formatTsUtils.d.ts +36 -0
  704. package/out/server/formatTsUtils.js +854 -0
  705. package/out/server/formatTsUtils.js.map +1 -0
  706. package/out/server/getConnector.d.ts +14 -0
  707. package/out/server/getConnector.js +101 -0
  708. package/out/server/getConnector.js.map +1 -0
  709. package/out/server/getExtensionModules.d.ts +3 -0
  710. package/out/server/getExtensionModules.js +34 -0
  711. package/out/server/getExtensionModules.js.map +1 -0
  712. package/out/server/getFunctions.d.ts +3 -0
  713. package/out/server/getFunctions.js +20 -0
  714. package/out/server/getFunctions.js.map +1 -0
  715. package/out/server/getInterfaces.d.ts +2 -0
  716. package/out/server/getInterfaces.js +48 -0
  717. package/out/server/getInterfaces.js.map +1 -0
  718. package/out/server/getLogging.d.ts +1 -0
  719. package/out/server/getLogging.js +9 -0
  720. package/out/server/getLogging.js.map +1 -0
  721. package/out/server/getLogics.d.ts +5 -0
  722. package/out/server/getLogics.js +454 -0
  723. package/out/server/getLogics.js.map +1 -0
  724. package/out/server/getMemberIdentifier.d.ts +17 -0
  725. package/out/server/getMemberIdentifier.js +594 -0
  726. package/out/server/getMemberIdentifier.js.map +1 -0
  727. package/out/server/getProcessComponents.d.ts +2 -0
  728. package/out/server/getProcessComponents.js +13 -0
  729. package/out/server/getProcessComponents.js.map +1 -0
  730. package/out/server/getProcesses.d.ts +33 -0
  731. package/out/server/getProcesses.js +647 -0
  732. package/out/server/getProcesses.js.map +1 -0
  733. package/out/server/getScope.d.ts +13 -0
  734. package/out/server/getScope.js +61 -0
  735. package/out/server/getScope.js.map +1 -0
  736. package/out/server/getValidates.d.ts +3 -0
  737. package/out/server/getValidates.js +14 -0
  738. package/out/server/getValidates.js.map +1 -0
  739. package/out/server/index.d.ts +5 -0
  740. package/out/server/index.js +43 -0
  741. package/out/server/index.js.map +1 -0
  742. package/out/server/naslServer.d.ts +375 -0
  743. package/out/server/naslServer.js +4735 -0
  744. package/out/server/naslServer.js.map +1 -0
  745. package/out/server/naslStdlibMap.d.ts +2 -0
  746. package/out/server/naslStdlibMap.js +54 -0
  747. package/out/server/naslStdlibMap.js.map +1 -0
  748. package/out/server/process2LogicNamespace.d.ts +26 -0
  749. package/out/server/process2LogicNamespace.js +109 -0
  750. package/out/server/process2LogicNamespace.js.map +1 -0
  751. package/out/server/translator.d.ts +26 -0
  752. package/out/server/translator.js +847 -0
  753. package/out/server/translator.js.map +1 -0
  754. package/out/service/creator/add.configs.d.ts +1 -0
  755. package/out/service/creator/add.configs.js +103 -0
  756. package/out/service/creator/add.configs.js.map +1 -0
  757. package/out/service/creator/errHandles.d.ts +18 -0
  758. package/out/service/creator/errHandles.js +71 -0
  759. package/out/service/creator/errHandles.js.map +1 -0
  760. package/out/service/creator/index.d.ts +1 -0
  761. package/out/service/creator/index.js +87 -0
  762. package/out/service/creator/index.js.map +1 -0
  763. package/out/service/datasource/api.d.ts +12 -0
  764. package/out/service/datasource/api.js +14 -0
  765. package/out/service/datasource/api.js.map +1 -0
  766. package/out/service/datasource/index.d.ts +2 -0
  767. package/out/service/datasource/index.js +10 -0
  768. package/out/service/datasource/index.js.map +1 -0
  769. package/out/service/defaultErrorMessage.json +98 -0
  770. package/out/service/logic/api.d.ts +9 -0
  771. package/out/service/logic/api.js +11 -0
  772. package/out/service/logic/api.js.map +1 -0
  773. package/out/service/logic/checktypeSocket.d.ts +5 -0
  774. package/out/service/logic/checktypeSocket.js +55 -0
  775. package/out/service/logic/checktypeSocket.js.map +1 -0
  776. package/out/service/logic/index.d.ts +2 -0
  777. package/out/service/logic/index.js +10 -0
  778. package/out/service/logic/index.js.map +1 -0
  779. package/out/service/storage/api.d.ts +54 -0
  780. package/out/service/storage/api.js +42 -0
  781. package/out/service/storage/api.js.map +1 -0
  782. package/out/service/storage/index.d.ts +2 -0
  783. package/out/service/storage/index.js +10 -0
  784. package/out/service/storage/index.js.map +1 -0
  785. package/out/service/storage/init.d.ts +105 -0
  786. package/out/service/storage/init.js +1232 -0
  787. package/out/service/storage/init.js.map +1 -0
  788. package/out/service/storage/jsoner.d.ts +36 -0
  789. package/out/service/storage/jsoner.js +148 -0
  790. package/out/service/storage/jsoner.js.map +1 -0
  791. package/out/service/storage/map.d.ts +4 -0
  792. package/out/service/storage/map.js +54 -0
  793. package/out/service/storage/map.js.map +1 -0
  794. package/out/service/storage/service.d.ts +25 -0
  795. package/out/service/storage/service.js +80 -0
  796. package/out/service/storage/service.js.map +1 -0
  797. package/out/service/storage/storagePoint.d.ts +17 -0
  798. package/out/service/storage/storagePoint.js +76 -0
  799. package/out/service/storage/storagePoint.js.map +1 -0
  800. package/out/service/video/BaseService.d.ts +7 -0
  801. package/out/service/video/BaseService.js +61 -0
  802. package/out/service/video/BaseService.js.map +1 -0
  803. package/out/service/video/MainCallbackService.d.ts +12 -0
  804. package/out/service/video/MainCallbackService.js +183 -0
  805. package/out/service/video/MainCallbackService.js.map +1 -0
  806. package/out/service/video/VideoTranscribe.d.ts +15 -0
  807. package/out/service/video/VideoTranscribe.js +96 -0
  808. package/out/service/video/VideoTranscribe.js.map +1 -0
  809. package/out/service/video/publishService.d.ts +1 -0
  810. package/out/service/video/publishService.js +58 -0
  811. package/out/service/video/publishService.js.map +1 -0
  812. package/out/templator/genCallComponentLogic.d.ts +17 -0
  813. package/out/templator/genCallComponentLogic.js +29 -0
  814. package/out/templator/genCallComponentLogic.js.map +1 -0
  815. package/out/templator/genCreateBlock.d.ts +10 -0
  816. package/out/templator/genCreateBlock.js +372 -0
  817. package/out/templator/genCreateBlock.js.map +1 -0
  818. package/out/templator/genCurdEditMultipleKeyBlock.d.ts +8 -0
  819. package/out/templator/genCurdEditMultipleKeyBlock.js +527 -0
  820. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -0
  821. package/out/templator/genCurdMultipleKeyBlock.d.ts +61 -0
  822. package/out/templator/genCurdMultipleKeyBlock.js +1378 -0
  823. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -0
  824. package/out/templator/genEditTableBlock.d.ts +51 -0
  825. package/out/templator/genEditTableBlock.js +325 -0
  826. package/out/templator/genEditTableBlock.js.map +1 -0
  827. package/out/templator/genEnumSelectBlock.d.ts +10 -0
  828. package/out/templator/genEnumSelectBlock.js +53 -0
  829. package/out/templator/genEnumSelectBlock.js.map +1 -0
  830. package/out/templator/genGetBlock.d.ts +6 -0
  831. package/out/templator/genGetBlock.js +139 -0
  832. package/out/templator/genGetBlock.js.map +1 -0
  833. package/out/templator/genGridViewBlock.d.ts +55 -0
  834. package/out/templator/genGridViewBlock.js +359 -0
  835. package/out/templator/genGridViewBlock.js.map +1 -0
  836. package/out/templator/genListViewBlock.d.ts +19 -0
  837. package/out/templator/genListViewBlock.js +148 -0
  838. package/out/templator/genListViewBlock.js.map +1 -0
  839. package/out/templator/genQueryComponent.d.ts +34 -0
  840. package/out/templator/genQueryComponent.js +344 -0
  841. package/out/templator/genQueryComponent.js.map +1 -0
  842. package/out/templator/genSelectBlock.d.ts +45 -0
  843. package/out/templator/genSelectBlock.js +415 -0
  844. package/out/templator/genSelectBlock.js.map +1 -0
  845. package/out/templator/genTableBlock.d.ts +55 -0
  846. package/out/templator/genTableBlock.js +421 -0
  847. package/out/templator/genTableBlock.js.map +1 -0
  848. package/out/templator/genUpdateBlock.d.ts +6 -0
  849. package/out/templator/genUpdateBlock.js +414 -0
  850. package/out/templator/genUpdateBlock.js.map +1 -0
  851. package/out/templator/index.d.ts +19 -0
  852. package/out/templator/index.js +38 -0
  853. package/out/templator/index.js.map +1 -0
  854. package/out/templator/utils.d.ts +683 -0
  855. package/out/templator/utils.js +472 -0
  856. package/out/templator/utils.js.map +1 -0
  857. package/out/translator/constant.d.ts +6 -0
  858. package/out/translator/constant.js +10 -0
  859. package/out/translator/constant.js.map +1 -0
  860. package/out/translator/index.d.ts +3 -0
  861. package/out/translator/index.js +20 -0
  862. package/out/translator/index.js.map +1 -0
  863. package/out/translator/types.d.ts +49 -0
  864. package/out/translator/types.js +3 -0
  865. package/out/translator/types.js.map +1 -0
  866. package/out/translator/utils.d.ts +44 -0
  867. package/out/translator/utils.js +241 -0
  868. package/out/translator/utils.js.map +1 -0
  869. package/out/utils/cookie.d.ts +9 -0
  870. package/out/utils/cookie.js +62 -0
  871. package/out/utils/cookie.js.map +1 -0
  872. package/out/utils/env.d.ts +2 -0
  873. package/out/utils/env.js +6 -0
  874. package/out/utils/env.js.map +1 -0
  875. package/out/utils/i18nInfo.d.ts +5 -0
  876. package/out/utils/i18nInfo.js +36 -0
  877. package/out/utils/i18nInfo.js.map +1 -0
  878. package/out/utils/index.d.ts +61 -0
  879. package/out/utils/index.js +386 -0
  880. package/out/utils/index.js.map +1 -0
  881. package/out/utils/logger.d.ts +7 -0
  882. package/out/utils/logger.js +23 -0
  883. package/out/utils/logger.js.map +1 -0
  884. package/out/utils/sortTsString.d.ts +1 -0
  885. package/out/utils/sortTsString.js +44 -0
  886. package/out/utils/sortTsString.js.map +1 -0
  887. package/out/utils/string.d.ts +64 -0
  888. package/out/utils/string.js +153 -0
  889. package/out/utils/string.js.map +1 -0
  890. package/out/utils/time-slicing/constant.d.ts +35 -0
  891. package/out/utils/time-slicing/constant.js +40 -0
  892. package/out/utils/time-slicing/constant.js.map +1 -0
  893. package/out/utils/time-slicing/controller.d.ts +53 -0
  894. package/out/utils/time-slicing/controller.js +294 -0
  895. package/out/utils/time-slicing/controller.js.map +1 -0
  896. package/out/utils/time-slicing/index.d.ts +5 -0
  897. package/out/utils/time-slicing/index.js +26 -0
  898. package/out/utils/time-slicing/index.js.map +1 -0
  899. package/out/utils/time-slicing/page-state.d.ts +2 -0
  900. package/out/utils/time-slicing/page-state.js +14 -0
  901. package/out/utils/time-slicing/page-state.js.map +1 -0
  902. package/out/utils/time-slicing/performance.d.ts +11 -0
  903. package/out/utils/time-slicing/performance.js +50 -0
  904. package/out/utils/time-slicing/performance.js.map +1 -0
  905. package/out/utils/time-slicing/runner.d.ts +12 -0
  906. package/out/utils/time-slicing/runner.js +52 -0
  907. package/out/utils/time-slicing/runner.js.map +1 -0
  908. package/out/utils/time-slicing/tool.d.ts +24 -0
  909. package/out/utils/time-slicing/tool.js +47 -0
  910. package/out/utils/time-slicing/tool.js.map +1 -0
  911. package/out/utils/time-slicing/utils.d.ts +62 -0
  912. package/out/utils/time-slicing/utils.js +47 -0
  913. package/out/utils/time-slicing/utils.js.map +1 -0
  914. package/out/utils/time-slicing/wrapper.d.ts +18 -0
  915. package/out/utils/time-slicing/wrapper.js +55 -0
  916. package/out/utils/time-slicing/wrapper.js.map +1 -0
  917. package/out/utils/traverse.d.ts +36 -0
  918. package/out/utils/traverse.js +143 -0
  919. package/out/utils/traverse.js.map +1 -0
  920. package/out/utils/types.d.ts +13 -0
  921. package/out/utils/types.js +3 -0
  922. package/out/utils/types.js.map +1 -0
  923. package/out/utils/window.d.ts +7 -0
  924. package/out/utils/window.js +14 -0
  925. package/out/utils/window.js.map +1 -0
  926. package/package.json +1 -1
  927. package/sandbox/stdlib/nasl.oql.ts +2 -2
  928. package/src/concepts/NewComposite__.ts +2 -2
  929. package/src/server/translator.ts +1 -1
  930. package/src/templator/genTableBlock.ts +5 -1
  931. package/test/concepts/new-composite/__snapshots__/getQuickInfoOffset.spec.ts.snap +7 -7
  932. package/test/concepts/new-composite/__snapshots__/toEmbeddedTS.spec.ts.snap +11 -7
  933. package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +139 -189
  934. package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +9 -1
@@ -0,0 +1,2727 @@
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 time_slicing_1 = require("../utils/time-slicing");
38
+ const translator_1 = require("../translator");
39
+ const concepts_1 = require("../concepts");
40
+ const babelParser = __importStar(require("@babel/parser"));
41
+ const json5 = __importStar(require("json5"));
42
+ const compiler = __importStar(require("vue-template-compiler"));
43
+ const LogicItem__1 = require("./LogicItem__");
44
+ const Logic__1 = require("./Logic__");
45
+ const config_1 = require("../config");
46
+ const utils_1 = require("../utils");
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
103
+ .map((argument) => ({
104
+ concept: 'Argument',
105
+ name: '',
106
+ kind: 'Statement',
107
+ keyword: '',
108
+ expression: transAstNodeToNaslNode(Object.assign({}, argument)),
109
+ }))
110
+ .filter((item) => item.expression),
111
+ typeArguments: astNode.arguments
112
+ .map((argument) => transAstNodeToNaslTypeNode(Object.assign({}, argument)))
113
+ .filter((item) => item),
114
+ };
115
+ }
116
+ else if (astNode.type === 'MemberExpression') {
117
+ if (astNode.object?.name === '$global') {
118
+ if (astNode.property?.name === 'userInfo') {
119
+ // 目前只有权限相关的
120
+ node = transAstNodeToNaslNode(astNode.property, 'nasl.auth');
121
+ }
122
+ else if (astNode.property?.name === 'frontendVariables') {
123
+ node = 'app.frontendVariables';
124
+ }
125
+ }
126
+ else if (astNode.object?.name === 'frontendVariables') {
127
+ node = transAstNodeToNaslNode(astNode.property, 'app.frontendVariables');
128
+ }
129
+ else {
130
+ const object = transAstNodeToNaslNode(astNode.object);
131
+ // object如果返回字符串,则将它当成namespace处理
132
+ if (Object.prototype.toString.call(object) === '[object String]') {
133
+ node = transAstNodeToNaslNode(astNode.property, object);
134
+ }
135
+ else {
136
+ const property = transAstNodeToNaslNode(astNode.property);
137
+ node = {
138
+ concept: 'MemberExpression',
139
+ name: '',
140
+ kind: 'Expression',
141
+ object,
142
+ property,
143
+ };
144
+ }
145
+ }
146
+ }
147
+ else if (astNode.type === 'Identifier') {
148
+ node = {
149
+ concept: 'Identifier',
150
+ namespace: namespace || '',
151
+ name: astNode.name,
152
+ kind: 'Expression',
153
+ };
154
+ }
155
+ else if (astNode.type === 'ArrayExpression' || astNode.type === 'ObjectExpression') {
156
+ node = {
157
+ concept: 'Unparsed',
158
+ label: '原子项',
159
+ code: astNode.value,
160
+ };
161
+ }
162
+ else if (astNode.type === 'TemplateLiteral') {
163
+ // 模板字符串翻译成字符串插值
164
+ const { expressions, quasis } = astNode;
165
+ node = {
166
+ concept: 'StringInterpolation',
167
+ kind: 'Expression',
168
+ name: '',
169
+ expressions: [...(quasis || []), ...(expressions || [])]
170
+ .sort((node1, node2) => {
171
+ return node1.start - node2.start;
172
+ })
173
+ .map((node) => {
174
+ return transAstNodeToNaslNode(node);
175
+ }),
176
+ };
177
+ }
178
+ else if (astNode.type === 'TemplateElement') {
179
+ node = {
180
+ concept: 'StringLiteral',
181
+ kind: 'Expression',
182
+ name: '',
183
+ value: astNode.value?.raw,
184
+ };
185
+ }
186
+ else if (astNode.type === 'StringLiteral') {
187
+ // 单独特殊处理枚举因为他不是MemberExpression,而是Identifier_
188
+ if (astNode?.value?.startsWith('__enumTypeAnnotation_')) {
189
+ return null;
190
+ }
191
+ else {
192
+ node = {
193
+ concept: 'StringLiteral',
194
+ kind: 'Expression',
195
+ name: '',
196
+ value: astNode.value,
197
+ };
198
+ }
199
+ }
200
+ else if (astNode.type === 'UnaryExpression') {
201
+ const argument = astNode.argument;
202
+ if (argument.type === 'NumericLiteral') {
203
+ node = {
204
+ concept: 'NumericLiteral',
205
+ value: astNode.operator + argument.value,
206
+ };
207
+ }
208
+ else {
209
+ node = {
210
+ concept: 'UnaryExpression',
211
+ kind: 'Expression',
212
+ name: '',
213
+ operator: astNode.operator,
214
+ argument: transAstNodeToNaslNode(astNode.argument),
215
+ };
216
+ }
217
+ }
218
+ else if (astNode.type === 'NumericLiteral') {
219
+ const numberString = typeof astNode.value === 'number' ? astNode.value.toString() : astNode.value;
220
+ node = {
221
+ concept: 'NumericLiteral',
222
+ value: numberString,
223
+ };
224
+ }
225
+ else if (astNode.type === 'ArrowFunctionExpression') {
226
+ if (astNode.body?.callee?.name) {
227
+ astNode.name = astNode.body.callee.name;
228
+ }
229
+ let tempNode = {
230
+ calleeNamespace: 'app.logics',
231
+ concept: 'CallLogic',
232
+ namespace: namespace || '',
233
+ name: astNode.name,
234
+ calleeName: astNode.name,
235
+ kind: 'Expression',
236
+ parentNode: astNode.parentNode,
237
+ parentKey: astNode.parentKey,
238
+ arguments: astNode?.body?.arguments
239
+ ?.map((argument) => ({
240
+ concept: 'Argument',
241
+ name: '',
242
+ kind: 'Statement',
243
+ keyword: '',
244
+ expression: transAstNodeToNaslNode(Object.assign({}, argument)),
245
+ }))
246
+ .filter((item) => item.expression),
247
+ typeArguments: astNode?.body?.arguments
248
+ ?.map((argument) => transAstNodeToNaslTypeNode(Object.assign({}, argument)))
249
+ .filter((item) => item),
250
+ };
251
+ node = Logic__1.Logic.from({
252
+ ...tempNode,
253
+ }, undefined, 'logics');
254
+ }
255
+ else {
256
+ node = astNode;
257
+ node.concept = astNode.type;
258
+ }
259
+ return node;
260
+ }
261
+ function transAstNodeToNaslTypeNode(astNode, namespace) {
262
+ let node = null;
263
+ // 单独特殊处理枚举因为他不是MemberExpression,而是Identifier_
264
+ if (astNode?.value?.startsWith('__enumTypeAnnotation_')) {
265
+ const valueArr = astNode.value.replace('__enumTypeAnnotation_', '')?.split('.');
266
+ const name = valueArr.pop();
267
+ const namespace = valueArr.join('.');
268
+ node = {
269
+ concept: 'TypeAnnotation',
270
+ typeNamespace: namespace || '',
271
+ typeName: name || '',
272
+ typeKind: 'reference',
273
+ };
274
+ }
275
+ return node;
276
+ }
277
+ function isLockField(node) {
278
+ if (!node || node.concept !== 'ViewElement')
279
+ return false;
280
+ const attr = node?.bindAttrs?.find((attr) => ['FormDesignerLocked', 'TableDesignerLocked'].includes(attr.name))?.value;
281
+ if (attr === undefined)
282
+ return !!isLockField(node?.parentNode);
283
+ else
284
+ return !!attr;
285
+ }
286
+ const decorators_1 = require("../decorators");
287
+ const utils = __importStar(require("../utils"));
288
+ const asserts = __importStar(require("./utils/asserts"));
289
+ const uuid_1 = require("uuid");
290
+ const BaseNode_1 = __importDefault(require("../common/BaseNode"));
291
+ /**
292
+ * 页面元素
293
+ */
294
+ let ViewElement = ViewElement_1 = class ViewElement extends BaseNode_1.default {
295
+ /**
296
+ * @param source 需要合并的部分参数
297
+ */
298
+ constructor(source) {
299
+ source = Object.assign({}, ViewElement_1.getDefaultOptions(), source);
300
+ super(source);
301
+ /**
302
+ * 元素绑定属性列表
303
+ */
304
+ this.bindAttrs = [];
305
+ /**
306
+ * 元素绑定事件列表
307
+ */
308
+ this.bindEvents = [];
309
+ /**
310
+ * 元素指令列表
311
+ */
312
+ this.bindDirectives = [];
313
+ /**
314
+ * 绑定的角色
315
+ */
316
+ this.bindRoles = [];
317
+ /**
318
+ * 元素绑定样式列表
319
+ */
320
+ this.bindStyles = [];
321
+ /**
322
+ * 子元素列表
323
+ */
324
+ this.children = [];
325
+ this.computedStyle = {};
326
+ super.subConstructor(source);
327
+ }
328
+ /**
329
+ * 祖先 View
330
+ */
331
+ get view() {
332
+ return this.getAncestor('View');
333
+ }
334
+ /**
335
+ * 祖先 Module
336
+ */
337
+ get module() {
338
+ return this.getAncestor('Module');
339
+ }
340
+ /**
341
+ * 祖先 App
342
+ */
343
+ get app() {
344
+ return this.getAncestor('App');
345
+ }
346
+ /**
347
+ * 祖先 Frontend
348
+ */
349
+ get frontend() {
350
+ return this.getAncestor('Frontend');
351
+ }
352
+ /**
353
+ * 从父级删除该节点
354
+ * @internal
355
+ */
356
+ _delete() {
357
+ let params = null;
358
+ if (this.parentNode) {
359
+ params = this.parentNode?.__removeViewElement?.(this);
360
+ }
361
+ return params;
362
+ }
363
+ /**
364
+ * 设置页面元素名称
365
+ */
366
+ setName(name) {
367
+ const object = {
368
+ name,
369
+ };
370
+ this.update({
371
+ ...object,
372
+ field: 'name',
373
+ });
374
+ }
375
+ /**
376
+ * 设置静态 style
377
+ */
378
+ setStaticStyle(staticStyle) {
379
+ const object = {
380
+ staticStyle,
381
+ };
382
+ this.update({
383
+ ...object,
384
+ });
385
+ }
386
+ /**
387
+ * 设置权限资源描述
388
+ */
389
+ setAuthDescription(authDescription) {
390
+ const object = {
391
+ authDescription,
392
+ };
393
+ this.update({
394
+ ...object,
395
+ });
396
+ }
397
+ getBindAttributeExistingNames(excludedList = []) {
398
+ const excludedSet = new Set(excludedList);
399
+ return (this.bindAttrs || [])
400
+ .filter((item) => !excludedSet.has(item))
401
+ .map((item) => item?.name);
402
+ }
403
+ getBindAttributeUniqueName(name = 'bindAttribute1') {
404
+ return utils.unique(name, this.getBindAttributeExistingNames(), undefined, false);
405
+ }
406
+ _insertBindAttributeAt(options, index) {
407
+ const bindAttributeOptions = {};
408
+ const relationOptions = { parentNode: this, parentKey: 'bindAttrs' };
409
+ const BindAttribute = (0, decorators_1.getConceptConstructor)('BindAttribute');
410
+ let bindAttribute;
411
+ if (!options) {
412
+ bindAttribute = BindAttribute.from({
413
+ ...bindAttributeOptions,
414
+ name: this.getBindAttributeUniqueName(),
415
+ }, this, 'bindAttrs');
416
+ }
417
+ else if (typeof options === 'string') {
418
+ bindAttribute = BindAttribute.from({
419
+ ...bindAttributeOptions,
420
+ name: options,
421
+ }, this, 'bindAttrs');
422
+ }
423
+ else if (asserts.isBindAttribute(options)) {
424
+ options.ensureDelete(); // 同一实例不支持多处存在
425
+ bindAttribute = options;
426
+ Object.assign(bindAttribute, relationOptions);
427
+ }
428
+ else {
429
+ bindAttribute = BindAttribute.from({
430
+ ...bindAttributeOptions,
431
+ ...options,
432
+ }, this, 'bindAttrs');
433
+ }
434
+ this.bindAttrs.splice(index, 0, bindAttribute);
435
+ return bindAttribute;
436
+ }
437
+ insertBindAttributeAt(options, index) {
438
+ const node = this._insertBindAttributeAt(options, index);
439
+ node.create({
440
+ index,
441
+ parentNode: this,
442
+ parentKey: 'bindAttrs',
443
+ });
444
+ return node;
445
+ }
446
+ _addBindAttribute(options) {
447
+ const index = this.bindAttrs.length;
448
+ return this._insertBindAttributeAt(options, index);
449
+ }
450
+ addBindAttribute(options) {
451
+ const node = this._addBindAttribute(options);
452
+ const index = this.bindAttrs.indexOf(node);
453
+ node.create({
454
+ index,
455
+ parentNode: this,
456
+ parentKey: 'bindAttrs',
457
+ });
458
+ return node;
459
+ }
460
+ getBindEventExistingNames(excludedList = []) {
461
+ const excludedSet = new Set(excludedList);
462
+ return (this.bindEvents || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
463
+ }
464
+ getBindEventUniqueName(name = 'bindEvent1') {
465
+ return utils.unique(name, this.getBindEventExistingNames(), undefined, false);
466
+ }
467
+ _insertBindEventAt(options, index) {
468
+ const bindEventOptions = {};
469
+ const relationOptions = { parentNode: this, parentKey: 'bindEvents' };
470
+ const BindEvent = (0, decorators_1.getConceptConstructor)('BindEvent');
471
+ let bindEvent;
472
+ if (!options) {
473
+ bindEvent = BindEvent.from({
474
+ ...bindEventOptions,
475
+ name: this.getBindEventUniqueName(),
476
+ }, this, 'bindEvents');
477
+ }
478
+ else if (typeof options === 'string') {
479
+ bindEvent = BindEvent.from({
480
+ ...bindEventOptions,
481
+ name: options,
482
+ }, this, 'bindEvents');
483
+ }
484
+ else if (asserts.isBindEvent(options)) {
485
+ options.ensureDelete(); // 同一实例不支持多处存在
486
+ bindEvent = options;
487
+ Object.assign(bindEvent, relationOptions);
488
+ }
489
+ else {
490
+ bindEvent = BindEvent.from({
491
+ ...bindEventOptions,
492
+ ...options,
493
+ }, this, 'bindEvents');
494
+ }
495
+ this.bindEvents.splice(index, 0, bindEvent);
496
+ return bindEvent;
497
+ }
498
+ insertBindEventAt(options, index) {
499
+ const node = this._insertBindEventAt(options, index);
500
+ node.create({
501
+ index,
502
+ parentNode: this,
503
+ parentKey: 'bindEvents',
504
+ });
505
+ return node;
506
+ }
507
+ _addBindEvent(options) {
508
+ const index = this.bindEvents.length;
509
+ return this._insertBindEventAt(options, index);
510
+ }
511
+ addBindEvent(options) {
512
+ const node = this._addBindEvent(options);
513
+ const index = this.bindEvents.indexOf(node);
514
+ node.create({
515
+ index,
516
+ parentNode: this,
517
+ parentKey: 'bindEvents',
518
+ });
519
+ return node;
520
+ }
521
+ getBindDirectiveExistingNames(excludedList = []) {
522
+ const excludedSet = new Set(excludedList);
523
+ return (this.bindDirectives || [])
524
+ .filter((item) => !excludedSet.has(item))
525
+ .map((item) => item?.name);
526
+ }
527
+ getBindDirectiveUniqueName(name = 'bindDirective1') {
528
+ return utils.unique(name, this.getBindDirectiveExistingNames(), undefined, false);
529
+ }
530
+ _insertBindDirectiveAt(options, index) {
531
+ const bindDirectiveOptions = {};
532
+ const relationOptions = { parentNode: this, parentKey: 'bindDirectives' };
533
+ const BindDirective = (0, decorators_1.getConceptConstructor)('BindDirective');
534
+ let bindDirective;
535
+ if (!options) {
536
+ bindDirective = BindDirective.from({
537
+ ...bindDirectiveOptions,
538
+ name: this.getBindDirectiveUniqueName(),
539
+ }, this, 'bindDirectives');
540
+ }
541
+ else if (typeof options === 'string') {
542
+ bindDirective = BindDirective.from({
543
+ ...bindDirectiveOptions,
544
+ name: options,
545
+ }, this, 'bindDirectives');
546
+ }
547
+ else if (asserts.isBindDirective(options)) {
548
+ options.ensureDelete(); // 同一实例不支持多处存在
549
+ bindDirective = options;
550
+ Object.assign(bindDirective, relationOptions);
551
+ }
552
+ else {
553
+ bindDirective = BindDirective.from({
554
+ ...bindDirectiveOptions,
555
+ ...options,
556
+ }, this, 'bindDirectives');
557
+ }
558
+ this.bindDirectives.splice(index, 0, bindDirective);
559
+ return bindDirective;
560
+ }
561
+ insertBindDirectiveAt(options, index) {
562
+ const node = this._insertBindDirectiveAt(options, index);
563
+ node.create({
564
+ index,
565
+ parentNode: this,
566
+ parentKey: 'bindDirectives',
567
+ });
568
+ return node;
569
+ }
570
+ _addBindDirective(options) {
571
+ const index = this.bindDirectives.length;
572
+ return this._insertBindDirectiveAt(options, index);
573
+ }
574
+ addBindDirective(options) {
575
+ const node = this._addBindDirective(options);
576
+ const index = this.bindDirectives.indexOf(node);
577
+ node.create({
578
+ index,
579
+ parentNode: this,
580
+ parentKey: 'bindDirectives',
581
+ });
582
+ return node;
583
+ }
584
+ getBindStyleExistingNames(excludedList = []) {
585
+ const excludedSet = new Set(excludedList);
586
+ return (this.bindStyles || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
587
+ }
588
+ getBindStyleUniqueName(name = 'bindStyle1') {
589
+ return utils.unique(name, this.getBindStyleExistingNames(), undefined, false);
590
+ }
591
+ _insertBindStyleAt(options, index) {
592
+ const bindStyleOptions = {};
593
+ const relationOptions = { parentNode: this, parentKey: 'bindStyles' };
594
+ const BindStyle = (0, decorators_1.getConceptConstructor)('BindStyle');
595
+ let bindStyle;
596
+ if (!options) {
597
+ bindStyle = BindStyle.from({
598
+ ...bindStyleOptions,
599
+ name: this.getBindStyleUniqueName(),
600
+ }, this, 'bindStyles');
601
+ }
602
+ else if (typeof options === 'string') {
603
+ bindStyle = BindStyle.from({
604
+ ...bindStyleOptions,
605
+ name: options,
606
+ }, this, 'bindStyles');
607
+ }
608
+ else if (asserts.isBindStyle(options)) {
609
+ options.ensureDelete(); // 同一实例不支持多处存在
610
+ bindStyle = options;
611
+ Object.assign(bindStyle, relationOptions);
612
+ }
613
+ else {
614
+ bindStyle = BindStyle.from({
615
+ ...bindStyleOptions,
616
+ ...options,
617
+ }, this, 'bindStyles');
618
+ }
619
+ this.bindStyles.splice(index, 0, bindStyle);
620
+ return bindStyle;
621
+ }
622
+ insertBindStyleAt(options, index) {
623
+ const node = this._insertBindStyleAt(options, index);
624
+ node.create({
625
+ index,
626
+ parentNode: this,
627
+ parentKey: 'bindStyles',
628
+ });
629
+ return node;
630
+ }
631
+ _addBindStyle(options) {
632
+ const index = this.bindStyles.length;
633
+ return this._insertBindStyleAt(options, index);
634
+ }
635
+ addBindStyle(options) {
636
+ const node = this._addBindStyle(options);
637
+ const index = this.bindStyles.indexOf(node);
638
+ node.create({
639
+ index,
640
+ parentNode: this,
641
+ parentKey: 'bindStyles',
642
+ });
643
+ return node;
644
+ }
645
+ _insertViewElementAt(options, index) {
646
+ const viewElementOptions = {};
647
+ const relationOptions = { parentNode: this, parentKey: 'children' };
648
+ const ViewElement = (0, decorators_1.getConceptConstructor)('ViewElement');
649
+ let viewElement;
650
+ if (!options) {
651
+ viewElement = ViewElement.from({
652
+ ...viewElementOptions,
653
+ name: this.getViewElementUniqueName(),
654
+ }, this, 'children');
655
+ }
656
+ else if (typeof options === 'string') {
657
+ viewElement = ViewElement.from({
658
+ ...viewElementOptions,
659
+ name: options,
660
+ }, this, 'children');
661
+ }
662
+ else if (asserts.isViewElement(options)) {
663
+ options.ensureDelete(); // 同一实例不支持多处存在
664
+ viewElement = options;
665
+ Object.assign(viewElement, relationOptions);
666
+ }
667
+ else {
668
+ viewElement = ViewElement.from({
669
+ ...viewElementOptions,
670
+ ...options,
671
+ }, this, 'children');
672
+ }
673
+ this.children.splice(index, 0, viewElement);
674
+ return viewElement;
675
+ }
676
+ insertViewElementAt(options, index) {
677
+ const node = this._insertViewElementAt(options, index);
678
+ node.create({
679
+ index,
680
+ parentNode: this,
681
+ parentKey: 'children',
682
+ });
683
+ return node;
684
+ }
685
+ _addViewElement(options) {
686
+ const index = this.children.length;
687
+ return this._insertViewElementAt(options, index);
688
+ }
689
+ addViewElement(options) {
690
+ const node = this._addViewElement(options);
691
+ const index = this.children.indexOf(node);
692
+ node.create({
693
+ index,
694
+ parentNode: this,
695
+ parentKey: 'children',
696
+ });
697
+ return node;
698
+ }
699
+ removeBindAttribute(options) {
700
+ let bindAttribute;
701
+ if (typeof options === 'string') {
702
+ bindAttribute = this.bindAttrs.find((item) => item.name === options);
703
+ if (!bindAttribute) {
704
+ throw new Error('找不到元素绑定属性 ' + options);
705
+ }
706
+ }
707
+ else {
708
+ bindAttribute = options;
709
+ }
710
+ return bindAttribute.delete();
711
+ }
712
+ __removeBindAttribute(bindAttribute) {
713
+ const parentKey = bindAttribute.parentKey;
714
+ const params = {
715
+ parentNode: this,
716
+ parentKey,
717
+ index: -1,
718
+ object: null,
719
+ oldObject: bindAttribute,
720
+ };
721
+ if (parentKey) {
722
+ params.parentKey = parentKey;
723
+ // @ts-ignore
724
+ const t = this.__v_raw || this;
725
+ // @ts-ignore
726
+ const n = bindAttribute.__v_raw || bindAttribute;
727
+ if (Array.isArray(t[parentKey])) {
728
+ // @ts-ignore
729
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
730
+ ~index && this[parentKey].splice(index, 1);
731
+ params.index = index;
732
+ }
733
+ else {
734
+ const q = t[parentKey];
735
+ if ((q.__v_raw || q) === n) {
736
+ params.index = 0;
737
+ this[parentKey] = undefined;
738
+ }
739
+ }
740
+ }
741
+ return params;
742
+ }
743
+ removeBindEvent(options) {
744
+ let bindEvent;
745
+ if (typeof options === 'string') {
746
+ bindEvent = this.bindEvents.find((item) => item.name === options);
747
+ if (!bindEvent) {
748
+ throw new Error('找不到元素绑定事件 ' + options);
749
+ }
750
+ }
751
+ else {
752
+ bindEvent = options;
753
+ }
754
+ return bindEvent.delete();
755
+ }
756
+ __removeBindEvent(bindEvent) {
757
+ const parentKey = bindEvent.parentKey;
758
+ const params = {
759
+ parentNode: this,
760
+ parentKey,
761
+ index: -1,
762
+ object: null,
763
+ oldObject: bindEvent,
764
+ };
765
+ if (parentKey) {
766
+ params.parentKey = parentKey;
767
+ // @ts-ignore
768
+ const t = this.__v_raw || this;
769
+ // @ts-ignore
770
+ const n = bindEvent.__v_raw || bindEvent;
771
+ if (Array.isArray(t[parentKey])) {
772
+ // @ts-ignore
773
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
774
+ ~index && this[parentKey].splice(index, 1);
775
+ params.index = index;
776
+ }
777
+ else {
778
+ const q = t[parentKey];
779
+ if ((q.__v_raw || q) === n) {
780
+ params.index = 0;
781
+ this[parentKey] = undefined;
782
+ }
783
+ }
784
+ }
785
+ return params;
786
+ }
787
+ removeBindDirective(options) {
788
+ let bindDirective;
789
+ if (typeof options === 'string') {
790
+ bindDirective = this.bindDirectives.find((item) => item.name === options);
791
+ if (!bindDirective) {
792
+ throw new Error('找不到元素指令 ' + options);
793
+ }
794
+ }
795
+ else {
796
+ bindDirective = options;
797
+ }
798
+ return bindDirective.delete();
799
+ }
800
+ __removeBindDirective(bindDirective) {
801
+ const parentKey = bindDirective.parentKey;
802
+ const params = {
803
+ parentNode: this,
804
+ parentKey,
805
+ index: -1,
806
+ object: null,
807
+ oldObject: bindDirective,
808
+ };
809
+ if (parentKey) {
810
+ params.parentKey = parentKey;
811
+ // @ts-ignore
812
+ const t = this.__v_raw || this;
813
+ // @ts-ignore
814
+ const n = bindDirective.__v_raw || bindDirective;
815
+ if (Array.isArray(t[parentKey])) {
816
+ // @ts-ignore
817
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
818
+ ~index && this[parentKey].splice(index, 1);
819
+ params.index = index;
820
+ }
821
+ else {
822
+ const q = t[parentKey];
823
+ if ((q.__v_raw || q) === n) {
824
+ params.index = 0;
825
+ this[parentKey] = undefined;
826
+ }
827
+ }
828
+ }
829
+ return params;
830
+ }
831
+ removeBindStyle(options) {
832
+ let bindStyle;
833
+ if (typeof options === 'string') {
834
+ bindStyle = this.bindStyles.find((item) => item.name === options);
835
+ if (!bindStyle) {
836
+ throw new Error('找不到元素绑定样式 ' + options);
837
+ }
838
+ }
839
+ else {
840
+ bindStyle = options;
841
+ }
842
+ return bindStyle.delete();
843
+ }
844
+ __removeBindStyle(bindStyle) {
845
+ const parentKey = bindStyle.parentKey;
846
+ const params = {
847
+ parentNode: this,
848
+ parentKey,
849
+ index: -1,
850
+ object: null,
851
+ oldObject: bindStyle,
852
+ };
853
+ if (parentKey) {
854
+ params.parentKey = parentKey;
855
+ // @ts-ignore
856
+ const t = this.__v_raw || this;
857
+ // @ts-ignore
858
+ const n = bindStyle.__v_raw || bindStyle;
859
+ if (Array.isArray(t[parentKey])) {
860
+ // @ts-ignore
861
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
862
+ ~index && this[parentKey].splice(index, 1);
863
+ params.index = index;
864
+ }
865
+ else {
866
+ const q = t[parentKey];
867
+ if ((q.__v_raw || q) === n) {
868
+ params.index = 0;
869
+ this[parentKey] = undefined;
870
+ }
871
+ }
872
+ }
873
+ return params;
874
+ }
875
+ removeViewElement(options) {
876
+ let viewElement;
877
+ if (typeof options === 'string') {
878
+ viewElement = this.children.find((item) => item.name === options);
879
+ if (!viewElement) {
880
+ throw new Error('找不到页面元素 ' + options);
881
+ }
882
+ }
883
+ else {
884
+ viewElement = options;
885
+ }
886
+ return viewElement.delete();
887
+ }
888
+ __removeViewElement(viewElement) {
889
+ const parentKey = viewElement.parentKey;
890
+ const params = {
891
+ parentNode: this,
892
+ parentKey,
893
+ index: -1,
894
+ object: null,
895
+ oldObject: viewElement,
896
+ };
897
+ if (parentKey) {
898
+ params.parentKey = parentKey;
899
+ // @ts-ignore
900
+ const t = this.__v_raw || this;
901
+ // @ts-ignore
902
+ const n = viewElement.__v_raw || viewElement;
903
+ if (Array.isArray(t[parentKey])) {
904
+ // @ts-ignore
905
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
906
+ ~index && this[parentKey].splice(index, 1);
907
+ params.index = index;
908
+ }
909
+ else {
910
+ const q = t[parentKey];
911
+ if ((q.__v_raw || q) === n) {
912
+ params.index = 0;
913
+ this[parentKey] = undefined;
914
+ }
915
+ }
916
+ }
917
+ return params;
918
+ }
919
+ //================================================================================
920
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
921
+ // 自动生成的代码已结束。下面可以手动编写。
922
+ //================================================================================
923
+ get likeComponent() {
924
+ return this.view || this?.getAncestor('BusinessComponent');
925
+ }
926
+ /* 主页面有没有权限 */
927
+ get parentAuth() {
928
+ const _nameSpace = this.view.getNamespace();
929
+ const mainViewName = _nameSpace.split('.')[2];
930
+ return this.view.parentNode.concept === 'App'
931
+ ? this.view.auth
932
+ : this.frontend.views.find((item) => item.name === mainViewName)?.auth;
933
+ }
934
+ // IDE内展示需要屏蔽掉“系统统一路径前缀”
935
+ get uiPath() {
936
+ return `${this.view.uiPath}/${this.name}`;
937
+ }
938
+ /**
939
+ * 权限领域的资源路径
940
+ */
941
+ get authPath() {
942
+ return `${this.view.path}/${this.name}`;
943
+ }
944
+ get auth() {
945
+ return this.bindDirectives.find((directive) => directive.name === 'auth');
946
+ }
947
+ getViewElementUniqueName(name = 'viewElement1') {
948
+ return this.likeComponent?.getViewElementUniqueName(name);
949
+ }
950
+ getViewElementUniqueNameOld(name = 'viewElement1') {
951
+ return this.likeComponent?.getViewElementUniqueNameOld(name);
952
+ }
953
+ static from(source, parentNode, parentKey) {
954
+ const node = super.from(source, parentNode, parentKey);
955
+ if (!node.name) {
956
+ const tagName = node.tag.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
957
+ node.name = node.getViewElementUniqueName(`${tagName}1`);
958
+ }
959
+ return node;
960
+ }
961
+ /**
962
+ * 设置组件权限
963
+ */
964
+ setBindRoles(bindRoles) {
965
+ const object = {
966
+ bindRoles,
967
+ };
968
+ this.update({
969
+ ...object,
970
+ });
971
+ }
972
+ getBindAttribute(name) {
973
+ return this.bindAttrs.find((bindAttr) => bindAttr.name === name);
974
+ }
975
+ toHump(name) {
976
+ return name.replace(/-(\w)/g, (all, letter) => letter.toUpperCase());
977
+ }
978
+ toFirstUpper(name) {
979
+ return name.replace(/^\S/, (s) => s.toUpperCase());
980
+ }
981
+ haveScope() {
982
+ return Boolean(this.slotScope);
983
+ }
984
+ getGenericTypes(tag) {
985
+ let T;
986
+ let V;
987
+ let P;
988
+ let M;
989
+ let T1;
990
+ let C;
991
+ const genericTypes = [];
992
+ if (config_1.config?.allNodesAPI[tag]) {
993
+ const { tsTypeParams = '' } = config_1.config?.allNodesAPI[tag];
994
+ const tsTypes = tsTypeParams?.split(',');
995
+ tsTypes.forEach((item) => {
996
+ const reg = /^(\w+)\s?/;
997
+ const result = reg.exec(item.trim());
998
+ const t = result?.[1];
999
+ if (t === 'T') {
1000
+ T = true;
1001
+ genericTypes.push('item');
1002
+ }
1003
+ ;
1004
+ if (t === 'V') {
1005
+ V = true;
1006
+ genericTypes.push('V');
1007
+ }
1008
+ ;
1009
+ if (t === 'P') {
1010
+ P = true;
1011
+ genericTypes.push('pageable');
1012
+ }
1013
+ ;
1014
+ if (t === 'M') {
1015
+ M = true;
1016
+ genericTypes.push('multiple');
1017
+ }
1018
+ ;
1019
+ if (t === 'C') {
1020
+ C = true;
1021
+ genericTypes.push('converter');
1022
+ }
1023
+ ;
1024
+ if (t === 'T1') {
1025
+ T1 = true;
1026
+ genericTypes.push('columnItem');
1027
+ }
1028
+ ;
1029
+ });
1030
+ }
1031
+ return {
1032
+ T,
1033
+ V,
1034
+ P,
1035
+ M,
1036
+ T1,
1037
+ C,
1038
+ genericTypes,
1039
+ };
1040
+ }
1041
+ *toEmbeddedTSDefinition(state = (0, translator_1.createCompilerState)()) {
1042
+ const self = this;
1043
+ let code = '';
1044
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
1045
+ if (self.isCorrespondingBusinessComponent) {
1046
+ code += `${self.name}: ${self.correspondingBusinessComponentNamespace}.${self.tag.replace('bs-', '')};\n`;
1047
+ }
1048
+ else if (self.toHump(self.tag) === 'lcapLogin' || self.staticClass === 'login-form') { // 登录组件不翻译
1049
+ code += `${self.name}: nasl.ui.Div;\n`;
1050
+ }
1051
+ // else if (self.tag === 'u-table-view-column-dynamic') {
1052
+ // code += `${self.name}: nasl.ui.${utils.kebab2Pascal(self.tag)}<any, any>;\n`;
1053
+ // }
1054
+ // 基础组件
1055
+ else if (config_1.config?.allNodesAPI[self.tag]) {
1056
+ const { T, V, P, M, T1, C, genericTypes } = this.getGenericTypes(self.tag);
1057
+ code += `${self.name}: nasl.ui.${utils.kebab2Pascal(self.tag)}`;
1058
+ if (genericTypes.length > 0) {
1059
+ code += `<`;
1060
+ code += genericTypes.map((i) => `typeof __elementsRef.${self.name}.${i}`).join(', ');
1061
+ code += `>`;
1062
+ }
1063
+ code += ';\n';
1064
+ }
1065
+ // else if (Object.keys(PAGE_COMPONENT_INCLUDE_TAG_MAP).includes(self.tag)) {
1066
+ // if (self.bindAttrs?.findIndex((attr) => attr.name === 'data-source') > -1) {
1067
+ // code += `${self.name}: nasl.ui.${self.toHump(self.tag)}<__elements_completionProperty['${self.name
1068
+ // }']['dataSource']>;\n`;
1069
+ // } else {
1070
+ // code += `${self.name}: nasl.ui.${utils.kebab2Pascal(self.tag)};\n`;
1071
+ // }
1072
+ // }
1073
+ else {
1074
+ code += `${self.name}: nasl.ui.${utils.kebab2Pascal(self.tag)};\n`;
1075
+ }
1076
+ if (Array.isArray(self.children)) {
1077
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.children, function* warpForEachGenerator(element) {
1078
+ code += yield* element.toEmbeddedTSDefinition((0, translator_1.shiftState)(state, code));
1079
+ });
1080
+ }
1081
+ return code;
1082
+ }
1083
+ // 这个函数不用了
1084
+ // @withGenerator
1085
+ // *toEmbeddedTSVariableDefinition(
1086
+ // state = createCompilerState(),
1087
+ // variableList?: string[],
1088
+ // nameLevel?: string,
1089
+ // ): TranslatorGenerator {
1090
+ // const self = this;
1091
+ // let code = '';
1092
+ // let currentLevel = nameLevel ? `${nameLevel}?.` : '';
1093
+ // currentLevel += `${self.name}?.()`;
1094
+ // if (PAGE_COMPONENT_INCLUDE_TAG_MAP?.[self.tag]) {
1095
+ // code += indent((state?.tabSize || 0) + 2);
1096
+ // code += `${self.name}: {\n`;
1097
+ // if (Array.isArray(self.bindAttrs)) {
1098
+ // yield* wrapForEach(
1099
+ // self.bindAttrs.filter((attr) => PAGE_COMPONENT_INCLUDE_TAG_MAP[self.tag]?.[attr.name]),
1100
+ // function* warpForEachGenerator(attr) {
1101
+ // code += yield* attr.toEmbeddedTSVariableDefinition(
1102
+ // shiftState(state, code, { inline: true }),
1103
+ // variableList,
1104
+ // self.name,
1105
+ // currentLevel,
1106
+ // );
1107
+ // },
1108
+ // );
1109
+ // if (['u-select', 'van-pickerson'].includes(self.tag)) {
1110
+ // code += indent((state?.tabSize || 0) + 3);
1111
+ // code += `pageNumber: nasl.core.Long\n`;
1112
+ // code += indent((state?.tabSize || 0) + 3);
1113
+ // code += `filterText: nasl.core.String\n`;
1114
+ // } else if (
1115
+ // ['u-list-view', 'u-grid-view', 'u-table-view', 'van-list-view', 'van-grid-view'].includes(self.tag) &&
1116
+ // self.bindAttrs?.findIndex((attr) => attr.name === 'sorting') === -1
1117
+ // ) {
1118
+ // if (['u-list-view', 'van-grid-view', 'van-list-view'].includes(self.tag)) {
1119
+ // code += indent((state?.tabSize || 0) + 3);
1120
+ // code += `filterText: nasl.core.String\n`;
1121
+ // }
1122
+ // code += indent((state?.tabSize || 0) + 3);
1123
+ // code += `sorting: {
1124
+ // field: nasl.core.String
1125
+ // order: nasl.core.String
1126
+ // }\n`;
1127
+ // } else if (['u-cascader', 'van-cascader'].includes(self.tag)) {
1128
+ // code += indent((state?.tabSize || 0) + 3);
1129
+ // code += `filterText: nasl.core.String\n`;
1130
+ // }
1131
+ // }
1132
+ // code += indent((state?.tabSize || 0) + 2);
1133
+ // code += `};\n`;
1134
+ // }
1135
+ // if (Array.isArray(self.children)) {
1136
+ // yield* wrapForEach(self.children, function* warpForEachGenerator(element) {
1137
+ // code += yield* element.toEmbeddedTSVariableDefinition(shiftState(state, code), variableList, currentLevel);
1138
+ // });
1139
+ // }
1140
+ // return code;
1141
+ // }
1142
+ *toEmbeddedTSRefTree(state = (0, translator_1.createCompilerState)(), elementsPathMap, parentLevel) {
1143
+ const self = this;
1144
+ if (asserts.isViewElement(self.parentNode)) {
1145
+ elementsPathMap[self.name] = `${elementsPathMap[self.parentNode.name]}.${self.name}`;
1146
+ }
1147
+ else {
1148
+ elementsPathMap[self.name] = `${self.name}`;
1149
+ }
1150
+ const { T, V, P, M, T1, C } = this.getGenericTypes(self.tag);
1151
+ let code = '';
1152
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1153
+ let levelIndex = parentLevel || 0;
1154
+ code += `${self.name}: () => {\n`;
1155
+ const getType = (name) => {
1156
+ let t;
1157
+ const attr = self.bindAttrs?.find((attr) => attr.name === name);
1158
+ if (['static', 'string'].includes(attr?.type)) {
1159
+ t = attr.value;
1160
+ }
1161
+ else if (['dynamic'].includes(attr?.type)) {
1162
+ t = 'nasl.core.Boolean';
1163
+ }
1164
+ else {
1165
+ t = false;
1166
+ }
1167
+ return t;
1168
+ };
1169
+ const hasDataSource = self.bindAttrs?.findIndex((attr) => ['dataSource', 'data-source'].includes(attr.name)) > -1;
1170
+ // 有数据源属性的组件 才需要生成 item
1171
+ if (hasDataSource && T) {
1172
+ const key = T1 ? 'columnItem' : 'item';
1173
+ const dataSourceAttr = self.bindAttrs?.find((attr) => attr.name === 'dataSource');
1174
+ if (dataSourceAttr?.expression) {
1175
+ if (asserts.isMemberExpression(dataSourceAttr.expression) ||
1176
+ asserts.isIdentifier(dataSourceAttr.expression) ||
1177
+ asserts.isCallLogic(dataSourceAttr.expression)) {
1178
+ const value = yield* dataSourceAttr.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, dataSourceAttr.expression.concept === 'CallLogic' ? {
1179
+ tabSize: 4,
1180
+ inline: true,
1181
+ noNeedParams: true,
1182
+ } : {}));
1183
+ code += `let ${key}: nasl.ui.GetItemTypeFromDataSource<typeof ${value}>;\n`;
1184
+ }
1185
+ else {
1186
+ code += `const _load = () => { return `;
1187
+ code += yield* dataSourceAttr.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code));
1188
+ code += '};\n';
1189
+ code += `let ${key}: nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof _load>>;\n`;
1190
+ }
1191
+ }
1192
+ else {
1193
+ code += `let ${key}: any;\n`;
1194
+ }
1195
+ }
1196
+ // 值
1197
+ let valueType;
1198
+ if (hasDataSource && (V && !T1)) {
1199
+ const valueFieldAttr = self.bindAttrs?.find((attr) => attr.name === "valueField");
1200
+ if (['static', 'string'].includes(valueFieldAttr?.type)) {
1201
+ valueType = `typeof item.${valueFieldAttr.value}`;
1202
+ }
1203
+ else {
1204
+ valueType = 'any';
1205
+ }
1206
+ }
1207
+ // 分页
1208
+ let pageableType;
1209
+ if (hasDataSource && (P && !T1)) {
1210
+ pageableType = getType('pageable');
1211
+ code += `let pageable: ${pageableType};\n`;
1212
+ }
1213
+ // 多选
1214
+ let multipleType;
1215
+ if (hasDataSource && (M && !T1)) {
1216
+ multipleType = getType('multiple');
1217
+ code += `let multiple: ${multipleType};\n`;
1218
+ }
1219
+ if (hasDataSource && (V && !T1)) {
1220
+ code += `// @ts-ignore
1221
+ let value: ${valueType}${[true, 'true'].includes(multipleType) ? '[]' : ''};\n`;
1222
+ code += `// @ts-ignore
1223
+ let V: ${valueType};\n`;
1224
+ }
1225
+ if (C) {
1226
+ // code += `let converter: ${getType('converter')};\n`;
1227
+ code += `let converter: any;\n`;
1228
+ }
1229
+ if (self.tag === 'template' && self.haveScope() && asserts.isViewElement(self.parentNode)) {
1230
+ const currentType = self.parentNode.tag === 'u-table-view-column-dynamic' ? 'CurrentDynamic' : 'Current';
1231
+ // const _this = self.parentNode;
1232
+ // let genericity = '';
1233
+ // if (_this.tag === 'u-table-view-column-dynamic') {
1234
+ // genericity += `<${(_this.parentNode as any).__tsVariableDataSourceTypeName}, ${(_this as any).__tsVariableDataSourceTypeName
1235
+ // }>`;
1236
+ // } else {
1237
+ // let targetNode: any = _this;
1238
+ // while ((!targetNode.__tsVariableDataSourceTypeName || targetNode.__tsVariableDataSourceTypeName === 'any') && asserts.isViewElement(targetNode?.parentNode)) {
1239
+ // targetNode = targetNode.parentNode;
1240
+ // }
1241
+ // genericity += `<${(targetNode as any).__tsVariableDataSourceTypeName ?? 'any'}>`;
1242
+ // }
1243
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 3);
1244
+ code += `let current${levelIndex === 0 ? '' : levelIndex}: nasl.ui.${currentType}<typeof item${currentType === 'CurrentDynamic' ? ', typeof columnItem' : ''}>;\n`;
1245
+ levelIndex++;
1246
+ }
1247
+ // const attr = self.bindAttrs?.find((item) => item.name === 'dataSource');
1248
+ // if (attr && attr.expression) {
1249
+ // const datasourceName = `datasourceName${self.name}`;
1250
+ // (self as any).__tsVariableDataSourceTypeName = datasourceName;
1251
+ // if (
1252
+ // asserts.isMemberExpression(attr.expression) ||
1253
+ // asserts.isIdentifier(attr.expression) ||
1254
+ // asserts.isCallLogic(attr.expression)
1255
+ // ) {
1256
+ // const extraParams = {
1257
+ // tabSize: 4,
1258
+ // inline: true,
1259
+ // noNeedParams: true,
1260
+ // };
1261
+ // let value = yield* attr.expression.toEmbeddedTS(
1262
+ // shiftState(state, code, attr.expression.concept === 'CallLogic' ? extraParams : {}),
1263
+ // );
1264
+ // code += indent((state?.tabSize || 0) + 3);
1265
+ // code += `type ${datasourceName} = nasl.ui.GetItemTypeFromDataSource<typeof ${value}>;\n`;
1266
+ // // code += `let current${levelIndex === 0 ? '' : levelIndex}: nasl.ui.${currentType}<nasl.ui.GetItemTypeFromDataSource<typeof ${value}>>;\n`;
1267
+ // } else {
1268
+ // code += indent((state?.tabSize || 0) + 3);
1269
+ // code += `const __funcName = () => { return `;
1270
+ // code += yield* attr.expression.toEmbeddedTS(shiftState(state, code));
1271
+ // code += '};\n';
1272
+ // code += indent((state?.tabSize || 0) + 3);
1273
+ // code += `type ${datasourceName} = nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof __funcName>>;\n`;
1274
+ // // code += `let current${levelIndex === 0 ? '' : levelIndex}: nasl.ui.${currentType}<nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof __funcName>>>;\n`;
1275
+ // }
1276
+ // } else {
1277
+ // (self as any).__tsVariableDataSourceTypeName = 'any';
1278
+ // }
1279
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 3);
1280
+ code += `return {\n`;
1281
+ if (T) {
1282
+ code += `item,\n`;
1283
+ }
1284
+ if (V) {
1285
+ code += `value,V,\n`;
1286
+ }
1287
+ if (P) {
1288
+ code += `pageable,\n`;
1289
+ }
1290
+ if (M) {
1291
+ code += `multiple,\n`;
1292
+ }
1293
+ if (T1) {
1294
+ code += `columnItem,\n`;
1295
+ }
1296
+ if (C) {
1297
+ code += `converter,\n`;
1298
+ }
1299
+ // if (Array.isArray(self.bindAttrs)) {
1300
+ // yield* wrapForEach(
1301
+ // self.bindAttrs.filter((attr) => PAGE_COMPONENT_INCLUDE_TAG_MAP[self.tag]?.[attr.name]),
1302
+ // function* warpForEachGenerator(attr) {
1303
+ // code += yield* attr.toEmbeddedTSRefTree(shiftState(state, code, { inline: true }));
1304
+ // },
1305
+ // );
1306
+ // }
1307
+ if (Array.isArray(self.children)) {
1308
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 4);
1309
+ code += `children: {\n`;
1310
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.children, function* warpForEachGenerator(element) {
1311
+ code += yield* element.toEmbeddedTSRefTree((0, translator_1.shiftState)({ ...state, tabSize: state.tabSize + 2 }, code), elementsPathMap, levelIndex);
1312
+ });
1313
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 4);
1314
+ code += `},\n`;
1315
+ }
1316
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 3);
1317
+ code += `};\n`;
1318
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1319
+ code += `},\n`;
1320
+ return code;
1321
+ }
1322
+ getTypeArgmentsStr(state, currentNode) {
1323
+ // 登录组件不翻译
1324
+ if (this.toHump(this.tag) === 'lcapLogin' || this.staticClass === 'login-form')
1325
+ return '<any>';
1326
+ let code = '';
1327
+ // formItem的单独处理
1328
+ if (this.tag === 'u-form-item') {
1329
+ if (Array.isArray(this.children) && this.children.length) {
1330
+ const tag = this.children[0].tag;
1331
+ if (tag === 'u-input') {
1332
+ code += '<nasl.core.String>';
1333
+ }
1334
+ else if (tag === 'u-input-number') {
1335
+ code += '<nasl.core.Long>';
1336
+ }
1337
+ else {
1338
+ code += '<any>';
1339
+ }
1340
+ }
1341
+ return code;
1342
+ }
1343
+ if (this.tag === 'u-table-view-column-group') {
1344
+ code += `<${this.parentNode.__tsDataSourceTypeName}>`;
1345
+ return code;
1346
+ }
1347
+ const bindAttrs = this.bindAttrs;
1348
+ if (bindAttrs && bindAttrs.length) {
1349
+ const attr = bindAttrs.find((item) => item.name === 'dataSource');
1350
+ if (attr && attr.expression) {
1351
+ if (this.tag === 'u-table-view-column-dynamic') {
1352
+ code += `<${this.parentNode.__tsDataSourceTypeName}, ${this.__tsDataSourceTypeName}>`;
1353
+ }
1354
+ else {
1355
+ code += `<${this.__tsDataSourceTypeName}>`;
1356
+ }
1357
+ }
1358
+ }
1359
+ return code;
1360
+ }
1361
+ *getDatasourceTypeCodeStr(state, eleArr) {
1362
+ let code = '';
1363
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(eleArr ?? [], function* wrapForEach(element, index) {
1364
+ const bindAttrs = element.bindAttrs;
1365
+ if (bindAttrs && bindAttrs.length) {
1366
+ const attr = bindAttrs.find((item) => item.name === 'dataSource');
1367
+ if (attr && attr.expression) {
1368
+ const datasourceName = `datasourceName${element.name}`;
1369
+ element.__tsDataSourceTypeName = datasourceName;
1370
+ if (asserts.isMemberExpression(attr.expression) ||
1371
+ asserts.isIdentifier(attr.expression) ||
1372
+ asserts.isCallLogic(attr.expression)) {
1373
+ const extraParams = {
1374
+ tabSize: 4,
1375
+ inline: true,
1376
+ noNeedParams: true,
1377
+ callLogicNoIife: true,
1378
+ };
1379
+ const value = yield* attr.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, attr.expression.concept === 'CallLogic' ? extraParams : {}));
1380
+ code += `type ${datasourceName} = `;
1381
+ code += `nasl.ui.GetItemTypeFromDataSource<typeof ${value}>;\n`;
1382
+ }
1383
+ else {
1384
+ code += `const __funcName${index} = () => { return`;
1385
+ code += yield* attr.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code));
1386
+ code += '};\n';
1387
+ code += `type ${datasourceName} = `;
1388
+ code += `nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof __funcName${index}>>;\n`;
1389
+ }
1390
+ }
1391
+ }
1392
+ });
1393
+ code += '\n';
1394
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1395
+ return code;
1396
+ }
1397
+ // 获取端类型
1398
+ get frontendType() {
1399
+ return this.getAncestor('FrontendType');
1400
+ }
1401
+ // 对应业务组件
1402
+ get isCorrespondingBusinessComponent() {
1403
+ return this.tag.startsWith('bs-');
1404
+ }
1405
+ // 对应的业务组件的Namespace
1406
+ get correspondingBusinessComponentNamespace() {
1407
+ return `${this.frontendType?.getNamespace()}.${this.frontendType?.name}.businessComponents`;
1408
+ }
1409
+ // 获取对应的业务组件
1410
+ get correspondingBusinessComponent() {
1411
+ if (this.isCorrespondingBusinessComponent) {
1412
+ // 端下的业务组件
1413
+ const businessComponents = this.frontendType?.businessComponents;
1414
+ const businessComponent = businessComponents.find((businessComponent) => {
1415
+ return `bs-${businessComponent?.name}` === this.tag;
1416
+ });
1417
+ return businessComponent;
1418
+ }
1419
+ }
1420
+ *toEmbeddedTS(state = (0, translator_1.createCompilerState)(), parentLevel) {
1421
+ const self = this;
1422
+ const { parentNode, app, tag, staticClass, name, bindRoles, bindEvents, children } = self;
1423
+ const chineseTsName = (name) => {
1424
+ let tsName = name;
1425
+ // 匹配所有特殊字符都转为_
1426
+ tsName = tsName.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, '_');
1427
+ if (/^\d/.test(tsName)) {
1428
+ tsName = '$' + tsName;
1429
+ }
1430
+ return tsName;
1431
+ };
1432
+ // 过滤模板的登录中的一些翻译,这里只过滤h5表格中的两个列
1433
+ if ((parentNode.concept === 'ViewElement' &&
1434
+ parentNode.tag &&
1435
+ this.toHump(parentNode.tag) === 'lcapLogin') ||
1436
+ staticClass === 'login-cell') {
1437
+ return '';
1438
+ }
1439
+ // pc事件翻译
1440
+ if (self.toHump(tag) === 'lcapLogin') {
1441
+ let code = `new nasl.ui.Div({_name: __elements.${self.name},\n`;
1442
+ // 事件
1443
+ if (Array.isArray(self.bindEvents)) {
1444
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.bindEvents, function* warpForEachGenerator(event) {
1445
+ code += yield* event.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
1446
+ tabSize: (state?.tabSize || 0) + 2,
1447
+ }));
1448
+ code += '\n';
1449
+ });
1450
+ }
1451
+ code += `}),\n`;
1452
+ return code;
1453
+ }
1454
+ let levelIndex = parentLevel || 0;
1455
+ if (tag === 'template') {
1456
+ const hasScope = self.haveScope();
1457
+ const slotTarget = !self.slotTarget ? 'slotDefault' : `slot${self.toFirstUpper(self.toHump(self.slotTarget))}`;
1458
+ let code = '';
1459
+ if (hasScope) {
1460
+ code += `${slotTarget}: (current${levelIndex === 0 ? '' : levelIndex}) => [\n`;
1461
+ levelIndex++;
1462
+ }
1463
+ else {
1464
+ code += `${slotTarget}: () => [\n`;
1465
+ }
1466
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.children, function* warpForEachGenerator(element) {
1467
+ code += yield* element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
1468
+ tabSize: state?.tabSize || 0,
1469
+ }), levelIndex);
1470
+ });
1471
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1472
+ code += '\n],\n';
1473
+ return code;
1474
+ }
1475
+ // 老逻辑注释掉
1476
+ if (false) {
1477
+ if (tag === 'template' && self.haveScope()) {
1478
+ const slotTarget = !self.slotTarget ? 'slotDefault' : 'slot' + self.toFirstUpper(self.toHump(self.slotTarget));
1479
+ let code = '';
1480
+ code += `${slotTarget}: (current${levelIndex === 0 ? '' : levelIndex}) => [\n`;
1481
+ // code += yield* self.getDatasourceTypeCodeStr(state, self.children);
1482
+ levelIndex++;
1483
+ // code += 'return [';
1484
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.children, function* warpForEachGenerator(element) {
1485
+ code += yield* element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
1486
+ tabSize: state?.tabSize || 0,
1487
+ }), levelIndex);
1488
+ });
1489
+ // code += ']';
1490
+ code += '\n';
1491
+ code += '],\n';
1492
+ return code;
1493
+ }
1494
+ else if (tag === 'template') {
1495
+ const slotTarget = !self.slotTarget ? 'slotDefault' : 'slot' + self.toFirstUpper(self.toHump(self.slotTarget));
1496
+ let code = '';
1497
+ code += `${slotTarget}: () => [\n`;
1498
+ // code += yield* self.getDatasourceTypeCodeStr(state, self.children);
1499
+ // code += 'return [';
1500
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.children, function* warpForEachGenerator(element) {
1501
+ code += yield* element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
1502
+ tabSize: state?.tabSize || 0,
1503
+ }), levelIndex);
1504
+ });
1505
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1506
+ // code += ']';
1507
+ code += '\n';
1508
+ code += '],\n';
1509
+ return code;
1510
+ }
1511
+ }
1512
+ let namespace = `nasl.ui.${utils.kebab2Pascal(tag)}`;
1513
+ if (self.isCorrespondingBusinessComponent) {
1514
+ namespace = `${self.correspondingBusinessComponentNamespace}.${self.tag.replace('bs-', '')}`;
1515
+ }
1516
+ const { T, V, P, M, T1, C, genericTypes } = this.getGenericTypes(self.tag);
1517
+ let code = `new ${namespace}`;
1518
+ if (genericTypes.length > 0) {
1519
+ code += `<`;
1520
+ code += genericTypes.map((i) => `typeof __elementsRef.${self.name}.${i}`).join(', ');
1521
+ code += `>`;
1522
+ }
1523
+ // 增加唯一name 后面那个name是为了查找引用的时候用的
1524
+ code += `({_name: __elements.${self.name},\n`;
1525
+ // 是否开启权限
1526
+ // const hasAuth = Array.isArray(bindDirectives)
1527
+ // ? !!bindDirectives.filter((directive) => directive.name === 'auth').length
1528
+ // : false;
1529
+ // 角色
1530
+ if (Array.isArray(bindRoles) && bindRoles.length) {
1531
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1532
+ code += 'roles: [\n';
1533
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(bindRoles, function* warpForEachGenerator(role) {
1534
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 3);
1535
+ code += `${app.getNamespace()}.roles.${chineseTsName(role)}.${chineseTsName(role)},`;
1536
+ code += '\n';
1537
+ });
1538
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1539
+ code += '],\n';
1540
+ }
1541
+ // 事件
1542
+ if (Array.isArray(bindEvents)) {
1543
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(bindEvents, function* warpForEachGenerator(event) {
1544
+ code += yield* event.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
1545
+ tabSize: (state?.tabSize || 0) + 2,
1546
+ }));
1547
+ code += '\n';
1548
+ });
1549
+ }
1550
+ // 子元素
1551
+ if (Array.isArray(children)) {
1552
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
1553
+ if (Array.isArray(self.bindAttrs)) {
1554
+ // code += `bindAttr: `;
1555
+ // if (self.isCorrespondingBusinessComponent) {
1556
+ // code += `{\n`;
1557
+ // } else {
1558
+ // code += `() => [\n`;
1559
+ // }
1560
+ // 属性
1561
+ const validAttrs = self.bindAttrs.filter((attr) => {
1562
+ const com = config_1.config.allNodesAPI[self.tag];
1563
+ if (com) {
1564
+ const { props } = com;
1565
+ const prop = props?.find((item) => item.name === attr.name);
1566
+ if (prop) {
1567
+ return true;
1568
+ }
1569
+ return false;
1570
+ }
1571
+ return true;
1572
+ });
1573
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(validAttrs, function* warpForEachGenerator(attr) {
1574
+ // 过滤业务组件的非表达式模式的翻译
1575
+ const shouldFilter = self.isCorrespondingBusinessComponent && (attr.type !== 'dynamic');
1576
+ if (shouldFilter) {
1577
+ return;
1578
+ }
1579
+ const propCode = yield* attr.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: 1 }));
1580
+ if (propCode.trim()) {
1581
+ code += `${propCode},\n`;
1582
+ }
1583
+ });
1584
+ // 指令v-if等
1585
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.bindDirectives, function* warpForEachGenerator(directive) {
1586
+ const directiveCode = yield* directive.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: 1 }));
1587
+ if (directiveCode.trim()) {
1588
+ code += `${directiveCode},\n`;
1589
+ }
1590
+ });
1591
+ // 样式绑定
1592
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.bindStyles, function* warpForEachGenerator(bindStyle) {
1593
+ const styleCode = yield* bindStyle.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: 1 }));
1594
+ if (styleCode.trim()) {
1595
+ code += `${styleCode},\n`;
1596
+ }
1597
+ });
1598
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1599
+ // if (self.isCorrespondingBusinessComponent) {
1600
+ // code += '},\n';
1601
+ // } else {
1602
+ // code += '],\n';
1603
+ // }
1604
+ }
1605
+ // 如果子集中有插槽的就
1606
+ if (children.find((item) => item.tag === 'template' && item.slotTarget)) {
1607
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1608
+ const defaultArr = [];
1609
+ // 先把插槽翻译了
1610
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(children, function* warpForEachGenerator(element) {
1611
+ if (element.tag === 'template') {
1612
+ code += yield* element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
1613
+ tabSize: state?.tabSize || 0,
1614
+ }), levelIndex);
1615
+ }
1616
+ else {
1617
+ defaultArr.push(element);
1618
+ }
1619
+ });
1620
+ // 翻译其余的子集
1621
+ if (defaultArr.length) {
1622
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1623
+ code += `slotDefault: () => [\n`;
1624
+ // code += yield* self.getDatasourceTypeCodeStr(state, defaultArr);
1625
+ // code += 'return [';
1626
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(defaultArr, function* warpForEachGenerator(element) {
1627
+ code += yield* element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
1628
+ tabSize: (state?.tabSize || 0) + 2,
1629
+ }), levelIndex);
1630
+ code += '\n';
1631
+ });
1632
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1633
+ // code += ']\n';
1634
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
1635
+ code += ']\n';
1636
+ }
1637
+ }
1638
+ else if (children?.length) {
1639
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1640
+ code += `slotDefault: () => [\n`;
1641
+ // code += yield* self.getDatasourceTypeCodeStr(state, children);
1642
+ // code += 'return [';
1643
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(children, function* warpForEachGenerator(element) {
1644
+ code += yield* element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
1645
+ tabSize: (state?.tabSize || 0) + 2,
1646
+ }), levelIndex);
1647
+ code += '\n';
1648
+ });
1649
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
1650
+ // code += ']\n';
1651
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
1652
+ code += ']\n';
1653
+ }
1654
+ }
1655
+ code += (0, translator_1.indent)(state?.tabSize || 0) + '})';
1656
+ // 顶层元素是单独的表达式
1657
+ if (parentNode.concept === 'View' || asserts.isBusinessComponent(parentNode)) {
1658
+ code += ';\n';
1659
+ }
1660
+ else {
1661
+ code += ',\n';
1662
+ }
1663
+ return code;
1664
+ }
1665
+ toNaturalTS(state = (0, translator_1.createCompilerState)(), parentLevel) {
1666
+ let code = '';
1667
+ const levelIndex = parentLevel || 0;
1668
+ if (Array.isArray(this.bindEvents)) {
1669
+ this.bindEvents.forEach((event) => {
1670
+ code += event.toNaturalTS((0, translator_1.shiftState)(state, code, {
1671
+ tabSize: state.tabSize,
1672
+ }));
1673
+ // code += '\n';
1674
+ });
1675
+ }
1676
+ if (Array.isArray(this.children)) {
1677
+ if (this.children.find((item) => item.tag === 'template' && item.slotTarget)) {
1678
+ // code += indent(state.tabSize + 2);
1679
+ const defaultArr = [];
1680
+ // 先把插槽翻译了
1681
+ this.children.forEach((element) => {
1682
+ if (element.tag === 'template') {
1683
+ code += element.toNaturalTS((0, translator_1.shiftState)(state, code, {
1684
+ tabSize: state.tabSize,
1685
+ }), levelIndex);
1686
+ }
1687
+ else {
1688
+ defaultArr.push(element);
1689
+ }
1690
+ });
1691
+ // 翻译其余的子集
1692
+ if (defaultArr.length) {
1693
+ defaultArr.forEach((element) => {
1694
+ code += element.toNaturalTS((0, translator_1.shiftState)(state, code, {
1695
+ tabSize: state.tabSize,
1696
+ }), levelIndex);
1697
+ });
1698
+ }
1699
+ }
1700
+ else {
1701
+ this.children.forEach((element) => {
1702
+ code += element.toNaturalTS((0, translator_1.shiftState)(state, code, {
1703
+ tabSize: state.tabSize,
1704
+ }), levelIndex);
1705
+ });
1706
+ }
1707
+ }
1708
+ return code;
1709
+ }
1710
+ toNaturalTSDefinition(state) {
1711
+ let code = '';
1712
+ if (['u-button', 'u-form', 'u-modal', 'u-table-view', 'u-select', 'u-input', 'u-number-input'].includes(this.tag)) {
1713
+ code += (0, translator_1.indent)(state.tabSize + 1);
1714
+ // 登录组件不翻译
1715
+ // if (this.toHump(this.tag) === 'lcapLogin' || this.staticClass === 'login-form') {
1716
+ // code += `${this.name}: nasl.ui.div;\n`;
1717
+ // } else {
1718
+ code += `${this.name}: nasl.ui.${(0, utils_1.kebab2Camel)(this.tag.replace(/^\w-/, ''))},\n`;
1719
+ // }
1720
+ }
1721
+ if (Array.isArray(this.children)) {
1722
+ this.children.forEach((element) => {
1723
+ code += element.toNaturalTSDefinition((0, translator_1.shiftState)(state, code));
1724
+ });
1725
+ }
1726
+ return code;
1727
+ }
1728
+ _duplicate() {
1729
+ const element = ViewElement_1.from(this.toTemplateJSON());
1730
+ const nameMap = element.deepRenameElements(this);
1731
+ utils.traverse((current) => {
1732
+ const node = current.node;
1733
+ if (node.concept === 'CallLogic') {
1734
+ node.uuid = (0, uuid_1.v4)().replace(/-/g, '');
1735
+ if (/elements.(.+).logics/.test(node.calleeNamespace)) {
1736
+ const oldName = node.calleeNamespace.split('.')[1];
1737
+ if (nameMap.has(oldName)) {
1738
+ const newName = nameMap.get(oldName);
1739
+ node.calleeNamespace = `elements.${newName}.logics`;
1740
+ }
1741
+ }
1742
+ }
1743
+ // 如果创建副本,内部的国际化标识都要去掉
1744
+ if (node.i18nKey) {
1745
+ delete node.i18nKey;
1746
+ }
1747
+ }, { node: element }, { mode: 'anyObject', excludedKeySet: element.JSON_EXCLUDED_KEYS });
1748
+ this.likeComponent?.existingViewElement.clear();
1749
+ return element;
1750
+ }
1751
+ setTag(tag) {
1752
+ const object = {
1753
+ tag,
1754
+ };
1755
+ this.update({
1756
+ ...object,
1757
+ });
1758
+ }
1759
+ // 递归遍历组件
1760
+ traverseChildren(cb) {
1761
+ utils.traverse((current) => {
1762
+ cb(current.node);
1763
+ }, { node: this });
1764
+ }
1765
+ // 递归生成组件名
1766
+ deepRenameElements(node) {
1767
+ const map = new Map();
1768
+ this.traverseChildren((ele) => {
1769
+ const oldName = ele.name;
1770
+ const tagName = ele.tag.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
1771
+ ele.name = node.getViewElementUniqueName(`${tagName}1`);
1772
+ map.set(oldName, ele.name);
1773
+ });
1774
+ return map;
1775
+ }
1776
+ /**
1777
+ * 解析属性中的表达式
1778
+ * @param value
1779
+ * @param $def 目前 $def 只用来查找 $def.variables 和 $def.structures
1780
+ * @param dataSchema
1781
+ */
1782
+ static _parseExpression(value) {
1783
+ try {
1784
+ const ast = babelParser.parseExpression(value);
1785
+ const node = transAstNodeToNaslNode(ast);
1786
+ return LogicItem__1.LogicItem.from(node, null, null);
1787
+ }
1788
+ catch (e) {
1789
+ return null;
1790
+ }
1791
+ }
1792
+ static _parseValidationRule(value) {
1793
+ let calleeName = value;
1794
+ let args = [];
1795
+ try {
1796
+ const ast = babelParser.parseExpression(value);
1797
+ const validationNamespace = (0, concepts_1.getStdlibNamespace)().findChild('validation');
1798
+ if (ast.type === 'CallExpression') {
1799
+ calleeName = (ast.callee?.property?.name ?? ast.callee?.property?.value ?? ast.callee?.name).replace(/\(.*/, '');
1800
+ const func = validationNamespace.functions.find((item) => item.name === calleeName);
1801
+ args = ast.arguments.map((argument, index) => ({
1802
+ concept: 'Argument',
1803
+ name: '',
1804
+ kind: 'Statement',
1805
+ keyword: func?.params?.[index]?.name ?? '',
1806
+ expression: transAstNodeToNaslNode(Object.assign({}, argument)),
1807
+ }));
1808
+ }
1809
+ }
1810
+ catch (error) { }
1811
+ return {
1812
+ concept: 'ValidationRule',
1813
+ name: '',
1814
+ label: '验证规则',
1815
+ kind: 'Expression',
1816
+ calleeNamespace: 'nasl.validation',
1817
+ arguments: args,
1818
+ calleeName,
1819
+ };
1820
+ }
1821
+ /**
1822
+ * 从 Vue 的 ASTNode 转换成 ASL 元素
1823
+ * @param astNode Vue 的 ASTNode
1824
+ */
1825
+ static _fromASTNode(astNode, context) {
1826
+ const view = context?.view;
1827
+ // 临时处理组件的 text
1828
+ //h5-mock
1829
+ if ([
1830
+ 'u-text',
1831
+ 'van-text',
1832
+ 'u-link',
1833
+ 'u-button',
1834
+ 'u-label',
1835
+ 'u-radio',
1836
+ 'u-checkbox',
1837
+ 'u-navbar-item',
1838
+ 'u-sidebar-item',
1839
+ 'u-menu-item',
1840
+ ].includes(astNode.tag) &&
1841
+ astNode.children.length === 1 &&
1842
+ astNode.children[0].type === 3) {
1843
+ astNode.attrs = astNode.attrs || [];
1844
+ astNode.attrs.push({
1845
+ name: 'text',
1846
+ value: JSON.stringify(astNode.children[0].text),
1847
+ });
1848
+ astNode.children = [];
1849
+ }
1850
+ // 将 scopedSlots 合并到 children 中
1851
+ if (astNode.scopedSlots) {
1852
+ astNode.children = astNode.children || [];
1853
+ Object.keys(astNode.scopedSlots).forEach((key) => {
1854
+ if (!astNode.children.find((child) => key === child.slotTarget)) {
1855
+ astNode.children.unshift(astNode.scopedSlots[key]);
1856
+ }
1857
+ });
1858
+ delete astNode.scopedSlots;
1859
+ }
1860
+ // 提示不支持的属性
1861
+ [
1862
+ 'component',
1863
+ 'inlineTemplate',
1864
+ 'pre',
1865
+ 'ns',
1866
+ 'transition',
1867
+ 'transitionOnAppear',
1868
+ 'transitionMode',
1869
+ 'slotName',
1870
+ 'classBinding',
1871
+ 'styleBinding',
1872
+ ].forEach((key) => {
1873
+ if (astNode[key])
1874
+ console.warn(`[warn] ViewElement NASL unsupports '${key}' field in node `, astNode);
1875
+ });
1876
+ const BindAttribute = (0, decorators_1.getConceptConstructor)('BindAttribute');
1877
+ const BindDirective = (0, decorators_1.getConceptConstructor)('BindDirective');
1878
+ const BindEvent = (0, decorators_1.getConceptConstructor)('BindEvent');
1879
+ let element;
1880
+ if (astNode.type === 1) {
1881
+ if (astNode.tag === 'router-view') {
1882
+ if (view.frontend.type === 'h5') {
1883
+ astNode.tag = 'van-router-view';
1884
+ }
1885
+ else {
1886
+ astNode.tag = 'u-router-view';
1887
+ }
1888
+ }
1889
+ const tagName = astNode.tag.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
1890
+ let newContext = {};
1891
+ if (context) {
1892
+ newContext = {
1893
+ ...context,
1894
+ };
1895
+ }
1896
+ element = new ViewElement_1({
1897
+ tag: astNode.tag,
1898
+ name: astNode.attrsMap.ref || view.getViewElementUniqueName(`${tagName}1`),
1899
+ staticClass: astNode.attrsMap.class,
1900
+ staticStyle: astNode.attrsMap.style,
1901
+ slotTarget: astNode.slotTarget && json5.parse(astNode.slotTarget),
1902
+ slotScope: astNode.slotScope === '_empty_' ? '' : astNode.slotScope,
1903
+ children: astNode.children.map((item) => this._fromASTNode(item, newContext)),
1904
+ });
1905
+ const attrName2Camel = (name) => {
1906
+ if (name.startsWith('vusion-'))
1907
+ return name;
1908
+ return name.replace(/(?:v-)([a-zA-Z0-9])/g, (m, $1) => $1.toUpperCase());
1909
+ };
1910
+ astNode?.attrs?.forEach((oldAttr) => {
1911
+ let attr;
1912
+ // 获取原始属性
1913
+ const orginAttrCode = (context?.code || '').substr(oldAttr.start, oldAttr.end - oldAttr.start);
1914
+ if (oldAttr.value === '""' && orginAttrCode.trim() === oldAttr.name) {
1915
+ attr = new BindAttribute({
1916
+ type: 'static',
1917
+ name: attrName2Camel(oldAttr.name),
1918
+ value: 'true',
1919
+ });
1920
+ }
1921
+ else {
1922
+ try {
1923
+ const tmp = json5.parse(oldAttr.value);
1924
+ const source = {
1925
+ type: typeof tmp === 'string' ? 'string' : 'static',
1926
+ name: attrName2Camel(oldAttr.name),
1927
+ value: typeof tmp === 'string' ? tmp : oldAttr.value,
1928
+ };
1929
+ if (oldAttr.name === 'rules') {
1930
+ source.rules = tmp?.split('|').map((ruleStr) => this._parseValidationRule(ruleStr.trim()));
1931
+ }
1932
+ else if (['page-number', 'page-size', 'pageNumber', 'pageSize'].includes(oldAttr.name)) {
1933
+ source.value = Number(source.value);
1934
+ }
1935
+ attr = new BindAttribute(source);
1936
+ }
1937
+ catch (e) {
1938
+ const expression = this._parseExpression(oldAttr.value);
1939
+ attr = new BindAttribute({
1940
+ type: 'dynamic',
1941
+ name: attrName2Camel(oldAttr.name),
1942
+ value: expression ? '' : oldAttr.value,
1943
+ expression,
1944
+ });
1945
+ if (astNode.attrsMap[`:${attr.name}.sync`]) {
1946
+ attr.sync = true;
1947
+ }
1948
+ }
1949
+ }
1950
+ element.addBindAttribute(attr);
1951
+ });
1952
+ // compiler 处理:value.sync 时会加上update:value事件,需要过滤
1953
+ astNode.events &&
1954
+ Object.keys(astNode.events)
1955
+ .filter((name) => !name.startsWith('update:'))
1956
+ .forEach((name) => {
1957
+ const oldEvent = astNode.events[name];
1958
+ const str = oldEvent.value;
1959
+ const calleeName = str.split('(')[0];
1960
+ const matchArr = str.match(/\(([^)]*)\)/) || [];
1961
+ let argsStr = '';
1962
+ if (matchArr?.length >= 2) {
1963
+ argsStr = matchArr[1];
1964
+ }
1965
+ let args = [];
1966
+ const argStrs = argsStr.split(',');
1967
+ args = argStrs
1968
+ .filter((argStr) => !!argStr)
1969
+ .map((argStr) => {
1970
+ const keyword = argStr.trim().split('.');
1971
+ return {
1972
+ concept: 'Argument',
1973
+ expression: genArgumentMemberExpression(keyword),
1974
+ };
1975
+ });
1976
+ const viewLogics = context?.definition?.viewLogics || [];
1977
+ const currentLogic = viewLogics.find((item) => item.name === calleeName);
1978
+ if (currentLogic) {
1979
+ element.addBindEvent(new BindEvent({
1980
+ name,
1981
+ calleeNamespace: '',
1982
+ calleeName: '',
1983
+ arguments: args,
1984
+ logics: [currentLogic],
1985
+ }));
1986
+ }
1987
+ });
1988
+ astNode.directives &&
1989
+ astNode.directives.forEach((directive) => {
1990
+ if (directive.name === 'model') {
1991
+ const valueAttr = astNode.attrs && astNode.attrs.find((attr) => attr.name === 'value');
1992
+ if (!valueAttr) {
1993
+ const expression = this._parseExpression(directive.value);
1994
+ element.addBindAttribute(new BindAttribute({
1995
+ type: 'dynamic',
1996
+ name: 'value',
1997
+ value: expression ? '' : directive.value,
1998
+ expression,
1999
+ sync: true,
2000
+ }));
2001
+ }
2002
+ }
2003
+ else {
2004
+ const expression = this._parseExpression(directive.value);
2005
+ element.addBindDirective(new BindDirective({
2006
+ type: expression ? 'string' : 'dynamic',
2007
+ name: directive.name,
2008
+ rawName: directive.rawName,
2009
+ value: expression ? '' : directive.value,
2010
+ expression,
2011
+ arg: directive.arg,
2012
+ // modifiers: directive.modifiers,
2013
+ }));
2014
+ }
2015
+ });
2016
+ if (astNode.if) {
2017
+ element.addBindDirective(new BindDirective({
2018
+ type: 'dynamic',
2019
+ name: 'if',
2020
+ rawName: 'v-if',
2021
+ value: '',
2022
+ expression: this._parseExpression(astNode.if),
2023
+ }));
2024
+ }
2025
+ }
2026
+ else if (astNode.type === 2) {
2027
+ const tagName = config_1.config.scope === 'h5' ? 'van-text' : 'u-text';
2028
+ const baseName = tagName.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
2029
+ element = new ViewElement_1({
2030
+ tag: tagName,
2031
+ name: view.getViewElementUniqueName(`${baseName}1`),
2032
+ });
2033
+ const value = astNode.text?.match(/{{(.*?)}}/)[1].trim();
2034
+ const expression = this._parseExpression(value);
2035
+ element.addBindAttribute(new BindAttribute({
2036
+ type: 'dynamic',
2037
+ name: 'text',
2038
+ value: expression ? '' : value,
2039
+ expression,
2040
+ }));
2041
+ }
2042
+ else if (astNode.type === 3) {
2043
+ const tagName = config_1.config.scope === 'h5' ? 'van-text' : 'u-text';
2044
+ const baseName = tagName.replace(ViewElement_1.TAG_NAME_PREFIX_REG, '').replace(/-/g, '_');
2045
+ element = new ViewElement_1({
2046
+ tag: tagName,
2047
+ name: view.getViewElementUniqueName(`${baseName}1`),
2048
+ });
2049
+ element.addBindAttribute(new BindAttribute({
2050
+ name: 'text',
2051
+ type: 'string',
2052
+ value: astNode.text?.trim(),
2053
+ }));
2054
+ }
2055
+ return element;
2056
+ }
2057
+ /**
2058
+ * 解析 Vue 模板
2059
+ * 该方法不会绑定 view 和 parent,如果是添加元素优先使用 fromHTML
2060
+ * @param html Vue 的模板
2061
+ * @TODO 处理多个元素的问题
2062
+ */
2063
+ static parse(code, context) {
2064
+ code = code || '<div></div>';
2065
+ const compilerOptions = {
2066
+ preserveWhitespace: false,
2067
+ outputSourceRange: true,
2068
+ };
2069
+ let ast = compiler.compile(code, compilerOptions).ast;
2070
+ if (ast.tag === 'template' && !ast.slotTarget)
2071
+ ast = ast.children[0];
2072
+ return this._fromASTNode(ast, {
2073
+ ...context,
2074
+ code,
2075
+ });
2076
+ }
2077
+ /**
2078
+ * 从模板生成规范的 ViewElement 对象
2079
+ */
2080
+ static fromHTML(html, context) {
2081
+ return this.parse(html, context);
2082
+ }
2083
+ /**
2084
+ * 转换成设计器中使用的 Vue 文件
2085
+ * @param options
2086
+ */
2087
+ toDesignerVue(options) {
2088
+ return this.toVue({
2089
+ isRoot: options?.isRoot,
2090
+ asCompontent: options?.asCompontent,
2091
+ finalCode: false,
2092
+ nodePathAttr: true,
2093
+ attrFormat: (attr, element, defaultResult) => {
2094
+ if (attr.concept === 'BindAttribute' &&
2095
+ !['href', 'destination', 'externalDestination', 'download'].includes(attr.name)) {
2096
+ const api = config_1.config?.allNodesAPI?.[element.tag];
2097
+ const apiOfAttr = api && api.props && api.props.find((_attr) => _attr.name === attr.name);
2098
+ if (['u-form-item', 'u-validator', 'van-field'].includes(element.tag) && attr.name === 'rules') {
2099
+ return `${attr.name}=""`;
2100
+ }
2101
+ if (apiOfAttr && apiOfAttr['designerValue'] !== undefined) {
2102
+ let designerValue = apiOfAttr['designerValue'];
2103
+ //对流程模板拖拽进行特判
2104
+ element.bindAttrs.forEach((property) => {
2105
+ if (property.name === 'repeat' && property.value === '1')
2106
+ designerValue = '[{}, {}]';
2107
+ });
2108
+ if (typeof designerValue === 'string') {
2109
+ designerValue = designerValue.replace(/"/g, "'");
2110
+ }
2111
+ try {
2112
+ if (Array.isArray(designerValue)) {
2113
+ return `:${attr.name}="${JSON.stringify(designerValue)}"`;
2114
+ }
2115
+ json5.parse(designerValue);
2116
+ return `:${attr.name}="${designerValue}"`;
2117
+ }
2118
+ catch (e) {
2119
+ return `${attr.name}="${designerValue}"`;
2120
+ }
2121
+ }
2122
+ if (attr.name === 'text' &&
2123
+ asserts.isMemberExpression(attr?.expression) &&
2124
+ attr?.expression?.object?.namespace?.startsWith('elements.') &&
2125
+ attr?.expression?.object?.namespace?.endsWith('.property')) {
2126
+ return `${attr.name}="{{ ${attr.expression.toUI()} }}"`;
2127
+ }
2128
+ if (attr.type === 'dynamic' &&
2129
+ !(element.tag === 'u-cascade-select' && attr.name === 'categories'))
2130
+ return defaultResult.replace(/:?([\w-]+)(?:.*?)="([\s\S]*)"/, (m, name, value) => {
2131
+ try {
2132
+ const tempValue = json5.parse(value);
2133
+ if (typeof tempValue === 'boolean' || typeof tempValue === 'number') {
2134
+ // 简单类型走属性
2135
+ return `:${name}="${value.replace(/"/g, "'")}"`;
2136
+ }
2137
+ }
2138
+ catch (e) {
2139
+ if (apiOfAttr && apiOfAttr.tsType && !apiOfAttr.tsType.includes('nasl.core.String'))
2140
+ return '';
2141
+ }
2142
+ value = value
2143
+ .replace(/"/g, "'")
2144
+ .replace(/\$utils\['(.+?)'\]/g, '$1')
2145
+ .replace(/\$refs./g, 'elements.')
2146
+ .replace(/\$global.userInfo/g, 'nasl.auth.userInfo')
2147
+ .replace(/\$global./g, 'nasl.')
2148
+ .replace(/\bscope\.item\.\b/g, '')
2149
+ .replace(/\bcurrent\.item\.\b/g, '');
2150
+ if (isLockField(element)) {
2151
+ return element.tag === 'u-text' ? `${name}="--"` : `${name}=""`;
2152
+ }
2153
+ return `${name}="{{ ${value} }}"`;
2154
+ });
2155
+ else
2156
+ return defaultResult;
2157
+ }
2158
+ return false;
2159
+ },
2160
+ bindStylesFormat: (bindStyles, element) => false,
2161
+ getExtraParts: (el) => {
2162
+ const parts = [];
2163
+ const api = config_1.config?.allNodesAPI?.[el?.tag];
2164
+ const emptySlot = api && api.slots && api.slots.find((slot) => slot.name === 'default' && slot['emptyBackground']);
2165
+ const hasSupport = api && api.slots && api.slots.some((slot) => slot.support);
2166
+ if (emptySlot || hasSupport) {
2167
+ // 有些限制的组件如侧边栏分组有title插槽但要限制子元素放入
2168
+ const validChildren = el.children.filter((elem) => !(elem.tag === 'template' && elem.slotTarget !== 'default'));
2169
+ let childEmpty = !validChildren.length;
2170
+ const defaultSlot = el.children.find((elem) => elem.tag === 'template' && elem.slotTarget === 'default');
2171
+ if (defaultSlot) {
2172
+ childEmpty = !defaultSlot.children.length;
2173
+ }
2174
+ if (childEmpty) {
2175
+ let addEmpty = true;
2176
+ if (['u-grid-view', 'u-list-view', 'van-list-view', 'van-grid-view', 'u-carousel'].includes(el.tag)) {
2177
+ const hasDataSource = el.bindAttrs.find((attr) => attr.name === 'dataSource');
2178
+ addEmpty = !hasDataSource;
2179
+ }
2180
+ if (el.tag === 'u-crumb') {
2181
+ const attrList = el.bindAttrs;
2182
+ const hasAuto = attrList.some((attr) => attr.name === 'auto' && String(attr.value) === 'true');
2183
+ if (hasAuto)
2184
+ addEmpty = false;
2185
+ }
2186
+ if ([
2187
+ 'u-select',
2188
+ 'u-dropdown',
2189
+ 'u-panel',
2190
+ 'u-toc',
2191
+ 'u-toc-item',
2192
+ 'u-tree-view-new',
2193
+ 'u-tree-view-node-new',
2194
+ 'u-tree-select',
2195
+ 'u-tree-select-new',
2196
+ 'u-anchor',
2197
+ 'u-drawer',
2198
+ 'u-timeline',
2199
+ 'u-tabs',
2200
+ ].includes(el.tag)) {
2201
+ addEmpty = false;
2202
+ }
2203
+ const background = (emptySlot && emptySlot['emptyBackground']) || (hasSupport ? 'add-sub' : '');
2204
+ addEmpty && parts.push(`vusion-empty-background="${background}"`);
2205
+ }
2206
+ }
2207
+ if (['u-router-view', 'van-router-view'].includes(el.tag)) {
2208
+ const excludes = ['background-color:', 'background:', 'background-image:'];
2209
+ if (excludes.some((key) => el.staticStyle && el.staticStyle.includes(key))) {
2210
+ parts.push(':designer="false"');
2211
+ }
2212
+ }
2213
+ return parts;
2214
+ },
2215
+ isDev: true,
2216
+ });
2217
+ }
2218
+ isLikeComponent(node) {
2219
+ return ['View', 'BusinessComponent'].includes(node?.concept);
2220
+ }
2221
+ // 获取currentList
2222
+ getCurrentList() {
2223
+ const argsList = [];
2224
+ let parent = this.parentNode;
2225
+ let index = 0;
2226
+ while (parent && !this.isLikeComponent(parent)) {
2227
+ if (parent.slotScope) {
2228
+ argsList.push(index === 0 ? 'current' : 'current' + index);
2229
+ index++;
2230
+ }
2231
+ parent = parent.parentNode;
2232
+ }
2233
+ return argsList;
2234
+ }
2235
+ get refName() {
2236
+ let refName = this.name;
2237
+ const list = this.getCurrentList();
2238
+ if (Array.isArray(list) && list.length) {
2239
+ list.forEach((item) => {
2240
+ refName += `_\${(${item} || {}).__nodeKey || (${item} || {}).index}`;
2241
+ });
2242
+ }
2243
+ return refName;
2244
+ }
2245
+ get keyName() {
2246
+ // 是否配置了v-if
2247
+ const isDefineIf = this.bindDirectives.some((directive) => directive.name === 'if' && directive.expression);
2248
+ if (isDefineIf) {
2249
+ let key = this.name;
2250
+ const list = this.getCurrentList();
2251
+ // v-for中需要加上nodeKey
2252
+ if (Array.isArray(list) && list.length) {
2253
+ list.forEach((item) => {
2254
+ key += `_\${(${item} || {}).__nodeKey || (${item} || {}).index}`;
2255
+ });
2256
+ }
2257
+ return key;
2258
+ }
2259
+ return null;
2260
+ }
2261
+ get businessComponent() {
2262
+ return this.getAncestor('BusinessComponent');
2263
+ }
2264
+ /**
2265
+ * 转换成 Vue 的模板格式
2266
+ */
2267
+ toVue(options) {
2268
+ // lockField 不翻译modal
2269
+ if (options?.isDev && this?.tag === 'u-modal' && isLockField(this)) {
2270
+ return ``;
2271
+ }
2272
+ const { finalCode, asCompontent } = options || {};
2273
+ const parts = [];
2274
+ if (finalCode === false) {
2275
+ if (this.tag === 'slot') {
2276
+ if (asCompontent) {
2277
+ return `<div vusion-slot-name="${this.name}">
2278
+ <slot name="${this.name}">
2279
+ <div s-empty="true" bs-empty="true" style="background: #f7f8fa;
2280
+ border: 1px dashed #c3c3c3;
2281
+ text-align: center;
2282
+ color: #999;
2283
+ min-height: 32px;
2284
+ min-width: 32px;
2285
+ width: 100%;
2286
+ align-items: center;
2287
+ display: inline-flex;
2288
+ justify-content: center;">
2289
+ +
2290
+ </div>
2291
+ </slot>
2292
+ </div>`;
2293
+ }
2294
+ else {
2295
+ return `<div vusion-node-path="${this.nodePath}"
2296
+ style="background: linear-gradient(-45deg,#fff 25%,#f3f5fa 0,#f3f5fa 50%,#fff 0,#fff 75%,#f3f5fa 0);
2297
+ background-size: 45px 45px;
2298
+ background-repeat: repeat;
2299
+ line-height: 32px;
2300
+ min-height: 32px;
2301
+ color: var(--font-second-color);
2302
+ text-align: center;">
2303
+ 组件占位,可在使用业务组件时插入任意组件
2304
+ </div>`;
2305
+ }
2306
+ }
2307
+ else if (this.businessComponent?.name === this.tag) {
2308
+ // 组件内部使用自身的情况
2309
+ return `<div vusion-node-path="${this.nodePath}"
2310
+ style="background: linear-gradient(-45deg,#fff 25%,#f3f5fa 0,#f3f5fa 50%,#fff 0,#fff 75%,#f3f5fa 0);
2311
+ background-size: 45px 45px;
2312
+ background-repeat: repeat;
2313
+ line-height: 32px;
2314
+ min-height: 32px;
2315
+ color: var(--font-second-color);
2316
+ text-align: center;">
2317
+ 在组件内部使用自身可能会导致循环引用,请谨慎使用
2318
+ </div>`;
2319
+ }
2320
+ const isRoot = options.isRoot;
2321
+ if (isRoot && !options?.asCompontent) {
2322
+ parts.push('type="root"');
2323
+ if (this.frontendType?.kind === 'h5') {
2324
+ parts.push('class="l-root-h5"');
2325
+ }
2326
+ else {
2327
+ parts.push('style="height:100%; --custom-start: auto; min-height: 200px;"');
2328
+ }
2329
+ }
2330
+ }
2331
+ if (options) {
2332
+ options.isRoot = false;
2333
+ }
2334
+ let currentList = [];
2335
+ if (Array.isArray(options?.currentList)) {
2336
+ currentList = [...options?.currentList];
2337
+ }
2338
+ if (this.slotScope) {
2339
+ currentList.unshift(this.slotScope);
2340
+ }
2341
+ const newOptions = Object.assign({
2342
+ indentStyle: 'space',
2343
+ tabSize: 4,
2344
+ indentLevel: 0,
2345
+ aslIdAttr: false,
2346
+ nodePathAttr: false,
2347
+ getExtraParts: () => [],
2348
+ attrFormat: (attr, element, defaultResult) => defaultResult,
2349
+ bindStylesFormat: (bindStyles, element) => {
2350
+ if (bindStyles.length === 0)
2351
+ return false;
2352
+ return `:style="{${bindStyles
2353
+ .map((item) => item.toVue())
2354
+ .filter((item) => item !== undefined)
2355
+ .join(', ')}}"`;
2356
+ },
2357
+ }, options, {
2358
+ currentList,
2359
+ });
2360
+ const tabString = ' '.repeat(newOptions.tabSize * newOptions.indentLevel);
2361
+ const insideTabString = ' '.repeat(newOptions.tabSize * (newOptions.indentLevel + 1));
2362
+ let shouldIndent = true;
2363
+ const content = !this.children
2364
+ ? ''
2365
+ : this.children
2366
+ .map((element) => {
2367
+ const childOptions = Object.assign({}, newOptions);
2368
+ childOptions.indentLevel++;
2369
+ return (shouldIndent ? '\n' + insideTabString : '') + element?.toVue(childOptions);
2370
+ })
2371
+ .join('');
2372
+ if (!content.length) {
2373
+ shouldIndent = false;
2374
+ }
2375
+ if (newOptions.aslIdAttr) {
2376
+ if (newOptions.aslIdAttr === true) {
2377
+ newOptions.aslIdAttr = 'asl-id';
2378
+ }
2379
+ parts.push(`${newOptions.aslIdAttr}="${this.id}"`);
2380
+ }
2381
+ if (newOptions.nodePathAttr) {
2382
+ // 注入 asl 的 node-path
2383
+ parts.push(`vusion-node-path="${this.nodePath}"`);
2384
+ }
2385
+ // 模板里解析时候,可能会有多级嵌套的 current,所以当前有多少的长度,当前就是多大的下标
2386
+ this.slotTarget &&
2387
+ parts.push(`#${this.slotTarget}` +
2388
+ (this.slotScope
2389
+ ? `="${currentList.length > 1 ? this.slotScope + (currentList.length - 1) : this.slotScope}"`
2390
+ : ''));
2391
+ this.refName && parts.push(`:ref="\`${this.refName}\`"`);
2392
+ this.keyName && parts.push(`:key="\`${this.keyName}\`"`);
2393
+ this.staticClass && parts.push(`class="${this.staticClass}"`);
2394
+ this.staticStyle && parts.push(`style="${this.staticStyle}"`);
2395
+ const vIfs = [];
2396
+ []
2397
+ .concat(this.bindAttrs, this.bindDirectives, this.bindEvents)
2398
+ .forEach((attr) => {
2399
+ const result = newOptions.attrFormat(attr, this, attr?.toVue(newOptions));
2400
+ // v-auth v-if 都翻译成 v-if
2401
+ if (asserts.isBindDirective(attr) && ['if', 'auth'].includes(attr.name) && result !== false) {
2402
+ const expr = result.replace(/v-(if|auth)="(.*)"/, (match, p1, p2) => p2);
2403
+ if (expr)
2404
+ vIfs.push(attr.name === 'if' ? expr : `$auth.has(${expr})`);
2405
+ return;
2406
+ }
2407
+ result && parts.push(result);
2408
+ });
2409
+ if (vIfs.length === 2)
2410
+ parts.push(`v-if="(${vIfs[0]}) && (${vIfs[1]})"`);
2411
+ else if (vIfs.length === 1)
2412
+ parts.push(`v-if="${vIfs[0]}"`);
2413
+ const bindStyles = newOptions.bindStylesFormat(this.bindStyles, this);
2414
+ if (bindStyles)
2415
+ parts.push(bindStyles);
2416
+ newOptions.getExtraParts(this).forEach((part) => parts.push(part));
2417
+ if (['u-modal', 'u-drawer'].includes(this.tag)) {
2418
+ this.children.forEach((citem) => {
2419
+ if (citem.tag === 'template' && !citem.children.length) {
2420
+ parts.push(`:is-${citem.slotTarget}-slot-empty=true`);
2421
+ }
2422
+ });
2423
+ }
2424
+ // 部分组件增加 key 唯一标识,防止 vue 判断重复节点,导致渲染异常
2425
+ if (this.name &&
2426
+ ['u-table-view', 'u-list-view', 'u-grid-view', 'u-list-components', 'u-form', 'u-select'].includes(this.tag)) {
2427
+ this.name && parts.push(`key="${this.name}"`);
2428
+ }
2429
+ if (this.tag === 'slot') {
2430
+ this.name && parts.push(`name="${this.name}"`);
2431
+ }
2432
+ let partsLength = 0;
2433
+ let partsString = '';
2434
+ parts.forEach((part) => {
2435
+ if (partsLength >= 120 || part.length >= 120) {
2436
+ partsString += '\n' + tabString + ' '.repeat(3); // ' '.repeat(el.tag.length + 1);
2437
+ partsLength = 0;
2438
+ }
2439
+ partsString += ' ' + part;
2440
+ partsLength += part.length;
2441
+ });
2442
+ let htmlContent = `<${this.tag}${partsString.length ? partsString : ''}>` +
2443
+ content +
2444
+ (shouldIndent ? '\n' + tabString : '') +
2445
+ `</${this.tag}>`;
2446
+ if (!content.trim() && selfClosingTag.includes(this.tag)) {
2447
+ htmlContent = `<${this.tag}${partsString.length ? partsString : ''} />`;
2448
+ }
2449
+ return htmlContent;
2450
+ }
2451
+ /**
2452
+ * 从父级删除该节点
2453
+ * @internal
2454
+ */
2455
+ delete() {
2456
+ super.delete();
2457
+ if (this.parentNode) {
2458
+ this.traverseChildren((ele) => {
2459
+ this.likeComponent?.removeExistingViewElement(ele);
2460
+ });
2461
+ }
2462
+ }
2463
+ findElementByName(name) {
2464
+ return utils.traverse((current) => {
2465
+ if (current.node.name === name)
2466
+ return current.node;
2467
+ }, { node: this });
2468
+ }
2469
+ findElementByTag(tag) {
2470
+ return utils.traverse((current) => {
2471
+ if (current.node.tag === tag)
2472
+ return current.node;
2473
+ }, { node: this });
2474
+ }
2475
+ findElementByAttr(name, value) {
2476
+ return utils.traverse((current) => {
2477
+ if (current.node.bindAttrs.some((attr) => attr.name === name && attr.value === value))
2478
+ return current.node;
2479
+ }, { node: this });
2480
+ }
2481
+ getCurrentName() {
2482
+ let current = 'current';
2483
+ let parent = this.parentNode;
2484
+ let index = 0;
2485
+ while (parent && !this.isLikeComponent(parent)) {
2486
+ if (parent.slotScope) {
2487
+ index++;
2488
+ }
2489
+ parent = parent.parentNode;
2490
+ }
2491
+ current = index === 0 ? 'current' : 'current' + index;
2492
+ return current;
2493
+ }
2494
+ /**
2495
+ * 计算约束样式
2496
+ * @param positionData 位置数据
2497
+ * @param ops 配置项
2498
+ * @param ops.beforeSetStyleCb 设置样式前的回调
2499
+ * @param ops.setStaticSize 是否设置静态尺寸,开启此项会将节点的宽高设置为像素值,通常在修改约束规则时候开启
2500
+ */
2501
+ computeConstraintStyle(positionData, ops = {}) {
2502
+ if (!positionData) {
2503
+ return;
2504
+ }
2505
+ const { nodeRect, parentRect, parentBorder } = positionData;
2506
+ const staticWidth = nodeRect.width;
2507
+ const staticHeight = nodeRect.height;
2508
+ const staticLeft = nodeRect.left - parentRect.left - parentBorder.left;
2509
+ const staticTop = nodeRect.top - parentRect.top - parentBorder.top;
2510
+ const staticRight = parentRect.width - nodeRect.width - staticLeft - parentBorder.right - parentBorder.left;
2511
+ const staticBottom = parentRect.height - nodeRect.height - staticTop - parentBorder.bottom - parentBorder.top;
2512
+ const styleObj = this.parseStyleToObject(this.staticStyle);
2513
+ const constraintX = styleObj['--constraint-x'] || 'left';
2514
+ const constraintY = styleObj['--constraint-y'] || 'top';
2515
+ const rawWidth = styleObj.width || '';
2516
+ const rawHeight = styleObj.height || '';
2517
+ let left = '';
2518
+ let right = '';
2519
+ let top = '';
2520
+ let bottom = '';
2521
+ let transform = '';
2522
+ let width = ops.setStaticSize ? `${staticWidth}px` : rawWidth;
2523
+ let height = ops.setStaticSize ? `${staticHeight}px` : rawHeight;
2524
+ const parentWidth = staticLeft + staticWidth + staticRight;
2525
+ const parentHeight = staticTop + staticHeight + staticBottom;
2526
+ if (constraintX === 'left') {
2527
+ left = staticLeft + 'px';
2528
+ right = '';
2529
+ }
2530
+ else if (constraintX === 'right') {
2531
+ left = '';
2532
+ right = staticRight + 'px';
2533
+ }
2534
+ else if (constraintX === 'center') {
2535
+ const offset = staticLeft + staticWidth / 2 - parentWidth / 2;
2536
+ left = `calc(50% ${offset > 0 ? '+' : '-'} ${Math.abs(offset)}px)`;
2537
+ right = '';
2538
+ transform = 'translateX(-50%)';
2539
+ }
2540
+ else if (constraintX === 'scale') {
2541
+ left = (staticLeft * 100) / parentWidth + '%';
2542
+ right = '';
2543
+ width = (staticWidth * 100) / parentWidth + '%';
2544
+ }
2545
+ else if (constraintX === 'left-right') {
2546
+ left = staticLeft + 'px';
2547
+ right = staticRight + 'px';
2548
+ width = 'auto';
2549
+ }
2550
+ if (constraintY === 'top') {
2551
+ top = staticTop + 'px';
2552
+ bottom = '';
2553
+ }
2554
+ else if (constraintY === 'bottom') {
2555
+ top = '';
2556
+ bottom = staticBottom + 'px';
2557
+ }
2558
+ else if (constraintY === 'center') {
2559
+ const offset = staticTop + staticHeight / 2 - parentHeight / 2;
2560
+ top = `calc(50% ${offset > 0 ? '+' : '-'} ${Math.abs(offset)}px)`;
2561
+ bottom = '';
2562
+ transform = transform ? 'translate(-50%, -50%)' : 'translateY(-50%)';
2563
+ }
2564
+ else if (constraintY === 'scale') {
2565
+ top = (staticTop * 100) / parentHeight + '%';
2566
+ bottom = '';
2567
+ height = (staticHeight * 100) / parentHeight + '%';
2568
+ }
2569
+ else if (constraintY === 'top-bottom') {
2570
+ top = staticTop + 'px';
2571
+ bottom = staticBottom + 'px';
2572
+ height = 'auto';
2573
+ }
2574
+ const newStyleObj = {
2575
+ ...styleObj,
2576
+ left,
2577
+ right,
2578
+ top,
2579
+ bottom,
2580
+ transform,
2581
+ width,
2582
+ height,
2583
+ };
2584
+ ops.beforeSetStyleCb?.(newStyleObj);
2585
+ const newStaticStyle = this.stringifyStyleAttr(newStyleObj);
2586
+ this.setStaticStyle(newStaticStyle);
2587
+ }
2588
+ updateStyleObj(styleObj) {
2589
+ this.setStaticStyle(this.stringifyStyleAttr({
2590
+ ...this.parseStyleToObject(this.staticStyle),
2591
+ ...styleObj,
2592
+ }));
2593
+ }
2594
+ parseStyleToObject(styleStr = '') {
2595
+ const [styleStr1, styleStr2] = styleStr.split('--custom-start: auto;');
2596
+ const styleObj = styleStr1.split(/;/gim).reduce((obj, item) => {
2597
+ // background-image:url(http://www...)
2598
+ item = item.trim();
2599
+ const pos = item.indexOf(':');
2600
+ if (pos >= 0) {
2601
+ const key = item.slice(0, pos).trim();
2602
+ const value = item.slice(pos + 1).trim();
2603
+ obj[key] = value;
2604
+ }
2605
+ return obj;
2606
+ }, {});
2607
+ styleObj['customStyle'] = styleStr2;
2608
+ return styleObj;
2609
+ }
2610
+ stringifyStyleAttr(styleObj) {
2611
+ const customStyle = styleObj['customStyle'] || '';
2612
+ delete styleObj['customStyle'];
2613
+ const styleStr = Object.keys(styleObj)
2614
+ // 空字符串是允许的,因为有时候想要覆盖之前的样式。undefined 则不允许
2615
+ .filter((key) => styleObj[key] !== undefined)
2616
+ .map((key) => `${key}:${String(styleObj[key]).trim()};`)
2617
+ .join('');
2618
+ return styleStr + '--custom-start: auto;' + customStyle;
2619
+ }
2620
+ // 批量更新绑定属性
2621
+ batchUpdateBindAttrs(attrOptions) {
2622
+ const BindAttribute = (0, decorators_1.getConceptConstructor)('BindAttribute');
2623
+ const oldBindAttrs = this.bindAttrs.filter((it) => !attrOptions.some((item) => item.name === it.name));
2624
+ const newBindAttrs = attrOptions.map((it) => BindAttribute.from(it, this, 'bindAttrs'));
2625
+ this.update({
2626
+ bindAttrs: [...oldBindAttrs, ...newBindAttrs],
2627
+ });
2628
+ }
2629
+ };
2630
+ /** 类名 */
2631
+ ViewElement.ConceptName = 'ViewElement';
2632
+ /** 继承链 */
2633
+ ViewElement.inheritanceChain = ['BaseNode'];
2634
+ ViewElement.TAG_NAME_PREFIX_REG = /^([lieu]|van)[-_]/;
2635
+ __decorate([
2636
+ (0, decorators_1.property)('concept')
2637
+ ], ViewElement.prototype, "concept", void 0);
2638
+ __decorate([
2639
+ (0, decorators_1.property)()
2640
+ ], ViewElement.prototype, "type", void 0);
2641
+ __decorate([
2642
+ (0, decorators_1.property)()
2643
+ ], ViewElement.prototype, "tag", void 0);
2644
+ __decorate([
2645
+ (0, decorators_1.property)()
2646
+ ], ViewElement.prototype, "name", void 0);
2647
+ __decorate([
2648
+ (0, decorators_1.property)()
2649
+ ], ViewElement.prototype, "staticClass", void 0);
2650
+ __decorate([
2651
+ (0, decorators_1.property)()
2652
+ ], ViewElement.prototype, "staticStyle", void 0);
2653
+ __decorate([
2654
+ (0, decorators_1.property)()
2655
+ ], ViewElement.prototype, "authDescription", void 0);
2656
+ __decorate([
2657
+ (0, decorators_1.property)()
2658
+ ], ViewElement.prototype, "slotTarget", void 0);
2659
+ __decorate([
2660
+ (0, decorators_1.property)()
2661
+ ], ViewElement.prototype, "slotScope", void 0);
2662
+ __decorate([
2663
+ (0, decorators_1.property)({
2664
+ objectRef: 'BindAttribute',
2665
+ isArray: true,
2666
+ defaultValue: [],
2667
+ })
2668
+ ], ViewElement.prototype, "bindAttrs", void 0);
2669
+ __decorate([
2670
+ (0, decorators_1.property)({
2671
+ objectRef: 'BindEvent',
2672
+ isArray: true,
2673
+ defaultValue: [],
2674
+ })
2675
+ ], ViewElement.prototype, "bindEvents", void 0);
2676
+ __decorate([
2677
+ (0, decorators_1.property)({
2678
+ objectRef: 'BindDirective',
2679
+ isArray: true,
2680
+ defaultValue: [],
2681
+ })
2682
+ ], ViewElement.prototype, "bindDirectives", void 0);
2683
+ __decorate([
2684
+ (0, decorators_1.property)({
2685
+ isArray: true,
2686
+ defaultValue: [],
2687
+ })
2688
+ ], ViewElement.prototype, "bindRoles", void 0);
2689
+ __decorate([
2690
+ (0, decorators_1.property)({
2691
+ objectRef: 'BindStyle',
2692
+ isArray: true,
2693
+ defaultValue: [],
2694
+ })
2695
+ ], ViewElement.prototype, "bindStyles", void 0);
2696
+ __decorate([
2697
+ (0, decorators_1.property)({
2698
+ objectRef: 'ViewElement',
2699
+ isArray: true,
2700
+ defaultValue: [],
2701
+ })
2702
+ ], ViewElement.prototype, "children", void 0);
2703
+ __decorate([
2704
+ translator_1.withGenerator
2705
+ ], ViewElement.prototype, "toEmbeddedTSDefinition", null);
2706
+ __decorate([
2707
+ translator_1.withGenerator
2708
+ ], ViewElement.prototype, "toEmbeddedTSRefTree", null);
2709
+ __decorate([
2710
+ translator_1.withSourceMapGenerator
2711
+ ], ViewElement.prototype, "toEmbeddedTS", null);
2712
+ __decorate([
2713
+ (0, translator_1.withSourceMap)()
2714
+ ], ViewElement.prototype, "toNaturalTS", null);
2715
+ __decorate([
2716
+ (0, decorators_1.excludedInJSON)()
2717
+ ], ViewElement.prototype, "computedStyle", void 0);
2718
+ ViewElement = ViewElement_1 = __decorate([
2719
+ (0, decorators_1.concept)('页面元素')
2720
+ ], ViewElement);
2721
+ exports.ViewElement = ViewElement;
2722
+ exports.default = ViewElement;
2723
+ //================================================================================
2724
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
2725
+ // 自动生成的代码已结束。下面可以手动编写。
2726
+ //================================================================================
2727
+ //# sourceMappingURL=ViewElement__.js.map