@farris/jit-engine 1.3.294 → 1.3.296

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 (464) hide show
  1. package/README.md +3 -0
  2. package/lib/domstructure/devkit/devkit.js +5 -1
  3. package/lib/domstructure/devkit/devkit.js.map +1 -1
  4. package/lib/domstructure/devkit/section-toolbar/farris-section-toolbar-item.js +8 -1
  5. package/lib/domstructure/devkit/section-toolbar/farris-section-toolbar-item.js.map +1 -1
  6. package/lib/domstructure/devkit/tab-toolbar/farris-tab-toolbar-Item.js +8 -1
  7. package/lib/domstructure/devkit/tab-toolbar/farris-tab-toolbar-Item.js.map +1 -1
  8. package/lib/domstructure/devkit/viewmodel/component/component.js +15 -8
  9. package/lib/domstructure/devkit/viewmodel/component/component.js.map +1 -1
  10. package/lib/domstructure/devkit/viewmodel/viewmodel.js +2 -0
  11. package/lib/domstructure/devkit/viewmodel/viewmodel.js.map +1 -1
  12. package/lib/domstructure/ui/commands/button.js +8 -0
  13. package/lib/domstructure/ui/commands/button.js.map +1 -1
  14. package/lib/domstructure/ui/commands/command.js +3 -0
  15. package/lib/domstructure/ui/commands/command.js.map +1 -1
  16. package/lib/domstructure/ui/commands/toolbar.js +2 -0
  17. package/lib/domstructure/ui/commands/toolbar.js.map +1 -1
  18. package/lib/domstructure/ui/common/basecomponent.js +11 -0
  19. package/lib/domstructure/ui/common/basecomponent.js.map +1 -1
  20. package/lib/domstructure/ui/data/fields/form/form_field.js +17 -16
  21. package/lib/domstructure/ui/data/fields/form/form_field.js.map +1 -1
  22. package/lib/domstructure/ui/section/section.js +2 -0
  23. package/lib/domstructure/ui/section/section.js.map +1 -1
  24. package/lib/domstructure/ui/table/farris-table-column.js.map +1 -1
  25. package/lib/domstructure/ui/table/farris-table-static-text.js.map +1 -1
  26. package/lib/domstructure/ui/tabs/farris-tabs.js +2 -0
  27. package/lib/domstructure/ui/tabs/farris-tabs.js.map +1 -1
  28. package/lib/template/ui/kendo/adminorganization-selector.pug +101 -101
  29. package/lib/template/ui/kendo/appointment-calendar.pug +39 -39
  30. package/lib/template/ui/kendo/approval-comments.pug +15 -15
  31. package/lib/template/ui/kendo/approve-logs.pug +1 -1
  32. package/lib/template/ui/kendo/button.pug +16 -10
  33. package/lib/template/ui/kendo/buttongroup.pug +7 -7
  34. package/lib/template/ui/kendo/chart.pug +9 -9
  35. package/lib/template/ui/kendo/checkbox.pug +118 -99
  36. package/lib/template/ui/kendo/checkboxgroup.pug +63 -51
  37. package/lib/template/ui/kendo/city-selector.pug +69 -69
  38. package/lib/template/ui/kendo/combobox.pug +70 -70
  39. package/lib/template/ui/kendo/componentref.pug +3 -3
  40. package/lib/template/ui/kendo/contentcontainer.pug +8 -8
  41. package/lib/template/ui/kendo/datepicker.pug +70 -70
  42. package/lib/template/ui/kendo/dialog.pug +10 -10
  43. package/lib/template/ui/kendo/dropdownlist.pug +18 -18
  44. package/lib/template/ui/kendo/dynamic-area-item.pug +1 -1
  45. package/lib/template/ui/kendo/employee-selector.pug +96 -96
  46. package/lib/template/ui/kendo/externalContainer.pug +12 -12
  47. package/lib/template/ui/kendo/externalRouteContainer.pug +1 -1
  48. package/lib/template/ui/kendo/farris-avatar.pug +19 -13
  49. package/lib/template/ui/kendo/farris-calendar.pug +5 -5
  50. package/lib/template/ui/kendo/farris-checkbox-group.pug +96 -67
  51. package/lib/template/ui/kendo/farris-combo-list.pug +111 -71
  52. package/lib/template/ui/kendo/farris-combo-lookup.pug +98 -83
  53. package/lib/template/ui/kendo/farris-datagrid-template.pug +21 -21
  54. package/lib/template/ui/kendo/farris-datagrid.pug +37 -37
  55. package/lib/template/ui/kendo/farris-datepicker.pug +118 -104
  56. package/lib/template/ui/kendo/farris-dynamic-control-group.pug +14 -14
  57. package/lib/template/ui/kendo/farris-ext-intergration.pug +79 -79
  58. package/lib/template/ui/kendo/farris-file-preview.pug +6 -6
  59. package/lib/template/ui/kendo/farris-file-upload-preview.pug +48 -48
  60. package/lib/template/ui/kendo/farris-file-upload.pug +3 -3
  61. package/lib/template/ui/kendo/farris-light-list-filter.pug +10 -10
  62. package/lib/template/ui/kendo/farris-list-filter.pug +11 -11
  63. package/lib/template/ui/kendo/farris-list-view.pug +27 -27
  64. package/lib/template/ui/kendo/farris-number-range.pug +98 -68
  65. package/lib/template/ui/kendo/farris-number-spinner.pug +103 -83
  66. package/lib/template/ui/kendo/farris-progress-step.pug +13 -13
  67. package/lib/template/ui/kendo/farris-query-solution.pug +17 -17
  68. package/lib/template/ui/kendo/farris-scrollspy.pug +10 -10
  69. package/lib/template/ui/kendo/farris-splitter-pane.pug +11 -11
  70. package/lib/template/ui/kendo/farris-splitter.pug +6 -6
  71. package/lib/template/ui/kendo/farris-switch.pug +88 -66
  72. package/lib/template/ui/kendo/farris-tags.pug +70 -70
  73. package/lib/template/ui/kendo/farris-time-picker.pug +102 -71
  74. package/lib/template/ui/kendo/farris-time-spinner.pug +71 -48
  75. package/lib/template/ui/kendo/farris-ui-footer.pug +15 -15
  76. package/lib/template/ui/kendo/farris-wizard-page-detail.pug +14 -14
  77. package/lib/template/ui/kendo/farris-wizard.pug +8 -8
  78. package/lib/template/ui/kendo/farrissidebar.pug +26 -26
  79. package/lib/template/ui/kendo/farristabpage.pug +14 -14
  80. package/lib/template/ui/kendo/farristabs.pug +13 -2
  81. package/lib/template/ui/kendo/farristag.pug +6 -6
  82. package/lib/template/ui/kendo/fieldset.pug +20 -20
  83. package/lib/template/ui/kendo/flexlayout.pug +5 -5
  84. package/lib/template/ui/kendo/form.pug +15 -15
  85. package/lib/template/ui/kendo/grid.pug +83 -83
  86. package/lib/template/ui/kendo/header.pug +9 -9
  87. package/lib/template/ui/kendo/hidden-container.pug +1 -1
  88. package/lib/template/ui/kendo/image-upload.pug +82 -82
  89. package/lib/template/ui/kendo/image.pug +19 -19
  90. package/lib/template/ui/kendo/input-group.pug +96 -66
  91. package/lib/template/ui/kendo/label.pug +18 -18
  92. package/lib/template/ui/kendo/language-textbox.pug +92 -70
  93. package/lib/template/ui/kendo/list-nav.pug +12 -12
  94. package/lib/template/ui/kendo/lookup-employee.pug +109 -96
  95. package/lib/template/ui/kendo/lookup.pug +113 -98
  96. package/lib/template/ui/kendo/loop-container.pug +1 -1
  97. package/lib/template/ui/kendo/menu.pug +3 -3
  98. package/lib/template/ui/kendo/menuitem.pug +7 -7
  99. package/lib/template/ui/kendo/modal-footer.pug +9 -9
  100. package/lib/template/ui/kendo/multi-select.pug +16 -16
  101. package/lib/template/ui/kendo/multi-view-container.pug +7 -7
  102. package/lib/template/ui/kendo/multi-view-item.pug +8 -8
  103. package/lib/template/ui/kendo/multitextbox.pug +101 -67
  104. package/lib/template/ui/kendo/numericbox.pug +70 -70
  105. package/lib/template/ui/kendo/oa-relation.pug +20 -20
  106. package/lib/template/ui/kendo/organization-selector.pug +116 -103
  107. package/lib/template/ui/kendo/p-treetable.pug +28 -28
  108. package/lib/template/ui/kendo/popup.pug +3 -3
  109. package/lib/template/ui/kendo/portlet.pug +2 -2
  110. package/lib/template/ui/kendo/primeng-edittree/checkbox.pug +12 -12
  111. package/lib/template/ui/kendo/primeng-edittree/farris-combo-list.pug +16 -16
  112. package/lib/template/ui/kendo/primeng-edittree/farris-combo-lookup.pug +19 -19
  113. package/lib/template/ui/kendo/primeng-edittree/farris-datepicker.pug +31 -31
  114. package/lib/template/ui/kendo/primeng-edittree/farris-number-spinner.pug +18 -18
  115. package/lib/template/ui/kendo/primeng-edittree/farris-switch.pug +13 -13
  116. package/lib/template/ui/kendo/primeng-edittree/farris-time-picker.pug +17 -17
  117. package/lib/template/ui/kendo/primeng-edittree/input-group.pug +14 -14
  118. package/lib/template/ui/kendo/primeng-edittree/language-textbox.pug +14 -14
  119. package/lib/template/ui/kendo/primeng-edittree/lookup.pug +32 -32
  120. package/lib/template/ui/kendo/primeng-edittree/multitextbox.pug +17 -17
  121. package/lib/template/ui/kendo/primeng-edittree/textbox.pug +18 -18
  122. package/lib/template/ui/kendo/qdp-condition-dialog-tab.pug +3 -3
  123. package/lib/template/ui/kendo/qdp-condition-dialog.pug +3 -3
  124. package/lib/template/ui/kendo/qdpframework.pug +15 -15
  125. package/lib/template/ui/kendo/queryform.pug +7 -7
  126. package/lib/template/ui/kendo/radiobox.pug +60 -48
  127. package/lib/template/ui/kendo/radioboxgroup.pug +94 -69
  128. package/lib/template/ui/kendo/richtextbox.pug +53 -53
  129. package/lib/template/ui/kendo/scroll-collapse-area.pug +2 -2
  130. package/lib/template/ui/kendo/section.pug +44 -31
  131. package/lib/template/ui/kendo/select.pug +46 -46
  132. package/lib/template/ui/kendo/spreadsheet.pug +7 -7
  133. package/lib/template/ui/kendo/switch.pug +67 -67
  134. package/lib/template/ui/kendo/tab.pug +3 -3
  135. package/lib/template/ui/kendo/table/adminorganization-selector.pug +73 -73
  136. package/lib/template/ui/kendo/table/checkbox.pug +92 -81
  137. package/lib/template/ui/kendo/table/checkboxgroup.pug +30 -30
  138. package/lib/template/ui/kendo/table/combobox.pug +49 -49
  139. package/lib/template/ui/kendo/table/datepicker.pug +49 -49
  140. package/lib/template/ui/kendo/table/employee-selector.pug +70 -70
  141. package/lib/template/ui/kendo/table/farris-avatar.pug +26 -18
  142. package/lib/template/ui/kendo/table/farris-checkbox-group.pug +47 -47
  143. package/lib/template/ui/kendo/table/farris-combo-list.pug +60 -60
  144. package/lib/template/ui/kendo/table/farris-combo-lookup.pug +30 -30
  145. package/lib/template/ui/kendo/table/farris-datepicker.pug +61 -61
  146. package/lib/template/ui/kendo/table/farris-number-range.pug +59 -48
  147. package/lib/template/ui/kendo/table/farris-number-spinner.pug +61 -46
  148. package/lib/template/ui/kendo/table/farris-static-text.pug +4 -4
  149. package/lib/template/ui/kendo/table/farris-switch.pug +55 -46
  150. package/lib/template/ui/kendo/table/farris-table-column.pug +1 -1
  151. package/lib/template/ui/kendo/table/farris-table-row.pug +1 -1
  152. package/lib/template/ui/kendo/table/farris-table.pug +1 -1
  153. package/lib/template/ui/kendo/table/farris-tags.pug +55 -48
  154. package/lib/template/ui/kendo/table/farris-time-picker.pug +51 -51
  155. package/lib/template/ui/kendo/table/farris-time-spinner.pug +25 -25
  156. package/lib/template/ui/kendo/table/input-group.pug +46 -46
  157. package/lib/template/ui/kendo/table/language-textbox.pug +50 -50
  158. package/lib/template/ui/kendo/table/lookup-employee.pug +71 -71
  159. package/lib/template/ui/kendo/table/lookup.pug +75 -75
  160. package/lib/template/ui/kendo/table/multi-select.pug +16 -16
  161. package/lib/template/ui/kendo/table/multitextbox.pug +47 -47
  162. package/lib/template/ui/kendo/table/numericbox.pug +59 -49
  163. package/lib/template/ui/kendo/table/organization-selector.pug +75 -75
  164. package/lib/template/ui/kendo/table/radiobox.pug +27 -27
  165. package/lib/template/ui/kendo/table/radioboxgroup.pug +47 -47
  166. package/lib/template/ui/kendo/table/richtextbox.pug +30 -30
  167. package/lib/template/ui/kendo/table/select.pug +21 -13
  168. package/lib/template/ui/kendo/table/switch.pug +55 -46
  169. package/lib/template/ui/kendo/table/textbox.pug +53 -53
  170. package/lib/template/ui/kendo/table/timebox.pug +33 -25
  171. package/lib/template/ui/kendo/table/timepicker.pug +25 -21
  172. package/lib/template/ui/kendo/table/tinymcerichtextbox.pug +36 -28
  173. package/lib/template/ui/kendo/tabpage.pug +10 -10
  174. package/lib/template/ui/kendo/template.pug +2 -2
  175. package/lib/template/ui/kendo/textbox.pug +98 -74
  176. package/lib/template/ui/kendo/timebox.pug +47 -47
  177. package/lib/template/ui/kendo/timepicker.pug +17 -17
  178. package/lib/template/ui/kendo/tinymcerichtextbox.pug +59 -51
  179. package/lib/template/ui/kendo/toolbar.pug +6 -2
  180. package/lib/template/ui/kendo/treegrid.pug +16 -16
  181. package/lib/template/ui/kendo/view-change.pug +1 -1
  182. package/lib/template/ui/kendo/wizarddetailcontainer.pug +6 -6
  183. package/lib/utility/behavior/behavior-manager.js +320 -0
  184. package/lib/utility/behavior/behavior-manager.js.map +1 -0
  185. package/lib/utility/behavior/behavior-params.js +3 -0
  186. package/lib/utility/behavior/behavior-params.js.map +1 -0
  187. package/lib/utility/behavior/index.js +14 -0
  188. package/lib/utility/behavior/index.js.map +1 -0
  189. package/lib/utility/config-hepler.js +25 -1
  190. package/lib/utility/config-hepler.js.map +1 -1
  191. package/lib/utility/devkit/abstract-dom-creator.js +48 -48
  192. package/lib/utility/devkit/abstract-dom-map.js +2 -2
  193. package/lib/utility/devkit/checkgroup-type-creator-factory.js +21 -21
  194. package/lib/utility/devkit/component-adminorganization-selector-parameter.js +6 -6
  195. package/lib/utility/devkit/component-appointment-calendar-parameter.js +37 -37
  196. package/lib/utility/devkit/component-button-parameter.js +13 -13
  197. package/lib/utility/devkit/component-children-routes-creator.js +59 -59
  198. package/lib/utility/devkit/component-condition-dialog-parameter.js +28 -28
  199. package/lib/utility/devkit/component-creator.js +191 -191
  200. package/lib/utility/devkit/component-employee-selector-parameter.js +6 -6
  201. package/lib/utility/devkit/component-event.js +2 -2
  202. package/lib/utility/devkit/component-external-container-parameter-creator.js +86 -86
  203. package/lib/utility/devkit/component-external-container-parameter.js +12 -12
  204. package/lib/utility/devkit/component-farris-avatar-parameter-creator.js +14 -14
  205. package/lib/utility/devkit/component-farris-datagrid-contextmenu-parameter.js +15 -15
  206. package/lib/utility/devkit/component-farris-datagrid-parameter.js +89 -89
  207. package/lib/utility/devkit/component-farris-input-group-parameter.js +49 -49
  208. package/lib/utility/devkit/component-farris-lookup-parameter.js +52 -52
  209. package/lib/utility/devkit/component-farris-treegrid-parameter.js +21 -21
  210. package/lib/utility/devkit/component-fileupload-preview-creator.js +22 -22
  211. package/lib/utility/devkit/component-listview-parameter.js +6 -6
  212. package/lib/utility/devkit/component-nav-tab-parameter.js +16 -16
  213. package/lib/utility/devkit/component-number-spinner-range-creator.js +19 -19
  214. package/lib/utility/devkit/component-number-spinner-range.js +36 -36
  215. package/lib/utility/devkit/component-organization-selector-parameter.js +6 -6
  216. package/lib/utility/devkit/component-parameter-collector/abstract-component-parameter-collector.js +6 -6
  217. package/lib/utility/devkit/component-parameter-collector/combolist-parameter-collector.js +51 -51
  218. package/lib/utility/devkit/component-parameter-collector/component-adminorganization-selector-parameter-collector.js +45 -45
  219. package/lib/utility/devkit/component-parameter-collector/component-appointment-calendar-parameter-collector.js +90 -90
  220. package/lib/utility/devkit/component-parameter-collector/component-button-collector.js +59 -59
  221. package/lib/utility/devkit/component-parameter-collector/component-condition-dialog-collector.js +34 -34
  222. package/lib/utility/devkit/component-parameter-collector/component-datebox-parameter-collector.js +46 -46
  223. package/lib/utility/devkit/component-parameter-collector/component-employee-selector-parameter-collector.js +45 -45
  224. package/lib/utility/devkit/component-parameter-collector/component-events-collector.js +109 -109
  225. package/lib/utility/devkit/component-parameter-collector/component-external-container-parameter-collector.js +81 -81
  226. package/lib/utility/devkit/component-parameter-collector/component-file-upload-parameter-collector.js +202 -202
  227. package/lib/utility/devkit/component-parameter-collector/component-header-parameter-collector.js +78 -78
  228. package/lib/utility/devkit/component-parameter-collector/component-languagetextbox-parameter-collector.js +51 -51
  229. package/lib/utility/devkit/component-parameter-collector/component-listview-parameter-collector.js +100 -100
  230. package/lib/utility/devkit/component-parameter-collector/component-multitextbox-parameter-collector.js +46 -46
  231. package/lib/utility/devkit/component-parameter-collector/component-numericbox-parameter-collector.js +46 -46
  232. package/lib/utility/devkit/component-parameter-collector/component-organization-selector-parameter-collector.js +45 -45
  233. package/lib/utility/devkit/component-parameter-collector/component-parameter-collector-manager.js +221 -221
  234. package/lib/utility/devkit/component-parameter-collector/component-parameter-collector-options-creator.js +14 -14
  235. package/lib/utility/devkit/component-parameter-collector/component-parameter-collector-options.js +6 -6
  236. package/lib/utility/devkit/component-parameter-collector/component-parameter-collector-type.js +56 -56
  237. package/lib/utility/devkit/component-parameter-collector/component-personnel-selector-parameter-collector.js +45 -45
  238. package/lib/utility/devkit/component-parameter-collector/component-readonly-parameter-collector.js +49 -49
  239. package/lib/utility/devkit/component-parameter-collector/component-viewchange-parameter-collector.js +70 -70
  240. package/lib/utility/devkit/component-parameter-collector/enum-field-collector.js +56 -56
  241. package/lib/utility/devkit/component-parameter-collector/farris-avatar-collector.js +44 -44
  242. package/lib/utility/devkit/component-parameter-collector/farris-checkbox-group-collector.js +69 -69
  243. package/lib/utility/devkit/component-parameter-collector/farris-datagrid-collector.js +390 -390
  244. package/lib/utility/devkit/component-parameter-collector/farris-datepicker-collector.js +50 -50
  245. package/lib/utility/devkit/component-parameter-collector/farris-input-group-collector.js +155 -155
  246. package/lib/utility/devkit/component-parameter-collector/farris-list-filter-parameter-collector.js +150 -150
  247. package/lib/utility/devkit/component-parameter-collector/farris-lookup-collector.js +64 -64
  248. package/lib/utility/devkit/component-parameter-collector/farris-nav-tab-parameter-collector.js +82 -82
  249. package/lib/utility/devkit/component-parameter-collector/farris-radiogroup-collector.js +70 -70
  250. package/lib/utility/devkit/component-parameter-collector/farris-section-collector.js +128 -126
  251. package/lib/utility/devkit/component-parameter-collector/farris-section-collector.js.map +1 -1
  252. package/lib/utility/devkit/component-parameter-collector/farris-tabs-collector.js +124 -122
  253. package/lib/utility/devkit/component-parameter-collector/farris-tabs-collector.js.map +1 -1
  254. package/lib/utility/devkit/component-parameter-collector/farris-tags-parameter-collector.js +49 -49
  255. package/lib/utility/devkit/component-parameter-collector/farris-timepicker-collector.js +46 -46
  256. package/lib/utility/devkit/component-parameter-collector/farris-timespinner-parameter-collector.js +46 -46
  257. package/lib/utility/devkit/component-parameter-collector/farris-treegrid-parameter-collector.js +197 -197
  258. package/lib/utility/devkit/component-parameter-collector/farris-ui-footer-parameter-collector.js +41 -41
  259. package/lib/utility/devkit/component-parameter-collector/fieldset-collector.js +47 -47
  260. package/lib/utility/devkit/component-parameter-collector/i-component-parameter-collector.js +2 -2
  261. package/lib/utility/devkit/component-parameter-collector/index.js +14 -14
  262. package/lib/utility/devkit/component-parameter-collector/list-nav-collector.js +31 -31
  263. package/lib/utility/devkit/component-parameter-collector/number-spinner-range-collector.js +79 -79
  264. package/lib/utility/devkit/component-parameter-collector/primeng-tree-grid-parameter-collector.js +221 -221
  265. package/lib/utility/devkit/component-parameter-collector/qdp-framework-collector.js +30 -30
  266. package/lib/utility/devkit/component-parameter-collector/query-schema-collector.js +247 -243
  267. package/lib/utility/devkit/component-parameter-collector/query-schema-collector.js.map +1 -1
  268. package/lib/utility/devkit/component-parameter-collector/richtextbox-parameter-collector.js +46 -46
  269. package/lib/utility/devkit/component-parameter-collector/scrollspy-collector.js +86 -86
  270. package/lib/utility/devkit/component-parameter-collector/sidebar-parameter-collector.js +34 -34
  271. package/lib/utility/devkit/component-parameter-collector/textbox-parameter-collector.js +46 -46
  272. package/lib/utility/devkit/component-parameter-collector/tool-typechange-collector.js +27 -27
  273. package/lib/utility/devkit/component-parameter-collector/toolbar-collector.js +114 -110
  274. package/lib/utility/devkit/component-parameter-collector/toolbar-collector.js.map +1 -1
  275. package/lib/utility/devkit/component-parameter-collector/wizard-collector.js +73 -73
  276. package/lib/utility/devkit/component-parameter-creator.js +9 -9
  277. package/lib/utility/devkit/component-personnel-selector-parameter.js +6 -6
  278. package/lib/utility/devkit/component-primeng-treegrid-parameter.js +13 -13
  279. package/lib/utility/devkit/component-readonly-parameter-creator.js +10 -10
  280. package/lib/utility/devkit/component-readonly-parameter.js +6 -6
  281. package/lib/utility/devkit/component-sidebar-toolbar.js +6 -6
  282. package/lib/utility/devkit/component-viewchange-parameter.js +13 -13
  283. package/lib/utility/devkit/datagrid-type-creator-factory.js +22 -22
  284. package/lib/utility/devkit/datebox-type-creator-factory.js +35 -35
  285. package/lib/utility/devkit/declarationevents-modifier.js +54 -54
  286. package/lib/utility/devkit/devkit-constant.js +38 -38
  287. package/lib/utility/devkit/devkit-creator.js +28 -27
  288. package/lib/utility/devkit/devkit-creator.js.map +1 -1
  289. package/lib/utility/devkit/devkit-object-name-creator.js +52 -52
  290. package/lib/utility/devkit/entities-creator.js +94 -94
  291. package/lib/utility/devkit/entity-creator.js +47 -47
  292. package/lib/utility/devkit/entity-name-creator.js +14 -14
  293. package/lib/utility/devkit/enumfield-type-creator.js +35 -35
  294. package/lib/utility/devkit/external-component/className-isExternalcomponent-checker.js +19 -19
  295. package/lib/utility/devkit/external-component/external-component-childroutingpath-generator.js +20 -20
  296. package/lib/utility/devkit/external-component/external-component-creator.js +101 -100
  297. package/lib/utility/devkit/external-component/external-component-creator.js.map +1 -1
  298. package/lib/utility/devkit/external-component/external-component-prefix-creator.js +13 -13
  299. package/lib/utility/devkit/external-component/external-component-publisPath-generator.js +39 -39
  300. package/lib/utility/devkit/external-component/external-component-uniquecode-creator.js +26 -26
  301. package/lib/utility/devkit/external-component/external-components-creator.js +41 -40
  302. package/lib/utility/devkit/external-component/external-components-creator.js.map +1 -1
  303. package/lib/utility/devkit/external-component/externalComponent-constant.js +15 -15
  304. package/lib/utility/devkit/external-component/index.js +15 -15
  305. package/lib/utility/devkit/field-creator.js +265 -265
  306. package/lib/utility/devkit/form-creator.js +110 -110
  307. package/lib/utility/devkit/form-file-executor.js +416 -409
  308. package/lib/utility/devkit/form-file-executor.js.map +1 -1
  309. package/lib/utility/devkit/form-resource-json-reader.js +21 -21
  310. package/lib/utility/devkit/handlers-creator.js +38 -38
  311. package/lib/utility/devkit/index.js +18 -18
  312. package/lib/utility/devkit/list-filter-type-creator-factory.js +36 -36
  313. package/lib/utility/devkit/lookup-type-creator-factory.js +52 -52
  314. package/lib/utility/devkit/module-creator.js +167 -167
  315. package/lib/utility/devkit/repository-creator.js +60 -60
  316. package/lib/utility/devkit/response-layout-type-creator-factory.js +22 -22
  317. package/lib/utility/devkit/richtextbox-type-creator-factory.js +35 -35
  318. package/lib/utility/devkit/routing-creator.js +21 -21
  319. package/lib/utility/devkit/statemachine-creator.js +39 -39
  320. package/lib/utility/devkit/switch-type-creator-factory.js +35 -35
  321. package/lib/utility/devkit/tab-type-creator-factory.js +45 -45
  322. package/lib/utility/devkit/toolbar/toolbar-item.js +2 -2
  323. package/lib/utility/devkit/toolbar/toolbar.js +2 -2
  324. package/lib/utility/devkit/toolbar/toolbaritem-state.js +2 -2
  325. package/lib/utility/devkit/treegrid-type-creator-factory.js +36 -36
  326. package/lib/utility/devkit/viewmodels-creator.js +634 -634
  327. package/lib/utility/farris-datagrid/lookup-editor.js +1 -1
  328. package/lib/utility/farris-datagrid/lookup-editor.js.map +1 -1
  329. package/lib/utility/jit-path-helper.js +3 -0
  330. package/lib/utility/jit-path-helper.js.map +1 -1
  331. package/lib/utility/template-generator/abstract-template-generator.js +31 -31
  332. package/lib/utility/template-generator/devkit/befproxy-template-generator.js +126 -126
  333. package/lib/utility/template-generator/devkit/commandhandler-template-generator.js +94 -94
  334. package/lib/utility/template-generator/devkit/component-generator/component-adminorganization-selector-parameter-generator.js +20 -20
  335. package/lib/utility/template-generator/devkit/component-generator/component-appointment-calendar-parameter-generator.js +76 -76
  336. package/lib/utility/template-generator/devkit/component-generator/component-avatar-parameter-generator.js +19 -19
  337. package/lib/utility/template-generator/devkit/component-generator/component-button-parameter-generator.js +23 -23
  338. package/lib/utility/template-generator/devkit/component-generator/component-checkgroup-parameter-generator.js +40 -40
  339. package/lib/utility/template-generator/devkit/component-generator/component-combolist-parameter-generator.js +48 -48
  340. package/lib/utility/template-generator/devkit/component-generator/component-constructor-parameter-generator.js +68 -68
  341. package/lib/utility/template-generator/devkit/component-generator/component-datebox-parameter-generator.js +19 -19
  342. package/lib/utility/template-generator/devkit/component-generator/component-datepicker-parameter-generator.js +19 -19
  343. package/lib/utility/template-generator/devkit/component-generator/component-employee-selector-parameter-generator.js +20 -20
  344. package/lib/utility/template-generator/devkit/component-generator/component-enumfield-parameter-generator.js +42 -42
  345. package/lib/utility/template-generator/devkit/component-generator/component-events-parameter-generator.js +112 -112
  346. package/lib/utility/template-generator/devkit/component-generator/component-external-container-parameter-generator.js +191 -191
  347. package/lib/utility/template-generator/devkit/component-generator/component-farris-inputgroup-parameter-generator.js +95 -95
  348. package/lib/utility/template-generator/devkit/component-generator/component-farrisgrid-parameter-generator.js +607 -607
  349. package/lib/utility/template-generator/devkit/component-generator/component-farristabs-parameter-generator.js +149 -146
  350. package/lib/utility/template-generator/devkit/component-generator/component-farristabs-parameter-generator.js.map +1 -1
  351. package/lib/utility/template-generator/devkit/component-generator/component-fieldset-parameter-generator.js +27 -27
  352. package/lib/utility/template-generator/devkit/component-generator/component-fileupload-parameter-generator.js +228 -228
  353. package/lib/utility/template-generator/devkit/component-generator/component-footer-parameter-generator.js +23 -23
  354. package/lib/utility/template-generator/devkit/component-generator/component-header-parameter-generator.js +74 -74
  355. package/lib/utility/template-generator/devkit/component-generator/component-hostbinding-class-generator.js +31 -31
  356. package/lib/utility/template-generator/devkit/component-generator/component-import-generator.js +184 -179
  357. package/lib/utility/template-generator/devkit/component-generator/component-import-generator.js.map +1 -1
  358. package/lib/utility/template-generator/devkit/component-generator/component-joint-search-parameter-generator.js +15 -15
  359. package/lib/utility/template-generator/devkit/component-generator/component-keybinding-service-generator.js +18 -18
  360. package/lib/utility/template-generator/devkit/component-generator/component-languagetextbox-parameter-generator.js +19 -19
  361. package/lib/utility/template-generator/devkit/component-generator/component-listfilter-parameter-generator.js +218 -218
  362. package/lib/utility/template-generator/devkit/component-generator/component-listnav-parameter-generator.js +14 -14
  363. package/lib/utility/template-generator/devkit/component-generator/component-lookup-parameter-generator.js +71 -71
  364. package/lib/utility/template-generator/devkit/component-generator/component-modal-form-controls-generator.js +142 -142
  365. package/lib/utility/template-generator/devkit/component-generator/component-multitextbox-parameter-generator.js +19 -19
  366. package/lib/utility/template-generator/devkit/component-generator/component-nav-tab-parameter-generator.js +44 -44
  367. package/lib/utility/template-generator/devkit/component-generator/component-numberspinner-range-parameter-generator.js +52 -52
  368. package/lib/utility/template-generator/devkit/component-generator/component-numericbox-parameter-generator.js +19 -19
  369. package/lib/utility/template-generator/devkit/component-generator/component-organization-selector-parameter-generator.js +20 -20
  370. package/lib/utility/template-generator/devkit/component-generator/component-personnel-selector-parameter-generator.js +40 -40
  371. package/lib/utility/template-generator/devkit/component-generator/component-primeng-treegrid-parameter-generator.js +350 -350
  372. package/lib/utility/template-generator/devkit/component-generator/component-provider-generator.js +177 -172
  373. package/lib/utility/template-generator/devkit/component-generator/component-provider-generator.js.map +1 -1
  374. package/lib/utility/template-generator/devkit/component-generator/component-qdpframework-parameter-generator.js +17 -17
  375. package/lib/utility/template-generator/devkit/component-generator/component-queryschema-parameter-generator.js +385 -365
  376. package/lib/utility/template-generator/devkit/component-generator/component-queryschema-parameter-generator.js.map +1 -1
  377. package/lib/utility/template-generator/devkit/component-generator/component-radiogroup-parameter-generator.js +47 -47
  378. package/lib/utility/template-generator/devkit/component-generator/component-readonly-parameter-generator.js +17 -17
  379. package/lib/utility/template-generator/devkit/component-generator/component-richtextbox-parameter-generator.js +19 -19
  380. package/lib/utility/template-generator/devkit/component-generator/component-scrollspy-parameter-generator.js +64 -64
  381. package/lib/utility/template-generator/devkit/component-generator/component-section-parameter-generator.js +161 -178
  382. package/lib/utility/template-generator/devkit/component-generator/component-section-parameter-generator.js.map +1 -1
  383. package/lib/utility/template-generator/devkit/component-generator/component-selector-generator.js +18 -18
  384. package/lib/utility/template-generator/devkit/component-generator/component-sidebar-parameter-generator.js +17 -17
  385. package/lib/utility/template-generator/devkit/component-generator/component-styleurls-generator.js +20 -20
  386. package/lib/utility/template-generator/devkit/component-generator/component-tags-parameter-generator.js +40 -40
  387. package/lib/utility/template-generator/devkit/component-generator/component-textbox-parameter-generator.js +19 -19
  388. package/lib/utility/template-generator/devkit/component-generator/component-timepicker-parameter-generator.js +19 -19
  389. package/lib/utility/template-generator/devkit/component-generator/component-timespinner-parameter-generator.js +19 -19
  390. package/lib/utility/template-generator/devkit/component-generator/component-toolbar-parameter-generator.js +219 -175
  391. package/lib/utility/template-generator/devkit/component-generator/component-toolbar-parameter-generator.js.map +1 -1
  392. package/lib/utility/template-generator/devkit/component-generator/component-tooltype-parameter-generator.js +27 -27
  393. package/lib/utility/template-generator/devkit/component-generator/component-treegrid-parameter-generator.js +281 -281
  394. package/lib/utility/template-generator/devkit/component-generator/component-verify-parameter-generator.js +44 -44
  395. package/lib/utility/template-generator/devkit/component-generator/component-viewchange-parameter-generator.js +40 -40
  396. package/lib/utility/template-generator/devkit/component-generator/component-wizard-parameter-generator.js +59 -59
  397. package/lib/utility/template-generator/devkit/component-generator/index.js +40 -40
  398. package/lib/utility/template-generator/devkit/component-template-generator.js +513 -512
  399. package/lib/utility/template-generator/devkit/component-template-generator.js.map +1 -1
  400. package/lib/utility/template-generator/devkit/entity-template-generator.js +192 -192
  401. package/lib/utility/template-generator/devkit/event-template-generator.js +46 -46
  402. package/lib/utility/template-generator/devkit/form-template-generator.js +120 -120
  403. package/lib/utility/template-generator/devkit/lang-template-generator.js +148 -148
  404. package/lib/utility/template-generator/devkit/module-generator/index.js +19 -19
  405. package/lib/utility/template-generator/devkit/module-generator/module-bootstrap-generator.js +23 -23
  406. package/lib/utility/template-generator/devkit/module-generator/module-declarations-generator.js +27 -27
  407. package/lib/utility/template-generator/devkit/module-generator/module-entrycomponents-generator.js +23 -23
  408. package/lib/utility/template-generator/devkit/module-generator/module-exports-generator.js +23 -23
  409. package/lib/utility/template-generator/devkit/module-generator/module-i18n-generator.js +17 -17
  410. package/lib/utility/template-generator/devkit/module-generator/module-import-statement-generator.js +303 -303
  411. package/lib/utility/template-generator/devkit/module-generator/module-imports-statement-generator.js +282 -282
  412. package/lib/utility/template-generator/devkit/module-generator/module-providers-generator.js +158 -158
  413. package/lib/utility/template-generator/devkit/module-template-generator.js +46 -46
  414. package/lib/utility/template-generator/devkit/repository-template-generator.js +100 -100
  415. package/lib/utility/template-generator/devkit/router-template-generator.js +110 -110
  416. package/lib/utility/template-generator/devkit/state-template-generator.js +48 -48
  417. package/lib/utility/template-generator/devkit/statemachine-template-generator.js +70 -70
  418. package/lib/utility/template-generator/devkit/validrules-template-generator.js +55 -55
  419. package/lib/utility/template-generator/devkit/viewmodel-template-generator.js +140 -140
  420. package/lib/utility/template-generator/devkit-classname-templatetype-convertor.js +59 -59
  421. package/lib/utility/template-generator/form-jiexi/devkit/component-generator/index.js +15 -15
  422. package/lib/utility/template-generator/form-jiexi/devkit/component-generator/root-component-html-generator.js +10 -10
  423. package/lib/utility/template-generator/form-jiexi/devkit/component-generator/root-component-scss-generator.js +10 -10
  424. package/lib/utility/template-generator/form-jiexi/devkit/component-generator/root-component-ts-generator.js +62 -62
  425. package/lib/utility/template-generator/form-jiexi/devkit/metadata-generator/form-metadata-generator.js +50 -50
  426. package/lib/utility/template-generator/form-jiexi/devkit/metadata-generator/indexx.js +13 -13
  427. package/lib/utility/template-generator/form-jiexi/devkit/module-generator/form-module-generator.js +56 -56
  428. package/lib/utility/template-generator/form-jiexi/devkit/module-generator/form-module-routing-generator.js +35 -35
  429. package/lib/utility/template-generator/form-jiexi/devkit/module-generator/index.js +13 -13
  430. package/lib/utility/template-generator/form-jiexi/form-jiexi-generator-manager.js +81 -81
  431. package/lib/utility/template-generator/form-jiexi/sourcecode-delete-with-jiexiform.js +19 -19
  432. package/lib/utility/template-generator/i-template-generator.js +2 -2
  433. package/lib/utility/template-generator/index.js +16 -16
  434. package/lib/utility/template-generator/project/angularJson-generator.js +197 -196
  435. package/lib/utility/template-generator/project/angularJson-generator.js.map +1 -1
  436. package/lib/utility/template-generator/project/environments/environment-prod-ts-generator.js +17 -17
  437. package/lib/utility/template-generator/project/environments/environment-ts-generator.js +17 -17
  438. package/lib/utility/template-generator/project/index-rollup-html-generator.js +109 -109
  439. package/lib/utility/template-generator/project/mail-ts-generator.js +27 -27
  440. package/lib/utility/template-generator/project/main-ts-aot-generaor.js +23 -23
  441. package/lib/utility/template-generator/project/package-json-generator.js +134 -134
  442. package/lib/utility/template-generator/project/polyfills-ts-generator.js +33 -33
  443. package/lib/utility/template-generator/project/tsconfig-app-flash-json-generator.js +26 -26
  444. package/lib/utility/template-generator/project/tsconfig-app-json-generator.js +26 -26
  445. package/lib/utility/template-generator/project/tsconfig-flash-json-generator.js +56 -56
  446. package/lib/utility/template-generator/project/tsconfig-json-generator.js +58 -58
  447. package/lib/utility/template-generator/project/version-check-service-generator.js +85 -85
  448. package/lib/utility/template-generator/project-app/app-component-scss-generator.js +17 -17
  449. package/lib/utility/template-generator/project-app/app-component-ts-generator.js +25 -25
  450. package/lib/utility/template-generator/project-app/app-module-ts-generator.js +151 -147
  451. package/lib/utility/template-generator/project-app/app-module-ts-generator.js.map +1 -1
  452. package/lib/utility/template-generator/project-app/app-routing-module-generator.js +73 -73
  453. package/lib/utility/template-generator/project-app/index.js +16 -16
  454. package/lib/utility/template-generator/project-app/navigate-guard-generator.js +79 -79
  455. package/lib/utility/template-generator/project-app/systemjs-lc-moduleloader-generator.js +132 -132
  456. package/lib/utility/template-generator/subcontext-path-generator.js +19 -19
  457. package/lib/utility/template-generator/template-generator-factory.js +173 -173
  458. package/lib/utility/template-generator/template-generator-manager.js +119 -119
  459. package/lib/utility/template-generator/template-type.js +48 -48
  460. package/lib/utility/template-generator/ui/abstract-ui-template-generator.js +58 -58
  461. package/lib/utility/template-generator/ui/button-template-generator.js +17 -17
  462. package/lib/utility/template-generator/ui/html-attribute-name-constants.js +24 -24
  463. package/lib/utility/template-generator/ui/html-attribute-type.js +8 -8
  464. package/package.json +1 -1
@@ -1,635 +1,635 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ViewModelsCreator = void 0;
7
- const toolhepler_1 = require("../toolhepler");
8
- const lodash_1 = __importDefault(require("lodash"));
9
- const handlers_creator_1 = require("./handlers-creator");
10
- const statemachine_creator_1 = require("./statemachine-creator");
11
- const form_creator_1 = require("./form-creator");
12
- const component_creator_1 = require("./component-creator");
13
- const abstract_dom_creator_1 = require("./abstract-dom-creator");
14
- const devkit_object_name_creator_1 = require("./devkit-object-name-creator");
15
- const logger_helper_1 = require("../logger/logger-helper");
16
- const logger_level_1 = require("../logger/logger-level");
17
- const devkit_constant_1 = require("./devkit-constant");
18
- const component_parameter_creator_1 = require("./component-parameter-creator");
19
- const entities_creator_1 = require("./entities-creator");
20
- class ViewModelsCreator {
21
- constructor() {
22
- }
23
- static getNewInstance() {
24
- return new ViewModelsCreator();
25
- }
26
- createViewModels(viewModelParameter) {
27
- var _a;
28
- const { serviceRefs, viewModelList, i18nResourceKeyPrefix, externalComponentNameSpace, componentList, eapi, metaDataConfig, parentExternalComponent, customClass, subscriptions, declarationCommands, declarationStates } = this.initParameter(viewModelParameter);
29
- this.analysisServices(viewModelParameter, serviceRefs);
30
- const runMode = (_a = viewModelParameter.ui.options) === null || _a === void 0 ? void 0 : _a.runMode;
31
- viewModelList.forEach((item) => {
32
- item["formGroupName"] = item["name"];
33
- item["name"] = toolhepler_1.ToolHelper.tf(item.id);
34
- item[devkit_constant_1.DevkitConstant.ResourcePrefixKey] = i18nResourceKeyPrefix;
35
- if (toolhepler_1.ToolHelper.isArray(serviceRefs, false)) {
36
- item["serviceRefs"] = serviceRefs;
37
- }
38
- if (toolhepler_1.ToolHelper.isArray(item["commands"]) == true) {
39
- this.executeCmdWithViewModel(item, viewModelParameter, serviceRefs);
40
- }
41
- this.executeStateMachineWithViewModel(item, viewModelParameter);
42
- const form = this.executeFormWithViewModel(item, viewModelParameter);
43
- const component = componentList[lodash_1.default.findIndex(componentList, function (o) {
44
- return o.viewModel == item.id;
45
- })];
46
- if (component) {
47
- if (component.componentType == "dataGrid") {
48
- component["relatedSchema"] = viewModelParameter.ui.module.schemas[0];
49
- }
50
- if (form && toolhepler_1.ToolHelper.isArray(form.controls, false)) {
51
- this.updateComponentIdWithForm(component, form.controls);
52
- }
53
- component["moduleSchemaId"] = viewModelParameter.ui.module.schemas[0].id;
54
- item["component"] = component_creator_1.ComponentCreator.getNewInstance().createComponent(component, item, viewModelParameter.mainEntityCode, eapi, metaDataConfig, viewModelParameter.ui, i18nResourceKeyPrefix, externalComponentNameSpace);
55
- if (toolhepler_1.ToolHelper.isArray(viewModelParameter.ui.module.moduleReference, false)) {
56
- item["component"]["moduleReference"] = viewModelParameter.ui.module.moduleReference;
57
- }
58
- item["component"]["dynamic"] = component.dynamic;
59
- item["component"]["onInit"] = component.onInit;
60
- item["component"]["afterViewInit"] = component.afterViewInit;
61
- item['dom'] = abstract_dom_creator_1.AbstractDomCreator.getNewInstance().createAbsctractDOM(component, item, i18nResourceKeyPrefix, externalComponentNameSpace);
62
- item["component"]["parentExternalComponent"] = parentExternalComponent;
63
- item["component"]["onInitDeclarationEvents"] = component.onInitDeclarationEvents;
64
- item["component"]["afterViewInitDeclarationEvents"] = component.afterViewInitDeclarationEvents;
65
- item["component"]["enableUnifiedSession"] = item["enableUnifiedSession"];
66
- item["component"]["runMode"] = runMode;
67
- item["component"]["customComponentClass"] = this.getComponentClass(customClass, component.id);
68
- if (viewModelParameter.isJointSearch) {
69
- item["component"]["isJointSearch"] = viewModelParameter.isJointSearch;
70
- }
71
- this.executeComponentSubscriptions(component, subscriptions, parentExternalComponent, viewModelParameter, declarationCommands, declarationStates, componentList, item);
72
- }
73
- });
74
- viewModelList.forEach((item) => {
75
- item.children = [];
76
- viewModelList.forEach((item1) => {
77
- if (item.id == item1.parent) {
78
- const name = item1.name.substring(0, 1).toLowerCase() + item1.name.substring(1);
79
- item.children.push({ name: name, class: item1.name });
80
- }
81
- if (!toolhepler_1.ToolHelper.isNullOrUndefined(item1.parentModalViewModel)) {
82
- if (item.id == item1.parentModalViewModel) {
83
- const name = item1.name.substring(0, 1).toLowerCase() + item1.name.substring(1);
84
- item.children.push({ name: name, class: item1.name });
85
- }
86
- }
87
- });
88
- if (item.component && item.component.template && item.form) {
89
- if (toolhepler_1.ToolHelper.isArray(item.component.template, true)) {
90
- item.component.template.forEach((itemTemplate) => {
91
- this.handleValidProps(itemTemplate, item.form);
92
- });
93
- }
94
- else {
95
- this.handleValidProps(item.component.template, item.form);
96
- }
97
- }
98
- if (!toolhepler_1.ToolHelper.isNullOrUndefinedOrEmpty(item.allowEmpty)) {
99
- const relateEntity = entities_creator_1.EntitiesCreator.getSingleInstance().getEntityInfoByBindto(viewModelParameter.entity, item.bindTo, false);
100
- if (relateEntity) {
101
- relateEntity.allowEmpty = item.allowEmpty;
102
- }
103
- }
104
- });
105
- return viewModelList;
106
- }
107
- initParameter(viewModelParameter) {
108
- const uiModule = viewModelParameter.ui.module;
109
- const componentList = uiModule.components;
110
- const viewModelList = uiModule.viewmodels;
111
- const serviceRefs = uiModule.serviceRefs || [];
112
- const metaDataConfig = viewModelParameter.metaDataConfig;
113
- const eapi = viewModelParameter.eapi;
114
- let subscriptions = uiModule.subscriptions || [];
115
- const parentSubscriptions = viewModelParameter.parentExternalComponent ? viewModelParameter.parentExternalComponent.parentSubscriptions : null;
116
- if (parentSubscriptions && parentSubscriptions.length > 0) {
117
- subscriptions = subscriptions.concat(parentSubscriptions);
118
- }
119
- const parentExternalComponent = viewModelParameter.parentExternalComponent;
120
- const declarations = viewModelParameter.ui.module.declarations;
121
- const declarationCommands = declarations ? (declarations.commands ? declarations.commands : []) : [];
122
- let declarationStates = [];
123
- if (declarations) {
124
- declarationStates = declarations.states;
125
- }
126
- const i18nResourceKeyPrefix = viewModelParameter.i18nResourcePrefix;
127
- const externalComponentNameSpace = viewModelParameter.externalComponentNameSpace;
128
- const customClass = viewModelParameter.ui.module.customClass;
129
- return {
130
- serviceRefs, viewModelList, i18nResourceKeyPrefix, externalComponentNameSpace, componentList, eapi,
131
- metaDataConfig, parentExternalComponent, customClass, subscriptions, declarationCommands, declarationStates
132
- };
133
- }
134
- executeComponentSubscriptions(component, subscriptions, parentExternalComponent, viewModelParameter, declarationCommands, declarationStates, componentList, item) {
135
- if (toolhepler_1.ToolHelper.isArray(subscriptions, false)) {
136
- const filteredSubscriptions = [];
137
- subscriptions.forEach((subscription) => {
138
- if ((parentExternalComponent &&
139
- (subscription.targetComponent == parentExternalComponent.id)) ||
140
- subscription.targetComponent == viewModelParameter.ui.module.id) {
141
- const invokeComponentId = subscription.invokeComponentId;
142
- if (toolhepler_1.ToolHelper.isNullOrUndefined(invokeComponentId) == false) {
143
- if (component.id != invokeComponentId) {
144
- return true;
145
- }
146
- subscription.useInvokeComponentId = true;
147
- }
148
- else if (component_parameter_creator_1.ComponentParameterCreator.checkIsFrame(component) == false) {
149
- return true;
150
- }
151
- subscription.isFrame = component_parameter_creator_1.ComponentParameterCreator.checkIsFrame(component);
152
- declarationCommands.forEach((commandItem) => {
153
- if (commandItem.code == subscription.invoke) {
154
- subscription.command = commandItem;
155
- }
156
- });
157
- const paramMapCollection = [];
158
- if (subscription.paramMappings && subscription.paramMappings.length) {
159
- subscription.paramMappings.forEach((paramMapping) => {
160
- let targetComponentId;
161
- const targetViewModelName = this.extractParamMappingTargetViewModelName(paramMapping);
162
- if (targetViewModelName) {
163
- const findComponent = componentList.find((componentItem) => {
164
- return componentItem.viewModel == targetViewModelName;
165
- });
166
- if (findComponent) {
167
- targetComponentId = findComponent.id;
168
- }
169
- }
170
- const declarationState = this.getDeclarationState(paramMapping.targetCode, declarationStates);
171
- if (declarationState) {
172
- const paramMap = {
173
- frameID: subscription.targetComponent,
174
- from: paramMapping.sourceCode,
175
- to: declarationState.state,
176
- targetType: paramMapping.targetType,
177
- targetComponentId: targetComponentId
178
- };
179
- paramMapCollection.push(paramMap);
180
- }
181
- });
182
- }
183
- subscription["paramMapCollection"] = paramMapCollection;
184
- filteredSubscriptions.push(subscription);
185
- }
186
- else {
187
- if (!subscription["token"] && viewModelParameter.ui.module && viewModelParameter.ui.module.declarations && viewModelParameter.ui.module.declarations.events && viewModelParameter.ui.module.declarations.events.length > 0) {
188
- const findDeclaration = viewModelParameter.ui.module.declarations.events.find((pd) => {
189
- return pd.code == subscription.subscribeOn && subscription.sourceComponent == pd.currentFrmCode;
190
- });
191
- if (findDeclaration) {
192
- subscription["token"] = findDeclaration["token"];
193
- }
194
- }
195
- }
196
- });
197
- item["component"]["componentSubscriptions"] = filteredSubscriptions;
198
- }
199
- }
200
- extractParamMappingTargetViewModelName(paramMapping) {
201
- const targetPath = paramMapping.targetPath;
202
- let targetViewModelName;
203
- if (targetPath) {
204
- const arrTargetPath = targetPath.split(".");
205
- if (toolhepler_1.ToolHelper.isArray(arrTargetPath, false)) {
206
- targetViewModelName = arrTargetPath[0];
207
- }
208
- }
209
- return targetViewModelName;
210
- }
211
- executeFormWithViewModel(item, viewModelParameter) {
212
- const form = form_creator_1.FormCreator.getNewInstance().createForm(devkit_object_name_creator_1.DevkitObjectNameCreator.getDevkitObjectNameWithType("f", item.name), item.fields, viewModelParameter.entity, item);
213
- if (form) {
214
- item["form"] = form;
215
- }
216
- return form;
217
- }
218
- executeStateMachineWithViewModel(item, viewModelParameter) {
219
- const stateMachineName = item["stateMachine"];
220
- if (stateMachineName && viewModelParameter.sm && viewModelParameter.sm[stateMachineName]) {
221
- item["stateMachine"] = statemachine_creator_1.StateMachineCreator.getNewInstance().createStateMachine(devkit_object_name_creator_1.DevkitObjectNameCreator.getDevkitObjectNameWithType("sm", item.name), viewModelParameter.sm[stateMachineName]);
222
- }
223
- else {
224
- item["stateMachine"] = null;
225
- }
226
- }
227
- executeCmdWithViewModel(item, viewModelParameter, serviceRefs) {
228
- item["commands"].forEach((c) => {
229
- this.analysisCommand(viewModelParameter.cmd.commands, c, serviceRefs, viewModelParameter.ui.module.code);
230
- const result = [];
231
- const queue = [];
232
- if (c.handlers && c.handlers.length) {
233
- if (!c.links) {
234
- c.links = [];
235
- }
236
- handlers_creator_1.HandlersCreator.getNewInstance().createHandlers(c.links, result, c.handlers, 0);
237
- }
238
- if (c.links && c.links.length && (c.links instanceof Array)) {
239
- c.links.forEach((item, index) => {
240
- if (item.level == 0 && lodash_1.default.findIndex(queue, function (o) {
241
- return o.from == item.from;
242
- }) < 0) {
243
- item["index"] = index;
244
- queue.push(item);
245
- }
246
- });
247
- c.links.forEach((item, i) => {
248
- if (!item.to) {
249
- for (let j = 0; j < queue.length; j++) {
250
- if (queue[j].index > i) {
251
- item.to = queue[j].from;
252
- break;
253
- }
254
- }
255
- }
256
- });
257
- lodash_1.default.remove(c.links, function (n) {
258
- return n.to == '' || n.to == null || n.to == undefined;
259
- });
260
- }
261
- c.handlers = result;
262
- });
263
- }
264
- getComponentClass(moduleCustomClass, componentId) {
265
- if (!moduleCustomClass || !componentId) {
266
- return "";
267
- }
268
- let componentClass = "";
269
- Object.keys(moduleCustomClass).forEach((item) => {
270
- if (item === componentId) {
271
- componentClass = moduleCustomClass[item];
272
- }
273
- });
274
- return componentClass;
275
- }
276
- updateComponentIdWithForm(component, controls) {
277
- if (component && component.binding && component.binding.field) {
278
- controls.forEach((control) => {
279
- if (control.fieldId == component.binding.field) {
280
- control.formControlId = component.id;
281
- let titleValue;
282
- if (component.type == "GridField" || component.type == "TreeGridField") {
283
- control.fieldCode = component.dataField;
284
- titleValue = this.getControlTitleValue(component, "caption");
285
- }
286
- else {
287
- control.fieldCode = component.id;
288
- titleValue = this.getControlTitleValue(component, "title");
289
- }
290
- if (titleValue) {
291
- control["defaultI18nValue"] = titleValue;
292
- }
293
- }
294
- });
295
- }
296
- if (component && (component.type == "DataGrid" || component.type == "TreeGrid") && toolhepler_1.ToolHelper.isArray(component.fields, false)) {
297
- component.fields.forEach((field) => {
298
- this.updateComponentIdWithForm(field, controls);
299
- });
300
- }
301
- if (component && (component.type === "FileUploadPreview") && toolhepler_1.ToolHelper.isArray(component.previewColumns, false)) {
302
- component.previewColumns.forEach((column) => {
303
- this.updateFileUploadWithForm(column, controls);
304
- });
305
- }
306
- if (component && toolhepler_1.ToolHelper.isArray(component.contents, false)) {
307
- component.contents.forEach((element) => {
308
- this.updateComponentIdWithForm(element, controls);
309
- });
310
- }
311
- if (component && component.type === 'Table' && toolhepler_1.ToolHelper.isArray(component.rows, false)) {
312
- component.rows.forEach((itemRow) => {
313
- if (toolhepler_1.ToolHelper.isArray(itemRow.columns, false)) {
314
- itemRow.columns.forEach((itemColumn) => {
315
- if (itemColumn.tdType === 'editor' && itemColumn.editor) {
316
- this.updateComponentIdWithForm(itemColumn["editor"], controls);
317
- }
318
- });
319
- }
320
- });
321
- }
322
- }
323
- updateFileUploadWithForm(column, controls) {
324
- if (column.extend) {
325
- controls.forEach((control) => {
326
- if (control.binding = column.bindingField) {
327
- control.fieldCode = column.field;
328
- control.formControlId = column.title;
329
- control["defaultI18nValue"] = column.title;
330
- if (column.editor && column.editor.require) {
331
- control['require'] = true;
332
- }
333
- }
334
- });
335
- }
336
- }
337
- getControlTitleValue(component, defaultKey = "title") {
338
- if (component && component[defaultKey]) {
339
- return component[defaultKey];
340
- }
341
- return null;
342
- }
343
- handleValidProps(node, form) {
344
- if (!node || !form || (!node.contents && !node.fields)) {
345
- return;
346
- }
347
- if (node.contents) {
348
- node.contents.forEach((content) => {
349
- if (content.binding && content.binding.type == 'Form' && content.binding.path) {
350
- this.handleInputValidProps(content, form);
351
- }
352
- else {
353
- this.handleValidProps(content, form);
354
- }
355
- });
356
- }
357
- else {
358
- node.fields.forEach((field) => {
359
- if (field.editor && field.editor.binding) {
360
- this.handleInputValidProps(field.editor, form);
361
- }
362
- });
363
- }
364
- }
365
- handleInputValidProps(input, form) {
366
- const control = form.controls.find((item) => item.name === input.binding.path);
367
- if (!control) {
368
- return;
369
- }
370
- const keys = 'maxValue,minValue,require,formatValidation';
371
- Object.keys(input).forEach(key => {
372
- if (keys.includes(key)) {
373
- if (key === "require") {
374
- if (this.checkRequireHasTrueValue(input[key])) {
375
- control[key] = input[key];
376
- input.needValid = true;
377
- }
378
- }
379
- else {
380
- if (toolhepler_1.ToolHelper.isNullOrUndefined(input[key]) == false && input[key] !== "") {
381
- control[key] = input[key];
382
- input.needValid = true;
383
- }
384
- }
385
- }
386
- });
387
- if (input.type == "NumericBox") {
388
- const maxValueKey = "maxValue";
389
- if (!control[maxValueKey] && control[maxValueKey] != 0) {
390
- control[maxValueKey] = Number.MAX_VALUE;
391
- input.needValid = true;
392
- }
393
- const minValueKey = "minValue";
394
- if (!control[minValueKey] && control[minValueKey] != 0) {
395
- control[minValueKey] = -Number.MAX_VALUE;
396
- input.needValid = true;
397
- }
398
- }
399
- if (input["bigNumber"]) {
400
- control["bigNumber"] = input["bigNumber"];
401
- }
402
- const voField = control.voField;
403
- if (voField && voField.fieldSchema) {
404
- if (voField.fieldSchema.require) {
405
- input.needValid = true;
406
- }
407
- }
408
- const field = control.field;
409
- if (!field) {
410
- return;
411
- }
412
- if (field.required || (field.length !== undefined && field.length !== null)) {
413
- input.needValid = true;
414
- }
415
- }
416
- checkRequireHasTrueValue(requireValue) {
417
- if (toolhepler_1.ToolHelper.isNullOrUndefinedOrEmpty(requireValue)) {
418
- return false;
419
- }
420
- if (toolhepler_1.ToolHelper.isBinding(requireValue) && (requireValue.value === "true" || requireValue.value === true)) {
421
- return true;
422
- }
423
- if (requireValue === "true" || requireValue === true) {
424
- return true;
425
- }
426
- return false;
427
- }
428
- analysisCommand(commands, form_metadata_command_node, serviceRefs, moduleCode) {
429
- if (!commands || commands.length == 0) {
430
- return;
431
- }
432
- if (form_metadata_command_node && form_metadata_command_node.cmpId && commands && commands[form_metadata_command_node.cmpId]) {
433
- form_metadata_command_node.handlers = [];
434
- const c = lodash_1.default.find(commands[form_metadata_command_node.cmpId].Commands, function (o) {
435
- return o.Code == form_metadata_command_node.handlerName;
436
- });
437
- if (!c) {
438
- logger_helper_1.LoggerHelper.log(`form ${moduleCode},handler name: ${form_metadata_command_node.handlerName} can not found specific command`, logger_level_1.LoggerLevel.Warning);
439
- }
440
- else {
441
- this.mappingCommands(serviceRefs, c.Items, form_metadata_command_node, 0);
442
- if (!form_metadata_command_node.handlers || form_metadata_command_node.handlers.length == 0) {
443
- throw new Error(`command name:${form_metadata_command_node.name}, code:${form_metadata_command_node.code} can not found handler:${form_metadata_command_node.handlerName} `);
444
- }
445
- this.mappingParams(c.Parameters, form_metadata_command_node);
446
- }
447
- }
448
- else {
449
- throw new Error(`Commands analysis Error! Command Metadata is null, or Command node is null in form Metadata,the form is ${moduleCode}, ${form_metadata_command_node.handlerName} command not exists !`);
450
- }
451
- }
452
- analysisServices(obj, serviceRefs) {
453
- if (obj.cmd && toolhepler_1.ToolHelper.isArray(obj.cmd.serviceList, false)) {
454
- obj.cmd.serviceList.forEach((s) => {
455
- if (lodash_1.default.findIndex(serviceRefs, function (o) {
456
- return o.name == s.ClassName && o.cmpId == s.Id;
457
- }) < 0) {
458
- serviceRefs.push({
459
- name: s.ClassName,
460
- path: s.Source,
461
- cmpId: s.Id,
462
- isCommon: s.IsCommon ? "1" : "0",
463
- alias: s.ClassName + "1"
464
- });
465
- }
466
- });
467
- }
468
- serviceRefs.forEach((s) => {
469
- const filters = lodash_1.default.filter(serviceRefs, function (o) {
470
- return o.alias == s.alias && o.cmpId != s.Id;
471
- });
472
- if (filters && filters.length) {
473
- for (let i = 0; i < filters.length; i++) {
474
- if (i == 0)
475
- continue;
476
- filters[i].alias = filters[i].alias + "1";
477
- }
478
- }
479
- });
480
- }
481
- mappingCommands(serviceRefs, items, form_metadata_command_node, level) {
482
- const handlerList = [];
483
- this.mappingHandlers(serviceRefs, items, form_metadata_command_node, handlerList, level);
484
- return handlerList;
485
- }
486
- mappingParams(items, form_metadata_command_node) {
487
- const params = form_metadata_command_node.params;
488
- if (!params || !params.length || !items || !items.length) {
489
- return;
490
- }
491
- const paramDescriptions = [];
492
- params.forEach((p) => {
493
- const paramDefine = items.find(item => item.Code === p.name);
494
- if (!paramDefine) {
495
- return;
496
- }
497
- paramDescriptions.push({ name: p.name, type: paramDefine.ParameterType });
498
- });
499
- if (paramDescriptions.length) {
500
- form_metadata_command_node.paramDescriptions = paramDescriptions;
501
- }
502
- }
503
- mappingHandlers(serviceRefs, items, form_metadata_command_node, handlerList, level) {
504
- items.forEach((item) => {
505
- const handler = {};
506
- switch (item.Type + '') {
507
- case '0':
508
- handler['id'] = item.Content.Id;
509
- handler['type'] = 'executeNode';
510
- handler['name'] = item.Content.MethodName;
511
- handler['code'] = item.Content.Code;
512
- handler['method'] = item.Content.MethodCode;
513
- const findServiceRef = lodash_1.default.find(serviceRefs, function (o) {
514
- return o.cmpId == item.Content.ComponentId;
515
- });
516
- handler['serviceName'] = findServiceRef.alias;
517
- handler['params'] = [];
518
- if (item.Content.ParamConfigs && item.Content.ParamConfigs.length) {
519
- item.Content.ParamConfigs.forEach((p) => {
520
- handler['params'].push({
521
- name: p.ParamCode,
522
- shownName: p.ParamName,
523
- value: p.ParamExpress
524
- });
525
- });
526
- }
527
- if (level == 0) {
528
- form_metadata_command_node.handlers.push(handler);
529
- }
530
- handlerList.push(handler);
531
- if (form_metadata_command_node.extensions && form_metadata_command_node.extensions.length) {
532
- const extendNodes = lodash_1.default.filter(form_metadata_command_node.extensions, function (o) {
533
- return o.position == item.Content.Id;
534
- });
535
- if (extendNodes && extendNodes.length) {
536
- extendNodes.forEach(extendNode => {
537
- if (extendNode && extendNode.position == item.Content.Id) {
538
- extendNode.tasks.forEach((t) => {
539
- this.serviceAliasReplace(t, null, serviceRefs);
540
- });
541
- const index = form_metadata_command_node.handlers.findIndex((item) => item === handler);
542
- switch (extendNode.type) {
543
- case 'Replace':
544
- if (index > -1) {
545
- if (level == 0)
546
- form_metadata_command_node.handlers.splice(index, 1, ...extendNode.tasks);
547
- handlerList.splice(index, 1, ...extendNode.tasks);
548
- }
549
- break;
550
- case 'InsertBefore':
551
- if (index > -1) {
552
- if (level == 0) {
553
- form_metadata_command_node.handlers.splice(index, 0, ...extendNode.tasks);
554
- }
555
- handlerList.splice(index, 0, ...extendNode.tasks);
556
- }
557
- break;
558
- case 'InsertAfter':
559
- if (level == 0) {
560
- form_metadata_command_node.handlers.push(...extendNode.tasks);
561
- }
562
- handlerList.push(...extendNode.tasks);
563
- break;
564
- }
565
- }
566
- });
567
- }
568
- }
569
- break;
570
- case '2':
571
- handler['id'] = item.Content.Id;
572
- handler['type'] = 'switchNode';
573
- handler['name'] = item.Content.Name;
574
- handler['cases'] = [];
575
- level += 1;
576
- item.Content.Items.forEach((item1) => {
577
- const caseItem = {};
578
- caseItem['id'] = item1.Id;
579
- caseItem['name'] = item1.Name;
580
- caseItem['condition'] = item1.Express;
581
- caseItem['handlers'] = this.mappingCommands(serviceRefs, item1.Items, form_metadata_command_node, level);
582
- handler['cases'].push(caseItem);
583
- });
584
- form_metadata_command_node.handlers.push(handler);
585
- level -= 1;
586
- break;
587
- }
588
- });
589
- }
590
- getDeclarationState(code, declarationStates) {
591
- if (!code || !declarationStates || toolhepler_1.ToolHelper.isArray(declarationStates) == false) {
592
- return;
593
- }
594
- const declarationState = declarationStates.find((item) => {
595
- if (code == item.code) {
596
- return item;
597
- }
598
- });
599
- return declarationState;
600
- }
601
- serviceAliasReplace(item, items, serviceRefs) {
602
- if (item) {
603
- if (item.cases && item.cases.length) {
604
- item.cases.forEach((case1) => {
605
- this.serviceAliasReplace(null, case1.handlers, serviceRefs);
606
- });
607
- }
608
- else {
609
- const findServiceRef = lodash_1.default.find(serviceRefs, function (o) {
610
- return o.cmpId == item.serviceRefId;
611
- });
612
- if (!findServiceRef) {
613
- throw new Error("对应命令不存在,请检查。元数据信息为:" + JSON.stringify(item));
614
- }
615
- item.serviceName = findServiceRef.alias;
616
- }
617
- }
618
- else {
619
- items.forEach((t) => {
620
- if (t.cases && t.cases.length) {
621
- t.cases.forEach((case1) => {
622
- this.serviceAliasReplace(null, case1.handlers, serviceRefs);
623
- });
624
- }
625
- else {
626
- t.serviceName = lodash_1.default.find(serviceRefs, function (o) {
627
- return o.cmpId == t.serviceRefId;
628
- }).alias;
629
- }
630
- });
631
- }
632
- }
633
- }
634
- exports.ViewModelsCreator = ViewModelsCreator;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ViewModelsCreator = void 0;
7
+ const toolhepler_1 = require("../toolhepler");
8
+ const lodash_1 = __importDefault(require("lodash"));
9
+ const handlers_creator_1 = require("./handlers-creator");
10
+ const statemachine_creator_1 = require("./statemachine-creator");
11
+ const form_creator_1 = require("./form-creator");
12
+ const component_creator_1 = require("./component-creator");
13
+ const abstract_dom_creator_1 = require("./abstract-dom-creator");
14
+ const devkit_object_name_creator_1 = require("./devkit-object-name-creator");
15
+ const logger_helper_1 = require("../logger/logger-helper");
16
+ const logger_level_1 = require("../logger/logger-level");
17
+ const devkit_constant_1 = require("./devkit-constant");
18
+ const component_parameter_creator_1 = require("./component-parameter-creator");
19
+ const entities_creator_1 = require("./entities-creator");
20
+ class ViewModelsCreator {
21
+ constructor() {
22
+ }
23
+ static getNewInstance() {
24
+ return new ViewModelsCreator();
25
+ }
26
+ createViewModels(viewModelParameter) {
27
+ var _a;
28
+ const { serviceRefs, viewModelList, i18nResourceKeyPrefix, externalComponentNameSpace, componentList, eapi, metaDataConfig, parentExternalComponent, customClass, subscriptions, declarationCommands, declarationStates } = this.initParameter(viewModelParameter);
29
+ this.analysisServices(viewModelParameter, serviceRefs);
30
+ const runMode = (_a = viewModelParameter.ui.options) === null || _a === void 0 ? void 0 : _a.runMode;
31
+ viewModelList.forEach((item) => {
32
+ item["formGroupName"] = item["name"];
33
+ item["name"] = toolhepler_1.ToolHelper.tf(item.id);
34
+ item[devkit_constant_1.DevkitConstant.ResourcePrefixKey] = i18nResourceKeyPrefix;
35
+ if (toolhepler_1.ToolHelper.isArray(serviceRefs, false)) {
36
+ item["serviceRefs"] = serviceRefs;
37
+ }
38
+ if (toolhepler_1.ToolHelper.isArray(item["commands"]) == true) {
39
+ this.executeCmdWithViewModel(item, viewModelParameter, serviceRefs);
40
+ }
41
+ this.executeStateMachineWithViewModel(item, viewModelParameter);
42
+ const form = this.executeFormWithViewModel(item, viewModelParameter);
43
+ const component = componentList[lodash_1.default.findIndex(componentList, function (o) {
44
+ return o.viewModel == item.id;
45
+ })];
46
+ if (component) {
47
+ if (component.componentType == "dataGrid") {
48
+ component["relatedSchema"] = viewModelParameter.ui.module.schemas[0];
49
+ }
50
+ if (form && toolhepler_1.ToolHelper.isArray(form.controls, false)) {
51
+ this.updateComponentIdWithForm(component, form.controls);
52
+ }
53
+ component["moduleSchemaId"] = viewModelParameter.ui.module.schemas[0].id;
54
+ item["component"] = component_creator_1.ComponentCreator.getNewInstance().createComponent(component, item, viewModelParameter.mainEntityCode, eapi, metaDataConfig, viewModelParameter.ui, i18nResourceKeyPrefix, externalComponentNameSpace);
55
+ if (toolhepler_1.ToolHelper.isArray(viewModelParameter.ui.module.moduleReference, false)) {
56
+ item["component"]["moduleReference"] = viewModelParameter.ui.module.moduleReference;
57
+ }
58
+ item["component"]["dynamic"] = component.dynamic;
59
+ item["component"]["onInit"] = component.onInit;
60
+ item["component"]["afterViewInit"] = component.afterViewInit;
61
+ item['dom'] = abstract_dom_creator_1.AbstractDomCreator.getNewInstance().createAbsctractDOM(component, item, i18nResourceKeyPrefix, externalComponentNameSpace);
62
+ item["component"]["parentExternalComponent"] = parentExternalComponent;
63
+ item["component"]["onInitDeclarationEvents"] = component.onInitDeclarationEvents;
64
+ item["component"]["afterViewInitDeclarationEvents"] = component.afterViewInitDeclarationEvents;
65
+ item["component"]["enableUnifiedSession"] = item["enableUnifiedSession"];
66
+ item["component"]["runMode"] = runMode;
67
+ item["component"]["customComponentClass"] = this.getComponentClass(customClass, component.id);
68
+ if (viewModelParameter.isJointSearch) {
69
+ item["component"]["isJointSearch"] = viewModelParameter.isJointSearch;
70
+ }
71
+ this.executeComponentSubscriptions(component, subscriptions, parentExternalComponent, viewModelParameter, declarationCommands, declarationStates, componentList, item);
72
+ }
73
+ });
74
+ viewModelList.forEach((item) => {
75
+ item.children = [];
76
+ viewModelList.forEach((item1) => {
77
+ if (item.id == item1.parent) {
78
+ const name = item1.name.substring(0, 1).toLowerCase() + item1.name.substring(1);
79
+ item.children.push({ name: name, class: item1.name });
80
+ }
81
+ if (!toolhepler_1.ToolHelper.isNullOrUndefined(item1.parentModalViewModel)) {
82
+ if (item.id == item1.parentModalViewModel) {
83
+ const name = item1.name.substring(0, 1).toLowerCase() + item1.name.substring(1);
84
+ item.children.push({ name: name, class: item1.name });
85
+ }
86
+ }
87
+ });
88
+ if (item.component && item.component.template && item.form) {
89
+ if (toolhepler_1.ToolHelper.isArray(item.component.template, true)) {
90
+ item.component.template.forEach((itemTemplate) => {
91
+ this.handleValidProps(itemTemplate, item.form);
92
+ });
93
+ }
94
+ else {
95
+ this.handleValidProps(item.component.template, item.form);
96
+ }
97
+ }
98
+ if (!toolhepler_1.ToolHelper.isNullOrUndefinedOrEmpty(item.allowEmpty)) {
99
+ const relateEntity = entities_creator_1.EntitiesCreator.getSingleInstance().getEntityInfoByBindto(viewModelParameter.entity, item.bindTo, false);
100
+ if (relateEntity) {
101
+ relateEntity.allowEmpty = item.allowEmpty;
102
+ }
103
+ }
104
+ });
105
+ return viewModelList;
106
+ }
107
+ initParameter(viewModelParameter) {
108
+ const uiModule = viewModelParameter.ui.module;
109
+ const componentList = uiModule.components;
110
+ const viewModelList = uiModule.viewmodels;
111
+ const serviceRefs = uiModule.serviceRefs || [];
112
+ const metaDataConfig = viewModelParameter.metaDataConfig;
113
+ const eapi = viewModelParameter.eapi;
114
+ let subscriptions = uiModule.subscriptions || [];
115
+ const parentSubscriptions = viewModelParameter.parentExternalComponent ? viewModelParameter.parentExternalComponent.parentSubscriptions : null;
116
+ if (parentSubscriptions && parentSubscriptions.length > 0) {
117
+ subscriptions = subscriptions.concat(parentSubscriptions);
118
+ }
119
+ const parentExternalComponent = viewModelParameter.parentExternalComponent;
120
+ const declarations = viewModelParameter.ui.module.declarations;
121
+ const declarationCommands = declarations ? (declarations.commands ? declarations.commands : []) : [];
122
+ let declarationStates = [];
123
+ if (declarations) {
124
+ declarationStates = declarations.states;
125
+ }
126
+ const i18nResourceKeyPrefix = viewModelParameter.i18nResourcePrefix;
127
+ const externalComponentNameSpace = viewModelParameter.externalComponentNameSpace;
128
+ const customClass = viewModelParameter.ui.module.customClass;
129
+ return {
130
+ serviceRefs, viewModelList, i18nResourceKeyPrefix, externalComponentNameSpace, componentList, eapi,
131
+ metaDataConfig, parentExternalComponent, customClass, subscriptions, declarationCommands, declarationStates
132
+ };
133
+ }
134
+ executeComponentSubscriptions(component, subscriptions, parentExternalComponent, viewModelParameter, declarationCommands, declarationStates, componentList, item) {
135
+ if (toolhepler_1.ToolHelper.isArray(subscriptions, false)) {
136
+ const filteredSubscriptions = [];
137
+ subscriptions.forEach((subscription) => {
138
+ if ((parentExternalComponent &&
139
+ (subscription.targetComponent == parentExternalComponent.id)) ||
140
+ subscription.targetComponent == viewModelParameter.ui.module.id) {
141
+ const invokeComponentId = subscription.invokeComponentId;
142
+ if (toolhepler_1.ToolHelper.isNullOrUndefined(invokeComponentId) == false) {
143
+ if (component.id != invokeComponentId) {
144
+ return true;
145
+ }
146
+ subscription.useInvokeComponentId = true;
147
+ }
148
+ else if (component_parameter_creator_1.ComponentParameterCreator.checkIsFrame(component) == false) {
149
+ return true;
150
+ }
151
+ subscription.isFrame = component_parameter_creator_1.ComponentParameterCreator.checkIsFrame(component);
152
+ declarationCommands.forEach((commandItem) => {
153
+ if (commandItem.code == subscription.invoke) {
154
+ subscription.command = commandItem;
155
+ }
156
+ });
157
+ const paramMapCollection = [];
158
+ if (subscription.paramMappings && subscription.paramMappings.length) {
159
+ subscription.paramMappings.forEach((paramMapping) => {
160
+ let targetComponentId;
161
+ const targetViewModelName = this.extractParamMappingTargetViewModelName(paramMapping);
162
+ if (targetViewModelName) {
163
+ const findComponent = componentList.find((componentItem) => {
164
+ return componentItem.viewModel == targetViewModelName;
165
+ });
166
+ if (findComponent) {
167
+ targetComponentId = findComponent.id;
168
+ }
169
+ }
170
+ const declarationState = this.getDeclarationState(paramMapping.targetCode, declarationStates);
171
+ if (declarationState) {
172
+ const paramMap = {
173
+ frameID: subscription.targetComponent,
174
+ from: paramMapping.sourceCode,
175
+ to: declarationState.state,
176
+ targetType: paramMapping.targetType,
177
+ targetComponentId: targetComponentId
178
+ };
179
+ paramMapCollection.push(paramMap);
180
+ }
181
+ });
182
+ }
183
+ subscription["paramMapCollection"] = paramMapCollection;
184
+ filteredSubscriptions.push(subscription);
185
+ }
186
+ else {
187
+ if (!subscription["token"] && viewModelParameter.ui.module && viewModelParameter.ui.module.declarations && viewModelParameter.ui.module.declarations.events && viewModelParameter.ui.module.declarations.events.length > 0) {
188
+ const findDeclaration = viewModelParameter.ui.module.declarations.events.find((pd) => {
189
+ return pd.code == subscription.subscribeOn && subscription.sourceComponent == pd.currentFrmCode;
190
+ });
191
+ if (findDeclaration) {
192
+ subscription["token"] = findDeclaration["token"];
193
+ }
194
+ }
195
+ }
196
+ });
197
+ item["component"]["componentSubscriptions"] = filteredSubscriptions;
198
+ }
199
+ }
200
+ extractParamMappingTargetViewModelName(paramMapping) {
201
+ const targetPath = paramMapping.targetPath;
202
+ let targetViewModelName;
203
+ if (targetPath) {
204
+ const arrTargetPath = targetPath.split(".");
205
+ if (toolhepler_1.ToolHelper.isArray(arrTargetPath, false)) {
206
+ targetViewModelName = arrTargetPath[0];
207
+ }
208
+ }
209
+ return targetViewModelName;
210
+ }
211
+ executeFormWithViewModel(item, viewModelParameter) {
212
+ const form = form_creator_1.FormCreator.getNewInstance().createForm(devkit_object_name_creator_1.DevkitObjectNameCreator.getDevkitObjectNameWithType("f", item.name), item.fields, viewModelParameter.entity, item);
213
+ if (form) {
214
+ item["form"] = form;
215
+ }
216
+ return form;
217
+ }
218
+ executeStateMachineWithViewModel(item, viewModelParameter) {
219
+ const stateMachineName = item["stateMachine"];
220
+ if (stateMachineName && viewModelParameter.sm && viewModelParameter.sm[stateMachineName]) {
221
+ item["stateMachine"] = statemachine_creator_1.StateMachineCreator.getNewInstance().createStateMachine(devkit_object_name_creator_1.DevkitObjectNameCreator.getDevkitObjectNameWithType("sm", item.name), viewModelParameter.sm[stateMachineName]);
222
+ }
223
+ else {
224
+ item["stateMachine"] = null;
225
+ }
226
+ }
227
+ executeCmdWithViewModel(item, viewModelParameter, serviceRefs) {
228
+ item["commands"].forEach((c) => {
229
+ this.analysisCommand(viewModelParameter.cmd.commands, c, serviceRefs, viewModelParameter.ui.module.code);
230
+ const result = [];
231
+ const queue = [];
232
+ if (c.handlers && c.handlers.length) {
233
+ if (!c.links) {
234
+ c.links = [];
235
+ }
236
+ handlers_creator_1.HandlersCreator.getNewInstance().createHandlers(c.links, result, c.handlers, 0);
237
+ }
238
+ if (c.links && c.links.length && (c.links instanceof Array)) {
239
+ c.links.forEach((item, index) => {
240
+ if (item.level == 0 && lodash_1.default.findIndex(queue, function (o) {
241
+ return o.from == item.from;
242
+ }) < 0) {
243
+ item["index"] = index;
244
+ queue.push(item);
245
+ }
246
+ });
247
+ c.links.forEach((item, i) => {
248
+ if (!item.to) {
249
+ for (let j = 0; j < queue.length; j++) {
250
+ if (queue[j].index > i) {
251
+ item.to = queue[j].from;
252
+ break;
253
+ }
254
+ }
255
+ }
256
+ });
257
+ lodash_1.default.remove(c.links, function (n) {
258
+ return n.to == '' || n.to == null || n.to == undefined;
259
+ });
260
+ }
261
+ c.handlers = result;
262
+ });
263
+ }
264
+ getComponentClass(moduleCustomClass, componentId) {
265
+ if (!moduleCustomClass || !componentId) {
266
+ return "";
267
+ }
268
+ let componentClass = "";
269
+ Object.keys(moduleCustomClass).forEach((item) => {
270
+ if (item === componentId) {
271
+ componentClass = moduleCustomClass[item];
272
+ }
273
+ });
274
+ return componentClass;
275
+ }
276
+ updateComponentIdWithForm(component, controls) {
277
+ if (component && component.binding && component.binding.field) {
278
+ controls.forEach((control) => {
279
+ if (control.fieldId == component.binding.field) {
280
+ control.formControlId = component.id;
281
+ let titleValue;
282
+ if (component.type == "GridField" || component.type == "TreeGridField") {
283
+ control.fieldCode = component.dataField;
284
+ titleValue = this.getControlTitleValue(component, "caption");
285
+ }
286
+ else {
287
+ control.fieldCode = component.id;
288
+ titleValue = this.getControlTitleValue(component, "title");
289
+ }
290
+ if (titleValue) {
291
+ control["defaultI18nValue"] = titleValue;
292
+ }
293
+ }
294
+ });
295
+ }
296
+ if (component && (component.type == "DataGrid" || component.type == "TreeGrid") && toolhepler_1.ToolHelper.isArray(component.fields, false)) {
297
+ component.fields.forEach((field) => {
298
+ this.updateComponentIdWithForm(field, controls);
299
+ });
300
+ }
301
+ if (component && (component.type === "FileUploadPreview") && toolhepler_1.ToolHelper.isArray(component.previewColumns, false)) {
302
+ component.previewColumns.forEach((column) => {
303
+ this.updateFileUploadWithForm(column, controls);
304
+ });
305
+ }
306
+ if (component && toolhepler_1.ToolHelper.isArray(component.contents, false)) {
307
+ component.contents.forEach((element) => {
308
+ this.updateComponentIdWithForm(element, controls);
309
+ });
310
+ }
311
+ if (component && component.type === 'Table' && toolhepler_1.ToolHelper.isArray(component.rows, false)) {
312
+ component.rows.forEach((itemRow) => {
313
+ if (toolhepler_1.ToolHelper.isArray(itemRow.columns, false)) {
314
+ itemRow.columns.forEach((itemColumn) => {
315
+ if (itemColumn.tdType === 'editor' && itemColumn.editor) {
316
+ this.updateComponentIdWithForm(itemColumn["editor"], controls);
317
+ }
318
+ });
319
+ }
320
+ });
321
+ }
322
+ }
323
+ updateFileUploadWithForm(column, controls) {
324
+ if (column.extend) {
325
+ controls.forEach((control) => {
326
+ if (control.binding = column.bindingField) {
327
+ control.fieldCode = column.field;
328
+ control.formControlId = column.title;
329
+ control["defaultI18nValue"] = column.title;
330
+ if (column.editor && column.editor.require) {
331
+ control['require'] = true;
332
+ }
333
+ }
334
+ });
335
+ }
336
+ }
337
+ getControlTitleValue(component, defaultKey = "title") {
338
+ if (component && component[defaultKey]) {
339
+ return component[defaultKey];
340
+ }
341
+ return null;
342
+ }
343
+ handleValidProps(node, form) {
344
+ if (!node || !form || (!node.contents && !node.fields)) {
345
+ return;
346
+ }
347
+ if (node.contents) {
348
+ node.contents.forEach((content) => {
349
+ if (content.binding && content.binding.type == 'Form' && content.binding.path) {
350
+ this.handleInputValidProps(content, form);
351
+ }
352
+ else {
353
+ this.handleValidProps(content, form);
354
+ }
355
+ });
356
+ }
357
+ else {
358
+ node.fields.forEach((field) => {
359
+ if (field.editor && field.editor.binding) {
360
+ this.handleInputValidProps(field.editor, form);
361
+ }
362
+ });
363
+ }
364
+ }
365
+ handleInputValidProps(input, form) {
366
+ const control = form.controls.find((item) => item.name === input.binding.path);
367
+ if (!control) {
368
+ return;
369
+ }
370
+ const keys = 'maxValue,minValue,require,formatValidation';
371
+ Object.keys(input).forEach(key => {
372
+ if (keys.includes(key)) {
373
+ if (key === "require") {
374
+ if (this.checkRequireHasTrueValue(input[key])) {
375
+ control[key] = input[key];
376
+ input.needValid = true;
377
+ }
378
+ }
379
+ else {
380
+ if (toolhepler_1.ToolHelper.isNullOrUndefined(input[key]) == false && input[key] !== "") {
381
+ control[key] = input[key];
382
+ input.needValid = true;
383
+ }
384
+ }
385
+ }
386
+ });
387
+ if (input.type == "NumericBox") {
388
+ const maxValueKey = "maxValue";
389
+ if (!control[maxValueKey] && control[maxValueKey] != 0) {
390
+ control[maxValueKey] = Number.MAX_VALUE;
391
+ input.needValid = true;
392
+ }
393
+ const minValueKey = "minValue";
394
+ if (!control[minValueKey] && control[minValueKey] != 0) {
395
+ control[minValueKey] = -Number.MAX_VALUE;
396
+ input.needValid = true;
397
+ }
398
+ }
399
+ if (input["bigNumber"]) {
400
+ control["bigNumber"] = input["bigNumber"];
401
+ }
402
+ const voField = control.voField;
403
+ if (voField && voField.fieldSchema) {
404
+ if (voField.fieldSchema.require) {
405
+ input.needValid = true;
406
+ }
407
+ }
408
+ const field = control.field;
409
+ if (!field) {
410
+ return;
411
+ }
412
+ if (field.required || (field.length !== undefined && field.length !== null)) {
413
+ input.needValid = true;
414
+ }
415
+ }
416
+ checkRequireHasTrueValue(requireValue) {
417
+ if (toolhepler_1.ToolHelper.isNullOrUndefinedOrEmpty(requireValue)) {
418
+ return false;
419
+ }
420
+ if (toolhepler_1.ToolHelper.isBinding(requireValue) && (requireValue.value === "true" || requireValue.value === true)) {
421
+ return true;
422
+ }
423
+ if (requireValue === "true" || requireValue === true) {
424
+ return true;
425
+ }
426
+ return false;
427
+ }
428
+ analysisCommand(commands, form_metadata_command_node, serviceRefs, moduleCode) {
429
+ if (!commands || commands.length == 0) {
430
+ return;
431
+ }
432
+ if (form_metadata_command_node && form_metadata_command_node.cmpId && commands && commands[form_metadata_command_node.cmpId]) {
433
+ form_metadata_command_node.handlers = [];
434
+ const c = lodash_1.default.find(commands[form_metadata_command_node.cmpId].Commands, function (o) {
435
+ return o.Code == form_metadata_command_node.handlerName;
436
+ });
437
+ if (!c) {
438
+ logger_helper_1.LoggerHelper.log(`form ${moduleCode},handler name: ${form_metadata_command_node.handlerName} can not found specific command`, logger_level_1.LoggerLevel.Warning);
439
+ }
440
+ else {
441
+ this.mappingCommands(serviceRefs, c.Items, form_metadata_command_node, 0);
442
+ if (!form_metadata_command_node.handlers || form_metadata_command_node.handlers.length == 0) {
443
+ throw new Error(`command name:${form_metadata_command_node.name}, code:${form_metadata_command_node.code} can not found handler:${form_metadata_command_node.handlerName} `);
444
+ }
445
+ this.mappingParams(c.Parameters, form_metadata_command_node);
446
+ }
447
+ }
448
+ else {
449
+ throw new Error(`Commands analysis Error! Command Metadata is null, or Command node is null in form Metadata,the form is ${moduleCode}, ${form_metadata_command_node.handlerName} command not exists !`);
450
+ }
451
+ }
452
+ analysisServices(obj, serviceRefs) {
453
+ if (obj.cmd && toolhepler_1.ToolHelper.isArray(obj.cmd.serviceList, false)) {
454
+ obj.cmd.serviceList.forEach((s) => {
455
+ if (lodash_1.default.findIndex(serviceRefs, function (o) {
456
+ return o.name == s.ClassName && o.cmpId == s.Id;
457
+ }) < 0) {
458
+ serviceRefs.push({
459
+ name: s.ClassName,
460
+ path: s.Source,
461
+ cmpId: s.Id,
462
+ isCommon: s.IsCommon ? "1" : "0",
463
+ alias: s.ClassName + "1"
464
+ });
465
+ }
466
+ });
467
+ }
468
+ serviceRefs.forEach((s) => {
469
+ const filters = lodash_1.default.filter(serviceRefs, function (o) {
470
+ return o.alias == s.alias && o.cmpId != s.Id;
471
+ });
472
+ if (filters && filters.length) {
473
+ for (let i = 0; i < filters.length; i++) {
474
+ if (i == 0)
475
+ continue;
476
+ filters[i].alias = filters[i].alias + "1";
477
+ }
478
+ }
479
+ });
480
+ }
481
+ mappingCommands(serviceRefs, items, form_metadata_command_node, level) {
482
+ const handlerList = [];
483
+ this.mappingHandlers(serviceRefs, items, form_metadata_command_node, handlerList, level);
484
+ return handlerList;
485
+ }
486
+ mappingParams(items, form_metadata_command_node) {
487
+ const params = form_metadata_command_node.params;
488
+ if (!params || !params.length || !items || !items.length) {
489
+ return;
490
+ }
491
+ const paramDescriptions = [];
492
+ params.forEach((p) => {
493
+ const paramDefine = items.find(item => item.Code === p.name);
494
+ if (!paramDefine) {
495
+ return;
496
+ }
497
+ paramDescriptions.push({ name: p.name, type: paramDefine.ParameterType });
498
+ });
499
+ if (paramDescriptions.length) {
500
+ form_metadata_command_node.paramDescriptions = paramDescriptions;
501
+ }
502
+ }
503
+ mappingHandlers(serviceRefs, items, form_metadata_command_node, handlerList, level) {
504
+ items.forEach((item) => {
505
+ const handler = {};
506
+ switch (item.Type + '') {
507
+ case '0':
508
+ handler['id'] = item.Content.Id;
509
+ handler['type'] = 'executeNode';
510
+ handler['name'] = item.Content.MethodName;
511
+ handler['code'] = item.Content.Code;
512
+ handler['method'] = item.Content.MethodCode;
513
+ const findServiceRef = lodash_1.default.find(serviceRefs, function (o) {
514
+ return o.cmpId == item.Content.ComponentId;
515
+ });
516
+ handler['serviceName'] = findServiceRef.alias;
517
+ handler['params'] = [];
518
+ if (item.Content.ParamConfigs && item.Content.ParamConfigs.length) {
519
+ item.Content.ParamConfigs.forEach((p) => {
520
+ handler['params'].push({
521
+ name: p.ParamCode,
522
+ shownName: p.ParamName,
523
+ value: p.ParamExpress
524
+ });
525
+ });
526
+ }
527
+ if (level == 0) {
528
+ form_metadata_command_node.handlers.push(handler);
529
+ }
530
+ handlerList.push(handler);
531
+ if (form_metadata_command_node.extensions && form_metadata_command_node.extensions.length) {
532
+ const extendNodes = lodash_1.default.filter(form_metadata_command_node.extensions, function (o) {
533
+ return o.position == item.Content.Id;
534
+ });
535
+ if (extendNodes && extendNodes.length) {
536
+ extendNodes.forEach(extendNode => {
537
+ if (extendNode && extendNode.position == item.Content.Id) {
538
+ extendNode.tasks.forEach((t) => {
539
+ this.serviceAliasReplace(t, null, serviceRefs);
540
+ });
541
+ const index = form_metadata_command_node.handlers.findIndex((item) => item === handler);
542
+ switch (extendNode.type) {
543
+ case 'Replace':
544
+ if (index > -1) {
545
+ if (level == 0)
546
+ form_metadata_command_node.handlers.splice(index, 1, ...extendNode.tasks);
547
+ handlerList.splice(index, 1, ...extendNode.tasks);
548
+ }
549
+ break;
550
+ case 'InsertBefore':
551
+ if (index > -1) {
552
+ if (level == 0) {
553
+ form_metadata_command_node.handlers.splice(index, 0, ...extendNode.tasks);
554
+ }
555
+ handlerList.splice(index, 0, ...extendNode.tasks);
556
+ }
557
+ break;
558
+ case 'InsertAfter':
559
+ if (level == 0) {
560
+ form_metadata_command_node.handlers.push(...extendNode.tasks);
561
+ }
562
+ handlerList.push(...extendNode.tasks);
563
+ break;
564
+ }
565
+ }
566
+ });
567
+ }
568
+ }
569
+ break;
570
+ case '2':
571
+ handler['id'] = item.Content.Id;
572
+ handler['type'] = 'switchNode';
573
+ handler['name'] = item.Content.Name;
574
+ handler['cases'] = [];
575
+ level += 1;
576
+ item.Content.Items.forEach((item1) => {
577
+ const caseItem = {};
578
+ caseItem['id'] = item1.Id;
579
+ caseItem['name'] = item1.Name;
580
+ caseItem['condition'] = item1.Express;
581
+ caseItem['handlers'] = this.mappingCommands(serviceRefs, item1.Items, form_metadata_command_node, level);
582
+ handler['cases'].push(caseItem);
583
+ });
584
+ form_metadata_command_node.handlers.push(handler);
585
+ level -= 1;
586
+ break;
587
+ }
588
+ });
589
+ }
590
+ getDeclarationState(code, declarationStates) {
591
+ if (!code || !declarationStates || toolhepler_1.ToolHelper.isArray(declarationStates) == false) {
592
+ return;
593
+ }
594
+ const declarationState = declarationStates.find((item) => {
595
+ if (code == item.code) {
596
+ return item;
597
+ }
598
+ });
599
+ return declarationState;
600
+ }
601
+ serviceAliasReplace(item, items, serviceRefs) {
602
+ if (item) {
603
+ if (item.cases && item.cases.length) {
604
+ item.cases.forEach((case1) => {
605
+ this.serviceAliasReplace(null, case1.handlers, serviceRefs);
606
+ });
607
+ }
608
+ else {
609
+ const findServiceRef = lodash_1.default.find(serviceRefs, function (o) {
610
+ return o.cmpId == item.serviceRefId;
611
+ });
612
+ if (!findServiceRef) {
613
+ throw new Error("对应命令不存在,请检查。元数据信息为:" + JSON.stringify(item));
614
+ }
615
+ item.serviceName = findServiceRef.alias;
616
+ }
617
+ }
618
+ else {
619
+ items.forEach((t) => {
620
+ if (t.cases && t.cases.length) {
621
+ t.cases.forEach((case1) => {
622
+ this.serviceAliasReplace(null, case1.handlers, serviceRefs);
623
+ });
624
+ }
625
+ else {
626
+ t.serviceName = lodash_1.default.find(serviceRefs, function (o) {
627
+ return o.cmpId == t.serviceRefId;
628
+ }).alias;
629
+ }
630
+ });
631
+ }
632
+ }
633
+ }
634
+ exports.ViewModelsCreator = ViewModelsCreator;
635
635
  //# sourceMappingURL=viewmodels-creator.js.map