@colijnit/corecomponents_v12 12.0.91 → 12.0.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/bundles/colijnit-corecomponents_v12.umd.js +103 -1
  2. package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
  3. package/colijnit-corecomponents_v12.metadata.json +1 -1
  4. package/esm2015/lib/components/filter-item/filter-item-viewmodel.js +11 -0
  5. package/esm2015/lib/components/filter-item/filter-item.component.js +2 -2
  6. package/esm2015/lib/components/filter-item/filter-viewmodel.js +11 -0
  7. package/esm2015/lib/components/view-mode-buttons/content-view-mode.enum.js +11 -0
  8. package/esm2015/lib/components/view-mode-buttons/view-mode-buttons.component.js +61 -0
  9. package/esm2015/lib/components/view-mode-buttons/view-mode-buttons.module.js +21 -0
  10. package/esm2015/public-api.js +6 -1
  11. package/fesm2015/colijnit-corecomponents_v12.js +108 -2
  12. package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
  13. package/lib/components/filter-item/filter-item-viewmodel.d.ts +8 -0
  14. package/lib/components/filter-item/filter-item.component.d.ts +1 -1
  15. package/lib/components/filter-item/filter-viewmodel.d.ts +8 -0
  16. package/lib/components/view-mode-buttons/content-view-mode.enum.d.ts +8 -0
  17. package/lib/components/view-mode-buttons/style/_layout.scss +24 -0
  18. package/lib/components/view-mode-buttons/style/_material-definition.scss +6 -0
  19. package/lib/components/view-mode-buttons/style/_theme.scss +20 -0
  20. package/lib/components/view-mode-buttons/style/material.scss +3 -0
  21. package/lib/components/view-mode-buttons/view-mode-buttons.component.d.ts +17 -0
  22. package/lib/components/view-mode-buttons/view-mode-buttons.module.d.ts +2 -0
  23. package/package.json +1 -1
  24. package/public-api.d.ts +5 -0
  25. package/esm2015/lib/core/interface/filter-item-viewmodel.js +0 -2
  26. package/lib/core/interface/filter-item-viewmodel.d.ts +0 -7
@@ -11011,6 +11011,80 @@
11011
11011
  },] }
11012
11012
  ];
11013
11013
 
11014
+ // The different view modes for content, e.g. list, grid, ..
11015
+ exports.ContentViewMode = void 0;
11016
+ (function (ContentViewMode) {
11017
+ ContentViewMode[ContentViewMode["List"] = 0] = "List";
11018
+ ContentViewMode[ContentViewMode["Grid"] = 1] = "Grid";
11019
+ ContentViewMode[ContentViewMode["GridExpanded"] = 2] = "GridExpanded";
11020
+ ContentViewMode[ContentViewMode["MasterDetail"] = 3] = "MasterDetail";
11021
+ ContentViewMode[ContentViewMode["Timeline"] = 4] = "Timeline";
11022
+ ContentViewMode[ContentViewMode["Tiles"] = 5] = "Tiles";
11023
+ })(exports.ContentViewMode || (exports.ContentViewMode = {}));
11024
+
11025
+ var ViewModeButtonsComponent = /** @class */ (function () {
11026
+ function ViewModeButtonsComponent(iconCacheService) {
11027
+ this.iconCacheService = iconCacheService;
11028
+ this.icons = exports.CoreComponentsIcon;
11029
+ this.viewModes = exports.ContentViewMode;
11030
+ this.showViewModes = [this.viewModes.List, this.viewModes.Grid, this.viewModes.Tiles];
11031
+ this.viewModeChange = new i0.EventEmitter();
11032
+ }
11033
+ ViewModeButtonsComponent.prototype.showClass = function () {
11034
+ return true;
11035
+ };
11036
+ Object.defineProperty(ViewModeButtonsComponent.prototype, "activeViewMode", {
11037
+ get: function () {
11038
+ return this._activeViewMode;
11039
+ },
11040
+ set: function (value) {
11041
+ this._activeViewMode = value;
11042
+ this.viewModeChange.emit(this._activeViewMode);
11043
+ },
11044
+ enumerable: false,
11045
+ configurable: true
11046
+ });
11047
+ ViewModeButtonsComponent.prototype.ngOnInit = function () {
11048
+ this.activeViewMode = this.showViewModes.includes(exports.ContentViewMode.List) ? exports.ContentViewMode.List : this.showViewModes[0];
11049
+ };
11050
+ return ViewModeButtonsComponent;
11051
+ }());
11052
+ ViewModeButtonsComponent.decorators = [
11053
+ { type: i0.Component, args: [{
11054
+ selector: 'co-view-mode-buttons',
11055
+ template: "\n <co-button class=\"view-button white\"\n *ngIf=\"showViewModes.includes(viewModes.Tiles)\"\n [class.selected]=\"this.activeViewMode === viewModes.Tiles\"\n [iconData]=\"iconCacheService.getIcon(icons.ListView)\"\n [title]=\"'TILE_VIEW'\"\n (click)=\"this.activeViewMode = viewModes.Tiles\"></co-button>\n <co-button class=\"view-button white\"\n *ngIf=\"showViewModes.includes(viewModes.List)\"\n [class.selected]=\"this.activeViewMode === viewModes.List\"\n [iconData]=\"iconCacheService.getIcon(icons.ThickLines)\"\n [title]=\"'LIST_VIEW'\"\n (click)=\"this.activeViewMode = viewModes.List\"></co-button>\n <co-button class=\"view-button white\"\n *ngIf=\"showViewModes.includes(viewModes.Grid)\"\n [class.selected]=\"this.activeViewMode === viewModes.Grid\"\n [iconData]=\"iconCacheService.getIcon(icons.ThinLines)\"\n [title]=\"'GRID_VIEW'\"\n (click)=\"this.activeViewMode = viewModes.Grid\"></co-button>\n ",
11056
+ encapsulation: i0.ViewEncapsulation.None
11057
+ },] }
11058
+ ];
11059
+ ViewModeButtonsComponent.ctorParameters = function () { return [
11060
+ { type: IconCacheService }
11061
+ ]; };
11062
+ ViewModeButtonsComponent.propDecorators = {
11063
+ showViewModes: [{ type: i0.Input }],
11064
+ viewModeChange: [{ type: i0.Output }],
11065
+ showClass: [{ type: i0.HostBinding, args: ["class.co-view-mode-buttons",] }]
11066
+ };
11067
+
11068
+ var ViewModeButtonsModule = /** @class */ (function () {
11069
+ function ViewModeButtonsModule() {
11070
+ }
11071
+ return ViewModeButtonsModule;
11072
+ }());
11073
+ ViewModeButtonsModule.decorators = [
11074
+ { type: i0.NgModule, args: [{
11075
+ imports: [
11076
+ common.CommonModule,
11077
+ ButtonModule,
11078
+ ],
11079
+ declarations: [
11080
+ ViewModeButtonsComponent
11081
+ ],
11082
+ exports: [
11083
+ ViewModeButtonsComponent
11084
+ ]
11085
+ },] }
11086
+ ];
11087
+
11014
11088
  var FilterPipe = /** @class */ (function () {
11015
11089
  function FilterPipe() {
11016
11090
  }
@@ -11178,7 +11252,7 @@
11178
11252
  FilterItemComponent.decorators = [
11179
11253
  { type: i0.Component, args: [{
11180
11254
  selector: "co-filter-item",
11181
- template: "\n <div class=\"co-filter-item-header\">\n <co-collapsible\n [headerTitle]=\"placeholder\"\n [expandButtonLast]=\"true\"\n [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"\n [expanded]=\"expanded\"\n [showButton]=\"showButton\"\n [buttonText]=\"filterButtonLabel\"\n (buttonClicked)=\"onButtonClicked()\"\n >\n <div class=\"co-filter-item-collapsable-content\">\n <div class=\"co-filter-item-custom-content\" *ngIf=\"customContent; else collectionContent\"\n (keydown)=\"showButton=true\" (click)=\"showButton=true\">\n <ng-content></ng-content>\n </div>\n <ng-template #collectionContent>\n <div class=\"co-filter-item-collection-content\">\n <co-input-text\n *ngIf=\"collection?.length > 10 || minSearchCharsToLoadCollection\"\n [placeholder]=\"searchPlaceholder\"\n [model]=\"filterText\"\n (modelChange)=\"applyFilter($event)\"\n >\n </co-input-text>\n <div class=\"no-results\" *ngIf=\"filteredCollection?.length === 0\">\n <span [textContent]=\"noResultsLabel\"></span>\n </div>\n <div class=\"co-filter-item-collection-results\">\n <ng-container\n *ngFor=\"let option of filteredCollection; let index = index\">\n <div class=\"co-filter-item-collection-result-item\" *ngIf=\"index < limitTo || showAllResults\">\n <co-input-checkbox *ngIf=\"!singleSelect\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n [clickableLabel]=\"false\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-checkbox>\n <co-input-radio-button *ngIf=\"singleSelect\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-radio-button>\n <div class=\"co-filter-item-amount\" *ngIf=\"option.count\"\n [textContent]=\"option.count.toString() | append: ')' | prepend: ' ('\"\n ></div>\n </div>\n\n </ng-container>\n </div>\n <div class=\"co-filter-show-more-or-less\" *ngIf=\"!showAllResults\">\n <div class=\"co-filter-show-more clickable\"\n *ngIf=\"moreToShow()\">\n <a (click)=\"increaseLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"></co-icon>\n <span [textContent]=\"showMoreLabel\"></span>\n </a>\n </div>\n <div class=\"co-filter-show-less clickable\"\n *ngIf=\"lessToShow()\">\n <a (click)=\"setToInitialLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointUp)\"></co-icon>\n <span [textContent]=\"showLessLabel\"></span>\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </co-collapsible>\n </div>\n\n ",
11255
+ template: "\n <div class=\"co-filter-item-header\">\n <co-collapsible\n [headerTitle]=\"placeholder\"\n [expandButtonLast]=\"true\"\n [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"\n [expanded]=\"expanded\"\n [showButton]=\"showButton\"\n [buttonText]=\"filterButtonLabel\"\n (buttonClicked)=\"onButtonClicked()\"\n >\n <div class=\"co-filter-item-collapsable-content\">\n <div class=\"co-filter-item-custom-content\" *ngIf=\"customContent; else collectionContent\"\n (keydown)=\"showButton=true\" (mousedown)=\"showButton=true\">\n <ng-content></ng-content>\n </div>\n <ng-template #collectionContent>\n <div class=\"co-filter-item-collection-content\">\n <co-input-text\n *ngIf=\"collection?.length > 10 || minSearchCharsToLoadCollection\"\n [placeholder]=\"searchPlaceholder\"\n [model]=\"filterText\"\n (modelChange)=\"applyFilter($event)\"\n >\n </co-input-text>\n <div class=\"no-results\" *ngIf=\"filteredCollection?.length === 0\">\n <span [textContent]=\"noResultsLabel\"></span>\n </div>\n <div class=\"co-filter-item-collection-results\">\n <ng-container\n *ngFor=\"let option of filteredCollection; let index = index\">\n <div class=\"co-filter-item-collection-result-item\" *ngIf=\"index < limitTo || showAllResults\">\n <co-input-checkbox *ngIf=\"!singleSelect\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n [clickableLabel]=\"false\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-checkbox>\n <co-input-radio-button *ngIf=\"singleSelect\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-radio-button>\n <div class=\"co-filter-item-amount\" *ngIf=\"option.count\"\n [textContent]=\"option.count.toString() | append: ')' | prepend: ' ('\"\n ></div>\n </div>\n\n </ng-container>\n </div>\n <div class=\"co-filter-show-more-or-less\" *ngIf=\"!showAllResults\">\n <div class=\"co-filter-show-more clickable\"\n *ngIf=\"moreToShow()\">\n <a (click)=\"increaseLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"></co-icon>\n <span [textContent]=\"showMoreLabel\"></span>\n </a>\n </div>\n <div class=\"co-filter-show-less clickable\"\n *ngIf=\"lessToShow()\">\n <a (click)=\"setToInitialLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointUp)\"></co-icon>\n <span [textContent]=\"showLessLabel\"></span>\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </co-collapsible>\n </div>\n\n ",
11182
11256
  encapsulation: i0.ViewEncapsulation.None
11183
11257
  },] }
11184
11258
  ];
@@ -11625,6 +11699,30 @@
11625
11699
  },] }
11626
11700
  ];
11627
11701
 
11702
+ var FilterItemViewmodel = /** @class */ (function () {
11703
+ function FilterItemViewmodel(code, description, checked, count, valueName) {
11704
+ this.checked = false;
11705
+ this.code = code;
11706
+ this.description = description === null || description === void 0 ? void 0 : description.toString();
11707
+ this.checked = checked;
11708
+ this.count = count;
11709
+ this.valueName = valueName;
11710
+ }
11711
+ return FilterItemViewmodel;
11712
+ }());
11713
+
11714
+ var FilterViewmodel = /** @class */ (function () {
11715
+ function FilterViewmodel(collection, fields) {
11716
+ var _this = this;
11717
+ this.filterItems = [];
11718
+ collection.forEach(function (item) {
11719
+ var _a, _b, _c;
11720
+ _this.filterItems.push(new FilterItemViewmodel(item[fields.value], item[fields.text], (_a = item.checked) !== null && _a !== void 0 ? _a : false, (_b = item.count) !== null && _b !== void 0 ? _b : null, (_c = item.valueName) !== null && _c !== void 0 ? _c : null));
11721
+ });
11722
+ }
11723
+ return FilterViewmodel;
11724
+ }());
11725
+
11628
11726
  /*
11629
11727
  * Public API Surface of corecomponents
11630
11728
  */
@@ -11676,8 +11774,10 @@
11676
11774
  exports.DropDownModule = DropDownModule;
11677
11775
  exports.FilterItemComponent = FilterItemComponent;
11678
11776
  exports.FilterItemModule = FilterItemModule;
11777
+ exports.FilterItemViewmodel = FilterItemViewmodel;
11679
11778
  exports.FilterPipe = FilterPipe;
11680
11779
  exports.FilterPipeModule = FilterPipeModule;
11780
+ exports.FilterViewmodel = FilterViewmodel;
11681
11781
  exports.FormComponent = FormComponent;
11682
11782
  exports.FormMasterService = FormMasterService;
11683
11783
  exports.FormModule = FormModule;
@@ -11737,6 +11837,8 @@
11737
11837
  exports.TextInputPopupComponent = TextInputPopupComponent;
11738
11838
  exports.TileComponent = TileComponent;
11739
11839
  exports.TileModule = TileModule;
11840
+ exports.ViewModeButtonsComponent = ViewModeButtonsComponent;
11841
+ exports.ViewModeButtonsModule = ViewModeButtonsModule;
11740
11842
  exports.showHideDialogAnimation = showHideDialogAnimation;
11741
11843
  exports["ɵa"] = RippleModule;
11742
11844
  exports["ɵb"] = MD_RIPPLE_GLOBAL_OPTIONS;