@lcap/nasl-concepts 3.9.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (986) hide show
  1. package/README.md +3 -0
  2. package/out/breakpoint/index.d.ts +2 -0
  3. package/out/breakpoint/index.d.ts.map +1 -0
  4. package/out/breakpoint/index.js +18 -0
  5. package/out/breakpoint/index.js.map +1 -0
  6. package/out/breakpoint/operation.d.ts +11 -0
  7. package/out/breakpoint/operation.d.ts.map +1 -0
  8. package/out/breakpoint/operation.js +24 -0
  9. package/out/breakpoint/operation.js.map +1 -0
  10. package/out/common/BaseNode.d.ts +427 -0
  11. package/out/common/BaseNode.d.ts.map +1 -0
  12. package/out/common/BaseNode.js +1721 -0
  13. package/out/common/BaseNode.js.map +1 -0
  14. package/out/common/EventEmitter.d.ts +30 -0
  15. package/out/common/EventEmitter.d.ts.map +1 -0
  16. package/out/common/EventEmitter.js +70 -0
  17. package/out/common/EventEmitter.js.map +1 -0
  18. package/out/common/index.d.ts +3 -0
  19. package/out/common/index.d.ts.map +1 -0
  20. package/out/common/index.js +19 -0
  21. package/out/common/index.js.map +1 -0
  22. package/out/common/types.d.ts +5 -0
  23. package/out/common/types.d.ts.map +1 -0
  24. package/out/common/types.js +3 -0
  25. package/out/common/types.js.map +1 -0
  26. package/out/concepts/Abort__.d.ts +32 -0
  27. package/out/concepts/Abort__.d.ts.map +1 -0
  28. package/out/concepts/Abort__.js +94 -0
  29. package/out/concepts/Abort__.js.map +1 -0
  30. package/out/concepts/AbstractInterface__.d.ts +29 -0
  31. package/out/concepts/AbstractInterface__.d.ts.map +1 -0
  32. package/out/concepts/AbstractInterface__.js +62 -0
  33. package/out/concepts/AbstractInterface__.js.map +1 -0
  34. package/out/concepts/Anchor__.d.ts +44 -0
  35. package/out/concepts/Anchor__.d.ts.map +1 -0
  36. package/out/concepts/Anchor__.js +179 -0
  37. package/out/concepts/Anchor__.js.map +1 -0
  38. package/out/concepts/Annotatable__.d.ts +111 -0
  39. package/out/concepts/Annotatable__.d.ts.map +1 -0
  40. package/out/concepts/Annotatable__.js +163 -0
  41. package/out/concepts/Annotatable__.js.map +1 -0
  42. package/out/concepts/AnnotationProperty__.d.ts +49 -0
  43. package/out/concepts/AnnotationProperty__.d.ts.map +1 -0
  44. package/out/concepts/AnnotationProperty__.js +76 -0
  45. package/out/concepts/AnnotationProperty__.js.map +1 -0
  46. package/out/concepts/Annotation__.d.ts +129 -0
  47. package/out/concepts/Annotation__.d.ts.map +1 -0
  48. package/out/concepts/Annotation__.js +249 -0
  49. package/out/concepts/Annotation__.js.map +1 -0
  50. package/out/concepts/AnonymousFunction__.d.ts +141 -0
  51. package/out/concepts/AnonymousFunction__.d.ts.map +1 -0
  52. package/out/concepts/AnonymousFunction__.js +428 -0
  53. package/out/concepts/AnonymousFunction__.js.map +1 -0
  54. package/out/concepts/App__.d.ts +1794 -0
  55. package/out/concepts/App__.d.ts.map +1 -0
  56. package/out/concepts/App__.js +3475 -0
  57. package/out/concepts/App__.js.map +1 -0
  58. package/out/concepts/ApplyAnnotation__.d.ts +88 -0
  59. package/out/concepts/ApplyAnnotation__.d.ts.map +1 -0
  60. package/out/concepts/ApplyAnnotation__.js +142 -0
  61. package/out/concepts/ApplyAnnotation__.js.map +1 -0
  62. package/out/concepts/ApprovalPolicyV2__.d.ts +27 -0
  63. package/out/concepts/ApprovalPolicyV2__.d.ts.map +1 -0
  64. package/out/concepts/ApprovalPolicyV2__.js +55 -0
  65. package/out/concepts/ApprovalPolicyV2__.js.map +1 -0
  66. package/out/concepts/Argument__.d.ts +85 -0
  67. package/out/concepts/Argument__.d.ts.map +1 -0
  68. package/out/concepts/Argument__.js +390 -0
  69. package/out/concepts/Argument__.js.map +1 -0
  70. package/out/concepts/AssigneeV2__.d.ts +380 -0
  71. package/out/concepts/AssigneeV2__.d.ts.map +1 -0
  72. package/out/concepts/AssigneeV2__.js +517 -0
  73. package/out/concepts/AssigneeV2__.js.map +1 -0
  74. package/out/concepts/Assignee__.d.ts +296 -0
  75. package/out/concepts/Assignee__.d.ts.map +1 -0
  76. package/out/concepts/Assignee__.js +404 -0
  77. package/out/concepts/Assignee__.js.map +1 -0
  78. package/out/concepts/AssignmentLine__.d.ts +44 -0
  79. package/out/concepts/AssignmentLine__.d.ts.map +1 -0
  80. package/out/concepts/AssignmentLine__.js +110 -0
  81. package/out/concepts/AssignmentLine__.js.map +1 -0
  82. package/out/concepts/Assignment__.d.ts +59 -0
  83. package/out/concepts/Assignment__.d.ts.map +1 -0
  84. package/out/concepts/Assignment__.js +288 -0
  85. package/out/concepts/Assignment__.js.map +1 -0
  86. package/out/concepts/Attribute__.d.ts +77 -0
  87. package/out/concepts/Attribute__.d.ts.map +1 -0
  88. package/out/concepts/Attribute__.js +103 -0
  89. package/out/concepts/Attribute__.js.map +1 -0
  90. package/out/concepts/AuthInterface__.d.ts +39 -0
  91. package/out/concepts/AuthInterface__.d.ts.map +1 -0
  92. package/out/concepts/AuthInterface__.js +79 -0
  93. package/out/concepts/AuthInterface__.js.map +1 -0
  94. package/out/concepts/AuthLogicForCallInterface__.d.ts +148 -0
  95. package/out/concepts/AuthLogicForCallInterface__.d.ts.map +1 -0
  96. package/out/concepts/AuthLogicForCallInterface__.js +597 -0
  97. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
  98. package/out/concepts/AuthLogic__.d.ts +70 -0
  99. package/out/concepts/AuthLogic__.d.ts.map +1 -0
  100. package/out/concepts/AuthLogic__.js +211 -0
  101. package/out/concepts/AuthLogic__.js.map +1 -0
  102. package/out/concepts/BackendVariable__.d.ts +120 -0
  103. package/out/concepts/BackendVariable__.d.ts.map +1 -0
  104. package/out/concepts/BackendVariable__.js +432 -0
  105. package/out/concepts/BackendVariable__.js.map +1 -0
  106. package/out/concepts/Backend__.d.ts +128 -0
  107. package/out/concepts/Backend__.d.ts.map +1 -0
  108. package/out/concepts/Backend__.js +238 -0
  109. package/out/concepts/Backend__.js.map +1 -0
  110. package/out/concepts/BaseSetter__.d.ts +27 -0
  111. package/out/concepts/BaseSetter__.d.ts.map +1 -0
  112. package/out/concepts/BaseSetter__.js +55 -0
  113. package/out/concepts/BaseSetter__.js.map +1 -0
  114. package/out/concepts/BatchAssignment__.d.ts +246 -0
  115. package/out/concepts/BatchAssignment__.d.ts.map +1 -0
  116. package/out/concepts/BatchAssignment__.js +831 -0
  117. package/out/concepts/BatchAssignment__.js.map +1 -0
  118. package/out/concepts/BinaryExpression__.d.ts +64 -0
  119. package/out/concepts/BinaryExpression__.d.ts.map +1 -0
  120. package/out/concepts/BinaryExpression__.js +508 -0
  121. package/out/concepts/BinaryExpression__.js.map +1 -0
  122. package/out/concepts/BindAttribute__.d.ts +294 -0
  123. package/out/concepts/BindAttribute__.d.ts.map +1 -0
  124. package/out/concepts/BindAttribute__.js +1023 -0
  125. package/out/concepts/BindAttribute__.js.map +1 -0
  126. package/out/concepts/BindDirective__.d.ts +157 -0
  127. package/out/concepts/BindDirective__.d.ts.map +1 -0
  128. package/out/concepts/BindDirective__.js +492 -0
  129. package/out/concepts/BindDirective__.js.map +1 -0
  130. package/out/concepts/BindEvent__.d.ts +247 -0
  131. package/out/concepts/BindEvent__.d.ts.map +1 -0
  132. package/out/concepts/BindEvent__.js +833 -0
  133. package/out/concepts/BindEvent__.js.map +1 -0
  134. package/out/concepts/BindStyle__.d.ts +128 -0
  135. package/out/concepts/BindStyle__.d.ts.map +1 -0
  136. package/out/concepts/BindStyle__.js +412 -0
  137. package/out/concepts/BindStyle__.js.map +1 -0
  138. package/out/concepts/Block__.d.ts +90 -0
  139. package/out/concepts/Block__.d.ts.map +1 -0
  140. package/out/concepts/Block__.js +204 -0
  141. package/out/concepts/Block__.js.map +1 -0
  142. package/out/concepts/BooleanLiteral__.d.ts +46 -0
  143. package/out/concepts/BooleanLiteral__.d.ts.map +1 -0
  144. package/out/concepts/BooleanLiteral__.js +119 -0
  145. package/out/concepts/BooleanLiteral__.js.map +1 -0
  146. package/out/concepts/BusinessComponent__.d.ts +648 -0
  147. package/out/concepts/BusinessComponent__.d.ts.map +1 -0
  148. package/out/concepts/BusinessComponent__.js +1785 -0
  149. package/out/concepts/BusinessComponent__.js.map +1 -0
  150. package/out/concepts/BusinessLogic__.d.ts +46 -0
  151. package/out/concepts/BusinessLogic__.d.ts.map +1 -0
  152. package/out/concepts/BusinessLogic__.js +485 -0
  153. package/out/concepts/BusinessLogic__.js.map +1 -0
  154. package/out/concepts/CallAuthInterface__.d.ts +134 -0
  155. package/out/concepts/CallAuthInterface__.d.ts.map +1 -0
  156. package/out/concepts/CallAuthInterface__.js +426 -0
  157. package/out/concepts/CallAuthInterface__.js.map +1 -0
  158. package/out/concepts/CallConnector__.d.ts +56 -0
  159. package/out/concepts/CallConnector__.d.ts.map +1 -0
  160. package/out/concepts/CallConnector__.js +296 -0
  161. package/out/concepts/CallConnector__.js.map +1 -0
  162. package/out/concepts/CallEvent__.d.ts +103 -0
  163. package/out/concepts/CallEvent__.d.ts.map +1 -0
  164. package/out/concepts/CallEvent__.js +326 -0
  165. package/out/concepts/CallEvent__.js.map +1 -0
  166. package/out/concepts/CallFunction__.d.ts +173 -0
  167. package/out/concepts/CallFunction__.d.ts.map +1 -0
  168. package/out/concepts/CallFunction__.js +679 -0
  169. package/out/concepts/CallFunction__.js.map +1 -0
  170. package/out/concepts/CallInterface__.d.ts +145 -0
  171. package/out/concepts/CallInterface__.d.ts.map +1 -0
  172. package/out/concepts/CallInterface__.js +882 -0
  173. package/out/concepts/CallInterface__.js.map +1 -0
  174. package/out/concepts/CallLogic__.d.ts +247 -0
  175. package/out/concepts/CallLogic__.d.ts.map +1 -0
  176. package/out/concepts/CallLogic__.js +1583 -0
  177. package/out/concepts/CallLogic__.js.map +1 -0
  178. package/out/concepts/CallQueryComponent__.d.ts +380 -0
  179. package/out/concepts/CallQueryComponent__.d.ts.map +1 -0
  180. package/out/concepts/CallQueryComponent__.js +1227 -0
  181. package/out/concepts/CallQueryComponent__.js.map +1 -0
  182. package/out/concepts/CapsulesSetter__.d.ts +114 -0
  183. package/out/concepts/CapsulesSetter__.d.ts.map +1 -0
  184. package/out/concepts/CapsulesSetter__.js +172 -0
  185. package/out/concepts/CapsulesSetter__.js.map +1 -0
  186. package/out/concepts/Comment__.d.ts +42 -0
  187. package/out/concepts/Comment__.d.ts.map +1 -0
  188. package/out/concepts/Comment__.js +107 -0
  189. package/out/concepts/Comment__.js.map +1 -0
  190. package/out/concepts/CompletionProperty__.d.ts +88 -0
  191. package/out/concepts/CompletionProperty__.d.ts.map +1 -0
  192. package/out/concepts/CompletionProperty__.js +175 -0
  193. package/out/concepts/CompletionProperty__.js.map +1 -0
  194. package/out/concepts/ConfigGroup__.d.ts +122 -0
  195. package/out/concepts/ConfigGroup__.d.ts.map +1 -0
  196. package/out/concepts/ConfigGroup__.js +228 -0
  197. package/out/concepts/ConfigGroup__.js.map +1 -0
  198. package/out/concepts/ConfigPropertyValue__.d.ts +42 -0
  199. package/out/concepts/ConfigPropertyValue__.d.ts.map +1 -0
  200. package/out/concepts/ConfigPropertyValue__.js +83 -0
  201. package/out/concepts/ConfigPropertyValue__.js.map +1 -0
  202. package/out/concepts/ConfigProperty__.d.ts +148 -0
  203. package/out/concepts/ConfigProperty__.d.ts.map +1 -0
  204. package/out/concepts/ConfigProperty__.js +294 -0
  205. package/out/concepts/ConfigProperty__.js.map +1 -0
  206. package/out/concepts/Configuration__.d.ts +121 -0
  207. package/out/concepts/Configuration__.d.ts.map +1 -0
  208. package/out/concepts/Configuration__.js +202 -0
  209. package/out/concepts/Configuration__.js.map +1 -0
  210. package/out/concepts/Connection__.d.ts +165 -0
  211. package/out/concepts/Connection__.d.ts.map +1 -0
  212. package/out/concepts/Connection__.js +330 -0
  213. package/out/concepts/Connection__.js.map +1 -0
  214. package/out/concepts/ConnectorLogic__.d.ts +34 -0
  215. package/out/concepts/ConnectorLogic__.d.ts.map +1 -0
  216. package/out/concepts/ConnectorLogic__.js +69 -0
  217. package/out/concepts/ConnectorLogic__.js.map +1 -0
  218. package/out/concepts/ConnectorTriggerLauncher__.d.ts +45 -0
  219. package/out/concepts/ConnectorTriggerLauncher__.d.ts.map +1 -0
  220. package/out/concepts/ConnectorTriggerLauncher__.js +98 -0
  221. package/out/concepts/ConnectorTriggerLauncher__.js.map +1 -0
  222. package/out/concepts/ConnectorTrigger__.d.ts +94 -0
  223. package/out/concepts/ConnectorTrigger__.d.ts.map +1 -0
  224. package/out/concepts/ConnectorTrigger__.js +339 -0
  225. package/out/concepts/ConnectorTrigger__.js.map +1 -0
  226. package/out/concepts/Connector__.d.ts +533 -0
  227. package/out/concepts/Connector__.d.ts.map +1 -0
  228. package/out/concepts/Connector__.js +670 -0
  229. package/out/concepts/Connector__.js.map +1 -0
  230. package/out/concepts/Constant__.d.ts +95 -0
  231. package/out/concepts/Constant__.d.ts.map +1 -0
  232. package/out/concepts/Constant__.js +243 -0
  233. package/out/concepts/Constant__.js.map +1 -0
  234. package/out/concepts/CountersignPolicyV2__.d.ts +30 -0
  235. package/out/concepts/CountersignPolicyV2__.d.ts.map +1 -0
  236. package/out/concepts/CountersignPolicyV2__.js +58 -0
  237. package/out/concepts/CountersignPolicyV2__.js.map +1 -0
  238. package/out/concepts/CountersignPolicy__.d.ts +30 -0
  239. package/out/concepts/CountersignPolicy__.d.ts.map +1 -0
  240. package/out/concepts/CountersignPolicy__.js +58 -0
  241. package/out/concepts/CountersignPolicy__.js.map +1 -0
  242. package/out/concepts/DataSource__.d.ts +166 -0
  243. package/out/concepts/DataSource__.d.ts.map +1 -0
  244. package/out/concepts/DataSource__.js +516 -0
  245. package/out/concepts/DataSource__.js.map +1 -0
  246. package/out/concepts/DatabaseTypeAnnotation__.d.ts +36 -0
  247. package/out/concepts/DatabaseTypeAnnotation__.d.ts.map +1 -0
  248. package/out/concepts/DatabaseTypeAnnotation__.js +81 -0
  249. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -0
  250. package/out/concepts/DefaultValue__.d.ts +96 -0
  251. package/out/concepts/DefaultValue__.d.ts.map +1 -0
  252. package/out/concepts/DefaultValue__.js +212 -0
  253. package/out/concepts/DefaultValue__.js.map +1 -0
  254. package/out/concepts/DepartmentManagerV2__.d.ts +30 -0
  255. package/out/concepts/DepartmentManagerV2__.d.ts.map +1 -0
  256. package/out/concepts/DepartmentManagerV2__.js +58 -0
  257. package/out/concepts/DepartmentManagerV2__.js.map +1 -0
  258. package/out/concepts/DepartmentV2__.d.ts +34 -0
  259. package/out/concepts/DepartmentV2__.d.ts.map +1 -0
  260. package/out/concepts/DepartmentV2__.js +65 -0
  261. package/out/concepts/DepartmentV2__.js.map +1 -0
  262. package/out/concepts/Destination__.d.ts +151 -0
  263. package/out/concepts/Destination__.d.ts.map +1 -0
  264. package/out/concepts/Destination__.js +771 -0
  265. package/out/concepts/Destination__.js.map +1 -0
  266. package/out/concepts/DirectManagerV2__.d.ts +26 -0
  267. package/out/concepts/DirectManagerV2__.d.ts.map +1 -0
  268. package/out/concepts/DirectManagerV2__.js +55 -0
  269. package/out/concepts/DirectManagerV2__.js.map +1 -0
  270. package/out/concepts/End__.d.ts +31 -0
  271. package/out/concepts/End__.d.ts.map +1 -0
  272. package/out/concepts/End__.js +150 -0
  273. package/out/concepts/End__.js.map +1 -0
  274. package/out/concepts/EntityIndex__.d.ts +94 -0
  275. package/out/concepts/EntityIndex__.d.ts.map +1 -0
  276. package/out/concepts/EntityIndex__.js +201 -0
  277. package/out/concepts/EntityIndex__.js.map +1 -0
  278. package/out/concepts/EntityProperty__.d.ts +254 -0
  279. package/out/concepts/EntityProperty__.d.ts.map +1 -0
  280. package/out/concepts/EntityProperty__.js +715 -0
  281. package/out/concepts/EntityProperty__.js.map +1 -0
  282. package/out/concepts/Entity__.d.ts +341 -0
  283. package/out/concepts/Entity__.d.ts.map +1 -0
  284. package/out/concepts/Entity__.js +783 -0
  285. package/out/concepts/Entity__.js.map +1 -0
  286. package/out/concepts/EnumItem__.d.ts +93 -0
  287. package/out/concepts/EnumItem__.d.ts.map +1 -0
  288. package/out/concepts/EnumItem__.js +235 -0
  289. package/out/concepts/EnumItem__.js.map +1 -0
  290. package/out/concepts/EnumSelectSetter__.d.ts +114 -0
  291. package/out/concepts/EnumSelectSetter__.d.ts.map +1 -0
  292. package/out/concepts/EnumSelectSetter__.js +172 -0
  293. package/out/concepts/EnumSelectSetter__.js.map +1 -0
  294. package/out/concepts/Enum__.d.ts +129 -0
  295. package/out/concepts/Enum__.d.ts.map +1 -0
  296. package/out/concepts/Enum__.js +342 -0
  297. package/out/concepts/Enum__.js.map +1 -0
  298. package/out/concepts/EventDeclaration__.d.ts +43 -0
  299. package/out/concepts/EventDeclaration__.d.ts.map +1 -0
  300. package/out/concepts/EventDeclaration__.js +109 -0
  301. package/out/concepts/EventDeclaration__.js.map +1 -0
  302. package/out/concepts/Event__.d.ts +156 -0
  303. package/out/concepts/Event__.d.ts.map +1 -0
  304. package/out/concepts/Event__.js +291 -0
  305. package/out/concepts/Event__.js.map +1 -0
  306. package/out/concepts/ExternalDestination__.d.ts +65 -0
  307. package/out/concepts/ExternalDestination__.d.ts.map +1 -0
  308. package/out/concepts/ExternalDestination__.js +285 -0
  309. package/out/concepts/ExternalDestination__.js.map +1 -0
  310. package/out/concepts/FieldPermissionV2__.d.ts +40 -0
  311. package/out/concepts/FieldPermissionV2__.d.ts.map +1 -0
  312. package/out/concepts/FieldPermissionV2__.js +85 -0
  313. package/out/concepts/FieldPermissionV2__.js.map +1 -0
  314. package/out/concepts/FlowConditionItemV2__.d.ts +45 -0
  315. package/out/concepts/FlowConditionItemV2__.d.ts.map +1 -0
  316. package/out/concepts/FlowConditionItemV2__.js +107 -0
  317. package/out/concepts/FlowConditionItemV2__.js.map +1 -0
  318. package/out/concepts/FlowConditionV2__.d.ts +116 -0
  319. package/out/concepts/FlowConditionV2__.d.ts.map +1 -0
  320. package/out/concepts/FlowConditionV2__.js +181 -0
  321. package/out/concepts/FlowConditionV2__.js.map +1 -0
  322. package/out/concepts/ForEachStatement__.d.ts +128 -0
  323. package/out/concepts/ForEachStatement__.d.ts.map +1 -0
  324. package/out/concepts/ForEachStatement__.js +398 -0
  325. package/out/concepts/ForEachStatement__.js.map +1 -0
  326. package/out/concepts/FrontendLibrary__.d.ts +213 -0
  327. package/out/concepts/FrontendLibrary__.d.ts.map +1 -0
  328. package/out/concepts/FrontendLibrary__.js +303 -0
  329. package/out/concepts/FrontendLibrary__.js.map +1 -0
  330. package/out/concepts/FrontendType__.d.ts +312 -0
  331. package/out/concepts/FrontendType__.d.ts.map +1 -0
  332. package/out/concepts/FrontendType__.js +550 -0
  333. package/out/concepts/FrontendType__.js.map +1 -0
  334. package/out/concepts/FrontendVariable__.d.ts +42 -0
  335. package/out/concepts/FrontendVariable__.d.ts.map +1 -0
  336. package/out/concepts/FrontendVariable__.js +81 -0
  337. package/out/concepts/FrontendVariable__.js.map +1 -0
  338. package/out/concepts/Frontend__.d.ts +395 -0
  339. package/out/concepts/Frontend__.d.ts.map +1 -0
  340. package/out/concepts/Frontend__.js +870 -0
  341. package/out/concepts/Frontend__.js.map +1 -0
  342. package/out/concepts/Function__.d.ts +400 -0
  343. package/out/concepts/Function__.d.ts.map +1 -0
  344. package/out/concepts/Function__.js +631 -0
  345. package/out/concepts/Function__.js.map +1 -0
  346. package/out/concepts/HistoryProcessV2__.d.ts +229 -0
  347. package/out/concepts/HistoryProcessV2__.d.ts.map +1 -0
  348. package/out/concepts/HistoryProcessV2__.js +345 -0
  349. package/out/concepts/HistoryProcessV2__.js.map +1 -0
  350. package/out/concepts/I18nInfo__.d.ts +48 -0
  351. package/out/concepts/I18nInfo__.d.ts.map +1 -0
  352. package/out/concepts/I18nInfo__.js +100 -0
  353. package/out/concepts/I18nInfo__.js.map +1 -0
  354. package/out/concepts/IconSetter__.d.ts +30 -0
  355. package/out/concepts/IconSetter__.d.ts.map +1 -0
  356. package/out/concepts/IconSetter__.js +58 -0
  357. package/out/concepts/IconSetter__.js.map +1 -0
  358. package/out/concepts/Identifier__.d.ts +69 -0
  359. package/out/concepts/Identifier__.d.ts.map +1 -0
  360. package/out/concepts/Identifier__.js +437 -0
  361. package/out/concepts/Identifier__.js.map +1 -0
  362. package/out/concepts/IfStatement__.d.ts +157 -0
  363. package/out/concepts/IfStatement__.d.ts.map +1 -0
  364. package/out/concepts/IfStatement__.js +365 -0
  365. package/out/concepts/IfStatement__.js.map +1 -0
  366. package/out/concepts/ImageSetter__.d.ts +26 -0
  367. package/out/concepts/ImageSetter__.d.ts.map +1 -0
  368. package/out/concepts/ImageSetter__.js +55 -0
  369. package/out/concepts/ImageSetter__.js.map +1 -0
  370. package/out/concepts/ImportedInterface__.d.ts +31 -0
  371. package/out/concepts/ImportedInterface__.d.ts.map +1 -0
  372. package/out/concepts/ImportedInterface__.js +58 -0
  373. package/out/concepts/ImportedInterface__.js.map +1 -0
  374. package/out/concepts/InputSetter__.d.ts +30 -0
  375. package/out/concepts/InputSetter__.d.ts.map +1 -0
  376. package/out/concepts/InputSetter__.js +58 -0
  377. package/out/concepts/InputSetter__.js.map +1 -0
  378. package/out/concepts/Integration__.d.ts +129 -0
  379. package/out/concepts/Integration__.d.ts.map +1 -0
  380. package/out/concepts/Integration__.js +215 -0
  381. package/out/concepts/Integration__.js.map +1 -0
  382. package/out/concepts/InterfaceParam__.d.ts +121 -0
  383. package/out/concepts/InterfaceParam__.d.ts.map +1 -0
  384. package/out/concepts/InterfaceParam__.js +285 -0
  385. package/out/concepts/InterfaceParam__.js.map +1 -0
  386. package/out/concepts/InterfaceTriggerEvent__.d.ts +35 -0
  387. package/out/concepts/InterfaceTriggerEvent__.d.ts.map +1 -0
  388. package/out/concepts/InterfaceTriggerEvent__.js +74 -0
  389. package/out/concepts/InterfaceTriggerEvent__.js.map +1 -0
  390. package/out/concepts/Interface__.d.ts +406 -0
  391. package/out/concepts/Interface__.d.ts.map +1 -0
  392. package/out/concepts/Interface__.js +994 -0
  393. package/out/concepts/Interface__.js.map +1 -0
  394. package/out/concepts/JSBlock__.d.ts +40 -0
  395. package/out/concepts/JSBlock__.d.ts.map +1 -0
  396. package/out/concepts/JSBlock__.js +110 -0
  397. package/out/concepts/JSBlock__.js.map +1 -0
  398. package/out/concepts/JavaLogic__.d.ts +51 -0
  399. package/out/concepts/JavaLogic__.d.ts.map +1 -0
  400. package/out/concepts/JavaLogic__.js +116 -0
  401. package/out/concepts/JavaLogic__.js.map +1 -0
  402. package/out/concepts/LogicDeclaration__.d.ts +292 -0
  403. package/out/concepts/LogicDeclaration__.d.ts.map +1 -0
  404. package/out/concepts/LogicDeclaration__.js +421 -0
  405. package/out/concepts/LogicDeclaration__.js.map +1 -0
  406. package/out/concepts/LogicItem__.d.ts +188 -0
  407. package/out/concepts/LogicItem__.d.ts.map +1 -0
  408. package/out/concepts/LogicItem__.js +322 -0
  409. package/out/concepts/LogicItem__.js.map +1 -0
  410. package/out/concepts/Logic__.d.ts +657 -0
  411. package/out/concepts/Logic__.d.ts.map +1 -0
  412. package/out/concepts/Logic__.js +2280 -0
  413. package/out/concepts/Logic__.js.map +1 -0
  414. package/out/concepts/ManagerV2__.d.ts +36 -0
  415. package/out/concepts/ManagerV2__.d.ts.map +1 -0
  416. package/out/concepts/ManagerV2__.js +63 -0
  417. package/out/concepts/ManagerV2__.js.map +1 -0
  418. package/out/concepts/MatchCase__.d.ts +266 -0
  419. package/out/concepts/MatchCase__.d.ts.map +1 -0
  420. package/out/concepts/MatchCase__.js +677 -0
  421. package/out/concepts/MatchCase__.js.map +1 -0
  422. package/out/concepts/Match__.d.ts +125 -0
  423. package/out/concepts/Match__.d.ts.map +1 -0
  424. package/out/concepts/Match__.js +685 -0
  425. package/out/concepts/Match__.js.map +1 -0
  426. package/out/concepts/MemberExpression__.d.ts +66 -0
  427. package/out/concepts/MemberExpression__.d.ts.map +1 -0
  428. package/out/concepts/MemberExpression__.js +514 -0
  429. package/out/concepts/MemberExpression__.js.map +1 -0
  430. package/out/concepts/MetadataType__.d.ts +222 -0
  431. package/out/concepts/MetadataType__.d.ts.map +1 -0
  432. package/out/concepts/MetadataType__.js +422 -0
  433. package/out/concepts/MetadataType__.js.map +1 -0
  434. package/out/concepts/MicroApp__.d.ts +54 -0
  435. package/out/concepts/MicroApp__.d.ts.map +1 -0
  436. package/out/concepts/MicroApp__.js +80 -0
  437. package/out/concepts/MicroApp__.js.map +1 -0
  438. package/out/concepts/Module__.d.ts +1314 -0
  439. package/out/concepts/Module__.d.ts.map +1 -0
  440. package/out/concepts/Module__.js +1580 -0
  441. package/out/concepts/Module__.js.map +1 -0
  442. package/out/concepts/MsgTriggerEvent__.d.ts +139 -0
  443. package/out/concepts/MsgTriggerEvent__.d.ts.map +1 -0
  444. package/out/concepts/MsgTriggerEvent__.js +210 -0
  445. package/out/concepts/MsgTriggerEvent__.js.map +1 -0
  446. package/out/concepts/MsgTriggerLauncher__.d.ts +120 -0
  447. package/out/concepts/MsgTriggerLauncher__.d.ts.map +1 -0
  448. package/out/concepts/MsgTriggerLauncher__.js +189 -0
  449. package/out/concepts/MsgTriggerLauncher__.js.map +1 -0
  450. package/out/concepts/MultiApprovalPolicy__.d.ts +27 -0
  451. package/out/concepts/MultiApprovalPolicy__.d.ts.map +1 -0
  452. package/out/concepts/MultiApprovalPolicy__.js +55 -0
  453. package/out/concepts/MultiApprovalPolicy__.js.map +1 -0
  454. package/out/concepts/Namespace__.d.ts +1146 -0
  455. package/out/concepts/Namespace__.d.ts.map +1 -0
  456. package/out/concepts/Namespace__.js +1256 -0
  457. package/out/concepts/Namespace__.js.map +1 -0
  458. package/out/concepts/NewComposite__.d.ts +341 -0
  459. package/out/concepts/NewComposite__.d.ts.map +1 -0
  460. package/out/concepts/NewComposite__.js +1225 -0
  461. package/out/concepts/NewComposite__.js.map +1 -0
  462. package/out/concepts/NewList__.d.ts +128 -0
  463. package/out/concepts/NewList__.d.ts.map +1 -0
  464. package/out/concepts/NewList__.js +408 -0
  465. package/out/concepts/NewList__.js.map +1 -0
  466. package/out/concepts/NewMap__.d.ts +219 -0
  467. package/out/concepts/NewMap__.d.ts.map +1 -0
  468. package/out/concepts/NewMap__.js +558 -0
  469. package/out/concepts/NewMap__.js.map +1 -0
  470. package/out/concepts/New__.d.ts +32 -0
  471. package/out/concepts/New__.d.ts.map +1 -0
  472. package/out/concepts/New__.js +80 -0
  473. package/out/concepts/New__.js.map +1 -0
  474. package/out/concepts/NullLiteral__.d.ts +37 -0
  475. package/out/concepts/NullLiteral__.d.ts.map +1 -0
  476. package/out/concepts/NullLiteral__.js +102 -0
  477. package/out/concepts/NullLiteral__.js.map +1 -0
  478. package/out/concepts/NumberInputSetter__.d.ts +46 -0
  479. package/out/concepts/NumberInputSetter__.d.ts.map +1 -0
  480. package/out/concepts/NumberInputSetter__.js +70 -0
  481. package/out/concepts/NumberInputSetter__.js.map +1 -0
  482. package/out/concepts/NumericLiteral__.d.ts +49 -0
  483. package/out/concepts/NumericLiteral__.d.ts.map +1 -0
  484. package/out/concepts/NumericLiteral__.js +141 -0
  485. package/out/concepts/NumericLiteral__.js.map +1 -0
  486. package/out/concepts/OperatePermissionV2__.d.ts +44 -0
  487. package/out/concepts/OperatePermissionV2__.d.ts.map +1 -0
  488. package/out/concepts/OperatePermissionV2__.js +82 -0
  489. package/out/concepts/OperatePermissionV2__.js.map +1 -0
  490. package/out/concepts/OqlQueryComponent__.d.ts +63 -0
  491. package/out/concepts/OqlQueryComponent__.d.ts.map +1 -0
  492. package/out/concepts/OqlQueryComponent__.js +313 -0
  493. package/out/concepts/OqlQueryComponent__.js.map +1 -0
  494. package/out/concepts/OrSignPolicyV2__.d.ts +26 -0
  495. package/out/concepts/OrSignPolicyV2__.d.ts.map +1 -0
  496. package/out/concepts/OrSignPolicyV2__.js +55 -0
  497. package/out/concepts/OrSignPolicyV2__.js.map +1 -0
  498. package/out/concepts/OverriddenLogic__.d.ts +618 -0
  499. package/out/concepts/OverriddenLogic__.d.ts.map +1 -0
  500. package/out/concepts/OverriddenLogic__.js +1657 -0
  501. package/out/concepts/OverriddenLogic__.js.map +1 -0
  502. package/out/concepts/Paginate__.d.ts +57 -0
  503. package/out/concepts/Paginate__.d.ts.map +1 -0
  504. package/out/concepts/Paginate__.js +163 -0
  505. package/out/concepts/Paginate__.js.map +1 -0
  506. package/out/concepts/ParamWithGroup__.d.ts +44 -0
  507. package/out/concepts/ParamWithGroup__.d.ts.map +1 -0
  508. package/out/concepts/ParamWithGroup__.js +161 -0
  509. package/out/concepts/ParamWithGroup__.js.map +1 -0
  510. package/out/concepts/Param__.d.ts +145 -0
  511. package/out/concepts/Param__.d.ts.map +1 -0
  512. package/out/concepts/Param__.js +453 -0
  513. package/out/concepts/Param__.js.map +1 -0
  514. package/out/concepts/Point__.d.ts +34 -0
  515. package/out/concepts/Point__.d.ts.map +1 -0
  516. package/out/concepts/Point__.js +61 -0
  517. package/out/concepts/Point__.js.map +1 -0
  518. package/out/concepts/ProcessBindV2__.d.ts +53 -0
  519. package/out/concepts/ProcessBindV2__.d.ts.map +1 -0
  520. package/out/concepts/ProcessBindV2__.js +114 -0
  521. package/out/concepts/ProcessBindV2__.js.map +1 -0
  522. package/out/concepts/ProcessComponentV2__.d.ts +126 -0
  523. package/out/concepts/ProcessComponentV2__.d.ts.map +1 -0
  524. package/out/concepts/ProcessComponentV2__.js +186 -0
  525. package/out/concepts/ProcessComponentV2__.js.map +1 -0
  526. package/out/concepts/ProcessComponent__.d.ts +215 -0
  527. package/out/concepts/ProcessComponent__.d.ts.map +1 -0
  528. package/out/concepts/ProcessComponent__.js +276 -0
  529. package/out/concepts/ProcessComponent__.js.map +1 -0
  530. package/out/concepts/ProcessElementV2__.d.ts +552 -0
  531. package/out/concepts/ProcessElementV2__.d.ts.map +1 -0
  532. package/out/concepts/ProcessElementV2__.js +954 -0
  533. package/out/concepts/ProcessElementV2__.js.map +1 -0
  534. package/out/concepts/ProcessElement__.d.ts +628 -0
  535. package/out/concepts/ProcessElement__.d.ts.map +1 -0
  536. package/out/concepts/ProcessElement__.js +1079 -0
  537. package/out/concepts/ProcessElement__.js.map +1 -0
  538. package/out/concepts/ProcessOutcome__.d.ts +36 -0
  539. package/out/concepts/ProcessOutcome__.d.ts.map +1 -0
  540. package/out/concepts/ProcessOutcome__.js +97 -0
  541. package/out/concepts/ProcessOutcome__.js.map +1 -0
  542. package/out/concepts/ProcessOutcomes__.d.ts +36 -0
  543. package/out/concepts/ProcessOutcomes__.d.ts.map +1 -0
  544. package/out/concepts/ProcessOutcomes__.js +104 -0
  545. package/out/concepts/ProcessOutcomes__.js.map +1 -0
  546. package/out/concepts/ProcessV2__.d.ts +433 -0
  547. package/out/concepts/ProcessV2__.d.ts.map +1 -0
  548. package/out/concepts/ProcessV2__.js +732 -0
  549. package/out/concepts/ProcessV2__.js.map +1 -0
  550. package/out/concepts/Process__.d.ts +615 -0
  551. package/out/concepts/Process__.d.ts.map +1 -0
  552. package/out/concepts/Process__.js +985 -0
  553. package/out/concepts/Process__.js.map +1 -0
  554. package/out/concepts/PropDeclaration__.d.ts +109 -0
  555. package/out/concepts/PropDeclaration__.d.ts.map +1 -0
  556. package/out/concepts/PropDeclaration__.js +137 -0
  557. package/out/concepts/PropDeclaration__.js.map +1 -0
  558. package/out/concepts/PropertySelectSetter__.d.ts +26 -0
  559. package/out/concepts/PropertySelectSetter__.d.ts.map +1 -0
  560. package/out/concepts/PropertySelectSetter__.js +55 -0
  561. package/out/concepts/PropertySelectSetter__.js.map +1 -0
  562. package/out/concepts/QueryAggregateExpression__.d.ts +51 -0
  563. package/out/concepts/QueryAggregateExpression__.d.ts.map +1 -0
  564. package/out/concepts/QueryAggregateExpression__.js +126 -0
  565. package/out/concepts/QueryAggregateExpression__.js.map +1 -0
  566. package/out/concepts/QueryFieldExpression__.d.ts +67 -0
  567. package/out/concepts/QueryFieldExpression__.d.ts.map +1 -0
  568. package/out/concepts/QueryFieldExpression__.js +207 -0
  569. package/out/concepts/QueryFieldExpression__.js.map +1 -0
  570. package/out/concepts/QueryFromExpression__.d.ts +108 -0
  571. package/out/concepts/QueryFromExpression__.d.ts.map +1 -0
  572. package/out/concepts/QueryFromExpression__.js +244 -0
  573. package/out/concepts/QueryFromExpression__.js.map +1 -0
  574. package/out/concepts/QueryGroupByExpression__.d.ts +48 -0
  575. package/out/concepts/QueryGroupByExpression__.d.ts.map +1 -0
  576. package/out/concepts/QueryGroupByExpression__.js +123 -0
  577. package/out/concepts/QueryGroupByExpression__.js.map +1 -0
  578. package/out/concepts/QueryJoinExpression__.d.ts +195 -0
  579. package/out/concepts/QueryJoinExpression__.d.ts.map +1 -0
  580. package/out/concepts/QueryJoinExpression__.js +357 -0
  581. package/out/concepts/QueryJoinExpression__.js.map +1 -0
  582. package/out/concepts/QueryLimitExpression__.d.ts +48 -0
  583. package/out/concepts/QueryLimitExpression__.d.ts.map +1 -0
  584. package/out/concepts/QueryLimitExpression__.js +141 -0
  585. package/out/concepts/QueryLimitExpression__.js.map +1 -0
  586. package/out/concepts/QueryOrderByExpression__.d.ts +59 -0
  587. package/out/concepts/QueryOrderByExpression__.d.ts.map +1 -0
  588. package/out/concepts/QueryOrderByExpression__.js +158 -0
  589. package/out/concepts/QueryOrderByExpression__.js.map +1 -0
  590. package/out/concepts/QuerySelectExpression__.d.ts +213 -0
  591. package/out/concepts/QuerySelectExpression__.d.ts.map +1 -0
  592. package/out/concepts/QuerySelectExpression__.js +346 -0
  593. package/out/concepts/QuerySelectExpression__.js.map +1 -0
  594. package/out/concepts/Rect__.d.ts +42 -0
  595. package/out/concepts/Rect__.d.ts.map +1 -0
  596. package/out/concepts/Rect__.js +67 -0
  597. package/out/concepts/Rect__.js.map +1 -0
  598. package/out/concepts/Return__.d.ts +122 -0
  599. package/out/concepts/Return__.d.ts.map +1 -0
  600. package/out/concepts/Return__.js +359 -0
  601. package/out/concepts/Return__.js.map +1 -0
  602. package/out/concepts/Role__.d.ts +60 -0
  603. package/out/concepts/Role__.d.ts.map +1 -0
  604. package/out/concepts/Role__.js +188 -0
  605. package/out/concepts/Role__.js.map +1 -0
  606. package/out/concepts/SelectMembers__.d.ts +136 -0
  607. package/out/concepts/SelectMembers__.d.ts.map +1 -0
  608. package/out/concepts/SelectMembers__.js +259 -0
  609. package/out/concepts/SelectMembers__.js.map +1 -0
  610. package/out/concepts/SequentialPolicyV2__.d.ts +26 -0
  611. package/out/concepts/SequentialPolicyV2__.d.ts.map +1 -0
  612. package/out/concepts/SequentialPolicyV2__.js +55 -0
  613. package/out/concepts/SequentialPolicyV2__.js.map +1 -0
  614. package/out/concepts/SequentialPolicy__.d.ts +26 -0
  615. package/out/concepts/SequentialPolicy__.d.ts.map +1 -0
  616. package/out/concepts/SequentialPolicy__.js +55 -0
  617. package/out/concepts/SequentialPolicy__.js.map +1 -0
  618. package/out/concepts/SetterOption__.d.ts +50 -0
  619. package/out/concepts/SetterOption__.d.ts.map +1 -0
  620. package/out/concepts/SetterOption__.js +73 -0
  621. package/out/concepts/SetterOption__.js.map +1 -0
  622. package/out/concepts/SlotDeclaration__.d.ts +215 -0
  623. package/out/concepts/SlotDeclaration__.d.ts.map +1 -0
  624. package/out/concepts/SlotDeclaration__.js +285 -0
  625. package/out/concepts/SlotDeclaration__.js.map +1 -0
  626. package/out/concepts/Slot__.d.ts +54 -0
  627. package/out/concepts/Slot__.d.ts.map +1 -0
  628. package/out/concepts/Slot__.js +95 -0
  629. package/out/concepts/Slot__.js.map +1 -0
  630. package/out/concepts/SqlQueryComponent__.d.ts +59 -0
  631. package/out/concepts/SqlQueryComponent__.d.ts.map +1 -0
  632. package/out/concepts/SqlQueryComponent__.js +220 -0
  633. package/out/concepts/SqlQueryComponent__.js.map +1 -0
  634. package/out/concepts/Start__.d.ts +31 -0
  635. package/out/concepts/Start__.d.ts.map +1 -0
  636. package/out/concepts/Start__.js +75 -0
  637. package/out/concepts/Start__.js.map +1 -0
  638. package/out/concepts/StaticString__.d.ts +50 -0
  639. package/out/concepts/StaticString__.d.ts.map +1 -0
  640. package/out/concepts/StaticString__.js +114 -0
  641. package/out/concepts/StaticString__.js.map +1 -0
  642. package/out/concepts/StringInterpolation__.d.ts +124 -0
  643. package/out/concepts/StringInterpolation__.d.ts.map +1 -0
  644. package/out/concepts/StringInterpolation__.js +279 -0
  645. package/out/concepts/StringInterpolation__.js.map +1 -0
  646. package/out/concepts/StringLiteral__.d.ts +52 -0
  647. package/out/concepts/StringLiteral__.d.ts.map +1 -0
  648. package/out/concepts/StringLiteral__.js +185 -0
  649. package/out/concepts/StringLiteral__.js.map +1 -0
  650. package/out/concepts/StructureProperty__.d.ts +134 -0
  651. package/out/concepts/StructureProperty__.d.ts.map +1 -0
  652. package/out/concepts/StructureProperty__.js +292 -0
  653. package/out/concepts/StructureProperty__.js.map +1 -0
  654. package/out/concepts/Structure__.d.ts +241 -0
  655. package/out/concepts/Structure__.d.ts.map +1 -0
  656. package/out/concepts/Structure__.js +485 -0
  657. package/out/concepts/Structure__.js.map +1 -0
  658. package/out/concepts/SubLogic__.d.ts +418 -0
  659. package/out/concepts/SubLogic__.d.ts.map +1 -0
  660. package/out/concepts/SubLogic__.js +1002 -0
  661. package/out/concepts/SubLogic__.js.map +1 -0
  662. package/out/concepts/SwitchCase__.d.ts +93 -0
  663. package/out/concepts/SwitchCase__.d.ts.map +1 -0
  664. package/out/concepts/SwitchCase__.js +282 -0
  665. package/out/concepts/SwitchCase__.js.map +1 -0
  666. package/out/concepts/SwitchSetter__.d.ts +26 -0
  667. package/out/concepts/SwitchSetter__.d.ts.map +1 -0
  668. package/out/concepts/SwitchSetter__.js +55 -0
  669. package/out/concepts/SwitchSetter__.js.map +1 -0
  670. package/out/concepts/SwitchStatement__.d.ts +92 -0
  671. package/out/concepts/SwitchStatement__.d.ts.map +1 -0
  672. package/out/concepts/SwitchStatement__.js +221 -0
  673. package/out/concepts/SwitchStatement__.js.map +1 -0
  674. package/out/concepts/ThemeVariable__.d.ts +30 -0
  675. package/out/concepts/ThemeVariable__.d.ts.map +1 -0
  676. package/out/concepts/ThemeVariable__.js +58 -0
  677. package/out/concepts/ThemeVariable__.js.map +1 -0
  678. package/out/concepts/Theme__.d.ts +44 -0
  679. package/out/concepts/Theme__.d.ts.map +1 -0
  680. package/out/concepts/Theme__.js +83 -0
  681. package/out/concepts/Theme__.js.map +1 -0
  682. package/out/concepts/Transactional__.d.ts +86 -0
  683. package/out/concepts/Transactional__.d.ts.map +1 -0
  684. package/out/concepts/Transactional__.js +150 -0
  685. package/out/concepts/Transactional__.js.map +1 -0
  686. package/out/concepts/TriggerEvent__.d.ts +44 -0
  687. package/out/concepts/TriggerEvent__.d.ts.map +1 -0
  688. package/out/concepts/TriggerEvent__.js +93 -0
  689. package/out/concepts/TriggerEvent__.js.map +1 -0
  690. package/out/concepts/TriggerLauncher__.d.ts +77 -0
  691. package/out/concepts/TriggerLauncher__.d.ts.map +1 -0
  692. package/out/concepts/TriggerLauncher__.js +232 -0
  693. package/out/concepts/TriggerLauncher__.js.map +1 -0
  694. package/out/concepts/TypeAnnotation__.d.ts +310 -0
  695. package/out/concepts/TypeAnnotation__.d.ts.map +1 -0
  696. package/out/concepts/TypeAnnotation__.js +1169 -0
  697. package/out/concepts/TypeAnnotation__.js.map +1 -0
  698. package/out/concepts/TypeParam__.d.ts +40 -0
  699. package/out/concepts/TypeParam__.d.ts.map +1 -0
  700. package/out/concepts/TypeParam__.js +91 -0
  701. package/out/concepts/TypeParam__.js.map +1 -0
  702. package/out/concepts/UnaryExpression__.d.ts +48 -0
  703. package/out/concepts/UnaryExpression__.d.ts.map +1 -0
  704. package/out/concepts/UnaryExpression__.js +176 -0
  705. package/out/concepts/UnaryExpression__.js.map +1 -0
  706. package/out/concepts/Unparsed__.d.ts +42 -0
  707. package/out/concepts/Unparsed__.d.ts.map +1 -0
  708. package/out/concepts/Unparsed__.js +98 -0
  709. package/out/concepts/Unparsed__.js.map +1 -0
  710. package/out/concepts/UseComponent__.d.ts +34 -0
  711. package/out/concepts/UseComponent__.d.ts.map +1 -0
  712. package/out/concepts/UseComponent__.js +61 -0
  713. package/out/concepts/UseComponent__.js.map +1 -0
  714. package/out/concepts/ValidationRule__.d.ts +130 -0
  715. package/out/concepts/ValidationRule__.d.ts.map +1 -0
  716. package/out/concepts/ValidationRule__.js +542 -0
  717. package/out/concepts/ValidationRule__.js.map +1 -0
  718. package/out/concepts/Variable__.d.ts +140 -0
  719. package/out/concepts/Variable__.d.ts.map +1 -0
  720. package/out/concepts/Variable__.js +457 -0
  721. package/out/concepts/Variable__.js.map +1 -0
  722. package/out/concepts/ViewBlockWithImage__.d.ts +34 -0
  723. package/out/concepts/ViewBlockWithImage__.d.ts.map +1 -0
  724. package/out/concepts/ViewBlockWithImage__.js +61 -0
  725. package/out/concepts/ViewBlockWithImage__.js.map +1 -0
  726. package/out/concepts/ViewBlock__.d.ts +38 -0
  727. package/out/concepts/ViewBlock__.d.ts.map +1 -0
  728. package/out/concepts/ViewBlock__.js +64 -0
  729. package/out/concepts/ViewBlock__.js.map +1 -0
  730. package/out/concepts/ViewComponentDeclaration__.d.ts +727 -0
  731. package/out/concepts/ViewComponentDeclaration__.d.ts.map +1 -0
  732. package/out/concepts/ViewComponentDeclaration__.js +833 -0
  733. package/out/concepts/ViewComponentDeclaration__.js.map +1 -0
  734. package/out/concepts/ViewElement__.d.ts +666 -0
  735. package/out/concepts/ViewElement__.d.ts.map +1 -0
  736. package/out/concepts/ViewElement__.js +2929 -0
  737. package/out/concepts/ViewElement__.js.map +1 -0
  738. package/out/concepts/View__.d.ts +754 -0
  739. package/out/concepts/View__.d.ts.map +1 -0
  740. package/out/concepts/View__.js +2907 -0
  741. package/out/concepts/View__.js.map +1 -0
  742. package/out/concepts/WhileStatement__.d.ts +96 -0
  743. package/out/concepts/WhileStatement__.d.ts.map +1 -0
  744. package/out/concepts/WhileStatement__.js +256 -0
  745. package/out/concepts/WhileStatement__.js.map +1 -0
  746. package/out/concepts/basics/index.d.ts +16 -0
  747. package/out/concepts/basics/index.d.ts.map +1 -0
  748. package/out/concepts/basics/index.js +54 -0
  749. package/out/concepts/basics/index.js.map +1 -0
  750. package/out/concepts/basics/stdlib/index.d.ts +16 -0
  751. package/out/concepts/basics/stdlib/index.d.ts.map +1 -0
  752. package/out/concepts/basics/stdlib/index.js +93 -0
  753. package/out/concepts/basics/stdlib/index.js.map +1 -0
  754. package/out/concepts/basics/stdlib/nasl.auth.d.ts +10 -0
  755. package/out/concepts/basics/stdlib/nasl.auth.d.ts.map +1 -0
  756. package/out/concepts/basics/stdlib/nasl.auth.js +206 -0
  757. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -0
  758. package/out/concepts/basics/stdlib/nasl.browser.d.ts +6 -0
  759. package/out/concepts/basics/stdlib/nasl.browser.d.ts.map +1 -0
  760. package/out/concepts/basics/stdlib/nasl.browser.js +200 -0
  761. package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -0
  762. package/out/concepts/basics/stdlib/nasl.collection.d.ts +10 -0
  763. package/out/concepts/basics/stdlib/nasl.collection.d.ts.map +1 -0
  764. package/out/concepts/basics/stdlib/nasl.collection.js +57 -0
  765. package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -0
  766. package/out/concepts/basics/stdlib/nasl.configuration.d.ts +10 -0
  767. package/out/concepts/basics/stdlib/nasl.configuration.d.ts.map +1 -0
  768. package/out/concepts/basics/stdlib/nasl.configuration.js +97 -0
  769. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -0
  770. package/out/concepts/basics/stdlib/nasl.core.d.ts +8 -0
  771. package/out/concepts/basics/stdlib/nasl.core.d.ts.map +1 -0
  772. package/out/concepts/basics/stdlib/nasl.core.js +47 -0
  773. package/out/concepts/basics/stdlib/nasl.core.js.map +1 -0
  774. package/out/concepts/basics/stdlib/nasl.event.d.ts +6 -0
  775. package/out/concepts/basics/stdlib/nasl.event.d.ts.map +1 -0
  776. package/out/concepts/basics/stdlib/nasl.event.js +34 -0
  777. package/out/concepts/basics/stdlib/nasl.event.js.map +1 -0
  778. package/out/concepts/basics/stdlib/nasl.http.d.ts +10 -0
  779. package/out/concepts/basics/stdlib/nasl.http.d.ts.map +1 -0
  780. package/out/concepts/basics/stdlib/nasl.http.js +174 -0
  781. package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
  782. package/out/concepts/basics/stdlib/nasl.interface.d.ts +10 -0
  783. package/out/concepts/basics/stdlib/nasl.interface.d.ts.map +1 -0
  784. package/out/concepts/basics/stdlib/nasl.interface.js +49 -0
  785. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -0
  786. package/out/concepts/basics/stdlib/nasl.io.d.ts +6 -0
  787. package/out/concepts/basics/stdlib/nasl.io.d.ts.map +1 -0
  788. package/out/concepts/basics/stdlib/nasl.io.js +61 -0
  789. package/out/concepts/basics/stdlib/nasl.io.js.map +1 -0
  790. package/out/concepts/basics/stdlib/nasl.logging.d.ts +6 -0
  791. package/out/concepts/basics/stdlib/nasl.logging.d.ts.map +1 -0
  792. package/out/concepts/basics/stdlib/nasl.logging.js +65 -0
  793. package/out/concepts/basics/stdlib/nasl.logging.js.map +1 -0
  794. package/out/concepts/basics/stdlib/nasl.process.d.ts +10 -0
  795. package/out/concepts/basics/stdlib/nasl.process.d.ts.map +1 -0
  796. package/out/concepts/basics/stdlib/nasl.process.js +741 -0
  797. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -0
  798. package/out/concepts/basics/stdlib/nasl.processV2.d.ts +12 -0
  799. package/out/concepts/basics/stdlib/nasl.processV2.d.ts.map +1 -0
  800. package/out/concepts/basics/stdlib/nasl.processV2.js +967 -0
  801. package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -0
  802. package/out/concepts/basics/stdlib/nasl.ui.d.ts +10 -0
  803. package/out/concepts/basics/stdlib/nasl.ui.d.ts.map +1 -0
  804. package/out/concepts/basics/stdlib/nasl.ui.js +1038 -0
  805. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -0
  806. package/out/concepts/basics/stdlib/nasl.util.d.ts +7 -0
  807. package/out/concepts/basics/stdlib/nasl.util.d.ts.map +1 -0
  808. package/out/concepts/basics/stdlib/nasl.util.js +2501 -0
  809. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -0
  810. package/out/concepts/basics/stdlib/nasl.validation.d.ts +6 -0
  811. package/out/concepts/basics/stdlib/nasl.validation.d.ts.map +1 -0
  812. package/out/concepts/basics/stdlib/nasl.validation.js +680 -0
  813. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
  814. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +5 -0
  815. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts.map +1 -0
  816. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +47 -0
  817. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -0
  818. package/out/concepts/basics/stdlib/timeZone.d.ts +6 -0
  819. package/out/concepts/basics/stdlib/timeZone.d.ts.map +1 -0
  820. package/out/concepts/basics/stdlib/timeZone.js +196 -0
  821. package/out/concepts/basics/stdlib/timeZone.js.map +1 -0
  822. package/out/concepts/basics/types/coreTypeList.d.ts +5 -0
  823. package/out/concepts/basics/types/coreTypeList.d.ts.map +1 -0
  824. package/out/concepts/basics/types/coreTypeList.js +14 -0
  825. package/out/concepts/basics/types/coreTypeList.js.map +1 -0
  826. package/out/concepts/basics/types/dataTypes.d.ts +9 -0
  827. package/out/concepts/basics/types/dataTypes.d.ts.map +1 -0
  828. package/out/concepts/basics/types/dataTypes.js +18 -0
  829. package/out/concepts/basics/types/dataTypes.js.map +1 -0
  830. package/out/concepts/basics/types/index.d.ts +5 -0
  831. package/out/concepts/basics/types/index.d.ts.map +1 -0
  832. package/out/concepts/basics/types/index.js +17 -0
  833. package/out/concepts/basics/types/index.js.map +1 -0
  834. package/out/concepts/index.d.ts +6 -0
  835. package/out/concepts/index.d.ts.map +1 -0
  836. package/out/concepts/index.js +36 -0
  837. package/out/concepts/index.js.map +1 -0
  838. package/out/concepts/index__.d.ts +178 -0
  839. package/out/concepts/index__.d.ts.map +1 -0
  840. package/out/concepts/index__.js +194 -0
  841. package/out/concepts/index__.js.map +1 -0
  842. package/out/concepts/types__.d.ts +2 -0
  843. package/out/concepts/types__.d.ts.map +1 -0
  844. package/out/concepts/types__.js +3 -0
  845. package/out/concepts/types__.js.map +1 -0
  846. package/out/concepts/utils/asserts.d.ts +8822 -0
  847. package/out/concepts/utils/asserts.d.ts.map +1 -0
  848. package/out/concepts/utils/asserts.js +11727 -0
  849. package/out/concepts/utils/asserts.js.map +1 -0
  850. package/out/concepts/utils/quick-info.d.ts +21 -0
  851. package/out/concepts/utils/quick-info.d.ts.map +1 -0
  852. package/out/concepts/utils/quick-info.js +108 -0
  853. package/out/concepts/utils/quick-info.js.map +1 -0
  854. package/out/concepts/utils/types.d.ts +580 -0
  855. package/out/concepts/utils/types.d.ts.map +1 -0
  856. package/out/concepts/utils/types.js +3 -0
  857. package/out/concepts/utils/types.js.map +1 -0
  858. package/out/decorators/constant.d.ts +12 -0
  859. package/out/decorators/constant.d.ts.map +1 -0
  860. package/out/decorators/constant.js +6 -0
  861. package/out/decorators/constant.js.map +1 -0
  862. package/out/decorators/index.d.ts +34 -0
  863. package/out/decorators/index.d.ts.map +1 -0
  864. package/out/decorators/index.js +123 -0
  865. package/out/decorators/index.js.map +1 -0
  866. package/out/decorators/utils.d.ts +22 -0
  867. package/out/decorators/utils.d.ts.map +1 -0
  868. package/out/decorators/utils.js +50 -0
  869. package/out/decorators/utils.js.map +1 -0
  870. package/out/index.d.ts +13 -0
  871. package/out/index.d.ts.map +1 -0
  872. package/out/index.js +49 -0
  873. package/out/index.js.map +1 -0
  874. package/out/service/actionable.d.ts +3 -0
  875. package/out/service/actionable.d.ts.map +1 -0
  876. package/out/service/actionable.js +9 -0
  877. package/out/service/actionable.js.map +1 -0
  878. package/out/service/engine.d.ts +7 -0
  879. package/out/service/engine.d.ts.map +1 -0
  880. package/out/service/engine.js +120 -0
  881. package/out/service/engine.js.map +1 -0
  882. package/out/service/entity2LogicNamespace.d.ts +11 -0
  883. package/out/service/entity2LogicNamespace.d.ts.map +1 -0
  884. package/out/service/entity2LogicNamespace.js +379 -0
  885. package/out/service/entity2LogicNamespace.js.map +1 -0
  886. package/out/service/formatTsUtils.d.ts +37 -0
  887. package/out/service/formatTsUtils.d.ts.map +1 -0
  888. package/out/service/formatTsUtils.js +876 -0
  889. package/out/service/formatTsUtils.js.map +1 -0
  890. package/out/service/getConnector.d.ts +13 -0
  891. package/out/service/getConnector.d.ts.map +1 -0
  892. package/out/service/getConnector.js +117 -0
  893. package/out/service/getConnector.js.map +1 -0
  894. package/out/service/getExtensionModules.d.ts +4 -0
  895. package/out/service/getExtensionModules.d.ts.map +1 -0
  896. package/out/service/getExtensionModules.js +34 -0
  897. package/out/service/getExtensionModules.js.map +1 -0
  898. package/out/service/getFunctions.d.ts +4 -0
  899. package/out/service/getFunctions.d.ts.map +1 -0
  900. package/out/service/getFunctions.js +20 -0
  901. package/out/service/getFunctions.js.map +1 -0
  902. package/out/service/getInterfaces.d.ts +3 -0
  903. package/out/service/getInterfaces.d.ts.map +1 -0
  904. package/out/service/getInterfaces.js +48 -0
  905. package/out/service/getInterfaces.js.map +1 -0
  906. package/out/service/getLogging.d.ts +2 -0
  907. package/out/service/getLogging.d.ts.map +1 -0
  908. package/out/service/getLogging.js +9 -0
  909. package/out/service/getLogging.js.map +1 -0
  910. package/out/service/getLogics.d.ts +6 -0
  911. package/out/service/getLogics.d.ts.map +1 -0
  912. package/out/service/getLogics.js +509 -0
  913. package/out/service/getLogics.js.map +1 -0
  914. package/out/service/getMemberIdentifier.d.ts +18 -0
  915. package/out/service/getMemberIdentifier.d.ts.map +1 -0
  916. package/out/service/getMemberIdentifier.js +489 -0
  917. package/out/service/getMemberIdentifier.js.map +1 -0
  918. package/out/service/getProcessComponents.d.ts +3 -0
  919. package/out/service/getProcessComponents.d.ts.map +1 -0
  920. package/out/service/getProcessComponents.js +13 -0
  921. package/out/service/getProcessComponents.js.map +1 -0
  922. package/out/service/getProcesses.d.ts +34 -0
  923. package/out/service/getProcesses.d.ts.map +1 -0
  924. package/out/service/getProcesses.js +644 -0
  925. package/out/service/getProcesses.js.map +1 -0
  926. package/out/service/getProcessesV2.d.ts +91 -0
  927. package/out/service/getProcessesV2.d.ts.map +1 -0
  928. package/out/service/getProcessesV2.js +687 -0
  929. package/out/service/getProcessesV2.js.map +1 -0
  930. package/out/service/getValidates.d.ts +4 -0
  931. package/out/service/getValidates.d.ts.map +1 -0
  932. package/out/service/getValidates.js +14 -0
  933. package/out/service/getValidates.js.map +1 -0
  934. package/out/service/index.d.ts +19 -0
  935. package/out/service/index.d.ts.map +1 -0
  936. package/out/service/index.js +48 -0
  937. package/out/service/index.js.map +1 -0
  938. package/out/service/modules.d.ts +9 -0
  939. package/out/service/modules.d.ts.map +1 -0
  940. package/out/service/modules.js +88 -0
  941. package/out/service/modules.js.map +1 -0
  942. package/out/service/process2LogicNamespace.d.ts +27 -0
  943. package/out/service/process2LogicNamespace.d.ts.map +1 -0
  944. package/out/service/process2LogicNamespace.js +109 -0
  945. package/out/service/process2LogicNamespace.js.map +1 -0
  946. package/out/service/transform.d.ts +9 -0
  947. package/out/service/transform.d.ts.map +1 -0
  948. package/out/service/transform.js +36 -0
  949. package/out/service/transform.js.map +1 -0
  950. package/out/store/event.d.ts +14 -0
  951. package/out/store/event.d.ts.map +1 -0
  952. package/out/store/event.js +19 -0
  953. package/out/store/event.js.map +1 -0
  954. package/out/store/index.d.ts +8 -0
  955. package/out/store/index.d.ts.map +1 -0
  956. package/out/store/index.js +25 -0
  957. package/out/store/index.js.map +1 -0
  958. package/out/store/lib.d.ts +16 -0
  959. package/out/store/lib.d.ts.map +1 -0
  960. package/out/store/lib.js +21 -0
  961. package/out/store/lib.js.map +1 -0
  962. package/out/store/store.d.ts +16 -0
  963. package/out/store/store.d.ts.map +1 -0
  964. package/out/store/store.js +18 -0
  965. package/out/store/store.js.map +1 -0
  966. package/out/utils/bak-translator.d.ts +2 -0
  967. package/out/utils/bak-translator.d.ts.map +1 -0
  968. package/out/utils/bak-translator.js +334 -0
  969. package/out/utils/bak-translator.js.map +1 -0
  970. package/out/utils/constant.d.ts +4 -0
  971. package/out/utils/constant.d.ts.map +1 -0
  972. package/out/utils/constant.js +34 -0
  973. package/out/utils/constant.js.map +1 -0
  974. package/out/utils/index.d.ts +6 -0
  975. package/out/utils/index.d.ts.map +1 -0
  976. package/out/utils/index.js +22 -0
  977. package/out/utils/index.js.map +1 -0
  978. package/out/utils/node.d.ts +14 -0
  979. package/out/utils/node.d.ts.map +1 -0
  980. package/out/utils/node.js +85 -0
  981. package/out/utils/node.js.map +1 -0
  982. package/out/utils/utils.d.ts +13 -0
  983. package/out/utils/utils.d.ts.map +1 -0
  984. package/out/utils/utils.js +77 -0
  985. package/out/utils/utils.js.map +1 -0
  986. package/package.json +67 -0
@@ -0,0 +1,2907 @@
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 View_1;
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getComponentNameFromElementName = exports.FrontendTypeComponentNamePerfixMap = exports.ComponentCompletionPropertyMap = exports.PAGE_COMPONENT_INCLUDE_TAG_MAP = exports.View = void 0;
37
+ const utils_1 = require("../utils");
38
+ const nasl_translator_1 = require("@lcap/nasl-translator");
39
+ const utils_2 = require("../utils");
40
+ const Structure__1 = require("./Structure__");
41
+ const getBranchCopyUniCode = () => window?.BranchCopyUniCode;
42
+ const removedViewElementCache = {};
43
+ const decorators_1 = require("../decorators");
44
+ const utils = __importStar(require("../utils"));
45
+ const asserts = __importStar(require("./utils/asserts"));
46
+ const Annotatable__1 = __importDefault(require("./Annotatable__"));
47
+ /**
48
+ * 页面
49
+ */
50
+ let View = class View extends Annotatable__1.default {
51
+ static { View_1 = this; }
52
+ /** 类名 */
53
+ static { this.ConceptName = 'View'; }
54
+ /**
55
+ * 是否为抽象类
56
+ * 抽象类不能产生 concept: string
57
+ */
58
+ static { this.isAbstract = false; }
59
+ /** 继承链 */
60
+ static { this.inheritanceChain = ['Annotatable', 'BaseNode']; }
61
+ /**
62
+ * @param source 需要合并的部分参数
63
+ */
64
+ constructor(source) {
65
+ source = Object.assign({}, View_1.getDefaultOptions(), source);
66
+ super(source);
67
+ /**
68
+ * 页面名称
69
+ */
70
+ this.name = '';
71
+ /**
72
+ * 页面元素列表
73
+ */
74
+ this.elements = [];
75
+ /**
76
+ * 变量列表
77
+ */
78
+ this.variables = [];
79
+ /**
80
+ * 逻辑列表
81
+ */
82
+ this.logics = [];
83
+ /**
84
+ * 元素绑定事件列表
85
+ */
86
+ this.bindEvents = [];
87
+ /**
88
+ * 绑定的角色
89
+ */
90
+ this.bindRoles = [];
91
+ /**
92
+ * 页面列表
93
+ */
94
+ this.children = [];
95
+ this.existingViewElement = new Set();
96
+ /**
97
+ * 获取当前页面下所有elements上bindEvents下的logic
98
+ */
99
+ this.elementLogicRoot = [];
100
+ this.subLogics = [];
101
+ this.existingSubLogic = new Set();
102
+ super.subConstructor(source);
103
+ }
104
+ static from(source, parentNode, parentKey) {
105
+ return super.from(source, parentNode, parentKey);
106
+ }
107
+ /**
108
+ * 设置页面名称
109
+ */
110
+ setName(name) {
111
+ const object = {
112
+ name,
113
+ };
114
+ this.update({
115
+ ...object,
116
+ field: 'name',
117
+ });
118
+ }
119
+ /**
120
+ * 设置页面标题
121
+ */
122
+ setTitle(title) {
123
+ const object = {
124
+ title,
125
+ };
126
+ this.update({
127
+ ...object,
128
+ });
129
+ }
130
+ /**
131
+ * 设置面包屑
132
+ */
133
+ setCrumb(crumb) {
134
+ crumb._delete();
135
+ const relationOptions = { parentNode: this, parentKey: 'crumb' };
136
+ Object.assign(crumb, relationOptions);
137
+ const object = {
138
+ crumb,
139
+ };
140
+ this.update({
141
+ ...object,
142
+ });
143
+ }
144
+ /**
145
+ * 设置权限控制
146
+ */
147
+ setAuth(auth) {
148
+ const object = {
149
+ auth,
150
+ };
151
+ this.update({
152
+ ...object,
153
+ });
154
+ }
155
+ /**
156
+ * 设置权限资源描述
157
+ */
158
+ setAuthDescription(authDescription) {
159
+ const object = {
160
+ authDescription,
161
+ };
162
+ this.update({
163
+ ...object,
164
+ });
165
+ }
166
+ /**
167
+ * 设置是否是默认跳转的页面
168
+ */
169
+ setIsIndex(isIndex) {
170
+ const object = {
171
+ isIndex,
172
+ };
173
+ this.update({
174
+ ...object,
175
+ });
176
+ }
177
+ _insertViewElementAt(options, index) {
178
+ const viewElementOptions = {};
179
+ const relationOptions = { parentNode: this, parentKey: 'elements' };
180
+ const ViewElement = (0, decorators_1.getConceptConstructor)('ViewElement');
181
+ let viewElement;
182
+ if (!options) {
183
+ viewElement = ViewElement.from({
184
+ ...viewElementOptions,
185
+ name: this.getViewElementUniqueName(),
186
+ }, this, 'elements');
187
+ }
188
+ else if (typeof options === 'string') {
189
+ viewElement = ViewElement.from({
190
+ ...viewElementOptions,
191
+ name: options,
192
+ }, this, 'elements');
193
+ }
194
+ else if (asserts.isViewElement(options)) {
195
+ options.ensureDelete(); // 同一实例不支持多处存在
196
+ viewElement = options;
197
+ Object.assign(viewElement, relationOptions);
198
+ }
199
+ else {
200
+ viewElement = ViewElement.from({
201
+ ...viewElementOptions,
202
+ ...options,
203
+ }, this, 'elements');
204
+ }
205
+ this.elements.splice(index, 0, viewElement);
206
+ return viewElement;
207
+ }
208
+ insertViewElementAt(options, index) {
209
+ const node = this._insertViewElementAt(options, index);
210
+ node.create({
211
+ index,
212
+ parentNode: this,
213
+ parentKey: 'elements',
214
+ });
215
+ return node;
216
+ }
217
+ _addViewElement(options) {
218
+ const index = this.elements.length;
219
+ return this._insertViewElementAt(options, index);
220
+ }
221
+ addViewElement(options) {
222
+ const node = this._addViewElement(options);
223
+ const index = this.elements.indexOf(node);
224
+ node.create({
225
+ index,
226
+ parentNode: this,
227
+ parentKey: 'elements',
228
+ });
229
+ return node;
230
+ }
231
+ getParamUniqueName(name = 'param1') {
232
+ return utils.unique(name, this.getVarExistingNames(), undefined, false);
233
+ }
234
+ _insertParamAt(options, index) {
235
+ const paramOptions = {};
236
+ const relationOptions = { parentNode: this, parentKey: 'params' };
237
+ const Param = (0, decorators_1.getConceptConstructor)('Param');
238
+ let param;
239
+ if (!options) {
240
+ param = Param.from({
241
+ ...paramOptions,
242
+ name: this.getParamUniqueName(),
243
+ }, this, 'params');
244
+ }
245
+ else if (typeof options === 'string') {
246
+ param = Param.from({
247
+ ...paramOptions,
248
+ name: options,
249
+ }, this, 'params');
250
+ }
251
+ else if (asserts.isParam(options)) {
252
+ options.ensureDelete(); // 同一实例不支持多处存在
253
+ param = options;
254
+ Object.assign(param, relationOptions);
255
+ }
256
+ else {
257
+ param = Param.from({
258
+ ...paramOptions,
259
+ ...options,
260
+ }, this, 'params');
261
+ }
262
+ this.params.splice(index, 0, param);
263
+ return param;
264
+ }
265
+ insertParamAt(options, index) {
266
+ const node = this._insertParamAt(options, index);
267
+ node.create({
268
+ index,
269
+ parentNode: this,
270
+ parentKey: 'params',
271
+ });
272
+ return node;
273
+ }
274
+ _addParam(options) {
275
+ const index = this.params.length;
276
+ return this._insertParamAt(options, index);
277
+ }
278
+ addParam(options) {
279
+ const node = this._addParam(options);
280
+ const index = this.params.indexOf(node);
281
+ node.create({
282
+ index,
283
+ parentNode: this,
284
+ parentKey: 'params',
285
+ });
286
+ return node;
287
+ }
288
+ getVariableUniqueName(name = 'variable1') {
289
+ return utils.unique(name, this.getVarExistingNames(), undefined, false);
290
+ }
291
+ _insertVariableAt(options, index) {
292
+ const variableOptions = {};
293
+ const relationOptions = { parentNode: this, parentKey: 'variables' };
294
+ const Variable = (0, decorators_1.getConceptConstructor)('Variable');
295
+ let variable;
296
+ if (!options) {
297
+ variable = Variable.from({
298
+ ...variableOptions,
299
+ name: this.getVariableUniqueName(),
300
+ }, this, 'variables');
301
+ }
302
+ else if (typeof options === 'string') {
303
+ variable = Variable.from({
304
+ ...variableOptions,
305
+ name: options,
306
+ }, this, 'variables');
307
+ }
308
+ else if (asserts.isVariable(options)) {
309
+ options.ensureDelete(); // 同一实例不支持多处存在
310
+ variable = options;
311
+ Object.assign(variable, relationOptions);
312
+ }
313
+ else {
314
+ variable = Variable.from({
315
+ ...variableOptions,
316
+ ...options,
317
+ }, this, 'variables');
318
+ }
319
+ this.variables.splice(index, 0, variable);
320
+ return variable;
321
+ }
322
+ insertVariableAt(options, index) {
323
+ const node = this._insertVariableAt(options, index);
324
+ node.create({
325
+ index,
326
+ parentNode: this,
327
+ parentKey: 'variables',
328
+ });
329
+ return node;
330
+ }
331
+ _addVariable(options) {
332
+ const index = this.variables.length;
333
+ return this._insertVariableAt(options, index);
334
+ }
335
+ addVariable(options) {
336
+ const node = this._addVariable(options);
337
+ const index = this.variables.indexOf(node);
338
+ node.create({
339
+ index,
340
+ parentNode: this,
341
+ parentKey: 'variables',
342
+ });
343
+ return node;
344
+ }
345
+ getLogicUniqueName(name = 'logic1') {
346
+ return utils.unique(name, this.getLogicExistingNames(), undefined, false);
347
+ }
348
+ _insertLogicAt(options, index) {
349
+ const logicOptions = {};
350
+ const relationOptions = { parentNode: this, parentKey: 'logics' };
351
+ const Logic = (0, decorators_1.getConceptConstructor)('Logic');
352
+ let logic;
353
+ if (!options) {
354
+ logic = Logic.from({
355
+ ...logicOptions,
356
+ name: this.getLogicUniqueName(),
357
+ }, this, 'logics');
358
+ }
359
+ else if (typeof options === 'string') {
360
+ logic = Logic.from({
361
+ ...logicOptions,
362
+ name: options,
363
+ }, this, 'logics');
364
+ }
365
+ else if (asserts.isLogic(options)) {
366
+ options.ensureDelete(); // 同一实例不支持多处存在
367
+ logic = options;
368
+ Object.assign(logic, relationOptions);
369
+ }
370
+ else {
371
+ logic = Logic.from({
372
+ ...logicOptions,
373
+ ...options,
374
+ }, this, 'logics');
375
+ }
376
+ this.logics.splice(index, 0, logic);
377
+ return logic;
378
+ }
379
+ insertLogicAt(options, index) {
380
+ const node = this._insertLogicAt(options, index);
381
+ node.create({
382
+ index,
383
+ parentNode: this,
384
+ parentKey: 'logics',
385
+ });
386
+ return node;
387
+ }
388
+ _addLogic(options) {
389
+ const index = this.logics.length;
390
+ return this._insertLogicAt(options, index);
391
+ }
392
+ addLogic(options) {
393
+ const node = this._addLogic(options);
394
+ const index = this.logics.indexOf(node);
395
+ node.create({
396
+ index,
397
+ parentNode: this,
398
+ parentKey: 'logics',
399
+ });
400
+ return node;
401
+ }
402
+ getBindEventExistingNames(excludedList = []) {
403
+ const excludedSet = new Set(excludedList);
404
+ return (this.bindEvents || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
405
+ }
406
+ getBindEventUniqueName(name = 'bindEvent1') {
407
+ return utils.unique(name, this.getBindEventExistingNames(), undefined, false);
408
+ }
409
+ _insertBindEventAt(options, index) {
410
+ const bindEventOptions = {};
411
+ const relationOptions = { parentNode: this, parentKey: 'bindEvents' };
412
+ const BindEvent = (0, decorators_1.getConceptConstructor)('BindEvent');
413
+ let bindEvent;
414
+ if (!options) {
415
+ bindEvent = BindEvent.from({
416
+ ...bindEventOptions,
417
+ name: this.getBindEventUniqueName(),
418
+ }, this, 'bindEvents');
419
+ }
420
+ else if (typeof options === 'string') {
421
+ bindEvent = BindEvent.from({
422
+ ...bindEventOptions,
423
+ name: options,
424
+ }, this, 'bindEvents');
425
+ }
426
+ else if (asserts.isBindEvent(options)) {
427
+ options.ensureDelete(); // 同一实例不支持多处存在
428
+ bindEvent = options;
429
+ Object.assign(bindEvent, relationOptions);
430
+ }
431
+ else {
432
+ bindEvent = BindEvent.from({
433
+ ...bindEventOptions,
434
+ ...options,
435
+ }, this, 'bindEvents');
436
+ }
437
+ this.bindEvents.splice(index, 0, bindEvent);
438
+ return bindEvent;
439
+ }
440
+ insertBindEventAt(options, index) {
441
+ const node = this._insertBindEventAt(options, index);
442
+ node.create({
443
+ index,
444
+ parentNode: this,
445
+ parentKey: 'bindEvents',
446
+ });
447
+ return node;
448
+ }
449
+ _addBindEvent(options) {
450
+ const index = this.bindEvents.length;
451
+ return this._insertBindEventAt(options, index);
452
+ }
453
+ addBindEvent(options) {
454
+ const node = this._addBindEvent(options);
455
+ const index = this.bindEvents.indexOf(node);
456
+ node.create({
457
+ index,
458
+ parentNode: this,
459
+ parentKey: 'bindEvents',
460
+ });
461
+ return node;
462
+ }
463
+ getViewExistingNames(excludedList = []) {
464
+ const excludedSet = new Set(excludedList);
465
+ return (this.children || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
466
+ }
467
+ getViewUniqueName(name = 'view1') {
468
+ return utils.unique(name, this.getViewExistingNames(), undefined, false);
469
+ }
470
+ _insertViewAt(options, index) {
471
+ const viewOptions = {};
472
+ const relationOptions = { parentNode: this, parentKey: 'children' };
473
+ const View = (0, decorators_1.getConceptConstructor)('View');
474
+ let view;
475
+ if (!options) {
476
+ view = View.from({
477
+ ...viewOptions,
478
+ name: this.getViewUniqueName(),
479
+ }, this, 'children');
480
+ }
481
+ else if (typeof options === 'string') {
482
+ view = View.from({
483
+ ...viewOptions,
484
+ name: options,
485
+ }, this, 'children');
486
+ }
487
+ else if (asserts.isView(options)) {
488
+ options.ensureDelete(); // 同一实例不支持多处存在
489
+ view = options;
490
+ Object.assign(view, relationOptions);
491
+ }
492
+ else {
493
+ view = View.from({
494
+ ...viewOptions,
495
+ ...options,
496
+ }, this, 'children');
497
+ }
498
+ this.children.splice(index, 0, view);
499
+ return view;
500
+ }
501
+ insertViewAt(options, index) {
502
+ const node = this._insertViewAt(options, index);
503
+ node.create({
504
+ index,
505
+ parentNode: this,
506
+ parentKey: 'children',
507
+ });
508
+ return node;
509
+ }
510
+ _addView(options) {
511
+ const index = this.children.length;
512
+ return this._insertViewAt(options, index);
513
+ }
514
+ addView(options) {
515
+ const node = this._addView(options);
516
+ const index = this.children.indexOf(node);
517
+ node.create({
518
+ index,
519
+ parentNode: this,
520
+ parentKey: 'children',
521
+ });
522
+ return node;
523
+ }
524
+ removeViewElement(options) {
525
+ let viewElement;
526
+ if (typeof options === 'string') {
527
+ viewElement = this.elements.find((item) => item.name === options);
528
+ if (!viewElement) {
529
+ throw new Error('找不到页面元素 ' + options);
530
+ }
531
+ }
532
+ else {
533
+ viewElement = options;
534
+ }
535
+ return viewElement.delete();
536
+ }
537
+ removeParam(options) {
538
+ let param;
539
+ if (typeof options === 'string') {
540
+ param = this.params.find((item) => item.name === options);
541
+ if (!param) {
542
+ throw new Error('找不到输入参数 ' + options);
543
+ }
544
+ }
545
+ else {
546
+ param = options;
547
+ }
548
+ return param.delete();
549
+ }
550
+ removeVariable(options) {
551
+ let variable;
552
+ if (typeof options === 'string') {
553
+ variable = this.variables.find((item) => item.name === options);
554
+ if (!variable) {
555
+ throw new Error('找不到变量 ' + options);
556
+ }
557
+ }
558
+ else {
559
+ variable = options;
560
+ }
561
+ return variable.delete();
562
+ }
563
+ removeLogic(options) {
564
+ let logic;
565
+ if (typeof options === 'string') {
566
+ logic = this.logics.find((item) => item.name === options);
567
+ if (!logic) {
568
+ throw new Error('找不到逻辑 ' + options);
569
+ }
570
+ }
571
+ else {
572
+ logic = options;
573
+ }
574
+ return logic.delete();
575
+ }
576
+ removeBindEvent(options) {
577
+ let bindEvent;
578
+ if (typeof options === 'string') {
579
+ bindEvent = this.bindEvents.find((item) => item.name === options);
580
+ if (!bindEvent) {
581
+ throw new Error('找不到元素绑定事件 ' + options);
582
+ }
583
+ }
584
+ else {
585
+ bindEvent = options;
586
+ }
587
+ return bindEvent.delete();
588
+ }
589
+ removeView(options) {
590
+ let view;
591
+ if (typeof options === 'string') {
592
+ view = this.children.find((item) => item.name === options);
593
+ if (!view) {
594
+ throw new Error('找不到页面 ' + options);
595
+ }
596
+ }
597
+ else {
598
+ view = options;
599
+ }
600
+ return view.delete();
601
+ }
602
+ //================================================================================
603
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
604
+ // 自动生成的代码已结束。下面可以手动编写。
605
+ //================================================================================
606
+ /**
607
+ * 祖先 Module
608
+ */
609
+ get module() {
610
+ return this.getAncestor('Module');
611
+ }
612
+ /**
613
+ * 祖先 Frontend
614
+ */
615
+ get frontend() {
616
+ return this.getAncestor('Frontend');
617
+ }
618
+ /* 主页面有没有权限 */
619
+ get parentAuth() {
620
+ const _nameSpace = this.getTsNamespace();
621
+ const _nameSpaceArr = _nameSpace.split('.');
622
+ const viewsIndex = _nameSpaceArr.findIndex((item) => item === 'views');
623
+ const mainViewName = _nameSpaceArr[viewsIndex + 1];
624
+ return mainViewName ? this.frontend.views.find((item) => item.name === mainViewName)?.auth : this.auth;
625
+ }
626
+ /**
627
+ * 设置页面权限
628
+ */
629
+ setBindRoles(bindRoles) {
630
+ const object = {
631
+ bindRoles,
632
+ };
633
+ this.update({
634
+ ...object,
635
+ });
636
+ }
637
+ findLogicByName(name) {
638
+ return this.logics.find((logic) => logic.name === name);
639
+ }
640
+ // 收集已经存在的ViewElement
641
+ collectExistingViewElementName(excludedList = []) {
642
+ const excludedSet = new Set(excludedList);
643
+ this.elements.forEach((element) => {
644
+ utils.traverse(({ node }) => {
645
+ if (!excludedSet.has(node)) {
646
+ this.existingViewElement.add(node.name);
647
+ }
648
+ }, {
649
+ node: element,
650
+ });
651
+ });
652
+ }
653
+ // 获取当前页面的所有组件的名字
654
+ getViewElementExistingNames(excludedList = []) {
655
+ if (!this.existingViewElement.size) {
656
+ this.collectExistingViewElementName();
657
+ }
658
+ return Array.from(this.existingViewElement);
659
+ }
660
+ getViewElementUniqueName(name = 'viewElement_1') {
661
+ this.collectExistingViewElementName();
662
+ const BranchCopyUniCode = getBranchCopyUniCode();
663
+ let newName = name;
664
+ const prefix = name.replace(/\d*$/, '');
665
+ if (BranchCopyUniCode && prefix.indexOf(`_${BranchCopyUniCode}_`) === -1) {
666
+ newName = name.replace(/\d*$/, (m) => `_${BranchCopyUniCode}_${m}`);
667
+ }
668
+ // 主分支无 BranchCopyUniCode
669
+ if (!BranchCopyUniCode && prefix?.slice(-1) !== '_') {
670
+ newName = name.replace(/\d*$/, (m) => `_${m}`);
671
+ }
672
+ const newPrefix = newName.replace(/\d*$/, '');
673
+ const newPrefixNum = removedViewElementCache?.[newPrefix] ? removedViewElementCache[newPrefix] : 1;
674
+ const startNum = newPrefixNum < Number.MAX_SAFE_INTEGER ? newPrefixNum + 1 : BigInt(newPrefixNum) + BigInt(1);
675
+ const viewElementUniqueName = utils.uniqueMax(newName, this.existingViewElement, removedViewElementCache?.[newPrefix] ? startNum : newPrefixNum);
676
+ this.existingViewElement.add(viewElementUniqueName);
677
+ return viewElementUniqueName;
678
+ }
679
+ getViewElementUniqueNameOld(name = 'viewElement1') {
680
+ this.collectExistingViewElementName();
681
+ const viewElementUniqueName = utils.unique(name, this.existingViewElement);
682
+ this.existingViewElement.add(viewElementUniqueName);
683
+ return viewElementUniqueName;
684
+ }
685
+ getAllViewElementNames(excludeName) {
686
+ const res = [];
687
+ this.elements.forEach((element) => {
688
+ utils.traverse(({ node }) => {
689
+ if (node.name !== excludeName)
690
+ res.push(node.name);
691
+ }, {
692
+ node: element,
693
+ });
694
+ });
695
+ return Array.from(res);
696
+ }
697
+ // 组件名是否有效
698
+ isValidElementName(name) {
699
+ if (name) {
700
+ return !this.getViewElementExistingNames().find((existingName) => existingName === name);
701
+ }
702
+ return false;
703
+ }
704
+ getViewElementByName(name) {
705
+ let res = null;
706
+ for (let i = 0; i < (this.elements || []).length; i += 1) {
707
+ const element = this.elements[i];
708
+ // eslint-disable-next-line @typescript-eslint/no-loop-func
709
+ utils.traverse(({ node }) => {
710
+ if (node.concept === 'ViewElement' && node.name === name) {
711
+ res = node;
712
+ }
713
+ }, {
714
+ node: element,
715
+ });
716
+ if (res) {
717
+ break;
718
+ }
719
+ }
720
+ return res;
721
+ }
722
+ static { this.TAG_NAME_PREFIX_REG = /^([lieu]|van)[-_]/; }
723
+ mergeBlock({ code, nodePath, position, slotTarget, cb, }) {
724
+ const ViewElement = (0, decorators_1.getConceptConstructor)('ViewElement');
725
+ let template = utils.sliceTagContent(code, 'template');
726
+ if (slotTarget) {
727
+ template = `<template #${slotTarget}>${template}</template>`;
728
+ }
729
+ let targetNode = this.app.findNodeByPath(nodePath);
730
+ let parentNode = position === 'append' ? targetNode : targetNode.parentNode;
731
+ if (parentNode.concept === 'View') {
732
+ parentNode = targetNode;
733
+ if (position === 'insertBefore') {
734
+ targetNode = parentNode.children[0];
735
+ }
736
+ else if (position === 'insertAfter') {
737
+ const len = parentNode.children.length;
738
+ targetNode = parentNode.children[len - 1];
739
+ }
740
+ }
741
+ const definitionStr = utils.sliceTagContent(code, 'definition') || '{}';
742
+ const definition = JSON.parse(definitionStr);
743
+ let node = null;
744
+ if (template) {
745
+ node = ViewElement.fromHTML(template, {
746
+ view: this,
747
+ definition,
748
+ });
749
+ if (!parentNode) {
750
+ return;
751
+ }
752
+ if (position === 'append') {
753
+ parentNode.addViewElement(node);
754
+ cb && cb(parentNode, node);
755
+ }
756
+ else {
757
+ const index = targetNode.getIndexOfParent();
758
+ if (position === 'insertBefore') {
759
+ parentNode.insertViewElementAt(node, index);
760
+ }
761
+ else if (position === 'insertAfter') {
762
+ parentNode.insertViewElementAt(node, index + 1);
763
+ }
764
+ }
765
+ }
766
+ this.mergeDefinitions(code);
767
+ return node;
768
+ }
769
+ mergeDefinitions(code) {
770
+ const Logic = (0, decorators_1.getConceptConstructor)('Logic');
771
+ const Param = (0, decorators_1.getConceptConstructor)('Param');
772
+ const Variable = (0, decorators_1.getConceptConstructor)('Variable');
773
+ const BindEvent = (0, decorators_1.getConceptConstructor)('BindEvent');
774
+ const definitionStr = utils.sliceTagContent(code, 'definition') || '{}';
775
+ const definition = JSON.parse(definitionStr);
776
+ // 服务端逻辑
777
+ if (Array.isArray(definition.logics)) {
778
+ definition.logics.forEach((logicOption) => {
779
+ const logic = Logic.from({
780
+ ...logicOption,
781
+ }, this.rootNode, 'logics');
782
+ this.rootNode.addLogic(logic);
783
+ });
784
+ }
785
+ // 全局结构体
786
+ if (Array.isArray(definition.structures)) {
787
+ definition.structures.forEach((structureOption) => {
788
+ const structure = Structure__1.Structure.from({
789
+ ...structureOption,
790
+ }, this.rootNode, 'structures');
791
+ this.rootNode.addStructure(structure);
792
+ });
793
+ }
794
+ // 页面入参
795
+ if (Array.isArray(definition.viewParams)) {
796
+ definition.viewParams.forEach((paramsOption) => {
797
+ const param = Param.from({
798
+ ...paramsOption,
799
+ }, this, 'params');
800
+ this._addParam(param);
801
+ param.addParamsPrepare();
802
+ });
803
+ }
804
+ // 页面变量
805
+ if (Array.isArray(definition.viewVariables)) {
806
+ definition.viewVariables.forEach((variableOption) => {
807
+ const variable = Variable.from({
808
+ ...variableOption,
809
+ }, this, 'variables');
810
+ this.addVariable(variable);
811
+ });
812
+ }
813
+ // 页面事件
814
+ if (Array.isArray(definition.viewBindEvents)) {
815
+ definition.viewBindEvents.forEach((eventOption) => {
816
+ const newLogic = definition.viewLogics.find((logic) => eventOption.calleeName === logic.name);
817
+ const bindEvent = this.bindEvents.find((currentEventItem) => currentEventItem.name === eventOption.name);
818
+ // 如果没有event对象就先新增一个,如果已经有了就在内部添加logic
819
+ if (!bindEvent) {
820
+ const event = BindEvent.from({
821
+ ...eventOption,
822
+ calleeName: '',
823
+ logics: [newLogic],
824
+ }, this, 'bindEvents');
825
+ this.addBindEvent(event);
826
+ }
827
+ else {
828
+ bindEvent.addLogic(newLogic);
829
+ }
830
+ });
831
+ }
832
+ }
833
+ mergeDefinitions2(code) {
834
+ const Logic = (0, decorators_1.getConceptConstructor)('Logic');
835
+ const Param = (0, decorators_1.getConceptConstructor)('Param');
836
+ const Variable = (0, decorators_1.getConceptConstructor)('Variable');
837
+ const BindEvent = (0, decorators_1.getConceptConstructor)('BindEvent');
838
+ const definitionStr = utils.sliceTagContent(code, 'definition') || '{}';
839
+ const definition = JSON.parse(definitionStr);
840
+ // 服务端逻辑
841
+ if (Array.isArray(definition.logics)) {
842
+ definition.logics.forEach((logicOption) => {
843
+ const logic = Logic.from({
844
+ ...logicOption,
845
+ }, this.rootNode, 'logics');
846
+ this.rootNode.addLogic(logic);
847
+ });
848
+ }
849
+ // 全局结构体
850
+ if (Array.isArray(definition.structures)) {
851
+ definition.structures.forEach((structureOption) => {
852
+ const structure = Structure__1.Structure.from({
853
+ ...structureOption,
854
+ }, this.rootNode, 'structures');
855
+ this.rootNode.addStructure(structure);
856
+ });
857
+ }
858
+ // 页面入参
859
+ if (Array.isArray(definition.viewParams)) {
860
+ definition.viewParams.forEach((paramsOption) => {
861
+ const param = Param.from({
862
+ ...paramsOption,
863
+ }, this, 'params');
864
+ this.addParam(param);
865
+ });
866
+ }
867
+ // 页面变量
868
+ if (Array.isArray(definition.viewVariables)) {
869
+ definition.viewVariables.forEach((variableOption) => {
870
+ const variable = Variable.from({
871
+ ...variableOption,
872
+ }, this, 'variables');
873
+ this.addVariable(variable);
874
+ });
875
+ }
876
+ // 页面事件
877
+ if (Array.isArray(definition.viewBindEvents)) {
878
+ definition.viewBindEvents.forEach((eventOption) => {
879
+ const newLogic = definition.viewLogics.find((logic) => eventOption.calleeName === logic.name);
880
+ const bindEvent = this.bindEvents.find((currentEventItem) => currentEventItem.name === eventOption.name);
881
+ // 如果没有event对象就先新增一个,如果已经有了就在内部添加logic
882
+ if (!bindEvent) {
883
+ const event = BindEvent.from({
884
+ ...eventOption,
885
+ calleeName: '',
886
+ logics: [newLogic],
887
+ }, this, 'bindEvents');
888
+ this.addBindEvent(event);
889
+ }
890
+ else {
891
+ bindEvent.addLogic(newLogic);
892
+ }
893
+ });
894
+ }
895
+ }
896
+ onChange($event) {
897
+ this.emit('change', $event);
898
+ }
899
+ getLogicExistingNames(excludedList = []) {
900
+ const excludedSet = new Set(excludedList);
901
+ const varList = [];
902
+ if (Array.isArray(this.params)) {
903
+ varList.push(...this.params);
904
+ }
905
+ if (Array.isArray(this.variables)) {
906
+ varList.push(...this.variables);
907
+ }
908
+ if (Array.isArray(this.logics)) {
909
+ varList.push(...this.logics);
910
+ }
911
+ if (Array.isArray(this.bindEvents)) {
912
+ this.bindEvents.forEach((bindEvent) => {
913
+ if (Array.isArray(bindEvent.logics)) {
914
+ varList.push(...bindEvent.logics);
915
+ }
916
+ });
917
+ }
918
+ return varList.filter((item) => !excludedSet.has(item)).map((item) => item.name);
919
+ }
920
+ getVarExistingNames(excludedList = []) {
921
+ const excludedSet = new Set(excludedList);
922
+ const varList = [];
923
+ if (Array.isArray(this.params)) {
924
+ varList.push(...this.params);
925
+ }
926
+ if (Array.isArray(this.variables)) {
927
+ varList.push(...this.variables);
928
+ }
929
+ if (Array.isArray(this.logics)) {
930
+ this.logics.forEach((logic) => {
931
+ varList.push(logic);
932
+ if (Array.isArray(logic.params)) {
933
+ varList.push(...logic.params);
934
+ }
935
+ if (Array.isArray(logic.returns)) {
936
+ varList.push(...logic.returns);
937
+ }
938
+ if (Array.isArray(logic.variables)) {
939
+ varList.push(...logic.variables);
940
+ }
941
+ });
942
+ }
943
+ // 事件逻辑的变量不允许和页面逻辑下的重复
944
+ if (Array.isArray(this.elementLogicRoot) && this.elementLogicRoot.length) {
945
+ this.elementLogicRoot[0]?.children.forEach((logic) => {
946
+ if (Array.isArray(logic.variables)) {
947
+ varList.push(...logic.variables);
948
+ }
949
+ });
950
+ }
951
+ this.traverseChildren((node) => {
952
+ switch (node?.concept) {
953
+ case 'ForEachStatement':
954
+ if (node.item) {
955
+ varList.push(node?.item);
956
+ }
957
+ if (node.index) {
958
+ varList.push(node?.index);
959
+ }
960
+ break;
961
+ case 'AnonymousFunction':
962
+ node.params?.forEach((param) => {
963
+ varList.push(param);
964
+ });
965
+ break;
966
+ }
967
+ });
968
+ return varList.filter((item) => !excludedSet.has(item)).map((item) => item.name);
969
+ }
970
+ /**
971
+ * 生成 Vue 中需要的 JS 代码
972
+ * @TODO 这一版先做成 componentOptions 式的,后面再美化
973
+ */
974
+ genScript() {
975
+ const componentList = [];
976
+ const allComponentList = [];
977
+ this.elementsAttrs(this.elements, componentList, allComponentList, -1);
978
+ const routeMeta = this.getRouteMeta();
979
+ const definition = {
980
+ params: this.params,
981
+ variables: this.variables,
982
+ logics: this.logics,
983
+ events: this.bindEvents,
984
+ viewBindEvents: this.getViewBindEvents(),
985
+ viewExpressions: this.getViewExpressions(),
986
+ elements: componentList,
987
+ elementsAll: allComponentList,
988
+ ...routeMeta,
989
+ };
990
+ let code = '';
991
+ let mixin = '';
992
+ const keyboardEventMixinCode = `const keyboardEventMixin = {
993
+ mounted() {
994
+ document.addEventListener('keydown', this.onKeyDown);
995
+ document.addEventListener('keyup', this.onKeyUp);
996
+ },
997
+ beforeDestory() {
998
+ document.removeEventListener('keydown', this.onKeyDown);
999
+ document.removeEventListener('keyup', this.onKeyUp);
1000
+ },
1001
+ methods: {
1002
+ async onKeyDown(e) {
1003
+ ${this.bindEvents
1004
+ .filter((event) => ['keydown'].includes(event.name))
1005
+ .map((event) => `await this.${event.view.name}_${event.name}(e);`)
1006
+ .join('\n')}
1007
+ },
1008
+ async onKeyUp(e) {
1009
+ ${this.bindEvents
1010
+ .filter((event) => ['keyup'].includes(event.name))
1011
+ .map((event) => `await this.${event.view.name}_${event.name}(e);`)
1012
+ .join('\n')}
1013
+ }
1014
+ }
1015
+ };\n`;
1016
+ code += keyboardEventMixinCode;
1017
+ const processDetailFrom = this.getViewProcessForm(), hasProcessDetailFrom = !!processDetailFrom, processV2 = this.getDestinationProcessV2();
1018
+ if (hasProcessDetailFrom) {
1019
+ const processDetailFromMixinCode = `const processDetailFromMixin = {
1020
+ data() {
1021
+ return {
1022
+ processDetailFormData: {},
1023
+ ${processV2.name} : {
1024
+ data: {},
1025
+ },
1026
+ ${processDetailFrom.getBindAttribute('processPrefix')?.value} : {
1027
+ data: {},
1028
+ }
1029
+ }
1030
+ },
1031
+ async mounted() {
1032
+ try {
1033
+ const taskId = this.$route.query.taskId
1034
+ if (!taskId) return
1035
+ // 获取表单定义
1036
+ let templateProcessDetailFrom = await this.$processV2.getProcessFormDefinition({
1037
+ body: { taskId }
1038
+ })
1039
+ templateProcessDetailFrom = templateProcessDetailFrom?.data
1040
+ // 获取表单数据
1041
+ let formData = await this.$processV2.getTaskInstanceForm({ body: { taskId } })
1042
+ formData = formData?.data
1043
+ // 获取流程变量
1044
+ let processVars = await this.$processV2.getProcVariable({ body: { taskId } })
1045
+ processVars = processVars?.data
1046
+ formData = { ...formData, ...processVars }
1047
+ // 获取字段权限
1048
+ let fieldPermission = await this.$processV2.fieldPermissionDetail({ body: { taskId } })
1049
+ fieldPermission = fieldPermission?.data
1050
+ if (fieldPermission && fieldPermission?.length) {
1051
+ const tag = ${this.frontend.type === 'pc' ? `'u-form-item'` : `'van-field'`};
1052
+ fieldPermission.forEach(it => {
1053
+ const key = it.propertyName,
1054
+ value = it.permission
1055
+ if (value === 'hidden') {
1056
+ const fieldStr = ':value.sync="processDetailFormData.data.' + key + '"'
1057
+ // 删除form-item内的元素
1058
+ const fieldStrIndex = templateProcessDetailFrom.indexOf(fieldStr)
1059
+ if (fieldStrIndex > -1) {
1060
+ const formItemEndIndex = templateProcessDetailFrom.indexOf(
1061
+ '</' + tag + '>',
1062
+ fieldStrIndex
1063
+ )
1064
+ if (formItemEndIndex > -1) {
1065
+ const formItemStartIndex = templateProcessDetailFrom.lastIndexOf(
1066
+ '<' + tag,
1067
+ formItemEndIndex
1068
+ )
1069
+ if (formItemStartIndex > -1) {
1070
+ templateProcessDetailFrom =
1071
+ templateProcessDetailFrom.substring(0, formItemStartIndex) +
1072
+ templateProcessDetailFrom.substring(formItemEndIndex + 14)
1073
+ }
1074
+ }
1075
+ }
1076
+ } else if (['readOnly', 'preview'].includes(value)) {
1077
+ templateProcessDetailFrom = templateProcessDetailFrom.replace(
1078
+ ':value.sync="processDetailFormData.data.' + key + '"',
1079
+ ':value.sync="processDetailFormData.data.' + key + '" preview '
1080
+ )
1081
+ }
1082
+ })
1083
+ }
1084
+
1085
+ if (formData) this.processDetailFormData = formData
1086
+ // 使processDetailFormData内每一个key具备双向绑定能力
1087
+ Object.keys(this.processDetailFormData).forEach(key => {
1088
+ this.$set(this.processDetailFormData, key, this.processDetailFormData[key])
1089
+ })
1090
+
1091
+ const container = document.getElementById('dynamicRenderContainer')
1092
+ if (!container) return
1093
+ const vmRoot = this
1094
+ const _self = this
1095
+ const vm = new Vue({
1096
+ template: templateProcessDetailFrom,
1097
+ data() {
1098
+ return {
1099
+ processDetailFormData: _self.processDetailFormData
1100
+ }
1101
+ },
1102
+ methods:{
1103
+ ..._self.$options.methods
1104
+ }
1105
+ }).$mount()
1106
+ var parentElement = container.parentNode
1107
+ const regex = /ref-name="([^"]+)"/;
1108
+ const match = templateProcessDetailFrom.match(regex);
1109
+ parentElement.replaceChild(vm.$el, container)
1110
+ window.__processDetailFromMixinFormVm__ = vm.$refs[match[1]]
1111
+ const processVarsKeys = Object.keys(processVars);
1112
+ const data = {};
1113
+ for (const key in this.processDetailFormData) {
1114
+ if (!processVarsKeys.includes(key)) {
1115
+ data[key] = this.processDetailFormData[key];
1116
+ }
1117
+ }
1118
+ window.__processDetailFromMixinFormData__ = data;
1119
+ } catch (error) {
1120
+ console.warn('processDetailFromMixin warn', error)
1121
+ }
1122
+ }
1123
+ }; \n`;
1124
+ code += processDetailFromMixinCode;
1125
+ }
1126
+ if (this.script) {
1127
+ mixin = this.script.trim().replace(/export default |module\.exports +=/, 'const mixin = ');
1128
+ }
1129
+ if (mixin) {
1130
+ code += mixin;
1131
+ }
1132
+ code += 'export default {\n';
1133
+ code += 'mixins: [';
1134
+ const mixins = [];
1135
+ // mixin
1136
+ if (mixin) {
1137
+ mixins.push('mixin');
1138
+ }
1139
+ // 键盘事件mixin
1140
+ mixins.push('keyboardEventMixin');
1141
+ if (hasProcessDetailFrom)
1142
+ mixins.push('processDetailFromMixin');
1143
+ code += mixins.join(',');
1144
+ code += '],';
1145
+ code += (0, utils_2.translator)(definition, this);
1146
+ code += '};\n';
1147
+ return code;
1148
+ }
1149
+ genVueTemplate(options) {
1150
+ return this.elements?.map((element) => `${element?.toVue(options)}\n`).join('');
1151
+ }
1152
+ /**
1153
+ * 转换成 Vue 文件
1154
+ */
1155
+ toVue(options) {
1156
+ let result = '';
1157
+ result += `<template>\n${this.genVueTemplate(options)}\n</template>\n`;
1158
+ result += `<script>\n${this.genScript()}\n</script>\n`;
1159
+ return result;
1160
+ }
1161
+ /**
1162
+ * 转换成设计器中使用的 Vue template 内容
1163
+ * @param options
1164
+ */
1165
+ genDesignerVueTemplate() {
1166
+ return this.elements.map((element) => `${element.toDesignerVue()}\n`).join('');
1167
+ }
1168
+ /**
1169
+ * 转换成设计器中使用的 Vue 文件
1170
+ * 目前不需要 script 和 style
1171
+ * @param options
1172
+ */
1173
+ toDesignerVue() {
1174
+ return `<template>\n${this.genDesignerVueTemplate()}</template>`;
1175
+ }
1176
+ /**
1177
+ * 转换成 VueOptions
1178
+ * @TODO 后面 template 可以优化成 render 函数
1179
+ */
1180
+ toVueOptions(options) {
1181
+ return {
1182
+ template: this.genVueTemplate(options),
1183
+ script: this.genScript(),
1184
+ };
1185
+ }
1186
+ /**
1187
+ * 生成宿主语言的文件路径
1188
+ * @param name 一般不用传,用于 rename
1189
+ */
1190
+ getEmbeddedFilePath(name = this.name) {
1191
+ let pathName = name;
1192
+ let parent = this.parentNode;
1193
+ if (parent) {
1194
+ while (parent && asserts.isView(parent)) {
1195
+ pathName = `${parent.name}/${pathName}`;
1196
+ parent = parent.parentNode;
1197
+ }
1198
+ }
1199
+ return `/embedded/${this.getAncestor('App')?.name}/frontendTypes/${this.getAncestor('FrontendType')?.name}/frontends/${this.getAncestor('Frontend')?.name}/views/${pathName}.ts`;
1200
+ }
1201
+ getNamespace() {
1202
+ if (this.parentNode && this.parentNode.getNamespace) {
1203
+ const parentNamespace = this.parentNode.getNamespace();
1204
+ const parentName = this.parentNode.name;
1205
+ const arr = [parentNamespace];
1206
+ if (this.parentNode.concept !== 'App' && parentName) {
1207
+ arr.push(parentName);
1208
+ }
1209
+ return `${arr.join('.')}.views`;
1210
+ }
1211
+ throw new Error('无法获取命名空间,请设置 parentNode!');
1212
+ }
1213
+ getTsNamespace() {
1214
+ const parentNodeNamespace = this.getNamespace();
1215
+ let tsCalleeNamespace = parentNodeNamespace.replace(/\.[0-9]/g, (m) => m.replace('.', '.$'));
1216
+ tsCalleeNamespace = tsCalleeNamespace.replace(/-/g, '_');
1217
+ return tsCalleeNamespace;
1218
+ }
1219
+ // 获取当前element,铺平
1220
+ elementsMethods(elements, allMethods, parentNodeNames) {
1221
+ if (elements) {
1222
+ elements.forEach((item) => {
1223
+ const { bindAttrs = [], name } = item;
1224
+ const isDataSource = bindAttrs.some((attr) => attr.name === 'dataSource');
1225
+ const isInclude = parentNodeNames.includes(name);
1226
+ allMethods.push(item);
1227
+ if (item.children) {
1228
+ if (isDataSource) {
1229
+ if (isInclude) {
1230
+ this.elementsMethods(item.children, allMethods, parentNodeNames);
1231
+ }
1232
+ }
1233
+ else {
1234
+ this.elementsMethods(item.children, allMethods, parentNodeNames);
1235
+ }
1236
+ }
1237
+ });
1238
+ }
1239
+ }
1240
+ // 获取当前element,铺平
1241
+ elementsAttrs(elements, componentList, allComponentList, currentIndex) {
1242
+ if (elements) {
1243
+ elements.forEach((item) => {
1244
+ let index = currentIndex ?? -1;
1245
+ if (item.tag === 'template' && item.haveScope()) {
1246
+ index += 1;
1247
+ }
1248
+ if (exports.ComponentCompletionPropertyMap[item.tag]) {
1249
+ componentList.push(item);
1250
+ }
1251
+ item.currentIndex = index;
1252
+ allComponentList.push(item);
1253
+ if (item.children.length > 0) {
1254
+ this.elementsAttrs(item.children, componentList, allComponentList, index);
1255
+ }
1256
+ });
1257
+ }
1258
+ }
1259
+ // 获取指向该页面的流程
1260
+ getDestinationProcessV2() {
1261
+ const processV2 = this.app?.processV2s || [];
1262
+ let res;
1263
+ const isM = this.frontend?.type === 'h5';
1264
+ processV2.forEach((process) => {
1265
+ const elements = [...process.elements];
1266
+ process.historyProcesses.forEach((historyProcess) => {
1267
+ elements.push(...historyProcess.elements);
1268
+ });
1269
+ elements.forEach((element) => {
1270
+ const attr = element?.bindAttrs?.find((it) => it.name === `destination-${isM ? 'm' : 'pc'}`);
1271
+ if (this.getNamespace() === attr?.destination?.viewNamespace && attr?.destination.viewName === this.name) {
1272
+ res = process;
1273
+ }
1274
+ });
1275
+ });
1276
+ return res;
1277
+ }
1278
+ getDestinationProcessV2Element() {
1279
+ const processV2 = this.app?.processV2s || [];
1280
+ let res;
1281
+ const isM = this.frontend?.type === 'h5';
1282
+ processV2.forEach((process) => {
1283
+ const elements = [...process.elements];
1284
+ process.historyProcesses.forEach((historyProcess) => {
1285
+ elements.push(...historyProcess.elements);
1286
+ });
1287
+ elements.forEach((element) => {
1288
+ const attr = element?.bindAttrs?.find((it) => it.name === `destination-${isM ? 'm' : 'pc'}`);
1289
+ if (this.getNamespace() === attr?.destination?.viewNamespace && attr?.destination.viewName === this.name) {
1290
+ res = element;
1291
+ }
1292
+ });
1293
+ });
1294
+ return res;
1295
+ }
1296
+ *toEmbeddedTS(state = (0, nasl_translator_1.createCompilerState)()) {
1297
+ const self = this;
1298
+ // 获取所有子节点用于树上填充
1299
+ self.getSubLogics();
1300
+ function chineseTsName(name) {
1301
+ let tsName = name;
1302
+ // 匹配所有特殊字符都转为_
1303
+ tsName = tsName.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, '_');
1304
+ return tsName;
1305
+ }
1306
+ // 获取虚拟logic的参数和内容
1307
+ // 用作展示和tots查找引用
1308
+ self.getElementLogicRoot();
1309
+ let code = `export namespace ${self.tsName} {\n`;
1310
+ /** 获取跳转链接声明 */
1311
+ function* getDestinationCode() {
1312
+ if (Array.isArray(self.params)) {
1313
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}export declare function $destination(options: {`;
1314
+ yield* (0, utils_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param, index) {
1315
+ code += `${param.name}?: `;
1316
+ code += yield* param.typeAnnotation.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code));
1317
+ code += ', ';
1318
+ });
1319
+ // 锚点
1320
+ code += `_anchor?: nasl.core.String`;
1321
+ code += '}): void;\n';
1322
+ }
1323
+ }
1324
+ // 只需要声明的时候只要有跳转链接就够了
1325
+ if (state.onlyDeclaration) {
1326
+ yield* getDestinationCode();
1327
+ code += '}\n';
1328
+ return code;
1329
+ }
1330
+ // 角色
1331
+ if (Array.isArray(self.bindRoles) && self.bindRoles.length) {
1332
+ code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
1333
+ code += 'export let __bindRoles = [\n';
1334
+ yield* (0, utils_1.wrapForEachToGenerator)(self.bindRoles, function* warpForEachGenerator(role) {
1335
+ code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
1336
+ code += `${self.app.getNamespace()}.roles.${chineseTsName(role)}.${chineseTsName(role)},`;
1337
+ code += '\n';
1338
+ });
1339
+ code += '\n';
1340
+ code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
1341
+ code += '];\n';
1342
+ }
1343
+ // 需要类型推导的局部变量/返回值需要调整申明顺序
1344
+ const advanceMap = new Map();
1345
+ const callFunctionAdvanceMap = new Map();
1346
+ yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
1347
+ if (el &&
1348
+ // 批量赋值
1349
+ (asserts.isBatchAssignment(el) ||
1350
+ // 赋值
1351
+ (asserts.isAssignment(el) && el.left?.name) ||
1352
+ // 内置函数对集合类型的推导
1353
+ (asserts.isCallFunction(el) && el.derivablecollection?.name))) {
1354
+ if (el?.getAncestor('SubLogic')) {
1355
+ return;
1356
+ }
1357
+ // 子页面内部逻辑过滤
1358
+ if (el.view !== self)
1359
+ return;
1360
+ if (asserts.isAssignment(el)) {
1361
+ // 需要被推导的赋值左侧
1362
+ const expression = el.left;
1363
+ const advanceVar = self.variables?.find((variable) => {
1364
+ return !variable.typeAnnotation && expression?.name === variable.name;
1365
+ });
1366
+ if (advanceVar && !advanceMap.get(advanceVar)) {
1367
+ advanceMap.set(advanceVar, el);
1368
+ }
1369
+ }
1370
+ else if (asserts.isCallFunction(el)) {
1371
+ // 需要被推导的集合
1372
+ const expression = el.derivablecollection;
1373
+ const advanceVar = self.variables?.find((variable) => {
1374
+ return !variable.typeAnnotation && expression?.name === variable.name;
1375
+ });
1376
+ if (advanceVar && !callFunctionAdvanceMap.get(advanceVar)) {
1377
+ callFunctionAdvanceMap.set(advanceVar, el);
1378
+ }
1379
+ }
1380
+ else if (asserts.isBatchAssignment(el)) {
1381
+ yield* (0, utils_1.wrapForEachToGenerator)(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
1382
+ const leftCode = leftIndex.length === 1
1383
+ ? yield* el.left?.expression?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
1384
+ (0, utils_1.returnOrigin)('')
1385
+ : yield* el.left?.members[leftIndex[1]]?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
1386
+ (0, utils_1.returnOrigin)('');
1387
+ const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && leftCode === variable.name);
1388
+ if (advanceVar && !advanceMap.get(advanceVar)) {
1389
+ advanceMap.set(advanceVar, el);
1390
+ }
1391
+ });
1392
+ }
1393
+ }
1394
+ });
1395
+ // 用来储存默认值翻译结构是__IDENTIFIER__或者__IDENTIFIER__()的节点
1396
+ const IDENTIFIERMAP = new Set();
1397
+ if (Array.isArray(self.params)) {
1398
+ yield* (0, utils_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param) {
1399
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1400
+ code += yield* param.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1401
+ code += ';\n';
1402
+ });
1403
+ }
1404
+ if (Array.isArray(self.variables)) {
1405
+ yield* (0, utils_1.wrapForEachToGenerator)(self.variables, function* warpForEachGenerator(variable) {
1406
+ const ts = yield* variable.defaultValue?.toEmbeddedTS?.() ?? (0, utils_1.returnOrigin)('');
1407
+ if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
1408
+ IDENTIFIERMAP.add(variable);
1409
+ }
1410
+ if (!advanceMap.get(variable) && !callFunctionAdvanceMap.get(variable)) {
1411
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1412
+ code += yield* variable.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1413
+ code += ';\n';
1414
+ }
1415
+ });
1416
+ }
1417
+ // 变量提升
1418
+ state.isVariableHost = true;
1419
+ yield* (0, utils_1.wrapIteratorToGenerator)(advanceMap.entries(), function* warpForEachGenerator([variable, assignment]) {
1420
+ // 有默认值的用默认值来推导类型, 但是如果是__IDENTIFIER__或者__IDENTIFIER__(),就不需要默认值来推导了
1421
+ if (variable.defaultValue?.expression && !IDENTIFIERMAP.has(variable)) {
1422
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1423
+ code += yield* variable.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1424
+ return;
1425
+ }
1426
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}// @ts-ignore\n`;
1427
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1428
+ code += yield* variable.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1429
+ if (asserts.isBatchAssignment(assignment)) {
1430
+ code += ' = ';
1431
+ yield* (0, utils_1.wrapForEachToGenerator)(assignment.assignmentLines, function* warpForEachGenerator({ leftIndex, rightIndex }) {
1432
+ const leftCode = leftIndex.length === 1
1433
+ ? yield* assignment.left.expression.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }))
1434
+ : yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
1435
+ (0, utils_1.returnOrigin)('');
1436
+ if (leftCode === variable.name) {
1437
+ const rightNode = rightIndex.length === 1
1438
+ ? assignment.rights[rightIndex[0]]?.expression
1439
+ : assignment.rights[rightIndex[0]]?.members[rightIndex[1]];
1440
+ const rightCode = yield* rightNode?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
1441
+ (0, utils_1.returnOrigin)('');
1442
+ code += yield* self.getRightCode(rightCode, assignment, rightNode);
1443
+ }
1444
+ });
1445
+ }
1446
+ else {
1447
+ code += ' = ';
1448
+ let rightCode = '';
1449
+ // 因为右侧枚举要赋值就得new 一下;
1450
+ if (assignment.right &&
1451
+ asserts.isIdentifier(assignment.right) &&
1452
+ assignment.right.namespace &&
1453
+ assignment.right.namespace.endsWith('enums')) {
1454
+ rightCode += 'new ';
1455
+ }
1456
+ rightCode +=
1457
+ assignment.right && assignment.right.toEmbeddedTS
1458
+ ? yield* assignment.right.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }))
1459
+ : '__RIGHT__';
1460
+ code += yield* self.getRightCode(rightCode, assignment, assignment.right);
1461
+ }
1462
+ code += ';\n';
1463
+ });
1464
+ yield* (0, utils_1.wrapIteratorToGenerator)(callFunctionAdvanceMap.entries(), function* warpForEachGenerator([node, assignment]) {
1465
+ //
1466
+ if (advanceMap.get(node)) {
1467
+ return;
1468
+ }
1469
+ // 有默认值的用默认值来推导类型, 但是如果是__IDENTIFIER__或者__IDENTIFIER__(),就不需要默认值来推导了
1470
+ if (node.defaultValue?.expression && !IDENTIFIERMAP.has(node)) {
1471
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1472
+ code += yield* node.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1473
+ return;
1474
+ }
1475
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}// @ts-ignore\n`;
1476
+ yield* (0, utils_1.wrapForEachToGenerator)([
1477
+ {
1478
+ key: 'key',
1479
+ node: assignment.keyOfCollection,
1480
+ },
1481
+ {
1482
+ key: 'item',
1483
+ node: assignment.itemOfCollection,
1484
+ },
1485
+ ], function* warpForEachGenerator({ key, node: itemNode }) {
1486
+ if (itemNode) {
1487
+ code += `const __${key}_${node?.name} = `;
1488
+ const itemCode = yield* itemNode?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
1489
+ (0, utils_1.returnOrigin)('');
1490
+ code += yield* self.getRightCode(itemCode, assignment, itemNode);
1491
+ code += ';\n';
1492
+ }
1493
+ });
1494
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1495
+ code += yield* node.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1496
+ const nodeName = node?.name;
1497
+ const keyNode = assignment.keyOfCollection;
1498
+ const itemNode = assignment.itemOfCollection;
1499
+ if (assignment.isDerivableMap && keyNode && itemNode) {
1500
+ code += `: nasl.collection.Map<typeof __key_${nodeName}, typeof __item_${nodeName}>`;
1501
+ }
1502
+ else if (assignment.isDerivableList && itemNode) {
1503
+ code += `: nasl.collection.List<typeof __item_${nodeName}>;`;
1504
+ }
1505
+ code += ';\n';
1506
+ });
1507
+ // 变量提升结束
1508
+ delete state.isVariableHost;
1509
+ // elements类型声明定义
1510
+ code += `interface IElements {\n`;
1511
+ // 生成所有的name和类型定义
1512
+ yield* (0, utils_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(element) {
1513
+ code += yield* element.toEmbeddedTSDefinition((0, nasl_translator_1.shiftState)(state, code, {
1514
+ tabSize: (state?.tabSize || 0) + 1,
1515
+ }));
1516
+ });
1517
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}}\n`;
1518
+ code += `let __elements: IElements;\n`;
1519
+ const elementsPathMap = {};
1520
+ // 深度遍历拿到element path
1521
+ if (Array.isArray(self.elements)) {
1522
+ self.elements.forEach((item) => {
1523
+ item.toEmbeddedTSRefPath(elementsPathMap);
1524
+ });
1525
+ }
1526
+ if (Array.isArray(self.elements)) {
1527
+ // elementsRefTree
1528
+ code += `function elementsRefTree() {\n`;
1529
+ code += `return {\n`;
1530
+ code += `children: {\n`;
1531
+ yield* (0, utils_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(item) {
1532
+ code += yield* item.toEmbeddedTSRefTree((0, nasl_translator_1.shiftState)(state, code, { inline: true }), { elementsPathMap });
1533
+ });
1534
+ code += `},\n`;
1535
+ code += `};\n`;
1536
+ code += `};\n`;
1537
+ code += `const __elementsRef = {\n`;
1538
+ // eslint-disable-next-line no-restricted-syntax, guard-for-in
1539
+ for (const key in elementsPathMap) {
1540
+ const pathStr = elementsPathMap[key];
1541
+ const pathArr = pathStr.split('.');
1542
+ const path = pathArr.reduce((prev, cur) => {
1543
+ return `${prev}.children.${cur}()`;
1544
+ }, 'elementsRefTree()');
1545
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}${key}: ${path},\n`;
1546
+ }
1547
+ code += `};\n`;
1548
+ }
1549
+ // 逻辑
1550
+ if (Array.isArray(self.logics) && self.logics.length) {
1551
+ code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
1552
+ yield* (0, utils_1.wrapForEachToGenerator)(self.logics, function* warpForEachGenerator(logic) {
1553
+ code += yield* logic.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, {
1554
+ tabSize: (state?.tabSize || 0) + 2,
1555
+ }), 'noExport');
1556
+ code += '\n';
1557
+ });
1558
+ code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
1559
+ }
1560
+ // 事件
1561
+ if (Array.isArray(self.bindEvents)) {
1562
+ yield* (0, utils_1.wrapForEachToGenerator)(self.bindEvents, function* warpForEachGenerator(event) {
1563
+ code += yield* event.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, {
1564
+ tabSize: state?.tabSize || 0,
1565
+ }), true);
1566
+ code += '\n';
1567
+ });
1568
+ }
1569
+ // render函数
1570
+ code += `\n${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}`;
1571
+ code += `export function __render(`;
1572
+ code += `){\n`;
1573
+ code += (0, nasl_translator_1.indent)(state?.tabSize || 0);
1574
+ // elements 元素
1575
+ if (Array.isArray(self.elements)) {
1576
+ // 生成嵌套式的内容
1577
+ yield* (0, utils_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(element) {
1578
+ code += yield* element.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, {
1579
+ tabSize: (state?.tabSize || 0) + 3,
1580
+ }));
1581
+ code += '\n';
1582
+ });
1583
+ }
1584
+ code += `\n${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}}\n`;
1585
+ yield* getDestinationCode();
1586
+ /* 默认值草稿区 ---------------------------*/
1587
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}export function __playground(){\n`;
1588
+ /* 参数的默认值是__IDENTIFIER__或者__IDENTIFIER__()时不赋默认值,但是需要ts翻译出来进行报错校验 */
1589
+ for (const node of IDENTIFIERMAP.values()) {
1590
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 2)}`;
1591
+ code += yield* node.defaultValue.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1592
+ code += '; ';
1593
+ }
1594
+ code += '\n';
1595
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 2)}return\n`;
1596
+ function* setPlaygroundCode(arr, name) {
1597
+ if (arr.length) {
1598
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}/* -----以下是 ${name} 的默认值草稿------ */\n`;
1599
+ }
1600
+ for (const item1 of arr) {
1601
+ for (const item of item1.defaultValue?.playground ?? []) {
1602
+ code += yield* item.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
1603
+ code += ';\n';
1604
+ }
1605
+ }
1606
+ }
1607
+ yield* setPlaygroundCode(self.variables, 'variables');
1608
+ yield* setPlaygroundCode(self.params, 'params');
1609
+ code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}}\n`;
1610
+ code += `${(0, nasl_translator_1.indent)(state?.tabSize || 0)}}\n`;
1611
+ return code;
1612
+ }
1613
+ toNaturalTS(state = (0, nasl_translator_1.createCompilerState)(), callback) {
1614
+ const viewName = state.rename ?? this.tsName;
1615
+ let code = '';
1616
+ if (state.declaration) {
1617
+ code += `export function ${viewName}_view`;
1618
+ // 有参数长度
1619
+ code += '(';
1620
+ this.params.forEach((param, index) => {
1621
+ code += param.toNaturalTS((0, nasl_translator_1.shiftState)(state, code, { tabSize: 0 }));
1622
+ if (index !== this.params.length - 1)
1623
+ code += ', ';
1624
+ });
1625
+ code += ') {';
1626
+ if (state.convertChildren && this.children?.length) {
1627
+ code += '\n';
1628
+ this.children.forEach((child) => {
1629
+ code += child.toNaturalTS((0, nasl_translator_1.shiftState)(state, code, { tabSize: state?.tabSize || 0 + 1 }), callback);
1630
+ code += '\n';
1631
+ });
1632
+ }
1633
+ code += '}';
1634
+ }
1635
+ else {
1636
+ code += `export function ${viewName}_view`;
1637
+ // 有参数长度
1638
+ code += '(';
1639
+ this.params.forEach((param, index) => {
1640
+ code += param.toNaturalTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1641
+ if (index !== this.params.length - 1)
1642
+ code += ', ';
1643
+ });
1644
+ code += ')';
1645
+ code += ' {\n';
1646
+ this.variables.forEach((variable) => {
1647
+ code += `${(0, nasl_translator_1.indent)(state.tabSize + 1)}let `;
1648
+ code += variable.toNaturalTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1649
+ code += ';\n';
1650
+ });
1651
+ if (this.variables.length)
1652
+ code += '\n';
1653
+ if (callback) {
1654
+ code += callback.call(this, state);
1655
+ }
1656
+ else {
1657
+ code += this.elements[0].toNaturalTS((0, nasl_translator_1.shiftState)(state, code, { tabSize: state.tabSize + 1 }));
1658
+ }
1659
+ code += `\n${(0, nasl_translator_1.indent)(state.tabSize)}}\n`;
1660
+ }
1661
+ return code;
1662
+ }
1663
+ toTextualNASL(state = (0, nasl_translator_1.createCompilerState)(), callback) {
1664
+ const viewName = state.rename ?? this.tsName;
1665
+ let code = '';
1666
+ code += (0, nasl_translator_1.createDecoratorCode)(state, this, [
1667
+ 'pageTemplateId',
1668
+ 'uuid',
1669
+ 'title',
1670
+ 'crumb',
1671
+ 'auth',
1672
+ 'authDescription',
1673
+ 'isIndex',
1674
+ ]);
1675
+ if (state.declaration) {
1676
+ code += `declare view ${viewName}`;
1677
+ // 有参数长度
1678
+ code += '(';
1679
+ this.params.forEach((param, index) => {
1680
+ code += param.toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { tabSize: 0 }));
1681
+ if (index !== this.params.length - 1)
1682
+ code += ', ';
1683
+ });
1684
+ code += ') {';
1685
+ if (state.convertChildren && this.children?.length) {
1686
+ this.children.forEach((child) => {
1687
+ code += child.toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { tabSize: state?.tabSize || 0 + 1 }), callback);
1688
+ code += '\n';
1689
+ });
1690
+ }
1691
+ code += '}';
1692
+ }
1693
+ else {
1694
+ code += `view ${viewName}`;
1695
+ // 有参数长度
1696
+ code += '(';
1697
+ this.params.forEach((param, index) => {
1698
+ code += param.toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1699
+ if (index !== this.params.length - 1)
1700
+ code += ', ';
1701
+ });
1702
+ code += ')';
1703
+ code += ' {\n';
1704
+ this.variables.forEach((variable) => {
1705
+ code += `${(0, nasl_translator_1.indent)(state.tabSize + 1)}let `;
1706
+ code += variable.toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
1707
+ code += ';\n';
1708
+ });
1709
+ if (this.variables.length)
1710
+ code += '\n';
1711
+ if (callback) {
1712
+ code += callback.call(this, state);
1713
+ }
1714
+ else {
1715
+ code += this.elements[0].toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { tabSize: state.tabSize + 1 }));
1716
+ }
1717
+ code += `\n${(0, nasl_translator_1.indent)(state.tabSize)}}\n`;
1718
+ }
1719
+ return code;
1720
+ }
1721
+ *toEmbeddedTSFile() {
1722
+ let code = `namespace ${this.getTsNamespace()} {\n`;
1723
+ const state = (0, nasl_translator_1.createCompilerState)(code, {
1724
+ tabSize: 1,
1725
+ });
1726
+ try {
1727
+ code += yield* this.toEmbeddedTS(state);
1728
+ }
1729
+ catch (err) {
1730
+ code += '';
1731
+ console.log(err);
1732
+ }
1733
+ code += '}\n';
1734
+ return {
1735
+ code,
1736
+ filePath: this.getEmbeddedFilePath(),
1737
+ sourceMap: state.sourceMap,
1738
+ };
1739
+ }
1740
+ toEmbeddedDeclarationTSFile() {
1741
+ let code = `namespace ${this.getNamespace()} {\n`;
1742
+ try {
1743
+ code += utils.runGeneratorSync(this.toEmbeddedTS((0, nasl_translator_1.createCompilerState)(code, {
1744
+ tabSize: 1,
1745
+ onlyDeclaration: true,
1746
+ })));
1747
+ }
1748
+ catch (err) {
1749
+ code += '\n';
1750
+ }
1751
+ code += '}\n';
1752
+ return {
1753
+ code,
1754
+ filePath: this.getEmbeddedFilePath(),
1755
+ };
1756
+ }
1757
+ // IDE内展示需要屏蔽掉“系统统一路径前缀”
1758
+ get uiPath() {
1759
+ const { basePath } = this.frontend;
1760
+ const _path = [];
1761
+ let view = this;
1762
+ while (view.concept === 'View') {
1763
+ _path.push(view.name);
1764
+ view = view.parentNode;
1765
+ }
1766
+ let path = '/';
1767
+ if (_path.length) {
1768
+ path += `${_path.reverse().join('/')}`;
1769
+ }
1770
+ return `${basePath}${path}`;
1771
+ }
1772
+ get path() {
1773
+ const { prefixPath } = this.frontend;
1774
+ const _path = [];
1775
+ let view = this;
1776
+ while (view.concept === 'View') {
1777
+ _path.push(view.name);
1778
+ view = view.parentNode;
1779
+ }
1780
+ let path = '/';
1781
+ if (_path.length) {
1782
+ path += `${_path.reverse().join('/')}`;
1783
+ }
1784
+ return `${prefixPath}${path}`;
1785
+ }
1786
+ /**
1787
+ * 权限领域的资源路径
1788
+ */
1789
+ get authPath() {
1790
+ return this.path;
1791
+ }
1792
+ getElementLogicRoot() {
1793
+ const Param = (0, decorators_1.getConceptConstructor)('Param');
1794
+ const logics = [];
1795
+ // 页面上的绑定的事件
1796
+ this.bindEvents.forEach((bindEvent) => {
1797
+ bindEvent.logics.forEach((logic) => {
1798
+ // 键盘事件
1799
+ if (['keydown', 'keyup'].includes(bindEvent.name)) {
1800
+ logic.virtualParams = [
1801
+ Param.from({
1802
+ name: 'event',
1803
+ typeAnnotation: null,
1804
+ }, logic, 'virtualParams'),
1805
+ ];
1806
+ }
1807
+ // 生命周期没有event
1808
+ logics.push(logic);
1809
+ });
1810
+ });
1811
+ this.elements.forEach((item) => {
1812
+ utils.traverse((current) => {
1813
+ current.node.bindEvents.forEach((bindEvent) => {
1814
+ bindEvent.logics.forEach((logic) => {
1815
+ if (!logic?.name || logic?.name?.startsWith('__')) {
1816
+ return;
1817
+ }
1818
+ // 绑定参数才有 event 的 current
1819
+ logic.virtualParams = bindEvent.getContextRenderLogicParams(logic);
1820
+ logics.push(logic);
1821
+ });
1822
+ });
1823
+ }, { node: item });
1824
+ });
1825
+ if (logics.length) {
1826
+ const expanded = (this.elementLogicRoot.length && this.elementLogicRoot[0].expanded) || false;
1827
+ this.elementLogicRoot = [
1828
+ {
1829
+ concept: 'elementLogicRoot',
1830
+ expanded,
1831
+ children: logics,
1832
+ },
1833
+ ];
1834
+ }
1835
+ else {
1836
+ this.elementLogicRoot = [];
1837
+ }
1838
+ }
1839
+ getViewBindEvents() {
1840
+ const bindEvents = [];
1841
+ // 页面上的绑定的事件
1842
+ this.bindEvents.forEach((bindEvent) => {
1843
+ bindEvents.push(bindEvent);
1844
+ });
1845
+ this.elements.forEach((item) => {
1846
+ utils.traverse((current) => {
1847
+ current.node.bindEvents.forEach((bindEvent) => {
1848
+ bindEvents.push(bindEvent);
1849
+ });
1850
+ }, { node: item });
1851
+ });
1852
+ return bindEvents;
1853
+ }
1854
+ // 获取页面上需要替换的表达式
1855
+ getViewExpressions() {
1856
+ const bindExpressions = [];
1857
+ this.elements.forEach((item) => {
1858
+ utils.traverse((current) => {
1859
+ const { node } = current;
1860
+ const playgroundNodePath = (node?.nodePath || '').split('.').find((nodePathNode) => {
1861
+ return nodePathNode.match(/(.+)\[.+\]/)?.[1] === 'playground';
1862
+ });
1863
+ if (!playgroundNodePath) {
1864
+ //// 处理三种情况
1865
+ //if (
1866
+ // ['BindAttribute', 'BindDirective', 'BindStyle'].includes(node.concept)
1867
+ // && node.needReplaceWithIdentifier
1868
+ //) {
1869
+ // bindExpressions.push(node);
1870
+ //}
1871
+ if (node?.concept === 'Match') {
1872
+ bindExpressions.push(node);
1873
+ }
1874
+ }
1875
+ }, {
1876
+ node: item,
1877
+ }, {
1878
+ mode: 'anyObject',
1879
+ depthFirst: true,
1880
+ excludedKeySet: new Set([
1881
+ 'bindEvents',
1882
+ 'parentNode',
1883
+ 'sourceMap',
1884
+ 'storageJSON',
1885
+ 'tsErrorDetail',
1886
+ 'NaslAnnotatedJSON',
1887
+ 'calledFrom',
1888
+ '_events',
1889
+ '_collectingList',
1890
+ '_historyList',
1891
+ ]),
1892
+ });
1893
+ });
1894
+ return bindExpressions;
1895
+ }
1896
+ /**
1897
+ * @param path 子路径
1898
+ * 比如当前页面路径为:/dashboard
1899
+ * path 为要查找子路径:如 /student/list、student/list
1900
+ */
1901
+ findViewByPath(path) {
1902
+ const arr = path.split('/');
1903
+ if (arr[0] === '')
1904
+ arr.shift();
1905
+ if (!arr.length)
1906
+ return this;
1907
+ const childName = arr.shift();
1908
+ const subView = this.children.find((child) => child.name === childName);
1909
+ return arr.length ? subView.findViewByPath(arr.join('/')) : subView;
1910
+ }
1911
+ findViewByName(name) {
1912
+ return utils.traverse((current) => {
1913
+ if (current.node.name === name)
1914
+ return current.node;
1915
+ }, { node: this });
1916
+ }
1917
+ findElementByName(name) {
1918
+ return this.elements[0]?.findElementByName(name);
1919
+ }
1920
+ findElementByTag(tag) {
1921
+ return this.elements[0]?.findElementByTag(tag);
1922
+ }
1923
+ findElementByAttr(name, value) {
1924
+ return this.elements[0]?.findElementByAttr(name, value);
1925
+ }
1926
+ _setAsIndexView(isIndex) {
1927
+ let views = [];
1928
+ if (this.parentNode.concept !== 'View') {
1929
+ views = this.parentNode.views;
1930
+ }
1931
+ else if (this.parentNode.concept === 'View') {
1932
+ views = this.parentNode.children;
1933
+ }
1934
+ if (views.length) {
1935
+ if (this.isIndex !== isIndex) {
1936
+ this.setIsIndex(isIndex);
1937
+ }
1938
+ // 设为默认跳转页时,将之前的默认跳转页取消设置
1939
+ if (isIndex) {
1940
+ views.forEach((view) => {
1941
+ if (view !== this && view.id !== this.id && view.isIndex) {
1942
+ view.setIsIndex(false);
1943
+ }
1944
+ });
1945
+ }
1946
+ }
1947
+ }
1948
+ setAsIndexView(isIndex) {
1949
+ let actionMsg = `设置页面“${this.name}”为默认跳转页`;
1950
+ if (this.parentNode.concept !== 'View') {
1951
+ actionMsg = `设置页面“${this.name}”为首页`;
1952
+ }
1953
+ this.rootNode.emit('collect:start', {
1954
+ actionMsg,
1955
+ });
1956
+ this._setAsIndexView(isIndex);
1957
+ this.rootNode.emit('collect:end');
1958
+ }
1959
+ removeExistingViewElement(viewElement) {
1960
+ if (this.existingViewElement.has(viewElement.name)) {
1961
+ this.existingViewElement.delete(viewElement.name);
1962
+ }
1963
+ const prefix = viewElement?.name.replace(/\d*$/, '');
1964
+ let lastDigit = viewElement?.name.match(/\d+$/)?.[0];
1965
+ if (lastDigit === undefined)
1966
+ return;
1967
+ //@ts-ignore
1968
+ lastDigit = lastDigit < Number.MAX_SAFE_INTEGER ? parseInt(lastDigit) : BigInt(lastDigit);
1969
+ if (removedViewElementCache?.[prefix]) {
1970
+ //@ts-ignore
1971
+ if (lastDigit > removedViewElementCache[prefix])
1972
+ //@ts-ignore
1973
+ removedViewElementCache[prefix] = lastDigit;
1974
+ }
1975
+ else {
1976
+ //@ts-ignore
1977
+ removedViewElementCache[prefix] = lastDigit;
1978
+ }
1979
+ }
1980
+ *getRightCode(code, assignment, rightNode) {
1981
+ code = code.replaceAll('\n', ' ');
1982
+ // 赋值语句的右侧或者集合内置函数的参数
1983
+ if ((asserts.isAssignment(assignment) && !assignment.right) ||
1984
+ (asserts.isCallFunction(assignment) &&
1985
+ ((assignment.isDerivableList && !assignment.itemOfCollection) ||
1986
+ (assignment.isDerivableMap && !(assignment.keyOfCollection && assignment.itemOfCollection))))) {
1987
+ return code;
1988
+ }
1989
+ const { logic } = assignment;
1990
+ const logicRtn = logic?.returns[0];
1991
+ // 调用接口,参数替换成 null
1992
+ if (asserts.isCallInterface(rightNode)) {
1993
+ const { _interface } = rightNode.getModuleInterface();
1994
+ return _interface
1995
+ ? `${rightNode.tsCalleeKey}(${_interface.params.map(() => 'null').join(',')})`
1996
+ : null;
1997
+ }
1998
+ // 调用服务端逻辑,参数替换成 null
1999
+ if (asserts.isCallLogic(rightNode) && rightNode.calleeNamespace === 'app.logics') {
2000
+ const calleeName = rightNode?.calleeName;
2001
+ const calleeLogic = this.app.logics.find((l) => l.name === calleeName);
2002
+ return calleeLogic ? `app.logics.${calleeName}(${calleeLogic.params.map(() => 'null').join(',')})` : null;
2003
+ }
2004
+ // 调用依赖库逻辑可能会有子逻辑,子逻辑拼接可能有ts忽略先去掉
2005
+ if (asserts.isCallLogic(rightNode) && rightNode.calleeNamespace?.startsWith('extensions.')) {
2006
+ code = code.replaceAll('// @ts-ignore', '');
2007
+ }
2008
+ // view 局部变量,申明提升前增加判断,使用 logic 内的 result 直接替换成对应 logic,logic 内部变量替换成 null
2009
+ if (logicRtn && code.includes(logicRtn.name)) {
2010
+ if (code === logicRtn.name)
2011
+ return `${logic.name}(${logic.params.map(() => 'null').join(',')})`;
2012
+ code = this.handleReplaceCode(code, logicRtn.name, `${logic.name}(${logic.params.map(() => 'null').join(',')})`);
2013
+ logic.params.forEach((param) => {
2014
+ if (code.includes(param.name))
2015
+ code = this.handleReplaceCode(code, param.name, 'null');
2016
+ });
2017
+ logic.variables.forEach((variable) => {
2018
+ if (code.includes(variable.name))
2019
+ code = this.handleReplaceCode(code, variable.name, 'null');
2020
+ });
2021
+ return code;
2022
+ }
2023
+ // 处理 current.item、current1.item 等数据
2024
+ if (/current(\d)*\.item/.test(code)) {
2025
+ code = yield* this.handleCurrentItemCode(code, logic);
2026
+ return code;
2027
+ }
2028
+ // 直接赋值 logic 内局部变量、输入参数直接提示系统无法推断类型
2029
+ const useLogicVar = logic.params.find((param) => code.includes(param.name)) ||
2030
+ logic.variables.find((variable) => code.includes(variable.name));
2031
+ return useLogicVar ? 'null' : code;
2032
+ }
2033
+ handleReplaceCode(code, variable, replaceCode) {
2034
+ return code.replace(/\S+/g, ($1) => {
2035
+ if ($1 === `${variable},`)
2036
+ return `${replaceCode},`;
2037
+ if ($1 === variable)
2038
+ return replaceCode;
2039
+ let fnCode = $1;
2040
+ if ($1.startsWith(`${variable}.`))
2041
+ fnCode = $1.replaceAll(`${variable}.`, `${replaceCode}.`);
2042
+ if ($1.startsWith(`${variable},`))
2043
+ fnCode = $1.replaceAll(`${variable},`, `${replaceCode},`);
2044
+ if ($1.includes(`(${variable},`))
2045
+ fnCode = $1.replaceAll(`(${variable},`, `(${replaceCode},`);
2046
+ if ($1.includes(`(${variable}.`))
2047
+ fnCode = $1.replaceAll(`(${variable}.`, `(${replaceCode}.`);
2048
+ if ($1.includes(`(${variable})`))
2049
+ fnCode = $1.replaceAll(`(${variable})`, `(${replaceCode})`);
2050
+ if ($1.includes(`,${variable},`))
2051
+ fnCode = $1.replaceAll(`,${variable},`, `,${replaceCode},`);
2052
+ if ($1.includes(`,${variable}.`))
2053
+ fnCode = $1.replaceAll(`,${variable}.`, `,${replaceCode}.`);
2054
+ if ($1.includes(`,${variable})`))
2055
+ fnCode = $1.replaceAll(`,${variable})`, `,${replaceCode})`);
2056
+ return fnCode;
2057
+ });
2058
+ }
2059
+ getAncestorViewElementsWithDataSource(logic) {
2060
+ let element = logic;
2061
+ const viewElements = [];
2062
+ while (element) {
2063
+ if (element.concept &&
2064
+ element.concept === 'ViewElement' &&
2065
+ element.bindAttrs.find((bAttr) => bAttr.name === 'dataSource')) {
2066
+ viewElements.push(element);
2067
+ }
2068
+ element = element.parentNode;
2069
+ }
2070
+ return viewElements;
2071
+ }
2072
+ *handleCurrentItemCode(code, logic) {
2073
+ const viewElementsWithDataSource = this.getAncestorViewElementsWithDataSource(logic);
2074
+ yield* (0, utils_1.wrapForEachToGenerator)(viewElementsWithDataSource, function* wrapForEach(viewElement, index) {
2075
+ const currentIndex = viewElementsWithDataSource.length - 1 - index;
2076
+ const currentItemCode = `current${currentIndex === 0 ? '' : currentIndex}.item`;
2077
+ if (code.includes(currentItemCode)) {
2078
+ const dataSource = viewElement.bindAttrs.find((bAttr) => bAttr.name === 'dataSource');
2079
+ if (dataSource) {
2080
+ const view = viewElement.getAncestor('View');
2081
+ const dataSourceTS = yield* dataSource.expression.toEmbeddedTS();
2082
+ const logic = view.logics.find((logic) => logic.name === dataSourceTS);
2083
+ if (logic) {
2084
+ code = code.replaceAll(currentItemCode, `nasl.ui.getCurrentItemType(${dataSourceTS}(${logic.params.map(() => 'null').join(',')}))`);
2085
+ }
2086
+ else {
2087
+ const variable = view.variables.find((variable) => variable.name === dataSourceTS);
2088
+ code = code.replaceAll(currentItemCode, `nasl.ui.getCurrentItemType(${variable ? variable.name : dataSourceTS})`);
2089
+ }
2090
+ }
2091
+ }
2092
+ });
2093
+ return code;
2094
+ }
2095
+ /**
2096
+ * 该视图是否有子页面容器
2097
+ */
2098
+ hasRouterView() {
2099
+ let res = false;
2100
+ utils.traverse((current) => {
2101
+ if (current.node.tag === 'u-router-view' || current.node.tag === 'van-router-view') {
2102
+ res = true;
2103
+ }
2104
+ }, { node: { children: this.elements } });
2105
+ return res;
2106
+ }
2107
+ getViewCallLogics() {
2108
+ const callbackLogics = [];
2109
+ this.traverseChildren((el) => {
2110
+ if (asserts.isIdentifier(el) && el.namespace?.endsWith('logics')) {
2111
+ callbackLogics.push(`${el.namespace}.${el.name}`);
2112
+ }
2113
+ });
2114
+ return callbackLogics;
2115
+ }
2116
+ getViewProcessForm() {
2117
+ let res;
2118
+ const excludedKeySet = new Set([
2119
+ 'parentNode',
2120
+ 'sourceMap',
2121
+ 'storageJSON',
2122
+ 'tsErrorDetail',
2123
+ 'NaslAnnotatedJSON',
2124
+ 'calledFrom',
2125
+ '_events',
2126
+ '_collectingList',
2127
+ '_historyList',
2128
+ ]);
2129
+ utils.traverse(({ node }) => {
2130
+ if (node?.isProcessForm?.()) {
2131
+ res = node;
2132
+ }
2133
+ }, { node: this.elements[0] }, { mode: 'onlyChildren', excludedKeySet });
2134
+ return res;
2135
+ }
2136
+ getViewProcessComponent(componentName) {
2137
+ let res;
2138
+ const excludedKeySet = new Set([
2139
+ 'parentNode',
2140
+ 'sourceMap',
2141
+ 'storageJSON',
2142
+ 'tsErrorDetail',
2143
+ 'NaslAnnotatedJSON',
2144
+ 'calledFrom',
2145
+ '_events',
2146
+ '_collectingList',
2147
+ '_historyList',
2148
+ ]);
2149
+ utils.traverse(({ node }) => {
2150
+ if (node.tag === componentName) {
2151
+ res = node;
2152
+ }
2153
+ }, { node: this.elements[0] }, { mode: 'onlyChildren', excludedKeySet });
2154
+ return res;
2155
+ }
2156
+ getRouteMeta() {
2157
+ return {
2158
+ title: this.title,
2159
+ crumb: this.crumb?.value,
2160
+ crumbI18n: this.frontend?.i18nInfo?.enabled && this.crumb?.i18nKey ? this.crumb?.i18nKey : undefined,
2161
+ first: this.children.find((child) => child.isIndex)?.name,
2162
+ auth: this.auth ? 'loginAuth' : undefined,
2163
+ };
2164
+ }
2165
+ getSubLogics() {
2166
+ const subLogics = this.findNaslNodeByBFS((node) => {
2167
+ if (asserts.isSubLogic(node)) {
2168
+ // 仅仅是为了处理数据源中的子逻辑,Logic 下面的,交由Logic 自己处理
2169
+ if (node?.getAncestor('Logic')) {
2170
+ return false;
2171
+ }
2172
+ return true;
2173
+ }
2174
+ });
2175
+ this.subLogics = subLogics;
2176
+ }
2177
+ collectExistSubLogic() {
2178
+ const existSubLogics = [];
2179
+ this.findNaslNodeByBFS((node) => {
2180
+ if (asserts.isSubLogic(node)) {
2181
+ existSubLogics.push(node);
2182
+ }
2183
+ return false;
2184
+ });
2185
+ return existSubLogics;
2186
+ }
2187
+ // 获取当前逻辑中已经存在的子逻辑名称
2188
+ getSubLogicExistingNames(excludedList = []) {
2189
+ if (!this.existingSubLogic.size) {
2190
+ const subLogics = this.collectExistSubLogic();
2191
+ subLogics.forEach((subLogic) => {
2192
+ if (!excludedList.includes(subLogic)) {
2193
+ this.existingSubLogic.add(subLogic.name);
2194
+ }
2195
+ });
2196
+ }
2197
+ return Array.from(this.existingSubLogic);
2198
+ }
2199
+ getSubLogicUniqueName(name = 'subLogic1', excludedNames = []) {
2200
+ const existingNames = this.getSubLogicExistingNames();
2201
+ const uniqueName = utils.unique(name, existingNames.concat(excludedNames), undefined, false);
2202
+ this.existingSubLogic.add(uniqueName);
2203
+ return uniqueName;
2204
+ }
2205
+ };
2206
+ exports.View = View;
2207
+ __decorate([
2208
+ (0, decorators_1.property)()
2209
+ // @ts-ignore
2210
+ ], View.prototype, "concept", void 0);
2211
+ __decorate([
2212
+ (0, decorators_1.property)()
2213
+ ], View.prototype, "pageTemplateId", void 0);
2214
+ __decorate([
2215
+ (0, decorators_1.property)()
2216
+ ], View.prototype, "name", void 0);
2217
+ __decorate([
2218
+ (0, decorators_1.property)()
2219
+ ], View.prototype, "uuid", void 0);
2220
+ __decorate([
2221
+ (0, decorators_1.property)()
2222
+ ], View.prototype, "title", void 0);
2223
+ __decorate([
2224
+ (0, decorators_1.property)({
2225
+ objectRef: 'StaticString',
2226
+ })
2227
+ ], View.prototype, "crumb", void 0);
2228
+ __decorate([
2229
+ (0, decorators_1.property)()
2230
+ ], View.prototype, "auth", void 0);
2231
+ __decorate([
2232
+ (0, decorators_1.property)()
2233
+ ], View.prototype, "authDescription", void 0);
2234
+ __decorate([
2235
+ (0, decorators_1.property)()
2236
+ ], View.prototype, "isIndex", void 0);
2237
+ __decorate([
2238
+ (0, decorators_1.property)()
2239
+ ], View.prototype, "template", void 0);
2240
+ __decorate([
2241
+ (0, decorators_1.property)()
2242
+ ], View.prototype, "script", void 0);
2243
+ __decorate([
2244
+ (0, decorators_1.property)()
2245
+ ], View.prototype, "style", void 0);
2246
+ __decorate([
2247
+ (0, decorators_1.property)({
2248
+ objectRef: 'ViewElement',
2249
+ isArray: true,
2250
+ defaultValue: [],
2251
+ })
2252
+ ], View.prototype, "elements", void 0);
2253
+ __decorate([
2254
+ (0, decorators_1.property)({
2255
+ objectRef: 'Param',
2256
+ isArray: true,
2257
+ defaultValue: null,
2258
+ })
2259
+ ], View.prototype, "params", void 0);
2260
+ __decorate([
2261
+ (0, decorators_1.property)({
2262
+ objectRef: 'Variable',
2263
+ isArray: true,
2264
+ defaultValue: [],
2265
+ })
2266
+ ], View.prototype, "variables", void 0);
2267
+ __decorate([
2268
+ (0, decorators_1.property)({
2269
+ objectRef: 'Logic',
2270
+ isArray: true,
2271
+ defaultValue: [],
2272
+ })
2273
+ ], View.prototype, "logics", void 0);
2274
+ __decorate([
2275
+ (0, decorators_1.property)({
2276
+ objectRef: 'BindEvent',
2277
+ isArray: true,
2278
+ defaultValue: [],
2279
+ })
2280
+ ], View.prototype, "bindEvents", void 0);
2281
+ __decorate([
2282
+ (0, decorators_1.property)({
2283
+ isArray: true,
2284
+ defaultValue: [],
2285
+ })
2286
+ ], View.prototype, "bindRoles", void 0);
2287
+ __decorate([
2288
+ (0, decorators_1.property)({
2289
+ objectRef: 'View',
2290
+ isArray: true,
2291
+ defaultValue: [],
2292
+ })
2293
+ ], View.prototype, "children", void 0);
2294
+ __decorate([
2295
+ nasl_translator_1.withSourceMapGenerator
2296
+ ], View.prototype, "toEmbeddedTS", null);
2297
+ __decorate([
2298
+ (0, nasl_translator_1.withSourceMap)()
2299
+ ], View.prototype, "toNaturalTS", null);
2300
+ __decorate([
2301
+ (0, nasl_translator_1.withSourceMap)()
2302
+ ], View.prototype, "toTextualNASL", null);
2303
+ exports.View = View = View_1 = __decorate([
2304
+ (0, decorators_1.concept)('页面')
2305
+ ], View);
2306
+ exports.default = View;
2307
+ // 不再使用
2308
+ exports.PAGE_COMPONENT_INCLUDE_TAG_MAP = {
2309
+ 'u-list-view': {
2310
+ pageSize: {
2311
+ value: 'size',
2312
+ label: '分页大小',
2313
+ },
2314
+ pageNumber: {
2315
+ value: 'page',
2316
+ label: '当前页数',
2317
+ },
2318
+ dataSource: {
2319
+ value: 'data',
2320
+ label: '数据',
2321
+ },
2322
+ },
2323
+ 'u-grid-view': {
2324
+ pageSize: {
2325
+ value: 'size',
2326
+ label: '分页大小',
2327
+ },
2328
+ pageNumber: {
2329
+ value: 'page',
2330
+ label: '当前页数',
2331
+ },
2332
+ dataSource: {
2333
+ value: 'data',
2334
+ label: '数据',
2335
+ },
2336
+ },
2337
+ 'u-list-components': {
2338
+ dataSource: {
2339
+ value: 'data',
2340
+ label: '数据',
2341
+ },
2342
+ },
2343
+ 'u-table-view': {
2344
+ pageSize: {
2345
+ value: 'size',
2346
+ label: '分页大小',
2347
+ },
2348
+ pageNumber: {
2349
+ value: 'page',
2350
+ label: '当前页数',
2351
+ },
2352
+ sorting: {
2353
+ value: 'sort',
2354
+ label: '排序属性',
2355
+ },
2356
+ value: {
2357
+ value: 'value',
2358
+ label: '单选选中值',
2359
+ },
2360
+ values: {
2361
+ value: 'values',
2362
+ label: '多选选中值',
2363
+ },
2364
+ dataSource: {
2365
+ value: 'data',
2366
+ label: '数据',
2367
+ },
2368
+ },
2369
+ 'u-radios': {
2370
+ value: {
2371
+ value: 'value',
2372
+ label: '选中值',
2373
+ },
2374
+ dataSource: {
2375
+ value: 'data',
2376
+ label: '数据',
2377
+ },
2378
+ },
2379
+ 'u-checkboxes': {
2380
+ value: {
2381
+ value: 'value',
2382
+ label: '选中值',
2383
+ },
2384
+ dataSource: {
2385
+ value: 'data',
2386
+ label: '数据',
2387
+ },
2388
+ },
2389
+ 'u-select': {
2390
+ value: {
2391
+ value: 'value',
2392
+ label: '选中值',
2393
+ },
2394
+ dataSource: {
2395
+ value: 'data',
2396
+ label: '数据',
2397
+ },
2398
+ opened: {
2399
+ value: 'opened',
2400
+ label: '弹出状态',
2401
+ },
2402
+ pageSize: {
2403
+ value: 'size',
2404
+ label: '分页大小',
2405
+ },
2406
+ pageNumber: {
2407
+ value: 'page',
2408
+ label: '当前页数',
2409
+ },
2410
+ },
2411
+ 'u-cascader': {
2412
+ value: {
2413
+ value: 'value',
2414
+ label: '选中值',
2415
+ },
2416
+ dataSource: {
2417
+ value: 'data',
2418
+ label: '数据',
2419
+ },
2420
+ },
2421
+ 'u-tree-select-new': {
2422
+ value: {
2423
+ value: 'value',
2424
+ label: '选中值',
2425
+ },
2426
+ dataSource: {
2427
+ value: 'data',
2428
+ label: '数据',
2429
+ },
2430
+ },
2431
+ 'van-radio-group': {
2432
+ value: {
2433
+ value: 'value',
2434
+ label: '选中值',
2435
+ },
2436
+ dataSource: {
2437
+ value: 'data',
2438
+ label: '数据',
2439
+ },
2440
+ },
2441
+ 'van-checkbox-group': {
2442
+ value: {
2443
+ value: 'value',
2444
+ label: '选中值',
2445
+ },
2446
+ dataSource: {
2447
+ value: 'data',
2448
+ label: '数据',
2449
+ },
2450
+ },
2451
+ 'van-pickerson': {
2452
+ pvalue: {
2453
+ value: 'value',
2454
+ label: '选中值',
2455
+ },
2456
+ dataSource: {
2457
+ value: 'data',
2458
+ label: '数据',
2459
+ },
2460
+ pageSize: {
2461
+ value: 'size',
2462
+ label: '分页大小',
2463
+ },
2464
+ pageNumber: {
2465
+ value: 'page',
2466
+ label: '当前页数',
2467
+ },
2468
+ },
2469
+ 'van-cascader': {
2470
+ value: {
2471
+ value: 'value',
2472
+ label: '选中值',
2473
+ },
2474
+ dataSource: {
2475
+ value: 'data',
2476
+ label: '数据',
2477
+ },
2478
+ },
2479
+ 'van-list-view': {
2480
+ pageSize: {
2481
+ value: 'size',
2482
+ label: '分页大小',
2483
+ },
2484
+ pageNumber: {
2485
+ value: 'page',
2486
+ label: '当前页数',
2487
+ },
2488
+ dataSource: {
2489
+ value: 'data',
2490
+ label: '数据',
2491
+ },
2492
+ },
2493
+ 'van-grid-view': {
2494
+ pageSize: {
2495
+ value: 'size',
2496
+ label: '分页大小',
2497
+ },
2498
+ pageNumber: {
2499
+ value: 'page',
2500
+ label: '当前页数',
2501
+ },
2502
+ dataSource: {
2503
+ value: 'data',
2504
+ label: '数据',
2505
+ },
2506
+ },
2507
+ 'van-for-components': {
2508
+ dataSource: {
2509
+ value: 'data',
2510
+ label: '数据',
2511
+ },
2512
+ },
2513
+ };
2514
+ /**
2515
+ * 组件支持补全取值的属性映射
2516
+ * prop 组件属性
2517
+ * state 组件内部状态
2518
+ */
2519
+ exports.ComponentCompletionPropertyMap = {
2520
+ // h5
2521
+ 'van-list-view': {
2522
+ page: {
2523
+ prop: 'pageNumber',
2524
+ state: 'paging?.number',
2525
+ label: '当前页数',
2526
+ },
2527
+ size: {
2528
+ prop: 'pageSize',
2529
+ state: 'paging?.size',
2530
+ label: '分页大小',
2531
+ },
2532
+ filterText: {
2533
+ prop: 'filterText',
2534
+ state: 'filterText',
2535
+ label: '过滤文本',
2536
+ },
2537
+ data: {
2538
+ prop: 'dataSource',
2539
+ state: 'currentData',
2540
+ label: '数据',
2541
+ },
2542
+ },
2543
+ 'van-grid-view': {
2544
+ page: {
2545
+ prop: 'pageNumber',
2546
+ state: 'paging?.number',
2547
+ label: '当前页数',
2548
+ },
2549
+ size: {
2550
+ prop: 'pageSize',
2551
+ state: 'paging?.size',
2552
+ label: '分页大小',
2553
+ },
2554
+ filterText: {
2555
+ prop: 'filterText',
2556
+ state: 'filterText',
2557
+ label: '过滤文本',
2558
+ },
2559
+ data: {
2560
+ prop: 'dataSource',
2561
+ state: 'currentData',
2562
+ label: '数据',
2563
+ },
2564
+ },
2565
+ 'van-for-components': {
2566
+ data: {
2567
+ prop: 'dataSource',
2568
+ state: 'options',
2569
+ label: '数据',
2570
+ },
2571
+ },
2572
+ 'van-pickerson': {
2573
+ value: {
2574
+ prop: 'value',
2575
+ state: 'value',
2576
+ label: '选中值',
2577
+ },
2578
+ page: {
2579
+ prop: 'pageNumber',
2580
+ state: 'paging?.number',
2581
+ label: '当前页数',
2582
+ },
2583
+ size: {
2584
+ prop: 'pageSize',
2585
+ state: 'paging?.size',
2586
+ label: '分页大小',
2587
+ },
2588
+ filterText: {
2589
+ prop: 'filterText',
2590
+ state: 'filterText',
2591
+ label: '过滤文本',
2592
+ },
2593
+ data: {
2594
+ prop: 'dataSource',
2595
+ state: 'currentData',
2596
+ label: '数据',
2597
+ },
2598
+ },
2599
+ 'van-cascader': {
2600
+ value: {
2601
+ prop: 'value',
2602
+ state: 'value',
2603
+ label: '选中值',
2604
+ },
2605
+ filterText: {
2606
+ prop: 'filterText',
2607
+ state: 'filterText',
2608
+ label: '过滤文本',
2609
+ },
2610
+ },
2611
+ 'van-radio-group': {
2612
+ value: {
2613
+ prop: 'value',
2614
+ state: 'value',
2615
+ label: '选中值',
2616
+ },
2617
+ data: {
2618
+ prop: 'dataSource',
2619
+ state: 'options',
2620
+ label: '数据',
2621
+ },
2622
+ },
2623
+ 'van-checkbox-group': {
2624
+ value: {
2625
+ prop: 'value',
2626
+ state: 'value',
2627
+ label: '选中值',
2628
+ },
2629
+ data: {
2630
+ prop: 'dataSource',
2631
+ state: 'options',
2632
+ label: '数据',
2633
+ },
2634
+ },
2635
+ // pc
2636
+ 'u-table-view': {
2637
+ page: {
2638
+ prop: 'pageNumber',
2639
+ state: 'paging?.number',
2640
+ label: '当前页数',
2641
+ },
2642
+ size: {
2643
+ prop: 'pageSize',
2644
+ state: 'paging?.size',
2645
+ label: '分页大小',
2646
+ },
2647
+ sort: {
2648
+ prop: 'sorting',
2649
+ state: 'currentSorting?.field',
2650
+ label: '排序属性',
2651
+ },
2652
+ order: {
2653
+ prop: 'sorting',
2654
+ state: 'currentSorting?.order',
2655
+ label: '排序方式',
2656
+ },
2657
+ data: {
2658
+ prop: 'dataSource',
2659
+ state: 'currentData',
2660
+ label: '数据',
2661
+ },
2662
+ },
2663
+ 'u-grid-view': {
2664
+ page: {
2665
+ prop: 'pageNumber',
2666
+ state: 'paging?.number',
2667
+ label: '当前页数',
2668
+ },
2669
+ size: {
2670
+ prop: 'pageSize',
2671
+ state: 'paging?.size',
2672
+ label: '分页大小',
2673
+ },
2674
+ data: {
2675
+ prop: 'dataSource',
2676
+ state: 'currentData',
2677
+ label: '数据',
2678
+ },
2679
+ },
2680
+ 'u-list-view': {
2681
+ page: {
2682
+ prop: 'pageNumber',
2683
+ state: 'paging?.number',
2684
+ label: '当前页数',
2685
+ },
2686
+ size: {
2687
+ prop: 'pageSize',
2688
+ state: 'paging?.size',
2689
+ label: '分页大小',
2690
+ },
2691
+ filterText: {
2692
+ prop: 'filterText',
2693
+ state: 'filterText',
2694
+ label: '过滤文本',
2695
+ },
2696
+ },
2697
+ 'u-list-components': {
2698
+ data: {
2699
+ prop: 'dataSource',
2700
+ state: 'options',
2701
+ label: '数据',
2702
+ },
2703
+ },
2704
+ 'u-radios': {
2705
+ value: {
2706
+ prop: 'value',
2707
+ state: 'value',
2708
+ label: '选中值',
2709
+ },
2710
+ data: {
2711
+ prop: 'dataSource',
2712
+ state: 'currentDataSource?.data',
2713
+ label: '数据',
2714
+ },
2715
+ },
2716
+ 'u-checkboxes': {
2717
+ value: {
2718
+ prop: 'value',
2719
+ state: 'value',
2720
+ label: '选中值',
2721
+ },
2722
+ data: {
2723
+ prop: 'dataSource',
2724
+ state: 'currentDataSource?.data',
2725
+ label: '数据',
2726
+ },
2727
+ },
2728
+ 'u-select': {
2729
+ value: {
2730
+ prop: 'value',
2731
+ state: 'value',
2732
+ label: '选中值',
2733
+ },
2734
+ page: {
2735
+ prop: 'pageNumber',
2736
+ state: 'paging?.number',
2737
+ label: '当前页数',
2738
+ },
2739
+ size: {
2740
+ prop: 'pageSize',
2741
+ state: 'paging?.size',
2742
+ label: '分页大小',
2743
+ },
2744
+ filterText: {
2745
+ prop: 'filterText',
2746
+ state: 'filterText',
2747
+ label: '过滤文本',
2748
+ },
2749
+ data: {
2750
+ prop: 'dataSource',
2751
+ state: 'currentData',
2752
+ label: '数据',
2753
+ },
2754
+ opened: {
2755
+ prop: 'opened',
2756
+ state: 'popperOpened',
2757
+ label: '弹出状态',
2758
+ },
2759
+ },
2760
+ 'u-cascader': {
2761
+ value: {
2762
+ prop: 'value',
2763
+ state: 'value',
2764
+ label: '选中值',
2765
+ },
2766
+ filterText: {
2767
+ prop: 'filterText',
2768
+ state: 'filterText',
2769
+ label: '过滤文本',
2770
+ },
2771
+ data: {
2772
+ prop: 'dataSource',
2773
+ state: 'currentData',
2774
+ label: '数据',
2775
+ },
2776
+ },
2777
+ 'u-tree-select-new': {
2778
+ value: {
2779
+ prop: 'value',
2780
+ state: 'value',
2781
+ label: '选中值',
2782
+ },
2783
+ data: {
2784
+ prop: 'dataSource',
2785
+ state: 'currentDataSource?.data',
2786
+ label: '数据',
2787
+ },
2788
+ },
2789
+ // react-pc
2790
+ Table: {
2791
+ current: {
2792
+ prop: 'pageNumber',
2793
+ label: '当前页数',
2794
+ },
2795
+ pageSize: {
2796
+ prop: 'pageSize',
2797
+ label: '分页大小',
2798
+ },
2799
+ sorter: {
2800
+ prop: 'sorting',
2801
+ label: '排序属性',
2802
+ },
2803
+ data: {
2804
+ prop: 'dataSource',
2805
+ state: 'currentData',
2806
+ label: '数据',
2807
+ },
2808
+ order: {
2809
+ prop: 'sorting',
2810
+ label: '排序方式',
2811
+ },
2812
+ filter: {
2813
+ prop: 'filter',
2814
+ label: '筛选条件',
2815
+ },
2816
+ },
2817
+ List: {
2818
+ current: {
2819
+ prop: 'pageNumber',
2820
+ state: 'paging?.number',
2821
+ label: '当前页数',
2822
+ },
2823
+ pageSize: {
2824
+ prop: 'pageSize',
2825
+ state: 'paging?.size',
2826
+ label: '分页大小',
2827
+ },
2828
+ filterText: {
2829
+ prop: 'filterText',
2830
+ state: 'filterText',
2831
+ label: '过滤文本',
2832
+ },
2833
+ },
2834
+ Radios: {
2835
+ value: {
2836
+ prop: 'value',
2837
+ state: 'value',
2838
+ label: '选中值',
2839
+ },
2840
+ data: {
2841
+ prop: 'dataSource',
2842
+ state: 'currentDataSource?.data',
2843
+ label: '数据',
2844
+ },
2845
+ },
2846
+ CheckboxGroup: {
2847
+ value: {
2848
+ prop: 'value',
2849
+ label: '选中值',
2850
+ },
2851
+ data: {
2852
+ prop: 'dataSource',
2853
+ label: '数据',
2854
+ },
2855
+ },
2856
+ Select: {
2857
+ value: {
2858
+ prop: 'value',
2859
+ label: '选中值',
2860
+ },
2861
+ data: {
2862
+ prop: 'dataSource',
2863
+ label: '数据',
2864
+ },
2865
+ opened: {
2866
+ prop: 'opened',
2867
+ label: '弹出状态',
2868
+ },
2869
+ },
2870
+ Cascader: {
2871
+ value: {
2872
+ prop: 'value',
2873
+ label: '选中值',
2874
+ },
2875
+ data: {
2876
+ prop: 'dataSource',
2877
+ label: '数据',
2878
+ },
2879
+ },
2880
+ Tree: {
2881
+ value: {
2882
+ prop: 'value',
2883
+ label: '选中值',
2884
+ },
2885
+ data: {
2886
+ prop: 'dataSource',
2887
+ label: '数据',
2888
+ },
2889
+ },
2890
+ };
2891
+ exports.FrontendTypeComponentNamePerfixMap = {
2892
+ h5: 'van-',
2893
+ pc: 'u-',
2894
+ };
2895
+ function getComponentNameFromElementName(name, frontendType = 'pc') {
2896
+ const prefix = exports.FrontendTypeComponentNamePerfixMap[frontendType];
2897
+ // radio_group_1 => radio_group
2898
+ let componentName = name.replace(/_\d+$/, '');
2899
+ // radio_group => radioGroup
2900
+ componentName = utils.snake2Camel(componentName, true);
2901
+ // radioGroup => radio-group
2902
+ componentName = utils.Camel2kebab(componentName);
2903
+ componentName = `${prefix}${componentName}`;
2904
+ return componentName;
2905
+ }
2906
+ exports.getComponentNameFromElementName = getComponentNameFromElementName;
2907
+ //# sourceMappingURL=View__.js.map