arco-support-request 0.0.64 → 0.0.65

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 (410) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +18 -0
  3. package/package.json +11 -22
  4. package/src/lib/Pipe/allpipe.pipe.ts +127 -0
  5. package/src/lib/Pipe/handlebar-helper-register.ts +197 -0
  6. package/src/lib/Pipe/translate.pipe.ts +32 -0
  7. package/src/lib/all-routing.ts +61 -0
  8. package/src/lib/arco-support-request.component.spec.ts +25 -0
  9. package/src/lib/arco-support-request.component.ts +20 -0
  10. package/src/lib/arco-support-request.module.ts +19 -0
  11. package/src/lib/arco-support-request.service.spec.ts +16 -0
  12. package/src/lib/arco-support-request.service.ts +16 -0
  13. package/src/lib/commonstyles/new-style-rtl.css +381 -0
  14. package/src/lib/commonstyles/styles.scss +3984 -0
  15. package/src/lib/core/encodeurl.service.ts +23 -0
  16. package/src/lib/core/global.service.ts +1810 -0
  17. package/src/lib/core/handlebar-helper-register.ts +213 -0
  18. package/src/lib/core/httpcancel.service.ts +21 -0
  19. package/src/lib/core/loader.service.ts +19 -0
  20. package/src/lib/core/loading-provider.service.ts +64 -0
  21. package/src/lib/core/managehttp.interceptor.ts +49 -0
  22. package/src/lib/core/static/jwt.ts +7 -0
  23. package/src/lib/core/token.service.ts +37 -0
  24. package/src/lib/entity-type-setup/activities-create/activities-create.component.html +68 -0
  25. package/src/lib/entity-type-setup/activities-create/activities-create.component.scss +0 -0
  26. package/src/lib/entity-type-setup/activities-create/activities-create.component.spec.ts +25 -0
  27. package/src/lib/entity-type-setup/activities-create/activities-create.component.ts +121 -0
  28. package/src/lib/entity-type-setup/activities-view/activities-view.component.html +19 -0
  29. package/src/lib/entity-type-setup/activities-view/activities-view.component.scss +3 -0
  30. package/src/lib/entity-type-setup/activities-view/activities-view.component.spec.ts +25 -0
  31. package/src/lib/entity-type-setup/activities-view/activities-view.component.ts +53 -0
  32. package/src/lib/entity-type-setup/activity-template/activity-template.component.html +73 -0
  33. package/src/lib/entity-type-setup/activity-template/activity-template.component.scss +0 -0
  34. package/src/lib/entity-type-setup/activity-template/activity-template.component.spec.ts +25 -0
  35. package/src/lib/entity-type-setup/activity-template/activity-template.component.ts +208 -0
  36. package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.html +356 -0
  37. package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.scss +50 -0
  38. package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.spec.ts +25 -0
  39. package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.ts +346 -0
  40. package/src/lib/entity-type-setup/commom-condition/commom-condition.component.html +92 -0
  41. package/src/lib/entity-type-setup/commom-condition/commom-condition.component.scss +90 -0
  42. package/src/lib/entity-type-setup/commom-condition/commom-condition.component.spec.ts +25 -0
  43. package/src/lib/entity-type-setup/commom-condition/commom-condition.component.ts +74 -0
  44. package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.html +57 -0
  45. package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.scss +16 -0
  46. package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.spec.ts +25 -0
  47. package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.ts +59 -0
  48. package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.html +102 -0
  49. package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.scss +3 -0
  50. package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.spec.ts +25 -0
  51. package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.ts +498 -0
  52. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.html +408 -0
  53. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.scss +123 -0
  54. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.spec.ts +25 -0
  55. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.ts +1051 -0
  56. package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/validation-error.component.ts +84 -0
  57. package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.html +194 -0
  58. package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.scss +81 -0
  59. package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.spec.ts +25 -0
  60. package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.ts +1466 -0
  61. package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.html +137 -0
  62. package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.scss +0 -0
  63. package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.spec.ts +25 -0
  64. package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.ts +1232 -0
  65. package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.html +329 -0
  66. package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.scss +0 -0
  67. package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.spec.ts +25 -0
  68. package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.ts +520 -0
  69. package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.html +609 -0
  70. package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.scss +99 -0
  71. package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.spec.ts +25 -0
  72. package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.ts +784 -0
  73. package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.html +632 -0
  74. package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.scss +261 -0
  75. package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.spec.ts +25 -0
  76. package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.ts +765 -0
  77. package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.html +368 -0
  78. package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.scss +0 -0
  79. package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.spec.ts +25 -0
  80. package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.ts +334 -0
  81. package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.html +500 -0
  82. package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.scss +0 -0
  83. package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.spec.ts +25 -0
  84. package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.ts +862 -0
  85. package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.html +139 -0
  86. package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.scss +14 -0
  87. package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.spec.ts +25 -0
  88. package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.ts +347 -0
  89. package/src/lib/entity-type-setup/entity-category-activities/entity-category-activities.component.html +150 -0
  90. package/src/lib/entity-type-setup/entity-category-activities/entity-category-activities.component.scss +27 -0
  91. package/src/lib/entity-type-setup/entity-category-activities/entity-category-activities.component.ts +384 -0
  92. package/src/lib/entity-type-setup/entity-category-details/entity-category-details.component.html +305 -0
  93. package/src/lib/entity-type-setup/entity-category-details/entity-category-details.component.scss +31 -0
  94. package/src/lib/entity-type-setup/entity-category-details/entity-category-details.component.ts +572 -0
  95. package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.html +610 -0
  96. package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.scss +50 -0
  97. package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.spec.ts +25 -0
  98. package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.ts +633 -0
  99. package/src/lib/entity-type-setup/entity-type-field/entity-type-field.component.html +609 -0
  100. package/src/lib/entity-type-setup/entity-type-field/entity-type-field.component.scss +4 -0
  101. package/src/lib/entity-type-setup/entity-type-field/entity-type-field.component.ts +702 -0
  102. package/src/lib/entity-type-setup/entity-type-form/entity-type-form.component.html +530 -0
  103. package/src/lib/entity-type-setup/entity-type-form/entity-type-form.component.scss +12 -0
  104. package/src/lib/entity-type-setup/entity-type-form/entity-type-form.component.ts +767 -0
  105. package/src/lib/entity-type-setup/entity-type-setup-routing.module.ts +92 -0
  106. package/src/lib/entity-type-setup/entity-type-setup.module.ts +114 -0
  107. package/src/lib/entity-type-setup/events/events.component.html +211 -0
  108. package/src/lib/entity-type-setup/events/events.component.scss +61 -0
  109. package/src/lib/entity-type-setup/events/events.component.spec.ts +25 -0
  110. package/src/lib/entity-type-setup/events/events.component.ts +517 -0
  111. package/src/lib/entity-type-setup/field-type/field-type.component.html +447 -0
  112. package/src/lib/entity-type-setup/field-type/field-type.component.scss +0 -0
  113. package/src/lib/entity-type-setup/field-type/field-type.component.spec.ts +25 -0
  114. package/src/lib/entity-type-setup/field-type/field-type.component.ts +531 -0
  115. package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.html +152 -0
  116. package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.scss +24 -0
  117. package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.spec.ts +25 -0
  118. package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.ts +35 -0
  119. package/src/lib/entity-type-setup/instruction/instruction.component.html +239 -0
  120. package/src/lib/entity-type-setup/instruction/instruction.component.scss +18 -0
  121. package/src/lib/entity-type-setup/instruction/instruction.component.ts +450 -0
  122. package/src/lib/entity-type-setup/interface/entityTypeInterface.ts +1045 -0
  123. package/src/lib/entity-type-setup/interface/eventEnum.ts +191 -0
  124. package/src/lib/entity-type-setup/issue-group/issue-group.component.html +77 -0
  125. package/src/lib/entity-type-setup/issue-group/issue-group.component.scss +0 -0
  126. package/src/lib/entity-type-setup/issue-group/issue-group.component.ts +221 -0
  127. package/src/lib/entity-type-setup/issue-sub-group/issue-sub-group.component.html +192 -0
  128. package/src/lib/entity-type-setup/issue-sub-group/issue-sub-group.component.scss +10 -0
  129. package/src/lib/entity-type-setup/issue-sub-group/issue-sub-group.component.ts +418 -0
  130. package/src/lib/entity-type-setup/issue-sub-group-detail/issue-sub-group-detail.component.html +42 -0
  131. package/src/lib/entity-type-setup/issue-sub-group-detail/issue-sub-group-detail.component.scss +8 -0
  132. package/src/lib/entity-type-setup/issue-sub-group-detail/issue-sub-group-detail.component.ts +52 -0
  133. package/src/lib/entity-type-setup/my-task/my-task.component.html +599 -0
  134. package/src/lib/entity-type-setup/my-task/my-task.component.scss +0 -0
  135. package/src/lib/entity-type-setup/my-task/my-task.component.spec.ts +25 -0
  136. package/src/lib/entity-type-setup/my-task/my-task.component.ts +770 -0
  137. package/src/lib/entity-type-setup/page-form-instance.ts +73 -0
  138. package/src/lib/entity-type-setup/page.interface.classes.ts +43 -0
  139. package/src/lib/entity-type-setup/service/dropdown.directive.ts +12 -0
  140. package/src/lib/entity-type-setup/service/entity-type-setup.service.ts +2821 -0
  141. package/src/lib/entity-type-setup/task-crete/task-crete.component.html +61 -0
  142. package/src/lib/entity-type-setup/task-crete/task-crete.component.scss +0 -0
  143. package/src/lib/entity-type-setup/task-crete/task-crete.component.ts +117 -0
  144. package/src/lib/entity-type-setup/ticket-create/ticket-create.component.html +95 -0
  145. package/src/lib/entity-type-setup/ticket-create/ticket-create.component.scss +23 -0
  146. package/src/lib/entity-type-setup/ticket-create/ticket-create.component.spec.ts +25 -0
  147. package/src/lib/entity-type-setup/ticket-create/ticket-create.component.ts +213 -0
  148. package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.html +222 -0
  149. package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.scss +14 -0
  150. package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.spec.ts +25 -0
  151. package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.ts +328 -0
  152. package/src/lib/search.pipe.spec.ts +8 -0
  153. package/src/lib/search.pipe.ts +21 -0
  154. package/src/lib/support-request/action/action.component.html +122 -0
  155. package/src/lib/support-request/action/action.component.scss +6 -0
  156. package/src/lib/support-request/action/action.component.ts +179 -0
  157. package/src/lib/support-request/case-list/case-list.component.html +220 -0
  158. package/src/lib/support-request/case-list/case-list.component.scss +208 -0
  159. package/src/lib/support-request/case-list/case-list.component.ts +433 -0
  160. package/src/lib/support-request/home/home.component.html +16 -0
  161. package/src/lib/support-request/home/home.component.scss +4 -0
  162. package/src/lib/support-request/home/home.component.ts +23 -0
  163. package/src/lib/support-request/pagination/pagination.component.html +71 -0
  164. package/src/lib/support-request/pagination/pagination.component.scss +77 -0
  165. package/src/lib/support-request/pagination/pagination.component.ts +29 -0
  166. package/src/lib/support-request/request-flow/request-flow.component.html +330 -0
  167. package/src/lib/support-request/request-flow/request-flow.component.scss +2 -0
  168. package/src/lib/support-request/request-flow/request-flow.component.ts +846 -0
  169. package/src/lib/support-request/self-service-flow/self-service-flow.component.html +64 -0
  170. package/src/lib/support-request/self-service-flow/self-service-flow.component.scss +2 -0
  171. package/src/lib/support-request/self-service-flow/self-service-flow.component.ts +87 -0
  172. package/src/lib/support-request/support-request-create/support-request-create.component.html +103 -0
  173. package/src/lib/support-request/support-request-create/support-request-create.component.scss +39 -0
  174. package/src/lib/support-request/support-request-create/support-request-create.component.ts +319 -0
  175. package/src/lib/support-request/support-request-details/support-request-details.component.html +268 -0
  176. package/src/lib/support-request/support-request-details/support-request-details.component.scss +319 -0
  177. package/src/lib/support-request/support-request-details/support-request-details.component.ts +678 -0
  178. package/src/lib/support-request/support-request-index/support-request-index.component.html +4 -0
  179. package/src/lib/support-request/support-request-index/support-request-index.component.scss +0 -0
  180. package/src/lib/support-request/support-request-index/support-request-index.component.ts +16 -0
  181. package/src/lib/support-request/support-request-list/support-request-list.component.html +455 -0
  182. package/src/lib/support-request/support-request-list/support-request-list.component.scss +0 -0
  183. package/src/lib/support-request/support-request-list/support-request-list.component.ts +869 -0
  184. package/src/lib/support-request/support-request-routing.module.ts +21 -0
  185. package/src/lib/support-request/support-request.module.ts +103 -0
  186. package/src/lib/support-request/support-request.service.ts +145 -0
  187. package/src/lib/support-request/supportRequestInterface.ts +6 -0
  188. package/src/lib/task/Interfaces/TaskInterface.ts +164 -0
  189. package/src/lib/task/Services/task.service.spec.ts +16 -0
  190. package/src/lib/task/Services/task.service.ts +354 -0
  191. package/src/lib/task/task-routing.module.ts +12 -0
  192. package/src/lib/task/task.module.ts +23 -0
  193. package/src/lib/template/template.component.html +22 -0
  194. package/src/lib/template/template.component.scss +0 -0
  195. package/src/lib/template/template.component.spec.ts +25 -0
  196. package/src/lib/template/template.component.ts +24 -0
  197. package/src/lib/templates/attachmentsetup/attach-list/attach-list.component.html +83 -0
  198. package/src/lib/templates/attachmentsetup/attach-list/attach-list.component.scss +0 -0
  199. package/src/lib/templates/attachmentsetup/attach-list/attach-list.component.ts +120 -0
  200. package/src/lib/templates/attachmentsetup/attach-popup/attach-popup.component.html +134 -0
  201. package/src/lib/templates/attachmentsetup/attach-popup/attach-popup.component.scss +0 -0
  202. package/src/lib/templates/attachmentsetup/attach-popup/attach-popup.component.ts +185 -0
  203. package/src/lib/templates/attachmentsetup/attachment-api.ts +55 -0
  204. package/src/lib/templates/attachmentsetup/attachment-interface.ts +100 -0
  205. package/src/lib/templates/attachmentsetup/attachment.service.ts +233 -0
  206. package/src/lib/templates/attachmentsetup/attachmentsetup/attachmentsetup.component.html +97 -0
  207. package/src/lib/templates/attachmentsetup/attachmentsetup/attachmentsetup.component.scss +10 -0
  208. package/src/lib/templates/attachmentsetup/attachmentsetup/attachmentsetup.component.ts +367 -0
  209. package/src/lib/templates/attachmentsetup/documenttype/documenttype.component.html +49 -0
  210. package/src/lib/templates/attachmentsetup/documenttype/documenttype.component.scss +0 -0
  211. package/src/lib/templates/attachmentsetup/documenttype/documenttype.component.ts +226 -0
  212. package/src/lib/templates/attachmentsetup/menu-item-data/menu-item-data.component.html +140 -0
  213. package/src/lib/templates/attachmentsetup/menu-item-data/menu-item-data.component.scss +8 -0
  214. package/src/lib/templates/attachmentsetup/menu-item-data/menu-item-data.component.ts +176 -0
  215. package/src/lib/templates/card/card.component.html +56 -0
  216. package/src/lib/templates/card/card.component.scss +0 -0
  217. package/src/lib/templates/card/card.component.spec.ts +25 -0
  218. package/src/lib/templates/card/card.component.ts +306 -0
  219. package/src/lib/templates/dashboard/dashboard.component.html +333 -0
  220. package/src/lib/templates/dashboard/dashboard.component.scss +16 -0
  221. package/src/lib/templates/dashboard/dashboard.component.ts +2290 -0
  222. package/src/lib/templates/details/details.component.html +233 -0
  223. package/src/lib/templates/details/details.component.scss +0 -0
  224. package/src/lib/templates/details/details.component.spec.ts +25 -0
  225. package/src/lib/templates/details/details.component.ts +15 -0
  226. package/src/lib/templates/detailstwo/detailstwo.component.html +694 -0
  227. package/src/lib/templates/detailstwo/detailstwo.component.scss +0 -0
  228. package/src/lib/templates/detailstwo/detailstwo.component.spec.ts +25 -0
  229. package/src/lib/templates/detailstwo/detailstwo.component.ts +15 -0
  230. package/src/lib/templates/dyanamic-page/dyanamic-page.component.html +1 -0
  231. package/src/lib/templates/dyanamic-page/dyanamic-page.component.scss +0 -0
  232. package/src/lib/templates/dyanamic-page/dyanamic-page.component.spec.ts +25 -0
  233. package/src/lib/templates/dyanamic-page/dyanamic-page.component.ts +15 -0
  234. package/src/lib/templates/grid/grid-datatype/grid-datatype.component.ts +39 -0
  235. package/src/lib/templates/grid/grid-service.service.ts +140 -0
  236. package/src/lib/templates/grid/grid.component.html +270 -0
  237. package/src/lib/templates/grid/grid.component.scss +99 -0
  238. package/src/lib/templates/grid/grid.component.spec.ts +25 -0
  239. package/src/lib/templates/grid/grid.component.ts +458 -0
  240. package/src/lib/templates/grid/inner-grid/inner-grid.component.html +1 -0
  241. package/src/lib/templates/grid/inner-grid/inner-grid.component.scss +0 -0
  242. package/src/lib/templates/grid/inner-grid/inner-grid.component.spec.ts +25 -0
  243. package/src/lib/templates/grid/inner-grid/inner-grid.component.ts +15 -0
  244. package/src/lib/templates/home/home.component.html +251 -0
  245. package/src/lib/templates/home/home.component.scss +20 -0
  246. package/src/lib/templates/home/home.component.spec.ts +25 -0
  247. package/src/lib/templates/home/home.component.ts +15 -0
  248. package/src/lib/templates/interface_enum/common-Interface.ts +107 -0
  249. package/src/lib/templates/interface_enum/common-enum.ts +147 -0
  250. package/src/lib/templates/interface_enum/icon-class.ts +1149 -0
  251. package/src/lib/templates/leftside/leftside.component.html +77 -0
  252. package/src/lib/templates/leftside/leftside.component.scss +0 -0
  253. package/src/lib/templates/leftside/leftside.component.spec.ts +25 -0
  254. package/src/lib/templates/leftside/leftside.component.ts +238 -0
  255. package/src/lib/templates/login/login.component.html +93 -0
  256. package/src/lib/templates/login/login.component.scss +110 -0
  257. package/src/lib/templates/login/login.component.spec.ts +25 -0
  258. package/src/lib/templates/login/login.component.ts +142 -0
  259. package/src/lib/templates/main-content/main-content.component.html +31 -0
  260. package/src/lib/templates/main-content/main-content.component.scss +6 -0
  261. package/src/lib/templates/main-content/main-content.component.spec.ts +25 -0
  262. package/src/lib/templates/main-content/main-content.component.ts +24 -0
  263. package/src/lib/templates/menu-item/child-menu/child-menu.component.html +5 -0
  264. package/src/lib/templates/menu-item/child-menu/child-menu.component.scss +3 -0
  265. package/src/lib/templates/menu-item/child-menu/child-menu.component.ts +22 -0
  266. package/src/lib/templates/menu-item/menu-item.component.html +25 -0
  267. package/src/lib/templates/menu-item/menu-item.component.scss +11 -0
  268. package/src/lib/templates/menu-item/menu-item.component.ts +29 -0
  269. package/src/lib/templates/pagination/pagination.component.html +71 -0
  270. package/src/lib/templates/pagination/pagination.component.scss +73 -0
  271. package/src/lib/templates/pagination/pagination.component.ts +29 -0
  272. package/src/lib/templates/pie-chart/pie-chart.component.html +0 -0
  273. package/src/lib/templates/pie-chart/pie-chart.component.scss +0 -0
  274. package/src/lib/templates/pie-chart/pie-chart.component.ts +14 -0
  275. package/src/lib/templates/pipe/multiple-search.pipe.ts +28 -0
  276. package/src/lib/templates/pipe/simple-search.pipe.ts +18 -0
  277. package/src/lib/templates/pipe/translate.pipe.ts +31 -0
  278. package/src/lib/templates/request-flow-dash/request-flow-dash.component.html +16 -0
  279. package/src/lib/templates/request-flow-dash/request-flow-dash.component.scss +0 -0
  280. package/src/lib/templates/request-flow-dash/request-flow-dash.component.spec.ts +25 -0
  281. package/src/lib/templates/request-flow-dash/request-flow-dash.component.ts +59 -0
  282. package/src/lib/templates/table/table.component.html +310 -0
  283. package/src/lib/templates/table/table.component.scss +0 -0
  284. package/src/lib/templates/table/table.component.spec.ts +25 -0
  285. package/src/lib/templates/table/table.component.ts +52 -0
  286. package/src/lib/templates/template.service.ts +43 -0
  287. package/src/lib/templates/templates-routing.module.ts +21 -0
  288. package/src/lib/templates/templates.module.ts +80 -0
  289. package/src/lib/templates/topnav/topnav.component.html +172 -0
  290. package/src/lib/templates/topnav/topnav.component.scss +10 -0
  291. package/src/lib/templates/topnav/topnav.component.spec.ts +25 -0
  292. package/src/lib/templates/topnav/topnav.component.ts +59 -0
  293. package/src/lib/ticket/_interfaces/master-models.ts +66 -0
  294. package/src/lib/ticket/_interfaces/model.ts +252 -0
  295. package/src/lib/ticket/_ticket-services/ticket-api.service.ts +319 -0
  296. package/src/lib/ticket/_ticket-services/ticket-master-api.service.ts +169 -0
  297. package/src/lib/ticket/_ticket-services/ticket-priority.service.ts +86 -0
  298. package/src/lib/ticket/_ticket-services/ticketchannel.service.ts +107 -0
  299. package/src/lib/ticket/ticket-routing.module.ts +12 -0
  300. package/src/lib/ticket/ticket.module.ts +29 -0
  301. package/{public-api.d.ts → src/public-api.ts} +6 -1
  302. package/src/test.ts +26 -0
  303. package/tsconfig.lib.json +25 -0
  304. package/tsconfig.lib.prod.json +10 -0
  305. package/tsconfig.spec.json +17 -0
  306. package/tslint.json +17 -0
  307. package/arco-support-request.d.ts +0 -32
  308. package/arco-support-request.metadata.json +0 -1
  309. package/bundles/arco-support-request.umd.js +0 -10935
  310. package/bundles/arco-support-request.umd.js.map +0 -1
  311. package/bundles/arco-support-request.umd.min.js +0 -2
  312. package/bundles/arco-support-request.umd.min.js.map +0 -1
  313. package/esm2015/arco-support-request.js +0 -33
  314. package/esm2015/lib/Pipe/allpipe.pipe.js +0 -110
  315. package/esm2015/lib/Pipe/translate.pipe.js +0 -31
  316. package/esm2015/lib/arco-support-request.component.js +0 -18
  317. package/esm2015/lib/arco-support-request.module.js +0 -20
  318. package/esm2015/lib/arco-support-request.service.js +0 -19
  319. package/esm2015/lib/core/global.service.js +0 -1747
  320. package/esm2015/lib/core/handlebar-helper-register.js +0 -182
  321. package/esm2015/lib/core/static/jwt.js +0 -8
  322. package/esm2015/lib/entity-type-setup/activities-create/activities-create.component.js +0 -105
  323. package/esm2015/lib/entity-type-setup/activities-view/activities-view.component.js +0 -46
  324. package/esm2015/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.js +0 -367
  325. package/esm2015/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.js +0 -850
  326. package/esm2015/lib/entity-type-setup/dynamic/entity-dynamic-field/validation-error.component.js +0 -85
  327. package/esm2015/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.js +0 -957
  328. package/esm2015/lib/entity-type-setup/interface/entityTypeInterface.js +0 -51
  329. package/esm2015/lib/entity-type-setup/interface/eventEnum.js +0 -84
  330. package/esm2015/lib/entity-type-setup/page-form-instance.js +0 -65
  331. package/esm2015/lib/entity-type-setup/page.interface.classes.js +0 -40
  332. package/esm2015/lib/entity-type-setup/service/entity-type-setup.service.js +0 -1833
  333. package/esm2015/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.js +0 -276
  334. package/esm2015/lib/search.pipe.js +0 -19
  335. package/esm2015/lib/support-request/action/action.component.js +0 -104
  336. package/esm2015/lib/support-request/case-list/case-list.component.js +0 -390
  337. package/esm2015/lib/support-request/home/home.component.js +0 -23
  338. package/esm2015/lib/support-request/pagination/pagination.component.js +0 -34
  339. package/esm2015/lib/support-request/request-flow/request-flow.component.js +0 -684
  340. package/esm2015/lib/support-request/self-service-flow/self-service-flow.component.js +0 -78
  341. package/esm2015/lib/support-request/support-request-create/support-request-create.component.js +0 -270
  342. package/esm2015/lib/support-request/support-request-details/support-request-details.component.js +0 -508
  343. package/esm2015/lib/support-request/support-request-index/support-request-index.component.js +0 -16
  344. package/esm2015/lib/support-request/support-request-routing.module.js +0 -22
  345. package/esm2015/lib/support-request/support-request.module.js +0 -98
  346. package/esm2015/lib/support-request/support-request.service.js +0 -105
  347. package/esm2015/lib/support-request/supportRequestInterface.js +0 -2
  348. package/esm2015/lib/task/Interfaces/TaskInterface.js +0 -7
  349. package/esm2015/lib/task/Services/task.service.js +0 -251
  350. package/esm2015/lib/templates/Pipe/translate.pipe.js +0 -31
  351. package/esm2015/lib/templates/attachmentsetup/attachment-interface.js +0 -2
  352. package/esm2015/lib/templates/attachmentsetup/attachment.service.js +0 -196
  353. package/esm2015/lib/templates/grid/grid-datatype/grid-datatype.component.js +0 -37
  354. package/esm2015/lib/templates/grid/grid-service.service.js +0 -85
  355. package/esm2015/lib/templates/grid/grid.component.js +0 -436
  356. package/esm2015/lib/templates/grid/inner-grid/inner-grid.component.js +0 -15
  357. package/esm2015/lib/templates/interface_enum/common-Interface.js +0 -2
  358. package/esm2015/lib/templates/interface_enum/common-enum.js +0 -153
  359. package/esm2015/lib/ticket/_interfaces/model.js +0 -2
  360. package/esm2015/lib/ticket/_ticket-services/ticket-api.service.js +0 -232
  361. package/esm2015/public-api.js +0 -9
  362. package/fesm2015/arco-support-request.js +0 -10335
  363. package/fesm2015/arco-support-request.js.map +0 -1
  364. package/lib/Pipe/allpipe.pipe.d.ts +0 -19
  365. package/lib/Pipe/translate.pipe.d.ts +0 -7
  366. package/lib/arco-support-request.component.d.ts +0 -5
  367. package/lib/arco-support-request.module.d.ts +0 -2
  368. package/lib/arco-support-request.service.d.ts +0 -9
  369. package/lib/core/global.service.d.ts +0 -78
  370. package/lib/core/handlebar-helper-register.d.ts +0 -1
  371. package/lib/core/static/jwt.d.ts +0 -7
  372. package/lib/entity-type-setup/activities-create/activities-create.component.d.ts +0 -30
  373. package/lib/entity-type-setup/activities-view/activities-view.component.d.ts +0 -16
  374. package/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.d.ts +0 -67
  375. package/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.d.ts +0 -88
  376. package/lib/entity-type-setup/dynamic/entity-dynamic-field/validation-error.component.d.ts +0 -11
  377. package/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.d.ts +0 -69
  378. package/lib/entity-type-setup/interface/entityTypeInterface.d.ts +0 -916
  379. package/lib/entity-type-setup/interface/eventEnum.d.ts +0 -161
  380. package/lib/entity-type-setup/page-form-instance.d.ts +0 -13
  381. package/lib/entity-type-setup/page.interface.classes.d.ts +0 -33
  382. package/lib/entity-type-setup/service/entity-type-setup.service.d.ts +0 -604
  383. package/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.d.ts +0 -66
  384. package/lib/search.pipe.d.ts +0 -4
  385. package/lib/support-request/action/action.component.d.ts +0 -31
  386. package/lib/support-request/case-list/case-list.component.d.ts +0 -91
  387. package/lib/support-request/home/home.component.d.ts +0 -6
  388. package/lib/support-request/pagination/pagination.component.d.ts +0 -18
  389. package/lib/support-request/request-flow/request-flow.component.d.ts +0 -143
  390. package/lib/support-request/self-service-flow/self-service-flow.component.d.ts +0 -31
  391. package/lib/support-request/support-request-create/support-request-create.component.d.ts +0 -55
  392. package/lib/support-request/support-request-details/support-request-details.component.d.ts +0 -116
  393. package/lib/support-request/support-request-index/support-request-index.component.d.ts +0 -5
  394. package/lib/support-request/support-request-routing.module.d.ts +0 -2
  395. package/lib/support-request/support-request.module.d.ts +0 -2
  396. package/lib/support-request/support-request.service.d.ts +0 -35
  397. package/lib/support-request/supportRequestInterface.d.ts +0 -6
  398. package/lib/task/Interfaces/TaskInterface.d.ts +0 -132
  399. package/lib/task/Services/task.service.d.ts +0 -75
  400. package/lib/templates/Pipe/translate.pipe.d.ts +0 -7
  401. package/lib/templates/attachmentsetup/attachment-interface.d.ts +0 -90
  402. package/lib/templates/attachmentsetup/attachment.service.d.ts +0 -61
  403. package/lib/templates/grid/grid-datatype/grid-datatype.component.d.ts +0 -11
  404. package/lib/templates/grid/grid-service.service.d.ts +0 -40
  405. package/lib/templates/grid/grid.component.d.ts +0 -155
  406. package/lib/templates/grid/inner-grid/inner-grid.component.d.ts +0 -5
  407. package/lib/templates/interface_enum/common-Interface.d.ts +0 -90
  408. package/lib/templates/interface_enum/common-enum.d.ts +0 -129
  409. package/lib/ticket/_interfaces/model.d.ts +0 -192
  410. package/lib/ticket/_ticket-services/ticket-api.service.d.ts +0 -81
@@ -0,0 +1,1232 @@
1
+ import { Component, OnInit, Output,Input,EventEmitter } from '@angular/core';
2
+ import { Validators } from '@angular/forms';
3
+ import { FormGroup,FormBuilder } from '@angular/forms';
4
+ import { ActivatedRoute, Router } from '@angular/router';
5
+ import { Observable } from 'rxjs';
6
+ import { E_DataType } from '../../../templates/interface_enum/common-enum';
7
+ import Swal from 'sweetalert2';
8
+ import { EntityTypeFieldVM, EntityTypeFormVM, FieldValidators } from '../../interface/entityTypeInterface';
9
+ import { PageForm } from '../../page-form-instance';
10
+ import { PageDetailsRow } from '../../page.interface.classes';
11
+ import { EntityTypeSetupService } from '../../service/entity-type-setup.service';
12
+ import * as handlebars from 'handlebars';
13
+ import { errorMessageType, GlobalService } from '../../../core/global.service';
14
+
15
+ import { TranslatePipe } from '../../../Pipe/translate.pipe';
16
+ import { registerHandlebarHelperMethods } from '../../../core/handlebar-helper-register';
17
+
18
+ @Component({
19
+ selector: 'app-entity-dynamic-view',
20
+ templateUrl: './entity-dynamic-view.component.html',
21
+ styleUrls: ['./entity-dynamic-view.component.scss']
22
+ })
23
+ export class EntityDynamicViewComponent implements OnInit {
24
+
25
+ constructor(
26
+ private entityTypeSetup: EntityTypeSetupService,
27
+ private router: Router,
28
+ private fb: FormBuilder,
29
+ private route: ActivatedRoute,
30
+ private globalService: GlobalService,
31
+ ) { }
32
+
33
+ ngOnInit(): void {
34
+ this._handlebars = handlebars;
35
+ registerHandlebarHelperMethods(this._handlebars);
36
+ this.getEntityForm()
37
+ }
38
+
39
+ _handlebars:any;
40
+
41
+ @Input() RequestorField: any = null;
42
+ @Input() RequestorFieldValue: any = null;
43
+
44
+
45
+ @Input() EntityFormId: number;
46
+ @Input() Type:any;
47
+ @Input() ViewFrom:string="";
48
+ @Input() ModalSize:any ="modal-lg";
49
+ @Output() closeDynamicViewPopup: any = new EventEmitter();
50
+ @Output() submitFormValue: any = new EventEmitter<{ formdata: any,pageForm:any,forms?:any }>();
51
+ @Input() PageGroupValues:any ={};
52
+
53
+ @Input() ParameterData:any=null;
54
+
55
+ closePopup() {
56
+ this.closeDynamicViewPopup.emit();
57
+ }
58
+
59
+ _submitFormValue() {
60
+ let formvalue = this._PageForm.form.value;
61
+ let _forms = {
62
+ PageGroup: this.pageGroups,
63
+ defaultPageGroups: this.defaultPageGroups,
64
+ PageGroupValues: formvalue,
65
+ EntityFormId:this.EntityFormId,
66
+ OnSaveRules: this.OnSaveRules,
67
+ }
68
+ this.submitFormValue.emit({formdata:formvalue,pageForm:this._PageForm.form,forms:_forms});
69
+ }
70
+
71
+
72
+ OnSaveRules:any;
73
+ EntityTypeForm: EntityTypeFormVM;
74
+ pageGroups: PageDetailsRow[] = [];
75
+ defaultPageGroups: PageDetailsRow[] = [];
76
+ // PageGroupValues:any ={};
77
+
78
+
79
+ EntityTypeTemplateId =null;
80
+ getEntityForm() {
81
+ // alert("aa");
82
+
83
+ this.entityTypeSetup.getSingleEntityTypeFormById(this.EntityFormId).subscribe(
84
+ (res: any) => {
85
+ // alert("bb");
86
+
87
+ this.EntityTypeForm = res;
88
+ if (this.EntityTypeForm.FormData) {
89
+ let _FormData = JSON.parse(this.EntityTypeForm.FormData)
90
+
91
+ if (_FormData.PageGroup) {
92
+ if (Array.isArray(_FormData.PageGroup)) {
93
+ this.pageGroups = _FormData.PageGroup;
94
+ // this.setDDLValueOnEditMode();
95
+ }
96
+ }
97
+ if (_FormData.defaultPageGroups) {
98
+ this.EntityTypeTemplateId = _FormData.defaultPageGroups;
99
+ this.getAllDefaultEntityTypeForm(_FormData.defaultPageGroups);
100
+ }
101
+ else
102
+ this.defaultPageGroups = [];
103
+
104
+ // if (_FormData.defaultPageGroups) {
105
+ // if (Array.isArray(_FormData.defaultPageGroups)) {
106
+ // this.defaultPageGroups = _FormData.defaultPageGroups;
107
+ // }
108
+ // }
109
+
110
+ if (this.Type != 'Edit') {
111
+
112
+ if (_FormData.PageGroupValues)
113
+ this.PageGroupValues = _FormData.PageGroupValues;
114
+ else
115
+ this.PageGroupValues = {};
116
+ }
117
+ }
118
+
119
+ this.getAllRules(this.EntityTypeForm.EntityTypeId);
120
+
121
+ this.getFieldListByEntityType(this.EntityTypeForm.EntityTypeId);
122
+
123
+
124
+ },
125
+ (error) => {
126
+
127
+ console.log(error);
128
+ }
129
+ )
130
+ }
131
+
132
+
133
+ EntityFieldList: EntityTypeFieldVM[] = [];
134
+ getFieldListByEntityType(EntityTypeId) {
135
+
136
+
137
+ this.entityTypeSetup.getAllEntityTypeField(null, EntityTypeId)
138
+ .subscribe((res: any) => {
139
+
140
+ this.EntityFieldList = res.Data;
141
+ this.buildReactiveForm();
142
+ // this.TempFieldValidators();
143
+ },
144
+ (error) => {
145
+
146
+ console.log(error);
147
+ });
148
+ }
149
+
150
+ getAllDefaultEntityTypeForm(EntityTypeId) {
151
+
152
+ this.entityTypeSetup.getActiveEntityForm(EntityTypeId).subscribe(
153
+ (res: any) => {
154
+
155
+
156
+ if (res && res.FormData) {
157
+ let _FormData = JSON.parse(res.FormData);
158
+
159
+ if (_FormData.PageGroup){
160
+ if(Array.isArray(_FormData.PageGroup)) {
161
+ this.defaultPageGroups = _FormData.PageGroup;
162
+ }
163
+ }
164
+
165
+ this.buildReactiveForm()
166
+ }
167
+
168
+ },
169
+ (error) => {
170
+
171
+ Swal.fire({
172
+ title: this.translatePipe.transform('Template form not found'),
173
+ });
174
+ console.log(error);
175
+ }
176
+ )
177
+ }
178
+
179
+
180
+
181
+
182
+ _PageForm: PageForm = new PageForm(new FormGroup({}));
183
+ dynamicFormGroup: FormGroup;
184
+ submitted: boolean;
185
+
186
+
187
+
188
+ validationError(name: string, errorName: string) {
189
+ if (name && errorName)
190
+ return this.dynamicFormGroup.get(name).errors[errorName]
191
+ ? true : false
192
+ else
193
+ return this.dynamicFormGroup.get(name).errors
194
+ ? true : false
195
+ }
196
+
197
+ getType(_dataType: E_DataType | number) {
198
+ switch (_dataType) {
199
+ case E_DataType.int:
200
+ case E_DataType.decimal:
201
+ return "number";
202
+ case E_DataType.date:
203
+ return "date";
204
+ case E_DataType.dateTime:
205
+ return "datetime-local";
206
+ case E_DataType.timespan:
207
+ return "time";
208
+ case E_DataType.bool:
209
+ return "checkbox";
210
+ case E_DataType.string:
211
+ return "text";
212
+ case E_DataType.image:
213
+ return "file";
214
+
215
+ default:
216
+ return "text";
217
+ }
218
+ }
219
+
220
+
221
+
222
+ getAllFields() {
223
+
224
+ let fields:EntityTypeFieldVM[] =[];
225
+
226
+ for (let index = 0; index < this.pageGroups.length; index++) {
227
+ let Groups = this.pageGroups[index].Groups;
228
+ for (let i = 0; i < Groups.length; i++) {
229
+ fields.push(...Groups[i].Fields)
230
+ }
231
+ }
232
+
233
+ for (let index = 0; index < this.defaultPageGroups.length; index++) {
234
+ let Groups = this.defaultPageGroups[index].Groups;
235
+ for (let i = 0; i < Groups.length; i++) {
236
+ fields.push(...Groups[i].Fields)
237
+ }
238
+ }
239
+ return fields;
240
+
241
+ }
242
+
243
+
244
+ buildReactiveForm() {
245
+
246
+ let fields: EntityTypeFieldVM[] =this.getAllFields();
247
+
248
+ this._PageForm = new PageForm(this.createFormGroup(fields));
249
+ this.BindDesignFormData()
250
+
251
+ if(this.ViewFrom=="Details"){
252
+ this._submitFormValue();
253
+ }
254
+ this.setFieldsInPageGroupsForm()
255
+
256
+ if (this.Type != 'Edit') {
257
+
258
+ if (this.ParameterData) {
259
+
260
+ for (var key in this._PageForm.form.value) {
261
+ if (this.ParameterData[key]) {
262
+ this._PageForm.form.get(key).setValue(this.ParameterData[key], { onlySelf: false,entitySelf:true });
263
+ }
264
+ }
265
+ }
266
+
267
+ if (this.RequestorField && this.RequestorFieldValue) {
268
+
269
+ if(this._PageForm.form.get(this.RequestorField))
270
+ this._PageForm.form.get(this.RequestorField).setValue(this.RequestorFieldValue,{ onlySelf: false,entitySelf:true });
271
+ }
272
+
273
+ this.onFormInit(this.EntityTypeForm);
274
+
275
+ }
276
+ this.onFormSave(this.EntityTypeForm);
277
+
278
+ this.setDDLValueOnEditMode();
279
+ }
280
+
281
+
282
+ setFieldsInPageGroupsForm() {
283
+
284
+ if (!(this.EntityFieldList && this.EntityFieldList.length > 0))
285
+ return
286
+
287
+ this.pageGroups.map((PG) => {
288
+ PG.Groups.map((group) => {
289
+ group.Fields = group.Fields.map(PGF => this.EntityFieldList.find(f => f.Description === PGF.Description) || PGF);
290
+ })
291
+ })
292
+ this.defaultPageGroups.map((PG) => {
293
+ PG.Groups.map((group) => {
294
+ group.Fields = group.Fields.map(PGF => this.EntityFieldList.find(f => f.Description === PGF.Description) || PGF);
295
+ })
296
+ })
297
+ }
298
+
299
+
300
+ setDDLValueOnEditMode() {
301
+ if (this.PageGroupValues && this.PageGroupValues.RecId) {
302
+
303
+ this.pageGroups.map((PG) => {
304
+ PG.Groups.map((group) => {
305
+ group.Fields.map((x) => {
306
+ if (x.DataType == E_DataType.dropdown) {
307
+
308
+ let _field = x.Description + "_Desc"
309
+ if (_field in this.PageGroupValues) {
310
+
311
+ x.showSelectedValues = this.PageGroupValues[_field];
312
+ }
313
+ else {
314
+ x.showSelectedValues = this.PageGroupValues[x.Description];
315
+ }
316
+ }
317
+ });
318
+
319
+ })
320
+ })
321
+ this.defaultPageGroups.map((PG) => {
322
+ PG.Groups.map((group) => {
323
+ group.Fields.map((x) => {
324
+ if (x.DataType == E_DataType.dropdown) {
325
+
326
+ let _field = x.Description + "_Desc"
327
+ if (_field in this.PageGroupValues) {
328
+
329
+ x.showSelectedValues = this.PageGroupValues[_field];
330
+ }
331
+ else {
332
+ x.showSelectedValues = this.PageGroupValues[x.Description];
333
+ }
334
+ }
335
+ });
336
+
337
+ })
338
+ })
339
+
340
+ }
341
+ }
342
+
343
+
344
+
345
+ createFormGroup(fields: EntityTypeFieldVM[]) {
346
+ let form = this.fb.group({});
347
+ if (Array.isArray(fields) && fields.length > 0) {
348
+ for (const field of fields) {
349
+ const value = null;
350
+ if(field.IsMandatory)
351
+ form.addControl(field.Description,this.fb.control(value, Validators.required));
352
+ else
353
+ form.addControl(field.Description,this.fb.control(value));
354
+ }
355
+ }
356
+
357
+ if (this.EntityFieldList && this.EntityFieldList.length > 0) {
358
+ for (const field of this.EntityFieldList) {
359
+ const value = null;
360
+ if (!(field.Description in form.value))
361
+ form.addControl(field.Description, this.fb.control(value));
362
+ }
363
+ }
364
+
365
+ return form;
366
+ }
367
+
368
+ BindDesignFormData() {
369
+
370
+ this._PageForm.form.patchValue(this.PageGroupValues);
371
+ }
372
+
373
+ FieldChangeEvent(FieldData:EntityTypeFieldVM,RestData:any) {
374
+
375
+
376
+ this._submitFormValue()
377
+
378
+ let _rulesField = null;
379
+ if (this.AllRules && this.AllRules.FieldRules) {
380
+ _rulesField = this.AllRules.FieldRules;
381
+ _rulesField = _rulesField.filter(x=>(x.EntityTypeRecId ==this.EntityTypeForm.EntityTypeId || x.EntityTypeRecId ==this.EntityTypeTemplateId));
382
+ }
383
+ else {
384
+ return
385
+ }
386
+ let _currentFieldRule = _rulesField.filter(x=>x.Field==FieldData.Description)[0]
387
+
388
+ if (_currentFieldRule && _currentFieldRule.Rules) {
389
+ let rulesData = JSON.parse(_currentFieldRule.Rules);
390
+
391
+ if (Array.isArray(rulesData)) {
392
+
393
+
394
+ let _rulesData = rulesData.filter((x) => {
395
+ if (x.CurrentEntityTypeId) {
396
+ if (x.CurrentEntityTypeId.includes(this.EntityTypeForm.EntityTypeId))
397
+ return x;
398
+ }
399
+ else
400
+ return x;
401
+ });
402
+
403
+
404
+ for (let rI = 0; rI < _rulesData.length; rI++) {
405
+ this._fieldrulesImplement(_rulesData[rI],RestData,FieldData)
406
+ }
407
+ }
408
+ else
409
+ this._fieldrulesImplement(rulesData,RestData,FieldData)
410
+
411
+
412
+ }
413
+
414
+ }
415
+
416
+ _fieldrulesImplement(rulesData,RestData:any,FieldData) {
417
+
418
+ if (!rulesData || !rulesData.Condtion) {
419
+ return
420
+ }
421
+
422
+ let _condition = true;
423
+
424
+ for (let index = 0; index < rulesData.Condtion.length; index++) {
425
+
426
+
427
+ let _con = rulesData.Condtion[index];
428
+
429
+ let _Icondition = false;
430
+
431
+ let _fieldValue = this._PageForm.form.value[_con.Field];
432
+ if (FieldData.DataType == E_DataType.bool)
433
+ _fieldValue = _fieldValue.toString()
434
+
435
+ if (_con.FieldType && _con.FieldType == "Value") {
436
+ let _handleData = this._PageForm.form.value;
437
+ _handleData.data = RestData;
438
+ _handleData.currentLang = this.globalService.CurrentLanguage;
439
+ if (this.ParameterData)
440
+ _handleData.params = this.ParameterData;
441
+ _fieldValue = this.hanbleBarHtml(_con.Field, _handleData)
442
+ }
443
+
444
+ let value = (_con.Value == "FieldValue" ? this._PageForm.form.value[_con.ValueTwo] : _con.ValueTwo)
445
+
446
+ switch (_con.Type) {
447
+ case "Equal": {
448
+ _Icondition = (_fieldValue == value ? true : false)
449
+ break
450
+ }
451
+ case "NotEqual": {
452
+ _Icondition = (_fieldValue != value ? true : false)
453
+ break
454
+ }
455
+ case "LessThen": {
456
+ _Icondition = (_fieldValue < value ? true : false)
457
+ break
458
+ }
459
+ case "LessThenEqual": {
460
+ _Icondition = (_fieldValue <= value ? true : false)
461
+ break
462
+ }
463
+ case "GreaterThen": {
464
+ _Icondition = (_fieldValue > value ? true : false)
465
+ break
466
+ }
467
+ case "GreaterThenEqual": {
468
+ _Icondition = (_fieldValue >= value ? true : false)
469
+ break
470
+ }
471
+ case "IsNull": {
472
+ _Icondition = (_fieldValue == null ? true : false)
473
+ break
474
+ }
475
+ case "IsNotNull": {
476
+ _Icondition = (_fieldValue != null ? true : false)
477
+ break
478
+ }
479
+
480
+ default:
481
+ _Icondition = false
482
+ break
483
+ }
484
+
485
+
486
+ if (index > 0) {
487
+ if (rulesData.CondtionOperator == 1) {
488
+ _condition = (_condition && _Icondition ? true : false)
489
+ }
490
+ else {
491
+ _condition = (_condition || _Icondition ? true : false)
492
+ }
493
+ }
494
+ else {
495
+ _condition = _Icondition;
496
+ }
497
+
498
+ }
499
+
500
+
501
+
502
+ if (_condition) {
503
+
504
+ this.OnRulesApply(rulesData, RestData)
505
+ }
506
+
507
+ }
508
+
509
+
510
+ onFormSave(FormData) {
511
+
512
+ if (FormData.RulesData) {
513
+ let _formInitRule = JSON.parse(FormData.RulesData);
514
+ this.OnSaveRules = _formInitRule.filter(x => x.Type == "OnSave");
515
+ }
516
+ }
517
+
518
+ onFormInit(FormData,RestData?:any) {
519
+
520
+
521
+ if (FormData.RulesData) {
522
+ let _formInitRule = JSON.parse(FormData.RulesData);
523
+
524
+ let onInitRules = _formInitRule.filter(x => x.Type == "OnInit")
525
+
526
+ for (let index = 0; index < onInitRules.length; index++) {
527
+
528
+ // let rulesData = _formInitRule.filter(x => x.Type == "OnInit")[0];
529
+ let rulesData = onInitRules[index];
530
+
531
+
532
+ if (!rulesData) {
533
+ return
534
+ }
535
+
536
+ let _condition = true;
537
+
538
+ for (let index = 0; index < rulesData.Condtion.length; index++) {
539
+
540
+
541
+ let _con = rulesData.Condtion[index];
542
+
543
+ let _Icondition = false;
544
+
545
+ let _fieldValue = this._PageForm.form.value[_con.Field];
546
+ if (_con.FieldType && _con.FieldType == "Value") {
547
+ let _handleData = this._PageForm.form.value;
548
+ _handleData.data = RestData;
549
+ _handleData.currentLang = this.globalService.CurrentLanguage;
550
+ if (this.ParameterData)
551
+ _handleData.params = this.ParameterData;
552
+ _fieldValue = this.hanbleBarHtml(_con.Field, _handleData)
553
+ }
554
+
555
+ let value = (_con.Value == "FieldValue" ? this._PageForm.form.value[_con.ValueTwo] : _con.ValueTwo)
556
+
557
+ switch (_con.Type) {
558
+ case "Equal": {
559
+ _Icondition = (_fieldValue == value ? true : false)
560
+ break
561
+ }
562
+ case "NotEqual": {
563
+ _Icondition = (_fieldValue != value ? true : false)
564
+ break
565
+ }
566
+ case "LessThen": {
567
+ _Icondition = (_fieldValue < value ? true : false)
568
+ break
569
+ }
570
+ case "LessThenEqual": {
571
+ _Icondition = (_fieldValue <= value ? true : false)
572
+ break
573
+ }
574
+ case "GreaterThen": {
575
+ _Icondition = (_fieldValue > + value ? true : false)
576
+ break
577
+ }
578
+ case "GreaterThenEqual": {
579
+ _Icondition = (_fieldValue >= value ? true : false)
580
+ break
581
+ }
582
+ case "IsNull": {
583
+ _Icondition = (_fieldValue == null ? true : false)
584
+ break
585
+ }
586
+ case "IsNotNull": {
587
+ _Icondition = (_fieldValue != null ? true : false)
588
+ break
589
+ }
590
+
591
+ default:
592
+ _Icondition = false
593
+ break
594
+ }
595
+
596
+
597
+ if (index > 0) {
598
+ if (rulesData.CondtionOperator == 1) {
599
+ _condition = (_condition && _Icondition ? true : false)
600
+ }
601
+ else {
602
+ _condition = (_condition || _Icondition ? true : false)
603
+ }
604
+ }
605
+ else {
606
+ _condition = _Icondition;
607
+ }
608
+
609
+ }
610
+
611
+
612
+
613
+ if (_condition) {
614
+ this.OnRulesApply(rulesData, RestData)
615
+ }
616
+ }
617
+
618
+ }
619
+ }
620
+
621
+ OnRulesApply(rulesData, RestData) {
622
+ let rulesList = rulesData;
623
+ if (rulesData.action)
624
+ rulesList = rulesData.action;
625
+
626
+ for (let index = 0; index < rulesList.length; index++) {
627
+
628
+ let rules = rulesList[index];
629
+
630
+
631
+ if (rules.Condition == 'ClearFieldValue') {
632
+ this._PageForm.form.get(rules.Field).setValue('', { entitySelf:true });
633
+ this.setDDLFieldDesc(rules.Field,"");
634
+ }
635
+
636
+ if (rules.Condition == 'SetFieldValue') {
637
+ let _rulesValue = rules.Value
638
+ try {
639
+ let _handleData = this._PageForm.form.value;
640
+ _handleData.data = RestData;
641
+ _handleData.currentLang = this.globalService.CurrentLanguage;
642
+ if (this.ParameterData)
643
+ _handleData.params = this.ParameterData;
644
+ let _rulesValueArr:any[] =rules.Value.split('<br>');
645
+
646
+ _rulesValue = this.hanbleBarHtml(_rulesValueArr[0], _handleData)
647
+ this._PageForm.form.get(rules.Field).setValue(_rulesValue, { entitySelf:true });
648
+
649
+ let _currentfield = this.EntityFieldList.filter(y => y.Description == rules.Field)[0];
650
+ if(_rulesValue &&(_currentfield.DataType == E_DataType.date || _currentfield.DataType == E_DataType.dateTime)){
651
+ this._PageForm.form.get(rules.Field).setValue(new Date(_rulesValue), { entitySelf:true });
652
+ }
653
+
654
+ if(_rulesValueArr.length>1) {
655
+ let _rulesValueDes = this.hanbleBarHtml(_rulesValueArr[1], _handleData)
656
+ this.setDDLFieldDesc(rules.Field,_rulesValueDes)
657
+ }
658
+ }
659
+ catch (err) {
660
+ alert("SetFieldValueerr -"+ err);
661
+ console.log(err);
662
+ // this._PageForm.form.get(rules.Field).setValue(_rulesValue, { onlySelf: true });
663
+ }
664
+ }
665
+
666
+ if (rules.Condition == 'CopyFieldValue') {
667
+ if (rules.Value)
668
+ this._PageForm.form.get(rules.Value).setValue(this._PageForm.form.get(rules.Field).value, { onlySelf: true });
669
+ }
670
+
671
+ if (rules.Condition == 'RemoveValidation') {
672
+ this._PageForm.form.controls[rules.Field].setValidators([]);
673
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity();
674
+
675
+ this.fieldValidation.map(x => {
676
+ if (x.Field == rules.Field) {
677
+ x.Validators =[];
678
+ }
679
+ });
680
+
681
+
682
+ }
683
+
684
+ if (rules.Condition == 'AddValidation') {
685
+
686
+ if (rules.Type == 'Required') {
687
+ this._PageForm.form.controls[rules.Field].setValidators([Validators.required]);
688
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
689
+ }
690
+ if (rules.Type == 'MinMax') {
691
+
692
+ let validateArry = [Validators.required];
693
+ if (rules.Value)
694
+ validateArry.push(Validators.min(rules.Value))
695
+ if (rules.ValueTwo)
696
+ validateArry.push(Validators.max(rules.ValueTwo))
697
+
698
+ this._PageForm.form.controls[rules.Field].setValidators(validateArry);
699
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
700
+ }
701
+
702
+ if (rules.Type == 'MinLength') {
703
+
704
+ let validateArry = [Validators.required];
705
+ if (rules.Value)
706
+ validateArry.push(Validators.minLength(rules.Value))
707
+
708
+ this._PageForm.form.controls[rules.Field].setValidators(validateArry);
709
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
710
+ }
711
+ if (rules.Type == 'MaxLength') {
712
+
713
+ let validateArry = [Validators.required];
714
+ if (rules.Value)
715
+ validateArry.push(Validators.maxLength(rules.Value))
716
+
717
+ this._PageForm.form.controls[rules.Field].setValidators(validateArry);
718
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
719
+ }
720
+ if (rules.Type == 'Pattern') {
721
+ this._PageForm.form.controls[rules.Field].setValidators([Validators.pattern(rules.Value)]);
722
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity()
723
+ }
724
+ this.setValidationOnField(rules.Field,rules.ValidationMessage,rules.ValidationMessageAr,rules.Type)
725
+
726
+ if (this.fieldValidation.filter(x => x.Field == rules.Field).length < 1) {
727
+ this.fieldValidation.push({ Field: rules.Field, Validators: [] })
728
+ }
729
+ this.fieldValidation.map(x => {
730
+ if (x.Field == rules.Field) {
731
+ if (rules.Type == 'Required') {
732
+ x.Validators.push(Validators.required);
733
+ }
734
+ else if (rules.Type == 'MinMax') {
735
+ if (rules.Value)
736
+ x.Validators.push(Validators.min(rules.Value));
737
+ if (rules.ValueTwo)
738
+ x.Validators.push(Validators.max(rules.ValueTwo));
739
+ }
740
+ else if (rules.Type == 'MinLength') {
741
+ if (rules.Value)
742
+ x.Validators.push(Validators.minLength(rules.Value));
743
+ }
744
+ else if (rules.Type == 'MaxLength') {
745
+ if (rules.Value)
746
+ x.Validators.push(Validators.maxLength(rules.Value));
747
+ }
748
+ else if (rules.Type == 'Pattern') {
749
+ if (rules.Value)
750
+ x.Validators.push(Validators.pattern(rules.Value));
751
+ }
752
+ }
753
+ });
754
+
755
+ let _Validators = this.fieldValidation.filter(x=>x.Field==rules.Field)[0].Validators;
756
+
757
+
758
+ this._PageForm.form.controls[rules.Field].setValidators(_Validators);
759
+ this._PageForm.form.controls[rules.Field].updateValueAndValidity();
760
+
761
+
762
+ }
763
+
764
+ if (rules.Condition == 'IsEditable') {
765
+ if (rules.Value == 'true') {
766
+ this.setReadOnlyOnField(rules.Field,true)
767
+ }
768
+ else if (rules.Value == 'false') {
769
+ this.setReadOnlyOnField(rules.Field,false)
770
+ }
771
+ }
772
+ if (rules.Condition == 'IsVisible') {
773
+ if (rules.Value == 'true') {
774
+ this.setIsHideOnField(rules.Field, false)
775
+ }
776
+ else if (rules.Value == 'false') {
777
+ this.setIsHideOnField(rules.Field, true)
778
+ }
779
+ }
780
+ if (rules.Condition == 'Datasource') {
781
+ this.getDatasoureData(rules.Value,rules.ValueTwo,rules.ValueThree);
782
+ }
783
+
784
+ }
785
+ }
786
+
787
+ getDatasoureData(EntityFormId,Fields,Triggr){
788
+
789
+ this.entityTypeSetup.getSingleEntityTypeFormById(EntityFormId)
790
+ .subscribe(
791
+ (res: any) => {
792
+
793
+ let _EntityTypeForm = res;
794
+ if(_EntityTypeForm.DataSource) {
795
+ let RestData =JSON.parse( _EntityTypeForm.DataSource)
796
+
797
+ let _hanbleBardata:any ={};
798
+ _hanbleBardata.FormData = this._PageForm.form.value;
799
+
800
+ RestData.URL = this.hanbleBarHtml(RestData.URL,_hanbleBardata);
801
+ RestData.Body = this.hanbleBarHtml(RestData.Body,_hanbleBardata);
802
+ RestData.QueryStrings = RestData.QueryStrings.map(x => {
803
+
804
+ x.Value = this.hanbleBarHtml(x.Value,_hanbleBardata);
805
+
806
+ if(x.Value)
807
+ return x
808
+ });
809
+
810
+ RestData.Headers = RestData.Headers.map(x => {
811
+ x.Value = this.hanbleBarHtml(x.Value,_hanbleBardata);
812
+ return x
813
+ });
814
+
815
+ this.entityTypeSetup.dynamicAPi(RestData)
816
+ .subscribe((res: any) => {
817
+
818
+ let _data: any = res;
819
+ if (RestData.ResponseView) {
820
+ let _rview = RestData.ResponseView.split(".");
821
+ _rview.forEach(x => {
822
+ _data = _data[x];
823
+ });
824
+ }
825
+
826
+ try {
827
+ let _Fields = JSON.parse(JSON.parse(Fields));
828
+ _Fields.forEach(x => {
829
+
830
+ let _value = _data[x.Value];
831
+ this._PageForm.form.get(x.Field).setValue(_value, { entitySelf: true });
832
+
833
+ });
834
+
835
+ let _TriggrFields = JSON.parse(JSON.parse(Triggr));
836
+ _TriggrFields.forEach(x => {
837
+
838
+ let _Triggrfield = this.EntityFieldList.filter(y => y.Description == x.Field)[0]
839
+ if (_Triggrfield)
840
+ this.FieldChangeEvent(_Triggrfield, null)
841
+
842
+ });
843
+ }
844
+ catch (err) {
845
+
846
+ alert(err)
847
+ }
848
+
849
+ },
850
+ (error) => {
851
+
852
+ console.log(error);
853
+ Swal.fire(errorMessageType(error));
854
+ });
855
+ }
856
+ },
857
+
858
+ (error) => {
859
+
860
+ console.log(error);
861
+ }
862
+ );
863
+
864
+ }
865
+
866
+
867
+ AllRules:any =null;
868
+ getAllRules(EntityTypeId) {
869
+
870
+ this.entityTypeSetup.getAllRulesWithTemplateData(EntityTypeId).subscribe(
871
+ (res: any) => {
872
+
873
+ this.AllRules = res;
874
+
875
+ },
876
+ (error)=>{
877
+
878
+ }
879
+ )
880
+ }
881
+
882
+ hanbleBarHtml(_code, data?) {
883
+ if (!data || (typeof data != 'object'))
884
+ data = {};
885
+ data.Local = localStorage;
886
+ data.Cookies = this.Cookies;
887
+ if (_code && data) {
888
+ let template = handlebars.compile(_code);
889
+ let result = template(data);
890
+ return result
891
+ }
892
+ else {
893
+ return _code
894
+ }
895
+
896
+ }
897
+
898
+ get Cookies() {
899
+ let cookies = document.cookie.split(';');
900
+ let cookie = {};
901
+ for (let i = 0; i < cookies.length; i++) {
902
+ let hash = (cookies[i].split('='));
903
+ let _key = hash[0].toString().replace(" ", "");
904
+ cookie[_key] = hash[1];
905
+ }
906
+ return cookie;
907
+ }
908
+
909
+ setValidationOnField(Field,ValidationMessage,ValidationMessageAr,Type) {
910
+ this.pageGroups.map((PG) => {
911
+
912
+ PG.Groups.map((group) => {
913
+ group.Fields.map((PGF) => {
914
+ if (PGF.Description == Field) {
915
+ let temp = { MsgEn: ValidationMessage, MsgAr: ValidationMessageAr,Type:Type }
916
+ if (PGF.ValidationMessage) {
917
+ if (PGF.ValidationMessage.filter(x => (x.Type==temp.Type && x.MsgEn == temp.MsgEn)).length < 1)
918
+ PGF.ValidationMessage.push(temp)
919
+ }
920
+ else
921
+ PGF.ValidationMessage = [temp];
922
+
923
+ }
924
+ })
925
+ })
926
+
927
+ })
928
+ this.defaultPageGroups.map((PG) => {
929
+
930
+ PG.Groups.map((group) => {
931
+ group.Fields.map((PGF) => {
932
+ if (PGF.Description == Field) {
933
+ let temp = { MsgEn: ValidationMessage, MsgAr: ValidationMessageAr,Type:Type }
934
+ if (PGF.ValidationMessage) {
935
+ if (PGF.ValidationMessage.filter(x => (x.Type==temp.Type && x.MsgEn == temp.MsgEn)).length < 1)
936
+ PGF.ValidationMessage.push(temp)
937
+ }
938
+ else
939
+ PGF.ValidationMessage = [temp];
940
+
941
+ }
942
+ })
943
+ })
944
+
945
+ })
946
+ }
947
+
948
+ setDDLFieldDesc(Field, value) {
949
+ this.pageGroups.map((PG) => {
950
+
951
+ PG.Groups.map((group) => {
952
+ group.Fields.map((PGF) => {
953
+ if (PGF.Description == Field) {
954
+ PGF.showSelectedValues = value
955
+ }
956
+
957
+ })
958
+ })
959
+
960
+ })
961
+ this.defaultPageGroups.map((PG) => {
962
+
963
+ PG.Groups.map((group) => {
964
+ group.Fields.map((PGF) => {
965
+ if (PGF.Description == Field) {
966
+ PGF.showSelectedValues = value
967
+ }
968
+
969
+ })
970
+ })
971
+
972
+ })
973
+ }
974
+
975
+ setReadOnlyOnField(Field,IsReadonly:boolean) {
976
+ this.pageGroups.map((PG) => {
977
+
978
+ PG.Groups.map((group) => {
979
+ group.Fields.map((PGF) => {
980
+ if(PGF.Description ==Field) {
981
+ PGF.IsReadonly = IsReadonly
982
+ }
983
+
984
+ })
985
+ })
986
+
987
+ })
988
+ this.defaultPageGroups.map((PG) => {
989
+
990
+ PG.Groups.map((group) => {
991
+ group.Fields.map((PGF) => {
992
+ if(PGF.Description ==Field) {
993
+ PGF.IsReadonly = IsReadonly
994
+ }
995
+
996
+ })
997
+ })
998
+
999
+ })
1000
+ }
1001
+ setIsHideOnField(Field, IsHide: boolean) {
1002
+ this.pageGroups.map((PG) => {
1003
+
1004
+ PG.Groups.map((group) => {
1005
+ group.Fields.map((PGF) => {
1006
+ if (PGF.Description == Field) {
1007
+ PGF.IsHide = IsHide
1008
+ }
1009
+
1010
+ })
1011
+ })
1012
+
1013
+ })
1014
+ this.defaultPageGroups.map((PG) => {
1015
+
1016
+ PG.Groups.map((group) => {
1017
+ group.Fields.map((PGF) => {
1018
+ if (PGF.Description == Field) {
1019
+ PGF.IsHide = IsHide
1020
+ }
1021
+
1022
+ })
1023
+ })
1024
+
1025
+ })
1026
+ }
1027
+
1028
+ fieldValidation:FieldValidators[] =[];
1029
+
1030
+ // TempFieldValidators() {
1031
+ // this.EntityFieldList.map((field)=> {
1032
+ // if(field.IsMandatory ) {
1033
+ // this.fieldValidation.push({Field:field.Description,Validators:[Validators.required]})
1034
+ // }
1035
+ // });
1036
+ // }
1037
+
1038
+ translatePipe = new TranslatePipe(this.globalService);
1039
+ }
1040
+
1041
+
1042
+ export function registerHandlebarHelperMethodsNew(handlebarObj) {
1043
+
1044
+
1045
+ console.log("registerHandlebarHelperMethodsNew");
1046
+ handlebarObj.registerHelper('isNotNullAndNotUndefined', function (value) {
1047
+ if (value == null || value == undefined) return false
1048
+ else return true
1049
+ })
1050
+
1051
+ handlebarObj.registerHelper('MoneyPipe', function (value, prefix = '$', count = 2) {
1052
+ if (isNaN(parseFloat(value))) {
1053
+ return null
1054
+ } else
1055
+ return `${prefix}${parseFloat(value).toFixed(count)}`; // $2312.00
1056
+ })
1057
+
1058
+ handlebarObj.registerHelper('BoolPile', function (value) {
1059
+ return value == true ? "YES" : "NO"
1060
+ })
1061
+
1062
+ handlebarObj.registerHelper('NillPipe', function (value, cond) {
1063
+ if (value) {
1064
+ return value
1065
+ }
1066
+ else {
1067
+ if (cond == "0") {
1068
+ return "0"
1069
+ }
1070
+ else
1071
+ return "NIL"
1072
+ }
1073
+ })
1074
+
1075
+
1076
+ /* #region Date */
1077
+
1078
+ handlebarObj.registerHelper('TodayDatePipe', function (formate) {
1079
+ let date = new Date();
1080
+ console.log('TodayDatePipe',date)
1081
+ switch (formate) {
1082
+ case "DATE":
1083
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1084
+ case "DATE_TIME":
1085
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
1086
+ case "DATE_TIME_FULL":
1087
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
1088
+ case "TIME":
1089
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
1090
+ case "TIME_FULL":
1091
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
1092
+ default:
1093
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1094
+ }
1095
+
1096
+ })
1097
+
1098
+ handlebarObj.registerHelper('AddtionalDatePipe', function (curdate, day, formate) {
1099
+
1100
+ if (curdate && day) {
1101
+
1102
+ var date = new Date(curdate);
1103
+ date.setDate(date.getDate() + parseInt(day));
1104
+ if (formate) {
1105
+
1106
+ switch (formate) {
1107
+ case "DATE":
1108
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1109
+ case "DATE_TIME":
1110
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
1111
+ case "DATE_TIME_FULL":
1112
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
1113
+ case "TIME":
1114
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
1115
+ case "TIME_FULL":
1116
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
1117
+ default:
1118
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1119
+ }
1120
+ }
1121
+ else {
1122
+ return date
1123
+ }
1124
+ }
1125
+ else {
1126
+ return date
1127
+ }
1128
+ })
1129
+
1130
+ handlebarObj.registerHelper('SubDatePipe', function (curdate, day, formate) {
1131
+ if (curdate && day) {
1132
+
1133
+ var date = new Date(curdate);
1134
+ date.setDate(date.getDate() - parseInt(day));
1135
+ if (formate) {
1136
+
1137
+ switch (formate) {
1138
+ case "DATE":
1139
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1140
+ case "DATE_TIME":
1141
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
1142
+ case "DATE_TIME_FULL":
1143
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
1144
+ case "TIME":
1145
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
1146
+ case "TIME_FULL":
1147
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
1148
+ default:
1149
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
1150
+ }
1151
+ }
1152
+ else {
1153
+ return date
1154
+ }
1155
+ }
1156
+ else {
1157
+ return date
1158
+ }
1159
+ })
1160
+
1161
+ /* #endregion */
1162
+
1163
+ /* #region Arithmetic */
1164
+
1165
+ handlebarObj.registerHelper('Addition', function (value, value2) {
1166
+
1167
+ let val = value + value2;
1168
+ return val
1169
+ })
1170
+
1171
+ handlebarObj.registerHelper('Subtraction', function (value, value2) {
1172
+ let val = value - value2;
1173
+ return val
1174
+ })
1175
+ handlebarObj.registerHelper('Multiplication', function (value, value2) {
1176
+
1177
+ if (isNaN(value) && isNaN(value2)) {
1178
+ let val = value * value2;
1179
+ return val
1180
+ }
1181
+ else {
1182
+ return "";
1183
+ }
1184
+ })
1185
+
1186
+ handlebarObj.registerHelper('Division', function (value, value2) {
1187
+
1188
+ if (isNaN(value) && isNaN(value2)) {
1189
+ let val = value / value2;
1190
+ return val
1191
+ }
1192
+ else {
1193
+ return "";
1194
+ }
1195
+ })
1196
+
1197
+ handlebarObj.registerHelper('Remainder', function (value, value2) {
1198
+
1199
+ if (isNaN(value) && isNaN(value2)) {
1200
+ let val = value % value2;
1201
+ return val
1202
+ }
1203
+ else {
1204
+ return "";
1205
+ }
1206
+ })
1207
+
1208
+
1209
+ handlebarObj.registerHelper('lengthGreaterThen0', function (value: any[]) {
1210
+ if (value && Array.isArray(value) && value.length > 0)
1211
+ return true
1212
+ else return false
1213
+ })
1214
+
1215
+ handlebarObj.registerHelper('isNullOrUndefined', function (value: any[]) {
1216
+ if (value == null || value == undefined) return true
1217
+ else return false
1218
+ })
1219
+
1220
+ handlebarObj.registerHelper('isEqual', function (value, value2) {
1221
+
1222
+ return value == value2 ? true : false
1223
+ })
1224
+ /* #endregion */
1225
+
1226
+ handlebarObj.registerHelper('SetFieldByLang', function (Lang,value, value2,) {
1227
+
1228
+ return Lang == "Ar" ? value2 : value
1229
+ })
1230
+
1231
+
1232
+ }