@colijnit/catalog 301.1.6 → 301.1.7

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.
@@ -44,6 +44,8 @@ import { ObjectUtils } from '@colijnit/ioneconnector/build/utils/object-utils';
44
44
  import { LanguageCode } from '@colijnit/ioneconnector/build/enum/language-code.enum';
45
45
  import { StringUtils } from '@colijnit/ioneconnector/build/utils/string-utils';
46
46
  import { PagingParameters } from '@colijnit/ioneconnector/build/model/paging-parameters';
47
+ import { ArticleSortField } from '@colijnit/articleapi/build/enum/article-sort-field.enum';
48
+ import { ArticleSortDirection } from '@colijnit/articleapi/build/enum/article-sort-direction.enum';
47
49
  import { trigger, state, transition, style, animate } from '@angular/animations';
48
50
  import * as i1 from '@angular/platform-browser';
49
51
  import { DomainName } from '@colijnit/mainapi/build/enum/domain-name.enum';
@@ -60,8 +62,8 @@ import { ExternalCatalogTypes } from '@colijnit/transactionapi/build/enum/extern
60
62
  class Version {
61
63
  name = "@colijnit/catalog";
62
64
  description = "iOne Catalog module based on Angular 20";
63
- symVer = "301.1.6";
64
- publishDate = "09/11/2026, 16:46:56";
65
+ symVer = "301.1.7";
66
+ publishDate = "11/11/2026, 16:53:33";
65
67
  }
66
68
 
67
69
  class ArticlesSearchResult {
@@ -84,6 +86,7 @@ class SettingsOptions {
84
86
  sortTurnoverGroupsByAlphabet = true;
85
87
  searchOnStart = false;
86
88
  showFilter = true;
89
+ showSorting = true;
87
90
  showNavigation = false;
88
91
  }
89
92
 
@@ -1911,6 +1914,9 @@ class CatalogOptionsService {
1911
1914
  get showFilter() {
1912
1915
  return this._settingsService.settings.options.showFilter;
1913
1916
  }
1917
+ get showSorting() {
1918
+ return this._settingsService.settings.options.showSorting !== false;
1919
+ }
1914
1920
  set parameters(value) {
1915
1921
  this._parameters = Object.assign(new ArticleExtendedRequest(), value);
1916
1922
  if (this._parameters.rangeBrand) { // workaround until it works in 250
@@ -2226,6 +2232,26 @@ class CatalogSearchService {
2226
2232
  get category() {
2227
2233
  return this._category;
2228
2234
  }
2235
+ get sortField() {
2236
+ return this._sortField;
2237
+ }
2238
+ set sortField(value) {
2239
+ if (!value || value === this._sortField) {
2240
+ return;
2241
+ }
2242
+ this._sortField = value;
2243
+ this.searchArticles();
2244
+ }
2245
+ get sortDirection() {
2246
+ return this._sortDirection;
2247
+ }
2248
+ set sortDirection(value) {
2249
+ if (!value || value === this._sortDirection) {
2250
+ return;
2251
+ }
2252
+ this._sortDirection = value;
2253
+ this.searchArticles();
2254
+ }
2229
2255
  articlesPerPage = 20;
2230
2256
  resultCount;
2231
2257
  get currentPage() {
@@ -2242,6 +2268,8 @@ class CatalogSearchService {
2242
2268
  _turnoverGroup;
2243
2269
  _subs = [];
2244
2270
  _presetApplied = false;
2271
+ _sortField = ArticleSortField.Name;
2272
+ _sortDirection = ArticleSortDirection.Ascending;
2245
2273
  constructor(_filterService, _catalogConnectorService, _catalogConnectorAdapterService, _settingsService, _optionService, _promptService, _screenConfigService) {
2246
2274
  this._filterService = _filterService;
2247
2275
  this._catalogConnectorService = _catalogConnectorService;
@@ -2255,6 +2283,7 @@ class CatalogSearchService {
2255
2283
  if (this._optionService.parameters) {
2256
2284
  this.searchRequest = Object.assign(new ArticleExtendedRequest(), this._optionService.parameters);
2257
2285
  this._applyScreenConfigDefaults();
2286
+ this._readSortingFromRequest(this.searchRequest);
2258
2287
  }
2259
2288
  }
2260
2289
  }), this._catalogConnectorAdapterService.controllerInitialized.subscribe(async (initialized) => {
@@ -2291,6 +2320,8 @@ class CatalogSearchService {
2291
2320
  lowerBound = 1;
2292
2321
  }
2293
2322
  this.searchRequest.paging = new PagingParameters(lowerBound, lowerBound + this.articlesPerPage - 1, this.articlesPerPage);
2323
+ this.searchRequest.sortField = this._sortField;
2324
+ this.searchRequest.sortDirection = this._sortDirection;
2294
2325
  this._catalogConnectorService.getArticlesForCatalog(this._requestForSearch()).then((result) => {
2295
2326
  this.articles = result && result.articles ? result.articles : [];
2296
2327
  this.resultCount = result && result.count ? result.count : 0;
@@ -2360,10 +2391,14 @@ class CatalogSearchService {
2360
2391
  * The in stock filter only counts the stock in the warehouses of the user's branch.
2361
2392
  * With warehouses chosen for it, only the stock in those warehouses counts, which the backend
2362
2393
  * checks through searchAvailableStock and rangeAvailableInWarehouses (as the AS app does).
2394
+ * The warehouses only belong to the in stock filter, so they're cleared once that filter is off.
2363
2395
  */
2364
2396
  _requestForSearch() {
2365
- const inStock = !!this.searchRequest.inStock?.includes('J');
2366
- if (!inStock || !this.searchRequest.rangeAvailableInWarehouses) {
2397
+ if (!this.searchRequest.inStock?.includes('J')) {
2398
+ this.searchRequest.rangeAvailableInWarehouses = undefined;
2399
+ return this.searchRequest;
2400
+ }
2401
+ if (!this.searchRequest.rangeAvailableInWarehouses) {
2367
2402
  return this.searchRequest;
2368
2403
  }
2369
2404
  const request = Object.assign(new ArticleExtendedRequest(), this.searchRequest);
@@ -2376,6 +2411,16 @@ class CatalogSearchService {
2376
2411
  this.searchRequest.turnoverGroup = turnoverGroup;
2377
2412
  this.searchRequest.general = searchText ? searchText.join(' ') : null;
2378
2413
  }
2414
+ _readSortingFromRequest(request) {
2415
+ const field = request ? request.sortField : null;
2416
+ const direction = request ? request.sortDirection : null;
2417
+ if (field && Object.values(ArticleSortField).includes(field)) {
2418
+ this._sortField = field;
2419
+ }
2420
+ if (direction && Object.values(ArticleSortDirection).includes(direction)) {
2421
+ this._sortDirection = direction;
2422
+ }
2423
+ }
2379
2424
  _resetRequestParametersAndProps() {
2380
2425
  this.searchRequest.category = null;
2381
2426
  this.searchRequest.turnoverGroup = null;
@@ -2739,9 +2784,11 @@ var IconEnum;
2739
2784
  (function (IconEnum) {
2740
2785
  IconEnum["AddToCartDrop"] = "add_to_cart_drop";
2741
2786
  IconEnum["Ar"] = "ar";
2787
+ IconEnum["ArrowDownSolid"] = "arrow_down_solid";
2742
2788
  IconEnum["ArrowScrollDown"] = "arrow_scroll_down";
2743
2789
  IconEnum["ArrowScrollLeft"] = "arrow_scroll_left";
2744
2790
  IconEnum["ArrowUpRightFromSquare"] = "arrow_up_right_from_square";
2791
+ IconEnum["ArrowUpSolid"] = "arrow_up_solid";
2745
2792
  IconEnum["BarsFilter"] = "bars_filter";
2746
2793
  IconEnum["BarsRegularFull"] = "bars_regular_full";
2747
2794
  IconEnum["BarsSolidFull"] = "bars_solid_full";
@@ -2776,9 +2823,11 @@ var IconEnum;
2776
2823
  const IconSvg = {
2777
2824
  "add_to_cart_drop": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M16.58,34.84a1.8,1.8,0,1,0,1.8,1.8A1.79,1.79,0,0,0,16.58,34.84Z\" fill=\"#484f60\"/><path d=\"M31.49,34.84a1.8,1.8,0,1,0,1.8,1.8A1.79,1.79,0,0,0,31.49,34.84Z\" fill=\"#484f60\"/><path d=\"M35.6,17.9l-1.51.18L31.88,20.3l1.31-.17a.88.88,0,0,1,1,1.08L32.35,29.5a1.52,1.52,0,0,1-1.44,1.2H16.51a1.75,1.75,0,0,1-1.57-1.17l-2.31-5.6a1,1,0,0,1,.85-1.29l4.43-.56-1.86-1.86-5.13.61a1,1,0,0,0-.87,1.28l3.34,9.44A1.73,1.73,0,0,0,15,32.72H32.64a1.51,1.51,0,0,0,1.43-1.2L36.6,19A.89.89,0,0,0,35.6,17.9Z\" fill=\"#484f60\"/><path d=\"M39,17a1.87,1.87,0,0,0-1.36,1.46l-.42,2.89c-.1.67.31,1,.9.7a2.75,2.75,0,0,0,1.33-1.7L40,18A.73.73,0,0,0,39,17Z\" fill=\"#484f60\"/><polygon points=\"24 25.35 32.04 17.3 27.04 17.3 27.04 10 20.95 10 20.95 17.3 15.96 17.3 24 25.35\" fill=\"#484f60\"/></svg>",
2778
2825
  "ar": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><rect width=\"50\" height=\"50\" fill=\"none\"/><rect x=\"8\" y=\"20.98\" width=\"4.27\" height=\"11.1\" rx=\"0.5\" ry=\"0.5\" fill=\"#484f60\"/><rect x=\"38.73\" y=\"20.98\" width=\"4.27\" height=\"11.1\" rx=\"0.5\" ry=\"0.5\" fill=\"#484f60\"/><rect x=\"13.12\" y=\"15.86\" width=\"11.95\" height=\"8.54\" rx=\"0.5\" ry=\"0.5\" fill=\"#484f60\"/><rect x=\"13.12\" y=\"25.25\" width=\"11.95\" height=\"3.41\" rx=\"0.5\" ry=\"0.5\" fill=\"#484f60\"/><rect x=\"25.93\" y=\"15.86\" width=\"11.95\" height=\"8.54\" rx=\"0.5\" ry=\"0.5\" fill=\"#484f60\"/><rect x=\"25.93\" y=\"25.25\" width=\"11.95\" height=\"3.41\" rx=\"0.5\" ry=\"0.5\" fill=\"#484f60\"/></svg>",
2826
+ "arrow_down_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\"><path d=\"M297.4 566.6C309.9 579.1 330.2 579.1 342.7 566.6L502.7 406.6C515.2 394.1 515.2 373.8 502.7 361.3C490.2 348.8 469.9 348.8 457.4 361.3L352 466.7L352 96C352 78.3 337.7 64 320 64C302.3 64 288 78.3 288 96L288 466.7L182.6 361.3C170.1 348.8 149.8 348.8 137.3 361.3C124.8 373.8 124.8 394.1 137.3 406.6L297.3 566.6z\"/></svg>",
2779
2827
  "arrow_scroll_down": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\" version=\"1.1\" sodipodi:docname=\"arrow_scroll_left.svg\" inkscape:version=\"0.92.4 (5da689c313, 2019-01-14)\"><metadata ><rdf:RDF><cc:Work rdf:about=\"\"><dc:format>image/svg+xml</dc:format><dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor=\"#ffffff\" bordercolor=\"#666666\" borderopacity=\"1\" objecttolerance=\"10\" gridtolerance=\"10\" guidetolerance=\"10\" inkscape:pageopacity=\"0\" inkscape:pageshadow=\"2\" inkscape:window-width=\"1920\" inkscape:window-height=\"1017\" showgr inkscape:zoom=\"4.72\" inkscape:cx=\"25\" inkscape:cy=\"25\" inkscape:window-x=\"-8\" inkscape:window-y=\"-8\" inkscape:window-maximized=\"1\" inkscape:current-layer=\"svg4\" /><path d=\"m 37.771942,16.289849 a 2.37,2.37 0 0 1 1.67,4 l -12.64,12.68 a 2.37,2.37 0 0 1 -3.34,0 l -12.63,-12.64 a 2.36,2.36 0 1 1 3.3,-3.36 l 11,11 11,-11 a 2.36,2.36 0 0 1 1.64,-0.68 z\" inkscape:connector-curvature=\"0\" style=\"fill:#484f60\" /></svg>",
2780
2828
  "arrow_scroll_left": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M33.68,37.64a2.37,2.37,0,0,1-4,1.67L17,26.67a2.37,2.37,0,0,1,0-3.34L29.64,10.7A2.36,2.36,0,1,1,33,14L22,25,33,36A2.36,2.36,0,0,1,33.68,37.64Z\" fill=\"#484f60\"/></svg>",
2781
2829
  "arrow_up_right_from_square": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\"><path d=\"M368 64C359.2 64 352 71.2 352 80C352 88.8 359.2 96 368 96L521.4 96L260.7 356.7C254.5 362.9 254.5 373.1 260.7 379.3C266.9 385.5 277.1 385.5 283.3 379.3L544 118.6L544 272C544 280.8 551.2 288 560 288C568.8 288 576 280.8 576 272L576 80C576 71.2 568.8 64 560 64L368 64zM144 160C99.8 160 64 195.8 64 240L64 496C64 540.2 99.8 576 144 576L400 576C444.2 576 480 540.2 480 496L480 400C480 391.2 472.8 384 464 384C455.2 384 448 391.2 448 400L448 496C448 522.5 426.5 544 400 544L144 544C117.5 544 96 522.5 96 496L96 240C96 213.5 117.5 192 144 192L240 192C248.8 192 256 184.8 256 176C256 167.2 248.8 160 240 160L144 160z\"/></svg>",
2830
+ "arrow_up_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\"><path d=\"M342.6 73.4C330.1 60.9 309.8 60.9 297.3 73.4L137.3 233.4C124.8 245.9 124.8 266.2 137.3 278.7C149.8 291.2 170.1 291.2 182.6 278.7L288 173.3L288 544C288 561.7 302.3 576 320 576C337.7 576 352 561.7 352 544L352 173.3L457.4 278.7C469.9 291.2 490.2 291.2 502.7 278.7C515.2 266.2 515.2 245.9 502.7 233.4L342.7 73.4z\"/></svg>",
2782
2831
  "bars_filter": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill=\"#494f61\" d=\"M264 392H183.1C170.8 392 160 402.8 160 415.1C160 429.2 170.8 440 183.1 440h80C277.2 440 288 429.2 288 416C288 402.8 277.2 392 264 392zM424 72H23.1C10.8 72 0 82.8 0 95.1S10.8 120 23.1 120H424c13.2 0 24-10.8 24-23.1S437.2 72 424 72zM360 232H87.1C74.8 232 64 242.8 64 255.1C64 269.2 74.8 280 87.1 280h272C373.2 280 384 269.2 384 256C384 242.8 373.2 232 360 232z\"/></svg>",
2783
2832
  "bars_regular_full": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\"><path d=\"M96 152C96 138.7 106.7 128 120 128L520 128C533.3 128 544 138.7 544 152C544 165.3 533.3 176 520 176L120 176C106.7 176 96 165.3 96 152zM96 320C96 306.7 106.7 296 120 296L520 296C533.3 296 544 306.7 544 320C544 333.3 533.3 344 520 344L120 344C106.7 344 96 333.3 96 320zM544 488C544 501.3 533.3 512 520 512L120 512C106.7 512 96 501.3 96 488C96 474.7 106.7 464 120 464L520 464C533.3 464 544 474.7 544 488z\"/></svg>",
2784
2833
  "bars_solid_full": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\"><path d=\"M96 160C96 142.3 110.3 128 128 128L512 128C529.7 128 544 142.3 544 160C544 177.7 529.7 192 512 192L128 192C110.3 192 96 177.7 96 160zM96 320C96 302.3 110.3 288 128 288L512 288C529.7 288 544 302.3 544 320C544 337.7 529.7 352 512 352L128 352C110.3 352 96 337.7 96 320zM544 480C544 497.7 529.7 512 512 512L128 512C110.3 512 96 497.7 96 480C96 462.3 110.3 448 128 448L512 448C529.7 448 544 462.3 544 480z\"/></svg>",
@@ -6527,9 +6576,16 @@ class CatalogSearchBaseComponent {
6527
6576
  onStockDetailsClick = new EventEmitter();
6528
6577
  onArticleCheckboxClicked = new EventEmitter();
6529
6578
  elements = [];
6579
+ _observerEnabled = new WeakMap();
6530
6580
  constructor(catalogSearchService) {
6531
6581
  this.catalogSearchService = catalogSearchService;
6532
6582
  }
6583
+ observerEnabled(article) {
6584
+ if (!this._observerEnabled.has(article)) {
6585
+ this._observerEnabled.set(article, !article.imageData);
6586
+ }
6587
+ return this._observerEnabled.get(article);
6588
+ }
6533
6589
  onPreviousClick() {
6534
6590
  this._scrollIntoView();
6535
6591
  this.catalogSearchService.currentPage -= 1;
@@ -7272,7 +7328,7 @@ class CatalogSearchResultTileComponent extends CatalogSearchBaseComponent {
7272
7328
  visibilityObserver
7273
7329
  #intersection="intersection"
7274
7330
  [selectedArticles]="selectedArticles"
7275
- [observerEnabled]="!article.imageData"
7331
+ [observerEnabled]="observerEnabled(article)"
7276
7332
  [createFrozenArticle]="createFrozenArticle"
7277
7333
  [article]="article"
7278
7334
  [embedded]="embedded"
@@ -7316,7 +7372,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
7316
7372
  visibilityObserver
7317
7373
  #intersection="intersection"
7318
7374
  [selectedArticles]="selectedArticles"
7319
- [observerEnabled]="!article.imageData"
7375
+ [observerEnabled]="observerEnabled(article)"
7320
7376
  [createFrozenArticle]="createFrozenArticle"
7321
7377
  [article]="article"
7322
7378
  [embedded]="embedded"
@@ -7666,7 +7722,7 @@ class CatalogSearchResultListComponent extends CatalogSearchBaseComponent {
7666
7722
  <co-catalog-article-list
7667
7723
  visibilityObserver
7668
7724
  #intersection="intersection"
7669
- [observerEnabled]="!article.imageData"
7725
+ [observerEnabled]="observerEnabled(article)"
7670
7726
  [createFrozenArticle]="createFrozenArticle"
7671
7727
  [article]="article"
7672
7728
  [externalSource]="externalSource"
@@ -7708,7 +7764,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
7708
7764
  <co-catalog-article-list
7709
7765
  visibilityObserver
7710
7766
  #intersection="intersection"
7711
- [observerEnabled]="!article.imageData"
7767
+ [observerEnabled]="observerEnabled(article)"
7712
7768
  [createFrozenArticle]="createFrozenArticle"
7713
7769
  [article]="article"
7714
7770
  [externalSource]="externalSource"
@@ -7879,6 +7935,109 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
7879
7935
  args: ["class.co-catalog-search-result-grid"]
7880
7936
  }] } });
7881
7937
 
7938
+ class CatalogSortComponent {
7939
+ iconCacheService;
7940
+ _catalogSearchService;
7941
+ _dictionary;
7942
+ icons = IconEnum;
7943
+ showClass = true;
7944
+ sortOptions = [];
7945
+ sortModel;
7946
+ get sortField() {
7947
+ return this._catalogSearchService.sortField;
7948
+ }
7949
+ get sortDirection() {
7950
+ return this._catalogSearchService.sortDirection;
7951
+ }
7952
+ get sortDirectionIcon() {
7953
+ return this.sortDirection === ArticleSortDirection.Descending ? this.icons.ArrowDownSolid : this.icons.ArrowUpSolid;
7954
+ }
7955
+ _subs = [];
7956
+ constructor(iconCacheService, _catalogSearchService, _dictionary) {
7957
+ this.iconCacheService = iconCacheService;
7958
+ this._catalogSearchService = _catalogSearchService;
7959
+ this._dictionary = _dictionary;
7960
+ }
7961
+ ngOnInit() {
7962
+ this._buildSortOptions();
7963
+ this._subs.push(this._dictionary.dictionaryLoaded.subscribe(() => {
7964
+ this._buildSortOptions();
7965
+ }));
7966
+ }
7967
+ ngOnDestroy() {
7968
+ this._subs.forEach(s => s.unsubscribe());
7969
+ }
7970
+ handleSortFieldChange(option) {
7971
+ if (!option) {
7972
+ this._selectSortOption(this.sortField);
7973
+ return;
7974
+ }
7975
+ this._catalogSearchService.sortField = option.field;
7976
+ this.sortModel = option;
7977
+ }
7978
+ handleSortDirectionClick() {
7979
+ this._catalogSearchService.sortDirection = this.sortDirection === ArticleSortDirection.Ascending
7980
+ ? ArticleSortDirection.Descending
7981
+ : ArticleSortDirection.Ascending;
7982
+ }
7983
+ _buildSortOptions() {
7984
+ this.sortOptions = [
7985
+ { field: ArticleSortField.Name, description: this._dictionary.get('NAME') },
7986
+ { field: ArticleSortField.Price, description: this._dictionary.get('PRICE') },
7987
+ { field: ArticleSortField.ArticleNumber, description: this._dictionary.get('ARTICLE_NR') }
7988
+ ];
7989
+ this._selectSortOption(this.sortField);
7990
+ }
7991
+ _selectSortOption(field) {
7992
+ const option = this.sortOptions.find((o) => o.field === field);
7993
+ this.sortModel = option ? { ...option } : undefined;
7994
+ }
7995
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CatalogSortComponent, deps: [{ token: IconCacheService }, { token: CatalogSearchService }, { token: CatalogDictionaryService }], target: i0.ɵɵFactoryTarget.Component });
7996
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: CatalogSortComponent, isStandalone: false, selector: "co-catalog-sort", host: { properties: { "class.co-catalog-sort": "this.showClass" } }, ngImport: i0, template: `
7997
+ <div class="catalog-sort-wrapper">
7998
+ <span class="catalog-sort-label" [textContent]="'SORT_BY' | caLocalize"></span>
7999
+ <co-list-of-values class="catalog-sort-select"
8000
+ [collection]="sortOptions"
8001
+ [model]="sortModel"
8002
+ [searchDisabled]="true"
8003
+ (modelChange)="handleSortFieldChange($event)">
8004
+ </co-list-of-values>
8005
+ <co-button class="catalog-sort-direction"
8006
+ [iconData]="iconCacheService.getIcon(sortDirectionIcon)"
8007
+ [title]="'SORTING_ORDER' | caLocalize"
8008
+ (click)="handleSortDirectionClick()">
8009
+ </co-button>
8010
+ </div>
8011
+ `, isInline: true, dependencies: [{ kind: "component", type: i6.ButtonComponent, selector: "co-button", inputs: ["label", "iconData", "iconDataRight", "isToggleButton", "isToggled", "hidden", "disabled"], outputs: ["onClick", "clickedWhileDisabled", "isToggledChange"] }, { kind: "component", type: i6.ListOfValuesComponent, selector: "co-list-of-values", inputs: ["model", "multiselect", "showToggleAll", "largeCollection", "displayField", "optionIcon", "collection", "collectionLoadFn", "collectionLoadFnProp", "leftIconData", "searchPlaceholder", "searchDisabled", "showChips"], outputs: ["leftIconClick"] }, { kind: "pipe", type: CatalogLocalizePipe, name: "caLocalize" }], encapsulation: i0.ViewEncapsulation.None });
8012
+ }
8013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CatalogSortComponent, decorators: [{
8014
+ type: Component,
8015
+ args: [{
8016
+ selector: 'co-catalog-sort',
8017
+ template: `
8018
+ <div class="catalog-sort-wrapper">
8019
+ <span class="catalog-sort-label" [textContent]="'SORT_BY' | caLocalize"></span>
8020
+ <co-list-of-values class="catalog-sort-select"
8021
+ [collection]="sortOptions"
8022
+ [model]="sortModel"
8023
+ [searchDisabled]="true"
8024
+ (modelChange)="handleSortFieldChange($event)">
8025
+ </co-list-of-values>
8026
+ <co-button class="catalog-sort-direction"
8027
+ [iconData]="iconCacheService.getIcon(sortDirectionIcon)"
8028
+ [title]="'SORTING_ORDER' | caLocalize"
8029
+ (click)="handleSortDirectionClick()">
8030
+ </co-button>
8031
+ </div>
8032
+ `,
8033
+ encapsulation: ViewEncapsulation.None,
8034
+ standalone: false
8035
+ }]
8036
+ }], ctorParameters: () => [{ type: IconCacheService }, { type: CatalogSearchService }, { type: CatalogDictionaryService }], propDecorators: { showClass: [{
8037
+ type: HostBinding,
8038
+ args: ['class.co-catalog-sort']
8039
+ }] } });
8040
+
7882
8041
  class CatalogSearchComponent {
7883
8042
  _settingsService;
7884
8043
  _catalogService;
@@ -7909,6 +8068,7 @@ class CatalogSearchComponent {
7909
8068
  tempFilter = true;
7910
8069
  popupFilter = true;
7911
8070
  showViewModes = true;
8071
+ showSorting = true;
7912
8072
  embedded;
7913
8073
  externalSource;
7914
8074
  isReturn = false;
@@ -7982,6 +8142,7 @@ class CatalogSearchComponent {
7982
8142
  }
7983
8143
  }
7984
8144
  this.showFilter = this.options.showFilter;
8145
+ this.showSorting = this.options.showSorting;
7985
8146
  if (this.popupFilter === false) {
7986
8147
  this.showFilter = false;
7987
8148
  }
@@ -8050,7 +8211,7 @@ class CatalogSearchComponent {
8050
8211
  this._catalogSearchService.searchArticles();
8051
8212
  }
8052
8213
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CatalogSearchComponent, deps: [{ token: CatalogSettingsService, host: true }, { token: CatalogService, host: true }, { token: CatalogSearchService, host: true }, { token: CatalogEventService }, { token: CatalogConnectorAdapterService }, { token: IconCacheService }, { token: CatalogScreenConfigurationService }, { token: CatalogOptionsService }], target: i0.ɵɵFactoryTarget.Component });
8053
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: CatalogSearchComponent, isStandalone: false, selector: "co-catalog-search", inputs: { settings: "settings", title: "title", subTitle: "subTitle", searchPlaceholder: "searchPlaceholder", createFrozenArticle: "createFrozenArticle", showNavigation: "showNavigation", showLandingPage: "showLandingPage", useQuickSelProperties: "useQuickSelProperties", tempFilter: "tempFilter", popupFilter: "popupFilter", showViewModes: "showViewModes", embedded: "embedded", externalSource: "externalSource", isReturn: "isReturn", currentTransactionBranchId: "currentTransactionBranchId", searchPresetTemplate: "searchPresetTemplate", generalFilterOrders: "generalFilterOrders", purchaseFilterOrders: "purchaseFilterOrders", logisticsFilterOrders: "logisticsFilterOrders" }, outputs: { settingsChange: "settingsChange", onLookAtArticleButtonClick: "onLookAtArticleButtonClick", onArButtonClick: "onArButtonClick", onAddArticleButtonClick: "onAddArticleButtonClick", onArticleClick: "onArticleClick", onArticleClickJSON: "onArticleClickJSON", onStockDetailsClick: "onStockDetailsClick", onExternalSourceClick: "onExternalSourceClick" }, host: { properties: { "class.co-catalog-search": "this.showClass" } }, providers: [
8214
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: CatalogSearchComponent, isStandalone: false, selector: "co-catalog-search", inputs: { settings: "settings", title: "title", subTitle: "subTitle", searchPlaceholder: "searchPlaceholder", createFrozenArticle: "createFrozenArticle", showNavigation: "showNavigation", showLandingPage: "showLandingPage", useQuickSelProperties: "useQuickSelProperties", tempFilter: "tempFilter", popupFilter: "popupFilter", showViewModes: "showViewModes", showSorting: "showSorting", embedded: "embedded", externalSource: "externalSource", isReturn: "isReturn", currentTransactionBranchId: "currentTransactionBranchId", searchPresetTemplate: "searchPresetTemplate", generalFilterOrders: "generalFilterOrders", purchaseFilterOrders: "purchaseFilterOrders", logisticsFilterOrders: "logisticsFilterOrders" }, outputs: { settingsChange: "settingsChange", onLookAtArticleButtonClick: "onLookAtArticleButtonClick", onArButtonClick: "onArButtonClick", onAddArticleButtonClick: "onAddArticleButtonClick", onArticleClick: "onArticleClick", onArticleClickJSON: "onArticleClickJSON", onStockDetailsClick: "onStockDetailsClick", onExternalSourceClick: "onExternalSourceClick" }, host: { properties: { "class.co-catalog-search": "this.showClass" } }, providers: [
8054
8215
  CatalogSelectSingleCacheService,
8055
8216
  CatalogSelectMultipleCacheService,
8056
8217
  CatalogSelectMultipleParameterizedCacheService,
@@ -8123,6 +8284,9 @@ class CatalogSearchComponent {
8123
8284
  <ng-container [ngTemplateOutlet]="searchPresetTemplate"></ng-container>
8124
8285
  }
8125
8286
  <div class="view-modes-wrapper">
8287
+ @if (showSorting) {
8288
+ <co-catalog-sort></co-catalog-sort>
8289
+ }
8126
8290
  <co-button
8127
8291
  (click)="mode = 'tile'"
8128
8292
  [class.selected]="mode === 'tile'"
@@ -8177,7 +8341,7 @@ class CatalogSearchComponent {
8177
8341
  </div>
8178
8342
  </div>
8179
8343
  }
8180
- `, isInline: true, dependencies: [{ kind: "directive", type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CatalogFilterComponent, selector: "co-catalog-filter", inputs: ["generalFilterOrders", "purchaseFilterOrders", "logisticsFilterOrders", "showResetFilter"] }, { kind: "component", type: CatalogSearchHeaderComponent, selector: "co-catalog-search-header", inputs: ["placeholder"], outputs: ["filterIconClick"] }, { kind: "component", type: CatalogSearchResultTileComponent, selector: "co-catalog-search-result-tile", inputs: ["embedded", "isReturn", "showSelectionCheckbox", "selectedArticles"] }, { kind: "component", type: CatalogSearchResultListComponent, selector: "co-catalog-search-result-list", inputs: ["embedded", "isReturn"] }, { kind: "component", type: CatalogSearchResultGridComponent, selector: "co-catalog-search-result-grid" }, { kind: "component", type: CatalogCategoriesComponent, selector: "co-catalog-categories", inputs: ["showTurnoverGroups", "parentForOverlay"], outputs: ["categoryClick", "turnoverGroupClick"] }, { kind: "component", type: CatalogNavigationComponent, selector: "co-catalog-navigation", inputs: ["homeLabel", "collectionLabel", "externalSourcesLabel", "showTurnoverGroups", "currentTransactionBranchId", "view", "minified"], outputs: ["homeClick", "categoryClick", "turnoverGroupClick", "externalSourceClick"] }, { kind: "component", type: i6.IconComponent, selector: "co-icon", inputs: ["icon", "iconData"] }, { kind: "component", type: i6.ButtonComponent, selector: "co-button", inputs: ["label", "iconData", "iconDataRight", "isToggleButton", "isToggled", "hidden", "disabled"], outputs: ["onClick", "clickedWhileDisabled", "isToggledChange"] }, { kind: "pipe", type: CatalogLocalizePipe, name: "caLocalize" }], animations: [
8344
+ `, isInline: true, dependencies: [{ kind: "directive", type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CatalogFilterComponent, selector: "co-catalog-filter", inputs: ["generalFilterOrders", "purchaseFilterOrders", "logisticsFilterOrders", "showResetFilter"] }, { kind: "component", type: CatalogSearchHeaderComponent, selector: "co-catalog-search-header", inputs: ["placeholder"], outputs: ["filterIconClick"] }, { kind: "component", type: CatalogSearchResultTileComponent, selector: "co-catalog-search-result-tile", inputs: ["embedded", "isReturn", "showSelectionCheckbox", "selectedArticles"] }, { kind: "component", type: CatalogSearchResultListComponent, selector: "co-catalog-search-result-list", inputs: ["embedded", "isReturn"] }, { kind: "component", type: CatalogSearchResultGridComponent, selector: "co-catalog-search-result-grid" }, { kind: "component", type: CatalogCategoriesComponent, selector: "co-catalog-categories", inputs: ["showTurnoverGroups", "parentForOverlay"], outputs: ["categoryClick", "turnoverGroupClick"] }, { kind: "component", type: CatalogNavigationComponent, selector: "co-catalog-navigation", inputs: ["homeLabel", "collectionLabel", "externalSourcesLabel", "showTurnoverGroups", "currentTransactionBranchId", "view", "minified"], outputs: ["homeClick", "categoryClick", "turnoverGroupClick", "externalSourceClick"] }, { kind: "component", type: CatalogSortComponent, selector: "co-catalog-sort" }, { kind: "component", type: i6.IconComponent, selector: "co-icon", inputs: ["icon", "iconData"] }, { kind: "component", type: i6.ButtonComponent, selector: "co-button", inputs: ["label", "iconData", "iconDataRight", "isToggleButton", "isToggled", "hidden", "disabled"], outputs: ["onClick", "clickedWhileDisabled", "isToggledChange"] }, { kind: "pipe", type: CatalogLocalizePipe, name: "caLocalize" }], animations: [
8181
8345
  trigger('showHideFilter', [
8182
8346
  state('void', style({ width: '0' })),
8183
8347
  state('*', style({ width: '*' })),
@@ -8237,6 +8401,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
8237
8401
  <ng-container [ngTemplateOutlet]="searchPresetTemplate"></ng-container>
8238
8402
  }
8239
8403
  <div class="view-modes-wrapper">
8404
+ @if (showSorting) {
8405
+ <co-catalog-sort></co-catalog-sort>
8406
+ }
8240
8407
  <co-button
8241
8408
  (click)="mode = 'tile'"
8242
8409
  [class.selected]="mode === 'tile'"
@@ -8356,6 +8523,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
8356
8523
  type: Input
8357
8524
  }], showViewModes: [{
8358
8525
  type: Input
8526
+ }], showSorting: [{
8527
+ type: Input
8359
8528
  }], embedded: [{
8360
8529
  type: Input
8361
8530
  }], externalSource: [{
@@ -8621,6 +8790,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
8621
8790
  }]
8622
8791
  }] });
8623
8792
 
8793
+ class CatalogSortModule {
8794
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CatalogSortModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8795
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: CatalogSortModule, declarations: [CatalogSortComponent], imports: [CommonModule,
8796
+ ButtonModule,
8797
+ ListOfValuesModule,
8798
+ CatalogPipeModule], exports: [CatalogSortComponent] });
8799
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CatalogSortModule, imports: [CommonModule,
8800
+ ButtonModule,
8801
+ ListOfValuesModule,
8802
+ CatalogPipeModule] });
8803
+ }
8804
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CatalogSortModule, decorators: [{
8805
+ type: NgModule,
8806
+ args: [{
8807
+ imports: [
8808
+ CommonModule,
8809
+ ButtonModule,
8810
+ ListOfValuesModule,
8811
+ CatalogPipeModule
8812
+ ],
8813
+ declarations: [
8814
+ CatalogSortComponent
8815
+ ],
8816
+ exports: [
8817
+ CatalogSortComponent
8818
+ ]
8819
+ }]
8820
+ }] });
8821
+
8624
8822
  class CatalogSearchModule {
8625
8823
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CatalogSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8626
8824
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: CatalogSearchModule, declarations: [CatalogSearchComponent], imports: [CommonModule,
@@ -8632,6 +8830,7 @@ class CatalogSearchModule {
8632
8830
  CatalogCategoriesModule,
8633
8831
  CatalogExternalSourcesModule,
8634
8832
  CatalogNavigationModule,
8833
+ CatalogSortModule,
8635
8834
  IconModule,
8636
8835
  ButtonModule,
8637
8836
  CatalogPipeModule,
@@ -8645,6 +8844,7 @@ class CatalogSearchModule {
8645
8844
  CatalogCategoriesModule,
8646
8845
  CatalogExternalSourcesModule,
8647
8846
  CatalogNavigationModule,
8847
+ CatalogSortModule,
8648
8848
  IconModule,
8649
8849
  ButtonModule,
8650
8850
  CatalogPipeModule,
@@ -8663,6 +8863,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
8663
8863
  CatalogCategoriesModule,
8664
8864
  CatalogExternalSourcesModule,
8665
8865
  CatalogNavigationModule,
8866
+ CatalogSortModule,
8666
8867
  IconModule,
8667
8868
  ButtonModule,
8668
8869
  CatalogPipeModule,
@@ -8933,7 +9134,7 @@ class CatalogExternalSourceComponent {
8933
9134
  (load)="iframeLoaded($event)"></iframe>
8934
9135
  }
8935
9136
  }
8936
- `, isInline: true, dependencies: [{ kind: "component", type: CatalogSearchComponent, selector: "co-catalog-search", inputs: ["settings", "title", "subTitle", "searchPlaceholder", "createFrozenArticle", "showNavigation", "showLandingPage", "useQuickSelProperties", "tempFilter", "popupFilter", "showViewModes", "embedded", "externalSource", "isReturn", "currentTransactionBranchId", "searchPresetTemplate", "generalFilterOrders", "purchaseFilterOrders", "logisticsFilterOrders"], outputs: ["settingsChange", "onLookAtArticleButtonClick", "onArButtonClick", "onAddArticleButtonClick", "onArticleClick", "onArticleClickJSON", "onStockDetailsClick", "onExternalSourceClick"] }], encapsulation: i0.ViewEncapsulation.None });
9137
+ `, isInline: true, dependencies: [{ kind: "component", type: CatalogSearchComponent, selector: "co-catalog-search", inputs: ["settings", "title", "subTitle", "searchPlaceholder", "createFrozenArticle", "showNavigation", "showLandingPage", "useQuickSelProperties", "tempFilter", "popupFilter", "showViewModes", "showSorting", "embedded", "externalSource", "isReturn", "currentTransactionBranchId", "searchPresetTemplate", "generalFilterOrders", "purchaseFilterOrders", "logisticsFilterOrders"], outputs: ["settingsChange", "onLookAtArticleButtonClick", "onArButtonClick", "onAddArticleButtonClick", "onArticleClick", "onArticleClickJSON", "onStockDetailsClick", "onExternalSourceClick"] }], encapsulation: i0.ViewEncapsulation.None });
8937
9138
  }
8938
9139
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CatalogExternalSourceComponent, decorators: [{
8939
9140
  type: Component,
@@ -10221,5 +10422,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
10221
10422
  * Generated bundle index. Do not edit.
10222
10423
  */
10223
10424
 
10224
- export { ArticleStockComparisonSearchGridResult, ArticleStockComparisonSearchGridSelection, ArticleStockComparisonSearchTileResult, ArticleStockComparisonSearchTileSelection, ArticleStockSearchGridSelection, ArticleStockSearchTileSelection, ArticleStockTransferSearchGridResult, ArticleStockTransferSearchGridSelection, ArticleStockTransferSearchTileResult, ArticleStockTransferSearchTileSelection, ArticlesSearchResult, ArticlesStockSearchGridResult, ArticlesStockSearchTileResult, CatalogArticleListComponent, CatalogArticleListModule, CatalogArticleTileComponent, CatalogArticleTileModule, CatalogBusinessObjectCacheManagerService, CatalogCategoriesComponent, CatalogCategoriesModule, CatalogConnectorAdapterService, CatalogConnectorService, CatalogDictionaryService, CatalogEventService, CatalogExternalSourceComponent, CatalogExternalSourceModule, CatalogExternalSourcesComponent, CatalogExternalSourcesModule, CatalogExternalSourcesService, CatalogFilterComponent, CatalogFilterModule, CatalogFilterService, CatalogFilterViewmodel, CatalogImageService, CatalogNavigationComponent, CatalogNavigationModule, CatalogNavigationService, CatalogOptionsService, CatalogScreenConfigurationService, CatalogSearchComponent, CatalogSearchHeaderComponent, CatalogSearchHeaderModule, CatalogSearchModule, CatalogSearchResultListComponent, CatalogSearchResultListModule, CatalogSearchResultTileComponent, CatalogSearchResultTileModule, CatalogSearchService, CatalogSelectMultipleCacheService, CatalogSelectMultipleParameterizedCacheService, CatalogSelectSingleCacheService, CatalogSelectSingleParameterizedCacheService, CatalogService, CatalogSettings, CatalogSettingsService, CatalogStockComparisonListComponent, CatalogStockComparisonListModule, CatalogStockComparisonService, CatalogStockComparisonTileComponent, CatalogStockComparisonTileModule, CatalogStockOverviewListComponent, CatalogStockOverviewListModule, CatalogStockOverviewTileComponent, CatalogStockOverviewTileModule, CatalogStockService, CatalogStockTransferService, CatalogWarehouseTransfersListComponent, CatalogWarehouseTransfersListModule, CatalogWarehouseTransfersTileComponent, CatalogWarehouseTransfersTileModule, ConfigNameEnum, ExternalSourceViewmodel, GoogleTranslateService, GoogleTranslation, IconSvg, SettingsOptions, StockView, Version };
10425
+ export { ArticleStockComparisonSearchGridResult, ArticleStockComparisonSearchGridSelection, ArticleStockComparisonSearchTileResult, ArticleStockComparisonSearchTileSelection, ArticleStockSearchGridSelection, ArticleStockSearchTileSelection, ArticleStockTransferSearchGridResult, ArticleStockTransferSearchGridSelection, ArticleStockTransferSearchTileResult, ArticleStockTransferSearchTileSelection, ArticlesSearchResult, ArticlesStockSearchGridResult, ArticlesStockSearchTileResult, CatalogArticleListComponent, CatalogArticleListModule, CatalogArticleTileComponent, CatalogArticleTileModule, CatalogBusinessObjectCacheManagerService, CatalogCategoriesComponent, CatalogCategoriesModule, CatalogConnectorAdapterService, CatalogConnectorService, CatalogDictionaryService, CatalogEventService, CatalogExternalSourceComponent, CatalogExternalSourceModule, CatalogExternalSourcesComponent, CatalogExternalSourcesModule, CatalogExternalSourcesService, CatalogFilterComponent, CatalogFilterModule, CatalogFilterService, CatalogFilterViewmodel, CatalogImageService, CatalogNavigationComponent, CatalogNavigationModule, CatalogNavigationService, CatalogOptionsService, CatalogScreenConfigurationService, CatalogSearchComponent, CatalogSearchHeaderComponent, CatalogSearchHeaderModule, CatalogSearchModule, CatalogSearchResultListComponent, CatalogSearchResultListModule, CatalogSearchResultTileComponent, CatalogSearchResultTileModule, CatalogSearchService, CatalogSelectMultipleCacheService, CatalogSelectMultipleParameterizedCacheService, CatalogSelectSingleCacheService, CatalogSelectSingleParameterizedCacheService, CatalogService, CatalogSettings, CatalogSettingsService, CatalogSortComponent, CatalogSortModule, CatalogStockComparisonListComponent, CatalogStockComparisonListModule, CatalogStockComparisonService, CatalogStockComparisonTileComponent, CatalogStockComparisonTileModule, CatalogStockOverviewListComponent, CatalogStockOverviewListModule, CatalogStockOverviewTileComponent, CatalogStockOverviewTileModule, CatalogStockService, CatalogStockTransferService, CatalogWarehouseTransfersListComponent, CatalogWarehouseTransfersListModule, CatalogWarehouseTransfersTileComponent, CatalogWarehouseTransfersTileModule, ConfigNameEnum, ExternalSourceViewmodel, GoogleTranslateService, GoogleTranslation, IconSvg, SettingsOptions, StockView, Version };
10225
10426
  //# sourceMappingURL=colijnit-catalog.mjs.map