@colijnit/sharedcomponents 1.0.25 → 1.0.27

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 +3704 -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 +124 -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 +3514 -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 +6 -3
  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
@@ -1,153 +0,0 @@
1
- import {AfterViewInit, Component, EventEmitter, Input, Output, ViewEncapsulation} from "@angular/core";
2
- import {PrintStockStickers} from "@colijnit/articleapi/build/model/print-stock-stickers";
3
- import {StockService} from "../../../service/stock.service";
4
- import {CoDropDownListFields} from "./co-drop-down-list-fields.interface";
5
- import {ArticleStock as ArticleStockBo} from "@colijnit/articleapi/build/model/article-stock.bo";
6
- import {ArticleDetailsBo} from "@colijnit/articleapi/build/model/article-details.bo";
7
- import {StockManagementWarehouses} from "@colijnit/articleapi/build/model/stock-management-warehouses.bo";
8
- import {StockStatus} from "@colijnit/articleapi/build/model/stock-status.bo";
9
- import {StockLocation} from "@colijnit/articleapi/build/model/stock-location.bo";
10
-
11
- @Component({
12
- selector: "co-stock-transfer",
13
- template: `
14
- <div class="stock-transfer">
15
- <div class="stock-transfer-columns">
16
- <div *ngIf="articleToTransfer" class="stock-transfer-left-column">
17
- <co-input-text disabled
18
- [(model)]="articleToTransfer.warehouseDescription"
19
- [textContent]="articleToTransfer.warehouseDescription"
20
- [placeholder]="'Standaard magazijn'">
21
- </co-input-text>
22
- <co-input-text disabled
23
- [(model)]="articleToTransfer.locationNo"
24
- [textContent]="articleToTransfer.locationNo"
25
- [placeholder]="'Standaard locatie'">
26
- </co-input-text>
27
- <co-input-text disabled
28
- [(model)]="stockSticker.batch"
29
- [placeholder]="'Batch'">
30
- </co-input-text>
31
- <co-input-text disabled
32
- [(model)]="stockSticker.serial"
33
- [placeholder]="'Serie'">
34
- </co-input-text>
35
- <co-input-text
36
- [(model)]="articleToTransfer.amountTransfer"
37
- [placeholder]="'Aantal'">
38
- </co-input-text>
39
- </div>
40
-
41
- <div class="stock-transfer-right-column">
42
- <co-drop-down-list [collection]="warehouses"
43
- [fields]="allWarehousesDropdownFields"
44
- (modelChange)="handleSelectedWarehouse($event)"
45
- [(model)]="articleToTransfer.targetWarehouse">
46
- </co-drop-down-list>
47
- <co-drop-down-list [collection]="locations"
48
- [fields]="allLocationDropdownFields"
49
- [(model)]="articleToTransfer.targetLocation"
50
- >
51
- </co-drop-down-list>
52
- <co-drop-down-list [collection]="stockState"
53
- [fields]="stockStateDropdownField"
54
- [placeholder]="'Voorraadstatus'"
55
- [(model)]="articleToTransfer.stockStateId">
56
- </co-drop-down-list>
57
- <co-input-text [placeholder]="'Omschrijving'"
58
- [(model)]="articleToTransfer.stockStateRemark">
59
- </co-input-text>
60
- </div>
61
- </div>
62
-
63
- <div class="ok-cancel-buttons">
64
- <co-button [textContent]="'Ok'" (click)="handleOkClick(articleToTransfer)"></co-button>
65
- <co-button [textContent]="'Annuleren'" (click)="handleCancelClick()"></co-button>
66
- <co-button [textContent]="'Sticker'" (click)="handleStickerClick()"></co-button>
67
- </div>
68
- </div>
69
- `,
70
- encapsulation: ViewEncapsulation.None
71
- })
72
- export class StockTransferComponent implements AfterViewInit {
73
-
74
- @Input()
75
- public stockSticker: PrintStockStickers;
76
-
77
- @Input()
78
- public article: ArticleStockBo;
79
-
80
- @Input()
81
- public articleToTransfer: ArticleDetailsBo;
82
-
83
- @Input()
84
- public articleWarehouse: any[];
85
-
86
- @Input()
87
- public allWarehouses: any[];
88
-
89
- @Output()
90
- public handleCancelClicked: EventEmitter<any> = new EventEmitter();
91
-
92
- @Output()
93
- public handleStickerClicked: EventEmitter<any> = new EventEmitter();
94
-
95
- public allWarehousesDropdownFields: CoDropDownListFields = {text: "warehouseDescription", value: "warehouseNo"};
96
- public allLocationDropdownFields: CoDropDownListFields = {text: "locationNo", value: "locationNo"};
97
-
98
- public showSendMethodDialog: boolean = false;
99
- public warehouses: StockManagementWarehouses[];
100
- public stockState: StockStatus[] = [];
101
- public stockStateDropdownField: CoDropDownListFields = {text: "stateDescription", value: "stockStateId"};
102
- public locations: StockLocation[];
103
- public selectedWarehouse: any;
104
-
105
- constructor(
106
- private _stockService: StockService
107
- ) {
108
- }
109
-
110
- ngAfterViewInit() {
111
- this.getStockManagementWarehouses();
112
- this.getStockState();
113
- }
114
-
115
- public async handleOkClick(data: ArticleDetailsBo): Promise<void> {
116
- data.selected = true;
117
- data.entryDate = new Date;
118
- await this._stockService.updateArticleDetails(data);
119
- }
120
-
121
- public handleCancelClick(): void {
122
- this.handleCancelClicked.emit();
123
- }
124
-
125
- public handleSelectedWarehouse(event): void {
126
- this.selectedWarehouse = event;
127
- this.getStockManagementLocations(this.selectedWarehouse);
128
- }
129
-
130
- public async handleStickerClick(): Promise<void> {
131
- this.handleStickerClicked.emit();
132
- this.showSendMethodDialog = true;
133
- }
134
-
135
- public getStockManagementWarehouses(): void {
136
- this._stockService.getStockManagementWarehouses().then((warehouses) => {
137
- this.warehouses = warehouses;
138
- })
139
- }
140
-
141
- public getStockManagementLocations(data): void {
142
- this._stockService.getStockManagementLocations(data).then((locations) => {
143
- this.locations = locations;
144
- })
145
- }
146
-
147
- public getStockState(): void {
148
- this._stockService.getStockState().then((state: StockStatus[]) => {
149
- this.stockState = state;
150
- });
151
- }
152
-
153
- }
@@ -1,165 +0,0 @@
1
- import {
2
- ChangeDetectorRef,
3
- Component,
4
- EventEmitter,
5
- HostBinding,
6
- Input, OnDestroy,
7
- Output,
8
- ViewChild,
9
- ViewEncapsulation
10
- } from "@angular/core";
11
- import {StockService} from "../../service/stock.service";
12
- import {PrintStockStickers} from "@colijnit/sharedapi/build/model/print-stock-stickers";
13
- import {GetStockHistoryRequest} from "@colijnit/articleapi/build/model/get-stock-history-request";
14
- import {ArticleStock as ArticleStockBo} from "@colijnit/articleapi/build/model/article-stock.bo";
15
- import {ArticleExtended} from "@colijnit/articleapi/build/model/article-extended.bo";
16
- import {ArticleStock} from "@colijnit/articleapi/build/model/article-stock";
17
- import {StockHistoryBo} from "@colijnit/articleapi/build/model/stock-history.bo";
18
- import {ArticleDetailsBo} from "@colijnit/articleapi/build/model/article-details.bo";
19
- import {OptionsService} from "../../service/options.service";
20
- import {Subscription} from "rxjs";
21
- import {DictionaryService} from "../../service/dictionary.service";
22
-
23
- @Component({
24
- selector: "co-stock",
25
- template: `
26
- <div class="stock-info-container">
27
- <co-stock-information [article]="articleExtended"
28
- [articleStock]=""
29
- [allAvailableStockInformation]="allAvailableStock"
30
- [allTechnicalStockInformation]="allTechnicalStock"
31
- >
32
- </co-stock-information>
33
- <hr>
34
- <co-stock-information-grid *ngIf="showStockInformationGrid"
35
- [stockLocationData]="stockLocationInformation"
36
- [articleStockInformation]="stockInformation"
37
- (transferIconClicked)="handleStockTransferClick($event)"
38
- (historyClicked)="getStockHistory()"
39
- [stockHistoryInformation]="stockHistory"
40
- >
41
- </co-stock-information-grid>
42
- <co-stock-location *ngIf="showStockLocation"
43
- (backToStockLines)="backToStockLinesClicked()">
44
-
45
- </co-stock-location>
46
- <co-stock-transfer *ngIf="showStockTransfer"
47
- (handleCancelClicked)="backToStock()"
48
- [article]="stockTransferArticle"
49
- [articleToTransfer]="stockTransferArticleDetails"
50
- [stockSticker]="stockService.stockStickers"
51
- (handleStickerClicked)="handleStickerClicked.emit($event)"
52
- [articleWarehouse]="articleWarehouse"
53
- [allWarehouses]="allWarehouses"
54
- >
55
- </co-stock-transfer>
56
- </div>
57
- `,
58
- encapsulation: ViewEncapsulation.None
59
- })
60
- export class StockComponent implements OnDestroy {
61
-
62
- @ViewChild(StockComponent)
63
- public stock: StockComponent;
64
-
65
- @Output()
66
- public handleStickerClicked: EventEmitter<any> = new EventEmitter();
67
-
68
- @Input()
69
- public set article(article) {
70
- this.articleExtended = article;
71
- this.getStockInformation(article);
72
- };
73
-
74
- @Input()
75
- public articleWarehouse: any[];
76
-
77
- @Input()
78
- public allWarehouses: any[];
79
-
80
- @HostBinding("class.co-stock")
81
- public showClass() {
82
- return true;
83
- }
84
-
85
- public showStockInformationGrid: boolean = true;
86
- public showStockLocation: boolean = false;
87
- public showStockTransfer: boolean = false;
88
- public stockInformation: ArticleStockBo[];
89
- public stockLocationInformation: ArticleStockBo[];
90
- public stockTransferArticle: ArticleStockBo;
91
- public stockTransferArticleDetails: ArticleDetailsBo;
92
- public articleExtended: ArticleExtended;
93
- public stockHistory: StockHistoryBo[];
94
- public allAvailableStock: number = 0;
95
- public allTechnicalStock: number = 0;
96
- private _subscriptions: Subscription[] = [];
97
-
98
- constructor(
99
- public stockService: StockService,
100
- private _optionsService: OptionsService,
101
- private _dictionary: DictionaryService,
102
- private _changeDetector: ChangeDetectorRef,
103
- ) {
104
- this._subscriptions.push(
105
- this._optionsService.optionsLoaded.subscribe(loaded => this._handleSettingsLoaded(loaded)),
106
- )
107
- }
108
-
109
- ngOnDestroy(): void {
110
- this._subscriptions.forEach(subscription => subscription.unsubscribe());
111
- }
112
-
113
- public backToStockLinesClicked(): void {
114
- this.showStockLocation = false;
115
- this.showStockInformationGrid = true;
116
- }
117
-
118
- public handleStockTransferClick(event): void {
119
- this.stockTransferArticleDetails = event;
120
- this.showStockTransfer = !this.showStockTransfer;
121
- this.showStockInformationGrid = !this.showStockInformationGrid;
122
- this.stockService.stockStickers = new PrintStockStickers();
123
- }
124
-
125
- public backToStock(): void {
126
- this.showStockTransfer = !this.showStockTransfer;
127
- this.showStockInformationGrid = !this.showStockInformationGrid;
128
- }
129
-
130
- public async getStockHistory(): Promise<void> {
131
- const stockHistoryInformation: GetStockHistoryRequest = new GetStockHistoryRequest();
132
- stockHistoryInformation.type = "B";
133
- stockHistoryInformation.goodId = this.articleExtended.goodId.toString();
134
- this.stockHistory = await this.stockService.getStockHistory(stockHistoryInformation);
135
- }
136
-
137
- public async getStockInformation(data: ArticleStock): Promise<void> {
138
- const articleData: ArticleStock = new ArticleStock();
139
- articleData.goodId = data.goodId.toString();
140
- articleData.viewKind = "M";
141
- this.stockInformation = await this.stockService.getStockInformation(articleData);
142
- this.stockInformation.forEach((articleStock) => this.allAvailableStock += articleStock.availableStock);
143
- this.stockInformation.forEach((articleStock) => this.allTechnicalStock += articleStock.technicalStock);
144
-
145
- }
146
-
147
- private async _handleSettingsLoaded(loaded: boolean): Promise<void> {
148
- if (loaded) {
149
- await this._initConnection().then();
150
- }
151
- }
152
-
153
- private async _initConnection(): Promise<void> {
154
- // await this._connector.connect(this._optionsService.options);
155
-
156
- if (this._optionsService.options.url) {
157
- this._dictionary.rootUrl = this._optionsService.options.url.replace("/ajaxservice", "");
158
- }
159
- await this._dictionary.setDictionary(this._optionsService.options.languageCode);
160
- setTimeout(() => {
161
- this._changeDetector.detectChanges();
162
- });
163
- }
164
-
165
- }
@@ -1,51 +0,0 @@
1
- import {NgModule} from "@angular/core";
2
- import {StockComponent} from "./stock.component";
3
- import {
4
- ButtonModule, CoDialogWizardModule,
5
- CoGridModule,
6
- DropDownModule, IconModule, ImageModule,
7
- InputComboBoxModule, InputNumberPickerModule,
8
- InputRadioButtonModule, InputTextareaModule, InputTextModule, SimpleGridModule
9
- } from "@colijnit/corecomponents_v12";
10
- import {CommonModule} from "@angular/common";
11
- import {StockInformationComponent} from "./stock-information/stock-information.component";
12
- import {StockInformationGridComponent} from "./stock-information-grid/stock-information-grid.component";
13
- import {StockLocationComponent} from "./stock-location/stock-location.component";
14
- import {StockService} from "../../service/stock.service";
15
- import {StockTransferComponent} from "./stock-transfer/stock-transfer.component";
16
- import {SendMethodDialogModule} from "../send-method-dialog/send-method-dialog.module";
17
- import {StockChangeAmountComponent} from "./stock-transfer/stock-change-amount.component";
18
-
19
- @NgModule({
20
- imports: [
21
- InputComboBoxModule,
22
- CoGridModule,
23
- ButtonModule,
24
- CommonModule,
25
- InputRadioButtonModule,
26
- DropDownModule,
27
- SimpleGridModule,
28
- ImageModule,
29
- InputTextModule,
30
- SendMethodDialogModule,
31
- IconModule,
32
- InputNumberPickerModule,
33
- CoDialogWizardModule,
34
- InputTextareaModule
35
- ],
36
- declarations: [
37
- StockComponent,
38
- StockInformationComponent,
39
- StockInformationGridComponent,
40
- StockLocationComponent,
41
- StockTransferComponent,
42
- StockChangeAmountComponent
43
- ],
44
- exports: [
45
- StockComponent
46
- ],
47
- providers: [
48
- StockService
49
- ]
50
- })
51
- export class StockModule {}
@@ -1,6 +0,0 @@
1
- export enum CalendarView {
2
- DayView = "DAY",
3
- WeekView = "WEEK",
4
- WeekSelectView = "WEEK_SELECT",
5
- MonthView = "MONTH"
6
- }
@@ -1,30 +0,0 @@
1
- export enum KeyboardCode {
2
- Backspace = "Backspace",
3
- Digit0 = "Digit0",
4
- Digit1 = "Digit1",
5
- Digit2 = "Digit2",
6
- Digit3 = "Digit3",
7
- Digit4 = "Digit4",
8
- Digit5 = "Digit5",
9
- Digit6 = "Digit6",
10
- Digit7 = "Digit7",
11
- Digit8 = "Digit8",
12
- Digit9 = "Digit9",
13
- Enter = "Enter",
14
- Escape = "Escape",
15
- Minus = "Minus",
16
- Numpad0 = "Numpad0",
17
- Numpad1 = "Numpad1",
18
- Numpad2 = "Numpad2",
19
- Numpad3 = "Numpad3",
20
- Numpad4 = "Numpad4",
21
- Numpad5 = "Numpad5",
22
- Numpad6 = "Numpad6",
23
- Numpad7 = "Numpad7",
24
- Numpad8 = "Numpad8",
25
- Numpad9 = "Numpad9",
26
- NumpadDecimal = "NumpadDecimal",
27
- NumpadEnter = "NumpadEnter",
28
- NumpadSubtract = "NumpadSubtract",
29
- Period = "Period"
30
- }
@@ -1,6 +0,0 @@
1
- export enum LanguageCode {
2
- Dutch = "nl-NL",
3
- English = "en-GB",
4
- German = "de-DE",
5
- French = "fr-FR",
6
- }
@@ -1,15 +0,0 @@
1
- // All the months. Values are corresponding dictionary keys in text_nl.
2
- export enum Month {
3
- January = "JANUARY",
4
- Februrary = "FEBRUARY",
5
- March = "MARCH",
6
- April = "APRIL",
7
- May = "MAY",
8
- June = "JUNE",
9
- July = "JULY",
10
- August = "AUGUST",
11
- September = "SEPTEMBER",
12
- October = "OCTOBER",
13
- November = "NOVEMBER",
14
- December = "DECEMBER"
15
- }
@@ -1,9 +0,0 @@
1
- // DOM_DATUMSELECTIE
2
- export enum TimePeriod {
3
- LastSevenDays = "LW",
4
- LastMonth = "LM",
5
- LastYear = "LY",
6
- LastCalendarYear = "LCY",
7
- CurrentCalendarYear = "CCY",
8
- Custom = "C"
9
- }
@@ -1,120 +0,0 @@
1
- import {ComplexFieldDecorator} from "./decorators/complex-field.decorator";
2
- import {ComplexArrayDecorator} from "./decorators/complex-array.decorator";
3
- import {BooleanTextDecorator} from "./decorators/boolean.decorator";
4
- import {DateFieldFieldDecorator} from "./decorators/date-field.decorator";
5
- import {StringNumberDecorator} from "./decorators/string-number.decorator";
6
- import {isNill} from "../utils/is-nill.function";
7
- import {ArrayUtils} from "../utils/array-utils";
8
- import {BusinessObject} from "../model/business-object";
9
-
10
- // Factory service creates businessobjects, using their decorators in the process.
11
- export class BusinessObjectFactory {
12
- constructor() {
13
- }
14
-
15
- /**
16
- * Creates and returns a new business data object instance of given class, with all given data properties applied to it in a
17
- * complex-aware style. That is, all properties on given class that are decorated with @ComplexField(..) or @ComplexArray(..) decorators
18
- * become strongly typed business objects, with methods that are usable and such.
19
- *
20
- * @param modelClass
21
- * @param {Object} rawData The object with all (possibly raw/flat/not alive) data to be applied to the created model object
22
- */
23
- public makeWithRawBackendData(modelClass: any, rawData: Object): BusinessObject {
24
- if (!modelClass) {
25
- return undefined;
26
- }
27
- if (typeof modelClass !== typeof BusinessObject) {
28
- return undefined;
29
- }
30
-
31
- const model: BusinessObject = new modelClass();
32
- this._copyAllPropertiesDecoratorProcessedFrom(rawData, model);
33
- return model;
34
- }
35
-
36
- // see makeWithRawBackendData, this is a loop-wrapper around that method
37
- public makeBOArrayFromRawBackendDataArray(modelClass: any, arrayOfRawDatas: Object[]): BusinessObject[] {
38
- if (!modelClass) {
39
- return undefined;
40
- }
41
-
42
- const trueClientBos: BusinessObject[] = [];
43
- if (arrayOfRawDatas) {
44
- for (let i: number = 0, len: number = arrayOfRawDatas.length; i < len; i++) {
45
- trueClientBos.push(this.makeWithRawBackendData(modelClass, arrayOfRawDatas[i]));
46
- }
47
- }
48
- return trueClientBos;
49
- }
50
-
51
- public instantiateNewBo(modelClass: any): BusinessObject {
52
- return this.makeWithRawBackendData(modelClass, {});
53
- }
54
-
55
- /**
56
- * Applies all properties of given 'source' object to the given 'destination' businessobject, if destination has that property.
57
- * Works with the @ComplexField(), @ComplexArray, @BooleanText, @CoInject and @DateField annotations of given destination model.
58
- *
59
- * @param sourceData Raw data to copy to destination model
60
- * @param {BusinessObject} destinationModel InOut: The annotated businessobject to apply source properties to
61
- */
62
- private _copyAllPropertiesDecoratorProcessedFrom(sourceData: any, destinationModel: BusinessObject): void {
63
- if (!sourceData || !destinationModel) {
64
- return;
65
- }
66
-
67
- // process all source data into destinationModel
68
- for (const srcPropKey in sourceData) {
69
- if (!sourceData.hasOwnProperty(srcPropKey)) {
70
- continue;
71
- }
72
-
73
- const srcPropVal: any = sourceData[srcPropKey];
74
-
75
- if (ComplexFieldDecorator.IsComplexField(destinationModel, srcPropKey)) {
76
- const classOfField: any = ComplexFieldDecorator.GetComplexFieldType(destinationModel, srcPropKey);
77
- destinationModel[srcPropKey] = this.makeWithRawBackendData(classOfField, srcPropVal);
78
- } else if (ComplexArrayDecorator.IsComplexArray(destinationModel, srcPropKey)) {
79
- const sourceArray: any[] = srcPropVal;
80
- if (!sourceArray) {
81
- continue;
82
- }
83
- const classOfArrayItems: any = ComplexArrayDecorator.GetComplexArrayType(destinationModel, srcPropKey);
84
- const tempArray: any[] = [];
85
- for (let i: number = 0, len: number = sourceArray.length; i < len; i++) {
86
- tempArray.push(this.makeWithRawBackendData(classOfArrayItems, sourceArray[i]));
87
- }
88
- destinationModel[srcPropKey] = tempArray;
89
- } else if (BooleanTextDecorator.IsBooleanTextField(destinationModel, srcPropKey)) {
90
- // logical 'true' and 'false' also allowed as incoming values for @BooleanText() properties: then just copy their value
91
- if (typeof srcPropVal === "boolean") {
92
- destinationModel[srcPropKey] = srcPropVal;
93
- // here, it should be a 'J' or 'N' (or 'T' or 'F'): assign the associated boolean value
94
- } else {
95
- destinationModel[srcPropKey] = BooleanTextDecorator.GetLogicalBooleanValue(srcPropVal);
96
- }
97
- } else if (DateFieldFieldDecorator.IsDateField(destinationModel, srcPropKey)) {
98
- destinationModel[srcPropKey] = DateFieldFieldDecorator.StringAsDate(srcPropVal);
99
- } else if (StringNumberDecorator.IsStringNumber(destinationModel, srcPropKey)) {
100
- destinationModel[srcPropKey] = StringNumberDecorator.StringAsNumber(srcPropVal);
101
- }
102
- // non-decorated prop
103
- else {
104
- if (isNill(srcPropVal)) {
105
- destinationModel[srcPropKey] = undefined;
106
- } else if (Array.isArray(srcPropVal)) {
107
- destinationModel[srcPropKey] = ArrayUtils.CloneArray(srcPropVal);
108
- } else if (typeof srcPropVal === "object") {
109
- if (srcPropVal instanceof Map) { //just copy the value in case of maps
110
- destinationModel[srcPropKey] = srcPropVal;
111
- } else {
112
- destinationModel[srcPropKey] = Object.assign({}, srcPropVal);
113
- }
114
- } else {
115
- destinationModel[srcPropKey] = srcPropVal;
116
- }
117
- }
118
- }
119
- }
120
- }
@@ -1,113 +0,0 @@
1
- import {GetYesNoDbBooleanValue} from "@colijnit/articleapi/build/enum/yes-no-db-type.enum";
2
- import {GetTrueFalseDbBooleanValue} from "@colijnit/articleapi/build/enum/true-false-db-type.enum";
3
- import {GetOneZeroDbBooleanValue} from "@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum";
4
- import {DbBooleanValueType, GetLogicalBooleanValue} from "@colijnit/articleapi/build/enum/db-boolean-value-type.enum";
5
-
6
- const PROP_META_KEY_JN: string = "booleanTextJN";
7
- const PROP_META_KEY_TF: string = "booleanTextTF";
8
- const PROP_META_KEY_10: string = "booleanText10";
9
-
10
- /**
11
- * 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
12
- * our client application.
13
- *
14
- * The values 'J' and 'N' seem to be most commonly used. This is the default setting when using this decorator.
15
- * You can pass 'T' or 1 for the other variants as follows:
16
- *
17
- * Usage:
18
- *
19
- * @BooleanText() or @BooleanText("J") (the default, uses YesNoDbType char values)
20
- * public foo: boolean // 'J' and 'N' become true and false after BusinessObjectFactoryService and -SerializerService processing
21
- *
22
- * @BooleanText('T') (uses TrueFalseDbType char values)
23
- * public bar: boolean // 'T' and 'F' become true and false after BusinessObjectFactoryService and -SerializerService processing
24
- *
25
- * @BooleanText(1)
26
- * public baz: boolean // 1 and 0 become true and false after BusinessObjectFactoryService and -SerializerService processing
27
- */
28
- export function BooleanText(type?: "J" | "T" | 1): PropertyDecorator {
29
- return function (target: any, propertyKey: string): void {
30
- if (!target || !propertyKey) {
31
- return;
32
- }
33
- // by default, it's a J N boolean text
34
- if (!type || type === "J") {
35
- Reflect.defineMetadata(PROP_META_KEY_JN, true, target, propertyKey);
36
- } else if (type === "T") {
37
- Reflect.defineMetadata(PROP_META_KEY_TF, true, target, propertyKey);
38
- } else if (type === 1) {
39
- Reflect.defineMetadata(PROP_META_KEY_10, true, target, propertyKey);
40
- }
41
- };
42
- }
43
-
44
- // Utility function holder of the BooleanTextDecorator decorator.
45
- export class BooleanTextDecorator {
46
-
47
- /**
48
- * Returns whether given property (as a string) on given object is a boolean text field. That is, it's a field that is decorated
49
- * with the @BooleanText decorator.
50
- */
51
- public static IsBooleanTextField(target: Object, propertyKey: string): boolean {
52
- if (!target || !propertyKey || typeof target !== "object") {
53
- return false;
54
- }
55
- return (
56
- Reflect.getMetadata(PROP_META_KEY_JN, target, propertyKey) === true
57
- ||
58
- Reflect.getMetadata(PROP_META_KEY_TF, target, propertyKey) === true
59
- ||
60
- Reflect.getMetadata(PROP_META_KEY_10, target, propertyKey) === true
61
- );
62
- }
63
-
64
- /**
65
- * Returns the logical true or false value of given character ('J', 'N', 'T' or 'F') or number (0 or 1).
66
- * Returns UNDEFINED if given boolChar was not recognised as a boolean text.
67
- */
68
- public static GetLogicalBooleanValue(dbBoolChar: DbBooleanValueType | string): boolean {
69
- return GetLogicalBooleanValue(dbBoolChar);
70
- }
71
-
72
- /**
73
- * Returns the boolean character / number of given logical bool property on target object. Uses its @BooleanText() annotation to decide
74
- * what character / number to return.
75
- * Used in BusinessObjectSerializerServiceService to convert logical bools to their original boolean character.
76
- * @returns {string|number} The original, reverse-engineered boolean character (or number) of given object property, or undefined.
77
- */
78
- public static GetDbBooleanValue(target: Object, propertyKey: string): DbBooleanValueType {
79
- if (!target || !propertyKey || typeof target !== "object") {
80
- return undefined;
81
- }
82
-
83
- let dbBoolVal: any = undefined;
84
-
85
- const curBoolVal: boolean = target[propertyKey];
86
-
87
- if (BooleanTextDecorator._IsJaNeeProp(target, propertyKey)) {
88
- dbBoolVal = GetYesNoDbBooleanValue(curBoolVal);
89
- } else if (BooleanTextDecorator._IsTrueFalseProp(target, propertyKey)) {
90
- dbBoolVal = GetTrueFalseDbBooleanValue(curBoolVal);
91
- } else if (BooleanTextDecorator._IsZeroOneProp(target, propertyKey)) {
92
- dbBoolVal = GetOneZeroDbBooleanValue(curBoolVal);
93
- }
94
-
95
- return dbBoolVal as any as DbBooleanValueType;
96
- }
97
-
98
- private static _IsJaNeeProp(target: Object, propertyKey: string): boolean {
99
- return BooleanTextDecorator._IsProp(PROP_META_KEY_JN, target, propertyKey);
100
- }
101
-
102
- private static _IsTrueFalseProp(target: Object, propertyKey: string): boolean {
103
- return BooleanTextDecorator._IsProp(PROP_META_KEY_TF, target, propertyKey);
104
- }
105
-
106
- private static _IsZeroOneProp(target: Object, propertyKey: string): boolean {
107
- return BooleanTextDecorator._IsProp(PROP_META_KEY_10, target, propertyKey);
108
- }
109
-
110
- private static _IsProp(prop: string, target: Object, propertyKey: string): boolean {
111
- return !!target && !!propertyKey && typeof target === "object" && Reflect.hasMetadata(prop, target, propertyKey);
112
- }
113
- }