@colijnit/sharedcomponents 1.0.25 → 1.0.26

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 (292) hide show
  1. package/README.md +8 -11
  2. package/bundles/colijnit-sharedcomponents.umd.js +3706 -0
  3. package/bundles/colijnit-sharedcomponents.umd.js.map +1 -0
  4. package/colijnit-sharedcomponents.d.ts +16 -0
  5. package/colijnit-sharedcomponents.metadata.json +1 -0
  6. package/esm2015/colijnit-sharedcomponents.js +17 -0
  7. package/esm2015/lib/assets/dictionary/text.properties.js +11 -0
  8. package/esm2015/lib/components/circular-gauge/co-circular-gauge.component.js +126 -0
  9. package/esm2015/lib/components/circular-gauge/co-circular-gauge.module.js +21 -0
  10. package/esm2015/lib/components/docsign/component/signature/signature.component.js +75 -0
  11. package/esm2015/lib/components/docsign/component/signatures/signatures.component.js +44 -0
  12. package/esm2015/lib/components/docsign/docsign.component.js +225 -0
  13. package/esm2015/lib/components/docsign/docsign.module.js +23 -0
  14. package/esm2015/lib/components/key-pad/key-pad.component.js +191 -0
  15. package/esm2015/lib/components/key-pad/key-pad.module.js +21 -0
  16. package/esm2015/lib/components/layout-switcher/layout-switcher.component.js +74 -0
  17. package/esm2015/lib/components/layout-switcher/layout-switcher.module.js +21 -0
  18. package/esm2015/lib/components/linear-gauge/co-linear-gauge.component.js +55 -0
  19. package/esm2015/lib/components/linear-gauge/co-linear-gauge.module.js +19 -0
  20. package/esm2015/lib/components/send-method-dialog/enums/send-option.js +8 -0
  21. package/esm2015/lib/components/send-method-dialog/send-method-dialog.component.js +309 -0
  22. package/esm2015/lib/components/send-method-dialog/send-method-dialog.module.js +31 -0
  23. package/esm2015/lib/components/statusbar/statusbar.component.js +81 -0
  24. package/esm2015/lib/components/statusbar/statusbar.module.js +23 -0
  25. package/esm2015/lib/components/stock/stock-information/stock-information.component.js +54 -0
  26. package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +350 -0
  27. package/esm2015/lib/components/stock/stock-location/stock-location.component.js +62 -0
  28. package/esm2015/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.js +2 -0
  29. package/esm2015/lib/components/stock/stock-transfer/stock-change-amount.component.js +68 -0
  30. package/esm2015/lib/components/stock/stock-transfer/stock-transfer.component.js +130 -0
  31. package/esm2015/lib/components/stock/stock.component.js +140 -0
  32. package/esm2015/lib/components/stock/stock.module.js +48 -0
  33. package/esm2015/lib/enum/icon.enum.js +19 -0
  34. package/esm2015/lib/enum/keyboard-code.enum.js +32 -0
  35. package/esm2015/lib/enum/language-code.enum.js +8 -0
  36. package/esm2015/lib/factory/business-object-factory.js +120 -0
  37. package/esm2015/lib/factory/decorators/boolean.decorator.js +102 -0
  38. package/esm2015/lib/factory/decorators/complex-array.decorator.js +55 -0
  39. package/esm2015/lib/factory/decorators/complex-field.decorator.js +57 -0
  40. package/esm2015/lib/factory/decorators/date-field.decorator.js +36 -0
  41. package/esm2015/lib/factory/decorators/string-number.decorator.js +43 -0
  42. package/esm2015/lib/model/business-object.js +81 -0
  43. package/esm2015/lib/model/icon-svg.js +18 -0
  44. package/esm2015/lib/service/dictionary.service.js +76 -0
  45. package/esm2015/lib/service/icon-cache.service.js +51 -0
  46. package/esm2015/lib/service/options.service.js +71 -0
  47. package/esm2015/lib/service/shared-connector.service.js +278 -0
  48. package/esm2015/lib/service/shared.service.js +30 -0
  49. package/esm2015/lib/service/stock.service.js +95 -0
  50. package/esm2015/lib/utils/array-utils.js +183 -0
  51. package/esm2015/lib/utils/is-nill.function.js +5 -0
  52. package/esm2015/lib/utils/string-utils.js +64 -0
  53. package/esm2015/public-api.js +21 -0
  54. package/fesm2015/colijnit-sharedcomponents.js +3516 -0
  55. package/fesm2015/colijnit-sharedcomponents.js.map +1 -0
  56. package/lib/assets/dictionary/text.properties.d.ts +3 -0
  57. package/lib/components/circular-gauge/co-circular-gauge.component.d.ts +20 -0
  58. package/lib/components/circular-gauge/co-circular-gauge.module.d.ts +2 -0
  59. package/{projects/sharedcomponents/src/lib → lib}/components/circular-gauge/style/_layout.scss +0 -0
  60. package/{projects/sharedcomponents/src/lib → lib}/components/circular-gauge/style/_material-definition.scss +0 -0
  61. package/{projects/sharedcomponents/src/lib → lib}/components/circular-gauge/style/_theme.scss +0 -0
  62. package/{projects/sharedcomponents/src/lib → lib}/components/circular-gauge/style/material.scss +0 -0
  63. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/agenda/style/_layout.scss +0 -0
  64. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/agenda/style/_material-definition.scss +0 -0
  65. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/agenda/style/_theme.scss +0 -0
  66. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/agenda/style/material.scss +0 -0
  67. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/calendar/style/_layout.scss +0 -0
  68. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/calendar/style/_material-definition.scss +0 -0
  69. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/calendar/style/_theme.scss +0 -0
  70. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/calendar/style/material.scss +0 -0
  71. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/style/_layout.scss +0 -0
  72. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/style/_material-definition.scss +0 -0
  73. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/style/_theme.scss +0 -0
  74. package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/style/material.scss +0 -0
  75. package/lib/components/docsign/component/signature/signature.component.d.ts +16 -0
  76. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_layout.scss +0 -0
  77. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_material-definition.scss +0 -0
  78. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_theme.scss +0 -0
  79. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/material.scss +0 -0
  80. package/lib/components/docsign/component/signatures/signatures.component.d.ts +12 -0
  81. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_layout.scss +0 -0
  82. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_material-definition.scss +0 -0
  83. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_theme.scss +0 -0
  84. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/material.scss +0 -0
  85. package/lib/components/docsign/docsign.component.d.ts +92 -0
  86. package/lib/components/docsign/docsign.module.d.ts +2 -0
  87. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_layout.scss +0 -0
  88. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_material-definition.scss +0 -0
  89. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_theme.scss +0 -0
  90. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/material.scss +0 -0
  91. package/lib/components/key-pad/key-pad.component.d.ts +36 -0
  92. package/lib/components/key-pad/key-pad.module.d.ts +2 -0
  93. package/{projects/sharedcomponents/src/lib → lib}/components/key-pad/style/_layout.scss +0 -0
  94. package/{projects/sharedcomponents/src/lib → lib}/components/key-pad/style/_material-definition.scss +0 -0
  95. package/{projects/sharedcomponents/src/lib → lib}/components/key-pad/style/_theme.scss +0 -0
  96. package/{projects/sharedcomponents/src/lib → lib}/components/key-pad/style/material.scss +0 -0
  97. package/lib/components/layout-switcher/layout-switcher.component.d.ts +16 -0
  98. package/lib/components/layout-switcher/layout-switcher.module.d.ts +2 -0
  99. package/{projects/sharedcomponents/src/lib → lib}/components/layout-switcher/style/_layout.scss +0 -0
  100. package/{projects/sharedcomponents/src/lib → lib}/components/layout-switcher/style/_material-definition.scss +0 -0
  101. package/{projects/sharedcomponents/src/lib → lib}/components/layout-switcher/style/_theme.scss +0 -0
  102. package/{projects/sharedcomponents/src/lib → lib}/components/layout-switcher/style/material.scss +0 -0
  103. package/lib/components/linear-gauge/co-linear-gauge.component.d.ts +16 -0
  104. package/lib/components/linear-gauge/co-linear-gauge.module.d.ts +2 -0
  105. package/{projects/sharedcomponents/src/lib → lib}/components/linear-gauge/style/_layout.scss +0 -0
  106. package/{projects/sharedcomponents/src/lib → lib}/components/linear-gauge/style/_material-definition.scss +0 -0
  107. package/{projects/sharedcomponents/src/lib → lib}/components/linear-gauge/style/_theme.scss +0 -0
  108. package/{projects/sharedcomponents/src/lib → lib}/components/linear-gauge/style/material.scss +0 -0
  109. package/lib/components/send-method-dialog/enums/send-option.d.ts +6 -0
  110. package/lib/components/send-method-dialog/send-method-dialog.component.d.ts +62 -0
  111. package/lib/components/send-method-dialog/send-method-dialog.module.d.ts +2 -0
  112. package/{projects/sharedcomponents/src/lib → lib}/components/send-method-dialog/style/_layout.scss +0 -0
  113. package/{projects/sharedcomponents/src/lib → lib}/components/send-method-dialog/style/_material-definition.scss +0 -0
  114. package/{projects/sharedcomponents/src/lib → lib}/components/send-method-dialog/style/_theme.scss +0 -0
  115. package/{projects/sharedcomponents/src/lib → lib}/components/send-method-dialog/style/material.scss +0 -0
  116. package/lib/components/statusbar/statusbar.component.d.ts +22 -0
  117. package/lib/components/statusbar/statusbar.module.d.ts +2 -0
  118. package/{projects/sharedcomponents/src/lib → lib}/components/statusbar/style/_layout.scss +0 -0
  119. package/{projects/sharedcomponents/src/lib → lib}/components/statusbar/style/_material-definition.scss +0 -0
  120. package/{projects/sharedcomponents/src/lib → lib}/components/statusbar/style/_theme.scss +0 -0
  121. package/{projects/sharedcomponents/src/lib → lib}/components/statusbar/style/material.scss +0 -0
  122. package/lib/components/stock/stock-information/stock-information.component.d.ts +10 -0
  123. package/lib/components/stock/stock-information-grid/stock-information-grid.component.d.ts +60 -0
  124. package/lib/components/stock/stock-location/stock-location.component.d.ts +15 -0
  125. package/{projects/sharedcomponents/src/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.ts → lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.d.ts} +2 -2
  126. package/lib/components/stock/stock-transfer/stock-change-amount.component.d.ts +18 -0
  127. package/lib/components/stock/stock-transfer/stock-transfer.component.d.ts +36 -0
  128. package/lib/components/stock/stock.component.d.ts +42 -0
  129. package/lib/components/stock/stock.module.d.ts +2 -0
  130. package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/_layout.scss +0 -0
  131. package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/_material-definition.scss +0 -0
  132. package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/_theme.scss +0 -0
  133. package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/material.scss +0 -0
  134. package/{projects/sharedcomponents/src/lib/enum/icon.enum.ts → lib/enum/icon.enum.d.ts} +2 -3
  135. package/lib/enum/keyboard-code.enum.d.ts +30 -0
  136. package/lib/enum/language-code.enum.d.ts +6 -0
  137. package/lib/factory/business-object-factory.d.ts +23 -0
  138. package/lib/factory/decorators/boolean.decorator.d.ts +43 -0
  139. package/lib/factory/decorators/complex-array.decorator.d.ts +25 -0
  140. package/lib/factory/decorators/complex-field.decorator.d.ts +25 -0
  141. package/lib/factory/decorators/date-field.decorator.d.ts +17 -0
  142. package/lib/factory/decorators/string-number.decorator.d.ts +22 -0
  143. package/lib/model/business-object.d.ts +7 -0
  144. package/lib/model/icon-svg.d.ts +4 -0
  145. package/lib/service/dictionary.service.d.ts +21 -0
  146. package/lib/service/icon-cache.service.d.ts +18 -0
  147. package/lib/service/options.service.d.ts +13 -0
  148. package/lib/service/shared-connector.service.d.ts +43 -0
  149. package/lib/service/shared.service.d.ts +8 -0
  150. package/lib/service/stock.service.d.ts +38 -0
  151. package/{projects/sharedcomponents/src/lib → lib}/style/_mixin.scss +0 -0
  152. package/{projects/sharedcomponents/src/lib → lib}/style/_variables.scss +0 -0
  153. package/{projects/sharedcomponents/src/lib → lib}/style/sharedcomponents-globals.scss +0 -0
  154. package/lib/utils/array-utils.d.ts +57 -0
  155. package/lib/utils/is-nill.function.d.ts +1 -0
  156. package/lib/utils/string-utils.d.ts +22 -0
  157. package/package.json +26 -74
  158. package/{projects/sharedcomponents/src/public-api.ts → public-api.d.ts} +0 -5
  159. package/.browserslistrc +0 -16
  160. package/.editorconfig +0 -16
  161. package/.vscode/extensions.json +0 -4
  162. package/.vscode/launch.json +0 -20
  163. package/.vscode/tasks.json +0 -42
  164. package/Sharedcomponents.iml +0 -11
  165. package/angular.json +0 -133
  166. package/karma.conf.js +0 -44
  167. package/move-assets.js +0 -14
  168. package/projects/sharedcomponents/.browserslistrc +0 -16
  169. package/projects/sharedcomponents/README.md +0 -24
  170. package/projects/sharedcomponents/karma.conf.js +0 -44
  171. package/projects/sharedcomponents/ng-package.json +0 -17
  172. package/projects/sharedcomponents/package.json +0 -18
  173. package/projects/sharedcomponents/src/lib/assets/dictionary/text.properties.ts +0 -8
  174. package/projects/sharedcomponents/src/lib/assets/icons/angle_left_solid.svg +0 -1
  175. package/projects/sharedcomponents/src/lib/assets/icons/angle_right_solid.svg +0 -1
  176. package/projects/sharedcomponents/src/lib/assets/icons/arrow_fat_right.svg +0 -1
  177. package/projects/sharedcomponents/src/lib/assets/icons/arrow_point_left.svg +0 -8
  178. package/projects/sharedcomponents/src/lib/assets/icons/arrow_point_right.svg +0 -4
  179. package/projects/sharedcomponents/src/lib/assets/icons/bring_forward_regular.svg +0 -1
  180. package/projects/sharedcomponents/src/lib/assets/icons/check_round.svg +0 -1
  181. package/projects/sharedcomponents/src/lib/assets/icons/delete_left_regular.svg +0 -1
  182. package/projects/sharedcomponents/src/lib/assets/icons/delivery_truck.svg +0 -12
  183. package/projects/sharedcomponents/src/lib/assets/icons/email.svg +0 -5
  184. package/projects/sharedcomponents/src/lib/assets/icons/pdf.svg +0 -15
  185. package/projects/sharedcomponents/src/lib/assets/icons/print.svg +0 -10
  186. package/projects/sharedcomponents/src/lib/assets/icons/signature_field.svg +0 -9
  187. package/projects/sharedcomponents/src/lib/assets/icons/xml.svg +0 -9
  188. package/projects/sharedcomponents/src/lib/components/circular-gauge/co-circular-gauge.component.ts +0 -139
  189. package/projects/sharedcomponents/src/lib/components/circular-gauge/co-circular-gauge.module.ts +0 -19
  190. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-base-view.component.ts +0 -68
  191. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-day-view.component.ts +0 -31
  192. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-event.component.ts +0 -67
  193. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-events.component.ts +0 -48
  194. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-half-hour-cell.component.ts +0 -81
  195. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-header.component.ts +0 -265
  196. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-hour-cell.component.ts +0 -38
  197. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-hour-view-labels.component.ts +0 -50
  198. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-hour-view.component.ts +0 -46
  199. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-month-view.component.ts +0 -65
  200. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-view.component.ts +0 -38
  201. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-week-select-view.component.ts +0 -63
  202. package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-week-view.component.ts +0 -46
  203. package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar-all-months.component.ts +0 -37
  204. package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar-all-years.component.ts +0 -52
  205. package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar-header.component.ts +0 -124
  206. package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar-view.component.ts +0 -201
  207. package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar.component.ts +0 -35
  208. package/projects/sharedcomponents/src/lib/components/date-planning/date-planning.component.ts +0 -133
  209. package/projects/sharedcomponents/src/lib/components/date-planning/date-planning.module.ts +0 -56
  210. package/projects/sharedcomponents/src/lib/components/docsign/component/signature/signature.component.ts +0 -82
  211. package/projects/sharedcomponents/src/lib/components/docsign/component/signatures/signatures.component.ts +0 -50
  212. package/projects/sharedcomponents/src/lib/components/docsign/docsign.component.ts +0 -252
  213. package/projects/sharedcomponents/src/lib/components/docsign/docsign.module.ts +0 -22
  214. package/projects/sharedcomponents/src/lib/components/key-pad/key-pad.component.ts +0 -205
  215. package/projects/sharedcomponents/src/lib/components/key-pad/key-pad.module.ts +0 -19
  216. package/projects/sharedcomponents/src/lib/components/layout-switcher/layout-switcher.component.ts +0 -98
  217. package/projects/sharedcomponents/src/lib/components/layout-switcher/layout-switcher.module.ts +0 -21
  218. package/projects/sharedcomponents/src/lib/components/linear-gauge/co-linear-gauge.component.ts +0 -56
  219. package/projects/sharedcomponents/src/lib/components/linear-gauge/co-linear-gauge.module.ts +0 -17
  220. package/projects/sharedcomponents/src/lib/components/send-method-dialog/enums/send-option.ts +0 -6
  221. package/projects/sharedcomponents/src/lib/components/send-method-dialog/send-method-dialog.component.ts +0 -342
  222. package/projects/sharedcomponents/src/lib/components/send-method-dialog/send-method-dialog.module.ts +0 -33
  223. package/projects/sharedcomponents/src/lib/components/statusbar/statusbar.component.ts +0 -97
  224. package/projects/sharedcomponents/src/lib/components/statusbar/statusbar.module.ts +0 -21
  225. package/projects/sharedcomponents/src/lib/components/stock/stock-in-order/stock-in-order.component.ts +0 -0
  226. package/projects/sharedcomponents/src/lib/components/stock/stock-information/stock-information.component.ts +0 -64
  227. package/projects/sharedcomponents/src/lib/components/stock/stock-information-grid/stock-information-grid.component.ts +0 -384
  228. package/projects/sharedcomponents/src/lib/components/stock/stock-location/stock-location.component.ts +0 -84
  229. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/stock-change-amount.component.ts +0 -73
  230. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/stock-transfer.component.ts +0 -153
  231. package/projects/sharedcomponents/src/lib/components/stock/stock.component.ts +0 -165
  232. package/projects/sharedcomponents/src/lib/components/stock/stock.module.ts +0 -51
  233. package/projects/sharedcomponents/src/lib/enum/calendar-view.enum.ts +0 -6
  234. package/projects/sharedcomponents/src/lib/enum/keyboard-code.enum.ts +0 -30
  235. package/projects/sharedcomponents/src/lib/enum/language-code.enum.ts +0 -6
  236. package/projects/sharedcomponents/src/lib/enum/month.enum.ts +0 -15
  237. package/projects/sharedcomponents/src/lib/enum/time-period.enum.ts +0 -9
  238. package/projects/sharedcomponents/src/lib/factory/business-object-factory.ts +0 -120
  239. package/projects/sharedcomponents/src/lib/factory/decorators/boolean.decorator.ts +0 -113
  240. package/projects/sharedcomponents/src/lib/factory/decorators/complex-array.decorator.ts +0 -61
  241. package/projects/sharedcomponents/src/lib/factory/decorators/complex-field.decorator.ts +0 -63
  242. package/projects/sharedcomponents/src/lib/factory/decorators/date-field.decorator.ts +0 -41
  243. package/projects/sharedcomponents/src/lib/factory/decorators/string-number.decorator.ts +0 -48
  244. package/projects/sharedcomponents/src/lib/model/agenda-event-per-day.model.ts +0 -6
  245. package/projects/sharedcomponents/src/lib/model/agenda-event.model.ts +0 -17
  246. package/projects/sharedcomponents/src/lib/model/agenda-null-objects.ts +0 -11
  247. package/projects/sharedcomponents/src/lib/model/business-object.ts +0 -85
  248. package/projects/sharedcomponents/src/lib/model/constant/all-months.ts +0 -17
  249. package/projects/sharedcomponents/src/lib/model/date-range.ts +0 -10
  250. package/projects/sharedcomponents/src/lib/model/day.model.ts +0 -9
  251. package/projects/sharedcomponents/src/lib/model/icon-svg.ts +0 -18
  252. package/projects/sharedcomponents/src/lib/model/month.model.ts +0 -11
  253. package/projects/sharedcomponents/src/lib/model/time-window.bo.ts +0 -21
  254. package/projects/sharedcomponents/src/lib/model/week.model.ts +0 -5
  255. package/projects/sharedcomponents/src/lib/model/weekday.model.ts +0 -17
  256. package/projects/sharedcomponents/src/lib/pipe/array-number.pipe.ts +0 -14
  257. package/projects/sharedcomponents/src/lib/pipe/master-pipes.ts +0 -7
  258. package/projects/sharedcomponents/src/lib/pipe/ucfirst.pipe.ts +0 -14
  259. package/projects/sharedcomponents/src/lib/service/dictionary.service.ts +0 -86
  260. package/projects/sharedcomponents/src/lib/service/icon-cache.service.ts +0 -51
  261. package/projects/sharedcomponents/src/lib/service/options.service.ts +0 -66
  262. package/projects/sharedcomponents/src/lib/service/shared-connector.service.ts +0 -258
  263. package/projects/sharedcomponents/src/lib/service/shared-initializer.service.ts +0 -29
  264. package/projects/sharedcomponents/src/lib/service/shared.service.ts +0 -21
  265. package/projects/sharedcomponents/src/lib/service/stock.service.ts +0 -95
  266. package/projects/sharedcomponents/src/lib/utils/array-utils.ts +0 -202
  267. package/projects/sharedcomponents/src/lib/utils/calendar.utils.ts +0 -75
  268. package/projects/sharedcomponents/src/lib/utils/date-utils.ts +0 -302
  269. package/projects/sharedcomponents/src/lib/utils/function/not-nill.function.ts +0 -4
  270. package/projects/sharedcomponents/src/lib/utils/is-nill.function.ts +0 -4
  271. package/projects/sharedcomponents/src/lib/utils/string-utils.ts +0 -67
  272. package/projects/sharedcomponents/src/test.ts +0 -27
  273. package/projects/sharedcomponents/tsconfig.lib.json +0 -18
  274. package/projects/sharedcomponents/tsconfig.lib.prod.json +0 -10
  275. package/projects/sharedcomponents/tsconfig.spec.json +0 -17
  276. package/script/merge-icons.js +0 -39
  277. package/src/app/app.component.scss +0 -9
  278. package/src/app/app.component.spec.ts +0 -31
  279. package/src/app/app.component.ts +0 -156
  280. package/src/app/app.module.ts +0 -60
  281. package/src/assets/.gitkeep +0 -0
  282. package/src/environments/environment.prod.ts +0 -3
  283. package/src/environments/environment.ts +0 -16
  284. package/src/favicon.ico +0 -0
  285. package/src/index.html +0 -13
  286. package/src/main.ts +0 -12
  287. package/src/polyfills.ts +0 -53
  288. package/src/styles.scss +0 -40
  289. package/src/test.ts +0 -26
  290. package/tsconfig.app.json +0 -15
  291. package/tsconfig.json +0 -65
  292. package/tsconfig.spec.json +0 -18
@@ -0,0 +1,3516 @@
1
+ import { __awaiter } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { EventEmitter, Component, ViewEncapsulation, ViewChild, ElementRef, Input, Output, HostBinding, NgModule, Injectable, ChangeDetectorRef, HostListener } from '@angular/core';
4
+ import { trigger, state, style, transition, animate } from '@angular/animations';
5
+ import { PDFDocument } from 'pdf-lib';
6
+ import * as PDFJS from 'pdfjs-dist/legacy/build/pdf';
7
+ import pdfjsWorker from 'pdfjs-dist/build/pdf.worker.entry';
8
+ import { CommonModule } from '@angular/common';
9
+ import SignaturePad from 'signature_pad';
10
+ import { PrintStockStickers } from '@colijnit/sharedapi/build/model/print-stock-stickers';
11
+ import { PrintPriceStickers } from '@colijnit/sharedapi/build/model/print-price-stickers.bo';
12
+ import { Articles } from '@colijnit/articleapi/build/articles';
13
+ import { Sharedapi } from '@colijnit/sharedapi/build/sharedapi';
14
+ import { Printer } from '@colijnit/sharedapi/build/model/report/printer.bo';
15
+ import { notNill } from '@colijnit/articleapi/build/utils/function/not-nill.function';
16
+ import { ObjectUtils } from '@colijnit/articleapi/build/utils/object-utils';
17
+ import { GetYesNoDbBooleanValue } from '@colijnit/articleapi/build/enum/yes-no-db-type.enum';
18
+ import { GetTrueFalseDbBooleanValue } from '@colijnit/articleapi/build/enum/true-false-db-type.enum';
19
+ import { GetOneZeroDbBooleanValue } from '@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum';
20
+ import { GetLogicalBooleanValue } from '@colijnit/articleapi/build/enum/db-boolean-value-type.enum';
21
+ import { DateUtils } from '@colijnit/articleapi/build/utils/date-utils';
22
+ import { NumberUtils } from '@colijnit/articleapi/build/utils/number-utils';
23
+ import { isNill as isNill$1 } from '@colijnit/articleapi/build/utils/function/is-nill.function';
24
+ import { MapPropertyDecorator } from '@colijnit/articleapi/build/factory/decorators/map-property.decorator';
25
+ import { BooleanTextDecorator as BooleanTextDecorator$1 } from '@colijnit/articleapi/build/factory/decorators/boolean.decorator';
26
+ import { JsonFieldFieldDecorator } from '@colijnit/articleapi/build/factory/decorators/json.decorator';
27
+ import { ComplexArrayDecorator as ComplexArrayDecorator$1 } from '@colijnit/articleapi/build/factory/decorators/complex-array.decorator';
28
+ import { ArticleStock } from '@colijnit/articleapi/build/model/article-stock.bo';
29
+ import { StockHistoryBo } from '@colijnit/articleapi/build/model/stock-history.bo';
30
+ import { StockStickersPrintLayouts } from '@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo';
31
+ import { ArticleDetailsBo } from '@colijnit/articleapi/build/model/article-details.bo';
32
+ import { StockStatus } from '@colijnit/articleapi/build/model/stock-status.bo';
33
+ import { StockManagementWarehouses } from '@colijnit/articleapi/build/model/stock-management-warehouses.bo';
34
+ import { StockLocation } from '@colijnit/articleapi/build/model/stock-location.bo';
35
+ import { ArticleTransaction } from '@colijnit/articleapi/build/model/article-transaction.bo';
36
+ import { BehaviorSubject } from 'rxjs';
37
+ import { GetStockHistoryRequest } from '@colijnit/articleapi/build/model/get-stock-history-request';
38
+ import { ArticleStock as ArticleStock$1 } from '@colijnit/articleapi/build/model/article-stock';
39
+ import { CoDialogPromptModule, InputCheckboxModule, InputComboBoxModule, IconModule, InputNumberPickerModule, CoDialogWizardModule, ButtonModule, CoGridModule, InputRadioButtonModule, DropDownModule, SimpleGridModule, ImageModule, InputTextModule, InputTextareaModule } from '@colijnit/corecomponents_v12';
40
+ import * as i1 from '@angular/platform-browser';
41
+ import { DomSanitizer } from '@angular/platform-browser';
42
+ import { ArticleStockManagement } from '@colijnit/articleapi/build/model/article-stock-management';
43
+ import { ArticleTransaction as ArticleTransaction$1 } from '@colijnit/articleapi/build/model/article-transaction';
44
+ import { CircularGaugeModule } from '@syncfusion/ej2-angular-circulargauge';
45
+
46
+ class DocsignComponent {
47
+ constructor() {
48
+ this.saveButtonLabel = 'SAVE';
49
+ this.clearButtonLabel = 'CLEAR';
50
+ this.signDocumentButtonLabel = 'SIGN_DOCUMENT';
51
+ this.cancelButtonLabel = 'CANCEL';
52
+ this.pdfSaved = new EventEmitter();
53
+ this.cancelClick = new EventEmitter();
54
+ this.showSignaturePopup = false;
55
+ this.showSigBuyer = false;
56
+ this.showSigSeller = false;
57
+ this.showSignatures = false;
58
+ }
59
+ /**
60
+ * Load an existing [[PDFDocument]]. The input data can be provided in
61
+ * multiple formats:
62
+ *
63
+ * | Type | Contents |
64
+ * | ------------- | ------------------------------------------------------ |
65
+ * | `string` | A base64 encoded string (or data URI) containing a PDF |
66
+ * | `Uint8Array` | The raw bytes of a PDF |
67
+ * | `ArrayBuffer` | The raw bytes of a PDF |
68
+ *
69
+ * For example:
70
+ * ```js
71
+ * import { PDFDocument } from 'pdf-lib'
72
+ *
73
+ * // pdf=string
74
+ * const base64 =
75
+ * 'JVBERi0xLjcKJYGBgYEKCjUgMCBvYmoKPDwKL0ZpbHRlciAvRmxhdGVEZWNvZGUKL0xlbm' +
76
+ * 'd0aCAxMDQKPj4Kc3RyZWFtCniccwrhMlAAwaJ0Ln2P1Jyy1JLM5ERdc0MjCwUjE4WQNC4Q' +
77
+ * '6cNlCFZkqGCqYGSqEJLLZWNuYGZiZmbkYuZsZmlmZGRgZmluDCQNzc3NTM2NzdzMXMxMjQ' +
78
+ * 'ztFEKyuEK0uFxDuAAOERdVCmVuZHN0cmVhbQplbmRvYmoKCjYgMCBvYmoKPDwKL0ZpbHRl' +
79
+ * 'ciAvRmxhdGVEZWNvZGUKL1R5cGUgL09ialN0bQovTiA0Ci9GaXJzdCAyMAovTGVuZ3RoID' +
80
+ * 'IxNQo+PgpzdHJlYW0KeJxVj9GqwjAMhu/zFHkBzTo3nCCCiiKIHPEICuJF3cKoSCu2E8/b' +
81
+ * '20wPIr1p8v9/8kVhgilmGfawX2CGaVrgcAi0/bsy0lrX7IGWpvJ4iJYEN3gEmrrGBlQwGs' +
82
+ * 'HHO9VBX1wNrxAqMX87RBD5xpJuddqwd82tjAHxzV1U5LPgy52DKXWnr1Lheg+j/c/pzGVr' +
83
+ * 'iqV0VlwZPXGPCJjElw/ybkwUmeoWgxesDXGhHJC/D/iikp1Av80ptKU0FdBEe25pPihAM1' +
84
+ * 'u6ytgaaWfs2Hrz35CJT1+EWmAKZW5kc3RyZWFtCmVuZG9iagoKNyAwIG9iago8PAovU2l6' +
85
+ * 'ZSA4Ci9Sb290IDIgMCBSCi9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9UeXBlIC9YUmVmCi9MZW' +
86
+ * '5ndGggMzgKL1cgWyAxIDIgMiBdCi9JbmRleCBbIDAgOCBdCj4+CnN0cmVhbQp4nBXEwREA' +
87
+ * 'EBAEsCwz3vrvRmOOyyOoGhZdutHN2MT55fIAVocD+AplbmRzdHJlYW0KZW5kb2JqCgpzdG' +
88
+ * 'FydHhyZWYKNTEwCiUlRU9G'
89
+ *
90
+ * const dataUri = 'data:application/pdf;base64,' + base64
91
+ *
92
+ * const pdfDoc1 = await PDFDocument.load(base64)
93
+ * const pdfDoc2 = await PDFDocument.load(dataUri)
94
+ *
95
+ * // pdf=Uint8Array
96
+ * import fs from 'fs'
97
+ * const uint8Array = fs.readFileSync('with_update_sections.pdf')
98
+ * const pdfDoc3 = await PDFDocument.load(uint8Array)
99
+ *
100
+ * // pdf=ArrayBuffer
101
+ * const url = 'https://pdf-lib.js.org/assets/with_update_sections.pdf'
102
+ * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())
103
+ * const pdfDoc4 = await PDFDocument.load(arrayBuffer)
104
+ *
105
+ * ```
106
+ *
107
+ * @param pdf The input data containing a PDF document.
108
+ * @param options The options to be used when loading the document.
109
+ * @returns Resolves with a document loaded from the input.
110
+ */
111
+ set pdf(value) {
112
+ if (value) {
113
+ this._pdf = value;
114
+ this._openPDF();
115
+ }
116
+ }
117
+ get pdf() {
118
+ return this._pdf;
119
+ }
120
+ showClass() {
121
+ return true;
122
+ }
123
+ saveFirstSignature(sig) {
124
+ this._saveSignature(sig, this.sigBuyerPosition);
125
+ this.showSigBuyer = false;
126
+ this._savePdf();
127
+ }
128
+ saveSecondSignature(sig) {
129
+ this._saveSignature(sig, this.sigSellerPosition);
130
+ this.showSigSeller = false;
131
+ this._savePdf();
132
+ }
133
+ _openPDF() {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ // first create reader to check signatures
136
+ this._checkSignatures();
137
+ this.pdfDoc = yield PDFDocument.load(this._pdf, {
138
+ updateMetadata: false
139
+ });
140
+ const pdfDataUri = yield this.pdfDoc.saveAsBase64({ dataUri: true });
141
+ this.iframe.nativeElement.src = pdfDataUri;
142
+ });
143
+ }
144
+ _savePdf() {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ if (!this.showSigBuyer && !this.showSigSeller) {
147
+ // ready, save the pdf and emit result
148
+ const result = yield this.pdfDoc.saveAsBase64();
149
+ this.pdfSaved.next(result);
150
+ }
151
+ });
152
+ }
153
+ _checkSignatures() {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ let pdfWorkerSrc;
156
+ if (window.hasOwnProperty('pdfWorkerSrc') &&
157
+ typeof window.pdfWorkerSrc === 'string' &&
158
+ window.pdfWorkerSrc) {
159
+ pdfWorkerSrc = window.pdfWorkerSrc;
160
+ }
161
+ else {
162
+ pdfWorkerSrc = pdfjsWorker;
163
+ }
164
+ PDFJS.GlobalWorkerOptions.workerSrc = pdfWorkerSrc;
165
+ const pdfReader = yield PDFJS.getDocument(this._pdf).promise;
166
+ const numPages = pdfReader.numPages;
167
+ for (let i = 0; i < numPages; i++) {
168
+ const page = yield pdfReader.getPage(i + 1);
169
+ const text = yield page.getTextContent();
170
+ page.cleanup();
171
+ if (this.firstSignatureField) {
172
+ this.sigBuyerPosition = this._getPositionSignature(text, this.firstSignatureField);
173
+ if (this.sigBuyerPosition.width > 0 && this.sigBuyerPosition.height > 0) {
174
+ this.sigBuyerPosition.page = i;
175
+ this.showSigBuyer = true;
176
+ }
177
+ }
178
+ if (this.secondSignatureField) {
179
+ this.sigSellerPosition = this._getPositionSignature(text, this.secondSignatureField);
180
+ if (this.sigSellerPosition.width > 0 && this.sigSellerPosition.height > 0) {
181
+ this.sigSellerPosition.page = i;
182
+ this.showSigSeller = true;
183
+ }
184
+ }
185
+ }
186
+ });
187
+ }
188
+ _getPositionSignature(textItem, signatureField) {
189
+ const sigItem = textItem.items.find((i) => i.str.toLowerCase() === signatureField.toLowerCase());
190
+ if (sigItem) {
191
+ textItem.items.slice(textItem.items.indexOf(sigItem), 1);
192
+ return {
193
+ x: sigItem.transform[4],
194
+ y: sigItem.transform[5],
195
+ width: sigItem.width,
196
+ height: sigItem.height,
197
+ page: 0
198
+ };
199
+ }
200
+ return { x: 0, y: 0, width: 0, height: 0, page: 0 };
201
+ }
202
+ _saveSignature(sig, dimensions) {
203
+ return __awaiter(this, void 0, void 0, function* () {
204
+ const jpgImage = yield this.pdfDoc.embedPng(sig);
205
+ const page = yield this.pdfDoc.getPage(dimensions.page);
206
+ page.drawImage(jpgImage, {
207
+ x: ((dimensions.x + (dimensions.width / 2)) - (200 / 2)),
208
+ y: ((dimensions.y + (dimensions.height / 2)) - (100 / 2)),
209
+ width: 200,
210
+ height: 100
211
+ });
212
+ });
213
+ }
214
+ }
215
+ DocsignComponent.decorators = [
216
+ { type: Component, args: [{
217
+ selector: "ione-docsign",
218
+ template: `
219
+ <iframe #iframe></iframe>
220
+ <ione-signatures *ngIf="showSignatures" @showHideSignature
221
+ [showFirstSignature]="showSigBuyer"
222
+ [firstSignatureTitle]="firstSignatureLabel"
223
+ [showSecondSignature]="showSigSeller"
224
+ [secondSignatureTitle]="secondSignatureLabel"
225
+ [saveButtonLabel]="saveButtonLabel"
226
+ [clearButtonLabel]="clearButtonLabel"
227
+ (saveFirstSignature)="saveFirstSignature($event)"
228
+ (saveSecondSignature)="saveSecondSignature($event)"
229
+ ></ione-signatures>
230
+ <input type="button" *ngIf="(showSigBuyer || showSigSeller) && !showSignatures" class="button button-sign-document"
231
+ [value]="signDocumentButtonLabel"
232
+ (click)="showSignatures = true"
233
+ />
234
+ <input type="button" class="button button-cancel"
235
+ [value]="cancelButtonLabel"
236
+ (click)="cancelClick.emit($event)"
237
+ />
238
+ `,
239
+ animations: [
240
+ trigger("showHideSignature", [
241
+ state("void", style({ transform: "translate(-50%, -50%) scale(0)" })),
242
+ state("*", style({ transform: "translate(-50%, -50%) scale(1)" })),
243
+ transition("void <=> *", animate("200ms ease-in-out")),
244
+ ])
245
+ ],
246
+ encapsulation: ViewEncapsulation.None
247
+ },] }
248
+ ];
249
+ DocsignComponent.propDecorators = {
250
+ iframe: [{ type: ViewChild, args: ["iframe", { read: ElementRef },] }],
251
+ pdf: [{ type: Input }],
252
+ firstSignatureLabel: [{ type: Input }],
253
+ firstSignatureField: [{ type: Input }],
254
+ secondSignatureLabel: [{ type: Input }],
255
+ secondSignatureField: [{ type: Input }],
256
+ saveButtonLabel: [{ type: Input }],
257
+ clearButtonLabel: [{ type: Input }],
258
+ signDocumentButtonLabel: [{ type: Input }],
259
+ cancelButtonLabel: [{ type: Input }],
260
+ pdfSaved: [{ type: Output }],
261
+ cancelClick: [{ type: Output }],
262
+ showClass: [{ type: HostBinding, args: ['class.ione-docsign',] }]
263
+ };
264
+
265
+ class SignatureComponent {
266
+ constructor() {
267
+ this.saveButtonLabel = 'SAVE';
268
+ this.clearButtonLabel = 'CLEAR';
269
+ this.save = new EventEmitter();
270
+ }
271
+ set content(content) {
272
+ if (content) {
273
+ this.signatureCanvas = content;
274
+ this._initCanvas();
275
+ }
276
+ }
277
+ showClass() {
278
+ return true;
279
+ }
280
+ handleSave(event) {
281
+ // save canvas as svg
282
+ // const sig: string = this.signature.toDataURL("image/svg+xml");
283
+ const sig = this.signature.toDataURL("image/png");
284
+ // emit signature string
285
+ this.save.next(sig);
286
+ }
287
+ handleClear(event) {
288
+ if (this.signature) {
289
+ this.signature.clear();
290
+ }
291
+ }
292
+ _initCanvas() {
293
+ if (this.signatureCanvas && this.signatureCanvas.nativeElement) {
294
+ this.signature = new SignaturePad(this.signatureCanvas.nativeElement);
295
+ setTimeout(() => {
296
+ this._resizeSignatureCanvas(this.signature, this.signatureCanvas);
297
+ });
298
+ }
299
+ }
300
+ _resizeSignatureCanvas(signature, signatureCanvas) {
301
+ const imageBeforeResize = signature.toDataURL();
302
+ const ratio = Math.max(window.devicePixelRatio || 1, 1);
303
+ signatureCanvas.nativeElement.width = signatureCanvas.nativeElement.offsetWidth * ratio;
304
+ signatureCanvas.nativeElement.height = signatureCanvas.nativeElement.offsetHeight * ratio;
305
+ signatureCanvas.nativeElement.getContext("2d").scale(ratio, ratio);
306
+ signature.fromDataURL(imageBeforeResize);
307
+ }
308
+ }
309
+ SignatureComponent.decorators = [
310
+ { type: Component, args: [{
311
+ selector: "ione-signature",
312
+ template: `
313
+ <div class="signature-wrapper">
314
+ <div class="signature-header">
315
+ <span *ngIf="title" class="title" [textContent]="title"></span>
316
+ <div class="button-wrapper">
317
+ <input type="button" (click)="handleSave($event)" [value]="saveButtonLabel"/>
318
+ <input type="button" (click)="handleClear($event)" [value]="clearButtonLabel">
319
+ </div>
320
+ </div>
321
+ <div class="canvas">
322
+ <canvas #signature></canvas>
323
+ </div>
324
+ </div>
325
+ `,
326
+ encapsulation: ViewEncapsulation.None
327
+ },] }
328
+ ];
329
+ SignatureComponent.propDecorators = {
330
+ content: [{ type: ViewChild, args: ["signature", { read: ElementRef },] }],
331
+ title: [{ type: Input }],
332
+ saveButtonLabel: [{ type: Input }],
333
+ clearButtonLabel: [{ type: Input }],
334
+ save: [{ type: Output }],
335
+ showClass: [{ type: HostBinding, args: ["class.ione-signature",] }]
336
+ };
337
+
338
+ class SignaturesComponent {
339
+ constructor() {
340
+ this.showFirstSignature = false;
341
+ this.showSecondSignature = false;
342
+ this.saveButtonLabel = 'SAVE';
343
+ this.clearButtonLabel = 'CLEAR';
344
+ this.saveFirstSignature = new EventEmitter();
345
+ this.saveSecondSignature = new EventEmitter();
346
+ }
347
+ showClass() {
348
+ return true;
349
+ }
350
+ }
351
+ SignaturesComponent.decorators = [
352
+ { type: Component, args: [{
353
+ selector: "ione-signatures",
354
+ template: `
355
+ <ione-signature *ngIf="showFirstSignature"
356
+ [title]="firstSignatureTitle"
357
+ [saveButtonLabel]="saveButtonLabel"
358
+ [clearButtonLabel]="clearButtonLabel"
359
+ (save)="saveFirstSignature.emit($event)"></ione-signature>
360
+ <ione-signature *ngIf="showSecondSignature"
361
+ [title]="secondSignatureTitle"
362
+ [saveButtonLabel]="saveButtonLabel"
363
+ [clearButtonLabel]="clearButtonLabel"
364
+ (save)="saveSecondSignature.emit($event)"></ione-signature>
365
+ `,
366
+ encapsulation: ViewEncapsulation.None
367
+ },] }
368
+ ];
369
+ SignaturesComponent.propDecorators = {
370
+ showFirstSignature: [{ type: Input }],
371
+ firstSignatureTitle: [{ type: Input }],
372
+ showSecondSignature: [{ type: Input }],
373
+ secondSignatureTitle: [{ type: Input }],
374
+ saveButtonLabel: [{ type: Input }],
375
+ clearButtonLabel: [{ type: Input }],
376
+ saveFirstSignature: [{ type: Output }],
377
+ saveSecondSignature: [{ type: Output }],
378
+ showClass: [{ type: HostBinding, args: ["class.ione-signatures",] }]
379
+ };
380
+
381
+ class DocsignModule {
382
+ }
383
+ DocsignModule.decorators = [
384
+ { type: NgModule, args: [{
385
+ imports: [
386
+ CommonModule
387
+ ],
388
+ declarations: [
389
+ DocsignComponent,
390
+ SignatureComponent,
391
+ SignaturesComponent
392
+ ],
393
+ exports: [
394
+ DocsignComponent
395
+ ]
396
+ },] }
397
+ ];
398
+
399
+ const PROP_META_KEY$3 = "complexField";
400
+ /**
401
+ * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
402
+ */
403
+ /**
404
+ * Property decorator for properties of businessobject classes that are other strongly typed businessobjects.
405
+ * Ensures that the BusinessObjectFactoryService makes properly typed objects from incoming raw persistence data. Otherwise we couldn't add methods
406
+ * to our own businessobjects and use them, since all fields would be flat data without methods after BusinessObjectFactoryService creation.
407
+ *
408
+ * Usage:
409
+ *
410
+ * @ComplexField(Transaction)
411
+ * public transaction: Transaction
412
+ *
413
+ * Also keeps track of a "complexFieldProps" metadata on the class-level, as a reflect-metadata workaround to be able to
414
+ * retrieve all properties that have the @ComplexField(..) decorator (impossible with current Reflect API).
415
+ */
416
+ function ComplexField(type) {
417
+ return function (target, propertyKey) {
418
+ if (!target || !propertyKey) {
419
+ return;
420
+ }
421
+ // warn the programmer if given type was undefined; it's probably an import order glitch that caused this, because decorators seem
422
+ // to be immediately processed when a class is first imported
423
+ if (!type) {
424
+ // eslint-disable-next-line no-console
425
+ console.warn(`@ComplexField(type): type was UNDEFINED. Called on prop (${ObjectUtils.GetClassName(target)}, ${propertyKey}). ` +
426
+ `Class will not properly serialize and deserialize now. We've always been able to fix this by CHANGING IMPORT ORDERS ` +
427
+ `where both classes and their dependencies are used, e.g. factory, repository or models..`);
428
+ return;
429
+ }
430
+ Reflect.defineMetadata(PROP_META_KEY$3, type, target, propertyKey);
431
+ };
432
+ }
433
+ // Utility function holder of the ComplexFieldDecorator decorator.
434
+ class ComplexFieldDecorator {
435
+ /**
436
+ * Returns whether given property (as a string) on given object is a complex field. A complex field is a field that is decorated
437
+ * with the @ComplexField decorator.
438
+ */
439
+ static IsComplexField(target, propertyKey) {
440
+ if (!target || !propertyKey || typeof target !== "object") {
441
+ return false;
442
+ }
443
+ return (notNill(Reflect.getMetadata(PROP_META_KEY$3, target, propertyKey)));
444
+ }
445
+ // Returns the VALUE of the @ComplexField(VALUE) property decorator on the given propertyKey on the given modelObject.
446
+ static GetComplexFieldType(target, propertyKey) {
447
+ if (!target || !propertyKey || typeof target !== "object") {
448
+ return undefined;
449
+ }
450
+ return Reflect.getMetadata(PROP_META_KEY$3, target, propertyKey);
451
+ }
452
+ }
453
+
454
+ const PROP_META_KEY$2 = "complexArray";
455
+ /**
456
+ * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
457
+ */
458
+ /**
459
+ * Property decorator for properties of businessobject classes that are an array of other strongly typed businessobjects.
460
+ * Ensures that the BusinessObjectFactoryService makes properly typed objects from incoming raw persistence data. Otherwise we couldn't add methods
461
+ * to our own businessobjects and use them, since all fields would be flat data without methods after BusinessObjectFactoryService creation.
462
+ *
463
+ * Usage:
464
+ *
465
+ * @ComplexArray(TransactionLine)
466
+ * public transactionLines: TransactionLine[]
467
+ */
468
+ function ComplexArray(type) {
469
+ return function (target, propertyKey) {
470
+ if (!target || !propertyKey || typeof target !== "object") {
471
+ return;
472
+ }
473
+ // warn the programmer if given type was undefined; it's probably an import order glitch that caused this, because decorators seem
474
+ // to be immediately processed when a class is first imported
475
+ if (!type) {
476
+ console.warn(`@ComplexArray(type): type was UNDEFINED. Called on prop (${ObjectUtils.GetClassName(target)}, ${propertyKey}). ` +
477
+ `Class will not properly serialize and deserialize now. We've always been able to fix this by CHANGING IMPORT ORDERS ` +
478
+ `where both classes and their dependencies are used, e.g. factory, repository or models..`);
479
+ return;
480
+ }
481
+ Reflect.defineMetadata(PROP_META_KEY$2, type, target, propertyKey);
482
+ };
483
+ }
484
+ // Utility function holder of the ComplexArrayDecorator decorator.
485
+ class ComplexArrayDecorator {
486
+ /**
487
+ * Returns whether given property (as a string) on given object is a complex array. A complex array is an array field that is decorated
488
+ * with the @ComplexArray decorator.
489
+ */
490
+ static IsComplexArray(target, propertyKey) {
491
+ if (!target || !propertyKey || typeof target !== "object") {
492
+ return false;
493
+ }
494
+ return (notNill(Reflect.getMetadata(PROP_META_KEY$2, target, propertyKey)));
495
+ }
496
+ /**
497
+ * Returns the VALUE of the @ComplexArray(VALUE) property decorator on the given propertyKey on the given modelobject.
498
+ */
499
+ static GetComplexArrayType(target, propertyKey) {
500
+ if (!target || !propertyKey || typeof target !== "object") {
501
+ return undefined;
502
+ }
503
+ return Reflect.getMetadata(PROP_META_KEY$2, target, propertyKey);
504
+ }
505
+ }
506
+
507
+ const PROP_META_KEY_JN = "booleanTextJN";
508
+ const PROP_META_KEY_TF = "booleanTextTF";
509
+ const PROP_META_KEY_10 = "booleanText10";
510
+ /**
511
+ * There are 'J', 'T', 'N', 'F', 0 and 1 'boolean values' in the database. These should be translated to true and false boolean values in
512
+ * our client application.
513
+ *
514
+ * The values 'J' and 'N' seem to be most commonly used. This is the default setting when using this decorator.
515
+ * You can pass 'T' or 1 for the other variants as follows:
516
+ *
517
+ * Usage:
518
+ *
519
+ * @BooleanText() or @BooleanText("J") (the default, uses YesNoDbType char values)
520
+ * public foo: boolean // 'J' and 'N' become true and false after BusinessObjectFactoryService and -SerializerService processing
521
+ *
522
+ * @BooleanText('T') (uses TrueFalseDbType char values)
523
+ * public bar: boolean // 'T' and 'F' become true and false after BusinessObjectFactoryService and -SerializerService processing
524
+ *
525
+ * @BooleanText(1)
526
+ * public baz: boolean // 1 and 0 become true and false after BusinessObjectFactoryService and -SerializerService processing
527
+ */
528
+ function BooleanText(type) {
529
+ return function (target, propertyKey) {
530
+ if (!target || !propertyKey) {
531
+ return;
532
+ }
533
+ // by default, it's a J N boolean text
534
+ if (!type || type === "J") {
535
+ Reflect.defineMetadata(PROP_META_KEY_JN, true, target, propertyKey);
536
+ }
537
+ else if (type === "T") {
538
+ Reflect.defineMetadata(PROP_META_KEY_TF, true, target, propertyKey);
539
+ }
540
+ else if (type === 1) {
541
+ Reflect.defineMetadata(PROP_META_KEY_10, true, target, propertyKey);
542
+ }
543
+ };
544
+ }
545
+ // Utility function holder of the BooleanTextDecorator decorator.
546
+ class BooleanTextDecorator {
547
+ /**
548
+ * Returns whether given property (as a string) on given object is a boolean text field. That is, it's a field that is decorated
549
+ * with the @BooleanText decorator.
550
+ */
551
+ static IsBooleanTextField(target, propertyKey) {
552
+ if (!target || !propertyKey || typeof target !== "object") {
553
+ return false;
554
+ }
555
+ return (Reflect.getMetadata(PROP_META_KEY_JN, target, propertyKey) === true
556
+ ||
557
+ Reflect.getMetadata(PROP_META_KEY_TF, target, propertyKey) === true
558
+ ||
559
+ Reflect.getMetadata(PROP_META_KEY_10, target, propertyKey) === true);
560
+ }
561
+ /**
562
+ * Returns the logical true or false value of given character ('J', 'N', 'T' or 'F') or number (0 or 1).
563
+ * Returns UNDEFINED if given boolChar was not recognised as a boolean text.
564
+ */
565
+ static GetLogicalBooleanValue(dbBoolChar) {
566
+ return GetLogicalBooleanValue(dbBoolChar);
567
+ }
568
+ /**
569
+ * Returns the boolean character / number of given logical bool property on target object. Uses its @BooleanText() annotation to decide
570
+ * what character / number to return.
571
+ * Used in BusinessObjectSerializerServiceService to convert logical bools to their original boolean character.
572
+ * @returns {string|number} The original, reverse-engineered boolean character (or number) of given object property, or undefined.
573
+ */
574
+ static GetDbBooleanValue(target, propertyKey) {
575
+ if (!target || !propertyKey || typeof target !== "object") {
576
+ return undefined;
577
+ }
578
+ let dbBoolVal = undefined;
579
+ const curBoolVal = target[propertyKey];
580
+ if (BooleanTextDecorator._IsJaNeeProp(target, propertyKey)) {
581
+ dbBoolVal = GetYesNoDbBooleanValue(curBoolVal);
582
+ }
583
+ else if (BooleanTextDecorator._IsTrueFalseProp(target, propertyKey)) {
584
+ dbBoolVal = GetTrueFalseDbBooleanValue(curBoolVal);
585
+ }
586
+ else if (BooleanTextDecorator._IsZeroOneProp(target, propertyKey)) {
587
+ dbBoolVal = GetOneZeroDbBooleanValue(curBoolVal);
588
+ }
589
+ return dbBoolVal;
590
+ }
591
+ static _IsJaNeeProp(target, propertyKey) {
592
+ return BooleanTextDecorator._IsProp(PROP_META_KEY_JN, target, propertyKey);
593
+ }
594
+ static _IsTrueFalseProp(target, propertyKey) {
595
+ return BooleanTextDecorator._IsProp(PROP_META_KEY_TF, target, propertyKey);
596
+ }
597
+ static _IsZeroOneProp(target, propertyKey) {
598
+ return BooleanTextDecorator._IsProp(PROP_META_KEY_10, target, propertyKey);
599
+ }
600
+ static _IsProp(prop, target, propertyKey) {
601
+ return !!target && !!propertyKey && typeof target === "object" && Reflect.hasMetadata(prop, target, propertyKey);
602
+ }
603
+ }
604
+
605
+ const PROP_META_KEY$1 = "dateField";
606
+ /**
607
+ * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
608
+ */
609
+ /**
610
+ * Property decorator for properties of businessobject classes that are of type Date, but are sent to us as strings.
611
+ * Ensures that the BusinessObjectFactory makes proper JavaScript Date objects from incoming strings for @DateField() decorated properties.
612
+ *
613
+ * Usage:
614
+ *
615
+ * @DateField()
616
+ * public expectedDeliveryDate: Date
617
+ */
618
+ function DateField() {
619
+ return function (target, propertyKey) {
620
+ if (!target || !propertyKey) {
621
+ return;
622
+ }
623
+ Reflect.defineMetadata(PROP_META_KEY$1, undefined, target, propertyKey);
624
+ };
625
+ }
626
+ // Utility function holder of the @DateField() decorator.
627
+ class DateFieldFieldDecorator {
628
+ // Returns whether given property (as a string) on given object is decorated with @DateField().
629
+ static IsDateField(target, propertyKey) {
630
+ if (!target || !propertyKey || typeof target !== "object") {
631
+ return false;
632
+ }
633
+ return Reflect.hasMetadata(PROP_META_KEY$1, target, propertyKey);
634
+ }
635
+ static StringAsDate(str) {
636
+ return DateUtils.StringAsDate(str);
637
+ }
638
+ }
639
+
640
+ const PROP_META_KEY = "stringNumber";
641
+ /**
642
+ * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
643
+ */
644
+ /**
645
+ * Decorator for properties of businessobjects that are sent to us as strings from the database, but which we want to use as a number in the client.
646
+ *
647
+ * Can be handy for incongruent backend api cases, where id data types are communicated wrongly via strings instead of numbers
648
+ * (e.g. on EmployeeFullObject.district, points to a District which has a number id, but in employee it's a string representation of that number...)
649
+ *
650
+ * Used by business object factory and -serializer.
651
+ *
652
+ * Usage:
653
+ *
654
+ * @StringNumber()
655
+ * public rights: UserRightType
656
+ */
657
+ function StringNumber() {
658
+ return function (target, propertyKey) {
659
+ if (!target || !propertyKey) {
660
+ return;
661
+ }
662
+ Reflect.defineMetadata(PROP_META_KEY, undefined, target, propertyKey);
663
+ };
664
+ }
665
+ // Utility function holder of the @StringNumber() decorator.
666
+ class StringNumberDecorator {
667
+ // Returns whether given property (as a string) on given object is decorated with @StringNumber().
668
+ static IsStringNumber(target, propertyKey) {
669
+ if (!target || !propertyKey || typeof target !== "object") {
670
+ return false;
671
+ }
672
+ return Reflect.hasMetadata(PROP_META_KEY, target, propertyKey);
673
+ }
674
+ static StringAsNumber(str) {
675
+ return NumberUtils.ParseFloatKeepPrecision(str);
676
+ }
677
+ static NumberAsString(nr) {
678
+ return "" + nr;
679
+ }
680
+ }
681
+
682
+ // @returns true iff given value equals null or equals undefined
683
+ function isNill(value) {
684
+ return value === null || value === undefined;
685
+ }
686
+
687
+ class ArrayUtils {
688
+ /**
689
+ * Returns whether at least one element in given array could be found by given finder function.
690
+ *
691
+ * @param {T[]} array
692
+ * @param {(element: T) => boolean} finder A finder function that takes an element of the array and returns a boolean that represents
693
+ * the 'found status' for that element; whether it should have been found or not.
694
+ */
695
+ static ContainsAnElementFoundBy(array, finder) {
696
+ if (!array || !finder) {
697
+ return false;
698
+ }
699
+ return notNill(this.Find(array, finder));
700
+ }
701
+ /**
702
+ * Cross-browser Array.find() function. Returns the first item in given array for which the foundBy function returns true. Returns
703
+ * undefined when none was found.
704
+ *
705
+ * Example usage:
706
+ * const foundItem: BusinessObject = ArrayUtils.Find<BusinessObject>(modelArray, (modelItem: BusinessObject) => <br>
707
+ * (return modelItem.getId() === '1')
708
+ * * });
709
+ *
710
+ * @param array The array with items to search in.
711
+ * @param foundBy The finder function applied on each items of the array, when that returns true, the item is considered found.
712
+ */
713
+ static Find(array, foundBy) {
714
+ if (!array || !foundBy) {
715
+ return undefined;
716
+ }
717
+ for (let i = 0, len = array.length; i < len; i++) {
718
+ const itemCur = array[i];
719
+ if (foundBy(itemCur)) {
720
+ return itemCur;
721
+ }
722
+ }
723
+ return undefined;
724
+ }
725
+ // @returns empty array when nothing found, otherwise array with found items
726
+ static FindAll(array, foundBy) {
727
+ const answer = [];
728
+ if (!array || !foundBy) {
729
+ return answer;
730
+ }
731
+ for (let i = 0, len = array.length; i < len; i++) {
732
+ const itemCur = array[i];
733
+ if (foundBy(itemCur)) {
734
+ answer.push(itemCur);
735
+ }
736
+ }
737
+ return answer;
738
+ }
739
+ // returns a simple clone of given array, using array.slice(0)
740
+ static CloneArray(array) {
741
+ let answer = [];
742
+ if (array) {
743
+ answer = array.slice(0);
744
+ }
745
+ return answer;
746
+ }
747
+ /**
748
+ * Returns a 'semi deep clone' of given array. Its first-level members are object-shallow-cloned (optionally with a strongly typed constructor),
749
+ * or just as plain object (see param arrayItemsClass).
750
+ * @param array
751
+ * @param arrayItemsClass If provided, the cloned array's first-level items will be strongly typed to / constructed as this class. Otherwise
752
+ * it'll be a plain object.
753
+ * @param deepClone Set to true if array items contain FUNCTIONS that need to be cloned..
754
+ * @returns {Array} semi-deep clone of given array
755
+ */
756
+ static CloneArrayAndItsItems(array, arrayItemsClass, deepClone = false) {
757
+ const cloneArray = [];
758
+ if (array) {
759
+ for (let i = 0, len = array.length; i < len; i++) {
760
+ if (deepClone) {
761
+ cloneArray.push(ObjectUtils.GetDeepClone(array[i]));
762
+ }
763
+ else {
764
+ cloneArray.push(ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
765
+ }
766
+ }
767
+ }
768
+ else {
769
+ return [];
770
+ }
771
+ return cloneArray;
772
+ }
773
+ /**
774
+ * Removes element at given index from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really
775
+ * removes the element using splice().
776
+ *
777
+ * @param {number} index
778
+ * @param {any[]} array in-out
779
+ * @returns {boolean} True if and only if the element on given index is succesfully removed from given array.
780
+ */
781
+ static RemoveElementAtIndex(index, array) {
782
+ if (NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
783
+ return false;
784
+ }
785
+ if (index in array) {
786
+ array.splice(index, 1);
787
+ return true;
788
+ }
789
+ else {
790
+ return false;
791
+ }
792
+ }
793
+ /**
794
+ * Removes given element from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really removes the
795
+ * element using splice(). Also works on associative arrays.
796
+ *
797
+ * @param {T} element The element to remove.
798
+ * @param {T[]} array The array to remove the element from.
799
+ * @returns {boolean} True iff given element was truly successfully removed from given array.
800
+ */
801
+ static RemoveElement(element, array) {
802
+ if (!Array.isArray(array)) {
803
+ return false;
804
+ }
805
+ const index = array.indexOf(element);
806
+ return ArrayUtils.RemoveElementAtIndex(index, array);
807
+ }
808
+ // Checks if given array is defined, and is an array, and has length > 0, and, optionally checks that the first element is of type given clazz.
809
+ static IsArrayWithElements(arrayToCheck, classItemsMustBeInstanceOf) {
810
+ if (isNill$1(arrayToCheck)) {
811
+ return false;
812
+ }
813
+ if (Array.isArray(arrayToCheck) && arrayToCheck.length > 0) {
814
+ if (classItemsMustBeInstanceOf) {
815
+ return arrayToCheck[0] instanceof classItemsMustBeInstanceOf;
816
+ }
817
+ else {
818
+ return true;
819
+ }
820
+ }
821
+ else {
822
+ return false;
823
+ }
824
+ }
825
+ // Removes all elements from given array for which given filter function holds true. Returns true if at least one removed, else false.
826
+ static RemoveElementsByFilter(array, filterFunction) {
827
+ if (!ArrayUtils.IsArrayWithElements(array) || !filterFunction) {
828
+ return false;
829
+ }
830
+ let atLeastOneRemoved = false;
831
+ const len = array.length;
832
+ for (let i = len - 1; i >= 0; i--) {
833
+ const item = array[i];
834
+ if (filterFunction.call(this, item) === true) {
835
+ array.splice(i, 1);
836
+ atLeastOneRemoved = true;
837
+ }
838
+ }
839
+ return atLeastOneRemoved;
840
+ }
841
+ static MoveElement(element, toIndex, array) {
842
+ if (!Array.isArray(array) || isNill$1(toIndex)) {
843
+ return false;
844
+ }
845
+ const fromIndex = array.indexOf(element);
846
+ const toIndexCorrected = NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
847
+ if (fromIndex === -1 || array[toIndexCorrected] === element) {
848
+ // element did not exist in given array, or already existed on given toIndex
849
+ return false;
850
+ }
851
+ array.splice(toIndexCorrected, 0, array.splice(fromIndex, 1)[0]);
852
+ return true;
853
+ }
854
+ // PRE: elements exists in given array. POST: given elementToPlace has a lower index than given afterThisElement. Array is in-out manipulated.
855
+ static PlaceElementAfterOther(array, elementToPlace, afterThisElement) {
856
+ if (array) {
857
+ const afterThisElIdx = array.indexOf(afterThisElement);
858
+ const elToPlaceIdx = array.indexOf(elementToPlace);
859
+ if (afterThisElIdx >= elToPlaceIdx) {
860
+ ArrayUtils.MoveElement(elementToPlace, afterThisElIdx + 1, array);
861
+ }
862
+ }
863
+ }
864
+ }
865
+
866
+ /**
867
+ * This type represents the concept of a business object ID type. ID's of business objects can be a primary number, a simple string or a
868
+ * object for a composite key.
869
+ *
870
+ * Simply to prevent type declarations of 'number | string | Object' for BO ID data all over the application.
871
+ */
872
+ class BusinessObject {
873
+ constructor() {
874
+ }
875
+ // Overridable. Returns the ID of the model. Concrete model classes often override this method to provide their specific ID getter.
876
+ getId() {
877
+ return this.id;
878
+ }
879
+ setOwnMappedPropsFromRawData(rawData = {}) {
880
+ if (!rawData) {
881
+ return;
882
+ }
883
+ Object.keys(this).forEach((key) => {
884
+ // check if property needs to be mapped
885
+ if (MapPropertyDecorator.IsMapProperty(this, key)) {
886
+ const mapKeys = MapPropertyDecorator.GetMapProperty(this, key).split(",");
887
+ const len = mapKeys.length;
888
+ for (let i = 0; i < len; i++) {
889
+ // eslint-disable-next-line
890
+ const mapKey = mapKeys[i].trim();
891
+ const objProp = rawData[mapKey];
892
+ let decorated = false;
893
+ if (rawData.hasOwnProperty(mapKey)) {
894
+ if (BooleanTextDecorator$1.IsBooleanTextField(this, key)) {
895
+ this[key] = BooleanTextDecorator$1.GetLogicalBooleanValue(objProp);
896
+ decorated = true;
897
+ }
898
+ if (JsonFieldFieldDecorator.IsJsonField(this, key)) {
899
+ this[key] = JsonFieldFieldDecorator.StringAsJson(objProp);
900
+ decorated = true;
901
+ }
902
+ if (ComplexArrayDecorator$1.IsComplexArray(this, key)) {
903
+ const arrayClass = ComplexArrayDecorator$1.GetComplexArrayType(this, key);
904
+ // eslint-disable-next-line
905
+ const origArray = this[key];
906
+ // eslint-disable-next-line
907
+ const newArray = [];
908
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
909
+ for (let j = 0; j < origArray.length; j++) {
910
+ // eslint-disable-next-line
911
+ const item = new arrayClass(origArray[j]);
912
+ newArray.push(item);
913
+ }
914
+ this[key] = newArray;
915
+ }
916
+ else {
917
+ if (!decorated) {
918
+ this[key] = objProp;
919
+ }
920
+ }
921
+ break;
922
+ }
923
+ }
924
+ }
925
+ else {
926
+ if (rawData.hasOwnProperty(key)) {
927
+ const objProp = rawData[key];
928
+ if (BooleanTextDecorator$1.IsBooleanTextField(this, key)) {
929
+ this[key] = BooleanTextDecorator$1.GetLogicalBooleanValue(objProp);
930
+ }
931
+ else if (JsonFieldFieldDecorator.IsJsonField(this, key)) {
932
+ this[key] = JsonFieldFieldDecorator.StringAsJson(objProp);
933
+ }
934
+ else {
935
+ this[key] = objProp;
936
+ }
937
+ }
938
+ }
939
+ });
940
+ }
941
+ }
942
+
943
+ // Factory service creates businessobjects, using their decorators in the process.
944
+ class BusinessObjectFactory {
945
+ constructor() {
946
+ }
947
+ /**
948
+ * Creates and returns a new business data object instance of given class, with all given data properties applied to it in a
949
+ * complex-aware style. That is, all properties on given class that are decorated with @ComplexField(..) or @ComplexArray(..) decorators
950
+ * become strongly typed business objects, with methods that are usable and such.
951
+ *
952
+ * @param modelClass
953
+ * @param {Object} rawData The object with all (possibly raw/flat/not alive) data to be applied to the created model object
954
+ */
955
+ makeWithRawBackendData(modelClass, rawData) {
956
+ if (!modelClass) {
957
+ return undefined;
958
+ }
959
+ if (typeof modelClass !== typeof BusinessObject) {
960
+ return undefined;
961
+ }
962
+ const model = new modelClass();
963
+ this._copyAllPropertiesDecoratorProcessedFrom(rawData, model);
964
+ return model;
965
+ }
966
+ // see makeWithRawBackendData, this is a loop-wrapper around that method
967
+ makeBOArrayFromRawBackendDataArray(modelClass, arrayOfRawDatas) {
968
+ if (!modelClass) {
969
+ return undefined;
970
+ }
971
+ const trueClientBos = [];
972
+ if (arrayOfRawDatas) {
973
+ for (let i = 0, len = arrayOfRawDatas.length; i < len; i++) {
974
+ trueClientBos.push(this.makeWithRawBackendData(modelClass, arrayOfRawDatas[i]));
975
+ }
976
+ }
977
+ return trueClientBos;
978
+ }
979
+ instantiateNewBo(modelClass) {
980
+ return this.makeWithRawBackendData(modelClass, {});
981
+ }
982
+ /**
983
+ * Applies all properties of given 'source' object to the given 'destination' businessobject, if destination has that property.
984
+ * Works with the @ComplexField(), @ComplexArray, @BooleanText, @CoInject and @DateField annotations of given destination model.
985
+ *
986
+ * @param sourceData Raw data to copy to destination model
987
+ * @param {BusinessObject} destinationModel InOut: The annotated businessobject to apply source properties to
988
+ */
989
+ _copyAllPropertiesDecoratorProcessedFrom(sourceData, destinationModel) {
990
+ if (!sourceData || !destinationModel) {
991
+ return;
992
+ }
993
+ // process all source data into destinationModel
994
+ for (const srcPropKey in sourceData) {
995
+ if (!sourceData.hasOwnProperty(srcPropKey)) {
996
+ continue;
997
+ }
998
+ const srcPropVal = sourceData[srcPropKey];
999
+ if (ComplexFieldDecorator.IsComplexField(destinationModel, srcPropKey)) {
1000
+ const classOfField = ComplexFieldDecorator.GetComplexFieldType(destinationModel, srcPropKey);
1001
+ destinationModel[srcPropKey] = this.makeWithRawBackendData(classOfField, srcPropVal);
1002
+ }
1003
+ else if (ComplexArrayDecorator.IsComplexArray(destinationModel, srcPropKey)) {
1004
+ const sourceArray = srcPropVal;
1005
+ if (!sourceArray) {
1006
+ continue;
1007
+ }
1008
+ const classOfArrayItems = ComplexArrayDecorator.GetComplexArrayType(destinationModel, srcPropKey);
1009
+ const tempArray = [];
1010
+ for (let i = 0, len = sourceArray.length; i < len; i++) {
1011
+ tempArray.push(this.makeWithRawBackendData(classOfArrayItems, sourceArray[i]));
1012
+ }
1013
+ destinationModel[srcPropKey] = tempArray;
1014
+ }
1015
+ else if (BooleanTextDecorator.IsBooleanTextField(destinationModel, srcPropKey)) {
1016
+ // logical 'true' and 'false' also allowed as incoming values for @BooleanText() properties: then just copy their value
1017
+ if (typeof srcPropVal === "boolean") {
1018
+ destinationModel[srcPropKey] = srcPropVal;
1019
+ // here, it should be a 'J' or 'N' (or 'T' or 'F'): assign the associated boolean value
1020
+ }
1021
+ else {
1022
+ destinationModel[srcPropKey] = BooleanTextDecorator.GetLogicalBooleanValue(srcPropVal);
1023
+ }
1024
+ }
1025
+ else if (DateFieldFieldDecorator.IsDateField(destinationModel, srcPropKey)) {
1026
+ destinationModel[srcPropKey] = DateFieldFieldDecorator.StringAsDate(srcPropVal);
1027
+ }
1028
+ else if (StringNumberDecorator.IsStringNumber(destinationModel, srcPropKey)) {
1029
+ destinationModel[srcPropKey] = StringNumberDecorator.StringAsNumber(srcPropVal);
1030
+ }
1031
+ // non-decorated prop
1032
+ else {
1033
+ if (isNill(srcPropVal)) {
1034
+ destinationModel[srcPropKey] = undefined;
1035
+ }
1036
+ else if (Array.isArray(srcPropVal)) {
1037
+ destinationModel[srcPropKey] = ArrayUtils.CloneArray(srcPropVal);
1038
+ }
1039
+ else if (typeof srcPropVal === "object") {
1040
+ if (srcPropVal instanceof Map) { //just copy the value in case of maps
1041
+ destinationModel[srcPropKey] = srcPropVal;
1042
+ }
1043
+ else {
1044
+ destinationModel[srcPropKey] = Object.assign({}, srcPropVal);
1045
+ }
1046
+ }
1047
+ else {
1048
+ destinationModel[srcPropKey] = srcPropVal;
1049
+ }
1050
+ }
1051
+ }
1052
+ }
1053
+ }
1054
+
1055
+ var LanguageCode;
1056
+ (function (LanguageCode) {
1057
+ LanguageCode["Dutch"] = "nl-NL";
1058
+ LanguageCode["English"] = "en-GB";
1059
+ LanguageCode["German"] = "de-DE";
1060
+ LanguageCode["French"] = "fr-FR";
1061
+ })(LanguageCode || (LanguageCode = {}));
1062
+
1063
+ // Static utility functions holder related to strings.
1064
+ class StringUtils {
1065
+ /**
1066
+ * Returns a new string where given placeholder in given source string are replaced by given replacement texts.
1067
+ *
1068
+ * Example usage:
1069
+ *
1070
+ * source = "ABCDABCD"
1071
+ * placeholder = "BC"
1072
+ * replacementTexts = "Z", "Z" (REST arguments)
1073
+ * OUTPUT = "AZDAZD"
1074
+ *
1075
+ * @param {string} source
1076
+ * @param {string} placeholder
1077
+ * @param {string} replacementTexts If only one is given, this function replaces all placeholders with that single replacementText.
1078
+ * If more are given, placeholders without a corresponding replacementText will remain their original placeholder characters.
1079
+ */
1080
+ static ReplaceOccurrencesIn(source, placeholder, ...replacementTexts) {
1081
+ // parameter guards
1082
+ if (!(source)) {
1083
+ return undefined;
1084
+ }
1085
+ if (!placeholder || replacementTexts.length === 0) {
1086
+ return source;
1087
+ }
1088
+ let outString = source;
1089
+ // one replacementText means replace for all
1090
+ if (replacementTexts.length === 1) {
1091
+ // "g" is the g flag to replace globally
1092
+ outString = outString.replace(placeholder, replacementTexts[0]);
1093
+ }
1094
+ else {
1095
+ // replace occurence i by replacementTexts[i], one at a time in loop (there might be a faster way..)
1096
+ for (let i = 0, len = replacementTexts.length; i < len; i++) {
1097
+ outString = outString.replace(placeholder, replacementTexts[i]);
1098
+ }
1099
+ }
1100
+ return outString;
1101
+ }
1102
+ // Returns the given argument as a string. Returns given defaultValue if conversion of argument to string was impossible.
1103
+ static ParseString(arg, defaultValue = "") {
1104
+ if (!StringUtils.IsString(arg)) {
1105
+ if (arg && typeof arg.toString === "function") {
1106
+ arg = arg.toString();
1107
+ }
1108
+ else {
1109
+ arg = defaultValue;
1110
+ }
1111
+ }
1112
+ return arg;
1113
+ }
1114
+ static IsString(str) {
1115
+ return typeof str === 'string';
1116
+ }
1117
+ // Returns whether given str is a string and has a length > 0.
1118
+ static IsStringWithLength(str) {
1119
+ return str && StringUtils.IsString(str) && str.length > 0;
1120
+ }
1121
+ // Returns given string, escaped for use as string literal in regular expressions.
1122
+ static _escapeRegExp(str) {
1123
+ return str; // .replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^$\|]/g, "\\$&");
1124
+ }
1125
+ }
1126
+
1127
+ class Dictionary {
1128
+ constructor() {
1129
+ this.strings = {
1130
+ "nl": {},
1131
+ "de": {},
1132
+ "fr": {},
1133
+ "en": {},
1134
+ };
1135
+ }
1136
+ }
1137
+
1138
+ // The localization service, providing peers with text translation functionality.
1139
+ class DictionaryService {
1140
+ constructor() {
1141
+ this.dictionaryUrl = "js/browser/res/dictionary/";
1142
+ // private _dictionaryPromise: Map<LanguageCode, Promise<{ [key: string]: string }>> = new Map<LanguageCode, Promise<{ [key: string]: string }>>();
1143
+ this._dictionaries = new Map();
1144
+ // Some dictionary values have one or more '|~' texts in them, meant to be replaced with client-side given texts.
1145
+ this._placeholder = "|~";
1146
+ }
1147
+ get language() {
1148
+ return this._language;
1149
+ }
1150
+ set rootUrl(value) {
1151
+ this._rootUrl = value;
1152
+ this._dictBasePath = this._rootUrl + "/" + this.dictionaryUrl;
1153
+ }
1154
+ // Loads the dictionary for given language in memory.
1155
+ setDictionary(language) {
1156
+ return __awaiter(this, void 0, void 0, function* () {
1157
+ this._language = language || LanguageCode.Dutch;
1158
+ this._loadDictionary();
1159
+ });
1160
+ }
1161
+ _loadDictionary() {
1162
+ if (!this._dictionaries.has(this._language)) {
1163
+ const dictionary = new Dictionary();
1164
+ // eslint-disable-next-line no-magic-numbers
1165
+ if (dictionary.strings[this._language.substr(0, 2).toLowerCase()] !== undefined) {
1166
+ // eslint-disable-next-line no-magic-numbers
1167
+ this._dictionaries.set(this._language, dictionary.strings[this._language.substr(0, 2).toLowerCase()]);
1168
+ }
1169
+ }
1170
+ }
1171
+ /**
1172
+ * Returns the localized text for the given dictionary key.
1173
+ * @param {string} key
1174
+ * @param {boolean} [upperCaseFirst = true] False for first letter lowercase, true for first letter uppercase for returned dict val
1175
+ * @param {string[]} replacementTexts Rest params for replacement of '|~' in returned dict value
1176
+ * @returns {string} The translated text for given dictionary key
1177
+ */
1178
+ get(key, upperCaseFirst = true, ...replacementTexts) {
1179
+ if (!StringUtils.IsStringWithLength(key)) {
1180
+ return key || "";
1181
+ }
1182
+ if (this.language === undefined) {
1183
+ this._language = LanguageCode.Dutch;
1184
+ this._loadDictionary();
1185
+ }
1186
+ let text = this._dictionaries.get(this.language)[key];
1187
+ text = StringUtils.IsStringWithLength(text) ? text : key;
1188
+ if (upperCaseFirst) {
1189
+ text = text.charAt(0).toUpperCase() + text.slice(1);
1190
+ }
1191
+ else {
1192
+ text = text.charAt(0).toLowerCase() + text.slice(1);
1193
+ }
1194
+ if (replacementTexts.length > 0) {
1195
+ text = StringUtils.ReplaceOccurrencesIn(text, this._placeholder, ...replacementTexts);
1196
+ }
1197
+ return text;
1198
+ }
1199
+ }
1200
+ DictionaryService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DictionaryService_Factory() { return new DictionaryService(); }, token: DictionaryService, providedIn: "root" });
1201
+ DictionaryService.decorators = [
1202
+ { type: Injectable, args: [{
1203
+ providedIn: "root"
1204
+ },] }
1205
+ ];
1206
+ DictionaryService.ctorParameters = () => [];
1207
+
1208
+ class OptionsService {
1209
+ constructor(_dictionary) {
1210
+ this._dictionary = _dictionary;
1211
+ this.optionsInitialized = new BehaviorSubject(false);
1212
+ this.optionsLoaded = new BehaviorSubject(false);
1213
+ }
1214
+ set options(value) {
1215
+ this._options = value;
1216
+ }
1217
+ get options() {
1218
+ return this._options;
1219
+ }
1220
+ createSettingsFromObject(obj) {
1221
+ return __awaiter(this, void 0, void 0, function* () {
1222
+ this.options = new Object();
1223
+ if (obj.hasOwnProperty("url")) {
1224
+ this.options.url = obj["url"];
1225
+ }
1226
+ if (obj.hasOwnProperty("schema")) {
1227
+ this.options.schema = obj["schema"];
1228
+ }
1229
+ if (obj.hasOwnProperty("version")) {
1230
+ this.options.version = obj["version"];
1231
+ }
1232
+ if (obj.hasOwnProperty("languageCode")) {
1233
+ this.options.languageCode = obj["languageCode"];
1234
+ }
1235
+ else {
1236
+ this.options.languageCode = "NL";
1237
+ }
1238
+ if (obj.hasOwnProperty("username")) {
1239
+ this.options.username = obj["username"];
1240
+ }
1241
+ if (obj.hasOwnProperty("password")) {
1242
+ this.options.password = obj["password"];
1243
+ }
1244
+ if (obj.hasOwnProperty("session")) {
1245
+ this.options.session = obj["session"];
1246
+ }
1247
+ if (obj.hasOwnProperty("useLoginEncryption")) {
1248
+ this.options.useLoginEncryption = obj["useLoginEncryption"];
1249
+ }
1250
+ this.optionsLoaded.next(true);
1251
+ });
1252
+ }
1253
+ initialize(options) {
1254
+ return __awaiter(this, void 0, void 0, function* () {
1255
+ if (options) {
1256
+ yield this.createSettingsFromObject(options);
1257
+ yield this._dictionary.setDictionary(this.options.languageCode);
1258
+ this.optionsInitialized.next(true);
1259
+ }
1260
+ });
1261
+ }
1262
+ }
1263
+ OptionsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function OptionsService_Factory() { return new OptionsService(i0.ɵɵinject(DictionaryService)); }, token: OptionsService, providedIn: "root" });
1264
+ OptionsService.decorators = [
1265
+ { type: Injectable, args: [{
1266
+ providedIn: "root"
1267
+ },] }
1268
+ ];
1269
+ OptionsService.ctorParameters = () => [
1270
+ { type: DictionaryService }
1271
+ ];
1272
+
1273
+ class SharedConnectorService {
1274
+ constructor(_optionsService) {
1275
+ this._optionsService = _optionsService;
1276
+ this._boFactory = new BusinessObjectFactory();
1277
+ }
1278
+ connect() {
1279
+ return __awaiter(this, void 0, void 0, function* () {
1280
+ this.articleConnector = new Articles(this._optionsService.options);
1281
+ this.sharedConnector = new Sharedapi(this._optionsService.options);
1282
+ });
1283
+ }
1284
+ getAllPrinters(showAll = true) {
1285
+ return __awaiter(this, void 0, void 0, function* () {
1286
+ return new Promise((resolve, reject) => {
1287
+ return this.sharedConnector.listAllPrinters(showAll).then((result) => {
1288
+ if (result.validationResult && result.validationResult.success) {
1289
+ if (result.resultObject) {
1290
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(Printer, result.resultObject));
1291
+ }
1292
+ }
1293
+ else {
1294
+ reject(result.validationMessagesAsString);
1295
+ }
1296
+ });
1297
+ });
1298
+ });
1299
+ }
1300
+ getPrintStockStickers(request) {
1301
+ return __awaiter(this, void 0, void 0, function* () {
1302
+ return new Promise((resolve, reject) => {
1303
+ return this.sharedConnector.getPrintStockStickers(request).then((result) => {
1304
+ if (result.validationResult && result.validationResult.success) {
1305
+ if (result.resultObject) {
1306
+ resolve(this._boFactory.makeWithRawBackendData(PrintStockStickers, result.resultObject));
1307
+ }
1308
+ }
1309
+ else {
1310
+ reject(result.validationMessagesAsString);
1311
+ }
1312
+ });
1313
+ });
1314
+ });
1315
+ }
1316
+ getPrintPriceStickers(request) {
1317
+ return __awaiter(this, void 0, void 0, function* () {
1318
+ return new Promise((resolve, reject) => {
1319
+ return this.sharedConnector.printPriceStickers(request).then((result) => {
1320
+ if (result.validationResult && result.validationResult.success) {
1321
+ if (result.resultObject) {
1322
+ resolve(this._boFactory.makeWithRawBackendData(PrintPriceStickers, result.resultObject));
1323
+ }
1324
+ }
1325
+ else {
1326
+ reject(result.validationMessagesAsString);
1327
+ }
1328
+ });
1329
+ });
1330
+ });
1331
+ }
1332
+ // public async getStockStickerPrintLayouts(stockStickersPrintLayouts: StockStickersPrintLayouts): Promise<StockStickersPrintLayouts[]> {
1333
+ // return new Promise((resolve: Function, reject: Function) => {
1334
+ // return this.sharedConnector.getStockStickerPrintLayouts(stockStickersPrintLayouts).then((result: DataServiceResponse) => {
1335
+ // if (result.validationResult && result.validationResult.success) {
1336
+ // if (result.resultObject) {
1337
+ // resolve(this._boFactory.makeWithRawBackendData(stockStickersPrintLayouts, result.resultObject));
1338
+ // }
1339
+ // } else {
1340
+ // reject(result.validationMessagesAsString);
1341
+ // }
1342
+ // })
1343
+ // })
1344
+ // }
1345
+ getArticleFullObject(goodId) {
1346
+ return __awaiter(this, void 0, void 0, function* () {
1347
+ return new Promise((resolve, reject) => {
1348
+ return this.articleConnector.getArticleFullObject(goodId).then((result) => {
1349
+ // if (result.validationResult && result.validationResult.success) {
1350
+ // if (result.resultObject) {
1351
+ // resolve(this._boFactory.makeWithRawBackendData(ArticleExtended, result.resultObject));
1352
+ // }
1353
+ // } else {
1354
+ // reject(result.validationMessagesAsString);
1355
+ // }
1356
+ });
1357
+ });
1358
+ });
1359
+ }
1360
+ getStockHistory(request) {
1361
+ return __awaiter(this, void 0, void 0, function* () {
1362
+ return new Promise((resolve, reject) => {
1363
+ return this.articleConnector.getStockHistory(request).then((result) => {
1364
+ if (result.validationResult && result.validationResult.success) {
1365
+ if (result.resultObject && result.resultObject.hasOwnProperty("stockHistory")) {
1366
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockHistoryBo, result.resultObject.stockHistory));
1367
+ }
1368
+ }
1369
+ else {
1370
+ reject(result.validationMessagesAsString);
1371
+ }
1372
+ });
1373
+ });
1374
+ });
1375
+ }
1376
+ getStockInformation(data) {
1377
+ return __awaiter(this, void 0, void 0, function* () {
1378
+ return new Promise((resolve, reject) => {
1379
+ return this.articleConnector.getStockInformation(data).then((result) => {
1380
+ if (result.validationResult && result.validationResult.success) {
1381
+ if (result.resultObjects) {
1382
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(ArticleStock, result.resultObjects));
1383
+ }
1384
+ }
1385
+ else {
1386
+ reject(result.validationMessagesAsString);
1387
+ }
1388
+ });
1389
+ });
1390
+ });
1391
+ }
1392
+ getStockManagementWarehouses() {
1393
+ return __awaiter(this, void 0, void 0, function* () {
1394
+ return new Promise((resolve, reject) => {
1395
+ return this.articleConnector.getStockManagementWarehouses().then((result) => {
1396
+ if (result.validationResult && result.validationResult.success) {
1397
+ if (result.resultObjects) {
1398
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockManagementWarehouses, result.resultObjects));
1399
+ }
1400
+ }
1401
+ else {
1402
+ reject(result.validationMessagesAsString);
1403
+ }
1404
+ });
1405
+ });
1406
+ });
1407
+ }
1408
+ getStockManagementLocations(warehouseNo) {
1409
+ return __awaiter(this, void 0, void 0, function* () {
1410
+ return new Promise((resolve, reject) => {
1411
+ return this.articleConnector.getStockManagementLocations(warehouseNo).then((result) => {
1412
+ if (result.validationResult && result.validationResult.success) {
1413
+ if (result.resultObjects) {
1414
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockLocation, result.resultObjects));
1415
+ }
1416
+ }
1417
+ else {
1418
+ reject(result.validationMessagesAsString);
1419
+ }
1420
+ });
1421
+ });
1422
+ });
1423
+ }
1424
+ getArticleDetails(data) {
1425
+ return __awaiter(this, void 0, void 0, function* () {
1426
+ return new Promise((resolve, reject) => {
1427
+ return this.articleConnector.getArticleDetails(data).then((result) => {
1428
+ if (result.validationResult && result.validationResult.success) {
1429
+ if (result.resultObjects) {
1430
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(ArticleDetailsBo, result.resultObjects));
1431
+ }
1432
+ }
1433
+ else {
1434
+ reject(result.validationMessagesAsString);
1435
+ }
1436
+ });
1437
+ });
1438
+ });
1439
+ }
1440
+ updateArticleDetails(data) {
1441
+ return __awaiter(this, void 0, void 0, function* () {
1442
+ return new Promise((resolve, reject) => {
1443
+ return this.articleConnector.updateArticleDetails(data).then((result) => __awaiter(this, void 0, void 0, function* () {
1444
+ if (result.validationResult && result.validationResult.success) {
1445
+ yield this.commit();
1446
+ resolve(true);
1447
+ }
1448
+ else {
1449
+ reject(result.validationMessagesAsString);
1450
+ }
1451
+ }));
1452
+ });
1453
+ });
1454
+ }
1455
+ lockArticleDetails(data) {
1456
+ return __awaiter(this, void 0, void 0, function* () {
1457
+ return new Promise((resolve, reject) => {
1458
+ return this.articleConnector.lockArticleDetails(data).then((result) => __awaiter(this, void 0, void 0, function* () {
1459
+ if (result.validationResult && result.validationResult.success) {
1460
+ yield this.commit();
1461
+ resolve(true);
1462
+ }
1463
+ else {
1464
+ reject(result.validationMessagesAsString);
1465
+ }
1466
+ }));
1467
+ });
1468
+ });
1469
+ }
1470
+ getStockStatus() {
1471
+ return __awaiter(this, void 0, void 0, function* () {
1472
+ return new Promise((resolve, reject) => {
1473
+ return this.articleConnector.getStockState().then((result) => {
1474
+ if (result.validationResult && result.validationResult.success) {
1475
+ if (result.resultObjects) {
1476
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockStatus, result.resultObjects));
1477
+ }
1478
+ }
1479
+ else {
1480
+ reject(result.validationMessagesAsString);
1481
+ }
1482
+ });
1483
+ });
1484
+ });
1485
+ }
1486
+ getStockStickerTemplates(data) {
1487
+ return __awaiter(this, void 0, void 0, function* () {
1488
+ return new Promise((resolve, reject) => {
1489
+ return this.sharedConnector.getStockStickerPrintLayouts(data).then((result) => {
1490
+ if (result.validationResult && result.validationResult.success) {
1491
+ if (result.resultObject) {
1492
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockStickersPrintLayouts, result.resultObject));
1493
+ }
1494
+ }
1495
+ else {
1496
+ reject(result.validationMessagesAsString);
1497
+ }
1498
+ });
1499
+ });
1500
+ });
1501
+ }
1502
+ getArticleTransaction(data) {
1503
+ return __awaiter(this, void 0, void 0, function* () {
1504
+ return new Promise((resolve, reject) => {
1505
+ return this.articleConnector.getArticleTransaction(data).then((result) => {
1506
+ if (result.validationResult && result.validationResult.success) {
1507
+ if (result.resultObjects) {
1508
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(ArticleTransaction, result.resultObjects));
1509
+ }
1510
+ }
1511
+ else {
1512
+ reject(result.validationMessagesAsString);
1513
+ }
1514
+ });
1515
+ });
1516
+ });
1517
+ }
1518
+ commit() {
1519
+ return this.articleConnector.commit();
1520
+ }
1521
+ }
1522
+ SharedConnectorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SharedConnectorService_Factory() { return new SharedConnectorService(i0.ɵɵinject(OptionsService)); }, token: SharedConnectorService, providedIn: "root" });
1523
+ SharedConnectorService.decorators = [
1524
+ { type: Injectable, args: [{
1525
+ providedIn: "root"
1526
+ },] }
1527
+ ];
1528
+ SharedConnectorService.ctorParameters = () => [
1529
+ { type: OptionsService }
1530
+ ];
1531
+
1532
+ class StockService {
1533
+ constructor(_sharedService) {
1534
+ this._sharedService = _sharedService;
1535
+ this.printSticker = new PrintStockStickers();
1536
+ this.printPriceSticker = new PrintPriceStickers();
1537
+ }
1538
+ getPrintStockStickers(data) {
1539
+ return __awaiter(this, void 0, void 0, function* () {
1540
+ yield this._sharedService.getPrintStockStickers(data);
1541
+ });
1542
+ }
1543
+ getPrintPriceStickers(data) {
1544
+ return __awaiter(this, void 0, void 0, function* () {
1545
+ yield this._sharedService.getPrintPriceStickers(data);
1546
+ });
1547
+ }
1548
+ getAllPrinters(showAll = true) {
1549
+ return __awaiter(this, void 0, void 0, function* () {
1550
+ return yield this._sharedService.getAllPrinters(showAll);
1551
+ });
1552
+ }
1553
+ getStockHistory(data) {
1554
+ return __awaiter(this, void 0, void 0, function* () {
1555
+ return yield this._sharedService.getStockHistory(data);
1556
+ });
1557
+ }
1558
+ getStockInformation(data) {
1559
+ return __awaiter(this, void 0, void 0, function* () {
1560
+ return yield this._sharedService.getStockInformation(data);
1561
+ });
1562
+ }
1563
+ // public async getStockStickerPrintLayouts(data: StockStickersPrintLayouts): Promise<StockStickersPrintLayouts[]> {
1564
+ // return await this._connector.getStockStickerPrintLayouts(data);
1565
+ // }
1566
+ getArticleDetails(data) {
1567
+ return __awaiter(this, void 0, void 0, function* () {
1568
+ return yield this._sharedService.getArticleDetails(data);
1569
+ });
1570
+ }
1571
+ updateArticleDetails(data) {
1572
+ return __awaiter(this, void 0, void 0, function* () {
1573
+ return yield this._sharedService.updateArticleDetails(data);
1574
+ });
1575
+ }
1576
+ getStockState() {
1577
+ return __awaiter(this, void 0, void 0, function* () {
1578
+ return yield this._sharedService.getStockStatus();
1579
+ });
1580
+ }
1581
+ getStockStickerTemplates(data) {
1582
+ return __awaiter(this, void 0, void 0, function* () {
1583
+ return yield this._sharedService.getStockStickerTemplates(data);
1584
+ });
1585
+ }
1586
+ getStockManagementWarehouses() {
1587
+ return __awaiter(this, void 0, void 0, function* () {
1588
+ return yield this._sharedService.getStockManagementWarehouses();
1589
+ });
1590
+ }
1591
+ getStockManagementLocations(warehouseNo) {
1592
+ return __awaiter(this, void 0, void 0, function* () {
1593
+ return yield this._sharedService.getStockManagementLocations(warehouseNo);
1594
+ });
1595
+ }
1596
+ getArticleTransaction(data) {
1597
+ return __awaiter(this, void 0, void 0, function* () {
1598
+ return yield this._sharedService.getArticleTransaction(data);
1599
+ });
1600
+ }
1601
+ lockArticleDetails(data) {
1602
+ return __awaiter(this, void 0, void 0, function* () {
1603
+ return yield this._sharedService.lockArticleDetails(data);
1604
+ });
1605
+ }
1606
+ commit() {
1607
+ return this._sharedService.commit();
1608
+ }
1609
+ }
1610
+ StockService.ɵprov = i0.ɵɵdefineInjectable({ factory: function StockService_Factory() { return new StockService(i0.ɵɵinject(SharedConnectorService)); }, token: StockService, providedIn: "root" });
1611
+ StockService.decorators = [
1612
+ { type: Injectable, args: [{
1613
+ providedIn: 'root',
1614
+ },] }
1615
+ ];
1616
+ StockService.ctorParameters = () => [
1617
+ { type: SharedConnectorService }
1618
+ ];
1619
+
1620
+ class StockComponent {
1621
+ constructor(stockService, _optionsService, _dictionary, _changeDetector) {
1622
+ this.stockService = stockService;
1623
+ this._optionsService = _optionsService;
1624
+ this._dictionary = _dictionary;
1625
+ this._changeDetector = _changeDetector;
1626
+ this.handleStickerClicked = new EventEmitter();
1627
+ this.showStockInformationGrid = true;
1628
+ this.showStockLocation = false;
1629
+ this.showStockTransfer = false;
1630
+ this.allAvailableStock = 0;
1631
+ this.allTechnicalStock = 0;
1632
+ this._subscriptions = [];
1633
+ this._subscriptions.push(this._optionsService.optionsLoaded.subscribe(loaded => this._handleSettingsLoaded(loaded)));
1634
+ }
1635
+ set article(article) {
1636
+ this.articleExtended = article;
1637
+ this.getStockInformation(article);
1638
+ }
1639
+ ;
1640
+ showClass() {
1641
+ return true;
1642
+ }
1643
+ ngOnDestroy() {
1644
+ this._subscriptions.forEach(subscription => subscription.unsubscribe());
1645
+ }
1646
+ backToStockLinesClicked() {
1647
+ this.showStockLocation = false;
1648
+ this.showStockInformationGrid = true;
1649
+ }
1650
+ handleStockTransferClick(event) {
1651
+ this.stockTransferArticleDetails = event;
1652
+ this.showStockTransfer = !this.showStockTransfer;
1653
+ this.showStockInformationGrid = !this.showStockInformationGrid;
1654
+ this.stockService.stockStickers = new PrintStockStickers();
1655
+ }
1656
+ backToStock() {
1657
+ this.showStockTransfer = !this.showStockTransfer;
1658
+ this.showStockInformationGrid = !this.showStockInformationGrid;
1659
+ }
1660
+ getStockHistory() {
1661
+ return __awaiter(this, void 0, void 0, function* () {
1662
+ const stockHistoryInformation = new GetStockHistoryRequest();
1663
+ stockHistoryInformation.type = "B";
1664
+ stockHistoryInformation.goodId = this.articleExtended.goodId.toString();
1665
+ this.stockHistory = yield this.stockService.getStockHistory(stockHistoryInformation);
1666
+ });
1667
+ }
1668
+ getStockInformation(data) {
1669
+ return __awaiter(this, void 0, void 0, function* () {
1670
+ const articleData = new ArticleStock$1();
1671
+ articleData.goodId = data.goodId.toString();
1672
+ articleData.viewKind = "M";
1673
+ this.stockInformation = yield this.stockService.getStockInformation(articleData);
1674
+ this.stockInformation.forEach((articleStock) => this.allAvailableStock += articleStock.availableStock);
1675
+ this.stockInformation.forEach((articleStock) => this.allTechnicalStock += articleStock.technicalStock);
1676
+ });
1677
+ }
1678
+ _handleSettingsLoaded(loaded) {
1679
+ return __awaiter(this, void 0, void 0, function* () {
1680
+ if (loaded) {
1681
+ yield this._initConnection().then();
1682
+ }
1683
+ });
1684
+ }
1685
+ _initConnection() {
1686
+ return __awaiter(this, void 0, void 0, function* () {
1687
+ // await this._connector.connect(this._optionsService.options);
1688
+ if (this._optionsService.options.url) {
1689
+ this._dictionary.rootUrl = this._optionsService.options.url.replace("/ajaxservice", "");
1690
+ }
1691
+ yield this._dictionary.setDictionary(this._optionsService.options.languageCode);
1692
+ setTimeout(() => {
1693
+ this._changeDetector.detectChanges();
1694
+ });
1695
+ });
1696
+ }
1697
+ }
1698
+ StockComponent.decorators = [
1699
+ { type: Component, args: [{
1700
+ selector: "co-stock",
1701
+ template: `
1702
+ <div class="stock-info-container">
1703
+ <co-stock-information [article]="articleExtended"
1704
+ [articleStock]=""
1705
+ [allAvailableStockInformation]="allAvailableStock"
1706
+ [allTechnicalStockInformation]="allTechnicalStock"
1707
+ >
1708
+ </co-stock-information>
1709
+ <hr>
1710
+ <co-stock-information-grid *ngIf="showStockInformationGrid"
1711
+ [stockLocationData]="stockLocationInformation"
1712
+ [articleStockInformation]="stockInformation"
1713
+ (transferIconClicked)="handleStockTransferClick($event)"
1714
+ (historyClicked)="getStockHistory()"
1715
+ [stockHistoryInformation]="stockHistory"
1716
+ >
1717
+ </co-stock-information-grid>
1718
+ <co-stock-location *ngIf="showStockLocation"
1719
+ (backToStockLines)="backToStockLinesClicked()">
1720
+
1721
+ </co-stock-location>
1722
+ <co-stock-transfer *ngIf="showStockTransfer"
1723
+ (handleCancelClicked)="backToStock()"
1724
+ [article]="stockTransferArticle"
1725
+ [articleToTransfer]="stockTransferArticleDetails"
1726
+ [stockSticker]="stockService.stockStickers"
1727
+ (handleStickerClicked)="handleStickerClicked.emit($event)"
1728
+ [articleWarehouse]="articleWarehouse"
1729
+ [allWarehouses]="allWarehouses"
1730
+ >
1731
+ </co-stock-transfer>
1732
+ </div>
1733
+ `,
1734
+ encapsulation: ViewEncapsulation.None
1735
+ },] }
1736
+ ];
1737
+ StockComponent.ctorParameters = () => [
1738
+ { type: StockService },
1739
+ { type: OptionsService },
1740
+ { type: DictionaryService },
1741
+ { type: ChangeDetectorRef }
1742
+ ];
1743
+ StockComponent.propDecorators = {
1744
+ stock: [{ type: ViewChild, args: [StockComponent,] }],
1745
+ handleStickerClicked: [{ type: Output }],
1746
+ article: [{ type: Input }],
1747
+ articleWarehouse: [{ type: Input }],
1748
+ allWarehouses: [{ type: Input }],
1749
+ showClass: [{ type: HostBinding, args: ["class.co-stock",] }]
1750
+ };
1751
+
1752
+ class StockInformationComponent {
1753
+ constructor() {
1754
+ }
1755
+ }
1756
+ StockInformationComponent.decorators = [
1757
+ { type: Component, args: [{
1758
+ selector: "co-stock-information",
1759
+ template: `
1760
+ <div class="stock-info" *ngIf="article">
1761
+ <div class="stock-info-row" >
1762
+ <div class="stock-info-row-image">
1763
+ <div class="stock-image">
1764
+ <co-image class="stock-image" [source]="article.imageData"></co-image>
1765
+ </div>
1766
+ </div>
1767
+ <div class="stock-good-info">
1768
+ <div>
1769
+ <span [textContent]="article.description"></span>
1770
+ </div>
1771
+ <div>
1772
+ <span [textContent]="article.articleNumber"></span>
1773
+ </div>
1774
+ </div>
1775
+ </div>
1776
+ <div class="stock-status">
1777
+ <label [textContent]="'STOCK_STATUS'"></label>
1778
+ <span [textContent]="article.stockStatus"></span>
1779
+ </div>
1780
+ <div class="stock-status">
1781
+ <label [textContent]="'AMOUNT_IN_STOCK'"></label>
1782
+ <span [textContent]="allTechnicalStockInformation"></span>
1783
+ </div>
1784
+ <div class="stock-status">
1785
+ <label [textContent]="'AMOUNT_AVAILABLE'"></label>
1786
+ <span [textContent]="allAvailableStockInformation"></span>
1787
+ </div>
1788
+ <div class="stock-status">
1789
+ <label [textContent]="'AMOUNT_LATER_AVAILABLE'"></label>
1790
+ <span [textContent]=""></span>
1791
+ </div>
1792
+ </div>
1793
+ `,
1794
+ encapsulation: ViewEncapsulation.None
1795
+ },] }
1796
+ ];
1797
+ StockInformationComponent.ctorParameters = () => [];
1798
+ StockInformationComponent.propDecorators = {
1799
+ article: [{ type: Input }],
1800
+ articleStock: [{ type: Input }],
1801
+ allAvailableStockInformation: [{ type: Input }],
1802
+ allTechnicalStockInformation: [{ type: Input }]
1803
+ };
1804
+
1805
+ /** AUTO GENERATED FILE. DO NOT CHANGE.. OR YOU WILL SUFFER THE CONSEQUENCES OF YOUR ACTIONS **/
1806
+ const IconSvg = {
1807
+ "angle_left_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\"><path fill=\"#183153\" d=\"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z\"/></svg>",
1808
+ "angle_right_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\"><path fill=\"#183153\" d=\"M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z\"/></svg>",
1809
+ "arrow_fat_right": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><polygon points=\"37.5 25 25.2 12.7 25.2 20.35 12.5 20.35 12.5 29.66 25.2 29.66 25.2 37.3 37.5 25\" fill=\"#484f60\"/></svg>",
1810
+ "arrow_point_left": "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" viewBox=\"0 0 51 51\" enable-background=\"new 0 0 51 51\" ><path fill=\"#484F5F\" d=\"M31.9,36.7l-14.7-9.6C17.1,27,17,26.9,17,26.7v-2.4c0-0.2,0.1-0.3,0.2-0.4l14.7-9.6c0.2-0.2,0.5-0.1,0.7,0.1l1.4,2.1c0.2,0.2,0.1,0.5-0.1,0.7l-12,7.8c-0.3,0.2-0.3,0.6,0,0.8l12,7.8c0.2,0.2,0.3,0.5,0.1,0.7l-1.4,2.1C32.4,36.8,32.1,36.8,31.9,36.7z\"/></svg>",
1811
+ "arrow_point_right": "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" viewBox=\"0 0 51 51\" enable-background=\"new 0 0 51 51\"><path fill=\"#484F5F\" d=\"M19.1,14.3l14.7,9.6c0.1,0.1,0.2,0.2,0.2,0.4v2.4c0,0.2-0.1,0.3-0.2,0.4l-14.7,9.6c-0.2,0.2-0.5,0.1-0.7-0.1l-1.4-2.1c-0.2-0.2-0.1-0.5,0.1-0.7l12-7.8c0.3-0.2,0.3-0.6,0-0.8l-12-7.8c-0.2-0.2-0.3-0.5-0.1-0.7l1.4-2.1C18.6,14.2,18.9,14.2,19.1,14.3z\"/></svg>",
1812
+ "bring_forward_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"#183153\" d=\"M224 464H448C456.8 464 464 456.8 464 448V224C464 215.2 456.8 208 448 208H384V160H448C483.3 160 512 188.7 512 224V448C512 483.3 483.3 512 448 512H224C188.7 512 160 483.3 160 448V384H208V448C208 456.8 215.2 464 224 464zM64 352C28.65 352 0 323.3 0 288V64C0 28.65 28.65 0 64 0H288C323.3 0 352 28.65 352 64V288C352 323.3 323.3 352 288 352H64z\"/></svg>",
1813
+ "check_round": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M25,10A15,15,0,1,0,40,25,15,15,0,0,0,25,10ZM23,34l-6.24-9.09,2.81-3.59L23,26.45,27.66,16h5.58Z\" fill=\"#484f60\"/></svg>",
1814
+ "delete_left_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><path d=\"M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z\"/></svg>",
1815
+ "delivery_truck": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><rect x=\"15.35\" y=\"16.56\" width=\"15.14\" height=\"10.94\" transform=\"translate(-1.83 2.08) rotate(-5)\" fill=\"#484f60\"/><path d=\"M38.5,18.1l-6.9.61L32.41,28l-7.63.67a3.76,3.76,0,0,1,1.43,2.25l7.25-.63A3.83,3.83,0,0,1,41,29.6l1-.1-.52-6Zm.29,5.84-3.91.34a.51.51,0,0,1-.55-.46L34,20.1a.49.49,0,0,1,.45-.54l2.27-.2a.5.5,0,0,1,.48.25l2,3.59A.5.5,0,0,1,38.79,23.94Z\" fill=\"#484f60\"/><path d=\"M19.66,29.09a3.8,3.8,0,0,0-1,2.46l-.74.07-1.82-.94L16,29.41Z\" fill=\"#484f60\"/><path d=\"M34.56,30.62a2.74,2.74,0,1,0,2.49-3A2.73,2.73,0,0,0,34.56,30.62Z\" fill=\"#484f60\"/><path d=\"M19.74,31.91a2.74,2.74,0,1,0,2.49-3A2.74,2.74,0,0,0,19.74,31.91Z\" fill=\"#484f60\"/><rect x=\"7.96\" y=\"17.63\" width=\"5\" height=\"1\" transform=\"translate(-1.54 0.98) rotate(-5)\" fill=\"#484f60\"/><rect x=\"11.02\" y=\"29.71\" width=\"3\" height=\"1\" transform=\"translate(-2.59 1.21) rotate(-5)\" fill=\"#484f60\"/><rect x=\"9.48\" y=\"23.53\" width=\"4\" height=\"1\" transform=\"matrix(1, -0.09, 0.09, 1, -2.05, 1.09)\" fill=\"#484f60\"/></svg>",
1816
+ "email": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M31.79,38.45A17.82,17.82,0,0,1,23.86,40,13.09,13.09,0,0,1,10.41,26.42C10.41,17.63,16.83,10,26.53,10c7.63,0,13.06,5.21,13.06,12.46,0,6.33-3.53,10.3-8.19,10.3a3.42,3.42,0,0,1-3.71-3.32h-.08A6.5,6.5,0,0,1,22,32.76c-2.75,0-4.82-2.11-4.82-5.65a9.85,9.85,0,0,1,10.13-10,12.89,12.89,0,0,1,5.13,1l-1.3,8c-.43,2.54-.13,3.71,1.08,3.75,1.85.09,4.18-2.28,4.18-7.28,0-5.65-3.62-10-10.3-10S13.73,17.76,13.73,26c0,7.25,4.57,11.3,11,11.3A14.81,14.81,0,0,0,31,36ZM28,20.65a5.34,5.34,0,0,0-1.33-.18c-2.85,0-5.09,2.81-5.09,6.12,0,1.64.73,2.68,2.16,2.68,1.59,0,3.27-2,3.66-4.53Z\" fill=\"#484f60\"/></svg>",
1817
+ "pdf": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M31.42,40.17H13.88c-2.16,0-2.72-.56-2.72-2.72V12.88c0-2.15.56-2.71,2.72-2.71h11.6l8.66,8.88v3.43H32.8V19.6l-7.88-8.09h-11c-1.38,0-1.38,0-1.38,1.37V37.45c0,1.37,0,1.37,1.38,1.37H31.42c1.38,0,1.38,0,1.38-1.37V35h1.34v2.43C34.14,39.61,33.58,40.17,31.42,40.17Z\" fill=\"#484f60\"/><path d=\"M27.83,26.63v4.24h1a3.57,3.57,0,0,0,.78-.06,1.22,1.22,0,0,0,.52-.26,1.44,1.44,0,0,0,.34-.62,4.13,4.13,0,0,0,.13-1.18,3.79,3.79,0,0,0-.13-1.14,1.51,1.51,0,0,0-.37-.62,1.14,1.14,0,0,0-.6-.3,5.93,5.93,0,0,0-1.06-.06Z\" fill=\"#484f60\"/><path d=\"M21.86,26.63v1.82h.71a3.57,3.57,0,0,0,1-.1A.88.88,0,0,0,24,28a.84.84,0,0,0,.14-.5.8.8,0,0,0-.2-.57.88.88,0,0,0-.52-.29,6.36,6.36,0,0,0-.93,0Z\" fill=\"#484f60\"/><path d=\"M19.14,24.27v9h19.7v-9Zm6.12,4.24a1.68,1.68,0,0,1-.54.63,1.9,1.9,0,0,1-.67.3,6.57,6.57,0,0,1-1.34.1h-.85V32H20.57V25.54h2.07a7.75,7.75,0,0,1,1.54.1,1.73,1.73,0,0,1,.93.63,2,2,0,0,1,.37,1.25A2,2,0,0,1,25.26,28.51Zm6.45,1.66A2.91,2.91,0,0,1,31,31.31a2.28,2.28,0,0,1-.91.51A4,4,0,0,1,29,32H26.54V25.54H28.9a4.21,4.21,0,0,1,1.22.13,2.08,2.08,0,0,1,1,.59,2.79,2.79,0,0,1,.61,1,4.76,4.76,0,0,1,.21,1.52A4.19,4.19,0,0,1,31.71,30.17Zm5.7-3.54h-3.1v1.52H37v1.08H34.31V32H33V25.54h4.39Z\" fill=\"#484f60\"/><path d=\"M25.2,10.84v6.44c0,1.78.27,2,2,2h6.23Z\" fill=\"#484f60\"/></svg>",
1818
+ "print": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M38,16.5H12a2,2,0,0,0-2,2v9a2,2,0,0,0,2,2h2v-5H36v5h2a2,2,0,0,0,2-2v-9A2,2,0,0,0,38,16.5ZM37,21a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,37,21Z\" fill=\"#484f60\"/><path d=\"M35,11.5v5H15v-5H35m1-1H14v7H36v-7Z\" fill=\"#484f60\"/><path d=\"M35,25.5v13H15v-13H35m1-1H14v15H36v-15Z\" fill=\"#484f60\"/><rect x=\"17\" y=\"28.3\" width=\"16\" height=\"0.8\" fill=\"#484f60\"/><rect x=\"17\" y=\"31.5\" width=\"16\" height=\"0.8\" fill=\"#484f60\"/><rect x=\"17\" y=\"34.7\" width=\"16\" height=\"0.8\" fill=\"#484f60\"/></svg>",
1819
+ "signature_field": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M20.1,25.42a1.1,1.1,0,1,1,1.27,1.45l-3.3,9.07A63.13,63.13,0,0,1,28,28.3l1.26-12-8.26-3-6.77,10A62.4,62.4,0,0,1,17,35.54l3.3-9.07A1.12,1.12,0,0,1,20.1,25.42Z\" fill=\"#484f60\"/><rect x=\"21.62\" y=\"11.43\" width=\"8.79\" height=\"2.34\" transform=\"translate(5.88 -8.14) rotate(20)\" fill=\"#484f60\"/><path d=\"M18.11,37.48c1.44,2.65,4.58,2.94,7.23,2.1,1.41-.44,2.2-1.49,3.44-2.06,2.42-1.1,3.13,1.2,5.36,1.37.42,0,2-.65,1.54-.68-2.55-.19-2.93-3.13-5.51-2.65a4.9,4.9,0,0,0-1.64.71c-.77.49-1.31,1.62-2.07,2l-4.61.56A3.38,3.38,0,0,1,20,37c-.22-.41-2,.28-1.85.5Z\" fill=\"#484f60\"/></svg>",
1820
+ "xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M31.42,40.17H13.87c-2.15,0-2.71-.56-2.71-2.72V12.88c0-2.15.56-2.71,2.71-2.71H25.48l8.66,8.88v3.43H32.8V19.6l-7.88-8.09H13.87c-1.37,0-1.37,0-1.37,1.37V37.45c0,1.37,0,1.37,1.37,1.37H31.42c1.38,0,1.38,0,1.38-1.37V35h1.34v2.43C34.14,39.61,33.58,40.17,31.42,40.17Z\" fill=\"#484f60\"/><path d=\"M25.2,10.84v6.44c0,1.78.27,2,2,2h6.23Z\" fill=\"#484f60\"/><path d=\"M19.14,24.27v9h19.7v-9Zm5.36,7.41-1.3-2-1.3,2H20.48l2-3.06-1.81-2.8h1.38l1.18,1.88,1.15-1.88h1.37l-1.83,2.85,2,3Zm7.67,0h-1.1V27.07l-1.16,4.61H28.77l-1.16-4.61v4.61H26.52V25.82h1.76l1.07,4,1-4h1.77Zm5.33,0H33.38V25.87h1.18v4.82H37.5Z\" fill=\"#484f60\"/></svg>"
1821
+ };
1822
+
1823
+ class IconCacheService {
1824
+ constructor(_sanitizer) {
1825
+ this._sanitizer = _sanitizer;
1826
+ this._iconCache = {};
1827
+ this.setIconCache();
1828
+ }
1829
+ /**
1830
+ * All the icons as a large JSON object, from the all-icons.json file.
1831
+ * The object has property keys that are the icon names, and property values with the data string of the actual svg icon.
1832
+ */
1833
+ get iconCache() {
1834
+ return this._iconCache;
1835
+ }
1836
+ getIcon(iconName) {
1837
+ if (iconName) {
1838
+ return this._iconCache[iconName.toLowerCase()];
1839
+ }
1840
+ }
1841
+ getIconAsBase64(iconName) {
1842
+ const icon = IconSvg[iconName];
1843
+ const base64Data = window.btoa(icon);
1844
+ return this._sanitizer.bypassSecurityTrustUrl(`data:image/svg+xml;base64,${base64Data}`);
1845
+ }
1846
+ getRawIcon(iconName) {
1847
+ if (iconName) {
1848
+ return IconSvg[iconName.toLowerCase()];
1849
+ }
1850
+ }
1851
+ setIconCache() {
1852
+ for (const key in IconSvg) {
1853
+ if (IconSvg.hasOwnProperty(key) && typeof IconSvg[key] !== "function") {
1854
+ this._iconCache[key.toLowerCase()] = this._sanitizer.bypassSecurityTrustHtml(IconSvg[key]);
1855
+ }
1856
+ }
1857
+ }
1858
+ }
1859
+ IconCacheService.ɵprov = i0.ɵɵdefineInjectable({ factory: function IconCacheService_Factory() { return new IconCacheService(i0.ɵɵinject(i1.DomSanitizer)); }, token: IconCacheService, providedIn: "root" });
1860
+ IconCacheService.decorators = [
1861
+ { type: Injectable, args: [{
1862
+ providedIn: "root"
1863
+ },] }
1864
+ ];
1865
+ IconCacheService.ctorParameters = () => [
1866
+ { type: DomSanitizer }
1867
+ ];
1868
+
1869
+ /** AUTO GENERATED FILE. DO NOT CHANGE.. OR YOU WILL SUFFER THE CONSEQUENCES OF YOUR ACTIONS **/
1870
+ var Icon;
1871
+ (function (Icon) {
1872
+ Icon["AngleLeftSolid"] = "angle_left_solid";
1873
+ Icon["AngleRightSolid"] = "angle_right_solid";
1874
+ Icon["ArrowFatRight"] = "arrow_fat_right";
1875
+ Icon["ArrowPointLeft"] = "arrow_point_left";
1876
+ Icon["ArrowPointRight"] = "arrow_point_right";
1877
+ Icon["BringForwardRegular"] = "bring_forward_regular";
1878
+ Icon["CheckRound"] = "check_round";
1879
+ Icon["DeleteLeftRegular"] = "delete_left_regular";
1880
+ Icon["DeliveryTruck"] = "delivery_truck";
1881
+ Icon["Email"] = "email";
1882
+ Icon["Pdf"] = "pdf";
1883
+ Icon["Print"] = "print";
1884
+ Icon["SignatureField"] = "signature_field";
1885
+ Icon["Xml"] = "xml";
1886
+ })(Icon || (Icon = {}));
1887
+
1888
+ class StockInformationGridComponent {
1889
+ constructor(iconCacheService, _stockService) {
1890
+ this.iconCacheService = iconCacheService;
1891
+ this._stockService = _stockService;
1892
+ this.icons = Icon;
1893
+ this.transferIconClicked = new EventEmitter();
1894
+ this.historyClicked = new EventEmitter();
1895
+ this.show = false;
1896
+ this.hideOrShowLocationTab = false;
1897
+ this.showStockHistory = false;
1898
+ this.showSendMethodDialog = false;
1899
+ this.hideOrShowTabs = true;
1900
+ this.dataWareHouseFields = { text: "warehouseDescription", value: "warehouseNo" };
1901
+ this.articleStockSearchInfo = new ArticleStock$1();
1902
+ this.showChangeStockDetails = false;
1903
+ this.articleDetailsInformation = new ArticleStockManagement();
1904
+ this.tabs = [
1905
+ "STOCK",
1906
+ "IN_ORDER2",
1907
+ "ORDERS1"
1908
+ ];
1909
+ this.activeTab = this.tabs[0];
1910
+ }
1911
+ get activeTabText() {
1912
+ switch (this.activeTab) {
1913
+ case this.tabs[0]:
1914
+ return "Voorraadregels";
1915
+ case this.tabs[1]:
1916
+ return "Gevonden in order(s)";
1917
+ case this.tabs[2]:
1918
+ return "Gevonden in bestellingen";
1919
+ default:
1920
+ return "Voorraadlocatie regels";
1921
+ }
1922
+ }
1923
+ handleTabClick(tabData) {
1924
+ this.activeTab = tabData;
1925
+ if (this.activeTab === "IN_ORDER2") {
1926
+ this.getInOrderData();
1927
+ }
1928
+ if (this.activeTab === "ORDERS1") {
1929
+ this.getOrderData();
1930
+ }
1931
+ }
1932
+ onLocationClick(data) {
1933
+ this.articleStockSearchInfo.goodId = data.goodId.toString();
1934
+ this.articleStockSearchInfo.wareHouseNo = data.warehouseNo.toString();
1935
+ this.articleStockSearchInfo.viewKind = "D";
1936
+ this.selectedWarehouse = data.warehouseNo;
1937
+ if (!this.dataWareHouseCode) {
1938
+ this.getStockManagementWarehouses(data);
1939
+ }
1940
+ this.getArticleDetails(data);
1941
+ this.hideOrShowTabs = false;
1942
+ this.hideOrShowLocationTab = true;
1943
+ this._stockService.lockArticleDetails(this.articleDetailsInformation);
1944
+ }
1945
+ handleHistoryClick() {
1946
+ this.historyClicked.emit();
1947
+ this.hideOrShowLocationTab = false;
1948
+ this.showChangeStockDetails = false;
1949
+ this.hideOrShowTabs = false;
1950
+ this.showStockHistory = true;
1951
+ }
1952
+ backToStockInformation() {
1953
+ this.showStockHistory = false;
1954
+ this.hideOrShowTabs = true;
1955
+ }
1956
+ handleStockTransferClick(event) {
1957
+ this.transferIconClicked.emit(event);
1958
+ }
1959
+ handleBackToStockClick() {
1960
+ return __awaiter(this, void 0, void 0, function* () {
1961
+ this.activeTab = this.tabs[0];
1962
+ this.hideOrShowTabs = true;
1963
+ this.hideOrShowLocationTab = false;
1964
+ this.articleDetails = undefined;
1965
+ });
1966
+ }
1967
+ openSendMethodDialog(data) {
1968
+ this._stockService.printSticker.goodId = data.goodId;
1969
+ this._stockService.printSticker.warehouse = data.warehouseNo;
1970
+ this.showSendMethodDialog = !this.showSendMethodDialog;
1971
+ }
1972
+ printStockStickers() {
1973
+ this._stockService.getPrintStockStickers(this._stockService.printSticker);
1974
+ }
1975
+ onOkClick() {
1976
+ }
1977
+ onCancelClick() {
1978
+ }
1979
+ openDialogClick(data) {
1980
+ this.selectedArticleDetailsData = data;
1981
+ this.showChangeStockDetails = true;
1982
+ }
1983
+ getArticleDetails(data) {
1984
+ // const info = new ArticleStockManagement();
1985
+ this.articleDetailsInformation.goodId = data.goodId;
1986
+ this.articleDetailsInformation.lineId = data.lineId;
1987
+ this.articleDetailsInformation.warehouseNumber = data.warehouseNo;
1988
+ this._stockService.getArticleDetails(this.articleDetailsInformation).then((details) => {
1989
+ this.articleDetails = details;
1990
+ });
1991
+ }
1992
+ getStockManagementWarehouses(data) {
1993
+ this._stockService.getStockManagementWarehouses().then((warehouses) => {
1994
+ this.dataWareHouseCode = warehouses;
1995
+ this.selectedWarehouse = data.warehouseNo;
1996
+ });
1997
+ }
1998
+ onSelectWarehouse(event) {
1999
+ this.articleDetailsInformation.warehouseNumber = event;
2000
+ if (this.selectedWarehouse || this.selectedWarehouse === 0) {
2001
+ this._stockService.getArticleDetails(this.articleDetailsInformation).then((details) => {
2002
+ this.articleDetails = details;
2003
+ });
2004
+ }
2005
+ }
2006
+ getInOrderData() {
2007
+ return __awaiter(this, void 0, void 0, function* () {
2008
+ const inOrderData = new ArticleTransaction$1();
2009
+ inOrderData.type = "V";
2010
+ inOrderData.goodId = this.articleStockInformation[0].goodId.toString();
2011
+ this.inOrderInformation = yield this._stockService.getArticleTransaction(inOrderData);
2012
+ });
2013
+ }
2014
+ getOrderData() {
2015
+ return __awaiter(this, void 0, void 0, function* () {
2016
+ const orderData = new ArticleTransaction$1();
2017
+ orderData.type = "V";
2018
+ orderData.goodId = this.articleStockInformation[0].goodId.toString();
2019
+ this.orderInformation = yield this._stockService.getArticleTransaction(orderData);
2020
+ });
2021
+ }
2022
+ addNewRow() {
2023
+ }
2024
+ }
2025
+ StockInformationGridComponent.decorators = [
2026
+ { type: Component, args: [{
2027
+ selector: "co-stock-information-grid",
2028
+ template: `
2029
+ <div class="tab-link show" *ngIf="hideOrShowTabs">
2030
+ <span class="tab-link-buttons"
2031
+ *ngFor="let tab of tabs"
2032
+ (click)="handleTabClick(tab)"
2033
+ [textContent]="tab"
2034
+ [class.active]="tab === activeTab"
2035
+ ></span>
2036
+ </div>
2037
+
2038
+ <div class="stock-line">
2039
+ <div [textContent]="activeTabText"></div>
2040
+
2041
+ </div>
2042
+
2043
+ <div class="stock-grid">
2044
+ <co-simple-grid *ngIf="activeTab === tabs[0] && hideOrShowTabs"
2045
+ [data]="articleStockInformation"
2046
+ class="simple-grid"
2047
+ [showAdd]="true"
2048
+ [showToolbar]="true"
2049
+ (addRow)="addNewRow()"
2050
+ [inlineEdit]="true"
2051
+ [rowsPerPage]="20"
2052
+ >
2053
+ <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseNo'" [order]="10"></co-simple-grid-column>
2054
+ <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'warehouseName'" [order]="11"></co-simple-grid-column>
2055
+ <co-simple-grid-column [headerText]="'STOCK'" [field]="'technicalStock'" [order]="12"></co-simple-grid-column>
2056
+ <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'availableStock'" [order]="13"></co-simple-grid-column>
2057
+ <co-simple-grid-column [headerText]="'ECONOMICAL_STOCK'" [field]="'economicalStock'" [order]="14"></co-simple-grid-column>
2058
+ <co-simple-grid-column [headerText]="'LOCATION'" [field]="'locationNo'" [order]="15">
2059
+ <ng-template #template let-row="row">
2060
+ <span [textContent]="'Bekijken'" (click)="onLocationClick(row)"></span>
2061
+ </ng-template>
2062
+ </co-simple-grid-column>
2063
+ </co-simple-grid>
2064
+
2065
+ <co-simple-grid *ngIf="activeTab === tabs[1]"
2066
+ [data]="inOrderInformation"
2067
+ class="simple-grid"
2068
+ [rowsPerPage]="20"
2069
+ >
2070
+ <co-simple-grid-column [headerText]="'IN_ORDER2'" [field]="'transactionNr'"></co-simple-grid-column>
2071
+ <co-simple-grid-column [headerText]="'CUSTOMER'" [field]="'user'"></co-simple-grid-column>
2072
+ <co-simple-grid-column [headerText]="'DATE'" [field]="'transactionDate'"></co-simple-grid-column>
2073
+ <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'amountInOrder'"></co-simple-grid-column>
2074
+ <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'wareHouseNr'"></co-simple-grid-column>
2075
+ <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'locationNr'"></co-simple-grid-column>
2076
+ <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
2077
+ <co-simple-grid-column [headerText]="'TRANSFER'" [field]="'transfer'">
2078
+ <ng-template #template let-row="row">
2079
+ <co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.DeliveryTruck)" (click)="handleStockTransferClick($event)"></co-icon>
2080
+ </ng-template>
2081
+ </co-simple-grid-column>
2082
+ <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
2083
+ <ng-template #template let-row="row">
2084
+ <co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog(row)"></co-icon>
2085
+ </ng-template>
2086
+ </co-simple-grid-column>
2087
+ </co-simple-grid>
2088
+
2089
+ <co-simple-grid *ngIf="activeTab === tabs[2]"
2090
+ [data]="orderInformation"
2091
+ class="simple-grid"
2092
+ [rowsPerPage]="20"
2093
+ >
2094
+ <co-simple-grid-column [headerText]="'PURCHASE_ORDER_NR'" [field]="'transactionNr'"></co-simple-grid-column>
2095
+ <co-simple-grid-column [headerText]="'DATE'" [field]="'transactionDate'"></co-simple-grid-column>
2096
+ <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'amountInOrder'"></co-simple-grid-column>
2097
+ <co-simple-grid-column [headerText]="'RESERVED'" [field]="'reserved'"></co-simple-grid-column>
2098
+ <co-simple-grid-column [headerText]="'FREE_STOCK'" [field]="'freeStock'"></co-simple-grid-column>
2099
+ <co-simple-grid-column [headerText]="'DELIVERY_DATE1'" [field]="'deliveryDate'"></co-simple-grid-column>
2100
+ <co-simple-grid-column [headerText]="'RESERVE'" [field]="'reservation'"></co-simple-grid-column>
2101
+ </co-simple-grid>
2102
+ </div>
2103
+
2104
+ <div class="stock-grid" *ngIf="hideOrShowLocationTab">
2105
+ <div class="stock-location-group">
2106
+ <div class="stock-location-left-group">
2107
+ <span class="stock-button-back" [textContent]="'BACK_TO_STOCK_LINES'" (click)="handleBackToStockClick()"></span>
2108
+ </div>
2109
+ <div class="stock-location-right-group">
2110
+ <co-drop-down-list [(model)]="selectedWarehouse"
2111
+ [collection]="dataWareHouseCode"
2112
+ [fields]="dataWareHouseFields"
2113
+ [placeholder]="'WAREHOUSE'"
2114
+ (modelChange)="onSelectWarehouse($event)"
2115
+ [required]="true"
2116
+ ></co-drop-down-list>
2117
+ </div>
2118
+ </div>
2119
+
2120
+ <!-- TODO move to own component stock-location-->
2121
+ <co-simple-grid [data]="articleDetails"
2122
+ class="simple-grid"
2123
+ [rowsPerPage]="20"
2124
+ >
2125
+ <div class="stock-location-group">
2126
+ <div class="stock-location-left-group">
2127
+ <co-button class="stock-lines-button" [textContent]="'BACK_TO_STOCK_LINES'" (click)="handleBackToStockClick()"></co-button>
2128
+ </div>
2129
+ </div>
2130
+ <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseDescription'"></co-simple-grid-column>
2131
+ <co-simple-grid-column [headerText]="'BATCH'" [field]="'batchNo'"></co-simple-grid-column>
2132
+ <co-simple-grid-column [headerText]="'SERIAL_NO'" [field]="'serialNo'"></co-simple-grid-column>
2133
+ <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'">
2134
+ <ng-template #template let-row="row">
2135
+ <co-input-number-picker (keyup.enter)="openDialogClick(row)" [(model)]="row['amountInStock']">
2136
+
2137
+ </co-input-number-picker>
2138
+ </ng-template>
2139
+ </co-simple-grid-column>
2140
+ <co-simple-grid-column [headerText]="'ALLOCATED'" [field]="'amountInStockFree'"></co-simple-grid-column>
2141
+ <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'perceptibleStorage'"></co-simple-grid-column>
2142
+ <co-simple-grid-column [headerText]="'PHYSICAL_STOCK'" [field]="'amountInStockOriginal'"></co-simple-grid-column>
2143
+ <co-simple-grid-column [headerText]="'VALUTA'" [field]="'currency'"></co-simple-grid-column>
2144
+ <co-simple-grid-column [headerText]="'PURCHASE_PRICE'" [field]="'purchasePrice'"></co-simple-grid-column>
2145
+ <co-simple-grid-column [headerText]="'SUPPLIER_NUMBER'" [field]="'supplierNo'"></co-simple-grid-column>
2146
+ <co-simple-grid-column [headerText]="'TRANSFER'" [field]="'transfer'">
2147
+ <ng-template #template let-row="row">
2148
+ <co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.DeliveryTruck)" (click)="handleStockTransferClick(row)"></co-icon>
2149
+ </ng-template>
2150
+ </co-simple-grid-column>
2151
+ <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
2152
+ <ng-template #template let-row="row">
2153
+ <co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog(row)"></co-icon>
2154
+ </ng-template>
2155
+ </co-simple-grid-column>
2156
+ </co-simple-grid>
2157
+ </div>
2158
+
2159
+ <co-stock-change-amount *ngIf="showChangeStockDetails"
2160
+ (closeStockChangeAmount)="showChangeStockDetails = false"
2161
+ [selectedArticleDetailsData]="selectedArticleDetailsData"
2162
+ >
2163
+ </co-stock-change-amount>
2164
+
2165
+ <div class="stock-grid" *ngIf="showStockHistory">
2166
+ <div class="stock-button-left-group">
2167
+ <span class="stock-button-back" [textContent]="'BACK_TO_STOCK_LINES'" (click)="backToStockInformation()"></span>
2168
+ </div>
2169
+ <co-simple-grid [data]="stockHistoryInformation"
2170
+ class="simple-grid"
2171
+ [rowsPerPage]="20"
2172
+ >
2173
+ <co-simple-grid-column [headerText]="'MUTATION_DATE'" [field]="'mutationDate'"></co-simple-grid-column>
2174
+ <co-simple-grid-column [headerText]="'MUTATION_TIME'" [field]="'mutationTime'"></co-simple-grid-column>
2175
+ <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'amount'"></co-simple-grid-column>
2176
+ <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'wareHouseNr'"></co-simple-grid-column>
2177
+ <co-simple-grid-column [headerText]="'LOCATION'" [field]="'locationNr'"></co-simple-grid-column>
2178
+ <co-simple-grid-column [headerText]="'TRANSACTION_TYPE'" [field]="'transType'"></co-simple-grid-column>
2179
+ <co-simple-grid-column [headerText]="'DOCUMENT_NUMBER'" [field]="'docNr'"></co-simple-grid-column>
2180
+ <co-simple-grid-column [headerText]="'LINE'" [field]="'posLineNr'"></co-simple-grid-column>
2181
+ <co-simple-grid-column [headerText]="'STOCK_STATE'" [field]="'stockStateId'"></co-simple-grid-column>
2182
+ <co-simple-grid-column [headerText]="'STOCK_REMARK'" [field]="'stockStateRemarkId'"></co-simple-grid-column>
2183
+ <co-simple-grid-column [headerText]="'VALUTA'" [field]="'currencyCode'"></co-simple-grid-column>
2184
+ <co-simple-grid-column [headerText]="'RELATION_ID'" [field]="'relationId'"></co-simple-grid-column>
2185
+ <co-simple-grid-column [headerText]="'USER'" [field]="'user'"></co-simple-grid-column>
2186
+ <co-simple-grid-column [headerText]="'MUTATION_TYPE'" [field]="'mutationType'"></co-simple-grid-column>
2187
+ <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
2188
+ <ng-template #template let-row="row">
2189
+ <co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog(row)"></co-icon>
2190
+ </ng-template>
2191
+ </co-simple-grid-column>
2192
+ </co-simple-grid>
2193
+ </div>
2194
+
2195
+ <div class="stock-button-toolbar">
2196
+ <div class="stock-button-left-group">
2197
+ <co-button *ngIf="activeTab === tabs[0]" [label]="'HISTORY'" (click)="handleHistoryClick()"></co-button>
2198
+ </div>
2199
+ <div class="stock-button-middle-group">
2200
+ <div class="button-left">
2201
+ <co-button [textContent]="'Ok'" (click)="onOkClick()"></co-button>
2202
+ </div>
2203
+ <div class="button-right">
2204
+ <co-button [textContent]="'Annuleren'" (click)="onCancelClick()"></co-button>
2205
+ </div>
2206
+ </div>
2207
+ </div>
2208
+ <ione-send-method-dialog
2209
+ *ngIf="showSendMethodDialog"
2210
+ [showDialog]="showSendMethodDialog"
2211
+ (printButtonClicked)="printStockStickers()"
2212
+ ></ione-send-method-dialog>
2213
+ `,
2214
+ encapsulation: ViewEncapsulation.None
2215
+ },] }
2216
+ ];
2217
+ StockInformationGridComponent.ctorParameters = () => [
2218
+ { type: IconCacheService },
2219
+ { type: StockService }
2220
+ ];
2221
+ StockInformationGridComponent.propDecorators = {
2222
+ stock: [{ type: ViewChild, args: [StockInformationGridComponent,] }],
2223
+ articleStockInformation: [{ type: Input }],
2224
+ stockLocationData: [{ type: Input }],
2225
+ stockHistoryInformation: [{ type: Input }],
2226
+ transferIconClicked: [{ type: Output }],
2227
+ historyClicked: [{ type: Output }]
2228
+ };
2229
+
2230
+ class StockLocationComponent {
2231
+ constructor(_stockService) {
2232
+ this._stockService = _stockService;
2233
+ this.backToStockLines = new EventEmitter();
2234
+ this.stockLocationColumns = [];
2235
+ this.stockLocationColumns.push({ field: "location", headerText: "WAREHOUSE", editType: "none" }, { field: "batch", headerText: "BATCH" }, { field: "serieNo", headerText: "SERIAL_NO" }, { field: "amountInStock", headerText: "STOCK", textAlign: "Right", editType: "numericEdit" }, { field: "allocated", headerText: "ALLOCATED", textAlign: "Right" }, { field: "amountAvailable", headerText: "AVAILABLE_STOCK", textAlign: "Right" }, { field: "PhysicalStock", headerText: "PHYSICAL_STOCK", textAlign: "Right" }, { field: "Valuta", headerText: "VALUTA", textAlign: "Right" }, { field: "PurchasePrice", headerText: "PURSCHASE_PRICE", textAlign: "Right" }, { field: "SupplierNo", headerText: "SUPPLIER_NO", textAlign: "Right" }, { field: "Transfer", headerText: "TRANSFER" }, { field: "sticker", headerText: "STICKER" });
2236
+ }
2237
+ backToStockInformation() {
2238
+ this.backToStockLines.emit();
2239
+ }
2240
+ onOkClick() {
2241
+ }
2242
+ onCancelClick() {
2243
+ }
2244
+ onSelectWarehouse(event) {
2245
+ }
2246
+ }
2247
+ StockLocationComponent.decorators = [
2248
+ { type: Component, args: [{
2249
+ selector: "co-stock-location",
2250
+ template: `
2251
+ <div class="stock-location-wrapper">
2252
+ <div class="buttons-wrapper">
2253
+ <div class="stock-button-left-group">
2254
+ <span class="stock-button-back" [textContent]="'BACK_TO_STOCK_LINES'" (click)="backToStockInformation()"></span>
2255
+ </div>
2256
+ <div class="dropdown-wrapper">
2257
+ <co-drop-down-list
2258
+ [collection]="allWarehouses"
2259
+ [placeholder]="'WAREHOUSES'"
2260
+ (modelChange)="onSelectWarehouse($event)"
2261
+ ></co-drop-down-list>
2262
+ </div>
2263
+ </div>
2264
+
2265
+ <div class="stock-grid">
2266
+
2267
+ </div>
2268
+ <div class="button-wrapper">
2269
+ <div class="button-left">
2270
+ <co-button (click)="onOkClick()"></co-button>
2271
+ </div>
2272
+ <div class="button-right">
2273
+ <co-button (click)="onCancelClick()"></co-button>
2274
+ </div>
2275
+ </div>
2276
+ </div>
2277
+
2278
+ `,
2279
+ encapsulation: ViewEncapsulation.None
2280
+ },] }
2281
+ ];
2282
+ StockLocationComponent.ctorParameters = () => [
2283
+ { type: StockService }
2284
+ ];
2285
+ StockLocationComponent.propDecorators = {
2286
+ stockLocationInformation: [{ type: Input }],
2287
+ backToStockLines: [{ type: Output }]
2288
+ };
2289
+
2290
+ class StockTransferComponent {
2291
+ constructor(_stockService) {
2292
+ this._stockService = _stockService;
2293
+ this.handleCancelClicked = new EventEmitter();
2294
+ this.handleStickerClicked = new EventEmitter();
2295
+ this.allWarehousesDropdownFields = { text: "warehouseDescription", value: "warehouseNo" };
2296
+ this.allLocationDropdownFields = { text: "locationNo", value: "locationNo" };
2297
+ this.showSendMethodDialog = false;
2298
+ this.stockState = [];
2299
+ this.stockStateDropdownField = { text: "stateDescription", value: "stockStateId" };
2300
+ }
2301
+ ngAfterViewInit() {
2302
+ this.getStockManagementWarehouses();
2303
+ this.getStockState();
2304
+ }
2305
+ handleOkClick(data) {
2306
+ return __awaiter(this, void 0, void 0, function* () {
2307
+ data.selected = true;
2308
+ data.entryDate = new Date;
2309
+ yield this._stockService.updateArticleDetails(data);
2310
+ });
2311
+ }
2312
+ handleCancelClick() {
2313
+ this.handleCancelClicked.emit();
2314
+ }
2315
+ handleSelectedWarehouse(event) {
2316
+ this.selectedWarehouse = event;
2317
+ this.getStockManagementLocations(this.selectedWarehouse);
2318
+ }
2319
+ handleStickerClick() {
2320
+ return __awaiter(this, void 0, void 0, function* () {
2321
+ this.handleStickerClicked.emit();
2322
+ this.showSendMethodDialog = true;
2323
+ });
2324
+ }
2325
+ getStockManagementWarehouses() {
2326
+ this._stockService.getStockManagementWarehouses().then((warehouses) => {
2327
+ this.warehouses = warehouses;
2328
+ });
2329
+ }
2330
+ getStockManagementLocations(data) {
2331
+ this._stockService.getStockManagementLocations(data).then((locations) => {
2332
+ this.locations = locations;
2333
+ });
2334
+ }
2335
+ getStockState() {
2336
+ this._stockService.getStockState().then((state) => {
2337
+ this.stockState = state;
2338
+ });
2339
+ }
2340
+ }
2341
+ StockTransferComponent.decorators = [
2342
+ { type: Component, args: [{
2343
+ selector: "co-stock-transfer",
2344
+ template: `
2345
+ <div class="stock-transfer">
2346
+ <div class="stock-transfer-columns">
2347
+ <div *ngIf="articleToTransfer" class="stock-transfer-left-column">
2348
+ <co-input-text disabled
2349
+ [(model)]="articleToTransfer.warehouseDescription"
2350
+ [textContent]="articleToTransfer.warehouseDescription"
2351
+ [placeholder]="'Standaard magazijn'">
2352
+ </co-input-text>
2353
+ <co-input-text disabled
2354
+ [(model)]="articleToTransfer.locationNo"
2355
+ [textContent]="articleToTransfer.locationNo"
2356
+ [placeholder]="'Standaard locatie'">
2357
+ </co-input-text>
2358
+ <co-input-text disabled
2359
+ [(model)]="stockSticker.batch"
2360
+ [placeholder]="'Batch'">
2361
+ </co-input-text>
2362
+ <co-input-text disabled
2363
+ [(model)]="stockSticker.serial"
2364
+ [placeholder]="'Serie'">
2365
+ </co-input-text>
2366
+ <co-input-text
2367
+ [(model)]="articleToTransfer.amountTransfer"
2368
+ [placeholder]="'Aantal'">
2369
+ </co-input-text>
2370
+ </div>
2371
+
2372
+ <div class="stock-transfer-right-column">
2373
+ <co-drop-down-list [collection]="warehouses"
2374
+ [fields]="allWarehousesDropdownFields"
2375
+ (modelChange)="handleSelectedWarehouse($event)"
2376
+ [(model)]="articleToTransfer.targetWarehouse">
2377
+ </co-drop-down-list>
2378
+ <co-drop-down-list [collection]="locations"
2379
+ [fields]="allLocationDropdownFields"
2380
+ [(model)]="articleToTransfer.targetLocation"
2381
+ >
2382
+ </co-drop-down-list>
2383
+ <co-drop-down-list [collection]="stockState"
2384
+ [fields]="stockStateDropdownField"
2385
+ [placeholder]="'Voorraadstatus'"
2386
+ [(model)]="articleToTransfer.stockStateId">
2387
+ </co-drop-down-list>
2388
+ <co-input-text [placeholder]="'Omschrijving'"
2389
+ [(model)]="articleToTransfer.stockStateRemark">
2390
+ </co-input-text>
2391
+ </div>
2392
+ </div>
2393
+
2394
+ <div class="ok-cancel-buttons">
2395
+ <co-button [textContent]="'Ok'" (click)="handleOkClick(articleToTransfer)"></co-button>
2396
+ <co-button [textContent]="'Annuleren'" (click)="handleCancelClick()"></co-button>
2397
+ <co-button [textContent]="'Sticker'" (click)="handleStickerClick()"></co-button>
2398
+ </div>
2399
+ </div>
2400
+ `,
2401
+ encapsulation: ViewEncapsulation.None
2402
+ },] }
2403
+ ];
2404
+ StockTransferComponent.ctorParameters = () => [
2405
+ { type: StockService }
2406
+ ];
2407
+ StockTransferComponent.propDecorators = {
2408
+ stockSticker: [{ type: Input }],
2409
+ article: [{ type: Input }],
2410
+ articleToTransfer: [{ type: Input }],
2411
+ articleWarehouse: [{ type: Input }],
2412
+ allWarehouses: [{ type: Input }],
2413
+ handleCancelClicked: [{ type: Output }],
2414
+ handleStickerClicked: [{ type: Output }]
2415
+ };
2416
+
2417
+ var SendOption;
2418
+ (function (SendOption) {
2419
+ SendOption[SendOption["Email"] = 0] = "Email";
2420
+ SendOption[SendOption["Print"] = 1] = "Print";
2421
+ SendOption[SendOption["Pdf"] = 2] = "Pdf";
2422
+ SendOption[SendOption["Xml"] = 3] = "Xml";
2423
+ })(SendOption || (SendOption = {}));
2424
+
2425
+ class SendMethodDialogComponent {
2426
+ constructor(iconCacheService, stockService, _optionsService, _dictionary, _changeDetector) {
2427
+ this.iconCacheService = iconCacheService;
2428
+ this.stockService = stockService;
2429
+ this._optionsService = _optionsService;
2430
+ this._dictionary = _dictionary;
2431
+ this._changeDetector = _changeDetector;
2432
+ this.icons = Icon;
2433
+ this.sendOption = SendOption;
2434
+ this.showEmailOption = true;
2435
+ this.showPrintOption = true;
2436
+ this.showPdfOption = true;
2437
+ this.showXmlOption = true;
2438
+ this.showPrintPriceStickers = false;
2439
+ this.showPrintStockStickers = true;
2440
+ this.sendOptions = [
2441
+ { option: SendOption.Email,
2442
+ iconName: this.icons.Email,
2443
+ },
2444
+ { option: SendOption.Print,
2445
+ iconName: this.icons.Print,
2446
+ },
2447
+ { option: SendOption.Pdf,
2448
+ iconName: this.icons.Pdf,
2449
+ },
2450
+ { option: SendOption.Xml,
2451
+ iconName: this.icons.Xml,
2452
+ }
2453
+ ];
2454
+ this.activeSendOption = SendOption.Email;
2455
+ this.showStandardPrinterOptions = false;
2456
+ this.showPrinterSelections = false;
2457
+ this.showExitButton = true;
2458
+ this.printTemplatesField = { text: "name", value: "reportId" };
2459
+ this.priceListDataField = { text: "name", value: "priceListCode" };
2460
+ this.upAndLoaded = false;
2461
+ this.emails = ['lars.vdv@colijn-it.nl', 'david@colijn-it.nl', 'ruben@colijn-it.nl'];
2462
+ this.models = [false, false, true];
2463
+ this.layouts = ['Layout 1', 'Layout 2', 'Layout 3'];
2464
+ this.showDialog = false;
2465
+ this.startSignatureClicked = new EventEmitter();
2466
+ this.printButtonClicked = new EventEmitter();
2467
+ this._subscriptions = [];
2468
+ this._subscriptions.push(this._optionsService.optionsLoaded.subscribe(loaded => this._handleSettingsLoaded(loaded)));
2469
+ }
2470
+ set articleData(data) {
2471
+ this.stockService.printSticker.goodId = data.goodId;
2472
+ this.stockService.printSticker.warehouse = data.warehouseNo;
2473
+ }
2474
+ ;
2475
+ showClass() {
2476
+ return true;
2477
+ }
2478
+ ngOnDestroy() {
2479
+ this._subscriptions.forEach(subscription => subscription.unsubscribe());
2480
+ }
2481
+ getPrinters() {
2482
+ return __awaiter(this, void 0, void 0, function* () {
2483
+ return this.stockService.getAllPrinters(true).then((list) => {
2484
+ this.printerList = list;
2485
+ });
2486
+ });
2487
+ }
2488
+ closeDialogClick() {
2489
+ this.showDialog = false;
2490
+ }
2491
+ handleSignatureStart() {
2492
+ this.startSignatureClicked.emit();
2493
+ }
2494
+ handlePrintClicked() {
2495
+ // this.printButtonClicked.emit();
2496
+ if (this.stockService.printSticker.printerName) {
2497
+ this.stockService.getPrintStockStickers(this.stockService.printSticker);
2498
+ }
2499
+ }
2500
+ togglePrinterSelection() {
2501
+ this.getPrinters();
2502
+ if (!this.showPrinterSelections) {
2503
+ this.showPrinterSelections = true;
2504
+ this.headerTitle = 'Printer selectie';
2505
+ }
2506
+ else {
2507
+ this.showPrinterSelections = false;
2508
+ this.headerTitle = 'Verzendopties';
2509
+ }
2510
+ }
2511
+ onPrinterClicked(printer) {
2512
+ this.defaultPrinter = printer.name;
2513
+ this.stockService.printSticker.printerName = printer.name;
2514
+ this.showPrinterSelections = !this.showPrinterSelections;
2515
+ }
2516
+ getPrintTemplates() {
2517
+ if (!this.printTemplates) {
2518
+ const data = new StockStickersPrintLayouts();
2519
+ this.stockService.getStockStickerTemplates(data).then((templates) => {
2520
+ this.printTemplates = templates;
2521
+ });
2522
+ }
2523
+ }
2524
+ _handleSettingsLoaded(loaded) {
2525
+ return __awaiter(this, void 0, void 0, function* () {
2526
+ if (loaded) {
2527
+ yield this._initConnection().then();
2528
+ this.upAndLoaded = true;
2529
+ }
2530
+ });
2531
+ }
2532
+ _initConnection() {
2533
+ return __awaiter(this, void 0, void 0, function* () {
2534
+ // await this._connector.connect(this._optionsService.options);
2535
+ if (this._optionsService.options.url) {
2536
+ this._dictionary.rootUrl = this._optionsService.options.url.replace("/ajaxservice", "");
2537
+ }
2538
+ yield this._dictionary.setDictionary(this._optionsService.options.languageCode);
2539
+ setTimeout(() => {
2540
+ this._changeDetector.detectChanges();
2541
+ });
2542
+ });
2543
+ }
2544
+ }
2545
+ SendMethodDialogComponent.decorators = [
2546
+ { type: Component, args: [{
2547
+ selector: "ione-send-method-dialog",
2548
+ template: `
2549
+ <div class="send-method-dialog-wrapper">
2550
+ <co-dialog-wizard id="sendOptionsDialog" *ngIf="showDialog" [showCloseIcon]="showExitButton" (closeClick)="closeDialogClick()">
2551
+ <ng-container header>
2552
+ <span [textContent]="headerTitle"></span>
2553
+ </ng-container>
2554
+ <div class="dialog-content-wrapper">
2555
+ <div class="main-content-container" *ngIf="!showPrinterSelections">
2556
+ <div class="send-options-wrapper">
2557
+ <div class="custom-button-wrapper"
2558
+ *ngFor="let sendOption of sendOptions"
2559
+ [class.selected-option]="sendOption.option === activeSendOption"
2560
+ (click)="activeSendOption = sendOption.option">
2561
+ <co-icon [iconData]="iconCacheService.getIcon(sendOption.iconName)"></co-icon>
2562
+ </div>
2563
+ </div>
2564
+
2565
+ <div class="email-option-content" *ngIf="activeSendOption === sendOption.Email || activeSendOption === sendOption.Pdf">
2566
+ <div class="emails-container" *ngIf="activeSendOption === sendOption.Email">
2567
+ <co-input-checkbox
2568
+ *ngFor="let email, let index of emails"
2569
+ [name]="email"
2570
+ [(model)]="models[index]"
2571
+ [label]="email"
2572
+ [cssClass]="'input-checkbox-wrapper'"
2573
+ ></co-input-checkbox>
2574
+ </div>
2575
+
2576
+ <div class="lov-wrapper">
2577
+ <co-input-combo-box
2578
+ [(model)]="selectedLayout"
2579
+ [collection]="layouts"
2580
+ [forceReadonly]="true"
2581
+ placeholder="Layout"
2582
+ ></co-input-combo-box>
2583
+ </div>
2584
+
2585
+ <div class="signature-button-wrapper">
2586
+ <div class="custom-button-wrapper signature-button" (click)="handleSignatureStart()">
2587
+ <co-icon [iconData]="iconCacheService.getIcon(icons.SignatureField)"></co-icon>
2588
+ </div>
2589
+ </div>
2590
+ </div>
2591
+
2592
+ <div class="email-option-content" *ngIf="activeSendOption === sendOption.Print" (click)="getPrintTemplates()">
2593
+ <div *ngIf="showPrintPriceStickers">
2594
+ <div class="lov-wrapper">
2595
+ <co-input-combo-box
2596
+ [(model)]="stockService.printPriceSticker.reportId"
2597
+ [collection]="printTemplates"
2598
+ [fields]="printTemplatesField"
2599
+ placeholder="Layout"
2600
+ ></co-input-combo-box>
2601
+ </div>
2602
+ <div class="lov-wrapper" *ngIf="priceListCodeData">
2603
+ <co-input-combo-box
2604
+ [(model)]="stockService.printPriceSticker.priceListCode"
2605
+ [collection]="priceListCodeData"
2606
+ [fields]="priceListDataField"
2607
+ placeholder="Layout"
2608
+ ></co-input-combo-box>
2609
+ </div>
2610
+ </div>
2611
+
2612
+ <div *ngIf="showPrintStockStickers">
2613
+ <div class="lov-wrapper">
2614
+ <co-input-combo-box
2615
+ [(model)]="stockService.printSticker.reportId"
2616
+ [collection]="printTemplates"
2617
+ [fields]="printTemplatesField"
2618
+ placeholder="Layout"
2619
+ ></co-input-combo-box>
2620
+ </div>
2621
+ </div>
2622
+
2623
+ <div class="lov-wrapper clickable" (click)="togglePrinterSelection()">
2624
+ <div class="selected-printer-wrapper">
2625
+ <div class="printer-option-list-item">
2626
+ <co-icon class="printer-icon" [iconData]="iconCacheService.getIcon(icons.Print)"></co-icon>
2627
+ <div class="printer-details" *ngIf="printerList">
2628
+ <span class="printer-name" [textContent]="defaultPrinter"></span>
2629
+ <span class="printer-status" [textContent]="defaultPrinter.acceptingJobs"></span>
2630
+ </div>
2631
+ </div>
2632
+ <co-icon class="select-printer-arrow" [iconData]="iconCacheService.getIcon(icons.ArrowPointRight)"></co-icon>
2633
+ </div>
2634
+ </div>
2635
+
2636
+ <div class="standard-printer-wrapper">
2637
+ <div class="standard-printer-link" (click)="showStandardPrinterOptions = !showStandardPrinterOptions">
2638
+ <co-icon class="arrow-icon" [iconData]="iconCacheService.getIcon(icons.ArrowFatRight)"></co-icon>
2639
+ <span class="standard-printer-message" [textContent]="'Standaard printer voor lay-out instellen'"></span>
2640
+ </div>
2641
+
2642
+ <div class="standard-printer-selections" *ngIf="showStandardPrinterOptions">
2643
+ <co-input-checkbox
2644
+ [(model)]="models[0]"
2645
+ [label]="'Per gebruiker instellen'"
2646
+ [cssClass]="'input-checkbox-wrapper'"
2647
+ ></co-input-checkbox>
2648
+ <co-input-checkbox
2649
+ [(model)]="models[1]"
2650
+ [label]="'Voor alle gebruikers instellen'"
2651
+ [cssClass]="'input-checkbox-wrapper'"
2652
+ ></co-input-checkbox>
2653
+ </div>
2654
+ </div>
2655
+
2656
+ <div class="print-footer-wrapper">
2657
+ <div class="input-number-wrapper">
2658
+ <co-input-number-picker class="number-picker"
2659
+ [step]="1" [(model)]="stockService.printSticker.amount" [min]="1"
2660
+ [ngModelOptions]="{debounce: 1}">
2661
+ </co-input-number-picker>
2662
+ </div>
2663
+ <div class="custom-button-wrapper print-button" (click)="handlePrintClicked()">
2664
+ <span [textContent]="'Print'"></span>
2665
+ </div>
2666
+ <div class="custom-button-wrapper signature-button" (click)="handleSignatureStart()">
2667
+ <co-icon [iconData]="iconCacheService.getIcon(icons.SignatureField)"></co-icon>
2668
+ </div>
2669
+ </div>
2670
+ </div>
2671
+ </div>
2672
+
2673
+ <div class="printer-content-container" @slideInOut *ngIf="showPrinterSelections">
2674
+ <div class="selected-printer-wrapper selection clickable" *ngFor="let printers of printerList" (click)="onPrinterClicked(printers)">
2675
+ <div class="printer-option-list-item">
2676
+ <co-icon class="printer-icon" [iconData]="iconCacheService.getIcon(icons.Print)"></co-icon>
2677
+ <div class="printer-details">
2678
+ <span class="printer-name" [textContent]="printers.name"></span>
2679
+ <span class="printer-status" [textContent]="printers.acceptingJobs"></span>
2680
+ </div>
2681
+ </div>
2682
+ <co-icon class="select-printer-arrow" *ngIf="!showPrinterSelections"
2683
+ [iconData]="iconCacheService.getIcon(icons.ArrowPointRight)"></co-icon>
2684
+ </div>
2685
+ </div>
2686
+ </div>
2687
+ </co-dialog-wizard>
2688
+ </div>
2689
+ `,
2690
+ encapsulation: ViewEncapsulation.None,
2691
+ animations: [
2692
+ trigger('slideInOut', [
2693
+ state('*', style({ transform: 'translateX(0%)', width: '100%', opacity: '1' })),
2694
+ state('void', style({ transform: 'translateX(150%)', opacity: '0' })),
2695
+ transition('void => *', animate(250))
2696
+ ])
2697
+ ]
2698
+ },] }
2699
+ ];
2700
+ SendMethodDialogComponent.ctorParameters = () => [
2701
+ { type: IconCacheService },
2702
+ { type: StockService },
2703
+ { type: OptionsService },
2704
+ { type: DictionaryService },
2705
+ { type: ChangeDetectorRef }
2706
+ ];
2707
+ SendMethodDialogComponent.propDecorators = {
2708
+ showEmailOption: [{ type: Input }],
2709
+ showPrintOption: [{ type: Input }],
2710
+ showPdfOption: [{ type: Input }],
2711
+ showXmlOption: [{ type: Input }],
2712
+ showPrintPriceStickers: [{ type: Input }],
2713
+ showPrintStockStickers: [{ type: Input }],
2714
+ priceListCodeData: [{ type: Input }],
2715
+ showDialog: [{ type: Input }],
2716
+ headerTitle: [{ type: Input }],
2717
+ printerList: [{ type: Input }],
2718
+ articleData: [{ type: Input }],
2719
+ startSignatureClicked: [{ type: Output }],
2720
+ printButtonClicked: [{ type: Output }],
2721
+ showClass: [{ type: HostBinding, args: ["class.ione-send-method-dialog",] }]
2722
+ };
2723
+
2724
+ class SendMethodDialogModule {
2725
+ }
2726
+ SendMethodDialogModule.decorators = [
2727
+ { type: NgModule, args: [{
2728
+ declarations: [
2729
+ SendMethodDialogComponent
2730
+ ],
2731
+ imports: [
2732
+ CommonModule,
2733
+ CoDialogPromptModule,
2734
+ InputCheckboxModule,
2735
+ InputComboBoxModule,
2736
+ IconModule,
2737
+ InputNumberPickerModule,
2738
+ CoDialogWizardModule,
2739
+ ButtonModule
2740
+ ],
2741
+ exports: [
2742
+ SendMethodDialogComponent
2743
+ ],
2744
+ providers: [
2745
+ StockService
2746
+ ]
2747
+ },] }
2748
+ ];
2749
+
2750
+ class StockChangeAmountComponent {
2751
+ constructor(_stockService) {
2752
+ this._stockService = _stockService;
2753
+ this.closeStockChangeAmount = new EventEmitter();
2754
+ this.stockState = [];
2755
+ this.stockStateDropdownField = { text: "stateDescription", value: "stockStateId" };
2756
+ }
2757
+ ngAfterViewInit() {
2758
+ this.getStockState();
2759
+ }
2760
+ closeDialogClick() {
2761
+ this.closeStockChangeAmount.emit();
2762
+ }
2763
+ handleOkClick(data) {
2764
+ return __awaiter(this, void 0, void 0, function* () {
2765
+ yield this._stockService.updateArticleDetails(data);
2766
+ });
2767
+ }
2768
+ handleCancelClick() {
2769
+ this.closeStockChangeAmount.emit();
2770
+ }
2771
+ getStockState() {
2772
+ this._stockService.getStockState().then((state) => {
2773
+ this.stockState = state;
2774
+ });
2775
+ }
2776
+ }
2777
+ StockChangeAmountComponent.decorators = [
2778
+ { type: Component, args: [{
2779
+ selector: "co-stock-change-amount",
2780
+ template: `
2781
+ <div class="stock-transfer">
2782
+ <co-dialog-wizard [showCloseIcon]="true" (closeClick)="closeDialogClick()">
2783
+ <ng-container header>
2784
+ <span [textContent]="'STOCK_CHANGE_REASON'"></span>
2785
+ </ng-container>
2786
+ <div class="popup-wrapper">
2787
+ <co-drop-down-list [collection]="stockState"
2788
+ [fields]="stockStateDropdownField"
2789
+ [placeholder]="'STOCK_STATE'"
2790
+ [(model)]="selectedArticleDetailsData.stockStateId"
2791
+ ></co-drop-down-list>
2792
+
2793
+ <co-input-textarea [(model)]="selectedArticleDetailsData.stockStateRemark"
2794
+
2795
+ ></co-input-textarea>
2796
+ <div class="ok-cancel-buttons">
2797
+ <co-button [textContent]="'Ok'" (click)="handleOkClick(selectedArticleDetailsData)"></co-button>
2798
+ <co-button [textContent]="'Annuleren'" (click)="handleCancelClick()"></co-button>
2799
+ </div>
2800
+ </div>
2801
+ </co-dialog-wizard>
2802
+ </div>
2803
+ `,
2804
+ encapsulation: ViewEncapsulation.None
2805
+ },] }
2806
+ ];
2807
+ StockChangeAmountComponent.ctorParameters = () => [
2808
+ { type: StockService }
2809
+ ];
2810
+ StockChangeAmountComponent.propDecorators = {
2811
+ selectedArticleDetailsData: [{ type: Input }],
2812
+ closeStockChangeAmount: [{ type: Output }]
2813
+ };
2814
+
2815
+ class StockModule {
2816
+ }
2817
+ StockModule.decorators = [
2818
+ { type: NgModule, args: [{
2819
+ imports: [
2820
+ InputComboBoxModule,
2821
+ CoGridModule,
2822
+ ButtonModule,
2823
+ CommonModule,
2824
+ InputRadioButtonModule,
2825
+ DropDownModule,
2826
+ SimpleGridModule,
2827
+ ImageModule,
2828
+ InputTextModule,
2829
+ SendMethodDialogModule,
2830
+ IconModule,
2831
+ InputNumberPickerModule,
2832
+ CoDialogWizardModule,
2833
+ InputTextareaModule
2834
+ ],
2835
+ declarations: [
2836
+ StockComponent,
2837
+ StockInformationComponent,
2838
+ StockInformationGridComponent,
2839
+ StockLocationComponent,
2840
+ StockTransferComponent,
2841
+ StockChangeAmountComponent
2842
+ ],
2843
+ exports: [
2844
+ StockComponent
2845
+ ],
2846
+ providers: [
2847
+ StockService
2848
+ ]
2849
+ },] }
2850
+ ];
2851
+
2852
+ var KeyboardCode;
2853
+ (function (KeyboardCode) {
2854
+ KeyboardCode["Backspace"] = "Backspace";
2855
+ KeyboardCode["Digit0"] = "Digit0";
2856
+ KeyboardCode["Digit1"] = "Digit1";
2857
+ KeyboardCode["Digit2"] = "Digit2";
2858
+ KeyboardCode["Digit3"] = "Digit3";
2859
+ KeyboardCode["Digit4"] = "Digit4";
2860
+ KeyboardCode["Digit5"] = "Digit5";
2861
+ KeyboardCode["Digit6"] = "Digit6";
2862
+ KeyboardCode["Digit7"] = "Digit7";
2863
+ KeyboardCode["Digit8"] = "Digit8";
2864
+ KeyboardCode["Digit9"] = "Digit9";
2865
+ KeyboardCode["Enter"] = "Enter";
2866
+ KeyboardCode["Escape"] = "Escape";
2867
+ KeyboardCode["Minus"] = "Minus";
2868
+ KeyboardCode["Numpad0"] = "Numpad0";
2869
+ KeyboardCode["Numpad1"] = "Numpad1";
2870
+ KeyboardCode["Numpad2"] = "Numpad2";
2871
+ KeyboardCode["Numpad3"] = "Numpad3";
2872
+ KeyboardCode["Numpad4"] = "Numpad4";
2873
+ KeyboardCode["Numpad5"] = "Numpad5";
2874
+ KeyboardCode["Numpad6"] = "Numpad6";
2875
+ KeyboardCode["Numpad7"] = "Numpad7";
2876
+ KeyboardCode["Numpad8"] = "Numpad8";
2877
+ KeyboardCode["Numpad9"] = "Numpad9";
2878
+ KeyboardCode["NumpadDecimal"] = "NumpadDecimal";
2879
+ KeyboardCode["NumpadEnter"] = "NumpadEnter";
2880
+ KeyboardCode["NumpadSubtract"] = "NumpadSubtract";
2881
+ KeyboardCode["Period"] = "Period";
2882
+ })(KeyboardCode || (KeyboardCode = {}));
2883
+
2884
+ class KeyPadComponent {
2885
+ constructor(iconCacheService) {
2886
+ this.iconCacheService = iconCacheService;
2887
+ this.icons = Icon;
2888
+ this.showValue = true;
2889
+ this.emitModelChangeOnEnter = true;
2890
+ this.modelChange = new EventEmitter();
2891
+ this.internalModelChange = new EventEmitter();
2892
+ this.enterClick = new EventEmitter();
2893
+ this._validKeyMap = new Map([
2894
+ [KeyboardCode.Digit0, "0"],
2895
+ [KeyboardCode.Digit1, "1"],
2896
+ [KeyboardCode.Digit2, "2"],
2897
+ [KeyboardCode.Digit3, "3"],
2898
+ [KeyboardCode.Digit4, "4"],
2899
+ [KeyboardCode.Digit5, "5"],
2900
+ [KeyboardCode.Digit6, "6"],
2901
+ [KeyboardCode.Digit7, "7"],
2902
+ [KeyboardCode.Digit8, "8"],
2903
+ [KeyboardCode.Digit9, "9"],
2904
+ [KeyboardCode.Numpad0, "0"],
2905
+ [KeyboardCode.Numpad1, "1"],
2906
+ [KeyboardCode.Numpad2, "2"],
2907
+ [KeyboardCode.Numpad3, "3"],
2908
+ [KeyboardCode.Numpad4, "4"],
2909
+ [KeyboardCode.Numpad5, "5"],
2910
+ [KeyboardCode.Numpad6, "6"],
2911
+ [KeyboardCode.Numpad7, "7"],
2912
+ [KeyboardCode.Numpad8, "8"],
2913
+ [KeyboardCode.Numpad9, "9"],
2914
+ [KeyboardCode.NumpadDecimal, "."],
2915
+ [KeyboardCode.Period, "."]
2916
+ ]);
2917
+ this.isNegative = false;
2918
+ this._model = 0;
2919
+ this._internalModel = "0";
2920
+ this._maxCharacters = 11;
2921
+ }
2922
+ set model(value) {
2923
+ this._model = value;
2924
+ this._internalModel = this._model + "";
2925
+ }
2926
+ get model() {
2927
+ return this._model;
2928
+ }
2929
+ showClass() {
2930
+ return true;
2931
+ }
2932
+ handleKeyDown(event) {
2933
+ this._keyDown(event);
2934
+ }
2935
+ set internalModel(value) {
2936
+ this._internalModel = value;
2937
+ this.isNegative = parseFloat(this._internalModel) < 0;
2938
+ this.internalModelChange.emit(this._internalModel);
2939
+ }
2940
+ get internalModel() {
2941
+ return this._internalModel;
2942
+ }
2943
+ handleMinusClick(event) {
2944
+ const model = parseFloat(this.internalModel);
2945
+ if (model !== 0) {
2946
+ if (model < 0) {
2947
+ this.internalModel = Math.abs(model) + "";
2948
+ }
2949
+ else {
2950
+ this.internalModel = -model + "";
2951
+ }
2952
+ }
2953
+ this._emitModelChange();
2954
+ }
2955
+ handleClearClick(event) {
2956
+ this.internalModel = "0";
2957
+ this._emitModelChange();
2958
+ }
2959
+ handleBsClick(event) {
2960
+ let wish = this.internalModel;
2961
+ wish = wish.slice(0, wish.length - 1) || "0";
2962
+ if (!isNaN(parseFloat(wish))) {
2963
+ this.internalModel = parseFloat(wish) + "";
2964
+ }
2965
+ this._emitModelChange();
2966
+ }
2967
+ handleButtonClick(chr) {
2968
+ this._updateModel(chr);
2969
+ }
2970
+ handleEnterClick(event) {
2971
+ this._emitModelChange(true);
2972
+ this.enterClick.emit();
2973
+ }
2974
+ _updateModel(value) {
2975
+ if (value === undefined || value === null ||
2976
+ (value === '.' && this.internalModel.indexOf('.') > -1) ||
2977
+ this.internalModel.length >= this._maxCharacters) {
2978
+ return;
2979
+ }
2980
+ this.internalModel = this.internalModel !== "0" ? this.internalModel + value : value;
2981
+ this._emitModelChange();
2982
+ }
2983
+ _keyDown(event) {
2984
+ if (this._isEnter(event)) {
2985
+ this.handleEnterClick(event);
2986
+ }
2987
+ else if (this._isMinus(event)) {
2988
+ this.handleMinusClick(event);
2989
+ }
2990
+ else if (this._isEscape(event)) {
2991
+ this.handleClearClick(event);
2992
+ }
2993
+ else if (this._isBackspace(event)) {
2994
+ this.handleBsClick(event);
2995
+ }
2996
+ else {
2997
+ this._updateModel(this._validKeyMap.get(event.code));
2998
+ }
2999
+ }
3000
+ _isEnter(event) {
3001
+ return event.code === KeyboardCode.Enter || event.code === KeyboardCode.NumpadEnter;
3002
+ }
3003
+ _isMinus(event) {
3004
+ return event.code === KeyboardCode.Minus || event.code === KeyboardCode.NumpadSubtract;
3005
+ }
3006
+ _isEscape(event) {
3007
+ return event.code === KeyboardCode.Escape;
3008
+ }
3009
+ _isBackspace(event) {
3010
+ return event.code === KeyboardCode.Backspace;
3011
+ }
3012
+ _emitModelChange(enter = false) {
3013
+ if ((enter && this.emitModelChangeOnEnter) || (!enter && !this.emitModelChangeOnEnter)) {
3014
+ const model = parseFloat(this.internalModel);
3015
+ if (!isNaN(model)) {
3016
+ if (enter && this.emitModelChangeOnEnter) {
3017
+ this.model = model;
3018
+ }
3019
+ this.modelChange.emit(model);
3020
+ }
3021
+ }
3022
+ }
3023
+ }
3024
+ KeyPadComponent.decorators = [
3025
+ { type: Component, args: [{
3026
+ selector: 'co-key-pad',
3027
+ template: `
3028
+ <div class="key-pad-wrapper">
3029
+ <div class="key-pad-model-wrapper" *ngIf="showValue">
3030
+ <div class="key-pad-model" [textContent]="internalModel" [class.negative]="isNegative"></div>
3031
+ </div>
3032
+ <div class="key-pad-button-wrapper">
3033
+ <div class="key-pad-button button-7" [textContent]="'7'" (click)="handleButtonClick('7')"></div>
3034
+ <div class="key-pad-button button-8" [textContent]="'8'" (click)="handleButtonClick('8')"></div>
3035
+ <div class="key-pad-button button-9" [textContent]="'9'" (click)="handleButtonClick('9')"></div>
3036
+ <div class="key-pad-button button-bs" (click)="handleBsClick($event)">
3037
+ <co-icon [iconData]="iconCacheService.getIcon(icons.DeleteLeftRegular)"></co-icon>
3038
+ </div>
3039
+ <div class="key-pad-button button-4" [textContent]="'4'" (click)="handleButtonClick('4')"></div>
3040
+ <div class="key-pad-button button-5" [textContent]="'5'" (click)="handleButtonClick('5')"></div>
3041
+ <div class="key-pad-button button-6" [textContent]="'6'" (click)="handleButtonClick('6')"></div>
3042
+ <div class="key-pad-button button-minus" [textContent]="'-'" (click)="handleMinusClick($event)"></div>
3043
+ <div class="key-pad-button button-1" [textContent]="'1'" (click)="handleButtonClick('1')"></div>
3044
+ <div class="key-pad-button button-2" [textContent]="'2'" (click)="handleButtonClick('2')"></div>
3045
+ <div class="key-pad-button button-3" [textContent]="'3'" (click)="handleButtonClick('3')"></div>
3046
+ <div class="key-pad-button button-enter" (click)="handleEnterClick($event)">
3047
+ <span [textContent]="'enter'"></span>
3048
+ </div>
3049
+ <div class="key-pad-button button-0" [textContent]="'0'" (click)="handleButtonClick('0')"></div>
3050
+ <div class="key-pad-button button-dot" [textContent]="'.'" (click)="handleButtonClick('.')"></div>
3051
+ </div>
3052
+ </div>
3053
+ `,
3054
+ encapsulation: ViewEncapsulation.None
3055
+ },] }
3056
+ ];
3057
+ KeyPadComponent.ctorParameters = () => [
3058
+ { type: IconCacheService }
3059
+ ];
3060
+ KeyPadComponent.propDecorators = {
3061
+ model: [{ type: Input }],
3062
+ showValue: [{ type: Input }],
3063
+ emitModelChangeOnEnter: [{ type: Input }],
3064
+ modelChange: [{ type: Output }],
3065
+ internalModelChange: [{ type: Output }],
3066
+ enterClick: [{ type: Output }],
3067
+ showClass: [{ type: HostBinding, args: ['class.co-key-pad',] }],
3068
+ handleKeyDown: [{ type: HostListener, args: ['window:keydown', ['$event'],] }]
3069
+ };
3070
+
3071
+ class KeyPadModule {
3072
+ }
3073
+ KeyPadModule.decorators = [
3074
+ { type: NgModule, args: [{
3075
+ imports: [
3076
+ CommonModule,
3077
+ IconModule
3078
+ ],
3079
+ declarations: [
3080
+ KeyPadComponent
3081
+ ],
3082
+ exports: [
3083
+ KeyPadComponent
3084
+ ]
3085
+ },] }
3086
+ ];
3087
+
3088
+ class LayoutSwitcherComponent {
3089
+ constructor(iconCacheService) {
3090
+ this.iconCacheService = iconCacheService;
3091
+ this.icon = Icon;
3092
+ this.layoutItems = [];
3093
+ this.layoutSwitchEmit = new EventEmitter();
3094
+ this.showMaskSidebar = false;
3095
+ this._activeIndex = 0;
3096
+ }
3097
+ showClass() {
3098
+ return true;
3099
+ }
3100
+ get activeIndex() {
3101
+ return this._activeIndex;
3102
+ }
3103
+ set activeIndex(index) {
3104
+ this._activeIndex = index;
3105
+ this.toggleMaskSidebar();
3106
+ this.layoutSwitchEmit.emit(this.layoutItems[index]);
3107
+ }
3108
+ toggleMaskSidebar() {
3109
+ this.showMaskSidebar = !this.showMaskSidebar;
3110
+ }
3111
+ }
3112
+ LayoutSwitcherComponent.decorators = [
3113
+ { type: Component, args: [{
3114
+ selector: "layout-switcher",
3115
+ template: `
3116
+ <div class="mask-wrapper" [class.mask-wrapper-active]='showMaskSidebar' @showHideSidebar>
3117
+ <div class="icon-wrapper" (click)="toggleMaskSidebar()">
3118
+ <co-icon class="icon-mask" [iconData]="iconCacheService.getIcon(icon.BringForwardRegular)" [@positionIcon]="showMaskSidebar"></co-icon>
3119
+
3120
+ <co-icon class='icon-mask-sidebar-handle' [@positionHandle]='showMaskSidebar' [iconData]="showMaskSidebar ? iconCacheService.getIcon(this.icon.AngleLeftSolid) : iconCacheService.getIcon(this.icon.AngleRightSolid)"></co-icon>
3121
+ </div>
3122
+
3123
+ <div class="mask-content" *ngIf="showMaskSidebar" @showHideSidebar>
3124
+ <span *ngFor='let item of this.layoutItems' [class.active]="this.activeIndex === this.layoutItems.indexOf(item)" [textContent]="item" (click)='activeIndex = this.layoutItems.indexOf(item)' ></span>
3125
+ </div>
3126
+ </div>
3127
+
3128
+ `,
3129
+ animations: [
3130
+ trigger("showHideSidebar", [
3131
+ state("void", style({ "width": "0" })),
3132
+ state("*", style({ "width": "*" })),
3133
+ transition("void <=> *", animate(200))
3134
+ ]),
3135
+ trigger("positionIcon", [
3136
+ state("true", style({ "left": "70px" })),
3137
+ state("false", style({ "left": "10px" })),
3138
+ transition("true <=> false", animate(200))
3139
+ ]),
3140
+ trigger("positionHandle", [
3141
+ state("true", style({ "left": "15px" })),
3142
+ state("false", style({ "left": "75px" })),
3143
+ transition("true <=> false", animate(200))
3144
+ ])
3145
+ ],
3146
+ encapsulation: ViewEncapsulation.None
3147
+ },] }
3148
+ ];
3149
+ LayoutSwitcherComponent.ctorParameters = () => [
3150
+ { type: IconCacheService }
3151
+ ];
3152
+ LayoutSwitcherComponent.propDecorators = {
3153
+ showClass: [{ type: HostBinding, args: ['class.layout-switcher',] }],
3154
+ layoutItems: [{ type: Input }],
3155
+ layoutSwitchEmit: [{ type: Output }]
3156
+ };
3157
+
3158
+ class LayoutSwitcherModule {
3159
+ }
3160
+ LayoutSwitcherModule.decorators = [
3161
+ { type: NgModule, args: [{
3162
+ imports: [
3163
+ CommonModule,
3164
+ IconModule
3165
+ ],
3166
+ declarations: [
3167
+ LayoutSwitcherComponent,
3168
+ ],
3169
+ exports: [
3170
+ LayoutSwitcherComponent
3171
+ ]
3172
+ },] }
3173
+ ];
3174
+
3175
+ var GaugeColor$1;
3176
+ (function (GaugeColor) {
3177
+ GaugeColor["Low"] = "#E0E0E0";
3178
+ GaugeColor["Medium"] = "#F88952";
3179
+ GaugeColor["High"] = "#5FDCB3";
3180
+ })(GaugeColor$1 || (GaugeColor$1 = {}));
3181
+ class CoCircularGaugeComponent {
3182
+ constructor() {
3183
+ this._color = GaugeColor$1.Low;
3184
+ this.majorTicks = {
3185
+ height: 0,
3186
+ };
3187
+ this.minorTicks = {
3188
+ height: 0
3189
+ };
3190
+ this.labelStyle = {
3191
+ position: 'Inside', useRangeColor: true,
3192
+ font: { size: '0px', fontFamily: 'inherit' }
3193
+ };
3194
+ this.lineStyle = {
3195
+ width: 0
3196
+ };
3197
+ this.ranges = [
3198
+ {
3199
+ start: 1, end: 100,
3200
+ radius: '13px',
3201
+ startWidth: 3, endWidth: 3,
3202
+ color: '#E0E0E0',
3203
+ roundedCornerRadius: 0
3204
+ },
3205
+ ];
3206
+ }
3207
+ set value(value) {
3208
+ this._value = value;
3209
+ this._setColor();
3210
+ }
3211
+ get value() {
3212
+ return this._value;
3213
+ }
3214
+ get color() {
3215
+ return this._color;
3216
+ }
3217
+ showClass() {
3218
+ return true;
3219
+ }
3220
+ getAxes() {
3221
+ return [{
3222
+ minimum: 0,
3223
+ maximum: 100,
3224
+ radius: '15px',
3225
+ startAngle: 1,
3226
+ endAngle: 360,
3227
+ majorTicks: this.majorTicks,
3228
+ minorTicks: this.minorTicks,
3229
+ labelStyle: this.labelStyle,
3230
+ lineStyle: this.lineStyle,
3231
+ ranges: this.ranges,
3232
+ pointers: this.getPointers(),
3233
+ annotations: this.getAnnotations(),
3234
+ }];
3235
+ }
3236
+ getPointers() {
3237
+ if (this.value) {
3238
+ return [{
3239
+ roundedCornerRadius: 0,
3240
+ value: this.value,
3241
+ type: 'RangeBar',
3242
+ radius: '13px',
3243
+ color: this.color,
3244
+ border: {
3245
+ width: 0
3246
+ },
3247
+ animation: {
3248
+ enable: false
3249
+ },
3250
+ pointerWidth: 3
3251
+ }];
3252
+ }
3253
+ }
3254
+ ;
3255
+ getAnnotations() {
3256
+ if (this.value !== undefined) {
3257
+ const label = this.value ? this.value + "%" : "0%";
3258
+ return [{
3259
+ content: '<div class="annotation">' +
3260
+ label + '</div>',
3261
+ angle: 90,
3262
+ radius: '50%',
3263
+ zIndex: '10',
3264
+ }];
3265
+ }
3266
+ }
3267
+ _setColor() {
3268
+ if (this.value == 0) {
3269
+ this._color = GaugeColor$1.Low;
3270
+ }
3271
+ else if (this.value >= 0 && this.value < 100) {
3272
+ this._color = GaugeColor$1.Medium;
3273
+ }
3274
+ else if (this.value == 100) {
3275
+ this._color = GaugeColor$1.High;
3276
+ }
3277
+ }
3278
+ }
3279
+ CoCircularGaugeComponent.decorators = [
3280
+ { type: Component, args: [{
3281
+ selector: "co-circular-gauge",
3282
+ template: `
3283
+ <div class="circular-gauge-wrapper">
3284
+ <ejs-circulargauge
3285
+ class="circular-gauge"
3286
+ [width]="'100%'"
3287
+ [axes]="getAxes()">
3288
+ </ejs-circulargauge>
3289
+ </div>
3290
+ `,
3291
+ encapsulation: ViewEncapsulation.None
3292
+ },] }
3293
+ ];
3294
+ CoCircularGaugeComponent.propDecorators = {
3295
+ circulargauge: [{ type: ViewChild, args: ['circulargauge',] }],
3296
+ value: [{ type: Input }],
3297
+ showClass: [{ type: HostBinding, args: ["class.co-circular-gauge",] }]
3298
+ };
3299
+
3300
+ class CoCircularGaugeModule {
3301
+ }
3302
+ CoCircularGaugeModule.decorators = [
3303
+ { type: NgModule, args: [{
3304
+ imports: [
3305
+ CommonModule,
3306
+ CircularGaugeModule
3307
+ ],
3308
+ declarations: [
3309
+ CoCircularGaugeComponent
3310
+ ],
3311
+ exports: [
3312
+ CoCircularGaugeComponent
3313
+ ]
3314
+ },] }
3315
+ ];
3316
+
3317
+ var GaugeColor;
3318
+ (function (GaugeColor) {
3319
+ GaugeColor["Low"] = "#E0E0E0";
3320
+ GaugeColor["Medium"] = "#F88952";
3321
+ GaugeColor["High"] = "#5FDCB3";
3322
+ })(GaugeColor || (GaugeColor = {}));
3323
+ class CoLinearGaugeComponent {
3324
+ constructor() {
3325
+ this.color = GaugeColor.Low;
3326
+ }
3327
+ set value(value) {
3328
+ this._value = value;
3329
+ this._setColor();
3330
+ }
3331
+ get value() {
3332
+ return this._value;
3333
+ }
3334
+ showClass() {
3335
+ return true;
3336
+ }
3337
+ getStyle() {
3338
+ return `linear-gradient(90deg, ${this.color} 0 ${this.value}%, white ${this.value}% 100%`;
3339
+ }
3340
+ _setColor() {
3341
+ if (this.value == 0) {
3342
+ this.color = GaugeColor.Low;
3343
+ }
3344
+ else if (this.value >= 0 && this.value < 100) {
3345
+ this.color = GaugeColor.Medium;
3346
+ }
3347
+ else if (this.value == 100) {
3348
+ this.color = GaugeColor.High;
3349
+ }
3350
+ }
3351
+ }
3352
+ CoLinearGaugeComponent.decorators = [
3353
+ { type: Component, args: [{
3354
+ selector: "co-linear-gauge",
3355
+ template: `
3356
+ <div class="linear-gauge"
3357
+ [style.background]="getStyle()"
3358
+ [style.border-color]="color"
3359
+ [textContent]="count ? count : ''"
3360
+ ></div>
3361
+ `,
3362
+ encapsulation: ViewEncapsulation.None
3363
+ },] }
3364
+ ];
3365
+ CoLinearGaugeComponent.propDecorators = {
3366
+ value: [{ type: Input }],
3367
+ count: [{ type: Input }],
3368
+ showClass: [{ type: HostBinding, args: ["class.co-linear-gauge",] }]
3369
+ };
3370
+
3371
+ class CoLinearGaugeModule {
3372
+ }
3373
+ CoLinearGaugeModule.decorators = [
3374
+ { type: NgModule, args: [{
3375
+ imports: [
3376
+ CommonModule,
3377
+ ],
3378
+ declarations: [
3379
+ CoLinearGaugeComponent
3380
+ ],
3381
+ exports: [
3382
+ CoLinearGaugeComponent
3383
+ ]
3384
+ },] }
3385
+ ];
3386
+
3387
+ class StatusbarComponent {
3388
+ constructor() {
3389
+ this.statusbarClick = new EventEmitter();
3390
+ this.showPopup = false;
3391
+ this.popupClass = 'dropdown';
3392
+ }
3393
+ set statusbarData(value) {
3394
+ this._statusbarData = value;
3395
+ }
3396
+ get statusbarData() {
3397
+ return this._statusbarData;
3398
+ }
3399
+ showClass() {
3400
+ return true;
3401
+ }
3402
+ onHover(event) {
3403
+ this.showPopup = true;
3404
+ this._mouseY = event.screenY;
3405
+ this._windowHeight = window.innerHeight;
3406
+ this.setPopupClass();
3407
+ }
3408
+ onLeave() {
3409
+ this.showPopup = false;
3410
+ }
3411
+ onStatusbarClick() {
3412
+ this.statusbarClick.emit();
3413
+ }
3414
+ setPopupClass() {
3415
+ const popupHeight = this.statusbarData.length * 30;
3416
+ let dropdownInScreen = (this._mouseY + popupHeight) <= this._windowHeight;
3417
+ if (dropdownInScreen) {
3418
+ this.popupClass = 'dropdown';
3419
+ }
3420
+ else {
3421
+ this.popupClass = 'dropup';
3422
+ }
3423
+ }
3424
+ }
3425
+ StatusbarComponent.decorators = [
3426
+ { type: Component, args: [{
3427
+ selector: "co-statusbar",
3428
+ template: `
3429
+ <div class="co-statusbar-wrapper"
3430
+ *ngIf="statusbarData"
3431
+ (mouseover)="onHover($event)"
3432
+ (mouseleave)="onLeave()"
3433
+ (click)="onStatusbarClick()">
3434
+ <div class="statuses">
3435
+ <div *ngFor="let data of statusbarData; let index = index" class="status">
3436
+ <co-linear-gauge [value]="data.percentage" [count]="!!data.count ? data.count : undefined"></co-linear-gauge>
3437
+ </div>
3438
+ </div>
3439
+ <div class=status-description-popup *ngIf="showPopup" @showHidePopup [ngClass]="popupClass">
3440
+ <div class="status-descriptions">
3441
+ <div *ngFor="let data of statusbarData; let index = index" class="status-description">
3442
+ <co-circular-gauge [value]="data.percentage"></co-circular-gauge>
3443
+ <span [textContent]="data.label"></span>
3444
+ </div>
3445
+ </div>
3446
+ </div>
3447
+ </div>
3448
+ `,
3449
+ animations: [
3450
+ trigger("showHidePopup", [
3451
+ state("void", style({ opacity: 0 })),
3452
+ state("*", style({ opacity: 1 })),
3453
+ transition("void <=> *", animate("250ms ease-in-out")),
3454
+ ])
3455
+ ],
3456
+ encapsulation: ViewEncapsulation.None
3457
+ },] }
3458
+ ];
3459
+ StatusbarComponent.ctorParameters = () => [];
3460
+ StatusbarComponent.propDecorators = {
3461
+ statusbarData: [{ type: Input }],
3462
+ statusbarClick: [{ type: Output }],
3463
+ showClass: [{ type: HostBinding, args: ["class.co-statusbar",] }]
3464
+ };
3465
+
3466
+ class StatusbarModule {
3467
+ }
3468
+ StatusbarModule.decorators = [
3469
+ { type: NgModule, args: [{
3470
+ imports: [
3471
+ CommonModule,
3472
+ CoCircularGaugeModule,
3473
+ CoLinearGaugeModule
3474
+ ],
3475
+ declarations: [
3476
+ StatusbarComponent
3477
+ ],
3478
+ exports: [
3479
+ StatusbarComponent
3480
+ ]
3481
+ },] }
3482
+ ];
3483
+
3484
+ class SharedService {
3485
+ constructor(options, connector) {
3486
+ this.options = options;
3487
+ this.connector = connector;
3488
+ }
3489
+ init(options) {
3490
+ return __awaiter(this, void 0, void 0, function* () {
3491
+ yield this.options.initialize(options);
3492
+ this.connector.connect();
3493
+ });
3494
+ }
3495
+ }
3496
+ SharedService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SharedService_Factory() { return new SharedService(i0.ɵɵinject(OptionsService), i0.ɵɵinject(SharedConnectorService)); }, token: SharedService, providedIn: "root" });
3497
+ SharedService.decorators = [
3498
+ { type: Injectable, args: [{
3499
+ providedIn: "root"
3500
+ },] }
3501
+ ];
3502
+ SharedService.ctorParameters = () => [
3503
+ { type: OptionsService },
3504
+ { type: SharedConnectorService }
3505
+ ];
3506
+
3507
+ /*
3508
+ * Public API Surface of sharedcomponents
3509
+ */
3510
+
3511
+ /**
3512
+ * Generated bundle index. Do not edit.
3513
+ */
3514
+
3515
+ export { CoCircularGaugeComponent, CoCircularGaugeModule, CoLinearGaugeComponent, CoLinearGaugeModule, DocsignComponent, DocsignModule, KeyPadComponent, KeyPadModule, LayoutSwitcherComponent, LayoutSwitcherModule, SendMethodDialogComponent, SendMethodDialogModule, SharedService, StatusbarComponent, StatusbarModule, StockComponent, StockModule, SignatureComponent as ɵa, SignaturesComponent as ɵb, StockService as ɵc, SharedConnectorService as ɵd, OptionsService as ɵe, DictionaryService as ɵf, IconCacheService as ɵg, StockInformationComponent as ɵh, StockInformationGridComponent as ɵi, StockLocationComponent as ɵj, StockTransferComponent as ɵk, StockChangeAmountComponent as ɵl };
3516
+ //# sourceMappingURL=colijnit-sharedcomponents.js.map