@porscheinformatik/clr-addons 12.4.1 → 12.5.1
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/clr-addons.module.d.ts +2 -1
- package/datagrid-state-persistence/column-hidden-state-persistence.directive.d.ts +17 -0
- package/datagrid-state-persistence/datagrid-field.directive.d.ts +6 -0
- package/datagrid-state-persistence/datagrid-state-persistence.module.d.ts +9 -0
- package/datagrid-state-persistence/index.d.ts +4 -0
- package/datagrid-state-persistence/state-persistence-key.directive.d.ts +6 -0
- package/dropdown/clr-dropdown-overflow.directive.d.ts +10 -5
- package/esm2020/clr-addons.module.mjs +7 -3
- package/esm2020/datagrid-state-persistence/column-hidden-state-persistence.directive.mjs +74 -0
- package/esm2020/datagrid-state-persistence/datagrid-field.directive.mjs +15 -0
- package/esm2020/datagrid-state-persistence/datagrid-state-persistence.module.mjs +18 -0
- package/esm2020/datagrid-state-persistence/index.mjs +5 -0
- package/esm2020/datagrid-state-persistence/state-persistence-key.directive.mjs +15 -0
- package/esm2020/dropdown/clr-dropdown-overflow.directive.mjs +40 -7
- package/esm2020/index.mjs +2 -1
- package/esm2020/location-bar/location-bar-node/location-bar-node.component.mjs +3 -3
- package/fesm2015/clr-addons.mjs +155 -12
- package/fesm2015/clr-addons.mjs.map +1 -1
- package/fesm2020/clr-addons.mjs +150 -12
- package/fesm2020/clr-addons.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/location-bar/location-bar-node/location-bar-node.component.scss +3 -2
- package/styles/clr-addons-phs.css +3 -2
- package/styles/clr-addons-phs.css.map +1 -1
- package/styles/clr-addons-phs.min.css +1 -1
- package/styles/clr-addons-phs.min.css.map +1 -1
package/fesm2020/clr-addons.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, NgModule, Injectable, EventEmitter, Input, Output, Directive, ViewChild,
|
|
2
|
+
import { Component, NgModule, Injectable, EventEmitter, Input, Output, Directive, ViewChild, ContentChildren, TemplateRef, ViewChildren, HostBinding, ElementRef, Renderer2, forwardRef, ContentChild, HostListener, InjectionToken, Inject, Optional } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
5
5
|
import * as i3$1 from '@angular/forms';
|
|
6
6
|
import { FormsModule, NG_VALIDATORS, NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
7
|
import * as i1 from '@clr/angular';
|
|
8
|
-
import { ClarityModule, ClrFormsModule, ClrForm, ClrAlert, ClrAxis, ClrSide, ClrAlignment, ClrPopoverToggleService, ClrPopoverEventsService, ClrPopoverPositionService, ClrIconModule, ClrDropdownModule } from '@clr/angular';
|
|
8
|
+
import { ClarityModule, ClrFormsModule, ClrDropdown, ClrForm, ClrAlert, ClrAxis, ClrSide, ClrAlignment, ClrPopoverToggleService, ClrPopoverEventsService, ClrPopoverPositionService, ClrIconModule, ClrDropdownModule } from '@clr/angular';
|
|
9
9
|
import { Subject, BehaviorSubject, timer, asyncScheduler, interval, of, ReplaySubject, takeUntil as takeUntil$1 } from 'rxjs';
|
|
10
10
|
import { takeUntil, observeOn, take } from 'rxjs/operators';
|
|
11
11
|
import * as i3 from '@angular/router';
|
|
@@ -645,22 +645,49 @@ class ClrDropdownOverflowDirective {
|
|
|
645
645
|
this.elRef = elRef;
|
|
646
646
|
this.defaultItemMinHeightRem = 1.5;
|
|
647
647
|
this.marginBottomRem = 0.1;
|
|
648
|
+
this.destroy$ = new Subject();
|
|
648
649
|
}
|
|
649
|
-
|
|
650
|
-
|
|
650
|
+
ngAfterContentInit() {
|
|
651
|
+
// first trigger manually because the subscription lower only triggers after first change
|
|
652
|
+
if (!this.nestedDropdownChildren?.length) {
|
|
653
|
+
this.applyDropdownOverflowStyles();
|
|
654
|
+
}
|
|
655
|
+
this.nestedDropdownChildren.changes.pipe(takeUntil(this.destroy$)).subscribe((children) => {
|
|
656
|
+
// if there are any nested dropdowns, our overflow fix prevents those from showing and needs to be removed
|
|
657
|
+
if (!children?.length) {
|
|
658
|
+
this.applyDropdownOverflowStyles();
|
|
659
|
+
}
|
|
660
|
+
else if (children?.length) {
|
|
661
|
+
this.removeDropdownOverflowStyles();
|
|
662
|
+
}
|
|
663
|
+
});
|
|
651
664
|
}
|
|
652
|
-
|
|
665
|
+
ngOnDestroy() {
|
|
666
|
+
this.destroy$.next();
|
|
667
|
+
this.destroy$.complete();
|
|
668
|
+
}
|
|
669
|
+
applyDropdownOverflowStyles() {
|
|
653
670
|
// the vertical position of our element in the current window
|
|
654
671
|
const y = this.elRef.nativeElement.getBoundingClientRect().y;
|
|
655
672
|
const itemMinHeightPx = this.getItemMinHeight(this.clrDropdownMenuItemMinHeight);
|
|
656
673
|
// see https://stackoverflow.com/questions/22754315/for-loop-for-htmlcollection-elements
|
|
657
|
-
for (const item of this.
|
|
674
|
+
for (const item of this.getAllChildDropdownMenuItems()) {
|
|
658
675
|
item.style.minHeight = itemMinHeightPx + 'px';
|
|
659
676
|
}
|
|
660
677
|
this.elRef.nativeElement.style.maxHeight =
|
|
661
678
|
this.getMenuMaxHeight(this.clrDropdownMenuMaxHeight, window.innerHeight - y - this.convertRemToPixels(this.marginBottomRem)) + 'px';
|
|
662
679
|
this.elRef.nativeElement.style.overflowY = 'auto';
|
|
663
680
|
}
|
|
681
|
+
removeDropdownOverflowStyles() {
|
|
682
|
+
for (const item of this.getAllChildDropdownMenuItems()) {
|
|
683
|
+
item.style.minHeight = null;
|
|
684
|
+
}
|
|
685
|
+
this.elRef.nativeElement.style.maxHeight = null;
|
|
686
|
+
this.elRef.nativeElement.style.overflowY = null;
|
|
687
|
+
}
|
|
688
|
+
getAllChildDropdownMenuItems() {
|
|
689
|
+
return this.elRef.nativeElement.getElementsByClassName('dropdown-item');
|
|
690
|
+
}
|
|
664
691
|
getMenuMaxHeight(menuMaxHeightProvided, menuMaxHeightPx) {
|
|
665
692
|
if (menuMaxHeightProvided) {
|
|
666
693
|
const maxHeightPx = this.convertToPixels(menuMaxHeightProvided);
|
|
@@ -698,7 +725,7 @@ class ClrDropdownOverflowDirective {
|
|
|
698
725
|
}
|
|
699
726
|
}
|
|
700
727
|
ClrDropdownOverflowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDropdownOverflowDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
701
|
-
ClrDropdownOverflowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: ClrDropdownOverflowDirective, selector: "clr-dropdown-menu", inputs: { clrDropdownMenuMaxHeight: "clrDropdownMenuMaxHeight", clrDropdownMenuItemMinHeight: "clrDropdownMenuItemMinHeight" }, ngImport: i0 });
|
|
728
|
+
ClrDropdownOverflowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: ClrDropdownOverflowDirective, selector: "clr-dropdown-menu", inputs: { clrDropdownMenuMaxHeight: "clrDropdownMenuMaxHeight", clrDropdownMenuItemMinHeight: "clrDropdownMenuItemMinHeight" }, queries: [{ propertyName: "nestedDropdownChildren", predicate: ClrDropdown, descendants: true }], ngImport: i0 });
|
|
702
729
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDropdownOverflowDirective, decorators: [{
|
|
703
730
|
type: Directive,
|
|
704
731
|
args: [{ selector: 'clr-dropdown-menu' }]
|
|
@@ -706,6 +733,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
706
733
|
type: Input
|
|
707
734
|
}], clrDropdownMenuItemMinHeight: [{
|
|
708
735
|
type: Input
|
|
736
|
+
}], nestedDropdownChildren: [{
|
|
737
|
+
type: ContentChildren,
|
|
738
|
+
args: [ClrDropdown, { descendants: true }]
|
|
709
739
|
}] } });
|
|
710
740
|
|
|
711
741
|
/*
|
|
@@ -4444,10 +4474,10 @@ class LocationBarNodeComponent {
|
|
|
4444
4474
|
}
|
|
4445
4475
|
}
|
|
4446
4476
|
LocationBarNodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: LocationBarNodeComponent, deps: [{ token: CONTENT_PROVIDER, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
4447
|
-
LocationBarNodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: LocationBarNodeComponent, selector: "clr-location-bar-node", inputs: { parentNode: "parentNode" }, outputs: { selectionChanged: "selectionChanged" }, host: { properties: { "class.location-bar-node": "true" } }, ngImport: i0, template: "<ng-container *ngIf=\"parentNode\">\n <ng-content *ngIf=\"parentNode.getChildren()?.length > 0\"></ng-content>\n\n <ng-container\n *ngIf=\"\n (selectableChilds.length > 0 && !parentNode.getSelectedChild()) || selectableChilds.length > 1;\n else singleSelected\n \"\n >\n <clr-dropdown>\n <button class=\"btn btn-link btn-sm\" (blur)=\"focus = false\" (focus)=\"focus = true\" clrDropdownTrigger>\n <ng-container *ngIf=\"parentNode.getSelectedChild() as node; else unselected\">\n <span
|
|
4477
|
+
LocationBarNodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: LocationBarNodeComponent, selector: "clr-location-bar-node", inputs: { parentNode: "parentNode" }, outputs: { selectionChanged: "selectionChanged" }, host: { properties: { "class.location-bar-node": "true" } }, ngImport: i0, template: "<ng-container *ngIf=\"parentNode\">\n <ng-content *ngIf=\"parentNode.getChildren()?.length > 0\"></ng-content>\n\n <ng-container\n *ngIf=\"\n (selectableChilds.length > 0 && !parentNode.getSelectedChild()) || selectableChilds.length > 1;\n else singleSelected\n \"\n >\n <clr-dropdown>\n <button class=\"btn btn-link btn-sm\" (blur)=\"focus = false\" (focus)=\"focus = true\" clrDropdownTrigger>\n <ng-container *ngIf=\"parentNode.getSelectedChild() as node; else unselected\">\n <span\n class=\"text-truncate\"\n [class.last-level]=\"!parentNode.getSelectedChild().getSelectedChild()\"\n title=\"{{ node.label }}\"\n >\n {{ node.label }}\n </span>\n <cds-icon shape=\"angle\" direction=\"down\" size=\"xs\" class=\"caret-icon\"></cds-icon>\n </ng-container>\n <ng-template #unselected>\n <cds-icon class=\"unselected\" size=\"18\" [attr.solid]=\"focus\" shape=\"tree-view\"></cds-icon> ...\n </ng-template>\n </button>\n <clr-dropdown-menu [clrPosition]=\"'bottom-left'\" *clrIfOpen>\n <button\n *ngFor=\"let item of selectableChilds\"\n type=\"button\"\n clrDropdownItem\n class=\"text-truncate\"\n [class.selected-child]=\"item.id === parentNode.getSelectedChild()?.id\"\n (click)=\"selectNode(item)\"\n title=\"{{ item.label }}\"\n >\n {{ item.label }}\n </button>\n </clr-dropdown-menu>\n </clr-dropdown>\n </ng-container>\n\n <ng-template #singleSelected>\n <ng-container *ngIf=\"parentNode.getSelectedChild()\">\n <ng-container *ngIf=\"parentNode.getSelectedChild().selectable; else unselectable\">\n <button\n class=\"btn btn-link btn-sm\"\n (click)=\"selectNode(parentNode.getSelectedChild())\"\n [class.last-level]=\"!parentNode.getSelectedChild().getSelectedChild()\"\n title=\"{{ parentNode.getSelectedChild().label }}\"\n >\n {{ parentNode.getSelectedChild().label }}\n </button>\n </ng-container>\n <ng-template #unselectable>\n <span\n class=\"unselectable-node text-truncate\"\n [class.last-level]=\"!parentNode.getSelectedChild().getSelectedChild()\"\n title=\"{{ parentNode.getSelectedChild().label }}\"\n >\n {{ parentNode.getSelectedChild().label }}\n </span>\n </ng-template>\n </ng-container>\n </ng-template>\n\n <clr-location-bar-node\n *ngIf=\"parentNode.getSelectedChild() && parentNode.getChildren().length > 0\"\n [parentNode]=\"parentNode.getSelectedChild()\"\n (selectionChanged)=\"onSelectionChanged($event)\"\n >\n <span>/</span>\n </clr-location-bar-node>\n</ng-container>\n", components: [{ type: i1.ClrDropdown, selector: "clr-dropdown", inputs: ["clrCloseMenuOnItemClick"] }, { type: i1.ClrDropdownMenu, selector: "clr-dropdown-menu", inputs: ["clrPosition"] }, { type: LocationBarNodeComponent, selector: "clr-location-bar-node", inputs: ["parentNode"], outputs: ["selectionChanged"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ClrDropdownTrigger, selector: "[clrDropdownTrigger],[clrDropdownToggle]" }, { type: i1.CdsIconCustomTag, selector: "cds-icon" }, { type: i1.ClrIfOpen, selector: "[clrIfOpen]", inputs: ["clrIfOpen"], outputs: ["clrIfOpenChange"] }, { type: ClrDropdownOverflowDirective, selector: "clr-dropdown-menu", inputs: ["clrDropdownMenuMaxHeight", "clrDropdownMenuItemMinHeight"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.ClrDropdownItem, selector: "[clrDropdownItem]", inputs: ["clrDisabled", "disabled", "id"] }] });
|
|
4448
4478
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: LocationBarNodeComponent, decorators: [{
|
|
4449
4479
|
type: Component,
|
|
4450
|
-
args: [{ selector: 'clr-location-bar-node', host: { '[class.location-bar-node]': 'true' }, template: "<ng-container *ngIf=\"parentNode\">\n <ng-content *ngIf=\"parentNode.getChildren()?.length > 0\"></ng-content>\n\n <ng-container\n *ngIf=\"\n (selectableChilds.length > 0 && !parentNode.getSelectedChild()) || selectableChilds.length > 1;\n else singleSelected\n \"\n >\n <clr-dropdown>\n <button class=\"btn btn-link btn-sm\" (blur)=\"focus = false\" (focus)=\"focus = true\" clrDropdownTrigger>\n <ng-container *ngIf=\"parentNode.getSelectedChild() as node; else unselected\">\n <span
|
|
4480
|
+
args: [{ selector: 'clr-location-bar-node', host: { '[class.location-bar-node]': 'true' }, template: "<ng-container *ngIf=\"parentNode\">\n <ng-content *ngIf=\"parentNode.getChildren()?.length > 0\"></ng-content>\n\n <ng-container\n *ngIf=\"\n (selectableChilds.length > 0 && !parentNode.getSelectedChild()) || selectableChilds.length > 1;\n else singleSelected\n \"\n >\n <clr-dropdown>\n <button class=\"btn btn-link btn-sm\" (blur)=\"focus = false\" (focus)=\"focus = true\" clrDropdownTrigger>\n <ng-container *ngIf=\"parentNode.getSelectedChild() as node; else unselected\">\n <span\n class=\"text-truncate\"\n [class.last-level]=\"!parentNode.getSelectedChild().getSelectedChild()\"\n title=\"{{ node.label }}\"\n >\n {{ node.label }}\n </span>\n <cds-icon shape=\"angle\" direction=\"down\" size=\"xs\" class=\"caret-icon\"></cds-icon>\n </ng-container>\n <ng-template #unselected>\n <cds-icon class=\"unselected\" size=\"18\" [attr.solid]=\"focus\" shape=\"tree-view\"></cds-icon> ...\n </ng-template>\n </button>\n <clr-dropdown-menu [clrPosition]=\"'bottom-left'\" *clrIfOpen>\n <button\n *ngFor=\"let item of selectableChilds\"\n type=\"button\"\n clrDropdownItem\n class=\"text-truncate\"\n [class.selected-child]=\"item.id === parentNode.getSelectedChild()?.id\"\n (click)=\"selectNode(item)\"\n title=\"{{ item.label }}\"\n >\n {{ item.label }}\n </button>\n </clr-dropdown-menu>\n </clr-dropdown>\n </ng-container>\n\n <ng-template #singleSelected>\n <ng-container *ngIf=\"parentNode.getSelectedChild()\">\n <ng-container *ngIf=\"parentNode.getSelectedChild().selectable; else unselectable\">\n <button\n class=\"btn btn-link btn-sm\"\n (click)=\"selectNode(parentNode.getSelectedChild())\"\n [class.last-level]=\"!parentNode.getSelectedChild().getSelectedChild()\"\n title=\"{{ parentNode.getSelectedChild().label }}\"\n >\n {{ parentNode.getSelectedChild().label }}\n </button>\n </ng-container>\n <ng-template #unselectable>\n <span\n class=\"unselectable-node text-truncate\"\n [class.last-level]=\"!parentNode.getSelectedChild().getSelectedChild()\"\n title=\"{{ parentNode.getSelectedChild().label }}\"\n >\n {{ parentNode.getSelectedChild().label }}\n </span>\n </ng-template>\n </ng-container>\n </ng-template>\n\n <clr-location-bar-node\n *ngIf=\"parentNode.getSelectedChild() && parentNode.getChildren().length > 0\"\n [parentNode]=\"parentNode.getSelectedChild()\"\n (selectionChanged)=\"onSelectionChanged($event)\"\n >\n <span>/</span>\n </clr-location-bar-node>\n</ng-container>\n" }]
|
|
4451
4481
|
}], ctorParameters: function () { return [{ type: LocationBarContentProvider, decorators: [{
|
|
4452
4482
|
type: Inject,
|
|
4453
4483
|
args: [CONTENT_PROVIDER]
|
|
@@ -4562,6 +4592,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
4562
4592
|
}]
|
|
4563
4593
|
}] });
|
|
4564
4594
|
|
|
4595
|
+
class DatagridFieldDirective {
|
|
4596
|
+
}
|
|
4597
|
+
DatagridFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: DatagridFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4598
|
+
DatagridFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: DatagridFieldDirective, selector: "[clrDgField]", inputs: { clrDgField: "clrDgField" }, ngImport: i0 });
|
|
4599
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: DatagridFieldDirective, decorators: [{
|
|
4600
|
+
type: Directive,
|
|
4601
|
+
args: [{
|
|
4602
|
+
selector: '[clrDgField]',
|
|
4603
|
+
}]
|
|
4604
|
+
}], propDecorators: { clrDgField: [{
|
|
4605
|
+
type: Input
|
|
4606
|
+
}] } });
|
|
4607
|
+
|
|
4608
|
+
class StatePersistenceKeyDirective {
|
|
4609
|
+
}
|
|
4610
|
+
StatePersistenceKeyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: StatePersistenceKeyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4611
|
+
StatePersistenceKeyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: StatePersistenceKeyDirective, selector: "[clrStatePersistenceKey]", inputs: { clrStatePersistenceKey: "clrStatePersistenceKey" }, ngImport: i0 });
|
|
4612
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: StatePersistenceKeyDirective, decorators: [{
|
|
4613
|
+
type: Directive,
|
|
4614
|
+
args: [{
|
|
4615
|
+
selector: '[clrStatePersistenceKey]',
|
|
4616
|
+
}]
|
|
4617
|
+
}], propDecorators: { clrStatePersistenceKey: [{
|
|
4618
|
+
type: Input
|
|
4619
|
+
}] } });
|
|
4620
|
+
|
|
4621
|
+
class ColumnHiddenStatePersistenceDirective {
|
|
4622
|
+
constructor(columnDirective, statePersistenceKey, datagrid, hideableColumnDirective) {
|
|
4623
|
+
this.columnDirective = columnDirective;
|
|
4624
|
+
this.statePersistenceKey = statePersistenceKey;
|
|
4625
|
+
this.datagrid = datagrid;
|
|
4626
|
+
this.hideableColumnDirective = hideableColumnDirective;
|
|
4627
|
+
}
|
|
4628
|
+
ngOnInit() {
|
|
4629
|
+
if (this.statePersistenceKey?.clrStatePersistenceKey && this.columnDirective?.clrDgField) {
|
|
4630
|
+
/* set hidden states from local storage (if existing) */
|
|
4631
|
+
this.initHiddenState();
|
|
4632
|
+
/* listen to state changes and persist in local storage */
|
|
4633
|
+
this.hideableColumnDirective.hiddenChange.subscribe(hidden => {
|
|
4634
|
+
this.setHiddenState(hidden);
|
|
4635
|
+
});
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4638
|
+
initHiddenState() {
|
|
4639
|
+
/* read grid state if existing */
|
|
4640
|
+
const persistedGridStateJson = localStorage.getItem(this.statePersistenceKey.clrStatePersistenceKey);
|
|
4641
|
+
if (persistedGridStateJson !== null) {
|
|
4642
|
+
const persistedGridState = JSON.parse(persistedGridStateJson);
|
|
4643
|
+
/* read column state if existing */
|
|
4644
|
+
const persistedColumnState = persistedGridState[this.columnDirective.clrDgField];
|
|
4645
|
+
if (persistedColumnState) {
|
|
4646
|
+
/* read column hidden state if existing */
|
|
4647
|
+
const persistedColumnHiddenState = persistedColumnState.hidden;
|
|
4648
|
+
if (persistedColumnHiddenState) {
|
|
4649
|
+
this.hideableColumnDirective.clrDgHidden = persistedColumnHiddenState === true;
|
|
4650
|
+
}
|
|
4651
|
+
}
|
|
4652
|
+
}
|
|
4653
|
+
}
|
|
4654
|
+
setHiddenState(hidden) {
|
|
4655
|
+
if (!this.datagrid?.detailService?.isOpen) {
|
|
4656
|
+
/* read grid state if existing */
|
|
4657
|
+
const persistedGridStateJson = localStorage.getItem(this.statePersistenceKey.clrStatePersistenceKey);
|
|
4658
|
+
let persistedGridState = {};
|
|
4659
|
+
if (persistedGridStateJson !== null) {
|
|
4660
|
+
persistedGridState = JSON.parse(persistedGridStateJson);
|
|
4661
|
+
}
|
|
4662
|
+
/* read column state if existing */
|
|
4663
|
+
let persistedColumnState = persistedGridState[this.columnDirective.clrDgField];
|
|
4664
|
+
if (!persistedColumnState) {
|
|
4665
|
+
persistedColumnState = {};
|
|
4666
|
+
persistedGridState[this.columnDirective.clrDgField] = persistedColumnState;
|
|
4667
|
+
}
|
|
4668
|
+
/* set column hidden state and persist in local storage */
|
|
4669
|
+
persistedColumnState.hidden = hidden;
|
|
4670
|
+
localStorage.setItem(this.statePersistenceKey.clrStatePersistenceKey, JSON.stringify(persistedGridState));
|
|
4671
|
+
}
|
|
4672
|
+
}
|
|
4673
|
+
}
|
|
4674
|
+
ColumnHiddenStatePersistenceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ColumnHiddenStatePersistenceDirective, deps: [{ token: DatagridFieldDirective, optional: true }, { token: StatePersistenceKeyDirective, optional: true }, { token: i1.ClrDatagrid }, { token: i1.ClrDatagridHideableColumn }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4675
|
+
ColumnHiddenStatePersistenceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: ColumnHiddenStatePersistenceDirective, selector: "[clrDgHideableColumn]", ngImport: i0 });
|
|
4676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ColumnHiddenStatePersistenceDirective, decorators: [{
|
|
4677
|
+
type: Directive,
|
|
4678
|
+
args: [{
|
|
4679
|
+
selector: '[clrDgHideableColumn]',
|
|
4680
|
+
}]
|
|
4681
|
+
}], ctorParameters: function () { return [{ type: DatagridFieldDirective, decorators: [{
|
|
4682
|
+
type: Optional
|
|
4683
|
+
}] }, { type: StatePersistenceKeyDirective, decorators: [{
|
|
4684
|
+
type: Optional
|
|
4685
|
+
}] }, { type: i1.ClrDatagrid }, { type: i1.ClrDatagridHideableColumn }]; } });
|
|
4686
|
+
|
|
4687
|
+
class ClrDatagridStatePersistenceModule {
|
|
4688
|
+
}
|
|
4689
|
+
ClrDatagridStatePersistenceModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4690
|
+
ClrDatagridStatePersistenceModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule, declarations: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective], exports: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective] });
|
|
4691
|
+
ClrDatagridStatePersistenceModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule });
|
|
4692
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule, decorators: [{
|
|
4693
|
+
type: NgModule,
|
|
4694
|
+
args: [{
|
|
4695
|
+
declarations: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective],
|
|
4696
|
+
exports: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective],
|
|
4697
|
+
}]
|
|
4698
|
+
}] });
|
|
4699
|
+
|
|
4565
4700
|
/*
|
|
4566
4701
|
* Copyright (c) 2018-2022 Porsche Informatik. All Rights Reserved.
|
|
4567
4702
|
* This software is released under MIT license.
|
|
@@ -4596,7 +4731,8 @@ ClrAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
4596
4731
|
ClrBrandAvatarModule,
|
|
4597
4732
|
ClrLocationBarModule,
|
|
4598
4733
|
ClrFormModule,
|
|
4599
|
-
ClrDropdownOverflowModule
|
|
4734
|
+
ClrDropdownOverflowModule,
|
|
4735
|
+
ClrDatagridStatePersistenceModule] });
|
|
4600
4736
|
ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrAddonsModule, imports: [ClrViewEditSectionModule,
|
|
4601
4737
|
ClrPagerModule,
|
|
4602
4738
|
ClrDotPagerModule,
|
|
@@ -4623,7 +4759,8 @@ ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
|
|
|
4623
4759
|
ClrBrandAvatarModule,
|
|
4624
4760
|
ClrLocationBarModule,
|
|
4625
4761
|
ClrFormModule,
|
|
4626
|
-
ClrDropdownOverflowModule
|
|
4762
|
+
ClrDropdownOverflowModule,
|
|
4763
|
+
ClrDatagridStatePersistenceModule] });
|
|
4627
4764
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrAddonsModule, decorators: [{
|
|
4628
4765
|
type: NgModule,
|
|
4629
4766
|
args: [{
|
|
@@ -4655,6 +4792,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
4655
4792
|
ClrLocationBarModule,
|
|
4656
4793
|
ClrFormModule,
|
|
4657
4794
|
ClrDropdownOverflowModule,
|
|
4795
|
+
ClrDatagridStatePersistenceModule,
|
|
4658
4796
|
],
|
|
4659
4797
|
}]
|
|
4660
4798
|
}] });
|
|
@@ -5260,5 +5398,5 @@ const ClrAddonsIconShapes = {
|
|
|
5260
5398
|
* Generated bundle index. Do not edit.
|
|
5261
5399
|
*/
|
|
5262
5400
|
|
|
5263
|
-
export { ACShape, AcceptedBrands, AccessoriesShape, AccessoryPartsShape, AudiBrandShape, AwardWinnerPremiumShape, BlocksGroupForwardShape, BrochureShape, BundleForwardShape, BusinessCustomersCommercialShape, BusinessCustomersPrivateShape, CLR_BLANK_OPTION, CONTENT_PROVIDER, CalculatorForwardShape, CaliforniaServiceShape, CaliforniaSpecialistShape, CarPickupServiceShape, CarWashShape, CertifiedRepairShape, CertifiedRetailerShape, ClrActiveNotification, ClrAddonsIconShapes, ClrAddonsLabel, ClrAddonsModule, ClrAutocompleteOff, ClrAutocompleteOffModule, ClrBackButton, ClrBackButtonModule, ClrBrandAvatar, ClrBrandAvatarModule, ClrBreadcrumb, ClrBreadcrumbModule, ClrBreadcrumbService, ClrCollapseExpandSection, ClrCollapseExpandSectionModule, ClrContentPanel, ClrContentPanelContainer, ClrContentPanelContainerContent, ClrContentPanelContainerFooter, ClrContentPanelModule, ClrContentRef, ClrDataListPredefinedValidatorDirective, ClrDataListValidatorModule, ClrDataListValidators, ClrDateTimeContainer, ClrDateTimeModule, ClrDotPager, ClrDotPagerModule, ClrDropdownOverflowDirective, ClrDropdownOverflowModule, ClrFlowBar, ClrFlowBarModule, ClrFormModule, ClrGenericQuickList, ClrGenericQuickListModule, ClrHistory, ClrHistoryModule, ClrHistoryPinned, ClrHistoryService, ClrLetterAvatar, ClrLetterAvatarModule, ClrLocationBarModule, ClrMainNavGroup, ClrMainNavGroupItem, ClrMainNavGroupModule, ClrMaxNumeric, ClrMinNumeric, ClrMultilingualInput, ClrMultilingualInputValidators, ClrMultilingualModule, ClrMultilingualSelector, ClrMultilingualTextarea, ClrNotification, ClrNotificationModule, ClrNotificationRef, ClrNotificationService, ClrNumericField, ClrNumericFieldModule, ClrNumericFieldValidators, ClrPagedSearchResultList, ClrPagedSearchResultListModule, ClrPager, ClrPagerModule, ClrProgressSpinnerComponent, ClrProgressSpinnerModule, ClrQuickList, ClrQuickListModule, ClrRequiredAllMultilang, ClrRequiredOneMultilang, ClrSearchField, ClrSearchFieldModule, ClrTimeInput, ClrTreetable, ClrTreetableActionOverflow, ClrTreetableCell, ClrTreetableColumn, ClrTreetableModule, ClrTreetablePlaceholder, ClrTreetableRow, ClrViewEditSection, ClrViewEditSectionModule, ConfiguratorCommercialShape, ConfiguratorPrivateShape, ConsumptionShape, ContactDealerShape, CupraBrandShape, CustomersCenterShape, DWABrandShape, DieselShape, DollarBillForwardShape, DollarBillShape, DriversAssistanceShape, EfficiencyShape, ElectricCarsServiceShape, ElectricCarsShape, ElectricityShape, EmissionShape, EnergyShape, EngineShape, ExpressServiceShape, ExteriorShape, FindACarShape, FleetServiceCommercialShape, FleetServicePrivateShape, GasCarsServiceShape, GasShape, HybridShape, ItemsForwardShape, ItemsRecieveShape, LoadingVolumeShape, LocateShape, LocationBarComponent, LocationBarContentProvider, LocationBarNode, NewCarCommercialShape, NewCarPrivateShape, NewCarUtilityVehicleShape, NightServiceShape, NodeId, OffersShape, OnCallDutyShape, OpenSatShape, PaintMaterialForwardShape, PaintMaterialShape, PaintShopShape, PartNonStockForwardShape, PartsForwardShape, PartsNonStockShape, PartsShape, PayloadShape, PerformanceShape, PetrolShape, PlusServiceShape, PorscheBrandShape, PowerShape, PowerTrainShape, PriceTypeSwitchShape, QualifiedWorkshopShape, RoadsideAssistanceShape, RouteShape, SeatAirShape, SeatBrandShape, SeatShape, ServiceBellShape, ServiceShape, SizeShape, SkodaBrandShape, StockLocatorCommercialShape, StockLocatorPrivateShape, TaskAndAppointment, TaxiDealerShape, TextForward, TopcardShape, TouaregServiceShape, TransmissionAutomaticShape, TransmissionManualShape, TreetableCellRenderer, TreetableHeaderRenderer, TreetableMainRenderer, TreetableRowRenderer, UsedCarCommercialShape, UsedCarPrivateShape, VWBrandShape, VWNBrandShape, VWShape, VehicleConversionShape, View360Shape, VirtualRealityShape, WheelToWheelShape, WindscreenWashShape, WrenchForward, clrIconSVG, escapeHtml, escapeRegex };
|
|
5401
|
+
export { ACShape, AcceptedBrands, AccessoriesShape, AccessoryPartsShape, AudiBrandShape, AwardWinnerPremiumShape, BlocksGroupForwardShape, BrochureShape, BundleForwardShape, BusinessCustomersCommercialShape, BusinessCustomersPrivateShape, CLR_BLANK_OPTION, CONTENT_PROVIDER, CalculatorForwardShape, CaliforniaServiceShape, CaliforniaSpecialistShape, CarPickupServiceShape, CarWashShape, CertifiedRepairShape, CertifiedRetailerShape, ClrActiveNotification, ClrAddonsIconShapes, ClrAddonsLabel, ClrAddonsModule, ClrAutocompleteOff, ClrAutocompleteOffModule, ClrBackButton, ClrBackButtonModule, ClrBrandAvatar, ClrBrandAvatarModule, ClrBreadcrumb, ClrBreadcrumbModule, ClrBreadcrumbService, ClrCollapseExpandSection, ClrCollapseExpandSectionModule, ClrContentPanel, ClrContentPanelContainer, ClrContentPanelContainerContent, ClrContentPanelContainerFooter, ClrContentPanelModule, ClrContentRef, ClrDataListPredefinedValidatorDirective, ClrDataListValidatorModule, ClrDataListValidators, ClrDatagridStatePersistenceModule, ClrDateTimeContainer, ClrDateTimeModule, ClrDotPager, ClrDotPagerModule, ClrDropdownOverflowDirective, ClrDropdownOverflowModule, ClrFlowBar, ClrFlowBarModule, ClrFormModule, ClrGenericQuickList, ClrGenericQuickListModule, ClrHistory, ClrHistoryModule, ClrHistoryPinned, ClrHistoryService, ClrLetterAvatar, ClrLetterAvatarModule, ClrLocationBarModule, ClrMainNavGroup, ClrMainNavGroupItem, ClrMainNavGroupModule, ClrMaxNumeric, ClrMinNumeric, ClrMultilingualInput, ClrMultilingualInputValidators, ClrMultilingualModule, ClrMultilingualSelector, ClrMultilingualTextarea, ClrNotification, ClrNotificationModule, ClrNotificationRef, ClrNotificationService, ClrNumericField, ClrNumericFieldModule, ClrNumericFieldValidators, ClrPagedSearchResultList, ClrPagedSearchResultListModule, ClrPager, ClrPagerModule, ClrProgressSpinnerComponent, ClrProgressSpinnerModule, ClrQuickList, ClrQuickListModule, ClrRequiredAllMultilang, ClrRequiredOneMultilang, ClrSearchField, ClrSearchFieldModule, ClrTimeInput, ClrTreetable, ClrTreetableActionOverflow, ClrTreetableCell, ClrTreetableColumn, ClrTreetableModule, ClrTreetablePlaceholder, ClrTreetableRow, ClrViewEditSection, ClrViewEditSectionModule, ColumnHiddenStatePersistenceDirective, ConfiguratorCommercialShape, ConfiguratorPrivateShape, ConsumptionShape, ContactDealerShape, CupraBrandShape, CustomersCenterShape, DWABrandShape, DatagridFieldDirective, DieselShape, DollarBillForwardShape, DollarBillShape, DriversAssistanceShape, EfficiencyShape, ElectricCarsServiceShape, ElectricCarsShape, ElectricityShape, EmissionShape, EnergyShape, EngineShape, ExpressServiceShape, ExteriorShape, FindACarShape, FleetServiceCommercialShape, FleetServicePrivateShape, GasCarsServiceShape, GasShape, HybridShape, ItemsForwardShape, ItemsRecieveShape, LoadingVolumeShape, LocateShape, LocationBarComponent, LocationBarContentProvider, LocationBarNode, NewCarCommercialShape, NewCarPrivateShape, NewCarUtilityVehicleShape, NightServiceShape, NodeId, OffersShape, OnCallDutyShape, OpenSatShape, PaintMaterialForwardShape, PaintMaterialShape, PaintShopShape, PartNonStockForwardShape, PartsForwardShape, PartsNonStockShape, PartsShape, PayloadShape, PerformanceShape, PetrolShape, PlusServiceShape, PorscheBrandShape, PowerShape, PowerTrainShape, PriceTypeSwitchShape, QualifiedWorkshopShape, RoadsideAssistanceShape, RouteShape, SeatAirShape, SeatBrandShape, SeatShape, ServiceBellShape, ServiceShape, SizeShape, SkodaBrandShape, StatePersistenceKeyDirective, StockLocatorCommercialShape, StockLocatorPrivateShape, TaskAndAppointment, TaxiDealerShape, TextForward, TopcardShape, TouaregServiceShape, TransmissionAutomaticShape, TransmissionManualShape, TreetableCellRenderer, TreetableHeaderRenderer, TreetableMainRenderer, TreetableRowRenderer, UsedCarCommercialShape, UsedCarPrivateShape, VWBrandShape, VWNBrandShape, VWShape, VehicleConversionShape, View360Shape, VirtualRealityShape, WheelToWheelShape, WindscreenWashShape, WrenchForward, clrIconSVG, escapeHtml, escapeRegex };
|
|
5264
5402
|
//# sourceMappingURL=clr-addons.mjs.map
|