@pepperi-addons/ngx-lib 0.4.2-beta.137 → 0.4.2-beta.139

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 (577) hide show
  1. package/address/address.component.d.ts +30 -0
  2. package/address/address.module.d.ts +15 -0
  3. package/address/index.d.ts +5 -0
  4. package/address/public-api.d.ts +2 -0
  5. package/attachment/attachment.component.d.ts +94 -0
  6. package/attachment/attachment.module.d.ts +14 -0
  7. package/attachment/index.d.ts +5 -0
  8. package/attachment/public-api.d.ts +2 -0
  9. package/bread-crumbs/bread-crumbs.component.d.ts +27 -0
  10. package/bread-crumbs/bread-crumbs.model.d.ts +11 -0
  11. package/bread-crumbs/bread-crumbs.module.d.ts +15 -0
  12. package/bread-crumbs/index.d.ts +5 -0
  13. package/bread-crumbs/public-api.d.ts +3 -0
  14. package/carousel/carousel-item.directive.d.ts +12 -0
  15. package/carousel/carousel.component.d.ts +148 -0
  16. package/carousel/carousel.module.d.ts +8 -0
  17. package/carousel/index.d.ts +5 -0
  18. package/carousel/public-api.d.ts +3 -0
  19. package/checkbox/checkbox.component.d.ts +50 -0
  20. package/checkbox/checkbox.module.d.ts +19 -0
  21. package/checkbox/index.d.ts +5 -0
  22. package/checkbox/public-api.d.ts +2 -0
  23. package/color/color-picker.component.d.ts +57 -0
  24. package/color/color.component.d.ts +30 -0
  25. package/color/color.model.d.ts +1 -0
  26. package/color/color.module.d.ts +26 -0
  27. package/color/index.d.ts +5 -0
  28. package/color/public-api.d.ts +3 -0
  29. package/date/date.component.d.ts +70 -0
  30. package/date/date.model.d.ts +31 -0
  31. package/date/date.module.d.ts +23 -0
  32. package/date/index.d.ts +5 -0
  33. package/date/public-api.d.ts +2 -0
  34. package/draggable-items/draggable-item/draggable-item.component.d.ts +11 -0
  35. package/draggable-items/draggable-items.component.d.ts +36 -0
  36. package/draggable-items/draggable-items.model.d.ts +11 -0
  37. package/draggable-items/draggable-items.module.d.ts +18 -0
  38. package/draggable-items/index.d.ts +5 -0
  39. package/draggable-items/public-api.d.ts +4 -0
  40. package/esm2020/address/address.component.mjs +109 -0
  41. package/esm2020/address/address.module.mjs +54 -0
  42. package/esm2020/address/pepperi-addons-ngx-lib-address.mjs +5 -0
  43. package/esm2020/address/public-api.mjs +6 -0
  44. package/esm2020/attachment/attachment.component.mjs +240 -0
  45. package/esm2020/attachment/attachment.module.mjs +50 -0
  46. package/esm2020/attachment/pepperi-addons-ngx-lib-attachment.mjs +5 -0
  47. package/esm2020/attachment/public-api.mjs +6 -0
  48. package/esm2020/bread-crumbs/bread-crumbs.component.mjs +85 -0
  49. package/esm2020/bread-crumbs/bread-crumbs.model.mjs +7 -0
  50. package/esm2020/bread-crumbs/bread-crumbs.module.mjs +50 -0
  51. package/esm2020/bread-crumbs/pepperi-addons-ngx-lib-bread-crumbs.mjs +5 -0
  52. package/esm2020/bread-crumbs/public-api.mjs +7 -0
  53. package/esm2020/carousel/carousel-item.directive.mjs +33 -0
  54. package/esm2020/carousel/carousel.component.mjs +745 -0
  55. package/esm2020/carousel/carousel.module.mjs +17 -0
  56. package/esm2020/carousel/pepperi-addons-ngx-lib-carousel.mjs +5 -0
  57. package/esm2020/carousel/public-api.mjs +8 -0
  58. package/esm2020/checkbox/checkbox.component.mjs +168 -0
  59. package/esm2020/checkbox/checkbox.module.mjs +63 -0
  60. package/esm2020/checkbox/pepperi-addons-ngx-lib-checkbox.mjs +5 -0
  61. package/esm2020/checkbox/public-api.mjs +6 -0
  62. package/esm2020/color/color-picker.component.mjs +224 -0
  63. package/esm2020/color/color.component.mjs +90 -0
  64. package/esm2020/color/color.model.mjs +2 -0
  65. package/esm2020/color/color.module.mjs +93 -0
  66. package/esm2020/color/pepperi-addons-ngx-lib-color.mjs +5 -0
  67. package/esm2020/color/public-api.mjs +7 -0
  68. package/esm2020/date/date.component.mjs +312 -0
  69. package/esm2020/date/date.model.mjs +54 -0
  70. package/esm2020/date/date.module.mjs +88 -0
  71. package/esm2020/date/pepperi-addons-ngx-lib-date.mjs +5 -0
  72. package/esm2020/date/public-api.mjs +6 -0
  73. package/esm2020/draggable-items/draggable-item/draggable-item.component.mjs +27 -0
  74. package/esm2020/draggable-items/draggable-items.component.mjs +102 -0
  75. package/esm2020/draggable-items/draggable-items.model.mjs +2 -0
  76. package/esm2020/draggable-items/draggable-items.module.mjs +60 -0
  77. package/esm2020/draggable-items/pepperi-addons-ngx-lib-draggable-items.mjs +5 -0
  78. package/esm2020/draggable-items/public-api.mjs +8 -0
  79. package/esm2020/files-uploader/files-uploader.component.mjs +246 -0
  80. package/esm2020/files-uploader/files-uploader.module.mjs +79 -0
  81. package/esm2020/files-uploader/pepperi-addons-ngx-lib-files-uploader.mjs +5 -0
  82. package/esm2020/files-uploader/public-api.mjs +6 -0
  83. package/esm2020/form/field-generator.component.mjs +152 -0
  84. package/esm2020/form/form.component.mjs +1238 -0
  85. package/esm2020/form/form.model.mjs +2 -0
  86. package/esm2020/form/form.module.mjs +179 -0
  87. package/esm2020/form/indicators.component.mjs +23 -0
  88. package/esm2020/form/internal-button.component.mjs +184 -0
  89. package/esm2020/form/internal-carusel.component.mjs +117 -0
  90. package/esm2020/form/internal-carusel.service.mjs +32 -0
  91. package/esm2020/form/internal-field-generator.component.mjs +146 -0
  92. package/esm2020/form/internal-form.component.mjs +1216 -0
  93. package/esm2020/form/internal-list.component.mjs +513 -0
  94. package/esm2020/form/internal-menu.component.mjs +66 -0
  95. package/esm2020/form/internal-page.component.mjs +361 -0
  96. package/esm2020/form/internal-page.service.mjs +120 -0
  97. package/esm2020/form/pepperi-addons-ngx-lib-form.mjs +5 -0
  98. package/esm2020/form/public-api.mjs +7 -0
  99. package/esm2020/group-buttons/group-buttons.component.mjs +71 -0
  100. package/esm2020/group-buttons/group-buttons.module.mjs +59 -0
  101. package/esm2020/group-buttons/pepperi-addons-ngx-lib-group-buttons.mjs +5 -0
  102. package/esm2020/group-buttons/public-api.mjs +6 -0
  103. package/esm2020/image/image.component.mjs +263 -0
  104. package/esm2020/image/image.module.mjs +74 -0
  105. package/esm2020/image/image.service.mjs +50 -0
  106. package/esm2020/image/pepperi-addons-ngx-lib-image.mjs +5 -0
  107. package/esm2020/image/public-api.mjs +7 -0
  108. package/esm2020/images-filmstrip/images-filmstrip.component.mjs +337 -0
  109. package/esm2020/images-filmstrip/images-filmstrip.module.mjs +83 -0
  110. package/esm2020/images-filmstrip/pepperi-addons-ngx-lib-images-filmstrip.mjs +5 -0
  111. package/esm2020/images-filmstrip/public-api.mjs +6 -0
  112. package/esm2020/link/link.component.mjs +300 -0
  113. package/esm2020/link/link.module.mjs +80 -0
  114. package/esm2020/link/link.pipes.mjs +18 -0
  115. package/esm2020/link/pepperi-addons-ngx-lib-link.mjs +5 -0
  116. package/esm2020/link/public-api.mjs +7 -0
  117. package/esm2020/list/list-actions.component.mjs +44 -0
  118. package/esm2020/list/list-carousel.component.mjs +107 -0
  119. package/esm2020/list/list-chooser.component.mjs +64 -0
  120. package/esm2020/list/list-pager.component.mjs +120 -0
  121. package/esm2020/list/list-sorting.component.mjs +61 -0
  122. package/esm2020/list/list-total.component.mjs +30 -0
  123. package/esm2020/list/list-views.component.mjs +85 -0
  124. package/esm2020/list/list.component.mjs +1303 -0
  125. package/esm2020/list/list.model.mjs +4 -0
  126. package/esm2020/list/list.module.mjs +144 -0
  127. package/esm2020/list/list.pipes.mjs +47 -0
  128. package/esm2020/list/pepperi-addons-ngx-lib-list.mjs +5 -0
  129. package/esm2020/list/public-api.mjs +15 -0
  130. package/esm2020/list/virtual-scroller.mjs +1080 -0
  131. package/esm2020/menu/menu-item.component.mjs +115 -0
  132. package/esm2020/menu/menu.component.mjs +213 -0
  133. package/esm2020/menu/menu.model.mjs +19 -0
  134. package/esm2020/menu/menu.module.mjs +59 -0
  135. package/esm2020/menu/pepperi-addons-ngx-lib-menu.mjs +5 -0
  136. package/esm2020/menu/public-api.mjs +7 -0
  137. package/esm2020/page-layout/page-layout.component.mjs +35 -0
  138. package/esm2020/page-layout/page-layout.module.mjs +34 -0
  139. package/esm2020/page-layout/pepperi-addons-ngx-lib-page-layout.mjs +5 -0
  140. package/esm2020/page-layout/public-api.mjs +6 -0
  141. package/esm2020/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.mjs +5 -0
  142. package/esm2020/profile-data-views-list/profile-data-view/profile-data-view.component.mjs +45 -0
  143. package/esm2020/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.mjs +81 -0
  144. package/esm2020/profile-data-views-list/profile-data-views-list.component.mjs +127 -0
  145. package/esm2020/profile-data-views-list/profile-data-views-list.model.mjs +2 -0
  146. package/esm2020/profile-data-views-list/profile-data-views-list.module.mjs +88 -0
  147. package/esm2020/profile-data-views-list/public-api.mjs +9 -0
  148. package/esm2020/quantity-selector/pepperi-addons-ngx-lib-quantity-selector.mjs +5 -0
  149. package/esm2020/quantity-selector/public-api.mjs +6 -0
  150. package/esm2020/quantity-selector/quantity-selector-validation.directive.mjs +49 -0
  151. package/esm2020/quantity-selector/quantity-selector.component.mjs +574 -0
  152. package/esm2020/quantity-selector/quantity-selector.module.mjs +82 -0
  153. package/esm2020/quantity-selector/quantity-selector.pipes.mjs +23 -0
  154. package/esm2020/query-builder/common/model/field.mjs +2 -0
  155. package/esm2020/query-builder/common/model/filter.mjs +2 -0
  156. package/esm2020/query-builder/common/model/legacy.mjs +2 -0
  157. package/esm2020/query-builder/common/model/operator-unit.mjs +42 -0
  158. package/esm2020/query-builder/common/model/operator.mjs +276 -0
  159. package/esm2020/query-builder/common/model/structure.mjs +2 -0
  160. package/esm2020/query-builder/common/model/type-map.mjs +27 -0
  161. package/esm2020/query-builder/common/model/type.mjs +6 -0
  162. package/esm2020/query-builder/common/services/output-query.service.mjs +116 -0
  163. package/esm2020/query-builder/common/services/query-structure.service.mjs +249 -0
  164. package/esm2020/query-builder/common/services/type-convertor.service.mjs +42 -0
  165. package/esm2020/query-builder/pepperi-addons-ngx-lib-query-builder.mjs +5 -0
  166. package/esm2020/query-builder/public-api.mjs +9 -0
  167. package/esm2020/query-builder/query-builder-item/query-builder-item.component.mjs +125 -0
  168. package/esm2020/query-builder/query-builder-section/query-builder-section.component.mjs +71 -0
  169. package/esm2020/query-builder/query-builder.component.mjs +110 -0
  170. package/esm2020/query-builder/query-builder.module.mjs +70 -0
  171. package/esm2020/query-builder/query-builder.service.mjs +102 -0
  172. package/esm2020/remote-loader/addon-block-loader.component.mjs +102 -0
  173. package/esm2020/remote-loader/addon-block-loader.service.mjs +62 -0
  174. package/esm2020/remote-loader/pepperi-addons-ngx-lib-remote-loader.mjs +5 -0
  175. package/esm2020/remote-loader/public-api.mjs +11 -0
  176. package/esm2020/remote-loader/remote-loader-element.component.mjs +116 -0
  177. package/esm2020/remote-loader/remote-loader.component.mjs +115 -0
  178. package/esm2020/remote-loader/remote-loader.model.mjs +2 -0
  179. package/esm2020/remote-loader/remote-loader.module.mjs +69 -0
  180. package/esm2020/remote-loader/remote-loader.service.mjs +81 -0
  181. package/esm2020/rich-html-textarea/pepperi-addons-ngx-lib-rich-html-textarea.mjs +5 -0
  182. package/esm2020/rich-html-textarea/public-api.mjs +6 -0
  183. package/esm2020/rich-html-textarea/rich-html-textarea.component.mjs +250 -0
  184. package/esm2020/rich-html-textarea/rich-html-textarea.module.mjs +95 -0
  185. package/esm2020/search/pepperi-addons-ngx-lib-search.mjs +5 -0
  186. package/esm2020/search/public-api.mjs +7 -0
  187. package/esm2020/search/search.component.mjs +317 -0
  188. package/esm2020/search/search.model.mjs +2 -0
  189. package/esm2020/search/search.module.mjs +70 -0
  190. package/esm2020/select/pepperi-addons-ngx-lib-select.mjs +5 -0
  191. package/esm2020/select/public-api.mjs +6 -0
  192. package/esm2020/select/select.component.mjs +290 -0
  193. package/esm2020/select/select.module.mjs +70 -0
  194. package/esm2020/select-panel/pepperi-addons-ngx-lib-select-panel.mjs +5 -0
  195. package/esm2020/select-panel/public-api.mjs +7 -0
  196. package/esm2020/select-panel/select-panel.component.mjs +159 -0
  197. package/esm2020/select-panel/select-panel.model.mjs +2 -0
  198. package/esm2020/select-panel/select-panel.module.mjs +70 -0
  199. package/esm2020/separator/pepperi-addons-ngx-lib-separator.mjs +5 -0
  200. package/esm2020/separator/public-api.mjs +6 -0
  201. package/esm2020/separator/separator.component.mjs +63 -0
  202. package/esm2020/separator/separator.module.mjs +18 -0
  203. package/esm2020/side-bar/pepperi-addons-ngx-lib-side-bar.mjs +5 -0
  204. package/esm2020/side-bar/public-api.mjs +7 -0
  205. package/esm2020/side-bar/side-bar.component.mjs +122 -0
  206. package/esm2020/side-bar/side-bar.model.mjs +2 -0
  207. package/esm2020/side-bar/side-bar.module.mjs +55 -0
  208. package/esm2020/signature/pepperi-addons-ngx-lib-signature.mjs +5 -0
  209. package/esm2020/signature/public-api.mjs +7 -0
  210. package/esm2020/signature/signature-dialog.component.mjs +79 -0
  211. package/esm2020/signature/signature.component.mjs +282 -0
  212. package/esm2020/signature/signature.module.mjs +91 -0
  213. package/esm2020/size-detector/pepperi-addons-ngx-lib-size-detector.mjs +5 -0
  214. package/esm2020/size-detector/public-api.mjs +6 -0
  215. package/esm2020/size-detector/size-detector.component.mjs +92 -0
  216. package/esm2020/size-detector/size-detector.module.mjs +35 -0
  217. package/esm2020/skeleton-loader/pepperi-addons-ngx-lib-skeleton-loader.mjs +5 -0
  218. package/esm2020/skeleton-loader/public-api.mjs +6 -0
  219. package/esm2020/skeleton-loader/skeleton-loader.component.mjs +44 -0
  220. package/esm2020/skeleton-loader/skeleton-loader.module.mjs +24 -0
  221. package/esm2020/smart-filters/boolean-filter/boolean-filter.component.mjs +75 -0
  222. package/esm2020/smart-filters/common/filter-actions.component.mjs +29 -0
  223. package/esm2020/smart-filters/common/model/base-filter-component.mjs +296 -0
  224. package/esm2020/smart-filters/common/model/creator.mjs +76 -0
  225. package/esm2020/smart-filters/common/model/field.mjs +117 -0
  226. package/esm2020/smart-filters/common/model/filter.mjs +2 -0
  227. package/esm2020/smart-filters/common/model/operator.mjs +278 -0
  228. package/esm2020/smart-filters/common/model/type.mjs +2 -0
  229. package/esm2020/smart-filters/date-filter/date-filter.component.mjs +182 -0
  230. package/esm2020/smart-filters/multi-select-filter/multi-select-filter.component.mjs +200 -0
  231. package/esm2020/smart-filters/number-filter/number-filter.component.mjs +136 -0
  232. package/esm2020/smart-filters/pepperi-addons-ngx-lib-smart-filters.mjs +5 -0
  233. package/esm2020/smart-filters/public-api.mjs +19 -0
  234. package/esm2020/smart-filters/smart-filters.component.mjs +141 -0
  235. package/esm2020/smart-filters/smart-filters.module.mjs +158 -0
  236. package/esm2020/smart-filters/text-filter/text-filter.component.mjs +93 -0
  237. package/esm2020/snack-bar/default-snack-bar.component.mjs +29 -0
  238. package/esm2020/snack-bar/pepperi-addons-ngx-lib-snack-bar.mjs +5 -0
  239. package/esm2020/snack-bar/public-api.mjs +8 -0
  240. package/esm2020/snack-bar/snack-bar.component.mjs +26 -0
  241. package/esm2020/snack-bar/snack-bar.model.mjs +7 -0
  242. package/esm2020/snack-bar/snack-bar.module.mjs +63 -0
  243. package/esm2020/snack-bar/snack-bar.service.mjs +60 -0
  244. package/esm2020/textarea/pepperi-addons-ngx-lib-textarea.mjs +5 -0
  245. package/esm2020/textarea/public-api.mjs +6 -0
  246. package/esm2020/textarea/textarea.component.mjs +188 -0
  247. package/esm2020/textarea/textarea.module.mjs +82 -0
  248. package/esm2020/textbox/pepperi-addons-ngx-lib-textbox.mjs +5 -0
  249. package/esm2020/textbox/public-api.mjs +6 -0
  250. package/esm2020/textbox/textbox-validation.directive.mjs +93 -0
  251. package/esm2020/textbox/textbox.component.mjs +582 -0
  252. package/esm2020/textbox/textbox.module.mjs +72 -0
  253. package/esm2020/top-bar/pepperi-addons-ngx-lib-top-bar.mjs +5 -0
  254. package/esm2020/top-bar/public-api.mjs +7 -0
  255. package/esm2020/top-bar/top-bar.component.mjs +112 -0
  256. package/esm2020/top-bar/top-bar.model.mjs +2 -0
  257. package/esm2020/top-bar/top-bar.module.mjs +62 -0
  258. package/fesm2015/pepperi-addons-ngx-lib-address.mjs +170 -0
  259. package/fesm2015/pepperi-addons-ngx-lib-address.mjs.map +1 -0
  260. package/fesm2015/pepperi-addons-ngx-lib-attachment.mjs +297 -0
  261. package/fesm2015/pepperi-addons-ngx-lib-attachment.mjs.map +1 -0
  262. package/fesm2015/pepperi-addons-ngx-lib-bread-crumbs.mjs +147 -0
  263. package/fesm2015/pepperi-addons-ngx-lib-bread-crumbs.mjs.map +1 -0
  264. package/fesm2015/pepperi-addons-ngx-lib-carousel.mjs +804 -0
  265. package/fesm2015/pepperi-addons-ngx-lib-carousel.mjs.map +1 -0
  266. package/fesm2015/pepperi-addons-ngx-lib-checkbox.mjs +237 -0
  267. package/fesm2015/pepperi-addons-ngx-lib-checkbox.mjs.map +1 -0
  268. package/fesm2015/pepperi-addons-ngx-lib-color.mjs +404 -0
  269. package/fesm2015/pepperi-addons-ngx-lib-color.mjs.map +1 -0
  270. package/fesm2015/pepperi-addons-ngx-lib-date.mjs +458 -0
  271. package/fesm2015/pepperi-addons-ngx-lib-date.mjs.map +1 -0
  272. package/fesm2015/pepperi-addons-ngx-lib-draggable-items.mjs +192 -0
  273. package/fesm2015/pepperi-addons-ngx-lib-draggable-items.mjs.map +1 -0
  274. package/fesm2015/pepperi-addons-ngx-lib-files-uploader.mjs +331 -0
  275. package/fesm2015/pepperi-addons-ngx-lib-files-uploader.mjs.map +1 -0
  276. package/fesm2015/pepperi-addons-ngx-lib-form.mjs +4226 -0
  277. package/fesm2015/pepperi-addons-ngx-lib-form.mjs.map +1 -0
  278. package/fesm2015/pepperi-addons-ngx-lib-group-buttons.mjs +136 -0
  279. package/fesm2015/pepperi-addons-ngx-lib-group-buttons.mjs.map +1 -0
  280. package/fesm2015/pepperi-addons-ngx-lib-image.mjs +388 -0
  281. package/fesm2015/pepperi-addons-ngx-lib-image.mjs.map +1 -0
  282. package/fesm2015/pepperi-addons-ngx-lib-images-filmstrip.mjs +425 -0
  283. package/fesm2015/pepperi-addons-ngx-lib-images-filmstrip.mjs.map +1 -0
  284. package/fesm2015/pepperi-addons-ngx-lib-link.mjs +399 -0
  285. package/fesm2015/pepperi-addons-ngx-lib-link.mjs.map +1 -0
  286. package/fesm2015/pepperi-addons-ngx-lib-list.mjs +3047 -0
  287. package/fesm2015/pepperi-addons-ngx-lib-list.mjs.map +1 -0
  288. package/fesm2015/pepperi-addons-ngx-lib-menu.mjs +399 -0
  289. package/fesm2015/pepperi-addons-ngx-lib-menu.mjs.map +1 -0
  290. package/fesm2015/pepperi-addons-ngx-lib-page-layout.mjs +77 -0
  291. package/fesm2015/pepperi-addons-ngx-lib-page-layout.mjs.map +1 -0
  292. package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.mjs +337 -0
  293. package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.mjs.map +1 -0
  294. package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.mjs +728 -0
  295. package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.mjs.map +1 -0
  296. package/fesm2015/pepperi-addons-ngx-lib-query-builder.mjs +1216 -0
  297. package/fesm2015/pepperi-addons-ngx-lib-query-builder.mjs.map +1 -0
  298. package/fesm2015/pepperi-addons-ngx-lib-remote-loader.mjs +555 -0
  299. package/fesm2015/pepperi-addons-ngx-lib-remote-loader.mjs.map +1 -0
  300. package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.mjs +349 -0
  301. package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.mjs.map +1 -0
  302. package/fesm2015/pepperi-addons-ngx-lib-search.mjs +393 -0
  303. package/fesm2015/pepperi-addons-ngx-lib-search.mjs.map +1 -0
  304. package/fesm2015/pepperi-addons-ngx-lib-select-panel.mjs +237 -0
  305. package/fesm2015/pepperi-addons-ngx-lib-select-panel.mjs.map +1 -0
  306. package/fesm2015/pepperi-addons-ngx-lib-select.mjs +366 -0
  307. package/fesm2015/pepperi-addons-ngx-lib-select.mjs.map +1 -0
  308. package/fesm2015/pepperi-addons-ngx-lib-separator.mjs +89 -0
  309. package/fesm2015/pepperi-addons-ngx-lib-separator.mjs.map +1 -0
  310. package/fesm2015/pepperi-addons-ngx-lib-side-bar.mjs +182 -0
  311. package/fesm2015/pepperi-addons-ngx-lib-side-bar.mjs.map +1 -0
  312. package/fesm2015/pepperi-addons-ngx-lib-signature.mjs +455 -0
  313. package/fesm2015/pepperi-addons-ngx-lib-signature.mjs.map +1 -0
  314. package/fesm2015/pepperi-addons-ngx-lib-size-detector.mjs +134 -0
  315. package/fesm2015/pepperi-addons-ngx-lib-size-detector.mjs.map +1 -0
  316. package/fesm2015/pepperi-addons-ngx-lib-skeleton-loader.mjs +78 -0
  317. package/fesm2015/pepperi-addons-ngx-lib-skeleton-loader.mjs.map +1 -0
  318. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.mjs +1715 -0
  319. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.mjs.map +1 -0
  320. package/fesm2015/pepperi-addons-ngx-lib-snack-bar.mjs +183 -0
  321. package/fesm2015/pepperi-addons-ngx-lib-snack-bar.mjs.map +1 -0
  322. package/fesm2015/pepperi-addons-ngx-lib-textarea.mjs +277 -0
  323. package/fesm2015/pepperi-addons-ngx-lib-textarea.mjs.map +1 -0
  324. package/fesm2015/pepperi-addons-ngx-lib-textbox.mjs +748 -0
  325. package/fesm2015/pepperi-addons-ngx-lib-textbox.mjs.map +1 -0
  326. package/fesm2015/pepperi-addons-ngx-lib-top-bar.mjs +180 -0
  327. package/fesm2015/pepperi-addons-ngx-lib-top-bar.mjs.map +1 -0
  328. package/fesm2020/pepperi-addons-ngx-lib-address.mjs +170 -0
  329. package/fesm2020/pepperi-addons-ngx-lib-address.mjs.map +1 -0
  330. package/fesm2020/pepperi-addons-ngx-lib-attachment.mjs +297 -0
  331. package/fesm2020/pepperi-addons-ngx-lib-attachment.mjs.map +1 -0
  332. package/fesm2020/pepperi-addons-ngx-lib-bread-crumbs.mjs +147 -0
  333. package/fesm2020/pepperi-addons-ngx-lib-bread-crumbs.mjs.map +1 -0
  334. package/fesm2020/pepperi-addons-ngx-lib-carousel.mjs +800 -0
  335. package/fesm2020/pepperi-addons-ngx-lib-carousel.mjs.map +1 -0
  336. package/fesm2020/pepperi-addons-ngx-lib-checkbox.mjs +237 -0
  337. package/fesm2020/pepperi-addons-ngx-lib-checkbox.mjs.map +1 -0
  338. package/fesm2020/pepperi-addons-ngx-lib-color.mjs +401 -0
  339. package/fesm2020/pepperi-addons-ngx-lib-color.mjs.map +1 -0
  340. package/fesm2020/pepperi-addons-ngx-lib-date.mjs +454 -0
  341. package/fesm2020/pepperi-addons-ngx-lib-date.mjs.map +1 -0
  342. package/fesm2020/pepperi-addons-ngx-lib-draggable-items.mjs +191 -0
  343. package/fesm2020/pepperi-addons-ngx-lib-draggable-items.mjs.map +1 -0
  344. package/fesm2020/pepperi-addons-ngx-lib-files-uploader.mjs +328 -0
  345. package/fesm2020/pepperi-addons-ngx-lib-files-uploader.mjs.map +1 -0
  346. package/fesm2020/pepperi-addons-ngx-lib-form.mjs +4225 -0
  347. package/fesm2020/pepperi-addons-ngx-lib-form.mjs.map +1 -0
  348. package/fesm2020/pepperi-addons-ngx-lib-group-buttons.mjs +136 -0
  349. package/fesm2020/pepperi-addons-ngx-lib-group-buttons.mjs.map +1 -0
  350. package/fesm2020/pepperi-addons-ngx-lib-image.mjs +386 -0
  351. package/fesm2020/pepperi-addons-ngx-lib-image.mjs.map +1 -0
  352. package/fesm2020/pepperi-addons-ngx-lib-images-filmstrip.mjs +422 -0
  353. package/fesm2020/pepperi-addons-ngx-lib-images-filmstrip.mjs.map +1 -0
  354. package/fesm2020/pepperi-addons-ngx-lib-link.mjs +399 -0
  355. package/fesm2020/pepperi-addons-ngx-lib-link.mjs.map +1 -0
  356. package/fesm2020/pepperi-addons-ngx-lib-list.mjs +3035 -0
  357. package/fesm2020/pepperi-addons-ngx-lib-list.mjs.map +1 -0
  358. package/fesm2020/pepperi-addons-ngx-lib-menu.mjs +399 -0
  359. package/fesm2020/pepperi-addons-ngx-lib-menu.mjs.map +1 -0
  360. package/fesm2020/pepperi-addons-ngx-lib-page-layout.mjs +77 -0
  361. package/fesm2020/pepperi-addons-ngx-lib-page-layout.mjs.map +1 -0
  362. package/fesm2020/pepperi-addons-ngx-lib-profile-data-views-list.mjs +336 -0
  363. package/fesm2020/pepperi-addons-ngx-lib-profile-data-views-list.mjs.map +1 -0
  364. package/fesm2020/pepperi-addons-ngx-lib-quantity-selector.mjs +726 -0
  365. package/fesm2020/pepperi-addons-ngx-lib-quantity-selector.mjs.map +1 -0
  366. package/fesm2020/pepperi-addons-ngx-lib-query-builder.mjs +1202 -0
  367. package/fesm2020/pepperi-addons-ngx-lib-query-builder.mjs.map +1 -0
  368. package/fesm2020/pepperi-addons-ngx-lib-remote-loader.mjs +532 -0
  369. package/fesm2020/pepperi-addons-ngx-lib-remote-loader.mjs.map +1 -0
  370. package/fesm2020/pepperi-addons-ngx-lib-rich-html-textarea.mjs +349 -0
  371. package/fesm2020/pepperi-addons-ngx-lib-rich-html-textarea.mjs.map +1 -0
  372. package/fesm2020/pepperi-addons-ngx-lib-search.mjs +392 -0
  373. package/fesm2020/pepperi-addons-ngx-lib-search.mjs.map +1 -0
  374. package/fesm2020/pepperi-addons-ngx-lib-select-panel.mjs +236 -0
  375. package/fesm2020/pepperi-addons-ngx-lib-select-panel.mjs.map +1 -0
  376. package/fesm2020/pepperi-addons-ngx-lib-select.mjs +366 -0
  377. package/fesm2020/pepperi-addons-ngx-lib-select.mjs.map +1 -0
  378. package/fesm2020/pepperi-addons-ngx-lib-separator.mjs +89 -0
  379. package/fesm2020/pepperi-addons-ngx-lib-separator.mjs.map +1 -0
  380. package/fesm2020/pepperi-addons-ngx-lib-side-bar.mjs +182 -0
  381. package/fesm2020/pepperi-addons-ngx-lib-side-bar.mjs.map +1 -0
  382. package/fesm2020/pepperi-addons-ngx-lib-signature.mjs +450 -0
  383. package/fesm2020/pepperi-addons-ngx-lib-signature.mjs.map +1 -0
  384. package/fesm2020/pepperi-addons-ngx-lib-size-detector.mjs +134 -0
  385. package/fesm2020/pepperi-addons-ngx-lib-size-detector.mjs.map +1 -0
  386. package/fesm2020/pepperi-addons-ngx-lib-skeleton-loader.mjs +76 -0
  387. package/fesm2020/pepperi-addons-ngx-lib-skeleton-loader.mjs.map +1 -0
  388. package/fesm2020/pepperi-addons-ngx-lib-smart-filters.mjs +1708 -0
  389. package/fesm2020/pepperi-addons-ngx-lib-smart-filters.mjs.map +1 -0
  390. package/fesm2020/pepperi-addons-ngx-lib-snack-bar.mjs +180 -0
  391. package/fesm2020/pepperi-addons-ngx-lib-snack-bar.mjs.map +1 -0
  392. package/fesm2020/pepperi-addons-ngx-lib-textarea.mjs +276 -0
  393. package/fesm2020/pepperi-addons-ngx-lib-textarea.mjs.map +1 -0
  394. package/fesm2020/pepperi-addons-ngx-lib-textbox.mjs +748 -0
  395. package/fesm2020/pepperi-addons-ngx-lib-textbox.mjs.map +1 -0
  396. package/fesm2020/pepperi-addons-ngx-lib-top-bar.mjs +179 -0
  397. package/fesm2020/pepperi-addons-ngx-lib-top-bar.mjs.map +1 -0
  398. package/files-uploader/files-uploader.component.d.ts +60 -0
  399. package/files-uploader/files-uploader.module.d.ts +21 -0
  400. package/files-uploader/index.d.ts +5 -0
  401. package/files-uploader/public-api.d.ts +2 -0
  402. package/form/field-generator.component.d.ts +37 -0
  403. package/form/form.component.d.ts +93 -0
  404. package/form/form.model.d.ts +20 -0
  405. package/form/form.module.d.ts +50 -0
  406. package/form/index.d.ts +5 -0
  407. package/form/indicators.component.d.ts +10 -0
  408. package/form/internal-button.component.d.ts +42 -0
  409. package/form/internal-carusel.component.d.ts +39 -0
  410. package/form/internal-carusel.service.d.ts +10 -0
  411. package/form/internal-field-generator.component.d.ts +33 -0
  412. package/form/internal-form.component.d.ts +89 -0
  413. package/form/internal-list.component.d.ts +95 -0
  414. package/form/internal-menu.component.d.ts +19 -0
  415. package/form/internal-page.component.d.ts +73 -0
  416. package/form/internal-page.service.d.ts +22 -0
  417. package/form/public-api.d.ts +3 -0
  418. package/group-buttons/group-buttons.component.d.ts +24 -0
  419. package/group-buttons/group-buttons.module.d.ts +18 -0
  420. package/group-buttons/index.d.ts +5 -0
  421. package/group-buttons/public-api.d.ts +2 -0
  422. package/image/image.component.d.ts +74 -0
  423. package/image/image.module.d.ts +20 -0
  424. package/image/image.service.d.ts +14 -0
  425. package/image/index.d.ts +5 -0
  426. package/image/public-api.d.ts +3 -0
  427. package/images-filmstrip/images-filmstrip.component.d.ts +87 -0
  428. package/images-filmstrip/images-filmstrip.module.d.ts +22 -0
  429. package/images-filmstrip/index.d.ts +5 -0
  430. package/images-filmstrip/public-api.d.ts +2 -0
  431. package/link/index.d.ts +5 -0
  432. package/link/link.component.d.ts +121 -0
  433. package/link/link.module.d.ts +22 -0
  434. package/link/link.pipes.d.ts +7 -0
  435. package/link/public-api.d.ts +3 -0
  436. package/list/index.d.ts +5 -0
  437. package/list/list-actions.component.d.ts +18 -0
  438. package/list/list-carousel.component.d.ts +40 -0
  439. package/list/list-chooser.component.d.ts +29 -0
  440. package/list/list-pager.component.d.ts +39 -0
  441. package/list/list-sorting.component.d.ts +30 -0
  442. package/list/list-total.component.d.ts +11 -0
  443. package/list/list-views.component.d.ts +35 -0
  444. package/list/list.component.d.ts +177 -0
  445. package/list/list.model.d.ts +32 -0
  446. package/list/list.module.d.ts +34 -0
  447. package/list/list.pipes.d.ts +16 -0
  448. package/list/public-api.d.ts +10 -0
  449. package/list/virtual-scroller.d.ts +183 -0
  450. package/menu/index.d.ts +5 -0
  451. package/menu/menu-item.component.d.ts +28 -0
  452. package/menu/menu.component.d.ts +48 -0
  453. package/menu/menu.model.d.ts +25 -0
  454. package/menu/menu.module.d.ts +18 -0
  455. package/menu/public-api.d.ts +3 -0
  456. package/package.json +1 -1
  457. package/page-layout/index.d.ts +5 -0
  458. package/page-layout/page-layout.component.d.ts +19 -0
  459. package/page-layout/page-layout.module.d.ts +10 -0
  460. package/page-layout/public-api.d.ts +2 -0
  461. package/profile-data-views-list/index.d.ts +5 -0
  462. package/profile-data-views-list/profile-data-view/profile-data-view.component.d.ts +18 -0
  463. package/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.d.ts +25 -0
  464. package/profile-data-views-list/profile-data-views-list.component.d.ts +38 -0
  465. package/profile-data-views-list/profile-data-views-list.model.d.ts +26 -0
  466. package/profile-data-views-list/profile-data-views-list.module.d.ts +23 -0
  467. package/profile-data-views-list/public-api.d.ts +5 -0
  468. package/quantity-selector/index.d.ts +5 -0
  469. package/quantity-selector/public-api.d.ts +2 -0
  470. package/quantity-selector/quantity-selector-validation.directive.d.ts +17 -0
  471. package/quantity-selector/quantity-selector.component.d.ts +110 -0
  472. package/quantity-selector/quantity-selector.module.d.ts +23 -0
  473. package/quantity-selector/quantity-selector.pipes.d.ts +7 -0
  474. package/query-builder/common/model/field.d.ts +8 -0
  475. package/query-builder/common/model/filter.d.ts +6 -0
  476. package/query-builder/common/model/legacy.d.ts +31 -0
  477. package/query-builder/common/model/operator-unit.d.ts +13 -0
  478. package/query-builder/common/model/operator.d.ts +31 -0
  479. package/query-builder/common/model/structure.d.ts +4 -0
  480. package/query-builder/common/model/type-map.d.ts +12 -0
  481. package/query-builder/common/model/type.d.ts +4 -0
  482. package/query-builder/common/services/output-query.service.d.ts +47 -0
  483. package/query-builder/common/services/query-structure.service.d.ts +83 -0
  484. package/query-builder/common/services/type-convertor.service.d.ts +13 -0
  485. package/query-builder/index.d.ts +5 -0
  486. package/query-builder/public-api.d.ts +5 -0
  487. package/query-builder/query-builder-item/query-builder-item.component.d.ts +41 -0
  488. package/query-builder/query-builder-section/query-builder-section.component.d.ts +30 -0
  489. package/query-builder/query-builder.component.d.ts +39 -0
  490. package/query-builder/query-builder.module.d.ts +20 -0
  491. package/query-builder/query-builder.service.d.ts +30 -0
  492. package/remote-loader/addon-block-loader.component.d.ts +36 -0
  493. package/remote-loader/addon-block-loader.service.d.ts +15 -0
  494. package/remote-loader/index.d.ts +5 -0
  495. package/remote-loader/public-api.d.ts +7 -0
  496. package/remote-loader/remote-loader-element.component.d.ts +32 -0
  497. package/remote-loader/remote-loader.component.d.ts +25 -0
  498. package/remote-loader/remote-loader.model.d.ts +41 -0
  499. package/remote-loader/remote-loader.module.d.ts +15 -0
  500. package/remote-loader/remote-loader.service.d.ts +15 -0
  501. package/rich-html-textarea/index.d.ts +5 -0
  502. package/rich-html-textarea/public-api.d.ts +2 -0
  503. package/rich-html-textarea/rich-html-textarea.component.d.ts +80 -0
  504. package/rich-html-textarea/rich-html-textarea.module.d.ts +25 -0
  505. package/search/index.d.ts +5 -0
  506. package/search/public-api.d.ts +3 -0
  507. package/search/search.component.d.ts +65 -0
  508. package/search/search.model.d.ts +14 -0
  509. package/search/search.module.d.ts +20 -0
  510. package/select/index.d.ts +5 -0
  511. package/select/public-api.d.ts +2 -0
  512. package/select/select.component.d.ts +67 -0
  513. package/select/select.module.d.ts +20 -0
  514. package/select-panel/index.d.ts +5 -0
  515. package/select-panel/public-api.d.ts +3 -0
  516. package/select-panel/select-panel.component.d.ts +51 -0
  517. package/select-panel/select-panel.model.d.ts +5 -0
  518. package/select-panel/select-panel.module.d.ts +19 -0
  519. package/separator/index.d.ts +5 -0
  520. package/separator/public-api.d.ts +2 -0
  521. package/separator/separator.component.d.ts +22 -0
  522. package/separator/separator.module.d.ts +8 -0
  523. package/side-bar/index.d.ts +5 -0
  524. package/side-bar/public-api.d.ts +3 -0
  525. package/side-bar/side-bar.component.d.ts +42 -0
  526. package/side-bar/side-bar.model.d.ts +4 -0
  527. package/side-bar/side-bar.module.d.ts +16 -0
  528. package/signature/index.d.ts +5 -0
  529. package/signature/public-api.d.ts +3 -0
  530. package/signature/signature-dialog.component.d.ts +29 -0
  531. package/signature/signature.component.d.ts +59 -0
  532. package/signature/signature.module.d.ts +25 -0
  533. package/size-detector/index.d.ts +5 -0
  534. package/size-detector/public-api.d.ts +2 -0
  535. package/size-detector/size-detector.component.d.ts +29 -0
  536. package/size-detector/size-detector.module.d.ts +11 -0
  537. package/skeleton-loader/index.d.ts +5 -0
  538. package/skeleton-loader/public-api.d.ts +2 -0
  539. package/skeleton-loader/skeleton-loader.component.d.ts +20 -0
  540. package/skeleton-loader/skeleton-loader.module.d.ts +9 -0
  541. package/smart-filters/boolean-filter/boolean-filter.component.d.ts +29 -0
  542. package/smart-filters/common/filter-actions.component.d.ts +12 -0
  543. package/smart-filters/common/model/base-filter-component.d.ts +74 -0
  544. package/smart-filters/common/model/creator.d.ts +6 -0
  545. package/smart-filters/common/model/field.d.ts +69 -0
  546. package/smart-filters/common/model/filter.d.ts +11 -0
  547. package/smart-filters/common/model/operator.d.ts +52 -0
  548. package/smart-filters/common/model/type.d.ts +4 -0
  549. package/smart-filters/date-filter/date-filter.component.d.ts +61 -0
  550. package/smart-filters/index.d.ts +5 -0
  551. package/smart-filters/multi-select-filter/multi-select-filter.component.d.ts +57 -0
  552. package/smart-filters/number-filter/number-filter.component.d.ts +53 -0
  553. package/smart-filters/public-api.d.ts +14 -0
  554. package/smart-filters/smart-filters.component.d.ts +35 -0
  555. package/smart-filters/smart-filters.module.d.ts +37 -0
  556. package/smart-filters/text-filter/text-filter.component.d.ts +29 -0
  557. package/snack-bar/default-snack-bar.component.d.ts +13 -0
  558. package/snack-bar/index.d.ts +5 -0
  559. package/snack-bar/public-api.d.ts +4 -0
  560. package/snack-bar/snack-bar.component.d.ts +12 -0
  561. package/snack-bar/snack-bar.model.d.ts +8 -0
  562. package/snack-bar/snack-bar.module.d.ts +19 -0
  563. package/snack-bar/snack-bar.service.d.ts +24 -0
  564. package/textarea/index.d.ts +5 -0
  565. package/textarea/public-api.d.ts +2 -0
  566. package/textarea/textarea.component.d.ts +56 -0
  567. package/textarea/textarea.module.d.ts +23 -0
  568. package/textbox/index.d.ts +5 -0
  569. package/textbox/public-api.d.ts +2 -0
  570. package/textbox/textbox-validation.directive.d.ts +22 -0
  571. package/textbox/textbox.component.d.ts +157 -0
  572. package/textbox/textbox.module.d.ts +22 -0
  573. package/top-bar/index.d.ts +5 -0
  574. package/top-bar/public-api.d.ts +3 -0
  575. package/top-bar/top-bar.component.d.ts +39 -0
  576. package/top-bar/top-bar.model.d.ts +4 -0
  577. package/top-bar/top-bar.module.d.ts +18 -0
@@ -0,0 +1,4225 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, EventEmitter, Output, Injectable, ViewEncapsulation, ViewChild, ViewContainerRef, TemplateRef, NgModule } from '@angular/core';
3
+ import * as i5 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i3$1 from '@angular/forms';
6
+ import { Validators, ReactiveFormsModule, FormBuilder } from '@angular/forms';
7
+ import { MatCommonModule } from '@angular/material/core';
8
+ import { MatFormFieldModule } from '@angular/material/form-field';
9
+ import * as i4 from '@angular/material/button';
10
+ import { MatButtonModule } from '@angular/material/button';
11
+ import * as i6$1 from '@angular/material/grid-list';
12
+ import { MatGridListModule } from '@angular/material/grid-list';
13
+ import * as i5$1 from '@angular/material/icon';
14
+ import { MatIconModule } from '@angular/material/icon';
15
+ import * as i4$2 from '@angular/material/menu';
16
+ import { MatMenuModule } from '@angular/material/menu';
17
+ import { SignaturePadModule } from 'ngx-signaturepad';
18
+ import * as i1$1 from '@pepperi-addons/ngx-lib';
19
+ import { DEFAULT_HORIZONTAL_ALIGNMENT, X_ALIGNMENT_TYPE, DEFAULT_VERTICAL_ALIGNMENT, Y_ALIGNMENT_TYPE, PepTextboxField, PepSelectField, PepInternalMenuField, FIELD_TYPE, PepQuantitySelectorField, PepSeparatorField, PepInternalButtonField, PepCheckboxField, PepDateField, PepRichHtmlTextareaField, PepTextareaField, PepLinkField, PepImagesField, PepImageField, PepSignatureField, PepAttachmentField, PepInternalCaruselField, PepInternalPageField, PepIndicatorsField, PepAddressField, PepCustomizationService, PepPlaceholderField, PepScreenSizeType, PepNgxLibModule } from '@pepperi-addons/ngx-lib';
20
+ import * as i1 from '@pepperi-addons/ngx-lib/icon';
21
+ import { pepIconSystemBin, pepIconSystemEdit, pepIconSystemMenu, pepIconNumberPlus, pepIconIndicatorDotPlaceholder, PepIconModule } from '@pepperi-addons/ngx-lib/icon';
22
+ import * as i1$2 from '@pepperi-addons/ngx-lib/dialog';
23
+ import { PepDialogData, PepDialogModule } from '@pepperi-addons/ngx-lib/dialog';
24
+ import * as i3$2 from '@pepperi-addons/ngx-lib/address';
25
+ import { PepAddressModule } from '@pepperi-addons/ngx-lib/address';
26
+ import * as i4$3 from '@pepperi-addons/ngx-lib/attachment';
27
+ import { PepAttachmentModule } from '@pepperi-addons/ngx-lib/attachment';
28
+ import * as i4$4 from '@pepperi-addons/ngx-lib/button';
29
+ import { PepButtonModule } from '@pepperi-addons/ngx-lib/button';
30
+ import * as i5$3 from '@pepperi-addons/ngx-lib/carousel';
31
+ import { PepCarouselComponent, PepCarouselModule } from '@pepperi-addons/ngx-lib/carousel';
32
+ import * as i5$2 from '@pepperi-addons/ngx-lib/checkbox';
33
+ import { PepCheckboxModule } from '@pepperi-addons/ngx-lib/checkbox';
34
+ import * as i6 from '@pepperi-addons/ngx-lib/date';
35
+ import { PepDateModule } from '@pepperi-addons/ngx-lib/date';
36
+ import * as i7$1 from '@pepperi-addons/ngx-lib/image';
37
+ import { PepImageModule } from '@pepperi-addons/ngx-lib/image';
38
+ import * as i8$1 from '@pepperi-addons/ngx-lib/images-filmstrip';
39
+ import { PepImagesFilmstripModule } from '@pepperi-addons/ngx-lib/images-filmstrip';
40
+ import * as i9 from '@pepperi-addons/ngx-lib/quantity-selector';
41
+ import { PepQuantitySelectorComponent, PepQuantitySelectorModule } from '@pepperi-addons/ngx-lib/quantity-selector';
42
+ import * as i10 from '@pepperi-addons/ngx-lib/rich-html-textarea';
43
+ import { PepRichHtmlTextareaModule } from '@pepperi-addons/ngx-lib/rich-html-textarea';
44
+ import * as i11 from '@pepperi-addons/ngx-lib/select';
45
+ import { PepSelectModule } from '@pepperi-addons/ngx-lib/select';
46
+ import { PepSelectPanelModule } from '@pepperi-addons/ngx-lib/select-panel';
47
+ import * as i12 from '@pepperi-addons/ngx-lib/separator';
48
+ import { PepSeparatorModule } from '@pepperi-addons/ngx-lib/separator';
49
+ import * as i13 from '@pepperi-addons/ngx-lib/signature';
50
+ import { PepSignatureModule } from '@pepperi-addons/ngx-lib/signature';
51
+ import * as i14 from '@pepperi-addons/ngx-lib/textarea';
52
+ import { PepTextareaModule } from '@pepperi-addons/ngx-lib/textarea';
53
+ import * as i15 from '@pepperi-addons/ngx-lib/textbox';
54
+ import { PepTextboxModule } from '@pepperi-addons/ngx-lib/textbox';
55
+ import * as i16 from '@pepperi-addons/ngx-lib/link';
56
+ import { PepLinkModule } from '@pepperi-addons/ngx-lib/link';
57
+ import * as i7 from '@pepperi-addons/ngx-lib/field-title';
58
+ import { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';
59
+ import * as i8 from '@pepperi-addons/ngx-lib/group-buttons';
60
+ import { PepGroupButtonsModule } from '@pepperi-addons/ngx-lib/group-buttons';
61
+ import { BehaviorSubject, fromEvent } from 'rxjs';
62
+ import * as i4$1 from '@ngx-translate/core';
63
+ import * as i3 from '@angular/cdk/bidi';
64
+ import { debounceTime } from 'rxjs/operators';
65
+
66
+ class PepIndicatorsComponent {
67
+ constructor() {
68
+ this.controlType = 'indicators';
69
+ this.layoutType = 'table';
70
+ }
71
+ }
72
+ PepIndicatorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepIndicatorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
73
+ PepIndicatorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepIndicatorsComponent, selector: "pep-indicators", inputs: { key: "key", value: "value", layoutType: "layoutType" }, ngImport: i0, template: "<div class=\"indicators-container\" [ngClass]=\"{ 'is-inside-table': layoutType === 'table' }\">\n <ng-container *ngFor=\"let value of value?.split(';')\">\n <pep-icon name=\"indicator_dot_placeholder\" class=\"pull-left flip\" [fill]=\"value\"></pep-icon>\n </ng-container>\n <ng-container *ngIf=\"key != 'ItemIndicatorsWithoutCampaign' && value?.split(';').length < 4\">\n <pep-icon name=\"indicator_dot_placeholder\" class=\"pull-left flip\"></pep-icon>\n </ng-container>\n</div>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center}.indicators-container{height:2.5rem}.indicators-container pep-icon{height:1rem;width:1rem;margin:.05rem}.indicators-container.is-inside-table{height:1rem;display:flex;justify-content:center;align-items:center}\n", ".indicators-container .svg-icon{fill:hsla(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%),.5)}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepIndicatorsComponent, decorators: [{
75
+ type: Component,
76
+ args: [{ selector: 'pep-indicators', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"indicators-container\" [ngClass]=\"{ 'is-inside-table': layoutType === 'table' }\">\n <ng-container *ngFor=\"let value of value?.split(';')\">\n <pep-icon name=\"indicator_dot_placeholder\" class=\"pull-left flip\" [fill]=\"value\"></pep-icon>\n </ng-container>\n <ng-container *ngIf=\"key != 'ItemIndicatorsWithoutCampaign' && value?.split(';').length < 4\">\n <pep-icon name=\"indicator_dot_placeholder\" class=\"pull-left flip\"></pep-icon>\n </ng-container>\n</div>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center}.indicators-container{height:2.5rem}.indicators-container pep-icon{height:1rem;width:1rem;margin:.05rem}.indicators-container.is-inside-table{height:1rem;display:flex;justify-content:center;align-items:center}\n", ".indicators-container .svg-icon{fill:hsla(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%),.5)}\n"] }]
77
+ }], propDecorators: { key: [{
78
+ type: Input
79
+ }], value: [{
80
+ type: Input
81
+ }], layoutType: [{
82
+ type: Input
83
+ }] } });
84
+
85
+ class PepInternalButtonComponent {
86
+ constructor(customizationService, renderer, element) {
87
+ this.customizationService = customizationService;
88
+ this.renderer = renderer;
89
+ this.element = element;
90
+ this.key = '';
91
+ this.value = '';
92
+ this.formattedValue = '';
93
+ this.label = '';
94
+ this.type = 'button';
95
+ this.mandatory = false;
96
+ this.disabled = false;
97
+ this.readonly = false;
98
+ this.xAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;
99
+ this.rowSpan = 1;
100
+ this._visible = true;
101
+ this.controlType = 'button';
102
+ this.form = null;
103
+ this.showTitle = true;
104
+ this.layoutType = 'form';
105
+ this.elementClick = new EventEmitter();
106
+ this.valueChange = new EventEmitter();
107
+ // standAlone = false;
108
+ this.createNewReference = false;
109
+ this.referenceButtons = [
110
+ {
111
+ key: 'action',
112
+ callback: (action) => this.onButtonClicked(action.event),
113
+ },
114
+ {
115
+ key: 'delete',
116
+ callback: (action) => this.remove(),
117
+ classNames: 'caution',
118
+ iconName: pepIconSystemBin.name,
119
+ },
120
+ ];
121
+ }
122
+ set visible(visible) {
123
+ this._visible = visible;
124
+ if (visible) {
125
+ this.renderer.removeClass(this.element.nativeElement, 'hidden-element');
126
+ }
127
+ else {
128
+ this.renderer.addClass(this.element.nativeElement, 'hidden-element');
129
+ }
130
+ }
131
+ get visible() {
132
+ return this._visible;
133
+ }
134
+ ngOnInit() {
135
+ // if (this.form === null) {
136
+ // this.standAlone = true;
137
+ // // this.form = this.customizationService.getDefaultFromGroup(this.key, this.value, this.mandatory, this.readonly, this.disabled);
138
+ // const pepField = new PepInternalButtonField({
139
+ // key: this.key,
140
+ // value: this.value,
141
+ // mandatory: this.mandatory,
142
+ // readonly: this.readonly,
143
+ // disabled: this.disabled,
144
+ // });
145
+ // this.form = this.customizationService.getDefaultFromGroup(pepField);
146
+ // this.formattedValue = this.formattedValue || this.value;
147
+ // this.renderer.addClass(
148
+ // this.element.nativeElement,
149
+ // PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME
150
+ // );
151
+ // }
152
+ }
153
+ ngOnChanges(changes) {
154
+ if (this.type === 'reference') {
155
+ this.createNewReference = this.value.length === 0;
156
+ this.referenceButtons[0].value = this.formattedValue;
157
+ }
158
+ }
159
+ ngOnDestroy() {
160
+ //
161
+ }
162
+ // groupButtonClicked(action: IPepButtonClickEvent): void {
163
+ // if (action.source.key === 'action') {
164
+ // this.onButtonClicked(action.event);
165
+ // } else if (action.source.key === 'delete') {
166
+ // this.remove();
167
+ // }
168
+ // }
169
+ onButtonClicked(event) {
170
+ if (this.type === 'reference') {
171
+ const valueArr = this.value.split('/');
172
+ this.elementClick.emit({
173
+ key: this.key,
174
+ value: valueArr[valueArr.length - 1],
175
+ controlType: this.controlType,
176
+ eventWhich: event.which,
177
+ otherData: this.referenceObjectInternalType,
178
+ });
179
+ }
180
+ else if (this.type === 'button' && true) {
181
+ this.elementClick.emit({
182
+ key: this.key,
183
+ value: this.value,
184
+ controlType: this.controlType,
185
+ eventWhich: event.which,
186
+ });
187
+ }
188
+ else {
189
+ this.elementClick.emit({
190
+ key: this.key,
191
+ controlType: this.controlType,
192
+ eventWhich: event.which,
193
+ });
194
+ }
195
+ }
196
+ hrefFunction(event) {
197
+ if (event.which === 1 /*|| event.which === 2*/) {
198
+ this.onButtonClicked(event);
199
+ }
200
+ }
201
+ openReferenceObjectInternal(event) {
202
+ this.elementClick.emit({
203
+ key: this.key,
204
+ value: this.value,
205
+ controlType: this.controlType,
206
+ eventWhich: event.which,
207
+ otherData: this.referenceObjectInternalType,
208
+ });
209
+ }
210
+ remove() {
211
+ this.value = '';
212
+ this.valueChange.emit(this.value);
213
+ }
214
+ }
215
+ PepInternalButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalButtonComponent, deps: [{ token: i1$1.PepCustomizationService }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
216
+ PepInternalButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepInternalButtonComponent, selector: "pep-internal-button", inputs: { key: "key", value: "value", formattedValue: "formattedValue", label: "label", referenceObjectInternalType: "referenceObjectInternalType", type: "type", mandatory: "mandatory", disabled: "disabled", readonly: "readonly", xAlignment: "xAlignment", rowSpan: "rowSpan", visible: "visible", form: "form", showTitle: "showTitle", layoutType: "layoutType" }, outputs: { elementClick: "elementClick", valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'reference'\">\n <ng-container *ngIf=\"layoutType === 'form'; then formBlock; else notFormBlock\"></ng-container>\n <ng-template #formBlock>\n <div class=\"pep-button-container reference-button\">\n <pep-field-title [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\">\n </pep-field-title>\n <ng-container *ngIf=\"createNewReference; then newBlock; else existingBlock\"></ng-container>\n <ng-template #newBlock>\n <button mat-button [id]=\"key\" title=\"{{ formattedValue }}\" class=\"pep-button md regular\"\n (click)=\"onButtonClicked($event)\" [ngClass]=\"{\n disabled: disabled,\n 'pull-left': xAlignment == 'left',\n 'pull-right': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center'\n }\">\n <span class=\"ellipsis pull-left flip button-title-with-icon\">{{ 'ACTIONS.CREATE_NEW' | translate\n }}</span>\n <mat-icon class=\"pull-right flip\" pepRtlClass>\n <pep-icon name=\"number_plus\" (click)=\"onButtonClicked($event)\">\n </pep-icon>\n </mat-icon>\n </button>\n </ng-template>\n <ng-template #existingBlock>\n <pep-group-buttons [buttons]=\"referenceButtons\" styleType=\"regular\" viewType=\"split\">\n </pep-group-buttons>\n </ng-template>\n </div>\n </ng-template>\n <ng-template #notFormBlock>\n <ng-container *ngTemplateOutlet=\"linkTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'listofobjects'\">\n <ng-container *ngIf=\"layoutType === 'form'; then formBlock; else notFormBlock\"></ng-container>\n <ng-template #formBlock>\n <ng-container *ngTemplateOutlet=\"buttonTemplate; context: {internal: true}\"></ng-container>\n </ng-template>\n <ng-template #notFormBlock>\n <ng-container *ngTemplateOutlet=\"linkTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'button'\">\n <ng-container [ngSwitch]=\"key\">\n <ng-container *ngSwitchCase=\"'ObjectMenu'\">\n <span (click)=\"onButtonClicked($event)\" title=\"{{ key }}\">\n <mat-icon>\n <pep-icon *ngIf=\"key == 'ObjectMenu'\" name=\"system_menu\">\n </pep-icon>\n </mat-icon>\n </span>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Agents' || 'ContactPersons' || 'Buyers'\">\n <ng-container *ngIf=\"layoutType === 'table'; then tableBlock; else nonTableBlock\">\n </ng-container>\n <ng-template #nonTableBlock>\n <ng-container *ngTemplateOutlet=\"buttonTemplate; context: {internal: true}\"></ng-container>\n </ng-template>\n <ng-template #tableBlock>\n <span [id]=\"key\" title=\"{{ formattedValue }}\" class=\"pep-report-input readonly body-sm\">{{\n formattedValue }}</span>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"layoutType === 'form'; then buttonBlock; else linkBlock\">\n </ng-container>\n\n <ng-template #buttonBlock>\n <ng-container *ngTemplateOutlet=\"buttonTemplate; context: {internal: false}\"></ng-container>\n </ng-template>\n <ng-template #linkBlock>\n <ng-container *ngTemplateOutlet=\"linkTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #buttonTemplate let-internal=\"internal\">\n <div class=\"pep-button-container\">\n <pep-field-title [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\">\n </pep-field-title>\n\n <ng-container *ngIf=\"internal; then internalButtonTemplate; else regularButtonTemplate\"></ng-container>\n <ng-template #regularButtonTemplate>\n <button [id]=\"key\" title=\"{{ formattedValue }}\" mat-button class=\"pep-button md regular\"\n dir=\"{{ xAlignment == 'right' ? 'rtl' : 'ltr' }}\" (click)=\"onButtonClicked($event)\"\n [disabled]=\"disabled\"\n [ngClass]=\"{disabled: disabled, 'pull-left': xAlignment == 'left', 'pull-right': xAlignment == 'right', 'center-alignment': xAlignment == 'center'}\">\n {{ formattedValue }}\n </button>\n </ng-template>\n\n <ng-template #internalButtonTemplate>\n <button [id]=\"key\" title=\"{{ formattedValue }}\" mat-button class=\"pep-button md regular\"\n dir=\"{{ xAlignment == 'right' ? 'rtl' : 'ltr' }}\" (click)=\"openReferenceObjectInternal($event)\"\n [disabled]=\"disabled\"\n [ngClass]=\"{disabled: disabled, 'pull-left': xAlignment == 'left', 'pull-right': xAlignment == 'right', 'center-alignment': xAlignment == 'center'}\">\n <ng-container *ngIf=\"formattedValue == '0' || formattedValue == ''; then newBlock; else existingBlock\">\n </ng-container>\n <ng-template #newBlock>\n <span class=\"pull-left flip button-title-with-icon\">{{ 'LIST.SELECT' | translate }}&nbsp;</span>\n <mat-icon>\n <pep-icon name=\"number_plus\">\n </pep-icon>\n </mat-icon>\n </ng-template>\n <ng-template #existingBlock>\n <span class=\"pull-left flip button-title-with-icon\">{{ formattedValue }}&nbsp;{{ 'LIST.SELECTED' |\n translate\n }}&nbsp;</span>\n <mat-icon>\n <pep-icon name=\"system_edit\">\n </pep-icon>\n </mat-icon>\n </ng-template>\n </button>\n </ng-template>\n </div>\n</ng-template>\n\n<ng-template #linkTemplate>\n <ng-container *ngIf=\"formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <a href=\"{{ value }}\" (mousedown)=\"hrefFunction($event)\" class=\"color-link\">\n <span *ngIf=\"layoutType === 'table'\" [id]=\"key\" title=\"{{ formattedValue }}\"\n class=\"body-sm pep-report-input readonly\">\n {{ formattedValue }}\n </span>\n <span *ngIf=\"layoutType !== 'table'\" [id]=\"key\" title=\"{{ formattedValue }}\" class=\"body-sm pep-card-input\"\n style=\"display: block;\">\n {{ formattedValue }}\n </span>\n </a>\n </ng-template>\n <ng-template #emptyBlock>\n <span>&nbsp;</span>\n </ng-template>\n</ng-template>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center}.pepperi-button-container,.pep-button-container{height:-moz-fit-content;height:fit-content}.pepperi-button-container .center-alignment,.pep-button-container .center-alignment{position:absolute;left:50%;transform:translate(-50%)}.pepperi-button-container.reference-button ::ng-deep .split-buttons,.pepperi-button-container.reference-button .split-buttons,.pep-button-container.reference-button ::ng-deep .split-buttons,.pep-button-container.reference-button .split-buttons{float:left}.pepperi-button-container.reference-button ::ng-deep .split-buttons button:last-of-type,.pepperi-button-container.reference-button .split-buttons button:last-of-type,.pep-button-container.reference-button ::ng-deep .split-buttons button:last-of-type,.pep-button-container.reference-button .split-buttons button:last-of-type{width:1.5rem;padding:0}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i5.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1$1.PepRtlClassDirective, selector: "[pepRtlClass]" }, { kind: "component", type: i1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "component", type: i7.PepFieldTitleComponent, selector: "pep-field-title", inputs: ["label", "mandatory", "disabled", "maxFieldCharacters", "hint", "xAlignment", "showTitle", "inputLength", "fontBodyType"] }, { kind: "component", type: i8.PepGroupButtonsComponent, selector: "pep-group-buttons", inputs: ["viewType", "styleType", "sizeType", "buttons", "buttonsDisabled", "supportUnselect", "selectedButtonKey", "stretch"], outputs: ["buttonClick"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalButtonComponent, decorators: [{
218
+ type: Component,
219
+ args: [{ selector: 'pep-internal-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'reference'\">\n <ng-container *ngIf=\"layoutType === 'form'; then formBlock; else notFormBlock\"></ng-container>\n <ng-template #formBlock>\n <div class=\"pep-button-container reference-button\">\n <pep-field-title [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\">\n </pep-field-title>\n <ng-container *ngIf=\"createNewReference; then newBlock; else existingBlock\"></ng-container>\n <ng-template #newBlock>\n <button mat-button [id]=\"key\" title=\"{{ formattedValue }}\" class=\"pep-button md regular\"\n (click)=\"onButtonClicked($event)\" [ngClass]=\"{\n disabled: disabled,\n 'pull-left': xAlignment == 'left',\n 'pull-right': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center'\n }\">\n <span class=\"ellipsis pull-left flip button-title-with-icon\">{{ 'ACTIONS.CREATE_NEW' | translate\n }}</span>\n <mat-icon class=\"pull-right flip\" pepRtlClass>\n <pep-icon name=\"number_plus\" (click)=\"onButtonClicked($event)\">\n </pep-icon>\n </mat-icon>\n </button>\n </ng-template>\n <ng-template #existingBlock>\n <pep-group-buttons [buttons]=\"referenceButtons\" styleType=\"regular\" viewType=\"split\">\n </pep-group-buttons>\n </ng-template>\n </div>\n </ng-template>\n <ng-template #notFormBlock>\n <ng-container *ngTemplateOutlet=\"linkTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'listofobjects'\">\n <ng-container *ngIf=\"layoutType === 'form'; then formBlock; else notFormBlock\"></ng-container>\n <ng-template #formBlock>\n <ng-container *ngTemplateOutlet=\"buttonTemplate; context: {internal: true}\"></ng-container>\n </ng-template>\n <ng-template #notFormBlock>\n <ng-container *ngTemplateOutlet=\"linkTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'button'\">\n <ng-container [ngSwitch]=\"key\">\n <ng-container *ngSwitchCase=\"'ObjectMenu'\">\n <span (click)=\"onButtonClicked($event)\" title=\"{{ key }}\">\n <mat-icon>\n <pep-icon *ngIf=\"key == 'ObjectMenu'\" name=\"system_menu\">\n </pep-icon>\n </mat-icon>\n </span>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Agents' || 'ContactPersons' || 'Buyers'\">\n <ng-container *ngIf=\"layoutType === 'table'; then tableBlock; else nonTableBlock\">\n </ng-container>\n <ng-template #nonTableBlock>\n <ng-container *ngTemplateOutlet=\"buttonTemplate; context: {internal: true}\"></ng-container>\n </ng-template>\n <ng-template #tableBlock>\n <span [id]=\"key\" title=\"{{ formattedValue }}\" class=\"pep-report-input readonly body-sm\">{{\n formattedValue }}</span>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"layoutType === 'form'; then buttonBlock; else linkBlock\">\n </ng-container>\n\n <ng-template #buttonBlock>\n <ng-container *ngTemplateOutlet=\"buttonTemplate; context: {internal: false}\"></ng-container>\n </ng-template>\n <ng-template #linkBlock>\n <ng-container *ngTemplateOutlet=\"linkTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #buttonTemplate let-internal=\"internal\">\n <div class=\"pep-button-container\">\n <pep-field-title [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\">\n </pep-field-title>\n\n <ng-container *ngIf=\"internal; then internalButtonTemplate; else regularButtonTemplate\"></ng-container>\n <ng-template #regularButtonTemplate>\n <button [id]=\"key\" title=\"{{ formattedValue }}\" mat-button class=\"pep-button md regular\"\n dir=\"{{ xAlignment == 'right' ? 'rtl' : 'ltr' }}\" (click)=\"onButtonClicked($event)\"\n [disabled]=\"disabled\"\n [ngClass]=\"{disabled: disabled, 'pull-left': xAlignment == 'left', 'pull-right': xAlignment == 'right', 'center-alignment': xAlignment == 'center'}\">\n {{ formattedValue }}\n </button>\n </ng-template>\n\n <ng-template #internalButtonTemplate>\n <button [id]=\"key\" title=\"{{ formattedValue }}\" mat-button class=\"pep-button md regular\"\n dir=\"{{ xAlignment == 'right' ? 'rtl' : 'ltr' }}\" (click)=\"openReferenceObjectInternal($event)\"\n [disabled]=\"disabled\"\n [ngClass]=\"{disabled: disabled, 'pull-left': xAlignment == 'left', 'pull-right': xAlignment == 'right', 'center-alignment': xAlignment == 'center'}\">\n <ng-container *ngIf=\"formattedValue == '0' || formattedValue == ''; then newBlock; else existingBlock\">\n </ng-container>\n <ng-template #newBlock>\n <span class=\"pull-left flip button-title-with-icon\">{{ 'LIST.SELECT' | translate }}&nbsp;</span>\n <mat-icon>\n <pep-icon name=\"number_plus\">\n </pep-icon>\n </mat-icon>\n </ng-template>\n <ng-template #existingBlock>\n <span class=\"pull-left flip button-title-with-icon\">{{ formattedValue }}&nbsp;{{ 'LIST.SELECTED' |\n translate\n }}&nbsp;</span>\n <mat-icon>\n <pep-icon name=\"system_edit\">\n </pep-icon>\n </mat-icon>\n </ng-template>\n </button>\n </ng-template>\n </div>\n</ng-template>\n\n<ng-template #linkTemplate>\n <ng-container *ngIf=\"formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <a href=\"{{ value }}\" (mousedown)=\"hrefFunction($event)\" class=\"color-link\">\n <span *ngIf=\"layoutType === 'table'\" [id]=\"key\" title=\"{{ formattedValue }}\"\n class=\"body-sm pep-report-input readonly\">\n {{ formattedValue }}\n </span>\n <span *ngIf=\"layoutType !== 'table'\" [id]=\"key\" title=\"{{ formattedValue }}\" class=\"body-sm pep-card-input\"\n style=\"display: block;\">\n {{ formattedValue }}\n </span>\n </a>\n </ng-template>\n <ng-template #emptyBlock>\n <span>&nbsp;</span>\n </ng-template>\n</ng-template>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center}.pepperi-button-container,.pep-button-container{height:-moz-fit-content;height:fit-content}.pepperi-button-container .center-alignment,.pep-button-container .center-alignment{position:absolute;left:50%;transform:translate(-50%)}.pepperi-button-container.reference-button ::ng-deep .split-buttons,.pepperi-button-container.reference-button .split-buttons,.pep-button-container.reference-button ::ng-deep .split-buttons,.pep-button-container.reference-button .split-buttons{float:left}.pepperi-button-container.reference-button ::ng-deep .split-buttons button:last-of-type,.pepperi-button-container.reference-button .split-buttons button:last-of-type,.pep-button-container.reference-button ::ng-deep .split-buttons button:last-of-type,.pep-button-container.reference-button .split-buttons button:last-of-type{width:1.5rem;padding:0}\n"] }]
220
+ }], ctorParameters: function () { return [{ type: i1$1.PepCustomizationService }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { key: [{
221
+ type: Input
222
+ }], value: [{
223
+ type: Input
224
+ }], formattedValue: [{
225
+ type: Input
226
+ }], label: [{
227
+ type: Input
228
+ }], referenceObjectInternalType: [{
229
+ type: Input
230
+ }], type: [{
231
+ type: Input
232
+ }], mandatory: [{
233
+ type: Input
234
+ }], disabled: [{
235
+ type: Input
236
+ }], readonly: [{
237
+ type: Input
238
+ }], xAlignment: [{
239
+ type: Input
240
+ }], rowSpan: [{
241
+ type: Input
242
+ }], visible: [{
243
+ type: Input
244
+ }], form: [{
245
+ type: Input
246
+ }], showTitle: [{
247
+ type: Input
248
+ }], layoutType: [{
249
+ type: Input
250
+ }], elementClick: [{
251
+ type: Output
252
+ }], valueChange: [{
253
+ type: Output
254
+ }] } });
255
+
256
+ class PepInternalMenuComponent {
257
+ constructor() {
258
+ this.key = '';
259
+ this.label = '';
260
+ this.disabled = false;
261
+ this.xAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;
262
+ // @Input() hasSubMenu = false;
263
+ this.options = [];
264
+ this.invertClass = true;
265
+ this.controlType = 'menu';
266
+ this.layoutType = 'form';
267
+ this.elementClick = new EventEmitter();
268
+ }
269
+ // @Output() menuItemClick: EventEmitter<IPepFieldClickEvent> = new EventEmitter<IPepFieldClickEvent>();
270
+ ngOnDestroy() {
271
+ // if (this.elementClick) {
272
+ // this.elementClick.unsubscribe();
273
+ // }
274
+ // if (this.menuItemClick) {
275
+ // this.menuItemClick.unsubscribe();
276
+ // }
277
+ }
278
+ menuClicked(event) {
279
+ this.elementClick.emit({
280
+ key: this.key,
281
+ controlType: this.controlType,
282
+ eventWhich: event.which,
283
+ });
284
+ }
285
+ menuItemClicked(itemKey) {
286
+ // Not in use comment in version 16.55 for webapp.
287
+ // this.menuItemClick.emit({ key: itemKey });
288
+ }
289
+ }
290
+ PepInternalMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
291
+ PepInternalMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepInternalMenuComponent, selector: "pep-internal-menu", inputs: { key: "key", label: "label", disabled: "disabled", xAlignment: "xAlignment", options: "options", invertClass: "invertClass", layoutType: "layoutType" }, outputs: { elementClick: "elementClick" }, ngImport: i0, template: "<ng-container *ngIf=\"options?.length > 0; then subMenuBlock; else noSubMenuBlock\"></ng-container>\n<ng-template #noSubMenuBlock>\n <button (click)=\"menuClicked($event)\" title=\"{{ label }}\" mat-button\n class=\"pep-button icon-button weak {{ layoutType === 'table' ? 'sm' : 'md' }}\" [ngClass]=\"{\n 'lock-events': disabled,\n 'left-alignment': xAlignment == 'left',\n 'right-alignment': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center',\n 'invert': invertClass\n }\">\n <mat-icon>\n <pep-icon name=\"system_menu\">\n </pep-icon>\n </mat-icon>\n </button>\n</ng-template>\n\n<ng-template #subMenuBlock>\n <button mat-button [matMenuTriggerFor]=\"menu\" menu-blur\n class=\"pep-button icon-button weak {{ layoutType === 'table' ? 'sm' : 'md' }}\" [ngClass]=\"{\n 'left-alignment': xAlignment == 'left',\n 'right-alignment': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center',\n 'invert': invertClass\n }\" title=\"{{ label }}\">\n <mat-icon>\n <pep-icon name=\"system_menu\">\n </pep-icon>\n </mat-icon>\n </button>\n\n <mat-menu #menu=\"matMenu\" xPosition=\"{{xAlignment == 'right' ? 'after' : 'before'}}\"\n [ngClass]=\"{ rtlMenu: xAlignment == 'right' }\">\n <button *ngFor=\"let option of options\" mat-menu-item (click)=\"menuItemClicked(option.key)\">\n <span>{{ option.value | translate }}</span>\n </button>\n </mat-menu>\n\n</ng-template>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center}.pepperi-button,.pep-button{cursor:pointer}.pepperi-button.left-alignment,.pep-button.left-alignment{justify-self:flex-start}.pepperi-button.center-alignment,.pep-button.center-alignment{justify-self:center}.pepperi-button.right-alignment,.pep-button.right-alignment{justify-self:flex-end}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$2.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalMenuComponent, decorators: [{
293
+ type: Component,
294
+ args: [{ selector: 'pep-internal-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"options?.length > 0; then subMenuBlock; else noSubMenuBlock\"></ng-container>\n<ng-template #noSubMenuBlock>\n <button (click)=\"menuClicked($event)\" title=\"{{ label }}\" mat-button\n class=\"pep-button icon-button weak {{ layoutType === 'table' ? 'sm' : 'md' }}\" [ngClass]=\"{\n 'lock-events': disabled,\n 'left-alignment': xAlignment == 'left',\n 'right-alignment': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center',\n 'invert': invertClass\n }\">\n <mat-icon>\n <pep-icon name=\"system_menu\">\n </pep-icon>\n </mat-icon>\n </button>\n</ng-template>\n\n<ng-template #subMenuBlock>\n <button mat-button [matMenuTriggerFor]=\"menu\" menu-blur\n class=\"pep-button icon-button weak {{ layoutType === 'table' ? 'sm' : 'md' }}\" [ngClass]=\"{\n 'left-alignment': xAlignment == 'left',\n 'right-alignment': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center',\n 'invert': invertClass\n }\" title=\"{{ label }}\">\n <mat-icon>\n <pep-icon name=\"system_menu\">\n </pep-icon>\n </mat-icon>\n </button>\n\n <mat-menu #menu=\"matMenu\" xPosition=\"{{xAlignment == 'right' ? 'after' : 'before'}}\"\n [ngClass]=\"{ rtlMenu: xAlignment == 'right' }\">\n <button *ngFor=\"let option of options\" mat-menu-item (click)=\"menuItemClicked(option.key)\">\n <span>{{ option.value | translate }}</span>\n </button>\n </mat-menu>\n\n</ng-template>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center}.pepperi-button,.pep-button{cursor:pointer}.pepperi-button.left-alignment,.pep-button.left-alignment{justify-self:flex-start}.pepperi-button.center-alignment,.pep-button.center-alignment{justify-self:center}.pepperi-button.right-alignment,.pep-button.right-alignment{justify-self:flex-end}\n"] }]
295
+ }], propDecorators: { key: [{
296
+ type: Input
297
+ }], label: [{
298
+ type: Input
299
+ }], disabled: [{
300
+ type: Input
301
+ }], xAlignment: [{
302
+ type: Input
303
+ }], options: [{
304
+ type: Input
305
+ }], invertClass: [{
306
+ type: Input
307
+ }], layoutType: [{
308
+ type: Input
309
+ }], elementClick: [{
310
+ type: Output
311
+ }] } });
312
+
313
+ class PepInternalPageService {
314
+ constructor(httpService) {
315
+ this.httpService = httpService;
316
+ this.parentId = '0';
317
+ this.additionalApiName = '';
318
+ this.transactionUrl = 'Service1.svc/v1/OrderCenter/Transaction/';
319
+ }
320
+ getBaseParentUrl() {
321
+ const url = `${this.transactionUrl}${this.objectId}/ParentLine/${this.parentId}/`;
322
+ return url;
323
+ }
324
+ getChildren(callbackFunc) {
325
+ const body = JSON.stringify({
326
+ TransactionUID: this.objectId,
327
+ SearchCode: this.searchCode,
328
+ AdditionalApiName: this.additionalApiName,
329
+ ParentTransactionLineID: this.parentId,
330
+ ViewType: this.viewType,
331
+ });
332
+ // Set the additional api name with view type string.
333
+ const moreParams = this.additionalApiName?.length > 0
334
+ ? `${this.additionalApiName}/${this.viewType}`
335
+ : `''/${this.viewType}`;
336
+ const url = `${this.getBaseParentUrl()}Items/${moreParams}`;
337
+ this.httpService.postWapiApiCall(url, body).subscribe((res) => {
338
+ callbackFunc(res);
339
+ }
340
+ // (error) => {},
341
+ // () => {}
342
+ );
343
+ }
344
+ initDetails(objectId, parentId, searchCode, callbackFunc) {
345
+ if (!objectId || !parentId) {
346
+ return;
347
+ }
348
+ this.objectId = objectId;
349
+ this.parentId = parentId;
350
+ this.searchCode = searchCode;
351
+ this.httpService
352
+ .getWapiApiCall(`${this.getBaseParentUrl()}ViewTypes`)
353
+ .subscribe((res) => {
354
+ callbackFunc(res);
355
+ }
356
+ // (error) => {},
357
+ // () => {}
358
+ );
359
+ }
360
+ changeChildrenViewType(viewType, callbackFunc) {
361
+ this.viewType = viewType;
362
+ this.getChildren(callbackFunc);
363
+ }
364
+ changeAdditionalApiName(additionalApiName, callbackFunc) {
365
+ this.additionalApiName = additionalApiName;
366
+ this.getChildren(callbackFunc);
367
+ }
368
+ childPlusClick(itemId, fieldApiName, callbackFunc) {
369
+ const body = JSON.stringify({
370
+ TransactionUID: this.objectId,
371
+ SearchCode: this.searchCode,
372
+ ParentTransactionLineID: this.parentId,
373
+ TransactionLineUID: itemId,
374
+ FieldApiName: fieldApiName,
375
+ ViewType: this.viewType,
376
+ });
377
+ this.httpService
378
+ .postWapiApiCall(`${this.getBaseParentUrl()}IncrementValue`, body)
379
+ .subscribe((res) => {
380
+ callbackFunc(res);
381
+ }
382
+ // (error) => {},
383
+ // () => {}
384
+ );
385
+ }
386
+ childMinusClick(itemId, fieldApiName, callbackFunc) {
387
+ const body = JSON.stringify({
388
+ TransactionUID: this.objectId,
389
+ SearchCode: this.searchCode,
390
+ ParentTransactionLineID: this.parentId,
391
+ TransactionLineUID: itemId,
392
+ FieldApiName: fieldApiName,
393
+ ViewType: this.viewType,
394
+ });
395
+ this.httpService
396
+ .postWapiApiCall(`${this.getBaseParentUrl()}DecrementValue`, body)
397
+ .subscribe((res) => {
398
+ callbackFunc(res);
399
+ }
400
+ // (error) => {},
401
+ // () => {}
402
+ );
403
+ }
404
+ childValueChanged(itemId, fieldApiName, value, callbackFunc) {
405
+ const body = JSON.stringify({
406
+ TransactionUID: this.objectId,
407
+ SearchCode: this.searchCode,
408
+ ParentTransactionLineID: this.parentId,
409
+ TransactionLineUID: itemId,
410
+ FieldApiName: fieldApiName,
411
+ FieldValue: value,
412
+ ViewType: this.viewType,
413
+ });
414
+ this.httpService
415
+ .postWapiApiCall(`${this.getBaseParentUrl()}SetFieldValue`, body)
416
+ .subscribe((res) => {
417
+ callbackFunc(res);
418
+ }
419
+ // (error) => {},
420
+ // () => {}
421
+ );
422
+ }
423
+ }
424
+ PepInternalPageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalPageService, deps: [{ token: i1$1.PepHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
425
+ PepInternalPageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalPageService });
426
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalPageService, decorators: [{
427
+ type: Injectable
428
+ }], ctorParameters: function () { return [{ type: i1$1.PepHttpService }]; } });
429
+
430
+ class PepInternalFieldGeneratorComponent {
431
+ constructor() {
432
+ this.isActive = false;
433
+ this.uid = null;
434
+ this.layoutType = 'form';
435
+ this.showTitle = true;
436
+ this.checkForChanges = null;
437
+ this.valueChange = new EventEmitter();
438
+ // @Output()
439
+ // formValidationChange: EventEmitter<boolean> = new EventEmitter<boolean>();
440
+ this.elementClick = new EventEmitter();
441
+ // @Output() internalFormFieldChange: EventEmitter<any> = new EventEmitter<any>();
442
+ // @Output() internalFormFieldClick: EventEmitter<any> = new EventEmitter<any>();
443
+ this.formValueChange = new EventEmitter();
444
+ this.formFieldClick = new EventEmitter();
445
+ }
446
+ set field(value) {
447
+ this._field = value;
448
+ }
449
+ get field() {
450
+ return this._field;
451
+ }
452
+ get isValid() {
453
+ if (this.field.readonly || this.field.disabled) {
454
+ return true;
455
+ }
456
+ else {
457
+ const formControl = this.form && this.form.get(this.field.key);
458
+ if (formControl) {
459
+ return formControl.valid;
460
+ }
461
+ else {
462
+ return false;
463
+ }
464
+ }
465
+ }
466
+ get isTouched() {
467
+ const formControl = this.form && this.form.get(this.field.key);
468
+ return formControl ? formControl.touched : false;
469
+ }
470
+ get isDirty() {
471
+ const formControl = this.form && this.form.get(this.field.key);
472
+ return formControl ? formControl.dirty : false;
473
+ }
474
+ ngOnDestroy() {
475
+ //
476
+ }
477
+ onFileChanged(fileData, field) {
478
+ const value = fileData ? JSON.stringify(fileData) : '';
479
+ const fieldValueChange = {
480
+ key: field.key,
481
+ value: value,
482
+ controlType: field.controlType,
483
+ };
484
+ this.valueChange.emit(fieldValueChange);
485
+ }
486
+ onAddressValueChanged(valueChange, field) {
487
+ const fieldValueChange = {
488
+ key: valueChange.key,
489
+ value: valueChange.value,
490
+ controlType: field.controlType,
491
+ };
492
+ this.valueChange.emit(fieldValueChange);
493
+ }
494
+ onValueChanged(value, field) {
495
+ const fieldValueChange = {
496
+ key: field.key,
497
+ value: value.toString(),
498
+ controlType: field.controlType,
499
+ };
500
+ this.valueChange.emit(fieldValueChange);
501
+ }
502
+ // onInternalFormFieldChanged(internalFormFieldChange: any): void {
503
+ // this.internalFormFieldChange.emit(internalFormFieldChange);
504
+ // }
505
+ // onFormValidationChanged(formValidationChange: any): void {
506
+ // this.formValidationChange.emit(formValidationChange);
507
+ // }
508
+ onClick(fieldClicked) {
509
+ this.elementClick.emit(fieldClicked);
510
+ }
511
+ // onInternalFormFieldClick(internalFormFieldClick: any): void {
512
+ // this.internalFormFieldClick.emit(internalFormFieldClick);
513
+ // }
514
+ onFormValueChanged(event) {
515
+ this.formValueChange.emit(event);
516
+ }
517
+ onFormFieldClick(event) {
518
+ this.formFieldClick.emit(event);
519
+ }
520
+ ngOnChanges(changes) {
521
+ // debugger;
522
+ // For testing.
523
+ // this.field.disabled = this.field.readonly = false;
524
+ }
525
+ }
526
+ PepInternalFieldGeneratorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalFieldGeneratorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
527
+ PepInternalFieldGeneratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepInternalFieldGeneratorComponent, selector: "pep-internal-field-generator", inputs: { field: "field", isActive: "isActive", uid: "uid", form: "form", layoutType: "layoutType", showTitle: "showTitle", checkForChanges: "checkForChanges" }, outputs: { valueChange: "valueChange", elementClick: "elementClick", formValueChange: "formValueChange", formFieldClick: "formFieldClick" }, usesOnChanges: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"field.controlType\" [formGroup]=\"form\">\n\n <pep-address *ngSwitchCase=\"'address'\" [form]=\"form\" [key]=\"field.key\" [formattedValue]=\"field.formattedValue\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [groupFields]=\"field.groupFields\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (addressValueChange)=\"onAddressValueChanged($event, field)\">\n </pep-address>\n\n <pep-attachment *ngSwitchCase=\"'attachment'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-attachment>\n\n <pep-checkbox *ngSwitchCase=\"'checkbox'\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"(field.value | lowercase) == 'true' || field.value == '1' ? true : false\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [additionalValue]=\"field.additionalValue\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-checkbox>\n\n <pep-date *ngSwitchCase=\"'date'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [minValue]=\"field.minValue\"\n [maxValue]=\"field.maxValue\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-date>\n\n <pep-images-filmstrip *ngSwitchCase=\"'images'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [showTitle]=\"showTitle\" [rowSpan]=\"field.rowSpan\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-images-filmstrip>\n\n <pep-image *ngSwitchCase=\"'image'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.formattedValue\"\n [srcLarge]=\"field.value\" [options]=\"field.options\" [label]=\"field.label\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [indicatorsField]=\"field.indicatorsField\" [menuField]=\"field.menuField\"\n [hasCampaignField]=\"field.hasCampaignField\" [sizeLimitMB]=\"field.sizeLimitMB\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-image>\n\n <pep-quantity-selector *ngSwitchCase=\"'qs'\" [form]=\"form\" [key]=\"field.key\" [allowDecimal]=\"field.allowDecimal\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [additionalValue]=\"field.additionalValue\" [notificationInfo]=\"field.notificationInfo\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [showTitle]=\"showTitle\" [visible]=\"field.visible\"\n [minFractionDigits]=\"field.digitsNumberAfterDecimalPoint\"\n (valueChange)=\"onValueChanged($event, field)\" \n (elementClick)=\"onClick($event)\">\n </pep-quantity-selector>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-rich-html-textarea *ngSwitchCase=\"'richhtmltextarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-rich-html-textarea>\n\n <pep-select *ngSwitchCase=\"'select'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [options]=\"field.options\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (valueChange)=\"onValueChanged($event, field)\"\n [isActive]=\"isActive\">\n </pep-select>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-separator *ngSwitchCase=\"'separator'\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [xAlignment]=\"field.xAlignment\" [layoutType]=\"layoutType\" [visible]=\"field.visible\">\n </pep-separator>\n\n <pep-signature *ngSwitchCase=\"'signature'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [layoutType]=\"layoutType\"\n [visible]=\"field.visible\" (fileChange)=\"onFileChanged($event, field)\">\n </pep-signature>\n\n <pep-textarea *ngSwitchCase=\"'textarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-textarea>\n\n <pep-textbox *ngSwitchCase=\"'textbox'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [accessory]=\"field.accessory\" [label]=\"field.label\" [placeholder]=\"field.placeholder\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\"\n [minFractionDigits]=\"field.digitsNumberAfterDecimalPoint\"\n (valueChange)=\"onValueChanged($event, field)\" \n [isActive]=\"isActive\" [visible]=\"field.visible\">\n </pep-textbox>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-link *ngSwitchCase=\"'link'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [placeholder]=\"field.placeholder\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\" [visible]=\"field.visible\"\n (elementClick)=\"onClick($event)\">\n </pep-link>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-indicators *ngSwitchCase=\"'indicators'\" [key]=\"field.key\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-indicators>\n <pep-internal-button *ngSwitchCase=\"'button'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\"\n [referenceObjectInternalType]=\"field.referenceObjectInternalType\" [type]=\"field.type\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (valueChange)=\"onValueChanged($event, field)\">\n </pep-internal-button>\n <pep-internal-menu *ngSwitchCase=\"'menu'\" [key]=\"field.key\" [label]=\"field.label\" [disabled]=\"field.disabled\"\n [xAlignment]=\"field.xAlignment\" [options]=\"field.options\" [layoutType]=\"layoutType\"\n (elementClick)=\"onClick($event)\">\n </pep-internal-menu>\n <!-- \n comment for not cause a circular reference.\n <pep-internal-page *ngSwitchCase=\"'internalPage'\" [field]=\"field\" [layoutType]=\"layoutType\"\n (internalFormFieldClick)=\"onInternalFormFieldClick($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\">\n </pep-internal-page>\n\n <pep-internal-carusel *ngSwitchCase=\"'internalCarusel'\" [field]=\"field\"\n (internalFormFieldClick)=\"onInternalFormFieldClick($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\">\n </pep-internal-carusel> \n -->\n\n <ng-container *ngSwitchCase=\"'placeholder'\">\n </ng-container>\n</ng-container>", styles: [":host{width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$2.PepAddressComponent, selector: "pep-address", inputs: ["key", "formattedValue", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "groupFields", "form", "layoutType", "visible"], outputs: ["addressValueChange"] }, { kind: "component", type: i4$3.PepAttachmentComponent, selector: "pep-attachment", inputs: ["key", "src", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "handleActions", "hint"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i5$2.PepCheckboxComponent, selector: "pep-checkbox", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "additionalValue", "form", "isActive", "showTitle", "renderTitle", "layoutType", "visible"], outputs: ["valueChange"] }, { kind: "component", type: i6.PepDateComponent, selector: "pep-date", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "visible", "minValue", "maxValue", "minDateValue", "maxDateValue", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType"], outputs: ["valueChange"] }, { kind: "component", type: i7$1.PepImageComponent, selector: "pep-image", inputs: ["key", "srcLarge", "src", "options", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "indicatorsField", "menuField", "hasCampaignField", "visible", "form", "uid", "showTitle", "renderTitle", "layoutType", "isActive", "sizeLimitMB", "acceptImagesType", "handleActions", "hint"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i8$1.PepImagesFilmstripComponent, selector: "pep-images-filmstrip", inputs: ["key", "value", "label", "xAlignment", "rowSpan", "form", "uid", "showTitle", "renderTitle", "layoutType", "currIndex", "showThumbnails"] }, { kind: "component", type: i9.PepQuantitySelectorComponent, selector: "pep-quantity-selector", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "allowDecimal", "additionalValue", "notificationInfo", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "styleType", "isInFocus"], outputs: ["valueChange", "elementClick"] }, { kind: "component", type: i10.PepRichHtmlTextareaComponent, selector: "pep-rich-html-textarea", inputs: ["key", "value", "label", "mandatory", "disabled", "readonly", "maxFieldCharacters", "xAlignment", "sanitize", "rowSpan", "visible", "form", "isActive", "showTitle", "renderTitle", "renderEnlargeButton", "layoutType", "inlineMode", "toolbarOptions"], outputs: ["valueChange"] }, { kind: "component", type: i11.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "placeholder", "placeholderWhenDisabled", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle", "typeaheadDebounceInterval", "addValueToOptionsIfNotExist"], outputs: ["valueChange"] }, { kind: "component", type: i12.PepSeparatorComponent, selector: "pep-separator", inputs: ["key", "label", "xAlignment", "form", "layoutType", "visible"] }, { kind: "component", type: i13.PepSignatureComponent, selector: "pep-signature", inputs: ["key", "src", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "signatureURL", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "handleActions"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i14.PepTextareaComponent, selector: "pep-textarea", inputs: ["key", "value", "label", "mandatory", "disabled", "readonly", "maxFieldCharacters", "textColor", "xAlignment", "rowSpan", "visible", "form", "isActive", "showTitle", "renderTitle", "layoutType"], outputs: ["valueChange", "keyup"] }, { kind: "component", type: i15.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey", "regex", "regexError", "isInFocus"], outputs: ["valueChange", "keyup"] }, { kind: "component", type: i16.PepLinkComponent, selector: "pep-link", inputs: ["key", "value", "displayValue", "label", "placeholder", "mandatory", "disabled", "readonly", "maxFieldCharacters", "textColor", "xAlignment", "rowSpan", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType"], outputs: ["valueChange", "elementClick"] }, { kind: "component", type: PepIndicatorsComponent, selector: "pep-indicators", inputs: ["key", "value", "layoutType"] }, { kind: "component", type: PepInternalButtonComponent, selector: "pep-internal-button", inputs: ["key", "value", "formattedValue", "label", "referenceObjectInternalType", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "visible", "form", "showTitle", "layoutType"], outputs: ["elementClick", "valueChange"] }, { kind: "component", type: PepInternalMenuComponent, selector: "pep-internal-menu", inputs: ["key", "label", "disabled", "xAlignment", "options", "invertClass", "layoutType"], outputs: ["elementClick"] }, { kind: "pipe", type: i5.LowerCasePipe, name: "lowercase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
528
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalFieldGeneratorComponent, decorators: [{
529
+ type: Component,
530
+ args: [{ selector: 'pep-internal-field-generator', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"field.controlType\" [formGroup]=\"form\">\n\n <pep-address *ngSwitchCase=\"'address'\" [form]=\"form\" [key]=\"field.key\" [formattedValue]=\"field.formattedValue\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [groupFields]=\"field.groupFields\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (addressValueChange)=\"onAddressValueChanged($event, field)\">\n </pep-address>\n\n <pep-attachment *ngSwitchCase=\"'attachment'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-attachment>\n\n <pep-checkbox *ngSwitchCase=\"'checkbox'\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"(field.value | lowercase) == 'true' || field.value == '1' ? true : false\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [additionalValue]=\"field.additionalValue\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-checkbox>\n\n <pep-date *ngSwitchCase=\"'date'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [minValue]=\"field.minValue\"\n [maxValue]=\"field.maxValue\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-date>\n\n <pep-images-filmstrip *ngSwitchCase=\"'images'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [showTitle]=\"showTitle\" [rowSpan]=\"field.rowSpan\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-images-filmstrip>\n\n <pep-image *ngSwitchCase=\"'image'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.formattedValue\"\n [srcLarge]=\"field.value\" [options]=\"field.options\" [label]=\"field.label\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [indicatorsField]=\"field.indicatorsField\" [menuField]=\"field.menuField\"\n [hasCampaignField]=\"field.hasCampaignField\" [sizeLimitMB]=\"field.sizeLimitMB\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-image>\n\n <pep-quantity-selector *ngSwitchCase=\"'qs'\" [form]=\"form\" [key]=\"field.key\" [allowDecimal]=\"field.allowDecimal\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [additionalValue]=\"field.additionalValue\" [notificationInfo]=\"field.notificationInfo\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [showTitle]=\"showTitle\" [visible]=\"field.visible\"\n [minFractionDigits]=\"field.digitsNumberAfterDecimalPoint\"\n (valueChange)=\"onValueChanged($event, field)\" \n (elementClick)=\"onClick($event)\">\n </pep-quantity-selector>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-rich-html-textarea *ngSwitchCase=\"'richhtmltextarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-rich-html-textarea>\n\n <pep-select *ngSwitchCase=\"'select'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [options]=\"field.options\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (valueChange)=\"onValueChanged($event, field)\"\n [isActive]=\"isActive\">\n </pep-select>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-separator *ngSwitchCase=\"'separator'\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [xAlignment]=\"field.xAlignment\" [layoutType]=\"layoutType\" [visible]=\"field.visible\">\n </pep-separator>\n\n <pep-signature *ngSwitchCase=\"'signature'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [layoutType]=\"layoutType\"\n [visible]=\"field.visible\" (fileChange)=\"onFileChanged($event, field)\">\n </pep-signature>\n\n <pep-textarea *ngSwitchCase=\"'textarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-textarea>\n\n <pep-textbox *ngSwitchCase=\"'textbox'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [accessory]=\"field.accessory\" [label]=\"field.label\" [placeholder]=\"field.placeholder\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\"\n [minFractionDigits]=\"field.digitsNumberAfterDecimalPoint\"\n (valueChange)=\"onValueChanged($event, field)\" \n [isActive]=\"isActive\" [visible]=\"field.visible\">\n </pep-textbox>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-link *ngSwitchCase=\"'link'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [placeholder]=\"field.placeholder\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\" [visible]=\"field.visible\"\n (elementClick)=\"onClick($event)\">\n </pep-link>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-indicators *ngSwitchCase=\"'indicators'\" [key]=\"field.key\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-indicators>\n <pep-internal-button *ngSwitchCase=\"'button'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\"\n [referenceObjectInternalType]=\"field.referenceObjectInternalType\" [type]=\"field.type\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (valueChange)=\"onValueChanged($event, field)\">\n </pep-internal-button>\n <pep-internal-menu *ngSwitchCase=\"'menu'\" [key]=\"field.key\" [label]=\"field.label\" [disabled]=\"field.disabled\"\n [xAlignment]=\"field.xAlignment\" [options]=\"field.options\" [layoutType]=\"layoutType\"\n (elementClick)=\"onClick($event)\">\n </pep-internal-menu>\n <!-- \n comment for not cause a circular reference.\n <pep-internal-page *ngSwitchCase=\"'internalPage'\" [field]=\"field\" [layoutType]=\"layoutType\"\n (internalFormFieldClick)=\"onInternalFormFieldClick($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\">\n </pep-internal-page>\n\n <pep-internal-carusel *ngSwitchCase=\"'internalCarusel'\" [field]=\"field\"\n (internalFormFieldClick)=\"onInternalFormFieldClick($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\">\n </pep-internal-carusel> \n -->\n\n <ng-container *ngSwitchCase=\"'placeholder'\">\n </ng-container>\n</ng-container>", styles: [":host{width:100%;height:100%}\n"] }]
531
+ }], propDecorators: { field: [{
532
+ type: Input
533
+ }], isActive: [{
534
+ type: Input
535
+ }], uid: [{
536
+ type: Input
537
+ }], form: [{
538
+ type: Input
539
+ }], layoutType: [{
540
+ type: Input
541
+ }], showTitle: [{
542
+ type: Input
543
+ }], checkForChanges: [{
544
+ type: Input
545
+ }], valueChange: [{
546
+ type: Output
547
+ }], elementClick: [{
548
+ type: Output
549
+ }], formValueChange: [{
550
+ type: Output
551
+ }], formFieldClick: [{
552
+ type: Output
553
+ }] } });
554
+
555
+ class PepInternalFormComponent {
556
+ // eventServiceSub: Subscription;
557
+ // public jsonLib = JSON;
558
+ constructor(dialogService, customizationService, layoutService, fb, differs, translate) {
559
+ this.dialogService = dialogService;
560
+ this.customizationService = customizationService;
561
+ this.layoutService = layoutService;
562
+ this.fb = fb;
563
+ this.translate = translate;
564
+ this.isInternal = true;
565
+ this.isReport = false;
566
+ this.lockEvents = false;
567
+ this.canEditObject = true;
568
+ this._data = null;
569
+ this.isActive = false;
570
+ this.layoutType = 'card';
571
+ // @Input() listType = '';
572
+ this.objectId = '0';
573
+ this.parentId = '0';
574
+ this.searchCode = '0';
575
+ this.showTitle = true;
576
+ this.firstFieldAsLink = false;
577
+ this.checkForChanges = null;
578
+ this.valueChange = new EventEmitter();
579
+ this.formValidationChange = new EventEmitter();
580
+ this.fieldClick = new EventEmitter();
581
+ // @Output() internalFormFieldClick: EventEmitter<any> = new EventEmitter<any>();
582
+ // @Output() internalFormFieldChange: EventEmitter<any> = new EventEmitter<any>();
583
+ this.isLocked = false;
584
+ // payLoad = '';
585
+ this.rows = [];
586
+ this.fields = [];
587
+ this._fieldsSubject = new BehaviorSubject([]);
588
+ this.columns = 1;
589
+ this.hasMenuFloatingOnOtherField = false;
590
+ this.indicatorsDataField = null;
591
+ this._shouldReloadForm = false;
592
+ // store the initial value to compare with
593
+ this.differ = differs.find({}).create();
594
+ }
595
+ set data(value) {
596
+ const shouldReload = this.shouldReloadForm || !this._data;
597
+ this._data = value;
598
+ if (shouldReload) {
599
+ this._shouldReloadForm = false;
600
+ this.initForm();
601
+ }
602
+ else {
603
+ this.updateForm();
604
+ }
605
+ }
606
+ get data() {
607
+ return this._data;
608
+ }
609
+ set lockFields(value) {
610
+ this.isLocked = value;
611
+ }
612
+ get fields$() {
613
+ return this._fieldsSubject.asObservable();
614
+ }
615
+ get shouldReloadForm() {
616
+ return this._shouldReloadForm;
617
+ }
618
+ convertXAlignToHorizontalAlign(xAlign) {
619
+ let res = DEFAULT_HORIZONTAL_ALIGNMENT;
620
+ if (xAlign === X_ALIGNMENT_TYPE.None ||
621
+ xAlign === X_ALIGNMENT_TYPE.Left) {
622
+ res = 'left';
623
+ }
624
+ else if (xAlign === X_ALIGNMENT_TYPE.Right) {
625
+ res = 'right';
626
+ }
627
+ else {
628
+ res = 'center';
629
+ }
630
+ return res;
631
+ }
632
+ convertYAlignToVerticalAlign(yAlign) {
633
+ let res = DEFAULT_VERTICAL_ALIGNMENT;
634
+ if (yAlign === Y_ALIGNMENT_TYPE.None ||
635
+ yAlign === Y_ALIGNMENT_TYPE.Top) {
636
+ res = 'top';
637
+ }
638
+ else if (yAlign === Y_ALIGNMENT_TYPE.Bottom) {
639
+ res = 'bottom';
640
+ }
641
+ else {
642
+ res = 'middle';
643
+ }
644
+ return res;
645
+ }
646
+ convertOptionalValues(optionalValues) {
647
+ if (optionalValues && optionalValues.length > 0) {
648
+ return optionalValues.map((ov) => {
649
+ return { key: ov.Key, value: ov.Value };
650
+ });
651
+ }
652
+ else {
653
+ return [];
654
+ }
655
+ }
656
+ convertAddressFields(controlField, addressFields, canEditObject) {
657
+ const fields = [];
658
+ addressFields.forEach((field) => {
659
+ let customField;
660
+ const placeholder = field.ApiName;
661
+ if (field.ApiName.toLowerCase().indexOf('street') >= 0) {
662
+ customField = new PepTextboxField({
663
+ key: field.ApiName,
664
+ label: field.ApiName,
665
+ type: 'text',
666
+ placeholder,
667
+ readonly: !canEditObject,
668
+ disabled: !field.Enabled || !canEditObject,
669
+ hidden: false,
670
+ mandatory: false,
671
+ value: field.Value,
672
+ formattedValue: field.FormattedValue,
673
+ row: 0,
674
+ rowSpan: 1,
675
+ col: 0,
676
+ colSpan: 2,
677
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
678
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
679
+ order: 0,
680
+ });
681
+ }
682
+ else if (field.ApiName.toLowerCase().indexOf('city') >= 0) {
683
+ customField = new PepTextboxField({
684
+ key: field.ApiName,
685
+ label: field.ApiName,
686
+ type: 'text',
687
+ placeholder,
688
+ readonly: !canEditObject,
689
+ disabled: !field.Enabled || !canEditObject,
690
+ hidden: false,
691
+ mandatory: false,
692
+ value: field.Value,
693
+ formattedValue: field.FormattedValue,
694
+ row: 0,
695
+ rowSpan: 1,
696
+ col: 2,
697
+ colSpan: 1,
698
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
699
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
700
+ order: 1,
701
+ });
702
+ }
703
+ else if (field.ApiName.toLowerCase().indexOf('state') >= 0) {
704
+ customField = new PepSelectField({
705
+ key: field.ApiName,
706
+ label: field.ApiName,
707
+ placeholder,
708
+ options: this.convertOptionalValues(field.OptionalValues),
709
+ readonly: !canEditObject,
710
+ disabled: !field.Enabled || !canEditObject,
711
+ hidden: false,
712
+ mandatory: false,
713
+ value: field.Value,
714
+ formattedValue: field.FormattedValue,
715
+ row: 1,
716
+ rowSpan: 1,
717
+ col: 0,
718
+ colSpan: 1,
719
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
720
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
721
+ order: 2,
722
+ });
723
+ }
724
+ else if (field.ApiName.toLowerCase().indexOf('zipcode') >= 0) {
725
+ customField = new PepTextboxField({
726
+ key: field.ApiName,
727
+ label: field.ApiName,
728
+ type: 'text',
729
+ placeholder,
730
+ readonly: !canEditObject,
731
+ disabled: !field.Enabled || !canEditObject,
732
+ hidden: false,
733
+ mandatory: false,
734
+ value: field.Value,
735
+ formattedValue: field.FormattedValue,
736
+ row: 1,
737
+ rowSpan: 1,
738
+ col: 1,
739
+ colSpan: 1,
740
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
741
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
742
+ order: 3,
743
+ });
744
+ }
745
+ else if (field.ApiName.toLowerCase().indexOf('country') >= 0) {
746
+ customField = new PepSelectField({
747
+ key: field.ApiName,
748
+ label: field.ApiName,
749
+ placeholder,
750
+ options: this.convertOptionalValues(field.OptionalValues),
751
+ readonly: !canEditObject,
752
+ disabled: !field.Enabled || !canEditObject,
753
+ hidden: false,
754
+ mandatory: false,
755
+ value: field.Value,
756
+ formattedValue: field.FormattedValue,
757
+ row: 2,
758
+ rowSpan: 1,
759
+ col: 2,
760
+ colSpan: 1,
761
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
762
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
763
+ order: 4,
764
+ });
765
+ }
766
+ fields.push(customField);
767
+ });
768
+ return fields.sort((n1, n2) => n1.order > n2.order ? 1 : n1.order < n2.order ? -1 : 0);
769
+ }
770
+ isMatrixField(apiNameToCheck) {
771
+ return apiNameToCheck.indexOf('Matrix') >= 0;
772
+ }
773
+ doesFieldHavaFloatingField(controlField, floatingField) {
774
+ let hasFloatingField = false;
775
+ if (floatingField.Layout.Y >= controlField.Layout.Y &&
776
+ floatingField.Layout.Y <
777
+ controlField.Layout.Y + controlField.Layout.Height &&
778
+ floatingField.Layout.X >= controlField.Layout.X &&
779
+ floatingField.Layout.X <
780
+ controlField.Layout.X + controlField.Layout.Width) {
781
+ hasFloatingField = true;
782
+ }
783
+ return hasFloatingField;
784
+ }
785
+ getOptionsForCustomField(controlField, dataField, canEditObject) {
786
+ if (!controlField || !dataField) {
787
+ return;
788
+ }
789
+ const placeholder = controlField.ReadOnly || !canEditObject ? '' : controlField.Title;
790
+ return {
791
+ key: controlField.ApiName,
792
+ label: controlField.Title,
793
+ accessory: dataField.Accessory,
794
+ placeholder,
795
+ readonly: controlField.ReadOnly || !canEditObject,
796
+ disabled: !dataField.Enabled || !canEditObject,
797
+ hidden: controlField.Hidden,
798
+ mandatory: controlField.Mandatory,
799
+ value: dataField.Value,
800
+ formattedValue: dataField.FormattedValue,
801
+ additionalValue: dataField.AdditionalValue,
802
+ row: controlField.Layout.Y,
803
+ rowSpan: controlField.Layout.Height,
804
+ col: controlField.Layout.X,
805
+ colSpan: controlField.Layout.Width,
806
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
807
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
808
+ options: this.convertOptionalValues(dataField.OptionalValues),
809
+ groupFields: undefined,
810
+ maxFieldCharacters: controlField.MaxFieldCharacters,
811
+ minValue: controlField.MinValue,
812
+ maxValue: controlField.MaxValue,
813
+ // hasMenu: hasMenu,
814
+ // hasCampaign: hasCampaign,
815
+ // hasIndicators: hasIndicators,
816
+ textColor: dataField.TextColor,
817
+ visible: dataField.Visible,
818
+ digitsNumberAfterDecimalPoint: dataField.DigitsNumberAfterDecimalPoint,
819
+ };
820
+ }
821
+ convertToCustomField(controlField, dataField, canEditObject, menuField, hasCampaignField, indicatorsField, objectId, parentId, searchCode) {
822
+ let customField;
823
+ const options = this.getOptionsForCustomField(controlField, dataField, canEditObject);
824
+ if (controlField.ApiName === 'ObjectMenu') {
825
+ options.type = 'menu';
826
+ customField = new PepInternalMenuField(options);
827
+ }
828
+ else if (controlField.FieldType === FIELD_TYPE.NumberRealQuantitySelector ||
829
+ controlField.FieldType ===
830
+ FIELD_TYPE.NumberIntegerQuantitySelector ||
831
+ controlField.ApiName === 'QuantitySelector' ||
832
+ controlField.ApiName === 'UnitsQuantity' ||
833
+ controlField.ApiName.indexOf('size_') === 0) {
834
+ if (dataField.FieldType === FIELD_TYPE.InternalLink) {
835
+ options.type = 'button';
836
+ }
837
+ else if (dataField.FieldType === FIELD_TYPE.Package) {
838
+ options.type = 'packageButton';
839
+ }
840
+ else if (dataField.FieldType === FIELD_TYPE.NumberRealQuantitySelector ||
841
+ dataField.FieldType === FIELD_TYPE.NumberReal) {
842
+ options.type = 'qs';
843
+ options.allowDecimal = true;
844
+ }
845
+ else if (dataField.FieldType ===
846
+ FIELD_TYPE.NumberIntegerQuantitySelector ||
847
+ dataField.FieldType === FIELD_TYPE.NumberInteger) {
848
+ options.type = 'qs';
849
+ options.allowDecimal = false;
850
+ }
851
+ else if (dataField.FieldType === FIELD_TYPE.NumberIntegerForMatrix) {
852
+ options.type = 'qsForMatrix';
853
+ options.allowDecimal = false;
854
+ }
855
+ else if (dataField.FieldType === FIELD_TYPE.NumberRealForMatrix) {
856
+ options.type = 'qsForMatrix';
857
+ options.allowDecimal = true;
858
+ }
859
+ options.notificationInfo = dataField.NotificationInfo;
860
+ customField = new PepQuantitySelectorField(options);
861
+ }
862
+ else {
863
+ // HACK: need to remove this..
864
+ if (dataField.FieldType === FIELD_TYPE.Indicators &&
865
+ this.isMatrixField(dataField.ApiName)) {
866
+ dataField.FieldType = FIELD_TYPE.InternalPage;
867
+ }
868
+ switch (dataField.FieldType) {
869
+ case FIELD_TYPE.Address: {
870
+ const canEditGroupObject = controlField.ReadOnly
871
+ ? false
872
+ : canEditObject;
873
+ options.groupFields = this.convertAddressFields(controlField, dataField.GroupFields, canEditGroupObject);
874
+ customField = new PepAddressField(options);
875
+ break;
876
+ }
877
+ case FIELD_TYPE.Indicators: {
878
+ // options['type'] = 'indicators'; // Not needed this is PepIndicatorsField.
879
+ customField = new PepIndicatorsField(options);
880
+ break;
881
+ }
882
+ case FIELD_TYPE.InternalPage: {
883
+ if (this.isMatrixField(controlField.ApiName)) {
884
+ options.rowSpan = controlField.Layout.Height;
885
+ options.objectId = objectId;
886
+ options.parentId = parentId;
887
+ options.searchCode = searchCode;
888
+ customField = new PepInternalPageField(options);
889
+ }
890
+ else {
891
+ // Not supported
892
+ }
893
+ break;
894
+ }
895
+ case FIELD_TYPE.RelatedObjectsCards: {
896
+ options.rowSpan = controlField.Layout.Height;
897
+ options.searchCode = searchCode;
898
+ options.pageInfo = dataField.UIPageInfo;
899
+ customField = new PepInternalCaruselField(options);
900
+ break;
901
+ }
902
+ case FIELD_TYPE.Link: {
903
+ options.type = 'link';
904
+ customField = new PepLinkField(options);
905
+ break;
906
+ }
907
+ case FIELD_TYPE.InternalLink:
908
+ case FIELD_TYPE.Button: {
909
+ options.type = 'button';
910
+ customField = new PepInternalButtonField(options);
911
+ break;
912
+ }
913
+ case FIELD_TYPE.Attachment: {
914
+ // options.type = 'attachment';
915
+ customField = new PepAttachmentField(options);
916
+ break;
917
+ }
918
+ case FIELD_TYPE.Signature: {
919
+ // options.type = 'signature';
920
+ customField = new PepSignatureField(options);
921
+ break;
922
+ }
923
+ case FIELD_TYPE.Image:
924
+ case FIELD_TYPE.ImageURL: {
925
+ // options.type = 'image';
926
+ options.menuField =
927
+ menuField &&
928
+ this.doesFieldHavaFloatingField(controlField, menuField)
929
+ ? menuField
930
+ : null;
931
+ options.hasCampaignField =
932
+ hasCampaignField &&
933
+ this.doesFieldHavaFloatingField(controlField, hasCampaignField)
934
+ ? hasCampaignField
935
+ : null;
936
+ options.indicatorsField =
937
+ indicatorsField &&
938
+ this.doesFieldHavaFloatingField(controlField, indicatorsField)
939
+ ? indicatorsField
940
+ : null;
941
+ customField = new PepImageField(options);
942
+ break;
943
+ }
944
+ case FIELD_TYPE.Images: {
945
+ // options.type = 'images';
946
+ customField = new PepImagesField(options);
947
+ break;
948
+ }
949
+ case FIELD_TYPE.Email: {
950
+ options.type = 'email';
951
+ customField = new PepLinkField(options);
952
+ break;
953
+ }
954
+ case FIELD_TYPE.Phone: {
955
+ options.type = 'phone';
956
+ customField = new PepLinkField(options);
957
+ break;
958
+ }
959
+ case FIELD_TYPE.Duration: {
960
+ options.type = 'duration';
961
+ customField = new PepTextboxField(options);
962
+ break;
963
+ }
964
+ case FIELD_TYPE.Default:
965
+ case FIELD_TYPE.TextBox:
966
+ case FIELD_TYPE.LimitedLengthTextBox:
967
+ case FIELD_TYPE.TextHeader:
968
+ case FIELD_TYPE.CalculatedString:
969
+ case FIELD_TYPE.MapDataString: {
970
+ customField = new PepTextboxField(options);
971
+ break;
972
+ }
973
+ case FIELD_TYPE.TextArea: {
974
+ customField = new PepTextareaField(options);
975
+ break;
976
+ }
977
+ case FIELD_TYPE.RichTextHTML: {
978
+ customField = new PepRichHtmlTextareaField(options);
979
+ break;
980
+ }
981
+ case FIELD_TYPE.Date:
982
+ case FIELD_TYPE.LimitedDate:
983
+ case FIELD_TYPE.CalculatedDate:
984
+ case FIELD_TYPE.DateAndTime: {
985
+ options.type =
986
+ dataField.FieldType === FIELD_TYPE.DateAndTime
987
+ ? 'datetime'
988
+ : 'date';
989
+ customField = new PepDateField(options);
990
+ break;
991
+ }
992
+ case FIELD_TYPE.NumberInteger:
993
+ case FIELD_TYPE.CalculatedInt:
994
+ case FIELD_TYPE.MapDataInt: {
995
+ options.type = 'int';
996
+ customField = new PepTextboxField(options);
997
+ break;
998
+ }
999
+ case FIELD_TYPE.Percentage: {
1000
+ options.type = 'percentage';
1001
+ customField = new PepTextboxField(options);
1002
+ break;
1003
+ }
1004
+ case FIELD_TYPE.Currency: {
1005
+ options.type = 'currency';
1006
+ customField = new PepTextboxField(options);
1007
+ break;
1008
+ }
1009
+ case FIELD_TYPE.NumberReal:
1010
+ case FIELD_TYPE.CalculatedReal:
1011
+ case FIELD_TYPE.MapDataReal:
1012
+ case FIELD_TYPE.Sum:
1013
+ case FIELD_TYPE.Totals: {
1014
+ options.type = 'real';
1015
+ customField = new PepTextboxField(options);
1016
+ break;
1017
+ }
1018
+ case FIELD_TYPE.Boolean:
1019
+ case FIELD_TYPE.CalculatedBool: {
1020
+ customField = new PepCheckboxField(options);
1021
+ break;
1022
+ }
1023
+ case FIELD_TYPE.BooleanText: {
1024
+ options.type = 'booleanText';
1025
+ customField = new PepCheckboxField(options);
1026
+ break;
1027
+ }
1028
+ case FIELD_TYPE.ComboBox:
1029
+ case FIELD_TYPE.EmptyComboBox:
1030
+ case FIELD_TYPE.MapDataDropDown: {
1031
+ // options.type = 'select';
1032
+ customField = new PepSelectField(options);
1033
+ break;
1034
+ }
1035
+ case FIELD_TYPE.MultiTickBox:
1036
+ case FIELD_TYPE.MultiTickBoxToComboBox:
1037
+ case FIELD_TYPE.EmptyMultiTickBox: {
1038
+ options.type = 'multi';
1039
+ customField = new PepSelectField(options);
1040
+ break;
1041
+ }
1042
+ case FIELD_TYPE.GuidReferenceType: {
1043
+ options.type = 'reference';
1044
+ options.referenceObjectType = dataField.ReferenceObjectType;
1045
+ options.referenceObjectSubType =
1046
+ dataField.ReferenceObjectSubType;
1047
+ options.referenceObjectInternalType =
1048
+ dataField.ReferenceObjectInternalType;
1049
+ customField = new PepInternalButtonField(options);
1050
+ break;
1051
+ }
1052
+ case FIELD_TYPE.ListOfObjects: {
1053
+ options.type = 'listofobjects';
1054
+ customField = new PepInternalButtonField(options);
1055
+ break;
1056
+ }
1057
+ case FIELD_TYPE.Separator: {
1058
+ customField = new PepSeparatorField(options);
1059
+ break;
1060
+ }
1061
+ /*
1062
+ case FIELD_TYPE.Images: return that.field(value);
1063
+ */
1064
+ case FIELD_TYPE.NumberRealQuantitySelector:
1065
+ case FIELD_TYPE.NumberIntegerQuantitySelector: {
1066
+ options.type = 'qs';
1067
+ options.allowDecimal =
1068
+ dataField.FieldType ===
1069
+ FIELD_TYPE.NumberRealQuantitySelector;
1070
+ options.notificationInfo = dataField.NotificationInfo;
1071
+ customField = new PepQuantitySelectorField(options);
1072
+ break;
1073
+ }
1074
+ case FIELD_TYPE.Package: {
1075
+ options.type = 'packageButton';
1076
+ options.notificationInfo = dataField.NotificationInfo;
1077
+ customField = new PepQuantitySelectorField(options);
1078
+ break;
1079
+ }
1080
+ }
1081
+ }
1082
+ if (!customField) {
1083
+ options.label = controlField.ApiName + ' is not supported!!!';
1084
+ customField = new PepSeparatorField(options);
1085
+ }
1086
+ return customField;
1087
+ }
1088
+ getFieldFormattedValue(field) {
1089
+ let fieldFormattedValue = field.formattedValue || field.value;
1090
+ // Fix for the custom check box component.
1091
+ if (field.controlType === 'checkbox') {
1092
+ fieldFormattedValue = fieldFormattedValue === 'true';
1093
+ }
1094
+ // Fix for the custom button component.
1095
+ if (field.controlType === 'button') {
1096
+ fieldFormattedValue =
1097
+ fieldFormattedValue === '0' ? '' : fieldFormattedValue;
1098
+ }
1099
+ return fieldFormattedValue;
1100
+ }
1101
+ toControlGroup(fields) {
1102
+ const group = {};
1103
+ if (fields && fields.length > 0) {
1104
+ fields.forEach((field) => {
1105
+ if (field.groupFields && field.groupFields.length > 0) {
1106
+ const subGroup = {};
1107
+ field.groupFields.forEach((groupField) => {
1108
+ if (groupField.mandatory &&
1109
+ !field.readonly &&
1110
+ !field.disabled) {
1111
+ subGroup[groupField.key] = [
1112
+ {
1113
+ value: groupField.formattedValue || '',
1114
+ disabled: field.readonly ||
1115
+ field.disabled ||
1116
+ groupField.disabled,
1117
+ },
1118
+ [Validators.required],
1119
+ ];
1120
+ }
1121
+ else {
1122
+ subGroup[groupField.key] = [
1123
+ {
1124
+ value: groupField.formattedValue || '',
1125
+ disabled: field.readonly ||
1126
+ field.disabled ||
1127
+ groupField.disabled,
1128
+ },
1129
+ [Validators.nullValidator],
1130
+ ];
1131
+ }
1132
+ });
1133
+ group[field.key] = this.fb.group(subGroup);
1134
+ }
1135
+ else {
1136
+ const validators = field.getValidators();
1137
+ const fieldFormattedValue = this.getFieldFormattedValue(field);
1138
+ group[field.key] = [
1139
+ {
1140
+ value: fieldFormattedValue || '',
1141
+ disabled: field.disabled,
1142
+ },
1143
+ validators,
1144
+ ];
1145
+ }
1146
+ });
1147
+ }
1148
+ return this.fb.group(group);
1149
+ }
1150
+ createBaseField(uiControlField, dataField) {
1151
+ const customField = this.convertToCustomField(uiControlField, dataField, this.canEditObject, this.menuDataField, this.hasCampaignDataField, this.indicatorsDataField, this.objectId, this.parentId, this.searchCode);
1152
+ return customField;
1153
+ }
1154
+ showFormValidationMessage() {
1155
+ const fields = this.fields;
1156
+ let emptyMandatoryFieldsMsg = '';
1157
+ let notValidFieldsMsg = '';
1158
+ // for (let i: number = 0; i < fields.length; i++) {
1159
+ // let field = fields[i];
1160
+ for (const field of fields) {
1161
+ const formControl = this.form && this.form.get(field.key);
1162
+ if (formControl) {
1163
+ // Mandatory is empty.
1164
+ if (field.mandatory &&
1165
+ formControl.value.toString().trim().length === 0) {
1166
+ emptyMandatoryFieldsMsg +=
1167
+ '<li><small>' + field.label + '</small></li>';
1168
+ }
1169
+ else if (!field.disabled && !formControl.valid) {
1170
+ notValidFieldsMsg +=
1171
+ '<li><small>' + field.label + '</small></li>';
1172
+ }
1173
+ }
1174
+ }
1175
+ // Add the header message of the empty mandatory fields
1176
+ if (emptyMandatoryFieldsMsg.length > 0) {
1177
+ emptyMandatoryFieldsMsg =
1178
+ '<div>' +
1179
+ this.translate.instant('MESSAGES.ERROR_MANDATORY_FIELDS') +
1180
+ "</div><ul style='padding: 0 20px;'>" +
1181
+ emptyMandatoryFieldsMsg +
1182
+ '</ul><br/>';
1183
+ }
1184
+ // Add the header message of the empty mandatory fields
1185
+ if (notValidFieldsMsg.length > 0) {
1186
+ notValidFieldsMsg =
1187
+ '<div>' +
1188
+ this.translate.instant('MESSAGES.ERROR_INVALID_FIELDS') +
1189
+ "</div><ul style='padding: 0 20px;'>" +
1190
+ notValidFieldsMsg +
1191
+ '</ul>';
1192
+ }
1193
+ const title = this.translate.instant('MESSAGES.TITLE_NOTICE');
1194
+ const data = new PepDialogData({
1195
+ title,
1196
+ content: emptyMandatoryFieldsMsg + notValidFieldsMsg,
1197
+ });
1198
+ this.dialogService.openDefaultDialog(data);
1199
+ }
1200
+ ngOnInit() {
1201
+ const themeVars = this.customizationService.getThemeVariables();
1202
+ // convert rem to pixel
1203
+ const RemToPixel = 16;
1204
+ this.formGutterSize =
1205
+ this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.FORM_SPACEING_KEY) * RemToPixel;
1206
+ this.cardGutterSize =
1207
+ this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.CARD_SPACEING_KEY) * RemToPixel;
1208
+ }
1209
+ ngDoCheck() {
1210
+ const changes = this.differ.diff(this.data); // check for changes
1211
+ if (changes) {
1212
+ this.updateForm();
1213
+ this.checkForChanges = new Date();
1214
+ }
1215
+ }
1216
+ ngOnChanges(changes) {
1217
+ // if (changes.data && changes.data.currentValue) {
1218
+ // // Load changes
1219
+ // if (!this.shouldReloadForm && changes.data.previousValue) {
1220
+ // this.data = changes.data.currentValue;
1221
+ // this.updateForm();
1222
+ // } else {
1223
+ // this._shouldReloadForm = false;
1224
+ // this.initForm();
1225
+ // }
1226
+ // }
1227
+ // if (this.shouldReloadForm || !changes?.data?.previousValue) {
1228
+ // this._shouldReloadForm = false;
1229
+ // this.initForm();
1230
+ // this.checkForChanges = new Date();
1231
+ // }
1232
+ }
1233
+ ngOnDestroy() {
1234
+ //
1235
+ }
1236
+ getUiControlFields() {
1237
+ return this.layout ? this.layout.ControlFields : [];
1238
+ }
1239
+ initFieldsStructure(fields, maxRow) {
1240
+ const themeVars = this.customizationService.getThemeVariables();
1241
+ // Set form row height.
1242
+ if (this.layoutType === 'card') {
1243
+ const cardFieldHeight = this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.CARD_FIELD_HEIGHT_KEY);
1244
+ this.rowHeight = cardFieldHeight;
1245
+ }
1246
+ else {
1247
+ const rowFieldHeight = this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.FORM_FIELD_HEIGHT_KEY);
1248
+ const rowFieldTitleHeight = this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.FORM_FIELD_TITLE_HEIGHT_KEY);
1249
+ this.rowHeight = rowFieldHeight + rowFieldTitleHeight;
1250
+ }
1251
+ // Create the fields structure (the fields must be sorted!!!).
1252
+ if (fields.length > 0) {
1253
+ // Init the layout.
1254
+ if (
1255
+ // this.layoutType === 'form' ||
1256
+ this.layoutType === 'table') {
1257
+ this.fields = fields;
1258
+ this._fieldsSubject.next(fields);
1259
+ this.rows = [];
1260
+ for (let i = 0; i <= maxRow; i++) {
1261
+ this.rows[i] = [];
1262
+ }
1263
+ // for (let i = 0; i < fields.length; i++) {
1264
+ // const field = fields[i]
1265
+ for (const field of fields) {
1266
+ this.rows[field.row].push(field);
1267
+ }
1268
+ }
1269
+ else {
1270
+ const doesfieldExistIn = new Array(maxRow);
1271
+ for (let i = 0; i < doesfieldExistIn.length; i++) {
1272
+ doesfieldExistIn[i] = new Array(this.columns);
1273
+ for (let j = 0; j < doesfieldExistIn[i].length; j++) {
1274
+ doesfieldExistIn[i][j] = false;
1275
+ }
1276
+ }
1277
+ // Run in squere (row - colspan, col - rowspan) and put true where it should.
1278
+ // for (let index = 0; index < fields.length; index++) {
1279
+ // const currentField = fields[index];
1280
+ for (const currentField of fields) {
1281
+ if (currentField.rowSpan > 1) {
1282
+ for (let row = currentField.row; row < currentField.row + currentField.rowSpan; row++) {
1283
+ if (currentField.colSpan > 1) {
1284
+ for (let col = currentField.col; col <
1285
+ currentField.col + currentField.colSpan; col++) {
1286
+ if (doesfieldExistIn.length > row &&
1287
+ doesfieldExistIn[0].length > col) {
1288
+ doesfieldExistIn[row][col] = true;
1289
+ }
1290
+ }
1291
+ }
1292
+ else {
1293
+ if (doesfieldExistIn.length > row &&
1294
+ doesfieldExistIn[0].length >
1295
+ currentField.col) {
1296
+ doesfieldExistIn[row][currentField.col] = true;
1297
+ }
1298
+ }
1299
+ }
1300
+ }
1301
+ else if (currentField.colSpan > 1) {
1302
+ for (let col = currentField.col; col < currentField.col + currentField.colSpan; col++) {
1303
+ if (doesfieldExistIn.length > currentField.row &&
1304
+ doesfieldExistIn[0].length > col) {
1305
+ doesfieldExistIn[currentField.row][col] = true;
1306
+ }
1307
+ }
1308
+ }
1309
+ else {
1310
+ if (doesfieldExistIn.length > currentField.row &&
1311
+ doesfieldExistIn[0].length > currentField.col) {
1312
+ doesfieldExistIn[currentField.row][currentField.col] = true;
1313
+ }
1314
+ }
1315
+ }
1316
+ // Create empty fields where doesfieldExistIn is false (For the md-grid-list UI Component).
1317
+ for (let i = 0; i < doesfieldExistIn.length; i++) {
1318
+ for (let j = 0; j < doesfieldExistIn[i].length; j++) {
1319
+ if (!doesfieldExistIn[i][j]) {
1320
+ // Create empty field and add it to the fields list.
1321
+ fields.push(new PepPlaceholderField({
1322
+ key: i + '_' + j,
1323
+ label: '',
1324
+ placeholder: '',
1325
+ readonly: false,
1326
+ disabled: false,
1327
+ hidden: false,
1328
+ mandatory: false,
1329
+ value: '',
1330
+ formattedValue: '',
1331
+ row: i,
1332
+ rowSpan: 1,
1333
+ col: j,
1334
+ colSpan: 1,
1335
+ order: 1,
1336
+ }));
1337
+ }
1338
+ }
1339
+ }
1340
+ // Sort the fields again.
1341
+ this.fields = fields.sort((f1, f2) => f1.row > f2.row
1342
+ ? 1
1343
+ : f1.row < f2.row
1344
+ ? -1
1345
+ : f1.col > f2.col
1346
+ ? 1
1347
+ : f1.col < f2.col
1348
+ ? -1
1349
+ : 0);
1350
+ this._fieldsSubject.next(fields);
1351
+ }
1352
+ }
1353
+ }
1354
+ setForm(isForUpdate = false) {
1355
+ let allFieldsAreReadOnly = true;
1356
+ if (!isForUpdate) {
1357
+ const fields = [];
1358
+ for (const currentField of this.fields) {
1359
+ // Add all fields except 'internalPage' (for children).
1360
+ if (currentField.controlType !== 'internalPage') {
1361
+ fields.push(currentField);
1362
+ }
1363
+ if (!currentField.readonly) {
1364
+ allFieldsAreReadOnly = false;
1365
+ }
1366
+ }
1367
+ this.form = this.toControlGroup(fields);
1368
+ }
1369
+ else {
1370
+ // Update form values if changed by calculated fields.
1371
+ for (let i = 0; i < this.fields.length; i++) {
1372
+ let currentField = this.fields[i];
1373
+ if (currentField.controlType === 'internalCarusel') {
1374
+ // Hack to override (update) the field.
1375
+ const uiControlField = this.getUiControlFields().find(cf => cf.ApiName === currentField.key);
1376
+ const dataField = this.data.Fields.find(df => df.ApiName === currentField.key);
1377
+ currentField = this.createBaseField(uiControlField, dataField);
1378
+ this._fieldsSubject.value[i] = currentField;
1379
+ }
1380
+ else if (currentField.controlType !== 'internalPage') {
1381
+ if (currentField.groupFields &&
1382
+ currentField.groupFields.length > 0) {
1383
+ // for (let j = 0; j < currentField.groupFields.length; j++) {
1384
+ // let currentGroupField = currentField.groupFields[j];
1385
+ for (const currentGroupField of currentField.groupFields) {
1386
+ const fieldFormattedValue = this.getFieldFormattedValue(currentGroupField);
1387
+ this.customizationService.updateFormField(this.form, currentGroupField, fieldFormattedValue, currentField);
1388
+ }
1389
+ }
1390
+ else {
1391
+ const fieldFormattedValue = this.getFieldFormattedValue(currentField);
1392
+ // this.form.controls[currentField.key].setValue(fieldFormattedValue);
1393
+ this.customizationService.updateFormField(this.form, currentField, fieldFormattedValue);
1394
+ }
1395
+ }
1396
+ if (!currentField.readonly) {
1397
+ allFieldsAreReadOnly = false;
1398
+ }
1399
+ }
1400
+ }
1401
+ let isFormValid = this.form?.valid;
1402
+ // Change validation to true if all fields are read only.
1403
+ if (!isFormValid && allFieldsAreReadOnly) {
1404
+ isFormValid = true;
1405
+ }
1406
+ this.onFormValidationChanged(isFormValid);
1407
+ // Set it to false to enable all fields.
1408
+ if (this.isInternal && this.isLocked) {
1409
+ this.isLocked = false;
1410
+ }
1411
+ }
1412
+ initForm() {
1413
+ if (this.data && this.data.Fields) {
1414
+ const fields = this.convertCustomFields(this.getUiControlFields(), this.data.Fields);
1415
+ const maxRow = Math.max(...fields.map((f) => {
1416
+ return f.row + f.rowSpan;
1417
+ }));
1418
+ this.columns = Math.max(...fields.map((f) => {
1419
+ return f.col + f.colSpan;
1420
+ }));
1421
+ this.initFieldsStructure(fields, maxRow);
1422
+ this.setForm();
1423
+ }
1424
+ }
1425
+ updateField(customField, updatedField) {
1426
+ const options = {
1427
+ disabled: !updatedField.Enabled || !this.canEditObject,
1428
+ readonly: !updatedField.Enabled || !this.canEditObject,
1429
+ visible: updatedField.Visible,
1430
+ value: updatedField.Value,
1431
+ additionalValue: updatedField.AdditionalValue,
1432
+ formattedValue: updatedField.FormattedValue,
1433
+ textColor: updatedField.TextColor,
1434
+ digitsNumberAfterDecimalPoint: updatedField.DigitsNumberAfterDecimalPoint,
1435
+ };
1436
+ if (customField instanceof PepQuantitySelectorField) {
1437
+ const notificationInfo = updatedField.NotificationInfo;
1438
+ options.notificationInfo = notificationInfo;
1439
+ // Change type if it's change (only for allowDecimal).
1440
+ let allowDecimal = false;
1441
+ if (updatedField.FieldType === FIELD_TYPE.NumberRealQuantitySelector ||
1442
+ updatedField.FieldType === FIELD_TYPE.NumberReal ||
1443
+ updatedField.FieldType === FIELD_TYPE.NumberRealForMatrix) {
1444
+ allowDecimal = true;
1445
+ }
1446
+ options.allowDecimal = allowDecimal;
1447
+ }
1448
+ else if (customField instanceof PepSelectField) {
1449
+ options.options = this.convertOptionalValues(updatedField.OptionalValues);
1450
+ if (!options.options || options.options.length === 0) {
1451
+ options.options.push({
1452
+ key: options.value,
1453
+ value: options.formattedValue,
1454
+ });
1455
+ }
1456
+ }
1457
+ else if (customField instanceof PepInternalCaruselField) {
1458
+ options.pageInfo = updatedField.UIPageInfo;
1459
+ }
1460
+ customField.update(options);
1461
+ }
1462
+ updateForm() {
1463
+ if (this.data && this.data.Fields) {
1464
+ for (const currentField of this.data.Fields) {
1465
+ const customField = this.fields.filter((f) => f.key === currentField.ApiName)[0];
1466
+ // Update all fields except 'internalPage' type (for children).
1467
+ if (customField && customField.controlType !== 'internalPage') {
1468
+ this.updateField(customField, currentField);
1469
+ // Update the group fields.
1470
+ if (customField.controlType === 'address' &&
1471
+ currentField.GroupFields) {
1472
+ // for (let j = 0; j < currentField.GroupFields.length; j++) {
1473
+ // let currentGroupField = currentField.GroupFields[j];
1474
+ for (const currentGroupField of currentField.GroupFields) {
1475
+ currentGroupField.Enabled = !currentField.Enabled
1476
+ ? false
1477
+ : currentGroupField.Enabled;
1478
+ const customGroupField = customField.groupFields.filter((f) => f.key === currentGroupField.ApiName)[0];
1479
+ this.updateField(customGroupField, currentGroupField);
1480
+ }
1481
+ }
1482
+ }
1483
+ }
1484
+ this.setForm(true);
1485
+ }
1486
+ }
1487
+ ReloadForm() {
1488
+ this._shouldReloadForm = true;
1489
+ }
1490
+ // onSubmit() {
1491
+ // if (this.form.valid) {
1492
+ // this.payLoad = JSON.stringify(this.form.value);
1493
+ // //this.submitted.emit(this.form.value);
1494
+ // }
1495
+ // }
1496
+ getFormControlById(key) {
1497
+ let formControl = null;
1498
+ this.fields.forEach((field) => {
1499
+ if (field.key === key) {
1500
+ formControl = this.form.get(field.key);
1501
+ return;
1502
+ }
1503
+ else if (field.groupFields && field.groupFields.length > 0) {
1504
+ field.groupFields.forEach((groupField) => {
1505
+ if (groupField.key === key) {
1506
+ formControl = this.form.get(field.key + '.' + groupField.key);
1507
+ return;
1508
+ }
1509
+ });
1510
+ }
1511
+ });
1512
+ return formControl;
1513
+ }
1514
+ setSpecialFields(controlFields, dataFields) {
1515
+ // let cf;
1516
+ // for (let index = 0; index < controlFields.length; index++) {
1517
+ // cf = controlFields[index];
1518
+ for (const cf of controlFields) {
1519
+ if (cf.ApiName === 'ObjectMenu') {
1520
+ this.menuField = cf;
1521
+ }
1522
+ else if (cf.ApiName === 'ItemHasActiveCampaign') {
1523
+ this.hasCampaignField = cf;
1524
+ }
1525
+ else if (cf.ApiName === 'ItemIndicatorsWithoutCampaign') {
1526
+ this.indicatorsField = cf;
1527
+ }
1528
+ }
1529
+ // let df;
1530
+ // for (let index = 0; index < dataFields.length; index++) {
1531
+ // df = dataFields[index];
1532
+ for (const df of dataFields) {
1533
+ if (df.ApiName === 'ObjectMenu') {
1534
+ this.menuDataField = df;
1535
+ }
1536
+ else if (df.ApiName === 'ItemHasActiveCampaign') {
1537
+ this.hasCampaignDataField = df;
1538
+ }
1539
+ else if (df.ApiName === 'ItemIndicatorsWithoutCampaign') {
1540
+ this.indicatorsDataField = df;
1541
+ }
1542
+ }
1543
+ if (this.menuField && this.menuDataField) {
1544
+ this.menuDataField.Layout = this.menuField.Layout;
1545
+ }
1546
+ if (this.hasCampaignField && this.hasCampaignDataField) {
1547
+ this.hasCampaignDataField.Layout = this.hasCampaignField.Layout;
1548
+ }
1549
+ if (this.indicatorsField && this.indicatorsDataField) {
1550
+ this.indicatorsDataField.Layout = this.indicatorsField.Layout;
1551
+ }
1552
+ // Check if menu is floating on other field.
1553
+ // for (let index = 0; index < controlFields.length; index++) {
1554
+ // cf = controlFields[index];
1555
+ for (const cf of controlFields) {
1556
+ if (this.menuField && cf.ApiName !== 'ObjectMenu') {
1557
+ this.hasMenuFloatingOnOtherField = this.doesFieldHavaFloatingField(cf, this.menuField);
1558
+ if (this.hasMenuFloatingOnOtherField) {
1559
+ break;
1560
+ }
1561
+ }
1562
+ }
1563
+ }
1564
+ convertCustomFields(controlFields, dataFields) {
1565
+ if (this.layoutType !== 'table') {
1566
+ this.setSpecialFields(controlFields, dataFields);
1567
+ }
1568
+ else {
1569
+ // HACK: convert to center alignment if table view & special fields)
1570
+ controlFields.forEach((field, index) => {
1571
+ if (field.ApiName === 'UnitsQuantity' ||
1572
+ field.ApiName === 'QuantitySelector' ||
1573
+ field.ApiName === 'ObjectMenu' ||
1574
+ field.FieldType === FIELD_TYPE.Image ||
1575
+ field.FieldType === FIELD_TYPE.ImageURL ||
1576
+ field.FieldType === FIELD_TYPE.Indicators ||
1577
+ field.FieldType === FIELD_TYPE.Boolean ||
1578
+ field.FieldType === FIELD_TYPE.CalculatedBool ||
1579
+ field.FieldType === FIELD_TYPE.Signature ||
1580
+ field.FieldType ===
1581
+ FIELD_TYPE.NumberIntegerQuantitySelector ||
1582
+ field.FieldType === FIELD_TYPE.NumberRealQuantitySelector ||
1583
+ field.FieldType === FIELD_TYPE.Package ||
1584
+ field.FieldType === FIELD_TYPE.NumberIntegerForMatrix ||
1585
+ field.FieldType === FIELD_TYPE.NumberRealForMatrix) {
1586
+ field.Layout.XAlignment = X_ALIGNMENT_TYPE.Center;
1587
+ }
1588
+ else {
1589
+ // HACK: align the rest of the fields by the culture.
1590
+ // field.Layout.XAlignment = this.layoutService.isRtl() ? X_ALIGNMENT_TYPE.Right : X_ALIGNMENT_TYPE.Left;
1591
+ }
1592
+ });
1593
+ }
1594
+ const fields = [];
1595
+ controlFields.forEach((field, index) => {
1596
+ const dataField = dataFields.filter((df) => df.ApiName === field.ApiName)[0];
1597
+ if (!dataField) {
1598
+ return;
1599
+ }
1600
+ // If current view is not table view and those fields are special.
1601
+ if (this.layoutType !== 'table' &&
1602
+ ((this.hasMenuFloatingOnOtherField &&
1603
+ this.menuField &&
1604
+ this.menuField.ApiName === field.ApiName) ||
1605
+ (this.indicatorsField &&
1606
+ this.indicatorsField.ApiName === field.ApiName) ||
1607
+ (this.hasCampaignField &&
1608
+ this.hasCampaignField.ApiName === field.ApiName))) {
1609
+ return;
1610
+ }
1611
+ // Set type to link
1612
+ if (index === 0 && this.firstFieldAsLink) {
1613
+ dataField.FieldType = FIELD_TYPE.InternalLink;
1614
+ // dataField.Value = this.getInternalLinkHref();
1615
+ }
1616
+ if (field.ApiName === 'ObjectMenu') {
1617
+ dataField.Enabled = true;
1618
+ // HACK : Until "Enabled" returns from the server, we set PepMenu to be
1619
+ // Disabled in cart on regular items and not campign items.
1620
+ }
1621
+ const customField = this.createBaseField(field, dataField);
1622
+ fields.push(customField);
1623
+ });
1624
+ return fields.sort((f1, f2) => f1.row > f2.row
1625
+ ? 1
1626
+ : f1.row < f2.row
1627
+ ? -1
1628
+ : f1.col > f2.col
1629
+ ? 1
1630
+ : f1.col < f2.col
1631
+ ? -1
1632
+ : 0);
1633
+ }
1634
+ onFormValidationChanged(formValidationChange) {
1635
+ this.formValidationChange.emit(formValidationChange);
1636
+ }
1637
+ onValueChanged(event) {
1638
+ this.onFormValidationChanged(this.form.valid);
1639
+ const formControl = this.getFormControlById(event.key);
1640
+ const isValid = formControl ? formControl.valid : true;
1641
+ // const isValid = true;
1642
+ if (isValid) {
1643
+ // Set it to false to disable all fields.
1644
+ if (this.isInternal && this.layoutType === 'form') {
1645
+ this.isLocked = true;
1646
+ }
1647
+ // Update the current field value.
1648
+ const currentField = this.fields.find((f) => f.key === event.key);
1649
+ if (currentField) {
1650
+ currentField.formattedValue = currentField.value = event.value;
1651
+ }
1652
+ this.valueChange.emit({
1653
+ id: this.data.UID.toString(),
1654
+ uiObjectKey: this.data.Key,
1655
+ key: event.key,
1656
+ value: event.value,
1657
+ controlType: event.controlType,
1658
+ });
1659
+ }
1660
+ }
1661
+ onClick(fieldClickEvent) {
1662
+ const clickedUiControlField = this.data.Fields.filter((f) => f.ApiName === fieldClickEvent.key)[0];
1663
+ const idType = this.data.Type ? this.data.Type.toString() : '';
1664
+ if (clickedUiControlField) {
1665
+ this.fieldClick.emit({
1666
+ id: this.data.UID.toString(),
1667
+ uiObjectKey: this.data.Key,
1668
+ key: fieldClickEvent.key,
1669
+ idType,
1670
+ which: fieldClickEvent.eventWhich,
1671
+ value: fieldClickEvent.value,
1672
+ controlType: fieldClickEvent.controlType,
1673
+ fieldType: clickedUiControlField.FieldType,
1674
+ otherData: fieldClickEvent.otherData,
1675
+ });
1676
+ }
1677
+ else {
1678
+ // For other api names (like enter children etc).
1679
+ this.fieldClick.emit({
1680
+ id: this.data.UID.toString(),
1681
+ uiObjectKey: this.data.Key,
1682
+ key: fieldClickEvent.key,
1683
+ idType,
1684
+ which: fieldClickEvent.eventWhich,
1685
+ value: fieldClickEvent.value,
1686
+ controlType: fieldClickEvent.controlType,
1687
+ otherData: fieldClickEvent.otherData,
1688
+ });
1689
+ }
1690
+ }
1691
+ // // This event is for handle the internal page events.
1692
+ // onInternalFormFieldClicked(internalFormFieldClick: any): void {
1693
+ // this.internalFormFieldClick.emit(internalFormFieldClick);
1694
+ // }
1695
+ // // This event is for handle the internal page events.
1696
+ // onInternalFormFieldChanged(internalFormFieldChange: any): void {
1697
+ // this.internalFormFieldChange.emit(internalFormFieldChange);
1698
+ // }
1699
+ // This event is for handle the related items change events.
1700
+ onFormValueChanged(event) {
1701
+ // this.valueChange.emit(event);
1702
+ }
1703
+ // This event is for handle the related items change events.
1704
+ onFormFieldClick(event) {
1705
+ this.fieldClick.emit(event);
1706
+ }
1707
+ }
1708
+ PepInternalFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalFormComponent, deps: [{ token: i1$2.PepDialogService }, { token: i1$1.PepCustomizationService }, { token: i1$1.PepLayoutService }, { token: i3$1.FormBuilder }, { token: i0.KeyValueDiffers }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
1709
+ PepInternalFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepInternalFormComponent, selector: "pep-internal-form", inputs: { isInternal: "isInternal", isReport: "isReport", layout: "layout", lockEvents: "lockEvents", canEditObject: "canEditObject", data: "data", lockFields: "lockFields", isActive: "isActive", layoutType: "layoutType", objectId: "objectId", parentId: "parentId", searchCode: "searchCode", showTitle: "showTitle", firstFieldAsLink: "firstFieldAsLink", checkForChanges: "checkForChanges" }, outputs: { valueChange: "valueChange", formValidationChange: "formValidationChange", fieldClick: "fieldClick" }, usesOnChanges: true, ngImport: i0, template: "<fieldset *ngIf=\"form\" [formGroup]=\"form\" [disabled]=\"isLocked\" class=\"pep-form\"\n [ngStyle]=\"{ 'background-color': layoutType == 'card' && data?.BackgroundColor }\">\n <!-- New Form -->\n <mat-grid-list *ngIf=\"layoutType == 'form'\" [cols]=\"columns\" [rowHeight]=\"rowHeight + 'rem'\"\n [gutterSize]=\"formGutterSize\">\n <mat-grid-tile *ngFor=\"let field of fields$ | async\" [rowspan]=\"field.rowSpan\" [colspan]=\"field.colSpan\">\n <pep-internal-field-generator *ngIf=\"field.controlType != 'placeholder'\" [form]=\"form\" [layoutType]=\"layoutType\"\n [checkForChanges]=\"checkForChanges\" [uid]=\"data?.UID\" [field]=\"field\" [showTitle]=\"showTitle\"\n (valueChange)=\"onValueChanged($event)\" (elementClick)=\"onClick($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\"\n >\n </pep-internal-field-generator>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n </mat-grid-tile>\n </mat-grid-list>\n\n <!-- Thumbnails -->\n <mat-grid-list *ngIf=\"layoutType == 'card'\" [cols]=\"columns\" [rowHeight]=\"rowHeight + 'rem'\"\n [gutterSize]=\"cardGutterSize\" class=\"card-spacing\">\n <mat-grid-tile *ngFor=\"let field of fields$ | async\" [rowspan]=\"field.rowSpan\" [colspan]=\"field.colSpan\"\n [ngStyle]=\"{ overflow: field.type == 'qs' ? 'unset' : 'hidden' }\">\n <pep-internal-field-generator *ngIf=\"field.controlType != 'placeholder'\" [form]=\"form\" [layoutType]=\"layoutType\"\n [ngClass]=\"{ 'lock-events': lockEvents }\" [isActive]=\"isActive\" [checkForChanges]=\"checkForChanges\"\n [uid]=\"data?.UID\" [field]=\"field\" [showTitle]=\"showTitle\" (valueChange)=\"onValueChanged($event)\"\n (elementClick)=\"onClick($event)\" (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\">\n </pep-internal-field-generator>\n </mat-grid-tile>\n </mat-grid-list>\n\n <ng-container *ngIf=\"layoutType == 'table'\">\n <ng-container *ngIf=\"isReport; then reportBlock; else notReportBlock\"></ng-container>\n <ng-template #reportBlock>\n <ng-container *ngTemplateOutlet=\"report\"></ng-container>\n </ng-template>\n <ng-template #notReportBlock>\n <div *ngFor=\"let field of fields$ | async; let j = index\" class=\"pull-left flip table-cell \"\n [ngClass]=\"['text-align-' + field.xAlignment]\" style=\"height: 100%\"\n [ngStyle]=\"{ width: (layout?.ControlFields)[j]?.calcColumnWidthString}\">\n <pep-internal-field-generator *ngIf=\"field.controlType != 'placeholder'\" [checkForChanges]=\"checkForChanges\"\n [uid]=\"data?.UID\" [field]=\"field\" [form]=\"form\" [layoutType]=\"layoutType\" [showTitle]=\"false\"\n (elementClick)=\"onClick($event)\" (valueChange)=\"onValueChanged($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\"\n [isActive]=\"isActive\">\n </pep-internal-field-generator>\n </div>\n </ng-template>\n </ng-container>\n\n <!------- For testing ------------\n {{ form.value | json }}\n {{ form.valid }}\n ---------------------------------->\n</fieldset>\n\n<ng-template #report>\n <div *ngFor=\"let field of fields$ | async; let j = index\" class=\"pull-left flip pep-report-fields\"\n [ngStyle]=\"{ width: (layout?.ControlFields)[j]?.calcColumnWidthString }\"\n [ngClass]=\"['text-align-' + field.xAlignment]\">\n <ng-container [ngSwitch]=\"field.controlType\">\n <pep-image *ngSwitchCase=\"'image'\" [uid]=\"data?.UID\" [form]=\"form\" [key]=\"field.key\"\n [src]=\"field.formattedValue\" [srcLarge]=\"field.value\" [options]=\"field.options\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [layoutType]=\"layoutType\"\n (elementClick)=\"onClick($event)\">\n </pep-image>\n\n <pep-signature *ngSwitchCase=\"'signature'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\">\n </pep-signature>\n\n <pep-checkbox *ngSwitchCase=\"'checkbox'\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"(field.value | lowercase) == 'true' || field.value == '1' ? true : false\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [additionalValue]=\"field.additionalValue\" [layoutType]=\"layoutType\">\n </pep-checkbox>\n\n <pep-date *ngSwitchCase=\"'date'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [minValue]=\"field.minValue\" [maxValue]=\"field.maxValue\" [layoutType]=\"layoutType\">\n </pep-date>\n\n <pep-internal-button *ngSwitchCase=\"'button'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\" [type]=\"field.type\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [layoutType]=\"layoutType\" (elementClick)=\"onClick($event)\">\n </pep-internal-button>\n\n <pep-textarea *ngSwitchCase=\"'textarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [maxFieldCharacters]=\"field.maxFieldCharacters\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\">\n </pep-textarea>\n\n <pep-quantity-selector *ngSwitchCase=\"'qs'\" [id]=\"field.key\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"field.value\" [label]=\"field.label\" [type]=\"field.type\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\" (valueChange)=\"onValueChanged($event)\" (elementClick)=\"onClick($event)\">\n </pep-quantity-selector>\n\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"field.formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\">\n </ng-container>\n <ng-template #notEmptyBlock>\n <ng-container\n *ngIf=\"field.controlType === 'attachment' || field.type === 'link'; then linkBlock; else notLinkBlock\">\n </ng-container>\n <ng-template #linkBlock>\n <a [id]=\"field.key\" class=\"color-link body-sm pep-report-input readonly\"\n *ngIf=\"field.formattedValue != null\" title=\"{{ field.formattedValue }}\" target=\"_blank\"\n href=\"{{ field.value }}\">{{ field.formattedValue }}</a>\n </ng-template>\n <ng-template #notLinkBlock>\n <span [id]=\"field.key\" class=\"body-sm pep-report-input readonly\"\n title=\"{{ field.formattedValue }}\" [ngStyle]=\"{ color: field.textColor }\">{{\n field.formattedValue }}</span>\n </ng-template>\n </ng-template>\n <ng-template #emptyBlock>\n <span>&nbsp;</span>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>", styles: [":host{display:grid}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i5.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i6$1.MatGridList, selector: "mat-grid-list", inputs: ["cols", "gutterSize", "rowHeight"], exportAs: ["matGridList"] }, { kind: "component", type: i6$1.MatGridTile, selector: "mat-grid-tile", inputs: ["rowspan", "colspan"], exportAs: ["matGridTile"] }, { kind: "component", type: i5$2.PepCheckboxComponent, selector: "pep-checkbox", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "additionalValue", "form", "isActive", "showTitle", "renderTitle", "layoutType", "visible"], outputs: ["valueChange"] }, { kind: "component", type: i6.PepDateComponent, selector: "pep-date", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "visible", "minValue", "maxValue", "minDateValue", "maxDateValue", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType"], outputs: ["valueChange"] }, { kind: "component", type: i7$1.PepImageComponent, selector: "pep-image", inputs: ["key", "srcLarge", "src", "options", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "indicatorsField", "menuField", "hasCampaignField", "visible", "form", "uid", "showTitle", "renderTitle", "layoutType", "isActive", "sizeLimitMB", "acceptImagesType", "handleActions", "hint"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i9.PepQuantitySelectorComponent, selector: "pep-quantity-selector", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "allowDecimal", "additionalValue", "notificationInfo", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "styleType", "isInFocus"], outputs: ["valueChange", "elementClick"] }, { kind: "component", type: i13.PepSignatureComponent, selector: "pep-signature", inputs: ["key", "src", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "signatureURL", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "handleActions"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i14.PepTextareaComponent, selector: "pep-textarea", inputs: ["key", "value", "label", "mandatory", "disabled", "readonly", "maxFieldCharacters", "textColor", "xAlignment", "rowSpan", "visible", "form", "isActive", "showTitle", "renderTitle", "layoutType"], outputs: ["valueChange", "keyup"] }, { kind: "component", type: PepInternalFieldGeneratorComponent, selector: "pep-internal-field-generator", inputs: ["field", "isActive", "uid", "form", "layoutType", "showTitle", "checkForChanges"], outputs: ["valueChange", "elementClick", "formValueChange", "formFieldClick"] }, { kind: "component", type: PepInternalButtonComponent, selector: "pep-internal-button", inputs: ["key", "value", "formattedValue", "label", "referenceObjectInternalType", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "visible", "form", "showTitle", "layoutType"], outputs: ["elementClick", "valueChange"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.LowerCasePipe, name: "lowercase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1710
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalFormComponent, decorators: [{
1711
+ type: Component,
1712
+ args: [{ selector: 'pep-internal-form', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fieldset *ngIf=\"form\" [formGroup]=\"form\" [disabled]=\"isLocked\" class=\"pep-form\"\n [ngStyle]=\"{ 'background-color': layoutType == 'card' && data?.BackgroundColor }\">\n <!-- New Form -->\n <mat-grid-list *ngIf=\"layoutType == 'form'\" [cols]=\"columns\" [rowHeight]=\"rowHeight + 'rem'\"\n [gutterSize]=\"formGutterSize\">\n <mat-grid-tile *ngFor=\"let field of fields$ | async\" [rowspan]=\"field.rowSpan\" [colspan]=\"field.colSpan\">\n <pep-internal-field-generator *ngIf=\"field.controlType != 'placeholder'\" [form]=\"form\" [layoutType]=\"layoutType\"\n [checkForChanges]=\"checkForChanges\" [uid]=\"data?.UID\" [field]=\"field\" [showTitle]=\"showTitle\"\n (valueChange)=\"onValueChanged($event)\" (elementClick)=\"onClick($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\"\n >\n </pep-internal-field-generator>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n </mat-grid-tile>\n </mat-grid-list>\n\n <!-- Thumbnails -->\n <mat-grid-list *ngIf=\"layoutType == 'card'\" [cols]=\"columns\" [rowHeight]=\"rowHeight + 'rem'\"\n [gutterSize]=\"cardGutterSize\" class=\"card-spacing\">\n <mat-grid-tile *ngFor=\"let field of fields$ | async\" [rowspan]=\"field.rowSpan\" [colspan]=\"field.colSpan\"\n [ngStyle]=\"{ overflow: field.type == 'qs' ? 'unset' : 'hidden' }\">\n <pep-internal-field-generator *ngIf=\"field.controlType != 'placeholder'\" [form]=\"form\" [layoutType]=\"layoutType\"\n [ngClass]=\"{ 'lock-events': lockEvents }\" [isActive]=\"isActive\" [checkForChanges]=\"checkForChanges\"\n [uid]=\"data?.UID\" [field]=\"field\" [showTitle]=\"showTitle\" (valueChange)=\"onValueChanged($event)\"\n (elementClick)=\"onClick($event)\" (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\">\n </pep-internal-field-generator>\n </mat-grid-tile>\n </mat-grid-list>\n\n <ng-container *ngIf=\"layoutType == 'table'\">\n <ng-container *ngIf=\"isReport; then reportBlock; else notReportBlock\"></ng-container>\n <ng-template #reportBlock>\n <ng-container *ngTemplateOutlet=\"report\"></ng-container>\n </ng-template>\n <ng-template #notReportBlock>\n <div *ngFor=\"let field of fields$ | async; let j = index\" class=\"pull-left flip table-cell \"\n [ngClass]=\"['text-align-' + field.xAlignment]\" style=\"height: 100%\"\n [ngStyle]=\"{ width: (layout?.ControlFields)[j]?.calcColumnWidthString}\">\n <pep-internal-field-generator *ngIf=\"field.controlType != 'placeholder'\" [checkForChanges]=\"checkForChanges\"\n [uid]=\"data?.UID\" [field]=\"field\" [form]=\"form\" [layoutType]=\"layoutType\" [showTitle]=\"false\"\n (elementClick)=\"onClick($event)\" (valueChange)=\"onValueChanged($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\"\n [isActive]=\"isActive\">\n </pep-internal-field-generator>\n </div>\n </ng-template>\n </ng-container>\n\n <!------- For testing ------------\n {{ form.value | json }}\n {{ form.valid }}\n ---------------------------------->\n</fieldset>\n\n<ng-template #report>\n <div *ngFor=\"let field of fields$ | async; let j = index\" class=\"pull-left flip pep-report-fields\"\n [ngStyle]=\"{ width: (layout?.ControlFields)[j]?.calcColumnWidthString }\"\n [ngClass]=\"['text-align-' + field.xAlignment]\">\n <ng-container [ngSwitch]=\"field.controlType\">\n <pep-image *ngSwitchCase=\"'image'\" [uid]=\"data?.UID\" [form]=\"form\" [key]=\"field.key\"\n [src]=\"field.formattedValue\" [srcLarge]=\"field.value\" [options]=\"field.options\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [layoutType]=\"layoutType\"\n (elementClick)=\"onClick($event)\">\n </pep-image>\n\n <pep-signature *ngSwitchCase=\"'signature'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\">\n </pep-signature>\n\n <pep-checkbox *ngSwitchCase=\"'checkbox'\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"(field.value | lowercase) == 'true' || field.value == '1' ? true : false\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [additionalValue]=\"field.additionalValue\" [layoutType]=\"layoutType\">\n </pep-checkbox>\n\n <pep-date *ngSwitchCase=\"'date'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [minValue]=\"field.minValue\" [maxValue]=\"field.maxValue\" [layoutType]=\"layoutType\">\n </pep-date>\n\n <pep-internal-button *ngSwitchCase=\"'button'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\" [type]=\"field.type\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [layoutType]=\"layoutType\" (elementClick)=\"onClick($event)\">\n </pep-internal-button>\n\n <pep-textarea *ngSwitchCase=\"'textarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [maxFieldCharacters]=\"field.maxFieldCharacters\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\">\n </pep-textarea>\n\n <pep-quantity-selector *ngSwitchCase=\"'qs'\" [id]=\"field.key\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"field.value\" [label]=\"field.label\" [type]=\"field.type\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\" (valueChange)=\"onValueChanged($event)\" (elementClick)=\"onClick($event)\">\n </pep-quantity-selector>\n\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"field.formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\">\n </ng-container>\n <ng-template #notEmptyBlock>\n <ng-container\n *ngIf=\"field.controlType === 'attachment' || field.type === 'link'; then linkBlock; else notLinkBlock\">\n </ng-container>\n <ng-template #linkBlock>\n <a [id]=\"field.key\" class=\"color-link body-sm pep-report-input readonly\"\n *ngIf=\"field.formattedValue != null\" title=\"{{ field.formattedValue }}\" target=\"_blank\"\n href=\"{{ field.value }}\">{{ field.formattedValue }}</a>\n </ng-template>\n <ng-template #notLinkBlock>\n <span [id]=\"field.key\" class=\"body-sm pep-report-input readonly\"\n title=\"{{ field.formattedValue }}\" [ngStyle]=\"{ color: field.textColor }\">{{\n field.formattedValue }}</span>\n </ng-template>\n </ng-template>\n <ng-template #emptyBlock>\n <span>&nbsp;</span>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>", styles: [":host{display:grid}\n"] }]
1713
+ }], ctorParameters: function () { return [{ type: i1$2.PepDialogService }, { type: i1$1.PepCustomizationService }, { type: i1$1.PepLayoutService }, { type: i3$1.FormBuilder }, { type: i0.KeyValueDiffers }, { type: i4$1.TranslateService }]; }, propDecorators: { isInternal: [{
1714
+ type: Input
1715
+ }], isReport: [{
1716
+ type: Input
1717
+ }], layout: [{
1718
+ type: Input
1719
+ }], lockEvents: [{
1720
+ type: Input
1721
+ }], canEditObject: [{
1722
+ type: Input
1723
+ }], data: [{
1724
+ type: Input
1725
+ }], lockFields: [{
1726
+ type: Input
1727
+ }], isActive: [{
1728
+ type: Input
1729
+ }], layoutType: [{
1730
+ type: Input
1731
+ }], objectId: [{
1732
+ type: Input
1733
+ }], parentId: [{
1734
+ type: Input
1735
+ }], searchCode: [{
1736
+ type: Input
1737
+ }], showTitle: [{
1738
+ type: Input
1739
+ }], firstFieldAsLink: [{
1740
+ type: Input
1741
+ }], checkForChanges: [{
1742
+ type: Input
1743
+ }], valueChange: [{
1744
+ type: Output
1745
+ }], formValidationChange: [{
1746
+ type: Output
1747
+ }], fieldClick: [{
1748
+ type: Output
1749
+ }] } });
1750
+
1751
+ class PepInternalListComponent {
1752
+ constructor(element, layoutService, cd, renderer) {
1753
+ this.element = element;
1754
+ this.layoutService = layoutService;
1755
+ this.cd = cd;
1756
+ this.renderer = renderer;
1757
+ this.noDataFoundMsg = 'Items not found';
1758
+ this.hideAllSelectionInMulti = false;
1759
+ this.top = -1;
1760
+ this.objectId = '0';
1761
+ this.parentId = '0';
1762
+ this.searchCode = '0';
1763
+ // @Input() showTopBorder = false;
1764
+ this.supportResizing = true;
1765
+ this.parentScroll = null;
1766
+ this.disabled = false;
1767
+ this.disableEvents = false;
1768
+ this.disableSelectionItems = false;
1769
+ this.totalsRow = [];
1770
+ // @Output()
1771
+ // itemClick: EventEmitter<IPepListItemClickEvent> = new EventEmitter<IPepListItemClickEvent>();
1772
+ this.fieldClick = new EventEmitter();
1773
+ this.valueChange = new EventEmitter();
1774
+ this.uiControl = null;
1775
+ this.totalRows = -1;
1776
+ this.isTable = false;
1777
+ this.hasColumnWidthOfTypePercentage = true;
1778
+ this._items = null;
1779
+ // isCardView = false;
1780
+ this.itemsCounter = 0;
1781
+ this.showItems = true;
1782
+ this.SEPARATOR = ',';
1783
+ this.nativeWindow = null;
1784
+ this.selectedItemId = '';
1785
+ this.hoveredItemId = '';
1786
+ this.lockEvents = false;
1787
+ this.containerWidth = 0;
1788
+ this.deviceHasMouse = false;
1789
+ // headerIsInFocus = false;
1790
+ // For resize
1791
+ this.pressedColumn = '';
1792
+ this.startX = 0;
1793
+ this.startWidth = 0;
1794
+ this.tableStartWidth = 0;
1795
+ this.isUserSelected = false;
1796
+ this.checkForChanges = null;
1797
+ this.useVirtualScroll = true;
1798
+ this.nativeWindow = window;
1799
+ this.deviceHasMouse = this.layoutService.getDeviceHasMouse();
1800
+ this.layoutService.onMouseOver$.subscribe((deviceHasMouse) => {
1801
+ this.deviceHasMouse = deviceHasMouse;
1802
+ });
1803
+ }
1804
+ get items() {
1805
+ return this._items;
1806
+ }
1807
+ ngOnInit() {
1808
+ this.containerWidth = 0;
1809
+ }
1810
+ ngOnChanges(changes) {
1811
+ if (this.containerWidth <= 0) {
1812
+ this.setContainerWidth();
1813
+ }
1814
+ }
1815
+ ngOnDestroy() {
1816
+ // if (this.valueChange) {
1817
+ // this.valueChange.unsubscribe();
1818
+ // }
1819
+ // if (this.itemClick) {
1820
+ // this.itemClick.unsubscribe();
1821
+ // }
1822
+ // if (this.fieldClick) {
1823
+ // this.fieldClick.unsubscribe();
1824
+ // }
1825
+ }
1826
+ setContainerWidth() {
1827
+ if (!this.element.nativeElement.parentElement) {
1828
+ return;
1829
+ }
1830
+ const selectionCheckBoxWidth = 0;
1831
+ const rowHeight = 40; // the table row height (2.5rem * 16font-size).
1832
+ const style = getComputedStyle(this.element.nativeElement.parentElement);
1833
+ // The container-fluid class padding left + right + border
1834
+ const containerFluidSpacing = parseInt(style.paddingLeft, 10) + parseInt(style.paddingRight, 10);
1835
+ const parentContainer = this.element.nativeElement.parentElement.parentElement > 0
1836
+ ? this.element.nativeElement.parentElement.parentElement
1837
+ : this.element.nativeElement.parentElement;
1838
+ // Calculate if vertical scroll should appear, if so set the scroll width. (this.totalRows + 1) + 1 is for the header row.
1839
+ const scrollWidth = parentContainer.clientHeight < rowHeight * (this.totalRows + 1)
1840
+ ? 18
1841
+ : 0; // 18 is the default scroll width.
1842
+ // The selectionCheckBoxWidth width + containerFluidSpacing + scrollWidth.
1843
+ const rowHeaderWidthToSub = containerFluidSpacing + selectionCheckBoxWidth + scrollWidth;
1844
+ this.containerWidth = parentContainer.offsetWidth - rowHeaderWidthToSub;
1845
+ }
1846
+ clear() {
1847
+ this.cleanItems();
1848
+ this.uiControl = null;
1849
+ }
1850
+ toggleItems(isVisible) {
1851
+ this.showItems = isVisible;
1852
+ this.lockEvents = !isVisible;
1853
+ }
1854
+ updateScrollItems(startIndex, endIndex, loadInChunks = true) {
1855
+ this.scrollItems = this.items.slice(startIndex, endIndex);
1856
+ }
1857
+ getUniqItemId(itemId, itemType = '') {
1858
+ return itemId + this.SEPARATOR + itemType;
1859
+ }
1860
+ setLayout() {
1861
+ if (this.totalRows === 0 ||
1862
+ !this.uiControl ||
1863
+ !this.uiControl.ControlFields ||
1864
+ this.uiControl.ControlFields.length === 0) {
1865
+ return;
1866
+ }
1867
+ this.uiControl.ControlFields.forEach((cf) => {
1868
+ if (cf.ColumnWidth === 0) {
1869
+ cf.ColumnWidth = 10;
1870
+ }
1871
+ if (this.isTable &&
1872
+ (cf.FieldType === FIELD_TYPE.Image ||
1873
+ // cf.FieldType === FIELD_TYPE.Indicators || ???
1874
+ cf.FieldType === FIELD_TYPE.Signature ||
1875
+ cf.FieldType === FIELD_TYPE.NumberIntegerQuantitySelector ||
1876
+ cf.FieldType === FIELD_TYPE.NumberRealQuantitySelector ||
1877
+ cf.FieldType === FIELD_TYPE.NumberIntegerForMatrix ||
1878
+ cf.FieldType === FIELD_TYPE.NumberRealForMatrix ||
1879
+ cf.FieldType === FIELD_TYPE.Package ||
1880
+ cf.ApiName === 'UnitsQuantity' ||
1881
+ cf.ApiName === 'QuantitySelector')) {
1882
+ cf.Layout.XAlignment = 3;
1883
+ }
1884
+ });
1885
+ if (!this.cd['destroyed']) {
1886
+ this.cd.detectChanges();
1887
+ }
1888
+ // Set the columns width.
1889
+ if (this.containerWidth <= 0) {
1890
+ this.setContainerWidth();
1891
+ }
1892
+ this.calcColumnsWidth();
1893
+ this.checkForChanges = new Date().getTime();
1894
+ }
1895
+ calcColumnsWidth() {
1896
+ const fixedMultiple = 3.78; // for converting em to pixel.
1897
+ const length = this.uiControl.ControlFields.length;
1898
+ const selectionCheckBoxWidth = 0;
1899
+ // Is table AND there is at least one column of width type of percentage.
1900
+ if (this.isTable) {
1901
+ if (this.uiControl && this.uiControl.ControlFields) {
1902
+ this.hasColumnWidthOfTypePercentage =
1903
+ this.uiControl.ControlFields.filter((cf) => cf.ColumnWidthType === 1).length === 0;
1904
+ }
1905
+ }
1906
+ // If the columns size is fixed and the total is small then the container change it to percentage.
1907
+ if (!this.hasColumnWidthOfTypePercentage) {
1908
+ const totalFixedColsWidth = this.uiControl.ControlFields.map((cf) => cf.ColumnWidth * fixedMultiple).reduce((sum, current) => sum + current);
1909
+ if (window.innerWidth > totalFixedColsWidth) {
1910
+ this.hasColumnWidthOfTypePercentage = true;
1911
+ }
1912
+ }
1913
+ let totalCalcColsWidth = 0;
1914
+ // Calc by percentage
1915
+ if (this.hasColumnWidthOfTypePercentage) {
1916
+ const totalColsWidth = this.uiControl.ControlFields.map((cf) => cf.ColumnWidth).reduce((sum, current) => sum + current);
1917
+ for (let index = 0; index < length; index++) {
1918
+ const uiControlField = this.uiControl
1919
+ .ControlFields[index];
1920
+ const calcColumnWidthPercentage = (100 / totalColsWidth) * uiControlField.ColumnWidth;
1921
+ uiControlField.calcColumnWidth = Math.floor((this.containerWidth * calcColumnWidthPercentage) / 100);
1922
+ if (index === length - 1) {
1923
+ uiControlField.calcTitleColumnWidthString = uiControlField.calcColumnWidthString =
1924
+ 'calc(100% - ' + totalCalcColsWidth + 'px)'; // For 100%
1925
+ }
1926
+ else {
1927
+ uiControlField.calcTitleColumnWidthString = uiControlField.calcColumnWidthString =
1928
+ uiControlField.calcColumnWidth + 'px';
1929
+ totalCalcColsWidth += uiControlField.calcColumnWidth;
1930
+ }
1931
+ }
1932
+ this.renderer.setStyle(this.element.nativeElement, 'width', 'inherit');
1933
+ }
1934
+ else {
1935
+ for (let index = 0; index < length; index++) {
1936
+ const uiControlField = this.uiControl
1937
+ .ControlFields[index];
1938
+ const currentFixedWidth = Math.floor(uiControlField.ColumnWidth * fixedMultiple);
1939
+ if (index === length - 1) {
1940
+ uiControlField.calcTitleColumnWidthString =
1941
+ currentFixedWidth + 'px';
1942
+ uiControlField.calcColumnWidthString =
1943
+ currentFixedWidth - 4 + 'px'; // -4 for the row padding.
1944
+ }
1945
+ else {
1946
+ uiControlField.calcTitleColumnWidthString = uiControlField.calcColumnWidthString =
1947
+ currentFixedWidth + 'px';
1948
+ }
1949
+ totalCalcColsWidth += currentFixedWidth;
1950
+ }
1951
+ this.renderer.setStyle(this.element.nativeElement, 'width', totalCalcColsWidth + selectionCheckBoxWidth + 'px');
1952
+ }
1953
+ }
1954
+ initResizeData() {
1955
+ this.startX = 0;
1956
+ this.startWidth = 0;
1957
+ this.tableStartWidth = 0;
1958
+ this.pressedColumn = '';
1959
+ }
1960
+ onListResizeStart(event, columnKey) {
1961
+ this.pressedColumn = columnKey;
1962
+ this.startX = event.x;
1963
+ this.startWidth = event.target.closest('.header-column').offsetWidth;
1964
+ // Set the tableStartWidth to the container offsetWidth
1965
+ this.tableStartWidth = this.element.nativeElement.offsetWidth; // this.noVirtualScrollCont.nativeElement.offsetWidth;
1966
+ }
1967
+ onListResize(event) {
1968
+ if (this.pressedColumn.length > 0) {
1969
+ const widthToAdd = this.layoutService.isRtl()
1970
+ ? this.startX - event.x
1971
+ : event.x - this.startX;
1972
+ // Set the width of the column and the container of the whole columns.
1973
+ if (this.startWidth + widthToAdd >= 48 || widthToAdd > 0) {
1974
+ const length = this.uiControl.ControlFields.length;
1975
+ let totalCalcColsWidth = 0;
1976
+ for (let index = 0; index < length; index++) {
1977
+ const uiControlField = this.uiControl
1978
+ .ControlFields[index];
1979
+ if (index === length - 1) {
1980
+ // Calc the last column only in percentage type.
1981
+ if (this.hasColumnWidthOfTypePercentage) {
1982
+ uiControlField.calcTitleColumnWidthString = uiControlField.calcColumnWidthString =
1983
+ 'calc(100% - ' + totalCalcColsWidth + 'px)'; // For 100%
1984
+ }
1985
+ else {
1986
+ if (uiControlField.ApiName === this.pressedColumn) {
1987
+ uiControlField.calcColumnWidth =
1988
+ this.startWidth + widthToAdd;
1989
+ uiControlField.calcTitleColumnWidthString =
1990
+ uiControlField.calcColumnWidth + 'px';
1991
+ uiControlField.calcColumnWidthString =
1992
+ uiControlField.calcColumnWidth - 4 + 'px';
1993
+ }
1994
+ }
1995
+ }
1996
+ else if (uiControlField.ApiName === this.pressedColumn) {
1997
+ uiControlField.calcColumnWidth =
1998
+ this.startWidth + widthToAdd;
1999
+ uiControlField.calcTitleColumnWidthString = uiControlField.calcColumnWidthString =
2000
+ uiControlField.calcColumnWidth + 'px';
2001
+ }
2002
+ totalCalcColsWidth += uiControlField.calcColumnWidth;
2003
+ }
2004
+ this.renderer.setStyle(this.element.nativeElement, 'width', this.tableStartWidth + widthToAdd + 'px');
2005
+ }
2006
+ this.checkForChanges = new Date().getTime();
2007
+ }
2008
+ }
2009
+ getParent(el, parentSelector) {
2010
+ // If no parentSelector defined will bubble up all the way to *document*
2011
+ if (parentSelector === undefined) {
2012
+ parentSelector = document;
2013
+ }
2014
+ const parent = [];
2015
+ let p = el.parentNode;
2016
+ while (p &&
2017
+ p.className !== '' &&
2018
+ p.className.indexOf(parentSelector) === -1 &&
2019
+ parentSelector !== document) {
2020
+ const o = p;
2021
+ p = o.parentNode;
2022
+ }
2023
+ if (p.className.indexOf(parentSelector) > -1) {
2024
+ parent.push(p); // Push that parentSelector you wanted to stop at
2025
+ }
2026
+ return parent;
2027
+ }
2028
+ onListResizeEnd(event) {
2029
+ if (this.pressedColumn.length > 0) {
2030
+ if (event &&
2031
+ this.getParent(event.srcElement, 'resize-box').length > 0) {
2032
+ this.initResizeData();
2033
+ }
2034
+ else {
2035
+ setTimeout(() => {
2036
+ this.initResizeData();
2037
+ }, 0);
2038
+ }
2039
+ }
2040
+ }
2041
+ onListHeaderMouseEnter(event) {
2042
+ // this.headerIsInFocus = true;
2043
+ }
2044
+ onListHeaderMouseLeave(event) {
2045
+ // this.headerIsInFocus = false;
2046
+ this.onListResizeEnd(event);
2047
+ this.initResizeData();
2048
+ }
2049
+ onListChange(event) {
2050
+ if (this.disableEvents) {
2051
+ return;
2052
+ }
2053
+ // For other events do nothing.
2054
+ if (typeof event.start === 'undefined' ||
2055
+ typeof event.end === 'undefined') {
2056
+ return;
2057
+ }
2058
+ this.calculatedObjectHeight = event.calculatedChildHeight + 'px';
2059
+ if (!this.lockEvents) {
2060
+ this.toggleItems(false);
2061
+ this.updateScrollItems(event.start, event.end, false);
2062
+ this.toggleItems(true);
2063
+ }
2064
+ }
2065
+ getParentContainer() {
2066
+ return this.parentScroll ? this.parentScroll : window;
2067
+ }
2068
+ onValueChanged(valueChange) {
2069
+ if (this.disabled) {
2070
+ return;
2071
+ }
2072
+ this.valueChange.emit(valueChange);
2073
+ }
2074
+ onCustomizeFieldClick(customizeFieldClickedData) {
2075
+ if (this.disabled) {
2076
+ return;
2077
+ }
2078
+ this.fieldClick.emit(customizeFieldClickedData);
2079
+ }
2080
+ getIsDisabled(item) {
2081
+ if (this.disableSelectionItems) {
2082
+ return true;
2083
+ }
2084
+ else {
2085
+ const IsNotSelectableForActions = item && !item.IsSelectableForActions;
2086
+ return IsNotSelectableForActions;
2087
+ }
2088
+ }
2089
+ getIsItemSelected(itemId, itemType = '') {
2090
+ let isSelected = false;
2091
+ const uniqItemId = this.getUniqItemId(itemId, itemType);
2092
+ isSelected = uniqItemId === this.selectedItemId;
2093
+ return isSelected;
2094
+ }
2095
+ setItemClicked(itemId, isSelectableForActions, itemType, isChecked) {
2096
+ const uniqItemId = this.getUniqItemId(itemId, itemType);
2097
+ // select the selected item.
2098
+ if (isChecked) {
2099
+ // Set seleted item
2100
+ this.selectedItemId = uniqItemId;
2101
+ }
2102
+ else {
2103
+ if (this.selectedItemId === uniqItemId) {
2104
+ this.selectedItemId = '';
2105
+ }
2106
+ }
2107
+ }
2108
+ itemClicked(e, item) {
2109
+ // Set seleted item
2110
+ const itemId = item.UID.toString();
2111
+ const itemType = item.Type.toString();
2112
+ let isChecked = false;
2113
+ if (item && item.IsSelectableForActions) {
2114
+ this.selectedItemId = this.getUniqItemId(itemId, itemType);
2115
+ isChecked = true;
2116
+ }
2117
+ if (this.isTable) {
2118
+ this.setItemClicked(itemId, item.IsSelectableForActions, itemType, true);
2119
+ }
2120
+ else {
2121
+ if (this.disabled) {
2122
+ return;
2123
+ }
2124
+ }
2125
+ // this.itemClick.emit({ source: item, viewType: this.viewType });
2126
+ }
2127
+ onTableRowMouseEnter(event, itemId, itemType) {
2128
+ if (!this.deviceHasMouse) {
2129
+ return;
2130
+ }
2131
+ const uniqItemId = this.getUniqItemId(itemId, itemType);
2132
+ this.hoveredItemId = uniqItemId;
2133
+ }
2134
+ onTableRowMouseLeave(event, itemId, itemType) {
2135
+ this.hoveredItemId = '';
2136
+ }
2137
+ onCardMouseEnter(event, itemId, itemType) {
2138
+ if (!this.deviceHasMouse) {
2139
+ return;
2140
+ }
2141
+ const uniqItemId = this.getUniqItemId(itemId, itemType);
2142
+ this.hoveredItemId = uniqItemId;
2143
+ }
2144
+ onCardMouseLeave(event, itemId, itemType) {
2145
+ this.hoveredItemId = '';
2146
+ }
2147
+ // call this function after resize + animation end
2148
+ winResize(e) {
2149
+ this.containerWidth = 0;
2150
+ this.setLayout();
2151
+ }
2152
+ trackByFunc(index, item) {
2153
+ return item && item.UID ? item.UID : index;
2154
+ }
2155
+ cleanItems() {
2156
+ this.itemsCounter = 0;
2157
+ this._items =
2158
+ this.totalRows > 0 ? Array(this.totalRows) : [];
2159
+ this.scrollItems = [];
2160
+ this.calculatedObjectHeight = '';
2161
+ }
2162
+ getUIControl() {
2163
+ return this.uiControl;
2164
+ }
2165
+ initListData(uiControl, totalRows, items, viewType = 'table', itemClass = '') {
2166
+ this.viewType = viewType;
2167
+ this.isTable = viewType === 'table';
2168
+ // this.isCardView = viewType === 'cards';
2169
+ this.uiControl = uiControl;
2170
+ this.itemClass = itemClass;
2171
+ this.selectedItemId = '';
2172
+ this.totalRows = totalRows;
2173
+ // fix bug for the scrollTo that doesn't work on edge div , not window
2174
+ // const scrollingElement = this.getParentContainer();
2175
+ // scrollingElement.scrollTo(0, 0);
2176
+ this.cleanItems();
2177
+ this.updateItems(items);
2178
+ this.setLayout();
2179
+ }
2180
+ updateItems(items) {
2181
+ this.scrollItems = this._items = items;
2182
+ this.itemsCounter = items.length;
2183
+ }
2184
+ updateItem(data) {
2185
+ let index = 0;
2186
+ // Update items list
2187
+ index = this.items.findIndex((i) => i && i.UID === data.UID);
2188
+ if (index >= 0 && index < this.items.length) {
2189
+ this.items[index] = data;
2190
+ }
2191
+ // Update scrollItems list
2192
+ index = this.scrollItems.findIndex((i) => i && i.UID === data.UID);
2193
+ if (index >= 0 && index < this.scrollItems.length) {
2194
+ this.scrollItems[index] = data;
2195
+ this.checkForChanges = new Date().getTime();
2196
+ }
2197
+ }
2198
+ getIsItemEditable(uid) {
2199
+ const item = this.items.filter((x) => x.UID.toString() === uid);
2200
+ if (item.length > 0) {
2201
+ return item[0].IsEditable;
2202
+ }
2203
+ else {
2204
+ return false;
2205
+ }
2206
+ }
2207
+ getItemDataByID(uid) {
2208
+ return this.items.find((item) => item.UID.toString() === uid);
2209
+ }
2210
+ }
2211
+ PepInternalListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalListComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.PepLayoutService }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
2212
+ PepInternalListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepInternalListComponent, selector: "pep-internal-list", inputs: { noDataFoundMsg: "noDataFoundMsg", hideAllSelectionInMulti: "hideAllSelectionInMulti", top: "top", objectId: "objectId", parentId: "parentId", searchCode: "searchCode", supportResizing: "supportResizing", parentScroll: "parentScroll", disabled: "disabled", disableEvents: "disableEvents", disableSelectionItems: "disableSelectionItems", totalsRow: "totalsRow" }, outputs: { fieldClick: "fieldClick", valueChange: "valueChange" }, host: { listeners: { "window:resize": "winResize($event)" } }, viewQueries: [{ propertyName: "noVirtualScrollCont", first: true, predicate: ["noVirtualScrollCont"], descendants: true }, { propertyName: "tableHeader", first: true, predicate: ["tableHeader"], descendants: true }, { propertyName: "selectAllCB", first: true, predicate: ["selectAllCB"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"totalRows == 0\">\n <div class=\"pep-border-bottom\">\n <p class=\"title-xl no-data\">\n {{ (noDataFoundMsg ? noDataFoundMsg : 'LIST.NO_DATA_FOUND') | translate}}\n </p>\n </div>\n <div class=\"no-data-suggestions\">\n <p class=\"suggestions-title title-lg\">\n {{ 'LIST.NO_DATA_FOUND_SUGGESTIONS_TITLE' | translate}}\n </p>\n <ul class=\"suggestions-list body-lg\" [innerHtml]=\"'LIST.NO_DATA_FOUND_SUGGESTIONS_LIST' | translate\"></ul>\n </div>\n</ng-container>\n<ng-container *ngIf=\"totalRows > 0\">\n <div *ngIf=\"isTable\" #tableHeader class=\"table-header\" (mouseup)=\"onListResizeEnd($event)\"\n (mouseenter)=\"onListHeaderMouseEnter($event)\" (mouseleave)=\"onListHeaderMouseLeave($event)\"\n (mousemove)=\"onListResize($event)\">\n\n <div class=\"table-header-padding-top\"></div>\n <fieldset class=\"table-header-fieldset\">\n <fieldset>\n <div *ngFor=\"let field of uiControl?.ControlFields; let j = index\" class=\"header-column pull-left flip\"\n [ngStyle]=\"{ width: field.calcTitleColumnWidthString }\" [ngClass]=\"{\n 'is-resizing': field.ApiName === pressedColumn,\n 'is-first': j === 0,\n 'is-last': j === uiControl?.ControlFields?.length - 1\n }\">\n <label *ngIf=\"field.Title != ''\" id=\"{{ field.ApiName }}\"\n class=\"header-label body-sm pull-left flip text-align-{{ field.Layout.XAlignment }}\"\n title=\"{{ field.Title }}\">\n {{ field.Title }}\n </label>\n <label *ngIf=\"field.Title == ''\" id=\"{{ field.ApiName }}\"\n class=\"header-label body-sm pull-left flip\">&nbsp;</label>\n\n <div *ngIf=\"supportResizing\" class=\"resize-box pull-right flip\"\n (mousedown)=\"onListResizeStart($event, field.ApiName)\">\n <div class=\"splitter\"></div>\n </div>\n </div>\n </fieldset>\n </fieldset>\n </div>\n\n <div #noVirtualScrollCont [ngClass]=\"{ 'table-body': isTable, 'cards-body': !isTable }\">\n <ng-container *ngTemplateOutlet=\"listData\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"listTotals\"></ng-container>\n</ng-container>\n\n<ng-template #listData>\n <ng-container *ngFor=\"let item of scrollItems; let i = index; let isFirst = first; trackBy: trackByFunc\">\n <ng-container *ngIf=\"isTable\">\n <div class=\"table-row\" (mouseenter)=\"onTableRowMouseEnter($event, item?.UID, item?.Type)\"\n (mouseleave)=\"onTableRowMouseLeave($event, item?.UID, item?.Type)\" [ngClass]=\"{\n selected: getIsItemSelected(item?.UID, item?.Type),\n highlighted: item?.UID + SEPARATOR + item?.Type === selectedItemId\n }\"\n [ngStyle]=\"{ height: calculatedObjectHeight, visibility: showItems || item ? 'visible' : 'hidden' }\">\n <fieldset class=\"table-row-fieldset\" [ngStyle]=\"{ 'background-color': item?.BackgroundColor }\">\n <!-- [canEditObject]=\"!disabled && item?.IsEditable\" -->\n <pep-internal-form [checkForChanges]=\"checkForChanges\" [layout]=\"uiControl\" [data]=\"item\"\n [canEditObject]=\"!disabled\" [objectId]=\"objectId\" [parentId]=\"parentId\"\n [searchCode]=\"searchCode\" [lockEvents]=\"disableSelectionItems\" [layoutType]=\"'table'\"\n [isActive]=\"\n (item?.UID + SEPARATOR + item?.Type === selectedItemId ||\n item?.UID + SEPARATOR + item?.Type === hoveredItemId) && deviceHasMouse\n \" (valueChange)=\"onValueChanged($event)\" (fieldClick)=\"onCustomizeFieldClick($event)\"\n (click)=\"itemClicked($event, item)\">\n </pep-internal-form>\n </fieldset>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!isTable\">\n <div [class]=\"itemClass\" (mouseenter)=\"onCardMouseEnter($event, item?.UID, item?.Type)\"\n (mouseleave)=\"onCardMouseLeave($event, item?.UID, item?.Type)\" [ngClass]=\"{\n selected: getIsItemSelected(item?.UID, item?.Type),\n highlighted: item?.UID + SEPARATOR + item?.Type === selectedItemId,\n 'card-view': viewType === 'cards',\n 'line-view': viewType === 'lines'\n }\" class=\"pull-left flip\"\n [ngStyle]=\"{ height: calculatedObjectHeight, visibility: showItems || item ? 'visible' : 'hidden' }\">\n <!-- [canEditObject]=\"!disabled && item?.IsEditable\" -->\n <pep-internal-form [checkForChanges]=\"checkForChanges\" [layout]=\"uiControl\" [data]=\"item\"\n [canEditObject]=\"!disabled\" [objectId]=\" objectId\" [parentId]=\"parentId\" [searchCode]=\"searchCode\"\n [lockEvents]=\"disableSelectionItems\" [layoutType]=\"'card'\" [isActive]=\"\n (item?.UID + SEPARATOR + item?.Type === selectedItemId ||\n item?.UID + SEPARATOR + item?.Type === hoveredItemId) && deviceHasMouse\n \" (valueChange)=\"onValueChanged($event)\" (fieldClick)=\"onCustomizeFieldClick($event)\"\n (click)=\"itemClicked($event, item)\">\n </pep-internal-form>\n </div>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #listTotals>\n <div *ngIf=\"totalsRow?.length > 0 && totalsRow.length <= uiControl?.ControlFields.length\" class=\"table-total\">\n <fieldset class=\"table-header-fieldset\">\n <div *ngFor=\"let field of uiControl?.ControlFields; let j = index\" class=\"total-column pull-left flip\"\n [ngStyle]=\"{ width: field.calcTitleColumnWidthString }\">\n <label class=\"total-label body-sm text-align-{{ field.Layout.XAlignment }}\">\n {{ totalsRow[j] }}\n </label>\n </div>\n </fieldset>\n </div>\n</ng-template>", styles: [":host{height:inherit;display:grid}.no-data{margin:var(--pep-spacing-2xl, 2rem) 0}.no-data-suggestions .suggestions-title{margin:var(--pep-spacing-lg, 1rem) 0 var(--pep-spacing-sm, .5rem)}.no-data-suggestions .suggestions-list{margin:0;padding:0;padding-inline-start:var(--pep-spacing-2xl, 2rem)}.table-header{top:0}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: PepInternalFormComponent, selector: "pep-internal-form", inputs: ["isInternal", "isReport", "layout", "lockEvents", "canEditObject", "data", "lockFields", "isActive", "layoutType", "objectId", "parentId", "searchCode", "showTitle", "firstFieldAsLink", "checkForChanges"], outputs: ["valueChange", "formValidationChange", "fieldClick"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] });
2213
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalListComponent, decorators: [{
2214
+ type: Component,
2215
+ args: [{ selector: 'pep-internal-list', host: {
2216
+ '(window:resize)': 'winResize($event)',
2217
+ }, template: "<ng-container *ngIf=\"totalRows == 0\">\n <div class=\"pep-border-bottom\">\n <p class=\"title-xl no-data\">\n {{ (noDataFoundMsg ? noDataFoundMsg : 'LIST.NO_DATA_FOUND') | translate}}\n </p>\n </div>\n <div class=\"no-data-suggestions\">\n <p class=\"suggestions-title title-lg\">\n {{ 'LIST.NO_DATA_FOUND_SUGGESTIONS_TITLE' | translate}}\n </p>\n <ul class=\"suggestions-list body-lg\" [innerHtml]=\"'LIST.NO_DATA_FOUND_SUGGESTIONS_LIST' | translate\"></ul>\n </div>\n</ng-container>\n<ng-container *ngIf=\"totalRows > 0\">\n <div *ngIf=\"isTable\" #tableHeader class=\"table-header\" (mouseup)=\"onListResizeEnd($event)\"\n (mouseenter)=\"onListHeaderMouseEnter($event)\" (mouseleave)=\"onListHeaderMouseLeave($event)\"\n (mousemove)=\"onListResize($event)\">\n\n <div class=\"table-header-padding-top\"></div>\n <fieldset class=\"table-header-fieldset\">\n <fieldset>\n <div *ngFor=\"let field of uiControl?.ControlFields; let j = index\" class=\"header-column pull-left flip\"\n [ngStyle]=\"{ width: field.calcTitleColumnWidthString }\" [ngClass]=\"{\n 'is-resizing': field.ApiName === pressedColumn,\n 'is-first': j === 0,\n 'is-last': j === uiControl?.ControlFields?.length - 1\n }\">\n <label *ngIf=\"field.Title != ''\" id=\"{{ field.ApiName }}\"\n class=\"header-label body-sm pull-left flip text-align-{{ field.Layout.XAlignment }}\"\n title=\"{{ field.Title }}\">\n {{ field.Title }}\n </label>\n <label *ngIf=\"field.Title == ''\" id=\"{{ field.ApiName }}\"\n class=\"header-label body-sm pull-left flip\">&nbsp;</label>\n\n <div *ngIf=\"supportResizing\" class=\"resize-box pull-right flip\"\n (mousedown)=\"onListResizeStart($event, field.ApiName)\">\n <div class=\"splitter\"></div>\n </div>\n </div>\n </fieldset>\n </fieldset>\n </div>\n\n <div #noVirtualScrollCont [ngClass]=\"{ 'table-body': isTable, 'cards-body': !isTable }\">\n <ng-container *ngTemplateOutlet=\"listData\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"listTotals\"></ng-container>\n</ng-container>\n\n<ng-template #listData>\n <ng-container *ngFor=\"let item of scrollItems; let i = index; let isFirst = first; trackBy: trackByFunc\">\n <ng-container *ngIf=\"isTable\">\n <div class=\"table-row\" (mouseenter)=\"onTableRowMouseEnter($event, item?.UID, item?.Type)\"\n (mouseleave)=\"onTableRowMouseLeave($event, item?.UID, item?.Type)\" [ngClass]=\"{\n selected: getIsItemSelected(item?.UID, item?.Type),\n highlighted: item?.UID + SEPARATOR + item?.Type === selectedItemId\n }\"\n [ngStyle]=\"{ height: calculatedObjectHeight, visibility: showItems || item ? 'visible' : 'hidden' }\">\n <fieldset class=\"table-row-fieldset\" [ngStyle]=\"{ 'background-color': item?.BackgroundColor }\">\n <!-- [canEditObject]=\"!disabled && item?.IsEditable\" -->\n <pep-internal-form [checkForChanges]=\"checkForChanges\" [layout]=\"uiControl\" [data]=\"item\"\n [canEditObject]=\"!disabled\" [objectId]=\"objectId\" [parentId]=\"parentId\"\n [searchCode]=\"searchCode\" [lockEvents]=\"disableSelectionItems\" [layoutType]=\"'table'\"\n [isActive]=\"\n (item?.UID + SEPARATOR + item?.Type === selectedItemId ||\n item?.UID + SEPARATOR + item?.Type === hoveredItemId) && deviceHasMouse\n \" (valueChange)=\"onValueChanged($event)\" (fieldClick)=\"onCustomizeFieldClick($event)\"\n (click)=\"itemClicked($event, item)\">\n </pep-internal-form>\n </fieldset>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!isTable\">\n <div [class]=\"itemClass\" (mouseenter)=\"onCardMouseEnter($event, item?.UID, item?.Type)\"\n (mouseleave)=\"onCardMouseLeave($event, item?.UID, item?.Type)\" [ngClass]=\"{\n selected: getIsItemSelected(item?.UID, item?.Type),\n highlighted: item?.UID + SEPARATOR + item?.Type === selectedItemId,\n 'card-view': viewType === 'cards',\n 'line-view': viewType === 'lines'\n }\" class=\"pull-left flip\"\n [ngStyle]=\"{ height: calculatedObjectHeight, visibility: showItems || item ? 'visible' : 'hidden' }\">\n <!-- [canEditObject]=\"!disabled && item?.IsEditable\" -->\n <pep-internal-form [checkForChanges]=\"checkForChanges\" [layout]=\"uiControl\" [data]=\"item\"\n [canEditObject]=\"!disabled\" [objectId]=\" objectId\" [parentId]=\"parentId\" [searchCode]=\"searchCode\"\n [lockEvents]=\"disableSelectionItems\" [layoutType]=\"'card'\" [isActive]=\"\n (item?.UID + SEPARATOR + item?.Type === selectedItemId ||\n item?.UID + SEPARATOR + item?.Type === hoveredItemId) && deviceHasMouse\n \" (valueChange)=\"onValueChanged($event)\" (fieldClick)=\"onCustomizeFieldClick($event)\"\n (click)=\"itemClicked($event, item)\">\n </pep-internal-form>\n </div>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #listTotals>\n <div *ngIf=\"totalsRow?.length > 0 && totalsRow.length <= uiControl?.ControlFields.length\" class=\"table-total\">\n <fieldset class=\"table-header-fieldset\">\n <div *ngFor=\"let field of uiControl?.ControlFields; let j = index\" class=\"total-column pull-left flip\"\n [ngStyle]=\"{ width: field.calcTitleColumnWidthString }\">\n <label class=\"total-label body-sm text-align-{{ field.Layout.XAlignment }}\">\n {{ totalsRow[j] }}\n </label>\n </div>\n </fieldset>\n </div>\n</ng-template>", styles: [":host{height:inherit;display:grid}.no-data{margin:var(--pep-spacing-2xl, 2rem) 0}.no-data-suggestions .suggestions-title{margin:var(--pep-spacing-lg, 1rem) 0 var(--pep-spacing-sm, .5rem)}.no-data-suggestions .suggestions-list{margin:0;padding:0;padding-inline-start:var(--pep-spacing-2xl, 2rem)}.table-header{top:0}\n"] }]
2218
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.PepLayoutService }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }]; }, propDecorators: { noDataFoundMsg: [{
2219
+ type: Input
2220
+ }], hideAllSelectionInMulti: [{
2221
+ type: Input
2222
+ }], top: [{
2223
+ type: Input
2224
+ }], objectId: [{
2225
+ type: Input
2226
+ }], parentId: [{
2227
+ type: Input
2228
+ }], searchCode: [{
2229
+ type: Input
2230
+ }], supportResizing: [{
2231
+ type: Input
2232
+ }], parentScroll: [{
2233
+ type: Input
2234
+ }], disabled: [{
2235
+ type: Input
2236
+ }], disableEvents: [{
2237
+ type: Input
2238
+ }], disableSelectionItems: [{
2239
+ type: Input
2240
+ }], totalsRow: [{
2241
+ type: Input
2242
+ }], fieldClick: [{
2243
+ type: Output
2244
+ }], valueChange: [{
2245
+ type: Output
2246
+ }], noVirtualScrollCont: [{
2247
+ type: ViewChild,
2248
+ args: ['noVirtualScrollCont']
2249
+ }], tableHeader: [{
2250
+ type: ViewChild,
2251
+ args: ['tableHeader']
2252
+ }], selectAllCB: [{
2253
+ type: ViewChild,
2254
+ args: ['selectAllCB']
2255
+ }] } });
2256
+
2257
+ class PepInternalPageComponent {
2258
+ constructor(dialogService, internalPageService, customizationService, changeDetectorRef) {
2259
+ this.dialogService = dialogService;
2260
+ this.internalPageService = internalPageService;
2261
+ this.customizationService = customizationService;
2262
+ this.changeDetectorRef = changeDetectorRef;
2263
+ this.controlType = 'internalPage';
2264
+ this.layoutType = 'form';
2265
+ this.internalFormFieldChange = new EventEmitter();
2266
+ this.internalFormFieldClick = new EventEmitter();
2267
+ this.checkForChanges = null;
2268
+ this.childData = null;
2269
+ this.totalsRow = [];
2270
+ this.additionalApiNames = null;
2271
+ this.currentAdditionalApiName = null;
2272
+ this.focusedQS = false;
2273
+ this.fieldIdWithFocus = '';
2274
+ this.columnWidth = 100;
2275
+ this.coverChildTable = false;
2276
+ this.currentViewType = null;
2277
+ this.sumOfMinColWidth = 0;
2278
+ this.totalRowsWidth = 0;
2279
+ this.viewWidth = '100%';
2280
+ this.viewHeight = 'auto';
2281
+ this.displayQSbtns = true;
2282
+ this.selectedApiName = '';
2283
+ this.showSort = false;
2284
+ this.defaultRowSpan = -1;
2285
+ }
2286
+ fillData(isInDialog = false) {
2287
+ const view = this.matrixTemplate.createEmbeddedView(null);
2288
+ this.customList?.clear();
2289
+ this.orgCont?.clear();
2290
+ if (isInDialog) {
2291
+ this.dialogCont?.clear();
2292
+ this.dialogCont?.insert(view);
2293
+ }
2294
+ else {
2295
+ this.orgCont?.insert(view);
2296
+ }
2297
+ setTimeout(() => {
2298
+ const viewType = this.isTableView()
2299
+ ? 'table'
2300
+ : 'lines';
2301
+ this.customList.initListData(this.uiControl, this.childData.TotalRows, this.childData.Rows, viewType);
2302
+ this.setTotalsRow();
2303
+ // if (!this.childModal.isShown) {
2304
+ const childrenCount = this.childData.Rows
2305
+ ? this.childData.Rows.length
2306
+ : 0;
2307
+ const isEven = childrenCount % 2 === 0;
2308
+ // 3 for matrix & flat matrix because the header + total is 2 more rows.
2309
+ const rowsToAdd = this.isMatrixView() || this.isFlatMatrixView()
2310
+ ? isEven
2311
+ ? 3
2312
+ : 4
2313
+ : 1;
2314
+ const formRowHeight = this.customizationService.calculateFormFieldHeight() * 16; // convert rem to pixel
2315
+ // Set the default only if not set yet.
2316
+ if (this.defaultRowSpan === -1) {
2317
+ this.defaultRowSpan = this.field.rowSpan;
2318
+ }
2319
+ this.sumOfMinColWidth = 0;
2320
+ this.totalRowsWidth = 0;
2321
+ this.childData.UIControl.ControlFields.forEach((uiControlField) => {
2322
+ this.totalRowsWidth += uiControlField.ColumnWidth;
2323
+ uiControlField.minFieldWidth = this.mmToPx(12); // NEED TO GET THIS PARAM FROM CUSTOMIZATION;
2324
+ this.sumOfMinColWidth += 12;
2325
+ });
2326
+ this.setViewCover(this.childData.Rows);
2327
+ if (this.coverChildTable) {
2328
+ this.field.rowSpan = this.defaultRowSpan;
2329
+ }
2330
+ else {
2331
+ // For line view Add the height of the line (form height).
2332
+ if (this.currentViewType.Key === 'OrderCenterFlatMatrixLine') {
2333
+ const maxRow = Math.max(...this.uiControl.ControlFields.map((f) => {
2334
+ return f.Layout.Y + f.Layout.Height;
2335
+ }));
2336
+ // * 16 convert rem to pixel
2337
+ const cardRowsHeight = this.customizationService.calculateCardRowsHeight(maxRow) * 16;
2338
+ // maxRow * 24 + 60 - 24 for each row in card + 60 for the padding of each card.
2339
+ // const rowSpanToAdd = childrenCount * ((cardRowsHeight + 24) / formRowHeight) + rowsToAdd;
2340
+ const rowSpanToAdd = (childrenCount * (cardRowsHeight + 24)) /
2341
+ formRowHeight +
2342
+ rowsToAdd;
2343
+ this.field.rowSpan = rowSpanToAdd;
2344
+ }
2345
+ else {
2346
+ // const tableRowsHeight = this.customizationService.calculateTableRowsHeight(childrenCount) * 16;
2347
+ // this.field.rowSpan = Math.ceil((tableRowsHeight + (rowsToAdd * 40)) / formRowHeight);
2348
+ // * 16 convert rem to pixel
2349
+ const rowsToAddHeight = this.customizationService.calculateTableRowsHeight(rowsToAdd, false) * 16;
2350
+ const tableRowsHeight = this.customizationService.calculateTableRowsHeight(childrenCount) * 16;
2351
+ this.field.rowSpan =
2352
+ (rowsToAddHeight + tableRowsHeight) / formRowHeight;
2353
+ }
2354
+ }
2355
+ }, 0);
2356
+ this.changeDetectorRef.markForCheck();
2357
+ }
2358
+ fillChildData(res) {
2359
+ this.childData = res;
2360
+ this.uiControl = res.UIControl;
2361
+ this.additionalApiNames = res.AdditionalApiNames;
2362
+ this.fillData();
2363
+ }
2364
+ mmToPx(mm) {
2365
+ const height = this.my1mm.nativeElement.clientHeight;
2366
+ return Math.floor(mm * height); // returns sizes in PX
2367
+ }
2368
+ isMatrixView() {
2369
+ return (this.currentViewType &&
2370
+ this.currentViewType.Key === 'OrderCenterMatrix');
2371
+ }
2372
+ isFlatMatrixView() {
2373
+ return (this.currentViewType &&
2374
+ this.currentViewType.Key === 'OrderCenterFlatMatrixGrid');
2375
+ }
2376
+ isTableView() {
2377
+ return this.isMatrixView() || this.isFlatMatrixView();
2378
+ }
2379
+ changeChildrenViewType(viewTypeKey) {
2380
+ this.rows = [];
2381
+ this.uiControl = null;
2382
+ for (const vt of this.childViewTypes) {
2383
+ if (vt.Key === viewTypeKey) {
2384
+ this.currentViewType = vt;
2385
+ break;
2386
+ }
2387
+ }
2388
+ this.currentViewTypeTitle = this.currentViewType.Value;
2389
+ this.internalPageService.changeChildrenViewType(this.currentViewType.Key, (res) => {
2390
+ if (res.Rows) {
2391
+ this.fillChildData(res);
2392
+ }
2393
+ });
2394
+ }
2395
+ setViewCover(rows) {
2396
+ if (!rows) {
2397
+ return;
2398
+ }
2399
+ const matrixCont = this.mainViewCont.nativeElement;
2400
+ const viewWidth = matrixCont.clientWidth;
2401
+ this.viewWidth = viewWidth ? viewWidth.toString() : '100%';
2402
+ // if the matrix located on the bottom / there is nothing under the matrix we dont need to check the height
2403
+ if (parseInt(viewWidth, 10) < this.mmToPx(this.sumOfMinColWidth)) {
2404
+ this.coverChildTable = true;
2405
+ }
2406
+ else {
2407
+ this.coverChildTable = false;
2408
+ }
2409
+ this.changeDetectorRef.markForCheck();
2410
+ }
2411
+ showMatrixDialog() {
2412
+ const config = this.dialogService.getDialogConfig({
2413
+ disableClose: false,
2414
+ }, 'large');
2415
+ const dialogRef = this.dialogService.openDialog(this.matrixDialogTemplate, {}, config);
2416
+ dialogRef.afterOpened().subscribe(() => {
2417
+ this.fillData(true);
2418
+ });
2419
+ dialogRef.afterClosed().subscribe((value) => {
2420
+ this.fillData(false);
2421
+ });
2422
+ }
2423
+ ngOnInit() {
2424
+ // let field = this.field as PepInternalPageField;
2425
+ this.internalPageService.initDetails(this.field.objectId, this.field.parentId, this.field.searchCode, (resViewTypes) => {
2426
+ // my code DI-7134
2427
+ resViewTypes.Rows = resViewTypes.Rows.filter((item) => item.Key !== 'OrderCenterView1');
2428
+ if (resViewTypes.Rows && resViewTypes.Rows.length > 0) {
2429
+ if (!resViewTypes.Default) {
2430
+ resViewTypes.Default = resViewTypes.Rows[0].Key;
2431
+ }
2432
+ this.childViewTypes = resViewTypes.Rows;
2433
+ this.currentViewType = resViewTypes.Rows[0];
2434
+ // for (var i = 0; i < resViewTypes.Rows.length; i++) {
2435
+ for (const viewTypeRow of resViewTypes.Rows) {
2436
+ if (viewTypeRow.Value === resViewTypes.Default) {
2437
+ this.currentViewType = viewTypeRow;
2438
+ }
2439
+ }
2440
+ this.loadLastAdditionalApiName();
2441
+ this.changeChildrenViewType(this.currentViewType.Key);
2442
+ }
2443
+ });
2444
+ this.resize = fromEvent(window, 'resize')
2445
+ .pipe(debounceTime(10))
2446
+ .subscribe((event) => {
2447
+ this.setViewCover(this.rows);
2448
+ });
2449
+ }
2450
+ loadLastAdditionalApiName() {
2451
+ const daa = sessionStorage.getItem(PepInternalPageComponent.CURRENT_ADDITIONAL_API_NAME);
2452
+ if (daa && daa.length > 0) {
2453
+ const additionalApiName = JSON.parse(daa);
2454
+ this.currentAdditionalApiName = additionalApiName;
2455
+ this.internalPageService.additionalApiName = additionalApiName?.Key;
2456
+ }
2457
+ }
2458
+ ngOnDestroy() {
2459
+ if (this.resize) {
2460
+ this.resize.unsubscribe();
2461
+ }
2462
+ }
2463
+ changeAdditionalApiName(additionalApiName) {
2464
+ this.internalPageService.changeAdditionalApiName(additionalApiName ? additionalApiName.Key : '', (res) => {
2465
+ // for (let index = 0; index < res.Rows.length; index++) {
2466
+ for (const row of res.Rows) {
2467
+ this.updateChanges(row);
2468
+ }
2469
+ this.changeDetectorRef.markForCheck();
2470
+ });
2471
+ sessionStorage.setItem(PepInternalPageComponent.CURRENT_ADDITIONAL_API_NAME, JSON.stringify(additionalApiName));
2472
+ setTimeout(() => {
2473
+ this.currentAdditionalApiName = additionalApiName;
2474
+ }, 0);
2475
+ }
2476
+ setTotalsRow() {
2477
+ this.totalsRow = [];
2478
+ if (this.isMatrixView() || this.isFlatMatrixView()) {
2479
+ let totalCol = 0;
2480
+ const items = this.customList.items;
2481
+ if (items) {
2482
+ for (let col = 0; col < items[0].Fields.length; col++) {
2483
+ const field = items[0].Fields[col];
2484
+ if (field.FieldType === FIELD_TYPE.NumberIntegerForMatrix ||
2485
+ field.FieldType ===
2486
+ FIELD_TYPE.NumberIntegerQuantitySelector ||
2487
+ field.FieldType === FIELD_TYPE.NumberRealForMatrix ||
2488
+ field.FieldType ===
2489
+ FIELD_TYPE.NumberRealQuantitySelector ||
2490
+ field.FieldType === FIELD_TYPE.CalculatedInt ||
2491
+ field.FieldType === FIELD_TYPE.NumberInteger ||
2492
+ field.FieldType === FIELD_TYPE.CalculatedReal ||
2493
+ field.FieldType === FIELD_TYPE.NumberReal) {
2494
+ totalCol = 0;
2495
+ for (const listItem of items) {
2496
+ if (listItem.Fields[col] &&
2497
+ listItem.Fields[col].Value) {
2498
+ const num = parseFloat(listItem.Fields[col].Value);
2499
+ totalCol += isNaN(num) ? 0 : num;
2500
+ }
2501
+ }
2502
+ this.totalsRow.push(totalCol);
2503
+ }
2504
+ else {
2505
+ this.totalsRow.push('');
2506
+ }
2507
+ }
2508
+ }
2509
+ }
2510
+ }
2511
+ updateChanges(elementToUpdate) {
2512
+ this.customList.updateItem(elementToUpdate);
2513
+ // Update memory data
2514
+ for (let index = 0; index < this.childData.Rows.length; index++) {
2515
+ if (this.childData.Rows[index].UID === elementToUpdate.UID) {
2516
+ this.childData.Rows[index] = elementToUpdate;
2517
+ }
2518
+ }
2519
+ }
2520
+ setValueCallback(id, res) {
2521
+ if (res.Rows.length === 1) {
2522
+ const field = res.Rows[0].Fields.find((f) => f.ApiName === 'ObjectMenu');
2523
+ if (field) {
2524
+ // HACK : Until "Enabled" returns from the server, we set PepMenu to be
2525
+ // Disabled in cart on regular items and not campign items.
2526
+ field.Enabled = true;
2527
+ }
2528
+ this.updateChanges(res.Rows[0]);
2529
+ }
2530
+ this.setTotalsRow();
2531
+ this.checkForChanges = new Date();
2532
+ // DI-15985
2533
+ this.internalFormFieldChange.emit(res);
2534
+ this.changeDetectorRef.markForCheck();
2535
+ }
2536
+ onCustomizeObjectChanged(customizeObjectChangedData) {
2537
+ this.internalPageService.childValueChanged(customizeObjectChangedData.id, customizeObjectChangedData.key, customizeObjectChangedData.value, (res) => {
2538
+ this.setValueCallback(customizeObjectChangedData.id, res);
2539
+ });
2540
+ }
2541
+ onCustomizeFieldClick(fieldClickEvent) {
2542
+ let handledEvent = false;
2543
+ // For the new custom form, the plus and minus events transform in the IPepFormFieldValueChangeEvent
2544
+ if (fieldClickEvent.controlType === 'qs') {
2545
+ if (fieldClickEvent.value === PepQuantitySelectorComponent.PLUS) {
2546
+ handledEvent = true;
2547
+ this.internalPageService.childPlusClick(fieldClickEvent.id, fieldClickEvent.key, (res) => {
2548
+ this.setValueCallback(fieldClickEvent.id, res);
2549
+ });
2550
+ }
2551
+ else if (fieldClickEvent.value === PepQuantitySelectorComponent.MINUS) {
2552
+ handledEvent = true;
2553
+ this.internalPageService.childMinusClick(fieldClickEvent.id, fieldClickEvent.key, (res) => {
2554
+ this.setValueCallback(fieldClickEvent.id, res);
2555
+ });
2556
+ }
2557
+ }
2558
+ if (!handledEvent) {
2559
+ this.internalFormFieldClick.emit(fieldClickEvent);
2560
+ }
2561
+ }
2562
+ }
2563
+ PepInternalPageComponent.CURRENT_ADDITIONAL_API_NAME = 'item_details_currentAdditionalApiName';
2564
+ PepInternalPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalPageComponent, deps: [{ token: i1$2.PepDialogService }, { token: PepInternalPageService }, { token: i1$1.PepCustomizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2565
+ PepInternalPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepInternalPageComponent, selector: "pep-internal-page", inputs: { field: "field", layoutType: "layoutType" }, outputs: { internalFormFieldChange: "internalFormFieldChange", internalFormFieldClick: "internalFormFieldClick" }, providers: [PepInternalPageService], viewQueries: [{ propertyName: "my1mm", first: true, predicate: ["my1mm"], descendants: true }, { propertyName: "mainViewCont", first: true, predicate: ["mainViewCont"], descendants: true }, { propertyName: "orgCont", first: true, predicate: ["orgCont"], descendants: true, read: ViewContainerRef }, { propertyName: "dialogCont", first: true, predicate: ["dialogCont"], descendants: true, read: ViewContainerRef }, { propertyName: "matrixTemplate", first: true, predicate: ["matrixTemplate"], descendants: true }, { propertyName: "matrixDialogTemplate", first: true, predicate: ["matrixDialogTemplate"], descendants: true, read: TemplateRef }, { propertyName: "customList", first: true, predicate: PepInternalListComponent, descendants: true }], ngImport: i0, template: "<ng-template #matrixHeaderTemplate>\n <div class=\"matrix-title-container pep-border-bottom align-{{\n field.xAlignment\n }}\" title=\"{{ field.label }}\">\n <span class=\"block-with-text body-md\">{{ field.label }}</span>\n\n <div class=\"buttons-container pep-spacing-element-negative pull-right flip\">\n <ng-container *ngIf=\"\n currentViewType?.Key == 'OrderCenterMatrix' &&\n additionalApiNames &&\n additionalApiNames.length > 0\n \">\n <button class=\"pep-spacing-element pep-button icon-button sm weak\" mat-button [matMenuTriggerFor]=\"menu\"\n menu-blur>\n <span class=\"pull-left flip\" *ngIf=\"currentAdditionalApiName\">&nbsp;{{\n currentAdditionalApiName?.Value }}&nbsp;</span>\n\n <mat-icon [ngClass]=\"{'pull-left flip': currentAdditionalApiName}\">\n <pep-icon name=\"system_info\"></pep-icon>\n </mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\" xPosition=\"before\">\n <button mat-menu-item [ngClass]=\"{\n selected: currentAdditionalApiName === null\n }\" (click)=\"changeAdditionalApiName(null)\">\n <span>{{ \"LIST.NONE\" | translate }}</span>\n </button>\n <button mat-menu-item [ngClass]=\"{\n selected:\n currentAdditionalApiName?.Key ==\n additionalApiName?.Key\n }\" *ngFor=\"let additionalApiName of additionalApiNames\"\n (click)=\"changeAdditionalApiName(additionalApiName)\">\n <span>{{ additionalApiName.Value }}</span>\n </button>\n </mat-menu>\n </ng-container>\n <ng-container *ngIf=\"childViewTypes && childViewTypes.length > 1\">\n <button class=\"pep-spacing-element pep-button icon-button sm weak\" mat-button\n [matMenuTriggerFor]=\"viewsMenu\" menu-blur>\n <mat-icon>\n <pep-icon name=\"view_card_md\"></pep-icon>\n </mat-icon>\n </button>\n\n <mat-menu #viewsMenu=\"matMenu\" xPosition=\"before\">\n <button mat-menu-item [ngClass]=\"{\n selected: currentViewType?.Key == viewType?.Key\n }\" *ngFor=\"let viewType of childViewTypes\" (click)=\"changeChildrenViewType(viewType?.Key)\">\n <mat-icon [ngSwitch]=\"viewType?.Key\">\n <pep-icon *ngSwitchCase=\"'OrderCenterMatrix'\" name=\"view_matrix\"></pep-icon>\n <pep-icon *ngSwitchCase=\"'OrderCenterFlatMatrixGrid'\" name=\"view_table\"></pep-icon>\n <pep-icon *ngSwitchCase=\"'OrderCenterFlatMatrixLine'\" name=\"view_line\"></pep-icon>\n </mat-icon>\n <span>{{ viewType?.Value }}</span>\n </button>\n </mat-menu>\n </ng-container>\n </div>\n </div>\n\n</ng-template>\n\n<ng-template #matrixTemplate>\n <div #matrixContainer class=\"matrix-container\">\n <pep-internal-list (valueChange)=\"onCustomizeObjectChanged($event)\" [parentScroll]=\"matrixContainer\"\n (fieldClick)=\"onCustomizeFieldClick($event)\" [totalsRow]=\"totalsRow\"></pep-internal-list>\n </div>\n</ng-template>\n\n<div #mainViewCont id=\"mainViewCont\" [ngStyle]=\"{ 'max-width': viewWidth, 'max-height': viewHeight }\">\n <div #my1mm id=\"my1_mm\" style=\"height:1mm;width:1mm;visibility: hidden;\"></div>\n <ng-container *ngIf=\"coverChildTable && uiControl != null\">\n <div class=\"table-cover\"></div>\n <button (click)=\"showMatrixDialog()\" class=\"pep-button strong sm table-cover-button\"\n [ngClass]=\"{ 'lineview-btn': currentViewType?.Key == 'OrderCenterFlatMatrixLine'}\">\n {{ \"INTERNAL_PAGE.CLICK_TO_ORDER\" | translate }}\n </button>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"matrixHeaderTemplate\"></ng-container>\n <ng-container #orgCont></ng-container>\n</div>\n\n<ng-template #matrixDialogTemplate>\n\n <div mat-dialog-title>\n <ng-container *ngTemplateOutlet=\"matrixHeaderTemplate\"></ng-container>\n </div>\n\n <div mat-dialog-content>\n <ng-container #dialogCont></ng-container>\n </div>\n</ng-template>\n\n<!-- <div id=\"childGridModal\" bsModal (onShown)=\"onShown()\" (onHidden)=\"onHidden()\" #childModal=\"bs-modal\" class=\"modal\"\n tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"gridModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-body matrix-dialog-body\">\n <ng-container #modalCont></ng-container>\n </div>\n </div>\n </div>\n</div> -->", styles: [":host{display:grid;width:inherit;height:inherit}.matrix-title-container{padding:0;height:var(--pep-form-field-height, 2.5rem);display:flex;align-items:flex-end}.matrix-title-container .block-with-text{width:100%;max-height:inherit;font-weight:var(--pep-font-weight-bold, 600);display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.matrix-title-container .buttons-container{display:flex;align-self:center}.matrix-title-container .buttons-container .pepperi-button,.matrix-title-container .buttons-container .pep-button{width:max-content}#mainViewCont{width:100%;height:inherit;overflow:hidden;padding:0 var(--pep-spacing-xs, .25rem)}#mainViewCont .table-cover{background-color:#fff;z-index:98;position:absolute;top:0;width:100%;height:inherit;opacity:.5}#mainViewCont .table-cover-button{position:absolute;left:50%;transform:translate(-50%,-50%);top:calc(50% + var(--pep-form-field-height, 2.5rem));z-index:99}#mainViewCont .table-cover-button.lineview-btn{top:calc(2 * var(--pep-form-field-height, 2.5rem));transform:translate(-50%)}#mainViewCont .underCover{max-height:inherit;overflow:hidden}#mainViewCont ::ng-deep .table-header{top:unset!important}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$2.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "component", type: PepInternalListComponent, selector: "pep-internal-list", inputs: ["noDataFoundMsg", "hideAllSelectionInMulti", "top", "objectId", "parentId", "searchCode", "supportResizing", "parentScroll", "disabled", "disableEvents", "disableSelectionItems", "totalsRow"], outputs: ["fieldClick", "valueChange"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalPageComponent, decorators: [{
2567
+ type: Component,
2568
+ args: [{ selector: 'pep-internal-page', providers: [PepInternalPageService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #matrixHeaderTemplate>\n <div class=\"matrix-title-container pep-border-bottom align-{{\n field.xAlignment\n }}\" title=\"{{ field.label }}\">\n <span class=\"block-with-text body-md\">{{ field.label }}</span>\n\n <div class=\"buttons-container pep-spacing-element-negative pull-right flip\">\n <ng-container *ngIf=\"\n currentViewType?.Key == 'OrderCenterMatrix' &&\n additionalApiNames &&\n additionalApiNames.length > 0\n \">\n <button class=\"pep-spacing-element pep-button icon-button sm weak\" mat-button [matMenuTriggerFor]=\"menu\"\n menu-blur>\n <span class=\"pull-left flip\" *ngIf=\"currentAdditionalApiName\">&nbsp;{{\n currentAdditionalApiName?.Value }}&nbsp;</span>\n\n <mat-icon [ngClass]=\"{'pull-left flip': currentAdditionalApiName}\">\n <pep-icon name=\"system_info\"></pep-icon>\n </mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\" xPosition=\"before\">\n <button mat-menu-item [ngClass]=\"{\n selected: currentAdditionalApiName === null\n }\" (click)=\"changeAdditionalApiName(null)\">\n <span>{{ \"LIST.NONE\" | translate }}</span>\n </button>\n <button mat-menu-item [ngClass]=\"{\n selected:\n currentAdditionalApiName?.Key ==\n additionalApiName?.Key\n }\" *ngFor=\"let additionalApiName of additionalApiNames\"\n (click)=\"changeAdditionalApiName(additionalApiName)\">\n <span>{{ additionalApiName.Value }}</span>\n </button>\n </mat-menu>\n </ng-container>\n <ng-container *ngIf=\"childViewTypes && childViewTypes.length > 1\">\n <button class=\"pep-spacing-element pep-button icon-button sm weak\" mat-button\n [matMenuTriggerFor]=\"viewsMenu\" menu-blur>\n <mat-icon>\n <pep-icon name=\"view_card_md\"></pep-icon>\n </mat-icon>\n </button>\n\n <mat-menu #viewsMenu=\"matMenu\" xPosition=\"before\">\n <button mat-menu-item [ngClass]=\"{\n selected: currentViewType?.Key == viewType?.Key\n }\" *ngFor=\"let viewType of childViewTypes\" (click)=\"changeChildrenViewType(viewType?.Key)\">\n <mat-icon [ngSwitch]=\"viewType?.Key\">\n <pep-icon *ngSwitchCase=\"'OrderCenterMatrix'\" name=\"view_matrix\"></pep-icon>\n <pep-icon *ngSwitchCase=\"'OrderCenterFlatMatrixGrid'\" name=\"view_table\"></pep-icon>\n <pep-icon *ngSwitchCase=\"'OrderCenterFlatMatrixLine'\" name=\"view_line\"></pep-icon>\n </mat-icon>\n <span>{{ viewType?.Value }}</span>\n </button>\n </mat-menu>\n </ng-container>\n </div>\n </div>\n\n</ng-template>\n\n<ng-template #matrixTemplate>\n <div #matrixContainer class=\"matrix-container\">\n <pep-internal-list (valueChange)=\"onCustomizeObjectChanged($event)\" [parentScroll]=\"matrixContainer\"\n (fieldClick)=\"onCustomizeFieldClick($event)\" [totalsRow]=\"totalsRow\"></pep-internal-list>\n </div>\n</ng-template>\n\n<div #mainViewCont id=\"mainViewCont\" [ngStyle]=\"{ 'max-width': viewWidth, 'max-height': viewHeight }\">\n <div #my1mm id=\"my1_mm\" style=\"height:1mm;width:1mm;visibility: hidden;\"></div>\n <ng-container *ngIf=\"coverChildTable && uiControl != null\">\n <div class=\"table-cover\"></div>\n <button (click)=\"showMatrixDialog()\" class=\"pep-button strong sm table-cover-button\"\n [ngClass]=\"{ 'lineview-btn': currentViewType?.Key == 'OrderCenterFlatMatrixLine'}\">\n {{ \"INTERNAL_PAGE.CLICK_TO_ORDER\" | translate }}\n </button>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"matrixHeaderTemplate\"></ng-container>\n <ng-container #orgCont></ng-container>\n</div>\n\n<ng-template #matrixDialogTemplate>\n\n <div mat-dialog-title>\n <ng-container *ngTemplateOutlet=\"matrixHeaderTemplate\"></ng-container>\n </div>\n\n <div mat-dialog-content>\n <ng-container #dialogCont></ng-container>\n </div>\n</ng-template>\n\n<!-- <div id=\"childGridModal\" bsModal (onShown)=\"onShown()\" (onHidden)=\"onHidden()\" #childModal=\"bs-modal\" class=\"modal\"\n tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"gridModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-body matrix-dialog-body\">\n <ng-container #modalCont></ng-container>\n </div>\n </div>\n </div>\n</div> -->", styles: [":host{display:grid;width:inherit;height:inherit}.matrix-title-container{padding:0;height:var(--pep-form-field-height, 2.5rem);display:flex;align-items:flex-end}.matrix-title-container .block-with-text{width:100%;max-height:inherit;font-weight:var(--pep-font-weight-bold, 600);display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.matrix-title-container .buttons-container{display:flex;align-self:center}.matrix-title-container .buttons-container .pepperi-button,.matrix-title-container .buttons-container .pep-button{width:max-content}#mainViewCont{width:100%;height:inherit;overflow:hidden;padding:0 var(--pep-spacing-xs, .25rem)}#mainViewCont .table-cover{background-color:#fff;z-index:98;position:absolute;top:0;width:100%;height:inherit;opacity:.5}#mainViewCont .table-cover-button{position:absolute;left:50%;transform:translate(-50%,-50%);top:calc(50% + var(--pep-form-field-height, 2.5rem));z-index:99}#mainViewCont .table-cover-button.lineview-btn{top:calc(2 * var(--pep-form-field-height, 2.5rem));transform:translate(-50%)}#mainViewCont .underCover{max-height:inherit;overflow:hidden}#mainViewCont ::ng-deep .table-header{top:unset!important}\n"] }]
2569
+ }], ctorParameters: function () { return [{ type: i1$2.PepDialogService }, { type: PepInternalPageService }, { type: i1$1.PepCustomizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { field: [{
2570
+ type: Input
2571
+ }], layoutType: [{
2572
+ type: Input
2573
+ }], internalFormFieldChange: [{
2574
+ type: Output
2575
+ }], internalFormFieldClick: [{
2576
+ type: Output
2577
+ }], my1mm: [{
2578
+ type: ViewChild,
2579
+ args: ['my1mm']
2580
+ }], mainViewCont: [{
2581
+ type: ViewChild,
2582
+ args: ['mainViewCont']
2583
+ }], orgCont: [{
2584
+ type: ViewChild,
2585
+ args: ['orgCont', { read: ViewContainerRef }]
2586
+ }], dialogCont: [{
2587
+ type: ViewChild,
2588
+ args: ['dialogCont', { read: ViewContainerRef }]
2589
+ }], matrixTemplate: [{
2590
+ type: ViewChild,
2591
+ args: ['matrixTemplate']
2592
+ }], matrixDialogTemplate: [{
2593
+ type: ViewChild,
2594
+ args: ['matrixDialogTemplate', { read: TemplateRef }]
2595
+ }], customList: [{
2596
+ type: ViewChild,
2597
+ args: [PepInternalListComponent]
2598
+ }] } });
2599
+
2600
+ class PepInternalCaruselService {
2601
+ constructor(httpService) {
2602
+ this.httpService = httpService;
2603
+ this.eventUrl = 'Service1.svc/v1/EmitEvent';
2604
+ }
2605
+ emitEvent(uiObjectKey, fieldKey, fieldValue, eventName, callbackFunc) {
2606
+ const body = {
2607
+ 'EventKey': eventName,
2608
+ 'EventData': JSON.stringify({
2609
+ UIObjectKey: uiObjectKey,
2610
+ FieldID: fieldKey,
2611
+ Value: fieldValue
2612
+ })
2613
+ };
2614
+ this.httpService.postWapiApiCall(`${this.eventUrl}`, body).subscribe((res) => {
2615
+ console.log(res);
2616
+ callbackFunc(res);
2617
+ }
2618
+ // (error) => {},
2619
+ // () => {}
2620
+ );
2621
+ }
2622
+ }
2623
+ PepInternalCaruselService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalCaruselService, deps: [{ token: i1$1.PepHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2624
+ PepInternalCaruselService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalCaruselService });
2625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalCaruselService, decorators: [{
2626
+ type: Injectable
2627
+ }], ctorParameters: function () { return [{ type: i1$1.PepHttpService }]; } });
2628
+
2629
+ class PepInternalCaruselComponent {
2630
+ constructor(layoutService, internalCaruselService) {
2631
+ this.layoutService = layoutService;
2632
+ this.internalCaruselService = internalCaruselService;
2633
+ this.layoutType = 'form';
2634
+ this.internalFormFieldChange = new EventEmitter();
2635
+ this.internalFormFieldClick = new EventEmitter();
2636
+ this._items = null;
2637
+ this.layout = null;
2638
+ this.duration = 1000;
2639
+ this.itemsToMove = 3;
2640
+ this.prevDisabled = false;
2641
+ this.nextDisabled = false;
2642
+ this.PepScreenSizeType = PepScreenSizeType;
2643
+ }
2644
+ set field(value) {
2645
+ this._field = value;
2646
+ const caruselField = this._field;
2647
+ if (caruselField && caruselField.pageInfo) {
2648
+ this.layout = caruselField.pageInfo.UIControl;
2649
+ this.items = caruselField.pageInfo.Rows;
2650
+ }
2651
+ }
2652
+ get field() {
2653
+ return this._field;
2654
+ }
2655
+ set items(value) {
2656
+ this._items = value;
2657
+ // this.moveTo(0);
2658
+ }
2659
+ get items() {
2660
+ return this._items;
2661
+ }
2662
+ ngOnInit() {
2663
+ //
2664
+ }
2665
+ ngAfterViewInit() {
2666
+ this.layoutService.onResize$.subscribe((size) => {
2667
+ this.screenSize = size;
2668
+ });
2669
+ }
2670
+ onCustomizeObjectChanged(customizeObjectChangedData) {
2671
+ this.internalCaruselService.emitEvent(customizeObjectChangedData.uiObjectKey, customizeObjectChangedData.key, customizeObjectChangedData.value, 'SetFieldValue', () => {
2672
+ this.internalFormFieldChange.emit(customizeObjectChangedData);
2673
+ });
2674
+ }
2675
+ onCustomizeFieldClick(fieldClickEvent) {
2676
+ let handledEvent = false;
2677
+ // For the new custom form, the plus and minus events transform in the IPepFormFieldValueChangeEvent
2678
+ if (fieldClickEvent.controlType === 'qs') {
2679
+ if (fieldClickEvent.value === PepQuantitySelectorComponent.PLUS) {
2680
+ handledEvent = true;
2681
+ this.internalCaruselService.emitEvent(fieldClickEvent.uiObjectKey, fieldClickEvent.key, '', 'IncrementFieldValue', () => {
2682
+ this.internalFormFieldChange.emit({});
2683
+ });
2684
+ }
2685
+ else if (fieldClickEvent.value === PepQuantitySelectorComponent.MINUS) {
2686
+ handledEvent = true;
2687
+ this.internalCaruselService.emitEvent(fieldClickEvent.uiObjectKey, fieldClickEvent.key, '', 'DecrementFieldValue', () => {
2688
+ this.internalFormFieldChange.emit({});
2689
+ });
2690
+ }
2691
+ }
2692
+ if (!handledEvent) {
2693
+ this.internalFormFieldClick.emit(fieldClickEvent);
2694
+ }
2695
+ }
2696
+ moveLeft() {
2697
+ const indexToMove = Math.max(this.carousel.currIndex - this.itemsToMove, 0);
2698
+ this.moveTo(indexToMove);
2699
+ }
2700
+ moveRight() {
2701
+ const indexToMove = Math.min(this.carousel.currIndex + this.itemsToMove, this.items.length);
2702
+ this.moveTo(indexToMove);
2703
+ }
2704
+ moveTo(index) {
2705
+ if (this.carousel) {
2706
+ this.carousel.moveTo(index);
2707
+ }
2708
+ }
2709
+ onReachesLeftBound(event) {
2710
+ this.prevDisabled = event;
2711
+ }
2712
+ onReachesRightBound(event) {
2713
+ this.nextDisabled = event;
2714
+ }
2715
+ }
2716
+ PepInternalCaruselComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalCaruselComponent, deps: [{ token: i1$1.PepLayoutService }, { token: PepInternalCaruselService }], target: i0.ɵɵFactoryTarget.Component });
2717
+ PepInternalCaruselComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepInternalCaruselComponent, selector: "pep-internal-carusel", inputs: { field: "field", layoutType: "layoutType" }, outputs: { internalFormFieldChange: "internalFormFieldChange", internalFormFieldClick: "internalFormFieldClick" }, providers: [PepInternalCaruselService], viewQueries: [{ propertyName: "carousel", first: true, predicate: ["carousel"], descendants: true, read: PepCarouselComponent }], ngImport: i0, template: "<div class=\"carousel-container\">\n <ng-container *ngIf=\"items?.length > 0; then carouselBlock; else emptyBlock\"></ng-container>\n <ng-template #emptyBlock>\n <!-- No items -->\n </ng-template>\n <ng-template #carouselBlock>\n <pep-button *ngIf=\"screenSize <= PepScreenSizeType.SM\" [iconName]=\"'arrow_left_alt'\" [styleType]=\"'regular'\"\n [disabled]=\"prevDisabled\" (click)=\"moveLeft()\" class=\"carousel-arrow start-arrow\">\n </pep-button>\n <pep-carousel #carousel [xWheelEnabled]=\"false\" [snapDuration]=\"duration\"\n (reachesLeftBound)=\"onReachesLeftBound($event)\" (reachesRightBound)=\"onReachesRightBound($event)\">\n <ng-container *ngFor=\"let item of items\">\n <pep-internal-form pepCarouselItem [layout]=\"layout\" [data]=\"item\" [layoutType]=\"'card'\" class=\"card-view \"\n (valueChange)=\"onCustomizeObjectChanged($event)\" (fieldClick)=\"onCustomizeFieldClick($event)\">\n </pep-internal-form>\n </ng-container>\n </pep-carousel>\n <pep-button *ngIf=\"screenSize <= PepScreenSizeType.SM\" [iconName]=\"'arrow_right_alt'\" [styleType]=\"'regular'\"\n [disabled]=\"nextDisabled\" (click)=\"moveRight()\" class=\"carousel-arrow end-arrow\">\n </pep-button>\n </ng-template>\n</div>", styles: [".carousel-container{position:relative;margin:0;display:grid}.carousel-container .carousel-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:1}.carousel-container .carousel-arrow.start-arrow{left:0}.carousel-container .carousel-arrow.end-arrow{right:0}.carousel-container ::ng-deep .carousel-content .card-view{padding:var(--pep-spacing-sm, .5rem) 0!important}.carousel-container ::ng-deep .carousel-content .card-view:first-child{padding-inline-start:var(--pep-spacing-sm, .5rem)!important}.carousel-container ::ng-deep .carousel-content .card-view:last-child{padding-inline-end:var(--pep-spacing-sm, .5rem)!important}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$4.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "component", type: i5$3.PepCarouselComponent, selector: "pep-carousel", inputs: ["scrollbarHidden", "disabled", "xDisabled", "yDisabled", "xWheelEnabled", "dragDisabled", "snapDisabled", "snapOffset", "snapDuration"], outputs: ["dsInitialized", "indexChanged", "reachesLeftBound", "reachesRightBound", "snapAnimationFinished", "dragStart", "dragEnd"] }, { kind: "directive", type: i5$3.PepCarouselItemDirective, selector: "[pepCarouselItem]", inputs: ["dragDisabled"] }, { kind: "component", type: PepInternalFormComponent, selector: "pep-internal-form", inputs: ["isInternal", "isReport", "layout", "lockEvents", "canEditObject", "data", "lockFields", "isActive", "layoutType", "objectId", "parentId", "searchCode", "showTitle", "firstFieldAsLink", "checkForChanges"], outputs: ["valueChange", "formValidationChange", "fieldClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2718
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepInternalCaruselComponent, decorators: [{
2719
+ type: Component,
2720
+ args: [{ selector: 'pep-internal-carusel', providers: [PepInternalCaruselService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"carousel-container\">\n <ng-container *ngIf=\"items?.length > 0; then carouselBlock; else emptyBlock\"></ng-container>\n <ng-template #emptyBlock>\n <!-- No items -->\n </ng-template>\n <ng-template #carouselBlock>\n <pep-button *ngIf=\"screenSize <= PepScreenSizeType.SM\" [iconName]=\"'arrow_left_alt'\" [styleType]=\"'regular'\"\n [disabled]=\"prevDisabled\" (click)=\"moveLeft()\" class=\"carousel-arrow start-arrow\">\n </pep-button>\n <pep-carousel #carousel [xWheelEnabled]=\"false\" [snapDuration]=\"duration\"\n (reachesLeftBound)=\"onReachesLeftBound($event)\" (reachesRightBound)=\"onReachesRightBound($event)\">\n <ng-container *ngFor=\"let item of items\">\n <pep-internal-form pepCarouselItem [layout]=\"layout\" [data]=\"item\" [layoutType]=\"'card'\" class=\"card-view \"\n (valueChange)=\"onCustomizeObjectChanged($event)\" (fieldClick)=\"onCustomizeFieldClick($event)\">\n </pep-internal-form>\n </ng-container>\n </pep-carousel>\n <pep-button *ngIf=\"screenSize <= PepScreenSizeType.SM\" [iconName]=\"'arrow_right_alt'\" [styleType]=\"'regular'\"\n [disabled]=\"nextDisabled\" (click)=\"moveRight()\" class=\"carousel-arrow end-arrow\">\n </pep-button>\n </ng-template>\n</div>", styles: [".carousel-container{position:relative;margin:0;display:grid}.carousel-container .carousel-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:1}.carousel-container .carousel-arrow.start-arrow{left:0}.carousel-container .carousel-arrow.end-arrow{right:0}.carousel-container ::ng-deep .carousel-content .card-view{padding:var(--pep-spacing-sm, .5rem) 0!important}.carousel-container ::ng-deep .carousel-content .card-view:first-child{padding-inline-start:var(--pep-spacing-sm, .5rem)!important}.carousel-container ::ng-deep .carousel-content .card-view:last-child{padding-inline-end:var(--pep-spacing-sm, .5rem)!important}\n"] }]
2721
+ }], ctorParameters: function () { return [{ type: i1$1.PepLayoutService }, { type: PepInternalCaruselService }]; }, propDecorators: { carousel: [{
2722
+ type: ViewChild,
2723
+ args: ['carousel', { read: PepCarouselComponent }]
2724
+ }], field: [{
2725
+ type: Input
2726
+ }], layoutType: [{
2727
+ type: Input
2728
+ }], internalFormFieldChange: [{
2729
+ type: Output
2730
+ }], internalFormFieldClick: [{
2731
+ type: Output
2732
+ }] } });
2733
+
2734
+ class PepFieldGeneratorComponent {
2735
+ constructor() {
2736
+ this.isActive = false;
2737
+ this.uid = null;
2738
+ this.layoutType = 'form';
2739
+ this.showTitle = true;
2740
+ this.checkForChanges = null;
2741
+ this.valueChange = new EventEmitter();
2742
+ // @Output()
2743
+ // formValidationChange: EventEmitter<boolean> = new EventEmitter<boolean>();
2744
+ this.elementClick = new EventEmitter();
2745
+ this.internalFormFieldChange = new EventEmitter();
2746
+ this.internalFormFieldClick = new EventEmitter();
2747
+ this.formValueChange = new EventEmitter();
2748
+ this.formFieldClick = new EventEmitter();
2749
+ }
2750
+ set field(value) {
2751
+ this._field = value;
2752
+ }
2753
+ get field() {
2754
+ return this._field;
2755
+ }
2756
+ get isValid() {
2757
+ if (this.field.readonly || this.field.disabled) {
2758
+ return true;
2759
+ }
2760
+ else {
2761
+ const formControl = this.form && this.form.get(this.field.key);
2762
+ if (formControl) {
2763
+ return formControl.valid;
2764
+ }
2765
+ else {
2766
+ return false;
2767
+ }
2768
+ }
2769
+ }
2770
+ get isTouched() {
2771
+ const formControl = this.form && this.form.get(this.field.key);
2772
+ return formControl ? formControl.touched : false;
2773
+ }
2774
+ get isDirty() {
2775
+ const formControl = this.form && this.form.get(this.field.key);
2776
+ return formControl ? formControl.dirty : false;
2777
+ }
2778
+ onFileChanged(fileData, field) {
2779
+ const value = fileData ? JSON.stringify(fileData) : '';
2780
+ const fieldValueChange = {
2781
+ key: field.key,
2782
+ value: value,
2783
+ controlType: field.controlType,
2784
+ };
2785
+ this.valueChange.emit(fieldValueChange);
2786
+ }
2787
+ onAddressValueChanged(valueChange, field) {
2788
+ const fieldValueChange = {
2789
+ key: valueChange.key,
2790
+ value: valueChange.value,
2791
+ controlType: field.controlType,
2792
+ };
2793
+ this.valueChange.emit(fieldValueChange);
2794
+ }
2795
+ onValueChanged(value, field) {
2796
+ const fieldValueChange = {
2797
+ key: field.key,
2798
+ value: value.toString(),
2799
+ controlType: field.controlType,
2800
+ };
2801
+ this.valueChange.emit(fieldValueChange);
2802
+ }
2803
+ onInternalFormFieldChanged(internalFormFieldChange) {
2804
+ this.internalFormFieldChange.emit(internalFormFieldChange);
2805
+ }
2806
+ // onFormValidationChanged(formValidationChange: any): void {
2807
+ // this.formValidationChange.emit(formValidationChange);
2808
+ // }
2809
+ onClick(fieldClicked) {
2810
+ this.elementClick.emit(fieldClicked);
2811
+ }
2812
+ onInternalFormFieldClick(internalFormFieldClick) {
2813
+ this.internalFormFieldClick.emit(internalFormFieldClick);
2814
+ }
2815
+ onFormValueChanged(event) {
2816
+ this.formValueChange.emit(event);
2817
+ }
2818
+ onFormFieldClick(event) {
2819
+ this.formFieldClick.emit(event);
2820
+ }
2821
+ ngOnChanges(changes) {
2822
+ // debugger;
2823
+ // For testing.
2824
+ // this.field.disabled = this.field.readonly = false;
2825
+ }
2826
+ ngOnDestroy() {
2827
+ //
2828
+ }
2829
+ }
2830
+ PepFieldGeneratorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFieldGeneratorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2831
+ PepFieldGeneratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepFieldGeneratorComponent, selector: "pep-field-generator", inputs: { field: "field", isActive: "isActive", uid: "uid", form: "form", layoutType: "layoutType", showTitle: "showTitle", checkForChanges: "checkForChanges" }, outputs: { valueChange: "valueChange", elementClick: "elementClick", internalFormFieldChange: "internalFormFieldChange", internalFormFieldClick: "internalFormFieldClick", formValueChange: "formValueChange", formFieldClick: "formFieldClick" }, usesOnChanges: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"field.controlType\" [formGroup]=\"form\">\n\n <pep-address *ngSwitchCase=\"'address'\" [form]=\"form\" [key]=\"field.key\" [formattedValue]=\"field.formattedValue\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [groupFields]=\"field.groupFields\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (addressValueChange)=\"onAddressValueChanged($event, field)\">\n </pep-address>\n\n <pep-attachment *ngSwitchCase=\"'attachment'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-attachment>\n\n <pep-checkbox *ngSwitchCase=\"'checkbox'\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"(field.value?.toString() | lowercase) == 'true' || field.value == '1' ? true : false\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [additionalValue]=\"field.additionalValue\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-checkbox>\n\n <pep-date *ngSwitchCase=\"'date'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [minValue]=\"field.minValue\"\n [maxValue]=\"field.maxValue\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-date>\n\n <pep-images-filmstrip *ngSwitchCase=\"'images'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [showTitle]=\"showTitle\" [rowSpan]=\"field.rowSpan\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-images-filmstrip>\n\n <pep-image *ngSwitchCase=\"'image'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.formattedValue\"\n [srcLarge]=\"field.value\" [options]=\"field.options\" [label]=\"field.label\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [indicatorsField]=\"field.indicatorsField\" [menuField]=\"field.menuField\"\n [hasCampaignField]=\"field.hasCampaignField\" [sizeLimitMB]=\"field.sizeLimitMB\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-image>\n\n <pep-quantity-selector *ngSwitchCase=\"'qs'\" [form]=\"form\" [key]=\"field.key\" [allowDecimal]=\"field.allowDecimal\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [additionalValue]=\"field.additionalValue\" [notificationInfo]=\"field.notificationInfo\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [showTitle]=\"showTitle\" [visible]=\"field.visible\"\n [minFractionDigits]=\"field.digitsNumberAfterDecimalPoint\" (valueChange)=\"onValueChanged($event, field)\"\n (elementClick)=\"onClick($event)\">\n </pep-quantity-selector>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-rich-html-textarea *ngSwitchCase=\"'richhtmltextarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\" [renderTitle]=\"field.renderTitle\"\n [renderEnlargeButton]=\"field.renderEnlargeButton\" (valueChange)=\"onValueChanged($event, field)\"\n [isActive]=\"isActive\">\n </pep-rich-html-textarea>\n\n <pep-select *ngSwitchCase=\"'select'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [options]=\"field.options\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" [emptyOption]=\"field.emptyOption\"\n (valueChange)=\"onValueChanged($event, field)\" \n [isActive]=\"isActive\">\n </pep-select>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-separator *ngSwitchCase=\"'separator'\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [xAlignment]=\"field.xAlignment\" [layoutType]=\"layoutType\" [visible]=\"field.visible\">\n </pep-separator>\n\n <pep-signature *ngSwitchCase=\"'signature'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [layoutType]=\"layoutType\"\n [visible]=\"field.visible\" (fileChange)=\"onFileChanged($event, field)\">\n </pep-signature>\n\n <pep-textarea *ngSwitchCase=\"'textarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-textarea>\n\n <pep-textbox *ngSwitchCase=\"'textbox'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [accessory]=\"field.accessory\" [label]=\"field.label\"\n [placeholder]=\"field.placeholder\" [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [regex]=\"field.regex\" [regexError]=\"field.regexError\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [minFractionDigits]=\"field.digitsNumberAfterDecimalPoint\"\n (valueChange)=\"onValueChanged($event, field)\" \n [isActive]=\"isActive\" [visible]=\"field.visible\">\n </pep-textbox>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-link *ngSwitchCase=\"'link'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [displayValue]=\"field.formattedValue\"\n [label]=\"field.label\" [placeholder]=\"field.placeholder\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\" [visible]=\"field.visible\"\n (elementClick)=\"onClick($event)\">\n </pep-link>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-indicators *ngSwitchCase=\"'indicators'\" [key]=\"field.key\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-indicators>\n <pep-internal-button *ngSwitchCase=\"'button'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\"\n [referenceObjectInternalType]=\"field.referenceObjectInternalType\" [type]=\"field.type\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (valueChange)=\"onValueChanged($event, field)\">\n </pep-internal-button>\n <pep-internal-menu *ngSwitchCase=\"'menu'\" [key]=\"field.key\" [label]=\"field.label\" [disabled]=\"field.disabled\"\n [xAlignment]=\"field.xAlignment\" [options]=\"field.options\" [layoutType]=\"layoutType\"\n (elementClick)=\"onClick($event)\">\n </pep-internal-menu>\n <pep-internal-page *ngSwitchCase=\"'internalPage'\" [field]=\"field\" [layoutType]=\"layoutType\"\n (internalFormFieldClick)=\"onInternalFormFieldClick($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\">\n </pep-internal-page>\n\n <pep-internal-carusel *ngSwitchCase=\"'internalCarusel'\" [field]=\"field\"\n (internalFormFieldClick)=\"onInternalFormFieldClick($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\">\n </pep-internal-carusel>\n\n <ng-container *ngSwitchCase=\"'placeholder'\">\n </ng-container>\n</ng-container>", styles: [":host{width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$2.PepAddressComponent, selector: "pep-address", inputs: ["key", "formattedValue", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "groupFields", "form", "layoutType", "visible"], outputs: ["addressValueChange"] }, { kind: "component", type: i4$3.PepAttachmentComponent, selector: "pep-attachment", inputs: ["key", "src", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "handleActions", "hint"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i5$2.PepCheckboxComponent, selector: "pep-checkbox", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "additionalValue", "form", "isActive", "showTitle", "renderTitle", "layoutType", "visible"], outputs: ["valueChange"] }, { kind: "component", type: i6.PepDateComponent, selector: "pep-date", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "visible", "minValue", "maxValue", "minDateValue", "maxDateValue", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType"], outputs: ["valueChange"] }, { kind: "component", type: i7$1.PepImageComponent, selector: "pep-image", inputs: ["key", "srcLarge", "src", "options", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "indicatorsField", "menuField", "hasCampaignField", "visible", "form", "uid", "showTitle", "renderTitle", "layoutType", "isActive", "sizeLimitMB", "acceptImagesType", "handleActions", "hint"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i8$1.PepImagesFilmstripComponent, selector: "pep-images-filmstrip", inputs: ["key", "value", "label", "xAlignment", "rowSpan", "form", "uid", "showTitle", "renderTitle", "layoutType", "currIndex", "showThumbnails"] }, { kind: "component", type: i9.PepQuantitySelectorComponent, selector: "pep-quantity-selector", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "allowDecimal", "additionalValue", "notificationInfo", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "styleType", "isInFocus"], outputs: ["valueChange", "elementClick"] }, { kind: "component", type: i10.PepRichHtmlTextareaComponent, selector: "pep-rich-html-textarea", inputs: ["key", "value", "label", "mandatory", "disabled", "readonly", "maxFieldCharacters", "xAlignment", "sanitize", "rowSpan", "visible", "form", "isActive", "showTitle", "renderTitle", "renderEnlargeButton", "layoutType", "inlineMode", "toolbarOptions"], outputs: ["valueChange"] }, { kind: "component", type: i11.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "placeholder", "placeholderWhenDisabled", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle", "typeaheadDebounceInterval", "addValueToOptionsIfNotExist"], outputs: ["valueChange"] }, { kind: "component", type: i12.PepSeparatorComponent, selector: "pep-separator", inputs: ["key", "label", "xAlignment", "form", "layoutType", "visible"] }, { kind: "component", type: i13.PepSignatureComponent, selector: "pep-signature", inputs: ["key", "src", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "signatureURL", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "handleActions"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i14.PepTextareaComponent, selector: "pep-textarea", inputs: ["key", "value", "label", "mandatory", "disabled", "readonly", "maxFieldCharacters", "textColor", "xAlignment", "rowSpan", "visible", "form", "isActive", "showTitle", "renderTitle", "layoutType"], outputs: ["valueChange", "keyup"] }, { kind: "component", type: i15.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey", "regex", "regexError", "isInFocus"], outputs: ["valueChange", "keyup"] }, { kind: "component", type: i16.PepLinkComponent, selector: "pep-link", inputs: ["key", "value", "displayValue", "label", "placeholder", "mandatory", "disabled", "readonly", "maxFieldCharacters", "textColor", "xAlignment", "rowSpan", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType"], outputs: ["valueChange", "elementClick"] }, { kind: "component", type: PepIndicatorsComponent, selector: "pep-indicators", inputs: ["key", "value", "layoutType"] }, { kind: "component", type: PepInternalButtonComponent, selector: "pep-internal-button", inputs: ["key", "value", "formattedValue", "label", "referenceObjectInternalType", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "visible", "form", "showTitle", "layoutType"], outputs: ["elementClick", "valueChange"] }, { kind: "component", type: PepInternalMenuComponent, selector: "pep-internal-menu", inputs: ["key", "label", "disabled", "xAlignment", "options", "invertClass", "layoutType"], outputs: ["elementClick"] }, { kind: "component", type: PepInternalPageComponent, selector: "pep-internal-page", inputs: ["field", "layoutType"], outputs: ["internalFormFieldChange", "internalFormFieldClick"] }, { kind: "component", type: PepInternalCaruselComponent, selector: "pep-internal-carusel", inputs: ["field", "layoutType"], outputs: ["internalFormFieldChange", "internalFormFieldClick"] }, { kind: "pipe", type: i5.LowerCasePipe, name: "lowercase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2832
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFieldGeneratorComponent, decorators: [{
2833
+ type: Component,
2834
+ args: [{ selector: 'pep-field-generator', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"field.controlType\" [formGroup]=\"form\">\n\n <pep-address *ngSwitchCase=\"'address'\" [form]=\"form\" [key]=\"field.key\" [formattedValue]=\"field.formattedValue\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [groupFields]=\"field.groupFields\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (addressValueChange)=\"onAddressValueChanged($event, field)\">\n </pep-address>\n\n <pep-attachment *ngSwitchCase=\"'attachment'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-attachment>\n\n <pep-checkbox *ngSwitchCase=\"'checkbox'\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"(field.value?.toString() | lowercase) == 'true' || field.value == '1' ? true : false\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [additionalValue]=\"field.additionalValue\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-checkbox>\n\n <pep-date *ngSwitchCase=\"'date'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [minValue]=\"field.minValue\"\n [maxValue]=\"field.maxValue\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-date>\n\n <pep-images-filmstrip *ngSwitchCase=\"'images'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [showTitle]=\"showTitle\" [rowSpan]=\"field.rowSpan\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-images-filmstrip>\n\n <pep-image *ngSwitchCase=\"'image'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.formattedValue\"\n [srcLarge]=\"field.value\" [options]=\"field.options\" [label]=\"field.label\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [indicatorsField]=\"field.indicatorsField\" [menuField]=\"field.menuField\"\n [hasCampaignField]=\"field.hasCampaignField\" [sizeLimitMB]=\"field.sizeLimitMB\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-image>\n\n <pep-quantity-selector *ngSwitchCase=\"'qs'\" [form]=\"form\" [key]=\"field.key\" [allowDecimal]=\"field.allowDecimal\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [additionalValue]=\"field.additionalValue\" [notificationInfo]=\"field.notificationInfo\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [showTitle]=\"showTitle\" [visible]=\"field.visible\"\n [minFractionDigits]=\"field.digitsNumberAfterDecimalPoint\" (valueChange)=\"onValueChanged($event, field)\"\n (elementClick)=\"onClick($event)\">\n </pep-quantity-selector>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-rich-html-textarea *ngSwitchCase=\"'richhtmltextarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\" [renderTitle]=\"field.renderTitle\"\n [renderEnlargeButton]=\"field.renderEnlargeButton\" (valueChange)=\"onValueChanged($event, field)\"\n [isActive]=\"isActive\">\n </pep-rich-html-textarea>\n\n <pep-select *ngSwitchCase=\"'select'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [options]=\"field.options\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" [emptyOption]=\"field.emptyOption\"\n (valueChange)=\"onValueChanged($event, field)\" \n [isActive]=\"isActive\">\n </pep-select>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-separator *ngSwitchCase=\"'separator'\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [xAlignment]=\"field.xAlignment\" [layoutType]=\"layoutType\" [visible]=\"field.visible\">\n </pep-separator>\n\n <pep-signature *ngSwitchCase=\"'signature'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [layoutType]=\"layoutType\"\n [visible]=\"field.visible\" (fileChange)=\"onFileChanged($event, field)\">\n </pep-signature>\n\n <pep-textarea *ngSwitchCase=\"'textarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-textarea>\n\n <pep-textbox *ngSwitchCase=\"'textbox'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [accessory]=\"field.accessory\" [label]=\"field.label\"\n [placeholder]=\"field.placeholder\" [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [regex]=\"field.regex\" [regexError]=\"field.regexError\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [minFractionDigits]=\"field.digitsNumberAfterDecimalPoint\"\n (valueChange)=\"onValueChanged($event, field)\" \n [isActive]=\"isActive\" [visible]=\"field.visible\">\n </pep-textbox>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-link *ngSwitchCase=\"'link'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [displayValue]=\"field.formattedValue\"\n [label]=\"field.label\" [placeholder]=\"field.placeholder\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\" [visible]=\"field.visible\"\n (elementClick)=\"onClick($event)\">\n </pep-link>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n\n <pep-indicators *ngSwitchCase=\"'indicators'\" [key]=\"field.key\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-indicators>\n <pep-internal-button *ngSwitchCase=\"'button'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\"\n [referenceObjectInternalType]=\"field.referenceObjectInternalType\" [type]=\"field.type\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (valueChange)=\"onValueChanged($event, field)\">\n </pep-internal-button>\n <pep-internal-menu *ngSwitchCase=\"'menu'\" [key]=\"field.key\" [label]=\"field.label\" [disabled]=\"field.disabled\"\n [xAlignment]=\"field.xAlignment\" [options]=\"field.options\" [layoutType]=\"layoutType\"\n (elementClick)=\"onClick($event)\">\n </pep-internal-menu>\n <pep-internal-page *ngSwitchCase=\"'internalPage'\" [field]=\"field\" [layoutType]=\"layoutType\"\n (internalFormFieldClick)=\"onInternalFormFieldClick($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\">\n </pep-internal-page>\n\n <pep-internal-carusel *ngSwitchCase=\"'internalCarusel'\" [field]=\"field\"\n (internalFormFieldClick)=\"onInternalFormFieldClick($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\">\n </pep-internal-carusel>\n\n <ng-container *ngSwitchCase=\"'placeholder'\">\n </ng-container>\n</ng-container>", styles: [":host{width:100%;height:100%}\n"] }]
2835
+ }], propDecorators: { field: [{
2836
+ type: Input
2837
+ }], isActive: [{
2838
+ type: Input
2839
+ }], uid: [{
2840
+ type: Input
2841
+ }], form: [{
2842
+ type: Input
2843
+ }], layoutType: [{
2844
+ type: Input
2845
+ }], showTitle: [{
2846
+ type: Input
2847
+ }], checkForChanges: [{
2848
+ type: Input
2849
+ }], valueChange: [{
2850
+ type: Output
2851
+ }], elementClick: [{
2852
+ type: Output
2853
+ }], internalFormFieldChange: [{
2854
+ type: Output
2855
+ }], internalFormFieldClick: [{
2856
+ type: Output
2857
+ }], formValueChange: [{
2858
+ type: Output
2859
+ }], formFieldClick: [{
2860
+ type: Output
2861
+ }] } });
2862
+
2863
+ class PepFormComponent {
2864
+ // eventServiceSub: Subscription;
2865
+ // public jsonLib = JSON;
2866
+ constructor(dialogService, customizationService, layoutService, fb, differs, translate) {
2867
+ this.dialogService = dialogService;
2868
+ this.customizationService = customizationService;
2869
+ this.layoutService = layoutService;
2870
+ this.fb = fb;
2871
+ this.translate = translate;
2872
+ this.isInternal = true;
2873
+ this.isReport = false;
2874
+ this.lockEvents = false;
2875
+ this.canEditObject = true;
2876
+ this._data = null;
2877
+ this.isActive = false;
2878
+ this.layoutType = 'card';
2879
+ // @Input() listType = '';
2880
+ this.objectId = '0';
2881
+ this.parentId = '0';
2882
+ this.searchCode = '0';
2883
+ this.showTitle = true;
2884
+ this.firstFieldAsLink = false;
2885
+ this.checkForChanges = null;
2886
+ this.valueChange = new EventEmitter();
2887
+ this.formValidationChange = new EventEmitter();
2888
+ this.fieldClick = new EventEmitter();
2889
+ this.internalFormFieldClick = new EventEmitter();
2890
+ this.internalFormFieldChange = new EventEmitter();
2891
+ this.isLocked = false;
2892
+ // payLoad = '';
2893
+ this.rows = [];
2894
+ this.fields = [];
2895
+ this._fieldsSubject = new BehaviorSubject([]);
2896
+ this.columns = 1;
2897
+ this.hasMenuFloatingOnOtherField = false;
2898
+ this.indicatorsDataField = null;
2899
+ this._shouldReloadForm = false;
2900
+ // store the initial value to compare with
2901
+ this.differ = differs.find({}).create();
2902
+ }
2903
+ set data(value) {
2904
+ const shouldReload = this.shouldReloadForm || !this._data;
2905
+ this._data = value;
2906
+ if (shouldReload) {
2907
+ this._shouldReloadForm = false;
2908
+ this.initForm();
2909
+ }
2910
+ else {
2911
+ this.updateForm();
2912
+ }
2913
+ }
2914
+ get data() {
2915
+ return this._data;
2916
+ }
2917
+ set lockFields(value) {
2918
+ this.isLocked = value;
2919
+ }
2920
+ get fields$() {
2921
+ return this._fieldsSubject.asObservable();
2922
+ }
2923
+ get shouldReloadForm() {
2924
+ return this._shouldReloadForm;
2925
+ }
2926
+ convertXAlignToHorizontalAlign(xAlign) {
2927
+ let res = DEFAULT_HORIZONTAL_ALIGNMENT;
2928
+ if (xAlign === X_ALIGNMENT_TYPE.None ||
2929
+ xAlign === X_ALIGNMENT_TYPE.Left) {
2930
+ res = 'left';
2931
+ }
2932
+ else if (xAlign === X_ALIGNMENT_TYPE.Right) {
2933
+ res = 'right';
2934
+ }
2935
+ else {
2936
+ res = 'center';
2937
+ }
2938
+ return res;
2939
+ }
2940
+ convertYAlignToVerticalAlign(yAlign) {
2941
+ let res = DEFAULT_VERTICAL_ALIGNMENT;
2942
+ if (yAlign === Y_ALIGNMENT_TYPE.None ||
2943
+ yAlign === Y_ALIGNMENT_TYPE.Top) {
2944
+ res = 'top';
2945
+ }
2946
+ else if (yAlign === Y_ALIGNMENT_TYPE.Bottom) {
2947
+ res = 'bottom';
2948
+ }
2949
+ else {
2950
+ res = 'middle';
2951
+ }
2952
+ return res;
2953
+ }
2954
+ convertOptionalValues(optionalValues) {
2955
+ if (optionalValues && optionalValues.length > 0) {
2956
+ return optionalValues.map((ov) => {
2957
+ return { key: ov.Key, value: ov.Value };
2958
+ });
2959
+ }
2960
+ else {
2961
+ return [];
2962
+ }
2963
+ }
2964
+ convertAddressFields(controlField, addressFields, canEditObject) {
2965
+ const fields = [];
2966
+ addressFields.forEach((field) => {
2967
+ let customField;
2968
+ const placeholder = field.ApiName;
2969
+ if (field.ApiName.toLowerCase().indexOf('street') >= 0) {
2970
+ customField = new PepTextboxField({
2971
+ key: field.ApiName,
2972
+ label: field.ApiName,
2973
+ type: 'text',
2974
+ placeholder,
2975
+ readonly: !canEditObject,
2976
+ disabled: !field.Enabled || !canEditObject,
2977
+ hidden: false,
2978
+ mandatory: false,
2979
+ value: field.Value,
2980
+ formattedValue: field.FormattedValue,
2981
+ row: 0,
2982
+ rowSpan: 1,
2983
+ col: 0,
2984
+ colSpan: 2,
2985
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
2986
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
2987
+ order: 0,
2988
+ });
2989
+ }
2990
+ else if (field.ApiName.toLowerCase().indexOf('city') >= 0) {
2991
+ customField = new PepTextboxField({
2992
+ key: field.ApiName,
2993
+ label: field.ApiName,
2994
+ type: 'text',
2995
+ placeholder,
2996
+ readonly: !canEditObject,
2997
+ disabled: !field.Enabled || !canEditObject,
2998
+ hidden: false,
2999
+ mandatory: false,
3000
+ value: field.Value,
3001
+ formattedValue: field.FormattedValue,
3002
+ row: 0,
3003
+ rowSpan: 1,
3004
+ col: 2,
3005
+ colSpan: 1,
3006
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
3007
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
3008
+ order: 1,
3009
+ });
3010
+ }
3011
+ else if (field.ApiName.toLowerCase().indexOf('state') >= 0) {
3012
+ customField = new PepSelectField({
3013
+ key: field.ApiName,
3014
+ label: field.ApiName,
3015
+ placeholder,
3016
+ options: this.convertOptionalValues(field.OptionalValues),
3017
+ readonly: !canEditObject,
3018
+ disabled: !field.Enabled || !canEditObject,
3019
+ hidden: false,
3020
+ mandatory: false,
3021
+ value: field.Value,
3022
+ formattedValue: field.FormattedValue,
3023
+ row: 1,
3024
+ rowSpan: 1,
3025
+ col: 0,
3026
+ colSpan: 1,
3027
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
3028
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
3029
+ order: 2,
3030
+ });
3031
+ }
3032
+ else if (field.ApiName.toLowerCase().indexOf('zipcode') >= 0) {
3033
+ customField = new PepTextboxField({
3034
+ key: field.ApiName,
3035
+ label: field.ApiName,
3036
+ type: 'text',
3037
+ placeholder,
3038
+ readonly: !canEditObject,
3039
+ disabled: !field.Enabled || !canEditObject,
3040
+ hidden: false,
3041
+ mandatory: false,
3042
+ value: field.Value,
3043
+ formattedValue: field.FormattedValue,
3044
+ row: 1,
3045
+ rowSpan: 1,
3046
+ col: 1,
3047
+ colSpan: 1,
3048
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
3049
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
3050
+ order: 3,
3051
+ });
3052
+ }
3053
+ else if (field.ApiName.toLowerCase().indexOf('country') >= 0) {
3054
+ customField = new PepSelectField({
3055
+ key: field.ApiName,
3056
+ label: field.ApiName,
3057
+ placeholder,
3058
+ options: this.convertOptionalValues(field.OptionalValues),
3059
+ readonly: !canEditObject,
3060
+ disabled: !field.Enabled || !canEditObject,
3061
+ hidden: false,
3062
+ mandatory: false,
3063
+ value: field.Value,
3064
+ formattedValue: field.FormattedValue,
3065
+ row: 2,
3066
+ rowSpan: 1,
3067
+ col: 2,
3068
+ colSpan: 1,
3069
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
3070
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
3071
+ order: 4,
3072
+ });
3073
+ }
3074
+ fields.push(customField);
3075
+ });
3076
+ return fields.sort((n1, n2) => n1.order > n2.order ? 1 : n1.order < n2.order ? -1 : 0);
3077
+ }
3078
+ isMatrixField(apiNameToCheck) {
3079
+ return apiNameToCheck.indexOf('Matrix') >= 0;
3080
+ }
3081
+ doesFieldHavaFloatingField(controlField, floatingField) {
3082
+ let hasFloatingField = false;
3083
+ if (floatingField.Layout.Y >= controlField.Layout.Y &&
3084
+ floatingField.Layout.Y <
3085
+ controlField.Layout.Y + controlField.Layout.Height &&
3086
+ floatingField.Layout.X >= controlField.Layout.X &&
3087
+ floatingField.Layout.X <
3088
+ controlField.Layout.X + controlField.Layout.Width) {
3089
+ hasFloatingField = true;
3090
+ }
3091
+ return hasFloatingField;
3092
+ }
3093
+ getOptionsForCustomField(controlField, dataField, canEditObject) {
3094
+ if (!controlField || !dataField) {
3095
+ return;
3096
+ }
3097
+ const placeholder = controlField.ReadOnly || !canEditObject ? '' : controlField.Title;
3098
+ let fieldProperties = {
3099
+ key: controlField.ApiName,
3100
+ label: controlField.Title,
3101
+ accessory: dataField.Accessory,
3102
+ placeholder,
3103
+ readonly: controlField.ReadOnly || !canEditObject,
3104
+ disabled: !dataField.Enabled || !canEditObject,
3105
+ hidden: controlField.Hidden,
3106
+ mandatory: controlField.Mandatory,
3107
+ value: dataField.Value,
3108
+ formattedValue: dataField.FormattedValue,
3109
+ additionalValue: dataField.AdditionalValue,
3110
+ row: controlField.Layout.Y,
3111
+ rowSpan: controlField.Layout.Height,
3112
+ col: controlField.Layout.X,
3113
+ colSpan: controlField.Layout.Width,
3114
+ xAlignment: this.convertXAlignToHorizontalAlign(controlField.Layout.XAlignment),
3115
+ yAlignment: this.convertYAlignToVerticalAlign(controlField.Layout.YAlignment),
3116
+ options: this.convertOptionalValues(dataField.OptionalValues),
3117
+ groupFields: undefined,
3118
+ maxFieldCharacters: controlField.MaxFieldCharacters,
3119
+ minValue: controlField.MinValue,
3120
+ maxValue: controlField.MaxValue,
3121
+ // hasMenu: hasMenu,
3122
+ // hasCampaign: hasCampaign,
3123
+ // hasIndicators: hasIndicators,
3124
+ textColor: dataField.TextColor,
3125
+ visible: dataField.Visible,
3126
+ digitsNumberAfterDecimalPoint: dataField.DigitsNumberAfterDecimalPoint,
3127
+ };
3128
+ if (dataField.AdditionalProps) {
3129
+ fieldProperties = {
3130
+ ...fieldProperties,
3131
+ ...dataField.AdditionalProps
3132
+ };
3133
+ }
3134
+ return fieldProperties;
3135
+ }
3136
+ convertToCustomField(controlField, dataField, canEditObject, menuField, hasCampaignField, indicatorsField, objectId, parentId, searchCode) {
3137
+ let customField;
3138
+ const options = this.getOptionsForCustomField(controlField, dataField, canEditObject);
3139
+ if (controlField.ApiName === 'ObjectMenu') {
3140
+ options.type = 'menu';
3141
+ customField = new PepInternalMenuField(options);
3142
+ }
3143
+ else if (controlField.FieldType === FIELD_TYPE.NumberRealQuantitySelector ||
3144
+ controlField.FieldType ===
3145
+ FIELD_TYPE.NumberIntegerQuantitySelector ||
3146
+ controlField.ApiName === 'QuantitySelector' ||
3147
+ controlField.ApiName === 'UnitsQuantity' ||
3148
+ controlField.ApiName.indexOf('size_') === 0) {
3149
+ if (dataField.FieldType === FIELD_TYPE.InternalLink) {
3150
+ options.type = 'button';
3151
+ }
3152
+ else if (dataField.FieldType === FIELD_TYPE.Package) {
3153
+ options.type = 'packageButton';
3154
+ }
3155
+ else if (dataField.FieldType === FIELD_TYPE.NumberRealQuantitySelector ||
3156
+ dataField.FieldType === FIELD_TYPE.NumberReal) {
3157
+ options.type = 'qs';
3158
+ options.allowDecimal = true;
3159
+ }
3160
+ else if (dataField.FieldType ===
3161
+ FIELD_TYPE.NumberIntegerQuantitySelector ||
3162
+ dataField.FieldType === FIELD_TYPE.NumberInteger) {
3163
+ options.type = 'qs';
3164
+ options.allowDecimal = false;
3165
+ }
3166
+ else if (dataField.FieldType === FIELD_TYPE.NumberIntegerForMatrix) {
3167
+ options.type = 'qsForMatrix';
3168
+ options.allowDecimal = false;
3169
+ }
3170
+ else if (dataField.FieldType === FIELD_TYPE.NumberRealForMatrix) {
3171
+ options.type = 'qsForMatrix';
3172
+ options.allowDecimal = true;
3173
+ }
3174
+ options.notificationInfo = dataField.NotificationInfo;
3175
+ customField = new PepQuantitySelectorField(options);
3176
+ }
3177
+ else {
3178
+ // HACK: need to remove this..
3179
+ if (dataField.FieldType === FIELD_TYPE.Indicators &&
3180
+ this.isMatrixField(dataField.ApiName)) {
3181
+ dataField.FieldType = FIELD_TYPE.InternalPage;
3182
+ }
3183
+ switch (dataField.FieldType) {
3184
+ case FIELD_TYPE.Address: {
3185
+ const canEditGroupObject = controlField.ReadOnly
3186
+ ? false
3187
+ : canEditObject;
3188
+ options.groupFields = this.convertAddressFields(controlField, dataField.GroupFields, canEditGroupObject);
3189
+ customField = new PepAddressField(options);
3190
+ break;
3191
+ }
3192
+ case FIELD_TYPE.Indicators: {
3193
+ // options['type'] = 'indicators'; // Not needed this is PepIndicatorsField.
3194
+ customField = new PepIndicatorsField(options);
3195
+ break;
3196
+ }
3197
+ case FIELD_TYPE.InternalPage: {
3198
+ if (this.isMatrixField(controlField.ApiName)) {
3199
+ options.rowSpan = controlField.Layout.Height;
3200
+ options.objectId = objectId;
3201
+ options.parentId = parentId;
3202
+ options.searchCode = searchCode;
3203
+ customField = new PepInternalPageField(options);
3204
+ }
3205
+ else {
3206
+ // Not supported
3207
+ }
3208
+ break;
3209
+ }
3210
+ case FIELD_TYPE.RelatedObjectsCards: {
3211
+ options.rowSpan = controlField.Layout.Height;
3212
+ options.searchCode = searchCode;
3213
+ options.pageInfo = dataField.UIPageInfo;
3214
+ customField = new PepInternalCaruselField(options);
3215
+ break;
3216
+ }
3217
+ case FIELD_TYPE.Link: {
3218
+ options.type = 'link';
3219
+ customField = new PepLinkField(options);
3220
+ break;
3221
+ }
3222
+ case FIELD_TYPE.InternalLink:
3223
+ case FIELD_TYPE.Button: {
3224
+ options.type = 'button';
3225
+ customField = new PepInternalButtonField(options);
3226
+ break;
3227
+ }
3228
+ case FIELD_TYPE.Attachment: {
3229
+ // options.type = 'attachment';
3230
+ customField = new PepAttachmentField(options);
3231
+ break;
3232
+ }
3233
+ case FIELD_TYPE.Signature: {
3234
+ // options.type = 'signature';
3235
+ customField = new PepSignatureField(options);
3236
+ break;
3237
+ }
3238
+ case FIELD_TYPE.Image:
3239
+ case FIELD_TYPE.ImageURL: {
3240
+ // options.type = 'image';
3241
+ options.menuField =
3242
+ menuField &&
3243
+ this.doesFieldHavaFloatingField(controlField, menuField)
3244
+ ? menuField
3245
+ : null;
3246
+ options.hasCampaignField =
3247
+ hasCampaignField &&
3248
+ this.doesFieldHavaFloatingField(controlField, hasCampaignField)
3249
+ ? hasCampaignField
3250
+ : null;
3251
+ options.indicatorsField =
3252
+ indicatorsField &&
3253
+ this.doesFieldHavaFloatingField(controlField, indicatorsField)
3254
+ ? indicatorsField
3255
+ : null;
3256
+ customField = new PepImageField(options);
3257
+ break;
3258
+ }
3259
+ case FIELD_TYPE.Images: {
3260
+ // options.type = 'images';
3261
+ customField = new PepImagesField(options);
3262
+ break;
3263
+ }
3264
+ case FIELD_TYPE.Email: {
3265
+ options.type = 'email';
3266
+ customField = new PepTextboxField(options);
3267
+ break;
3268
+ }
3269
+ case FIELD_TYPE.Phone: {
3270
+ options.type = 'phone';
3271
+ customField = new PepTextboxField(options);
3272
+ break;
3273
+ }
3274
+ case FIELD_TYPE.Duration: {
3275
+ options.type = 'duration';
3276
+ customField = new PepTextboxField(options);
3277
+ break;
3278
+ }
3279
+ case FIELD_TYPE.Default:
3280
+ case FIELD_TYPE.TextBox:
3281
+ case FIELD_TYPE.LimitedLengthTextBox:
3282
+ case FIELD_TYPE.TextHeader:
3283
+ case FIELD_TYPE.CalculatedString:
3284
+ case FIELD_TYPE.MapDataString: {
3285
+ customField = new PepTextboxField(options);
3286
+ break;
3287
+ }
3288
+ case FIELD_TYPE.TextArea: {
3289
+ customField = new PepTextareaField(options);
3290
+ break;
3291
+ }
3292
+ case FIELD_TYPE.RichTextHTML: {
3293
+ customField = new PepRichHtmlTextareaField(options);
3294
+ break;
3295
+ }
3296
+ case FIELD_TYPE.Date:
3297
+ case FIELD_TYPE.LimitedDate:
3298
+ case FIELD_TYPE.CalculatedDate:
3299
+ case FIELD_TYPE.DateAndTime: {
3300
+ options.type =
3301
+ dataField.FieldType === FIELD_TYPE.DateAndTime
3302
+ ? 'datetime'
3303
+ : 'date';
3304
+ customField = new PepDateField(options);
3305
+ break;
3306
+ }
3307
+ case FIELD_TYPE.NumberInteger:
3308
+ case FIELD_TYPE.CalculatedInt:
3309
+ case FIELD_TYPE.MapDataInt: {
3310
+ options.type = 'int';
3311
+ customField = new PepTextboxField(options);
3312
+ break;
3313
+ }
3314
+ case FIELD_TYPE.Percentage: {
3315
+ options.type = 'percentage';
3316
+ customField = new PepTextboxField(options);
3317
+ break;
3318
+ }
3319
+ case FIELD_TYPE.Currency: {
3320
+ options.type = 'currency';
3321
+ customField = new PepTextboxField(options);
3322
+ break;
3323
+ }
3324
+ case FIELD_TYPE.NumberReal:
3325
+ case FIELD_TYPE.CalculatedReal:
3326
+ case FIELD_TYPE.MapDataReal:
3327
+ case FIELD_TYPE.Sum:
3328
+ case FIELD_TYPE.Totals: {
3329
+ options.type = 'real';
3330
+ customField = new PepTextboxField(options);
3331
+ break;
3332
+ }
3333
+ case FIELD_TYPE.Boolean:
3334
+ case FIELD_TYPE.CalculatedBool: {
3335
+ customField = new PepCheckboxField(options);
3336
+ break;
3337
+ }
3338
+ case FIELD_TYPE.BooleanText: {
3339
+ options.type = 'booleanText';
3340
+ customField = new PepCheckboxField(options);
3341
+ break;
3342
+ }
3343
+ case FIELD_TYPE.ComboBox:
3344
+ case FIELD_TYPE.EmptyComboBox:
3345
+ case FIELD_TYPE.MapDataDropDown: {
3346
+ // options.type = 'select';
3347
+ customField = new PepSelectField(options);
3348
+ break;
3349
+ }
3350
+ case FIELD_TYPE.MultiTickBox:
3351
+ case FIELD_TYPE.MultiTickBoxToComboBox:
3352
+ case FIELD_TYPE.EmptyMultiTickBox: {
3353
+ options.type = 'multi';
3354
+ customField = new PepSelectField(options);
3355
+ break;
3356
+ }
3357
+ case FIELD_TYPE.GuidReferenceType: {
3358
+ options.type = 'reference';
3359
+ options.referenceObjectType = dataField.ReferenceObjectType;
3360
+ options.referenceObjectSubType =
3361
+ dataField.ReferenceObjectSubType;
3362
+ options.referenceObjectInternalType =
3363
+ dataField.ReferenceObjectInternalType;
3364
+ customField = new PepInternalButtonField(options);
3365
+ break;
3366
+ }
3367
+ case FIELD_TYPE.ListOfObjects: {
3368
+ options.type = 'listofobjects';
3369
+ customField = new PepInternalButtonField(options);
3370
+ break;
3371
+ }
3372
+ case FIELD_TYPE.Separator: {
3373
+ customField = new PepSeparatorField(options);
3374
+ break;
3375
+ }
3376
+ /*
3377
+ case FIELD_TYPE.Images: return that.field(value);
3378
+ */
3379
+ case FIELD_TYPE.NumberRealQuantitySelector:
3380
+ case FIELD_TYPE.NumberIntegerQuantitySelector: {
3381
+ options.type = 'qs';
3382
+ options.allowDecimal =
3383
+ dataField.FieldType ===
3384
+ FIELD_TYPE.NumberRealQuantitySelector;
3385
+ options.notificationInfo = dataField.NotificationInfo;
3386
+ customField = new PepQuantitySelectorField(options);
3387
+ break;
3388
+ }
3389
+ case FIELD_TYPE.Package: {
3390
+ options.type = 'packageButton';
3391
+ options.notificationInfo = dataField.NotificationInfo;
3392
+ customField = new PepQuantitySelectorField(options);
3393
+ break;
3394
+ }
3395
+ }
3396
+ }
3397
+ if (!customField) {
3398
+ options.label = controlField.ApiName + ' is not supported!!!';
3399
+ customField = new PepSeparatorField(options);
3400
+ }
3401
+ return customField;
3402
+ }
3403
+ getFieldFormattedValue(field) {
3404
+ let fieldFormattedValue = field.formattedValue || field.value;
3405
+ // Fix for the custom check box component.
3406
+ if (field.controlType === 'checkbox') {
3407
+ fieldFormattedValue = fieldFormattedValue === 'true';
3408
+ }
3409
+ // Fix for the custom button component.
3410
+ if (field.controlType === 'button') {
3411
+ fieldFormattedValue =
3412
+ fieldFormattedValue === '0' ? '' : fieldFormattedValue;
3413
+ }
3414
+ // Fix for the custom date component.
3415
+ if (field.controlType === 'date' || field.controlType === 'datetime') {
3416
+ if (fieldFormattedValue === '' ||
3417
+ fieldFormattedValue.indexOf('1900-1-1') >= 0 ||
3418
+ fieldFormattedValue.indexOf('1900-01-01') >= 0 ||
3419
+ fieldFormattedValue.indexOf('1970-1-1') >= 0 ||
3420
+ fieldFormattedValue.indexOf('1970-01-01') >= 0) {
3421
+ fieldFormattedValue = '';
3422
+ }
3423
+ }
3424
+ return fieldFormattedValue;
3425
+ }
3426
+ toControlGroup(fields) {
3427
+ const group = {};
3428
+ if (fields && fields.length > 0) {
3429
+ fields.forEach((field) => {
3430
+ if (field.groupFields && field.groupFields.length > 0) {
3431
+ const subGroup = {};
3432
+ field.groupFields.forEach((groupField) => {
3433
+ if (groupField.mandatory &&
3434
+ !field.readonly &&
3435
+ !field.disabled) {
3436
+ subGroup[groupField.key] = [
3437
+ {
3438
+ value: groupField.formattedValue || '',
3439
+ disabled: field.readonly ||
3440
+ field.disabled ||
3441
+ groupField.disabled,
3442
+ },
3443
+ [Validators.required],
3444
+ ];
3445
+ }
3446
+ else {
3447
+ subGroup[groupField.key] = [
3448
+ {
3449
+ value: groupField.formattedValue || '',
3450
+ disabled: field.readonly ||
3451
+ field.disabled ||
3452
+ groupField.disabled,
3453
+ },
3454
+ [Validators.nullValidator],
3455
+ ];
3456
+ }
3457
+ });
3458
+ group[field.key] = this.fb.group(subGroup);
3459
+ }
3460
+ else {
3461
+ const validators = field.getValidators();
3462
+ const fieldFormattedValue = this.getFieldFormattedValue(field);
3463
+ group[field.key] = [
3464
+ {
3465
+ value: fieldFormattedValue || '',
3466
+ disabled: field.disabled,
3467
+ },
3468
+ validators,
3469
+ ];
3470
+ }
3471
+ });
3472
+ }
3473
+ return this.fb.group(group);
3474
+ }
3475
+ createBaseField(uiControlField, dataField) {
3476
+ const customField = this.convertToCustomField(uiControlField, dataField, this.canEditObject, this.menuDataField, this.hasCampaignDataField, this.indicatorsDataField, this.objectId, this.parentId, this.searchCode);
3477
+ return customField;
3478
+ }
3479
+ showFormValidationMessage() {
3480
+ const fields = this.fields;
3481
+ let emptyMandatoryFieldsMsg = '';
3482
+ let notValidFieldsMsg = '';
3483
+ // for (let i: number = 0; i < fields.length; i++) {
3484
+ // let field = fields[i];
3485
+ for (const field of fields) {
3486
+ const formControl = this.form && this.form.get(field.key);
3487
+ if (formControl) {
3488
+ // Mandatory is empty.
3489
+ if (field.mandatory &&
3490
+ formControl.value.toString().trim().length === 0) {
3491
+ emptyMandatoryFieldsMsg +=
3492
+ '<li><small>' + field.label + '</small></li>';
3493
+ }
3494
+ else if (!field.disabled && !formControl.valid) {
3495
+ notValidFieldsMsg +=
3496
+ '<li><small>' + field.label + '</small></li>';
3497
+ }
3498
+ }
3499
+ }
3500
+ // Add the header message of the empty mandatory fields
3501
+ if (emptyMandatoryFieldsMsg.length > 0) {
3502
+ emptyMandatoryFieldsMsg =
3503
+ '<div>' +
3504
+ this.translate.instant('MESSAGES.ERROR_MANDATORY_FIELDS') +
3505
+ "</div><ul style='padding: 0 20px;'>" +
3506
+ emptyMandatoryFieldsMsg +
3507
+ '</ul><br/>';
3508
+ }
3509
+ // Add the header message of the empty mandatory fields
3510
+ if (notValidFieldsMsg.length > 0) {
3511
+ notValidFieldsMsg =
3512
+ '<div>' +
3513
+ this.translate.instant('MESSAGES.ERROR_INVALID_FIELDS') +
3514
+ "</div><ul style='padding: 0 20px;'>" +
3515
+ notValidFieldsMsg +
3516
+ '</ul>';
3517
+ }
3518
+ const title = this.translate.instant('MESSAGES.TITLE_NOTICE');
3519
+ const data = new PepDialogData({
3520
+ title,
3521
+ content: emptyMandatoryFieldsMsg + notValidFieldsMsg,
3522
+ });
3523
+ this.dialogService.openDefaultDialog(data);
3524
+ }
3525
+ ngOnInit() {
3526
+ const themeVars = this.customizationService.getThemeVariables();
3527
+ // convert rem to pixel
3528
+ const RemToPixel = 16;
3529
+ this.formGutterSize =
3530
+ this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.FORM_SPACEING_KEY) * RemToPixel;
3531
+ this.cardGutterSize =
3532
+ this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.CARD_SPACEING_KEY) * RemToPixel;
3533
+ }
3534
+ ngDoCheck() {
3535
+ const changes = this.differ.diff(this.data); // check for changes
3536
+ if (changes) {
3537
+ this.updateForm();
3538
+ this.checkForChanges = new Date();
3539
+ }
3540
+ }
3541
+ ngOnChanges(changes) {
3542
+ // if (changes.data && changes.data.currentValue) {
3543
+ // // Load changes
3544
+ // if (!this.shouldReloadForm && changes.data.previousValue) {
3545
+ // this.data = changes.data.currentValue;
3546
+ // this.updateForm();
3547
+ // } else {
3548
+ // this._shouldReloadForm = false;
3549
+ // this.initForm();
3550
+ // }
3551
+ // }
3552
+ // if (this.shouldReloadForm || !changes?.data?.previousValue) {
3553
+ // this._shouldReloadForm = false;
3554
+ // this.initForm();
3555
+ // this.checkForChanges = new Date();
3556
+ // }
3557
+ }
3558
+ ngOnDestroy() {
3559
+ //
3560
+ }
3561
+ getUiControlFields() {
3562
+ return this.layout ? this.layout.ControlFields : [];
3563
+ }
3564
+ initFieldsStructure(fields, maxRow) {
3565
+ const themeVars = this.customizationService.getThemeVariables();
3566
+ // Set form row height.
3567
+ if (this.layoutType === 'card') {
3568
+ const cardFieldHeight = this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.CARD_FIELD_HEIGHT_KEY);
3569
+ this.rowHeight = cardFieldHeight;
3570
+ }
3571
+ else {
3572
+ const rowFieldHeight = this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.FORM_FIELD_HEIGHT_KEY);
3573
+ const rowFieldTitleHeight = this.customizationService.getNumberThemeVariable(themeVars, PepCustomizationService.FORM_FIELD_TITLE_HEIGHT_KEY);
3574
+ this.rowHeight = rowFieldHeight + rowFieldTitleHeight;
3575
+ }
3576
+ // Create the fields structure (the fields must be sorted!!!).
3577
+ if (fields.length > 0) {
3578
+ // Init the layout.
3579
+ if (
3580
+ // this.layoutType === 'form' ||
3581
+ this.layoutType === 'table') {
3582
+ this.fields = fields;
3583
+ this._fieldsSubject.next(fields);
3584
+ this.rows = [];
3585
+ for (let i = 0; i <= maxRow; i++) {
3586
+ this.rows[i] = [];
3587
+ }
3588
+ // for (let i = 0; i < fields.length; i++) {
3589
+ // const field = fields[i]
3590
+ for (const field of fields) {
3591
+ this.rows[field.row].push(field);
3592
+ }
3593
+ }
3594
+ else {
3595
+ const doesfieldExistIn = new Array(maxRow);
3596
+ for (let i = 0; i < doesfieldExistIn.length; i++) {
3597
+ doesfieldExistIn[i] = new Array(this.columns);
3598
+ for (let j = 0; j < doesfieldExistIn[i].length; j++) {
3599
+ doesfieldExistIn[i][j] = false;
3600
+ }
3601
+ }
3602
+ // Run in squere (row - colspan, col - rowspan) and put true where it should.
3603
+ // for (let index = 0; index < fields.length; index++) {
3604
+ // const currentField = fields[index];
3605
+ for (const currentField of fields) {
3606
+ if (currentField.rowSpan > 1) {
3607
+ for (let row = currentField.row; row < currentField.row + currentField.rowSpan; row++) {
3608
+ if (currentField.colSpan > 1) {
3609
+ for (let col = currentField.col; col <
3610
+ currentField.col + currentField.colSpan; col++) {
3611
+ if (doesfieldExistIn.length > row &&
3612
+ doesfieldExistIn[0].length > col) {
3613
+ doesfieldExistIn[row][col] = true;
3614
+ }
3615
+ }
3616
+ }
3617
+ else {
3618
+ if (doesfieldExistIn.length > row &&
3619
+ doesfieldExistIn[0].length >
3620
+ currentField.col) {
3621
+ doesfieldExistIn[row][currentField.col] = true;
3622
+ }
3623
+ }
3624
+ }
3625
+ }
3626
+ else if (currentField.colSpan > 1) {
3627
+ for (let col = currentField.col; col < currentField.col + currentField.colSpan; col++) {
3628
+ if (doesfieldExistIn.length > currentField.row &&
3629
+ doesfieldExistIn[0].length > col) {
3630
+ doesfieldExistIn[currentField.row][col] = true;
3631
+ }
3632
+ }
3633
+ }
3634
+ else {
3635
+ if (doesfieldExistIn.length > currentField.row &&
3636
+ doesfieldExistIn[0].length > currentField.col) {
3637
+ doesfieldExistIn[currentField.row][currentField.col] = true;
3638
+ }
3639
+ }
3640
+ }
3641
+ // Create empty fields where doesfieldExistIn is false (For the md-grid-list UI Component).
3642
+ for (let i = 0; i < doesfieldExistIn.length; i++) {
3643
+ for (let j = 0; j < doesfieldExistIn[i].length; j++) {
3644
+ if (!doesfieldExistIn[i][j]) {
3645
+ // Create empty field and add it to the fields list.
3646
+ fields.push(new PepPlaceholderField({
3647
+ key: i + '_' + j,
3648
+ label: '',
3649
+ placeholder: '',
3650
+ readonly: false,
3651
+ disabled: false,
3652
+ hidden: false,
3653
+ mandatory: false,
3654
+ value: '',
3655
+ formattedValue: '',
3656
+ row: i,
3657
+ rowSpan: 1,
3658
+ col: j,
3659
+ colSpan: 1,
3660
+ order: 1,
3661
+ }));
3662
+ }
3663
+ }
3664
+ }
3665
+ // Sort the fields again.
3666
+ this.fields = fields.sort((f1, f2) => f1.row > f2.row
3667
+ ? 1
3668
+ : f1.row < f2.row
3669
+ ? -1
3670
+ : f1.col > f2.col
3671
+ ? 1
3672
+ : f1.col < f2.col
3673
+ ? -1
3674
+ : 0);
3675
+ this._fieldsSubject.next(fields);
3676
+ }
3677
+ }
3678
+ }
3679
+ setForm(isForUpdate = false) {
3680
+ let allFieldsAreReadOnly = true;
3681
+ if (!isForUpdate) {
3682
+ const fields = [];
3683
+ for (const currentField of this.fields) {
3684
+ // Add all fields except 'internalPage' (for children).
3685
+ if (currentField.controlType !== 'internalPage') {
3686
+ fields.push(currentField);
3687
+ }
3688
+ if (!currentField.readonly) {
3689
+ allFieldsAreReadOnly = false;
3690
+ }
3691
+ }
3692
+ this.form = this.toControlGroup(fields);
3693
+ }
3694
+ else {
3695
+ // Update form values if changed by calculated fields.
3696
+ for (let i = 0; i < this.fields.length; i++) {
3697
+ let currentField = this.fields[i];
3698
+ if (currentField.controlType === 'internalCarusel') {
3699
+ // Hack to override (update) the field.
3700
+ const uiControlField = this.getUiControlFields().find(cf => cf.ApiName === currentField.key);
3701
+ const dataField = this.data.Fields.find(df => df.ApiName === currentField.key);
3702
+ currentField = this.createBaseField(uiControlField, dataField);
3703
+ this._fieldsSubject.value[i] = currentField;
3704
+ }
3705
+ else if (currentField.controlType !== 'internalPage') {
3706
+ if (currentField.groupFields &&
3707
+ currentField.groupFields.length > 0) {
3708
+ // for (let j = 0; j < currentField.groupFields.length; j++) {
3709
+ // let currentGroupField = currentField.groupFields[j];
3710
+ for (const currentGroupField of currentField.groupFields) {
3711
+ const fieldFormattedValue = this.getFieldFormattedValue(currentGroupField);
3712
+ this.customizationService.updateFormField(this.form, currentGroupField, fieldFormattedValue, currentField);
3713
+ }
3714
+ }
3715
+ else {
3716
+ const fieldFormattedValue = this.getFieldFormattedValue(currentField);
3717
+ // this.form.controls[currentField.key].setValue(fieldFormattedValue);
3718
+ this.customizationService.updateFormField(this.form, currentField, fieldFormattedValue);
3719
+ }
3720
+ }
3721
+ if (!currentField.readonly) {
3722
+ allFieldsAreReadOnly = false;
3723
+ }
3724
+ }
3725
+ }
3726
+ let isFormValid = this.form?.valid;
3727
+ // Change validation to true if all fields are read only.
3728
+ if (!isFormValid && allFieldsAreReadOnly) {
3729
+ isFormValid = true;
3730
+ }
3731
+ this.onFormValidationChanged(isFormValid);
3732
+ // Set it to false to enable all fields.
3733
+ if (this.isInternal && this.isLocked) {
3734
+ this.isLocked = false;
3735
+ }
3736
+ }
3737
+ initForm() {
3738
+ if (this.data && this.data.Fields) {
3739
+ const fields = this.convertCustomFields(this.getUiControlFields(), this.data.Fields);
3740
+ const maxRow = Math.max(...fields.map((f) => {
3741
+ return f.row + f.rowSpan;
3742
+ }));
3743
+ this.columns = Math.max(...fields.map((f) => {
3744
+ return f.col + f.colSpan;
3745
+ }));
3746
+ this.initFieldsStructure(fields, maxRow);
3747
+ this.setForm();
3748
+ }
3749
+ }
3750
+ updateField(customField, updatedField) {
3751
+ const options = {
3752
+ disabled: !updatedField.Enabled || !this.canEditObject,
3753
+ readonly: !updatedField.Enabled || !this.canEditObject,
3754
+ visible: updatedField.Visible,
3755
+ value: updatedField.Value,
3756
+ additionalValue: updatedField.AdditionalValue,
3757
+ formattedValue: updatedField.FormattedValue,
3758
+ textColor: updatedField.TextColor,
3759
+ digitsNumberAfterDecimalPoint: updatedField.DigitsNumberAfterDecimalPoint
3760
+ };
3761
+ if (customField instanceof PepQuantitySelectorField) {
3762
+ const notificationInfo = updatedField.NotificationInfo;
3763
+ options.notificationInfo = notificationInfo;
3764
+ // Change type if it's change (only for allowDecimal).
3765
+ let allowDecimal = false;
3766
+ if (updatedField.FieldType === FIELD_TYPE.NumberRealQuantitySelector ||
3767
+ updatedField.FieldType === FIELD_TYPE.NumberReal ||
3768
+ updatedField.FieldType === FIELD_TYPE.NumberRealForMatrix) {
3769
+ allowDecimal = true;
3770
+ }
3771
+ options.allowDecimal = allowDecimal;
3772
+ }
3773
+ else if (customField instanceof PepSelectField) {
3774
+ options.options = this.convertOptionalValues(updatedField.OptionalValues);
3775
+ if (!options.options || options.options.length === 0) {
3776
+ options.options.push({
3777
+ key: options.value,
3778
+ value: options.formattedValue,
3779
+ });
3780
+ }
3781
+ }
3782
+ else if (customField instanceof PepInternalCaruselField) {
3783
+ options.pageInfo = updatedField.UIPageInfo;
3784
+ }
3785
+ customField.update(options);
3786
+ }
3787
+ updateForm() {
3788
+ if (this.data && this.data.Fields) {
3789
+ for (const currentField of this.data.Fields) {
3790
+ const customField = this.fields.filter((f) => f.key === currentField.ApiName)[0];
3791
+ // Update all fields except 'internalPage' type (for children).
3792
+ if (customField && customField.controlType !== 'internalPage') {
3793
+ this.updateField(customField, currentField);
3794
+ // Update the group fields.
3795
+ if (customField.controlType === 'address' &&
3796
+ currentField.GroupFields) {
3797
+ // for (let j = 0; j < currentField.GroupFields.length; j++) {
3798
+ // let currentGroupField = currentField.GroupFields[j];
3799
+ for (const currentGroupField of currentField.GroupFields) {
3800
+ currentGroupField.Enabled = !currentField.Enabled
3801
+ ? false
3802
+ : currentGroupField.Enabled;
3803
+ const customGroupField = customField.groupFields.filter((f) => f.key === currentGroupField.ApiName)[0];
3804
+ this.updateField(customGroupField, currentGroupField);
3805
+ }
3806
+ }
3807
+ }
3808
+ }
3809
+ this.setForm(true);
3810
+ }
3811
+ }
3812
+ ReloadForm() {
3813
+ this._shouldReloadForm = true;
3814
+ }
3815
+ // onSubmit() {
3816
+ // if (this.form.valid) {
3817
+ // this.payLoad = JSON.stringify(this.form.value);
3818
+ // //this.submitted.emit(this.form.value);
3819
+ // }
3820
+ // }
3821
+ getFormControlById(key) {
3822
+ let formControl = null;
3823
+ this.fields.forEach((field) => {
3824
+ if (field.key === key) {
3825
+ formControl = this.form.get(field.key);
3826
+ return;
3827
+ }
3828
+ else if (field.groupFields && field.groupFields.length > 0) {
3829
+ field.groupFields.forEach((groupField) => {
3830
+ if (groupField.key === key) {
3831
+ formControl = this.form.get(field.key + '.' + groupField.key);
3832
+ return;
3833
+ }
3834
+ });
3835
+ }
3836
+ });
3837
+ return formControl;
3838
+ }
3839
+ setSpecialFields(controlFields, dataFields) {
3840
+ // let cf;
3841
+ // for (let index = 0; index < controlFields.length; index++) {
3842
+ // cf = controlFields[index];
3843
+ for (const cf of controlFields) {
3844
+ if (cf.ApiName === 'ObjectMenu') {
3845
+ this.menuField = cf;
3846
+ }
3847
+ else if (cf.ApiName === 'ItemHasActiveCampaign') {
3848
+ this.hasCampaignField = cf;
3849
+ }
3850
+ else if (cf.ApiName === 'ItemIndicatorsWithoutCampaign') {
3851
+ this.indicatorsField = cf;
3852
+ }
3853
+ }
3854
+ // let df;
3855
+ // for (let index = 0; index < dataFields.length; index++) {
3856
+ // df = dataFields[index];
3857
+ for (const df of dataFields) {
3858
+ if (df.ApiName === 'ObjectMenu') {
3859
+ this.menuDataField = df;
3860
+ }
3861
+ else if (df.ApiName === 'ItemHasActiveCampaign') {
3862
+ this.hasCampaignDataField = df;
3863
+ }
3864
+ else if (df.ApiName === 'ItemIndicatorsWithoutCampaign') {
3865
+ this.indicatorsDataField = df;
3866
+ }
3867
+ }
3868
+ if (this.menuField && this.menuDataField) {
3869
+ this.menuDataField.Layout = this.menuField.Layout;
3870
+ }
3871
+ if (this.hasCampaignField && this.hasCampaignDataField) {
3872
+ this.hasCampaignDataField.Layout = this.hasCampaignField.Layout;
3873
+ }
3874
+ if (this.indicatorsField && this.indicatorsDataField) {
3875
+ this.indicatorsDataField.Layout = this.indicatorsField.Layout;
3876
+ }
3877
+ // Check if menu is floating on other field.
3878
+ // for (let index = 0; index < controlFields.length; index++) {
3879
+ // cf = controlFields[index];
3880
+ for (const cf of controlFields) {
3881
+ if (this.menuField && cf.ApiName !== 'ObjectMenu') {
3882
+ this.hasMenuFloatingOnOtherField = this.doesFieldHavaFloatingField(cf, this.menuField);
3883
+ if (this.hasMenuFloatingOnOtherField) {
3884
+ break;
3885
+ }
3886
+ }
3887
+ }
3888
+ }
3889
+ convertCustomFields(controlFields, dataFields) {
3890
+ if (this.layoutType !== 'table') {
3891
+ this.setSpecialFields(controlFields, dataFields);
3892
+ }
3893
+ else {
3894
+ // HACK: convert to center alignment if table view & special fields)
3895
+ controlFields.forEach((field, index) => {
3896
+ if (field.ApiName === 'UnitsQuantity' ||
3897
+ field.ApiName === 'QuantitySelector' ||
3898
+ field.ApiName === 'ObjectMenu' ||
3899
+ field.FieldType === FIELD_TYPE.Image ||
3900
+ field.FieldType === FIELD_TYPE.ImageURL ||
3901
+ field.FieldType === FIELD_TYPE.Indicators ||
3902
+ field.FieldType === FIELD_TYPE.Boolean ||
3903
+ field.FieldType === FIELD_TYPE.CalculatedBool ||
3904
+ field.FieldType === FIELD_TYPE.Signature ||
3905
+ field.FieldType ===
3906
+ FIELD_TYPE.NumberIntegerQuantitySelector ||
3907
+ field.FieldType === FIELD_TYPE.NumberRealQuantitySelector ||
3908
+ field.FieldType === FIELD_TYPE.Package ||
3909
+ field.FieldType === FIELD_TYPE.NumberIntegerForMatrix ||
3910
+ field.FieldType === FIELD_TYPE.NumberRealForMatrix) {
3911
+ field.Layout.XAlignment = X_ALIGNMENT_TYPE.Center;
3912
+ }
3913
+ else {
3914
+ // HACK: align the rest of the fields by the culture.
3915
+ // field.Layout.XAlignment = this.layoutService.isRtl() ? X_ALIGNMENT_TYPE.Right : X_ALIGNMENT_TYPE.Left;
3916
+ }
3917
+ });
3918
+ }
3919
+ const fields = [];
3920
+ controlFields.forEach((field, index) => {
3921
+ const dataField = dataFields.filter((df) => df.ApiName === field.ApiName)[0];
3922
+ if (!dataField) {
3923
+ return;
3924
+ }
3925
+ // If current view is not table view and those fields are special.
3926
+ if (this.layoutType !== 'table' &&
3927
+ ((this.hasMenuFloatingOnOtherField &&
3928
+ this.menuField &&
3929
+ this.menuField.ApiName === field.ApiName) ||
3930
+ (this.indicatorsField &&
3931
+ this.indicatorsField.ApiName === field.ApiName) ||
3932
+ (this.hasCampaignField &&
3933
+ this.hasCampaignField.ApiName === field.ApiName))) {
3934
+ return;
3935
+ }
3936
+ // Set type to link
3937
+ if (index === 0 && this.firstFieldAsLink) {
3938
+ dataField.FieldType = FIELD_TYPE.InternalLink;
3939
+ // dataField.Value = this.getInternalLinkHref();
3940
+ }
3941
+ if (field.ApiName === 'ObjectMenu') {
3942
+ dataField.Enabled = true;
3943
+ // HACK : Until "Enabled" returns from the server, we set PepMenu to be
3944
+ // Disabled in cart on regular items and not campign items.
3945
+ }
3946
+ const customField = this.createBaseField(field, dataField);
3947
+ fields.push(customField);
3948
+ });
3949
+ return fields.sort((f1, f2) => f1.row > f2.row
3950
+ ? 1
3951
+ : f1.row < f2.row
3952
+ ? -1
3953
+ : f1.col > f2.col
3954
+ ? 1
3955
+ : f1.col < f2.col
3956
+ ? -1
3957
+ : 0);
3958
+ }
3959
+ onFormValidationChanged(formValidationChange) {
3960
+ this.formValidationChange.emit(formValidationChange);
3961
+ }
3962
+ onValueChanged(event) {
3963
+ this.onFormValidationChanged(this.form.valid);
3964
+ const formControl = this.getFormControlById(event.key);
3965
+ const isValid = formControl ? formControl.valid : true;
3966
+ // const isValid = true;
3967
+ // If isValid || event.value === '' for init the field if the user want.
3968
+ if (isValid || event.value === '') {
3969
+ // Set it to false to disable all fields.
3970
+ if (this.isInternal && this.layoutType === 'form') {
3971
+ this.isLocked = true;
3972
+ }
3973
+ // Update the current field value.
3974
+ const currentField = this.fields.find((f) => f.key === event.key);
3975
+ if (currentField) {
3976
+ currentField.formattedValue = currentField.value = event.value;
3977
+ }
3978
+ this.valueChange.emit({
3979
+ id: this.data.UID.toString(),
3980
+ uiObjectKey: this.data.Key,
3981
+ key: event.key,
3982
+ value: event.value,
3983
+ controlType: event.controlType,
3984
+ });
3985
+ }
3986
+ }
3987
+ onClick(fieldClickEvent) {
3988
+ const clickedUiControlField = this.data.Fields.filter((f) => f.ApiName === fieldClickEvent.key)[0];
3989
+ const idType = this.data.Type ? this.data.Type.toString() : '';
3990
+ if (clickedUiControlField) {
3991
+ this.fieldClick.emit({
3992
+ id: this.data.UID.toString(),
3993
+ uiObjectKey: this.data.Key,
3994
+ key: fieldClickEvent.key,
3995
+ idType,
3996
+ which: fieldClickEvent.eventWhich,
3997
+ value: fieldClickEvent.value,
3998
+ controlType: fieldClickEvent.controlType,
3999
+ fieldType: clickedUiControlField.FieldType,
4000
+ otherData: fieldClickEvent.otherData,
4001
+ });
4002
+ }
4003
+ else {
4004
+ // For other api names (like enter children etc).
4005
+ this.fieldClick.emit({
4006
+ id: this.data.UID.toString(),
4007
+ uiObjectKey: this.data.Key,
4008
+ key: fieldClickEvent.key,
4009
+ idType,
4010
+ which: fieldClickEvent.eventWhich,
4011
+ value: fieldClickEvent.value,
4012
+ controlType: fieldClickEvent.controlType,
4013
+ otherData: fieldClickEvent.otherData,
4014
+ });
4015
+ }
4016
+ }
4017
+ // This event is for handle the internal page events.
4018
+ onInternalFormFieldClicked(internalFormFieldClick) {
4019
+ this.internalFormFieldClick.emit(internalFormFieldClick);
4020
+ }
4021
+ // This event is for handle the internal page events.
4022
+ onInternalFormFieldChanged(internalFormFieldChange) {
4023
+ this.internalFormFieldChange.emit(internalFormFieldChange);
4024
+ }
4025
+ // This event is for handle the related items change events.
4026
+ onFormValueChanged(event) {
4027
+ // this.valueChange.emit(event);
4028
+ }
4029
+ // This event is for handle the related items change events.
4030
+ onFormFieldClick(event) {
4031
+ this.fieldClick.emit(event);
4032
+ }
4033
+ }
4034
+ PepFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFormComponent, deps: [{ token: i1$2.PepDialogService }, { token: i1$1.PepCustomizationService }, { token: i1$1.PepLayoutService }, { token: i3$1.FormBuilder }, { token: i0.KeyValueDiffers }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
4035
+ PepFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepFormComponent, selector: "pep-form", inputs: { isInternal: "isInternal", isReport: "isReport", layout: "layout", lockEvents: "lockEvents", canEditObject: "canEditObject", data: "data", lockFields: "lockFields", isActive: "isActive", layoutType: "layoutType", objectId: "objectId", parentId: "parentId", searchCode: "searchCode", showTitle: "showTitle", firstFieldAsLink: "firstFieldAsLink", checkForChanges: "checkForChanges" }, outputs: { valueChange: "valueChange", formValidationChange: "formValidationChange", fieldClick: "fieldClick", internalFormFieldClick: "internalFormFieldClick", internalFormFieldChange: "internalFormFieldChange" }, usesOnChanges: true, ngImport: i0, template: "<fieldset *ngIf=\"form\" [formGroup]=\"form\" [disabled]=\"isLocked\" class=\"pep-form\"\n [ngStyle]=\"{ 'background-color': layoutType == 'card' && data?.BackgroundColor }\">\n <!-- New Form -->\n <mat-grid-list *ngIf=\"layoutType == 'form'\" [cols]=\"columns\" [rowHeight]=\"rowHeight + 'rem'\"\n [gutterSize]=\"formGutterSize\">\n <mat-grid-tile *ngFor=\"let field of fields$ | async\" [rowspan]=\"field.rowSpan\" [colspan]=\"field.colSpan\">\n <pep-field-generator *ngIf=\"field.controlType != 'placeholder'\" [form]=\"form\" [layoutType]=\"layoutType\"\n [checkForChanges]=\"checkForChanges\" [uid]=\"data?.UID\" [field]=\"field\" [showTitle]=\"showTitle\"\n (valueChange)=\"onValueChanged($event)\" (elementClick)=\"onClick($event)\"\n (internalFormFieldClick)=\"onInternalFormFieldClicked($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\"\n >\n </pep-field-generator>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n </mat-grid-tile>\n </mat-grid-list>\n\n <!-- Thumbnails -->\n <mat-grid-list *ngIf=\"layoutType == 'card'\" [cols]=\"columns\" [rowHeight]=\"rowHeight + 'rem'\"\n [gutterSize]=\"cardGutterSize\" class=\"card-spacing\">\n <mat-grid-tile *ngFor=\"let field of fields$ | async\" [rowspan]=\"field.rowSpan\" [colspan]=\"field.colSpan\"\n [ngStyle]=\"{ overflow: field.type == 'qs' ? 'unset' : 'hidden' }\">\n <pep-field-generator *ngIf=\"field.controlType != 'placeholder'\" [form]=\"form\" [layoutType]=\"layoutType\"\n [ngClass]=\"{ 'lock-events': lockEvents }\" [isActive]=\"isActive\" [checkForChanges]=\"checkForChanges\"\n [uid]=\"data?.UID\" [field]=\"field\" [showTitle]=\"showTitle\" (valueChange)=\"onValueChanged($event)\"\n (elementClick)=\"onClick($event)\" (internalFormFieldClick)=\"onInternalFormFieldClicked($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\">\n </pep-field-generator>\n </mat-grid-tile>\n </mat-grid-list>\n\n <ng-container *ngIf=\"layoutType == 'table'\">\n <ng-container *ngIf=\"isReport; then reportBlock; else notReportBlock\"></ng-container>\n <ng-template #reportBlock>\n <ng-container *ngTemplateOutlet=\"report\"></ng-container>\n </ng-template>\n <ng-template #notReportBlock>\n <div *ngFor=\"let field of fields$ | async; let j = index\" class=\"pull-left flip table-cell \"\n [ngClass]=\"['text-align-' + field.xAlignment]\" style=\"height: 100%\"\n [ngStyle]=\"{ width: (layout?.ControlFields)[j]?.calcColumnWidthString}\">\n <pep-field-generator *ngIf=\"field.controlType != 'placeholder'\" [checkForChanges]=\"checkForChanges\"\n [uid]=\"data?.UID\" [field]=\"field\" [form]=\"form\" [layoutType]=\"layoutType\" [showTitle]=\"false\"\n (elementClick)=\"onClick($event)\" (valueChange)=\"onValueChanged($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\"\n [isActive]=\"isActive\">\n </pep-field-generator>\n </div>\n </ng-template>\n </ng-container>\n\n <!------- For testing ------------\n {{ form.value | json }}\n {{ form.valid }}\n ---------------------------------->\n</fieldset>\n\n<ng-template #report>\n <div *ngFor=\"let field of fields$ | async; let j = index\" class=\"pull-left flip pep-report-fields\"\n [ngStyle]=\"{ width: (layout?.ControlFields)[j]?.calcColumnWidthString }\"\n [ngClass]=\"['text-align-' + field.xAlignment]\">\n <ng-container [ngSwitch]=\"field.controlType\">\n <pep-image *ngSwitchCase=\"'image'\" [uid]=\"data?.UID\" [form]=\"form\" [key]=\"field.key\"\n [src]=\"field.formattedValue\" [srcLarge]=\"field.value\" [options]=\"field.options\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [layoutType]=\"layoutType\"\n (elementClick)=\"onClick($event)\">\n </pep-image>\n\n <pep-signature *ngSwitchCase=\"'signature'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\">\n </pep-signature>\n\n <pep-checkbox *ngSwitchCase=\"'checkbox'\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"(field.value?.toString() | lowercase) == 'true' || field.value == '1' ? true : false\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [additionalValue]=\"field.additionalValue\" [layoutType]=\"layoutType\">\n </pep-checkbox>\n\n <pep-date *ngSwitchCase=\"'date'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [minValue]=\"field.minValue\" [maxValue]=\"field.maxValue\" [layoutType]=\"layoutType\">\n </pep-date>\n\n <pep-internal-button *ngSwitchCase=\"'button'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\" [type]=\"field.type\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [layoutType]=\"layoutType\" (elementClick)=\"onClick($event)\">\n </pep-internal-button>\n\n <pep-textarea *ngSwitchCase=\"'textarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [maxFieldCharacters]=\"field.maxFieldCharacters\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\">\n </pep-textarea>\n\n <pep-quantity-selector *ngSwitchCase=\"'qs'\" [id]=\"field.key\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"field.value\" [label]=\"field.label\" [type]=\"field.type\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\" (valueChange)=\"onValueChanged($event)\" (elementClick)=\"onClick($event)\">\n </pep-quantity-selector>\n\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"field.formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\">\n </ng-container>\n <ng-template #notEmptyBlock>\n <ng-container\n *ngIf=\"field.controlType === 'attachment' || field.type === 'link'; then linkBlock; else notLinkBlock\">\n </ng-container>\n <ng-template #linkBlock>\n <a [id]=\"field.key\" class=\"color-link body-sm pep-report-input readonly\"\n *ngIf=\"field.formattedValue != null\" title=\"{{ field.formattedValue }}\" target=\"_blank\"\n href=\"{{ field.value }}\">{{ field.formattedValue }}</a>\n </ng-template>\n <ng-template #notLinkBlock>\n <span [id]=\"field.key\" class=\"body-sm pep-report-input readonly\"\n title=\"{{ field.formattedValue }}\" [ngStyle]=\"{ color: field.textColor }\">{{\n field.formattedValue }}</span>\n </ng-template>\n </ng-template>\n <ng-template #emptyBlock>\n <span>&nbsp;</span>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>", styles: [":host{display:grid}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i5.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i6$1.MatGridList, selector: "mat-grid-list", inputs: ["cols", "gutterSize", "rowHeight"], exportAs: ["matGridList"] }, { kind: "component", type: i6$1.MatGridTile, selector: "mat-grid-tile", inputs: ["rowspan", "colspan"], exportAs: ["matGridTile"] }, { kind: "component", type: i5$2.PepCheckboxComponent, selector: "pep-checkbox", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "additionalValue", "form", "isActive", "showTitle", "renderTitle", "layoutType", "visible"], outputs: ["valueChange"] }, { kind: "component", type: i6.PepDateComponent, selector: "pep-date", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "visible", "minValue", "maxValue", "minDateValue", "maxDateValue", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType"], outputs: ["valueChange"] }, { kind: "component", type: i7$1.PepImageComponent, selector: "pep-image", inputs: ["key", "srcLarge", "src", "options", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "indicatorsField", "menuField", "hasCampaignField", "visible", "form", "uid", "showTitle", "renderTitle", "layoutType", "isActive", "sizeLimitMB", "acceptImagesType", "handleActions", "hint"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i9.PepQuantitySelectorComponent, selector: "pep-quantity-selector", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "allowDecimal", "additionalValue", "notificationInfo", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "styleType", "isInFocus"], outputs: ["valueChange", "elementClick"] }, { kind: "component", type: i13.PepSignatureComponent, selector: "pep-signature", inputs: ["key", "src", "label", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "signatureURL", "visible", "form", "showTitle", "renderTitle", "layoutType", "isActive", "handleActions"], outputs: ["chooseFile", "fileChange", "elementClick"] }, { kind: "component", type: i14.PepTextareaComponent, selector: "pep-textarea", inputs: ["key", "value", "label", "mandatory", "disabled", "readonly", "maxFieldCharacters", "textColor", "xAlignment", "rowSpan", "visible", "form", "isActive", "showTitle", "renderTitle", "layoutType"], outputs: ["valueChange", "keyup"] }, { kind: "component", type: PepFieldGeneratorComponent, selector: "pep-field-generator", inputs: ["field", "isActive", "uid", "form", "layoutType", "showTitle", "checkForChanges"], outputs: ["valueChange", "elementClick", "internalFormFieldChange", "internalFormFieldClick", "formValueChange", "formFieldClick"] }, { kind: "component", type: PepInternalButtonComponent, selector: "pep-internal-button", inputs: ["key", "value", "formattedValue", "label", "referenceObjectInternalType", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "visible", "form", "showTitle", "layoutType"], outputs: ["elementClick", "valueChange"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.LowerCasePipe, name: "lowercase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFormComponent, decorators: [{
4037
+ type: Component,
4038
+ args: [{ selector: 'pep-form', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fieldset *ngIf=\"form\" [formGroup]=\"form\" [disabled]=\"isLocked\" class=\"pep-form\"\n [ngStyle]=\"{ 'background-color': layoutType == 'card' && data?.BackgroundColor }\">\n <!-- New Form -->\n <mat-grid-list *ngIf=\"layoutType == 'form'\" [cols]=\"columns\" [rowHeight]=\"rowHeight + 'rem'\"\n [gutterSize]=\"formGutterSize\">\n <mat-grid-tile *ngFor=\"let field of fields$ | async\" [rowspan]=\"field.rowSpan\" [colspan]=\"field.colSpan\">\n <pep-field-generator *ngIf=\"field.controlType != 'placeholder'\" [form]=\"form\" [layoutType]=\"layoutType\"\n [checkForChanges]=\"checkForChanges\" [uid]=\"data?.UID\" [field]=\"field\" [showTitle]=\"showTitle\"\n (valueChange)=\"onValueChanged($event)\" (elementClick)=\"onClick($event)\"\n (internalFormFieldClick)=\"onInternalFormFieldClicked($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\"\n >\n </pep-field-generator>\n <!-- (formValidationChange)=\"onFormValidationChanged($event)\" -->\n </mat-grid-tile>\n </mat-grid-list>\n\n <!-- Thumbnails -->\n <mat-grid-list *ngIf=\"layoutType == 'card'\" [cols]=\"columns\" [rowHeight]=\"rowHeight + 'rem'\"\n [gutterSize]=\"cardGutterSize\" class=\"card-spacing\">\n <mat-grid-tile *ngFor=\"let field of fields$ | async\" [rowspan]=\"field.rowSpan\" [colspan]=\"field.colSpan\"\n [ngStyle]=\"{ overflow: field.type == 'qs' ? 'unset' : 'hidden' }\">\n <pep-field-generator *ngIf=\"field.controlType != 'placeholder'\" [form]=\"form\" [layoutType]=\"layoutType\"\n [ngClass]=\"{ 'lock-events': lockEvents }\" [isActive]=\"isActive\" [checkForChanges]=\"checkForChanges\"\n [uid]=\"data?.UID\" [field]=\"field\" [showTitle]=\"showTitle\" (valueChange)=\"onValueChanged($event)\"\n (elementClick)=\"onClick($event)\" (internalFormFieldClick)=\"onInternalFormFieldClicked($event)\"\n (internalFormFieldChange)=\"onInternalFormFieldChanged($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\">\n </pep-field-generator>\n </mat-grid-tile>\n </mat-grid-list>\n\n <ng-container *ngIf=\"layoutType == 'table'\">\n <ng-container *ngIf=\"isReport; then reportBlock; else notReportBlock\"></ng-container>\n <ng-template #reportBlock>\n <ng-container *ngTemplateOutlet=\"report\"></ng-container>\n </ng-template>\n <ng-template #notReportBlock>\n <div *ngFor=\"let field of fields$ | async; let j = index\" class=\"pull-left flip table-cell \"\n [ngClass]=\"['text-align-' + field.xAlignment]\" style=\"height: 100%\"\n [ngStyle]=\"{ width: (layout?.ControlFields)[j]?.calcColumnWidthString}\">\n <pep-field-generator *ngIf=\"field.controlType != 'placeholder'\" [checkForChanges]=\"checkForChanges\"\n [uid]=\"data?.UID\" [field]=\"field\" [form]=\"form\" [layoutType]=\"layoutType\" [showTitle]=\"false\"\n (elementClick)=\"onClick($event)\" (valueChange)=\"onValueChanged($event)\"\n (formValueChange)=\"onFormValueChanged($event)\" (formFieldClick)=\"onFormFieldClick($event)\"\n [isActive]=\"isActive\">\n </pep-field-generator>\n </div>\n </ng-template>\n </ng-container>\n\n <!------- For testing ------------\n {{ form.value | json }}\n {{ form.valid }}\n ---------------------------------->\n</fieldset>\n\n<ng-template #report>\n <div *ngFor=\"let field of fields$ | async; let j = index\" class=\"pull-left flip pep-report-fields\"\n [ngStyle]=\"{ width: (layout?.ControlFields)[j]?.calcColumnWidthString }\"\n [ngClass]=\"['text-align-' + field.xAlignment]\">\n <ng-container [ngSwitch]=\"field.controlType\">\n <pep-image *ngSwitchCase=\"'image'\" [uid]=\"data?.UID\" [form]=\"form\" [key]=\"field.key\"\n [src]=\"field.formattedValue\" [srcLarge]=\"field.value\" [options]=\"field.options\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [layoutType]=\"layoutType\"\n (elementClick)=\"onClick($event)\">\n </pep-image>\n\n <pep-signature *ngSwitchCase=\"'signature'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\">\n </pep-signature>\n\n <pep-checkbox *ngSwitchCase=\"'checkbox'\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"(field.value?.toString() | lowercase) == 'true' || field.value == '1' ? true : false\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [additionalValue]=\"field.additionalValue\" [layoutType]=\"layoutType\">\n </pep-checkbox>\n\n <pep-date *ngSwitchCase=\"'date'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [type]=\"field.type\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [minValue]=\"field.minValue\" [maxValue]=\"field.maxValue\" [layoutType]=\"layoutType\">\n </pep-date>\n\n <pep-internal-button *ngSwitchCase=\"'button'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\" [type]=\"field.type\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [layoutType]=\"layoutType\" (elementClick)=\"onClick($event)\">\n </pep-internal-button>\n\n <pep-textarea *ngSwitchCase=\"'textarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\"\n [readonly]=\"field.readonly\" [maxFieldCharacters]=\"field.maxFieldCharacters\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\">\n </pep-textarea>\n\n <pep-quantity-selector *ngSwitchCase=\"'qs'\" [id]=\"field.key\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"field.value\" [label]=\"field.label\" [type]=\"field.type\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [layoutType]=\"layoutType\" (valueChange)=\"onValueChanged($event)\" (elementClick)=\"onClick($event)\">\n </pep-quantity-selector>\n\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"field.formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\">\n </ng-container>\n <ng-template #notEmptyBlock>\n <ng-container\n *ngIf=\"field.controlType === 'attachment' || field.type === 'link'; then linkBlock; else notLinkBlock\">\n </ng-container>\n <ng-template #linkBlock>\n <a [id]=\"field.key\" class=\"color-link body-sm pep-report-input readonly\"\n *ngIf=\"field.formattedValue != null\" title=\"{{ field.formattedValue }}\" target=\"_blank\"\n href=\"{{ field.value }}\">{{ field.formattedValue }}</a>\n </ng-template>\n <ng-template #notLinkBlock>\n <span [id]=\"field.key\" class=\"body-sm pep-report-input readonly\"\n title=\"{{ field.formattedValue }}\" [ngStyle]=\"{ color: field.textColor }\">{{\n field.formattedValue }}</span>\n </ng-template>\n </ng-template>\n <ng-template #emptyBlock>\n <span>&nbsp;</span>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>", styles: [":host{display:grid}\n"] }]
4039
+ }], ctorParameters: function () { return [{ type: i1$2.PepDialogService }, { type: i1$1.PepCustomizationService }, { type: i1$1.PepLayoutService }, { type: i3$1.FormBuilder }, { type: i0.KeyValueDiffers }, { type: i4$1.TranslateService }]; }, propDecorators: { isInternal: [{
4040
+ type: Input
4041
+ }], isReport: [{
4042
+ type: Input
4043
+ }], layout: [{
4044
+ type: Input
4045
+ }], lockEvents: [{
4046
+ type: Input
4047
+ }], canEditObject: [{
4048
+ type: Input
4049
+ }], data: [{
4050
+ type: Input
4051
+ }], lockFields: [{
4052
+ type: Input
4053
+ }], isActive: [{
4054
+ type: Input
4055
+ }], layoutType: [{
4056
+ type: Input
4057
+ }], objectId: [{
4058
+ type: Input
4059
+ }], parentId: [{
4060
+ type: Input
4061
+ }], searchCode: [{
4062
+ type: Input
4063
+ }], showTitle: [{
4064
+ type: Input
4065
+ }], firstFieldAsLink: [{
4066
+ type: Input
4067
+ }], checkForChanges: [{
4068
+ type: Input
4069
+ }], valueChange: [{
4070
+ type: Output
4071
+ }], formValidationChange: [{
4072
+ type: Output
4073
+ }], fieldClick: [{
4074
+ type: Output
4075
+ }], internalFormFieldClick: [{
4076
+ type: Output
4077
+ }], internalFormFieldChange: [{
4078
+ type: Output
4079
+ }] } });
4080
+
4081
+ const pepComponentsModules = [
4082
+ PepAddressModule,
4083
+ PepAttachmentModule,
4084
+ PepButtonModule,
4085
+ PepCarouselModule,
4086
+ PepCheckboxModule,
4087
+ PepDateModule,
4088
+ PepImageModule,
4089
+ PepImagesFilmstripModule,
4090
+ PepQuantitySelectorModule,
4091
+ PepRichHtmlTextareaModule,
4092
+ PepSelectModule,
4093
+ PepSelectPanelModule,
4094
+ PepSeparatorModule,
4095
+ PepSignatureModule,
4096
+ PepTextareaModule,
4097
+ PepTextboxModule,
4098
+ PepLinkModule
4099
+ ];
4100
+ class PepFormModule {
4101
+ constructor(pepIconRegistry) {
4102
+ this.pepIconRegistry = pepIconRegistry;
4103
+ this.pepIconRegistry.registerIcons([
4104
+ pepIconSystemEdit,
4105
+ pepIconSystemMenu,
4106
+ pepIconNumberPlus,
4107
+ pepIconSystemBin,
4108
+ pepIconIndicatorDotPlaceholder,
4109
+ ]);
4110
+ }
4111
+ }
4112
+ PepFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFormModule, deps: [{ token: i1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
4113
+ PepFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepFormModule, declarations: [PepFormComponent,
4114
+ PepInternalFormComponent,
4115
+ PepFieldGeneratorComponent,
4116
+ PepInternalFieldGeneratorComponent,
4117
+ PepIndicatorsComponent,
4118
+ PepInternalButtonComponent,
4119
+ PepInternalListComponent,
4120
+ PepInternalMenuComponent,
4121
+ PepInternalPageComponent,
4122
+ PepInternalCaruselComponent], imports: [CommonModule,
4123
+ ReactiveFormsModule,
4124
+ // Material modules,
4125
+ MatCommonModule,
4126
+ MatFormFieldModule,
4127
+ MatButtonModule,
4128
+ MatGridListModule,
4129
+ MatIconModule,
4130
+ MatMenuModule,
4131
+ // External modules
4132
+ SignaturePadModule,
4133
+ // ngx-lib modules
4134
+ PepNgxLibModule,
4135
+ PepDialogModule,
4136
+ PepIconModule, PepAddressModule,
4137
+ PepAttachmentModule,
4138
+ PepButtonModule,
4139
+ PepCarouselModule,
4140
+ PepCheckboxModule,
4141
+ PepDateModule,
4142
+ PepImageModule,
4143
+ PepImagesFilmstripModule,
4144
+ PepQuantitySelectorModule,
4145
+ PepRichHtmlTextareaModule,
4146
+ PepSelectModule,
4147
+ PepSelectPanelModule,
4148
+ PepSeparatorModule,
4149
+ PepSignatureModule,
4150
+ PepTextareaModule,
4151
+ PepTextboxModule,
4152
+ PepLinkModule, PepFieldTitleModule,
4153
+ PepGroupButtonsModule], exports: [PepFormComponent] });
4154
+ PepFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFormModule, providers: [
4155
+ FormBuilder
4156
+ ], imports: [CommonModule,
4157
+ ReactiveFormsModule,
4158
+ // Material modules,
4159
+ MatCommonModule,
4160
+ MatFormFieldModule,
4161
+ MatButtonModule,
4162
+ MatGridListModule,
4163
+ MatIconModule,
4164
+ MatMenuModule,
4165
+ // External modules
4166
+ SignaturePadModule,
4167
+ // ngx-lib modules
4168
+ PepNgxLibModule,
4169
+ PepDialogModule,
4170
+ PepIconModule,
4171
+ pepComponentsModules,
4172
+ PepFieldTitleModule,
4173
+ PepGroupButtonsModule] });
4174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFormModule, decorators: [{
4175
+ type: NgModule,
4176
+ args: [{
4177
+ imports: [
4178
+ CommonModule,
4179
+ ReactiveFormsModule,
4180
+ // Material modules,
4181
+ MatCommonModule,
4182
+ MatFormFieldModule,
4183
+ MatButtonModule,
4184
+ MatGridListModule,
4185
+ MatIconModule,
4186
+ MatMenuModule,
4187
+ // External modules
4188
+ SignaturePadModule,
4189
+ // ngx-lib modules
4190
+ PepNgxLibModule,
4191
+ PepDialogModule,
4192
+ PepIconModule,
4193
+ pepComponentsModules,
4194
+ PepFieldTitleModule,
4195
+ PepGroupButtonsModule,
4196
+ ],
4197
+ exports: [PepFormComponent],
4198
+ declarations: [
4199
+ PepFormComponent,
4200
+ PepInternalFormComponent,
4201
+ PepFieldGeneratorComponent,
4202
+ PepInternalFieldGeneratorComponent,
4203
+ PepIndicatorsComponent,
4204
+ PepInternalButtonComponent,
4205
+ PepInternalListComponent,
4206
+ PepInternalMenuComponent,
4207
+ PepInternalPageComponent,
4208
+ PepInternalCaruselComponent
4209
+ ],
4210
+ providers: [
4211
+ FormBuilder
4212
+ ]
4213
+ }]
4214
+ }], ctorParameters: function () { return [{ type: i1.PepIconRegistry }]; } });
4215
+
4216
+ /*
4217
+ * Public API Surface of ngx-lib/form
4218
+ */
4219
+
4220
+ /**
4221
+ * Generated bundle index. Do not edit.
4222
+ */
4223
+
4224
+ export { PepFormComponent, PepFormModule };
4225
+ //# sourceMappingURL=pepperi-addons-ngx-lib-form.mjs.map