@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.
package/index.d.ts CHANGED
@@ -43,6 +43,8 @@ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-obj
43
43
  import { BusinessObjectIDType } from '@colijnit/ioneconnector/build/type/business-object-id-type';
44
44
  import { AvaliableCatalogs } from '@colijnit/articleapi/build/model/catalogs-available.bo';
45
45
  import { TurnoverGroupImage } from '@colijnit/articleapi/build/model/turnover-group-image.bo';
46
+ import { ArticleSortField } from '@colijnit/articleapi/build/enum/article-sort-field.enum';
47
+ import { ArticleSortDirection } from '@colijnit/articleapi/build/enum/article-sort-direction.enum';
46
48
  import * as i2 from '@angular/common';
47
49
  import { SafeHtml, DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
48
50
  import * as i9 from '@colijnit/sharedcomponents';
@@ -72,6 +74,7 @@ declare class SettingsOptions {
72
74
  sortTurnoverGroupsByAlphabet: boolean;
73
75
  searchOnStart: boolean;
74
76
  showFilter: boolean;
77
+ showSorting: boolean;
75
78
  showNavigation: boolean;
76
79
  }
77
80
 
@@ -552,6 +555,7 @@ declare class CatalogOptionsService implements OnDestroy {
552
555
  get stockButtonText(): string;
553
556
  get sortTurnoverGroupsByAlphabet(): boolean;
554
557
  get showFilter(): boolean;
558
+ get showSorting(): boolean;
555
559
  set parameters(value: ArticleExtendedRequest);
556
560
  get parameters(): ArticleExtendedRequest;
557
561
  static ɵfac: i0.ɵɵFactoryDeclaration<CatalogOptionsService, never>;
@@ -636,6 +640,10 @@ declare class CatalogSearchService implements OnDestroy {
636
640
  get turnoverGroup(): string;
637
641
  set category(value: string);
638
642
  get category(): string;
643
+ get sortField(): ArticleSortField;
644
+ set sortField(value: ArticleSortField);
645
+ get sortDirection(): ArticleSortDirection;
646
+ set sortDirection(value: ArticleSortDirection);
639
647
  articlesPerPage: number;
640
648
  resultCount: number;
641
649
  get currentPage(): number;
@@ -647,6 +655,8 @@ declare class CatalogSearchService implements OnDestroy {
647
655
  private _turnoverGroup;
648
656
  private _subs;
649
657
  private _presetApplied;
658
+ private _sortField;
659
+ private _sortDirection;
650
660
  constructor(_filterService: CatalogFilterService, _catalogConnectorService: CatalogConnectorService, _catalogConnectorAdapterService: CatalogConnectorAdapterService, _settingsService: CatalogSettingsService, _optionService: CatalogOptionsService, _promptService: PromptService, _screenConfigService: CatalogScreenConfigurationService);
651
661
  ngOnDestroy(): void;
652
662
  searchArticles(resetPaging?: boolean): void;
@@ -670,9 +680,11 @@ declare class CatalogSearchService implements OnDestroy {
670
680
  * The in stock filter only counts the stock in the warehouses of the user's branch.
671
681
  * With warehouses chosen for it, only the stock in those warehouses counts, which the backend
672
682
  * checks through searchAvailableStock and rangeAvailableInWarehouses (as the AS app does).
683
+ * The warehouses only belong to the in stock filter, so they're cleared once that filter is off.
673
684
  */
674
685
  private _requestForSearch;
675
686
  private _setRequestParametersAndProps;
687
+ private _readSortingFromRequest;
676
688
  private _resetRequestParametersAndProps;
677
689
  static ɵfac: i0.ɵɵFactoryDeclaration<CatalogSearchService, never>;
678
690
  static ɵprov: i0.ɵɵInjectableDeclaration<CatalogSearchService>;
@@ -774,9 +786,11 @@ declare class CatalogCategoriesComponent implements OnInit, OnDestroy {
774
786
  declare enum IconEnum {
775
787
  AddToCartDrop = "add_to_cart_drop",
776
788
  Ar = "ar",
789
+ ArrowDownSolid = "arrow_down_solid",
777
790
  ArrowScrollDown = "arrow_scroll_down",
778
791
  ArrowScrollLeft = "arrow_scroll_left",
779
792
  ArrowUpRightFromSquare = "arrow_up_right_from_square",
793
+ ArrowUpSolid = "arrow_up_solid",
780
794
  BarsFilter = "bars_filter",
781
795
  BarsRegularFull = "bars_regular_full",
782
796
  BarsSolidFull = "bars_solid_full",
@@ -1413,6 +1427,7 @@ declare class CatalogSearchComponent implements OnInit, OnDestroy {
1413
1427
  tempFilter: boolean;
1414
1428
  popupFilter: boolean;
1415
1429
  showViewModes: boolean;
1430
+ showSorting: boolean;
1416
1431
  embedded: boolean;
1417
1432
  externalSource: ExternalSourceInfo;
1418
1433
  isReturn: boolean;
@@ -1461,7 +1476,7 @@ declare class CatalogSearchComponent implements OnInit, OnDestroy {
1461
1476
  applySearchRequest(searchRequest: ArticleExtendedRequest): void;
1462
1477
  search(): void;
1463
1478
  static ɵfac: i0.ɵɵFactoryDeclaration<CatalogSearchComponent, [{ host: true; }, { host: true; }, { host: true; }, null, null, null, null, null]>;
1464
- static ɵcmp: i0.ɵɵComponentDeclaration<CatalogSearchComponent, "co-catalog-search", never, { "settings": { "alias": "settings"; "required": false; }; "title": { "alias": "title"; "required": false; }; "subTitle": { "alias": "subTitle"; "required": false; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; }; "createFrozenArticle": { "alias": "createFrozenArticle"; "required": false; }; "showNavigation": { "alias": "showNavigation"; "required": false; }; "showLandingPage": { "alias": "showLandingPage"; "required": false; }; "useQuickSelProperties": { "alias": "useQuickSelProperties"; "required": false; }; "tempFilter": { "alias": "tempFilter"; "required": false; }; "popupFilter": { "alias": "popupFilter"; "required": false; }; "showViewModes": { "alias": "showViewModes"; "required": false; }; "embedded": { "alias": "embedded"; "required": false; }; "externalSource": { "alias": "externalSource"; "required": false; }; "isReturn": { "alias": "isReturn"; "required": false; }; "currentTransactionBranchId": { "alias": "currentTransactionBranchId"; "required": false; }; "searchPresetTemplate": { "alias": "searchPresetTemplate"; "required": false; }; "generalFilterOrders": { "alias": "generalFilterOrders"; "required": false; }; "purchaseFilterOrders": { "alias": "purchaseFilterOrders"; "required": false; }; "logisticsFilterOrders": { "alias": "logisticsFilterOrders"; "required": false; }; }, { "settingsChange": "settingsChange"; "onLookAtArticleButtonClick": "onLookAtArticleButtonClick"; "onArButtonClick": "onArButtonClick"; "onAddArticleButtonClick": "onAddArticleButtonClick"; "onArticleClick": "onArticleClick"; "onArticleClickJSON": "onArticleClickJSON"; "onStockDetailsClick": "onStockDetailsClick"; "onExternalSourceClick": "onExternalSourceClick"; }, never, never, false, never>;
1479
+ static ɵcmp: i0.ɵɵComponentDeclaration<CatalogSearchComponent, "co-catalog-search", never, { "settings": { "alias": "settings"; "required": false; }; "title": { "alias": "title"; "required": false; }; "subTitle": { "alias": "subTitle"; "required": false; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; }; "createFrozenArticle": { "alias": "createFrozenArticle"; "required": false; }; "showNavigation": { "alias": "showNavigation"; "required": false; }; "showLandingPage": { "alias": "showLandingPage"; "required": false; }; "useQuickSelProperties": { "alias": "useQuickSelProperties"; "required": false; }; "tempFilter": { "alias": "tempFilter"; "required": false; }; "popupFilter": { "alias": "popupFilter"; "required": false; }; "showViewModes": { "alias": "showViewModes"; "required": false; }; "showSorting": { "alias": "showSorting"; "required": false; }; "embedded": { "alias": "embedded"; "required": false; }; "externalSource": { "alias": "externalSource"; "required": false; }; "isReturn": { "alias": "isReturn"; "required": false; }; "currentTransactionBranchId": { "alias": "currentTransactionBranchId"; "required": false; }; "searchPresetTemplate": { "alias": "searchPresetTemplate"; "required": false; }; "generalFilterOrders": { "alias": "generalFilterOrders"; "required": false; }; "purchaseFilterOrders": { "alias": "purchaseFilterOrders"; "required": false; }; "logisticsFilterOrders": { "alias": "logisticsFilterOrders"; "required": false; }; }, { "settingsChange": "settingsChange"; "onLookAtArticleButtonClick": "onLookAtArticleButtonClick"; "onArButtonClick": "onArButtonClick"; "onAddArticleButtonClick": "onAddArticleButtonClick"; "onArticleClick": "onArticleClick"; "onArticleClickJSON": "onArticleClickJSON"; "onStockDetailsClick": "onStockDetailsClick"; "onExternalSourceClick": "onExternalSourceClick"; }, never, never, false, never>;
1465
1480
  }
1466
1481
 
1467
1482
  declare class CatalogSearchHeaderComponent {
@@ -1496,7 +1511,9 @@ declare abstract class CatalogSearchBaseComponent {
1496
1511
  selected: boolean;
1497
1512
  }>;
1498
1513
  elements: ElementRef[];
1514
+ private _observerEnabled;
1499
1515
  constructor(catalogSearchService: CatalogSearchService);
1516
+ observerEnabled(article: ArticleExtended): boolean;
1500
1517
  onPreviousClick(): void;
1501
1518
  onNextClick(): void;
1502
1519
  onPageClick(pageNr: number): void;
@@ -1691,9 +1708,48 @@ declare class CatalogSearchResultGridModule {
1691
1708
  static ɵinj: i0.ɵɵInjectorDeclaration<CatalogSearchResultGridModule>;
1692
1709
  }
1693
1710
 
1711
+ /**
1712
+ * One entry of the sort dropdown. 'description' is the field co-list-of-values
1713
+ * displays by default, so it holds the already localized label. The direction is
1714
+ * not part of it, it is toggled with the arrow next to the dropdown.
1715
+ */
1716
+ interface CatalogSortOption {
1717
+ field: ArticleSortField;
1718
+ description: string;
1719
+ }
1720
+
1721
+ declare class CatalogSortComponent {
1722
+ iconCacheService: IconCacheService;
1723
+ private _catalogSearchService;
1724
+ private _dictionary;
1725
+ readonly icons: typeof IconEnum;
1726
+ showClass: boolean;
1727
+ sortOptions: CatalogSortOption[];
1728
+ sortModel: CatalogSortOption;
1729
+ get sortField(): ArticleSortField;
1730
+ get sortDirection(): ArticleSortDirection;
1731
+ get sortDirectionIcon(): IconEnum;
1732
+ private _subs;
1733
+ constructor(iconCacheService: IconCacheService, _catalogSearchService: CatalogSearchService, _dictionary: CatalogDictionaryService);
1734
+ ngOnInit(): void;
1735
+ ngOnDestroy(): void;
1736
+ handleSortFieldChange(option: CatalogSortOption): void;
1737
+ handleSortDirectionClick(): void;
1738
+ private _buildSortOptions;
1739
+ private _selectSortOption;
1740
+ static ɵfac: i0.ɵɵFactoryDeclaration<CatalogSortComponent, never>;
1741
+ static ɵcmp: i0.ɵɵComponentDeclaration<CatalogSortComponent, "co-catalog-sort", never, {}, {}, never, never, false, never>;
1742
+ }
1743
+
1744
+ declare class CatalogSortModule {
1745
+ static ɵfac: i0.ɵɵFactoryDeclaration<CatalogSortModule, never>;
1746
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CatalogSortModule, [typeof CatalogSortComponent], [typeof i2.CommonModule, typeof i3.ButtonModule, typeof i3.ListOfValuesModule, typeof CatalogPipeModule], [typeof CatalogSortComponent]>;
1747
+ static ɵinj: i0.ɵɵInjectorDeclaration<CatalogSortModule>;
1748
+ }
1749
+
1694
1750
  declare class CatalogSearchModule {
1695
1751
  static ɵfac: i0.ɵɵFactoryDeclaration<CatalogSearchModule, never>;
1696
- static ɵmod: i0.ɵɵNgModuleDeclaration<CatalogSearchModule, [typeof CatalogSearchComponent], [typeof i2.CommonModule, typeof CatalogFilterModule, typeof CatalogSearchHeaderModule, typeof CatalogSearchResultTileModule, typeof CatalogSearchResultListModule, typeof CatalogSearchResultGridModule, typeof CatalogCategoriesModule, typeof CatalogExternalSourcesModule, typeof CatalogNavigationModule, typeof i3.IconModule, typeof i3.ButtonModule, typeof CatalogPipeModule, typeof i9.SearchPresetOverviewModule], [typeof CatalogSearchComponent]>;
1752
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CatalogSearchModule, [typeof CatalogSearchComponent], [typeof i2.CommonModule, typeof CatalogFilterModule, typeof CatalogSearchHeaderModule, typeof CatalogSearchResultTileModule, typeof CatalogSearchResultListModule, typeof CatalogSearchResultGridModule, typeof CatalogCategoriesModule, typeof CatalogExternalSourcesModule, typeof CatalogNavigationModule, typeof CatalogSortModule, typeof i3.IconModule, typeof i3.ButtonModule, typeof CatalogPipeModule, typeof i9.SearchPresetOverviewModule], [typeof CatalogSearchComponent]>;
1697
1753
  static ɵinj: i0.ɵɵInjectorDeclaration<CatalogSearchModule>;
1698
1754
  }
1699
1755
 
@@ -1928,5 +1984,5 @@ declare class CatalogNavigationService implements OnDestroy {
1928
1984
  static ɵprov: i0.ɵɵInjectableDeclaration<CatalogNavigationService>;
1929
1985
  }
1930
1986
 
1931
- 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 };
1932
- export type { Category, FilterItem, FilterOrder, OrderByInterface };
1987
+ 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 };
1988
+ export type { CatalogSortOption, Category, FilterItem, FilterOrder, OrderByInterface };
@@ -16,6 +16,11 @@
16
16
  gap: 0;
17
17
  justify-content: flex-end;
18
18
  padding: $co-catalog-search-view-modes-padding;
19
+ align-items: center;
20
+ // The sorting itself is co-catalog-sort, it only has to sit on the left here.
21
+ .co-catalog-sort {
22
+ margin-right: auto;
23
+ }
19
24
  co-button {
20
25
  width: $co-catalog-search-view-modes-button-size;
21
26
  height: $co-catalog-search-view-modes-button-size;
@@ -39,3 +39,4 @@ $co-catalog-search-view-modes-padding: 0 20px 0 0 !default;
39
39
  $co-catalog-search-view-modes-button-size: 30px !default;
40
40
  $co-catalog-search-view-modes-button-radius: 3px !default;
41
41
  $co-catalog-search-view-modes-button-background: #3e7eff !default;
42
+
@@ -0,0 +1,36 @@
1
+ @include export-module('co-catalog-sort-layout') {
2
+ .co-catalog-sort {
3
+ font-family: $co-catalog-sort-font-family;
4
+
5
+ .catalog-sort-wrapper {
6
+ display: flex;
7
+ align-items: center;
8
+ gap: $co-catalog-sort-column-gap;
9
+ padding: $co-catalog-sort-padding;
10
+ .catalog-sort-label {
11
+ font-size: $co-catalog-sort-font-size;
12
+ font-weight: $co-catalog-sort-label-font-weight;
13
+ white-space: nowrap;
14
+ }
15
+ co-list-of-values.catalog-sort-select {
16
+ co-input-text {
17
+ font-size: $co-catalog-sort-font-size;
18
+ input {
19
+ min-height: 100%;
20
+ padding: 5px 10px;
21
+ }
22
+ .input-text-clear-button {
23
+ display: none;
24
+ }
25
+ }
26
+ }
27
+ co-button.catalog-sort-direction {
28
+ cursor: pointer;
29
+ co-icon svg {
30
+ width: $co-catalog-sort-arrow-size;
31
+ height: $co-catalog-sort-arrow-size;
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,19 @@
1
+ :root {
2
+ --co-catalog-sort-font-size: 13px;
3
+ --co-catalog-sort-label-font-weight: 500;
4
+ --co-catalog-sort-column-gap: 8px;
5
+ --co-catalog-sort-padding: 0 0 0 20px;
6
+ --co-catalog-sort-select-width: 180px;
7
+ --co-catalog-sort-select-border: 1px solid #d5d9e0;
8
+ --co-catalog-sort-select-background: #FFFFFF;
9
+ --co-catalog-sort-arrow-size: 12px;
10
+ }
11
+ $co-catalog-sort-font-family: $ca-font-family !default;
12
+ $co-catalog-sort-font-size: var(--co-catalog-sort-font-size) !default;
13
+ $co-catalog-sort-label-font-weight: var(--co-catalog-sort-label-font-weight) !default;
14
+ $co-catalog-sort-column-gap: var(--co-catalog-sort-column-gap) !default;
15
+ $co-catalog-sort-padding: var(--co-catalog-sort-padding) !default;
16
+ $co-catalog-sort-select-width: var(--co-catalog-sort-select-width) !default;
17
+ $co-catalog-sort-select-border: var(--co-catalog-sort-select-border) !default;
18
+ $co-catalog-sort-select-background: var(--co-catalog-sort-select-background) !default;
19
+ $co-catalog-sort-arrow-size: var(--co-catalog-sort-arrow-size) !default;
@@ -0,0 +1,10 @@
1
+ @include export-module('co-catalog-sort-theme') {
2
+ .co-catalog-sort {
3
+ .catalog-sort-wrapper {
4
+ co-button.catalog-sort-direction {
5
+ border: $co-catalog-sort-select-border;
6
+ background-color: $co-catalog-sort-select-background;
7
+ }
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,4 @@
1
+ @import "../../../style/mixin";
2
+ @import "./_material-definition";
3
+ @import "./_layout";
4
+ @import "./_theme";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/catalog",
3
- "version": "301.1.6",
3
+ "version": "301.1.7",
4
4
  "license": "MIT",
5
5
  "description": "iOne Catalog module based on Angular 20",
6
6
  "repository": "npm/npm",