@colijnit/catalog 12.1.25 → 12.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/README.md +10 -14
  2. package/bundles/colijnit-catalog.umd.js +2290 -1709
  3. package/bundles/colijnit-catalog.umd.js.map +1 -1
  4. package/colijnit-catalog.d.ts +34 -33
  5. package/colijnit-catalog.metadata.json +1 -1
  6. package/esm2015/colijnit-catalog.js +35 -34
  7. package/esm2015/lib/cache/cache-field.js +75 -0
  8. package/esm2015/lib/cache/parameter-cache-field.js +54 -0
  9. package/esm2015/lib/cache/service/business-object-cache-manager.service.js +150 -0
  10. package/esm2015/lib/cache/service/select-multiple-cache.service.js +38 -0
  11. package/esm2015/lib/cache/service/select-multiple-parameterized-cache.service.js +47 -0
  12. package/esm2015/lib/cache/service/select-single-cache.service.js +30 -0
  13. package/esm2015/lib/cache/service/select-single-parameterized-cache.service.js +47 -0
  14. package/esm2015/lib/catalog-version.js +10 -0
  15. package/esm2015/lib/component/base/article-base.component.js +152 -0
  16. package/esm2015/lib/component/base/catalog-search-base.component.js +23 -0
  17. package/esm2015/lib/component/catalog-article-list/catalog-article-list.component.js +86 -0
  18. package/esm2015/lib/component/catalog-article-list/catalog-article-list.module.js +26 -0
  19. package/esm2015/lib/component/catalog-article-tile/catalog-article-tile.component.js +75 -0
  20. package/esm2015/lib/component/catalog-article-tile/catalog-article-tile.module.js +27 -0
  21. package/esm2015/lib/component/catalog-categories/catalog-categories.component.js +92 -0
  22. package/esm2015/lib/component/catalog-categories/catalog-categories.module.js +26 -0
  23. package/esm2015/lib/component/catalog-external-source/catalog-external-source.component.js +57 -0
  24. package/esm2015/lib/component/catalog-external-source/catalog-external-source.module.js +19 -0
  25. package/esm2015/lib/component/catalog-external-sources/catalog-external-sources.component.js +52 -0
  26. package/esm2015/lib/component/catalog-external-sources/catalog-external-sources.module.js +25 -0
  27. package/esm2015/lib/component/catalog-filter/catalog-filter.component.js +190 -0
  28. package/esm2015/lib/component/catalog-filter/catalog-filter.module.js +29 -0
  29. package/esm2015/lib/component/catalog-navigation/catalog-navigation.component.js +200 -0
  30. package/esm2015/lib/component/catalog-navigation/catalog-navigation.module.js +27 -0
  31. package/esm2015/lib/component/catalog-search/catalog-search.component.js +106 -0
  32. package/esm2015/lib/component/catalog-search/catalog-search.module.js +33 -0
  33. package/esm2015/lib/component/catalog-search-header/catalog-search-header.component.js +36 -0
  34. package/esm2015/lib/component/catalog-search-header/catalog-search-header.module.js +21 -0
  35. package/esm2015/lib/component/catalog-search-result-list/catalog-search-result-list.component.js +44 -0
  36. package/esm2015/lib/component/catalog-search-result-list/catalog-search-result-list.module.js +27 -0
  37. package/esm2015/lib/component/catalog-search-result-tile/catalog-search-result-tile.component.js +62 -0
  38. package/esm2015/lib/component/catalog-search-result-tile/catalog-search-result-tile.module.js +27 -0
  39. package/esm2015/lib/component/responsive-text/responsive-text.component.js +24 -0
  40. package/esm2015/lib/component/responsive-text/responsive-text.module.js +19 -0
  41. package/esm2015/lib/directive/visibility-observer-master.directive.js +49 -0
  42. package/esm2015/lib/directive/visibility-observer.directive.js +55 -0
  43. package/esm2015/lib/directive/visibility-observer.module.js +18 -0
  44. package/esm2015/lib/enum/icon.enum.js +25 -0
  45. package/esm2015/lib/enum/language-code.enum.js +8 -0
  46. package/esm2015/lib/interface/order-by.interface.js +2 -0
  47. package/esm2015/lib/model/articles-search-result.js +3 -0
  48. package/esm2015/lib/model/external-source-viewmodel.js +7 -0
  49. package/esm2015/lib/model/filter-item.viewmodel.js +10 -0
  50. package/esm2015/lib/model/filter-viewmodel.js +12 -0
  51. package/esm2015/lib/model/icon.js +24 -0
  52. package/esm2015/lib/model/settings-options.js +20 -0
  53. package/esm2015/lib/model/settings.js +10 -0
  54. package/esm2015/lib/pipe/localize.pipe.js +27 -0
  55. package/esm2015/lib/service/catalog-connector-adapter.service.js +332 -0
  56. package/esm2015/lib/service/catalog-connector.service.js +142 -0
  57. package/esm2015/lib/service/catalog-event.service.js +19 -0
  58. package/esm2015/lib/service/catalog-filter.service.js +91 -0
  59. package/esm2015/lib/service/catalog-image.service.js +124 -0
  60. package/esm2015/lib/service/catalog-options.service.js +92 -0
  61. package/esm2015/lib/service/catalog-search.service.js +167 -0
  62. package/esm2015/lib/service/catalog-settings.service.js +111 -0
  63. package/esm2015/lib/service/catalog.service.js +305 -0
  64. package/esm2015/lib/service/dictionary.service.js +90 -0
  65. package/esm2015/lib/service/icon-cache.service.js +40 -0
  66. package/esm2015/lib/utils/json.utils.js +22 -0
  67. package/esm2015/public_api.js +15 -3
  68. package/fesm2015/colijnit-catalog.js +2262 -1380
  69. package/fesm2015/colijnit-catalog.js.map +1 -1
  70. package/lib/cache/cache-field.d.ts +25 -0
  71. package/lib/cache/parameter-cache-field.d.ts +11 -0
  72. package/lib/cache/service/business-object-cache-manager.service.d.ts +58 -0
  73. package/lib/cache/service/select-multiple-cache.service.d.ts +15 -0
  74. package/lib/cache/service/select-multiple-parameterized-cache.service.d.ts +19 -0
  75. package/lib/cache/service/select-single-cache.service.d.ts +12 -0
  76. package/lib/cache/service/select-single-parameterized-cache.service.d.ts +18 -0
  77. package/{app/components/catalog/article-card/article-card.component.d.ts → lib/component/base/article-base.component.d.ts} +20 -16
  78. package/lib/component/base/catalog-search-base.component.d.ts +8 -0
  79. package/lib/component/catalog-article-list/catalog-article-list.component.d.ts +4 -0
  80. package/lib/component/catalog-article-list/catalog-article-list.module.d.ts +2 -0
  81. package/lib/component/catalog-article-list/style/_layout.scss +463 -0
  82. package/lib/component/catalog-article-list/style/_material-definition.scss +9 -0
  83. package/lib/component/catalog-article-list/style/_theme.scss +4 -0
  84. package/lib/component/catalog-article-list/style/material.scss +4 -0
  85. package/lib/component/catalog-article-tile/catalog-article-tile.component.d.ts +4 -0
  86. package/lib/component/catalog-article-tile/catalog-article-tile.module.d.ts +2 -0
  87. package/lib/component/catalog-article-tile/style/_layout.scss +693 -0
  88. package/lib/component/catalog-article-tile/style/_material-definition.scss +11 -0
  89. package/lib/component/catalog-article-tile/style/_theme.scss +4 -0
  90. package/lib/component/catalog-article-tile/style/material.scss +4 -0
  91. package/lib/component/catalog-categories/catalog-categories.component.d.ts +19 -0
  92. package/lib/component/catalog-categories/catalog-categories.module.d.ts +2 -0
  93. package/lib/component/catalog-categories/style/_layout.scss +109 -0
  94. package/lib/component/catalog-categories/style/_material-definition.scss +29 -0
  95. package/lib/component/catalog-categories/style/_theme.scss +14 -0
  96. package/lib/component/catalog-categories/style/material.scss +5 -0
  97. package/lib/component/catalog-external-source/catalog-external-source.component.d.ts +18 -0
  98. package/lib/component/catalog-external-source/catalog-external-source.module.d.ts +2 -0
  99. package/lib/component/catalog-external-source/style/_layout.scss +51 -0
  100. package/lib/component/catalog-external-source/style/_material-definition.scss +0 -0
  101. package/lib/component/catalog-external-source/style/_theme.scss +4 -0
  102. package/lib/component/catalog-external-source/style/material.scss +4 -0
  103. package/lib/component/catalog-external-sources/catalog-external-sources.component.d.ts +12 -0
  104. package/lib/component/catalog-external-sources/catalog-external-sources.module.d.ts +2 -0
  105. package/lib/component/catalog-external-sources/style/_layout.scss +63 -0
  106. package/lib/component/catalog-external-sources/style/_material-definition.scss +18 -0
  107. package/lib/component/catalog-external-sources/style/_theme.scss +12 -0
  108. package/lib/component/catalog-external-sources/style/material.scss +5 -0
  109. package/lib/component/catalog-filter/catalog-filter.component.d.ts +40 -0
  110. package/lib/component/catalog-filter/catalog-filter.module.d.ts +2 -0
  111. package/lib/component/catalog-filter/style/_layout.scss +52 -0
  112. package/lib/component/catalog-filter/style/_material-definition.scss +8 -0
  113. package/lib/component/catalog-filter/style/_theme.scss +17 -0
  114. package/lib/component/catalog-filter/style/material.scss +4 -0
  115. package/lib/component/catalog-navigation/catalog-navigation.component.d.ts +51 -0
  116. package/lib/component/catalog-navigation/catalog-navigation.module.d.ts +2 -0
  117. package/lib/component/catalog-navigation/style/_layout.scss +515 -0
  118. package/lib/component/catalog-navigation/style/_material-definition.scss +21 -0
  119. package/lib/component/catalog-navigation/style/_theme.scss +4 -0
  120. package/lib/component/catalog-navigation/style/material.scss +4 -0
  121. package/lib/component/catalog-search/catalog-search.component.d.ts +25 -0
  122. package/lib/component/catalog-search/catalog-search.module.d.ts +2 -0
  123. package/lib/component/catalog-search/style/_layout.scss +30 -0
  124. package/lib/component/catalog-search/style/_material-definition.scss +2 -0
  125. package/lib/component/catalog-search/style/_theme.scss +4 -0
  126. package/lib/component/catalog-search/style/material.scss +4 -0
  127. package/lib/component/catalog-search-header/catalog-search-header.component.d.ts +7 -0
  128. package/lib/component/catalog-search-header/catalog-search-header.module.d.ts +2 -0
  129. package/lib/component/catalog-search-header/style/_layout.scss +12 -0
  130. package/lib/component/catalog-search-header/style/_material-definition.scss +4 -0
  131. package/lib/component/catalog-search-header/style/_theme.scss +4 -0
  132. package/lib/component/catalog-search-header/style/material.scss +4 -0
  133. package/lib/component/catalog-search-result-list/catalog-search-result-list.component.d.ts +4 -0
  134. package/lib/component/catalog-search-result-list/catalog-search-result-list.module.d.ts +2 -0
  135. package/lib/component/catalog-search-result-list/style/_layout.scss +4 -0
  136. package/lib/component/catalog-search-result-list/style/_material-definition.scss +0 -0
  137. package/lib/component/catalog-search-result-list/style/_theme.scss +4 -0
  138. package/lib/component/catalog-search-result-list/style/material.scss +4 -0
  139. package/lib/component/catalog-search-result-tile/catalog-search-result-tile.component.d.ts +12 -0
  140. package/lib/component/catalog-search-result-tile/catalog-search-result-tile.module.d.ts +2 -0
  141. package/lib/component/catalog-search-result-tile/style/_layout.scss +16 -0
  142. package/lib/component/catalog-search-result-tile/style/_material-definition.scss +0 -0
  143. package/lib/component/catalog-search-result-tile/style/_theme.scss +4 -0
  144. package/lib/component/catalog-search-result-tile/style/material.scss +4 -0
  145. package/lib/component/responsive-text/responsive-text.component.d.ts +4 -0
  146. package/lib/component/responsive-text/responsive-text.module.d.ts +2 -0
  147. package/lib/component/responsive-text/style/_layout.scss +9 -0
  148. package/lib/component/responsive-text/style/_material-definition.scss +0 -0
  149. package/lib/component/responsive-text/style/_theme.scss +4 -0
  150. package/lib/component/responsive-text/style/material.scss +4 -0
  151. package/lib/directive/visibility-observer.module.d.ts +2 -0
  152. package/{app → lib}/model/settings-options.d.ts +2 -0
  153. package/{app/service/i-one-controller.service.d.ts → lib/service/catalog-connector-adapter.service.d.ts} +4 -5
  154. package/lib/service/catalog-connector.service.d.ts +42 -0
  155. package/{app/service/app-event.service.d.ts → lib/service/catalog-event.service.d.ts} +2 -2
  156. package/{app/service/filter.service.d.ts → lib/service/catalog-filter.service.d.ts} +3 -3
  157. package/{app/service/image.service.d.ts → lib/service/catalog-image.service.d.ts} +3 -3
  158. package/{app/service/options.service.d.ts → lib/service/catalog-options.service.d.ts} +3 -3
  159. package/lib/service/catalog-search.service.d.ts +46 -0
  160. package/{app/service/settings.service.d.ts → lib/service/catalog-settings.service.d.ts} +3 -5
  161. package/{app → lib}/service/catalog.service.d.ts +20 -24
  162. package/{app → lib}/service/dictionary.service.d.ts +0 -3
  163. package/lib/style/_mixin.scss +15 -0
  164. package/lib/style/_variables.scss +10 -0
  165. package/lib/style/catalog-globals.scss +3 -0
  166. package/lib/utils/json.utils.d.ts +3 -0
  167. package/package.json +2 -2
  168. package/public_api.d.ts +14 -2
  169. package/app/base/base-component.d.ts +0 -2
  170. package/app/components/catalog/catalog/catalog.component.d.ts +0 -11
  171. package/app/components/catalog/catalog-external/catalog-external.component.d.ts +0 -19
  172. package/app/components/catalog/catalog-filter/catalog-filter.component.d.ts +0 -40
  173. package/app/components/catalog/catalog-home/catalog-home.component.d.ts +0 -15
  174. package/app/components/catalog/catalog-page/catalog-page.component.d.ts +0 -41
  175. package/app/components/catalog/filter-items/filter-items.component.d.ts +0 -20
  176. package/app/components/core/icon-handle/icon-handle.component.d.ts +0 -14
  177. package/app/components/core/label-field/label-field.component.d.ts +0 -4
  178. package/app/components/left-content/left-content.component.d.ts +0 -4
  179. package/app/components/main-content/main-content.component.d.ts +0 -4
  180. package/app/components/navigation/navigation.component.d.ts +0 -29
  181. package/app/components/top-content/top-content.component.d.ts +0 -16
  182. package/app/enum/level-indicator-level.enum.d.ts +0 -5
  183. package/app/interface/filter-item.d.ts +0 -7
  184. package/app/ione-catalog.component.d.ts +0 -46
  185. package/app/ione-catalog.module.d.ts +0 -4
  186. package/app/layout.directive.d.ts +0 -20
  187. package/app/pipe/greater-than-zero.pipe.d.ts +0 -4
  188. package/app/service/app-initializer.service.d.ts +0 -6
  189. package/app/service/navigation.service.d.ts +0 -27
  190. package/app/style/_scrollbars.mixins.scss +0 -18
  191. package/app/style/_variables.scss +0 -17
  192. package/app/style/catalog-globals.scss +0 -94
  193. package/app/utils/json-utils.service.d.ts +0 -3
  194. package/app/utils/string-utils.d.ts +0 -6
  195. package/app/utils/utils.service.d.ts +0 -21
  196. package/esm2015/app/base/base-component.js +0 -3
  197. package/esm2015/app/catalog-version.js +0 -10
  198. package/esm2015/app/components/catalog/article-card/article-card.component.js +0 -137
  199. package/esm2015/app/components/catalog/catalog/catalog.component.js +0 -32
  200. package/esm2015/app/components/catalog/catalog-external/catalog-external.component.js +0 -54
  201. package/esm2015/app/components/catalog/catalog-filter/catalog-filter.component.js +0 -142
  202. package/esm2015/app/components/catalog/catalog-home/catalog-home.component.js +0 -39
  203. package/esm2015/app/components/catalog/catalog-page/catalog-page.component.js +0 -124
  204. package/esm2015/app/components/catalog/filter-items/filter-items.component.js +0 -48
  205. package/esm2015/app/components/core/icon-handle/icon-handle.component.js +0 -32
  206. package/esm2015/app/components/core/label-field/label-field.component.js +0 -18
  207. package/esm2015/app/components/left-content/left-content.component.js +0 -13
  208. package/esm2015/app/components/main-content/main-content.component.js +0 -13
  209. package/esm2015/app/components/navigation/navigation.component.js +0 -94
  210. package/esm2015/app/components/top-content/top-content.component.js +0 -46
  211. package/esm2015/app/directive/visibility-observer-master.directive.js +0 -49
  212. package/esm2015/app/directive/visibility-observer.directive.js +0 -55
  213. package/esm2015/app/enum/icon.enum.js +0 -25
  214. package/esm2015/app/enum/language-code.enum.js +0 -8
  215. package/esm2015/app/enum/level-indicator-level.enum.js +0 -7
  216. package/esm2015/app/interface/filter-item.js +0 -2
  217. package/esm2015/app/interface/order-by.interface.js +0 -2
  218. package/esm2015/app/ione-catalog.component.js +0 -120
  219. package/esm2015/app/ione-catalog.module.js +0 -119
  220. package/esm2015/app/layout.directive.js +0 -68
  221. package/esm2015/app/model/articles-search-result.js +0 -3
  222. package/esm2015/app/model/external-source-viewmodel.js +0 -7
  223. package/esm2015/app/model/filter-item.viewmodel.js +0 -10
  224. package/esm2015/app/model/filter-viewmodel.js +0 -12
  225. package/esm2015/app/model/icon.js +0 -24
  226. package/esm2015/app/model/settings-options.js +0 -18
  227. package/esm2015/app/model/settings.js +0 -10
  228. package/esm2015/app/pipe/greater-than-zero.pipe.js +0 -16
  229. package/esm2015/app/pipe/localize.pipe.js +0 -27
  230. package/esm2015/app/service/app-event.service.js +0 -19
  231. package/esm2015/app/service/app-initializer.service.js +0 -25
  232. package/esm2015/app/service/catalog.service.js +0 -273
  233. package/esm2015/app/service/dictionary.service.js +0 -90
  234. package/esm2015/app/service/filter.service.js +0 -86
  235. package/esm2015/app/service/i-one-controller.service.js +0 -329
  236. package/esm2015/app/service/icon-cache.service.js +0 -35
  237. package/esm2015/app/service/image.service.js +0 -119
  238. package/esm2015/app/service/navigation.service.js +0 -80
  239. package/esm2015/app/service/options.service.js +0 -86
  240. package/esm2015/app/service/settings.service.js +0 -108
  241. package/esm2015/app/utils/json-utils.service.js +0 -26
  242. package/esm2015/app/utils/string-utils.js +0 -37
  243. package/esm2015/app/utils/utils.service.js +0 -111
  244. /package/{app → lib}/catalog-version.d.ts +0 -0
  245. /package/{app → lib}/directive/visibility-observer-master.directive.d.ts +0 -0
  246. /package/{app → lib}/directive/visibility-observer.directive.d.ts +0 -0
  247. /package/{app → lib}/enum/icon.enum.d.ts +0 -0
  248. /package/{app → lib}/enum/language-code.enum.d.ts +0 -0
  249. /package/{app → lib}/interface/order-by.interface.d.ts +0 -0
  250. /package/{app → lib}/model/articles-search-result.d.ts +0 -0
  251. /package/{app → lib}/model/external-source-viewmodel.d.ts +0 -0
  252. /package/{app → lib}/model/filter-item.viewmodel.d.ts +0 -0
  253. /package/{app → lib}/model/filter-viewmodel.d.ts +0 -0
  254. /package/{app → lib}/model/icon.d.ts +0 -0
  255. /package/{app → lib}/model/settings.d.ts +0 -0
  256. /package/{app → lib}/pipe/localize.pipe.d.ts +0 -0
  257. /package/{app → lib}/service/icon-cache.service.d.ts +0 -0
@@ -1,25 +1,28 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, Input, ChangeDetectorRef, ViewChild, HostBinding, ContentChildren, Renderer2, ElementRef, EventEmitter, Output, HostListener, Pipe, Directive, TemplateRef, ViewContainerRef, ViewEncapsulation, ComponentFactoryResolver, NgModule, APP_INITIALIZER } from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, ViewEncapsulation, Input, Output, HostBinding, ChangeDetectorRef, ViewChild, Pipe, NgModule, Directive, HostListener, ElementRef, Renderer2 } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
3
4
  import { __awaiter } from 'tslib';
4
- import { BehaviorSubject, Subject } from 'rxjs';
5
- import { ArticleExtended } from '@colijnit/articleapi/build/model/article-extended.bo';
5
+ import { Subject, BehaviorSubject } from 'rxjs';
6
+ import { StringUtils } from '@colijnit/ioneconnector/build/utils/string-utils';
6
7
  import { ArticleCategory } from '@colijnit/articleapi/build/model/article-category';
7
8
  import { CatalogDefinition } from '@colijnit/articleapi/build/model/catalog-definition.bo';
8
- import { Articles } from '@colijnit/articleapi/build/articles';
9
9
  import { ExternalSource } from '@colijnit/articleapi/build/model/external-source.bo';
10
+ import { BusinessObjectFactory } from '@colijnit/ioneconnector/build/factory/business-object-factory';
11
+ import { Articles } from '@colijnit/articleapi/build/articles';
12
+ import { ArticleExtended } from '@colijnit/articleapi/build/model/article-extended.bo';
10
13
  import { ArticleSearchFilterSelections } from '@colijnit/articleapi/build/model/article-search-filter-selections';
11
14
  import { ArticleSearchFilterMaxAndMinPrice } from '@colijnit/articleapi/build/model/article-search-filter-max-and-min-price';
12
15
  import { ArticlePrice } from '@colijnit/articleapi/build/model/article-price';
13
16
  import { GetArticlePriceRequest } from '@colijnit/articleapi/build/model/get-article-price-request';
14
- import { BusinessObjectFactory } from '@colijnit/ioneconnector/build/factory/business-object-factory';
17
+ import { ObjectUtils } from '@colijnit/ioneconnector/build/utils/object-utils';
15
18
  import { FileUtils } from '@colijnit/ioneconnector/build/utils/file-utils';
19
+ import { ArticleExtendedRequest } from '@colijnit/articleapi/build/model/article-extended-request';
16
20
  import { PagingParameters } from '@colijnit/ioneconnector/build/model/paging-parameters';
17
- import { DomSanitizer } from '@angular/platform-browser';
21
+ import { InputTextModule, FilterItemModule, InputDatePickerModule, IconCollapseHandleModule, ImageModule, IconModule as IconModule$1, OverlayModule, InputSearchModule, PaginationBarModule } from '@colijnit/corecomponents_v12';
18
22
  import { trigger, state, style, transition, animate } from '@angular/animations';
19
- import { SliderComponent, PaginationComponent, PaginationModule, CardModule, ButtonModule, LevelIndicatorModule, ImageModule, IconModule, PriceDisplayPipeModule, InputYesNoModule, SliderModule, InputTextChipsModule, InputCheckboxModule } from '@colijnit/corecomponents';
20
- import { SimpleGridColumnDirective, InputTextModule, FilterItemModule, InputDatePickerModule, SimpleGridModule, PaginationBarModule } from '@colijnit/corecomponents_v12';
21
- import { CommonModule } from '@angular/common';
22
- import { FormsModule } from '@angular/forms';
23
+ import { SliderComponent, IconModule, PriceDisplayPipeModule, ButtonModule, ImageModule as ImageModule$1 } from '@colijnit/corecomponents';
24
+ import * as i1 from '@angular/platform-browser';
25
+ import { DomSanitizer } from '@angular/platform-browser';
23
26
 
24
27
  // this file is dynamically created, do not change this
25
28
  class Version {
@@ -31,11 +34,253 @@ class Version {
31
34
  }
32
35
  }
33
36
 
37
+ class SettingsOptions {
38
+ constructor() {
39
+ this.showAddToCart = true;
40
+ this.showPriceFilter = true;
41
+ this.showLookAtArticleButton = true;
42
+ this.showStockIndication = false;
43
+ this.lookAtArticleButtonText = 'LOOKAT';
44
+ this.stockButtonText = 'STOCK';
45
+ this.showAddArticleButton = true;
46
+ this.showARButton = false;
47
+ this.maxItemsPerPage = 20;
48
+ this.addArticleButtonText = 'ADD TO CART';
49
+ this.collapseFilterByDefault = false;
50
+ this.sortTurnoverGroupsByAlphabet = true;
51
+ this.searchOnStart = false;
52
+ this.showFilter = false;
53
+ this.showNavigation = false;
54
+ }
55
+ }
56
+
57
+ class Settings {
58
+ constructor() {
59
+ this.session = undefined;
60
+ this.useEncryption = true;
61
+ this.type = "V";
62
+ this.options = new SettingsOptions();
63
+ }
64
+ }
65
+
66
+ var LanguageCode;
67
+ (function (LanguageCode) {
68
+ LanguageCode["Dutch"] = "nl-NL";
69
+ LanguageCode["English"] = "en-GB";
70
+ LanguageCode["German"] = "de-DE";
71
+ LanguageCode["French"] = "fr-FR";
72
+ })(LanguageCode || (LanguageCode = {}));
73
+
74
+ class JsonUtils {
75
+ static ReadJsonFile(filePath) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ try {
78
+ const response = yield fetch(filePath);
79
+ if (!response.ok) {
80
+ console.error('Error getting translation:', response.statusText);
81
+ return '';
82
+ }
83
+ else {
84
+ return response.json();
85
+ }
86
+ }
87
+ catch (e) {
88
+ console.error('Error getting translation:', e.message);
89
+ return '';
90
+ }
91
+ });
92
+ }
93
+ }
94
+
95
+ // The localization service, providing peers with text translation functionality.
96
+ class DictionaryService {
97
+ constructor() {
98
+ this.dictionaryUrl = 'js/browser/res/dictionary/';
99
+ this.dictionaryLoaded = new Subject();
100
+ this._dictionaryPromise = new Map();
101
+ this._dictionaries = new Map();
102
+ // Some dictionary values have one or more '|~' texts in them, meant to be replaced with client-side given texts.
103
+ this._placeholder = '|~';
104
+ }
105
+ get language() {
106
+ return this._language;
107
+ }
108
+ set rootUrl(value) {
109
+ this._rootUrl = value;
110
+ this._dictBasePath = this._rootUrl + '/' + this.dictionaryUrl;
111
+ }
112
+ getLanguageCode(lc) {
113
+ for (const key in LanguageCode) {
114
+ if (LanguageCode[key] === lc) {
115
+ return lc;
116
+ }
117
+ }
118
+ return LanguageCode.Dutch;
119
+ }
120
+ // Loads the dictionary for given language in memory.
121
+ setDictionary(language, additionalTranslationFile) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ this._language = language;
124
+ if (!this._dictionaryPromise.has(language)) {
125
+ this._dictionaryPromise.set(language, JsonUtils.ReadJsonFile(additionalTranslationFile ?
126
+ additionalTranslationFile :
127
+ this._dictBasePath + 'text_' + language.substr(0, 2).toLowerCase() + '.properties.json')
128
+ .then((data) => {
129
+ this._dictionaries.set(language, data);
130
+ this.dictionaryLoaded.next();
131
+ return data;
132
+ }));
133
+ }
134
+ else {
135
+ this.dictionaryLoaded.next();
136
+ }
137
+ yield this._dictionaryPromise.get(language);
138
+ });
139
+ }
140
+ /**
141
+ * Returns the localized text for the given dictionary key.
142
+ * @param {string} key
143
+ * @param {boolean} [upperCaseFirst = true] False for first letter lowercase, true for first letter uppercase for returned dict val
144
+ * @param {string[]} replacementTexts Rest params for replacement of '|~' in returned dict value
145
+ * @returns {string} The translated text for given dictionary key
146
+ */
147
+ get(key, upperCaseFirst = true, ...replacementTexts) {
148
+ if (!StringUtils.IsStringWithLength(key)) {
149
+ return key || '';
150
+ }
151
+ else if (!this._dictionaryLoaded(this._language)) {
152
+ return key;
153
+ }
154
+ let text = this._dictionaries.get(this._language)[key];
155
+ text = StringUtils.IsStringWithLength(text) ? text : key;
156
+ if (upperCaseFirst) {
157
+ text = text.charAt(0).toUpperCase() + text.slice(1);
158
+ }
159
+ else {
160
+ text = text.charAt(0).toLowerCase() + text.slice(1);
161
+ }
162
+ if (replacementTexts.length > 0) {
163
+ text = StringUtils.ReplaceOccurrencesIn(text, this._placeholder, ...replacementTexts);
164
+ }
165
+ return text;
166
+ }
167
+ _dictionaryLoaded(language) {
168
+ return this._dictionaries.has(language);
169
+ }
170
+ }
171
+ DictionaryService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DictionaryService_Factory() { return new DictionaryService(); }, token: DictionaryService, providedIn: "root" });
172
+ DictionaryService.decorators = [
173
+ { type: Injectable, args: [{
174
+ providedIn: 'root'
175
+ },] }
176
+ ];
177
+
178
+ class CatalogSettingsService {
179
+ constructor(_dictionaryService) {
180
+ this._dictionaryService = _dictionaryService;
181
+ this.settingsLoaded = new BehaviorSubject(false);
182
+ this._settings = new Settings();
183
+ }
184
+ set settings(value) {
185
+ this._settings = value;
186
+ }
187
+ get settings() {
188
+ return this._settings;
189
+ }
190
+ initializeSettings(settings) {
191
+ return __awaiter(this, void 0, void 0, function* () {
192
+ // see if there's a json file for application settings
193
+ if (typeof settings === 'undefined') {
194
+ const jsonSettings = yield JsonUtils.ReadJsonFile('catalog-settings.json');
195
+ this.settings = Object.assign(new Settings(), jsonSettings);
196
+ this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
197
+ this.settingsFinished();
198
+ }
199
+ else {
200
+ this.settings = Object.assign(new Settings(), settings);
201
+ this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
202
+ this.settingsFinished();
203
+ }
204
+ });
205
+ }
206
+ createSettingsFromObject(obj) {
207
+ return __awaiter(this, void 0, void 0, function* () {
208
+ if (!this.settings) {
209
+ this.settings = new Settings();
210
+ }
211
+ if (obj.hasOwnProperty('url')) {
212
+ this.settings.url = obj['url'];
213
+ }
214
+ if (obj.hasOwnProperty('schema')) {
215
+ this.settings.schema = obj['schema'];
216
+ }
217
+ if (obj.hasOwnProperty('version')) {
218
+ this.settings.version = obj['version'];
219
+ }
220
+ if (obj.hasOwnProperty('branch')) {
221
+ this.settings.branch = obj['branch'];
222
+ }
223
+ if (obj.hasOwnProperty('currency')) {
224
+ this.settings.currency = obj['currency'];
225
+ }
226
+ if (obj.hasOwnProperty('languageCode')) {
227
+ this.settings.languageCode = obj['languageCode'];
228
+ }
229
+ if (obj.hasOwnProperty('username')) {
230
+ this.settings.username = obj['username'];
231
+ }
232
+ if (obj.hasOwnProperty('password')) {
233
+ this.settings.password = obj['password'];
234
+ }
235
+ if (obj.hasOwnProperty('timeoutInMs')) {
236
+ this.settings.timeoutInMs = obj['timeoutInMs'];
237
+ }
238
+ if (obj.hasOwnProperty('session')) {
239
+ this.settings.session = obj['session'];
240
+ }
241
+ if (obj.hasOwnProperty('useEncryption')) {
242
+ this.settings.useEncryption = obj['useEncryption'];
243
+ }
244
+ if (obj.hasOwnProperty('additionalTranslationFile')) {
245
+ this.settings.additionalTranslationFile = obj['additionalTranslationFile'];
246
+ }
247
+ if (obj.hasOwnProperty('type')) {
248
+ this.settings.type = obj['type'];
249
+ }
250
+ if (obj.hasOwnProperty('options')) {
251
+ Object.assign(this.settings.options, obj['options']);
252
+ }
253
+ if (obj.hasOwnProperty('catalogParameters')) {
254
+ this.settings.catalogParameters = obj['catalogParameters'];
255
+ }
256
+ this.settingsFinished();
257
+ });
258
+ }
259
+ settingsFinished() {
260
+ return __awaiter(this, void 0, void 0, function* () {
261
+ this._dictionaryService.rootUrl = this.settings.url.replace('/ajaxservice', '');
262
+ if (!this.settings.additionalTranslationFile) {
263
+ const languageCode = this._dictionaryService.getLanguageCode(this.settings.languageCode);
264
+ yield this._dictionaryService.setDictionary(languageCode);
265
+ }
266
+ this.settingsLoaded.next(true);
267
+ });
268
+ }
269
+ }
270
+ CatalogSettingsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogSettingsService_Factory() { return new CatalogSettingsService(i0.ɵɵinject(DictionaryService)); }, token: CatalogSettingsService, providedIn: "root" });
271
+ CatalogSettingsService.decorators = [
272
+ { type: Injectable, args: [{
273
+ providedIn: 'root'
274
+ },] }
275
+ ];
276
+ CatalogSettingsService.ctorParameters = () => [
277
+ { type: DictionaryService }
278
+ ];
279
+
34
280
  class ArticlesSearchResult {
35
281
  }
36
282
 
37
- // Holds all iONE backend related state and methods for a running HomeDecorator. To be used anywhere internally.
38
- class IOneControllerService {
283
+ class CatalogConnectorAdapterService {
39
284
  constructor() {
40
285
  this.controllerInitialized = new BehaviorSubject(false);
41
286
  this.connectorOptions = {};
@@ -345,401 +590,552 @@ class IOneControllerService {
345
590
  this._shouldShowLoader = showLoader;
346
591
  }
347
592
  }
348
- IOneControllerService.decorators = [
349
- { type: Injectable }
593
+ CatalogConnectorAdapterService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogConnectorAdapterService_Factory() { return new CatalogConnectorAdapterService(); }, token: CatalogConnectorAdapterService, providedIn: "root" });
594
+ CatalogConnectorAdapterService.decorators = [
595
+ { type: Injectable, args: [{
596
+ providedIn: "root"
597
+ },] }
350
598
  ];
351
599
 
352
- class UtilsService {
600
+ // Class represents a value that is to be loaded only once, lazily, by its .loadFunction, despite how many times or how fast its getValue() is called.
601
+ class CacheField {
353
602
  constructor() {
354
- this.MAX_DIMENSION = 1200;
355
- }
356
- resizeImage(image) {
357
- const ratio = Math.min(this.MAX_DIMENSION / image.width, this.MAX_DIMENSION / image.height);
358
- const canvas = document.createElement('canvas');
359
- canvas.width = Math.trunc(image.width * ratio);
360
- canvas.height = Math.trunc(image.height * ratio);
361
- const ctx = canvas.getContext('2d');
362
- ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height);
363
- const newSrc = canvas.toDataURL('image/jpeg'); // or png
364
- return newSrc;
365
- }
366
- readAndResizePhotoAsDataURL(file) {
367
- const image = new Image();
368
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
369
- image.onload = () => {
370
- const newSrc = this.resizeImage(image);
371
- resolve(newSrc);
372
- };
373
- image.onerror = error => reject(error);
374
- image.src = yield this.readFileAsDataURL(file);
375
- }));
603
+ this.onLoad = new EventEmitter();
604
+ this._isLoaded = false;
376
605
  }
377
- readFileAsDataURL(file) {
378
- const fileReader = new FileReader();
379
- return new Promise((resolve, reject) => {
380
- fileReader.onload = (e) => resolve(e.target.result);
381
- fileReader.onerror = error => reject(error);
382
- fileReader.readAsDataURL(file);
383
- });
384
- }
385
- readFileAsText(file) {
386
- const fileReader = new FileReader();
387
- return new Promise((resolve, reject) => {
388
- fileReader.onload = (e) => resolve(e.target.result);
389
- fileReader.onerror = error => reject(error);
390
- fileReader.readAsText(file);
391
- });
392
- }
393
- loadImage(src, resize = true) {
394
- const image = new Image();
395
- return new Promise((resolve, reject) => {
396
- image.onload = () => {
397
- if (resize) {
398
- const resizedImage = new Image();
399
- resizedImage.onload = () => resolve(resizedImage);
400
- resizedImage.onerror = error => reject(error);
401
- const resizedImageSrc = this.resizeImage(image);
402
- resizedImage.src = resizedImageSrc;
403
- }
404
- else {
405
- resolve(image);
406
- }
407
- };
408
- image.onerror = error => reject(error);
409
- image.src = src;
410
- });
606
+ // The value of this cache field. Warning: might not have been loaded yet. Call ensureLoaded() or getvalue() for true value.
607
+ get value() {
608
+ return this._value;
411
609
  }
412
- /**
413
- * Returns a new function that is a throttled version of given function func. Enforces that there is a always minimum amount of time
414
- * between two subsequent calls of the function. Tail calls are always executed. In-between calls are lost and not executed.
415
- *
416
- * @param func The function to return as a throttled version
417
- * @param throttleMs Number of milliseconds for throttle: the minimum time between any two subsequent function calls of function
418
- * @param [thisArg] Optionally supply the this context of the caller
419
- * @returns The given function, with the above-mentioned time constraints
420
- */
421
- getAsThrottledFunction(func, throttleMs = 250, thisArg) {
422
- let lastCallTime;
423
- let deferTimer;
424
- return function () {
425
- const context = thisArg || this;
426
- const now = +new Date;
427
- const args = arguments;
428
- if (lastCallTime && now < lastCallTime + throttleMs) {
429
- clearTimeout(deferTimer);
430
- deferTimer = window.setTimeout(function () {
431
- lastCallTime = now;
432
- func.apply(context, args);
433
- }, throttleMs);
434
- }
435
- else {
436
- lastCallTime = now;
437
- func.apply(context, args);
438
- }
439
- };
610
+ set value(value) {
611
+ this._value = value;
612
+ this._promiseValue = Promise.resolve(value);
613
+ this._isLoaded = true;
440
614
  }
441
- readJsonFile(filePath) {
442
- return __awaiter(this, void 0, void 0, function* () {
443
- const response = yield fetch(filePath);
444
- if (!response.ok) {
445
- throw new Error(response.statusText);
446
- }
447
- return response.json();
448
- });
615
+ // Whether the value has been loaded or not.
616
+ get isLoaded() {
617
+ return this._isLoaded;
449
618
  }
450
- forceChangeDetection(cd, component, propName) {
451
- const value = component[propName];
452
- component[propName] = null;
453
- cd.detectChanges();
454
- component[propName] = value;
619
+ // Whether the value is currently loading or not.
620
+ get isLoading() {
621
+ return !this._isLoaded && (this._promiseValue !== null && this._promiseValue !== undefined);
455
622
  }
456
- }
457
- UtilsService.decorators = [
458
- { type: Injectable }
459
- ];
460
-
461
- var LanguageCode;
462
- (function (LanguageCode) {
463
- LanguageCode["Dutch"] = "nl-NL";
464
- LanguageCode["English"] = "en-GB";
465
- LanguageCode["German"] = "de-DE";
466
- LanguageCode["French"] = "fr-FR";
467
- })(LanguageCode || (LanguageCode = {}));
468
-
469
- // Static utility functions holder related to strings.
470
- class StringUtils {
471
- static ReplaceOccurrencesIn(source, placeholder, ...replacementTexts) {
472
- // parameter guards
473
- if (!(source)) {
474
- return undefined;
623
+ get loadNeverCalled() {
624
+ return !this.isLoading && !this.isLoaded;
625
+ }
626
+ // Loads and returns the value. Only loads from db if it wasn't loaded before (or forceReload was given true)
627
+ getValue(forceReload) {
628
+ return this.ensureLoaded(forceReload);
629
+ }
630
+ setValue(value) {
631
+ this.value = value;
632
+ }
633
+ /**
634
+ * POSTCONDITION: The .value of this cache field contains the loaded value as fetched by the resolve data of its .loadFunction.
635
+ * Will load only once, consecutive calls will resolve immediately or wait until the first original database fetch was finished.
636
+ * @returns {Promise<any>} Postcondition holds after resolve
637
+ */
638
+ ensureLoaded(forceReload) {
639
+ if (!forceReload && this._promiseValue) {
640
+ return this._promiseValue;
475
641
  }
476
- if (!placeholder || replacementTexts.length === 0) {
477
- return source;
642
+ else {
643
+ return this._load();
478
644
  }
479
- let outString = source;
480
- // one replacementText means replace for all
481
- if (replacementTexts.length === 1) {
482
- // "g" is the g flag to replace globally
483
- outString = outString.replace(new RegExp(this._escapeRegExp(placeholder), 'g'), replacementTexts[0]);
645
+ }
646
+ // POSTCONDITION: The .value of this cache field contains a freshly loaded value as fetched by the resolve data of its loadFunction.
647
+ reload() {
648
+ return this.ensureLoaded(true);
649
+ }
650
+ // Resets / invaldates this cache field. Makes sure that the next load() will really perform its load function body again (e.g. visit the DB,
651
+ // if that's ur function)
652
+ reset() {
653
+ this._value = undefined;
654
+ this._promiseValue = undefined;
655
+ this._isLoaded = false;
656
+ }
657
+ _load() {
658
+ if (this.loadFunction) {
659
+ this._promiseValue = this.loadFunction.call(this);
660
+ this._promiseValue.then((value) => {
661
+ this._value = value;
662
+ this._isLoaded = true;
663
+ this.onLoad.emit();
664
+ return value;
665
+ });
666
+ return this._promiseValue;
484
667
  }
485
668
  else {
486
- // replace occurence i by replacementTexts[i], one at a time in loop (there might be a faster way..)
487
- for (let i = 0, len = replacementTexts.length; i < len; i++) {
488
- outString = outString.replace(placeholder, replacementTexts[i]);
489
- }
669
+ return Promise.resolve(undefined);
490
670
  }
491
- return outString;
492
671
  }
493
- static IsString(str) {
494
- return typeof str === 'string';
672
+ }
673
+
674
+ // Class represents cached values retrieved by a load function that is to be called only once per unique input parameter combination.
675
+ class ParameterCacheField {
676
+ constructor() {
677
+ // A map from cache params (keys: the loadFunction arguments) to their cache fields
678
+ this._paramsToCacheItems = new Map();
679
+ }
680
+ // Returns the value for given loadfunction parameters. Loads if not yet loaded.
681
+ getValue(...params) {
682
+ return this._getCacheField(params).getValue();
495
683
  }
496
- // Returns whether given str is a string and has a length > 0.
497
- static IsStringWithLength(str) {
498
- return str && StringUtils.IsString(str) && str.length > 0;
684
+ setValue(value, ...params) {
685
+ return this._getCacheField(params).setValue(value);
686
+ }
687
+ // Returns the freshly reloaded value for given loadfunction parameters.
688
+ reload(...params) {
689
+ return this._getCacheField(params).reload();
690
+ }
691
+ // Resets one or all cache items. If no params given, resets ALL cache items.
692
+ reset(...params) {
693
+ if (params && params.length > 0) {
694
+ this._getCacheField(params).reset();
695
+ }
696
+ else {
697
+ this._paramsToCacheItems.forEach(cacheItem => cacheItem.reset());
698
+ this._paramsToCacheItems.clear();
699
+ this._paramsToCacheItems = new Map(); // not sure if clear() is enough for garbage collector?
700
+ }
701
+ }
702
+ // Makes a new cache field if none existed for these params. Returns the cache field that matches given params.
703
+ _getCacheField(params) {
704
+ let existingCacheField = undefined;
705
+ this._paramsToCacheItems.forEach((value, key) => {
706
+ if (!existingCacheField && ObjectUtils.DeepEquals(params, key)) {
707
+ existingCacheField = value;
708
+ }
709
+ });
710
+ if (existingCacheField) {
711
+ return existingCacheField;
712
+ }
713
+ else {
714
+ return this._makeNewCacheField(params);
715
+ }
499
716
  }
500
- // Returns given string, escaped for use as string literal in regular expressions.
501
- static _escapeRegExp(str) {
502
- return str; // .replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^$\|]/g, '\\$&');
717
+ // Creates and returns a new loadField for given params
718
+ _makeNewCacheField(params) {
719
+ const cacheField = new CacheField();
720
+ cacheField.loadFunction = this.loadFunction.bind(cacheField, ...params);
721
+ this._paramsToCacheItems.set(params, cacheField);
722
+ return cacheField;
503
723
  }
504
724
  }
505
725
 
506
- class JsonUtilsService {
507
- readJsonFile(filePath) {
508
- return __awaiter(this, void 0, void 0, function* () {
509
- try {
510
- const response = yield fetch(filePath);
511
- if (!response.ok) {
512
- console.error('Error getting translation:', response.statusText);
513
- return '';
514
- }
515
- else {
516
- return response.json();
517
- }
726
+ /**
727
+ * App-wide, top-level, 'dumb' BO cache manager service. It stores and returns simple and parameterized business object cache items.
728
+ *
729
+ * Several other services register cache items onto this manager, such as repositories or the more generic SelectMultipleSimpleCacheService.
730
+ *
731
+ * This is a dumb cache manager. It just functions as a point to add and retrieve generic cache items, but does not know how to actually
732
+ * LOAD these cache items from the database, or what exact types the items are.
733
+ *
734
+ * All caches are reset when the user logs out.
735
+ */
736
+ class BusinessObjectCacheManagerService {
737
+ constructor() {
738
+ // emits after this BO cache manager has been reset (e.g. after user logs out)
739
+ this.reset = new Subject();
740
+ // key: global cache id's, e.g. a model classe or any other arbitrary key for cache items
741
+ this._selectMultipleCache = new Map();
742
+ // key: global cache id's, e.g. a model classe or any other arbitrary key for cache items
743
+ this._selectMultipleParameterizedCache = new Map();
744
+ this._selectSingleCache = new Map();
745
+ this._selectSingleParameterizedCache = new Map();
746
+ }
747
+ // constructor(private _transactionService: TransactionService) {
748
+ // this._logoutSub = this._transactionService.logout.subscribe(() => {
749
+ // this._reset();
750
+ // });
751
+ // }
752
+ ngOnDestroy() {
753
+ this._logoutSub.unsubscribe();
754
+ }
755
+ /**
756
+ * Creates and adds a new simple cache item for the given key with the given load function.
757
+ * @param key
758
+ * @param loadFunction e.g. () => { return this._dataService.selectMultiple(Color); }
759
+ * @param overrideOld Whether to allow an old cache item with the same key to become override by this newly created cache item.
760
+ * @returns The newly created cache item.
761
+ */
762
+ addNewSelectMultipleCacheItem(key, loadFunction, overrideOld = false) {
763
+ if (!overrideOld && this._selectMultipleCache.has(key)) {
764
+ return;
765
+ }
766
+ const newCacheItem = new CacheField();
767
+ newCacheItem.loadFunction = loadFunction;
768
+ this._selectMultipleCache.set(key, newCacheItem);
769
+ return newCacheItem;
770
+ }
771
+ addNewSelectSingleCacheItem(key, id = BusinessObjectCacheManagerService._NullBoId, loadFunction, overrideOld = false) {
772
+ const cacheId = id.toString();
773
+ if (!overrideOld && this.hasSingleCacheItem(key, id)) {
774
+ return;
775
+ }
776
+ if (!this._selectSingleCache.has(key)) {
777
+ this._selectSingleCache.set(key, {});
778
+ }
779
+ const newCacheItem = new CacheField();
780
+ newCacheItem.loadFunction = loadFunction;
781
+ this._selectSingleCache.get(key)[cacheId] = newCacheItem;
782
+ return newCacheItem;
783
+ }
784
+ addNewSelectSingleParameterizedCacheItem(key, loadFunction, overrideOld = false) {
785
+ if (!overrideOld && this._selectSingleParameterizedCache.has(key)) {
786
+ return;
787
+ }
788
+ const newCacheItem = new ParameterCacheField();
789
+ newCacheItem.loadFunction = loadFunction;
790
+ this._selectSingleParameterizedCache.set(key, newCacheItem);
791
+ return newCacheItem;
792
+ }
793
+ /**
794
+ * Creates and adds a new parameterized cache item for the given key with the given load function.
795
+ * @param key
796
+ * @param loadFunction e.g. (category: ArticleCategory) => { return this._dataService.selectMultiple(TurnoverGroupImage, category); }
797
+ * @param overrideOld Whether to allow an old cache item with the same key to become override by this newly created cache item.
798
+ */
799
+ addNewSelectMultipleParameterizedCacheItem(key, loadFunction, overrideOld = false) {
800
+ if (!overrideOld && this._selectMultipleParameterizedCache.has(key)) {
801
+ return;
802
+ }
803
+ const newCacheItem = new ParameterCacheField();
804
+ newCacheItem.loadFunction = loadFunction;
805
+ this._selectMultipleParameterizedCache.set(key, newCacheItem);
806
+ return newCacheItem;
807
+ }
808
+ hasSelectMultipleCacheItem(key) {
809
+ return this._selectMultipleCache.has(key);
810
+ }
811
+ hasSingleCacheItem(key, id = BusinessObjectCacheManagerService._NullBoId) {
812
+ const cacheId = id.toString();
813
+ return this._selectSingleCache.has(key) && !!this._selectSingleCache.get(key)[cacheId];
814
+ }
815
+ hasSelectMultipleParameterizedCacheItem(key) {
816
+ return this._selectMultipleParameterizedCache.has(key);
817
+ }
818
+ hasSelectSingleParameterizedCacheItem(key) {
819
+ return this._selectSingleParameterizedCache.has(key);
820
+ }
821
+ // Returns the simple cache item with the given key. T is the type of the cache value items requested, e.g. Color.
822
+ getSelectMultipleCacheItem(key) {
823
+ return this._selectMultipleCache.get(key);
824
+ }
825
+ getSingleCacheItem(key, id = BusinessObjectCacheManagerService._NullBoId) {
826
+ const cacheId = id.toString();
827
+ return this._selectSingleCache.has(key) && this._selectSingleCache.get(key)[cacheId];
828
+ }
829
+ // Returns the parameterized cache item with the given key. T is the type of the cache value items requested, e.g. Color.
830
+ getSelectMultipleParameterCacheItem(key) {
831
+ return this._selectMultipleParameterizedCache.get(key);
832
+ }
833
+ getSelectSingleParameterCacheItem(key) {
834
+ return this._selectSingleParameterizedCache.get(key);
835
+ }
836
+ _reset() {
837
+ this._selectMultipleCache.forEach((cacheItem) => {
838
+ if (cacheItem) {
839
+ cacheItem.reset();
518
840
  }
519
- catch (e) {
520
- console.error('Error getting translation:', e.message);
521
- return '';
841
+ });
842
+ this._selectSingleCache.forEach((cache) => {
843
+ if (cache) {
844
+ ObjectUtils.ForOwnProperty(cache, (cacheField) => {
845
+ cacheField.reset();
846
+ });
522
847
  }
523
848
  });
849
+ this._selectSingleParameterizedCache.forEach((selSinParamCacheItem) => {
850
+ if (selSinParamCacheItem) {
851
+ selSinParamCacheItem.reset();
852
+ }
853
+ });
854
+ this._selectMultipleParameterizedCache.forEach((selMulParamCacheItem) => {
855
+ if (selMulParamCacheItem) {
856
+ selMulParamCacheItem.reset();
857
+ }
858
+ });
859
+ this.reset.next();
524
860
  }
525
861
  }
526
- JsonUtilsService.decorators = [
527
- { type: Injectable }
862
+ BusinessObjectCacheManagerService._NullBoId = -1;
863
+ BusinessObjectCacheManagerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function BusinessObjectCacheManagerService_Factory() { return new BusinessObjectCacheManagerService(); }, token: BusinessObjectCacheManagerService, providedIn: "root" });
864
+ BusinessObjectCacheManagerService.decorators = [
865
+ { type: Injectable, args: [{
866
+ providedIn: "root"
867
+ },] }
528
868
  ];
529
869
 
530
- // The localization service, providing peers with text translation functionality.
531
- class DictionaryService {
532
- constructor(_jsonUtils) {
533
- this._jsonUtils = _jsonUtils;
534
- this.dictionaryUrl = 'js/browser/res/dictionary/';
535
- this.dictionaryLoaded = new Subject();
536
- this._dictionaryPromise = new Map();
537
- this._dictionaries = new Map();
538
- // Some dictionary values have one or more '|~' texts in them, meant to be replaced with client-side given texts.
539
- this._placeholder = '|~';
870
+ class SelectSingleCacheService {
871
+ constructor(_boCacheManager) {
872
+ this._boCacheManager = _boCacheManager;
540
873
  }
541
- get language() {
542
- return this._language;
874
+ requestCache(clazz, sourceId, loadFunction) {
875
+ if (!this._boCacheManager.hasSingleCacheItem(clazz, sourceId)) {
876
+ this._createCacheItem(clazz, sourceId, loadFunction);
877
+ }
878
+ // noinspection TypeScriptValidateTypes
879
+ return this._boCacheManager.getSingleCacheItem(clazz, sourceId);
543
880
  }
544
- set rootUrl(value) {
545
- this._rootUrl = value;
546
- this._dictBasePath = this._rootUrl + '/' + this.dictionaryUrl;
881
+ _createCacheItem(clazz, sourceId, loadFunction) {
882
+ // noinspection TypeScriptValidateTypes
883
+ return this._boCacheManager.addNewSelectSingleCacheItem(clazz, sourceId, loadFunction);
547
884
  }
548
- getLanguageCode(lc) {
549
- for (const key in LanguageCode) {
550
- if (LanguageCode[key] === lc) {
551
- return lc;
552
- }
885
+ }
886
+ SelectSingleCacheService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SelectSingleCacheService_Factory() { return new SelectSingleCacheService(i0.ɵɵinject(BusinessObjectCacheManagerService)); }, token: SelectSingleCacheService, providedIn: "root" });
887
+ SelectSingleCacheService.decorators = [
888
+ { type: Injectable, args: [{
889
+ providedIn: "root"
890
+ },] }
891
+ ];
892
+ SelectSingleCacheService.ctorParameters = () => [
893
+ { type: BusinessObjectCacheManagerService }
894
+ ];
895
+
896
+ class SelectMultipleCacheService {
897
+ constructor(_boCacheManager) {
898
+ this._boCacheManager = _boCacheManager;
899
+ }
900
+ /**
901
+ * Returns the global cache item for the select multiple of the given business object class. Creates a new cache item if not yet exists.
902
+ * @param clazz The BO class, e.g. CustomerFullObject
903
+ * @returns {CacheField<T[]>}
904
+ */
905
+ requestCache(clazz, loadFunction) {
906
+ if (!this._boCacheManager.hasSelectMultipleCacheItem(clazz)) {
907
+ this._createCacheItem(clazz, loadFunction);
553
908
  }
554
- return LanguageCode.Dutch;
909
+ // noinspection TypeScriptValidateTypes
910
+ return this._boCacheManager.getSelectMultipleCacheItem(clazz);
555
911
  }
556
- // Loads the dictionary for given language in memory.
557
- setDictionary(language, additionalTranslationFile) {
558
- return __awaiter(this, void 0, void 0, function* () {
559
- this._language = language;
560
- if (!this._dictionaryPromise.has(language)) {
561
- this._dictionaryPromise.set(language, this._jsonUtils.readJsonFile(additionalTranslationFile ?
562
- additionalTranslationFile :
563
- this._dictBasePath + 'text_' + language.substr(0, 2).toLowerCase() + '.properties.json')
564
- .then((data) => {
565
- this._dictionaries.set(language, data);
566
- this.dictionaryLoaded.next();
567
- return data;
568
- }));
569
- }
570
- else {
571
- this.dictionaryLoaded.next();
572
- }
573
- yield this._dictionaryPromise.get(language);
574
- });
912
+ // Creates and returns a new select multiple cache item into the global business object cache manager for given business object class.
913
+ _createCacheItem(clazz, loadFunction) {
914
+ // noinspection TypeScriptValidateTypes
915
+ return this._boCacheManager.addNewSelectMultipleCacheItem(clazz, loadFunction);
916
+ }
917
+ }
918
+ SelectMultipleCacheService._NullCache = new CacheField();
919
+ SelectMultipleCacheService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SelectMultipleCacheService_Factory() { return new SelectMultipleCacheService(i0.ɵɵinject(BusinessObjectCacheManagerService)); }, token: SelectMultipleCacheService, providedIn: "root" });
920
+ SelectMultipleCacheService.decorators = [
921
+ { type: Injectable, args: [{
922
+ providedIn: "root"
923
+ },] }
924
+ ];
925
+ SelectMultipleCacheService.ctorParameters = () => [
926
+ { type: BusinessObjectCacheManagerService }
927
+ ];
928
+
929
+ // service resonsible for filling the global BO cache manager service with parameterized select multiple cache items
930
+ class SelectMultipleParameterizedCacheService {
931
+ constructor(_boCacheManager) {
932
+ this._boCacheManager = _boCacheManager;
933
+ // emits after this select multiple parameterized cache service has been reset (e.g. after user logs out)
934
+ this.reset = new Subject();
935
+ this._subs = [];
936
+ this._subs.push(this._boCacheManager.reset.subscribe(() => {
937
+ this.reset.next();
938
+ }));
939
+ }
940
+ ngOnDestroy() {
941
+ this._subs.forEach(sub => sub.unsubscribe());
575
942
  }
576
943
  /**
577
- * Returns the localized text for the given dictionary key.
578
- * @param {string} key
579
- * @param {boolean} [upperCaseFirst = true] False for first letter lowercase, true for first letter uppercase for returned dict val
580
- * @param {string[]} replacementTexts Rest params for replacement of '|~' in returned dict value
581
- * @returns {string} The translated text for given dictionary key
944
+ * Returns the global cache item for the parameterized select multiple of the given business object class. Creates a new cache item if not yet exists.
945
+ * @param clazz The BO class, used for undeflying dataService.selectMultiple(clazz) call.
946
+ * @returns {CacheField<T[]>}
582
947
  */
583
- get(key, upperCaseFirst = true, ...replacementTexts) {
584
- if (!StringUtils.IsStringWithLength(key)) {
585
- return key || '';
586
- }
587
- else if (!this._dictionaryLoaded(this._language)) {
588
- return key;
948
+ requestCache(clazz, loadFunction) {
949
+ if (!this._boCacheManager.hasSelectMultipleParameterizedCacheItem(clazz)) {
950
+ this._createParameterizedCacheItem(clazz, loadFunction);
589
951
  }
590
- let text = this._dictionaries.get(this._language)[key];
591
- text = StringUtils.IsStringWithLength(text) ? text : key;
592
- if (upperCaseFirst) {
593
- text = text.charAt(0).toUpperCase() + text.slice(1);
594
- }
595
- else {
596
- text = text.charAt(0).toLowerCase() + text.slice(1);
597
- }
598
- if (replacementTexts.length > 0) {
599
- text = StringUtils.ReplaceOccurrencesIn(text, this._placeholder, ...replacementTexts);
600
- }
601
- return text;
952
+ // noinspection TypeScriptValidateTypes
953
+ return this._boCacheManager.getSelectMultipleParameterCacheItem(clazz);
602
954
  }
603
- _dictionaryLoaded(language) {
604
- return this._dictionaries.has(language);
955
+ // Creates and returns a new parameterized select multiple cache item into the global business object cache manager for given business object class.
956
+ _createParameterizedCacheItem(clazz, loadFunction) {
957
+ // noinspection TypeScriptValidateTypes
958
+ return this._boCacheManager.addNewSelectMultipleParameterizedCacheItem(clazz, loadFunction);
605
959
  }
606
960
  }
607
- DictionaryService.decorators = [
608
- { type: Injectable }
961
+ SelectMultipleParameterizedCacheService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SelectMultipleParameterizedCacheService_Factory() { return new SelectMultipleParameterizedCacheService(i0.ɵɵinject(BusinessObjectCacheManagerService)); }, token: SelectMultipleParameterizedCacheService, providedIn: "root" });
962
+ SelectMultipleParameterizedCacheService.decorators = [
963
+ { type: Injectable, args: [{
964
+ providedIn: "root"
965
+ },] }
609
966
  ];
610
- DictionaryService.ctorParameters = () => [
611
- { type: JsonUtilsService }
967
+ SelectMultipleParameterizedCacheService.ctorParameters = () => [
968
+ { type: BusinessObjectCacheManagerService }
612
969
  ];
613
970
 
614
- class SettingsOptions {
615
- constructor() {
616
- this.showAddToCart = true;
617
- this.showPriceFilter = true;
618
- this.showLookAtArticleButton = true;
619
- this.showStockIndication = false;
620
- this.lookAtArticleButtonText = 'LOOKAT';
621
- this.stockButtonText = 'STOCK';
622
- this.showAddArticleButton = true;
623
- this.showARButton = false;
624
- this.maxItemsPerPage = 20;
625
- this.addArticleButtonText = 'ADD TO CART';
626
- this.collapseFilterByDefault = false;
627
- this.sortTurnoverGroupsByAlphabet = true;
628
- this.searchOnStart = false;
971
+ // service resonsible for filling the global BO cache manager service with parameterized select single cache items
972
+ class SelectSingleParameterizedCacheService {
973
+ constructor(_boCacheManager) {
974
+ this._boCacheManager = _boCacheManager;
975
+ // emits after this select single parameterized cache service has been reset (e.g. after user logs out)
976
+ this.reset = new Subject();
977
+ this._subs = [];
978
+ this._subs.push(this._boCacheManager.reset.subscribe(() => {
979
+ this.reset.next();
980
+ }));
629
981
  }
630
- }
631
-
632
- class Settings {
633
- constructor() {
634
- this.session = undefined;
635
- this.useEncryption = true;
636
- this.type = "V";
637
- this.options = new SettingsOptions();
982
+ ngOnDestroy() {
983
+ this._subs.forEach(sub => sub.unsubscribe());
638
984
  }
639
- }
985
+ /**
986
+ * Returns the global cache item for the parameterized select single of the given business object class. Creates a new cache item if not yet exists.
987
+ * @param clazz The BO class, used for undeflying dataService.selectSingle(clazz) call.
988
+ * @returns {CacheField<T>}
989
+ */
990
+ requestCache(clazz, loadFunction) {
991
+ if (!this._boCacheManager.hasSelectSingleParameterizedCacheItem(clazz)) {
992
+ this._createParameterizedCacheItem(clazz, loadFunction);
993
+ }
994
+ // noinspection TypeScriptValidateTypes
995
+ return this._boCacheManager.getSelectSingleParameterCacheItem(clazz);
996
+ }
997
+ // Creates and returns a new parameterized select single cache item into the global business object cache manager for given business object class.
998
+ _createParameterizedCacheItem(clazz, loadFunction) {
999
+ // noinspection TypeScriptValidateTypes
1000
+ return this._boCacheManager.addNewSelectSingleParameterizedCacheItem(clazz, loadFunction);
1001
+ }
1002
+ }
1003
+ SelectSingleParameterizedCacheService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SelectSingleParameterizedCacheService_Factory() { return new SelectSingleParameterizedCacheService(i0.ɵɵinject(BusinessObjectCacheManagerService)); }, token: SelectSingleParameterizedCacheService, providedIn: "root" });
1004
+ SelectSingleParameterizedCacheService.decorators = [
1005
+ { type: Injectable, args: [{
1006
+ providedIn: "root"
1007
+ },] }
1008
+ ];
1009
+ SelectSingleParameterizedCacheService.ctorParameters = () => [
1010
+ { type: BusinessObjectCacheManagerService }
1011
+ ];
640
1012
 
641
- class SettingsService {
642
- constructor(_dictionaryService, _jsonUtilsService) {
643
- this._dictionaryService = _dictionaryService;
644
- this._jsonUtilsService = _jsonUtilsService;
645
- this.settingsLoaded = new BehaviorSubject(false);
646
- this._settings = new Settings();
1013
+ class CatalogConnectorService {
1014
+ constructor(_adapterService, _selectSingleCacheService, _selectMultipleCacheService, _selectMultipleParameterizedCacheService, _selectSingleParameterizedCacheService) {
1015
+ this._adapterService = _adapterService;
1016
+ this._selectSingleCacheService = _selectSingleCacheService;
1017
+ this._selectMultipleCacheService = _selectMultipleCacheService;
1018
+ this._selectMultipleParameterizedCacheService = _selectMultipleParameterizedCacheService;
1019
+ this._selectSingleParameterizedCacheService = _selectSingleParameterizedCacheService;
1020
+ this._boFactory = new BusinessObjectFactory();
647
1021
  }
648
- set settings(value) {
649
- this._settings = value;
1022
+ initConnector(settings, forceReload) {
1023
+ return __awaiter(this, void 0, void 0, function* () {
1024
+ yield this._adapterService.initConnector(settings, forceReload);
1025
+ });
650
1026
  }
651
- get settings() {
652
- return this._settings;
1027
+ getArticlesForCatalog(params, showLoader = true) {
1028
+ return __awaiter(this, void 0, void 0, function* () {
1029
+ return this._adapterService.getArticlesForCatalog(params, showLoader);
1030
+ });
653
1031
  }
654
- initializeSettings() {
1032
+ getArticleCategories(publicationCode) {
655
1033
  return __awaiter(this, void 0, void 0, function* () {
656
- // see if there's a json file for application settings
657
- if (typeof settings === 'undefined') {
658
- const jsonSettings = yield this._jsonUtilsService.readJsonFile('catalog-settings.json');
659
- this.settings = Object.assign(new Settings(), jsonSettings);
660
- this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
661
- this.settingsFinished();
662
- }
663
- else {
664
- this.settings = Object.assign(new Settings(), settings);
665
- this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
666
- this.settingsFinished();
667
- }
1034
+ return this._selectMultipleParameterizedCacheService.requestCache(ArticleCategory, (publicationCode) => {
1035
+ return this._adapterService.getArticleCategories(publicationCode);
1036
+ }).getValue(publicationCode);
668
1037
  });
669
1038
  }
670
- createSettingsFromObject(obj) {
1039
+ getCatalogDefinitions(showLoader = true) {
671
1040
  return __awaiter(this, void 0, void 0, function* () {
672
- if (!this.settings) {
673
- this.settings = new Settings();
674
- }
675
- if (obj.hasOwnProperty('url')) {
676
- this.settings.url = obj['url'];
677
- }
678
- if (obj.hasOwnProperty('schema')) {
679
- this.settings.schema = obj['schema'];
680
- }
681
- if (obj.hasOwnProperty('version')) {
682
- this.settings.version = obj['version'];
683
- }
684
- if (obj.hasOwnProperty('branch')) {
685
- this.settings.branch = obj['branch'];
686
- }
687
- if (obj.hasOwnProperty('currency')) {
688
- this.settings.currency = obj['currency'];
689
- }
690
- if (obj.hasOwnProperty('languageCode')) {
691
- this.settings.languageCode = obj['languageCode'];
692
- }
693
- if (obj.hasOwnProperty('username')) {
694
- this.settings.username = obj['username'];
695
- }
696
- if (obj.hasOwnProperty('password')) {
697
- this.settings.password = obj['password'];
698
- }
699
- if (obj.hasOwnProperty('timeoutInMs')) {
700
- this.settings.timeoutInMs = obj['timeoutInMs'];
701
- }
702
- if (obj.hasOwnProperty('session')) {
703
- this.settings.session = obj['session'];
704
- }
705
- if (obj.hasOwnProperty('useEncryption')) {
706
- this.settings.useEncryption = obj['useEncryption'];
707
- }
708
- if (obj.hasOwnProperty('additionalTranslationFile')) {
709
- this.settings.additionalTranslationFile = obj['additionalTranslationFile'];
710
- }
711
- if (obj.hasOwnProperty('type')) {
712
- this.settings.type = obj['type'];
713
- }
714
- if (obj.hasOwnProperty('options')) {
715
- Object.assign(this.settings.options, obj['options']);
716
- }
717
- if (obj.hasOwnProperty('catalogParameters')) {
718
- this.settings.catalogParameters = obj['catalogParameters'];
719
- }
720
- this.settingsFinished();
1041
+ return this._selectMultipleCacheService.requestCache(CatalogDefinition, () => {
1042
+ return this._adapterService.getCatalogDefinitions(showLoader);
1043
+ }).getValue();
721
1044
  });
722
1045
  }
723
- settingsFinished() {
1046
+ getExternalSource(externalSourceId, showLoader = true) {
724
1047
  return __awaiter(this, void 0, void 0, function* () {
725
- this._dictionaryService.rootUrl = this.settings.url.replace('/ajaxservice', '');
726
- if (!this.settings.additionalTranslationFile) {
727
- const languageCode = this._dictionaryService.getLanguageCode(this.settings.languageCode);
728
- yield this._dictionaryService.setDictionary(languageCode);
729
- }
730
- this.settingsLoaded.next(true);
1048
+ return this._selectSingleCacheService.requestCache(ExternalSource, externalSourceId, () => {
1049
+ return this._adapterService.getExternalSource(externalSourceId, showLoader);
1050
+ }).getValue();
1051
+ });
1052
+ }
1053
+ getCatalogFilter(params) {
1054
+ return __awaiter(this, void 0, void 0, function* () {
1055
+ return this._adapterService.getCatalogFilter(params);
1056
+ });
1057
+ }
1058
+ getPriceFilter(params) {
1059
+ return __awaiter(this, void 0, void 0, function* () {
1060
+ return this._adapterService.getPriceFilter(params);
1061
+ });
1062
+ }
1063
+ getArticleGroupsFilter(params) {
1064
+ return __awaiter(this, void 0, void 0, function* () {
1065
+ return this._adapterService.getArticleGroupsFilter(params);
731
1066
  });
732
1067
  }
1068
+ getAtmosphereFilter(params) {
1069
+ return __awaiter(this, void 0, void 0, function* () {
1070
+ return this._adapterService.getAtmosphereFilter(params);
1071
+ });
1072
+ }
1073
+ getColorFilter(params) {
1074
+ return __awaiter(this, void 0, void 0, function* () {
1075
+ return this._adapterService.getColorFilter(params);
1076
+ });
1077
+ }
1078
+ getConceptFilter(params) {
1079
+ return __awaiter(this, void 0, void 0, function* () {
1080
+ return this._adapterService.getConceptFilter(params);
1081
+ });
1082
+ }
1083
+ getDesignFilter(params) {
1084
+ return __awaiter(this, void 0, void 0, function* () {
1085
+ return this._adapterService.getDesignFilter(params);
1086
+ });
1087
+ }
1088
+ getMainArticleFilter(params) {
1089
+ return __awaiter(this, void 0, void 0, function* () {
1090
+ return this._adapterService.getMainArticleFilter(params);
1091
+ });
1092
+ }
1093
+ getMaterialFilter(params) {
1094
+ return __awaiter(this, void 0, void 0, function* () {
1095
+ return this._adapterService.getMaterialFilter(params);
1096
+ });
1097
+ }
1098
+ getTagsFilter(params) {
1099
+ return __awaiter(this, void 0, void 0, function* () {
1100
+ return this._adapterService.getTagsFilter(params);
1101
+ });
1102
+ }
1103
+ getTurnoverGroupFilter(params) {
1104
+ return __awaiter(this, void 0, void 0, function* () {
1105
+ return this._adapterService.getTurnoverGroupFilter(params);
1106
+ });
1107
+ }
1108
+ getArticlePrice(goodId, type) {
1109
+ return __awaiter(this, void 0, void 0, function* () {
1110
+ return this._adapterService.getArticlePrice(goodId, type);
1111
+ });
1112
+ }
1113
+ getDocumentContent(docId, thumbnail = true) {
1114
+ return __awaiter(this, void 0, void 0, function* () {
1115
+ return this._selectSingleParameterizedCacheService.requestCache(String, (docId, thumbnail) => {
1116
+ return this._adapterService.getDocumentContent(docId, thumbnail);
1117
+ }).getValue(docId, thumbnail);
1118
+ });
1119
+ }
1120
+ getJsonArticleFlatTree(goodId, goodType, quantity, showLoader = true, instanceId = undefined, configuratorStatistics) {
1121
+ return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, undefined, configuratorStatistics);
1122
+ }
733
1123
  }
734
- SettingsService.decorators = [
735
- { type: Injectable }
1124
+ CatalogConnectorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogConnectorService_Factory() { return new CatalogConnectorService(i0.ɵɵinject(CatalogConnectorAdapterService), i0.ɵɵinject(SelectSingleCacheService), i0.ɵɵinject(SelectMultipleCacheService), i0.ɵɵinject(SelectMultipleParameterizedCacheService), i0.ɵɵinject(SelectSingleParameterizedCacheService)); }, token: CatalogConnectorService, providedIn: "root" });
1125
+ CatalogConnectorService.decorators = [
1126
+ { type: Injectable, args: [{
1127
+ providedIn: 'root'
1128
+ },] }
736
1129
  ];
737
- SettingsService.ctorParameters = () => [
738
- { type: DictionaryService },
739
- { type: JsonUtilsService }
1130
+ CatalogConnectorService.ctorParameters = () => [
1131
+ { type: CatalogConnectorAdapterService },
1132
+ { type: SelectSingleCacheService },
1133
+ { type: SelectMultipleCacheService },
1134
+ { type: SelectMultipleParameterizedCacheService },
1135
+ { type: SelectSingleParameterizedCacheService }
740
1136
  ];
741
1137
 
742
- class OptionsService {
1138
+ class CatalogOptionsService {
743
1139
  constructor(_dictionary, _settingsService) {
744
1140
  this._dictionary = _dictionary;
745
1141
  this._settingsService = _settingsService;
@@ -813,15 +1209,18 @@ class OptionsService {
813
1209
  return this._parameters;
814
1210
  }
815
1211
  }
816
- OptionsService.decorators = [
817
- { type: Injectable }
1212
+ CatalogOptionsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogOptionsService_Factory() { return new CatalogOptionsService(i0.ɵɵinject(DictionaryService), i0.ɵɵinject(CatalogSettingsService)); }, token: CatalogOptionsService, providedIn: "root" });
1213
+ CatalogOptionsService.decorators = [
1214
+ { type: Injectable, args: [{
1215
+ providedIn: 'root'
1216
+ },] }
818
1217
  ];
819
- OptionsService.ctorParameters = () => [
1218
+ CatalogOptionsService.ctorParameters = () => [
820
1219
  { type: DictionaryService },
821
- { type: SettingsService }
1220
+ { type: CatalogSettingsService }
822
1221
  ];
823
1222
 
824
- class ImageService {
1223
+ class CatalogImageService {
825
1224
  constructor(_iOneController) {
826
1225
  this._iOneController = _iOneController;
827
1226
  this._articleImages = new Map();
@@ -930,20 +1329,16 @@ class ImageService {
930
1329
  }
931
1330
  }
932
1331
  }
933
- ImageService.decorators = [
934
- { type: Injectable }
1332
+ CatalogImageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogImageService_Factory() { return new CatalogImageService(i0.ɵɵinject(CatalogConnectorService)); }, token: CatalogImageService, providedIn: "root" });
1333
+ CatalogImageService.decorators = [
1334
+ { type: Injectable, args: [{
1335
+ providedIn: 'root'
1336
+ },] }
935
1337
  ];
936
- ImageService.ctorParameters = () => [
937
- { type: IOneControllerService }
1338
+ CatalogImageService.ctorParameters = () => [
1339
+ { type: CatalogConnectorService }
938
1340
  ];
939
1341
 
940
- class ExternalSourceViewmodel {
941
- constructor(catalog, source) {
942
- this.catalogDefinition = catalog;
943
- this.externalSource = source;
944
- }
945
- }
946
-
947
1342
  class FilterItemViewmodel {
948
1343
  constructor(code, description, count, filter) {
949
1344
  this.checked = false;
@@ -965,7 +1360,7 @@ class FilterViewmodel {
965
1360
  }
966
1361
  }
967
1362
 
968
- class FilterService {
1363
+ class CatalogFilterService {
969
1364
  constructor(_iOneController) {
970
1365
  this._iOneController = _iOneController;
971
1366
  this.priceMinFilter = 0;
@@ -1041,21 +1436,181 @@ class FilterService {
1041
1436
  return this.filterItemMap.get(key);
1042
1437
  }
1043
1438
  }
1044
- FilterService.decorators = [
1045
- { type: Injectable }
1439
+ CatalogFilterService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogFilterService_Factory() { return new CatalogFilterService(i0.ɵɵinject(CatalogConnectorService)); }, token: CatalogFilterService, providedIn: "root" });
1440
+ CatalogFilterService.decorators = [
1441
+ { type: Injectable, args: [{
1442
+ providedIn: 'root'
1443
+ },] }
1444
+ ];
1445
+ CatalogFilterService.ctorParameters = () => [
1446
+ { type: CatalogConnectorService }
1447
+ ];
1448
+
1449
+ class CatalogSearchService {
1450
+ constructor(_filterService, _catalogConnectorService, _settingsService, _optionService) {
1451
+ this._filterService = _filterService;
1452
+ this._catalogConnectorService = _catalogConnectorService;
1453
+ this._settingsService = _settingsService;
1454
+ this._optionService = _optionService;
1455
+ this.searchRequest = new ArticleExtendedRequest();
1456
+ this.previousSearchRequest = new ArticleExtendedRequest();
1457
+ // public activeSearchViewMode: SearchViewMode = SearchViewMode.FullScreen;
1458
+ // public activeSearchBarViewMode: SearchbarViewMode = SearchbarViewMode.Expanded;
1459
+ this.showFilterSidebar = false;
1460
+ this.articles = [];
1461
+ this.articlesPerPage = 20;
1462
+ this._currentPage = 1;
1463
+ this._filterText = [];
1464
+ this._subs = [];
1465
+ this._subs.push(this._optionService.parametersSet.subscribe((isSet) => {
1466
+ if (isSet) {
1467
+ if (this._settingsService.settings.options.searchOnStart) {
1468
+ this.searchArticles();
1469
+ }
1470
+ }
1471
+ }));
1472
+ }
1473
+ set filterText(value) {
1474
+ this._setRequestParametersAndProps(null, null, value);
1475
+ // this.searchTextChanged.next(this.filterText);
1476
+ this.searchArticles();
1477
+ }
1478
+ get filterText() {
1479
+ return this._filterText;
1480
+ }
1481
+ set turnoverGroup(value) {
1482
+ this._setRequestParametersAndProps(null, value, null);
1483
+ // this.turnoverGroupChanged.next(this.turnoverGroup);
1484
+ this.searchArticles();
1485
+ }
1486
+ get turnoverGroup() {
1487
+ return this._turnoverGroup;
1488
+ }
1489
+ set category(value) {
1490
+ this._setRequestParametersAndProps(value, null, null);
1491
+ // this.categoryChanged.next(this.category);
1492
+ this.searchArticles();
1493
+ }
1494
+ get category() {
1495
+ return this._category;
1496
+ }
1497
+ get currentPage() {
1498
+ return this._currentPage;
1499
+ }
1500
+ set currentPage(value) {
1501
+ this._currentPage = value;
1502
+ this.searchArticles();
1503
+ }
1504
+ ngOnDestroy() {
1505
+ this._subs.forEach(s => s.unsubscribe());
1506
+ }
1507
+ filterOnCollection(collection) {
1508
+ if (!collection || collection.length === 0) {
1509
+ return;
1510
+ }
1511
+ let cleared = false;
1512
+ let filterRange = [];
1513
+ const searchFilterProp = this._filterService.getFilterItemMap(collection[0].filter.filterName);
1514
+ if (searchFilterProp) {
1515
+ collection.forEach((viewModel) => {
1516
+ if (!cleared) {
1517
+ this.searchRequest[searchFilterProp] = '';
1518
+ cleared = true;
1519
+ }
1520
+ if (viewModel.checked) {
1521
+ filterRange.push(`?='${viewModel.code}'`);
1522
+ }
1523
+ });
1524
+ this.searchRequest[searchFilterProp] = filterRange.join(',');
1525
+ this.searchArticles();
1526
+ }
1527
+ }
1528
+ searchArticles(getFilters = true) {
1529
+ if (this._settingsService.settings.catalogParameters) {
1530
+ this.searchRequest.publicationCode = this._settingsService.settings.catalogParameters.publicationCode;
1531
+ }
1532
+ if (this.isNewGeneralSearch()) {
1533
+ this._currentPage = 1;
1534
+ }
1535
+ const lowerBound = ((this.currentPage - 1) * this.articlesPerPage) + 1;
1536
+ this.searchRequest.paging = new PagingParameters(lowerBound, lowerBound + this.articlesPerPage - 1, this.articlesPerPage);
1537
+ this._catalogConnectorService.getArticlesForCatalog(this.searchRequest).then((result) => {
1538
+ var _a, _b;
1539
+ this.articles = (_a = result.articles) !== null && _a !== void 0 ? _a : [];
1540
+ this.resultCount = (_b = result.count) !== null && _b !== void 0 ? _b : undefined;
1541
+ if (this._settingsService.settings.options.showFilter && getFilters) {
1542
+ this._filterService.getFilters(this.searchRequest);
1543
+ }
1544
+ });
1545
+ this.setPreviousSearchRequest();
1546
+ }
1547
+ resetFilters() {
1548
+ this.setPreviousSearchRequest();
1549
+ this._resetRequest();
1550
+ this.searchRequest.general = this.previousSearchRequest.general;
1551
+ this.searchArticles();
1552
+ }
1553
+ _resetRequest() {
1554
+ this.searchRequest = new ArticleExtendedRequest();
1555
+ }
1556
+ setPreviousSearchRequest() {
1557
+ this.previousSearchRequest = Object.assign({}, this.searchRequest);
1558
+ }
1559
+ isNewGeneralSearch() {
1560
+ return this.previousSearchRequest && this.previousSearchRequest.general !== this.searchRequest.general;
1561
+ }
1562
+ // public get fullscreen(): boolean {
1563
+ // return this.activeSearchViewMode === SearchViewMode.FullScreen;
1564
+ // }
1565
+ //
1566
+ // public get collapsed(): boolean {
1567
+ // return this.activeSearchBarViewMode === SearchbarViewMode.Collapsed;
1568
+ // }
1569
+ toggleFilter() {
1570
+ this.showFilterSidebar = !this.showFilterSidebar;
1571
+ }
1572
+ handleHideFilter() {
1573
+ this.showFilterSidebar = false;
1574
+ }
1575
+ handleResetFilter() {
1576
+ this.resetFilters();
1577
+ this.showFilterSidebar = false;
1578
+ setTimeout(() => {
1579
+ this.showFilterSidebar = true;
1580
+ }, 10);
1581
+ }
1582
+ _setRequestParametersAndProps(category, turnoverGroup, searchText) {
1583
+ this.searchRequest.category = category;
1584
+ this.searchRequest.turnoverGroup = turnoverGroup;
1585
+ this.searchRequest.general = searchText ? searchText.join(' ') : null;
1586
+ // this._category = category;
1587
+ // this._turnoverGroup = turnoverGroup;
1588
+ // this._filterText = searchText;
1589
+ }
1590
+ }
1591
+ CatalogSearchService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogSearchService_Factory() { return new CatalogSearchService(i0.ɵɵinject(CatalogFilterService), i0.ɵɵinject(CatalogConnectorService), i0.ɵɵinject(CatalogSettingsService), i0.ɵɵinject(CatalogOptionsService)); }, token: CatalogSearchService, providedIn: "root" });
1592
+ CatalogSearchService.decorators = [
1593
+ { type: Injectable, args: [{
1594
+ providedIn: "root"
1595
+ },] }
1046
1596
  ];
1047
- FilterService.ctorParameters = () => [
1048
- { type: IOneControllerService }
1597
+ CatalogSearchService.ctorParameters = () => [
1598
+ { type: CatalogFilterService },
1599
+ { type: CatalogConnectorService },
1600
+ { type: CatalogSettingsService },
1601
+ { type: CatalogOptionsService }
1049
1602
  ];
1050
1603
 
1051
1604
  class CatalogService {
1052
- constructor(iOne, utils, optionsService, _imageService, _settingsService, _filterService) {
1053
- this.iOne = iOne;
1054
- this.utils = utils;
1605
+ constructor(connector, connectorAdapter, settingsService, optionsService, _imageService, _settingsService, _filterService, _catalogSearchService) {
1606
+ this.connector = connector;
1607
+ this.connectorAdapter = connectorAdapter;
1608
+ this.settingsService = settingsService;
1055
1609
  this.optionsService = optionsService;
1056
1610
  this._imageService = _imageService;
1057
1611
  this._settingsService = _settingsService;
1058
1612
  this._filterService = _filterService;
1613
+ this._catalogSearchService = _catalogSearchService;
1059
1614
  this.externalSourceChanged = new BehaviorSubject(undefined);
1060
1615
  this.articleSearchFilters = {};
1061
1616
  this.articlesOnShowcase = [];
@@ -1079,10 +1634,10 @@ class CatalogService {
1079
1634
  this._controllerInitialized = false;
1080
1635
  this._subs = [];
1081
1636
  this._currentOrderBy = 1;
1082
- this._subs.push(this.iOne.controllerInitialized.subscribe((initialized) => __awaiter(this, void 0, void 0, function* () {
1637
+ this._subs.push(this.connectorAdapter.controllerInitialized.subscribe((initialized) => __awaiter(this, void 0, void 0, function* () {
1083
1638
  if (initialized) {
1084
1639
  this._controllerInitialized = true;
1085
- this.ensureDataListsLoaded();
1640
+ // this.ensureDataListsLoaded();
1086
1641
  this.articlesPerPage = this._settingsService.settings.options.maxItemsPerPage;
1087
1642
  if (this._settingsService.settings.options.searchOnStart) {
1088
1643
  this.searchArticles();
@@ -1091,41 +1646,47 @@ class CatalogService {
1091
1646
  })), this.optionsService.parametersSet.subscribe((set) => {
1092
1647
  if (set) {
1093
1648
  this.defaultOptions = this.optionsService.parameters;
1094
- this._createDefaultRequest();
1095
- if (this.optionsService.parameters.general && this._settingsService.settings.options.searchOnStart) {
1096
- this._setRequestParametersAndProps(null, null, this.optionsService.parameters.general.split(' '));
1097
- this.searchArticles();
1098
- }
1649
+ // this._createDefaultRequest();
1650
+ // if (this.optionsService.parameters.general && this._settingsService.settings.options.searchOnStart) {
1651
+ // this._setRequestParametersAndProps(null, null, this.optionsService.parameters.general.split(' '));
1652
+ // this.searchArticles();
1653
+ // }
1099
1654
  }
1100
1655
  }));
1101
- this.doArticleSearchThrottledFunc = this.utils.getAsThrottledFunction(() => {
1102
- return this.doSearchArticles();
1103
- }, this.minMillisBetweenArticleSearches, this);
1104
- }
1105
- set filterText(value) {
1106
- this._setRequestParametersAndProps(null, null, value);
1107
- this.searchTextChanged.next(this.filterText);
1108
- this.searchArticles();
1109
- }
1110
- get filterText() {
1111
- return this._filterText;
1112
- }
1113
- set turnoverGroup(value) {
1114
- this._setRequestParametersAndProps(null, value, null);
1115
- this.turnoverGroupChanged.next(this.turnoverGroup);
1116
- this.searchArticles();
1117
- }
1118
- get turnoverGroup() {
1119
- return this._turnoverGroup;
1120
- }
1121
- set category(value) {
1122
- this._setRequestParametersAndProps(value, null, null);
1123
- this.categoryChanged.next(this.category);
1124
- this.searchArticles();
1125
- }
1126
- get category() {
1127
- return this._category;
1128
- }
1656
+ /*
1657
+ this.doArticleSearchThrottledFunc = this.utils.getAsThrottledFunction(() => {
1658
+ return this.doSearchArticles();
1659
+ }, this.minMillisBetweenArticleSearches, this);
1660
+ */
1661
+ }
1662
+ // public set filterText(value: string[]) {
1663
+ // this._setRequestParametersAndProps(null, null, value);
1664
+ // this.searchTextChanged.next(this.filterText);
1665
+ // this.searchArticles();
1666
+ // }
1667
+ //
1668
+ // public get filterText(): string[] {
1669
+ // return this._filterText;
1670
+ // }
1671
+ // public set turnoverGroup(value: string) {
1672
+ // this._setRequestParametersAndProps(null, value, null);
1673
+ // this.turnoverGroupChanged.next(this.turnoverGroup);
1674
+ // this.searchArticles();
1675
+ // }
1676
+ //
1677
+ // public get turnoverGroup(): string {
1678
+ // return this._turnoverGroup;
1679
+ // }
1680
+ //
1681
+ // public set category(value: string) {
1682
+ // this._setRequestParametersAndProps(value, null, null);
1683
+ // this.categoryChanged.next(this.category);
1684
+ // this.searchArticles();
1685
+ // }
1686
+ //
1687
+ // public get category(): string {
1688
+ // return this._category;
1689
+ // }
1129
1690
  set externalSourceUrl(url) {
1130
1691
  this._externalSourceUrl = url;
1131
1692
  this.showExternalSource = true;
@@ -1162,27 +1723,60 @@ class CatalogService {
1162
1723
  ngOnDestroy() {
1163
1724
  this._subs.forEach(s => s.unsubscribe());
1164
1725
  }
1165
- filterOnCollection(collection) {
1166
- if (!collection || collection.length === 0) {
1167
- return;
1168
- }
1169
- let cleared = false;
1170
- let filterRange = [];
1171
- const searchFilterProp = this._filterService.getFilterItemMap(collection[0].filter.filterName);
1172
- if (searchFilterProp) {
1173
- collection.forEach((viewModel) => {
1174
- if (!cleared) {
1175
- this.articleSearchFilters[searchFilterProp] = '';
1176
- cleared = true;
1177
- }
1178
- if (viewModel.checked) {
1179
- filterRange.push(`?='${viewModel.code}'`);
1726
+ init(settings) {
1727
+ return __awaiter(this, void 0, void 0, function* () {
1728
+ yield this.settingsService.initializeSettings(settings);
1729
+ yield this.connector.initConnector(this.settingsService.settings);
1730
+ });
1731
+ }
1732
+ getCategories() {
1733
+ return __awaiter(this, void 0, void 0, function* () {
1734
+ const categories = yield this.connector.getArticleCategories(this._catalogSearchService.searchRequest.publicationCode);
1735
+ if (categories && categories.length > 0) {
1736
+ for (let i = 0; i < categories.length; i++) {
1737
+ let articleCategory = categories[i];
1738
+ this._imageService.getCategoryImage(articleCategory);
1739
+ articleCategory.turnoverGroups.sort((a, b) => {
1740
+ if (this.optionsService.sortTurnoverGroupsByAlphabet) {
1741
+ return (/[A-Za-z]/.test(a.description)) - (/[A-Za-z]/.test(b.description)) ||
1742
+ (a.description.toUpperCase() < b.description.toUpperCase() ? -1 :
1743
+ a.description.toUpperCase() > b.description.toUpperCase() ? 1 : 0);
1744
+ }
1745
+ else {
1746
+ return +a.turnovergroupNr < +b.turnovergroupNr ? -1 : +a.turnovergroupNr > +b.turnovergroupNr ? 1 : 0;
1747
+ }
1748
+ });
1180
1749
  }
1181
- });
1182
- this.articleSearchFilters[searchFilterProp] = filterRange.join(',');
1183
- this.searchArticles();
1184
- }
1750
+ }
1751
+ return categories;
1752
+ });
1753
+ }
1754
+ prepareTurnoverGroupImage(group) {
1755
+ return __awaiter(this, void 0, void 0, function* () {
1756
+ return this._imageService.getTurnoverGroupImage(group);
1757
+ });
1185
1758
  }
1759
+ // public filterOnCollection(collection: FilterItemViewmodel[]): void {
1760
+ // if (!collection || collection.length === 0) {
1761
+ // return;
1762
+ // }
1763
+ // let cleared: boolean = false;
1764
+ // let filterRange: string[] = [];
1765
+ // const searchFilterProp: string = this._filterService.getFilterItemMap(collection[0].filter.filterName);
1766
+ // if (searchFilterProp) {
1767
+ // collection.forEach((viewModel: FilterItemViewmodel) => {
1768
+ // if (!cleared) {
1769
+ // this.articleSearchFilters[searchFilterProp] = '';
1770
+ // cleared = true;
1771
+ // }
1772
+ // if (viewModel.checked) {
1773
+ // filterRange.push(`?='${viewModel.code}'`);
1774
+ // }
1775
+ // });
1776
+ // this.articleSearchFilters[searchFilterProp] = filterRange.join(',');
1777
+ // this.searchArticles();
1778
+ // }
1779
+ // }
1186
1780
  changeOrderBy(orderBy) {
1187
1781
  this._currentOrderBy = orderBy.id;
1188
1782
  this._sortArticleList();
@@ -1200,13 +1794,13 @@ class CatalogService {
1200
1794
  });
1201
1795
  }
1202
1796
  resetFilters() {
1203
- this._createDefaultRequest();
1204
- this.category = null;
1205
- this.turnoverGroup = null;
1206
- if (this.filterText !== null) {
1207
- this.filterText = this.filterText.slice();
1208
- }
1209
- this.onResetFilters.next();
1797
+ // this._createDefaultRequest();
1798
+ // this.category = null;
1799
+ // this.turnoverGroup = null;
1800
+ // if (this.filterText !== null) {
1801
+ // this.filterText = this.filterText.slice();
1802
+ // }
1803
+ // this.onResetFilters.next();
1210
1804
  }
1211
1805
  reset() {
1212
1806
  this.showCatOrTurnoverGroupArticles = false;
@@ -1214,55 +1808,43 @@ class CatalogService {
1214
1808
  }
1215
1809
  ensureDataListsLoaded() {
1216
1810
  return __awaiter(this, void 0, void 0, function* () {
1217
- this.externalSourceViewModels.length = 0;
1218
- this.iOne.getCatalogDefinitions().then((defs) => __awaiter(this, void 0, void 0, function* () {
1219
- for (let i = 0; i < defs.length; i++) {
1220
- this._imageService.getExternalSourceImage(defs[i]);
1221
- const viewModel = new ExternalSourceViewmodel(defs[i], defs[i].externalSourceId ? yield this.iOne.getExternalSource(defs[i].externalSourceId, false) : new ExternalSource());
1222
- this.externalSourceViewModels.push(viewModel);
1223
- }
1224
- }));
1811
+ // this.externalSourceViewModels.length = 0;
1812
+ // this.iOne.getCatalogDefinitions().then(async (defs: CatalogDefinition[]) => {
1813
+ // for (let i = 0; i < defs.length; i++) {
1814
+ // this._imageService.getExternalSourceImage(defs[i]);
1815
+ // const viewModel: ExternalSourceViewmodel = new ExternalSourceViewmodel(
1816
+ // defs[i],
1817
+ // defs[i].externalSourceId ? await this.iOne.getExternalSource(defs[i].externalSourceId, false) : new ExternalSource()
1818
+ // )
1819
+ // this.externalSourceViewModels.push(viewModel);
1820
+ // }
1821
+ // });
1225
1822
  });
1226
1823
  }
1227
1824
  // POST: this.articlesOnShowcase contains all articles for given search parameters.
1228
1825
  doSearchArticles(getFilters = true) {
1229
1826
  return __awaiter(this, void 0, void 0, function* () {
1230
- const lowerBound = ((this.currentPage - 1) * this.articlesPerPage) + 1;
1231
- this.articleSearchFilters.paging = new PagingParameters(lowerBound, lowerBound + this.articlesPerPage - 1, this.articlesPerPage);
1232
- this.iOne.getArticlesForCatalog(this.articleSearchFilters, false).then((result) => {
1233
- this.resultCount = result.count;
1234
- this.articlesOnShowcase = result.articles;
1235
- this.filteredArticlesOnShowcase = this.articlesOnShowcase.slice(0);
1236
- this._sortArticleList();
1237
- this.showExternalSource = false;
1238
- this.showIoneSource = false;
1239
- this.showCatOrTurnoverGroupArticles = true;
1240
- this.showPageChanged.next(this.currentPage);
1241
- });
1242
- if (getFilters) {
1243
- this._filterService.getFilters(this.articleSearchFilters);
1244
- }
1245
- // todo: get total count of result based on same request to build paging
1827
+ // const lowerBound: number = ((this.currentPage - 1) * this.articlesPerPage) + 1;
1828
+ // this.articleSearchFilters.paging = new PagingParameters(lowerBound, lowerBound + this.articlesPerPage - 1, this.articlesPerPage);
1829
+ // this.iOne.getArticlesForCatalog(this.articleSearchFilters, false).then((result: ArticlesSearchResult) => {
1830
+ // this.resultCount = result.count;
1831
+ // this.articlesOnShowcase = result.articles;
1832
+ // this.filteredArticlesOnShowcase = this.articlesOnShowcase.slice(0);
1833
+ // this._sortArticleList();
1834
+ // this.showExternalSource = false;
1835
+ // this.showIoneSource = false;
1836
+ // this.showCatOrTurnoverGroupArticles = true;
1837
+ // this.showPageChanged.next(this.currentPage);
1838
+ // })
1839
+ // if (getFilters) {
1840
+ // this._filterService.getFilters(this.articleSearchFilters);
1841
+ // }
1842
+ // // todo: get total count of result based on same request to build paging
1246
1843
  });
1247
1844
  }
1248
- sortTurnoverGroups(categories) {
1249
- if (this.optionsService.sortTurnoverGroupsByAlphabet) {
1250
- categories.forEach((articleCategory) => {
1251
- articleCategory.turnoverGroups.sort((a, b) => {
1252
- return (/[A-Za-z]/.test(a.description)) - (/[A-Za-z]/.test(b.description)) ||
1253
- (a.description.toUpperCase() < b.description.toUpperCase() ? -1 :
1254
- a.description.toUpperCase() > b.description.toUpperCase() ? 1 : 0);
1255
- });
1256
- });
1257
- }
1258
- else {
1259
- categories.forEach((articleCategory) => {
1260
- articleCategory.turnoverGroups.sort((a, b) => {
1261
- return +a.turnovergroupNr < +b.turnovergroupNr ? -1 : +a.turnovergroupNr > +b.turnovergroupNr ? 1 : 0;
1262
- });
1263
- });
1264
- }
1265
- }
1845
+ // public sortTurnoverGroups(categories: ArticleCategory[]): void {
1846
+ // }
1847
+ //
1266
1848
  _sortArticleList() {
1267
1849
  switch (this._currentOrderBy) {
1268
1850
  case 1:
@@ -1288,27 +1870,113 @@ class CatalogService {
1288
1870
  _createDefaultRequest() {
1289
1871
  this.articleSearchFilters = Object.assign({}, this.defaultOptions);
1290
1872
  }
1291
- _setRequestParametersAndProps(category, turnoverGroup, searchText) {
1292
- this.articleSearchFilters.category = category;
1293
- this.articleSearchFilters.turnoverGroup = turnoverGroup;
1294
- this.articleSearchFilters.general = searchText ? searchText.join(' ') : null;
1295
- this._category = category;
1296
- this._turnoverGroup = turnoverGroup;
1297
- this._filterText = searchText;
1298
- }
1299
1873
  }
1874
+ CatalogService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogService_Factory() { return new CatalogService(i0.ɵɵinject(CatalogConnectorService), i0.ɵɵinject(CatalogConnectorAdapterService), i0.ɵɵinject(CatalogSettingsService), i0.ɵɵinject(CatalogOptionsService), i0.ɵɵinject(CatalogImageService), i0.ɵɵinject(CatalogSettingsService), i0.ɵɵinject(CatalogFilterService), i0.ɵɵinject(CatalogSearchService)); }, token: CatalogService, providedIn: "root" });
1300
1875
  CatalogService.decorators = [
1301
- { type: Injectable }
1876
+ { type: Injectable, args: [{
1877
+ providedIn: 'root'
1878
+ },] }
1302
1879
  ];
1303
1880
  CatalogService.ctorParameters = () => [
1304
- { type: IOneControllerService },
1305
- { type: UtilsService },
1306
- { type: OptionsService },
1307
- { type: ImageService },
1308
- { type: SettingsService },
1309
- { type: FilterService }
1881
+ { type: CatalogConnectorService },
1882
+ { type: CatalogConnectorAdapterService },
1883
+ { type: CatalogSettingsService },
1884
+ { type: CatalogOptionsService },
1885
+ { type: CatalogImageService },
1886
+ { type: CatalogSettingsService },
1887
+ { type: CatalogFilterService },
1888
+ { type: CatalogSearchService }
1310
1889
  ];
1311
1890
 
1891
+ class CatalogCategoriesComponent {
1892
+ constructor(_catalogService) {
1893
+ this._catalogService = _catalogService;
1894
+ this.showTurnoverGroups = true;
1895
+ this.categoryClick = new EventEmitter();
1896
+ this.turnoverGroupClick = new EventEmitter();
1897
+ this.categories = [];
1898
+ this.turnoverGroups = [];
1899
+ }
1900
+ showClass() {
1901
+ return true;
1902
+ }
1903
+ ngOnInit() {
1904
+ this.categories.length = 0;
1905
+ this.turnoverGroups.length = 0;
1906
+ this.getCategories();
1907
+ }
1908
+ getCategories() {
1909
+ return __awaiter(this, void 0, void 0, function* () {
1910
+ try {
1911
+ this._catalogService.getCategories().then((cats) => {
1912
+ this.categories = cats;
1913
+ this.prepareTurnoverGroups();
1914
+ });
1915
+ }
1916
+ catch (e) {
1917
+ }
1918
+ });
1919
+ }
1920
+ prepareTurnoverGroups() {
1921
+ this.categories.forEach((category) => {
1922
+ category.turnoverGroups.forEach(tog => this._catalogService.prepareTurnoverGroupImage(tog));
1923
+ this.turnoverGroups.push(...category.turnoverGroups);
1924
+ });
1925
+ }
1926
+ handleCategoryClick(event, category) {
1927
+ this.categoryClick.emit(category);
1928
+ }
1929
+ handleTurnoverGroupClick(event, turnovergroupNr) {
1930
+ this.turnoverGroupClick.emit(turnovergroupNr);
1931
+ }
1932
+ }
1933
+ CatalogCategoriesComponent.decorators = [
1934
+ { type: Component, args: [{
1935
+ selector: 'co-catalog-categories',
1936
+ template: `
1937
+ <div class="catalog-categories-wrapper">
1938
+ <ng-container *ngIf="categories && categories.length > 0">
1939
+ <div class="categories-wrapper">
1940
+ <div class="category-item" *ngFor="let category of categories" (click)="handleCategoryClick($event, category.category)">
1941
+ <co-image [source]="category.imageData"></co-image>
1942
+ <div class="category-description">
1943
+ <co-responsive-text [text]="category.category | localize"></co-responsive-text>
1944
+ </div>
1945
+ <!--
1946
+ <span [textContent]="category.category | localize"></span>
1947
+ -->
1948
+ </div>
1949
+ </div>
1950
+ <ng-container *ngIf="showTurnoverGroups">
1951
+ <div class="turnovergroup-wrapper" *ngFor="let category of categories">
1952
+ <div class="turnovergroup-items-wrapper" *ngIf="category.turnoverGroups && category.turnoverGroups.length > 0">
1953
+ <div class="category-title" [textContent]="category.category | localize"></div>
1954
+ <div class="turnovergroup-item-wrapper">
1955
+ <div class="turnovergroup-item" *ngFor="let turnoverGroup of category.turnoverGroups"
1956
+ (click)="handleTurnoverGroupClick($event, turnoverGroup.turnovergroupNr)">
1957
+ <co-image [source]="turnoverGroup.imageData"></co-image>
1958
+ <div class="turnovergroup-description" [textContent]="turnoverGroup.description | localize"></div>
1959
+ </div>
1960
+ </div>
1961
+ </div>
1962
+ </div>
1963
+ </ng-container>
1964
+ </ng-container>
1965
+ </div>
1966
+ `,
1967
+ encapsulation: ViewEncapsulation.None
1968
+ },] }
1969
+ ];
1970
+ CatalogCategoriesComponent.ctorParameters = () => [
1971
+ { type: CatalogService }
1972
+ ];
1973
+ CatalogCategoriesComponent.propDecorators = {
1974
+ showTurnoverGroups: [{ type: Input }],
1975
+ categoryClick: [{ type: Output }],
1976
+ turnoverGroupClick: [{ type: Output }],
1977
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-categories',] }]
1978
+ };
1979
+
1312
1980
  /** AUTO GENERATED FILE. DO NOT CHANGE.. **/
1313
1981
  var IconEnum;
1314
1982
  (function (IconEnum) {
@@ -1383,87 +2051,25 @@ class IconCacheService {
1383
2051
  }
1384
2052
  }
1385
2053
  }
2054
+ IconCacheService.ɵprov = i0.ɵɵdefineInjectable({ factory: function IconCacheService_Factory() { return new IconCacheService(i0.ɵɵinject(i1.DomSanitizer)); }, token: IconCacheService, providedIn: "root" });
1386
2055
  IconCacheService.decorators = [
1387
- { type: Injectable }
2056
+ { type: Injectable, args: [{
2057
+ providedIn: 'root'
2058
+ },] }
1388
2059
  ];
1389
2060
  IconCacheService.ctorParameters = () => [
1390
2061
  { type: DomSanitizer }
1391
2062
  ];
1392
2063
 
1393
- class TopContentComponent {
1394
- constructor(catalog, iconCache) {
1395
- this.catalog = catalog;
1396
- this.iconCache = iconCache;
1397
- this.Icons = IconEnum;
1398
- this.collapsed = true;
1399
- }
1400
- ngOnInit() {
1401
- }
1402
- onHandleClick(event) {
1403
- this.collapsed = !this.collapsed;
1404
- }
1405
- onSubmitSearch(event) {
1406
- // this.catalog.articleSearchFilters.general = this.searchedText.length > 0 ? this.searchedText.join(' ') : null;
1407
- // this.catalog.articleSearchFilters.description = this.searchedText.length > 0 ? this.searchedText[0] : null;
1408
- this.catalog.searchArticles();
1409
- }
1410
- }
1411
- TopContentComponent.decorators = [
1412
- { type: Component, args: [{
1413
- selector: 'app-top-content',
1414
- template: "<div class=\"search-wrapper\">\n <div class=\"main-search\">\n <co-input-text-chips class=\"search-text\" [placeholder]=\"'Zoek op nummer of naam' | localize\" [(value)]=\"catalog.filterText\" (submit)=\"onSubmitSearch($event)\"></co-input-text-chips>\n </div>\n <div *ngIf=\"!collapsed\" @showAdvancedSearch class=\"advanced-search-wrapper\">\n <h2 [textContent]=\"'ADVANCED_SEARCH_OPTIONS' | localize\"></h2>\n <div class=\"advanced-search\">\n <div class=\"flex-column\">\n <co-input-text [label]=\"'NAME' | localize\" [(model)]=\"catalog.articleSearchFilters.name\"></co-input-text>\n </div>\n <div class=\"flex-column\">\n <co-input-yes-no [label]=\"'3D artikel'\" [(model)]=\"catalog.articleSearchFilters.showCompositionArticles\" [trueValue]=\"'Ja'\" [falseValue]=\"'Nee'\"></co-input-yes-no>\n <co-input-yes-no [label]=\"'Inactieve artikelen'\" [(model)]=\"catalog.articleSearchFilters.showInactiveArticles\" [trueValue]=\"'Ja'\" [falseValue]=\"'Nee'\"></co-input-yes-no>\n <co-input-yes-no [label]=\"'Automatisch updaten'\" [(model)]=\"catalog.articleSearchFilters.doSync\" [trueValue]=\"'Ja'\" [falseValue]=\"'Nee'\"></co-input-yes-no>\n </div>\n <div class=\"flex-column\">\n <co-input-text [label]=\"'Inkoopomschrijving'\" [(model)]=\"catalog.articleSearchFilters.purchaseDescription\"></co-input-text>\n <co-input-text [label]=\"'Artikelnummer leverancier'\" [(model)]=\"catalog.articleSearchFilters.artNrSupplier\"></co-input-text>\n <co-input-text [label]=\"'Referentie'\" [(model)]=\"catalog.articleSearchFilters.simpleReference\"></co-input-text>\n </div>\n </div>\n </div>\n</div>\n<div class=\"button-bar\" *ngIf=\"false\">\n <div class=\"reset-filter flex-row\" (click)=\"catalog.resetFilters()\">\n <co-icon class=\"tiny no-border\" [icon]=\"Icons.Refresh\"></co-icon>\n <span [textContent]=\"'Alles leegmaken'\"></span>\n </div>\n <co-button [label]=\"'Zoeken'\" [iconData]=\"iconCache.getIcon(Icons.Search)\" (onClick)=\"catalog.searchArticles()\"></co-button>\n</div>\n<app-icon-handle *ngIf=\"false\" [icon]=\"Icons.ArrowScrollLeft\" (onHandleClick)=\"onHandleClick($event)\" [horizontal]=\"true\"></app-icon-handle>\n",
1415
- animations: [
1416
- trigger('showAdvancedSearch', [
1417
- state('void', style({ height: '0' })),
1418
- state('*', style({ height: '*' })),
1419
- transition('void <=> *', animate(200))
1420
- ])
1421
- ],
1422
- styles: [":host{display:flex;position:relative;flex-direction:column;max-width:100%}app-icon-handle{position:absolute;top:calc(100% - 17px);left:50%}app-icon-handle ::ng-deep co-icon{transform:rotate(90deg)}.search-wrapper{display:flex;flex-direction:column;padding-right:0}.main-search{display:flex;width:100%;flex-direction:row;align-items:center}.search-title{padding-left:0;margin:15px 0;width:380px;box-sizing:border-box}.search-text{justify-self:center;width:440px;border-radius:0}.search-text ::ng-deep div.chips-wrap{height:31px}.search-text ::ng-deep co-input-text{height:32px!important;width:440px!important;margin:0;border-style:solid;border-width:0 0 2px 0;border-color:#dce4ea;border-radius:10px;background:#f5f5fc}.search-text ::ng-deep co-input-text input{height:42px!important;width:100%}.search-text ::ng-deep co-input-text co-icon{width:45px;height:45px}.search-text ::ng-deep co-input-text .vertical-divider{position:relative;top:-2px}.search-text ::ng-deep co-chip-render{height:24px}.advanced-search-wrapper{overflow:hidden}.advanced-search{display:flex;flex-direction:row;flex-wrap:wrap}.advanced-search>div:not(:last-child){margin-right:10px}.button-bar{padding:30px 0;display:flex;align-items:center;justify-content:center}.reset-filter{cursor:pointer;font-size:13px}.flex-column{display:flex;flex-grow:1;flex-direction:column;max-width:340px}.flex-row{display:flex;flex-direction:row}@media screen and (max-width: 550px){.search-wrapper{padding:10px 0}.search-title{display:none;margin:15px 15px 15px 0;font-size:18px;padding:0}}\n"]
1423
- },] }
1424
- ];
1425
- TopContentComponent.ctorParameters = () => [
1426
- { type: CatalogService },
1427
- { type: IconCacheService }
1428
- ];
1429
- TopContentComponent.propDecorators = {
1430
- label: [{ type: Input }],
1431
- description: [{ type: Input }]
1432
- };
1433
-
1434
- class MainContentComponent {
1435
- ngOnInit() {
1436
- }
1437
- }
1438
- MainContentComponent.decorators = [
1439
- { type: Component, args: [{
1440
- selector: 'app-main-content',
1441
- template: "<app-catalog-page></app-catalog-page>\n",
1442
- styles: [""]
1443
- },] }
1444
- ];
1445
-
1446
- class LeftContentComponent {
1447
- ngOnInit() {
1448
- }
1449
- }
1450
- LeftContentComponent.decorators = [
1451
- { type: Component, args: [{
1452
- selector: 'app-left-content',
1453
- template: "<app-catalog-filter></app-catalog-filter>\r\n",
1454
- styles: [""]
1455
- },] }
1456
- ];
1457
-
1458
2064
  class CatalogFilterComponent {
1459
- constructor(catalog, filterService, iconCache, optionsService, changeDetector) {
1460
- this.catalog = catalog;
2065
+ constructor(catalogSearchService, filterService, iconCache, optionsService, changeDetector) {
2066
+ this.catalogSearchService = catalogSearchService;
1461
2067
  this.filterService = filterService;
1462
2068
  this.iconCache = iconCache;
1463
2069
  this.optionsService = optionsService;
1464
2070
  this.changeDetector = changeDetector;
1465
2071
  this.icons = IconEnum;
1466
- this.ownClass = true;
2072
+ this.showResetFilter = true;
1467
2073
  this.collapsed = false;
1468
2074
  this._subs = [];
1469
2075
  this._min = 0;
@@ -1475,9 +2081,11 @@ class CatalogFilterComponent {
1475
2081
  // })
1476
2082
  // ];
1477
2083
  }
2084
+ showClass() {
2085
+ return true;
2086
+ }
1478
2087
  ngOnInit() {
1479
2088
  // because our <co-checkbox-select> components will output a selectionStringChange on their init, which effectively changes this.filters
1480
- this.catalog.catalogShown = true;
1481
2089
  this.collapsed = this.optionsService.collapseFilterByDefault;
1482
2090
  if (window.innerWidth <= 950) {
1483
2091
  this.collapsed = true;
@@ -1496,7 +2104,7 @@ class CatalogFilterComponent {
1496
2104
  this._max = this.filterService.priceMaxFilter;
1497
2105
  }
1498
2106
  resetFilters(event) {
1499
- this.catalog.resetFilters();
2107
+ this.catalogSearchService.resetFilters();
1500
2108
  }
1501
2109
  onHandleClick(event) {
1502
2110
  this.collapsed = !this.collapsed;
@@ -1527,34 +2135,13 @@ class CatalogFilterComponent {
1527
2135
  this.filterService.priceMinFilter = !!this.filterService.priceMinFilter ? this.filterService.priceMinFilter : this._min;
1528
2136
  this.filterService.priceMaxFilter = !!this.filterService.priceMaxFilter ? this.filterService.priceMaxFilter : this._max;
1529
2137
  // some user error protection
1530
- let trueLowerBound = Math.min(this.filterService.priceMinFilter, this.filterService.priceMaxFilter);
1531
- let trueUpperBound = Math.max(this.filterService.priceMinFilter, this.filterService.priceMaxFilter);
1532
- this.catalog.articleSearchFilters.rangePrice = `${trueLowerBound} - ${trueUpperBound}`;
1533
- this.catalog.searchArticles();
1534
- }
1535
- handleCollectionChange(collection) {
1536
- this.catalog.filterOnCollection(collection);
1537
- }
1538
- filterOnItem(item) {
1539
- // todo: fix this crappy map
1540
- const mapFilterName = this.filterService.filterItemMap.get(item.filter.filterName);
1541
- if (!mapFilterName) {
1542
- return;
1543
- }
1544
- const filterItemOfRequest = this.catalog.articleSearchFilters[mapFilterName] || "";
1545
- const arr = filterItemOfRequest ? filterItemOfRequest.split(',') : [];
1546
- if (item.checked) { // add
1547
- if (arr.indexOf(item.code) < 0) {
1548
- arr.push(`?='${item.code}'`);
1549
- }
1550
- }
1551
- else { // remove
1552
- if (arr.indexOf(item.code) < 0) {
1553
- arr.splice(arr.indexOf(item.code), 1);
1554
- }
1555
- }
1556
- this.catalog.articleSearchFilters[mapFilterName] = arr.join(',');
1557
- this.catalog.searchArticles();
2138
+ let trueLowerBound = Math.min(this.filterService.priceMinFilter, this.filterService.priceMaxFilter);
2139
+ let trueUpperBound = Math.max(this.filterService.priceMinFilter, this.filterService.priceMaxFilter);
2140
+ this.catalogSearchService.searchRequest.rangePrice = `${trueLowerBound} - ${trueUpperBound}`;
2141
+ this.catalogSearchService.searchArticles();
2142
+ }
2143
+ handleCollectionChange(collection) {
2144
+ this.catalogSearchService.filterOnCollection(collection);
1558
2145
  }
1559
2146
  detectChanges() {
1560
2147
  if (!this._destroyed) {
@@ -1564,8 +2151,74 @@ class CatalogFilterComponent {
1564
2151
  }
1565
2152
  CatalogFilterComponent.decorators = [
1566
2153
  { type: Component, args: [{
1567
- selector: 'app-catalog-filter',
1568
- template: "<div class=\"narrow-scrollbar hide-on-collapse\">\r\n <div *ngIf=\"!collapsed\" class=\"filter-title title-bottom-border block-center-align\">\r\n\r\n <h3 [textContent]=\"'FILTER' | localize\"></h3>\r\n <div class=\"handle-wrapper\">\r\n <co-icon class=\"filter-reset-icon\" [iconData]=\"iconCache.getIcon(icons.SyncAlt)\"></co-icon>\r\n <div class=\"filter-reset\" [textContent]=\"'RESET_FILTER' | localize\" (click)=\"resetFilters($event)\"></div>\r\n <app-icon-handle [icon]=\"icons.ArrowScrollLeft\" (onHandleClick)=\"onHandleClick($event)\"></app-icon-handle>\r\n </div>\r\n </div>\r\n\r\n <div class=\"catalog-filter-price-input-wrapper\">\r\n <label class=\"temp\">Price</label>\r\n <div class=\"price-inputs\">\r\n <co-input-text\r\n class=\"price-from\"\r\n [type]=\"'number'\"\r\n [digitsOnly]=\"true\"\r\n [hideArrowButtons]=\"true\"\r\n [excludePlusMinus]=\"true\"\r\n [label]=\"'BASELINE_PRICE' | localize\"\r\n [(model)]=\"filterService.priceMinFilter\"\r\n (modelChange)=\"updatePriceFrom()\"\r\n customWidth\r\n ></co-input-text>\r\n <co-input-text\r\n class=\"price-to\"\r\n [type]=\"'number'\"\r\n [digitsOnly]=\"true\"\r\n [hideArrowButtons]=\"true\"\r\n [excludePlusMinus]=\"true\"\r\n [label]=\"'PRICE_TO' | localize\"\r\n [(model)]=\"filterService.priceMaxFilter\"\r\n (modelChange)=\"updatePriceTo()\"\r\n customWidth\r\n ></co-input-text>\r\n <co-icon [iconData]=\"iconCache.getIcon(icons.Check)\" (click)=\"filterOnPrice()\"></co-icon>\r\n </div>\r\n </div>\r\n <div class=\"catalog-filter-wrapper\">\r\n <co-filter-item\r\n [expanded]=true\r\n [customContent]=\"true\"\r\n class=\"no-header\"\r\n >\r\n <label class=\"temp\">Modified date</label>\r\n <co-input-date\r\n [(model)]=\"catalog.articleSearchFilters.dateModified\"\r\n (modelChange)=\"catalog.searchArticles()\"\r\n ></co-input-date>\r\n </co-filter-item>\r\n <div class=\"catalog-filter-item\" *ngFor=\"let filter of filterService.filters\">\r\n <co-filter-item\r\n [placeholder]=\"filter.filterName\"\r\n [collection]=\"filter.filterItems\"\r\n [showLessLabel]=\"'Bekijk minder...'\"\r\n [showMoreLabel]=\"'Bekijk meer...'\"\r\n [searchPlaceholder]=\"'Zoeken...'\"\r\n [expanded]=true\r\n [initialLimit]=5\r\n (collectionChange)=\"handleCollectionChange($event)\"\r\n ></co-filter-item>\r\n </div>\r\n </div>\r\n</div>\r\n",
2154
+ selector: 'co-catalog-filter',
2155
+ template: `
2156
+ <div class="catalog-filter-wrapper">
2157
+ <div *ngIf="showResetFilter" class="reset-filter-wrapper">
2158
+ <div class="reset-title-wrapper">
2159
+ <div class="reset-title">
2160
+ <div class="reset-filter-title" [textContent]="'FILTER' | localize"></div>
2161
+ <co-icon class="reset-filter-icon" [iconData]="iconCache.getIcon(icons.SyncAlt)"></co-icon>
2162
+ </div>
2163
+ <co-icon-collapse-handle (click)="onHandleClick($event)"></co-icon-collapse-handle>
2164
+ </div>
2165
+ <div class="filter-reset" [textContent]="'RESET_FILTER' | localize" (click)="resetFilters($event)"></div>
2166
+ </div>
2167
+ <div class="filter-items-wrapper co-small-scrollbar">
2168
+ <div class="filter-item-wrapper">
2169
+ <label class="temp">Price</label>
2170
+ <div class="price-inputs">
2171
+ <co-input-text
2172
+ class="price-from"
2173
+ [type]="'number'"
2174
+ [digitsOnly]="true"
2175
+ [hideArrowButtons]="true"
2176
+ [excludePlusMinus]="true"
2177
+ [label]="'BASELINE_PRICE' | localize"
2178
+ [(model)]="filterService.priceMinFilter"
2179
+ (modelChange)="updatePriceFrom()"
2180
+ customWidth
2181
+ ></co-input-text>
2182
+ <co-input-text
2183
+ class="price-to"
2184
+ [type]="'number'"
2185
+ [digitsOnly]="true"
2186
+ [hideArrowButtons]="true"
2187
+ [excludePlusMinus]="true"
2188
+ [label]="'PRICE_TO' | localize"
2189
+ [(model)]="filterService.priceMaxFilter"
2190
+ (modelChange)="updatePriceTo()"
2191
+ customWidth
2192
+ ></co-input-text>
2193
+ <co-icon [iconData]="iconCache.getIcon(icons.Check)" (click)="filterOnPrice()"></co-icon>
2194
+ </div>
2195
+ </div>
2196
+ <div class="filter-item-wrapper">
2197
+ <co-filter-item [placeholder]="'MODIFIED_DATE' | localize"
2198
+ [expanded]="true"
2199
+ [customContent]="true"
2200
+ >
2201
+ <co-input-date
2202
+ [(model)]="catalogSearchService.searchRequest.dateModified"
2203
+ (modelChange)="catalogSearchService.searchArticles()"
2204
+ ></co-input-date>
2205
+ </co-filter-item>
2206
+ </div>
2207
+ <div class="filter-item-wrapper" *ngFor="let filter of filterService.filters">
2208
+ <co-filter-item
2209
+ [placeholder]="filter.filterName"
2210
+ [collection]="filter.filterItems"
2211
+ [showLessLabel]="'Bekijk minder...'"
2212
+ [showMoreLabel]="'Bekijk meer...'"
2213
+ [searchPlaceholder]="'Zoeken...'"
2214
+ [expanded]=true
2215
+ [initialLimit]=5
2216
+ (collectionChange)="handleCollectionChange($event)"
2217
+ ></co-filter-item>
2218
+ </div>
2219
+ </div>
2220
+ </div>
2221
+ `,
1569
2222
  animations: [
1570
2223
  trigger('showFilterItem', [
1571
2224
  state('closed', style({ height: '80px' })),
@@ -1573,97 +2226,131 @@ CatalogFilterComponent.decorators = [
1573
2226
  transition('closed <=> open', animate(200))
1574
2227
  ])
1575
2228
  ],
1576
- styles: ["@charset \"UTF-8\";:host{width:320px;margin:0 60px 0 0;flex-shrink:0;overflow:hidden;height:auto;display:flex;flex-direction:column;transition:all .2s ease}:host.collapsed{width:0px;margin:0}:host.collapsed .hide-on-collapse{display:none}:host>.narrow-scrollbar{overflow:hidden!important}:host h3{margin:20px 0}:host .filter-title{padding-left:10px}:host .filter-title app-icon-handle{display:none}:host .filter-title .handle-wrapper .filter-reset{left:10px}:host .catalog-filter-price-input-wrapper{padding:10px;margin:20px 0;display:block}:host .catalog-filter-price-input-wrapper label.temp{font-size:14px;color:#000;font-family:\"Public sans\";font-weight:bold;margin-bottom:10px;display:block}:host .catalog-filter-price-input-wrapper .price-inputs{align-items:center}:host .catalog-filter-price-input-wrapper .price-inputs co-input-text{width:40%;border-radius:0}:host .catalog-filter-price-input-wrapper .price-inputs co-input-text.price-to{margin-right:5px}:host .catalog-filter-price-input-wrapper .price-inputs co-icon{cursor:pointer;z-index:10;width:25px;height:25px}:host .catalog-filter-item{border-bottom:none}:host ::ng-deep co-filter-item{border-bottom:none!important}:host ::ng-deep co-filter-item.no-header .collapsible-header{display:none!important}:host ::ng-deep co-filter-item .co-collapsible{width:100%}:host ::ng-deep co-filter-item .co-collapsible .expand-icon-wrapper{margin-top:10px;margin-right:18px}:host ::ng-deep co-filter-item .co-collapsible .collapsible-header{height:auto;border-bottom:none}:host ::ng-deep co-filter-item .co-collapsible .collapsible-header .collapsible-title{font-size:14px;color:#000;padding:20px 10px 5px}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content{padding:0 10px 20px}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content co-input-text{position:relative;margin:5px 0 10px;display:block;height:auto;padding:0;border:none}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content co-input-text.cc-input-focused label,:host ::ng-deep co-filter-item .co-collapsible .collapsible-content co-input-text.hasvalue label{display:none}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content co-input-text>label{position:absolute;top:12px;left:10px;cursor:text;font-size:10px;transform:none}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content co-input-text>input{width:100%;border:1px solid #ececec;height:40px;padding:0 10px;margin:0}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content .co-filter-item-collection-results{margin:5px 0 10px}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content .co-filter-item-collection-results .co-filter-item-collection-result-items .co-filter-item-collection-result-item{height:27px}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content .co-filter-show-more-or-less a span{font-size:12px;text-decoration:underline}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content .co-filter-item-custom-content label.temp{font-size:14px;color:#000;font-family:\"Public sans\";font-weight:bold;margin-bottom:10px;display:block}:host ::ng-deep co-filter-item .co-collapsible .collapsible-content .co-filter-item-custom-content co-input-date{height:40px;border:1px solid #ececec;padding:0 10px;line-height:40px}.handle-wrapper{display:flex;flex-direction:row;align-items:center;width:100%}.handle-wrapper .filter-reset-icon{height:26px;width:26px;padding:8px;fill:#3e7eff;margin:0 0 0 10px;font-size:0;box-sizing:border-box;cursor:pointer;border-radius:4px}.handle-wrapper .filter-reset-icon:hover{background:#DCE4EA}.handle-wrapper .filter-reset{cursor:pointer;font-size:11px;color:#3e7eff;position:absolute;margin:40px 0 0;left:20px}.handle-wrapper .filter-reset:hover{text-decoration:underline}.catalog-filter-item-header{font-weight:bold}.selected-filters-block{background:#DCE4EA;padding:15px 20px 20px;border-radius:4px;font-size:13px}.selected-filters-block h4{margin-bottom:5px}.selected-filters-block .selected-filters-list-item{width:100%;display:flex;justify-content:flex-start;align-content:center;padding:3px 0;line-height:20px}.selected-filters-block .selected-filters-list-item co-icon{width:20px;height:20px;cursor:pointer;border-radius:100%}.selected-filters-block .selected-filters-list-item co-icon ::ng-deep svg{width:10px;height:10px;margin:5px}.selected-filters-block .selected-filters-list-item co-icon:hover{background:#fff}.selected-filters-block .selected-filters-list-item span{margin:0 10px}.catalog-filter-price-input-wrapper .price-inputs{display:flex;flex-direction:row;overflow:hidden}.catalog-filter-price-input-wrapper .price-inputs ::ng-deep co-input-text{width:30%}.catalog-filter-price-input-wrapper .price-inputs ::ng-deep co-input-text:after{display:none}.catalog-filter-price-input-wrapper .price-inputs ::ng-deep co-icon{z-index:1!important}.catalog-filter-price-input-wrapper .price-from{margin-right:20px}.catalog-filter-price-input-wrapper co-slider{width:calc(100% - 15px);padding-left:7px;grid-column-start:1;grid-column-end:3}.catalog-filter-price-input-wrapper ::ng-deep co-input-text .input-wrapper{display:flex}.catalog-filter-price-input-wrapper ::ng-deep co-input-text .input-wrapper:before{content:\"\\20ac\";margin-right:5px;font-size:13px}.catalog-filter-price-input-wrapper ::ng-deep co-input-text input{font-family:iOneMontserrat}.catalog-filter-item{overflow:hidden;border-bottom:1px solid #DCE4EA;box-sizing:border-box}.catalog-filter-item.open h3 co-icon{transform:rotate(180deg)}.catalog-filter-item h3{cursor:pointer;position:relative;width:100%;padding-right:30px;box-sizing:border-box}.catalog-filter-item h3 co-icon{display:inline-block;position:absolute;right:0;top:50%;width:20px;height:20px;margin:-10px 0 0;transition:.2s ease-in-out}.catalog-filter-item-items{display:flex;grid-column-gap:5px;column-gap:5px}.catalog-filter-item-items .catalog-filter-item-items-count{opacity:.5}.catalog-filter-item-items .catalog-filter-item-items-count:before{content:\"(\"}.catalog-filter-item-items .catalog-filter-item-items-count:after{content:\")\"}.filter-title{justify-content:space-between;position:relative}app-icon-handle{margin-left:auto}app-icon-handle:hover{background:#DCE4EA}.filter-expand-button{font-size:13px;cursor:pointer;position:absolute;background:#3E7EFF;color:#fff;height:34px;align-items:center;display:flex;justify-content:center;border-radius:0 0 5px 5px;top:95px;font-weight:bold;padding:0 30px 0 10px;display:none}.filter-expand-button:hover{background:#74B77F}.filter-expand-button.show{display:flex}.filter-expand-button co-icon{width:26px;height:26px;margin:0 10px 0 0}.filter-expand-button co-icon ::ng-deep svg path{fill:#fff!important}.filter-icon{cursor:pointer;position:relative;border:1px solid #a2857b;border-radius:50%;margin:10px}.filter-icon ::ng-deep svg [fill]{fill:#a2857b}.filter-icon.filter-active:after{content:\"*\";position:absolute;top:-5px;font-size:20px;right:-5px;color:#a2857b}::ng-deep .catalog-filter h3{margin:0}::ng-deep .catalog-filter h2{line-height:40px}::ng-deep .catalog-filter a{font-size:14px;color:#3e7eff;cursor:pointer}@media screen and (max-width: 950px){:host{position:fixed;left:0;top:0;width:320px;max-width:100%;height:100%;background:#fff;z-index:100;box-shadow:0 0 10px #0000001a;padding-bottom:70px;box-sizing:border-box}:host>.narrow-scrollbar{overflow:auto!important}:host .filter-title{padding-right:10px}:host .filter-expand-button{position:fixed;left:15px;top:auto;bottom:15px;width:calc(100% - 30px);box-shadow:0 0 10px #0000001a;z-index:101;border-radius:5px;height:40px;box-sizing:border-box;display:flex}}\n"]
2229
+ encapsulation: ViewEncapsulation.None
1577
2230
  },] }
1578
2231
  ];
1579
2232
  CatalogFilterComponent.ctorParameters = () => [
1580
- { type: CatalogService },
1581
- { type: FilterService },
2233
+ { type: CatalogSearchService },
2234
+ { type: CatalogFilterService },
1582
2235
  { type: IconCacheService },
1583
- { type: OptionsService },
2236
+ { type: CatalogOptionsService },
1584
2237
  { type: ChangeDetectorRef }
1585
2238
  ];
1586
2239
  CatalogFilterComponent.propDecorators = {
1587
2240
  priceSlider: [{ type: ViewChild, args: [SliderComponent, { static: true },] }],
1588
- ownClass: [{ type: HostBinding, args: ['class.catalog-filter',] }],
2241
+ showResetFilter: [{ type: Input }],
2242
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-filter',] }],
1589
2243
  collapsed: [{ type: HostBinding, args: ['class.collapsed',] }]
1590
2244
  };
1591
2245
 
1592
- class NavigationService {
1593
- constructor(_catalog, _iOne, _optionsService, _imageService) {
1594
- this._catalog = _catalog;
1595
- this._iOne = _iOne;
1596
- this._optionsService = _optionsService;
1597
- this._imageService = _imageService;
1598
- this._subs = [];
1599
- this._connectionMade = false;
1600
- this._optionsSet = false;
1601
- this.navigationCategories = [];
1602
- this.allTurnoverGroups = [];
1603
- this._subs.push(this._iOne.controllerInitialized.subscribe((initialized) => {
1604
- if (initialized) {
1605
- this._connectionMade = true;
1606
- this.getCategories();
1607
- }
1608
- }), this._optionsService.parametersSet.subscribe((set) => {
1609
- if (set) {
1610
- this._optionsSet = true;
1611
- this.getCategories();
1612
- }
1613
- }));
1614
- }
1615
- ngOnDestroy() {
1616
- this._subs.forEach(s => s.unsubscribe());
1617
- }
1618
- setCategory(category) {
1619
- this._catalog.category = category;
1620
- }
1621
- setTurnoverGroup(turnoverGroup) {
1622
- this._catalog.turnoverGroup = turnoverGroup;
1623
- }
1624
- setExternalSourceUrl(url) {
1625
- this._catalog.externalSourceUrl = url;
1626
- }
1627
- setIoneSourceUrl(url, ioneUrl, id, username, password) {
1628
- this._catalog.ioneSourceUrl = url + '?url=' + ioneUrl + '&id=' + id + '&user=' + username + '&pass=' + password;
1629
- }
1630
- navigateToHome() {
1631
- this._catalog.reset();
2246
+ // A pipe for localizing string values in view templates.
2247
+ class LocalizePipe {
2248
+ constructor(_dictionaryService) {
2249
+ this._dictionaryService = _dictionaryService;
1632
2250
  }
1633
- getCategories() {
1634
- return __awaiter(this, void 0, void 0, function* () {
1635
- if (this._optionsSet && this._connectionMade) {
1636
- try {
1637
- this._iOne.getArticleCategories(this._optionsService.parameters.publicationCode).then((cats) => {
1638
- this._catalog.sortTurnoverGroups(cats);
1639
- this.navigationCategories = cats;
1640
- this.navigationCategories.forEach(cat => this._imageService.getCategoryImage(cat));
1641
- this.getTurnoverGroupList();
1642
- });
1643
- }
1644
- catch (e) {
1645
- }
1646
- }
1647
- });
2251
+ transform(value, upperCaseFirst = true, replace = []) {
2252
+ if (!value) {
2253
+ return '';
2254
+ }
2255
+ replace = replace ? replace : [];
2256
+ if (!Array.isArray(replace)) {
2257
+ replace = [replace];
2258
+ }
2259
+ return this._dictionaryService.get(value, upperCaseFirst, ...replace);
1648
2260
  }
1649
- getTurnoverGroupList() {
1650
- this.navigationCategories.forEach((category) => {
1651
- category.turnoverGroups.forEach(tog => this._imageService.getTurnoverGroupImage(tog));
1652
- this.allTurnoverGroups.push(...category.turnoverGroups);
1653
- });
2261
+ }
2262
+ LocalizePipe.decorators = [
2263
+ { type: Pipe, args: [{
2264
+ name: 'localize'
2265
+ },] }
2266
+ ];
2267
+ LocalizePipe.ctorParameters = () => [
2268
+ { type: DictionaryService }
2269
+ ];
2270
+
2271
+ class CatalogFilterModule {
2272
+ }
2273
+ CatalogFilterModule.decorators = [
2274
+ { type: NgModule, args: [{
2275
+ imports: [
2276
+ CommonModule,
2277
+ IconModule,
2278
+ InputTextModule,
2279
+ FilterItemModule,
2280
+ InputDatePickerModule,
2281
+ IconCollapseHandleModule
2282
+ ],
2283
+ declarations: [
2284
+ CatalogFilterComponent,
2285
+ LocalizePipe
2286
+ ],
2287
+ exports: [
2288
+ CatalogFilterComponent,
2289
+ LocalizePipe
2290
+ ]
2291
+ },] }
2292
+ ];
2293
+
2294
+ class ResponsiveTextComponent {
2295
+ showClass() {
2296
+ return true;
1654
2297
  }
1655
2298
  }
1656
- NavigationService.decorators = [
1657
- { type: Injectable }
2299
+ ResponsiveTextComponent.decorators = [
2300
+ { type: Component, args: [{
2301
+ selector: 'co-responsive-text',
2302
+ template: `
2303
+ <svg viewBox="0 0 100 100">
2304
+ <foreignObject height="100%" width="100%">
2305
+ <div class="text" [textContent]="text"></div>
2306
+ </foreignObject>
2307
+ </svg>
2308
+ `,
2309
+ encapsulation: ViewEncapsulation.None
2310
+ },] }
1658
2311
  ];
1659
- NavigationService.ctorParameters = () => [
1660
- { type: CatalogService },
1661
- { type: IOneControllerService },
1662
- { type: OptionsService },
1663
- { type: ImageService }
2312
+ ResponsiveTextComponent.propDecorators = {
2313
+ text: [{ type: Input }],
2314
+ showClass: [{ type: HostBinding, args: ['class.co-responsive-text',] }]
2315
+ };
2316
+
2317
+ class ResponsiveTextModule {
2318
+ }
2319
+ ResponsiveTextModule.decorators = [
2320
+ { type: NgModule, args: [{
2321
+ imports: [
2322
+ CommonModule
2323
+ ],
2324
+ declarations: [
2325
+ ResponsiveTextComponent
2326
+ ],
2327
+ exports: [
2328
+ ResponsiveTextComponent
2329
+ ]
2330
+ },] }
2331
+ ];
2332
+
2333
+ class CatalogCategoriesModule {
2334
+ }
2335
+ CatalogCategoriesModule.decorators = [
2336
+ { type: NgModule, args: [{
2337
+ imports: [
2338
+ CommonModule,
2339
+ ImageModule,
2340
+ IconModule$1,
2341
+ CatalogFilterModule,
2342
+ ResponsiveTextModule
2343
+ ],
2344
+ declarations: [
2345
+ CatalogCategoriesComponent
2346
+ ],
2347
+ exports: [
2348
+ CatalogCategoriesComponent
2349
+ ]
2350
+ },] }
1664
2351
  ];
1665
2352
 
1666
- class AppEventService {
2353
+ class CatalogEventService {
1667
2354
  constructor() {
1668
2355
  this.lookAtArticleButtonClick = new Subject();
1669
2356
  this.addArticleButtonClick = new Subject();
@@ -1672,766 +2359,769 @@ class AppEventService {
1672
2359
  this.stockDetailsClick = new Subject();
1673
2360
  }
1674
2361
  }
1675
- AppEventService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AppEventService_Factory() { return new AppEventService(); }, token: AppEventService, providedIn: "root" });
1676
- AppEventService.decorators = [
2362
+ CatalogEventService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogEventService_Factory() { return new CatalogEventService(); }, token: CatalogEventService, providedIn: "root" });
2363
+ CatalogEventService.decorators = [
1677
2364
  { type: Injectable, args: [{
1678
2365
  providedIn: 'root'
1679
2366
  },] }
1680
2367
  ];
1681
2368
 
1682
- class CatalogPageComponent {
1683
- constructor(catalog, options, changeDetector, navigationService, iconCache, _appEventService) {
1684
- this.catalog = catalog;
1685
- this.options = options;
1686
- this.changeDetector = changeDetector;
1687
- this.navigationService = navigationService;
2369
+ class CatalogNavigationComponent {
2370
+ constructor(iconCache,
2371
+ /*
2372
+ public navigationService: CatalogNavigationService,
2373
+ */
2374
+ catalogService, _appEventService) {
1688
2375
  this.iconCache = iconCache;
2376
+ this.catalogService = catalogService;
1689
2377
  this._appEventService = _appEventService;
1690
2378
  this.icons = IconEnum;
1691
- this.orderByOptions = [
1692
- { id: 1, name: 'ORDER_BY_ARTICLENR' },
1693
- { id: 2, name: 'ORDER_BY_ARTICLENAME' }
1694
- ];
1695
- this.orderByOption = this.orderByOptions[0];
1696
- this.extraColumns = [];
1697
- this._subs = [];
1698
- this._subs.push(this.catalog.categoryChanged.subscribe(category => this._navigationChanged()), this.catalog.turnoverGroupChanged.subscribe(turnoverGroup => this._navigationChanged()), this.catalog.searchTextChanged.subscribe(searchText => this._navigationChanged()));
1699
- }
1700
- set content(columnComponents) {
1701
- this.extraColumns = columnComponents.toArray();
1702
- }
1703
- get article() {
1704
- return this._article;
1705
- }
1706
- ngOnDestroy() {
1707
- this._subs.forEach(s => s.unsubscribe());
1708
- this.destroyed = true;
1709
- this.catalog.listMode = false;
1710
- this.catalog.webMode = true;
1711
- }
1712
- onArticleCardAdd3DButtonClick(event, article) {
1713
- // if (article) {
1714
- // this.messageBus.emit(MessageType.LoadIOneFurnitureIntoSceneBySKU, {
1715
- // sku: article.articleNumber,
1716
- // position: { x: event.clientX, y: event.clientY }
1717
- // });
1718
- // this.catalog.catalogShown = false;
1719
- // }
1720
- }
1721
- handleArticleRowClick(event) {
1722
- this._appEventService.lookAtArticleButtonClick.next(this.article);
1723
- }
1724
- onPreviousClick() {
1725
- this.catalog.currentPage -= 1;
1726
- }
1727
- onNextClick() {
1728
- this.catalog.currentPage += 1;
1729
- }
1730
- onPageClick(pageNr) {
1731
- this.catalog.currentPage = pageNr;
1732
- }
1733
- onArticlesPageChange(qty) {
1734
- this.catalog.articlesPerPage = qty;
1735
- this.detectChanges();
1736
- }
1737
- handleOrderBy(orderBy) {
1738
- this.catalog.changeOrderBy(orderBy);
1739
- this.detectChanges();
1740
- }
1741
- handleViewChange(event) {
1742
- const viewWrapper = event.currentTarget.closest('.view-mode-wrapper');
1743
- const currentView = event.currentTarget;
1744
- const currentClasses = currentView.classList;
1745
- const parentClasses = viewWrapper.classList;
1746
- if (currentClasses.contains('grid')) {
1747
- parentClasses.add('grid');
1748
- parentClasses.remove('list');
1749
- parentClasses.remove('tile');
1750
- this.catalog.listMode = false;
1751
- this.catalog.webMode = false;
1752
- }
1753
- if (currentClasses.contains('list')) {
1754
- parentClasses.add('list');
1755
- parentClasses.remove('grid');
1756
- parentClasses.remove('tile');
1757
- this.catalog.listMode = true;
1758
- this.catalog.webMode = true;
1759
- }
1760
- if (currentClasses.contains('tile')) {
1761
- parentClasses.add('tile');
1762
- parentClasses.remove('grid');
1763
- parentClasses.remove('list');
1764
- this.catalog.listMode = false;
1765
- this.catalog.webMode = true;
1766
- }
1767
- }
1768
- _navigationChanged() {
1769
- this.catalog.currentPage = 1;
1770
- }
1771
- detectChanges() {
1772
- if (!this.destroyed) {
1773
- this.changeDetector.detectChanges();
1774
- }
2379
+ this.homeLabel = 'Home';
2380
+ this.collectionLabel = 'Collection';
2381
+ this.externalSourcesLabel = 'External sources';
2382
+ this.showTurnoverGroups = true;
2383
+ this.homeClick = new EventEmitter();
2384
+ this.categoryClick = new EventEmitter();
2385
+ this.turnoverGroupClick = new EventEmitter();
2386
+ this.minified = false;
2387
+ this.showClass = true;
2388
+ this.mobileMenuToggle = false;
2389
+ this.categories = [];
2390
+ this.turnoverGroups = [];
2391
+ this.showCollectionOverlay = false;
2392
+ this.showExternalOverlay = false;
1775
2393
  }
1776
- }
1777
- CatalogPageComponent.decorators = [
1778
- { type: Component, args: [{
1779
- selector: 'app-catalog-page',
1780
- template: "<div class=\"title-bottom-border block-center-align page-title\">\n <h3 [textContent]=\"catalog.showcaseTitle | localize\"></h3>\n <div class=\"catalog-toolbar\">\n <div class=\"order-by-wrapper\">\n <span class=\"order-by-desc\" [textContent]=\"'ORDER_BY' | localize\"></span>\n <select class=\"order-by-select\" [ngModel]=\"orderByOption\" (ngModelChange)=\"handleOrderBy($event)\">\n <option *ngFor=\"let option of orderByOptions\" [ngValue]=\"option\" [textContent]=\"option.name | localize\"></option>\n </select>\n </div>\n <div class=\"view-mode-wrapper tile\">\n <co-button [label]=\"\"\n class=\"open-icon action pointer tile\"\n (onClick)=\"handleViewChange($event)\"\n [iconData]=\"iconCache.getIcon(icons.TileView)\">\n </co-button>\n <co-button [label]=\"\"\n class=\"open-icon action pointer list\"\n (onClick)=\"handleViewChange($event)\"\n [iconData]=\"iconCache.getIcon(icons.ListView)\">\n </co-button>\n <co-button [label]=\"\"\n class=\"open-icon action pointer grid\"\n (onClick)=\"handleViewChange($event)\"\n [iconData]=\"iconCache.getIcon(icons.GridView)\">\n </co-button>\n </div>\n </div>\n</div>\n\n<div *ngIf=\"catalog.webMode\" class=\"article-cards\" [class.list-view]=\"catalog.listMode\" visibilityObserverMaster>\n <ng-container *ngFor=\"let article of catalog.filteredArticlesOnShowcase\">\n <app-article-card\n visibilityObserver\n #intersection=\"intersection\"\n [observerEnabled]=\"!article.imageData\"\n [showing]=\"intersection.isIntersecting\"\n [article]=\"article\"\n [class.list-card]=\"catalog.listMode\"\n (threeDButtonClick)=\"onArticleCardAdd3DButtonClick($event, article)\"\n >\n </app-article-card>\n </ng-container>\n</div>\n<div *ngIf=\"!catalog.webMode\" class=\"article-grid\">\n <co-simple-grid\n [data]=\"catalog.filteredArticlesOnShowcase\"\n [extraColumns]=\"extraColumns\"\n [dragDropEnabled]=\"true\"\n [emitDragDrop]=\"false\"\n (selectRow)=\"handleArticleRowClick($event)\">\n >\n <co-simple-grid-column [headerText]=\"'SKU' | localize\" [field]=\"'articleNumber'\"\n [order]=\"20\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'NAME' | localize\" [field]=\"'name'\"\n [order]=\"30\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'DESCRIPTION' | localize\" [field]=\"'description'\"\n [order]=\"40\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'ADDITIONAL_DESCRIPTION' | localize\" [field]=\"'additionalDescription'\"\n [order]=\"50\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'SALES_DESCRIPTION' | localize\" [field]=\"'salesDescription'\"\n [order]=\"70\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'PURCHASE_DESCRIPTION' | localize\" [field]=\"'buyerDescription'\"\n [order]=\"80\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'CONFIGURATION' | localize\" [field]=\"'configuration'\"\n [order]=\"90\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'COLOR_DESCRIPTION' | localize\" [field]=\"'colorDescription'\"\n [order]=\"100\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'HEIGHT' | localize\" [field]=\"'height'\"\n [order]=\"110\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'WIDTH' | localize\" [field]=\"'width'\"\n [order]=\"120\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'LENGTH' | localize\" [field]=\"'length'\"\n [order]=\"130\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'SALES_PRICE' | localize\" [field]=\"'price'\"\n [order]=\"140\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'PURCHASE_PRICE' | localize\" [field]=\"'purchasePrice'\"\n [order]=\"150\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'MAIN_ARTICLE' | localize\" [field]=\"'superArticleDescr'\"\n [order]=\"160\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'TURNOVER_GROUP' | localize\" [field]=\"'turnoverGroupDescr'\"\n [order]=\"170\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'CURRENCY' | localize\" [field]=\"'currency'\"\n [order]=\"180\"></co-simple-grid-column>\n <co-simple-grid-column [headerText]=\"'ARTICLE_TYPE' | localize\" [field]=\"'articleType'\"\n [order]=\"190\"></co-simple-grid-column>\n </co-simple-grid>\n</div>\n<co-pagination-bar *ngIf=\"catalog.articlesOnShowcase?.length > 0\"\n [currentPage]=\"catalog.currentPage\"\n [itemsPerPage]=\"catalog.articlesPerPage\"\n [totalItems]=\"catalog.resultCount\"\n [previousLabel]=\"'PREVIOUS' | localize\"\n [nextLabel]=\"'NEXT' | localize\"\n [autoHide]=\"true\"\n [directionLinks]=\"true\"\n [paginationRange]=\"8\"\n (previousClick)=\"onPreviousClick()\"\n (nextClick)=\"onNextClick()\"\n (pageClick)=\"onPageClick($event)\">\n</co-pagination-bar>\n",
1781
- styles: [":host{width:100%;height:100%;display:flex;flex-direction:column}ul.slides{display:block;list-style:none;padding-left:0;width:100%;float:left;margin:0}ul.slides span{float:left;width:100%;margin-top:30px}ul.slides li{float:left;margin:10px 10px 0 0;font-size:12px;position:relative;width:150px;height:100px;text-align:center;background:#ececec;cursor:pointer}ul.slides li span{transform:translateY(-50%);top:50%;position:absolute;left:0}ul.slides li.active{border:1px solid #3E7EFF;color:#3e7eff;font-weight:600}.catalog-toolbar{display:flex;align-items:center;grid-gap:15px;gap:15px}.view-mode-wrapper{display:flex;flex-direction:row;grid-gap:5px;gap:5px}.view-mode-wrapper co-button{padding:5px!important;height:30px;width:30px;border-radius:3px;cursor:pointer;background:#fff;border:1px solid #dce4ea;justify-content:center;align-items:center;display:flex}.view-mode-wrapper co-button ::ng-deep co-icon{width:20px;height:20px}.view-mode-wrapper co-button ::ng-deep co-icon [fill]{fill:#000}.view-mode-wrapper.list co-button.list{background:#3E7EFF}.view-mode-wrapper.list co-button.list ::ng-deep co-icon [fill]{fill:#fff}.view-mode-wrapper.grid co-button.grid{background:#3E7EFF}.view-mode-wrapper.grid co-button.grid ::ng-deep co-icon [fill]{fill:#fff}.view-mode-wrapper.tile co-button.tile{background:#3E7EFF}.view-mode-wrapper.tile co-button.tile ::ng-deep co-icon [fill]{fill:#fff}.order-by-desc{font-size:11px;margin-right:10px}.order-by-select{font-family:iOneMontserrat;font-size:11px;border:1px solid #e4edf4;border-radius:5px;background-color:#fff;height:38px;padding:5px;max-width:100%}.page-title{justify-content:space-between;display:flex}.page-title span{font-size:13px}.article-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,.5fr));grid-gap:20px;gap:20px;flex-basis:100%;padding:40px 0;z-index:1}.article-cards.list-view{grid-template-columns:none}::ng-deep co-pagination{height:auto!important;padding:30px 20px;border-style:solid;border-color:#dce4ea;border-width:1px 0 0 0}::ng-deep co-pagination .pagination-component-main-wrapper{padding:0!important}::ng-deep co-pagination ul{margin:0;justify-content:center!important}::ng-deep co-pagination ul li{border-radius:5px!important;border-color:#fff!important;color:#22313c!important;cursor:pointer!important;margin-right:8px!important}::ng-deep co-pagination ul li:hover{background:#DCE4EA!important;border:2px solid #DCE4EA}::ng-deep co-pagination ul li.pagination-previous,::ng-deep co-pagination ul li.pagination-next,::ng-deep co-pagination ul li.pagination-previous a,::ng-deep co-pagination ul li.pagination-next a{font-size:0!important;padding:0!important;line-height:0}::ng-deep co-pagination ul li.pagination-previous a:before,::ng-deep co-pagination ul li.pagination-next a:after{margin:0!important;border-color:#22313c!important;border-width:0 2px 2px 0!important}::ng-deep co-pagination ul li.current{background:#DCE4EA!important;border-color:#3e7eff!important;color:#222!important;border-width:2px!important}::ng-deep co-pagination ul li a{color:#22313c!important;width:40px!important}@media screen and (max-width: 940px){.article-cards{grid-gap:15px 0;gap:15px 0;grid-template-columns:repeat(auto-fill,minmax(220px,.5fr))}}@media screen and (max-width: 480px){.article-cards{grid-template-columns:1fr}.page-title{display:block;padding-left:0}.page-title .order-by-wrapper{margin-top:15px}}\n"]
1782
- },] }
1783
- ];
1784
- CatalogPageComponent.ctorParameters = () => [
1785
- { type: CatalogService },
1786
- { type: OptionsService },
1787
- { type: ChangeDetectorRef },
1788
- { type: NavigationService },
1789
- { type: IconCacheService },
1790
- { type: AppEventService }
1791
- ];
1792
- CatalogPageComponent.propDecorators = {
1793
- pagination: [{ type: ViewChild, args: [PaginationComponent, { static: true },] }],
1794
- content: [{ type: ContentChildren, args: [SimpleGridColumnDirective,] }]
1795
- };
1796
-
1797
- class CatalogExternalComponent {
1798
- constructor(catalog, _appEventService, _sanitizer, _ref, _renderer) {
1799
- this.catalog = catalog;
1800
- this._appEventService = _appEventService;
1801
- this._sanitizer = _sanitizer;
1802
- this._ref = _ref;
1803
- this._renderer = _renderer;
1804
- this.layout = {};
1805
- this._subs = [];
1806
- this._renderer.addClass(document.body, 'external');
1807
- this._subs.push(this.catalog.externalSourceChanged.subscribe(changed => {
1808
- if (changed) {
1809
- if (this.externalSourceFrame && this.externalSourceFrame.nativeElement) {
1810
- this.externalSourceFrame.nativeElement.src = '';
1811
- this.externalSourceFrame.nativeElement.src = this.catalog.externalSourceUrl;
1812
- }
2394
+ get internalList() {
2395
+ let list = [];
2396
+ this.catalogService.externalSourceViewModels.forEach(element => {
2397
+ if (element.catalogDefinition.useCatalogPage && element.externalSource.url !== '') {
2398
+ list.push(element);
1813
2399
  }
1814
- }));
2400
+ });
2401
+ return list;
1815
2402
  }
1816
- ngAfterViewInit() {
1817
- this._ref.detach();
2403
+ get externalList() {
2404
+ let list = [];
2405
+ this.catalogService.externalSourceViewModels.forEach(element => {
2406
+ if (!element.catalogDefinition.useCatalogPage && element.externalSource.url !== '') {
2407
+ list.push(element);
2408
+ }
2409
+ });
2410
+ return list;
1818
2411
  }
1819
2412
  ngOnInit() {
2413
+ this.categories.length = 0;
2414
+ this.turnoverGroups.length = 0;
2415
+ this.getCategories();
1820
2416
  }
1821
- ngOnDestroy() {
1822
- this._renderer.removeClass(document.body, 'external');
1823
- this._subs.forEach(s => s.unsubscribe());
1824
- }
1825
- getSafeUrl() {
1826
- return this._sanitizer.bypassSecurityTrustResourceUrl(this.catalog.externalSourceUrl);
1827
- }
1828
- }
1829
- CatalogExternalComponent.decorators = [
1830
- { type: Component, args: [{
1831
- selector: 'app-external-catalog',
1832
- template: "<iframe #externalSourceFrame class=\"external-iframe\" [src]=\"getSafeUrl()\"></iframe>\r\n\r\n",
1833
- styles: ["body{overflow:hidden!important}:host{transform:translate(0)}:host iframe{width:100%;height:100vh;border:none}\n"]
1834
- },] }
1835
- ];
1836
- CatalogExternalComponent.ctorParameters = () => [
1837
- { type: CatalogService },
1838
- { type: AppEventService },
1839
- { type: DomSanitizer },
1840
- { type: ChangeDetectorRef },
1841
- { type: Renderer2 }
1842
- ];
1843
- CatalogExternalComponent.propDecorators = {
1844
- externalSourceFrame: [{ type: ViewChild, args: ['externalSourceFrame', { read: ElementRef },] }]
1845
- };
1846
-
1847
- class CatalogHomeComponent {
1848
- constructor(iconCache, navigationService, catalogService) {
1849
- this.iconCache = iconCache;
1850
- this.navigationService = navigationService;
1851
- this.catalogService = catalogService;
1852
- this.icons = IconEnum;
1853
- this.minified = false;
1854
- }
1855
- onSetCategory(event, category) {
1856
- this.navigationService.setCategory(category);
1857
- }
1858
- onSetTurnoverGroup(event, turnoverGroup) {
1859
- this.navigationService.setTurnoverGroup(turnoverGroup);
2417
+ getCategories() {
2418
+ return __awaiter(this, void 0, void 0, function* () {
2419
+ try {
2420
+ this.catalogService.getCategories().then((cats) => {
2421
+ this.categories = cats;
2422
+ this.prepareTurnoverGroups();
2423
+ });
2424
+ }
2425
+ catch (e) {
2426
+ }
2427
+ });
1860
2428
  }
1861
- onOpenExternalCatalog(event, webviewUrl) {
1862
- this.navigationService.setExternalSourceUrl(webviewUrl);
2429
+ prepareTurnoverGroups() {
2430
+ if (this.categories && this.categories.length > 0) {
2431
+ this.categories.forEach((category) => {
2432
+ category.turnoverGroups.forEach(tog => this.catalogService.prepareTurnoverGroupImage(tog));
2433
+ this.turnoverGroups.push(...category.turnoverGroups);
2434
+ });
2435
+ }
1863
2436
  }
1864
- }
1865
- CatalogHomeComponent.decorators = [
1866
- { type: Component, args: [{
1867
- selector: 'app-home-catalog',
1868
- template: "<div class=\"component-wrapper\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"home-wrapper\">\r\n <div class=\"category-wrapper home-block\" *ngIf=\"navigationService.navigationCategories && navigationService.navigationCategories.length > 0\">\r\n <ul class=\"slides\">\r\n <li class=\"carousel-cell\" *ngFor=\"let category of navigationService.navigationCategories\" (click)=\"onSetCategory($event, category.category)\">\r\n <co-image *ngIf=\"category.imageData\" [source]=\"category.imageData\"></co-image>\r\n <div class=\"no-image-wrapper\" *ngIf=\"!category.imageData\">\r\n <co-icon class=\"no-image\" [iconData]=\"iconCache.getIcon(icons.Camera)\"></co-icon>\r\n </div>\r\n <span [textContent]=\"category.category | localize\"></span>\r\n </li>\r\n </ul>\r\n </div>\r\n <div class=\"turnover-wrapper home-block\" *ngIf=\"navigationService.navigationCategories && navigationService.navigationCategories.length > 0\">\r\n <div class=\"slide-wrapper\" *ngFor=\"let category of navigationService.navigationCategories\">\r\n <div class=\"slide-condition\" *ngIf=\"category.turnoverGroups && category.turnoverGroups.length > 0\">\r\n <span class=\"slide-title\">\r\n <span class=\"inner-title\" [textContent]=\"category.category | localize\"></span>\r\n </span>\r\n <ul class=\"slides\">\r\n <li class=\"carousel-cell\" *ngFor=\"let turnoverGroup of category.turnoverGroups\" (click)=\"onSetTurnoverGroup($event, turnoverGroup.turnovergroupNr)\">\r\n <co-image *ngIf=\"turnoverGroup.imageData\" [source]=\"turnoverGroup.imageData\"></co-image>\r\n <div class=\"no-image-wrapper\" *ngIf=\"!turnoverGroup.imageData\">\r\n <co-icon class=\"no-image\" [iconData]=\"iconCache.getIcon(icons.Camera)\"></co-icon>\r\n </div>\r\n <span [textContent]=\"turnoverGroup.description | localize\"></span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n",
1869
- styles: [":host .component-wrapper{display:flex;flex-direction:column;height:100%}:host .component-wrapper .page-wrapper{display:flex;flex-direction:row;padding:0 15px;margin:0 auto;width:100%}:host .component-wrapper .page-wrapper .home-wrapper{padding-bottom:60px}:host .component-wrapper .page-wrapper .home-wrapper .home-block{padding:15px 0;overflow:hidden}:host .slide-condition{display:block;margin:30px 0 60px;float:left;width:100%}:host .slide-condition .slide-title{position:relative}:host .slide-condition .slide-title .inner-title{text-transform:capitalize;font-weight:700;font-size:16px}:host .slide-condition ul.slides{display:flex;list-style:none;padding-left:0;width:100%;float:left;margin:0}:host .slide-condition ul.slides span{float:left;width:100%;margin-top:10px;position:absolute;text-align:left;transform:none;bottom:-25px;left:0;font-weight:600;font-size:12px}:host .slide-condition ul.slides li{float:left;margin:0 10px 0 0;font-size:12px;position:relative;width:calc(25% - 9px);max-width:200px;min-height:150px;max-height:200px;text-align:center;cursor:pointer}:host .slide-condition ul.slides li:hover{opacity:.9}:host .slide-condition ul.slides li co-image ::ng-deep{display:block;height:100%}:host .slide-condition ul.slides li co-image ::ng-deep img{object-fit:cover}:host .slide-condition ul.slides li.active{border:1px solid #3E7EFF;color:#3e7eff;font-weight:600}:host .slide-condition ul.slides li:last-child{margin-right:0}:host .slide-condition ul.slides li .no-image-wrapper{background:#ececec;width:100%;height:100%;display:flex;text-align:center;align-items:center}:host .slide-condition ul.slides li .no-image-wrapper co-icon{width:60px;height:60px;margin:0 auto;opacity:.3}:host .category-wrapper ul.slides{display:block;list-style:none;padding-left:0;width:100%;float:left;margin:0}:host .category-wrapper ul.slides li{width:calc(20% - 8px);height:auto;background:transparent;float:left;margin:10px 10px 0 0;font-size:12px;position:relative;text-align:center;cursor:pointer}:host .category-wrapper ul.slides li span{margin-top:0;font-size:24px;text-transform:capitalize;font-weight:700;text-shadow:0 2px 3px rgba(1,1,1,.55);color:#fff;transform:translateY(-50%);top:50%;position:absolute;left:0;text-align:center;width:100%}:host .category-wrapper ul.slides li:hover{opacity:.9}:host .category-wrapper ul.slides li co-image ::ng-deep{width:100%}:host .category-wrapper ul.slides li co-image ::ng-deep img{filter:brightness(80%);width:100%}:host .category-wrapper ul.slides li:nth-child(5n){margin-right:0}\n"]
1870
- },] }
1871
- ];
1872
- CatalogHomeComponent.ctorParameters = () => [
1873
- { type: IconCacheService },
1874
- { type: NavigationService },
1875
- { type: CatalogService }
1876
- ];
1877
- CatalogHomeComponent.propDecorators = {
1878
- minified: [{ type: Input }]
1879
- };
1880
-
1881
- class ArticleCardComponent {
1882
- constructor(iconCache, catalog, options, _iOne, _changeDetector, _appEventService, _imageService, _settingsService) {
1883
- this.iconCache = iconCache;
1884
- this.catalog = catalog;
1885
- this.options = options;
1886
- this._iOne = _iOne;
1887
- this._changeDetector = _changeDetector;
1888
- this._appEventService = _appEventService;
1889
- this._imageService = _imageService;
1890
- this._settingsService = _settingsService;
1891
- this.icons = IconEnum;
1892
- this.isSelected = false;
1893
- this.isSmallModus = false;
1894
- this.hasMagnifierButton = false;
1895
- this.hasInfoButton = false;
1896
- // does not emit when you click one of the predefined buttons, but emits on a click on any of our other content
1897
- this.contentClick = new EventEmitter();
1898
- this.infoButtonClick = new EventEmitter();
1899
- this.magnifierButtonClick = new EventEmitter();
1900
- this.threeDButtonClick = new EventEmitter();
1901
- this.configurable = false;
1902
- this.threeD = false;
1903
- this.valutaSymbol = '€';
2437
+ handleCategoryClick(event, category) {
2438
+ this.categoryClick.emit(category);
1904
2439
  }
1905
- set article(value) {
1906
- this._article = value;
1907
- this.name = this._article.name ? this._article.name : this._article.description;
1908
- this.added_description = this._article.additionalDescription ? this._article.additionalDescription : '';
1909
- this.description = this._article.description + ' ' + this.added_description;
1910
- this.turnover = this._article.turnoverGroupDescr;
1911
- // this.stock_available = this._article.stockStatus ? this._article.stockStatus : this._article.standardDeliveryTimeSales + " " + this._article.standardDeliveryMethod;
1912
- this.stock_available = this._article.stockStatus;
1913
- this.configurable = this._article.goodType === 'B';
1914
- this.threeD = this._article.homeBrandId !== undefined;
2440
+ handleTurnoverGroupClick(event, turnovergroupNr) {
2441
+ this.turnoverGroupClick.emit(turnovergroupNr);
1915
2442
  }
1916
- get article() {
1917
- return this._article;
2443
+ onToggleMobileMenu() {
2444
+ this.mobileMenuToggle = !this.mobileMenuToggle;
1918
2445
  }
1919
- set showing(value) {
1920
- if (value) {
1921
- this._getThumbNailImagesAndPrice();
2446
+ onSubMenuToggle(event) {
2447
+ event.preventDefault();
2448
+ const parentItem = event.currentTarget.closest('li');
2449
+ const parentClasses = parentItem.classList;
2450
+ if (parentClasses.contains('open')) {
2451
+ parentClasses.remove('open');
2452
+ }
2453
+ else {
2454
+ parentClasses.add('open');
1922
2455
  }
1923
2456
  }
1924
- onHostClick(event) {
1925
- event.stopPropagation();
1926
- this._appEventService.articleClick.next(this.article);
2457
+ onOpenSubMenu(event) {
2458
+ const listItem = event.target;
2459
+ const rect = listItem.getBoundingClientRect();
2460
+ const rectParent = listItem.parentNode.getBoundingClientRect();
2461
+ this.popupHeight = rectParent.height;
2462
+ this.popupLeft = rectParent.width;
1927
2463
  }
1928
- handleLookAtArticleButtonClick(event) {
1929
- event.stopPropagation();
1930
- this._appEventService.lookAtArticleButtonClick.next(this.article);
2464
+ onSetCategory(event, category) {
2465
+ // if (!event.target.closest('.toggle_sub_menu') && !event.target.classList.contains('toggle_sub_menu')) {
2466
+ // this.navigationService.setCategory(category);
2467
+ // this.mobileMenuToggle = false;
2468
+ // }
1931
2469
  }
1932
- handleAddArticleButtonClick(event) {
1933
- return __awaiter(this, void 0, void 0, function* () {
1934
- event.stopPropagation();
1935
- this._appEventService.addArticleButtonClick.next(yield this._getJSONFromArticleObject(this.article));
1936
- });
2470
+ onSetTurnoverGroup(event, turnoverGroup) {
2471
+ // if (!event.target.closest('.toggle_sub_menu') && !event.target.classList.contains('toggle_sub_menu')) {
2472
+ // this.navigationService.setTurnoverGroup(turnoverGroup);
2473
+ // this.mobileMenuToggle = false;
2474
+ // }
1937
2475
  }
1938
- handleStockDetailsButtonClick(event) {
1939
- event.stopPropagation();
1940
- this._appEventService.stockDetailsClick.next(this.article);
2476
+ onOpenExternalCatalog(event, webviewUrl) {
2477
+ // this.navigationService.setExternalSourceUrl(webviewUrl);
1941
2478
  }
1942
- handleArButtonClick(event) {
1943
- event.stopPropagation();
1944
- this._appEventService.arButtonClick.next(this.article);
2479
+ onOpenIoneCatalog(event, webviewUrl, ioneUrl, upId, userName, passWord) {
2480
+ // this.navigationService.setIoneSourceUrl(webviewUrl, ioneUrl, upId, userName, passWord);
1945
2481
  }
1946
- removeHtmlTags(desc) {
1947
- desc = desc.replace(/\r?\n|\r/, '');
1948
- return desc;
2482
+ handleHomeClick(event) {
2483
+ this.homeClick.emit();
1949
2484
  }
1950
- _getJSONFromArticleObject(article) {
1951
- return __awaiter(this, void 0, void 0, function* () {
1952
- return yield this._iOne.getJsonArticleFlatTree(article.goodId, article.goodType, 1);
1953
- });
2485
+ handleShowCollectionOverlay() {
2486
+ this.showExternalOverlay = false;
2487
+ this.showCollectionOverlay = true;
1954
2488
  }
1955
- _detectChanges() {
1956
- this._changeDetector.detectChanges();
2489
+ handleShowExternalOverlay() {
2490
+ this.showCollectionOverlay = false;
2491
+ this.showExternalOverlay = true;
1957
2492
  }
1958
- _getThumbNailImagesAndPrice() {
1959
- if (this._article) {
1960
- this._imageService.getArticleImage(this._article);
1961
- this._iOne.getArticlePrice(this._article.goodId, this._settingsService.settings.type).then(price => {
1962
- if (price) {
1963
- this._article.baselinePrice = price.baselinePrice;
1964
- this._article.price = price.basePrice;
1965
- this._article.suppliedPrice = price.suppliedPrice;
1966
- if (price.articleDescription !== undefined && price.articleDescription !== '') {
1967
- this._article.description = price.articleDescription;
1968
- }
1969
- }
1970
- });
1971
- }
2493
+ handleHideCollectionOverlay() {
2494
+ this.showCollectionOverlay = false;
2495
+ }
2496
+ handleHideExternalOverlay() {
2497
+ this.showExternalOverlay = false;
1972
2498
  }
1973
2499
  }
1974
- ArticleCardComponent.decorators = [
2500
+ CatalogNavigationComponent.decorators = [
1975
2501
  { type: Component, args: [{
1976
- selector: 'app-article-card',
1977
- template: "<div *ngIf=\"catalog.listMode\" class=\"list-wrapper\">\n <div class=\"card-wrapper list\">\n <div class=\"left\">\n <div class=\"image\">\n <co-image *ngIf=\"article && article.imageData\" [source]=\"article.imageData\"></co-image>\n <div class=\"no-image-wrapper\" *ngIf=\"!article || !article.imageData\">\n <co-icon class=\"no-image\" [iconData]=\"iconCache.getIcon(icons.Camera)\"></co-icon>\n <span [textContent]=\"'NO_IMAGE' | localize\"></span>\n </div>\n <ng-content select=\"[over-image]\"></ng-content>\n </div>\n <div class=\"button-wrapper\">\n <co-icon *ngIf=\"threeD\" [iconData]=\"iconCache.getIcon(icons.ThreeD)\" class=\"pointer\"></co-icon>\n <co-icon *ngIf=\"threeD && options.showARButton\" class=\"pointer\"\n [iconData]=\"iconCache.getIcon(icons.Ar)\"\n (click)=\"handleArButtonClick($event)\"\n ></co-icon>\n </div>\n </div>\n <div class=\"description-wrapper\">\n <div class=\"main\">\n <div class=\"main-top\">\n <div *ngIf=\"!!turnover\" class=\"turnover\" [innerText]=\"removeHtmlTags(turnover)\"></div>\n <div *ngIf=\"!!name\" class=\"description\" [innerText]=\"removeHtmlTags(name)\"></div>\n </div>\n <div class=\"main-bottom\">\n <div class=\"main-bottom-left\">\n <div *ngIf=\"!!article?.articleNumber\" class=\"sku\">\n <span [innerText]=\"'sku' | localize\"></span>:\n <span [innerText]=\"article.articleNumber\"></span>\n </div>\n <div class=\"description\">\n <span class=\"label\" [innerText]=\"'description' | localize\"></span>\n <span class=\"text\" *ngIf=\"!!article?.description\" [innerText]=\"removeHtmlTags(article.description)\"></span>\n <span class=\"text\" *ngIf=\"!!added_description\" [innerText]=\"removeHtmlTags(added_description)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"right\">\n <div *ngIf=\"!!article?.price\" class=\"price\" [innerText]=\"article?.price | priceDisplay:valutaSymbol\"></div>\n <div *ngIf=\"options.showAddArticleButton\" class=\"on-article-buttons\">\n <co-button *ngIf=\"!configurable\"\n [label]=\"options.addArticleButtonText\"\n class=\"open-icon action pointer\"\n (onClick)=\"handleAddArticleButtonClick($event)\"\n [iconData]=\"iconCache.getIcon(icons.AddToCartDrop)\">\n </co-button>\n <co-button *ngIf=\"configurable\"\n [label]=\"options.lookAtArticleButtonText\"\n class=\"open-icon action pointer\"\n (onClick)=\"handleLookAtArticleButtonClick($event)\"\n [iconData]=\"iconCache.getIcon(icons.MagicWand)\">\n </co-button>\n <!--co-button\n [label]=\"options.stockButtonText\"\n class=\"open-icon action pointer stock\"\n (onClick)=\"handleStockDetailsButtonClick($event)\"\n [iconData]=\"iconCache.getIcon(icons.Truck)\">\n </co-button-->\n </div>\n <div *ngIf=\"stock_available\" (click)=\"handleStockDetailsButtonClick($event)\" class=\"stock\" [innerText]=\"stock_available\"></div>\n <div *ngIf=\"!stock_available\" (click)=\"handleStockDetailsButtonClick($event)\" class=\"stock not-in-stock\" [innerText]=\"'Niet op voorraad'\"></div>\n </div>\n </div>\n</div>\n<div *ngIf=\"!catalog.listMode\" class=\"grid-wrapper\">\n <div class=\"card-wrapper grid\">\n <div class=\"top\">\n </div>\n <div class=\"image\">\n <co-image *ngIf=\"article && article.imageData\" [source]=\"article.imageData\"></co-image>\n <div class=\"no-image-wrapper\" *ngIf=\"!article || !article.imageData\">\n <co-icon class=\"no-image\" [iconData]=\"iconCache.getIcon(icons.Camera)\"></co-icon>\n <span [textContent]=\"'NO_IMAGE' | localize\"></span>\n </div>\n <ng-content select=\"[over-image]\"></ng-content>\n </div>\n <div class=\"button-wrapper\">\n <co-icon *ngIf=\"threeD\" [iconData]=\"iconCache.getIcon(icons.ThreeD)\" class=\"pointer\"></co-icon>\n <co-icon *ngIf=\"threeD && options.showARButton\" class=\"pointer\"\n [iconData]=\"iconCache.getIcon(icons.Ar)\"\n (click)=\"handleArButtonClick($event)\"\n ></co-icon>\n </div>\n </div>\n <div class=\"description-wrapper\">\n <div class=\"main\">\n <div class=\"main-top\">\n <div *ngIf=\"!!turnover\" class=\"turnover\" [innerText]=\"removeHtmlTags(turnover)\"></div>\n <div *ngIf=\"!!name\" class=\"description\" [innerText]=\"removeHtmlTags(name)\"></div>\n </div>\n <div class=\"main-bottom\">\n <div class=\"main-bottom-left\">\n <div *ngIf=\"!!article?.price\" class=\"price\" [innerText]=\"article?.price | priceDisplay:valutaSymbol\"></div>\n <div *ngIf=\"!!article?.articleNumber\" class=\"sku\">\n <span [innerText]=\"'sku' | localize\"></span>:\n <span [innerText]=\"article.articleNumber\"></span>\n </div>\n <div *ngIf=\"stock_available\" (click)=\"handleStockDetailsButtonClick($event)\" class=\"stock\" [innerText]=\"stock_available\"></div>\n <div *ngIf=\"!stock_available\" (click)=\"handleStockDetailsButtonClick($event)\" class=\"stock not-in-stock\" [innerText]=\"'Niet op voorraad'\"></div>\n </div>\n <div *ngIf=\"options.showAddArticleButton\" class=\"on-article-buttons\">\n <co-button *ngIf=\"!configurable\"\n [label]=\"options.addArticleButtonText\"\n class=\"open-icon action pointer\"\n (onClick)=\"handleAddArticleButtonClick($event)\"\n [iconData]=\"iconCache.getIcon(icons.AddToCartDrop)\">\n </co-button>\n <co-button *ngIf=\"configurable\"\n [label]=\"options.lookAtArticleButtonText\"\n class=\"open-icon action pointer\"\n (onClick)=\"handleLookAtArticleButtonClick($event)\"\n [iconData]=\"iconCache.getIcon(icons.MagicWand)\">\n </co-button>\n <!--co-button\n [label]=\"options.stockButtonText\"\n class=\"open-icon action pointer stock\"\n (onClick)=\"handleStockDetailsButtonClick($event)\"\n [iconData]=\"iconCache.getIcon(icons.Truck)\">\n </co-button-->\n </div>\n </div>\n </div>\n </div>\n</div>\n",
1978
- styles: [":host{position:relative;transition:all .14s ease-out;border:1px solid transparent;border-bottom-color:#dce4ea;padding:10px 20px}:host .grid-wrapper{flex-shrink:1;flex-grow:1;display:flex;flex-direction:column}:host:hover{border-color:#dce4ea;cursor:pointer}:host:hover .open-icon{opacity:1;transition:all .2s ease}:host:hover .extended-shadow-wrapper{z-index:1}:host:hover .card-wrapper{overflow:hidden;flex-shrink:0}:host:hover .description-wrapper .main .main-bottom .main-bottom-left .stock{text-decoration:underline;color:#3e7eff}:host *{box-sizing:content-box}:host.list-card .list-wrapper .card-wrapper{display:flex;flex-direction:row;align-items:center}:host.list-card .list-wrapper .card-wrapper .left{min-width:200px}:host.list-card .list-wrapper .card-wrapper .right{display:flex;flex-direction:column;justify-content:center}:host.list-card .list-wrapper .card-wrapper .right .on-article-buttons{pointer-events:none;display:flex;flex-direction:column;justify-content:flex-end;margin:15px 0;transition:all .2s ease-in-out}:host.list-card .list-wrapper .card-wrapper .right .on-article-buttons>co-button{pointer-events:all;padding:0 15px!important;width:150px;height:42px;text-align:center;margin:0;grid-gap:10px;gap:10px;border-radius:5px;background:#3E7EFF;cursor:pointer;justify-content:flex-start}:host.list-card .list-wrapper .card-wrapper .right .on-article-buttons>co-button:hover{opacity:.8}:host.list-card .list-wrapper .card-wrapper .right .on-article-buttons>co-button ::ng-deep co-icon{width:34px;height:34px}:host.list-card .list-wrapper .card-wrapper .right .price{font-size:18px;color:#404040;font-weight:500;letter-spacing:-.5px}:host.list-card .list-wrapper .card-wrapper .right .stock{color:#32a545;font-size:12px;font-weight:500;text-decoration:underline;margin-top:5px}:host.list-card .list-wrapper .card-wrapper .right .stock.not-in-stock{color:#5b6875}:host.list-card .list-wrapper .card-wrapper .description-wrapper .main-bottom .description span{display:block}:host.list-card .list-wrapper .card-wrapper .description-wrapper .main-bottom .description span.label{font-size:11px;color:#5b6875;margin:5px 0;font-weight:normal}:host.list-card .list-wrapper .card-wrapper .description-wrapper .main-bottom .description span.text{font-weight:normal;font-size:12px}.extended-shadow-wrapper{display:none;position:absolute;padding:20px 20px 40px;top:calc(100% - 2px);width:calc(100% - 40px);background-color:#fafafa;box-shadow:0 0 13px -2px #0003}.extended-shadow-wrapper .shadow-masque{width:calc(100% - 1px);height:14px;position:absolute;top:-14px;left:0;background-color:#fafafa}.extended-shadow-wrapper .extended{display:grid;grid-template-columns:50% 50%;grid-row-gap:10px;grid-column-gap:15px}.extended-shadow-wrapper .extended app-label-field:nth-child(odd):not(:last-child){border-right:1px solid #DCE4EA}.no-image-wrapper{position:absolute;display:flex;left:50%;top:50%;margin:-48px 0 0 -40px;flex-direction:column;align-items:center;opacity:.25}.no-image-wrapper .no-image{height:80px;width:80px}.no-image-wrapper span{font-size:13px}.right-aligned{margin-left:auto;display:flex;align-items:center}.card-wrapper{overflow:hidden;flex-shrink:0}.card-wrapper .top{height:50px;position:absolute;left:0;top:0}.card-wrapper .button-wrapper{height:30px;position:absolute;left:0;top:0}.card-wrapper .button-wrapper ::ng-deep co-icon{display:inline-block;width:30px;height:30px}.description-wrapper{display:flex;flex-shrink:1;flex-grow:1;justify-content:space-between;min-height:40px;padding:15px 0;z-index:9;align-items:flex-start}.description-wrapper .main-bottom{display:flex;justify-content:space-between}.description-wrapper .on-article-buttons{pointer-events:none;display:flex;flex-direction:column;justify-content:flex-end;margin:0 5px 0 0;transition:all .2s ease-in-out}.description-wrapper .on-article-buttons>co-button{pointer-events:all;padding:0!important;font-size:0;width:42px;height:42px;text-align:center;margin:0;border-radius:100%;background:#3E7EFF;cursor:pointer;place-content:center}.description-wrapper .on-article-buttons>co-button:hover{opacity:.8}.description-wrapper .on-article-buttons>co-button ::ng-deep co-icon{width:34px;height:34px}.description-wrapper .main{padding:0;width:100%}.description-wrapper .main .turnover{font-size:12px;color:#5b6875;margin:0}.description-wrapper .main .added-description{font-size:11px;height:20px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;display:block;hyphens:auto;width:100%;margin:5px 0;word-wrap:break-word}.description-wrapper .main .description{font-size:14px;font-weight:bold;color:#000;margin:10px 0 5px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-hyphens:auto;hyphens:auto}.description-wrapper .main .delivery{font-size:12px;font-weight:bold;margin:20px 0 0;display:flex;align-items:flex-start;justify-content:center;flex-direction:column;color:#5b6875}.description-wrapper .main .delivery ::ng-deep co-level-indicator{height:30px}.description-wrapper .main .delivery ::ng-deep co-level-indicator>div{justify-content:start}.description-wrapper .main .delivery ::ng-deep co-level-indicator>div div[class*=square-]{background:#DCE4EA;width:14px;height:14px;margin:0 3px 0 0}.description-wrapper .main .price{font-size:16px;margin:10px 0;color:#404040;font-weight:500;letter-spacing:-.5px}.description-wrapper .main .stock{color:#32a545;font-size:11px;font-weight:500}.description-wrapper .main .stock.not-in-stock{color:#5b6875}.description-wrapper .main .sku{font-size:11px;color:#5b6875;margin:5px 0;text-transform:lowercase}:host:hover co-button.magnify{visibility:visible}div.image{position:relative;padding:1px;display:flex;align-items:center;justify-content:center;overflow:hidden;max-width:190px;margin:0 auto}div.image:after{content:\"\";padding:100% 0 0;float:left;width:100%}div.image co-image ::ng-deep{position:absolute;left:0;top:0;overflow:hidden;width:100%;height:100%;object-fit:contain;z-index:-1;transition:all .2s ease}div.image co-image ::ng-deep img{position:absolute;width:auto;height:auto;top:50%;left:50%;transform:translate(-50%,-50%)}co-button.magnify{position:absolute;visibility:hidden;top:1px;left:1px;z-index:2}co-button.magnify ::ng-deep svg{transform:scale(1.5)}co-button.info{position:absolute;bottom:71px;right:1px}co-level-indicator{margin-right:5px}.stock-row{display:inline}.stock-details{margin-left:30px;color:#3e7eff}@media screen and (max-width: 860px){.description-wrapper{display:flex;flex-shrink:1;flex-grow:1;flex-direction:column;min-height:40px;padding:15px 0;z-index:-1}.description-wrapper .main{padding:0 10px}.description-wrapper .main .brand{font-size:11px}.description-wrapper .main .description{font-size:13px}.description-wrapper .main .delivery{font-size:12px}.description-wrapper .main .delivery co-icon{width:24px;height:24px;margin:0 10px 0 0}.description-wrapper .main .price{font-size:14px;margin:10px 0 0}}\n"]
2502
+ selector: 'co-catalog-navigation',
2503
+ template: `
2504
+ <div class="navigation-wrapper" [class.minified]="minified">
2505
+ <div class="navigation-item-wrapper">
2506
+ <a class="navigation-link" (click)="handleHomeClick($event)" [textContent]="homeLabel"></a>
2507
+ </div>
2508
+ <div class="navigation-item-wrapper" [class.active]="mobileMenuToggle" (click)="onToggleMobileMenu()"
2509
+ (mouseover)="handleShowCollectionOverlay()"
2510
+ (mouseleave)="handleHideCollectionOverlay()"
2511
+ overlayParent #collectionParentForOverlay="overlayParent">
2512
+ <co-icon class="hamburger-icon" [iconData]="iconCache.getIcon(icons.Hamburger)"></co-icon>
2513
+ <span [textContent]="collectionLabel"></span>
2514
+ <div class="navigation-overlay-wrapper" [overlay]="collectionParentForOverlay" *ngIf="showCollectionOverlay" @showHideOverlay>
2515
+ <div class="navigation-category-column-wrapper" *ngFor="let category of categories">
2516
+ <div class="navigation-category" [textContent]="category.category"></div>
2517
+ <div class="navigation-turnovergroup-wrapper">
2518
+ <div class="navigation-turnovergroup" *ngFor="let turnoverGroup of category.turnoverGroups" [textContent]="turnoverGroup.description"></div>
2519
+ </div>
2520
+ </div>
2521
+ </div>
2522
+ </div>
2523
+ <div class="navigation-item-wrapper" [class.active]="mobileMenuToggle" (click)="onToggleMobileMenu()"
2524
+ (mouseover)="handleShowExternalOverlay()"
2525
+ (mouseleave)="handleHideExternalOverlay()"
2526
+ overlayParent #externalParentForOverlay="overlayParent">
2527
+ <co-icon class="hamburger-icon" [iconData]="iconCache.getIcon(icons.Ar)"></co-icon>
2528
+ <span [textContent]="externalSourcesLabel"></span>
2529
+ <div class="navigation-overlay-wrapper" [overlay]="externalParentForOverlay" @showHideOverlay>
2530
+ <co-catalog-external-sources></co-catalog-external-sources>
2531
+ </div>
2532
+ </div>
2533
+ </div>
2534
+ `,
2535
+ animations: [
2536
+ trigger('showHideOverlay', [
2537
+ state('void', style({ height: '0' })),
2538
+ state('*', style({ height: '*' })),
2539
+ transition('void <=> *', animate(100))
2540
+ ])
2541
+ ],
2542
+ encapsulation: ViewEncapsulation.None
1979
2543
  },] }
1980
2544
  ];
1981
- ArticleCardComponent.ctorParameters = () => [
2545
+ CatalogNavigationComponent.ctorParameters = () => [
1982
2546
  { type: IconCacheService },
1983
2547
  { type: CatalogService },
1984
- { type: OptionsService },
1985
- { type: IOneControllerService },
1986
- { type: ChangeDetectorRef },
1987
- { type: AppEventService },
1988
- { type: ImageService },
1989
- { type: SettingsService }
2548
+ { type: CatalogEventService }
1990
2549
  ];
1991
- ArticleCardComponent.propDecorators = {
1992
- article: [{ type: Input }],
1993
- showing: [{ type: Input }],
1994
- imageData: [{ type: Input }],
1995
- price: [{ type: Input }],
1996
- level: [{ type: Input }],
1997
- isSelected: [{ type: Input }],
1998
- isSmallModus: [{ type: Input }, { type: HostBinding, args: ['class.small-modus',] }],
1999
- hasMagnifierButton: [{ type: Input }],
2000
- hasInfoButton: [{ type: Input }],
2001
- contentClick: [{ type: Output }],
2002
- infoButtonClick: [{ type: Output }],
2003
- magnifierButtonClick: [{ type: Output }],
2004
- threeDButtonClick: [{ type: Output }],
2005
- onHostClick: [{ type: HostListener, args: ['click', ['$event'],] }]
2550
+ CatalogNavigationComponent.propDecorators = {
2551
+ homeLabel: [{ type: Input }],
2552
+ collectionLabel: [{ type: Input }],
2553
+ externalSourcesLabel: [{ type: Input }],
2554
+ showTurnoverGroups: [{ type: Input }],
2555
+ homeClick: [{ type: Output }],
2556
+ categoryClick: [{ type: Output }],
2557
+ turnoverGroupClick: [{ type: Output }],
2558
+ minified: [{ type: Input }],
2559
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-navigation',] }]
2006
2560
  };
2007
2561
 
2008
- class LabelFieldComponent {
2009
- constructor() {
2010
- this.label = '';
2562
+ class ExternalSourceViewmodel {
2563
+ constructor(catalog, source) {
2564
+ this.catalogDefinition = catalog;
2565
+ this.externalSource = source;
2011
2566
  }
2012
- }
2013
- LabelFieldComponent.decorators = [
2014
- { type: Component, args: [{
2015
- selector: 'app-label-field',
2016
- template: "<div *ngIf=\"label\" class=\"label\" [textContent]=\"label\"></div>\n<div class=\"description\" [textContent]=\"description\"></div>\n",
2017
- styles: [":host{display:flex;flex-direction:column}.label{font-size:11px}.description{font-size:13px}\n"]
2018
- },] }
2019
- ];
2020
- LabelFieldComponent.propDecorators = {
2021
- label: [{ type: Input }],
2022
- description: [{ type: Input }]
2023
- };
2567
+ }
2024
2568
 
2025
- class IconHandleComponent {
2026
- constructor(_iconCache) {
2027
- this._iconCache = _iconCache;
2028
- this.icons = IconEnum;
2029
- this.horizontal = false;
2030
- this.onHandleClick = new EventEmitter();
2569
+ class CatalogExternalSourcesComponent {
2570
+ constructor(_catalogConnectorService, _imageService) {
2571
+ this._catalogConnectorService = _catalogConnectorService;
2572
+ this._imageService = _imageService;
2573
+ this.externalSourceViewModels = [];
2031
2574
  }
2032
- set icon(value) {
2033
- this.iconData = this._iconCache.getIcon(value);
2575
+ showClass() {
2576
+ return true;
2034
2577
  }
2035
2578
  ngOnInit() {
2579
+ this.externalSourceViewModels.length = 0;
2580
+ this._catalogConnectorService.getCatalogDefinitions().then((defs) => __awaiter(this, void 0, void 0, function* () {
2581
+ for (let i = 0; i < defs.length; i++) {
2582
+ this._imageService.getExternalSourceImage(defs[i]);
2583
+ const viewModel = new ExternalSourceViewmodel(defs[i], defs[i].externalSourceId ? yield this._catalogConnectorService.getExternalSource(defs[i].externalSourceId, false) : new ExternalSource());
2584
+ this.externalSourceViewModels.push(viewModel);
2585
+ }
2586
+ }));
2036
2587
  }
2037
2588
  }
2038
- IconHandleComponent.decorators = [
2589
+ CatalogExternalSourcesComponent.decorators = [
2039
2590
  { type: Component, args: [{
2040
- selector: 'app-icon-handle',
2041
- template: "<co-icon [iconData]=\"iconData\" (click)=\"onHandleClick.emit($event)\"></co-icon>\n",
2042
- styles: [":host{display:flex;align-items:center;justify-content:center;cursor:pointer;height:30px;border-radius:15px;border:1px solid #DCE4EA;background:white}:host co-icon{height:20px;width:20px}:host co-icon ::ng-deep svg{height:20px;width:20px}:host co-icon ::ng-deep svg [fill]{fill:#bdc2c5}:host.horizontal{width:50px;height:35px}\n"]
2591
+ selector: 'co-catalog-external-sources',
2592
+ template: `
2593
+ <ng-container *ngIf="externalSourceViewModels && externalSourceViewModels.length > 0">
2594
+ <div class="catalog-external-sources-wrapper">
2595
+ <div class="external-source-item" *ngFor="let externalSourceViewModel of externalSourceViewModels">
2596
+ <co-image [source]="externalSourceViewModel.catalogDefinition.imageData"></co-image>
2597
+ <div class="external-source-description">
2598
+ <co-responsive-text [text]="externalSourceViewModel.catalogDefinition.name | localize"></co-responsive-text>
2599
+ </div>
2600
+ </div>
2601
+ </div>
2602
+ </ng-container>
2603
+ `,
2604
+ encapsulation: ViewEncapsulation.None
2043
2605
  },] }
2044
2606
  ];
2045
- IconHandleComponent.ctorParameters = () => [
2046
- { type: IconCacheService }
2607
+ CatalogExternalSourcesComponent.ctorParameters = () => [
2608
+ { type: CatalogConnectorService },
2609
+ { type: CatalogImageService }
2047
2610
  ];
2048
- IconHandleComponent.propDecorators = {
2049
- icon: [{ type: Input }],
2050
- horizontal: [{ type: HostBinding, args: ['class.horizontal',] }, { type: Input }],
2051
- onHandleClick: [{ type: Output }]
2611
+ CatalogExternalSourcesComponent.propDecorators = {
2612
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-external-sources',] }]
2052
2613
  };
2053
2614
 
2054
- class CatalogComponent {
2055
- constructor(catalog) {
2056
- this.catalog = catalog;
2057
- this.layout = {};
2615
+ class CatalogExternalSourcesModule {
2616
+ }
2617
+ CatalogExternalSourcesModule.decorators = [
2618
+ { type: NgModule, args: [{
2619
+ imports: [
2620
+ CommonModule,
2621
+ CatalogFilterModule,
2622
+ ImageModule,
2623
+ ResponsiveTextModule
2624
+ ],
2625
+ declarations: [
2626
+ CatalogExternalSourcesComponent
2627
+ ],
2628
+ exports: [
2629
+ CatalogExternalSourcesComponent
2630
+ ]
2631
+ },] }
2632
+ ];
2633
+
2634
+ class CatalogNavigationModule {
2635
+ }
2636
+ CatalogNavigationModule.decorators = [
2637
+ { type: NgModule, args: [{
2638
+ imports: [
2639
+ CommonModule,
2640
+ IconModule,
2641
+ CatalogFilterModule,
2642
+ OverlayModule,
2643
+ CatalogExternalSourcesModule
2644
+ ],
2645
+ declarations: [
2646
+ CatalogNavigationComponent
2647
+ ],
2648
+ exports: [
2649
+ CatalogNavigationComponent
2650
+ ]
2651
+ },] }
2652
+ ];
2653
+
2654
+ class CatalogSearchComponent {
2655
+ constructor(_catalogSearchService, _catalogEventService) {
2656
+ this._catalogSearchService = _catalogSearchService;
2657
+ this._catalogEventService = _catalogEventService;
2658
+ this.showNavigation = false;
2659
+ this.showFilter = false;
2660
+ this.showViewModes = false;
2661
+ this.onLookAtArticleButtonClick = new EventEmitter();
2662
+ this.onArButtonClick = new EventEmitter();
2663
+ this.onAddArticleButtonClick = new EventEmitter();
2664
+ this.onArticleClick = new EventEmitter();
2665
+ this.onStockDetailsClick = new EventEmitter();
2666
+ this.mode = 'tile';
2667
+ this.showCategories = true;
2058
2668
  this._subs = [];
2059
- this._subs.push(this.catalog.showPageChanged.subscribe(() => {
2060
- this.containerElement.nativeElement.scrollTo({ left: 0, top: 0, behavior: 'smooth' });
2061
- }));
2669
+ }
2670
+ showClass() {
2671
+ return true;
2062
2672
  }
2063
2673
  ngOnInit() {
2064
- // this.catalog.articleSearchFilters.category = this.category;
2674
+ this._subs.push(this._catalogEventService.addArticleButtonClick.subscribe((json) => {
2675
+ this.onAddArticleButtonClick.emit(json);
2676
+ }), this._catalogEventService.arButtonClick.subscribe((article) => {
2677
+ this.onArButtonClick.emit(article);
2678
+ }), this._catalogEventService.articleClick.subscribe((article) => {
2679
+ this.onArticleClick.emit(article);
2680
+ }), this._catalogEventService.lookAtArticleButtonClick.subscribe((article) => {
2681
+ this.onLookAtArticleButtonClick.emit(article);
2682
+ }), this._catalogEventService.stockDetailsClick.subscribe((article) => {
2683
+ this.onStockDetailsClick.emit(article);
2684
+ }));
2065
2685
  }
2066
2686
  ngOnDestroy() {
2067
- this._subs.forEach((s) => { s.unsubscribe(); });
2687
+ this._subs.forEach(s => s.unsubscribe());
2688
+ }
2689
+ handleCategoryClick(category) {
2690
+ this._catalogSearchService.category = category;
2691
+ }
2692
+ handleTurnoverGroupClick(turnoverGroup) {
2693
+ this._catalogSearchService.turnoverGroup = turnoverGroup;
2068
2694
  }
2069
2695
  }
2070
- CatalogComponent.decorators = [
2696
+ CatalogSearchComponent.decorators = [
2071
2697
  { type: Component, args: [{
2072
- selector: 'app-catalog',
2073
- template: "<div class=\"component-wrapper\">\n <div class=\"content-wrapper\" #container>\n <div class=\"page-wrapper\">\n <div id=\"left_content\"><app-left-content></app-left-content></div>\n <div id=\"main_content\">\n <app-main-content></app-main-content>\n </div>\n </div>\n </div>\n</div>\n",
2074
- styles: [".page-wrapper{display:flex;flex-direction:column;padding:0 30px;margin:0 auto;width:100%}.component-wrapper{display:flex;flex-direction:column;height:100%}.component-wrapper .page-wrapper{flex-direction:row;height:100%;align-items:flex-start}.content-wrapper{display:flex;flex-basis:100%;position:relative;padding:15px 0 0}#top_content{display:flex;flex-basis:auto;border-bottom:1px solid #e4edf4}#main_content{width:100%}@media screen and (max-width: 640px){.page-wrapper{padding:0}}\n"]
2698
+ selector: 'co-catalog-search',
2699
+ template: `
2700
+ <co-catalog-navigation *ngIf="showNavigation"></co-catalog-navigation>
2701
+ <div class="catalog-search-wrapper">
2702
+ <ng-container *ngIf="showFilter">
2703
+ <div class="filter-content">
2704
+ <co-catalog-filter [showResetFilter]="true"></co-catalog-filter>
2705
+ </div>
2706
+ </ng-container>
2707
+ <div class="search-content-wrapper">
2708
+ <div class="search-header">
2709
+ <!--
2710
+ <co-catalog-external-sources></co-catalog-external-sources>
2711
+ -->
2712
+ <co-catalog-search-header [placeholder]="'Zoeken naar artikelen'"></co-catalog-search-header>
2713
+ </div>
2714
+ <ng-container *ngIf="showViewModes">
2715
+ <button (click)="mode = 'tile'">tile</button>
2716
+ <button (click)="mode = 'list'">list</button>
2717
+ <button (click)="mode = 'grid'">grid</button>
2718
+ </ng-container>
2719
+ <!--
2720
+ <co-catalog-categories (categoryClick)="handleCategoryClick($event)" (turnoverGroupClick)="handleTurnoverGroupClick($event)"></co-catalog-categories>
2721
+ -->
2722
+ <div class="search-content">
2723
+ <ng-container *ngIf="mode === 'tile'">
2724
+ <co-catalog-search-result-tile></co-catalog-search-result-tile>
2725
+ </ng-container>
2726
+ <ng-container *ngIf="mode === 'list'">
2727
+ <co-catalog-search-result-list></co-catalog-search-result-list>
2728
+ </ng-container>
2729
+ <ng-container *ngIf="mode === 'grid'">
2730
+ <!--
2731
+ <co-catalog-search-result></co-catalog-search-result>
2732
+ -->
2733
+ </ng-container>
2734
+ </div>
2735
+ </div>
2736
+ </div>
2737
+ `,
2738
+ encapsulation: ViewEncapsulation.None
2075
2739
  },] }
2076
2740
  ];
2077
- CatalogComponent.ctorParameters = () => [
2078
- { type: CatalogService }
2741
+ CatalogSearchComponent.ctorParameters = () => [
2742
+ { type: CatalogSearchService },
2743
+ { type: CatalogEventService }
2079
2744
  ];
2080
- CatalogComponent.propDecorators = {
2081
- containerElement: [{ type: ViewChild, args: ['container', { read: ElementRef, static: true },] }]
2745
+ CatalogSearchComponent.propDecorators = {
2746
+ showNavigation: [{ type: Input }],
2747
+ showFilter: [{ type: Input }],
2748
+ showViewModes: [{ type: Input }],
2749
+ onLookAtArticleButtonClick: [{ type: Output }],
2750
+ onArButtonClick: [{ type: Output }],
2751
+ onAddArticleButtonClick: [{ type: Output }],
2752
+ onArticleClick: [{ type: Output }],
2753
+ onStockDetailsClick: [{ type: Output }],
2754
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-search',] }]
2082
2755
  };
2083
2756
 
2084
- // A pipe for localizing string values in view templates.
2085
- class LocalizePipe {
2086
- constructor(_dictionaryService) {
2087
- this._dictionaryService = _dictionaryService;
2757
+ class CatalogSearchHeaderComponent {
2758
+ constructor(catalogSearchService) {
2759
+ this.catalogSearchService = catalogSearchService;
2088
2760
  }
2089
- transform(value, upperCaseFirst = true, replace = []) {
2090
- if (!value) {
2091
- return '';
2092
- }
2093
- replace = replace ? replace : [];
2094
- if (!Array.isArray(replace)) {
2095
- replace = [replace];
2096
- }
2097
- return this._dictionaryService.get(value, upperCaseFirst, ...replace);
2761
+ showClass() {
2762
+ return true;
2098
2763
  }
2099
2764
  }
2100
- LocalizePipe.decorators = [
2101
- { type: Pipe, args: [{
2102
- name: 'localize'
2765
+ CatalogSearchHeaderComponent.decorators = [
2766
+ { type: Component, args: [{
2767
+ selector: 'co-catalog-search-header',
2768
+ template: `
2769
+ <div class="catalog-search-header-wrapper">
2770
+ <co-input-search class="catalog-search-general"
2771
+ [useRightIcon]="true"
2772
+ [centerLabel]="true"
2773
+ [(model)]="catalogSearchService.searchRequest.general"
2774
+ [placeholder]="placeholder"
2775
+ [initFocus]="true"
2776
+ (search)="catalogSearchService.searchArticles()">
2777
+ </co-input-search>
2778
+ </div>
2779
+ `,
2780
+ encapsulation: ViewEncapsulation.None
2103
2781
  },] }
2104
2782
  ];
2105
- LocalizePipe.ctorParameters = () => [
2106
- { type: DictionaryService }
2107
- ];
2783
+ CatalogSearchHeaderComponent.ctorParameters = () => [
2784
+ { type: CatalogSearchService }
2785
+ ];
2786
+ CatalogSearchHeaderComponent.propDecorators = {
2787
+ placeholder: [{ type: Input }],
2788
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-search-header',] }]
2789
+ };
2108
2790
 
2109
- class BaseComponent {
2110
- }
2791
+ class CatalogSearchHeaderModule {
2792
+ }
2793
+ CatalogSearchHeaderModule.decorators = [
2794
+ { type: NgModule, args: [{
2795
+ imports: [
2796
+ CommonModule,
2797
+ InputSearchModule
2798
+ ],
2799
+ declarations: [
2800
+ CatalogSearchHeaderComponent
2801
+ ],
2802
+ exports: [
2803
+ CatalogSearchHeaderComponent
2804
+ ]
2805
+ },] }
2806
+ ];
2111
2807
 
2112
- class LayoutDirective {
2113
- constructor(_templateRef, _containerRef, _changeDetector) {
2114
- this._templateRef = _templateRef;
2115
- this._containerRef = _containerRef;
2116
- this._changeDetector = _changeDetector;
2117
- }
2118
- set layout(value) {
2119
- if (value) {
2120
- this._layout = value;
2121
- this._setLayout();
2122
- }
2123
- }
2124
- set layoutLayoutId(value) {
2125
- this._layoutId = value;
2126
- }
2127
- get layoutId() {
2128
- return this._layoutId;
2129
- }
2130
- test() {
2131
- this._changeDetector.detectChanges();
2132
- }
2133
- ngOnDestroy() {
2134
- this._containerRef = undefined;
2135
- this._templateRef = undefined;
2808
+ class CatalogSearchBaseComponent {
2809
+ constructor(catalogSearchService) {
2810
+ this.catalogSearchService = catalogSearchService;
2136
2811
  }
2137
- ngOnInit() {
2138
- let view = this._containerRef.createEmbeddedView(this._templateRef, {});
2139
- this._setLayout();
2812
+ onPreviousClick() {
2813
+ this.catalogSearchService.currentPage -= 1;
2140
2814
  }
2141
- ngAfterViewInit() {
2815
+ onNextClick() {
2816
+ this.catalogSearchService.currentPage += 1;
2142
2817
  }
2143
- _setLayout() {
2144
- for (const key in this._layout) {
2145
- if (this._layout.hasOwnProperty(key) && this.layoutId === key) {
2146
- // found a layout for this element
2147
- this._resetView(this._layout[key]);
2148
- }
2149
- }
2818
+ onPageClick(pageNr) {
2819
+ this.catalogSearchService.currentPage = pageNr;
2150
2820
  }
2151
- _resetView(layout) {
2152
- let i = 0;
2153
- let view = this._containerRef.get(0);
2154
- // let subView = view.get()
2155
- // while (view !== null) {
2156
- // i++;
2157
- // view = this._containerRef.get(i);
2158
- // }
2821
+ }
2822
+ CatalogSearchBaseComponent.decorators = [
2823
+ { type: Directive }
2824
+ ];
2825
+ CatalogSearchBaseComponent.ctorParameters = () => [
2826
+ { type: CatalogSearchService }
2827
+ ];
2828
+
2829
+ class CatalogSearchResultTileComponent extends CatalogSearchBaseComponent {
2830
+ constructor() {
2831
+ super(...arguments);
2832
+ this.onLookAtArticleButtonClick = new EventEmitter();
2833
+ this.onArButtonClick = new EventEmitter();
2834
+ this.onAddArticleButtonClick = new EventEmitter();
2835
+ this.onArticleClick = new EventEmitter();
2836
+ this.onStockDetailsClick = new EventEmitter();
2837
+ this.showClass = true;
2838
+ this.smallScrollbar = true;
2159
2839
  }
2160
2840
  }
2161
- LayoutDirective.decorators = [
2162
- { type: Directive, args: [{
2163
- selector: '[layout]'
2841
+ CatalogSearchResultTileComponent.decorators = [
2842
+ { type: Component, args: [{
2843
+ selector: 'co-catalog-search-result-tile',
2844
+ template: `
2845
+ <div class="article-cards" visibilityObserverMaster>
2846
+ <ng-container *ngFor="let article of catalogSearchService.articles">
2847
+ <co-catalog-article-tile
2848
+ visibilityObserver
2849
+ #intersection="intersection"
2850
+ [observerEnabled]="!article.imageData"
2851
+ [showing]="intersection.isIntersecting"
2852
+ [article]="article"
2853
+ (onArticleClick)="onArticleClick.emit($event)"
2854
+ (onAddArticleButtonClick)="onAddArticleButtonClick.emit($event)"
2855
+ (onArButtonClick)="onArButtonClick.emit($event)"
2856
+ (onLookAtArticleButtonClick)="onLookAtArticleButtonClick.emit($event)"
2857
+ (onStockDetailsClick)="onStockDetailsClick.emit($event)"
2858
+ >
2859
+ </co-catalog-article-tile>
2860
+ </ng-container>
2861
+ </div>
2862
+ <co-pagination-bar *ngIf="catalogSearchService.articles?.length > 0"
2863
+ [currentPage]="catalogSearchService.currentPage"
2864
+ [itemsPerPage]="catalogSearchService.articlesPerPage"
2865
+ [totalItems]="catalogSearchService.resultCount"
2866
+ [previousLabel]="'PREVIOUS' | localize"
2867
+ [nextLabel]="'NEXT' | localize"
2868
+ [autoHide]="true"
2869
+ [directionLinks]="true"
2870
+ [paginationRange]="8"
2871
+ (previousClick)="onPreviousClick()"
2872
+ (nextClick)="onNextClick()"
2873
+ (pageClick)="onPageClick($event)">
2874
+ </co-pagination-bar>
2875
+ `,
2876
+ encapsulation: ViewEncapsulation.None
2164
2877
  },] }
2165
2878
  ];
2166
- LayoutDirective.ctorParameters = () => [
2167
- { type: TemplateRef },
2168
- { type: ViewContainerRef },
2169
- { type: ChangeDetectorRef }
2170
- ];
2171
- LayoutDirective.propDecorators = {
2172
- comps: [{ type: ContentChildren, args: [BaseComponent, { descendants: true },] }],
2173
- layout: [{ type: Input }],
2174
- layoutLayoutId: [{ type: Input }],
2175
- test: [{ type: HostListener, args: ['click',] }]
2879
+ CatalogSearchResultTileComponent.propDecorators = {
2880
+ onLookAtArticleButtonClick: [{ type: Output }],
2881
+ onArButtonClick: [{ type: Output }],
2882
+ onAddArticleButtonClick: [{ type: Output }],
2883
+ onArticleClick: [{ type: Output }],
2884
+ onStockDetailsClick: [{ type: Output }],
2885
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-search-result-tile',] }],
2886
+ smallScrollbar: [{ type: HostBinding, args: ['class.co-small-scrollbar',] }]
2176
2887
  };
2177
2888
 
2178
- class IoneCatalogComponent {
2179
- constructor(catalogService, _dictionary, _componentFactoryResolver, _jsonUtils, _ione, _changeDetector, _optionsService, _elementRef, _appEventService, _settingsService) {
2889
+ class ArticleBaseComponent {
2890
+ constructor(iconCache, catalogService, options, _iOne, _changeDetector, _appEventService, _imageService, _settingsService) {
2891
+ this.iconCache = iconCache;
2180
2892
  this.catalogService = catalogService;
2181
- this._dictionary = _dictionary;
2182
- this._componentFactoryResolver = _componentFactoryResolver;
2183
- this._jsonUtils = _jsonUtils;
2184
- this._ione = _ione;
2893
+ this.options = options;
2894
+ this._iOne = _iOne;
2185
2895
  this._changeDetector = _changeDetector;
2186
- this._optionsService = _optionsService;
2187
- this._elementRef = _elementRef;
2188
2896
  this._appEventService = _appEventService;
2897
+ this._imageService = _imageService;
2189
2898
  this._settingsService = _settingsService;
2190
- this.onAddToCart = new EventEmitter();
2191
- this.onAddToQuote = new EventEmitter();
2899
+ this.icons = IconEnum;
2900
+ this.isSelected = false;
2901
+ this.isSmallModus = false;
2902
+ this.hasMagnifierButton = false;
2903
+ this.hasInfoButton = false;
2192
2904
  this.onLookAtArticleButtonClick = new EventEmitter();
2905
+ this.onArButtonClick = new EventEmitter();
2193
2906
  this.onAddArticleButtonClick = new EventEmitter();
2194
2907
  this.onArticleClick = new EventEmitter();
2195
- this.onArButtonClick = new EventEmitter();
2196
2908
  this.onStockDetailsClick = new EventEmitter();
2197
- this._subs = [];
2198
- this.upAndLoaded = false;
2199
- this.externalSource = false;
2200
- this.internalSource = false;
2201
- this.catalogUrl = '';
2202
- this._connectionSet = false;
2203
- this._getLayoutAndCreateComponents();
2204
- this._subs.push(this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true), this.catalogService.categoryChanged.subscribe(category => this._scrollToTop()), this.catalogService.turnoverGroupChanged.subscribe(turnoverGroup => this._scrollToTop()), this.catalogService.searchTextChanged.subscribe(searchText => this._scrollToTop()), this.catalogService.showPageChanged.subscribe(searchText => this._scrollToTop()), this._appEventService.addArticleButtonClick.subscribe((json) => this.onAddArticleButtonClick.next(json)), this._appEventService.articleClick.subscribe((article) => this.onArticleClick.next(article)), this._appEventService.lookAtArticleButtonClick.subscribe((article) => this.onLookAtArticleButtonClick.next(article)), this._appEventService.arButtonClick.subscribe((article) => this.onArButtonClick.next(article)), this._appEventService.stockDetailsClick.subscribe((article) => this.onStockDetailsClick.next(article)), this._settingsService.settingsLoaded.subscribe((loaded) => {
2205
- if (loaded) {
2206
- this._initConnection();
2207
- }
2208
- }));
2909
+ // does not emit when you click one of the predefined buttons, but emits on a click on any of our other content
2910
+ this.contentClick = new EventEmitter();
2911
+ this.infoButtonClick = new EventEmitter();
2912
+ this.magnifierButtonClick = new EventEmitter();
2913
+ this.threeDButtonClick = new EventEmitter();
2914
+ this.configurable = false;
2915
+ this.threeD = false;
2916
+ this.valutaSymbol = '€';
2209
2917
  }
2210
- set settings(value) {
2918
+ set article(value) {
2919
+ this._article = value;
2920
+ this.name = this._article.name ? this._article.name : this._article.description;
2921
+ this.added_description = this._article.additionalDescription ? this._article.additionalDescription : '';
2922
+ this.description = this._article.description + ' ' + this.added_description;
2923
+ this.turnover = this._article.turnoverGroupDescr;
2924
+ // this.stock_available = this._article.stockStatus ? this._article.stockStatus : this._article.standardDeliveryTimeSales + " " + this._article.standardDeliveryMethod;
2925
+ this.stock_available = this._article.stockStatus;
2926
+ this.configurable = this._article.goodType === 'B';
2927
+ this.threeD = this._article.homeBrandId !== undefined;
2928
+ }
2929
+ get article() {
2930
+ return this._article;
2931
+ }
2932
+ set showing(value) {
2211
2933
  if (value) {
2212
- let settings;
2213
- if (typeof value === 'string') {
2214
- settings = JSON.parse(value);
2215
- }
2216
- else {
2217
- settings = value;
2218
- }
2219
- this._settingsService.createSettingsFromObject(settings);
2934
+ this._getThumbNailImagesAndPrice();
2220
2935
  }
2221
2936
  }
2222
- get settings() {
2223
- return this._settings;
2937
+ showClass() {
2938
+ return true;
2939
+ }
2940
+ onHostClick(event) {
2941
+ event.stopPropagation();
2942
+ this._appEventService.articleClick.next(this.article);
2943
+ this.onArticleClick.emit(this.article);
2944
+ }
2945
+ handleLookAtArticleButtonClick(event) {
2946
+ event.stopPropagation();
2947
+ this._appEventService.lookAtArticleButtonClick.next(this.article);
2948
+ this.onLookAtArticleButtonClick.emit(this.article);
2224
2949
  }
2225
- set parameters(value) {
2226
- this._optionsService.parameters = value;
2950
+ handleAddArticleButtonClick(event) {
2951
+ return __awaiter(this, void 0, void 0, function* () {
2952
+ event.stopPropagation();
2953
+ const json = yield this._getJSONFromArticleObject(this.article);
2954
+ this._appEventService.addArticleButtonClick.next(json);
2955
+ this.onAddArticleButtonClick.emit(json);
2956
+ });
2227
2957
  }
2228
- ngOnDestroy() {
2229
- this._subs.forEach(s => s.unsubscribe());
2958
+ handleStockDetailsButtonClick(event) {
2959
+ event.stopPropagation();
2960
+ this._appEventService.stockDetailsClick.next(this.article);
2961
+ this.onStockDetailsClick.emit(this.article);
2230
2962
  }
2231
- _scrollToTop() {
2232
- // if (this._elementRef && this._elementRef.nativeElement) {
2233
- // this._elementRef.nativeElement.scrollTo({ top: 0, behavior: 'smooth' });
2234
- // }
2963
+ handleArButtonClick(event) {
2964
+ event.stopPropagation();
2965
+ this._appEventService.arButtonClick.next(this.article);
2966
+ this.onArButtonClick.emit(this.article);
2967
+ }
2968
+ removeHtmlTags(desc) {
2969
+ desc = desc.replace(/\r?\n|\r/, '');
2970
+ return desc;
2235
2971
  }
2236
- _getLayoutAndCreateComponents() {
2972
+ _getJSONFromArticleObject(article) {
2237
2973
  return __awaiter(this, void 0, void 0, function* () {
2238
- // this.layout = await this._jsonUtils.readJsonFile('layout/app-component.json');
2974
+ return yield this._iOne.getJsonArticleFlatTree(article.goodId, article.goodType, 1);
2239
2975
  });
2240
2976
  }
2241
- // we need to prepare the settings before we can use it for the 3d configurator bundle
2242
- _initConnection() {
2243
- return __awaiter(this, void 0, void 0, function* () {
2244
- yield this._ione.initConnector(this._settingsService.settings, this._connectionSet);
2245
- this._settingsService.settings.session = this._ione.connector.session;
2246
- yield this._dictionary.setDictionary(LanguageCode.Dutch, this._settingsService.settings.additionalTranslationFile);
2247
- setTimeout(() => {
2248
- this._changeDetector.detectChanges();
2977
+ _detectChanges() {
2978
+ this._changeDetector.detectChanges();
2979
+ }
2980
+ _getThumbNailImagesAndPrice() {
2981
+ if (this._article) {
2982
+ this._imageService.getArticleImage(this._article);
2983
+ this._iOne.getArticlePrice(this._article.goodId, this._settingsService.settings.type).then(price => {
2984
+ if (price) {
2985
+ this._article.baselinePrice = price.baselinePrice;
2986
+ this._article.price = price.basePrice;
2987
+ this._article.suppliedPrice = price.suppliedPrice;
2988
+ if (price.articleDescription !== undefined && price.articleDescription !== '') {
2989
+ this._article.description = price.articleDescription;
2990
+ }
2991
+ }
2249
2992
  });
2250
- this._settings = this._settingsService.settings;
2251
- // const defs = this._ione.connector.connector.getCatalogDefinitions();
2252
- this._connectionSet = true;
2253
- });
2993
+ }
2254
2994
  }
2255
2995
  }
2256
- IoneCatalogComponent.decorators = [
2257
- { type: Component, args: [{
2258
- selector: 'app-ione-catalog',
2259
- template: "<app-catalog *ngIf=\"!catalogService.showExternalSource && upAndLoaded && catalogService.showCatOrTurnoverGroupArticles\"></app-catalog>\r\n<app-external-catalog *ngIf=\"catalogService.showExternalSource && !catalogService.showCatOrTurnoverGroupArticles\"></app-external-catalog>\r\n<app-home-catalog *ngIf=\"!catalogService.showExternalSource && !catalogService.showCatOrTurnoverGroupArticles\"></app-home-catalog>\r\n",
2260
- encapsulation: ViewEncapsulation.None,
2261
- styles: [":host{display:flex;overflow:auto;flex-direction:column;height:calc(100% - 55px);color:#22313c}::ng-deep app-catalog{display:flex;height:100%;flex-direction:column}\n"]
2262
- },] }
2996
+ ArticleBaseComponent.decorators = [
2997
+ { type: Directive }
2263
2998
  ];
2264
- IoneCatalogComponent.ctorParameters = () => [
2999
+ ArticleBaseComponent.ctorParameters = () => [
3000
+ { type: IconCacheService },
2265
3001
  { type: CatalogService },
2266
- { type: DictionaryService },
2267
- { type: ComponentFactoryResolver },
2268
- { type: JsonUtilsService },
2269
- { type: IOneControllerService },
3002
+ { type: CatalogOptionsService },
3003
+ { type: CatalogConnectorService },
2270
3004
  { type: ChangeDetectorRef },
2271
- { type: OptionsService },
2272
- { type: ElementRef },
2273
- { type: AppEventService },
2274
- { type: SettingsService }
3005
+ { type: CatalogEventService },
3006
+ { type: CatalogImageService },
3007
+ { type: CatalogSettingsService }
2275
3008
  ];
2276
- IoneCatalogComponent.propDecorators = {
2277
- settings: [{ type: Input }],
2278
- parameters: [{ type: Input }],
2279
- onAddToCart: [{ type: Output }],
2280
- onAddToQuote: [{ type: Output }],
3009
+ ArticleBaseComponent.propDecorators = {
3010
+ article: [{ type: Input }],
3011
+ showing: [{ type: Input }],
3012
+ imageData: [{ type: Input }],
3013
+ price: [{ type: Input }],
3014
+ isSelected: [{ type: Input }],
3015
+ isSmallModus: [{ type: Input }, { type: HostBinding, args: ['class.small-modus',] }],
3016
+ hasMagnifierButton: [{ type: Input }],
3017
+ hasInfoButton: [{ type: Input }],
2281
3018
  onLookAtArticleButtonClick: [{ type: Output }],
3019
+ onArButtonClick: [{ type: Output }],
2282
3020
  onAddArticleButtonClick: [{ type: Output }],
2283
3021
  onArticleClick: [{ type: Output }],
2284
- onArButtonClick: [{ type: Output }],
2285
- onStockDetailsClick: [{ type: Output }]
3022
+ onStockDetailsClick: [{ type: Output }],
3023
+ contentClick: [{ type: Output }],
3024
+ infoButtonClick: [{ type: Output }],
3025
+ magnifierButtonClick: [{ type: Output }],
3026
+ threeDButtonClick: [{ type: Output }],
3027
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-article-tile',] }],
3028
+ onHostClick: [{ type: HostListener, args: ['click', ['$event'],] }]
2286
3029
  };
2287
3030
 
2288
- class FilterItemsComponent {
2289
- constructor(_iconCache, _productCatalogControllerService) {
2290
- this._iconCache = _iconCache;
2291
- this._productCatalogControllerService = _productCatalogControllerService;
2292
- this.icons = IconEnum;
2293
- this.filterCollection = [];
2294
- this.customColors = false;
2295
- this.filterCollectionChange = new EventEmitter();
2296
- this._subs = [];
2297
- this.collapseIconData = this._iconCache.getIcon(this.icons.ArrowScrollLeft);
2298
- this._subs.push(this._productCatalogControllerService.onResetFilters.subscribe(() => {
2299
- this.resetFilterItems();
2300
- }));
2301
- }
2302
- handleInputClick(item, checked) {
2303
- item.active = checked;
2304
- this.filterCollectionChange.next();
2305
- }
2306
- resetFilterItems() {
2307
- if (this.filterCollection !== undefined && this.filterCollection.length > 0) {
2308
- this.filterCollection.forEach((x) => {
2309
- x.active = false;
2310
- });
2311
- }
3031
+ class CatalogArticleTileComponent extends ArticleBaseComponent {
3032
+ showClass() {
3033
+ return true;
2312
3034
  }
2313
3035
  }
2314
- FilterItemsComponent.decorators = [
3036
+ CatalogArticleTileComponent.decorators = [
2315
3037
  { type: Component, args: [{
2316
- selector: 'app-filter-items',
2317
- template: "<div class=\"filter-item-wrapper narrow-scrollbar expanded filter-height\">\n <ng-container *ngIf=\"!customColors\">\n <co-input-checkbox *ngFor=\"let filterItem of filterCollection | greaterThanZero:'count'\"\n [label]=\"filterItem[description]\"\n [model]=\"filterItem.active\"\n showCheckMark\n (modelChange)=\"handleInputClick(filterItem, $event)\"\n ></co-input-checkbox>\n </ng-container>\n <ng-container *ngIf=\"customColors\">\n <co-input-checkbox *ngFor=\"let filterItem of filterCollection | greaterThanZero:'count'\"\n [label]=\"filterItem[description]\"\n [model]=\"filterItem.active\"\n [activeColor]=\"filterItem.activeColor\"\n [inActiveColor]=\"filterItem.inActiveColor\"\n [checkMarkColor]=\"filterItem.checkMarkColor\"\n (modelChange)=\"handleInputClick(filterItem, $event)\"\n showCheckMark\n ></co-input-checkbox>\n </ng-container>\n</div>\n",
2318
- styles: [".filter-item-wrapper{overflow:hidden}.filter-item-wrapper.expanded{overflow-y:auto}.filter-item-wrapper>*{margin-bottom:15px}.filter-item-wrapper ::ng-deep co-input-checkbox:hover .checkbox{border-color:#3e7eff}.filter-item-wrapper ::ng-deep co-input-checkbox:hover .label{color:#3e7eff}.filter-item-wrapper ::ng-deep co-input-checkbox.selected .checkbox{border-color:#3e7eff!important}.filter-item-wrapper ::ng-deep co-input-checkbox.selected .checkbox .checkmark{box-sizing:content-box;top:8px}.filter-item-wrapper ::ng-deep co-input-checkbox.selected .label{color:#3e7eff!important}.filter-item-wrapper ::ng-deep co-input-checkbox .checkbox{background:transparent!important;box-sizing:content-box}.filter-item-wrapper ::ng-deep co-input-checkbox .checkbox.has-label{margin:0 15px 0 0}.filter-item-wrapper ::ng-deep co-input-checkbox .checkbox.selected{border-color:#3e7eff!important}.filter-item-wrapper ::ng-deep co-input-checkbox .checkbox.selected+.label{color:#3e7eff!important}.filter-height{max-height:300px}.collapse-handle{display:flex;flex-direction:row;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;margin:15px 0}.collapse-handle span{color:#3e7eff;font-size:11px}.collapse-handle ::ng-deep co-icon{height:15px;width:15px;transform:rotate(270deg);margin:0 10px 0 0}.collapse-handle ::ng-deep co-icon [fill]{fill:#3e7eff}.collapse-handle.expanded ::ng-deep co-icon{transform:rotate(90deg)}\n"]
3038
+ selector: 'co-catalog-article-tile',
3039
+ template: `
3040
+ <div class="article-tile-wrapper">
3041
+ <div class="card-wrapper">
3042
+ <div class="image">
3043
+ <co-image class="co-image" [source]="article.imageData"></co-image>
3044
+ </div>
3045
+ <div class="button-wrapper">
3046
+ <co-icon *ngIf="threeD" [iconData]="iconCache.getIcon(icons.ThreeD)" class="pointer"></co-icon>
3047
+ <co-icon *ngIf="threeD && options.showARButton" class="pointer"
3048
+ [iconData]="iconCache.getIcon(icons.Ar)"
3049
+ (click)="handleArButtonClick($event)"
3050
+ ></co-icon>
3051
+ </div>
3052
+ </div>
3053
+ <div class="description-wrapper">
3054
+ <!--
3055
+ <div class="main">
3056
+ -->
3057
+ <div class="main-top">
3058
+ <div *ngIf="!!turnover" class="turnover" [innerText]="removeHtmlTags(turnover)"></div>
3059
+ <div *ngIf="!!name" class="description" [innerText]="removeHtmlTags(name)"></div>
3060
+ </div>
3061
+ <div class="main-bottom">
3062
+ <div class="main-bottom-left">
3063
+ <div *ngIf="!!article?.price" class="price" [innerText]="article?.price | priceDisplay:valutaSymbol"></div>
3064
+ <div *ngIf="!!article?.articleNumber" class="sku">
3065
+ <span [innerText]="'sku' | localize"></span>:
3066
+ <span [innerText]="article.articleNumber"></span>
3067
+ </div>
3068
+ <div *ngIf="stock_available" (click)="handleStockDetailsButtonClick($event)" class="stock"
3069
+ [innerText]="stock_available"></div>
3070
+ <div *ngIf="!stock_available" (click)="handleStockDetailsButtonClick($event)" class="stock not-in-stock"
3071
+ [innerText]="'Niet op voorraad'"></div>
3072
+ </div>
3073
+ <div *ngIf="options.showAddArticleButton" class="on-article-buttons">
3074
+ <co-button *ngIf="!configurable"
3075
+ [label]="options.addArticleButtonText"
3076
+ class="open-icon action pointer"
3077
+ (onClick)="handleAddArticleButtonClick($event)"
3078
+ [iconData]="iconCache.getIcon(icons.AddToCartDrop)">
3079
+ </co-button>
3080
+ <co-button *ngIf="configurable"
3081
+ [label]="options.lookAtArticleButtonText"
3082
+ class="open-icon action pointer"
3083
+ (onClick)="handleLookAtArticleButtonClick($event)"
3084
+ [iconData]="iconCache.getIcon(icons.MagicWand)">
3085
+ </co-button>
3086
+ <!--co-button
3087
+ [label]="options.stockButtonText"
3088
+ class="open-icon action pointer stock"
3089
+ (onClick)="handleStockDetailsButtonClick($event)"
3090
+ [iconData]="iconCache.getIcon(icons.Truck)">
3091
+ </co-button-->
3092
+ </div>
3093
+ </div>
3094
+ </div>
3095
+ </div>
3096
+ `,
3097
+ encapsulation: ViewEncapsulation.None
2319
3098
  },] }
2320
3099
  ];
2321
- FilterItemsComponent.ctorParameters = () => [
2322
- { type: IconCacheService },
2323
- { type: CatalogService }
2324
- ];
2325
- FilterItemsComponent.propDecorators = {
2326
- filterCollection: [{ type: Input }],
2327
- description: [{ type: Input }],
2328
- customColors: [{ type: Input }],
2329
- filterCollectionChange: [{ type: Output }]
3100
+ CatalogArticleTileComponent.propDecorators = {
3101
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-article-tile',] }]
2330
3102
  };
2331
3103
 
2332
- class GreaterThanZeroPipe {
2333
- transform(items, field) {
2334
- if (!items || !field) {
2335
- return items;
2336
- }
2337
- return items.filter(item => item[field] > 0);
2338
- }
3104
+ class CatalogArticleTileModule {
2339
3105
  }
2340
- GreaterThanZeroPipe.decorators = [
2341
- { type: Pipe, args: [{
2342
- name: 'greaterThanZero',
2343
- pure: false
3106
+ CatalogArticleTileModule.decorators = [
3107
+ { type: NgModule, args: [{
3108
+ imports: [
3109
+ CommonModule,
3110
+ IconModule,
3111
+ CatalogFilterModule,
3112
+ PriceDisplayPipeModule,
3113
+ ButtonModule,
3114
+ ImageModule
3115
+ ],
3116
+ declarations: [
3117
+ CatalogArticleTileComponent
3118
+ ],
3119
+ exports: [
3120
+ CatalogArticleTileComponent
3121
+ ]
2344
3122
  },] }
2345
3123
  ];
2346
3124
 
2347
- class NavigationComponent {
2348
- constructor(iconCache, navigationService, catalogController, _appEventService) {
2349
- this.iconCache = iconCache;
2350
- this.navigationService = navigationService;
2351
- this.catalogController = catalogController;
2352
- this._appEventService = _appEventService;
2353
- this.icons = IconEnum;
2354
- this.minified = false;
2355
- this.mobileMenuToggle = false;
2356
- }
2357
- get internalList() {
2358
- let list = [];
2359
- this.catalogController.externalSourceViewModels.forEach(element => {
2360
- if (element.catalogDefinition.useCatalogPage && element.externalSource.url !== '') {
2361
- list.push(element);
2362
- }
2363
- });
2364
- return list;
2365
- }
2366
- get externalList() {
2367
- let list = [];
2368
- this.catalogController.externalSourceViewModels.forEach(element => {
2369
- if (!element.catalogDefinition.useCatalogPage && element.externalSource.url !== '') {
2370
- list.push(element);
2371
- }
2372
- });
2373
- return list;
2374
- }
2375
- onToggleMobileMenu() {
2376
- this.mobileMenuToggle = !this.mobileMenuToggle;
2377
- }
2378
- onSubMenuToggle(event) {
2379
- event.preventDefault();
2380
- const parentItem = event.currentTarget.closest('li');
2381
- const parentClasses = parentItem.classList;
2382
- if (parentClasses.contains('open')) {
2383
- parentClasses.remove('open');
2384
- }
2385
- else {
2386
- parentClasses.add('open');
2387
- }
2388
- }
2389
- onOpenSubMenu(event) {
2390
- const listItem = event.target;
2391
- const rect = listItem.getBoundingClientRect();
2392
- const rectParent = listItem.parentNode.getBoundingClientRect();
2393
- this.popupHeight = rectParent.height;
2394
- this.popupLeft = rectParent.width;
2395
- }
2396
- onSetCategory(event, category) {
2397
- if (!event.target.closest('.toggle_sub_menu') && !event.target.classList.contains('toggle_sub_menu')) {
2398
- this.navigationService.setCategory(category);
2399
- this.mobileMenuToggle = false;
2400
- }
2401
- }
2402
- onSetTurnoverGroup(event, turnoverGroup) {
2403
- if (!event.target.closest('.toggle_sub_menu') && !event.target.classList.contains('toggle_sub_menu')) {
2404
- this.navigationService.setTurnoverGroup(turnoverGroup);
2405
- this.mobileMenuToggle = false;
2406
- }
2407
- }
2408
- onOpenExternalCatalog(event, webviewUrl) {
2409
- this.navigationService.setExternalSourceUrl(webviewUrl);
2410
- }
2411
- onOpenIoneCatalog(event, webviewUrl, ioneUrl, upId, userName, passWord) {
2412
- this.navigationService.setIoneSourceUrl(webviewUrl, ioneUrl, upId, userName, passWord);
2413
- }
2414
- onOpenHomePage(event) {
2415
- this.navigationService.navigateToHome();
2416
- }
2417
- }
2418
- NavigationComponent.decorators = [
2419
- { type: Component, args: [{
2420
- selector: 'app-ione-catalog-navigation',
2421
- template: "<div class=\"component-wrapper\">\r\n <div class=\"header-wrapper\">\r\n <div class=\"header\">\r\n <div class=\"navigation-container\" [class.minified]=\"minified\">\r\n <div class=\"home\">\r\n <a class=\"navigation-link\" (click)=\"onOpenHomePage($event)\" [textContent]=\"'Home' | localize\"></a>\r\n </div>\r\n <div class=\"navigation\">\r\n <button type=\"button\" class=\"menu-toggle\" [class.active]=\"mobileMenuToggle\" (click)=\"onToggleMobileMenu()\">\r\n <co-icon class=\"hamburger-icon\" [iconData]=\"iconCache.getIcon(icons.Hamburger)\"></co-icon>\r\n <span [textContent]=\"'Collectie' | localize\"></span>\r\n </button>\r\n <div class=\"navigation-dropdown\" [class.active]=\"mobileMenuToggle\">\r\n <ul class=\"navigation-menu narrow-scrollbar\" *ngIf=\"navigationService.navigationCategories.length > 0\">\r\n\r\n <button type=\"button\" class=\"menu-close\" (click)=\"onToggleMobileMenu()\">\r\n <co-icon [iconData]=\"iconCache.getIcon(icons.Close)\"></co-icon>\r\n </button>\r\n\r\n\r\n\r\n <li *ngFor=\"let category of navigationService.navigationCategories\" [class.has-children]=\"category.turnoverGroups && category.turnoverGroups.length > 0\" (mouseenter)=\"onOpenSubMenu($event)\">\r\n <a (click)=\"onSetCategory($event, category.category)\">\r\n <span [textContent]=\"category.description | localize\"></span>\r\n </a>\r\n <button type=\"button\" class=\"toggle-sub-menu\" (click)=\"onSubMenuToggle($event)\" *ngIf=\"category.turnoverGroups && category.turnoverGroups.length > 0\">\r\n <co-icon [iconData]=\"iconCache.getIcon(icons.ArrowScrollDown)\"></co-icon>\r\n </button>\r\n <ul *ngIf=\"category.turnoverGroups && category.turnoverGroups.length > 0\">\r\n <li *ngFor=\"let turnoverGroup of category.turnoverGroups\">\r\n <a (click)=\"onSetTurnoverGroup($event, turnoverGroup.turnovergroupNr)\">\r\n <span [textContent]=\"turnoverGroup.description | localize\"></span>\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n <div class=\"navigation external-source\">\r\n <button class=\"menu-toggle\">\r\n <co-icon class=\"hamburger-icon\" [iconData]=\"iconCache.getIcon(icons.Ar)\"></co-icon>\r\n <span [textContent]=\"'Externe Catalogus' | localize\"></span>\r\n </button>\r\n <div class=\"navigation-dropdown\">\r\n <ul class=\"navigation-menu narrow-scrollbar external\">\r\n <li class=\"internal-header\" *ngIf=\"internalList && internalList.length > 0\">\r\n <a href=\"#\">\r\n <span>Externe Catalogus</span>\r\n </a>\r\n <ul>\r\n <li *ngFor=\"let definition of internalList\">\r\n <a *ngIf=\"definition.catalogDefinition.useCatalogPage\"\r\n (click)=\"onOpenIoneCatalog(\r\n $event,\r\n definition.catalogDefinition.webviewUrl,\r\n definition.externalSource.url,\r\n definition.externalSource.schema,\r\n definition.externalSource.username,\r\n definition.externalSource.password\r\n )\">\r\n <!--co-image *ngIf=\"definition.catalogDefinition.imageData\" [source]=\"definition.catalogDefinition.imageData\"></co-image>\r\n <div class=\"no-image-wrapper\" *ngIf=\"!definition.catalogDefinition.imageData\">\r\n <co-icon class=\"no-image\" [iconData]=\"iconCache.getIcon(icons.Camera)\"></co-icon>\r\n <span [textContent]=\"'NO_IMAGE' | localize\"></span>\r\n </div-->\r\n <span [textContent]=\"definition.catalogDefinition.name\"></span>\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n <li class=\"external-header\" *ngIf=\"externalList && externalList.length > 0\">\r\n <a href=\"#\">\r\n <span>Externe Web URL</span>\r\n </a>\r\n <ul>\r\n <li *ngFor=\"let definition of externalList\">\r\n <a (click)=\"onOpenExternalCatalog($event, definition.externalSource.url)\">\r\n <!--co-image *ngIf=\"definition.catalogDefinition.imageData\" [source]=\"definition.catalogDefinition.imageData\"></co-image>\r\n <div class=\"no-image-wrapper\" *ngIf=\"!definition.catalogDefinition.imageData\">\r\n <co-icon class=\"no-image\" [iconData]=\"iconCache.getIcon(icons.Camera)\"></co-icon>\r\n <span [textContent]=\"'NO_IMAGE' | localize\"></span>\r\n </div-->\r\n <span [textContent]=\"definition.catalogDefinition.name\"></span>\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div id=\"top_content\">\r\n <div class=\"search-wrapper\">\r\n <app-top-content></app-top-content>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n",
2422
- styles: ["*:focus{outline:none}ul{list-style:none}a{text-decoration:none;cursor:pointer}.component-wrapper .header-wrapper{margin:0 auto;position:relative;padding:0 15px;width:100%}.component-wrapper .header-wrapper .header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-bottom:1px solid #ececec;padding:0 0 15px}.component-wrapper .header-wrapper .header .logo img{max-height:70px;max-width:70px}.navigation-container{background:#c8d8e6;text-align:center;font-family:iOneMontserrat;font-size:15px;min-height:50px;width:100%}.navigation-container.minified{min-height:30px;font-size:11px}.menu-toggle{cursor:pointer;border-radius:5px;height:40px;padding:5px 20px 5px 5px;float:left;margin:0;border:none;font-family:iOneMontserrat;box-sizing:border-box;display:flex;background:#FFF}.menu-toggle span{line-height:31px;display:inline-block;vertical-align:top;font-size:15px}.menu-toggle .hamburger-icon{fill:#222!important;margin:0 5px 0 0}.menu-close{position:absolute;right:0;top:0;height:50px;width:50px;background:transparent;color:#22313c;border:none;cursor:pointer;display:none}.navigation-container.minified .menu-toggle{height:30px;padding:0 20px 0 5px;font-size:11px;margin:0;border-radius:0}.toggle-sub-menu{display:none;float:left;width:50px;height:40px;text-align:center;border:none;background:transparent;color:#5a6875;position:absolute;right:0;top:5px;padding:0;cursor:pointer}.toggle-sub-menu co-icon{transition:.3s ease-in-out;width:20px;height:20px;margin:5px 0 0}li.open>.toggle-sub-menu co-icon{transform:rotate(180deg)}@media screen and (min-width: 941px){.navigation:hover .navigation-dropdown{height:auto;width:calc(100% - 60px);visibility:visible;opacity:1}.navigation:hover .menu-toggle{background:#3E7EFF;color:#fff}.navigation:hover .menu-toggle co-icon ::ng-deep{fill:#fff!important}.navigation:hover .menu-toggle co-icon ::ng-deep svg{fill:#fff!important}.navigation:hover .menu-toggle co-icon ::ng-deep svg g{fill:#fff!important}.navigation:hover .menu-toggle co-icon ::ng-deep svg g path{fill:#fff!important}.navigation:hover .menu-toggle co-icon ::ng-deep svg rect:not(:first-child){fill:#fff!important}.navigation-container{background:#FFF;display:flex;align-items:center;grid-gap:20px;gap:20px;padding-left:10px}.navigation-container .navigation-link{font-size:16px;font-weight:600}.menu-toggle{margin-left:0;border-radius:0}.menu-toggle span{font-size:16px;font-weight:600}.navigation-dropdown{position:absolute;width:calc(100% - 60px);top:calc(100% - 33px);left:30px;background:#fff;box-shadow:0 5px 5px 2px #0000004d;overflow:hidden;visibility:hidden;z-index:9;opacity:0;transform:translateY(10px);transition:opacity .2s ease-in,transform .2s ease-in,visibility .2s ease-in}.navigation-menu{display:inline-block;text-align:left;margin:0;padding:0;background:#FFF;width:100%}.navigation-menu>li{display:block;padding:13px 30px;float:left;width:20%}.navigation-menu>li.external-menu{width:12.5%;height:180px;position:relative;margin:10px 0}.navigation-menu>li.external-menu a{align-items:center;height:150px;font-size:12px;color:#222}.navigation-menu>li.external-menu a span{margin-top:0;display:block;position:absolute;bottom:5px;width:100%;text-align:center}.navigation-menu>li.external-menu a co-image{height:100px;width:100%}.navigation-menu>li.external-menu .no-image-wrapper{height:100px;width:100%;text-align:center;position:relative;background:#ececec}.navigation-menu>li.external-menu .no-image-wrapper co-icon ::ng-deep{height:100px;width:100%;position:absolute;left:0;top:0}.navigation-menu>li.external-menu .no-image-wrapper co-icon ::ng-deep svg{max-height:50px;position:absolute;top:50%;left:0;transform:translateY(-50%)}.navigation-menu>li.external-menu .no-image-wrapper co-icon ::ng-deep svg rect,.navigation-menu>li.external-menu .no-image-wrapper co-icon ::ng-deep svg path{fill:#fff}.navigation-menu>li.external-menu .no-image-wrapper span{color:#fff}.navigation-menu>li>a{display:inline-block;line-height:20px;border-bottom:1px solid #ececec;position:relative;z-index:12;width:100%;font-size:15px;padding-bottom:10px;font-weight:600;color:#222}.navigation-menu>li>a span{font-size:15px;font-weight:600;color:#222}.navigation-menu>li:hover>a{color:#3e7eff;border-bottom:1px solid #3E7EFF;z-index:12;text-decoration:none}.navigation-menu>li:hover>a span{color:#3e7eff}.navigation-menu>li>ul{padding-left:0;padding-top:15px}.navigation-menu>li>ul>li{padding:3px;margin:0}.navigation-menu>li>ul>li>a{line-height:24px;color:#22313c;font-size:13px;font-weight:normal}.navigation-menu>li>ul>li>a span{color:#22313c;font-size:13px;font-weight:normal}.navigation-menu>li>ul>li>a:hover{color:#3e7eff;text-decoration:underline}.navigation-menu>li>ul>li>a:hover span{color:#3e7eff}.navigation-menu>li>ul ul{display:none}.navigation-container.minified .navigation-menu{font-size:13px}.navigation-container.minified .navigation-menu>li{padding:7px 10px}.navigation-container.minified .navigation-menu>li>a{line-height:16px}.navigation-container.minified .navigation-menu>li>ul{padding:25px 30px}.navigation-container.minified .navigation-menu>li>ul>li>a{font-size:13px;line-height:24px}}@media screen and (max-width: 940px){.menu-close,.menu-toggle{display:flex}.navigation-menu{position:absolute;left:0;top:0;background:#fff;margin:0 0 0 -500px;overflow:auto;width:350px;height:100vh;max-width:100%;text-align:left;padding:50px 15px 30px;box-shadow:1px 0 8px #484f6040;transition:.3s ease-in-out;font-size:14px;box-sizing:border-box}.navigation-dropdown.active .navigation-menu{margin:0}.navigation-menu>li{display:block;width:100%;margin:0 0 15px;position:relative}.navigation-menu li.open>ul{display:block;height:auto!important}.navigation-menu>li>a{display:block;padding:15px 20px;border:1px solid #DCE4EA;border-radius:5px;color:#22313c;position:relative}.navigation-menu li.open>a,.navigation-menu>li>a:hover{background:#c8d8e6}.navigation-menu>li ul{display:none;padding:0 0 0 15px;font-size:93%;margin:-1px 0 0}.navigation-menu>li ul li{display:block;width:100%;margin:5px 0}.navigation-menu>li ul li a{display:block;padding:10px;color:#22313c;border:1px solid #DCE4EA;border-radius:5px;position:relative}.navigation-menu>li ul li a:hover{background:#DCE4EA}.toggle-sub-menu{display:block}.navigation-container.minified .navigation-menu{height:calc(100% - 30px);top:30px}}@media screen and (max-width: 480px){.navigation-menu{width:100%}}\n"]
2423
- },] }
2424
- ];
2425
- NavigationComponent.ctorParameters = () => [
2426
- { type: IconCacheService },
2427
- { type: NavigationService },
2428
- { type: CatalogService },
2429
- { type: AppEventService }
2430
- ];
2431
- NavigationComponent.propDecorators = {
2432
- minified: [{ type: Input }]
2433
- };
2434
-
2435
3125
  class VisibilityObserverMasterDirective {
2436
3126
  // I initialize the intersection observer parent directive.
2437
3127
  constructor() {
@@ -2533,104 +3223,296 @@ VisibilityObserverDirective.propDecorators = {
2533
3223
  observerEnabled: [{ type: Input }]
2534
3224
  };
2535
3225
 
2536
- class AppInitializerService {
2537
- constructor(_settingsService) {
2538
- this._settingsService = _settingsService;
2539
- }
2540
- initializeApp() {
2541
- return __awaiter(this, void 0, void 0, function* () {
2542
- return this._settingsService.initializeSettings();
2543
- });
3226
+ class VisibilityObserverModule {
3227
+ }
3228
+ VisibilityObserverModule.decorators = [
3229
+ { type: NgModule, args: [{
3230
+ declarations: [
3231
+ VisibilityObserverMasterDirective,
3232
+ VisibilityObserverDirective
3233
+ ],
3234
+ exports: [
3235
+ VisibilityObserverMasterDirective,
3236
+ VisibilityObserverDirective
3237
+ ]
3238
+ },] }
3239
+ ];
3240
+
3241
+ class CatalogSearchResultTileModule {
3242
+ }
3243
+ CatalogSearchResultTileModule.decorators = [
3244
+ { type: NgModule, args: [{
3245
+ imports: [
3246
+ CommonModule,
3247
+ CatalogArticleTileModule,
3248
+ VisibilityObserverModule,
3249
+ PaginationBarModule,
3250
+ CatalogFilterModule
3251
+ ],
3252
+ declarations: [
3253
+ CatalogSearchResultTileComponent
3254
+ ],
3255
+ exports: [
3256
+ CatalogSearchResultTileComponent
3257
+ ]
3258
+ },] }
3259
+ ];
3260
+
3261
+ class CatalogSearchResultListComponent extends CatalogSearchBaseComponent {
3262
+ showClass() {
3263
+ return true;
2544
3264
  }
2545
3265
  }
2546
- AppInitializerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AppInitializerService_Factory() { return new AppInitializerService(i0.ɵɵinject(SettingsService)); }, token: AppInitializerService, providedIn: "root" });
2547
- AppInitializerService.decorators = [
2548
- { type: Injectable, args: [{
2549
- providedIn: 'root',
3266
+ CatalogSearchResultListComponent.decorators = [
3267
+ { type: Component, args: [{
3268
+ selector: 'co-catalog-search-result-list',
3269
+ template: `
3270
+ <div class="article-cards" visibilityObserverMaster>
3271
+ <ng-container *ngFor="let article of catalogSearchService.articles">
3272
+ <co-catalog-article-list
3273
+ visibilityObserver
3274
+ #intersection="intersection"
3275
+ [observerEnabled]="!article.imageData"
3276
+ [showing]="intersection.isIntersecting"
3277
+ [article]="article"
3278
+ >
3279
+ </co-catalog-article-list>
3280
+ </ng-container>
3281
+ </div>
3282
+ <co-pagination-bar *ngIf="catalogSearchService.articles?.length > 0"
3283
+ [currentPage]="catalogSearchService.currentPage"
3284
+ [itemsPerPage]="catalogSearchService.articlesPerPage"
3285
+ [totalItems]="catalogSearchService.resultCount"
3286
+ [previousLabel]="'PREVIOUS' | localize"
3287
+ [nextLabel]="'NEXT' | localize"
3288
+ [autoHide]="true"
3289
+ [directionLinks]="true"
3290
+ [paginationRange]="8"
3291
+ (previousClick)="onPreviousClick()"
3292
+ (nextClick)="onNextClick()"
3293
+ (pageClick)="onPageClick($event)">
3294
+ </co-pagination-bar>
3295
+ `,
3296
+ encapsulation: ViewEncapsulation.None
2550
3297
  },] }
2551
3298
  ];
2552
- AppInitializerService.ctorParameters = () => [
2553
- { type: SettingsService }
2554
- ];
3299
+ CatalogSearchResultListComponent.propDecorators = {
3300
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-search-result-list',] }]
3301
+ };
2555
3302
 
2556
- function initializeApp(context) {
2557
- const x = () => context.initializeApp();
2558
- return x;
3303
+ class CatalogArticleListComponent extends ArticleBaseComponent {
3304
+ showClass() {
3305
+ return true;
3306
+ }
2559
3307
  }
2560
- class IoneCatalogModule {
3308
+ CatalogArticleListComponent.decorators = [
3309
+ { type: Component, args: [{
3310
+ selector: 'co-catalog-article-list',
3311
+ template: `
3312
+ <div class="card-wrapper">
3313
+ <div class="left">
3314
+ <div class="image">
3315
+ <co-image *ngIf="article && article.imageData" [source]="article.imageData"></co-image>
3316
+ <div class="no-image-wrapper" *ngIf="!article || !article.imageData">
3317
+ <co-icon class="no-image" [iconData]="iconCache.getIcon(icons.Camera)"></co-icon>
3318
+ <span [textContent]="'NO_IMAGE' | localize"></span>
3319
+ </div>
3320
+ </div>
3321
+ <div class="button-wrapper">
3322
+ <co-icon *ngIf="threeD" [iconData]="iconCache.getIcon(icons.ThreeD)" class="pointer"></co-icon>
3323
+ <co-icon *ngIf="threeD && options.showARButton" class="pointer"
3324
+ [iconData]="iconCache.getIcon(icons.Ar)"
3325
+ (click)="handleArButtonClick($event)"
3326
+ ></co-icon>
3327
+ </div>
3328
+ </div>
3329
+ <div class="description-wrapper">
3330
+ <div class="main">
3331
+ <div class="main-top">
3332
+ <div *ngIf="!!turnover" class="turnover" [innerText]="removeHtmlTags(turnover)"></div>
3333
+ <div *ngIf="!!name" class="description" [innerText]="removeHtmlTags(name)"></div>
3334
+ </div>
3335
+ <div class="main-bottom">
3336
+ <div class="main-bottom-left">
3337
+ <div *ngIf="!!article?.articleNumber" class="sku">
3338
+ <span [innerText]="'sku' | localize"></span>:
3339
+ <span [innerText]="article.articleNumber"></span>
3340
+ </div>
3341
+ <div class="description">
3342
+ <span class="label" [innerText]="'description' | localize"></span>
3343
+ <span class="text" *ngIf="!!article?.description"
3344
+ [innerText]="removeHtmlTags(article.description)"></span>
3345
+ <span class="text" *ngIf="!!added_description" [innerText]="removeHtmlTags(added_description)"></span>
3346
+ </div>
3347
+ </div>
3348
+ </div>
3349
+ </div>
3350
+ </div>
3351
+ <div class="right">
3352
+ <div *ngIf="!!article?.price" class="price" [innerText]="article?.price | priceDisplay:valutaSymbol"></div>
3353
+ <div *ngIf="options.showAddArticleButton" class="on-article-buttons">
3354
+ <co-button *ngIf="!configurable"
3355
+ [label]="options.addArticleButtonText"
3356
+ class="open-icon action pointer"
3357
+ (onClick)="handleAddArticleButtonClick($event)"
3358
+ [iconData]="iconCache.getIcon(icons.AddToCartDrop)">
3359
+ </co-button>
3360
+ <co-button *ngIf="configurable"
3361
+ [label]="options.lookAtArticleButtonText"
3362
+ class="open-icon action pointer"
3363
+ (onClick)="handleLookAtArticleButtonClick($event)"
3364
+ [iconData]="iconCache.getIcon(icons.MagicWand)">
3365
+ </co-button>
3366
+ <!--co-button
3367
+ [label]="options.stockButtonText"
3368
+ class="open-icon action pointer stock"
3369
+ (onClick)="handleStockDetailsButtonClick($event)"
3370
+ [iconData]="iconCache.getIcon(icons.Truck)">
3371
+ </co-button-->
3372
+ </div>
3373
+ <div *ngIf="stock_available" (click)="handleStockDetailsButtonClick($event)" class="stock"
3374
+ [innerText]="stock_available"></div>
3375
+ <div *ngIf="!stock_available" (click)="handleStockDetailsButtonClick($event)" class="stock not-in-stock"
3376
+ [innerText]="'Niet op voorraad'"></div>
3377
+ </div>
3378
+ </div>
3379
+ `,
3380
+ encapsulation: ViewEncapsulation.None
3381
+ },] }
3382
+ ];
3383
+ CatalogArticleListComponent.propDecorators = {
3384
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-article-list',] }]
3385
+ };
3386
+
3387
+ class CatalogArticleListModule {
2561
3388
  }
2562
- IoneCatalogModule.decorators = [
3389
+ CatalogArticleListModule.decorators = [
2563
3390
  { type: NgModule, args: [{
2564
3391
  imports: [
2565
- // BrowserAnimationsModule,
2566
3392
  CommonModule,
2567
- InputTextModule,
2568
- PaginationModule,
2569
- CardModule,
2570
- ButtonModule,
2571
- LevelIndicatorModule,
2572
- ImageModule,
3393
+ ImageModule$1,
2573
3394
  IconModule,
3395
+ CatalogFilterModule,
2574
3396
  PriceDisplayPipeModule,
2575
- InputYesNoModule,
2576
- SliderModule,
2577
- InputTextChipsModule,
2578
- InputCheckboxModule,
2579
- FormsModule,
2580
- FilterItemModule,
2581
- InputDatePickerModule,
2582
- InputTextModule,
2583
- InputTextModule,
2584
- SimpleGridModule,
2585
- PaginationBarModule
3397
+ ButtonModule
2586
3398
  ],
2587
3399
  declarations: [
2588
- IoneCatalogComponent,
2589
- TopContentComponent,
2590
- LeftContentComponent,
2591
- MainContentComponent,
2592
- LayoutDirective,
2593
- CatalogFilterComponent,
2594
- CatalogPageComponent,
2595
- CatalogExternalComponent,
2596
- CatalogHomeComponent,
2597
- ArticleCardComponent,
2598
- LabelFieldComponent,
2599
- IconHandleComponent,
2600
- CatalogComponent,
2601
- LocalizePipe,
2602
- GreaterThanZeroPipe,
2603
- FilterItemsComponent,
2604
- NavigationComponent,
2605
- VisibilityObserverDirective,
2606
- VisibilityObserverMasterDirective
3400
+ CatalogArticleListComponent
2607
3401
  ],
2608
- providers: [
2609
- FilterService,
2610
- SettingsService,
2611
- ImageService,
2612
- DictionaryService,
2613
- NavigationService,
2614
- OptionsService,
2615
- UtilsService,
2616
- JsonUtilsService,
2617
- IOneControllerService,
2618
- CatalogService,
2619
- IconCacheService,
2620
- {
2621
- provide: APP_INITIALIZER,
2622
- useFactory: initializeApp,
2623
- deps: [AppInitializerService],
2624
- multi: true
2625
- }
3402
+ exports: [
3403
+ CatalogArticleListComponent
3404
+ ]
3405
+ },] }
3406
+ ];
3407
+
3408
+ class CatalogSearchResultListModule {
3409
+ }
3410
+ CatalogSearchResultListModule.decorators = [
3411
+ { type: NgModule, args: [{
3412
+ imports: [
3413
+ CommonModule,
3414
+ VisibilityObserverModule,
3415
+ CatalogArticleListModule,
3416
+ PaginationBarModule,
3417
+ CatalogFilterModule
3418
+ ],
3419
+ declarations: [
3420
+ CatalogSearchResultListComponent
3421
+ ],
3422
+ exports: [
3423
+ CatalogSearchResultListComponent
3424
+ ]
3425
+ },] }
3426
+ ];
3427
+
3428
+ class CatalogSearchModule {
3429
+ }
3430
+ CatalogSearchModule.decorators = [
3431
+ { type: NgModule, args: [{
3432
+ imports: [
3433
+ CommonModule,
3434
+ CatalogFilterModule,
3435
+ CatalogSearchHeaderModule,
3436
+ CatalogSearchResultTileModule,
3437
+ CatalogSearchResultListModule,
3438
+ CatalogCategoriesModule,
3439
+ CatalogExternalSourcesModule,
3440
+ CatalogNavigationModule
3441
+ ],
3442
+ declarations: [
3443
+ CatalogSearchComponent
2626
3444
  ],
2627
3445
  exports: [
2628
- IoneCatalogComponent,
2629
- NavigationComponent
3446
+ CatalogSearchComponent
3447
+ ]
3448
+ },] }
3449
+ ];
3450
+
3451
+ class CatalogExternalSourceComponent {
3452
+ constructor(catalogService, _appEventService, _sanitizer, _ref, _renderer) {
3453
+ this.catalogService = catalogService;
3454
+ this._appEventService = _appEventService;
3455
+ this._sanitizer = _sanitizer;
3456
+ this._ref = _ref;
3457
+ this._renderer = _renderer;
3458
+ this._subs = [];
3459
+ this._renderer.addClass(document.body, 'external');
3460
+ this._subs.push(this.catalogService.externalSourceChanged.subscribe(changed => {
3461
+ if (changed) {
3462
+ if (this.externalSourceFrame && this.externalSourceFrame.nativeElement) {
3463
+ this.externalSourceFrame.nativeElement.src = '';
3464
+ this.externalSourceFrame.nativeElement.src = this.catalogService.externalSourceUrl;
3465
+ }
3466
+ }
3467
+ }));
3468
+ }
3469
+ showClass() {
3470
+ return true;
3471
+ }
3472
+ ngAfterViewInit() {
3473
+ this._ref.detach();
3474
+ }
3475
+ ngOnDestroy() {
3476
+ this._renderer.removeClass(document.body, 'external');
3477
+ this._subs.forEach(s => s.unsubscribe());
3478
+ }
3479
+ getSafeUrl() {
3480
+ return this._sanitizer.bypassSecurityTrustResourceUrl(this.catalogService.externalSourceUrl);
3481
+ }
3482
+ }
3483
+ CatalogExternalSourceComponent.decorators = [
3484
+ { type: Component, args: [{
3485
+ selector: 'co-catalog-external-source',
3486
+ template: `
3487
+ <iframe #externalSourceFrame class="external-iframe" [src]="getSafeUrl()"></iframe>
3488
+ `,
3489
+ encapsulation: ViewEncapsulation.None
3490
+ },] }
3491
+ ];
3492
+ CatalogExternalSourceComponent.ctorParameters = () => [
3493
+ { type: CatalogService },
3494
+ { type: CatalogEventService },
3495
+ { type: DomSanitizer },
3496
+ { type: ChangeDetectorRef },
3497
+ { type: Renderer2 }
3498
+ ];
3499
+ CatalogExternalSourceComponent.propDecorators = {
3500
+ externalSourceFrame: [{ type: ViewChild, args: ['externalSourceFrame', { read: ElementRef },] }],
3501
+ showClass: [{ type: HostBinding, args: ['class.co-catalog-external-source',] }]
3502
+ };
3503
+
3504
+ class CatalogExternalSourceModule {
3505
+ }
3506
+ CatalogExternalSourceModule.decorators = [
3507
+ { type: NgModule, args: [{
3508
+ imports: [
3509
+ CommonModule
3510
+ ],
3511
+ declarations: [
3512
+ CatalogExternalSourceComponent
2630
3513
  ],
2631
- bootstrap: [
2632
- IoneCatalogComponent,
2633
- NavigationComponent
3514
+ exports: [
3515
+ CatalogExternalSourceComponent
2634
3516
  ]
2635
3517
  },] }
2636
3518
  ];
@@ -2639,5 +3521,5 @@ IoneCatalogModule.decorators = [
2639
3521
  * Generated bundle index. Do not edit.
2640
3522
  */
2641
3523
 
2642
- export { IoneCatalogModule, Version, initializeApp, IoneCatalogComponent as ɵa, CatalogService as ɵb, LocalizePipe as ɵba, GreaterThanZeroPipe as ɵbb, FilterItemsComponent as ɵbc, NavigationComponent as ɵbd, VisibilityObserverDirective as ɵbe, VisibilityObserverMasterDirective as ɵbf, AppInitializerService as ɵbg, IOneControllerService as ɵc, UtilsService as ɵd, OptionsService as ɵe, DictionaryService as ɵf, JsonUtilsService as ɵg, SettingsService as ɵh, ImageService as ɵi, FilterService as ɵj, AppEventService as ɵk, TopContentComponent as ɵl, IconCacheService as ɵm, LeftContentComponent as ɵn, MainContentComponent as ɵo, LayoutDirective as ɵp, BaseComponent as ɵq, CatalogFilterComponent as ɵr, CatalogPageComponent as ɵs, NavigationService as ɵt, CatalogExternalComponent as ɵu, CatalogHomeComponent as ɵv, ArticleCardComponent as ɵw, LabelFieldComponent as ɵx, IconHandleComponent as ɵy, CatalogComponent as ɵz };
3524
+ export { CatalogArticleListModule, CatalogArticleTileModule, CatalogCategoriesModule, CatalogExternalSourceModule, CatalogExternalSourcesModule, CatalogFilterModule, CatalogNavigationModule, CatalogSearchHeaderModule, CatalogSearchModule, CatalogSearchResultListModule, CatalogSearchResultTileModule, CatalogSearchService, CatalogService, Version, CatalogFilterComponent as ɵa, CatalogFilterService as ɵb, VisibilityObserverMasterDirective as ɵba, VisibilityObserverDirective as ɵbb, CatalogSearchResultTileComponent as ɵbc, CatalogSearchBaseComponent as ɵbd, CatalogArticleListComponent as ɵbe, CatalogSearchResultListComponent as ɵbf, CatalogSearchComponent as ɵbg, CatalogExternalSourceComponent as ɵbh, CatalogConnectorService as ɵc, CatalogConnectorAdapterService as ɵd, SelectSingleCacheService as ɵe, BusinessObjectCacheManagerService as ɵf, SelectMultipleCacheService as ɵg, CacheField as ɵh, SelectMultipleParameterizedCacheService as ɵi, SelectSingleParameterizedCacheService as ɵj, CatalogSettingsService as ɵk, DictionaryService as ɵl, CatalogOptionsService as ɵm, IconCacheService as ɵn, LocalizePipe as ɵo, ResponsiveTextModule as ɵp, ResponsiveTextComponent as ɵq, CatalogCategoriesComponent as ɵr, CatalogImageService as ɵs, CatalogExternalSourcesComponent as ɵt, CatalogNavigationComponent as ɵu, CatalogEventService as ɵv, CatalogSearchHeaderComponent as ɵw, CatalogArticleTileComponent as ɵx, ArticleBaseComponent as ɵy, VisibilityObserverModule as ɵz };
2643
3525
  //# sourceMappingURL=colijnit-catalog.js.map