@colijnit/catalog 12.1.25 → 12.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -14
- package/bundles/colijnit-catalog.umd.js +2514 -1817
- package/bundles/colijnit-catalog.umd.js.map +1 -1
- package/colijnit-catalog.d.ts +37 -33
- package/colijnit-catalog.metadata.json +1 -1
- package/esm2015/colijnit-catalog.js +38 -34
- package/esm2015/lib/cache/cache-field.js +75 -0
- package/esm2015/lib/cache/parameter-cache-field.js +54 -0
- package/esm2015/lib/cache/service/business-object-cache-manager.service.js +150 -0
- package/esm2015/lib/cache/service/select-multiple-cache.service.js +38 -0
- package/esm2015/lib/cache/service/select-multiple-parameterized-cache.service.js +47 -0
- package/esm2015/lib/cache/service/select-single-cache.service.js +30 -0
- package/esm2015/lib/cache/service/select-single-parameterized-cache.service.js +47 -0
- package/esm2015/lib/catalog-version.js +10 -0
- package/esm2015/lib/component/base/article-base.component.js +152 -0
- package/esm2015/lib/component/base/catalog-search-base.component.js +23 -0
- package/esm2015/lib/component/catalog-article-list/catalog-article-list.component.js +86 -0
- package/esm2015/lib/component/catalog-article-list/catalog-article-list.module.js +26 -0
- package/esm2015/lib/component/catalog-article-tile/catalog-article-tile.component.js +75 -0
- package/esm2015/lib/component/catalog-article-tile/catalog-article-tile.module.js +27 -0
- package/esm2015/lib/component/catalog-categories/catalog-categories.component.js +92 -0
- package/esm2015/lib/component/catalog-categories/catalog-categories.module.js +26 -0
- package/esm2015/lib/component/catalog-external-source/catalog-external-source.component.js +57 -0
- package/esm2015/lib/component/catalog-external-source/catalog-external-source.module.js +19 -0
- package/esm2015/lib/component/catalog-external-sources/catalog-external-sources.component.js +52 -0
- package/esm2015/lib/component/catalog-external-sources/catalog-external-sources.module.js +25 -0
- package/esm2015/lib/component/catalog-filter/catalog-filter.component.js +190 -0
- package/esm2015/lib/component/catalog-filter/catalog-filter.module.js +29 -0
- package/esm2015/lib/component/catalog-navigation/catalog-navigation.component.js +205 -0
- package/esm2015/lib/component/catalog-navigation/catalog-navigation.module.js +27 -0
- package/esm2015/lib/component/catalog-search/catalog-search.component.js +104 -0
- package/esm2015/lib/component/catalog-search/catalog-search.module.js +33 -0
- package/esm2015/lib/component/catalog-search-header/catalog-search-header.component.js +36 -0
- package/esm2015/lib/component/catalog-search-header/catalog-search-header.module.js +21 -0
- package/esm2015/lib/component/catalog-search-result-list/catalog-search-result-list.component.js +44 -0
- package/esm2015/lib/component/catalog-search-result-list/catalog-search-result-list.module.js +27 -0
- package/esm2015/lib/component/catalog-search-result-tile/catalog-search-result-tile.component.js +62 -0
- package/esm2015/lib/component/catalog-search-result-tile/catalog-search-result-tile.module.js +27 -0
- package/esm2015/lib/component/responsive-text/responsive-text.component.js +24 -0
- package/esm2015/lib/component/responsive-text/responsive-text.module.js +19 -0
- package/esm2015/lib/directive/overlay/overlay-parent.directive.js +19 -0
- package/esm2015/lib/directive/overlay/overlay.directive.js +73 -0
- package/esm2015/lib/directive/overlay/overlay.module.js +18 -0
- package/esm2015/lib/directive/visibility-observer-master.directive.js +49 -0
- package/esm2015/lib/directive/visibility-observer.directive.js +55 -0
- package/esm2015/lib/directive/visibility-observer.module.js +18 -0
- package/esm2015/lib/enum/icon.enum.js +25 -0
- package/esm2015/lib/enum/language-code.enum.js +8 -0
- package/esm2015/lib/interface/order-by.interface.js +2 -0
- package/esm2015/lib/model/articles-search-result.js +3 -0
- package/esm2015/lib/model/external-source-viewmodel.js +7 -0
- package/esm2015/lib/model/filter-item.viewmodel.js +10 -0
- package/esm2015/lib/model/filter-viewmodel.js +12 -0
- package/esm2015/lib/model/icon.js +24 -0
- package/esm2015/lib/model/settings-options.js +20 -0
- package/esm2015/lib/model/settings.js +10 -0
- package/esm2015/lib/pipe/localize.pipe.js +27 -0
- package/esm2015/lib/service/catalog-connector-adapter.service.js +332 -0
- package/esm2015/lib/service/catalog-connector.service.js +142 -0
- package/esm2015/lib/service/catalog-event.service.js +19 -0
- package/esm2015/lib/service/catalog-filter.service.js +91 -0
- package/esm2015/lib/service/catalog-image.service.js +124 -0
- package/esm2015/lib/service/catalog-options.service.js +92 -0
- package/esm2015/lib/service/catalog-search.service.js +157 -0
- package/esm2015/lib/service/catalog-settings.service.js +111 -0
- package/esm2015/lib/service/catalog.service.js +305 -0
- package/esm2015/lib/service/dictionary.service.js +90 -0
- package/esm2015/lib/service/icon-cache.service.js +40 -0
- package/esm2015/lib/utils/json.utils.js +22 -0
- package/esm2015/public_api.js +15 -3
- package/fesm2015/colijnit-catalog.js +2508 -1528
- package/fesm2015/colijnit-catalog.js.map +1 -1
- package/lib/cache/cache-field.d.ts +25 -0
- package/lib/cache/parameter-cache-field.d.ts +11 -0
- package/lib/cache/service/business-object-cache-manager.service.d.ts +58 -0
- package/lib/cache/service/select-multiple-cache.service.d.ts +15 -0
- package/lib/cache/service/select-multiple-parameterized-cache.service.d.ts +19 -0
- package/lib/cache/service/select-single-cache.service.d.ts +12 -0
- package/lib/cache/service/select-single-parameterized-cache.service.d.ts +18 -0
- package/{app/components/catalog/article-card/article-card.component.d.ts → lib/component/base/article-base.component.d.ts} +20 -16
- package/lib/component/base/catalog-search-base.component.d.ts +8 -0
- package/lib/component/catalog-article-list/catalog-article-list.component.d.ts +4 -0
- package/lib/component/catalog-article-list/catalog-article-list.module.d.ts +2 -0
- package/lib/component/catalog-article-list/style/_layout.scss +463 -0
- package/lib/component/catalog-article-list/style/_material-definition.scss +9 -0
- package/lib/component/catalog-article-list/style/_theme.scss +4 -0
- package/lib/component/catalog-article-list/style/material.scss +4 -0
- package/lib/component/catalog-article-tile/catalog-article-tile.component.d.ts +4 -0
- package/lib/component/catalog-article-tile/catalog-article-tile.module.d.ts +2 -0
- package/lib/component/catalog-article-tile/style/_layout.scss +693 -0
- package/lib/component/catalog-article-tile/style/_material-definition.scss +11 -0
- package/lib/component/catalog-article-tile/style/_theme.scss +4 -0
- package/lib/component/catalog-article-tile/style/material.scss +4 -0
- package/lib/component/catalog-categories/catalog-categories.component.d.ts +19 -0
- package/lib/component/catalog-categories/catalog-categories.module.d.ts +2 -0
- package/lib/component/catalog-categories/style/_layout.scss +112 -0
- package/lib/component/catalog-categories/style/_material-definition.scss +32 -0
- package/lib/component/catalog-categories/style/_theme.scss +14 -0
- package/lib/component/catalog-categories/style/material.scss +5 -0
- package/lib/component/catalog-external-source/catalog-external-source.component.d.ts +18 -0
- package/lib/component/catalog-external-source/catalog-external-source.module.d.ts +2 -0
- package/lib/component/catalog-external-source/style/_layout.scss +51 -0
- package/lib/component/catalog-external-source/style/_material-definition.scss +0 -0
- package/lib/component/catalog-external-source/style/_theme.scss +4 -0
- package/lib/component/catalog-external-source/style/material.scss +4 -0
- package/lib/component/catalog-external-sources/catalog-external-sources.component.d.ts +13 -0
- package/lib/component/catalog-external-sources/catalog-external-sources.module.d.ts +2 -0
- package/lib/component/catalog-external-sources/style/_layout.scss +55 -0
- package/lib/component/catalog-external-sources/style/_material-definition.scss +19 -0
- package/lib/component/catalog-external-sources/style/_theme.scss +14 -0
- package/lib/component/catalog-external-sources/style/material.scss +5 -0
- package/lib/component/catalog-filter/catalog-filter.component.d.ts +40 -0
- package/lib/component/catalog-filter/catalog-filter.module.d.ts +2 -0
- package/lib/component/catalog-filter/style/_layout.scss +52 -0
- package/lib/component/catalog-filter/style/_material-definition.scss +8 -0
- package/lib/component/catalog-filter/style/_theme.scss +17 -0
- package/lib/component/catalog-filter/style/material.scss +4 -0
- package/lib/component/catalog-navigation/catalog-navigation.component.d.ts +54 -0
- package/lib/component/catalog-navigation/catalog-navigation.module.d.ts +2 -0
- package/lib/component/catalog-navigation/style/_layout.scss +523 -0
- package/lib/component/catalog-navigation/style/_material-definition.scss +26 -0
- package/lib/component/catalog-navigation/style/_theme.scss +7 -0
- package/lib/component/catalog-navigation/style/material.scss +4 -0
- package/lib/component/catalog-search/catalog-search.component.d.ts +25 -0
- package/lib/component/catalog-search/catalog-search.module.d.ts +2 -0
- package/lib/component/catalog-search/style/_layout.scss +30 -0
- package/lib/component/catalog-search/style/_material-definition.scss +2 -0
- package/lib/component/catalog-search/style/_theme.scss +4 -0
- package/lib/component/catalog-search/style/material.scss +4 -0
- package/lib/component/catalog-search-header/catalog-search-header.component.d.ts +7 -0
- package/lib/component/catalog-search-header/catalog-search-header.module.d.ts +2 -0
- package/lib/component/catalog-search-header/style/_layout.scss +12 -0
- package/lib/component/catalog-search-header/style/_material-definition.scss +4 -0
- package/lib/component/catalog-search-header/style/_theme.scss +4 -0
- package/lib/component/catalog-search-header/style/material.scss +4 -0
- package/lib/component/catalog-search-result-list/catalog-search-result-list.component.d.ts +4 -0
- package/lib/component/catalog-search-result-list/catalog-search-result-list.module.d.ts +2 -0
- package/lib/component/catalog-search-result-list/style/_layout.scss +4 -0
- package/lib/component/catalog-search-result-list/style/_material-definition.scss +0 -0
- package/lib/component/catalog-search-result-list/style/_theme.scss +4 -0
- package/lib/component/catalog-search-result-list/style/material.scss +4 -0
- package/lib/component/catalog-search-result-tile/catalog-search-result-tile.component.d.ts +12 -0
- package/lib/component/catalog-search-result-tile/catalog-search-result-tile.module.d.ts +2 -0
- package/lib/component/catalog-search-result-tile/style/_layout.scss +16 -0
- package/lib/component/catalog-search-result-tile/style/_material-definition.scss +0 -0
- package/lib/component/catalog-search-result-tile/style/_theme.scss +4 -0
- package/lib/component/catalog-search-result-tile/style/material.scss +4 -0
- package/lib/component/responsive-text/responsive-text.component.d.ts +4 -0
- package/lib/component/responsive-text/responsive-text.module.d.ts +2 -0
- package/lib/component/responsive-text/style/_layout.scss +9 -0
- package/lib/component/responsive-text/style/_material-definition.scss +0 -0
- package/lib/component/responsive-text/style/_theme.scss +4 -0
- package/lib/component/responsive-text/style/material.scss +4 -0
- package/lib/directive/overlay/overlay-parent.directive.d.ts +6 -0
- package/lib/directive/overlay/overlay.directive.d.ts +15 -0
- package/lib/directive/overlay/overlay.module.d.ts +2 -0
- package/lib/directive/visibility-observer.module.d.ts +2 -0
- package/{app → lib}/model/settings-options.d.ts +2 -0
- package/{app/service/i-one-controller.service.d.ts → lib/service/catalog-connector-adapter.service.d.ts} +4 -5
- package/lib/service/catalog-connector.service.d.ts +42 -0
- package/{app/service/app-event.service.d.ts → lib/service/catalog-event.service.d.ts} +2 -2
- package/{app/service/filter.service.d.ts → lib/service/catalog-filter.service.d.ts} +3 -3
- package/{app/service/image.service.d.ts → lib/service/catalog-image.service.d.ts} +3 -3
- package/{app/service/options.service.d.ts → lib/service/catalog-options.service.d.ts} +3 -3
- package/lib/service/catalog-search.service.d.ts +43 -0
- package/{app/service/settings.service.d.ts → lib/service/catalog-settings.service.d.ts} +3 -5
- package/{app → lib}/service/catalog.service.d.ts +20 -24
- package/{app → lib}/service/dictionary.service.d.ts +0 -3
- package/lib/style/_mixin.scss +15 -0
- package/lib/style/_variables.scss +10 -0
- package/lib/style/catalog-globals.scss +3 -0
- package/lib/utils/json.utils.d.ts +3 -0
- package/package.json +2 -2
- package/public_api.d.ts +14 -2
- package/app/base/base-component.d.ts +0 -2
- package/app/components/catalog/catalog/catalog.component.d.ts +0 -11
- package/app/components/catalog/catalog-external/catalog-external.component.d.ts +0 -19
- package/app/components/catalog/catalog-filter/catalog-filter.component.d.ts +0 -40
- package/app/components/catalog/catalog-home/catalog-home.component.d.ts +0 -15
- package/app/components/catalog/catalog-page/catalog-page.component.d.ts +0 -41
- package/app/components/catalog/filter-items/filter-items.component.d.ts +0 -20
- package/app/components/core/icon-handle/icon-handle.component.d.ts +0 -14
- package/app/components/core/label-field/label-field.component.d.ts +0 -4
- package/app/components/left-content/left-content.component.d.ts +0 -4
- package/app/components/main-content/main-content.component.d.ts +0 -4
- package/app/components/navigation/navigation.component.d.ts +0 -29
- package/app/components/top-content/top-content.component.d.ts +0 -16
- package/app/enum/level-indicator-level.enum.d.ts +0 -5
- package/app/interface/filter-item.d.ts +0 -7
- package/app/ione-catalog.component.d.ts +0 -46
- package/app/ione-catalog.module.d.ts +0 -4
- package/app/layout.directive.d.ts +0 -20
- package/app/pipe/greater-than-zero.pipe.d.ts +0 -4
- package/app/service/app-initializer.service.d.ts +0 -6
- package/app/service/navigation.service.d.ts +0 -27
- package/app/style/_scrollbars.mixins.scss +0 -18
- package/app/style/_variables.scss +0 -17
- package/app/style/catalog-globals.scss +0 -94
- package/app/utils/json-utils.service.d.ts +0 -3
- package/app/utils/string-utils.d.ts +0 -6
- package/app/utils/utils.service.d.ts +0 -21
- package/esm2015/app/base/base-component.js +0 -3
- package/esm2015/app/catalog-version.js +0 -10
- package/esm2015/app/components/catalog/article-card/article-card.component.js +0 -137
- package/esm2015/app/components/catalog/catalog/catalog.component.js +0 -32
- package/esm2015/app/components/catalog/catalog-external/catalog-external.component.js +0 -54
- package/esm2015/app/components/catalog/catalog-filter/catalog-filter.component.js +0 -142
- package/esm2015/app/components/catalog/catalog-home/catalog-home.component.js +0 -39
- package/esm2015/app/components/catalog/catalog-page/catalog-page.component.js +0 -124
- package/esm2015/app/components/catalog/filter-items/filter-items.component.js +0 -48
- package/esm2015/app/components/core/icon-handle/icon-handle.component.js +0 -32
- package/esm2015/app/components/core/label-field/label-field.component.js +0 -18
- package/esm2015/app/components/left-content/left-content.component.js +0 -13
- package/esm2015/app/components/main-content/main-content.component.js +0 -13
- package/esm2015/app/components/navigation/navigation.component.js +0 -94
- package/esm2015/app/components/top-content/top-content.component.js +0 -46
- package/esm2015/app/directive/visibility-observer-master.directive.js +0 -49
- package/esm2015/app/directive/visibility-observer.directive.js +0 -55
- package/esm2015/app/enum/icon.enum.js +0 -25
- package/esm2015/app/enum/language-code.enum.js +0 -8
- package/esm2015/app/enum/level-indicator-level.enum.js +0 -7
- package/esm2015/app/interface/filter-item.js +0 -2
- package/esm2015/app/interface/order-by.interface.js +0 -2
- package/esm2015/app/ione-catalog.component.js +0 -120
- package/esm2015/app/ione-catalog.module.js +0 -119
- package/esm2015/app/layout.directive.js +0 -68
- package/esm2015/app/model/articles-search-result.js +0 -3
- package/esm2015/app/model/external-source-viewmodel.js +0 -7
- package/esm2015/app/model/filter-item.viewmodel.js +0 -10
- package/esm2015/app/model/filter-viewmodel.js +0 -12
- package/esm2015/app/model/icon.js +0 -24
- package/esm2015/app/model/settings-options.js +0 -18
- package/esm2015/app/model/settings.js +0 -10
- package/esm2015/app/pipe/greater-than-zero.pipe.js +0 -16
- package/esm2015/app/pipe/localize.pipe.js +0 -27
- package/esm2015/app/service/app-event.service.js +0 -19
- package/esm2015/app/service/app-initializer.service.js +0 -25
- package/esm2015/app/service/catalog.service.js +0 -273
- package/esm2015/app/service/dictionary.service.js +0 -90
- package/esm2015/app/service/filter.service.js +0 -86
- package/esm2015/app/service/i-one-controller.service.js +0 -329
- package/esm2015/app/service/icon-cache.service.js +0 -35
- package/esm2015/app/service/image.service.js +0 -119
- package/esm2015/app/service/navigation.service.js +0 -80
- package/esm2015/app/service/options.service.js +0 -86
- package/esm2015/app/service/settings.service.js +0 -108
- package/esm2015/app/utils/json-utils.service.js +0 -26
- package/esm2015/app/utils/string-utils.js +0 -37
- package/esm2015/app/utils/utils.service.js +0 -111
- /package/{app → lib}/catalog-version.d.ts +0 -0
- /package/{app → lib}/directive/visibility-observer-master.directive.d.ts +0 -0
- /package/{app → lib}/directive/visibility-observer.directive.d.ts +0 -0
- /package/{app → lib}/enum/icon.enum.d.ts +0 -0
- /package/{app → lib}/enum/language-code.enum.d.ts +0 -0
- /package/{app → lib}/interface/order-by.interface.d.ts +0 -0
- /package/{app → lib}/model/articles-search-result.d.ts +0 -0
- /package/{app → lib}/model/external-source-viewmodel.d.ts +0 -0
- /package/{app → lib}/model/filter-item.viewmodel.d.ts +0 -0
- /package/{app → lib}/model/filter-viewmodel.d.ts +0 -0
- /package/{app → lib}/model/icon.d.ts +0 -0
- /package/{app → lib}/model/settings.d.ts +0 -0
- /package/{app → lib}/pipe/localize.pipe.d.ts +0 -0
- /package/{app → lib}/service/icon-cache.service.d.ts +0 -0
|
@@ -1,41 +1,286 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component,
|
|
2
|
+
import { Injectable, EventEmitter, Component, ViewEncapsulation, Input, Output, HostBinding, ChangeDetectorRef, ViewChild, Pipe, NgModule, Directive, ElementRef, HostListener, Renderer2 } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
3
4
|
import { __awaiter } from 'tslib';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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 {
|
|
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 {
|
|
21
|
+
import { InputTextModule, FilterItemModule, InputDatePickerModule, IconCollapseHandleModule, ImageModule, IconModule as IconModule$1, InputSearchModule, PaginationBarModule } from '@colijnit/corecomponents_v12';
|
|
18
22
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
19
|
-
import { SliderComponent,
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
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 {
|
|
26
29
|
constructor() {
|
|
27
30
|
this.name = "@colijnit/catalog";
|
|
28
31
|
this.description = "iOne Catalog module based on Angular 12";
|
|
29
|
-
this.symVer = "12.1.
|
|
30
|
-
this.publishDate = "
|
|
32
|
+
this.symVer = "12.1.27";
|
|
33
|
+
this.publishDate = "13-4-2023 18:09:01";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
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
|
+
});
|
|
31
92
|
}
|
|
32
93
|
}
|
|
33
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
|
-
|
|
38
|
-
class IOneControllerService {
|
|
283
|
+
class CatalogConnectorAdapterService {
|
|
39
284
|
constructor() {
|
|
40
285
|
this.controllerInitialized = new BehaviorSubject(false);
|
|
41
286
|
this.connectorOptions = {};
|
|
@@ -345,413 +590,564 @@ class IOneControllerService {
|
|
|
345
590
|
this._shouldShowLoader = showLoader;
|
|
346
591
|
}
|
|
347
592
|
}
|
|
348
|
-
|
|
349
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
378
|
-
|
|
379
|
-
return
|
|
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
|
-
|
|
414
|
-
|
|
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
|
-
|
|
442
|
-
|
|
443
|
-
|
|
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
|
-
|
|
451
|
-
|
|
452
|
-
|
|
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
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
return undefined;
|
|
475
|
-
}
|
|
476
|
-
if (!placeholder || replacementTexts.length === 0) {
|
|
477
|
-
return source;
|
|
478
|
-
}
|
|
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]);
|
|
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;
|
|
484
641
|
}
|
|
485
642
|
else {
|
|
486
|
-
|
|
487
|
-
for (let i = 0, len = replacementTexts.length; i < len; i++) {
|
|
488
|
-
outString = outString.replace(placeholder, replacementTexts[i]);
|
|
489
|
-
}
|
|
643
|
+
return this._load();
|
|
490
644
|
}
|
|
491
|
-
return outString;
|
|
492
|
-
}
|
|
493
|
-
static IsString(str) {
|
|
494
|
-
return typeof str === 'string';
|
|
495
645
|
}
|
|
496
|
-
//
|
|
497
|
-
|
|
498
|
-
return
|
|
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);
|
|
499
649
|
}
|
|
500
|
-
//
|
|
501
|
-
|
|
502
|
-
|
|
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;
|
|
667
|
+
}
|
|
668
|
+
else {
|
|
669
|
+
return Promise.resolve(undefined);
|
|
670
|
+
}
|
|
503
671
|
}
|
|
504
672
|
}
|
|
505
673
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if (!response.ok) {
|
|
512
|
-
console.error('Error getting translation:', response.statusText);
|
|
513
|
-
return '';
|
|
514
|
-
}
|
|
515
|
-
else {
|
|
516
|
-
return response.json();
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
catch (e) {
|
|
520
|
-
console.error('Error getting translation:', e.message);
|
|
521
|
-
return '';
|
|
522
|
-
}
|
|
523
|
-
});
|
|
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();
|
|
524
679
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
];
|
|
529
|
-
|
|
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 = '|~';
|
|
680
|
+
// Returns the value for given loadfunction parameters. Loads if not yet loaded.
|
|
681
|
+
getValue(...params) {
|
|
682
|
+
return this._getCacheField(params).getValue();
|
|
540
683
|
}
|
|
541
|
-
|
|
542
|
-
return this.
|
|
684
|
+
setValue(value, ...params) {
|
|
685
|
+
return this._getCacheField(params).setValue(value);
|
|
543
686
|
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
687
|
+
// Returns the freshly reloaded value for given loadfunction parameters.
|
|
688
|
+
reload(...params) {
|
|
689
|
+
return this._getCacheField(params).reload();
|
|
547
690
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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?
|
|
553
700
|
}
|
|
554
|
-
return LanguageCode.Dutch;
|
|
555
701
|
}
|
|
556
|
-
//
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
if (!
|
|
561
|
-
|
|
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();
|
|
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;
|
|
572
708
|
}
|
|
573
|
-
yield this._dictionaryPromise.get(language);
|
|
574
709
|
});
|
|
710
|
+
if (existingCacheField) {
|
|
711
|
+
return existingCacheField;
|
|
712
|
+
}
|
|
713
|
+
else {
|
|
714
|
+
return this._makeNewCacheField(params);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
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;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
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();
|
|
575
754
|
}
|
|
576
755
|
/**
|
|
577
|
-
*
|
|
578
|
-
* @param
|
|
579
|
-
* @param
|
|
580
|
-
* @param
|
|
581
|
-
* @returns
|
|
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.
|
|
582
761
|
*/
|
|
583
|
-
|
|
584
|
-
if (!
|
|
585
|
-
return
|
|
762
|
+
addNewSelectMultipleCacheItem(key, loadFunction, overrideOld = false) {
|
|
763
|
+
if (!overrideOld && this._selectMultipleCache.has(key)) {
|
|
764
|
+
return;
|
|
586
765
|
}
|
|
587
|
-
|
|
588
|
-
|
|
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;
|
|
589
775
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
if (upperCaseFirst) {
|
|
593
|
-
text = text.charAt(0).toUpperCase() + text.slice(1);
|
|
776
|
+
if (!this._selectSingleCache.has(key)) {
|
|
777
|
+
this._selectSingleCache.set(key, {});
|
|
594
778
|
}
|
|
595
|
-
|
|
596
|
-
|
|
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;
|
|
597
787
|
}
|
|
598
|
-
|
|
599
|
-
|
|
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;
|
|
600
802
|
}
|
|
601
|
-
|
|
803
|
+
const newCacheItem = new ParameterCacheField();
|
|
804
|
+
newCacheItem.loadFunction = loadFunction;
|
|
805
|
+
this._selectMultipleParameterizedCache.set(key, newCacheItem);
|
|
806
|
+
return newCacheItem;
|
|
602
807
|
}
|
|
603
|
-
|
|
604
|
-
return this.
|
|
808
|
+
hasSelectMultipleCacheItem(key) {
|
|
809
|
+
return this._selectMultipleCache.has(key);
|
|
605
810
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
];
|
|
610
|
-
DictionaryService.ctorParameters = () => [
|
|
611
|
-
{ type: JsonUtilsService }
|
|
612
|
-
];
|
|
613
|
-
|
|
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;
|
|
811
|
+
hasSingleCacheItem(key, id = BusinessObjectCacheManagerService._NullBoId) {
|
|
812
|
+
const cacheId = id.toString();
|
|
813
|
+
return this._selectSingleCache.has(key) && !!this._selectSingleCache.get(key)[cacheId];
|
|
629
814
|
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
class Settings {
|
|
633
|
-
constructor() {
|
|
634
|
-
this.session = undefined;
|
|
635
|
-
this.useEncryption = true;
|
|
636
|
-
this.type = "V";
|
|
637
|
-
this.options = new SettingsOptions();
|
|
815
|
+
hasSelectMultipleParameterizedCacheItem(key) {
|
|
816
|
+
return this._selectMultipleParameterizedCache.has(key);
|
|
638
817
|
}
|
|
639
|
-
|
|
640
|
-
|
|
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();
|
|
818
|
+
hasSelectSingleParameterizedCacheItem(key) {
|
|
819
|
+
return this._selectSingleParameterizedCache.has(key);
|
|
647
820
|
}
|
|
648
|
-
|
|
649
|
-
|
|
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);
|
|
650
824
|
}
|
|
651
|
-
|
|
652
|
-
|
|
825
|
+
getSingleCacheItem(key, id = BusinessObjectCacheManagerService._NullBoId) {
|
|
826
|
+
const cacheId = id.toString();
|
|
827
|
+
return this._selectSingleCache.has(key) && this._selectSingleCache.get(key)[cacheId];
|
|
653
828
|
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
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
|
-
}
|
|
668
|
-
});
|
|
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);
|
|
669
832
|
}
|
|
670
|
-
|
|
671
|
-
return
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
if (
|
|
676
|
-
|
|
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'];
|
|
833
|
+
getSelectSingleParameterCacheItem(key) {
|
|
834
|
+
return this._selectSingleParameterizedCache.get(key);
|
|
835
|
+
}
|
|
836
|
+
_reset() {
|
|
837
|
+
this._selectMultipleCache.forEach((cacheItem) => {
|
|
838
|
+
if (cacheItem) {
|
|
839
|
+
cacheItem.reset();
|
|
713
840
|
}
|
|
714
|
-
|
|
715
|
-
|
|
841
|
+
});
|
|
842
|
+
this._selectSingleCache.forEach((cache) => {
|
|
843
|
+
if (cache) {
|
|
844
|
+
ObjectUtils.ForOwnProperty(cache, (cacheField) => {
|
|
845
|
+
cacheField.reset();
|
|
846
|
+
});
|
|
716
847
|
}
|
|
717
|
-
|
|
718
|
-
|
|
848
|
+
});
|
|
849
|
+
this._selectSingleParameterizedCache.forEach((selSinParamCacheItem) => {
|
|
850
|
+
if (selSinParamCacheItem) {
|
|
851
|
+
selSinParamCacheItem.reset();
|
|
719
852
|
}
|
|
720
|
-
this.settingsFinished();
|
|
721
853
|
});
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
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);
|
|
854
|
+
this._selectMultipleParameterizedCache.forEach((selMulParamCacheItem) => {
|
|
855
|
+
if (selMulParamCacheItem) {
|
|
856
|
+
selMulParamCacheItem.reset();
|
|
729
857
|
}
|
|
730
|
-
this.settingsLoaded.next(true);
|
|
731
858
|
});
|
|
859
|
+
this.reset.next();
|
|
860
|
+
}
|
|
861
|
+
}
|
|
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
|
+
},] }
|
|
868
|
+
];
|
|
869
|
+
|
|
870
|
+
class SelectSingleCacheService {
|
|
871
|
+
constructor(_boCacheManager) {
|
|
872
|
+
this._boCacheManager = _boCacheManager;
|
|
873
|
+
}
|
|
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);
|
|
880
|
+
}
|
|
881
|
+
_createCacheItem(clazz, sourceId, loadFunction) {
|
|
882
|
+
// noinspection TypeScriptValidateTypes
|
|
883
|
+
return this._boCacheManager.addNewSelectSingleCacheItem(clazz, sourceId, loadFunction);
|
|
732
884
|
}
|
|
733
885
|
}
|
|
734
|
-
|
|
735
|
-
|
|
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
|
+
},] }
|
|
736
891
|
];
|
|
737
|
-
|
|
738
|
-
{ type:
|
|
739
|
-
{ type: JsonUtilsService }
|
|
892
|
+
SelectSingleCacheService.ctorParameters = () => [
|
|
893
|
+
{ type: BusinessObjectCacheManagerService }
|
|
740
894
|
];
|
|
741
895
|
|
|
742
|
-
class
|
|
743
|
-
constructor(
|
|
744
|
-
this.
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
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);
|
|
908
|
+
}
|
|
909
|
+
// noinspection TypeScriptValidateTypes
|
|
910
|
+
return this._boCacheManager.getSelectMultipleCacheItem(clazz);
|
|
911
|
+
}
|
|
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());
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
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[]>}
|
|
947
|
+
*/
|
|
948
|
+
requestCache(clazz, loadFunction) {
|
|
949
|
+
if (!this._boCacheManager.hasSelectMultipleParameterizedCacheItem(clazz)) {
|
|
950
|
+
this._createParameterizedCacheItem(clazz, loadFunction);
|
|
951
|
+
}
|
|
952
|
+
// noinspection TypeScriptValidateTypes
|
|
953
|
+
return this._boCacheManager.getSelectMultipleParameterCacheItem(clazz);
|
|
954
|
+
}
|
|
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);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
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
|
+
},] }
|
|
966
|
+
];
|
|
967
|
+
SelectMultipleParameterizedCacheService.ctorParameters = () => [
|
|
968
|
+
{ type: BusinessObjectCacheManagerService }
|
|
969
|
+
];
|
|
970
|
+
|
|
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
|
+
}));
|
|
981
|
+
}
|
|
982
|
+
ngOnDestroy() {
|
|
983
|
+
this._subs.forEach(sub => sub.unsubscribe());
|
|
984
|
+
}
|
|
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
|
+
];
|
|
1012
|
+
|
|
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();
|
|
1021
|
+
}
|
|
1022
|
+
initConnector(settings, forceReload) {
|
|
1023
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1024
|
+
yield this._adapterService.initConnector(settings, forceReload);
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1027
|
+
getArticlesForCatalog(params, showLoader = true) {
|
|
1028
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1029
|
+
return this._adapterService.getArticlesForCatalog(params, showLoader);
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
getArticleCategories(publicationCode) {
|
|
1033
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1034
|
+
return this._selectMultipleParameterizedCacheService.requestCache(ArticleCategory, (publicationCode) => {
|
|
1035
|
+
return this._adapterService.getArticleCategories(publicationCode);
|
|
1036
|
+
}).getValue(publicationCode);
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
getCatalogDefinitions(showLoader = true) {
|
|
1040
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1041
|
+
return this._selectMultipleCacheService.requestCache(CatalogDefinition, () => {
|
|
1042
|
+
return this._adapterService.getCatalogDefinitions(showLoader);
|
|
1043
|
+
}).getValue();
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
getExternalSource(externalSourceId, showLoader = true) {
|
|
1047
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
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);
|
|
1066
|
+
});
|
|
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
|
+
}
|
|
1123
|
+
}
|
|
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
|
+
},] }
|
|
1129
|
+
];
|
|
1130
|
+
CatalogConnectorService.ctorParameters = () => [
|
|
1131
|
+
{ type: CatalogConnectorAdapterService },
|
|
1132
|
+
{ type: SelectSingleCacheService },
|
|
1133
|
+
{ type: SelectMultipleCacheService },
|
|
1134
|
+
{ type: SelectMultipleParameterizedCacheService },
|
|
1135
|
+
{ type: SelectSingleParameterizedCacheService }
|
|
1136
|
+
];
|
|
1137
|
+
|
|
1138
|
+
class CatalogOptionsService {
|
|
1139
|
+
constructor(_dictionary, _settingsService) {
|
|
1140
|
+
this._dictionary = _dictionary;
|
|
1141
|
+
this._settingsService = _settingsService;
|
|
1142
|
+
this.parametersSet = new BehaviorSubject(false);
|
|
1143
|
+
this.brandFilter = [];
|
|
1144
|
+
this._parameters = {};
|
|
1145
|
+
this._subs = [];
|
|
1146
|
+
this._subs.push(this._dictionary.dictionaryLoaded.subscribe(() => {
|
|
1147
|
+
if (!this._settingsService.settings.options.lookAtArticleButtonText) {
|
|
1148
|
+
this._settingsService.settings.options.lookAtArticleButtonText =
|
|
1149
|
+
this._dictionary.get(this._settingsService.settings.options.lookAtArticleButtonText);
|
|
1150
|
+
}
|
|
755
1151
|
if (!this._settingsService.settings.options.addArticleButtonText) {
|
|
756
1152
|
this._settingsService.settings.options.addArticleButtonText =
|
|
757
1153
|
this._dictionary.get(this._settingsService.settings.options.addArticleButtonText);
|
|
@@ -813,15 +1209,18 @@ class OptionsService {
|
|
|
813
1209
|
return this._parameters;
|
|
814
1210
|
}
|
|
815
1211
|
}
|
|
816
|
-
|
|
817
|
-
|
|
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
|
-
|
|
1218
|
+
CatalogOptionsService.ctorParameters = () => [
|
|
820
1219
|
{ type: DictionaryService },
|
|
821
|
-
{ type:
|
|
1220
|
+
{ type: CatalogSettingsService }
|
|
822
1221
|
];
|
|
823
1222
|
|
|
824
|
-
class
|
|
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
|
-
|
|
934
|
-
|
|
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
|
-
|
|
937
|
-
{ type:
|
|
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
|
|
1363
|
+
class CatalogFilterService {
|
|
969
1364
|
constructor(_iOneController) {
|
|
970
1365
|
this._iOneController = _iOneController;
|
|
971
1366
|
this.priceMinFilter = 0;
|
|
@@ -1041,70 +1436,45 @@ class FilterService {
|
|
|
1041
1436
|
return this.filterItemMap.get(key);
|
|
1042
1437
|
}
|
|
1043
1438
|
}
|
|
1044
|
-
|
|
1045
|
-
|
|
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
|
+
},] }
|
|
1046
1444
|
];
|
|
1047
|
-
|
|
1048
|
-
{ type:
|
|
1445
|
+
CatalogFilterService.ctorParameters = () => [
|
|
1446
|
+
{ type: CatalogConnectorService }
|
|
1049
1447
|
];
|
|
1050
1448
|
|
|
1051
|
-
class
|
|
1052
|
-
constructor(
|
|
1053
|
-
this.iOne = iOne;
|
|
1054
|
-
this.utils = utils;
|
|
1055
|
-
this.optionsService = optionsService;
|
|
1056
|
-
this._imageService = _imageService;
|
|
1057
|
-
this._settingsService = _settingsService;
|
|
1449
|
+
class CatalogSearchService {
|
|
1450
|
+
constructor(_filterService, _catalogConnectorService, _settingsService, _optionService) {
|
|
1058
1451
|
this._filterService = _filterService;
|
|
1059
|
-
this.
|
|
1060
|
-
this.
|
|
1061
|
-
this.
|
|
1062
|
-
this.
|
|
1452
|
+
this._catalogConnectorService = _catalogConnectorService;
|
|
1453
|
+
this._settingsService = _settingsService;
|
|
1454
|
+
this._optionService = _optionService;
|
|
1455
|
+
this.searchRequest = new ArticleExtendedRequest();
|
|
1456
|
+
// public activeSearchViewMode: SearchViewMode = SearchViewMode.FullScreen;
|
|
1457
|
+
// public activeSearchBarViewMode: SearchbarViewMode = SearchbarViewMode.Expanded;
|
|
1458
|
+
this.showFilterSidebar = false;
|
|
1459
|
+
this.articles = [];
|
|
1063
1460
|
this.articlesPerPage = 20;
|
|
1064
|
-
this.showExternalSource = false;
|
|
1065
|
-
this.showCatOrTurnoverGroupArticles = false;
|
|
1066
|
-
this.showIoneSource = false;
|
|
1067
|
-
this.listMode = false;
|
|
1068
|
-
this.webMode = true;
|
|
1069
|
-
this.filteredArticlesOnShowcase = [];
|
|
1070
|
-
this.externalSourceViewModels = [];
|
|
1071
|
-
this.categoryChanged = new Subject();
|
|
1072
|
-
this.turnoverGroupChanged = new Subject();
|
|
1073
|
-
this.searchTextChanged = new Subject();
|
|
1074
|
-
this.showPageChanged = new Subject();
|
|
1075
|
-
this.onResetFilters = new Subject();
|
|
1076
1461
|
this._currentPage = 1;
|
|
1077
1462
|
this._filterText = [];
|
|
1078
|
-
this.minMillisBetweenArticleSearches = 400;
|
|
1079
|
-
this._controllerInitialized = false;
|
|
1080
1463
|
this._subs = [];
|
|
1081
|
-
this.
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
this.ensureDataListsLoaded();
|
|
1086
|
-
this.articlesPerPage = this._settingsService.settings.options.maxItemsPerPage;
|
|
1087
|
-
if (this._settingsService.settings.options.searchOnStart) {
|
|
1088
|
-
this.searchArticles();
|
|
1464
|
+
this._subs.push(this._optionService.parametersSet.subscribe((isSet) => {
|
|
1465
|
+
if (isSet) {
|
|
1466
|
+
if (this._settingsService.settings.catalogParameters) {
|
|
1467
|
+
this.searchRequest = this._settingsService.settings.catalogParameters;
|
|
1089
1468
|
}
|
|
1090
|
-
|
|
1091
|
-
})), this.optionsService.parametersSet.subscribe((set) => {
|
|
1092
|
-
if (set) {
|
|
1093
|
-
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(' '));
|
|
1469
|
+
if (this._settingsService.settings.options.searchOnStart) {
|
|
1097
1470
|
this.searchArticles();
|
|
1098
1471
|
}
|
|
1099
1472
|
}
|
|
1100
1473
|
}));
|
|
1101
|
-
this.doArticleSearchThrottledFunc = this.utils.getAsThrottledFunction(() => {
|
|
1102
|
-
return this.doSearchArticles();
|
|
1103
|
-
}, this.minMillisBetweenArticleSearches, this);
|
|
1104
1474
|
}
|
|
1105
1475
|
set filterText(value) {
|
|
1106
1476
|
this._setRequestParametersAndProps(null, null, value);
|
|
1107
|
-
this.searchTextChanged.next(this.filterText);
|
|
1477
|
+
// this.searchTextChanged.next(this.filterText);
|
|
1108
1478
|
this.searchArticles();
|
|
1109
1479
|
}
|
|
1110
1480
|
get filterText() {
|
|
@@ -1112,7 +1482,7 @@ class CatalogService {
|
|
|
1112
1482
|
}
|
|
1113
1483
|
set turnoverGroup(value) {
|
|
1114
1484
|
this._setRequestParametersAndProps(null, value, null);
|
|
1115
|
-
this.turnoverGroupChanged.next(this.turnoverGroup);
|
|
1485
|
+
// this.turnoverGroupChanged.next(this.turnoverGroup);
|
|
1116
1486
|
this.searchArticles();
|
|
1117
1487
|
}
|
|
1118
1488
|
get turnoverGroup() {
|
|
@@ -1120,44 +1490,18 @@ class CatalogService {
|
|
|
1120
1490
|
}
|
|
1121
1491
|
set category(value) {
|
|
1122
1492
|
this._setRequestParametersAndProps(value, null, null);
|
|
1123
|
-
this.categoryChanged.next(this.category);
|
|
1493
|
+
// this.categoryChanged.next(this.category);
|
|
1124
1494
|
this.searchArticles();
|
|
1125
1495
|
}
|
|
1126
1496
|
get category() {
|
|
1127
1497
|
return this._category;
|
|
1128
1498
|
}
|
|
1129
|
-
set externalSourceUrl(url) {
|
|
1130
|
-
this._externalSourceUrl = url;
|
|
1131
|
-
this.showExternalSource = true;
|
|
1132
|
-
this.showIoneSource = false;
|
|
1133
|
-
this.showCatOrTurnoverGroupArticles = false;
|
|
1134
|
-
this.externalSourceChanged.next(true);
|
|
1135
|
-
}
|
|
1136
|
-
set ioneSourceUrl(url) {
|
|
1137
|
-
this._externalSourceUrl = url;
|
|
1138
|
-
this.showExternalSource = true;
|
|
1139
|
-
this.showIoneSource = false;
|
|
1140
|
-
this.showCatOrTurnoverGroupArticles = false;
|
|
1141
|
-
this.externalSourceChanged.next(true);
|
|
1142
|
-
}
|
|
1143
|
-
get externalSourceUrl() {
|
|
1144
|
-
return this._externalSourceUrl;
|
|
1145
|
-
}
|
|
1146
|
-
get catalogShown() {
|
|
1147
|
-
return this._catalogShown;
|
|
1148
|
-
}
|
|
1149
|
-
set catalogShown(value) {
|
|
1150
|
-
this._catalogShown = value;
|
|
1151
|
-
}
|
|
1152
|
-
get itemsFiltered() {
|
|
1153
|
-
return this.filteredArticlesOnShowcase.length !== this.articlesOnShowcase.length;
|
|
1154
|
-
}
|
|
1155
1499
|
get currentPage() {
|
|
1156
1500
|
return this._currentPage;
|
|
1157
1501
|
}
|
|
1158
1502
|
set currentPage(value) {
|
|
1159
1503
|
this._currentPage = value;
|
|
1160
|
-
this.
|
|
1504
|
+
this.searchArticles();
|
|
1161
1505
|
}
|
|
1162
1506
|
ngOnDestroy() {
|
|
1163
1507
|
this._subs.forEach(s => s.unsubscribe());
|
|
@@ -1172,97 +1516,325 @@ class CatalogService {
|
|
|
1172
1516
|
if (searchFilterProp) {
|
|
1173
1517
|
collection.forEach((viewModel) => {
|
|
1174
1518
|
if (!cleared) {
|
|
1175
|
-
this.
|
|
1519
|
+
this.searchRequest[searchFilterProp] = '';
|
|
1176
1520
|
cleared = true;
|
|
1177
1521
|
}
|
|
1178
1522
|
if (viewModel.checked) {
|
|
1179
1523
|
filterRange.push(`?='${viewModel.code}'`);
|
|
1180
1524
|
}
|
|
1181
1525
|
});
|
|
1182
|
-
this.
|
|
1526
|
+
this.searchRequest[searchFilterProp] = filterRange.join(',');
|
|
1183
1527
|
this.searchArticles();
|
|
1184
1528
|
}
|
|
1185
1529
|
}
|
|
1186
|
-
|
|
1187
|
-
this.
|
|
1188
|
-
this.
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1530
|
+
searchArticles(getFilters = true) {
|
|
1531
|
+
const lowerBound = ((this.currentPage - 1) * this.articlesPerPage) + 1;
|
|
1532
|
+
this.searchRequest.paging = new PagingParameters(lowerBound, lowerBound + this.articlesPerPage - 1, this.articlesPerPage);
|
|
1533
|
+
this._catalogConnectorService.getArticlesForCatalog(this.searchRequest).then((result) => {
|
|
1534
|
+
var _a, _b;
|
|
1535
|
+
this.articles = (_a = result.articles) !== null && _a !== void 0 ? _a : [];
|
|
1536
|
+
this.resultCount = (_b = result.count) !== null && _b !== void 0 ? _b : undefined;
|
|
1537
|
+
if (this._settingsService.settings.options.showFilter && getFilters) {
|
|
1538
|
+
this._filterService.getFilters(this.searchRequest);
|
|
1194
1539
|
}
|
|
1195
|
-
clearTimeout(this._searchTimer);
|
|
1196
|
-
this._searchTimer = setTimeout(() => {
|
|
1197
|
-
this.searchTextChanged.next(this._filterText);
|
|
1198
|
-
this.doArticleSearchThrottledFunc.call(this);
|
|
1199
|
-
}, 400);
|
|
1200
1540
|
});
|
|
1201
1541
|
}
|
|
1202
|
-
resetFilters() {
|
|
1203
|
-
this.
|
|
1204
|
-
this.
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
this.filterText = this.filterText.slice();
|
|
1542
|
+
resetFilters(search = true) {
|
|
1543
|
+
this._resetRequest();
|
|
1544
|
+
this.articles.length = 0;
|
|
1545
|
+
if (search) {
|
|
1546
|
+
this.searchArticles();
|
|
1208
1547
|
}
|
|
1209
|
-
this.onResetFilters.next();
|
|
1210
1548
|
}
|
|
1211
|
-
|
|
1212
|
-
this.
|
|
1213
|
-
this.showExternalSource = false;
|
|
1549
|
+
_resetRequest() {
|
|
1550
|
+
this.searchRequest = new ArticleExtendedRequest();
|
|
1214
1551
|
}
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
}));
|
|
1225
|
-
});
|
|
1552
|
+
// public get fullscreen(): boolean {
|
|
1553
|
+
// return this.activeSearchViewMode === SearchViewMode.FullScreen;
|
|
1554
|
+
// }
|
|
1555
|
+
//
|
|
1556
|
+
// public get collapsed(): boolean {
|
|
1557
|
+
// return this.activeSearchBarViewMode === SearchbarViewMode.Collapsed;
|
|
1558
|
+
// }
|
|
1559
|
+
toggleFilter() {
|
|
1560
|
+
this.showFilterSidebar = !this.showFilterSidebar;
|
|
1226
1561
|
}
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
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
|
|
1246
|
-
});
|
|
1562
|
+
handleHideFilter() {
|
|
1563
|
+
this.showFilterSidebar = false;
|
|
1247
1564
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
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
|
-
}
|
|
1565
|
+
handleResetFilter() {
|
|
1566
|
+
this.resetFilters();
|
|
1567
|
+
this.showFilterSidebar = false;
|
|
1568
|
+
setTimeout(() => {
|
|
1569
|
+
this.showFilterSidebar = true;
|
|
1570
|
+
}, 10);
|
|
1265
1571
|
}
|
|
1572
|
+
_setRequestParametersAndProps(category, turnoverGroup, searchText) {
|
|
1573
|
+
this.searchRequest.category = category;
|
|
1574
|
+
this.searchRequest.turnoverGroup = turnoverGroup;
|
|
1575
|
+
this.searchRequest.general = searchText ? searchText.join(' ') : null;
|
|
1576
|
+
// this._category = category;
|
|
1577
|
+
// this._turnoverGroup = turnoverGroup;
|
|
1578
|
+
// this._filterText = searchText;
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
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" });
|
|
1582
|
+
CatalogSearchService.decorators = [
|
|
1583
|
+
{ type: Injectable, args: [{
|
|
1584
|
+
providedIn: "root"
|
|
1585
|
+
},] }
|
|
1586
|
+
];
|
|
1587
|
+
CatalogSearchService.ctorParameters = () => [
|
|
1588
|
+
{ type: CatalogFilterService },
|
|
1589
|
+
{ type: CatalogConnectorService },
|
|
1590
|
+
{ type: CatalogSettingsService },
|
|
1591
|
+
{ type: CatalogOptionsService }
|
|
1592
|
+
];
|
|
1593
|
+
|
|
1594
|
+
class CatalogService {
|
|
1595
|
+
constructor(connector, connectorAdapter, settingsService, optionsService, _imageService, _settingsService, _filterService, _catalogSearchService) {
|
|
1596
|
+
this.connector = connector;
|
|
1597
|
+
this.connectorAdapter = connectorAdapter;
|
|
1598
|
+
this.settingsService = settingsService;
|
|
1599
|
+
this.optionsService = optionsService;
|
|
1600
|
+
this._imageService = _imageService;
|
|
1601
|
+
this._settingsService = _settingsService;
|
|
1602
|
+
this._filterService = _filterService;
|
|
1603
|
+
this._catalogSearchService = _catalogSearchService;
|
|
1604
|
+
this.externalSourceChanged = new BehaviorSubject(undefined);
|
|
1605
|
+
this.articleSearchFilters = {};
|
|
1606
|
+
this.articlesOnShowcase = [];
|
|
1607
|
+
this.showcaseTitle = 'CATALOG';
|
|
1608
|
+
this.articlesPerPage = 20;
|
|
1609
|
+
this.showExternalSource = false;
|
|
1610
|
+
this.showCatOrTurnoverGroupArticles = false;
|
|
1611
|
+
this.showIoneSource = false;
|
|
1612
|
+
this.listMode = false;
|
|
1613
|
+
this.webMode = true;
|
|
1614
|
+
this.filteredArticlesOnShowcase = [];
|
|
1615
|
+
this.externalSourceViewModels = [];
|
|
1616
|
+
this.categoryChanged = new Subject();
|
|
1617
|
+
this.turnoverGroupChanged = new Subject();
|
|
1618
|
+
this.searchTextChanged = new Subject();
|
|
1619
|
+
this.showPageChanged = new Subject();
|
|
1620
|
+
this.onResetFilters = new Subject();
|
|
1621
|
+
this._currentPage = 1;
|
|
1622
|
+
this._filterText = [];
|
|
1623
|
+
this.minMillisBetweenArticleSearches = 400;
|
|
1624
|
+
this._controllerInitialized = false;
|
|
1625
|
+
this._subs = [];
|
|
1626
|
+
this._currentOrderBy = 1;
|
|
1627
|
+
this._subs.push(this.connectorAdapter.controllerInitialized.subscribe((initialized) => __awaiter(this, void 0, void 0, function* () {
|
|
1628
|
+
if (initialized) {
|
|
1629
|
+
this._controllerInitialized = true;
|
|
1630
|
+
// this.ensureDataListsLoaded();
|
|
1631
|
+
this.articlesPerPage = this._settingsService.settings.options.maxItemsPerPage;
|
|
1632
|
+
if (this._settingsService.settings.options.searchOnStart) {
|
|
1633
|
+
this.searchArticles();
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
})), this.optionsService.parametersSet.subscribe((set) => {
|
|
1637
|
+
if (set) {
|
|
1638
|
+
this.defaultOptions = this.optionsService.parameters;
|
|
1639
|
+
// this._createDefaultRequest();
|
|
1640
|
+
// if (this.optionsService.parameters.general && this._settingsService.settings.options.searchOnStart) {
|
|
1641
|
+
// this._setRequestParametersAndProps(null, null, this.optionsService.parameters.general.split(' '));
|
|
1642
|
+
// this.searchArticles();
|
|
1643
|
+
// }
|
|
1644
|
+
}
|
|
1645
|
+
}));
|
|
1646
|
+
/*
|
|
1647
|
+
this.doArticleSearchThrottledFunc = this.utils.getAsThrottledFunction(() => {
|
|
1648
|
+
return this.doSearchArticles();
|
|
1649
|
+
}, this.minMillisBetweenArticleSearches, this);
|
|
1650
|
+
*/
|
|
1651
|
+
}
|
|
1652
|
+
// public set filterText(value: string[]) {
|
|
1653
|
+
// this._setRequestParametersAndProps(null, null, value);
|
|
1654
|
+
// this.searchTextChanged.next(this.filterText);
|
|
1655
|
+
// this.searchArticles();
|
|
1656
|
+
// }
|
|
1657
|
+
//
|
|
1658
|
+
// public get filterText(): string[] {
|
|
1659
|
+
// return this._filterText;
|
|
1660
|
+
// }
|
|
1661
|
+
// public set turnoverGroup(value: string) {
|
|
1662
|
+
// this._setRequestParametersAndProps(null, value, null);
|
|
1663
|
+
// this.turnoverGroupChanged.next(this.turnoverGroup);
|
|
1664
|
+
// this.searchArticles();
|
|
1665
|
+
// }
|
|
1666
|
+
//
|
|
1667
|
+
// public get turnoverGroup(): string {
|
|
1668
|
+
// return this._turnoverGroup;
|
|
1669
|
+
// }
|
|
1670
|
+
//
|
|
1671
|
+
// public set category(value: string) {
|
|
1672
|
+
// this._setRequestParametersAndProps(value, null, null);
|
|
1673
|
+
// this.categoryChanged.next(this.category);
|
|
1674
|
+
// this.searchArticles();
|
|
1675
|
+
// }
|
|
1676
|
+
//
|
|
1677
|
+
// public get category(): string {
|
|
1678
|
+
// return this._category;
|
|
1679
|
+
// }
|
|
1680
|
+
set externalSourceUrl(url) {
|
|
1681
|
+
this._externalSourceUrl = url;
|
|
1682
|
+
this.showExternalSource = true;
|
|
1683
|
+
this.showIoneSource = false;
|
|
1684
|
+
this.showCatOrTurnoverGroupArticles = false;
|
|
1685
|
+
this.externalSourceChanged.next(true);
|
|
1686
|
+
}
|
|
1687
|
+
set ioneSourceUrl(url) {
|
|
1688
|
+
this._externalSourceUrl = url;
|
|
1689
|
+
this.showExternalSource = true;
|
|
1690
|
+
this.showIoneSource = false;
|
|
1691
|
+
this.showCatOrTurnoverGroupArticles = false;
|
|
1692
|
+
this.externalSourceChanged.next(true);
|
|
1693
|
+
}
|
|
1694
|
+
get externalSourceUrl() {
|
|
1695
|
+
return this._externalSourceUrl;
|
|
1696
|
+
}
|
|
1697
|
+
get catalogShown() {
|
|
1698
|
+
return this._catalogShown;
|
|
1699
|
+
}
|
|
1700
|
+
set catalogShown(value) {
|
|
1701
|
+
this._catalogShown = value;
|
|
1702
|
+
}
|
|
1703
|
+
get itemsFiltered() {
|
|
1704
|
+
return this.filteredArticlesOnShowcase.length !== this.articlesOnShowcase.length;
|
|
1705
|
+
}
|
|
1706
|
+
get currentPage() {
|
|
1707
|
+
return this._currentPage;
|
|
1708
|
+
}
|
|
1709
|
+
set currentPage(value) {
|
|
1710
|
+
this._currentPage = value;
|
|
1711
|
+
this.doSearchArticles(false);
|
|
1712
|
+
}
|
|
1713
|
+
ngOnDestroy() {
|
|
1714
|
+
this._subs.forEach(s => s.unsubscribe());
|
|
1715
|
+
}
|
|
1716
|
+
init(settings) {
|
|
1717
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1718
|
+
yield this.settingsService.initializeSettings(settings);
|
|
1719
|
+
yield this.connector.initConnector(this.settingsService.settings);
|
|
1720
|
+
});
|
|
1721
|
+
}
|
|
1722
|
+
getCategories() {
|
|
1723
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1724
|
+
const categories = yield this.connector.getArticleCategories(this.settingsService.settings.catalogParameters.publicationCode);
|
|
1725
|
+
if (categories && categories.length > 0) {
|
|
1726
|
+
for (let i = 0; i < categories.length; i++) {
|
|
1727
|
+
let articleCategory = categories[i];
|
|
1728
|
+
this._imageService.getCategoryImage(articleCategory);
|
|
1729
|
+
articleCategory.turnoverGroups.sort((a, b) => {
|
|
1730
|
+
if (this.optionsService.sortTurnoverGroupsByAlphabet) {
|
|
1731
|
+
return (/[A-Za-z]/.test(a.description)) - (/[A-Za-z]/.test(b.description)) ||
|
|
1732
|
+
(a.description.toUpperCase() < b.description.toUpperCase() ? -1 :
|
|
1733
|
+
a.description.toUpperCase() > b.description.toUpperCase() ? 1 : 0);
|
|
1734
|
+
}
|
|
1735
|
+
else {
|
|
1736
|
+
return +a.turnovergroupNr < +b.turnovergroupNr ? -1 : +a.turnovergroupNr > +b.turnovergroupNr ? 1 : 0;
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
return categories;
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
prepareTurnoverGroupImage(group) {
|
|
1745
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1746
|
+
return this._imageService.getTurnoverGroupImage(group);
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
// public filterOnCollection(collection: FilterItemViewmodel[]): void {
|
|
1750
|
+
// if (!collection || collection.length === 0) {
|
|
1751
|
+
// return;
|
|
1752
|
+
// }
|
|
1753
|
+
// let cleared: boolean = false;
|
|
1754
|
+
// let filterRange: string[] = [];
|
|
1755
|
+
// const searchFilterProp: string = this._filterService.getFilterItemMap(collection[0].filter.filterName);
|
|
1756
|
+
// if (searchFilterProp) {
|
|
1757
|
+
// collection.forEach((viewModel: FilterItemViewmodel) => {
|
|
1758
|
+
// if (!cleared) {
|
|
1759
|
+
// this.articleSearchFilters[searchFilterProp] = '';
|
|
1760
|
+
// cleared = true;
|
|
1761
|
+
// }
|
|
1762
|
+
// if (viewModel.checked) {
|
|
1763
|
+
// filterRange.push(`?='${viewModel.code}'`);
|
|
1764
|
+
// }
|
|
1765
|
+
// });
|
|
1766
|
+
// this.articleSearchFilters[searchFilterProp] = filterRange.join(',');
|
|
1767
|
+
// this.searchArticles();
|
|
1768
|
+
// }
|
|
1769
|
+
// }
|
|
1770
|
+
changeOrderBy(orderBy) {
|
|
1771
|
+
this._currentOrderBy = orderBy.id;
|
|
1772
|
+
this._sortArticleList();
|
|
1773
|
+
}
|
|
1774
|
+
searchArticles() {
|
|
1775
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1776
|
+
if (!this._controllerInitialized) {
|
|
1777
|
+
return;
|
|
1778
|
+
}
|
|
1779
|
+
clearTimeout(this._searchTimer);
|
|
1780
|
+
this._searchTimer = setTimeout(() => {
|
|
1781
|
+
this.searchTextChanged.next(this._filterText);
|
|
1782
|
+
this.doArticleSearchThrottledFunc.call(this);
|
|
1783
|
+
}, 400);
|
|
1784
|
+
});
|
|
1785
|
+
}
|
|
1786
|
+
resetFilters() {
|
|
1787
|
+
// this._createDefaultRequest();
|
|
1788
|
+
// this.category = null;
|
|
1789
|
+
// this.turnoverGroup = null;
|
|
1790
|
+
// if (this.filterText !== null) {
|
|
1791
|
+
// this.filterText = this.filterText.slice();
|
|
1792
|
+
// }
|
|
1793
|
+
// this.onResetFilters.next();
|
|
1794
|
+
}
|
|
1795
|
+
reset() {
|
|
1796
|
+
this.showCatOrTurnoverGroupArticles = false;
|
|
1797
|
+
this.showExternalSource = false;
|
|
1798
|
+
}
|
|
1799
|
+
ensureDataListsLoaded() {
|
|
1800
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1801
|
+
// this.externalSourceViewModels.length = 0;
|
|
1802
|
+
// this.iOne.getCatalogDefinitions().then(async (defs: CatalogDefinition[]) => {
|
|
1803
|
+
// for (let i = 0; i < defs.length; i++) {
|
|
1804
|
+
// this._imageService.getExternalSourceImage(defs[i]);
|
|
1805
|
+
// const viewModel: ExternalSourceViewmodel = new ExternalSourceViewmodel(
|
|
1806
|
+
// defs[i],
|
|
1807
|
+
// defs[i].externalSourceId ? await this.iOne.getExternalSource(defs[i].externalSourceId, false) : new ExternalSource()
|
|
1808
|
+
// )
|
|
1809
|
+
// this.externalSourceViewModels.push(viewModel);
|
|
1810
|
+
// }
|
|
1811
|
+
// });
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
// POST: this.articlesOnShowcase contains all articles for given search parameters.
|
|
1815
|
+
doSearchArticles(getFilters = true) {
|
|
1816
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1817
|
+
// const lowerBound: number = ((this.currentPage - 1) * this.articlesPerPage) + 1;
|
|
1818
|
+
// this.articleSearchFilters.paging = new PagingParameters(lowerBound, lowerBound + this.articlesPerPage - 1, this.articlesPerPage);
|
|
1819
|
+
// this.iOne.getArticlesForCatalog(this.articleSearchFilters, false).then((result: ArticlesSearchResult) => {
|
|
1820
|
+
// this.resultCount = result.count;
|
|
1821
|
+
// this.articlesOnShowcase = result.articles;
|
|
1822
|
+
// this.filteredArticlesOnShowcase = this.articlesOnShowcase.slice(0);
|
|
1823
|
+
// this._sortArticleList();
|
|
1824
|
+
// this.showExternalSource = false;
|
|
1825
|
+
// this.showIoneSource = false;
|
|
1826
|
+
// this.showCatOrTurnoverGroupArticles = true;
|
|
1827
|
+
// this.showPageChanged.next(this.currentPage);
|
|
1828
|
+
// })
|
|
1829
|
+
// if (getFilters) {
|
|
1830
|
+
// this._filterService.getFilters(this.articleSearchFilters);
|
|
1831
|
+
// }
|
|
1832
|
+
// // todo: get total count of result based on same request to build paging
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1835
|
+
// public sortTurnoverGroups(categories: ArticleCategory[]): void {
|
|
1836
|
+
// }
|
|
1837
|
+
//
|
|
1266
1838
|
_sortArticleList() {
|
|
1267
1839
|
switch (this._currentOrderBy) {
|
|
1268
1840
|
case 1:
|
|
@@ -1288,27 +1860,113 @@ class CatalogService {
|
|
|
1288
1860
|
_createDefaultRequest() {
|
|
1289
1861
|
this.articleSearchFilters = Object.assign({}, this.defaultOptions);
|
|
1290
1862
|
}
|
|
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
1863
|
}
|
|
1864
|
+
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
1865
|
CatalogService.decorators = [
|
|
1301
|
-
{ type: Injectable
|
|
1866
|
+
{ type: Injectable, args: [{
|
|
1867
|
+
providedIn: 'root'
|
|
1868
|
+
},] }
|
|
1302
1869
|
];
|
|
1303
1870
|
CatalogService.ctorParameters = () => [
|
|
1304
|
-
{ type:
|
|
1305
|
-
{ type:
|
|
1306
|
-
{ type:
|
|
1307
|
-
{ type:
|
|
1308
|
-
{ type:
|
|
1309
|
-
{ type:
|
|
1871
|
+
{ type: CatalogConnectorService },
|
|
1872
|
+
{ type: CatalogConnectorAdapterService },
|
|
1873
|
+
{ type: CatalogSettingsService },
|
|
1874
|
+
{ type: CatalogOptionsService },
|
|
1875
|
+
{ type: CatalogImageService },
|
|
1876
|
+
{ type: CatalogSettingsService },
|
|
1877
|
+
{ type: CatalogFilterService },
|
|
1878
|
+
{ type: CatalogSearchService }
|
|
1310
1879
|
];
|
|
1311
1880
|
|
|
1881
|
+
class CatalogCategoriesComponent {
|
|
1882
|
+
constructor(_catalogService) {
|
|
1883
|
+
this._catalogService = _catalogService;
|
|
1884
|
+
this.showTurnoverGroups = true;
|
|
1885
|
+
this.categoryClick = new EventEmitter();
|
|
1886
|
+
this.turnoverGroupClick = new EventEmitter();
|
|
1887
|
+
this.categories = [];
|
|
1888
|
+
this.turnoverGroups = [];
|
|
1889
|
+
}
|
|
1890
|
+
showClass() {
|
|
1891
|
+
return true;
|
|
1892
|
+
}
|
|
1893
|
+
ngOnInit() {
|
|
1894
|
+
this.categories.length = 0;
|
|
1895
|
+
this.turnoverGroups.length = 0;
|
|
1896
|
+
this.getCategories();
|
|
1897
|
+
}
|
|
1898
|
+
getCategories() {
|
|
1899
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1900
|
+
try {
|
|
1901
|
+
this._catalogService.getCategories().then((cats) => {
|
|
1902
|
+
this.categories = cats;
|
|
1903
|
+
this.prepareTurnoverGroups();
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
catch (e) {
|
|
1907
|
+
}
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
prepareTurnoverGroups() {
|
|
1911
|
+
this.categories.forEach((category) => {
|
|
1912
|
+
category.turnoverGroups.forEach(tog => this._catalogService.prepareTurnoverGroupImage(tog));
|
|
1913
|
+
this.turnoverGroups.push(...category.turnoverGroups);
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
handleCategoryClick(event, category) {
|
|
1917
|
+
this.categoryClick.emit(category);
|
|
1918
|
+
}
|
|
1919
|
+
handleTurnoverGroupClick(event, turnovergroupNr) {
|
|
1920
|
+
this.turnoverGroupClick.emit(turnovergroupNr);
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
CatalogCategoriesComponent.decorators = [
|
|
1924
|
+
{ type: Component, args: [{
|
|
1925
|
+
selector: 'co-catalog-categories',
|
|
1926
|
+
template: `
|
|
1927
|
+
<div class="catalog-categories-wrapper">
|
|
1928
|
+
<ng-container *ngIf="categories && categories.length > 0">
|
|
1929
|
+
<div class="categories-wrapper">
|
|
1930
|
+
<div class="category-item" *ngFor="let category of categories" (click)="handleCategoryClick($event, category.category)">
|
|
1931
|
+
<co-image [source]="category.imageData"></co-image>
|
|
1932
|
+
<div class="category-description">
|
|
1933
|
+
<co-responsive-text [text]="category.category | localize"></co-responsive-text>
|
|
1934
|
+
</div>
|
|
1935
|
+
<!--
|
|
1936
|
+
<span [textContent]="category.category | localize"></span>
|
|
1937
|
+
-->
|
|
1938
|
+
</div>
|
|
1939
|
+
</div>
|
|
1940
|
+
<ng-container *ngIf="showTurnoverGroups">
|
|
1941
|
+
<div class="turnovergroup-wrapper" *ngFor="let category of categories">
|
|
1942
|
+
<div class="turnovergroup-items-wrapper" *ngIf="category.turnoverGroups && category.turnoverGroups.length > 0">
|
|
1943
|
+
<div class="category-title" [textContent]="category.category | localize"></div>
|
|
1944
|
+
<div class="turnovergroup-item-wrapper">
|
|
1945
|
+
<div class="turnovergroup-item" *ngFor="let turnoverGroup of category.turnoverGroups"
|
|
1946
|
+
(click)="handleTurnoverGroupClick($event, turnoverGroup.turnovergroupNr)">
|
|
1947
|
+
<co-image [source]="turnoverGroup.imageData"></co-image>
|
|
1948
|
+
<div class="turnovergroup-description" [textContent]="turnoverGroup.description | localize"></div>
|
|
1949
|
+
</div>
|
|
1950
|
+
</div>
|
|
1951
|
+
</div>
|
|
1952
|
+
</div>
|
|
1953
|
+
</ng-container>
|
|
1954
|
+
</ng-container>
|
|
1955
|
+
</div>
|
|
1956
|
+
`,
|
|
1957
|
+
encapsulation: ViewEncapsulation.None
|
|
1958
|
+
},] }
|
|
1959
|
+
];
|
|
1960
|
+
CatalogCategoriesComponent.ctorParameters = () => [
|
|
1961
|
+
{ type: CatalogService }
|
|
1962
|
+
];
|
|
1963
|
+
CatalogCategoriesComponent.propDecorators = {
|
|
1964
|
+
showTurnoverGroups: [{ type: Input }],
|
|
1965
|
+
categoryClick: [{ type: Output }],
|
|
1966
|
+
turnoverGroupClick: [{ type: Output }],
|
|
1967
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-categories',] }]
|
|
1968
|
+
};
|
|
1969
|
+
|
|
1312
1970
|
/** AUTO GENERATED FILE. DO NOT CHANGE.. **/
|
|
1313
1971
|
var IconEnum;
|
|
1314
1972
|
(function (IconEnum) {
|
|
@@ -1372,516 +2030,964 @@ class IconCacheService {
|
|
|
1372
2030
|
get iconCache() {
|
|
1373
2031
|
return this._iconCache;
|
|
1374
2032
|
}
|
|
1375
|
-
getIcon(iconName) {
|
|
1376
|
-
return this._iconCache[iconName.toLowerCase()];
|
|
2033
|
+
getIcon(iconName) {
|
|
2034
|
+
return this._iconCache[iconName.toLowerCase()];
|
|
2035
|
+
}
|
|
2036
|
+
setIconCache() {
|
|
2037
|
+
for (const key in this._allIcons) {
|
|
2038
|
+
if (this._allIcons.hasOwnProperty(key)) {
|
|
2039
|
+
this._iconCache[key.toLowerCase()] = this._sanitizer.bypassSecurityTrustHtml(this._allIcons[key]);
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
IconCacheService.ɵprov = i0.ɵɵdefineInjectable({ factory: function IconCacheService_Factory() { return new IconCacheService(i0.ɵɵinject(i1.DomSanitizer)); }, token: IconCacheService, providedIn: "root" });
|
|
2045
|
+
IconCacheService.decorators = [
|
|
2046
|
+
{ type: Injectable, args: [{
|
|
2047
|
+
providedIn: 'root'
|
|
2048
|
+
},] }
|
|
2049
|
+
];
|
|
2050
|
+
IconCacheService.ctorParameters = () => [
|
|
2051
|
+
{ type: DomSanitizer }
|
|
2052
|
+
];
|
|
2053
|
+
|
|
2054
|
+
class CatalogFilterComponent {
|
|
2055
|
+
constructor(catalogSearchService, filterService, iconCache, optionsService, changeDetector) {
|
|
2056
|
+
this.catalogSearchService = catalogSearchService;
|
|
2057
|
+
this.filterService = filterService;
|
|
2058
|
+
this.iconCache = iconCache;
|
|
2059
|
+
this.optionsService = optionsService;
|
|
2060
|
+
this.changeDetector = changeDetector;
|
|
2061
|
+
this.icons = IconEnum;
|
|
2062
|
+
this.showResetFilter = true;
|
|
2063
|
+
this.collapsed = false;
|
|
2064
|
+
this._subs = [];
|
|
2065
|
+
this._min = 0;
|
|
2066
|
+
this._max = 100000;
|
|
2067
|
+
// this._subs = [
|
|
2068
|
+
// this.catalog.onPrepareFilters.subscribe(() => {
|
|
2069
|
+
// this.setupFilters();
|
|
2070
|
+
// this.detectChanges();
|
|
2071
|
+
// })
|
|
2072
|
+
// ];
|
|
2073
|
+
}
|
|
2074
|
+
showClass() {
|
|
2075
|
+
return true;
|
|
2076
|
+
}
|
|
2077
|
+
ngOnInit() {
|
|
2078
|
+
// because our <co-checkbox-select> components will output a selectionStringChange on their init, which effectively changes this.filters
|
|
2079
|
+
this.collapsed = this.optionsService.collapseFilterByDefault;
|
|
2080
|
+
if (window.innerWidth <= 950) {
|
|
2081
|
+
this.collapsed = true;
|
|
2082
|
+
}
|
|
2083
|
+
this.initializePriceFilterMinMax();
|
|
2084
|
+
this.detectChanges();
|
|
2085
|
+
}
|
|
2086
|
+
ngOnDestroy() {
|
|
2087
|
+
this._destroyed = true;
|
|
2088
|
+
this._subs.forEach((x) => {
|
|
2089
|
+
x.unsubscribe();
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
initializePriceFilterMinMax() {
|
|
2093
|
+
this._min = this.filterService.priceMinFilter;
|
|
2094
|
+
this._max = this.filterService.priceMaxFilter;
|
|
2095
|
+
}
|
|
2096
|
+
resetFilters(event) {
|
|
2097
|
+
this.catalogSearchService.resetFilters();
|
|
2098
|
+
}
|
|
2099
|
+
onHandleClick(event) {
|
|
2100
|
+
this.collapsed = !this.collapsed;
|
|
2101
|
+
}
|
|
2102
|
+
updatePriceInputs(range) {
|
|
2103
|
+
this.filterService.priceMinFilter = range.lowerBound;
|
|
2104
|
+
this.filterService.priceMaxFilter = range.upperBound;
|
|
2105
|
+
}
|
|
2106
|
+
updateSliderRange() {
|
|
2107
|
+
if (this.priceSlider) {
|
|
2108
|
+
this.priceSlider.setLowerBound(this.filterService.priceMinFilter, false);
|
|
2109
|
+
this.priceSlider.setUpperBound(this.filterService.priceMaxFilter, false);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
updatePriceFrom() {
|
|
2113
|
+
this.updateSliderRange();
|
|
2114
|
+
}
|
|
2115
|
+
updatePriceTo() {
|
|
2116
|
+
this.updateSliderRange();
|
|
2117
|
+
}
|
|
2118
|
+
setPriceMinToDefault() {
|
|
2119
|
+
this.filterService.priceMinFilter = this._min;
|
|
2120
|
+
}
|
|
2121
|
+
setPriceMaxToDefault() {
|
|
2122
|
+
this.filterService.priceMaxFilter = this._max;
|
|
2123
|
+
}
|
|
2124
|
+
filterOnPrice() {
|
|
2125
|
+
this.filterService.priceMinFilter = !!this.filterService.priceMinFilter ? this.filterService.priceMinFilter : this._min;
|
|
2126
|
+
this.filterService.priceMaxFilter = !!this.filterService.priceMaxFilter ? this.filterService.priceMaxFilter : this._max;
|
|
2127
|
+
// some user error protection
|
|
2128
|
+
let trueLowerBound = Math.min(this.filterService.priceMinFilter, this.filterService.priceMaxFilter);
|
|
2129
|
+
let trueUpperBound = Math.max(this.filterService.priceMinFilter, this.filterService.priceMaxFilter);
|
|
2130
|
+
this.catalogSearchService.searchRequest.rangePrice = `${trueLowerBound} - ${trueUpperBound}`;
|
|
2131
|
+
this.catalogSearchService.searchArticles();
|
|
2132
|
+
}
|
|
2133
|
+
handleCollectionChange(collection) {
|
|
2134
|
+
this.catalogSearchService.filterOnCollection(collection);
|
|
2135
|
+
}
|
|
2136
|
+
detectChanges() {
|
|
2137
|
+
if (!this._destroyed) {
|
|
2138
|
+
this.changeDetector.detectChanges();
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
CatalogFilterComponent.decorators = [
|
|
2143
|
+
{ type: Component, args: [{
|
|
2144
|
+
selector: 'co-catalog-filter',
|
|
2145
|
+
template: `
|
|
2146
|
+
<div class="catalog-filter-wrapper">
|
|
2147
|
+
<div *ngIf="showResetFilter" class="reset-filter-wrapper">
|
|
2148
|
+
<div class="reset-title-wrapper">
|
|
2149
|
+
<div class="reset-title">
|
|
2150
|
+
<div class="reset-filter-title" [textContent]="'FILTER' | localize"></div>
|
|
2151
|
+
<co-icon class="reset-filter-icon" [iconData]="iconCache.getIcon(icons.SyncAlt)"></co-icon>
|
|
2152
|
+
</div>
|
|
2153
|
+
<co-icon-collapse-handle (click)="onHandleClick($event)"></co-icon-collapse-handle>
|
|
2154
|
+
</div>
|
|
2155
|
+
<div class="filter-reset" [textContent]="'RESET_FILTER' | localize" (click)="resetFilters($event)"></div>
|
|
2156
|
+
</div>
|
|
2157
|
+
<div class="filter-items-wrapper co-small-scrollbar">
|
|
2158
|
+
<div class="filter-item-wrapper">
|
|
2159
|
+
<label class="temp">Price</label>
|
|
2160
|
+
<div class="price-inputs">
|
|
2161
|
+
<co-input-text
|
|
2162
|
+
class="price-from"
|
|
2163
|
+
[type]="'number'"
|
|
2164
|
+
[digitsOnly]="true"
|
|
2165
|
+
[hideArrowButtons]="true"
|
|
2166
|
+
[excludePlusMinus]="true"
|
|
2167
|
+
[label]="'BASELINE_PRICE' | localize"
|
|
2168
|
+
[(model)]="filterService.priceMinFilter"
|
|
2169
|
+
(modelChange)="updatePriceFrom()"
|
|
2170
|
+
customWidth
|
|
2171
|
+
></co-input-text>
|
|
2172
|
+
<co-input-text
|
|
2173
|
+
class="price-to"
|
|
2174
|
+
[type]="'number'"
|
|
2175
|
+
[digitsOnly]="true"
|
|
2176
|
+
[hideArrowButtons]="true"
|
|
2177
|
+
[excludePlusMinus]="true"
|
|
2178
|
+
[label]="'PRICE_TO' | localize"
|
|
2179
|
+
[(model)]="filterService.priceMaxFilter"
|
|
2180
|
+
(modelChange)="updatePriceTo()"
|
|
2181
|
+
customWidth
|
|
2182
|
+
></co-input-text>
|
|
2183
|
+
<co-icon [iconData]="iconCache.getIcon(icons.Check)" (click)="filterOnPrice()"></co-icon>
|
|
2184
|
+
</div>
|
|
2185
|
+
</div>
|
|
2186
|
+
<div class="filter-item-wrapper">
|
|
2187
|
+
<co-filter-item [placeholder]="'MODIFIED_DATE' | localize"
|
|
2188
|
+
[expanded]="true"
|
|
2189
|
+
[customContent]="true"
|
|
2190
|
+
>
|
|
2191
|
+
<co-input-date
|
|
2192
|
+
[(model)]="catalogSearchService.searchRequest.dateModified"
|
|
2193
|
+
(modelChange)="catalogSearchService.searchArticles()"
|
|
2194
|
+
></co-input-date>
|
|
2195
|
+
</co-filter-item>
|
|
2196
|
+
</div>
|
|
2197
|
+
<div class="filter-item-wrapper" *ngFor="let filter of filterService.filters">
|
|
2198
|
+
<co-filter-item
|
|
2199
|
+
[placeholder]="filter.filterName"
|
|
2200
|
+
[collection]="filter.filterItems"
|
|
2201
|
+
[showLessLabel]="'Bekijk minder...'"
|
|
2202
|
+
[showMoreLabel]="'Bekijk meer...'"
|
|
2203
|
+
[searchPlaceholder]="'Zoeken...'"
|
|
2204
|
+
[expanded]=true
|
|
2205
|
+
[initialLimit]=5
|
|
2206
|
+
(collectionChange)="handleCollectionChange($event)"
|
|
2207
|
+
></co-filter-item>
|
|
2208
|
+
</div>
|
|
2209
|
+
</div>
|
|
2210
|
+
</div>
|
|
2211
|
+
`,
|
|
2212
|
+
animations: [
|
|
2213
|
+
trigger('showFilterItem', [
|
|
2214
|
+
state('closed', style({ height: '80px' })),
|
|
2215
|
+
state('open', style({ height: '*' })),
|
|
2216
|
+
transition('closed <=> open', animate(200))
|
|
2217
|
+
])
|
|
2218
|
+
],
|
|
2219
|
+
encapsulation: ViewEncapsulation.None
|
|
2220
|
+
},] }
|
|
2221
|
+
];
|
|
2222
|
+
CatalogFilterComponent.ctorParameters = () => [
|
|
2223
|
+
{ type: CatalogSearchService },
|
|
2224
|
+
{ type: CatalogFilterService },
|
|
2225
|
+
{ type: IconCacheService },
|
|
2226
|
+
{ type: CatalogOptionsService },
|
|
2227
|
+
{ type: ChangeDetectorRef }
|
|
2228
|
+
];
|
|
2229
|
+
CatalogFilterComponent.propDecorators = {
|
|
2230
|
+
priceSlider: [{ type: ViewChild, args: [SliderComponent, { static: true },] }],
|
|
2231
|
+
showResetFilter: [{ type: Input }],
|
|
2232
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-filter',] }],
|
|
2233
|
+
collapsed: [{ type: HostBinding, args: ['class.collapsed',] }]
|
|
2234
|
+
};
|
|
2235
|
+
|
|
2236
|
+
// A pipe for localizing string values in view templates.
|
|
2237
|
+
class LocalizePipe {
|
|
2238
|
+
constructor(_dictionaryService) {
|
|
2239
|
+
this._dictionaryService = _dictionaryService;
|
|
2240
|
+
}
|
|
2241
|
+
transform(value, upperCaseFirst = true, replace = []) {
|
|
2242
|
+
if (!value) {
|
|
2243
|
+
return '';
|
|
2244
|
+
}
|
|
2245
|
+
replace = replace ? replace : [];
|
|
2246
|
+
if (!Array.isArray(replace)) {
|
|
2247
|
+
replace = [replace];
|
|
2248
|
+
}
|
|
2249
|
+
return this._dictionaryService.get(value, upperCaseFirst, ...replace);
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
LocalizePipe.decorators = [
|
|
2253
|
+
{ type: Pipe, args: [{
|
|
2254
|
+
name: 'localize'
|
|
2255
|
+
},] }
|
|
2256
|
+
];
|
|
2257
|
+
LocalizePipe.ctorParameters = () => [
|
|
2258
|
+
{ type: DictionaryService }
|
|
2259
|
+
];
|
|
2260
|
+
|
|
2261
|
+
class CatalogFilterModule {
|
|
2262
|
+
}
|
|
2263
|
+
CatalogFilterModule.decorators = [
|
|
2264
|
+
{ type: NgModule, args: [{
|
|
2265
|
+
imports: [
|
|
2266
|
+
CommonModule,
|
|
2267
|
+
IconModule,
|
|
2268
|
+
InputTextModule,
|
|
2269
|
+
FilterItemModule,
|
|
2270
|
+
InputDatePickerModule,
|
|
2271
|
+
IconCollapseHandleModule
|
|
2272
|
+
],
|
|
2273
|
+
declarations: [
|
|
2274
|
+
CatalogFilterComponent,
|
|
2275
|
+
LocalizePipe
|
|
2276
|
+
],
|
|
2277
|
+
exports: [
|
|
2278
|
+
CatalogFilterComponent,
|
|
2279
|
+
LocalizePipe
|
|
2280
|
+
]
|
|
2281
|
+
},] }
|
|
2282
|
+
];
|
|
2283
|
+
|
|
2284
|
+
class ResponsiveTextComponent {
|
|
2285
|
+
showClass() {
|
|
2286
|
+
return true;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
ResponsiveTextComponent.decorators = [
|
|
2290
|
+
{ type: Component, args: [{
|
|
2291
|
+
selector: 'co-responsive-text',
|
|
2292
|
+
template: `
|
|
2293
|
+
<svg viewBox="0 0 100 100">
|
|
2294
|
+
<foreignObject height="100%" width="100%">
|
|
2295
|
+
<div class="text" [textContent]="text"></div>
|
|
2296
|
+
</foreignObject>
|
|
2297
|
+
</svg>
|
|
2298
|
+
`,
|
|
2299
|
+
encapsulation: ViewEncapsulation.None
|
|
2300
|
+
},] }
|
|
2301
|
+
];
|
|
2302
|
+
ResponsiveTextComponent.propDecorators = {
|
|
2303
|
+
text: [{ type: Input }],
|
|
2304
|
+
showClass: [{ type: HostBinding, args: ['class.co-responsive-text',] }]
|
|
2305
|
+
};
|
|
2306
|
+
|
|
2307
|
+
class ResponsiveTextModule {
|
|
2308
|
+
}
|
|
2309
|
+
ResponsiveTextModule.decorators = [
|
|
2310
|
+
{ type: NgModule, args: [{
|
|
2311
|
+
imports: [
|
|
2312
|
+
CommonModule
|
|
2313
|
+
],
|
|
2314
|
+
declarations: [
|
|
2315
|
+
ResponsiveTextComponent
|
|
2316
|
+
],
|
|
2317
|
+
exports: [
|
|
2318
|
+
ResponsiveTextComponent
|
|
2319
|
+
]
|
|
2320
|
+
},] }
|
|
2321
|
+
];
|
|
2322
|
+
|
|
2323
|
+
class CatalogCategoriesModule {
|
|
2324
|
+
}
|
|
2325
|
+
CatalogCategoriesModule.decorators = [
|
|
2326
|
+
{ type: NgModule, args: [{
|
|
2327
|
+
imports: [
|
|
2328
|
+
CommonModule,
|
|
2329
|
+
ImageModule,
|
|
2330
|
+
IconModule$1,
|
|
2331
|
+
CatalogFilterModule,
|
|
2332
|
+
ResponsiveTextModule
|
|
2333
|
+
],
|
|
2334
|
+
declarations: [
|
|
2335
|
+
CatalogCategoriesComponent
|
|
2336
|
+
],
|
|
2337
|
+
exports: [
|
|
2338
|
+
CatalogCategoriesComponent
|
|
2339
|
+
]
|
|
2340
|
+
},] }
|
|
2341
|
+
];
|
|
2342
|
+
|
|
2343
|
+
class CatalogEventService {
|
|
2344
|
+
constructor() {
|
|
2345
|
+
this.lookAtArticleButtonClick = new Subject();
|
|
2346
|
+
this.addArticleButtonClick = new Subject();
|
|
2347
|
+
this.arButtonClick = new Subject();
|
|
2348
|
+
this.articleClick = new Subject();
|
|
2349
|
+
this.stockDetailsClick = new Subject();
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
CatalogEventService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogEventService_Factory() { return new CatalogEventService(); }, token: CatalogEventService, providedIn: "root" });
|
|
2353
|
+
CatalogEventService.decorators = [
|
|
2354
|
+
{ type: Injectable, args: [{
|
|
2355
|
+
providedIn: 'root'
|
|
2356
|
+
},] }
|
|
2357
|
+
];
|
|
2358
|
+
|
|
2359
|
+
class CatalogNavigationComponent {
|
|
2360
|
+
constructor(iconCache,
|
|
2361
|
+
/*
|
|
2362
|
+
public navigationService: CatalogNavigationService,
|
|
2363
|
+
*/
|
|
2364
|
+
catalogService, _appEventService) {
|
|
2365
|
+
this.iconCache = iconCache;
|
|
2366
|
+
this.catalogService = catalogService;
|
|
2367
|
+
this._appEventService = _appEventService;
|
|
2368
|
+
this.icons = IconEnum;
|
|
2369
|
+
this.homeLabel = 'Home';
|
|
2370
|
+
this.collectionLabel = 'Collection';
|
|
2371
|
+
this.externalSourcesLabel = 'External sources';
|
|
2372
|
+
this.showTurnoverGroups = true;
|
|
2373
|
+
this.homeClick = new EventEmitter();
|
|
2374
|
+
this.categoryClick = new EventEmitter();
|
|
2375
|
+
this.turnoverGroupClick = new EventEmitter();
|
|
2376
|
+
this.externalSourceClick = new EventEmitter();
|
|
2377
|
+
this.minified = false;
|
|
2378
|
+
this.showClass = true;
|
|
2379
|
+
this.mobileMenuToggle = false;
|
|
2380
|
+
this.categories = [];
|
|
2381
|
+
this.turnoverGroups = [];
|
|
2382
|
+
this.showCollectionOverlay = false;
|
|
2383
|
+
this.showExternalOverlay = false;
|
|
2384
|
+
}
|
|
2385
|
+
get internalList() {
|
|
2386
|
+
let list = [];
|
|
2387
|
+
this.catalogService.externalSourceViewModels.forEach(element => {
|
|
2388
|
+
if (element.catalogDefinition.useCatalogPage && element.externalSource.url !== '') {
|
|
2389
|
+
list.push(element);
|
|
2390
|
+
}
|
|
2391
|
+
});
|
|
2392
|
+
return list;
|
|
2393
|
+
}
|
|
2394
|
+
get externalList() {
|
|
2395
|
+
let list = [];
|
|
2396
|
+
this.catalogService.externalSourceViewModels.forEach(element => {
|
|
2397
|
+
if (!element.catalogDefinition.useCatalogPage && element.externalSource.url !== '') {
|
|
2398
|
+
list.push(element);
|
|
2399
|
+
}
|
|
2400
|
+
});
|
|
2401
|
+
return list;
|
|
2402
|
+
}
|
|
2403
|
+
ngOnInit() {
|
|
2404
|
+
this.categories.length = 0;
|
|
2405
|
+
this.turnoverGroups.length = 0;
|
|
2406
|
+
this.getCategories();
|
|
2407
|
+
}
|
|
2408
|
+
getCategories() {
|
|
2409
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2410
|
+
try {
|
|
2411
|
+
this.catalogService.getCategories().then((cats) => {
|
|
2412
|
+
this.categories = cats;
|
|
2413
|
+
this.prepareTurnoverGroups();
|
|
2414
|
+
});
|
|
2415
|
+
}
|
|
2416
|
+
catch (e) {
|
|
2417
|
+
}
|
|
2418
|
+
});
|
|
2419
|
+
}
|
|
2420
|
+
prepareTurnoverGroups() {
|
|
2421
|
+
if (this.categories && this.categories.length > 0) {
|
|
2422
|
+
this.categories.forEach((category) => {
|
|
2423
|
+
category.turnoverGroups.forEach(tog => this.catalogService.prepareTurnoverGroupImage(tog));
|
|
2424
|
+
this.turnoverGroups.push(...category.turnoverGroups);
|
|
2425
|
+
});
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
handleCategoryClick(event, category) {
|
|
2429
|
+
this.categoryClick.emit(category);
|
|
2430
|
+
}
|
|
2431
|
+
handleTurnoverGroupClick(event, turnovergroupNr) {
|
|
2432
|
+
this.turnoverGroupClick.emit(turnovergroupNr);
|
|
2433
|
+
}
|
|
2434
|
+
handleExternalSourceClick(externalSource) {
|
|
2435
|
+
this.externalSourceClick.emit(externalSource);
|
|
2436
|
+
}
|
|
2437
|
+
onToggleMobileMenu() {
|
|
2438
|
+
this.mobileMenuToggle = !this.mobileMenuToggle;
|
|
2439
|
+
}
|
|
2440
|
+
onSubMenuToggle(event) {
|
|
2441
|
+
event.preventDefault();
|
|
2442
|
+
const parentItem = event.currentTarget.closest('li');
|
|
2443
|
+
const parentClasses = parentItem.classList;
|
|
2444
|
+
if (parentClasses.contains('open')) {
|
|
2445
|
+
parentClasses.remove('open');
|
|
2446
|
+
}
|
|
2447
|
+
else {
|
|
2448
|
+
parentClasses.add('open');
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
onOpenSubMenu(event) {
|
|
2452
|
+
const listItem = event.target;
|
|
2453
|
+
const rect = listItem.getBoundingClientRect();
|
|
2454
|
+
const rectParent = listItem.parentNode.getBoundingClientRect();
|
|
2455
|
+
this.popupHeight = rectParent.height;
|
|
2456
|
+
this.popupLeft = rectParent.width;
|
|
2457
|
+
}
|
|
2458
|
+
onSetCategory(event, category) {
|
|
2459
|
+
// if (!event.target.closest('.toggle_sub_menu') && !event.target.classList.contains('toggle_sub_menu')) {
|
|
2460
|
+
// this.navigationService.setCategory(category);
|
|
2461
|
+
// this.mobileMenuToggle = false;
|
|
2462
|
+
// }
|
|
2463
|
+
}
|
|
2464
|
+
onSetTurnoverGroup(event, turnoverGroup) {
|
|
2465
|
+
// if (!event.target.closest('.toggle_sub_menu') && !event.target.classList.contains('toggle_sub_menu')) {
|
|
2466
|
+
// this.navigationService.setTurnoverGroup(turnoverGroup);
|
|
2467
|
+
// this.mobileMenuToggle = false;
|
|
2468
|
+
// }
|
|
2469
|
+
}
|
|
2470
|
+
onOpenExternalCatalog(event, webviewUrl) {
|
|
2471
|
+
// this.navigationService.setExternalSourceUrl(webviewUrl);
|
|
1377
2472
|
}
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
if (this._allIcons.hasOwnProperty(key)) {
|
|
1381
|
-
this._iconCache[key.toLowerCase()] = this._sanitizer.bypassSecurityTrustHtml(this._allIcons[key]);
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
2473
|
+
onOpenIoneCatalog(event, webviewUrl, ioneUrl, upId, userName, passWord) {
|
|
2474
|
+
// this.navigationService.setIoneSourceUrl(webviewUrl, ioneUrl, upId, userName, passWord);
|
|
1384
2475
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
{ type: Injectable }
|
|
1388
|
-
];
|
|
1389
|
-
IconCacheService.ctorParameters = () => [
|
|
1390
|
-
{ type: DomSanitizer }
|
|
1391
|
-
];
|
|
1392
|
-
|
|
1393
|
-
class TopContentComponent {
|
|
1394
|
-
constructor(catalog, iconCache) {
|
|
1395
|
-
this.catalog = catalog;
|
|
1396
|
-
this.iconCache = iconCache;
|
|
1397
|
-
this.Icons = IconEnum;
|
|
1398
|
-
this.collapsed = true;
|
|
2476
|
+
handleHomeClick(event) {
|
|
2477
|
+
this.homeClick.emit();
|
|
1399
2478
|
}
|
|
1400
|
-
|
|
2479
|
+
handleShowCollectionOverlay() {
|
|
2480
|
+
this.showExternalOverlay = false;
|
|
2481
|
+
this.showCollectionOverlay = true;
|
|
1401
2482
|
}
|
|
1402
|
-
|
|
1403
|
-
this.
|
|
2483
|
+
handleShowExternalOverlay() {
|
|
2484
|
+
this.showCollectionOverlay = false;
|
|
2485
|
+
this.showExternalOverlay = true;
|
|
1404
2486
|
}
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
2487
|
+
handleHideCollectionOverlay() {
|
|
2488
|
+
this.showCollectionOverlay = false;
|
|
2489
|
+
}
|
|
2490
|
+
handleHideExternalOverlay() {
|
|
2491
|
+
this.showExternalOverlay = false;
|
|
1409
2492
|
}
|
|
1410
2493
|
}
|
|
1411
|
-
|
|
2494
|
+
CatalogNavigationComponent.decorators = [
|
|
1412
2495
|
{ type: Component, args: [{
|
|
1413
|
-
selector: '
|
|
1414
|
-
template:
|
|
2496
|
+
selector: 'co-catalog-navigation',
|
|
2497
|
+
template: `
|
|
2498
|
+
<div class="navigation-wrapper" [class.minified]="minified">
|
|
2499
|
+
<div class="navigation-item-wrapper">
|
|
2500
|
+
<a class="home-link" (click)="handleHomeClick($event)" [textContent]="homeLabel"></a>
|
|
2501
|
+
</div>
|
|
2502
|
+
<div class="navigation-item-wrapper" [class.active]="mobileMenuToggle" (click)="onToggleMobileMenu()"
|
|
2503
|
+
(mouseover)="handleShowCollectionOverlay()"
|
|
2504
|
+
(mouseleave)="handleHideCollectionOverlay()"
|
|
2505
|
+
overlayParent #collectionParentForOverlay="overlayParent">
|
|
2506
|
+
<co-icon class="hamburger-icon" [iconData]="iconCache.getIcon(icons.Hamburger)"></co-icon>
|
|
2507
|
+
<span [textContent]="collectionLabel"></span>
|
|
2508
|
+
<div class="navigation-overlay-wrapper" [overlay]="collectionParentForOverlay" [keepInView]="true" *ngIf="showCollectionOverlay" @showHideOverlay>
|
|
2509
|
+
<div class="navigation-category-column-wrapper" *ngFor="let category of categories">
|
|
2510
|
+
<div class="navigation-category" [textContent]="category.category" (click)="handleCategoryClick($event, category.category)"></div>
|
|
2511
|
+
<div class="navigation-turnovergroup-wrapper">
|
|
2512
|
+
<div class="navigation-turnovergroup" *ngFor="let turnoverGroup of category.turnoverGroups" [textContent]="turnoverGroup.description" (click)="handleTurnoverGroupClick($event, turnoverGroup.description)"></div>
|
|
2513
|
+
</div>
|
|
2514
|
+
</div>
|
|
2515
|
+
</div>
|
|
2516
|
+
</div>
|
|
2517
|
+
<div class="navigation-item-wrapper" [class.active]="mobileMenuToggle" (click)="onToggleMobileMenu()"
|
|
2518
|
+
(mouseover)="handleShowExternalOverlay()"
|
|
2519
|
+
(mouseleave)="handleHideExternalOverlay()"
|
|
2520
|
+
overlayParent #externalParentForOverlay="overlayParent">
|
|
2521
|
+
<co-icon class="hamburger-icon" [iconData]="iconCache.getIcon(icons.Ar)"></co-icon>
|
|
2522
|
+
<span [textContent]="externalSourcesLabel"></span>
|
|
2523
|
+
<div class="navigation-overlay-wrapper" [overlay]="externalParentForOverlay" [keepInView]="true" *ngIf="showExternalOverlay" @showHideOverlay>
|
|
2524
|
+
<co-catalog-external-sources (externalSourceClick)="handleExternalSourceClick($event)"></co-catalog-external-sources>
|
|
2525
|
+
</div>
|
|
2526
|
+
</div>
|
|
2527
|
+
</div>
|
|
2528
|
+
`,
|
|
1415
2529
|
animations: [
|
|
1416
|
-
trigger('
|
|
2530
|
+
trigger('showHideOverlay', [
|
|
1417
2531
|
state('void', style({ height: '0' })),
|
|
1418
2532
|
state('*', style({ height: '*' })),
|
|
1419
|
-
transition('void <=> *', animate(
|
|
2533
|
+
transition('void <=> *', animate(100))
|
|
1420
2534
|
])
|
|
1421
2535
|
],
|
|
1422
|
-
|
|
2536
|
+
encapsulation: ViewEncapsulation.None
|
|
1423
2537
|
},] }
|
|
1424
2538
|
];
|
|
1425
|
-
|
|
2539
|
+
CatalogNavigationComponent.ctorParameters = () => [
|
|
2540
|
+
{ type: IconCacheService },
|
|
1426
2541
|
{ type: CatalogService },
|
|
1427
|
-
{ type:
|
|
2542
|
+
{ type: CatalogEventService }
|
|
1428
2543
|
];
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
2544
|
+
CatalogNavigationComponent.propDecorators = {
|
|
2545
|
+
homeLabel: [{ type: Input }],
|
|
2546
|
+
collectionLabel: [{ type: Input }],
|
|
2547
|
+
externalSourcesLabel: [{ type: Input }],
|
|
2548
|
+
showTurnoverGroups: [{ type: Input }],
|
|
2549
|
+
homeClick: [{ type: Output }],
|
|
2550
|
+
categoryClick: [{ type: Output }],
|
|
2551
|
+
turnoverGroupClick: [{ type: Output }],
|
|
2552
|
+
externalSourceClick: [{ type: Output }],
|
|
2553
|
+
minified: [{ type: Input }],
|
|
2554
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-navigation',] }]
|
|
1432
2555
|
};
|
|
1433
2556
|
|
|
1434
|
-
class
|
|
2557
|
+
class ExternalSourceViewmodel {
|
|
2558
|
+
constructor(catalog, source) {
|
|
2559
|
+
this.catalogDefinition = catalog;
|
|
2560
|
+
this.externalSource = source;
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
class CatalogExternalSourcesComponent {
|
|
2565
|
+
constructor(_catalogConnectorService, _imageService) {
|
|
2566
|
+
this._catalogConnectorService = _catalogConnectorService;
|
|
2567
|
+
this._imageService = _imageService;
|
|
2568
|
+
this.externalSourceClick = new EventEmitter();
|
|
2569
|
+
this.externalSourceViewModels = [];
|
|
2570
|
+
}
|
|
2571
|
+
showClass() {
|
|
2572
|
+
return true;
|
|
2573
|
+
}
|
|
1435
2574
|
ngOnInit() {
|
|
2575
|
+
this.externalSourceViewModels.length = 0;
|
|
2576
|
+
this._catalogConnectorService.getCatalogDefinitions().then((defs) => __awaiter(this, void 0, void 0, function* () {
|
|
2577
|
+
for (let i = 0; i < defs.length; i++) {
|
|
2578
|
+
this._imageService.getExternalSourceImage(defs[i]);
|
|
2579
|
+
const viewModel = new ExternalSourceViewmodel(defs[i], defs[i].externalSourceId ? yield this._catalogConnectorService.getExternalSource(defs[i].externalSourceId, false) : new ExternalSource());
|
|
2580
|
+
this.externalSourceViewModels.push(viewModel);
|
|
2581
|
+
}
|
|
2582
|
+
}));
|
|
1436
2583
|
}
|
|
1437
2584
|
}
|
|
1438
|
-
|
|
2585
|
+
CatalogExternalSourcesComponent.decorators = [
|
|
1439
2586
|
{ type: Component, args: [{
|
|
1440
|
-
selector: '
|
|
1441
|
-
template:
|
|
1442
|
-
|
|
2587
|
+
selector: 'co-catalog-external-sources',
|
|
2588
|
+
template: `
|
|
2589
|
+
<ng-container *ngIf="externalSourceViewModels && externalSourceViewModels.length > 0">
|
|
2590
|
+
<div class="catalog-external-sources-wrapper">
|
|
2591
|
+
<div class="external-source-item" *ngFor="let externalSourceViewModel of externalSourceViewModels" (click)="externalSourceClick.emit(externalSourceViewModel)">
|
|
2592
|
+
<div class="external-source-description" [textContent]="externalSourceViewModel.catalogDefinition.name"></div>
|
|
2593
|
+
<co-image [source]="externalSourceViewModel.catalogDefinition.imageData"></co-image>
|
|
2594
|
+
</div>
|
|
2595
|
+
</div>
|
|
2596
|
+
</ng-container>
|
|
2597
|
+
`,
|
|
2598
|
+
encapsulation: ViewEncapsulation.None
|
|
1443
2599
|
},] }
|
|
1444
|
-
];
|
|
2600
|
+
];
|
|
2601
|
+
CatalogExternalSourcesComponent.ctorParameters = () => [
|
|
2602
|
+
{ type: CatalogConnectorService },
|
|
2603
|
+
{ type: CatalogImageService }
|
|
2604
|
+
];
|
|
2605
|
+
CatalogExternalSourcesComponent.propDecorators = {
|
|
2606
|
+
externalSourceClick: [{ type: Output }],
|
|
2607
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-external-sources',] }]
|
|
2608
|
+
};
|
|
1445
2609
|
|
|
1446
|
-
class
|
|
1447
|
-
ngOnInit() {
|
|
1448
|
-
}
|
|
2610
|
+
class CatalogExternalSourcesModule {
|
|
1449
2611
|
}
|
|
1450
|
-
|
|
1451
|
-
{ type:
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
2612
|
+
CatalogExternalSourcesModule.decorators = [
|
|
2613
|
+
{ type: NgModule, args: [{
|
|
2614
|
+
imports: [
|
|
2615
|
+
CommonModule,
|
|
2616
|
+
CatalogFilterModule,
|
|
2617
|
+
ImageModule,
|
|
2618
|
+
ResponsiveTextModule
|
|
2619
|
+
],
|
|
2620
|
+
declarations: [
|
|
2621
|
+
CatalogExternalSourcesComponent
|
|
2622
|
+
],
|
|
2623
|
+
exports: [
|
|
2624
|
+
CatalogExternalSourcesComponent
|
|
2625
|
+
]
|
|
1455
2626
|
},] }
|
|
1456
2627
|
];
|
|
1457
2628
|
|
|
1458
|
-
class
|
|
1459
|
-
constructor(
|
|
1460
|
-
this.
|
|
1461
|
-
this.
|
|
1462
|
-
this.iconCache = iconCache;
|
|
1463
|
-
this.optionsService = optionsService;
|
|
1464
|
-
this.changeDetector = changeDetector;
|
|
1465
|
-
this.icons = IconEnum;
|
|
1466
|
-
this.ownClass = true;
|
|
1467
|
-
this.collapsed = false;
|
|
1468
|
-
this._subs = [];
|
|
1469
|
-
this._min = 0;
|
|
1470
|
-
this._max = 100000;
|
|
1471
|
-
// this._subs = [
|
|
1472
|
-
// this.catalog.onPrepareFilters.subscribe(() => {
|
|
1473
|
-
// this.setupFilters();
|
|
1474
|
-
// this.detectChanges();
|
|
1475
|
-
// })
|
|
1476
|
-
// ];
|
|
2629
|
+
class OverlayDirective {
|
|
2630
|
+
constructor(elementRef) {
|
|
2631
|
+
this.keepInView = false;
|
|
2632
|
+
this._elementRef = elementRef;
|
|
1477
2633
|
}
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
this.collapsed = this.optionsService.collapseFilterByDefault;
|
|
1482
|
-
if (window.innerWidth <= 950) {
|
|
1483
|
-
this.collapsed = true;
|
|
2634
|
+
set parent(value) {
|
|
2635
|
+
if (value && value.elementRef) {
|
|
2636
|
+
this._parent = value.elementRef;
|
|
1484
2637
|
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
this._destroyed = true;
|
|
1490
|
-
this._subs.forEach((x) => {
|
|
1491
|
-
x.unsubscribe();
|
|
1492
|
-
});
|
|
1493
|
-
}
|
|
1494
|
-
initializePriceFilterMinMax() {
|
|
1495
|
-
this._min = this.filterService.priceMinFilter;
|
|
1496
|
-
this._max = this.filterService.priceMaxFilter;
|
|
1497
|
-
}
|
|
1498
|
-
resetFilters(event) {
|
|
1499
|
-
this.catalog.resetFilters();
|
|
1500
|
-
}
|
|
1501
|
-
onHandleClick(event) {
|
|
1502
|
-
this.collapsed = !this.collapsed;
|
|
1503
|
-
}
|
|
1504
|
-
updatePriceInputs(range) {
|
|
1505
|
-
this.filterService.priceMinFilter = range.lowerBound;
|
|
1506
|
-
this.filterService.priceMaxFilter = range.upperBound;
|
|
1507
|
-
}
|
|
1508
|
-
updateSliderRange() {
|
|
1509
|
-
if (this.priceSlider) {
|
|
1510
|
-
this.priceSlider.setLowerBound(this.filterService.priceMinFilter, false);
|
|
1511
|
-
this.priceSlider.setUpperBound(this.filterService.priceMaxFilter, false);
|
|
2638
|
+
else {
|
|
2639
|
+
if (this._parent) {
|
|
2640
|
+
this._observer.disconnect();
|
|
2641
|
+
}
|
|
1512
2642
|
}
|
|
1513
2643
|
}
|
|
1514
|
-
|
|
1515
|
-
this.
|
|
1516
|
-
}
|
|
1517
|
-
updatePriceTo() {
|
|
1518
|
-
this.updateSliderRange();
|
|
1519
|
-
}
|
|
1520
|
-
setPriceMinToDefault() {
|
|
1521
|
-
this.filterService.priceMinFilter = this._min;
|
|
2644
|
+
handleScroll(event) {
|
|
2645
|
+
this._checkAndPlaceElement();
|
|
1522
2646
|
}
|
|
1523
|
-
|
|
1524
|
-
|
|
2647
|
+
ngOnDestroy() {
|
|
2648
|
+
// document.removeEventListener("scroll", (event) => this._handleScroll(event), false);
|
|
2649
|
+
this._observer.disconnect();
|
|
2650
|
+
this._elementRef = undefined;
|
|
2651
|
+
this._parent = undefined;
|
|
1525
2652
|
}
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
this.
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
this.
|
|
1533
|
-
this.catalog.searchArticles();
|
|
2653
|
+
ngOnInit() {
|
|
2654
|
+
// document.addEventListener("scroll", (event) => this._handleScroll(event), false);
|
|
2655
|
+
this._checkAndPlaceElement();
|
|
2656
|
+
this._observer = new ResizeObserver((entries) => {
|
|
2657
|
+
this._checkAndPlaceElement();
|
|
2658
|
+
});
|
|
2659
|
+
this._observer.observe(document.body);
|
|
1534
2660
|
}
|
|
1535
|
-
|
|
1536
|
-
this.
|
|
2661
|
+
_checkAndPlaceElement() {
|
|
2662
|
+
const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
2663
|
+
const parentRect = this._parent.nativeElement.getBoundingClientRect();
|
|
2664
|
+
this._placeElement(window.innerHeight, window.innerWidth, parentRect, elementRect);
|
|
1537
2665
|
}
|
|
1538
|
-
|
|
1539
|
-
//
|
|
1540
|
-
|
|
1541
|
-
if (!mapFilterName) {
|
|
1542
|
-
return;
|
|
2666
|
+
_placeElement(bottom, right, parentRect, elementRect) {
|
|
2667
|
+
if (bottom < parentRect.bottom + elementRect.height) { // make sure it fits at the bottom
|
|
2668
|
+
this._elementRef.nativeElement.style.top = (parentRect.top - elementRect.height) + "px";
|
|
1543
2669
|
}
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
if (item.checked) { // add
|
|
1547
|
-
if (arr.indexOf(item.code) < 0) {
|
|
1548
|
-
arr.push(`?='${item.code}'`);
|
|
1549
|
-
}
|
|
2670
|
+
else {
|
|
2671
|
+
this._elementRef.nativeElement.style.top = parentRect.bottom + "px";
|
|
1550
2672
|
}
|
|
1551
|
-
|
|
1552
|
-
if (
|
|
1553
|
-
|
|
2673
|
+
if (this.keepInView) {
|
|
2674
|
+
if (elementRect.right > window.innerWidth) {
|
|
2675
|
+
//see if we can move it to the left
|
|
2676
|
+
if ((window.innerWidth - elementRect.width) > 0) {
|
|
2677
|
+
this._elementRef.nativeElement.style.left = (window.innerWidth - elementRect.width) + "px";
|
|
2678
|
+
}
|
|
2679
|
+
else { //resize so it fits into view
|
|
2680
|
+
this._elementRef.nativeElement.style.width = window.innerWidth + "px";
|
|
2681
|
+
this._elementRef.nativeElement.style.left = 0;
|
|
2682
|
+
}
|
|
1554
2683
|
}
|
|
1555
2684
|
}
|
|
1556
|
-
this.catalog.articleSearchFilters[mapFilterName] = arr.join(',');
|
|
1557
|
-
this.catalog.searchArticles();
|
|
1558
|
-
}
|
|
1559
|
-
detectChanges() {
|
|
1560
|
-
if (!this._destroyed) {
|
|
1561
|
-
this.changeDetector.detectChanges();
|
|
1562
|
-
}
|
|
1563
2685
|
}
|
|
1564
2686
|
}
|
|
1565
|
-
|
|
1566
|
-
{ type:
|
|
1567
|
-
selector:
|
|
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",
|
|
1569
|
-
animations: [
|
|
1570
|
-
trigger('showFilterItem', [
|
|
1571
|
-
state('closed', style({ height: '80px' })),
|
|
1572
|
-
state('open', style({ height: '*' })),
|
|
1573
|
-
transition('closed <=> open', animate(200))
|
|
1574
|
-
])
|
|
1575
|
-
],
|
|
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"]
|
|
2687
|
+
OverlayDirective.decorators = [
|
|
2688
|
+
{ type: Directive, args: [{
|
|
2689
|
+
selector: "[overlay]"
|
|
1577
2690
|
},] }
|
|
1578
2691
|
];
|
|
1579
|
-
|
|
1580
|
-
{ type:
|
|
1581
|
-
{ type: FilterService },
|
|
1582
|
-
{ type: IconCacheService },
|
|
1583
|
-
{ type: OptionsService },
|
|
1584
|
-
{ type: ChangeDetectorRef }
|
|
2692
|
+
OverlayDirective.ctorParameters = () => [
|
|
2693
|
+
{ type: ElementRef }
|
|
1585
2694
|
];
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
2695
|
+
OverlayDirective.propDecorators = {
|
|
2696
|
+
parent: [{ type: Input, args: ["overlay",] }],
|
|
2697
|
+
keepInView: [{ type: Input }],
|
|
2698
|
+
handleScroll: [{ type: HostListener, args: ["document:scroll", ["$event"],] }]
|
|
1590
2699
|
};
|
|
1591
2700
|
|
|
1592
|
-
class
|
|
1593
|
-
constructor(
|
|
1594
|
-
this.
|
|
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
|
-
}));
|
|
2701
|
+
class OverlayParentDirective {
|
|
2702
|
+
constructor(elementRef) {
|
|
2703
|
+
this.elementRef = elementRef;
|
|
1614
2704
|
}
|
|
1615
2705
|
ngOnDestroy() {
|
|
1616
|
-
this.
|
|
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();
|
|
1632
|
-
}
|
|
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
|
-
});
|
|
1648
|
-
}
|
|
1649
|
-
getTurnoverGroupList() {
|
|
1650
|
-
this.navigationCategories.forEach((category) => {
|
|
1651
|
-
category.turnoverGroups.forEach(tog => this._imageService.getTurnoverGroupImage(tog));
|
|
1652
|
-
this.allTurnoverGroups.push(...category.turnoverGroups);
|
|
1653
|
-
});
|
|
2706
|
+
this.elementRef = undefined;
|
|
1654
2707
|
}
|
|
1655
2708
|
}
|
|
1656
|
-
|
|
1657
|
-
{ type:
|
|
2709
|
+
OverlayParentDirective.decorators = [
|
|
2710
|
+
{ type: Directive, args: [{
|
|
2711
|
+
selector: '[overlayParent]',
|
|
2712
|
+
exportAs: 'overlayParent'
|
|
2713
|
+
},] }
|
|
1658
2714
|
];
|
|
1659
|
-
|
|
1660
|
-
{ type:
|
|
1661
|
-
{ type: IOneControllerService },
|
|
1662
|
-
{ type: OptionsService },
|
|
1663
|
-
{ type: ImageService }
|
|
2715
|
+
OverlayParentDirective.ctorParameters = () => [
|
|
2716
|
+
{ type: ElementRef }
|
|
1664
2717
|
];
|
|
1665
2718
|
|
|
1666
|
-
class
|
|
1667
|
-
constructor() {
|
|
1668
|
-
this.lookAtArticleButtonClick = new Subject();
|
|
1669
|
-
this.addArticleButtonClick = new Subject();
|
|
1670
|
-
this.arButtonClick = new Subject();
|
|
1671
|
-
this.articleClick = new Subject();
|
|
1672
|
-
this.stockDetailsClick = new Subject();
|
|
1673
|
-
}
|
|
2719
|
+
class OverlayModule {
|
|
1674
2720
|
}
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
2721
|
+
OverlayModule.decorators = [
|
|
2722
|
+
{ type: NgModule, args: [{
|
|
2723
|
+
declarations: [
|
|
2724
|
+
OverlayDirective,
|
|
2725
|
+
OverlayParentDirective
|
|
2726
|
+
],
|
|
2727
|
+
exports: [
|
|
2728
|
+
OverlayDirective,
|
|
2729
|
+
OverlayParentDirective
|
|
2730
|
+
]
|
|
1679
2731
|
},] }
|
|
1680
2732
|
];
|
|
1681
2733
|
|
|
1682
|
-
class
|
|
1683
|
-
constructor(catalog, options, changeDetector, navigationService, iconCache, _appEventService) {
|
|
1684
|
-
this.catalog = catalog;
|
|
1685
|
-
this.options = options;
|
|
1686
|
-
this.changeDetector = changeDetector;
|
|
1687
|
-
this.navigationService = navigationService;
|
|
1688
|
-
this.iconCache = iconCache;
|
|
1689
|
-
this._appEventService = _appEventService;
|
|
1690
|
-
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
|
-
}
|
|
1775
|
-
}
|
|
2734
|
+
class CatalogNavigationModule {
|
|
1776
2735
|
}
|
|
1777
|
-
|
|
1778
|
-
{ type:
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
2736
|
+
CatalogNavigationModule.decorators = [
|
|
2737
|
+
{ type: NgModule, args: [{
|
|
2738
|
+
imports: [
|
|
2739
|
+
CommonModule,
|
|
2740
|
+
IconModule,
|
|
2741
|
+
CatalogFilterModule,
|
|
2742
|
+
CatalogExternalSourcesModule,
|
|
2743
|
+
OverlayModule
|
|
2744
|
+
],
|
|
2745
|
+
declarations: [
|
|
2746
|
+
CatalogNavigationComponent
|
|
2747
|
+
],
|
|
2748
|
+
exports: [
|
|
2749
|
+
CatalogNavigationComponent
|
|
2750
|
+
]
|
|
1782
2751
|
},] }
|
|
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
|
-
};
|
|
2752
|
+
];
|
|
1796
2753
|
|
|
1797
|
-
class
|
|
1798
|
-
constructor(
|
|
1799
|
-
this.
|
|
1800
|
-
this.
|
|
1801
|
-
this.
|
|
1802
|
-
this.
|
|
1803
|
-
this.
|
|
1804
|
-
this.
|
|
2754
|
+
class CatalogSearchComponent {
|
|
2755
|
+
constructor(_catalogSearchService, _catalogEventService) {
|
|
2756
|
+
this._catalogSearchService = _catalogSearchService;
|
|
2757
|
+
this._catalogEventService = _catalogEventService;
|
|
2758
|
+
this.showNavigation = false;
|
|
2759
|
+
this.showFilter = false;
|
|
2760
|
+
this.showViewModes = false;
|
|
2761
|
+
this.onLookAtArticleButtonClick = new EventEmitter();
|
|
2762
|
+
this.onArButtonClick = new EventEmitter();
|
|
2763
|
+
this.onAddArticleButtonClick = new EventEmitter();
|
|
2764
|
+
this.onArticleClick = new EventEmitter();
|
|
2765
|
+
this.onStockDetailsClick = new EventEmitter();
|
|
2766
|
+
this.mode = 'tile';
|
|
2767
|
+
this.showCategories = true;
|
|
1805
2768
|
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
|
-
}
|
|
1813
|
-
}
|
|
1814
|
-
}));
|
|
1815
2769
|
}
|
|
1816
|
-
|
|
1817
|
-
|
|
2770
|
+
showClass() {
|
|
2771
|
+
return true;
|
|
1818
2772
|
}
|
|
1819
2773
|
ngOnInit() {
|
|
2774
|
+
this._subs.push(this._catalogEventService.addArticleButtonClick.subscribe((json) => {
|
|
2775
|
+
this.onAddArticleButtonClick.emit(json);
|
|
2776
|
+
}), this._catalogEventService.arButtonClick.subscribe((article) => {
|
|
2777
|
+
this.onArButtonClick.emit(article);
|
|
2778
|
+
}), this._catalogEventService.articleClick.subscribe((article) => {
|
|
2779
|
+
this.onArticleClick.emit(article);
|
|
2780
|
+
}), this._catalogEventService.lookAtArticleButtonClick.subscribe((article) => {
|
|
2781
|
+
this.onLookAtArticleButtonClick.emit(article);
|
|
2782
|
+
}), this._catalogEventService.stockDetailsClick.subscribe((article) => {
|
|
2783
|
+
this.onStockDetailsClick.emit(article);
|
|
2784
|
+
}));
|
|
1820
2785
|
}
|
|
1821
2786
|
ngOnDestroy() {
|
|
1822
|
-
this._renderer.removeClass(document.body, 'external');
|
|
1823
2787
|
this._subs.forEach(s => s.unsubscribe());
|
|
1824
2788
|
}
|
|
1825
|
-
|
|
1826
|
-
|
|
2789
|
+
handleCategoryClick(category) {
|
|
2790
|
+
this._catalogSearchService.category = category;
|
|
2791
|
+
}
|
|
2792
|
+
handleTurnoverGroupClick(turnoverGroup) {
|
|
2793
|
+
this._catalogSearchService.turnoverGroup = turnoverGroup;
|
|
1827
2794
|
}
|
|
1828
2795
|
}
|
|
1829
|
-
|
|
2796
|
+
CatalogSearchComponent.decorators = [
|
|
1830
2797
|
{ type: Component, args: [{
|
|
1831
|
-
selector: '
|
|
1832
|
-
template:
|
|
1833
|
-
|
|
2798
|
+
selector: 'co-catalog-search',
|
|
2799
|
+
template: `
|
|
2800
|
+
<div class="catalog-search-wrapper">
|
|
2801
|
+
<ng-container *ngIf="showFilter">
|
|
2802
|
+
<div class="filter-content">
|
|
2803
|
+
<co-catalog-filter [showResetFilter]="true"></co-catalog-filter>
|
|
2804
|
+
</div>
|
|
2805
|
+
</ng-container>
|
|
2806
|
+
<div class="search-content-wrapper">
|
|
2807
|
+
<div class="search-header">
|
|
2808
|
+
<!--
|
|
2809
|
+
<co-catalog-external-sources></co-catalog-external-sources>
|
|
2810
|
+
-->
|
|
2811
|
+
<co-catalog-search-header [placeholder]="'Zoeken naar artikelen'"></co-catalog-search-header>
|
|
2812
|
+
</div>
|
|
2813
|
+
<ng-container *ngIf="showViewModes">
|
|
2814
|
+
<button (click)="mode = 'tile'">tile</button>
|
|
2815
|
+
<button (click)="mode = 'list'">list</button>
|
|
2816
|
+
<button (click)="mode = 'grid'">grid</button>
|
|
2817
|
+
</ng-container>
|
|
2818
|
+
<co-catalog-navigation *ngIf="showNavigation"></co-catalog-navigation>
|
|
2819
|
+
<co-catalog-categories (categoryClick)="handleCategoryClick($event)" (turnoverGroupClick)="handleTurnoverGroupClick($event)"></co-catalog-categories>
|
|
2820
|
+
<div class="search-content">
|
|
2821
|
+
<ng-container *ngIf="mode === 'tile'">
|
|
2822
|
+
<co-catalog-search-result-tile></co-catalog-search-result-tile>
|
|
2823
|
+
</ng-container>
|
|
2824
|
+
<ng-container *ngIf="mode === 'list'">
|
|
2825
|
+
<co-catalog-search-result-list></co-catalog-search-result-list>
|
|
2826
|
+
</ng-container>
|
|
2827
|
+
<ng-container *ngIf="mode === 'grid'">
|
|
2828
|
+
<!--
|
|
2829
|
+
<co-catalog-search-result></co-catalog-search-result>
|
|
2830
|
+
-->
|
|
2831
|
+
</ng-container>
|
|
2832
|
+
</div>
|
|
2833
|
+
</div>
|
|
2834
|
+
</div>
|
|
2835
|
+
`,
|
|
2836
|
+
encapsulation: ViewEncapsulation.None
|
|
1834
2837
|
},] }
|
|
1835
2838
|
];
|
|
1836
|
-
|
|
1837
|
-
{ type:
|
|
1838
|
-
{ type:
|
|
1839
|
-
{ type: DomSanitizer },
|
|
1840
|
-
{ type: ChangeDetectorRef },
|
|
1841
|
-
{ type: Renderer2 }
|
|
2839
|
+
CatalogSearchComponent.ctorParameters = () => [
|
|
2840
|
+
{ type: CatalogSearchService },
|
|
2841
|
+
{ type: CatalogEventService }
|
|
1842
2842
|
];
|
|
1843
|
-
|
|
1844
|
-
|
|
2843
|
+
CatalogSearchComponent.propDecorators = {
|
|
2844
|
+
showNavigation: [{ type: Input }],
|
|
2845
|
+
showFilter: [{ type: Input }],
|
|
2846
|
+
showViewModes: [{ type: Input }],
|
|
2847
|
+
onLookAtArticleButtonClick: [{ type: Output }],
|
|
2848
|
+
onArButtonClick: [{ type: Output }],
|
|
2849
|
+
onAddArticleButtonClick: [{ type: Output }],
|
|
2850
|
+
onArticleClick: [{ type: Output }],
|
|
2851
|
+
onStockDetailsClick: [{ type: Output }],
|
|
2852
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-search',] }]
|
|
1845
2853
|
};
|
|
1846
2854
|
|
|
1847
|
-
class
|
|
1848
|
-
constructor(
|
|
1849
|
-
this.
|
|
1850
|
-
this.navigationService = navigationService;
|
|
1851
|
-
this.catalogService = catalogService;
|
|
1852
|
-
this.icons = IconEnum;
|
|
1853
|
-
this.minified = false;
|
|
2855
|
+
class CatalogSearchHeaderComponent {
|
|
2856
|
+
constructor(catalogSearchService) {
|
|
2857
|
+
this.catalogSearchService = catalogSearchService;
|
|
1854
2858
|
}
|
|
1855
|
-
|
|
1856
|
-
|
|
2859
|
+
showClass() {
|
|
2860
|
+
return true;
|
|
1857
2861
|
}
|
|
1858
|
-
|
|
1859
|
-
|
|
2862
|
+
}
|
|
2863
|
+
CatalogSearchHeaderComponent.decorators = [
|
|
2864
|
+
{ type: Component, args: [{
|
|
2865
|
+
selector: 'co-catalog-search-header',
|
|
2866
|
+
template: `
|
|
2867
|
+
<div class="catalog-search-header-wrapper">
|
|
2868
|
+
<co-input-search class="catalog-search-general"
|
|
2869
|
+
[useRightIcon]="true"
|
|
2870
|
+
[centerLabel]="true"
|
|
2871
|
+
[(model)]="catalogSearchService.searchRequest.general"
|
|
2872
|
+
[placeholder]="placeholder"
|
|
2873
|
+
[initFocus]="true"
|
|
2874
|
+
(search)="catalogSearchService.searchArticles()">
|
|
2875
|
+
</co-input-search>
|
|
2876
|
+
</div>
|
|
2877
|
+
`,
|
|
2878
|
+
encapsulation: ViewEncapsulation.None
|
|
2879
|
+
},] }
|
|
2880
|
+
];
|
|
2881
|
+
CatalogSearchHeaderComponent.ctorParameters = () => [
|
|
2882
|
+
{ type: CatalogSearchService }
|
|
2883
|
+
];
|
|
2884
|
+
CatalogSearchHeaderComponent.propDecorators = {
|
|
2885
|
+
placeholder: [{ type: Input }],
|
|
2886
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-search-header',] }]
|
|
2887
|
+
};
|
|
2888
|
+
|
|
2889
|
+
class CatalogSearchHeaderModule {
|
|
2890
|
+
}
|
|
2891
|
+
CatalogSearchHeaderModule.decorators = [
|
|
2892
|
+
{ type: NgModule, args: [{
|
|
2893
|
+
imports: [
|
|
2894
|
+
CommonModule,
|
|
2895
|
+
InputSearchModule
|
|
2896
|
+
],
|
|
2897
|
+
declarations: [
|
|
2898
|
+
CatalogSearchHeaderComponent
|
|
2899
|
+
],
|
|
2900
|
+
exports: [
|
|
2901
|
+
CatalogSearchHeaderComponent
|
|
2902
|
+
]
|
|
2903
|
+
},] }
|
|
2904
|
+
];
|
|
2905
|
+
|
|
2906
|
+
class CatalogSearchBaseComponent {
|
|
2907
|
+
constructor(catalogSearchService) {
|
|
2908
|
+
this.catalogSearchService = catalogSearchService;
|
|
1860
2909
|
}
|
|
1861
|
-
|
|
1862
|
-
this.
|
|
2910
|
+
onPreviousClick() {
|
|
2911
|
+
this.catalogSearchService.currentPage -= 1;
|
|
2912
|
+
}
|
|
2913
|
+
onNextClick() {
|
|
2914
|
+
this.catalogSearchService.currentPage += 1;
|
|
2915
|
+
}
|
|
2916
|
+
onPageClick(pageNr) {
|
|
2917
|
+
this.catalogSearchService.currentPage = pageNr;
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
CatalogSearchBaseComponent.decorators = [
|
|
2921
|
+
{ type: Directive }
|
|
2922
|
+
];
|
|
2923
|
+
CatalogSearchBaseComponent.ctorParameters = () => [
|
|
2924
|
+
{ type: CatalogSearchService }
|
|
2925
|
+
];
|
|
2926
|
+
|
|
2927
|
+
class CatalogSearchResultTileComponent extends CatalogSearchBaseComponent {
|
|
2928
|
+
constructor() {
|
|
2929
|
+
super(...arguments);
|
|
2930
|
+
this.onLookAtArticleButtonClick = new EventEmitter();
|
|
2931
|
+
this.onArButtonClick = new EventEmitter();
|
|
2932
|
+
this.onAddArticleButtonClick = new EventEmitter();
|
|
2933
|
+
this.onArticleClick = new EventEmitter();
|
|
2934
|
+
this.onStockDetailsClick = new EventEmitter();
|
|
2935
|
+
this.showClass = true;
|
|
2936
|
+
this.smallScrollbar = true;
|
|
1863
2937
|
}
|
|
1864
2938
|
}
|
|
1865
|
-
|
|
2939
|
+
CatalogSearchResultTileComponent.decorators = [
|
|
1866
2940
|
{ type: Component, args: [{
|
|
1867
|
-
selector: '
|
|
1868
|
-
template:
|
|
1869
|
-
|
|
2941
|
+
selector: 'co-catalog-search-result-tile',
|
|
2942
|
+
template: `
|
|
2943
|
+
<div class="article-cards" visibilityObserverMaster>
|
|
2944
|
+
<ng-container *ngFor="let article of catalogSearchService.articles">
|
|
2945
|
+
<co-catalog-article-tile
|
|
2946
|
+
visibilityObserver
|
|
2947
|
+
#intersection="intersection"
|
|
2948
|
+
[observerEnabled]="!article.imageData"
|
|
2949
|
+
[showing]="intersection.isIntersecting"
|
|
2950
|
+
[article]="article"
|
|
2951
|
+
(onArticleClick)="onArticleClick.emit($event)"
|
|
2952
|
+
(onAddArticleButtonClick)="onAddArticleButtonClick.emit($event)"
|
|
2953
|
+
(onArButtonClick)="onArButtonClick.emit($event)"
|
|
2954
|
+
(onLookAtArticleButtonClick)="onLookAtArticleButtonClick.emit($event)"
|
|
2955
|
+
(onStockDetailsClick)="onStockDetailsClick.emit($event)"
|
|
2956
|
+
>
|
|
2957
|
+
</co-catalog-article-tile>
|
|
2958
|
+
</ng-container>
|
|
2959
|
+
</div>
|
|
2960
|
+
<co-pagination-bar *ngIf="catalogSearchService.articles?.length > 0"
|
|
2961
|
+
[currentPage]="catalogSearchService.currentPage"
|
|
2962
|
+
[itemsPerPage]="catalogSearchService.articlesPerPage"
|
|
2963
|
+
[totalItems]="catalogSearchService.resultCount"
|
|
2964
|
+
[previousLabel]="'PREVIOUS' | localize"
|
|
2965
|
+
[nextLabel]="'NEXT' | localize"
|
|
2966
|
+
[autoHide]="true"
|
|
2967
|
+
[directionLinks]="true"
|
|
2968
|
+
[paginationRange]="8"
|
|
2969
|
+
(previousClick)="onPreviousClick()"
|
|
2970
|
+
(nextClick)="onNextClick()"
|
|
2971
|
+
(pageClick)="onPageClick($event)">
|
|
2972
|
+
</co-pagination-bar>
|
|
2973
|
+
`,
|
|
2974
|
+
encapsulation: ViewEncapsulation.None
|
|
1870
2975
|
},] }
|
|
1871
2976
|
];
|
|
1872
|
-
|
|
1873
|
-
{ type:
|
|
1874
|
-
{ type:
|
|
1875
|
-
{ type:
|
|
1876
|
-
]
|
|
1877
|
-
|
|
1878
|
-
|
|
2977
|
+
CatalogSearchResultTileComponent.propDecorators = {
|
|
2978
|
+
onLookAtArticleButtonClick: [{ type: Output }],
|
|
2979
|
+
onArButtonClick: [{ type: Output }],
|
|
2980
|
+
onAddArticleButtonClick: [{ type: Output }],
|
|
2981
|
+
onArticleClick: [{ type: Output }],
|
|
2982
|
+
onStockDetailsClick: [{ type: Output }],
|
|
2983
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-search-result-tile',] }],
|
|
2984
|
+
smallScrollbar: [{ type: HostBinding, args: ['class.co-small-scrollbar',] }]
|
|
1879
2985
|
};
|
|
1880
2986
|
|
|
1881
|
-
class
|
|
1882
|
-
constructor(iconCache,
|
|
2987
|
+
class ArticleBaseComponent {
|
|
2988
|
+
constructor(iconCache, catalogService, options, _iOne, _changeDetector, _appEventService, _imageService, _settingsService) {
|
|
1883
2989
|
this.iconCache = iconCache;
|
|
1884
|
-
this.
|
|
2990
|
+
this.catalogService = catalogService;
|
|
1885
2991
|
this.options = options;
|
|
1886
2992
|
this._iOne = _iOne;
|
|
1887
2993
|
this._changeDetector = _changeDetector;
|
|
@@ -1893,6 +2999,11 @@ class ArticleCardComponent {
|
|
|
1893
2999
|
this.isSmallModus = false;
|
|
1894
3000
|
this.hasMagnifierButton = false;
|
|
1895
3001
|
this.hasInfoButton = false;
|
|
3002
|
+
this.onLookAtArticleButtonClick = new EventEmitter();
|
|
3003
|
+
this.onArButtonClick = new EventEmitter();
|
|
3004
|
+
this.onAddArticleButtonClick = new EventEmitter();
|
|
3005
|
+
this.onArticleClick = new EventEmitter();
|
|
3006
|
+
this.onStockDetailsClick = new EventEmitter();
|
|
1896
3007
|
// does not emit when you click one of the predefined buttons, but emits on a click on any of our other content
|
|
1897
3008
|
this.contentClick = new EventEmitter();
|
|
1898
3009
|
this.infoButtonClick = new EventEmitter();
|
|
@@ -1921,517 +3032,194 @@ class ArticleCardComponent {
|
|
|
1921
3032
|
this._getThumbNailImagesAndPrice();
|
|
1922
3033
|
}
|
|
1923
3034
|
}
|
|
3035
|
+
showClass() {
|
|
3036
|
+
return true;
|
|
3037
|
+
}
|
|
1924
3038
|
onHostClick(event) {
|
|
1925
3039
|
event.stopPropagation();
|
|
1926
3040
|
this._appEventService.articleClick.next(this.article);
|
|
3041
|
+
this.onArticleClick.emit(this.article);
|
|
1927
3042
|
}
|
|
1928
3043
|
handleLookAtArticleButtonClick(event) {
|
|
1929
3044
|
event.stopPropagation();
|
|
1930
3045
|
this._appEventService.lookAtArticleButtonClick.next(this.article);
|
|
3046
|
+
this.onLookAtArticleButtonClick.emit(this.article);
|
|
1931
3047
|
}
|
|
1932
|
-
handleAddArticleButtonClick(event) {
|
|
1933
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1934
|
-
event.stopPropagation();
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
event.stopPropagation();
|
|
1940
|
-
this._appEventService.stockDetailsClick.next(this.article);
|
|
1941
|
-
}
|
|
1942
|
-
handleArButtonClick(event) {
|
|
1943
|
-
event.stopPropagation();
|
|
1944
|
-
this._appEventService.arButtonClick.next(this.article);
|
|
1945
|
-
}
|
|
1946
|
-
removeHtmlTags(desc) {
|
|
1947
|
-
desc = desc.replace(/\r?\n|\r/, '');
|
|
1948
|
-
return desc;
|
|
1949
|
-
}
|
|
1950
|
-
_getJSONFromArticleObject(article) {
|
|
1951
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1952
|
-
return yield this._iOne.getJsonArticleFlatTree(article.goodId, article.goodType, 1);
|
|
1953
|
-
});
|
|
1954
|
-
}
|
|
1955
|
-
_detectChanges() {
|
|
1956
|
-
this._changeDetector.detectChanges();
|
|
1957
|
-
}
|
|
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
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
}
|
|
1974
|
-
ArticleCardComponent.decorators = [
|
|
1975
|
-
{ 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"]
|
|
1979
|
-
},] }
|
|
1980
|
-
];
|
|
1981
|
-
ArticleCardComponent.ctorParameters = () => [
|
|
1982
|
-
{ type: IconCacheService },
|
|
1983
|
-
{ type: CatalogService },
|
|
1984
|
-
{ type: OptionsService },
|
|
1985
|
-
{ type: IOneControllerService },
|
|
1986
|
-
{ type: ChangeDetectorRef },
|
|
1987
|
-
{ type: AppEventService },
|
|
1988
|
-
{ type: ImageService },
|
|
1989
|
-
{ type: SettingsService }
|
|
1990
|
-
];
|
|
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'],] }]
|
|
2006
|
-
};
|
|
2007
|
-
|
|
2008
|
-
class LabelFieldComponent {
|
|
2009
|
-
constructor() {
|
|
2010
|
-
this.label = '';
|
|
2011
|
-
}
|
|
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
|
-
};
|
|
2024
|
-
|
|
2025
|
-
class IconHandleComponent {
|
|
2026
|
-
constructor(_iconCache) {
|
|
2027
|
-
this._iconCache = _iconCache;
|
|
2028
|
-
this.icons = IconEnum;
|
|
2029
|
-
this.horizontal = false;
|
|
2030
|
-
this.onHandleClick = new EventEmitter();
|
|
2031
|
-
}
|
|
2032
|
-
set icon(value) {
|
|
2033
|
-
this.iconData = this._iconCache.getIcon(value);
|
|
2034
|
-
}
|
|
2035
|
-
ngOnInit() {
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
IconHandleComponent.decorators = [
|
|
2039
|
-
{ 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"]
|
|
2043
|
-
},] }
|
|
2044
|
-
];
|
|
2045
|
-
IconHandleComponent.ctorParameters = () => [
|
|
2046
|
-
{ type: IconCacheService }
|
|
2047
|
-
];
|
|
2048
|
-
IconHandleComponent.propDecorators = {
|
|
2049
|
-
icon: [{ type: Input }],
|
|
2050
|
-
horizontal: [{ type: HostBinding, args: ['class.horizontal',] }, { type: Input }],
|
|
2051
|
-
onHandleClick: [{ type: Output }]
|
|
2052
|
-
};
|
|
2053
|
-
|
|
2054
|
-
class CatalogComponent {
|
|
2055
|
-
constructor(catalog) {
|
|
2056
|
-
this.catalog = catalog;
|
|
2057
|
-
this.layout = {};
|
|
2058
|
-
this._subs = [];
|
|
2059
|
-
this._subs.push(this.catalog.showPageChanged.subscribe(() => {
|
|
2060
|
-
this.containerElement.nativeElement.scrollTo({ left: 0, top: 0, behavior: 'smooth' });
|
|
2061
|
-
}));
|
|
2062
|
-
}
|
|
2063
|
-
ngOnInit() {
|
|
2064
|
-
// this.catalog.articleSearchFilters.category = this.category;
|
|
2065
|
-
}
|
|
2066
|
-
ngOnDestroy() {
|
|
2067
|
-
this._subs.forEach((s) => { s.unsubscribe(); });
|
|
2068
|
-
}
|
|
2069
|
-
}
|
|
2070
|
-
CatalogComponent.decorators = [
|
|
2071
|
-
{ 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"]
|
|
2075
|
-
},] }
|
|
2076
|
-
];
|
|
2077
|
-
CatalogComponent.ctorParameters = () => [
|
|
2078
|
-
{ type: CatalogService }
|
|
2079
|
-
];
|
|
2080
|
-
CatalogComponent.propDecorators = {
|
|
2081
|
-
containerElement: [{ type: ViewChild, args: ['container', { read: ElementRef, static: true },] }]
|
|
2082
|
-
};
|
|
2083
|
-
|
|
2084
|
-
// A pipe for localizing string values in view templates.
|
|
2085
|
-
class LocalizePipe {
|
|
2086
|
-
constructor(_dictionaryService) {
|
|
2087
|
-
this._dictionaryService = _dictionaryService;
|
|
2088
|
-
}
|
|
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);
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2100
|
-
LocalizePipe.decorators = [
|
|
2101
|
-
{ type: Pipe, args: [{
|
|
2102
|
-
name: 'localize'
|
|
2103
|
-
},] }
|
|
2104
|
-
];
|
|
2105
|
-
LocalizePipe.ctorParameters = () => [
|
|
2106
|
-
{ type: DictionaryService }
|
|
2107
|
-
];
|
|
2108
|
-
|
|
2109
|
-
class BaseComponent {
|
|
2110
|
-
}
|
|
2111
|
-
|
|
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;
|
|
2136
|
-
}
|
|
2137
|
-
ngOnInit() {
|
|
2138
|
-
let view = this._containerRef.createEmbeddedView(this._templateRef, {});
|
|
2139
|
-
this._setLayout();
|
|
2140
|
-
}
|
|
2141
|
-
ngAfterViewInit() {
|
|
2142
|
-
}
|
|
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
|
-
}
|
|
2150
|
-
}
|
|
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
|
-
// }
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
LayoutDirective.decorators = [
|
|
2162
|
-
{ type: Directive, args: [{
|
|
2163
|
-
selector: '[layout]'
|
|
2164
|
-
},] }
|
|
2165
|
-
];
|
|
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',] }]
|
|
2176
|
-
};
|
|
2177
|
-
|
|
2178
|
-
class IoneCatalogComponent {
|
|
2179
|
-
constructor(catalogService, _dictionary, _componentFactoryResolver, _jsonUtils, _ione, _changeDetector, _optionsService, _elementRef, _appEventService, _settingsService) {
|
|
2180
|
-
this.catalogService = catalogService;
|
|
2181
|
-
this._dictionary = _dictionary;
|
|
2182
|
-
this._componentFactoryResolver = _componentFactoryResolver;
|
|
2183
|
-
this._jsonUtils = _jsonUtils;
|
|
2184
|
-
this._ione = _ione;
|
|
2185
|
-
this._changeDetector = _changeDetector;
|
|
2186
|
-
this._optionsService = _optionsService;
|
|
2187
|
-
this._elementRef = _elementRef;
|
|
2188
|
-
this._appEventService = _appEventService;
|
|
2189
|
-
this._settingsService = _settingsService;
|
|
2190
|
-
this.onAddToCart = new EventEmitter();
|
|
2191
|
-
this.onAddToQuote = new EventEmitter();
|
|
2192
|
-
this.onLookAtArticleButtonClick = new EventEmitter();
|
|
2193
|
-
this.onAddArticleButtonClick = new EventEmitter();
|
|
2194
|
-
this.onArticleClick = new EventEmitter();
|
|
2195
|
-
this.onArButtonClick = new EventEmitter();
|
|
2196
|
-
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
|
-
}));
|
|
2209
|
-
}
|
|
2210
|
-
set settings(value) {
|
|
2211
|
-
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);
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
get settings() {
|
|
2223
|
-
return this._settings;
|
|
2224
|
-
}
|
|
2225
|
-
set parameters(value) {
|
|
2226
|
-
this._optionsService.parameters = value;
|
|
3048
|
+
handleAddArticleButtonClick(event) {
|
|
3049
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3050
|
+
event.stopPropagation();
|
|
3051
|
+
const json = yield this._getJSONFromArticleObject(this.article);
|
|
3052
|
+
this._appEventService.addArticleButtonClick.next(json);
|
|
3053
|
+
this.onAddArticleButtonClick.emit(json);
|
|
3054
|
+
});
|
|
2227
3055
|
}
|
|
2228
|
-
|
|
2229
|
-
|
|
3056
|
+
handleStockDetailsButtonClick(event) {
|
|
3057
|
+
event.stopPropagation();
|
|
3058
|
+
this._appEventService.stockDetailsClick.next(this.article);
|
|
3059
|
+
this.onStockDetailsClick.emit(this.article);
|
|
2230
3060
|
}
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
3061
|
+
handleArButtonClick(event) {
|
|
3062
|
+
event.stopPropagation();
|
|
3063
|
+
this._appEventService.arButtonClick.next(this.article);
|
|
3064
|
+
this.onArButtonClick.emit(this.article);
|
|
3065
|
+
}
|
|
3066
|
+
removeHtmlTags(desc) {
|
|
3067
|
+
desc = desc.replace(/\r?\n|\r/, '');
|
|
3068
|
+
return desc;
|
|
2235
3069
|
}
|
|
2236
|
-
|
|
3070
|
+
_getJSONFromArticleObject(article) {
|
|
2237
3071
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2238
|
-
|
|
3072
|
+
return yield this._iOne.getJsonArticleFlatTree(article.goodId, article.goodType, 1);
|
|
2239
3073
|
});
|
|
2240
3074
|
}
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
3075
|
+
_detectChanges() {
|
|
3076
|
+
this._changeDetector.detectChanges();
|
|
3077
|
+
}
|
|
3078
|
+
_getThumbNailImagesAndPrice() {
|
|
3079
|
+
if (this._article) {
|
|
3080
|
+
this._imageService.getArticleImage(this._article);
|
|
3081
|
+
this._iOne.getArticlePrice(this._article.goodId, this._settingsService.settings.type).then(price => {
|
|
3082
|
+
if (price) {
|
|
3083
|
+
this._article.baselinePrice = price.baselinePrice;
|
|
3084
|
+
this._article.price = price.basePrice;
|
|
3085
|
+
this._article.suppliedPrice = price.suppliedPrice;
|
|
3086
|
+
if (price.articleDescription !== undefined && price.articleDescription !== '') {
|
|
3087
|
+
this._article.description = price.articleDescription;
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
2249
3090
|
});
|
|
2250
|
-
|
|
2251
|
-
// const defs = this._ione.connector.connector.getCatalogDefinitions();
|
|
2252
|
-
this._connectionSet = true;
|
|
2253
|
-
});
|
|
3091
|
+
}
|
|
2254
3092
|
}
|
|
2255
3093
|
}
|
|
2256
|
-
|
|
2257
|
-
{ type:
|
|
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
|
-
},] }
|
|
3094
|
+
ArticleBaseComponent.decorators = [
|
|
3095
|
+
{ type: Directive }
|
|
2263
3096
|
];
|
|
2264
|
-
|
|
3097
|
+
ArticleBaseComponent.ctorParameters = () => [
|
|
3098
|
+
{ type: IconCacheService },
|
|
2265
3099
|
{ type: CatalogService },
|
|
2266
|
-
{ type:
|
|
2267
|
-
{ type:
|
|
2268
|
-
{ type: JsonUtilsService },
|
|
2269
|
-
{ type: IOneControllerService },
|
|
3100
|
+
{ type: CatalogOptionsService },
|
|
3101
|
+
{ type: CatalogConnectorService },
|
|
2270
3102
|
{ type: ChangeDetectorRef },
|
|
2271
|
-
{ type:
|
|
2272
|
-
{ type:
|
|
2273
|
-
{ type:
|
|
2274
|
-
{ type: SettingsService }
|
|
3103
|
+
{ type: CatalogEventService },
|
|
3104
|
+
{ type: CatalogImageService },
|
|
3105
|
+
{ type: CatalogSettingsService }
|
|
2275
3106
|
];
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
3107
|
+
ArticleBaseComponent.propDecorators = {
|
|
3108
|
+
article: [{ type: Input }],
|
|
3109
|
+
showing: [{ type: Input }],
|
|
3110
|
+
imageData: [{ type: Input }],
|
|
3111
|
+
price: [{ type: Input }],
|
|
3112
|
+
isSelected: [{ type: Input }],
|
|
3113
|
+
isSmallModus: [{ type: Input }, { type: HostBinding, args: ['class.small-modus',] }],
|
|
3114
|
+
hasMagnifierButton: [{ type: Input }],
|
|
3115
|
+
hasInfoButton: [{ type: Input }],
|
|
2281
3116
|
onLookAtArticleButtonClick: [{ type: Output }],
|
|
3117
|
+
onArButtonClick: [{ type: Output }],
|
|
2282
3118
|
onAddArticleButtonClick: [{ type: Output }],
|
|
2283
3119
|
onArticleClick: [{ type: Output }],
|
|
2284
|
-
|
|
2285
|
-
|
|
3120
|
+
onStockDetailsClick: [{ type: Output }],
|
|
3121
|
+
contentClick: [{ type: Output }],
|
|
3122
|
+
infoButtonClick: [{ type: Output }],
|
|
3123
|
+
magnifierButtonClick: [{ type: Output }],
|
|
3124
|
+
threeDButtonClick: [{ type: Output }],
|
|
3125
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-article-tile',] }],
|
|
3126
|
+
onHostClick: [{ type: HostListener, args: ['click', ['$event'],] }]
|
|
2286
3127
|
};
|
|
2287
3128
|
|
|
2288
|
-
class
|
|
2289
|
-
|
|
2290
|
-
|
|
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
|
-
}
|
|
3129
|
+
class CatalogArticleTileComponent extends ArticleBaseComponent {
|
|
3130
|
+
showClass() {
|
|
3131
|
+
return true;
|
|
2312
3132
|
}
|
|
2313
3133
|
}
|
|
2314
|
-
|
|
3134
|
+
CatalogArticleTileComponent.decorators = [
|
|
2315
3135
|
{ type: Component, args: [{
|
|
2316
|
-
selector: '
|
|
2317
|
-
template:
|
|
2318
|
-
|
|
3136
|
+
selector: 'co-catalog-article-tile',
|
|
3137
|
+
template: `
|
|
3138
|
+
<div class="article-tile-wrapper">
|
|
3139
|
+
<div class="card-wrapper">
|
|
3140
|
+
<div class="image">
|
|
3141
|
+
<co-image class="co-image" [source]="article.imageData"></co-image>
|
|
3142
|
+
</div>
|
|
3143
|
+
<div class="button-wrapper">
|
|
3144
|
+
<co-icon *ngIf="threeD" [iconData]="iconCache.getIcon(icons.ThreeD)" class="pointer"></co-icon>
|
|
3145
|
+
<co-icon *ngIf="threeD && options.showARButton" class="pointer"
|
|
3146
|
+
[iconData]="iconCache.getIcon(icons.Ar)"
|
|
3147
|
+
(click)="handleArButtonClick($event)"
|
|
3148
|
+
></co-icon>
|
|
3149
|
+
</div>
|
|
3150
|
+
</div>
|
|
3151
|
+
<div class="description-wrapper">
|
|
3152
|
+
<!--
|
|
3153
|
+
<div class="main">
|
|
3154
|
+
-->
|
|
3155
|
+
<div class="main-top">
|
|
3156
|
+
<div *ngIf="!!turnover" class="turnover" [innerText]="removeHtmlTags(turnover)"></div>
|
|
3157
|
+
<div *ngIf="!!name" class="description" [innerText]="removeHtmlTags(name)"></div>
|
|
3158
|
+
</div>
|
|
3159
|
+
<div class="main-bottom">
|
|
3160
|
+
<div class="main-bottom-left">
|
|
3161
|
+
<div *ngIf="!!article?.price" class="price" [innerText]="article?.price | priceDisplay:valutaSymbol"></div>
|
|
3162
|
+
<div *ngIf="!!article?.articleNumber" class="sku">
|
|
3163
|
+
<span [innerText]="'sku' | localize"></span>:
|
|
3164
|
+
<span [innerText]="article.articleNumber"></span>
|
|
3165
|
+
</div>
|
|
3166
|
+
<div *ngIf="stock_available" (click)="handleStockDetailsButtonClick($event)" class="stock"
|
|
3167
|
+
[innerText]="stock_available"></div>
|
|
3168
|
+
<div *ngIf="!stock_available" (click)="handleStockDetailsButtonClick($event)" class="stock not-in-stock"
|
|
3169
|
+
[innerText]="'Niet op voorraad'"></div>
|
|
3170
|
+
</div>
|
|
3171
|
+
<div *ngIf="options.showAddArticleButton" class="on-article-buttons">
|
|
3172
|
+
<co-button *ngIf="!configurable"
|
|
3173
|
+
[label]="options.addArticleButtonText"
|
|
3174
|
+
class="open-icon action pointer"
|
|
3175
|
+
(onClick)="handleAddArticleButtonClick($event)"
|
|
3176
|
+
[iconData]="iconCache.getIcon(icons.AddToCartDrop)">
|
|
3177
|
+
</co-button>
|
|
3178
|
+
<co-button *ngIf="configurable"
|
|
3179
|
+
[label]="options.lookAtArticleButtonText"
|
|
3180
|
+
class="open-icon action pointer"
|
|
3181
|
+
(onClick)="handleLookAtArticleButtonClick($event)"
|
|
3182
|
+
[iconData]="iconCache.getIcon(icons.MagicWand)">
|
|
3183
|
+
</co-button>
|
|
3184
|
+
<!--co-button
|
|
3185
|
+
[label]="options.stockButtonText"
|
|
3186
|
+
class="open-icon action pointer stock"
|
|
3187
|
+
(onClick)="handleStockDetailsButtonClick($event)"
|
|
3188
|
+
[iconData]="iconCache.getIcon(icons.Truck)">
|
|
3189
|
+
</co-button-->
|
|
3190
|
+
</div>
|
|
3191
|
+
</div>
|
|
3192
|
+
</div>
|
|
3193
|
+
</div>
|
|
3194
|
+
`,
|
|
3195
|
+
encapsulation: ViewEncapsulation.None
|
|
2319
3196
|
},] }
|
|
2320
3197
|
];
|
|
2321
|
-
|
|
2322
|
-
{ type:
|
|
2323
|
-
{ type: CatalogService }
|
|
2324
|
-
];
|
|
2325
|
-
FilterItemsComponent.propDecorators = {
|
|
2326
|
-
filterCollection: [{ type: Input }],
|
|
2327
|
-
description: [{ type: Input }],
|
|
2328
|
-
customColors: [{ type: Input }],
|
|
2329
|
-
filterCollectionChange: [{ type: Output }]
|
|
3198
|
+
CatalogArticleTileComponent.propDecorators = {
|
|
3199
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-article-tile',] }]
|
|
2330
3200
|
};
|
|
2331
3201
|
|
|
2332
|
-
class
|
|
2333
|
-
transform(items, field) {
|
|
2334
|
-
if (!items || !field) {
|
|
2335
|
-
return items;
|
|
2336
|
-
}
|
|
2337
|
-
return items.filter(item => item[field] > 0);
|
|
2338
|
-
}
|
|
3202
|
+
class CatalogArticleTileModule {
|
|
2339
3203
|
}
|
|
2340
|
-
|
|
2341
|
-
{ type:
|
|
2342
|
-
|
|
2343
|
-
|
|
3204
|
+
CatalogArticleTileModule.decorators = [
|
|
3205
|
+
{ type: NgModule, args: [{
|
|
3206
|
+
imports: [
|
|
3207
|
+
CommonModule,
|
|
3208
|
+
IconModule,
|
|
3209
|
+
CatalogFilterModule,
|
|
3210
|
+
PriceDisplayPipeModule,
|
|
3211
|
+
ButtonModule,
|
|
3212
|
+
ImageModule
|
|
3213
|
+
],
|
|
3214
|
+
declarations: [
|
|
3215
|
+
CatalogArticleTileComponent
|
|
3216
|
+
],
|
|
3217
|
+
exports: [
|
|
3218
|
+
CatalogArticleTileComponent
|
|
3219
|
+
]
|
|
2344
3220
|
},] }
|
|
2345
3221
|
];
|
|
2346
3222
|
|
|
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
3223
|
class VisibilityObserverMasterDirective {
|
|
2436
3224
|
// I initialize the intersection observer parent directive.
|
|
2437
3225
|
constructor() {
|
|
@@ -2533,104 +3321,296 @@ VisibilityObserverDirective.propDecorators = {
|
|
|
2533
3321
|
observerEnabled: [{ type: Input }]
|
|
2534
3322
|
};
|
|
2535
3323
|
|
|
2536
|
-
class
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
3324
|
+
class VisibilityObserverModule {
|
|
3325
|
+
}
|
|
3326
|
+
VisibilityObserverModule.decorators = [
|
|
3327
|
+
{ type: NgModule, args: [{
|
|
3328
|
+
declarations: [
|
|
3329
|
+
VisibilityObserverMasterDirective,
|
|
3330
|
+
VisibilityObserverDirective
|
|
3331
|
+
],
|
|
3332
|
+
exports: [
|
|
3333
|
+
VisibilityObserverMasterDirective,
|
|
3334
|
+
VisibilityObserverDirective
|
|
3335
|
+
]
|
|
3336
|
+
},] }
|
|
3337
|
+
];
|
|
3338
|
+
|
|
3339
|
+
class CatalogSearchResultTileModule {
|
|
3340
|
+
}
|
|
3341
|
+
CatalogSearchResultTileModule.decorators = [
|
|
3342
|
+
{ type: NgModule, args: [{
|
|
3343
|
+
imports: [
|
|
3344
|
+
CommonModule,
|
|
3345
|
+
CatalogArticleTileModule,
|
|
3346
|
+
VisibilityObserverModule,
|
|
3347
|
+
PaginationBarModule,
|
|
3348
|
+
CatalogFilterModule
|
|
3349
|
+
],
|
|
3350
|
+
declarations: [
|
|
3351
|
+
CatalogSearchResultTileComponent
|
|
3352
|
+
],
|
|
3353
|
+
exports: [
|
|
3354
|
+
CatalogSearchResultTileComponent
|
|
3355
|
+
]
|
|
3356
|
+
},] }
|
|
3357
|
+
];
|
|
3358
|
+
|
|
3359
|
+
class CatalogSearchResultListComponent extends CatalogSearchBaseComponent {
|
|
3360
|
+
showClass() {
|
|
3361
|
+
return true;
|
|
2544
3362
|
}
|
|
2545
3363
|
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
3364
|
+
CatalogSearchResultListComponent.decorators = [
|
|
3365
|
+
{ type: Component, args: [{
|
|
3366
|
+
selector: 'co-catalog-search-result-list',
|
|
3367
|
+
template: `
|
|
3368
|
+
<div class="article-cards" visibilityObserverMaster>
|
|
3369
|
+
<ng-container *ngFor="let article of catalogSearchService.articles">
|
|
3370
|
+
<co-catalog-article-list
|
|
3371
|
+
visibilityObserver
|
|
3372
|
+
#intersection="intersection"
|
|
3373
|
+
[observerEnabled]="!article.imageData"
|
|
3374
|
+
[showing]="intersection.isIntersecting"
|
|
3375
|
+
[article]="article"
|
|
3376
|
+
>
|
|
3377
|
+
</co-catalog-article-list>
|
|
3378
|
+
</ng-container>
|
|
3379
|
+
</div>
|
|
3380
|
+
<co-pagination-bar *ngIf="catalogSearchService.articles?.length > 0"
|
|
3381
|
+
[currentPage]="catalogSearchService.currentPage"
|
|
3382
|
+
[itemsPerPage]="catalogSearchService.articlesPerPage"
|
|
3383
|
+
[totalItems]="catalogSearchService.resultCount"
|
|
3384
|
+
[previousLabel]="'PREVIOUS' | localize"
|
|
3385
|
+
[nextLabel]="'NEXT' | localize"
|
|
3386
|
+
[autoHide]="true"
|
|
3387
|
+
[directionLinks]="true"
|
|
3388
|
+
[paginationRange]="8"
|
|
3389
|
+
(previousClick)="onPreviousClick()"
|
|
3390
|
+
(nextClick)="onNextClick()"
|
|
3391
|
+
(pageClick)="onPageClick($event)">
|
|
3392
|
+
</co-pagination-bar>
|
|
3393
|
+
`,
|
|
3394
|
+
encapsulation: ViewEncapsulation.None
|
|
2550
3395
|
},] }
|
|
2551
3396
|
];
|
|
2552
|
-
|
|
2553
|
-
{ type:
|
|
2554
|
-
|
|
3397
|
+
CatalogSearchResultListComponent.propDecorators = {
|
|
3398
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-search-result-list',] }]
|
|
3399
|
+
};
|
|
2555
3400
|
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
3401
|
+
class CatalogArticleListComponent extends ArticleBaseComponent {
|
|
3402
|
+
showClass() {
|
|
3403
|
+
return true;
|
|
3404
|
+
}
|
|
2559
3405
|
}
|
|
2560
|
-
|
|
3406
|
+
CatalogArticleListComponent.decorators = [
|
|
3407
|
+
{ type: Component, args: [{
|
|
3408
|
+
selector: 'co-catalog-article-list',
|
|
3409
|
+
template: `
|
|
3410
|
+
<div class="card-wrapper">
|
|
3411
|
+
<div class="left">
|
|
3412
|
+
<div class="image">
|
|
3413
|
+
<co-image *ngIf="article && article.imageData" [source]="article.imageData"></co-image>
|
|
3414
|
+
<div class="no-image-wrapper" *ngIf="!article || !article.imageData">
|
|
3415
|
+
<co-icon class="no-image" [iconData]="iconCache.getIcon(icons.Camera)"></co-icon>
|
|
3416
|
+
<span [textContent]="'NO_IMAGE' | localize"></span>
|
|
3417
|
+
</div>
|
|
3418
|
+
</div>
|
|
3419
|
+
<div class="button-wrapper">
|
|
3420
|
+
<co-icon *ngIf="threeD" [iconData]="iconCache.getIcon(icons.ThreeD)" class="pointer"></co-icon>
|
|
3421
|
+
<co-icon *ngIf="threeD && options.showARButton" class="pointer"
|
|
3422
|
+
[iconData]="iconCache.getIcon(icons.Ar)"
|
|
3423
|
+
(click)="handleArButtonClick($event)"
|
|
3424
|
+
></co-icon>
|
|
3425
|
+
</div>
|
|
3426
|
+
</div>
|
|
3427
|
+
<div class="description-wrapper">
|
|
3428
|
+
<div class="main">
|
|
3429
|
+
<div class="main-top">
|
|
3430
|
+
<div *ngIf="!!turnover" class="turnover" [innerText]="removeHtmlTags(turnover)"></div>
|
|
3431
|
+
<div *ngIf="!!name" class="description" [innerText]="removeHtmlTags(name)"></div>
|
|
3432
|
+
</div>
|
|
3433
|
+
<div class="main-bottom">
|
|
3434
|
+
<div class="main-bottom-left">
|
|
3435
|
+
<div *ngIf="!!article?.articleNumber" class="sku">
|
|
3436
|
+
<span [innerText]="'sku' | localize"></span>:
|
|
3437
|
+
<span [innerText]="article.articleNumber"></span>
|
|
3438
|
+
</div>
|
|
3439
|
+
<div class="description">
|
|
3440
|
+
<span class="label" [innerText]="'description' | localize"></span>
|
|
3441
|
+
<span class="text" *ngIf="!!article?.description"
|
|
3442
|
+
[innerText]="removeHtmlTags(article.description)"></span>
|
|
3443
|
+
<span class="text" *ngIf="!!added_description" [innerText]="removeHtmlTags(added_description)"></span>
|
|
3444
|
+
</div>
|
|
3445
|
+
</div>
|
|
3446
|
+
</div>
|
|
3447
|
+
</div>
|
|
3448
|
+
</div>
|
|
3449
|
+
<div class="right">
|
|
3450
|
+
<div *ngIf="!!article?.price" class="price" [innerText]="article?.price | priceDisplay:valutaSymbol"></div>
|
|
3451
|
+
<div *ngIf="options.showAddArticleButton" class="on-article-buttons">
|
|
3452
|
+
<co-button *ngIf="!configurable"
|
|
3453
|
+
[label]="options.addArticleButtonText"
|
|
3454
|
+
class="open-icon action pointer"
|
|
3455
|
+
(onClick)="handleAddArticleButtonClick($event)"
|
|
3456
|
+
[iconData]="iconCache.getIcon(icons.AddToCartDrop)">
|
|
3457
|
+
</co-button>
|
|
3458
|
+
<co-button *ngIf="configurable"
|
|
3459
|
+
[label]="options.lookAtArticleButtonText"
|
|
3460
|
+
class="open-icon action pointer"
|
|
3461
|
+
(onClick)="handleLookAtArticleButtonClick($event)"
|
|
3462
|
+
[iconData]="iconCache.getIcon(icons.MagicWand)">
|
|
3463
|
+
</co-button>
|
|
3464
|
+
<!--co-button
|
|
3465
|
+
[label]="options.stockButtonText"
|
|
3466
|
+
class="open-icon action pointer stock"
|
|
3467
|
+
(onClick)="handleStockDetailsButtonClick($event)"
|
|
3468
|
+
[iconData]="iconCache.getIcon(icons.Truck)">
|
|
3469
|
+
</co-button-->
|
|
3470
|
+
</div>
|
|
3471
|
+
<div *ngIf="stock_available" (click)="handleStockDetailsButtonClick($event)" class="stock"
|
|
3472
|
+
[innerText]="stock_available"></div>
|
|
3473
|
+
<div *ngIf="!stock_available" (click)="handleStockDetailsButtonClick($event)" class="stock not-in-stock"
|
|
3474
|
+
[innerText]="'Niet op voorraad'"></div>
|
|
3475
|
+
</div>
|
|
3476
|
+
</div>
|
|
3477
|
+
`,
|
|
3478
|
+
encapsulation: ViewEncapsulation.None
|
|
3479
|
+
},] }
|
|
3480
|
+
];
|
|
3481
|
+
CatalogArticleListComponent.propDecorators = {
|
|
3482
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-article-list',] }]
|
|
3483
|
+
};
|
|
3484
|
+
|
|
3485
|
+
class CatalogArticleListModule {
|
|
2561
3486
|
}
|
|
2562
|
-
|
|
3487
|
+
CatalogArticleListModule.decorators = [
|
|
2563
3488
|
{ type: NgModule, args: [{
|
|
2564
3489
|
imports: [
|
|
2565
|
-
// BrowserAnimationsModule,
|
|
2566
3490
|
CommonModule,
|
|
2567
|
-
|
|
2568
|
-
PaginationModule,
|
|
2569
|
-
CardModule,
|
|
2570
|
-
ButtonModule,
|
|
2571
|
-
LevelIndicatorModule,
|
|
2572
|
-
ImageModule,
|
|
3491
|
+
ImageModule$1,
|
|
2573
3492
|
IconModule,
|
|
3493
|
+
CatalogFilterModule,
|
|
2574
3494
|
PriceDisplayPipeModule,
|
|
2575
|
-
|
|
2576
|
-
SliderModule,
|
|
2577
|
-
InputTextChipsModule,
|
|
2578
|
-
InputCheckboxModule,
|
|
2579
|
-
FormsModule,
|
|
2580
|
-
FilterItemModule,
|
|
2581
|
-
InputDatePickerModule,
|
|
2582
|
-
InputTextModule,
|
|
2583
|
-
InputTextModule,
|
|
2584
|
-
SimpleGridModule,
|
|
2585
|
-
PaginationBarModule
|
|
3495
|
+
ButtonModule
|
|
2586
3496
|
],
|
|
2587
3497
|
declarations: [
|
|
2588
|
-
|
|
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
|
|
3498
|
+
CatalogArticleListComponent
|
|
2607
3499
|
],
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
3500
|
+
exports: [
|
|
3501
|
+
CatalogArticleListComponent
|
|
3502
|
+
]
|
|
3503
|
+
},] }
|
|
3504
|
+
];
|
|
3505
|
+
|
|
3506
|
+
class CatalogSearchResultListModule {
|
|
3507
|
+
}
|
|
3508
|
+
CatalogSearchResultListModule.decorators = [
|
|
3509
|
+
{ type: NgModule, args: [{
|
|
3510
|
+
imports: [
|
|
3511
|
+
CommonModule,
|
|
3512
|
+
VisibilityObserverModule,
|
|
3513
|
+
CatalogArticleListModule,
|
|
3514
|
+
PaginationBarModule,
|
|
3515
|
+
CatalogFilterModule
|
|
3516
|
+
],
|
|
3517
|
+
declarations: [
|
|
3518
|
+
CatalogSearchResultListComponent
|
|
3519
|
+
],
|
|
3520
|
+
exports: [
|
|
3521
|
+
CatalogSearchResultListComponent
|
|
3522
|
+
]
|
|
3523
|
+
},] }
|
|
3524
|
+
];
|
|
3525
|
+
|
|
3526
|
+
class CatalogSearchModule {
|
|
3527
|
+
}
|
|
3528
|
+
CatalogSearchModule.decorators = [
|
|
3529
|
+
{ type: NgModule, args: [{
|
|
3530
|
+
imports: [
|
|
3531
|
+
CommonModule,
|
|
3532
|
+
CatalogFilterModule,
|
|
3533
|
+
CatalogSearchHeaderModule,
|
|
3534
|
+
CatalogSearchResultTileModule,
|
|
3535
|
+
CatalogSearchResultListModule,
|
|
3536
|
+
CatalogCategoriesModule,
|
|
3537
|
+
CatalogExternalSourcesModule,
|
|
3538
|
+
CatalogNavigationModule
|
|
3539
|
+
],
|
|
3540
|
+
declarations: [
|
|
3541
|
+
CatalogSearchComponent
|
|
2626
3542
|
],
|
|
2627
3543
|
exports: [
|
|
2628
|
-
|
|
2629
|
-
|
|
3544
|
+
CatalogSearchComponent
|
|
3545
|
+
]
|
|
3546
|
+
},] }
|
|
3547
|
+
];
|
|
3548
|
+
|
|
3549
|
+
class CatalogExternalSourceComponent {
|
|
3550
|
+
constructor(catalogService, _appEventService, _sanitizer, _ref, _renderer) {
|
|
3551
|
+
this.catalogService = catalogService;
|
|
3552
|
+
this._appEventService = _appEventService;
|
|
3553
|
+
this._sanitizer = _sanitizer;
|
|
3554
|
+
this._ref = _ref;
|
|
3555
|
+
this._renderer = _renderer;
|
|
3556
|
+
this._subs = [];
|
|
3557
|
+
this._renderer.addClass(document.body, 'external');
|
|
3558
|
+
this._subs.push(this.catalogService.externalSourceChanged.subscribe(changed => {
|
|
3559
|
+
if (changed) {
|
|
3560
|
+
if (this.externalSourceFrame && this.externalSourceFrame.nativeElement) {
|
|
3561
|
+
this.externalSourceFrame.nativeElement.src = '';
|
|
3562
|
+
this.externalSourceFrame.nativeElement.src = this.catalogService.externalSourceUrl;
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
}));
|
|
3566
|
+
}
|
|
3567
|
+
showClass() {
|
|
3568
|
+
return true;
|
|
3569
|
+
}
|
|
3570
|
+
ngAfterViewInit() {
|
|
3571
|
+
this._ref.detach();
|
|
3572
|
+
}
|
|
3573
|
+
ngOnDestroy() {
|
|
3574
|
+
this._renderer.removeClass(document.body, 'external');
|
|
3575
|
+
this._subs.forEach(s => s.unsubscribe());
|
|
3576
|
+
}
|
|
3577
|
+
getSafeUrl() {
|
|
3578
|
+
return this._sanitizer.bypassSecurityTrustResourceUrl(this.catalogService.externalSourceUrl);
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
CatalogExternalSourceComponent.decorators = [
|
|
3582
|
+
{ type: Component, args: [{
|
|
3583
|
+
selector: 'co-catalog-external-source',
|
|
3584
|
+
template: `
|
|
3585
|
+
<iframe #externalSourceFrame class="external-iframe" [src]="getSafeUrl()"></iframe>
|
|
3586
|
+
`,
|
|
3587
|
+
encapsulation: ViewEncapsulation.None
|
|
3588
|
+
},] }
|
|
3589
|
+
];
|
|
3590
|
+
CatalogExternalSourceComponent.ctorParameters = () => [
|
|
3591
|
+
{ type: CatalogService },
|
|
3592
|
+
{ type: CatalogEventService },
|
|
3593
|
+
{ type: DomSanitizer },
|
|
3594
|
+
{ type: ChangeDetectorRef },
|
|
3595
|
+
{ type: Renderer2 }
|
|
3596
|
+
];
|
|
3597
|
+
CatalogExternalSourceComponent.propDecorators = {
|
|
3598
|
+
externalSourceFrame: [{ type: ViewChild, args: ['externalSourceFrame', { read: ElementRef },] }],
|
|
3599
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-external-source',] }]
|
|
3600
|
+
};
|
|
3601
|
+
|
|
3602
|
+
class CatalogExternalSourceModule {
|
|
3603
|
+
}
|
|
3604
|
+
CatalogExternalSourceModule.decorators = [
|
|
3605
|
+
{ type: NgModule, args: [{
|
|
3606
|
+
imports: [
|
|
3607
|
+
CommonModule
|
|
3608
|
+
],
|
|
3609
|
+
declarations: [
|
|
3610
|
+
CatalogExternalSourceComponent
|
|
2630
3611
|
],
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
NavigationComponent
|
|
3612
|
+
exports: [
|
|
3613
|
+
CatalogExternalSourceComponent
|
|
2634
3614
|
]
|
|
2635
3615
|
},] }
|
|
2636
3616
|
];
|
|
@@ -2639,5 +3619,5 @@ IoneCatalogModule.decorators = [
|
|
|
2639
3619
|
* Generated bundle index. Do not edit.
|
|
2640
3620
|
*/
|
|
2641
3621
|
|
|
2642
|
-
export {
|
|
3622
|
+
export { CatalogArticleListModule, CatalogArticleTileModule, CatalogCategoriesModule, CatalogExternalSourceModule, CatalogExternalSourcesModule, CatalogFilterModule, CatalogNavigationModule, CatalogSearchHeaderModule, CatalogSearchModule, CatalogSearchResultListModule, CatalogSearchResultTileModule, CatalogSearchService, CatalogService, Version, CatalogFilterComponent as ɵa, CatalogFilterService as ɵb, CatalogArticleTileComponent as ɵba, ArticleBaseComponent as ɵbb, VisibilityObserverModule as ɵbc, VisibilityObserverMasterDirective as ɵbd, VisibilityObserverDirective as ɵbe, CatalogSearchResultTileComponent as ɵbf, CatalogSearchBaseComponent as ɵbg, CatalogArticleListComponent as ɵbh, CatalogSearchResultListComponent as ɵbi, CatalogSearchComponent as ɵbj, CatalogExternalSourceComponent as ɵbk, 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, OverlayModule as ɵu, OverlayDirective as ɵv, OverlayParentDirective as ɵw, CatalogNavigationComponent as ɵx, CatalogEventService as ɵy, CatalogSearchHeaderComponent as ɵz };
|
|
2643
3623
|
//# sourceMappingURL=colijnit-catalog.js.map
|