@colijnit/sharedcomponents 1.0.26 → 1.0.28

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 (132) hide show
  1. package/bundles/colijnit-sharedcomponents.umd.js +2710 -72
  2. package/bundles/colijnit-sharedcomponents.umd.js.map +1 -1
  3. package/colijnit-sharedcomponents.d.ts +24 -0
  4. package/colijnit-sharedcomponents.metadata.json +1 -1
  5. package/esm2015/colijnit-sharedcomponents.js +25 -1
  6. package/esm2015/lib/components/circular-gauge/co-circular-gauge.component.js +3 -4
  7. package/esm2015/lib/components/date-planning/component/agenda/agenda-base-view.component.js +61 -0
  8. package/esm2015/lib/components/date-planning/component/agenda/agenda-day-view.component.js +32 -0
  9. package/esm2015/lib/components/date-planning/component/agenda/agenda-event.component.js +54 -0
  10. package/esm2015/lib/components/date-planning/component/agenda/agenda-events.component.js +43 -0
  11. package/esm2015/lib/components/date-planning/component/agenda/agenda-half-hour-cell.component.js +68 -0
  12. package/esm2015/lib/components/date-planning/component/agenda/agenda-header.component.js +232 -0
  13. package/esm2015/lib/components/date-planning/component/agenda/agenda-hour-cell.component.js +36 -0
  14. package/esm2015/lib/components/date-planning/component/agenda/agenda-hour-view-labels.component.js +50 -0
  15. package/esm2015/lib/components/date-planning/component/agenda/agenda-hour-view.component.js +46 -0
  16. package/esm2015/lib/components/date-planning/component/agenda/agenda-month-view.component.js +61 -0
  17. package/esm2015/lib/components/date-planning/component/agenda/agenda-select-event.component.js +39 -0
  18. package/esm2015/lib/components/date-planning/component/agenda/agenda-view.component.js +35 -0
  19. package/esm2015/lib/components/date-planning/component/agenda/agenda-week-select-view.component.js +64 -0
  20. package/esm2015/lib/components/date-planning/component/agenda/agenda-week-view.component.js +48 -0
  21. package/esm2015/lib/components/date-planning/component/agenda/view-select.component.js +42 -0
  22. package/esm2015/lib/components/date-planning/component/calendar/calendar-all-months.component.js +34 -0
  23. package/esm2015/lib/components/date-planning/component/calendar/calendar-all-years.component.js +48 -0
  24. package/esm2015/lib/components/date-planning/component/calendar/calendar-header.component.js +107 -0
  25. package/esm2015/lib/components/date-planning/component/calendar/calendar-view.component.js +178 -0
  26. package/esm2015/lib/components/date-planning/component/calendar/calendar.component.js +34 -0
  27. package/esm2015/lib/components/date-planning/date-planning.component.js +106 -0
  28. package/esm2015/lib/components/date-planning/date-planning.module.js +63 -0
  29. package/esm2015/lib/components/send-method-dialog/send-method-dialog.component.js +83 -54
  30. package/esm2015/lib/components/send-method-dialog/send-method-dialog.module.js +6 -3
  31. package/esm2015/lib/components/send-method-dialog/send-method-params.interface.js +2 -0
  32. package/esm2015/lib/components/statusbar/statusbar.component.js +2 -2
  33. package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +7 -4
  34. package/esm2015/lib/enum/calendar-view.enum.js +8 -0
  35. package/esm2015/lib/enum/icon.enum.js +6 -1
  36. package/esm2015/lib/enum/month.enum.js +17 -0
  37. package/esm2015/lib/enum/thumb-three-way-state.js +19 -0
  38. package/esm2015/lib/enum/time-period.enum.js +11 -0
  39. package/esm2015/lib/model/agenda-event-per-day.model.js +6 -0
  40. package/esm2015/lib/model/agenda-event.model.js +8 -0
  41. package/esm2015/lib/model/agenda-null-objects.js +11 -0
  42. package/esm2015/lib/model/constant/all-months.js +17 -0
  43. package/esm2015/lib/model/date-range.js +5 -0
  44. package/esm2015/lib/model/day.model.js +7 -0
  45. package/esm2015/lib/model/icon-svg.js +6 -1
  46. package/esm2015/lib/model/month.model.js +11 -0
  47. package/esm2015/lib/model/time-window.bo.js +26 -0
  48. package/esm2015/lib/model/week.model.js +6 -0
  49. package/esm2015/lib/model/weekday.model.js +10 -0
  50. package/esm2015/lib/pipe/array-number.pipe.js +15 -0
  51. package/esm2015/lib/pipe/master-pipes.js +7 -0
  52. package/esm2015/lib/pipe/ucfirst.pipe.js +16 -0
  53. package/esm2015/lib/service/shared-connector.service.js +49 -1
  54. package/esm2015/lib/service/stock.service.js +16 -5
  55. package/esm2015/lib/utils/array-utils.js +24 -5
  56. package/esm2015/lib/utils/calendar.utils.js +69 -0
  57. package/esm2015/lib/utils/check-precision-and-scale-result.js +2 -0
  58. package/esm2015/lib/utils/check-within-stepped-bounds-result.js +2 -0
  59. package/esm2015/lib/utils/date-utils.js +264 -0
  60. package/esm2015/lib/utils/function/not-nill.function.js +5 -0
  61. package/esm2015/lib/utils/map-utils.js +41 -0
  62. package/esm2015/lib/utils/number-utils.js +390 -0
  63. package/esm2015/lib/utils/object-utils.js +278 -0
  64. package/esm2015/public-api.js +3 -1
  65. package/fesm2015/colijnit-sharedcomponents.js +2789 -98
  66. package/fesm2015/colijnit-sharedcomponents.js.map +1 -1
  67. package/lib/components/date-planning/component/agenda/agenda-base-view.component.d.ts +21 -0
  68. package/lib/components/date-planning/component/agenda/agenda-day-view.component.d.ts +6 -0
  69. package/lib/components/date-planning/component/agenda/agenda-event.component.d.ts +17 -0
  70. package/lib/components/date-planning/component/agenda/agenda-events.component.d.ts +12 -0
  71. package/lib/components/date-planning/component/agenda/agenda-half-hour-cell.component.d.ts +18 -0
  72. package/lib/components/date-planning/component/agenda/agenda-header.component.d.ts +47 -0
  73. package/lib/components/date-planning/component/agenda/agenda-hour-cell.component.d.ts +9 -0
  74. package/lib/components/date-planning/component/agenda/agenda-hour-view-labels.component.d.ts +8 -0
  75. package/lib/components/date-planning/component/agenda/agenda-hour-view.component.d.ts +7 -0
  76. package/lib/components/date-planning/component/agenda/agenda-month-view.component.d.ts +10 -0
  77. package/lib/components/date-planning/component/agenda/agenda-select-event.component.d.ts +12 -0
  78. package/lib/components/date-planning/component/agenda/agenda-view.component.d.ts +11 -0
  79. package/lib/components/date-planning/component/agenda/agenda-week-select-view.component.d.ts +10 -0
  80. package/lib/components/date-planning/component/agenda/agenda-week-view.component.d.ts +8 -0
  81. package/lib/components/date-planning/component/agenda/view-select.component.d.ts +11 -0
  82. package/lib/components/date-planning/component/calendar/calendar-all-months.component.d.ts +9 -0
  83. package/lib/components/date-planning/component/calendar/calendar-all-years.component.d.ts +9 -0
  84. package/lib/components/date-planning/component/calendar/calendar-header.component.d.ts +23 -0
  85. package/lib/components/date-planning/component/calendar/calendar-view.component.d.ts +31 -0
  86. package/lib/components/date-planning/component/calendar/calendar.component.d.ts +10 -0
  87. package/lib/components/date-planning/date-planning.component.d.ts +25 -0
  88. package/lib/components/date-planning/date-planning.module.d.ts +2 -0
  89. package/lib/components/send-method-dialog/send-method-dialog.component.d.ts +24 -7
  90. package/lib/components/send-method-dialog/send-method-params.interface.d.ts +13 -0
  91. package/lib/components/send-method-dialog/style/_layout.scss +5 -0
  92. package/lib/components/statusbar/statusbar.component.d.ts +1 -0
  93. package/lib/components/tags/component/style/_layout.scss +67 -0
  94. package/lib/components/tags/component/style/_material-definition.scss +1 -0
  95. package/lib/components/tags/component/style/_theme.scss +8 -0
  96. package/lib/components/tags/component/style/material.scss +3 -0
  97. package/lib/components/tags/component/tag-join-label/style/_layout.scss +97 -0
  98. package/lib/components/tags/component/tag-join-label/style/_material-definition.scss +4 -0
  99. package/lib/components/tags/component/tag-join-label/style/_theme.scss +8 -0
  100. package/lib/components/tags/component/tag-join-label/style/material.scss +3 -0
  101. package/lib/enum/calendar-view.enum.d.ts +6 -0
  102. package/lib/enum/icon.enum.d.ts +5 -0
  103. package/lib/enum/month.enum.d.ts +14 -0
  104. package/lib/enum/thumb-three-way-state.d.ts +6 -0
  105. package/lib/enum/time-period.enum.d.ts +8 -0
  106. package/lib/model/agenda-event-per-day.model.d.ts +5 -0
  107. package/lib/model/agenda-event.model.d.ts +16 -0
  108. package/lib/model/agenda-null-objects.d.ts +10 -0
  109. package/lib/model/constant/all-months.d.ts +2 -0
  110. package/lib/model/date-range.d.ts +7 -0
  111. package/lib/model/day.model.d.ts +8 -0
  112. package/lib/model/month.model.d.ts +5 -0
  113. package/lib/model/time-window.bo.d.ts +13 -0
  114. package/lib/model/week.model.d.ts +4 -0
  115. package/lib/model/weekday.model.d.ts +16 -0
  116. package/lib/pipe/array-number.pipe.d.ts +4 -0
  117. package/lib/pipe/master-pipes.d.ts +1 -0
  118. package/lib/pipe/ucfirst.pipe.d.ts +4 -0
  119. package/lib/service/shared-connector.service.d.ts +4 -0
  120. package/lib/service/stock.service.d.ts +6 -2
  121. package/lib/style/_mixin.scss +5 -0
  122. package/lib/utils/array-utils.d.ts +6 -0
  123. package/lib/utils/calendar.utils.d.ts +10 -0
  124. package/lib/utils/check-precision-and-scale-result.d.ts +4 -0
  125. package/lib/utils/check-within-stepped-bounds-result.d.ts +8 -0
  126. package/lib/utils/date-utils.d.ts +44 -0
  127. package/lib/utils/function/not-nill.function.d.ts +1 -0
  128. package/lib/utils/map-utils.d.ts +16 -0
  129. package/lib/utils/number-utils.d.ts +125 -0
  130. package/lib/utils/object-utils.d.ts +40 -0
  131. package/package.json +1 -1
  132. package/public-api.d.ts +2 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('pdf-lib'), require('pdfjs-dist/legacy/build/pdf'), require('pdfjs-dist/build/pdf.worker.entry'), require('@angular/common'), require('signature_pad'), require('@colijnit/sharedapi/build/model/print-stock-stickers'), require('@colijnit/sharedapi/build/model/print-price-stickers.bo'), require('@colijnit/articleapi/build/articles'), require('@colijnit/sharedapi/build/sharedapi'), require('@colijnit/sharedapi/build/model/report/printer.bo'), require('@colijnit/articleapi/build/utils/function/not-nill.function'), require('@colijnit/articleapi/build/utils/object-utils'), require('@colijnit/articleapi/build/enum/yes-no-db-type.enum'), require('@colijnit/articleapi/build/enum/true-false-db-type.enum'), require('@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum'), require('@colijnit/articleapi/build/enum/db-boolean-value-type.enum'), require('@colijnit/articleapi/build/utils/date-utils'), require('@colijnit/articleapi/build/utils/number-utils'), require('@colijnit/articleapi/build/utils/function/is-nill.function'), require('@colijnit/articleapi/build/factory/decorators/map-property.decorator'), require('@colijnit/articleapi/build/factory/decorators/boolean.decorator'), require('@colijnit/articleapi/build/factory/decorators/json.decorator'), require('@colijnit/articleapi/build/factory/decorators/complex-array.decorator'), require('@colijnit/articleapi/build/model/article-stock.bo'), require('@colijnit/articleapi/build/model/stock-history.bo'), require('@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo'), require('@colijnit/articleapi/build/model/article-details.bo'), require('@colijnit/articleapi/build/model/stock-status.bo'), require('@colijnit/articleapi/build/model/stock-management-warehouses.bo'), require('@colijnit/articleapi/build/model/stock-location.bo'), require('@colijnit/articleapi/build/model/article-transaction.bo'), require('rxjs'), require('@colijnit/articleapi/build/model/get-stock-history-request'), require('@colijnit/articleapi/build/model/article-stock'), require('@colijnit/corecomponents_v12'), require('@angular/platform-browser'), require('@colijnit/articleapi/build/model/article-stock-management'), require('@colijnit/articleapi/build/model/article-transaction'), require('@syncfusion/ej2-angular-circulargauge')) :
3
- typeof define === 'function' && define.amd ? define('@colijnit/sharedcomponents', ['exports', '@angular/core', '@angular/animations', 'pdf-lib', 'pdfjs-dist/legacy/build/pdf', 'pdfjs-dist/build/pdf.worker.entry', '@angular/common', 'signature_pad', '@colijnit/sharedapi/build/model/print-stock-stickers', '@colijnit/sharedapi/build/model/print-price-stickers.bo', '@colijnit/articleapi/build/articles', '@colijnit/sharedapi/build/sharedapi', '@colijnit/sharedapi/build/model/report/printer.bo', '@colijnit/articleapi/build/utils/function/not-nill.function', '@colijnit/articleapi/build/utils/object-utils', '@colijnit/articleapi/build/enum/yes-no-db-type.enum', '@colijnit/articleapi/build/enum/true-false-db-type.enum', '@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum', '@colijnit/articleapi/build/enum/db-boolean-value-type.enum', '@colijnit/articleapi/build/utils/date-utils', '@colijnit/articleapi/build/utils/number-utils', '@colijnit/articleapi/build/utils/function/is-nill.function', '@colijnit/articleapi/build/factory/decorators/map-property.decorator', '@colijnit/articleapi/build/factory/decorators/boolean.decorator', '@colijnit/articleapi/build/factory/decorators/json.decorator', '@colijnit/articleapi/build/factory/decorators/complex-array.decorator', '@colijnit/articleapi/build/model/article-stock.bo', '@colijnit/articleapi/build/model/stock-history.bo', '@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo', '@colijnit/articleapi/build/model/article-details.bo', '@colijnit/articleapi/build/model/stock-status.bo', '@colijnit/articleapi/build/model/stock-management-warehouses.bo', '@colijnit/articleapi/build/model/stock-location.bo', '@colijnit/articleapi/build/model/article-transaction.bo', 'rxjs', '@colijnit/articleapi/build/model/get-stock-history-request', '@colijnit/articleapi/build/model/article-stock', '@colijnit/corecomponents_v12', '@angular/platform-browser', '@colijnit/articleapi/build/model/article-stock-management', '@colijnit/articleapi/build/model/article-transaction', '@syncfusion/ej2-angular-circulargauge'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.sharedcomponents = {}), global.ng.core, global.ng.animations, global.pdfLib, global.PDFJS, global.pdfjsWorker, global.ng.common, global.SignaturePad, global.printStockStickers, global.printPriceStickers_bo, global.articles, global.sharedapi, global.printer_bo, global.notNill_function, global.objectUtils, global.yesNoDbType_enum, global.trueFalseDbType_enum, global.oneZeroBoolDbType_enum, global.dbBooleanValueType_enum, global.dateUtils, global.numberUtils, global.isNill_function, global.mapProperty_decorator, global.boolean_decorator, global.json_decorator, global.complexArray_decorator, global.articleStock_bo, global.stockHistory_bo, global.stockStickersPrintLayouts_bo, global.articleDetails_bo, global.stockStatus_bo, global.stockManagementWarehouses_bo, global.stockLocation_bo, global.articleTransaction_bo, global.rxjs, global.getStockHistoryRequest, global.articleStock, global.corecomponents_v12, global.ng.platformBrowser, global.articleStockManagement, global.articleTransaction, global.ej2AngularCirculargauge));
5
- })(this, (function (exports, i0, animations, pdfLib, PDFJS, pdfjsWorker, common, SignaturePad, printStockStickers, printPriceStickers_bo, articles, sharedapi, printer_bo, notNill_function, objectUtils, yesNoDbType_enum, trueFalseDbType_enum, oneZeroBoolDbType_enum, dbBooleanValueType_enum, dateUtils, numberUtils, isNill_function, mapProperty_decorator, boolean_decorator, json_decorator, complexArray_decorator, articleStock_bo, stockHistory_bo, stockStickersPrintLayouts_bo, articleDetails_bo, stockStatus_bo, stockManagementWarehouses_bo, stockLocation_bo, articleTransaction_bo, rxjs, getStockHistoryRequest, articleStock, corecomponents_v12, i1, articleStockManagement, articleTransaction, ej2AngularCirculargauge) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('pdf-lib'), require('pdfjs-dist/legacy/build/pdf'), require('pdfjs-dist/build/pdf.worker.entry'), require('@angular/common'), require('signature_pad'), require('@colijnit/articleapi/build/articles'), require('@colijnit/sharedapi/build/sharedapi'), require('@colijnit/sharedapi/build/model/report/printer.bo'), require('@colijnit/articleapi/build/utils/function/not-nill.function'), require('@colijnit/articleapi/build/utils/object-utils'), require('@colijnit/articleapi/build/enum/yes-no-db-type.enum'), require('@colijnit/articleapi/build/enum/true-false-db-type.enum'), require('@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum'), require('@colijnit/articleapi/build/enum/db-boolean-value-type.enum'), require('@colijnit/articleapi/build/utils/date-utils'), require('@colijnit/articleapi/build/utils/number-utils'), require('@colijnit/articleapi/build/factory/decorators/map-property.decorator'), require('@colijnit/articleapi/build/factory/decorators/boolean.decorator'), require('@colijnit/articleapi/build/factory/decorators/json.decorator'), require('@colijnit/articleapi/build/factory/decorators/complex-array.decorator'), require('@colijnit/sharedapi/build/model/print-stock-stickers'), require('@colijnit/articleapi/build/model/article-stock.bo'), require('@colijnit/articleapi/build/model/stock-history.bo'), require('@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo'), require('@colijnit/articleapi/build/model/article-details.bo'), require('@colijnit/articleapi/build/model/stock-status.bo'), require('@colijnit/articleapi/build/model/stock-management-warehouses.bo'), require('@colijnit/articleapi/build/model/stock-location.bo'), require('@colijnit/articleapi/build/model/article-transaction.bo'), require('rxjs'), require('@colijnit/sharedapi/build/model/print-price-stickers.bo'), require('@colijnit/articleapi/build/model/get-stock-history-request'), require('@colijnit/articleapi/build/model/article-stock'), require('@colijnit/corecomponents_v12'), require('@angular/platform-browser'), require('@colijnit/articleapi/build/model/article-stock-management'), require('@colijnit/articleapi/build/model/article-transaction'), require('@syncfusion/ej2-angular-circulargauge'), require('moment')) :
3
+ typeof define === 'function' && define.amd ? define('@colijnit/sharedcomponents', ['exports', '@angular/core', '@angular/animations', 'pdf-lib', 'pdfjs-dist/legacy/build/pdf', 'pdfjs-dist/build/pdf.worker.entry', '@angular/common', 'signature_pad', '@colijnit/articleapi/build/articles', '@colijnit/sharedapi/build/sharedapi', '@colijnit/sharedapi/build/model/report/printer.bo', '@colijnit/articleapi/build/utils/function/not-nill.function', '@colijnit/articleapi/build/utils/object-utils', '@colijnit/articleapi/build/enum/yes-no-db-type.enum', '@colijnit/articleapi/build/enum/true-false-db-type.enum', '@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum', '@colijnit/articleapi/build/enum/db-boolean-value-type.enum', '@colijnit/articleapi/build/utils/date-utils', '@colijnit/articleapi/build/utils/number-utils', '@colijnit/articleapi/build/factory/decorators/map-property.decorator', '@colijnit/articleapi/build/factory/decorators/boolean.decorator', '@colijnit/articleapi/build/factory/decorators/json.decorator', '@colijnit/articleapi/build/factory/decorators/complex-array.decorator', '@colijnit/sharedapi/build/model/print-stock-stickers', '@colijnit/articleapi/build/model/article-stock.bo', '@colijnit/articleapi/build/model/stock-history.bo', '@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo', '@colijnit/articleapi/build/model/article-details.bo', '@colijnit/articleapi/build/model/stock-status.bo', '@colijnit/articleapi/build/model/stock-management-warehouses.bo', '@colijnit/articleapi/build/model/stock-location.bo', '@colijnit/articleapi/build/model/article-transaction.bo', 'rxjs', '@colijnit/sharedapi/build/model/print-price-stickers.bo', '@colijnit/articleapi/build/model/get-stock-history-request', '@colijnit/articleapi/build/model/article-stock', '@colijnit/corecomponents_v12', '@angular/platform-browser', '@colijnit/articleapi/build/model/article-stock-management', '@colijnit/articleapi/build/model/article-transaction', '@syncfusion/ej2-angular-circulargauge', 'moment'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.sharedcomponents = {}), global.ng.core, global.ng.animations, global.pdfLib, global.PDFJS, global.pdfjsWorker, global.ng.common, global.SignaturePad, global.articles, global.sharedapi, global.printer_bo, global.notNill_function, global.objectUtils, global.yesNoDbType_enum, global.trueFalseDbType_enum, global.oneZeroBoolDbType_enum, global.dbBooleanValueType_enum, global.dateUtils, global.numberUtils, global.mapProperty_decorator, global.boolean_decorator, global.json_decorator, global.complexArray_decorator, global.printStockStickers, global.articleStock_bo, global.stockHistory_bo, global.stockStickersPrintLayouts_bo, global.articleDetails_bo, global.stockStatus_bo, global.stockManagementWarehouses_bo, global.stockLocation_bo, global.articleTransaction_bo, global.rxjs, global.printPriceStickers_bo, global.getStockHistoryRequest, global.articleStock, global.corecomponents_v12, global.ng.platformBrowser, global.articleStockManagement, global.articleTransaction, global.ej2AngularCirculargauge, global.moment));
5
+ })(this, (function (exports, i0, animations, pdfLib, PDFJS, pdfjsWorker, common, SignaturePad, articles, sharedapi, printer_bo, notNill_function, objectUtils, yesNoDbType_enum, trueFalseDbType_enum, oneZeroBoolDbType_enum, dbBooleanValueType_enum, dateUtils, numberUtils, mapProperty_decorator, boolean_decorator, json_decorator, complexArray_decorator, printStockStickers, articleStock_bo, stockHistory_bo, stockStickersPrintLayouts_bo, articleDetails_bo, stockStatus_bo, stockManagementWarehouses_bo, stockLocation_bo, articleTransaction_bo, rxjs, printPriceStickers_bo, getStockHistoryRequest, articleStock, corecomponents_v12, i1, articleStockManagement, articleTransaction, ej2AngularCirculargauge, moment) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -29,6 +29,7 @@
29
29
  var pdfjsWorker__default = /*#__PURE__*/_interopDefaultLegacy(pdfjsWorker);
30
30
  var SignaturePad__default = /*#__PURE__*/_interopDefaultLegacy(SignaturePad);
31
31
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
32
+ var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
32
33
 
33
34
  /******************************************************************************
34
35
  Copyright (c) Microsoft Corporation.
@@ -1032,6 +1033,703 @@
1032
1033
  return value === null || value === undefined;
1033
1034
  }
1034
1035
 
1036
+ // @returns true iff given value does not equals null and does not equal undefined
1037
+ function notNill(value) {
1038
+ return value !== null && value !== undefined;
1039
+ }
1040
+
1041
+ // Static utility function holder related to objects.
1042
+ var ObjectUtils = /** @class */ (function () {
1043
+ function ObjectUtils() {
1044
+ }
1045
+ /**
1046
+ * Returns whether all given values exist: for all values it holds that they are not null nor undefined. Short-circuit check.
1047
+ * @param {any} values Rest parameters with all objects to check existence for.
1048
+ * @returns {boolean} True if ALL given values are not null nor undefined, otherwise false (if at least one value was null or undefined)
1049
+ */
1050
+ ObjectUtils.AllExist = function () {
1051
+ var values = [];
1052
+ for (var _i = 0; _i < arguments.length; _i++) {
1053
+ values[_i] = arguments[_i];
1054
+ }
1055
+ var allExist = true;
1056
+ for (var i = 0, len = values.length; i < len; i++) {
1057
+ if (isNill(values[i])) {
1058
+ allExist = false;
1059
+ break;
1060
+ }
1061
+ }
1062
+ return allExist;
1063
+ };
1064
+ /**
1065
+ * Copies all properties from object 'from' to object 'to'. Overwrites properties on object 'to' if property already exists.
1066
+ * Does not copy functions, only properties.
1067
+ * @param {Object} from The source object from which to copy all properties of to the 'to' object.
1068
+ * @param {Object} to The object to which the properties of the 'from' object will be copied.
1069
+ * @param {boolean} [allowUndefined = true] wether the 'to' object may be assigned null or undefined values to any of its properties.
1070
+ */
1071
+ ObjectUtils.CopyPropertiesFrom = function (from, to, allowUndefined) {
1072
+ if (allowUndefined === void 0) { allowUndefined = true; }
1073
+ if (!to) {
1074
+ to = {};
1075
+ }
1076
+ if (!from) {
1077
+ return to;
1078
+ }
1079
+ ObjectUtils.ForOwnProperty(from, function (value, key) {
1080
+ if (allowUndefined || notNill(value)) {
1081
+ to[key] = value;
1082
+ }
1083
+ });
1084
+ return to;
1085
+ };
1086
+ ObjectUtils.DeepEquals = function (actual, expected) {
1087
+ if (actual === expected) {
1088
+ return true;
1089
+ }
1090
+ else if (actual instanceof Date && expected instanceof Date) {
1091
+ return actual.getTime() === expected.getTime();
1092
+ }
1093
+ else if (!actual || !expected || typeof actual !== "object" && typeof expected !== "object") {
1094
+ return actual === expected;
1095
+ }
1096
+ else {
1097
+ return this._objEquiv(actual, expected);
1098
+ }
1099
+ };
1100
+ // Performs given callback function for each own property of given plain object. Also works on string enums.
1101
+ ObjectUtils.ForOwnProperty = function (plainObject, callback) {
1102
+ if (ObjectUtils.IsPlainObject(plainObject)) {
1103
+ for (var key in plainObject) {
1104
+ if (plainObject.hasOwnProperty(key) && typeof plainObject[key] !== "function") {
1105
+ var response = callback(plainObject[key], key);
1106
+ if (response === false) {
1107
+ break;
1108
+ }
1109
+ }
1110
+ }
1111
+ }
1112
+ };
1113
+ // Returns the class name of given argument. The argument can be an object or a class.
1114
+ ObjectUtils.GetClassName = function (objectOrClass) {
1115
+ if (!objectOrClass) {
1116
+ return undefined;
1117
+ // arg was a class (or a function..)
1118
+ }
1119
+ else if (objectOrClass.constructor === Function) {
1120
+ return objectOrClass.name; // .. which has its readable name stores like this
1121
+ // else arg was an object
1122
+ }
1123
+ else {
1124
+ var constructorString = objectOrClass.constructor.toString();
1125
+ return constructorString.match(/\w+/g)[1];
1126
+ }
1127
+ };
1128
+ // Returns a shallow clone of the given original object. The clone is a SIMPLE OBJECT with the same properties as the original.
1129
+ ObjectUtils.GetShallowClone = function (originalObject, objectClass) {
1130
+ var clonedObject = undefined;
1131
+ if (objectClass) {
1132
+ clonedObject = new objectClass();
1133
+ }
1134
+ else {
1135
+ clonedObject = {};
1136
+ }
1137
+ ObjectUtils.ForOwnProperty(originalObject, function (value, key) {
1138
+ clonedObject[key] = value;
1139
+ });
1140
+ return clonedObject;
1141
+ };
1142
+ ObjectUtils.GetDeepClone = function (originalObject, circular) {
1143
+ if (circular === void 0) { circular = true; }
1144
+ // First create an empty object with
1145
+ // same prototype of our original source
1146
+ var propertyIndex;
1147
+ var descriptor;
1148
+ var keys;
1149
+ var current;
1150
+ var nextSource;
1151
+ var indexOf;
1152
+ var copies = [{
1153
+ source: originalObject,
1154
+ target: Object.create(Object.getPrototypeOf(originalObject))
1155
+ }];
1156
+ var cloneObject = copies[0].target;
1157
+ var sourceReferences = [originalObject];
1158
+ var targetReferences = [cloneObject];
1159
+ // First in, first out
1160
+ while (current = copies.shift()) { //NOSONAR
1161
+ keys = Object.getOwnPropertyNames(current.source);
1162
+ for (propertyIndex = 0; propertyIndex < keys.length; propertyIndex++) {
1163
+ // Save the source's descriptor
1164
+ descriptor = Object.getOwnPropertyDescriptor(current.source, keys[propertyIndex]);
1165
+ if (!descriptor.value || typeof descriptor.value !== "object") {
1166
+ Object.defineProperty(current.target, keys[propertyIndex], descriptor);
1167
+ continue;
1168
+ }
1169
+ nextSource = descriptor.value;
1170
+ descriptor.value = Array.isArray(nextSource) ?
1171
+ [] :
1172
+ Object.create(Object.getPrototypeOf(nextSource));
1173
+ if (circular) {
1174
+ indexOf = sourceReferences.indexOf(nextSource);
1175
+ if (indexOf !== -1) {
1176
+ // The source is already referenced, just assign reference
1177
+ descriptor.value = targetReferences[indexOf];
1178
+ Object.defineProperty(current.target, keys[propertyIndex], descriptor);
1179
+ continue;
1180
+ }
1181
+ sourceReferences.push(nextSource);
1182
+ targetReferences.push(descriptor.value);
1183
+ }
1184
+ Object.defineProperty(current.target, keys[propertyIndex], descriptor);
1185
+ copies.push({ source: nextSource, target: descriptor.value });
1186
+ }
1187
+ }
1188
+ return cloneObject;
1189
+ };
1190
+ ObjectUtils.IsEmpty = function (obj) {
1191
+ return isNill(obj) || Object.getOwnPropertyNames(obj).length === 0;
1192
+ };
1193
+ // Returns whether given object is an existing, plain object. That is, it defined, its type if 'object' and it is NOT an array or func.
1194
+ ObjectUtils.IsPlainObject = function (object) {
1195
+ return object !== null && !Array.isArray(object) && typeof object !== "function" && typeof object === "object";
1196
+ };
1197
+ /**
1198
+ * Returns an instance of given class with data of given dataObject. Only works if that class has a default constructor without args.
1199
+ * Does not actually create a new object if it alread is an instance of that class.
1200
+ * @param {any} clazz A class that has a default constructor
1201
+ * @param {any} [dataObject] The object with data to copy to the new instance of the class
1202
+ * @returns {any} An object that is an instance of given class, with given data applied to it.
1203
+ */
1204
+ ObjectUtils.MakeInstanceOf = function (clazz, dataObject) {
1205
+ // dont make a clone if given dataObject already instance of clazz
1206
+ if (dataObject instanceof clazz) {
1207
+ return dataObject;
1208
+ }
1209
+ else {
1210
+ var asClazz = new clazz();
1211
+ ObjectUtils.CopyPropertiesFrom(dataObject, asClazz);
1212
+ return asClazz;
1213
+ }
1214
+ };
1215
+ // Returns the value of a random own property of given object.
1216
+ ObjectUtils.PickRandomPropertyValue = function (object) {
1217
+ if (!object) {
1218
+ return;
1219
+ }
1220
+ var result;
1221
+ var count = 0;
1222
+ for (var prop in object) {
1223
+ if (object.hasOwnProperty(prop)) {
1224
+ count++;
1225
+ if (Math.random() < 1 / count) {
1226
+ result = object[prop];
1227
+ }
1228
+ }
1229
+ }
1230
+ return result;
1231
+ };
1232
+ // Returns a default if given value doesn't exist, otherwise just value.
1233
+ ObjectUtils.ValueOrDefault = function (value, defaultReturnVal) {
1234
+ if (defaultReturnVal === void 0) { defaultReturnVal = ""; }
1235
+ return notNill(value) ? value : defaultReturnVal;
1236
+ };
1237
+ ObjectUtils._isArguments = function (x) {
1238
+ var supportsArgsClass = this._supportsArgumentsClass();
1239
+ return supportsArgsClass ? this._isArgumentsWhenArgsClassSupported(x) : this._isArgumentsWhenArgsClassNotSupported(x);
1240
+ };
1241
+ ObjectUtils._isArgumentsWhenArgsClassNotSupported = function (object) {
1242
+ return object &&
1243
+ typeof object === "object" &&
1244
+ typeof object.length === "number" &&
1245
+ Object.prototype.hasOwnProperty.call(object, "callee") &&
1246
+ !Object.prototype.propertyIsEnumerable.call(object, "callee") ||
1247
+ false;
1248
+ };
1249
+ ObjectUtils._isArgumentsWhenArgsClassSupported = function (object) {
1250
+ return Object.prototype.toString.call(object) === "[object Arguments]";
1251
+ };
1252
+ ObjectUtils._isBuffer = function (x) {
1253
+ if (!x || typeof x !== "object" || typeof x.length !== "number") {
1254
+ return false;
1255
+ }
1256
+ if (typeof x.copy !== "function" || typeof x.slice !== "function") {
1257
+ return false;
1258
+ }
1259
+ return !(x.length > 0 && typeof x[0] !== "number");
1260
+ };
1261
+ ObjectUtils._isUndefinedOrNull = function (value) {
1262
+ return value === null || value === undefined;
1263
+ };
1264
+ ObjectUtils._objEquiv = function (a, b) {
1265
+ var i, key;
1266
+ if (this._isUndefinedOrNull(a) || this._isUndefinedOrNull(b)) {
1267
+ return false;
1268
+ }
1269
+ if (a.prototype !== b.prototype) {
1270
+ return false;
1271
+ }
1272
+ if (this._isArguments(a)) {
1273
+ if (!this._isArguments(b)) {
1274
+ return false;
1275
+ }
1276
+ a = Array.prototype.slice.call(a);
1277
+ b = Array.prototype.slice.call(b);
1278
+ return this.DeepEquals(a, b);
1279
+ }
1280
+ if (this._isBuffer(a)) {
1281
+ if (!this._isBuffer(b)) {
1282
+ return false;
1283
+ }
1284
+ if (a.length !== b.length) {
1285
+ return false;
1286
+ }
1287
+ for (i = 0; i < a.length; i++) {
1288
+ if (a[i] !== b[i]) {
1289
+ return false;
1290
+ }
1291
+ }
1292
+ return true;
1293
+ }
1294
+ var ka;
1295
+ var kb;
1296
+ try {
1297
+ ka = Object.keys(a);
1298
+ kb = Object.keys(b);
1299
+ }
1300
+ catch (e) {
1301
+ return false;
1302
+ }
1303
+ if (ka.length !== kb.length) {
1304
+ return false;
1305
+ }
1306
+ ka.sort();
1307
+ kb.sort();
1308
+ for (i = ka.length - 1; i >= 0; i--) {
1309
+ if (ka[i] !== kb[i]) {
1310
+ return false;
1311
+ }
1312
+ }
1313
+ for (i = ka.length - 1; i >= 0; i--) {
1314
+ key = ka[i];
1315
+ if (!this.DeepEquals(a[key], b[key])) {
1316
+ return false;
1317
+ }
1318
+ }
1319
+ return typeof a === typeof b;
1320
+ };
1321
+ ObjectUtils._supportsArgumentsClass = function () {
1322
+ return Object.prototype.toString.call(arguments) === "[object Arguments]";
1323
+ };
1324
+ return ObjectUtils;
1325
+ }());
1326
+
1327
+ // Static utility function holder related to numeric variable evaluations and operations.
1328
+ var NumberUtils = /** @class */ (function () {
1329
+ function NumberUtils() {
1330
+ }
1331
+ // For user-typed number input; supports comma's as decimal delimiter.
1332
+ NumberUtils.ParseIntNumberInput = function (arg) {
1333
+ return NumberUtils.ParseInt(NumberUtils._NumberInputToNumberStr(arg));
1334
+ };
1335
+ // Parses given argument to an integer, using a native parseInt() function with a radix of 10. Returns NaN if parsing was not possible.
1336
+ NumberUtils.ParseInt = function (arg) {
1337
+ if (isNill(arg) || Array.isArray(arg)) {
1338
+ return undefined;
1339
+ }
1340
+ return parseInt(arg, 10);
1341
+ };
1342
+ // For user-typed number input; supports comma's as decimal delimiter.
1343
+ NumberUtils.ParseFloatNumberInput = function (arg, decimalPrecision) {
1344
+ if (decimalPrecision === void 0) { decimalPrecision = 2; }
1345
+ return NumberUtils.ParseFloat(NumberUtils._NumberInputToNumberStr(arg), decimalPrecision);
1346
+ };
1347
+ NumberUtils.ParseFloatNumberInputKeepPrecision = function (arg) {
1348
+ var correctedInputStr = NumberUtils._NumberInputToNumberStr(arg);
1349
+ var decimalPrecision = this.GetDecimalPlaces(correctedInputStr);
1350
+ return NumberUtils.ParseFloat(correctedInputStr, decimalPrecision);
1351
+ };
1352
+ /**
1353
+ * Returns given arg as a float number with given decimal precision, if possible. Returns NaN if parse conversion failed.
1354
+ *
1355
+ * @param {any} arg The argument to parse to a float
1356
+ * @param {number} decimalPrecision The number of decimals, or the precision, the parsed return float should have
1357
+ * @returns {number} NaN if not possible, else the parsed float value
1358
+ */
1359
+ NumberUtils.ParseFloat = function (arg, decimalPrecision) {
1360
+ if (decimalPrecision === void 0) { decimalPrecision = 2; }
1361
+ if (!ObjectUtils.AllExist(arg, decimalPrecision) || Array.isArray(arg)) {
1362
+ return NaN;
1363
+ }
1364
+ if (!NumberUtils.IsInteger(decimalPrecision) || decimalPrecision < 0) {
1365
+ decimalPrecision = 2;
1366
+ // toFixed() can only handle up until 20
1367
+ }
1368
+ else if (decimalPrecision > 20) {
1369
+ decimalPrecision = 20;
1370
+ }
1371
+ return parseFloat(parseFloat(arg).toFixed(decimalPrecision));
1372
+ };
1373
+ /**
1374
+ * Returns given arg as a float number with given decimal precision, if possible. Returns NaN if parse conversion failed.
1375
+ *
1376
+ * @param arg The argument to parse to a float
1377
+ * @returns {number} The argument as a float with its original decimal precision intact
1378
+ */
1379
+ NumberUtils.ParseFloatKeepPrecision = function (arg) {
1380
+ var decimalPrecision = this.GetDecimalPlaces(arg);
1381
+ return this.ParseFloat(arg, decimalPrecision);
1382
+ };
1383
+ /**
1384
+ * Returns the given argument as a number. Returns given defaultValue if conversion of argument was impossible.
1385
+ * @param arg
1386
+ * @param {number} [defaultValue = 0]
1387
+ * @returns {number}
1388
+ */
1389
+ NumberUtils.ParseNumberOrDefault = function (arg, defaultValue) {
1390
+ if (defaultValue === void 0) { defaultValue = 0; }
1391
+ if (Array.isArray(arg)) {
1392
+ return defaultValue;
1393
+ }
1394
+ if (!NumberUtils.IsNumber(arg)) {
1395
+ arg = parseFloat(arg);
1396
+ arg = isNaN(arg) ? defaultValue : arg;
1397
+ }
1398
+ return arg;
1399
+ };
1400
+ // Returns true iff given argument is an integer number. Returns false on non-numbers or numbers with significant decimals.
1401
+ NumberUtils.IsInteger = function (arg) {
1402
+ if (isNaN(arg) || Array.isArray(arg)) {
1403
+ return false;
1404
+ }
1405
+ var argAsFloat = parseFloat(arg);
1406
+ return ((argAsFloat | 0) === argAsFloat); // returns whether 'arg converted to an integer equals arg'
1407
+ };
1408
+ // Returns the number of decimal places of the given number. Returns 0 if no decimals whatsoever could be found on given arg.
1409
+ NumberUtils.GetDecimalPlaces = function (arg, maxAnswer) {
1410
+ if (maxAnswer === void 0) { maxAnswer = 1000; }
1411
+ var match = ("" + arg).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
1412
+ if (!match) {
1413
+ return 0;
1414
+ }
1415
+ var answer = Math.max(0,
1416
+ // number of digits right of decimal point.
1417
+ (match[1] ? match[1].length : 0)
1418
+ // adjust for scientific notation
1419
+ - (match[2] ? +match[2] : 0));
1420
+ if (answer > maxAnswer) {
1421
+ answer = maxAnswer;
1422
+ }
1423
+ return answer;
1424
+ };
1425
+ // Parses given numberInput to a number, or returns given defaultValue if parse not possible. Allows ',' char as decimal delimiter.
1426
+ NumberUtils.ParseNumberInputOrDefault = function (numberInput, defaultValue) {
1427
+ if (defaultValue === void 0) { defaultValue = 0; }
1428
+ return NumberUtils.ParseNumberOrDefault(NumberUtils._NumberInputToNumberStr(numberInput), defaultValue);
1429
+ };
1430
+ // Returns whether the type of given argument is 'number'.
1431
+ NumberUtils.IsNumber = function (arg) {
1432
+ return typeof arg === "number" && !isNaN(arg);
1433
+ };
1434
+ /**
1435
+ * Returns whether given arg is indeed not a number (it's NaN or it has another type than 'number')
1436
+ * Our exact copy of AS Flex'es isNaN(arg) function. Always use this method for copying Flex isNaN(..) occurences into TypeScript.
1437
+ * @param arg
1438
+ * @returns {boolean}
1439
+ * @constructor
1440
+ */
1441
+ NumberUtils.IsNaN = function (arg) {
1442
+ return isNaN(arg) || !NumberUtils.IsNumber(arg);
1443
+ };
1444
+ // Our copy of CoMath.NaN. Returns number, or substitute if NumberUtils.IsNaN(number) holds true.
1445
+ NumberUtils.NaN = function (number, substitute) {
1446
+ if (substitute === void 0) { substitute = 0; }
1447
+ return NumberUtils.IsNaN(number) ? substitute : number;
1448
+ };
1449
+ // Returns whether the value is parasable as a number.
1450
+ NumberUtils.IsParsableNumber = function (arg) {
1451
+ if (Array.isArray(arg)) {
1452
+ return false;
1453
+ }
1454
+ return !isNaN(parseFloat(arg));
1455
+ };
1456
+ NumberUtils.IsParsableNumberInput = function (numberInput) {
1457
+ return NumberUtils.IsParsableNumber(NumberUtils._NumberInputToNumberStr(numberInput));
1458
+ };
1459
+ /**
1460
+ * Returns whether given arg is parseable as a number, and whether the lengts of its number parse result is equal to its original length.
1461
+ * I.e. this function returns FALSE with given number-parsable strings, but that have non-numeric appendices, eg '2233ff'. That arg
1462
+ * IS number-parseable, but not a strict 'string number', the latter being what this method actually checks for.
1463
+ */
1464
+ NumberUtils.IsStringNumber = function (arg) {
1465
+ if (!NumberUtils.IsParsableNumber(arg)) {
1466
+ return false;
1467
+ }
1468
+ else {
1469
+ return arg.toString().length === parseFloat(arg).toString().length;
1470
+ }
1471
+ };
1472
+ NumberUtils.IsListOfNumbers = function (arg, separator) {
1473
+ if (separator === void 0) { separator = ","; }
1474
+ var nrs = arg.split(separator);
1475
+ if (nrs.length === 0) {
1476
+ return false;
1477
+ }
1478
+ return nrs.filter(function (s) { return NumberUtils.IsStringNumber(s); }).length === nrs.length;
1479
+ };
1480
+ // Returns given argument as a string representation of a number parse, e.g. "1" for a number parse result of arg to 1.
1481
+ NumberUtils.ParseStringNumber = function (arg) {
1482
+ if (!this.IsStringNumber(arg)) {
1483
+ return NaN;
1484
+ }
1485
+ return NumberUtils.ParseFloatKeepPrecision(arg);
1486
+ };
1487
+ NumberUtils.ParseStringNumberDefault = function (arg, defaultValue) {
1488
+ if (defaultValue === void 0) { defaultValue = 0; }
1489
+ return NumberUtils.NaN(NumberUtils.ParseStringNumber(arg), defaultValue);
1490
+ };
1491
+ /**
1492
+ * Returns a random integer in range [lowerBound .. upperBound], an inclusive range. Returns NaN if not possible.
1493
+ * Given bounds are truncated first, before serving as the true lower- and upper bounds for the random int.
1494
+ */
1495
+ NumberUtils.RandomInt = function (lowerBoundInt, upperBoundInt) {
1496
+ if (!NumberUtils.IsNumber(lowerBoundInt) || !NumberUtils.IsNumber(upperBoundInt) || lowerBoundInt > upperBoundInt) {
1497
+ return NaN;
1498
+ }
1499
+ lowerBoundInt = Math.trunc(lowerBoundInt);
1500
+ upperBoundInt = Math.trunc(upperBoundInt);
1501
+ if (lowerBoundInt === upperBoundInt) {
1502
+ return lowerBoundInt;
1503
+ }
1504
+ var delta = upperBoundInt - lowerBoundInt;
1505
+ return (Math.round(Math.random() * delta) + lowerBoundInt);
1506
+ };
1507
+ // Adds thousands comma's to given value, E.g. '1000' to '1,000'. Returns empty string if value was undefined.
1508
+ NumberUtils.AddThousandsCommasTo = function (value) {
1509
+ if (isNill(value)) {
1510
+ return "";
1511
+ }
1512
+ return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1513
+ };
1514
+ /**
1515
+ * Function used to check wether a given number is composed of another number, power-of-two wise.
1516
+ * Example usage: NumberUtils.NumIsComposedOf(articleListObject.publication, ArticlePublication.Selector).
1517
+ * This would return whether or not that articleListObject was publicated for selector or not, where articleListObject.publication
1518
+ * was possibly a 'COMPOSITE that was made out of (including)' ArticlePublication.Selector.
1519
+ */
1520
+ NumberUtils.NumIsComposedOfOtherPowTwoNum = function (bigNrToCheck, powTwoNumItShouldBeComposedOf) {
1521
+ if (!bigNrToCheck) {
1522
+ return false;
1523
+ }
1524
+ else if (!powTwoNumItShouldBeComposedOf) {
1525
+ return true;
1526
+ }
1527
+ else {
1528
+ return ((bigNrToCheck & powTwoNumItShouldBeComposedOf) === powTwoNumItShouldBeComposedOf);
1529
+ }
1530
+ };
1531
+ /**
1532
+ * Returns given nr, or the given default number (default 0) if the nr number was undefined or otherwise not a number.
1533
+ * Same as CoMath.NaN from AS code (used as its substitute in transaction logic)
1534
+ * @param nr
1535
+ * @param defaultNr
1536
+ * @returns {number}
1537
+ */
1538
+ NumberUtils.NrOrDefault = function (nr, defaultNr) {
1539
+ if (defaultNr === void 0) { defaultNr = 0; }
1540
+ if (notNill(nr) && NumberUtils.IsNumber(nr)) {
1541
+ return nr;
1542
+ }
1543
+ else {
1544
+ return defaultNr;
1545
+ }
1546
+ };
1547
+ /**
1548
+ * Returns whether given nrToCheck is within the given precision and scale limits. Precision and scale, here, are Oracle DB terms.
1549
+ * This function can thus be used to check whether the given number is safe to send to the 'database' beforehand, if we know the
1550
+ * precision and scale of the number in the db declaration.
1551
+ *
1552
+ * I.e. A number declared in the Oracle DB as number(5, 2) has a precision of 5 and a scale of 2.
1553
+ *
1554
+ * @param {number} nrToCheck
1555
+ * @param {number} precision The number of significant digits, including possibly negative scale. E.g. 3 in '123' and 5 in '51.123'
1556
+ * @param {number} [scale = 0] The number of significant digits AFTER the decimal point. E.g. 1 in 5432.1 and 3 in 54000.003
1557
+ * @returns {CheckPrecisionAndScaleResult} Whether given nrToCheck is ok for given precision and scale, and if not, the
1558
+ * nearest number that IS ok for those constraints.
1559
+ */
1560
+ NumberUtils.CheckPrecisionAndScale = function (nrToCheck, precision, scale) {
1561
+ if (scale === void 0) { scale = 0; }
1562
+ // let's say any undefined number is checked OK, and all numbers are checked OK for an undefined precision
1563
+ if (!ObjectUtils.AllExist(nrToCheck, precision, scale)) {
1564
+ return { isOk: true, nearestOkNr: NaN };
1565
+ }
1566
+ // no number can have 0 or less than 0 significant digits, in our universe
1567
+ if (precision < 1 || precision - scale < 1) {
1568
+ return { isOk: false, nearestOkNr: NaN };
1569
+ }
1570
+ // begin check
1571
+ var isNegative = (nrToCheck < 0);
1572
+ var nrParts = nrToCheck.toString().split(".");
1573
+ // remove minus sign if negative
1574
+ if (isNegative) {
1575
+ nrParts[0] = nrParts[0].slice(1);
1576
+ }
1577
+ var numCountBeforeDot = nrParts[0].length;
1578
+ var allowedNumCountBeforeDot = precision - scale;
1579
+ if (numCountBeforeDot <= allowedNumCountBeforeDot) {
1580
+ return { isOk: true, nearestOkNr: nrToCheck };
1581
+ }
1582
+ else {
1583
+ // cut a part from the "before decimal number" so that the number is not too big anymore
1584
+ var numCountToRemove = numCountBeforeDot - allowedNumCountBeforeDot;
1585
+ // remove the right-most numbers before the decimal dot
1586
+ nrParts[0] = nrParts[0].slice(0, -1 * numCountToRemove);
1587
+ // add minus sign again if it was negative
1588
+ if (isNegative) {
1589
+ nrParts[0] = "-" + nrParts[0];
1590
+ }
1591
+ // build and return composite number again
1592
+ var nearestOkNr = void 0;
1593
+ if (nrParts[1]) {
1594
+ nearestOkNr = Number(nrParts[0] + "." + nrParts[1]);
1595
+ }
1596
+ else {
1597
+ nearestOkNr = Number(nrParts[0]);
1598
+ }
1599
+ return { isOk: false, nearestOkNr: nearestOkNr };
1600
+ }
1601
+ };
1602
+ /**
1603
+ * Returns whether given x is OK within the given min, max and step boundaries, where it should hold that nrToCheck = min + N * step,
1604
+ * with N integer or 0.
1605
+ * @param {number} nrToCheck Number to check whether it's within the given bounds
1606
+ * @param min Inclusive
1607
+ * @param max Inclusive
1608
+ * @param stepSize
1609
+ * @returns {CheckWithinSteppedBounds} Returns remainder of undefined when nrToCheck was OUTSIDE [min, max], else full result object.
1610
+ */
1611
+ NumberUtils.CheckWithinSteppedBounds = function (nrToCheck, min, max, stepSize) {
1612
+ if (stepSize === void 0) { stepSize = 1; }
1613
+ if (nrToCheck < min || nrToCheck > max) {
1614
+ return { isOk: false, remainder: undefined };
1615
+ }
1616
+ // we're in [min, max], but still check if nrToCheck = min + N * step holds (for N integer or 0)
1617
+ var remainder = (nrToCheck - min) % stepSize;
1618
+ // correct float for largest precision amongst input numbers
1619
+ remainder = NumberUtils.ParseFloat(remainder, NumberUtils._GetLargestDecimalPrecisionOf(nrToCheck, min, stepSize));
1620
+ return { isOk: (remainder === 0), remainder: remainder };
1621
+ };
1622
+ /**
1623
+ * Finds the number closest to the originalNumber, that adheres to the given bounds. That is, for which it holds that
1624
+ * nr = min + N * step with N integer or 0.
1625
+ * @param {number} originalNr Find closest answer to this number
1626
+ * @param min Inclusive
1627
+ * @param max Inclusive
1628
+ * @param stepSize
1629
+ * @returns {boolean} The closest OK number for bounds.
1630
+ */
1631
+ NumberUtils.GetNearestNumberWithinSteppedBounds = function (originalNr, min, max, stepSize) {
1632
+ if (stepSize === void 0) { stepSize = 1; }
1633
+ if (originalNr < min) {
1634
+ return min;
1635
+ }
1636
+ else if (originalNr > max) {
1637
+ return NumberUtils.GetTrueSteppedBoundsMax(min, max, stepSize);
1638
+ }
1639
+ var boundsCheck = NumberUtils.CheckWithinSteppedBounds(originalNr, min, max, stepSize);
1640
+ if (boundsCheck.isOk) {
1641
+ return originalNr;
1642
+ }
1643
+ var answer;
1644
+ var remainder = boundsCheck.remainder;
1645
+ if (remainder) {
1646
+ // round up or down?
1647
+ if ((remainder / stepSize) < 0.5) {
1648
+ // round down, but not below min
1649
+ answer = (originalNr - remainder >= min ? originalNr - remainder : min);
1650
+ }
1651
+ else {
1652
+ // round up, but not above max
1653
+ answer = (originalNr + stepSize - remainder <= max ? originalNr + stepSize - remainder :
1654
+ NumberUtils.GetTrueSteppedBoundsMax(min, max, stepSize));
1655
+ }
1656
+ }
1657
+ else {
1658
+ // is this real life, why wasn't our stepped bounds check OK?
1659
+ answer = originalNr;
1660
+ }
1661
+ // 'correct' float errors
1662
+ answer = NumberUtils.ParseFloat(answer, NumberUtils._GetLargestDecimalPrecisionOf(originalNr, min, max, stepSize));
1663
+ return answer;
1664
+ };
1665
+ /**
1666
+ * Returns the true maximum allowed value for the given "stepped bounds": min, stepSize and max, for which it holds that each allowed
1667
+ * value Y = min + stepSize * N, for any INTEGER or 0 N where it also holds, of course, that Y <= max.
1668
+ * @param min
1669
+ * @param max
1670
+ * @param stepSize
1671
+ */
1672
+ NumberUtils.GetTrueSteppedBoundsMax = function (min, max, stepSize) {
1673
+ if (stepSize === void 0) { stepSize = 1; }
1674
+ // solve max integer X in formula min + X * step <= max, and return min + X * stepSize for that X
1675
+ var maxSteps = Math.floor((max - min) / stepSize);
1676
+ // 'correct' float errors
1677
+ return NumberUtils.ParseFloat(min + maxSteps * stepSize, NumberUtils._GetLargestDecimalPrecisionOf(min, min, max));
1678
+ };
1679
+ // Returns the nearest number, relative to the given originalNr, that is within the given [min, max] inclusive bounds.
1680
+ NumberUtils.GetNearestNumberWithinBounds = function (originalNr, min, max) {
1681
+ var answer = originalNr;
1682
+ if (originalNr < min) {
1683
+ answer = min;
1684
+ }
1685
+ else if (originalNr > max) {
1686
+ answer = max;
1687
+ }
1688
+ return answer;
1689
+ };
1690
+ // Returns the string representation of given number. If it's not a number, returns the empty string.
1691
+ NumberUtils.ToString = function (nr) {
1692
+ if (!NumberUtils.IsNaN(nr)) {
1693
+ return "" + nr;
1694
+ }
1695
+ else {
1696
+ return "";
1697
+ }
1698
+ };
1699
+ NumberUtils.DecimalsToStepIncrement = function (numberOfDecimals) {
1700
+ return Math.pow(10, -1 * numberOfDecimals);
1701
+ };
1702
+ NumberUtils.Round = function (value, decimals) {
1703
+ var factor = Math.pow(10, decimals);
1704
+ return Math.round(value * factor) / factor;
1705
+ };
1706
+ // @returns The inclusive max value
1707
+ NumberUtils.PrecisionScaleToMaxValue = function (precision, scale) {
1708
+ var oneStep = this.DecimalsToStepIncrement(scale);
1709
+ var maxExclusive = Math.pow(10, precision - scale);
1710
+ return maxExclusive - oneStep;
1711
+ };
1712
+ // @returns the difference between given 2 numbers
1713
+ NumberUtils.DifferenceBetweenNumbers = function (numberA, numberB) {
1714
+ return Math.abs(numberA - numberB);
1715
+ };
1716
+ NumberUtils._GetLargestDecimalPrecisionOf = function () {
1717
+ var args = [];
1718
+ for (var _i = 0; _i < arguments.length; _i++) {
1719
+ args[_i] = arguments[_i];
1720
+ }
1721
+ var result = ArrayUtils.GetMaxCalculatedValue(args, function (arg) {
1722
+ return NumberUtils.GetDecimalPlaces(arg);
1723
+ });
1724
+ return result;
1725
+ };
1726
+ // Returns given number input as a number that's useable by Javascript. Allows for incoming ',' decimal delimiter.
1727
+ NumberUtils._NumberInputToNumberStr = function (numberInput) {
1728
+ return (numberInput + "").replace(",", ".");
1729
+ };
1730
+ return NumberUtils;
1731
+ }());
1732
+
1035
1733
  var ArrayUtils = /** @class */ (function () {
1036
1734
  function ArrayUtils() {
1037
1735
  }
@@ -1046,7 +1744,7 @@
1046
1744
  if (!array || !finder) {
1047
1745
  return false;
1048
1746
  }
1049
- return notNill_function.notNill(this.Find(array, finder));
1747
+ return notNill(this.Find(array, finder));
1050
1748
  };
1051
1749
  /**
1052
1750
  * Cross-browser Array.find() function. Returns the first item in given array for which the foundBy function returns true. Returns
@@ -1109,10 +1807,10 @@
1109
1807
  if (array) {
1110
1808
  for (var i = 0, len = array.length; i < len; i++) {
1111
1809
  if (deepClone) {
1112
- cloneArray.push(objectUtils.ObjectUtils.GetDeepClone(array[i]));
1810
+ cloneArray.push(ObjectUtils.GetDeepClone(array[i]));
1113
1811
  }
1114
1812
  else {
1115
- cloneArray.push(objectUtils.ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
1813
+ cloneArray.push(ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
1116
1814
  }
1117
1815
  }
1118
1816
  }
@@ -1130,7 +1828,7 @@
1130
1828
  * @returns {boolean} True if and only if the element on given index is succesfully removed from given array.
1131
1829
  */
1132
1830
  ArrayUtils.RemoveElementAtIndex = function (index, array) {
1133
- if (numberUtils.NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
1831
+ if (NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
1134
1832
  return false;
1135
1833
  }
1136
1834
  if (index in array) {
@@ -1158,7 +1856,7 @@
1158
1856
  };
1159
1857
  // 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.
1160
1858
  ArrayUtils.IsArrayWithElements = function (arrayToCheck, classItemsMustBeInstanceOf) {
1161
- if (isNill_function.isNill(arrayToCheck)) {
1859
+ if (isNill(arrayToCheck)) {
1162
1860
  return false;
1163
1861
  }
1164
1862
  if (Array.isArray(arrayToCheck) && arrayToCheck.length > 0) {
@@ -1190,11 +1888,11 @@
1190
1888
  return atLeastOneRemoved;
1191
1889
  };
1192
1890
  ArrayUtils.MoveElement = function (element, toIndex, array) {
1193
- if (!Array.isArray(array) || isNill_function.isNill(toIndex)) {
1891
+ if (!Array.isArray(array) || isNill(toIndex)) {
1194
1892
  return false;
1195
1893
  }
1196
1894
  var fromIndex = array.indexOf(element);
1197
- var toIndexCorrected = numberUtils.NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
1895
+ var toIndexCorrected = NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
1198
1896
  if (fromIndex === -1 || array[toIndexCorrected] === element) {
1199
1897
  // element did not exist in given array, or already existed on given toIndex
1200
1898
  return false;
@@ -1212,6 +1910,25 @@
1212
1910
  }
1213
1911
  }
1214
1912
  };
1913
+ /**
1914
+ * Returns max value from all resulting values from applying given itemValueFunction to all items of given array.
1915
+ * @param array
1916
+ * @param itemValueFunction The function applied to each array item that gives it a numerical value. The max num val found is returned.
1917
+ */
1918
+ ArrayUtils.GetMaxCalculatedValue = function (array, itemValueFunction) {
1919
+ if (!array || !itemValueFunction) {
1920
+ return NaN;
1921
+ }
1922
+ var max = undefined;
1923
+ var len = array.length;
1924
+ for (var i = 0; i < len; i++) {
1925
+ var valueCur = itemValueFunction.call(this);
1926
+ if (valueCur > max) {
1927
+ max = valueCur;
1928
+ }
1929
+ }
1930
+ return max;
1931
+ };
1215
1932
  return ArrayUtils;
1216
1933
  }());
1217
1934
 
@@ -1408,13 +2125,13 @@
1408
2125
  return BusinessObjectFactory;
1409
2126
  }());
1410
2127
 
1411
- var LanguageCode;
2128
+ exports["ɵr"] = void 0;
1412
2129
  (function (LanguageCode) {
1413
2130
  LanguageCode["Dutch"] = "nl-NL";
1414
2131
  LanguageCode["English"] = "en-GB";
1415
2132
  LanguageCode["German"] = "de-DE";
1416
2133
  LanguageCode["French"] = "fr-FR";
1417
- })(LanguageCode || (LanguageCode = {}));
2134
+ })(exports["ɵr"] || (exports["ɵr"] = {}));
1418
2135
 
1419
2136
  // Static utility functions holder related to strings.
1420
2137
  var StringUtils = /** @class */ (function () {
@@ -1528,7 +2245,7 @@
1528
2245
  DictionaryService.prototype.setDictionary = function (language) {
1529
2246
  return __awaiter(this, void 0, void 0, function () {
1530
2247
  return __generator(this, function (_a) {
1531
- this._language = language || LanguageCode.Dutch;
2248
+ this._language = language || exports["ɵr"].Dutch;
1532
2249
  this._loadDictionary();
1533
2250
  return [2 /*return*/];
1534
2251
  });
@@ -1561,7 +2278,7 @@
1561
2278
  return key || "";
1562
2279
  }
1563
2280
  if (this.language === undefined) {
1564
- this._language = LanguageCode.Dutch;
2281
+ this._language = exports["ɵr"].Dutch;
1565
2282
  this._loadDictionary();
1566
2283
  }
1567
2284
  var text = this._dictionaries.get(this.language)[key];
@@ -1849,15 +2566,15 @@
1849
2566
  });
1850
2567
  });
1851
2568
  };
1852
- SharedConnectorService.prototype.getArticleDetails = function (data) {
2569
+ SharedConnectorService.prototype.getOrderConfirmationDefaultSendMethod = function (relationId) {
1853
2570
  return __awaiter(this, void 0, void 0, function () {
1854
2571
  var _this = this;
1855
2572
  return __generator(this, function (_a) {
1856
2573
  return [2 /*return*/, new Promise(function (resolve, reject) {
1857
- return _this.articleConnector.getArticleDetails(data).then(function (result) {
2574
+ return _this.sharedConnector.getOrderConfirmationDefaultSendMethod(relationId).then(function (result) {
1858
2575
  if (result.validationResult && result.validationResult.success) {
1859
- if (result.resultObjects) {
1860
- resolve(_this._boFactory.makeBOArrayFromRawBackendDataArray(articleDetails_bo.ArticleDetailsBo, result.resultObjects));
2576
+ if (result.resultObject) {
2577
+ resolve(result.resultObject);
1861
2578
  }
1862
2579
  }
1863
2580
  else {
@@ -1868,31 +2585,88 @@
1868
2585
  });
1869
2586
  });
1870
2587
  };
1871
- SharedConnectorService.prototype.updateArticleDetails = function (data) {
2588
+ SharedConnectorService.prototype.getDefaultEmailAddressListForOrderConfirmation = function (transactionUUID) {
1872
2589
  return __awaiter(this, void 0, void 0, function () {
1873
2590
  var _this = this;
1874
2591
  return __generator(this, function (_a) {
1875
2592
  return [2 /*return*/, new Promise(function (resolve, reject) {
1876
- return _this.articleConnector.updateArticleDetails(data).then(function (result) { return __awaiter(_this, void 0, void 0, function () {
1877
- return __generator(this, function (_a) {
1878
- switch (_a.label) {
1879
- case 0:
1880
- if (!(result.validationResult && result.validationResult.success)) return [3 /*break*/, 2];
1881
- return [4 /*yield*/, this.commit()];
1882
- case 1:
1883
- _a.sent();
1884
- resolve(true);
1885
- return [3 /*break*/, 3];
1886
- case 2:
1887
- reject(result.validationMessagesAsString);
1888
- _a.label = 3;
1889
- case 3: return [2 /*return*/];
2593
+ return _this.sharedConnector.getDefaultEmailAddressListForOrderConfirmation(transactionUUID).then(function (result) {
2594
+ if (result.validationResult && result.validationResult.success) {
2595
+ if (result.resultObject) {
2596
+ resolve(result.resultObject);
1890
2597
  }
1891
- });
1892
- }); });
1893
- })];
1894
- });
1895
- });
2598
+ }
2599
+ else {
2600
+ reject(result.validationMessagesAsString);
2601
+ }
2602
+ });
2603
+ })];
2604
+ });
2605
+ });
2606
+ };
2607
+ SharedConnectorService.prototype.getPurchaseOrderEmailLayouts = function (transactionUUID) {
2608
+ return __awaiter(this, void 0, void 0, function () {
2609
+ var _this = this;
2610
+ return __generator(this, function (_a) {
2611
+ return [2 /*return*/, new Promise(function (resolve, reject) {
2612
+ return _this.sharedConnector.getPurchaseOrderEmailLayouts(transactionUUID).then(function (result) {
2613
+ if (result.validationResult && result.validationResult.success) {
2614
+ if (result.resultObject) {
2615
+ resolve(result.resultObject);
2616
+ }
2617
+ }
2618
+ else {
2619
+ reject(result.validationMessagesAsString);
2620
+ }
2621
+ });
2622
+ })];
2623
+ });
2624
+ });
2625
+ };
2626
+ SharedConnectorService.prototype.getArticleDetails = function (data) {
2627
+ return __awaiter(this, void 0, void 0, function () {
2628
+ var _this = this;
2629
+ return __generator(this, function (_a) {
2630
+ return [2 /*return*/, new Promise(function (resolve, reject) {
2631
+ return _this.articleConnector.getArticleDetails(data).then(function (result) {
2632
+ if (result.validationResult && result.validationResult.success) {
2633
+ if (result.resultObjects) {
2634
+ resolve(_this._boFactory.makeBOArrayFromRawBackendDataArray(articleDetails_bo.ArticleDetailsBo, result.resultObjects));
2635
+ }
2636
+ }
2637
+ else {
2638
+ reject(result.validationMessagesAsString);
2639
+ }
2640
+ });
2641
+ })];
2642
+ });
2643
+ });
2644
+ };
2645
+ SharedConnectorService.prototype.updateArticleDetails = function (data) {
2646
+ return __awaiter(this, void 0, void 0, function () {
2647
+ var _this = this;
2648
+ return __generator(this, function (_a) {
2649
+ return [2 /*return*/, new Promise(function (resolve, reject) {
2650
+ return _this.articleConnector.updateArticleDetails(data).then(function (result) { return __awaiter(_this, void 0, void 0, function () {
2651
+ return __generator(this, function (_a) {
2652
+ switch (_a.label) {
2653
+ case 0:
2654
+ if (!(result.validationResult && result.validationResult.success)) return [3 /*break*/, 2];
2655
+ return [4 /*yield*/, this.commit()];
2656
+ case 1:
2657
+ _a.sent();
2658
+ resolve(true);
2659
+ return [3 /*break*/, 3];
2660
+ case 2:
2661
+ reject(result.validationMessagesAsString);
2662
+ _a.label = 3;
2663
+ case 3: return [2 /*return*/];
2664
+ }
2665
+ });
2666
+ }); });
2667
+ })];
2668
+ });
2669
+ });
1896
2670
  };
1897
2671
  SharedConnectorService.prototype.lockArticleDetails = function (data) {
1898
2672
  return __awaiter(this, void 0, void 0, function () {
@@ -1995,8 +2769,6 @@
1995
2769
  var StockService = /** @class */ (function () {
1996
2770
  function StockService(_sharedService) {
1997
2771
  this._sharedService = _sharedService;
1998
- this.printSticker = new printStockStickers.PrintStockStickers();
1999
- this.printPriceSticker = new printPriceStickers_bo.PrintPriceStickers();
2000
2772
  }
2001
2773
  StockService.prototype.getPrintStockStickers = function (data) {
2002
2774
  return __awaiter(this, void 0, void 0, function () {
@@ -2116,6 +2888,36 @@
2116
2888
  });
2117
2889
  });
2118
2890
  };
2891
+ StockService.prototype.getOrderConfirmationDefaultSendMethod = function (relationId) {
2892
+ return __awaiter(this, void 0, void 0, function () {
2893
+ return __generator(this, function (_a) {
2894
+ switch (_a.label) {
2895
+ case 0: return [4 /*yield*/, this._sharedService.getOrderConfirmationDefaultSendMethod(relationId)];
2896
+ case 1: return [2 /*return*/, _a.sent()];
2897
+ }
2898
+ });
2899
+ });
2900
+ };
2901
+ StockService.prototype.getDefaultEmailAddressListForOrderConfirmation = function (transactionUUID) {
2902
+ return __awaiter(this, void 0, void 0, function () {
2903
+ return __generator(this, function (_a) {
2904
+ switch (_a.label) {
2905
+ case 0: return [4 /*yield*/, this._sharedService.getDefaultEmailAddressListForOrderConfirmation(transactionUUID)];
2906
+ case 1: return [2 /*return*/, _a.sent()];
2907
+ }
2908
+ });
2909
+ });
2910
+ };
2911
+ StockService.prototype.getPurchaseOrderEmailLayouts = function (transactionUUID) {
2912
+ return __awaiter(this, void 0, void 0, function () {
2913
+ return __generator(this, function (_a) {
2914
+ switch (_a.label) {
2915
+ case 0: return [4 /*yield*/, this._sharedService.getPurchaseOrderEmailLayouts(transactionUUID)];
2916
+ case 1: return [2 /*return*/, _a.sent()];
2917
+ }
2918
+ });
2919
+ });
2920
+ };
2119
2921
  StockService.prototype.getArticleTransaction = function (data) {
2120
2922
  return __awaiter(this, void 0, void 0, function () {
2121
2923
  return __generator(this, function (_a) {
@@ -2327,8 +3129,13 @@
2327
3129
  "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>",
2328
3130
  "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>",
2329
3131
  "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>",
3132
+ "envelope_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z\"/></svg>",
3133
+ "file_pdf_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><path d=\"M320 464C328.8 464 336 456.8 336 448V416H384V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V416H48V448C48 456.8 55.16 464 64 464H320zM256 160C238.3 160 224 145.7 224 128V48H64C55.16 48 48 55.16 48 64V192H0V64C0 28.65 28.65 0 64 0H229.5C246.5 0 262.7 6.743 274.7 18.75L365.3 109.3C377.3 121.3 384 137.5 384 154.5V192H336V160H256zM88 224C118.9 224 144 249.1 144 280C144 310.9 118.9 336 88 336H80V368C80 376.8 72.84 384 64 384C55.16 384 48 376.8 48 368V240C48 231.2 55.16 224 64 224H88zM112 280C112 266.7 101.3 256 88 256H80V304H88C101.3 304 112 293.3 112 280zM160 240C160 231.2 167.2 224 176 224H200C226.5 224 248 245.5 248 272V336C248 362.5 226.5 384 200 384H176C167.2 384 160 376.8 160 368V240zM192 352H200C208.8 352 216 344.8 216 336V272C216 263.2 208.8 256 200 256H192V352zM336 224C344.8 224 352 231.2 352 240C352 248.8 344.8 256 336 256H304V288H336C344.8 288 352 295.2 352 304C352 312.8 344.8 320 336 320H304V368C304 376.8 296.8 384 288 384C279.2 384 272 376.8 272 368V240C272 231.2 279.2 224 288 224H336z\"/></svg>",
3134
+ "file_pdf_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><path d=\"M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM64 224H88c30.9 0 56 25.1 56 56s-25.1 56-56 56H80v32c0 8.8-7.2 16-16 16s-16-7.2-16-16V320 240c0-8.8 7.2-16 16-16zm24 80c13.3 0 24-10.7 24-24s-10.7-24-24-24H80v48h8zm72-64c0-8.8 7.2-16 16-16h24c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H176c-8.8 0-16-7.2-16-16V240zm32 112h8c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16h-8v96zm96-128h48c8.8 0 16 7.2 16 16s-7.2 16-16 16H304v32h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H304v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V304 240c0-8.8 7.2-16 16-16z\"/></svg>",
2330
3135
  "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>",
2331
3136
  "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>",
3137
+ "print_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M111.1 48h254.1L400 81.94V160H448V81.94c0-12.73-5.057-24.94-14.06-33.94l-33.94-33.94C391 5.057 378.8 0 366.1 0H111.1C85.49 0 64.01 21.48 64 47.98l.002 82.28c-.002 0 .002 0 0 0L64 160h48.01L111.1 48zM440 192H72C32.3 192 0 224.3 0 264v112c0 13.25 10.75 24 24 24H80V480c0 17.67 14.33 32 32 32h288c17.67 0 32-14.33 32-32v-80h56c13.25 0 24-10.75 24-24v-112C512 224.3 479.7 192 440 192zM384 464H128v-96h256V464zM464 352h-32c0-17.67-14.33-32-32-32h-288c-17.67 0-32 14.33-32 32h-32V264c0-13.23 10.77-24 24-24h368c13.23 0 24 10.77 24 24V352z\"/></svg>",
3138
+ "print_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M448 192H64C28.65 192 0 220.7 0 256v96c0 17.67 14.33 32 32 32h32v96c0 17.67 14.33 32 32 32h320c17.67 0 32-14.33 32-32v-96h32c17.67 0 32-14.33 32-32V256C512 220.7 483.3 192 448 192zM384 448H128v-96h256V448zM432 296c-13.25 0-24-10.75-24-24c0-13.27 10.75-24 24-24s24 10.73 24 24C456 285.3 445.3 296 432 296zM128 64h229.5L384 90.51V160h64V77.25c0-8.484-3.375-16.62-9.375-22.62l-45.25-45.25C387.4 3.375 379.2 0 370.8 0H96C78.34 0 64 14.33 64 32v128h64V64z\"/></svg>",
2332
3139
  "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>",
2333
3140
  "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>"
2334
3141
  };
@@ -2397,8 +3204,13 @@
2397
3204
  Icon["DeleteLeftRegular"] = "delete_left_regular";
2398
3205
  Icon["DeliveryTruck"] = "delivery_truck";
2399
3206
  Icon["Email"] = "email";
3207
+ Icon["EnvelopeRegular"] = "envelope_regular";
3208
+ Icon["FilePdfRegular"] = "file_pdf_regular";
3209
+ Icon["FilePdfSolid"] = "file_pdf_solid";
2400
3210
  Icon["Pdf"] = "pdf";
2401
3211
  Icon["Print"] = "print";
3212
+ Icon["PrintRegular"] = "print_regular";
3213
+ Icon["PrintSolid"] = "print_solid";
2402
3214
  Icon["SignatureField"] = "signature_field";
2403
3215
  Icon["Xml"] = "xml";
2404
3216
  })(Icon || (Icon = {}));
@@ -2490,12 +3302,14 @@
2490
3302
  });
2491
3303
  };
2492
3304
  StockInformationGridComponent.prototype.openSendMethodDialog = function (data) {
2493
- this._stockService.printSticker.goodId = data.goodId;
2494
- this._stockService.printSticker.warehouse = data.warehouseNo;
3305
+ if (!(this._stockService.printLayoutParams instanceof printPriceStickers_bo.PrintPriceStickers)) {
3306
+ this._stockService.printLayoutParams.goodId = data.goodId;
3307
+ this._stockService.printLayoutParams.warehouse = data.warehouseNo;
3308
+ }
2495
3309
  this.showSendMethodDialog = !this.showSendMethodDialog;
2496
3310
  };
2497
3311
  StockInformationGridComponent.prototype.printStockStickers = function () {
2498
- this._stockService.getPrintStockStickers(this._stockService.printSticker);
3312
+ this._stockService.getPrintStockStickers(this._stockService.printLayoutParams);
2499
3313
  };
2500
3314
  StockInformationGridComponent.prototype.onOkClick = function () {
2501
3315
  };
@@ -2732,42 +3546,57 @@
2732
3546
  this.showPrintOption = true;
2733
3547
  this.showPdfOption = true;
2734
3548
  this.showXmlOption = true;
2735
- this.showPrintPriceStickers = false;
2736
- this.showPrintStockStickers = true;
3549
+ this.showPrintPriceStickers = true;
2737
3550
  this.sendOptions = [
2738
3551
  { option: SendOption.Email,
2739
- iconName: this.icons.Email,
3552
+ iconName: this.icons.EnvelopeRegular,
2740
3553
  },
2741
3554
  { option: SendOption.Print,
2742
- iconName: this.icons.Print,
3555
+ iconName: this.icons.PrintRegular,
2743
3556
  },
2744
3557
  { option: SendOption.Pdf,
2745
- iconName: this.icons.Pdf,
3558
+ iconName: this.icons.FilePdfRegular,
2746
3559
  },
2747
3560
  { option: SendOption.Xml,
2748
- iconName: this.icons.Xml,
3561
+ iconName: this.icons.FilePdfRegular,
2749
3562
  }
2750
3563
  ];
2751
3564
  this.activeSendOption = SendOption.Email;
2752
3565
  this.showStandardPrinterOptions = false;
2753
3566
  this.showPrinterSelections = false;
2754
3567
  this.showExitButton = true;
3568
+ this.printTemplates = [];
2755
3569
  this.printTemplatesField = { text: "name", value: "reportId" };
3570
+ this.emailLayoutField = { text: "name", value: "reportId" };
2756
3571
  this.priceListDataField = { text: "name", value: "priceListCode" };
2757
3572
  this.upAndLoaded = false;
2758
- this.emails = ['lars.vdv@colijn-it.nl', 'david@colijn-it.nl', 'ruben@colijn-it.nl'];
2759
3573
  this.models = [false, false, true];
2760
- this.layouts = ['Layout 1', 'Layout 2', 'Layout 3'];
2761
3574
  this.showDialog = false;
3575
+ this.emailAdresses = [];
3576
+ this.printLayouts = [];
3577
+ this.isDocSignEnabled = false;
3578
+ this.docSign = false;
2762
3579
  this.startSignatureClicked = new i0.EventEmitter();
3580
+ this.sendEmailClicked = new i0.EventEmitter();
2763
3581
  this.printButtonClicked = new i0.EventEmitter();
3582
+ this.emailLayoutClicked = new i0.EventEmitter();
3583
+ this.printTemplatesClicked = new i0.EventEmitter();
3584
+ this.defaultSendMethodClicked = new i0.EventEmitter();
3585
+ this.printLayoutParams = new i0.EventEmitter();
3586
+ this.sendMethodParams = new /** @class */ (function () {
3587
+ function class_1() {
3588
+ }
3589
+ return class_1;
3590
+ }());
2764
3591
  this._subscriptions = [];
2765
3592
  this._subscriptions.push(this._optionsService.optionsLoaded.subscribe(function (loaded) { return _this._handleSettingsLoaded(loaded); }));
2766
3593
  }
2767
3594
  Object.defineProperty(SendMethodDialogComponent.prototype, "articleData", {
2768
3595
  set: function (data) {
2769
- this.stockService.printSticker.goodId = data.goodId;
2770
- this.stockService.printSticker.warehouse = data.warehouseNo;
3596
+ if (!(this.printLayoutParams instanceof printPriceStickers_bo.PrintPriceStickers)) {
3597
+ this.sendMethodParams.goodId = data.goodId;
3598
+ this.sendMethodParams.warehouse = data.warehouseNo;
3599
+ }
2771
3600
  },
2772
3601
  enumerable: false,
2773
3602
  configurable: true
@@ -2776,6 +3605,10 @@
2776
3605
  SendMethodDialogComponent.prototype.showClass = function () {
2777
3606
  return true;
2778
3607
  };
3608
+ SendMethodDialogComponent.prototype.ngOnInit = function () {
3609
+ this.getDefaultSendMethod();
3610
+ this.getDefaultEmailLayouts();
3611
+ };
2779
3612
  SendMethodDialogComponent.prototype.ngOnDestroy = function () {
2780
3613
  this._subscriptions.forEach(function (subscription) { return subscription.unsubscribe(); });
2781
3614
  };
@@ -2793,12 +3626,16 @@
2793
3626
  this.showDialog = false;
2794
3627
  };
2795
3628
  SendMethodDialogComponent.prototype.handleSignatureStart = function () {
3629
+ this.docSign = !this.docSign;
2796
3630
  this.startSignatureClicked.emit();
2797
3631
  };
3632
+ SendMethodDialogComponent.prototype.sendEmail = function () {
3633
+ this.sendEmailClicked.emit();
3634
+ this.printLayoutParams.emit(this.sendMethodParams);
3635
+ };
2798
3636
  SendMethodDialogComponent.prototype.handlePrintClicked = function () {
2799
- // this.printButtonClicked.emit();
2800
- if (this.stockService.printSticker.printerName) {
2801
- this.stockService.getPrintStockStickers(this.stockService.printSticker);
3637
+ if (this.sendMethodParams.printerName) {
3638
+ this.printButtonClicked.emit();
2802
3639
  }
2803
3640
  };
2804
3641
  SendMethodDialogComponent.prototype.togglePrinterSelection = function () {
@@ -2814,17 +3651,22 @@
2814
3651
  };
2815
3652
  SendMethodDialogComponent.prototype.onPrinterClicked = function (printer) {
2816
3653
  this.defaultPrinter = printer.name;
2817
- this.stockService.printSticker.printerName = printer.name;
3654
+ this.sendMethodParams.printerName = printer.name;
2818
3655
  this.showPrinterSelections = !this.showPrinterSelections;
2819
3656
  };
2820
3657
  SendMethodDialogComponent.prototype.getPrintTemplates = function () {
2821
- var _this = this;
2822
- if (!this.printTemplates) {
2823
- var data = new stockStickersPrintLayouts_bo.StockStickersPrintLayouts();
2824
- this.stockService.getStockStickerTemplates(data).then(function (templates) {
2825
- _this.printTemplates = templates;
3658
+ this.printTemplatesClicked.emit();
3659
+ };
3660
+ SendMethodDialogComponent.prototype.getDefaultSendMethod = function () {
3661
+ this.defaultSendMethodClicked.emit();
3662
+ };
3663
+ SendMethodDialogComponent.prototype.getDefaultEmailLayouts = function () {
3664
+ return __awaiter(this, void 0, void 0, function () {
3665
+ return __generator(this, function (_a) {
3666
+ this.emailLayoutClicked.emit();
3667
+ return [2 /*return*/];
2826
3668
  });
2827
- }
3669
+ });
2828
3670
  };
2829
3671
  SendMethodDialogComponent.prototype._handleSettingsLoaded = function (loaded) {
2830
3672
  return __awaiter(this, void 0, void 0, function () {
@@ -2868,7 +3710,7 @@
2868
3710
  SendMethodDialogComponent.decorators = [
2869
3711
  { type: i0.Component, args: [{
2870
3712
  selector: "ione-send-method-dialog",
2871
- template: "\n <div class=\"send-method-dialog-wrapper\">\n <co-dialog-wizard id=\"sendOptionsDialog\" *ngIf=\"showDialog\" [showCloseIcon]=\"showExitButton\" (closeClick)=\"closeDialogClick()\">\n <ng-container header>\n <span [textContent]=\"headerTitle\"></span>\n </ng-container>\n <div class=\"dialog-content-wrapper\">\n <div class=\"main-content-container\" *ngIf=\"!showPrinterSelections\">\n <div class=\"send-options-wrapper\">\n <div class=\"custom-button-wrapper\"\n *ngFor=\"let sendOption of sendOptions\"\n [class.selected-option]=\"sendOption.option === activeSendOption\"\n (click)=\"activeSendOption = sendOption.option\">\n <co-icon [iconData]=\"iconCacheService.getIcon(sendOption.iconName)\"></co-icon>\n </div>\n </div>\n\n <div class=\"email-option-content\" *ngIf=\"activeSendOption === sendOption.Email || activeSendOption === sendOption.Pdf\">\n <div class=\"emails-container\" *ngIf=\"activeSendOption === sendOption.Email\">\n <co-input-checkbox\n *ngFor=\"let email, let index of emails\"\n [name]=\"email\"\n [(model)]=\"models[index]\"\n [label]=\"email\"\n [cssClass]=\"'input-checkbox-wrapper'\"\n ></co-input-checkbox>\n </div>\n\n <div class=\"lov-wrapper\">\n <co-input-combo-box\n [(model)]=\"selectedLayout\"\n [collection]=\"layouts\"\n [forceReadonly]=\"true\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n\n <div class=\"signature-button-wrapper\">\n <div class=\"custom-button-wrapper signature-button\" (click)=\"handleSignatureStart()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.SignatureField)\"></co-icon>\n </div>\n </div>\n </div>\n\n <div class=\"email-option-content\" *ngIf=\"activeSendOption === sendOption.Print\" (click)=\"getPrintTemplates()\">\n <div *ngIf=\"showPrintPriceStickers\">\n <div class=\"lov-wrapper\">\n <co-input-combo-box\n [(model)]=\"stockService.printPriceSticker.reportId\"\n [collection]=\"printTemplates\"\n [fields]=\"printTemplatesField\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n <div class=\"lov-wrapper\" *ngIf=\"priceListCodeData\">\n <co-input-combo-box\n [(model)]=\"stockService.printPriceSticker.priceListCode\"\n [collection]=\"priceListCodeData\"\n [fields]=\"priceListDataField\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n </div>\n\n <div *ngIf=\"showPrintStockStickers\">\n <div class=\"lov-wrapper\">\n <co-input-combo-box\n [(model)]=\"stockService.printSticker.reportId\"\n [collection]=\"printTemplates\"\n [fields]=\"printTemplatesField\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n </div>\n\n <div class=\"lov-wrapper clickable\" (click)=\"togglePrinterSelection()\">\n <div class=\"selected-printer-wrapper\">\n <div class=\"printer-option-list-item\">\n <co-icon class=\"printer-icon\" [iconData]=\"iconCacheService.getIcon(icons.Print)\"></co-icon>\n <div class=\"printer-details\" *ngIf=\"printerList\">\n <span class=\"printer-name\" [textContent]=\"defaultPrinter\"></span>\n <span class=\"printer-status\" [textContent]=\"defaultPrinter.acceptingJobs\"></span>\n </div>\n </div>\n <co-icon class=\"select-printer-arrow\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\"></co-icon>\n </div>\n </div>\n\n <div class=\"standard-printer-wrapper\">\n <div class=\"standard-printer-link\" (click)=\"showStandardPrinterOptions = !showStandardPrinterOptions\">\n <co-icon class=\"arrow-icon\" [iconData]=\"iconCacheService.getIcon(icons.ArrowFatRight)\"></co-icon>\n <span class=\"standard-printer-message\" [textContent]=\"'Standaard printer voor lay-out instellen'\"></span>\n </div>\n\n <div class=\"standard-printer-selections\" *ngIf=\"showStandardPrinterOptions\">\n <co-input-checkbox\n [(model)]=\"models[0]\"\n [label]=\"'Per gebruiker instellen'\"\n [cssClass]=\"'input-checkbox-wrapper'\"\n ></co-input-checkbox>\n <co-input-checkbox\n [(model)]=\"models[1]\"\n [label]=\"'Voor alle gebruikers instellen'\"\n [cssClass]=\"'input-checkbox-wrapper'\"\n ></co-input-checkbox>\n </div>\n </div>\n\n <div class=\"print-footer-wrapper\">\n <div class=\"input-number-wrapper\">\n <co-input-number-picker class=\"number-picker\"\n [step]=\"1\" [(model)]=\"stockService.printSticker.amount\" [min]=\"1\"\n [ngModelOptions]=\"{debounce: 1}\">\n </co-input-number-picker>\n </div>\n <div class=\"custom-button-wrapper print-button\" (click)=\"handlePrintClicked()\">\n <span [textContent]=\"'Print'\"></span>\n </div>\n <div class=\"custom-button-wrapper signature-button\" (click)=\"handleSignatureStart()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.SignatureField)\"></co-icon>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"printer-content-container\" @slideInOut *ngIf=\"showPrinterSelections\">\n <div class=\"selected-printer-wrapper selection clickable\" *ngFor=\"let printers of printerList\" (click)=\"onPrinterClicked(printers)\">\n <div class=\"printer-option-list-item\">\n <co-icon class=\"printer-icon\" [iconData]=\"iconCacheService.getIcon(icons.Print)\"></co-icon>\n <div class=\"printer-details\">\n <span class=\"printer-name\" [textContent]=\"printers.name\"></span>\n <span class=\"printer-status\" [textContent]=\"printers.acceptingJobs\"></span>\n </div>\n </div>\n <co-icon class=\"select-printer-arrow\" *ngIf=\"!showPrinterSelections\"\n [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\"></co-icon>\n </div>\n </div>\n </div>\n </co-dialog-wizard>\n </div>\n ",
3713
+ template: "\n <div class=\"send-method-dialog-wrapper\">\n <co-dialog id=\"sendOptionsDialog\" [headerTemplate]=\"headerTemplate\" *ngIf=\"showDialog\" [showCloseIcon]=\"showExitButton\" (closeClick)=\"closeDialogClick()\">\n <ng-template #headerTemplate>\n <h2 [textContent]=\"headerTitle\"></h2>\n </ng-template>\n <div class=\"dialog-content-wrapper\">\n <div class=\"main-content-container\" *ngIf=\"!showPrinterSelections\">\n <div class=\"send-options-wrapper\">\n <div class=\"custom-button-wrapper\"\n *ngFor=\"let sendOption of sendOptions\"\n [class.selected-option]=\"sendOption.option === activeSendOption\"\n (click)=\"activeSendOption = sendOption.option\">\n <co-icon [iconData]=\"iconCacheService.getIcon(sendOption.iconName)\"></co-icon>\n </div>\n </div>\n\n <div class=\"email-option-content\" *ngIf=\"activeSendOption === sendOption.Email || activeSendOption === sendOption.Pdf\">\n <div class=\"emails-container\" *ngIf=\"activeSendOption === sendOption.Email\">\n <co-input-checkbox\n *ngFor=\"let email of emailAdresses\"\n [(model)]=\"email.name\"\n [label]=\"email\"\n [cssClass]=\"'input-checkbox-wrapper'\"\n ></co-input-checkbox>\n </div>\n\n <div class=\"lov-wrapper\" (click)=\"getDefaultEmailLayouts()\">\n <co-input-combo-box\n [(model)]=\"sendMethodParams.reportId\"\n [collection]=\"emailLayouts\"\n [fields]=\"emailLayoutField\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n\n <div *ngIf=\"isDocSignEnabled\" class=\"signature-button-wrapper\">\n <div class=\"custom-button-wrapper signature-button\" (click)=\"handleSignatureStart()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.SignatureField)\"></co-icon>\n </div>\n <div class=\"custom-button-wrapper send-button\" (click)=\"sendEmail()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.Email)\"></co-icon>\n </div>\n </div>\n\n <ione-docsign *ngIf=\"docSign\"></ione-docsign>\n </div>\n\n <div class=\"email-option-content\" *ngIf=\"activeSendOption === sendOption.Print\" (click)=\"getPrintTemplates()\">\n <div *ngIf=\"showPrintPriceStickers\">\n <div class=\"lov-wrapper\">\n <co-input-combo-box\n [(model)]=\"sendMethodParams.reportId\"\n [collection]=\"printLayouts\"\n [fields]=\"printTemplatesField\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n <div class=\"lov-wrapper\" *ngIf=\"priceListCodeData\">\n <co-input-combo-box\n [(model)]=\"sendMethodParams.priceListCode\"\n [collection]=\"priceListCodeData\"\n [fields]=\"priceListDataField\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n </div>\n\n <div class=\"lov-wrapper clickable\" (click)=\"togglePrinterSelection()\">\n <div class=\"selected-printer-wrapper\">\n <div class=\"printer-option-list-item\">\n <co-icon class=\"printer-icon\" [iconData]=\"iconCacheService.getIcon(icons.PrintRegular)\"></co-icon>\n <div class=\"printer-details\" *ngIf=\"printerList\">\n <span class=\"printer-name\" [textContent]=\"defaultPrinter\"></span>\n <span class=\"printer-status\" [textContent]=\"defaultPrinter.acceptingJobs\"></span>\n </div>\n </div>\n <co-icon class=\"select-printer-arrow\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\"></co-icon>\n </div>\n </div>\n\n <div class=\"standard-printer-wrapper\">\n <div class=\"standard-printer-link\" (click)=\"showStandardPrinterOptions = !showStandardPrinterOptions\">\n <co-icon class=\"arrow-icon\" [iconData]=\"iconCacheService.getIcon(icons.ArrowFatRight)\"></co-icon>\n <span class=\"standard-printer-message\" [textContent]=\"'Standaard printer voor lay-out instellen'\"></span>\n </div>\n\n <div class=\"standard-printer-selections\" *ngIf=\"showStandardPrinterOptions\">\n <co-input-checkbox\n [(model)]=\"models[0]\"\n [label]=\"'Per gebruiker instellen'\"\n [cssClass]=\"'input-checkbox-wrapper'\"\n ></co-input-checkbox>\n <co-input-checkbox\n [(model)]=\"models[1]\"\n [label]=\"'Voor alle gebruikers instellen'\"\n [cssClass]=\"'input-checkbox-wrapper'\"\n ></co-input-checkbox>\n </div>\n </div>\n\n <div class=\"print-footer-wrapper\">\n <div class=\"input-number-wrapper\">\n <co-input-number-picker class=\"number-picker\"\n [step]=\"1\" [(model)]=\"sendMethodParams.amount\" [min]=\"1\"\n [ngModelOptions]=\"{debounce: 1}\">\n </co-input-number-picker>\n </div>\n <div class=\"custom-button-wrapper print-button\" (click)=\"handlePrintClicked()\">\n <span [textContent]=\"'Print'\"></span>\n </div>\n <div class=\"custom-button-wrapper signature-button\" (click)=\"handleSignatureStart()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.SignatureField)\"></co-icon>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"printer-content-container\" @slideInOut *ngIf=\"showPrinterSelections\">\n <div class=\"selected-printer-wrapper selection clickable\" *ngFor=\"let printers of printerList\" (click)=\"onPrinterClicked(printers)\">\n <div class=\"printer-option-list-item\">\n <co-icon class=\"printer-icon\" [iconData]=\"iconCacheService.getIcon(icons.PrintRegular)\"></co-icon>\n <div class=\"printer-details\">\n <span class=\"printer-name\" [textContent]=\"printers.name\"></span>\n <span class=\"printer-status\" [textContent]=\"printers.acceptingJobs\"></span>\n </div>\n </div>\n <co-icon class=\"select-printer-arrow\" *ngIf=\"!showPrinterSelections\"\n [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\"></co-icon>\n </div>\n </div>\n </div>\n </co-dialog>\n </div>\n ",
2872
3714
  encapsulation: i0.ViewEncapsulation.None,
2873
3715
  animations: [
2874
3716
  animations.trigger('slideInOut', [
@@ -2892,15 +3734,28 @@
2892
3734
  showPdfOption: [{ type: i0.Input }],
2893
3735
  showXmlOption: [{ type: i0.Input }],
2894
3736
  showPrintPriceStickers: [{ type: i0.Input }],
2895
- showPrintStockStickers: [{ type: i0.Input }],
2896
3737
  priceListCodeData: [{ type: i0.Input }],
3738
+ transactionUUID: [{ type: i0.Input }],
2897
3739
  showDialog: [{ type: i0.Input }],
2898
3740
  headerTitle: [{ type: i0.Input }],
2899
3741
  printerList: [{ type: i0.Input }],
3742
+ relationId: [{ type: i0.Input }],
3743
+ emailAdresses: [{ type: i0.Input }],
3744
+ emailLayouts: [{ type: i0.Input }],
3745
+ printLayouts: [{ type: i0.Input }],
3746
+ defaultSendMethod: [{ type: i0.Input }],
3747
+ defaultEmailAdresses: [{ type: i0.Input }],
3748
+ isDocSignEnabled: [{ type: i0.Input }],
3749
+ docSign: [{ type: i0.Input }],
2900
3750
  articleData: [{ type: i0.Input }],
2901
3751
  startSignatureClicked: [{ type: i0.Output }],
3752
+ sendEmailClicked: [{ type: i0.Output }],
2902
3753
  printButtonClicked: [{ type: i0.Output }],
2903
- showClass: [{ type: i0.HostBinding, args: ["class.ione-send-method-dialog",] }]
3754
+ emailLayoutClicked: [{ type: i0.Output }],
3755
+ showClass: [{ type: i0.HostBinding, args: ["class.ione-send-method-dialog",] }],
3756
+ printTemplatesClicked: [{ type: i0.Output }],
3757
+ defaultSendMethodClicked: [{ type: i0.Output }],
3758
+ printLayoutParams: [{ type: i0.Output }]
2904
3759
  };
2905
3760
 
2906
3761
  var SendMethodDialogModule = /** @class */ (function () {
@@ -2921,7 +3776,9 @@
2921
3776
  corecomponents_v12.IconModule,
2922
3777
  corecomponents_v12.InputNumberPickerModule,
2923
3778
  corecomponents_v12.CoDialogWizardModule,
2924
- corecomponents_v12.ButtonModule
3779
+ corecomponents_v12.ButtonModule,
3780
+ DocsignModule,
3781
+ corecomponents_v12.CoDialogModule
2925
3782
  ],
2926
3783
  exports: [
2927
3784
  SendMethodDialogComponent
@@ -3417,11 +4274,10 @@
3417
4274
  };
3418
4275
  ;
3419
4276
  CoCircularGaugeComponent.prototype.getAnnotations = function () {
3420
- if (this.value !== undefined) {
3421
- var label = this.value ? this.value + "%" : "0%";
4277
+ if (this.value) {
3422
4278
  return [{
3423
4279
  content: '<div class="annotation">' +
3424
- label + '</div>',
4280
+ this.value + '%</div>',
3425
4281
  angle: 90,
3426
4282
  radius: '50%',
3427
4283
  zIndex: '10',
@@ -3592,7 +4448,7 @@
3592
4448
  StatusbarComponent.decorators = [
3593
4449
  { type: i0.Component, args: [{
3594
4450
  selector: "co-statusbar",
3595
- template: "\n <div class=\"co-statusbar-wrapper\"\n *ngIf=\"statusbarData\"\n (mouseover)=\"onHover($event)\"\n (mouseleave)=\"onLeave()\"\n (click)=\"onStatusbarClick()\">\n <div class=\"statuses\">\n <div *ngFor=\"let data of statusbarData; let index = index\" class=\"status\">\n <co-linear-gauge [value]=\"data.percentage\" [count]=\"!!data.count ? data.count : undefined\"></co-linear-gauge>\n </div>\n </div>\n <div class=status-description-popup *ngIf=\"showPopup\" @showHidePopup [ngClass]=\"popupClass\">\n <div class=\"status-descriptions\">\n <div *ngFor=\"let data of statusbarData; let index = index\" class=\"status-description\">\n <co-circular-gauge [value]=\"data.percentage\"></co-circular-gauge>\n <span [textContent]=\"data.label\"></span>\n </div>\n </div>\n </div>\n </div>\n ",
4451
+ template: "\n <div class=\"co-statusbar-wrapper\"\n *ngIf=\"statusbarData\"\n (mouseover)=\"onHover($event)\"\n (mouseleave)=\"onLeave()\"\n (click)=\"onStatusbarClick()\">\n <div class=\"statuses\">\n <div *ngFor=\"let data of statusbarData; let index = index\" class=\"status\">\n <co-linear-gauge [value]=\"data.percentage\" [count]=\"data.count ? data.count : undefined\"></co-linear-gauge>\n </div>\n </div>\n <div class=status-description-popup *ngIf=\"showPopup\" @showHidePopup [ngClass]=\"popupClass\">\n <div class=\"status-descriptions\">\n <div *ngFor=\"let data of statusbarData; let index = index\" class=\"status-description\">\n <co-circular-gauge [value]=\"data.percentage\"></co-circular-gauge>\n <span [textContent]=\"data.label\"></span>\n </div>\n </div>\n </div>\n </div>\n ",
3596
4452
  animations: [
3597
4453
  animations.trigger("showHidePopup", [
3598
4454
  animations.state("void", animations.style({ opacity: 0 })),
@@ -3631,6 +4487,1763 @@
3631
4487
  },] }
3632
4488
  ];
3633
4489
 
4490
+ var DatePlanningComponent = /** @class */ (function () {
4491
+ function DatePlanningComponent(_changeDetector, renderer) {
4492
+ this._changeDetector = _changeDetector;
4493
+ this.renderer = renderer;
4494
+ this.calendarNavigation = false;
4495
+ this.showButton = false;
4496
+ this.buttonLabel = "";
4497
+ this.eventsPerDay = [];
4498
+ this.eventChecked = new i0.EventEmitter();
4499
+ this.selectedDateChange = new i0.EventEmitter();
4500
+ this.rangeChange = new i0.EventEmitter();
4501
+ this.viewChange = new i0.EventEmitter();
4502
+ this.buttonClick = new i0.EventEmitter();
4503
+ this.days = [];
4504
+ this._selectedDate = new Date();
4505
+ }
4506
+ DatePlanningComponent.prototype.doChangeSelectedDate = function (date, rangeChanged) {
4507
+ if (rangeChanged === void 0) { rangeChanged = false; }
4508
+ this.selectedDate = new Date(date);
4509
+ if (rangeChanged) {
4510
+ this.rangeChange.next(this.selectedDate);
4511
+ }
4512
+ else {
4513
+ this.selectedDateChange.next(this.selectedDate);
4514
+ }
4515
+ this._changeDetector.detectChanges();
4516
+ };
4517
+ DatePlanningComponent.prototype.doChangeView = function (view) {
4518
+ this.view = view;
4519
+ this.viewChange.next(this.view);
4520
+ };
4521
+ DatePlanningComponent.prototype.scrollToDayStart = function () {
4522
+ if (this.dayStart !== undefined) {
4523
+ var dayStart_1 = this.renderer.selectRootElement("#dayStart");
4524
+ if (dayStart_1) {
4525
+ setTimeout(function () {
4526
+ dayStart_1.scrollIntoView({ behavior: "instant", block: "center" });
4527
+ });
4528
+ }
4529
+ }
4530
+ };
4531
+ return DatePlanningComponent;
4532
+ }());
4533
+ DatePlanningComponent.decorators = [
4534
+ { type: i0.Component, args: [{
4535
+ selector: "sc-date-planning",
4536
+ template: "\n <div class=\"sc-agenda\">\n <div class=\"content-wrapper\">\n <calendar *ngIf=\"calendarNavigation\"\n [view]=\"view\"\n [(days)]=\"days\"\n [selectedDate]=\"selectedDate\" (selectedDateChange)=\"doChangeSelectedDate($event)\"></calendar>\n <div class=\"agenda-content-wrapper mini-scrollbar\">\n <div class=\"agenda-content\">\n <agenda-header [view]=\"view\" (viewChange)=\"doChangeView($event)\"\n [firstAvailableDate]=\"firstAvailableDate\"\n [eventsPerDay]=\"eventsPerDay\"\n [selectedDate]=\"selectedDate\"\n (selectedDateChange)=\"doChangeSelectedDate($event)\"\n (rangeChange)=\"doChangeSelectedDate($event, true)\"></agenda-header>\n <agenda-view [view]=\"view\"\n [selectedDate]=\"selectedDate\"\n [eventsPerDay]=\"eventsPerDay\"\n (eventChecked)=\"eventChecked.emit($event)\"></agenda-view>\n </div>\n </div>\n </div>\n </div>\n <co-button *ngIf=\"showButton && eventsPerDay.length > 0\" class=\"text-only select-agenda-button\"\n [label]=\"buttonLabel\"\n (click)=\"buttonClick.emit($event)\">\n </co-button>\n ",
4537
+ animations: [
4538
+ animations.trigger("showHideWindow", [
4539
+ animations.state("void", animations.style({ transform: "scaleY(0)" })),
4540
+ animations.state("*", animations.style({ transform: "scaleY(1)" })),
4541
+ animations.transition(":enter, :leave", [
4542
+ animations.animate("200ms ease-in-out")
4543
+ ])
4544
+ ])
4545
+ ],
4546
+ encapsulation: i0.ViewEncapsulation.None
4547
+ },] }
4548
+ ];
4549
+ DatePlanningComponent.ctorParameters = function () { return [
4550
+ { type: i0.ChangeDetectorRef },
4551
+ { type: i0.Renderer2 }
4552
+ ]; };
4553
+ DatePlanningComponent.propDecorators = {
4554
+ calendarNavigation: [{ type: i0.Input }],
4555
+ showButton: [{ type: i0.Input }],
4556
+ selectedDate: [{ type: i0.Input }],
4557
+ firstAvailableDate: [{ type: i0.Input }],
4558
+ buttonLabel: [{ type: i0.Input }],
4559
+ eventsPerDay: [{ type: i0.Input }],
4560
+ view: [{ type: i0.Input }],
4561
+ eventChecked: [{ type: i0.Output }],
4562
+ selectedDateChange: [{ type: i0.Output }],
4563
+ rangeChange: [{ type: i0.Output }],
4564
+ viewChange: [{ type: i0.Output }],
4565
+ buttonClick: [{ type: i0.Output }],
4566
+ dayStart: [{ type: i0.ViewChild, args: ["dayStart", { static: true },] }]
4567
+ };
4568
+
4569
+ var CalendarAllYearsComponent = /** @class */ (function () {
4570
+ function CalendarAllYearsComponent() {
4571
+ this.yearChange = new i0.EventEmitter();
4572
+ this.years = [];
4573
+ }
4574
+ CalendarAllYearsComponent.prototype.ngOnInit = function () {
4575
+ this.years.length = 0;
4576
+ var start = this._determineStart();
4577
+ var end = start + 11;
4578
+ while (start < end) {
4579
+ this.years.push(start);
4580
+ start++;
4581
+ }
4582
+ };
4583
+ CalendarAllYearsComponent.prototype._determineStart = function () {
4584
+ if (this.year > 0) {
4585
+ var thisYear = this.year;
4586
+ var thisYearLastDigit = parseInt(thisYear.toString().split("").pop());
4587
+ while (thisYearLastDigit > 0) {
4588
+ thisYear--;
4589
+ thisYearLastDigit = parseInt(thisYear.toString().split("").pop());
4590
+ }
4591
+ return thisYear;
4592
+ }
4593
+ return 0;
4594
+ };
4595
+ return CalendarAllYearsComponent;
4596
+ }());
4597
+ CalendarAllYearsComponent.decorators = [
4598
+ { type: i0.Component, args: [{
4599
+ selector: "calendar-all-years",
4600
+ template: "\n <div *ngFor=\"let currentYear of years\"\n [textContent]=\"currentYear\"\n [class.selected-year]=\"currentYear === year\"\n class=\"pointer-hover\"\n (click)=\"year = currentYear; yearChange.emit(year)\"\n ></div>\n ",
4601
+ encapsulation: i0.ViewEncapsulation.None
4602
+ },] }
4603
+ ];
4604
+ CalendarAllYearsComponent.ctorParameters = function () { return []; };
4605
+ CalendarAllYearsComponent.propDecorators = {
4606
+ year: [{ type: i0.Input }],
4607
+ yearChange: [{ type: i0.Output }]
4608
+ };
4609
+
4610
+ // All the months. Values are corresponding dictionary keys in text_nl.
4611
+ var Month$1;
4612
+ (function (Month) {
4613
+ Month["January"] = "JANUARY";
4614
+ Month["Februrary"] = "FEBRUARY";
4615
+ Month["March"] = "MARCH";
4616
+ Month["April"] = "APRIL";
4617
+ Month["May"] = "MAY";
4618
+ Month["June"] = "JUNE";
4619
+ Month["July"] = "JULY";
4620
+ Month["August"] = "AUGUST";
4621
+ Month["September"] = "SEPTEMBER";
4622
+ Month["October"] = "OCTOBER";
4623
+ Month["November"] = "NOVEMBER";
4624
+ Month["December"] = "DECEMBER";
4625
+ })(Month$1 || (Month$1 = {}));
4626
+
4627
+ // All the months in a year. The order is important, and should remain January - to December!
4628
+ var ALL_MONTHS = [
4629
+ Month$1.January,
4630
+ Month$1.Februrary,
4631
+ Month$1.March,
4632
+ Month$1.April,
4633
+ Month$1.May,
4634
+ Month$1.June,
4635
+ Month$1.July,
4636
+ Month$1.August,
4637
+ Month$1.September,
4638
+ Month$1.October,
4639
+ Month$1.November,
4640
+ Month$1.December
4641
+ ];
4642
+
4643
+ var CalendarAllMonthsComponent = /** @class */ (function () {
4644
+ function CalendarAllMonthsComponent() {
4645
+ this.shortDescriptions = false;
4646
+ this.monthChange = new i0.EventEmitter();
4647
+ this.months = [];
4648
+ }
4649
+ CalendarAllMonthsComponent.prototype.ngOnInit = function () {
4650
+ this.months.length = 0;
4651
+ this.months = ALL_MONTHS;
4652
+ };
4653
+ return CalendarAllMonthsComponent;
4654
+ }());
4655
+ CalendarAllMonthsComponent.decorators = [
4656
+ { type: i0.Component, args: [{
4657
+ selector: "calendar-all-months",
4658
+ template: "\n <div *ngFor=\"let currentMonth of months; let index = index\"\n [class.selected-month]=\"month === index\"\n [textContent]=\"currentMonth\"\n class=\"pointer-hover\"\n (click)=\"month = index; monthChange.emit(month)\"\n ></div>\n ",
4659
+ encapsulation: i0.ViewEncapsulation.None
4660
+ },] }
4661
+ ];
4662
+ CalendarAllMonthsComponent.ctorParameters = function () { return []; };
4663
+ CalendarAllMonthsComponent.propDecorators = {
4664
+ month: [{ type: i0.Input }],
4665
+ shortDescriptions: [{ type: i0.Input }],
4666
+ monthChange: [{ type: i0.Output }]
4667
+ };
4668
+
4669
+ var CalendarHeaderComponent = /** @class */ (function () {
4670
+ function CalendarHeaderComponent(iconCacheService) {
4671
+ this.iconCacheService = iconCacheService;
4672
+ this.selectedDate = new Date();
4673
+ this.selectedDateChange = new i0.EventEmitter();
4674
+ this.icons = Icon;
4675
+ this.showMonthYearSelect = false;
4676
+ this.expanded = false;
4677
+ }
4678
+ CalendarHeaderComponent.prototype.ngDoCheck = function () {
4679
+ if (this.selectedDate) {
4680
+ this.currentMonth = ALL_MONTHS[this.selectedDate.getMonth()];
4681
+ this.currentYear = this.selectedDate.getFullYear();
4682
+ }
4683
+ };
4684
+ CalendarHeaderComponent.prototype.subMonth = function () {
4685
+ var newDate = new Date(this.selectedDate);
4686
+ newDate.setMonth(newDate.getMonth() - 1);
4687
+ this.selectedDate = newDate;
4688
+ this.selectedDateChange.emit(this.selectedDate);
4689
+ };
4690
+ CalendarHeaderComponent.prototype.addMonth = function () {
4691
+ var newDate = new Date(this.selectedDate);
4692
+ newDate.setMonth(newDate.getMonth() + 1);
4693
+ this.selectedDate = newDate;
4694
+ this.selectedDateChange.emit(this.selectedDate);
4695
+ };
4696
+ CalendarHeaderComponent.prototype.hideMonthYearSelection = function () {
4697
+ this.expanded = false;
4698
+ this.showMonthYearSelect = false;
4699
+ };
4700
+ CalendarHeaderComponent.prototype.setNewMonth = function (month) {
4701
+ this.selectedMonth = month;
4702
+ };
4703
+ CalendarHeaderComponent.prototype.setNewYear = function (year) {
4704
+ this.selectedYear = year;
4705
+ };
4706
+ CalendarHeaderComponent.prototype.changeMonthYear = function () {
4707
+ this.hideMonthYearSelection();
4708
+ var newDate = new Date(this.selectedDate);
4709
+ newDate.setMonth(this.selectedMonth);
4710
+ newDate.setFullYear(this.selectedYear);
4711
+ this.selectedDate = newDate;
4712
+ this.selectedDateChange.emit(this.selectedDate);
4713
+ };
4714
+ return CalendarHeaderComponent;
4715
+ }());
4716
+ CalendarHeaderComponent.decorators = [
4717
+ { type: i0.Component, args: [{
4718
+ selector: "calendar-header",
4719
+ template: "\n <div #monthYearSelect class=\"calendar-header-row\">\n <co-icon class=\"pointer-hover\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subMonth()\"></co-icon>\n <div (click)=\"showMonthYearSelect = true\">\n <div class=\"month\" [textContent]=\"currentMonth\"></div>\n <div class=\"year\" [textContent]=\"currentYear\"></div>\n </div>\n <co-icon class=\"pointer-hover\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addMonth()\"></co-icon>\n </div>\n <ng-template #template>\n <div *ngIf=\"showMonthYearSelect\"\n (clickOutside)=\"hideMonthYearSelection()\"\n class=\"select-month-year-window\" [class.expanded]=\"expanded\" @showMonthYearSelect\n >\n <div>\n <calendar-all-months [month]=\"currentMonth\" (monthChange)=\"setNewMonth($event)\" shortDescriptions></calendar-all-months>\n <div class=\"vertical-divider\"></div>\n <calendar-all-years [year]=\"currentYear\" (yearChange)=\"setNewYear($event)\"></calendar-all-years>\n </div>\n<!-- <default-ok-cancel-buttons-->\n<!-- (okClick)=\"changeMonthYear()\"-->\n<!-- (cancelClick)=\"showMonthYearSelect = false\"-->\n<!-- >-->\n<!-- </default-ok-cancel-buttons>-->\n </div>\n </ng-template>\n ",
4720
+ encapsulation: i0.ViewEncapsulation.None,
4721
+ animations: [
4722
+ animations.trigger("showMonthYearSelect", [
4723
+ animations.state("void", animations.style({
4724
+ "transform-origin": "top center",
4725
+ transform: "scaleY(0)"
4726
+ })),
4727
+ animations.state("*", animations.style({
4728
+ "transform-origin": "top center",
4729
+ transform: "scaleY(1)"
4730
+ })),
4731
+ animations.transition(":enter, :leave", [
4732
+ animations.animate("200ms ease-in-out")
4733
+ ])
4734
+ ])
4735
+ ]
4736
+ },] }
4737
+ ];
4738
+ CalendarHeaderComponent.ctorParameters = function () { return [
4739
+ { type: IconCacheService }
4740
+ ]; };
4741
+ CalendarHeaderComponent.propDecorators = {
4742
+ selectedDate: [{ type: i0.Input }],
4743
+ selectedDateChange: [{ type: i0.Output }]
4744
+ };
4745
+
4746
+ var CalendarView;
4747
+ (function (CalendarView) {
4748
+ CalendarView["DayView"] = "DAY";
4749
+ CalendarView["WeekView"] = "WEEK";
4750
+ CalendarView["WeekSelectView"] = "WEEK_SELECT";
4751
+ CalendarView["MonthView"] = "MONTH";
4752
+ })(CalendarView || (CalendarView = {}));
4753
+
4754
+ var CalendarComponent = /** @class */ (function () {
4755
+ function CalendarComponent() {
4756
+ this.view = CalendarView.WeekView;
4757
+ this.selectedDate = new Date();
4758
+ this.days = [];
4759
+ this.selectedDateChange = new i0.EventEmitter();
4760
+ }
4761
+ CalendarComponent.prototype.changeSelectedDate = function (date) {
4762
+ this.selectedDate = date;
4763
+ this.selectedDateChange.emit(this.selectedDate);
4764
+ };
4765
+ return CalendarComponent;
4766
+ }());
4767
+ CalendarComponent.decorators = [
4768
+ { type: i0.Component, args: [{
4769
+ selector: "calendar",
4770
+ template: "\n <div class=\"sc-calendar\">\n <calendar-header [selectedDate]=\"selectedDate\" (selectedDateChange)=\"changeSelectedDate($event)\"></calendar-header>\n <calendar-view [view]=\"view\" [selectedDate]=\"selectedDate\" (selectedDateChange)=\"changeSelectedDate($event)\"></calendar-view>\n </div>\n ",
4771
+ encapsulation: i0.ViewEncapsulation.None
4772
+ },] }
4773
+ ];
4774
+ CalendarComponent.ctorParameters = function () { return []; };
4775
+ CalendarComponent.propDecorators = {
4776
+ view: [{ type: i0.Input }],
4777
+ selectedDate: [{ type: i0.Input }],
4778
+ days: [{ type: i0.Input }],
4779
+ selectedDateChange: [{ type: i0.Output }]
4780
+ };
4781
+
4782
+ var ArrayNumberPipe = /** @class */ (function () {
4783
+ function ArrayNumberPipe() {
4784
+ }
4785
+ ArrayNumberPipe.prototype.transform = function (length, offset) {
4786
+ if (offset === void 0) { offset = 0; }
4787
+ if (!length || length < 0) {
4788
+ return [];
4789
+ }
4790
+ return Array.from({ length: Math.round(length) }, function (x, i) { return i + offset; });
4791
+ };
4792
+ return ArrayNumberPipe;
4793
+ }());
4794
+ ArrayNumberPipe.decorators = [
4795
+ { type: i0.Pipe, args: [{
4796
+ name: "arrayNumber"
4797
+ },] }
4798
+ ];
4799
+
4800
+ var DateRange = /** @class */ (function () {
4801
+ function DateRange() {
4802
+ }
4803
+ return DateRange;
4804
+ }());
4805
+
4806
+ Date.prototype.toJSON = function () {
4807
+ return moment__namespace(this).format('YYYY-MM-DD[T]HH:mm:ss');
4808
+ };
4809
+ // static utility function holder related to dates
4810
+ var DateUtils = /** @class */ (function () {
4811
+ function DateUtils() {
4812
+ }
4813
+ DateUtils.NowAsString = function () {
4814
+ return DateUtils.ParseDate(new Date(), DateUtils.BACKEND_DATE_FORMAT);
4815
+ };
4816
+ DateUtils.ParseDate = function (date, format) {
4817
+ if (format === void 0) { format = "d-m-y"; }
4818
+ if (!date) {
4819
+ return "";
4820
+ }
4821
+ var day = ("0" + date.getDate()).slice(-2);
4822
+ var month = ("0" + (date.getMonth() + 1)).slice(-2);
4823
+ var year = date.getFullYear() + "";
4824
+ var formatParts = format.split("-");
4825
+ var dateParts = [];
4826
+ for (var i = 0, l = formatParts.length; i < l; i++) {
4827
+ switch (formatParts[i]) {
4828
+ case "d":
4829
+ case "DD":
4830
+ dateParts.push(day);
4831
+ break;
4832
+ case "m":
4833
+ case "MM":
4834
+ dateParts.push(month);
4835
+ break;
4836
+ case "y":
4837
+ case "YYYY":
4838
+ dateParts.push(year);
4839
+ break;
4840
+ default:
4841
+ break;
4842
+ }
4843
+ }
4844
+ return dateParts.join("-");
4845
+ };
4846
+ DateUtils.GetWeekNumber = function (date) {
4847
+ date = new Date(date.getTime());
4848
+ date.setHours(0, 0, 0, 0);
4849
+ date.setDate(date.getDate() + 4 - (date.getDay() || 7));
4850
+ return Math.ceil((((date.getTime() - new Date(date.getFullYear(), 0, 1).getTime()) / 8.64e7) + 1) / 7);
4851
+ };
4852
+ // Returns the number of days from now, for the given date in the future. Returns negative days if given date is in the past from now.
4853
+ DateUtils.GetDaysFromNow = function (date) {
4854
+ return DateUtils.GetDayDifference(new Date(Date.now()), date);
4855
+ };
4856
+ DateUtils.StringAsDate = function (str, format) {
4857
+ if (format === void 0) { format = DateUtils.BACKEND_DATE_FORMAT; }
4858
+ if (notNill(str)) {
4859
+ if (!isNaN(Number(str))) {
4860
+ return new Date(str);
4861
+ }
4862
+ else {
4863
+ var time = moment__namespace(str, format, true);
4864
+ return time.isValid() ? new Date(time) : undefined;
4865
+ }
4866
+ }
4867
+ else {
4868
+ return undefined;
4869
+ }
4870
+ };
4871
+ DateUtils.MomentToDate = function (time) {
4872
+ if (!time || !time.isValid()) {
4873
+ return undefined;
4874
+ }
4875
+ var d = new Date(time.format(DateUtils.BACKEND_DATE_FORMAT));
4876
+ d.setHours(time.hours());
4877
+ d.setMinutes(time.minutes());
4878
+ d.setSeconds(time.seconds());
4879
+ return d;
4880
+ };
4881
+ DateUtils.GetCurrentMonth = function () {
4882
+ return ALL_MONTHS[new Date().getMonth()];
4883
+ };
4884
+ // @returns e.g. ["FEBRUARI", "MARCH", ..] if it's Februari today, otherwise e.g. ["APRIL", "MAY", ...] if it's April today
4885
+ DateUtils.Get12MonthsArrayWithFirstMonthIsCurrentMonth = function () {
4886
+ var answer = [];
4887
+ var monthNrToAdd = new Date().getMonth();
4888
+ for (var i = 0; i < 12; i++) {
4889
+ answer.push(ALL_MONTHS[monthNrToAdd]);
4890
+ monthNrToAdd = (monthNrToAdd + 1) % ALL_MONTHS.length;
4891
+ }
4892
+ return answer;
4893
+ };
4894
+ DateUtils.GetFirstDayOfWeek = function (date) {
4895
+ if (!DateUtils._ValidDate(date)) {
4896
+ return null;
4897
+ }
4898
+ var firstDay;
4899
+ var dayOfWeek = date.getDay() || 7;
4900
+ if (dayOfWeek === 1) {
4901
+ firstDay = new Date(date);
4902
+ }
4903
+ else {
4904
+ firstDay = new Date(date);
4905
+ firstDay.setHours(-24 * (dayOfWeek - 1));
4906
+ }
4907
+ return firstDay;
4908
+ };
4909
+ DateUtils.GetLastDayOfWeek = function (date) {
4910
+ var firstDayOfWeek = DateUtils.GetFirstDayOfWeek(date);
4911
+ var lastDayOfWeek = new Date(firstDayOfWeek);
4912
+ lastDayOfWeek.setDate(firstDayOfWeek.getDate() + 6);
4913
+ return lastDayOfWeek;
4914
+ };
4915
+ DateUtils.GetFirstDayOfMonth = function (date) {
4916
+ if (!DateUtils._ValidDate(date)) {
4917
+ return null;
4918
+ }
4919
+ var year = date.getFullYear();
4920
+ var month = date.getMonth();
4921
+ return new Date(year, month, 1);
4922
+ };
4923
+ DateUtils.GetLastDayOfMonth = function (date) {
4924
+ if (!DateUtils._ValidDate(date)) {
4925
+ return null;
4926
+ }
4927
+ var year = date.getFullYear();
4928
+ var month = date.getMonth();
4929
+ return new Date(year, month + 1, 0);
4930
+ };
4931
+ DateUtils.DatesEqual = function (date1, date2) {
4932
+ var result = false;
4933
+ if (DateUtils._ValidDate(date1) && DateUtils._ValidDate(date2)) {
4934
+ result =
4935
+ date1.getDate() === date2.getDate() &&
4936
+ date1.getMonth() === date2.getMonth() &&
4937
+ date1.getFullYear() === date2.getFullYear();
4938
+ }
4939
+ return result;
4940
+ };
4941
+ DateUtils.DateRangeEqual = function (dates1, dates2) {
4942
+ return (this.DatesEqual(dates1.startDate, dates2.startDate) &&
4943
+ this.DatesEqual(dates1.endDate, dates2.endDate));
4944
+ };
4945
+ DateUtils.AddMinutes = function (date, minutes) {
4946
+ return new Date(date.getTime() + (minutes * 60000));
4947
+ };
4948
+ DateUtils.AddDays = function (date, days) {
4949
+ var result = new Date(date);
4950
+ result.setDate(result.getDate() + days);
4951
+ return result;
4952
+ };
4953
+ DateUtils.AddMonths = function (date, months) {
4954
+ var result = new Date(date);
4955
+ result.setMonth(result.getMonth() + months);
4956
+ return result;
4957
+ };
4958
+ DateUtils.DetermineDSTBreakpoints = function () {
4959
+ var endOfYear = new Date(new Date().getFullYear(), 11, 1);
4960
+ var checkDate = new Date(new Date().getFullYear(), 0, 1);
4961
+ var offset = checkDate.getTimezoneOffset();
4962
+ var periodStart = new Date();
4963
+ var periodStartSet = false;
4964
+ var periodEnd = new Date();
4965
+ var periodEndSet = false;
4966
+ while (checkDate.getTime() < endOfYear.getTime()) {
4967
+ checkDate = this.AddMinutes(checkDate, 60);
4968
+ if (offset < checkDate.getTimezoneOffset()) {
4969
+ periodEnd.setTime(checkDate.getTime());
4970
+ periodEndSet = true;
4971
+ }
4972
+ else if (offset > checkDate.getTimezoneOffset()) {
4973
+ periodStart.setTime(checkDate.getTime());
4974
+ periodStartSet = true;
4975
+ }
4976
+ offset = checkDate.getTimezoneOffset();
4977
+ if (periodStartSet && periodEndSet) {
4978
+ break;
4979
+ }
4980
+ }
4981
+ if (periodStartSet && periodEndSet) {
4982
+ return {
4983
+ start: this._DateToTimeStringWithDateFormat(periodStart),
4984
+ end: this._DateToTimeStringWithDateFormat(periodEnd)
4985
+ };
4986
+ }
4987
+ else {
4988
+ return { start: undefined, end: undefined }; // important otherwise we return new Date() for both
4989
+ }
4990
+ };
4991
+ DateUtils._ValidDate = function (date) {
4992
+ return date !== null && date !== undefined;
4993
+ };
4994
+ /**
4995
+ * Returns the difference between the two given days as the number of days, in float precision (date to - date from).
4996
+ * Returns negative values of the 'from' date is later than in time than the 'to' date.
4997
+ */
4998
+ DateUtils.GetDayDifference = function (from, to) {
4999
+ if (!from || !to) {
5000
+ return NaN;
5001
+ }
5002
+ return ((to.getTime() - from.getTime()) / 1000 / 60 / 60 / 24);
5003
+ };
5004
+ DateUtils.IsSameDay = function (dateOne, dateTwo) {
5005
+ return (dateOne && dateTwo &&
5006
+ dateOne.getDate() === dateTwo.getDate()
5007
+ && dateOne.getMonth() === dateTwo.getMonth()
5008
+ && dateOne.getFullYear() === dateTwo.getFullYear());
5009
+ };
5010
+ DateUtils.IsInBetween = function (date, startDate, endDate, withTime) {
5011
+ if (withTime === void 0) { withTime = true; }
5012
+ if (startDate && endDate) {
5013
+ if (withTime) {
5014
+ return (date > startDate && date < endDate);
5015
+ }
5016
+ else {
5017
+ var dateWithoutTime = new Date(date).setHours(0, 0, 0, 0), dateFromWithoutTime = new Date(startDate).setHours(0, 0, 0, 0), dateToWithoutTime = new Date(endDate).setHours(0, 0, 0, 0);
5018
+ return dateWithoutTime >= dateFromWithoutTime && dateWithoutTime <= dateToWithoutTime;
5019
+ }
5020
+ }
5021
+ };
5022
+ DateUtils.IsMonday = function (date) {
5023
+ return date.getDay() === 1;
5024
+ };
5025
+ DateUtils.IsSunday = function (date) {
5026
+ return date.getDay() === 0;
5027
+ };
5028
+ DateUtils.IsToday = function (date) {
5029
+ var today = new Date();
5030
+ return DateUtils.IsSameDay(today, date);
5031
+ };
5032
+ // Returns date format like it would when using a pipe in the templete, ie: "1 okt. 2020"
5033
+ DateUtils.ParseDateInShortDateFormat = function (date, locale) {
5034
+ this.datePipe = new common.DatePipe(locale);
5035
+ var parsedDate = this.datePipe.transform(date);
5036
+ return parsedDate;
5037
+ };
5038
+ // Transforms a string that is formatted like "'17-08-2014'<=?<='17-08-2021'" into "'17-08-2014' Untill '17-08-2021'"
5039
+ DateUtils.getFormattedDateRangeString = function (dateRangeString, separator) {
5040
+ if (separator === void 0) { separator = " - "; }
5041
+ var newString = dateRangeString;
5042
+ newString = newString.replace("<=?<=", " " + separator + " ");
5043
+ newString = newString.replace(/'/g, "");
5044
+ return newString;
5045
+ };
5046
+ DateUtils.SetDateOrDateRangeObjectHoursZero = function (date) {
5047
+ if (date instanceof DateRange) {
5048
+ if (date.startDate) {
5049
+ date.startDate.setHours(0, 0, 0);
5050
+ }
5051
+ if (date.endDate) {
5052
+ date.endDate.setHours(0, 0, 0);
5053
+ }
5054
+ }
5055
+ else if (!!date && (date instanceof Date)) {
5056
+ date.setHours(0, 0, 0, 0);
5057
+ }
5058
+ };
5059
+ DateUtils._DateToTimeStringWithDateFormat = function (value, dateFormat) {
5060
+ if (dateFormat === void 0) { dateFormat = "d-m-y"; }
5061
+ if (!value) {
5062
+ return "";
5063
+ }
5064
+ var hours = value.getHours() < 10 ? "0" + value.getHours() : "" + value.getHours();
5065
+ var minutes = value.getMinutes() < 10 ? "0" + value.getMinutes() : "" + value.getMinutes();
5066
+ return this.ParseDate(value, dateFormat) + " " + [hours, minutes].join(":");
5067
+ };
5068
+ return DateUtils;
5069
+ }());
5070
+ DateUtils.BACKEND_DATE_FORMAT = 'YYYY-MM-DD[T]HH:mm:ss';
5071
+ DateUtils.datePipe = new common.DatePipe('shortDate');
5072
+
5073
+ //fixme we don't have a todayDayStamp field but our template references it
5074
+ var CalendarViewComponent = /** @class */ (function () {
5075
+ function CalendarViewComponent(_locale) {
5076
+ this._locale = _locale;
5077
+ this.selectedDateChange = new i0.EventEmitter();
5078
+ this.trackByStamp = function (index, stamp) {
5079
+ return stamp && stamp.timestamp || index;
5080
+ };
5081
+ this.trackByWeek = function (index, week) {
5082
+ return week && week[0].week || index;
5083
+ };
5084
+ this.weekDayLabel = [];
5085
+ this.weeks = [];
5086
+ this._selectedDate = new Date();
5087
+ this._view = CalendarView.WeekView;
5088
+ this.selectedDate.setHours(0, 0, 0, 0);
5089
+ this._setLabels();
5090
+ }
5091
+ Object.defineProperty(CalendarViewComponent.prototype, "view", {
5092
+ get: function () {
5093
+ return this._view;
5094
+ },
5095
+ set: function (value) {
5096
+ this._view = value;
5097
+ this._selectDays();
5098
+ },
5099
+ enumerable: false,
5100
+ configurable: true
5101
+ });
5102
+ Object.defineProperty(CalendarViewComponent.prototype, "selectedDate", {
5103
+ get: function () {
5104
+ return this._selectedDate;
5105
+ },
5106
+ set: function (value) {
5107
+ this._selectedDate = value;
5108
+ this._selectedDate.setHours(0, 0, 0, 0);
5109
+ this._prepareWeeks();
5110
+ },
5111
+ enumerable: false,
5112
+ configurable: true
5113
+ });
5114
+ CalendarViewComponent.prototype.onDateClick = function (date) {
5115
+ this.selectedDate = new Date(date.timestamp);
5116
+ this.selectedDateChange.emit(this.selectedDate);
5117
+ this._selectDays();
5118
+ };
5119
+ CalendarViewComponent.prototype._setLabels = function () {
5120
+ var datePipe = new common.DatePipe(this._locale);
5121
+ var currentDay = this.selectedDate.getDay();
5122
+ var startWeekDate = new Date(this.selectedDate.getTime());
5123
+ startWeekDate.setDate(startWeekDate.getDate() - currentDay - 1);
5124
+ this.weekDayLabel = new ArrayNumberPipe().transform(7).map(function () {
5125
+ startWeekDate.setDate(startWeekDate.getDate() + 1);
5126
+ return datePipe.transform(startWeekDate, "E");
5127
+ });
5128
+ this.weekDayLabel.push(this.weekDayLabel.shift());
5129
+ };
5130
+ CalendarViewComponent.prototype._prepareWeeks = function () {
5131
+ this.weeks.length = 0;
5132
+ var date = new Date(this.selectedDate.getTime());
5133
+ date.setHours(0, 0, 0, 0);
5134
+ // go to last day of month
5135
+ date.setMonth(date.getMonth() + 1);
5136
+ date.setDate(0);
5137
+ var monthEndDay = date.getDay();
5138
+ var monthEndDate = date.getDate();
5139
+ // days after end of month
5140
+ var daysAfter = !monthEndDay ? 0 : 7 - monthEndDay;
5141
+ // go to first day of month
5142
+ date.setDate(1);
5143
+ var monthBeginDay = date.getDay();
5144
+ // days before start of month
5145
+ var daysBefore = !monthBeginDay ? 6 : monthBeginDay - 1;
5146
+ // go to start of calendar view
5147
+ date.setDate(-daysBefore + 1);
5148
+ // amount of weeks to display
5149
+ var weekCount = Math.ceil((daysBefore + daysAfter + monthEndDate) / 7);
5150
+ var weekStart = DateUtils.GetWeekNumber(date);
5151
+ var weekEnd = weekStart + weekCount - 1;
5152
+ // iterate over week count
5153
+ for (var i = weekStart; i <= weekEnd; i++) {
5154
+ var week = i;
5155
+ // only recalculate week when it's necessary
5156
+ if (weekStart > 50) {
5157
+ week = DateUtils.GetWeekNumber(date);
5158
+ }
5159
+ var days = [];
5160
+ // iterate over 7 days
5161
+ for (var ii = 1; ii <= 7; ii++) {
5162
+ // check if we are in the current month
5163
+ var inMonth = true;
5164
+ if (i === weekStart) {
5165
+ inMonth = ii > daysBefore;
5166
+ }
5167
+ else if (i === weekEnd) {
5168
+ inMonth = ii <= 7 - daysAfter;
5169
+ }
5170
+ var timestamp = date.getTime();
5171
+ // add dateStamp to date array
5172
+ days.push({
5173
+ week: week,
5174
+ inMonth: inMonth,
5175
+ day: date.getDate(),
5176
+ timestamp: timestamp,
5177
+ selected: this.selectedDate.getTime() === timestamp
5178
+ });
5179
+ // go one day further
5180
+ date.setDate(date.getDate() + 1);
5181
+ }
5182
+ this.weeks.push(days);
5183
+ }
5184
+ this._selectDays();
5185
+ };
5186
+ CalendarViewComponent.prototype._selectDays = function () {
5187
+ this._resetSelection();
5188
+ if (!this.selectedDate) {
5189
+ return;
5190
+ }
5191
+ var weekNumber = DateUtils.GetWeekNumber(this.selectedDate);
5192
+ var len = this.weeks.length;
5193
+ for (var i = 0; i < len; i++) {
5194
+ var leni = this.weeks[i].length;
5195
+ for (var ii = 0; ii < leni; ii++) {
5196
+ if (this.weeks[i][ii].inMonth && this.view === CalendarView.MonthView) {
5197
+ this.weeks[i][ii].selected = true;
5198
+ }
5199
+ else if (this.weeks[i][ii].week === weekNumber && this.view === CalendarView.WeekView) {
5200
+ this.weeks[i][ii].selected = true;
5201
+ }
5202
+ else if (this.weeks[i][ii].timestamp === this.selectedDate.getTime() && this.view === CalendarView.WeekSelectView) {
5203
+ this.weeks[i][ii].selected = true;
5204
+ }
5205
+ else if (this.weeks[i][ii].timestamp === this.selectedDate.getTime() && this.view === CalendarView.DayView) {
5206
+ this.weeks[i][ii].selected = true;
5207
+ }
5208
+ }
5209
+ }
5210
+ };
5211
+ CalendarViewComponent.prototype._resetSelection = function () {
5212
+ var len = this.weeks.length;
5213
+ for (var i = 0; i < len; i++) {
5214
+ var leni = this.weeks[i].length;
5215
+ for (var ii = 0; ii < leni; ii++) {
5216
+ this.weeks[i][ii].selected = false;
5217
+ }
5218
+ }
5219
+ };
5220
+ return CalendarViewComponent;
5221
+ }());
5222
+ CalendarViewComponent.decorators = [
5223
+ { type: i0.Component, args: [{
5224
+ selector: "calendar-view",
5225
+ template: "\n <div class=\"calendar-content\">\n <div>\n <div class=\"week-day-header week-row\">\n <div class=\"week-acronym\"></div>\n <div *ngFor=\"let weekDay of weekDayLabel\" [textContent]=\"weekDay | ucfirst\"\n class=\"week-day-label\"></div>\n </div>\n <div class=\"week-row\" *ngFor=\"let week of weeks;trackBy:trackByWeek\">\n <div [textContent]=\"week[0].week\" class=\"week-number\"></div>\n <div *ngFor=\"let date of week;trackBy:trackByStamp\" class=\"week-day\"\n (click)=\"onDateClick(date)\" [textContent]=\"date.day\">\n </div>\n </div>\n </div>\n </div>\n ",
5226
+ encapsulation: i0.ViewEncapsulation.None
5227
+ },] }
5228
+ ];
5229
+ CalendarViewComponent.ctorParameters = function () { return [
5230
+ { type: exports["ɵr"], decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] }
5231
+ ]; };
5232
+ CalendarViewComponent.propDecorators = {
5233
+ view: [{ type: i0.Input }],
5234
+ selectedDate: [{ type: i0.Input }],
5235
+ selectedDateChange: [{ type: i0.Output }]
5236
+ };
5237
+
5238
+ var Weekday = /** @class */ (function () {
5239
+ function Weekday() {
5240
+ this.inView = true;
5241
+ this.newMonth = false;
5242
+ this.weekdaySelected = false;
5243
+ this.datesByTheHour = [];
5244
+ this.events = [];
5245
+ }
5246
+ return Weekday;
5247
+ }());
5248
+
5249
+ var Week = /** @class */ (function () {
5250
+ function Week() {
5251
+ this.weekDays = [];
5252
+ }
5253
+ return Week;
5254
+ }());
5255
+
5256
+ var CalendarUtils = /** @class */ (function () {
5257
+ function CalendarUtils(_locale) {
5258
+ this._locale = _locale;
5259
+ CalendarUtils.Locale = _locale;
5260
+ }
5261
+ // public static GetCurrentYear(): number {
5262
+ // return this.Now.getFullYear();
5263
+ // }
5264
+ //
5265
+ // public static GetCurrentMonth(): number {
5266
+ // return this.Now.getUTCMonth() + 1;
5267
+ // }
5268
+ CalendarUtils.GetDayHours = function (day) {
5269
+ var datesByTheHour = [];
5270
+ if (day) {
5271
+ var newDate = new Date(day);
5272
+ newDate.setHours(0, 0, 0, 0);
5273
+ datesByTheHour.push(newDate);
5274
+ for (var i = 0; i < 23; i++) {
5275
+ newDate = new Date(newDate);
5276
+ newDate.setHours(newDate.getHours() + 1);
5277
+ datesByTheHour.push(newDate);
5278
+ }
5279
+ }
5280
+ return datesByTheHour;
5281
+ };
5282
+ CalendarUtils.GetDaysOfWeek = function (date) {
5283
+ var day = DateUtils.GetFirstDayOfWeek(date);
5284
+ var daysOfWeek = [];
5285
+ var options;
5286
+ var month;
5287
+ for (var i = 0; i < 7; i++) {
5288
+ var dayPerWeek = new Weekday();
5289
+ var dayHours = CalendarUtils.GetDayHours(day);
5290
+ dayPerWeek.newMonth = day.getMonth() !== month;
5291
+ dayPerWeek.weekdaySelected = day.getDay() === date.getDay();
5292
+ dayPerWeek.weekdayDay = day.getDate();
5293
+ options = { weekday: "short" };
5294
+ dayPerWeek.weekdayShort = day.toLocaleDateString(CalendarUtils.Locale, options);
5295
+ options = { weekday: "long" };
5296
+ dayPerWeek.weekdayLong = day.toLocaleDateString(CalendarUtils.Locale, options);
5297
+ options = { month: "short" };
5298
+ dayPerWeek.weekdayMonthShort = day.toLocaleDateString(CalendarUtils.Locale, options);
5299
+ options = { month: "long" };
5300
+ dayPerWeek.weekdayMonthLong = day.toLocaleDateString(CalendarUtils.Locale, options);
5301
+ dayPerWeek.weekdayYear = day.getFullYear();
5302
+ dayPerWeek.date = new Date(day);
5303
+ dayPerWeek.datesByTheHour = dayHours;
5304
+ daysOfWeek.push(dayPerWeek);
5305
+ month = day.getMonth();
5306
+ day = new Date(day);
5307
+ day.setDate(day.getDate() + 1);
5308
+ }
5309
+ var week = new Week();
5310
+ week.weekDays = daysOfWeek;
5311
+ return week;
5312
+ };
5313
+ return CalendarUtils;
5314
+ }());
5315
+ CalendarUtils.Locale = undefined;
5316
+ CalendarUtils.Now = new Date();
5317
+ CalendarUtils.ctorParameters = function () { return [
5318
+ { type: exports["ɵr"], decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] }
5319
+ ]; };
5320
+
5321
+ var AgendaEvent = /** @class */ (function () {
5322
+ function AgendaEvent() {
5323
+ this.checked = false;
5324
+ this.showCheckbox = false;
5325
+ this.draggable = false;
5326
+ }
5327
+ return AgendaEvent;
5328
+ }());
5329
+
5330
+ var AgendaEventPerDay = /** @class */ (function () {
5331
+ function AgendaEventPerDay() {
5332
+ this.events = [];
5333
+ }
5334
+ return AgendaEventPerDay;
5335
+ }());
5336
+
5337
+ var Month = /** @class */ (function () {
5338
+ function Month() {
5339
+ this.weeks = [];
5340
+ }
5341
+ Object.defineProperty(Month.prototype, "firstWeek", {
5342
+ get: function () {
5343
+ if (this.weeks && this.weeks.length > 0) {
5344
+ return this.weeks[0];
5345
+ }
5346
+ },
5347
+ enumerable: false,
5348
+ configurable: true
5349
+ });
5350
+ return Month;
5351
+ }());
5352
+
5353
+ var Day = /** @class */ (function () {
5354
+ function Day() {
5355
+ this.datesByTheHour = [];
5356
+ this.events = [];
5357
+ }
5358
+ return Day;
5359
+ }());
5360
+
5361
+ var NULL_AGENDA_EVENT = new AgendaEvent();
5362
+ var NULL_AGENDA_EVENT_PER_DAY = new AgendaEventPerDay();
5363
+ var NULL_MONTH = new Month();
5364
+ var NULL_WEEK = new Week();
5365
+ var NULL_DAY = new Day();
5366
+
5367
+ var AgendaHeaderComponent = /** @class */ (function () {
5368
+ function AgendaHeaderComponent(_locale, _elementRef, _renderer, _ngZone, iconCacheService) {
5369
+ var _this = this;
5370
+ this._locale = _locale;
5371
+ this._elementRef = _elementRef;
5372
+ this._renderer = _renderer;
5373
+ this._ngZone = _ngZone;
5374
+ this.iconCacheService = iconCacheService;
5375
+ this.icons = Icon;
5376
+ this.viewTypes = CalendarView;
5377
+ this.scrollbarWidth = 15;
5378
+ this.view = CalendarView.WeekSelectView;
5379
+ this.viewChange = new i0.EventEmitter();
5380
+ this.selectedDateChange = new i0.EventEmitter();
5381
+ this.rangeChange = new i0.EventEmitter();
5382
+ this.weekDays = [];
5383
+ this.day = NULL_DAY;
5384
+ this.showBackButton = true;
5385
+ this._eventsPerDay = [];
5386
+ this._onResize = function () { return __awaiter(_this, void 0, void 0, function () {
5387
+ return __generator(this, function (_a) {
5388
+ this._resizeHost();
5389
+ return [2 /*return*/];
5390
+ });
5391
+ }); };
5392
+ }
5393
+ Object.defineProperty(AgendaHeaderComponent.prototype, "selectedDate", {
5394
+ get: function () {
5395
+ return this._selectedDate;
5396
+ },
5397
+ set: function (value) {
5398
+ this._selectedDate = new Date(value);
5399
+ this._prepareHeaderData();
5400
+ },
5401
+ enumerable: false,
5402
+ configurable: true
5403
+ });
5404
+ Object.defineProperty(AgendaHeaderComponent.prototype, "firstAvailableDate", {
5405
+ get: function () {
5406
+ return this._firstAvailableDate;
5407
+ },
5408
+ set: function (value) {
5409
+ if (value) {
5410
+ this._firstAvailableDate = new Date(value);
5411
+ this._prepareHeaderData();
5412
+ }
5413
+ },
5414
+ enumerable: false,
5415
+ configurable: true
5416
+ });
5417
+ Object.defineProperty(AgendaHeaderComponent.prototype, "eventsPerDay", {
5418
+ set: function (value) {
5419
+ this._eventsPerDay = value;
5420
+ this._prepareHeaderData();
5421
+ },
5422
+ enumerable: false,
5423
+ configurable: true
5424
+ });
5425
+ AgendaHeaderComponent.prototype.ngOnDestroy = function () {
5426
+ window.removeEventListener("resize", this._onResize);
5427
+ this._elementRef = undefined;
5428
+ };
5429
+ AgendaHeaderComponent.prototype.ngOnInit = function () {
5430
+ var _this = this;
5431
+ this._ngZone.runOutsideAngular(function () {
5432
+ window.addEventListener("resize", _this._onResize);
5433
+ });
5434
+ };
5435
+ AgendaHeaderComponent.prototype.ngAfterContentChecked = function () {
5436
+ this._resizeHost();
5437
+ };
5438
+ AgendaHeaderComponent.prototype.subUnit = function () {
5439
+ if (this.selectedDate) {
5440
+ var newDate = new Date(this.selectedDate);
5441
+ switch (this.view) {
5442
+ case CalendarView.DayView:
5443
+ newDate.setDate(this.selectedDate.getDate() - 1);
5444
+ break;
5445
+ case CalendarView.WeekView:
5446
+ newDate.setDate(this.selectedDate.getDate() - 7);
5447
+ break;
5448
+ case CalendarView.WeekSelectView:
5449
+ newDate.setDate(this.selectedDate.getDate() - 7);
5450
+ break;
5451
+ case CalendarView.MonthView:
5452
+ newDate.setMonth(this.selectedDate.getMonth() - 1);
5453
+ break;
5454
+ }
5455
+ this.selectedDate = newDate;
5456
+ this.rangeChange.emit(this.selectedDate);
5457
+ }
5458
+ };
5459
+ AgendaHeaderComponent.prototype.addUnit = function () {
5460
+ if (this.selectedDate) {
5461
+ var newDate = new Date(this.selectedDate);
5462
+ switch (this.view) {
5463
+ case CalendarView.DayView:
5464
+ newDate.setDate(this.selectedDate.getDate() + 1);
5465
+ break;
5466
+ case CalendarView.WeekView:
5467
+ newDate.setDate(this.selectedDate.getDate() + 7);
5468
+ break;
5469
+ case CalendarView.WeekSelectView:
5470
+ newDate.setDate(this.selectedDate.getDate() + 7);
5471
+ break;
5472
+ case CalendarView.MonthView:
5473
+ newDate.setMonth(this.selectedDate.getMonth() + 1);
5474
+ break;
5475
+ }
5476
+ this.selectedDate = newDate;
5477
+ this.rangeChange.emit(this.selectedDate);
5478
+ }
5479
+ };
5480
+ AgendaHeaderComponent.prototype.setUnit = function (weekDay) {
5481
+ this.selectedDate = weekDay.date;
5482
+ this.selectedDateChange.emit(this.selectedDate);
5483
+ };
5484
+ AgendaHeaderComponent.prototype.changeTheView = function (view) {
5485
+ this.view = view;
5486
+ this.viewChange.emit(view);
5487
+ this._prepareHeaderData();
5488
+ };
5489
+ /**
5490
+ * Need to resize the host component to size it's fixed positioned child through css
5491
+ */
5492
+ AgendaHeaderComponent.prototype._resizeHost = function () {
5493
+ if (this._elementRef) {
5494
+ this._renderer.setStyle(this._elementRef.nativeElement, "width", this._elementRef.nativeElement.parentElement.clientWidth - this.scrollbarWidth + "px");
5495
+ }
5496
+ };
5497
+ AgendaHeaderComponent.prototype._prepareHeaderData = function () {
5498
+ var _this = this;
5499
+ if (this.selectedDate) {
5500
+ switch (this.view) {
5501
+ case CalendarView.DayView:
5502
+ var day = new Day();
5503
+ day.date = new Date(this.selectedDate);
5504
+ var options = { year: "numeric", month: "long", day: "numeric" };
5505
+ day.description = this.selectedDate.toLocaleDateString(this._locale, options);
5506
+ this.day = day;
5507
+ break;
5508
+ case CalendarView.WeekView:
5509
+ var weekView = CalendarUtils.GetDaysOfWeek(this.selectedDate);
5510
+ this.weekDays = weekView.weekDays;
5511
+ if (this.firstAvailableDate) {
5512
+ this.showBackButton = this.weekDays.find(function (wd) { return DateUtils.DatesEqual(_this.firstAvailableDate, wd.date); }) === undefined;
5513
+ }
5514
+ break;
5515
+ case CalendarView.WeekSelectView:
5516
+ var weekSelectView = CalendarUtils.GetDaysOfWeek(this.selectedDate);
5517
+ this.weekDays = weekSelectView.weekDays;
5518
+ this.weekDays.forEach(function (wd) {
5519
+ var evPerDay = _this._eventsPerDay && _this._eventsPerDay.length > 0 ? _this._eventsPerDay.find(function (e) { return DateUtils.DatesEqual(e.date, wd.date); }) : null;
5520
+ if (evPerDay) {
5521
+ wd.events = evPerDay.events;
5522
+ }
5523
+ else {
5524
+ wd.weekdaySelected = false;
5525
+ }
5526
+ });
5527
+ if (this.firstAvailableDate) {
5528
+ this.showBackButton = this.weekDays.find(function (wd) { return DateUtils.DatesEqual(_this.firstAvailableDate, wd.date); }) === undefined;
5529
+ }
5530
+ break;
5531
+ case CalendarView.MonthView:
5532
+ var weekOfMonth = CalendarUtils.GetDaysOfWeek(this.selectedDate);
5533
+ this.weekDays = weekOfMonth.weekDays;
5534
+ if (this.firstAvailableDate) {
5535
+ this.showBackButton = this.weekDays.find(function (wd) { return DateUtils.DatesEqual(_this.firstAvailableDate, wd.date); }) === undefined;
5536
+ }
5537
+ break;
5538
+ }
5539
+ }
5540
+ };
5541
+ return AgendaHeaderComponent;
5542
+ }());
5543
+ AgendaHeaderComponent.decorators = [
5544
+ { type: i0.Component, args: [{
5545
+ selector: "agenda-header",
5546
+ template: "\n <div class=\"agenda-header-wrapper\" *ngIf=\"view === viewTypes.DayView\">\n <div class=\"hour-label-placeholder\">\n <view-select [selectedView]=\"view\" (selectedViewChange)=\"changeTheView($event)\"></view-select>\n </div>\n <div class=\"week-day-label\">\n <co-icon class=\"pointer-hover no-user-select sub-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subUnit()\"></co-icon>\n <div class=\"day-description\" [textContent]=\"day.description\"></div>\n <co-icon class=\"pointer-hover no-user-select add-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addUnit()\"></co-icon>\n </div>\n </div>\n <div class=\"agenda-header-wrapper\" *ngIf=\"view === viewTypes.WeekView\">\n <div class=\"hour-label-placeholder\">\n <view-select [selectedView]=\"view\" (selectedViewChange)=\"changeTheView($event)\"></view-select>\n </div>\n <div class=\"week-day-label\" *ngFor=\"let weekDay of weekDays; let index = index\" [class.selected]=\"weekDay.weekdaySelected\" (click)=\"setUnit(weekDay)\">\n <co-icon *ngIf=\"index === 0 && showBackButton\" class=\"pointer-hover no-user-select sub-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subUnit()\"></co-icon>\n <div *ngIf=\"weekDay.newMonth\" [textContent]=\"weekDay.weekdayMonthLong + ' ' + weekDay.weekdayYear\" class=\"month-description\"></div>\n <div class=\"weekday-value\" [textContent]=\"weekDay.weekdayDay\"></div>\n <div class=\"weekday-description\" [textContent]=\"weekDay.weekdayShort\"></div>\n <co-icon *ngIf=\"index === 6\" class=\"pointer-hover no-user-select add-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addUnit()\"></co-icon>\n </div>\n </div>\n <div class=\"agenda-header-wrapper\" *ngIf=\"view === viewTypes.WeekSelectView\">\n <div class=\"week-day-label\" *ngFor=\"let weekDay of weekDays; let index = index\"\n [class.selected]=\"weekDay.weekdaySelected\"\n [class.selectable]=\"weekDay.events && weekDay.events.length > 0\"\n (click)=\"setUnit(weekDay)\">\n <co-icon *ngIf=\"index === 0 && showBackButton\" class=\"pointer-hover no-user-select sub-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subUnit()\"></co-icon>\n <div class=\"weekday-description\" [textContent]=\"weekDay.weekdayShort\"></div>\n <div class=\"weekday-value\" [textContent]=\"weekDay.weekdayDay + ' ' + weekDay.weekdayMonthShort\"></div>\n <co-icon *ngIf=\"index === 6\" class=\"pointer-hover no-user-select add-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addUnit()\"></co-icon>\n </div>\n </div>\n <div class=\"agenda-header-wrapper\" *ngIf=\"view === viewTypes.MonthView\">\n <div class=\"week-day-label\" *ngFor=\"let weekDay of weekDays; let index = index\">\n <co-icon *ngIf=\"index === 0 && showBackButton\" class=\"pointer-hover no-user-select sub-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subUnit()\"></co-icon>\n <div class=\"weekday-description\" [textContent]=\"weekDay.weekdayShort\"></div>\n <co-icon *ngIf=\"index === 6\" class=\"pointer-hover no-user-select add-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addUnit()\"></co-icon>\n </div>\n </div>\n ",
5547
+ encapsulation: i0.ViewEncapsulation.None
5548
+ },] }
5549
+ ];
5550
+ AgendaHeaderComponent.ctorParameters = function () { return [
5551
+ { type: exports["ɵr"], decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] },
5552
+ { type: i0.ElementRef },
5553
+ { type: i0.Renderer2 },
5554
+ { type: i0.NgZone },
5555
+ { type: IconCacheService }
5556
+ ]; };
5557
+ AgendaHeaderComponent.propDecorators = {
5558
+ selectedDate: [{ type: i0.Input }],
5559
+ view: [{ type: i0.Input }],
5560
+ firstAvailableDate: [{ type: i0.Input }],
5561
+ eventsPerDay: [{ type: i0.Input }],
5562
+ viewChange: [{ type: i0.Output }],
5563
+ selectedDateChange: [{ type: i0.Output }],
5564
+ rangeChange: [{ type: i0.Output }]
5565
+ };
5566
+
5567
+ var AgendaViewComponent = /** @class */ (function () {
5568
+ function AgendaViewComponent() {
5569
+ this.view = CalendarView.WeekView;
5570
+ this.eventsPerDay = [];
5571
+ this.eventChecked = new i0.EventEmitter();
5572
+ this.viewTypes = CalendarView;
5573
+ }
5574
+ return AgendaViewComponent;
5575
+ }());
5576
+ AgendaViewComponent.decorators = [
5577
+ { type: i0.Component, args: [{
5578
+ selector: "agenda-view",
5579
+ template: "\n <div class=\"view-wrapper mini-scrollbar\" [ngSwitch]=\"view\">\n <agenda-day-view *ngSwitchCase=\"viewTypes.DayView\"\n [selectedDate]=\"selectedDate\" [eventsPerDay]=\"eventsPerDay\" (eventChecked)=\"eventChecked.emit($event)\"></agenda-day-view>\n <agenda-week-view *ngSwitchCase=\"viewTypes.WeekView\"\n [view]=\"view\" [selectedDate]=\"selectedDate\" [eventsPerDay]=\"eventsPerDay\" (eventChecked)=\"eventChecked.emit($event)\"></agenda-week-view>\n <agenda-week-select-view *ngSwitchCase=\"viewTypes.WeekSelectView\"\n [view]=\"view\" [selectedDate]=\"selectedDate\" [eventsPerDay]=\"eventsPerDay\" (eventChecked)=\"eventChecked.emit($event)\"></agenda-week-select-view>\n <agenda-month-view *ngSwitchCase=\"viewTypes.MonthView\"\n [selectedDate]=\"selectedDate\" [eventsPerDay]=\"eventsPerDay\" (eventChecked)=\"eventChecked.emit($event)\"></agenda-month-view>\n </div>\n ",
5580
+ encapsulation: i0.ViewEncapsulation.None
5581
+ },] }
5582
+ ];
5583
+ AgendaViewComponent.propDecorators = {
5584
+ view: [{ type: i0.Input }],
5585
+ selectedDate: [{ type: i0.Input }],
5586
+ eventsPerDay: [{ type: i0.Input }],
5587
+ eventChecked: [{ type: i0.Output }]
5588
+ };
5589
+
5590
+ var AgendaBaseViewComponent = /** @class */ (function () {
5591
+ function AgendaBaseViewComponent(locale, iconCacheService) {
5592
+ this.locale = locale;
5593
+ this.iconCacheService = iconCacheService;
5594
+ this.eventChecked = new i0.EventEmitter();
5595
+ this._eventsPerDay = [];
5596
+ }
5597
+ Object.defineProperty(AgendaBaseViewComponent.prototype, "selectedDate", {
5598
+ get: function () {
5599
+ return this._selectedDate;
5600
+ },
5601
+ set: function (value) {
5602
+ this._selectedDate = value;
5603
+ this._dateIsSet();
5604
+ },
5605
+ enumerable: false,
5606
+ configurable: true
5607
+ });
5608
+ Object.defineProperty(AgendaBaseViewComponent.prototype, "eventsPerDay", {
5609
+ set: function (value) {
5610
+ this._eventsPerDay = value;
5611
+ this._eventsAreSet();
5612
+ },
5613
+ enumerable: false,
5614
+ configurable: true
5615
+ });
5616
+ Object.defineProperty(AgendaBaseViewComponent.prototype, "eventsPerDate", {
5617
+ get: function () {
5618
+ return this._eventsPerDay;
5619
+ },
5620
+ enumerable: false,
5621
+ configurable: true
5622
+ });
5623
+ //overridable by descendents
5624
+ AgendaBaseViewComponent.prototype.prepareViewData = function () {
5625
+ };
5626
+ AgendaBaseViewComponent.prototype.getEventsFromDate = function (date) {
5627
+ var events = [];
5628
+ if (this.eventsPerDate) {
5629
+ var len = this.eventsPerDate.length;
5630
+ for (var i = 0; i < len; i++) {
5631
+ if (DateUtils.DatesEqual(date, this.eventsPerDate[i].date)) {
5632
+ events = this.eventsPerDate[i].events;
5633
+ break;
5634
+ }
5635
+ }
5636
+ }
5637
+ return events;
5638
+ };
5639
+ AgendaBaseViewComponent.prototype._dateIsSet = function () {
5640
+ this.prepareViewData();
5641
+ };
5642
+ AgendaBaseViewComponent.prototype._eventsAreSet = function () {
5643
+ this.prepareViewData();
5644
+ };
5645
+ return AgendaBaseViewComponent;
5646
+ }());
5647
+ AgendaBaseViewComponent.decorators = [
5648
+ { type: i0.Directive }
5649
+ ];
5650
+ AgendaBaseViewComponent.ctorParameters = function () { return [
5651
+ { type: exports["ɵr"], decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] },
5652
+ { type: IconCacheService }
5653
+ ]; };
5654
+ AgendaBaseViewComponent.propDecorators = {
5655
+ selectedDate: [{ type: i0.Input }],
5656
+ eventsPerDay: [{ type: i0.Input }],
5657
+ eventChecked: [{ type: i0.Output }]
5658
+ };
5659
+
5660
+ var AgendaMonthViewComponent = /** @class */ (function (_super) {
5661
+ __extends(AgendaMonthViewComponent, _super);
5662
+ function AgendaMonthViewComponent() {
5663
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
5664
+ _this.month = NULL_MONTH;
5665
+ _this.firstWeekDays = [];
5666
+ _this.weeks = [];
5667
+ return _this;
5668
+ }
5669
+ AgendaMonthViewComponent.prototype.prepareViewData = function () {
5670
+ var month = new Month();
5671
+ if (this.selectedDate) {
5672
+ var day = DateUtils.GetFirstDayOfMonth(this.selectedDate);
5673
+ var endOfMonth = DateUtils.GetLastDayOfMonth(this.selectedDate);
5674
+ var oneMoreIteration = false;
5675
+ var continueLoop = true;
5676
+ while (continueLoop) {
5677
+ if (oneMoreIteration) {
5678
+ continueLoop = false;
5679
+ }
5680
+ var week = CalendarUtils.GetDaysOfWeek(day);
5681
+ var len = week.weekDays.length;
5682
+ for (var i = 0; i < len; i++) {
5683
+ week.weekDays[i].events = this.getEventsFromDate(week.weekDays[i].date);
5684
+ week.weekDays[i].inView = week.weekDays[i].date.getMonth() === this.selectedDate.getMonth();
5685
+ }
5686
+ month.weeks.push(week);
5687
+ day.setDate(day.getDate() + 7);
5688
+ if (day.getTime() >= endOfMonth.getTime()) {
5689
+ oneMoreIteration = true;
5690
+ }
5691
+ }
5692
+ this.month = month;
5693
+ this.firstWeekDays = this.month.firstWeek.weekDays;
5694
+ this.weeks = month.weeks;
5695
+ }
5696
+ };
5697
+ return AgendaMonthViewComponent;
5698
+ }(AgendaBaseViewComponent));
5699
+ AgendaMonthViewComponent.decorators = [
5700
+ { type: i0.Component, args: [{
5701
+ selector: "agenda-month-view",
5702
+ template: "\n <div class=\"view-wrapper\">\n <div class=\"hour-view-labels-wrapper\"></div>\n <div class=\"weeks\">\n <div class=\"week\" *ngFor=\"let week of weeks\" fxLayout=\"row\">\n <div class=\"week-day\" *ngFor=\"let weekDay of week.weekDays\" [class.not-in-month]=\"!weekDay.inView\">\n <div class=\"day\" [textContent]=\"weekDay.weekdayDay\"></div>\n </div>\n </div>\n </div>\n </div>\n ",
5703
+ encapsulation: i0.ViewEncapsulation.None
5704
+ },] }
5705
+ ];
5706
+
5707
+ var AgendaDayViewComponent = /** @class */ (function (_super) {
5708
+ __extends(AgendaDayViewComponent, _super);
5709
+ function AgendaDayViewComponent() {
5710
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
5711
+ _this.events = [];
5712
+ return _this;
5713
+ }
5714
+ AgendaDayViewComponent.prototype.prepareViewData = function () {
5715
+ if (this.eventsPerDate && this.eventsPerDate.length > 0) {
5716
+ this.events = this.eventsPerDate[0].events;
5717
+ }
5718
+ };
5719
+ return AgendaDayViewComponent;
5720
+ }(AgendaBaseViewComponent));
5721
+ AgendaDayViewComponent.decorators = [
5722
+ { type: i0.Component, args: [{
5723
+ selector: "agenda-day-view",
5724
+ template: "\n <div class=\"view-wrapper\">\n <agenda-hour-view-labels [date]=\"selectedDate\"></agenda-hour-view-labels>\n <agenda-hour-view [date]=\"selectedDate\">\n <agenda-events\n [halfHourHeight]=\"40\"\n [events]=\"events\"\n (eventChecked)=\"eventChecked.emit($event)\"\n ></agenda-events>\n </agenda-hour-view>\n </div>\n ",
5725
+ encapsulation: i0.ViewEncapsulation.None
5726
+ },] }
5727
+ ];
5728
+
5729
+ var AgendaWeekViewComponent = /** @class */ (function (_super) {
5730
+ __extends(AgendaWeekViewComponent, _super); /*implements OnInit, OnDestroy*/
5731
+ function AgendaWeekViewComponent() {
5732
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
5733
+ _this.view = CalendarView.WeekView;
5734
+ _this.week = NULL_WEEK;
5735
+ return _this;
5736
+ }
5737
+ AgendaWeekViewComponent.prototype.prepareViewData = function () {
5738
+ if (this.selectedDate) {
5739
+ // get the events
5740
+ var week = CalendarUtils.GetDaysOfWeek(this.selectedDate);
5741
+ var len = week.weekDays.length;
5742
+ for (var i = 0; i < len; i++) {
5743
+ week.weekDays[i].events = this.getEventsFromDate(week.weekDays[i].date);
5744
+ }
5745
+ this.week = week;
5746
+ }
5747
+ };
5748
+ return AgendaWeekViewComponent;
5749
+ }(AgendaBaseViewComponent /*implements OnInit, OnDestroy*/));
5750
+ AgendaWeekViewComponent.decorators = [
5751
+ { type: i0.Component, args: [{
5752
+ selector: "agenda-week-view",
5753
+ template: "\n <div class=\"view-wrapper\">\n <agenda-hour-view-labels [date]=\"selectedDate\"></agenda-hour-view-labels>\n <div class=\"week-day\" *ngFor=\"let weekDay of week.weekDays\">\n <agenda-hour-view [date]=\"weekDay.date\">\n <agenda-events\n [halfHourHeight]=\"40\"\n [events]=\"weekDay.events\"\n (eventChecked)=\"eventChecked.emit($event)\"\n [view]=\"view\"\n ></agenda-events>\n </agenda-hour-view>\n </div>\n </div>\n ",
5754
+ encapsulation: i0.ViewEncapsulation.None
5755
+ },] }
5756
+ ];
5757
+ AgendaWeekViewComponent.propDecorators = {
5758
+ view: [{ type: i0.Input }]
5759
+ };
5760
+
5761
+ var AgendaWeekSelectViewComponent = /** @class */ (function (_super) {
5762
+ __extends(AgendaWeekSelectViewComponent, _super);
5763
+ function AgendaWeekSelectViewComponent() {
5764
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
5765
+ _this.view = CalendarView.WeekSelectView;
5766
+ _this.week = NULL_WEEK;
5767
+ _this.icons = Icon;
5768
+ return _this;
5769
+ }
5770
+ AgendaWeekSelectViewComponent.prototype.prepareViewData = function () {
5771
+ if (this.selectedDate) {
5772
+ // get the events
5773
+ var week = CalendarUtils.GetDaysOfWeek(this.selectedDate);
5774
+ var len = week.weekDays.length;
5775
+ for (var i = 0; i < len; i++) {
5776
+ week.weekDays[i].events = this.getEventsFromDate(week.weekDays[i].date);
5777
+ }
5778
+ this.week = week;
5779
+ }
5780
+ };
5781
+ return AgendaWeekSelectViewComponent;
5782
+ }(AgendaBaseViewComponent));
5783
+ AgendaWeekSelectViewComponent.decorators = [
5784
+ { type: i0.Component, args: [{
5785
+ selector: "agenda-week-select-view",
5786
+ template: "\n <div class=\"view-wrapper week-select-view\">\n <div class=\"week-day\" *ngFor=\"let weekDay of week.weekDays\">\n <div class=\"week-select-container\" *ngIf=\"weekDay.weekdaySelected\">\n <div class=\"week-select-left\">\n <h3 [textContent]=\"'AGENDA_CHOOSE_DELIVERY_PERIOD'\"></h3>\n <div class=\"week-select-list mini-scrollbar\">\n <agenda-events\n [halfHourHeight]=\"40\"\n [events]=\"weekDay.events\"\n (eventChecked)=\"eventChecked.emit($event)\"\n [view]=\"view\"\n ></agenda-events>\n <div class=\"no-events-banner\" *ngIf=\"weekDay.events.length === 0\">\n <p [textContent]=\"'AGENDA_NO_PERIODS_AVAILABLE'\"></p>\n </div>\n </div>\n </div>\n <div class=\"week-select-right\">\n <h3 [textContent]=\"'AGENDA_FOR_EVERY_PERIOD'\"></h3>\n <ul>\n <li><co-icon [iconData]=\"iconCacheService.getIcon(icons.CheckRound)\" class=\"small action-color moment-icon\"></co-icon><span [textContent]=\"'AGENDA_FOR_EVERY_PERIOD_REASON1'\"></span></li>\n <li><co-icon [iconData]=\"iconCacheService.getIcon(icons.CheckRound)\" class=\"small action-color moment-icon\"></co-icon><span [textContent]=\"'AGENDA_FOR_EVERY_PERIOD_REASON2'\"></span></li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n ",
5787
+ encapsulation: i0.ViewEncapsulation.None
5788
+ },] }
5789
+ ];
5790
+ AgendaWeekSelectViewComponent.propDecorators = {
5791
+ view: [{ type: i0.Input }]
5792
+ };
5793
+
5794
+ var AgendaHourViewComponent = /** @class */ (function () {
5795
+ function AgendaHourViewComponent() {
5796
+ this.datesByTheHour = [];
5797
+ this._date = new Date();
5798
+ }
5799
+ Object.defineProperty(AgendaHourViewComponent.prototype, "date", {
5800
+ get: function () {
5801
+ return this._date;
5802
+ },
5803
+ set: function (value) {
5804
+ this._date = new Date(value);
5805
+ this._prepareViewData();
5806
+ },
5807
+ enumerable: false,
5808
+ configurable: true
5809
+ });
5810
+ // fixme remove ctrl + c, ctrl + v code duplication with AgendaHourViewLabelsComponent._prepareViewData()
5811
+ AgendaHourViewComponent.prototype._prepareViewData = function () {
5812
+ this.datesByTheHour.length = 0;
5813
+ if (this.date) {
5814
+ var newDate = new Date(this.date);
5815
+ newDate.setHours(0, 0, 0, 0);
5816
+ this.datesByTheHour.push(newDate);
5817
+ for (var i = 0; i < 23; i++) {
5818
+ newDate = new Date(newDate);
5819
+ newDate.setHours(newDate.getHours() + 1);
5820
+ this.datesByTheHour.push(newDate);
5821
+ }
5822
+ }
5823
+ };
5824
+ return AgendaHourViewComponent;
5825
+ }());
5826
+ AgendaHourViewComponent.decorators = [
5827
+ { type: i0.Component, args: [{
5828
+ selector: "agenda-hour-view",
5829
+ template: "\n <div class=\"row-per-hour\" *ngFor=\"let dateByTheHour of datesByTheHour\">\n <div fxLayout=\"row\">\n <agenda-hour-cell [date]=\"dateByTheHour\"></agenda-hour-cell>\n </div>\n </div>\n <ng-content></ng-content>\n ",
5830
+ encapsulation: i0.ViewEncapsulation.None
5831
+ },] }
5832
+ ];
5833
+ AgendaHourViewComponent.propDecorators = {
5834
+ date: [{ type: i0.Input }]
5835
+ };
5836
+
5837
+ var AgendaHourCellComponent = /** @class */ (function () {
5838
+ function AgendaHourCellComponent() {
5839
+ this.onlyLabels = false;
5840
+ this.noLabels = false;
5841
+ }
5842
+ Object.defineProperty(AgendaHourCellComponent.prototype, "date", {
5843
+ get: function () {
5844
+ return this._date;
5845
+ },
5846
+ set: function (value) {
5847
+ this._date = value;
5848
+ this._setNextHalfHour();
5849
+ },
5850
+ enumerable: false,
5851
+ configurable: true
5852
+ });
5853
+ AgendaHourCellComponent.prototype._setNextHalfHour = function () {
5854
+ this.datePlushalfHour = new Date(this._date);
5855
+ this.datePlushalfHour.setMinutes(this.datePlushalfHour.getMinutes() + 30);
5856
+ };
5857
+ return AgendaHourCellComponent;
5858
+ }());
5859
+ AgendaHourCellComponent.decorators = [
5860
+ { type: i0.Component, args: [{
5861
+ selector: "agenda-hour-cell",
5862
+ template: "\n <div class=\"row-per-half-hour\">\n <agenda-half-hour-cell [date]=\"date\" [showLabel]=\"onlyLabels && !noLabels\"></agenda-half-hour-cell>\n <agenda-half-hour-cell [date]=\"datePlushalfHour\"></agenda-half-hour-cell>\n </div>\n ",
5863
+ encapsulation: i0.ViewEncapsulation.None
5864
+ },] }
5865
+ ];
5866
+ AgendaHourCellComponent.propDecorators = {
5867
+ onlyLabels: [{ type: i0.Input }],
5868
+ noLabels: [{ type: i0.Input }],
5869
+ date: [{ type: i0.Input }]
5870
+ };
5871
+
5872
+ var AgendaHourViewLabelsComponent = /** @class */ (function () {
5873
+ function AgendaHourViewLabelsComponent() {
5874
+ this.noLabels = false;
5875
+ this.datesByTheHour = [];
5876
+ this._date = new Date();
5877
+ }
5878
+ Object.defineProperty(AgendaHourViewLabelsComponent.prototype, "date", {
5879
+ get: function () {
5880
+ return this._date;
5881
+ },
5882
+ set: function (value) {
5883
+ this._date = new Date(value);
5884
+ this._date.setDate(1);
5885
+ this._date.setMonth(1);
5886
+ this._date.setFullYear(1);
5887
+ this._prepareViewData();
5888
+ },
5889
+ enumerable: false,
5890
+ configurable: true
5891
+ });
5892
+ // fixme remove ctrl + c, ctrl + v code duplication with AgendaHourViewComponent._prepareViewData()
5893
+ AgendaHourViewLabelsComponent.prototype._prepareViewData = function () {
5894
+ this.datesByTheHour.length = 0;
5895
+ if (this.date) {
5896
+ var newDate = new Date(this.date);
5897
+ newDate.setHours(0, 0, 0, 0);
5898
+ this.datesByTheHour.push(newDate);
5899
+ for (var i = 0; i < 23; i++) {
5900
+ newDate = new Date(newDate);
5901
+ newDate.setHours(newDate.getHours() + 1);
5902
+ this.datesByTheHour.push(newDate);
5903
+ }
5904
+ }
5905
+ };
5906
+ return AgendaHourViewLabelsComponent;
5907
+ }());
5908
+ AgendaHourViewLabelsComponent.decorators = [
5909
+ { type: i0.Component, args: [{
5910
+ selector: "agenda-hour-view-labels",
5911
+ template: "\n <div class=\"row-per-hour\" *ngFor=\"let dateByTheHour of datesByTheHour\">\n <div>\n <agenda-hour-cell [date]=\"dateByTheHour\" onlyLabels [noLabels]=\"noLabels\"></agenda-hour-cell>\n </div>\n </div>\n ",
5912
+ encapsulation: i0.ViewEncapsulation.None
5913
+ },] }
5914
+ ];
5915
+ AgendaHourViewLabelsComponent.propDecorators = {
5916
+ date: [{ type: i0.Input }],
5917
+ noLabels: [{ type: i0.Input }]
5918
+ };
5919
+
5920
+ var AgendaHalfHourCellComponent = /** @class */ (function () {
5921
+ function AgendaHalfHourCellComponent(_renderer) {
5922
+ this._renderer = _renderer;
5923
+ this.showLabel = false;
5924
+ this.showCurrentTime = false;
5925
+ this.currentTimeTop = 0;
5926
+ }
5927
+ Object.defineProperty(AgendaHalfHourCellComponent.prototype, "date", {
5928
+ get: function () {
5929
+ return this._date;
5930
+ },
5931
+ set: function (value) {
5932
+ this._date = value;
5933
+ this._checkDate();
5934
+ this._checkWorkingDayStart();
5935
+ },
5936
+ enumerable: false,
5937
+ configurable: true
5938
+ });
5939
+ AgendaHalfHourCellComponent.prototype.ngOnDestroy = function () {
5940
+ this.currentTimeElement = undefined;
5941
+ };
5942
+ AgendaHalfHourCellComponent.prototype._checkDate = function () {
5943
+ var checkDate = new Date();
5944
+ var minutesFrom = this.date.getMinutes();
5945
+ var minutesTo = minutesFrom + 30;
5946
+ if (DateUtils.DatesEqual(this.date, checkDate)) {
5947
+ if (checkDate.getHours() === this.date.getHours() && (checkDate.getMinutes() > minutesFrom && checkDate.getMinutes() < minutesTo)) {
5948
+ this.currentTimeTop = (Math.max(checkDate.getMinutes(), .01) / 60) * 100;
5949
+ this._positionCurrentTime();
5950
+ this.showCurrentTime = true;
5951
+ }
5952
+ }
5953
+ };
5954
+ AgendaHalfHourCellComponent.prototype._checkWorkingDayStart = function () {
5955
+ this.id = (this._date.getHours() === 8 && this._date.getMinutes() === 30) ? "dayStart" : "";
5956
+ };
5957
+ AgendaHalfHourCellComponent.prototype._positionCurrentTime = function () {
5958
+ if (this.currentTimeElement) {
5959
+ this._renderer.setStyle(this.currentTimeElement.nativeElement, "top", this.currentTimeTop + "%");
5960
+ this.currentTimeElement.nativeElement.scrollIntoView();
5961
+ }
5962
+ };
5963
+ return AgendaHalfHourCellComponent;
5964
+ }());
5965
+ AgendaHalfHourCellComponent.decorators = [
5966
+ { type: i0.Component, args: [{
5967
+ selector: "agenda-half-hour-cell",
5968
+ template: "\n <div id=\"{{id}}\" class=\"cell-wrapper\">\n <div *ngIf=\"showLabel\" [class.show]=\"showLabel\" class=\"half-hour-label\">\n <div [textContent]=\"date | date:'HH:mm'\"></div>\n </div>\n <div *ngIf=\"showCurrentTime\" id=\"currentTime\" class=\"current-time\" #currentTime></div>\n <div class=\"content-wrapper\">\n <ng-content></ng-content>\n </div>\n </div>\n ",
5969
+ encapsulation: i0.ViewEncapsulation.None
5970
+ },] }
5971
+ ];
5972
+ AgendaHalfHourCellComponent.ctorParameters = function () { return [
5973
+ { type: i0.Renderer2 }
5974
+ ]; };
5975
+ AgendaHalfHourCellComponent.propDecorators = {
5976
+ currentTimeElement: [{ type: i0.ViewChild, args: ["currentTime",] }],
5977
+ date: [{ type: i0.Input }],
5978
+ showLabel: [{ type: i0.Input }]
5979
+ };
5980
+
5981
+ var AgendaEventsComponent = /** @class */ (function () {
5982
+ function AgendaEventsComponent() {
5983
+ this.viewTypes = CalendarView;
5984
+ this.view = CalendarView.WeekView;
5985
+ this.type = "";
5986
+ this.events = [];
5987
+ this.eventChecked = new i0.EventEmitter();
5988
+ }
5989
+ return AgendaEventsComponent;
5990
+ }());
5991
+ AgendaEventsComponent.decorators = [
5992
+ { type: i0.Component, args: [{
5993
+ selector: "agenda-events",
5994
+ template: "\n <ng-container *ngIf=\"view !== viewTypes.WeekSelectView\">\n <agenda-event\n *ngFor=\"let event of events\"\n [halfHourHeight]=\"halfHourHeight\"\n [event]=\"event\"\n (eventChecked)=\"eventChecked.emit($event)\"\n ></agenda-event>\n </ng-container>\n <ng-container *ngIf=\"view === viewTypes.WeekSelectView\">\n <agenda-select-event\n *ngFor=\"let event of events\"\n [event]=\"event\"\n (eventChecked)=\"eventChecked.emit($event)\"\n ></agenda-select-event>\n </ng-container>\n ",
5995
+ encapsulation: i0.ViewEncapsulation.None
5996
+ },] }
5997
+ ];
5998
+ AgendaEventsComponent.ctorParameters = function () { return []; };
5999
+ AgendaEventsComponent.propDecorators = {
6000
+ view: [{ type: i0.Input }],
6001
+ type: [{ type: i0.Input }],
6002
+ events: [{ type: i0.Input }],
6003
+ halfHourHeight: [{ type: i0.Input }],
6004
+ eventChecked: [{ type: i0.Output }]
6005
+ };
6006
+
6007
+ var AgendaEventComponent = /** @class */ (function () {
6008
+ function AgendaEventComponent(_elementRef, _renderer, iconCacheService) {
6009
+ this._elementRef = _elementRef;
6010
+ this._renderer = _renderer;
6011
+ this.iconCacheService = iconCacheService;
6012
+ this.icons = Icon;
6013
+ this.event = NULL_AGENDA_EVENT;
6014
+ this.eventChecked = new i0.EventEmitter();
6015
+ }
6016
+ AgendaEventComponent.prototype.ngOnDestroy = function () {
6017
+ this._elementRef = undefined;
6018
+ };
6019
+ AgendaEventComponent.prototype.ngOnInit = function () {
6020
+ var hourTo = this.event.from.getHours();
6021
+ var minutesTo = this.event.from.getMinutes();
6022
+ var multiply = hourTo + (minutesTo / 60);
6023
+ var top = multiply * (this.halfHourHeight * 2);
6024
+ this._renderer.setStyle(this._elementRef.nativeElement, "top", top + "px");
6025
+ var hours = Math.abs(this.event.to.getTime() - this.event.from.getTime()) / 3600000;
6026
+ var height = hours * (this.halfHourHeight * 2) - 1;
6027
+ this._renderer.setStyle(this._elementRef.nativeElement, "height", height + "px");
6028
+ };
6029
+ AgendaEventComponent.prototype.checkEvent = function (event) {
6030
+ this.event.checked = !this.event.checked;
6031
+ this.eventChecked.emit(this.event);
6032
+ };
6033
+ return AgendaEventComponent;
6034
+ }());
6035
+ AgendaEventComponent.decorators = [
6036
+ { type: i0.Component, args: [{
6037
+ selector: "agenda-event",
6038
+ template: "\n <div class=\"agenda-event-wrapper\" [class.checkable]=\"event.showCheckbox\" [class.selected]=\"event.checked\" (click)=\"checkEvent($event)\">\n <div [textContent]=\"event.fromToRepresentation\" class=\"event-description\"></div>\n <co-icon *ngIf=\"event.showCheckbox\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" [class.checked]=\"event.checked\"></co-icon>\n </div>\n ",
6039
+ encapsulation: i0.ViewEncapsulation.None
6040
+ },] }
6041
+ ];
6042
+ AgendaEventComponent.ctorParameters = function () { return [
6043
+ { type: i0.ElementRef },
6044
+ { type: i0.Renderer2 },
6045
+ { type: IconCacheService }
6046
+ ]; };
6047
+ AgendaEventComponent.propDecorators = {
6048
+ event: [{ type: i0.Input }],
6049
+ halfHourHeight: [{ type: i0.Input }],
6050
+ eventChecked: [{ type: i0.Output }]
6051
+ };
6052
+
6053
+ // Pipe capable of transforming the first character of a string-value to upper case.
6054
+ var UCfirstPipe = /** @class */ (function () {
6055
+ function UCfirstPipe() {
6056
+ }
6057
+ UCfirstPipe.prototype.transform = function (value) {
6058
+ if (typeof value === "string") {
6059
+ return value.charAt(0).toUpperCase() + value.slice(1);
6060
+ }
6061
+ return value;
6062
+ };
6063
+ return UCfirstPipe;
6064
+ }());
6065
+ UCfirstPipe.decorators = [
6066
+ { type: i0.Pipe, args: [{
6067
+ name: "ucfirst"
6068
+ },] }
6069
+ ];
6070
+
6071
+ var MASTER_PIPES = [
6072
+ ArrayNumberPipe,
6073
+ UCfirstPipe
6074
+ ];
6075
+
6076
+ // <b>Enum</b> Represents the different states of the three way thumb.
6077
+ var ThumbThreeWayState;
6078
+ (function (ThumbThreeWayState) {
6079
+ ThumbThreeWayState[ThumbThreeWayState["Left"] = 0] = "Left";
6080
+ ThumbThreeWayState[ThumbThreeWayState["Middle"] = 1] = "Middle";
6081
+ ThumbThreeWayState[ThumbThreeWayState["Right"] = 2] = "Right";
6082
+ })(ThumbThreeWayState || (ThumbThreeWayState = {}));
6083
+ function NextStateOfThumbThreeWay(state) {
6084
+ switch (state) {
6085
+ case ThumbThreeWayState.Left:
6086
+ return ThumbThreeWayState.Middle;
6087
+ case ThumbThreeWayState.Middle:
6088
+ return ThumbThreeWayState.Right;
6089
+ case ThumbThreeWayState.Right:
6090
+ default:
6091
+ return ThumbThreeWayState.Left;
6092
+ }
6093
+ }
6094
+
6095
+ // Static utility functions holder related to Maps.
6096
+ var MapUtils = /** @class */ (function () {
6097
+ function MapUtils() {
6098
+ }
6099
+ /**
6100
+ * Returns the first key from given map, for which the value filter holds true. Basically a reverse Map.get(key) function.
6101
+ * @param map
6102
+ * @param valueFilter For the first value that returns true for this filter functions, its key will be returned.
6103
+ */
6104
+ MapUtils.FindKeyByValue = function (map, valueFilter) {
6105
+ var _this = this;
6106
+ if (!map || !valueFilter) {
6107
+ return undefined;
6108
+ }
6109
+ var foundKey = undefined;
6110
+ var keyWasFound = false;
6111
+ map.forEach(function (value, key) {
6112
+ if (!keyWasFound && valueFilter.call(_this, value)) {
6113
+ foundKey = key;
6114
+ keyWasFound = true;
6115
+ }
6116
+ });
6117
+ return foundKey;
6118
+ };
6119
+ /**
6120
+ * Inserts given arrayEntry into given map, under given mapKey. What's special here, is that a NEW map entry is created with an array
6121
+ * containing the single [arrayEntry] item, if no entry yet existed.
6122
+ * @param map
6123
+ * @param mapKey
6124
+ * @param arrayEntry
6125
+ */
6126
+ MapUtils.InsertArrayItemIntoMap = function (map, mapKey, arrayEntry) {
6127
+ if (!map) {
6128
+ return;
6129
+ }
6130
+ if (!map.has(mapKey)) {
6131
+ map.set(mapKey, [arrayEntry]);
6132
+ }
6133
+ else {
6134
+ map.get(mapKey).push(arrayEntry);
6135
+ }
6136
+ };
6137
+ return MapUtils;
6138
+ }());
6139
+
6140
+ var ViewSelectComponent = /** @class */ (function () {
6141
+ function ViewSelectComponent() {
6142
+ this._viewsToThumb = new Map([
6143
+ [CalendarView.DayView, ThumbThreeWayState.Left],
6144
+ [CalendarView.WeekView, ThumbThreeWayState.Middle],
6145
+ [CalendarView.MonthView, ThumbThreeWayState.Right]
6146
+ ]);
6147
+ this.selectedView = CalendarView.WeekView;
6148
+ this.selectedViewChange = new i0.EventEmitter();
6149
+ }
6150
+ Object.defineProperty(ViewSelectComponent.prototype, "modelAsThumbState", {
6151
+ get: function () {
6152
+ return this._viewsToThumb.get(this.selectedView);
6153
+ },
6154
+ enumerable: false,
6155
+ configurable: true
6156
+ });
6157
+ ViewSelectComponent.prototype.onThumbStateChange = function (thumbState) {
6158
+ this.selectedView = MapUtils.FindKeyByValue(this._viewsToThumb, function (value) {
6159
+ return (value === thumbState);
6160
+ });
6161
+ this.selectedViewChange.emit(this.selectedView);
6162
+ };
6163
+ return ViewSelectComponent;
6164
+ }());
6165
+ ViewSelectComponent.decorators = [
6166
+ { type: i0.Component, args: [{
6167
+ selector: "view-select",
6168
+ template: "\n <div class=\"select-wrapper\">\n <div [textContent]=\"'DAY'\" class=\"label\"></div>\n <div [textContent]=\"'MONTH'\" class=\"label\"></div>\n </div>\n ",
6169
+ encapsulation: i0.ViewEncapsulation.None
6170
+ },] }
6171
+ ];
6172
+ ViewSelectComponent.ctorParameters = function () { return []; };
6173
+ ViewSelectComponent.propDecorators = {
6174
+ selectedView: [{ type: i0.Input }],
6175
+ selectedViewChange: [{ type: i0.Output }]
6176
+ };
6177
+
6178
+ var AgendaSelectEventComponent = /** @class */ (function () {
6179
+ function AgendaSelectEventComponent(iconCacheService) {
6180
+ this.iconCacheService = iconCacheService;
6181
+ this.icons = Icon;
6182
+ this.event = NULL_AGENDA_EVENT;
6183
+ this.eventChecked = new i0.EventEmitter();
6184
+ }
6185
+ AgendaSelectEventComponent.prototype.checkEvent = function (event) {
6186
+ this.event.checked = !this.event.checked;
6187
+ this.eventChecked.emit(this.event);
6188
+ };
6189
+ return AgendaSelectEventComponent;
6190
+ }());
6191
+ AgendaSelectEventComponent.decorators = [
6192
+ { type: i0.Component, args: [{
6193
+ selector: "agenda-select-event",
6194
+ template: "\n <div class=\"week-select-item\" (click)=\"checkEvent($event)\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" class=\"select-icon action-color\" *ngIf=\"!event.checked\"></co-icon>\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" class=\"select-icon action-color\" *ngIf=\"event.checked\"></co-icon>\n <div class=\"moment-name\">\n <small>{{ event.date | date: 'EEEE d MMMM' | uppercase }}</small>\n <h2>{{ event.description }}</h2>\n </div>\n </div>\n "
6195
+ },] }
6196
+ ];
6197
+ AgendaSelectEventComponent.ctorParameters = function () { return [
6198
+ { type: IconCacheService }
6199
+ ]; };
6200
+ AgendaSelectEventComponent.propDecorators = {
6201
+ event: [{ type: i0.Input }],
6202
+ eventChecked: [{ type: i0.Output }]
6203
+ };
6204
+
6205
+ var DatePlanningModule = /** @class */ (function () {
6206
+ function DatePlanningModule() {
6207
+ }
6208
+ return DatePlanningModule;
6209
+ }());
6210
+ DatePlanningModule.decorators = [
6211
+ { type: i0.NgModule, args: [{
6212
+ imports: [
6213
+ common.CommonModule,
6214
+ corecomponents_v12.InputDatePickerModule,
6215
+ corecomponents_v12.IconModule,
6216
+ corecomponents_v12.ButtonModule,
6217
+ ],
6218
+ declarations: [
6219
+ DatePlanningComponent,
6220
+ CalendarAllYearsComponent,
6221
+ CalendarAllMonthsComponent,
6222
+ CalendarHeaderComponent,
6223
+ CalendarComponent,
6224
+ CalendarViewComponent,
6225
+ AgendaHeaderComponent,
6226
+ AgendaViewComponent,
6227
+ AgendaMonthViewComponent,
6228
+ AgendaDayViewComponent,
6229
+ AgendaWeekViewComponent,
6230
+ AgendaWeekSelectViewComponent,
6231
+ AgendaHourViewComponent,
6232
+ AgendaHourCellComponent,
6233
+ AgendaHourViewLabelsComponent,
6234
+ AgendaHalfHourCellComponent,
6235
+ AgendaEventsComponent,
6236
+ AgendaEventComponent,
6237
+ ViewSelectComponent,
6238
+ AgendaSelectEventComponent,
6239
+ MASTER_PIPES
6240
+ ],
6241
+ exports: [
6242
+ DatePlanningComponent
6243
+ ]
6244
+ },] }
6245
+ ];
6246
+
3634
6247
  var SharedService = /** @class */ (function () {
3635
6248
  function SharedService(options, connector) {
3636
6249
  this.options = options;
@@ -3674,6 +6287,8 @@
3674
6287
  exports.CoCircularGaugeModule = CoCircularGaugeModule;
3675
6288
  exports.CoLinearGaugeComponent = CoLinearGaugeComponent;
3676
6289
  exports.CoLinearGaugeModule = CoLinearGaugeModule;
6290
+ exports.DatePlanningComponent = DatePlanningComponent;
6291
+ exports.DatePlanningModule = DatePlanningModule;
3677
6292
  exports.DocsignComponent = DocsignComponent;
3678
6293
  exports.DocsignModule = DocsignModule;
3679
6294
  exports.KeyPadComponent = KeyPadComponent;
@@ -3689,6 +6304,16 @@
3689
6304
  exports.StockModule = StockModule;
3690
6305
  exports["ɵa"] = SignatureComponent;
3691
6306
  exports["ɵb"] = SignaturesComponent;
6307
+ exports["ɵba"] = AgendaHourCellComponent;
6308
+ exports["ɵbb"] = AgendaHourViewLabelsComponent;
6309
+ exports["ɵbc"] = AgendaHalfHourCellComponent;
6310
+ exports["ɵbd"] = AgendaEventsComponent;
6311
+ exports["ɵbe"] = AgendaEventComponent;
6312
+ exports["ɵbf"] = ViewSelectComponent;
6313
+ exports["ɵbg"] = AgendaSelectEventComponent;
6314
+ exports["ɵbh"] = MASTER_PIPES;
6315
+ exports["ɵbi"] = ArrayNumberPipe;
6316
+ exports["ɵbj"] = UCfirstPipe;
3692
6317
  exports["ɵc"] = StockService;
3693
6318
  exports["ɵd"] = SharedConnectorService;
3694
6319
  exports["ɵe"] = OptionsService;
@@ -3699,6 +6324,19 @@
3699
6324
  exports["ɵj"] = StockLocationComponent;
3700
6325
  exports["ɵk"] = StockTransferComponent;
3701
6326
  exports["ɵl"] = StockChangeAmountComponent;
6327
+ exports["ɵm"] = CalendarAllYearsComponent;
6328
+ exports["ɵn"] = CalendarAllMonthsComponent;
6329
+ exports["ɵo"] = CalendarHeaderComponent;
6330
+ exports["ɵp"] = CalendarComponent;
6331
+ exports["ɵq"] = CalendarViewComponent;
6332
+ exports["ɵs"] = AgendaHeaderComponent;
6333
+ exports["ɵt"] = AgendaViewComponent;
6334
+ exports["ɵu"] = AgendaMonthViewComponent;
6335
+ exports["ɵv"] = AgendaBaseViewComponent;
6336
+ exports["ɵw"] = AgendaDayViewComponent;
6337
+ exports["ɵx"] = AgendaWeekViewComponent;
6338
+ exports["ɵy"] = AgendaWeekSelectViewComponent;
6339
+ exports["ɵz"] = AgendaHourViewComponent;
3702
6340
 
3703
6341
  Object.defineProperty(exports, '__esModule', { value: true });
3704
6342