@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/fesm2015/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,50 @@ 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
|
+
var _a;
|
|
652
|
+
// first trigger manually because the subscription lower only triggers after first change
|
|
653
|
+
if (!((_a = this.nestedDropdownChildren) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
654
|
+
this.applyDropdownOverflowStyles();
|
|
655
|
+
}
|
|
656
|
+
this.nestedDropdownChildren.changes.pipe(takeUntil(this.destroy$)).subscribe((children) => {
|
|
657
|
+
// if there are any nested dropdowns, our overflow fix prevents those from showing and needs to be removed
|
|
658
|
+
if (!(children === null || children === void 0 ? void 0 : children.length)) {
|
|
659
|
+
this.applyDropdownOverflowStyles();
|
|
660
|
+
}
|
|
661
|
+
else if (children === null || children === void 0 ? void 0 : children.length) {
|
|
662
|
+
this.removeDropdownOverflowStyles();
|
|
663
|
+
}
|
|
664
|
+
});
|
|
651
665
|
}
|
|
652
|
-
|
|
666
|
+
ngOnDestroy() {
|
|
667
|
+
this.destroy$.next();
|
|
668
|
+
this.destroy$.complete();
|
|
669
|
+
}
|
|
670
|
+
applyDropdownOverflowStyles() {
|
|
653
671
|
// the vertical position of our element in the current window
|
|
654
672
|
const y = this.elRef.nativeElement.getBoundingClientRect().y;
|
|
655
673
|
const itemMinHeightPx = this.getItemMinHeight(this.clrDropdownMenuItemMinHeight);
|
|
656
674
|
// see https://stackoverflow.com/questions/22754315/for-loop-for-htmlcollection-elements
|
|
657
|
-
for (const item of this.
|
|
675
|
+
for (const item of this.getAllChildDropdownMenuItems()) {
|
|
658
676
|
item.style.minHeight = itemMinHeightPx + 'px';
|
|
659
677
|
}
|
|
660
678
|
this.elRef.nativeElement.style.maxHeight =
|
|
661
679
|
this.getMenuMaxHeight(this.clrDropdownMenuMaxHeight, window.innerHeight - y - this.convertRemToPixels(this.marginBottomRem)) + 'px';
|
|
662
680
|
this.elRef.nativeElement.style.overflowY = 'auto';
|
|
663
681
|
}
|
|
682
|
+
removeDropdownOverflowStyles() {
|
|
683
|
+
for (const item of this.getAllChildDropdownMenuItems()) {
|
|
684
|
+
item.style.minHeight = null;
|
|
685
|
+
}
|
|
686
|
+
this.elRef.nativeElement.style.maxHeight = null;
|
|
687
|
+
this.elRef.nativeElement.style.overflowY = null;
|
|
688
|
+
}
|
|
689
|
+
getAllChildDropdownMenuItems() {
|
|
690
|
+
return this.elRef.nativeElement.getElementsByClassName('dropdown-item');
|
|
691
|
+
}
|
|
664
692
|
getMenuMaxHeight(menuMaxHeightProvided, menuMaxHeightPx) {
|
|
665
693
|
if (menuMaxHeightProvided) {
|
|
666
694
|
const maxHeightPx = this.convertToPixels(menuMaxHeightProvided);
|
|
@@ -698,7 +726,7 @@ class ClrDropdownOverflowDirective {
|
|
|
698
726
|
}
|
|
699
727
|
}
|
|
700
728
|
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 });
|
|
729
|
+
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
730
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDropdownOverflowDirective, decorators: [{
|
|
703
731
|
type: Directive,
|
|
704
732
|
args: [{ selector: 'clr-dropdown-menu' }]
|
|
@@ -706,6 +734,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
706
734
|
type: Input
|
|
707
735
|
}], clrDropdownMenuItemMinHeight: [{
|
|
708
736
|
type: Input
|
|
737
|
+
}], nestedDropdownChildren: [{
|
|
738
|
+
type: ContentChildren,
|
|
739
|
+
args: [ClrDropdown, { descendants: true }]
|
|
709
740
|
}] } });
|
|
710
741
|
|
|
711
742
|
/*
|
|
@@ -4445,10 +4476,10 @@ class LocationBarNodeComponent {
|
|
|
4445
4476
|
}
|
|
4446
4477
|
}
|
|
4447
4478
|
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 });
|
|
4448
|
-
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
|
|
4479
|
+
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"] }] });
|
|
4449
4480
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: LocationBarNodeComponent, decorators: [{
|
|
4450
4481
|
type: Component,
|
|
4451
|
-
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
|
|
4482
|
+
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" }]
|
|
4452
4483
|
}], ctorParameters: function () {
|
|
4453
4484
|
return [{ type: LocationBarContentProvider, decorators: [{
|
|
4454
4485
|
type: Inject,
|
|
@@ -4567,6 +4598,115 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
4567
4598
|
}]
|
|
4568
4599
|
}] });
|
|
4569
4600
|
|
|
4601
|
+
class DatagridFieldDirective {
|
|
4602
|
+
}
|
|
4603
|
+
DatagridFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: DatagridFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4604
|
+
DatagridFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: DatagridFieldDirective, selector: "[clrDgField]", inputs: { clrDgField: "clrDgField" }, ngImport: i0 });
|
|
4605
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: DatagridFieldDirective, decorators: [{
|
|
4606
|
+
type: Directive,
|
|
4607
|
+
args: [{
|
|
4608
|
+
selector: '[clrDgField]',
|
|
4609
|
+
}]
|
|
4610
|
+
}], propDecorators: { clrDgField: [{
|
|
4611
|
+
type: Input
|
|
4612
|
+
}] } });
|
|
4613
|
+
|
|
4614
|
+
class StatePersistenceKeyDirective {
|
|
4615
|
+
}
|
|
4616
|
+
StatePersistenceKeyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: StatePersistenceKeyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4617
|
+
StatePersistenceKeyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: StatePersistenceKeyDirective, selector: "[clrStatePersistenceKey]", inputs: { clrStatePersistenceKey: "clrStatePersistenceKey" }, ngImport: i0 });
|
|
4618
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: StatePersistenceKeyDirective, decorators: [{
|
|
4619
|
+
type: Directive,
|
|
4620
|
+
args: [{
|
|
4621
|
+
selector: '[clrStatePersistenceKey]',
|
|
4622
|
+
}]
|
|
4623
|
+
}], propDecorators: { clrStatePersistenceKey: [{
|
|
4624
|
+
type: Input
|
|
4625
|
+
}] } });
|
|
4626
|
+
|
|
4627
|
+
class ColumnHiddenStatePersistenceDirective {
|
|
4628
|
+
constructor(columnDirective, statePersistenceKey, datagrid, hideableColumnDirective) {
|
|
4629
|
+
this.columnDirective = columnDirective;
|
|
4630
|
+
this.statePersistenceKey = statePersistenceKey;
|
|
4631
|
+
this.datagrid = datagrid;
|
|
4632
|
+
this.hideableColumnDirective = hideableColumnDirective;
|
|
4633
|
+
}
|
|
4634
|
+
ngOnInit() {
|
|
4635
|
+
var _a, _b;
|
|
4636
|
+
if (((_a = this.statePersistenceKey) === null || _a === void 0 ? void 0 : _a.clrStatePersistenceKey) && ((_b = this.columnDirective) === null || _b === void 0 ? void 0 : _b.clrDgField)) {
|
|
4637
|
+
/* set hidden states from local storage (if existing) */
|
|
4638
|
+
this.initHiddenState();
|
|
4639
|
+
/* listen to state changes and persist in local storage */
|
|
4640
|
+
this.hideableColumnDirective.hiddenChange.subscribe(hidden => {
|
|
4641
|
+
this.setHiddenState(hidden);
|
|
4642
|
+
});
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
initHiddenState() {
|
|
4646
|
+
/* read grid state if existing */
|
|
4647
|
+
const persistedGridStateJson = localStorage.getItem(this.statePersistenceKey.clrStatePersistenceKey);
|
|
4648
|
+
if (persistedGridStateJson !== null) {
|
|
4649
|
+
const persistedGridState = JSON.parse(persistedGridStateJson);
|
|
4650
|
+
/* read column state if existing */
|
|
4651
|
+
const persistedColumnState = persistedGridState[this.columnDirective.clrDgField];
|
|
4652
|
+
if (persistedColumnState) {
|
|
4653
|
+
/* read column hidden state if existing */
|
|
4654
|
+
const persistedColumnHiddenState = persistedColumnState.hidden;
|
|
4655
|
+
if (persistedColumnHiddenState) {
|
|
4656
|
+
this.hideableColumnDirective.clrDgHidden = persistedColumnHiddenState === true;
|
|
4657
|
+
}
|
|
4658
|
+
}
|
|
4659
|
+
}
|
|
4660
|
+
}
|
|
4661
|
+
setHiddenState(hidden) {
|
|
4662
|
+
var _a, _b;
|
|
4663
|
+
if (!((_b = (_a = this.datagrid) === null || _a === void 0 ? void 0 : _a.detailService) === null || _b === void 0 ? void 0 : _b.isOpen)) {
|
|
4664
|
+
/* read grid state if existing */
|
|
4665
|
+
const persistedGridStateJson = localStorage.getItem(this.statePersistenceKey.clrStatePersistenceKey);
|
|
4666
|
+
let persistedGridState = {};
|
|
4667
|
+
if (persistedGridStateJson !== null) {
|
|
4668
|
+
persistedGridState = JSON.parse(persistedGridStateJson);
|
|
4669
|
+
}
|
|
4670
|
+
/* read column state if existing */
|
|
4671
|
+
let persistedColumnState = persistedGridState[this.columnDirective.clrDgField];
|
|
4672
|
+
if (!persistedColumnState) {
|
|
4673
|
+
persistedColumnState = {};
|
|
4674
|
+
persistedGridState[this.columnDirective.clrDgField] = persistedColumnState;
|
|
4675
|
+
}
|
|
4676
|
+
/* set column hidden state and persist in local storage */
|
|
4677
|
+
persistedColumnState.hidden = hidden;
|
|
4678
|
+
localStorage.setItem(this.statePersistenceKey.clrStatePersistenceKey, JSON.stringify(persistedGridState));
|
|
4679
|
+
}
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
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 });
|
|
4683
|
+
ColumnHiddenStatePersistenceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: ColumnHiddenStatePersistenceDirective, selector: "[clrDgHideableColumn]", ngImport: i0 });
|
|
4684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ColumnHiddenStatePersistenceDirective, decorators: [{
|
|
4685
|
+
type: Directive,
|
|
4686
|
+
args: [{
|
|
4687
|
+
selector: '[clrDgHideableColumn]',
|
|
4688
|
+
}]
|
|
4689
|
+
}], ctorParameters: function () {
|
|
4690
|
+
return [{ type: DatagridFieldDirective, decorators: [{
|
|
4691
|
+
type: Optional
|
|
4692
|
+
}] }, { type: StatePersistenceKeyDirective, decorators: [{
|
|
4693
|
+
type: Optional
|
|
4694
|
+
}] }, { type: i1.ClrDatagrid }, { type: i1.ClrDatagridHideableColumn }];
|
|
4695
|
+
} });
|
|
4696
|
+
|
|
4697
|
+
class ClrDatagridStatePersistenceModule {
|
|
4698
|
+
}
|
|
4699
|
+
ClrDatagridStatePersistenceModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4700
|
+
ClrDatagridStatePersistenceModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule, declarations: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective], exports: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective] });
|
|
4701
|
+
ClrDatagridStatePersistenceModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule });
|
|
4702
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule, decorators: [{
|
|
4703
|
+
type: NgModule,
|
|
4704
|
+
args: [{
|
|
4705
|
+
declarations: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective],
|
|
4706
|
+
exports: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective],
|
|
4707
|
+
}]
|
|
4708
|
+
}] });
|
|
4709
|
+
|
|
4570
4710
|
/*
|
|
4571
4711
|
* Copyright (c) 2018-2022 Porsche Informatik. All Rights Reserved.
|
|
4572
4712
|
* This software is released under MIT license.
|
|
@@ -4601,7 +4741,8 @@ ClrAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
4601
4741
|
ClrBrandAvatarModule,
|
|
4602
4742
|
ClrLocationBarModule,
|
|
4603
4743
|
ClrFormModule,
|
|
4604
|
-
ClrDropdownOverflowModule
|
|
4744
|
+
ClrDropdownOverflowModule,
|
|
4745
|
+
ClrDatagridStatePersistenceModule] });
|
|
4605
4746
|
ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrAddonsModule, imports: [ClrViewEditSectionModule,
|
|
4606
4747
|
ClrPagerModule,
|
|
4607
4748
|
ClrDotPagerModule,
|
|
@@ -4628,7 +4769,8 @@ ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
|
|
|
4628
4769
|
ClrBrandAvatarModule,
|
|
4629
4770
|
ClrLocationBarModule,
|
|
4630
4771
|
ClrFormModule,
|
|
4631
|
-
ClrDropdownOverflowModule
|
|
4772
|
+
ClrDropdownOverflowModule,
|
|
4773
|
+
ClrDatagridStatePersistenceModule] });
|
|
4632
4774
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrAddonsModule, decorators: [{
|
|
4633
4775
|
type: NgModule,
|
|
4634
4776
|
args: [{
|
|
@@ -4660,6 +4802,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
4660
4802
|
ClrLocationBarModule,
|
|
4661
4803
|
ClrFormModule,
|
|
4662
4804
|
ClrDropdownOverflowModule,
|
|
4805
|
+
ClrDatagridStatePersistenceModule,
|
|
4663
4806
|
],
|
|
4664
4807
|
}]
|
|
4665
4808
|
}] });
|
|
@@ -5255,5 +5398,5 @@ const ClrAddonsIconShapes = {
|
|
|
5255
5398
|
* Generated bundle index. Do not edit.
|
|
5256
5399
|
*/
|
|
5257
5400
|
|
|
5258
|
-
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 };
|
|
5259
5402
|
//# sourceMappingURL=clr-addons.mjs.map
|