@porscheinformatik/clr-addons 19.11.2 → 19.11.4
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/fesm2022/clr-addons.mjs +365 -76
- package/fesm2022/clr-addons.mjs.map +1 -1
- package/package.json +1 -1
- package/summary-area/summary-area/summary-area-state.service.d.ts +3 -2
- package/summary-area/summary-area/summary-area.d.ts +38 -8
- package/summary-area/summary-area/summary-area.model.d.ts +3 -2
- package/summary-area/summary-item/summary-item.d.ts +3 -1
- package/summary-area/summary-item-value/summary-item-value.d.ts +8 -1
- package/summary-area/summary-item-value-copy-button/summary-item-value-copy-button.d.ts +14 -4
package/fesm2022/clr-addons.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, NgModule, Injectable, EventEmitter, Output, Input, Directive, ViewChild, ContentChildren, TemplateRef, ViewChildren, HostBinding, ElementRef, Renderer2, forwardRef, Inject, ContentChild, Optional, input, ChangeDetectionStrategy, signal, computed, SkipSelf, inject, model, contentChild, linkedSignal, DestroyRef, contentChildren, effect, output, viewChild, InjectionToken, isSignal, HostListener, LOCALE_ID, Self, NgZone, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { Component, NgModule, Injectable, EventEmitter, Output, Input, Directive, ViewChild, ContentChildren, TemplateRef, ViewChildren, HostBinding, ElementRef, Renderer2, forwardRef, Inject, ContentChild, Optional, input, ChangeDetectionStrategy, signal, computed, SkipSelf, inject, model, contentChild, linkedSignal, DestroyRef, contentChildren, effect, output, viewChild, InjectionToken, isSignal, HostListener, LOCALE_ID, Self, NgZone, ChangeDetectorRef, Injector, untracked, runInInjectionContext } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule, DOCUMENT, NgComponentOutlet, NgTemplateOutlet, getLocaleDateFormat, FormatWidth, NgForOf, NgClass } from '@angular/common';
|
|
5
5
|
import { ClarityIcons, arrowIcon, angleIcon, timesIcon, trashIcon, plusCircleIcon, exclamationCircleIcon, searchIcon, ellipsisVerticalIcon, filterGridCircleIcon, filterGridIcon, pencilIcon, historyIcon as historyIcon$1, treeViewIcon, organizationIcon, calendarIcon, checkCircleIcon, windowCloseIcon, exclamationTriangleIcon, copyToClipboardIcon, successStandardIcon, angleDoubleIcon } from '@cds/core/icon';
|
|
@@ -15610,6 +15610,15 @@ class ClrSummaryItemValue {
|
|
|
15610
15610
|
this.contentCheckScheduled = false;
|
|
15611
15611
|
this.ngZone = inject(NgZone);
|
|
15612
15612
|
this.cdr = inject(ChangeDetectorRef);
|
|
15613
|
+
// Watch for value changes and trigger overflow detection
|
|
15614
|
+
effect(() => {
|
|
15615
|
+
// Access the value signal to track changes
|
|
15616
|
+
const currentValue = this.value();
|
|
15617
|
+
if (currentValue !== undefined && currentValue !== null && currentValue !== '') {
|
|
15618
|
+
// Schedule overflow check after view updates
|
|
15619
|
+
this.scheduleOverflowCheck();
|
|
15620
|
+
}
|
|
15621
|
+
});
|
|
15613
15622
|
}
|
|
15614
15623
|
get hasIcon() {
|
|
15615
15624
|
return !!this.icon()?.trim();
|
|
@@ -15645,17 +15654,18 @@ class ClrSummaryItemValue {
|
|
|
15645
15654
|
}
|
|
15646
15655
|
/**
|
|
15647
15656
|
* Returns true if this component has any meaningful content to display.
|
|
15648
|
-
* This includes: a value
|
|
15657
|
+
* This includes: a value or projected content.
|
|
15658
|
+
* An icon is considered special content and does not count as meaningful content alone.
|
|
15649
15659
|
*/
|
|
15650
15660
|
get hasMeaningfulContent() {
|
|
15651
|
-
return this.
|
|
15661
|
+
return this.hasText || this.hasProjectedContent;
|
|
15652
15662
|
}
|
|
15653
15663
|
/**
|
|
15654
15664
|
* Returns true if this component should be hidden.
|
|
15655
15665
|
* This happens when there's no meaningful content.
|
|
15656
15666
|
*/
|
|
15657
15667
|
get shouldHide() {
|
|
15658
|
-
return !this.hasMeaningfulContent;
|
|
15668
|
+
return !this.hasIcon && !this.hasMeaningfulContent;
|
|
15659
15669
|
}
|
|
15660
15670
|
ngOnInit() {
|
|
15661
15671
|
if (this.hasIcon && this.hasText) {
|
|
@@ -15709,27 +15719,23 @@ class ClrSummaryItemValue {
|
|
|
15709
15719
|
});
|
|
15710
15720
|
}
|
|
15711
15721
|
setupOverflowDetection() {
|
|
15712
|
-
|
|
15722
|
+
const el = this.valueElement?.nativeElement;
|
|
15723
|
+
if (!el) {
|
|
15724
|
+
return;
|
|
15725
|
+
}
|
|
15726
|
+
// Defer initial check to next tick to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
15727
|
+
setTimeout(() => {
|
|
15728
|
+
this.checkTextOverflowSync();
|
|
15729
|
+
this.cdr.markForCheck();
|
|
15730
|
+
});
|
|
15713
15731
|
this.ngZone.runOutsideAngular(() => {
|
|
15714
15732
|
this.resizeObserver = new ResizeObserver(() => {
|
|
15715
|
-
|
|
15716
|
-
|
|
15717
|
-
|
|
15718
|
-
|
|
15719
|
-
if (prevOverflowing !== this.isTextOverflowing || prevTooltipSize !== this.tooltipSize) {
|
|
15720
|
-
this.ngZone.run(() => {
|
|
15721
|
-
this.cdr.markForCheck();
|
|
15722
|
-
});
|
|
15723
|
-
}
|
|
15733
|
+
this.ngZone.run(() => {
|
|
15734
|
+
this.checkTextOverflowSync();
|
|
15735
|
+
this.cdr.markForCheck();
|
|
15736
|
+
});
|
|
15724
15737
|
});
|
|
15725
|
-
|
|
15726
|
-
if (this.valueElement?.nativeElement) {
|
|
15727
|
-
this.resizeObserver.observe(this.valueElement.nativeElement);
|
|
15728
|
-
}
|
|
15729
|
-
});
|
|
15730
|
-
// Defer initial check to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
15731
|
-
Promise.resolve().then(() => {
|
|
15732
|
-
this.checkTextOverflowSync();
|
|
15738
|
+
this.resizeObserver.observe(el);
|
|
15733
15739
|
});
|
|
15734
15740
|
}
|
|
15735
15741
|
checkTextOverflowSync() {
|
|
@@ -15739,12 +15745,23 @@ class ClrSummaryItemValue {
|
|
|
15739
15745
|
}
|
|
15740
15746
|
const tooltip = this.effectiveTooltip;
|
|
15741
15747
|
// if the tooltip content is too short for medium size, size small should be used instead
|
|
15742
|
-
const newSize = tooltip && tooltip.length <
|
|
15748
|
+
const newSize = tooltip && tooltip.length < 30 ? 'sm' : 'md';
|
|
15743
15749
|
if (this.tooltipSize !== newSize) {
|
|
15744
15750
|
this.tooltipSize = newSize;
|
|
15745
15751
|
this.cdr.markForCheck();
|
|
15746
15752
|
}
|
|
15747
15753
|
}
|
|
15754
|
+
/**
|
|
15755
|
+
* Schedule an overflow check after the DOM has been updated.
|
|
15756
|
+
* Uses setTimeout to ensure the check runs outside of change detection.
|
|
15757
|
+
*/
|
|
15758
|
+
scheduleOverflowCheck() {
|
|
15759
|
+
// Use setTimeout to ensure the check runs outside of Angular's change detection
|
|
15760
|
+
setTimeout(() => {
|
|
15761
|
+
this.checkTextOverflowSync();
|
|
15762
|
+
this.cdr.markForCheck();
|
|
15763
|
+
});
|
|
15764
|
+
}
|
|
15748
15765
|
/** @internal - Manually trigger projected content check. Useful for testing. */
|
|
15749
15766
|
checkProjectedContent() {
|
|
15750
15767
|
if (this.projectedContent?.nativeElement) {
|
|
@@ -15776,12 +15793,12 @@ class ClrSummaryItemValue {
|
|
|
15776
15793
|
return false;
|
|
15777
15794
|
}
|
|
15778
15795
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ClrSummaryItemValue, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15779
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: ClrSummaryItemValue, isStandalone: true, selector: "clr-summary-item-value", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, host: { properties: { "class.has-icon": "this.hasIcon", "class.has-text": "this.hasText", "class.hidden": "this.isHidden" } }, providers: [provideAnimations()], viewQueries: [{ propertyName: "projectedContent", first: true, predicate: ["projectedContent"], descendants: true }, { propertyName: "valueElement", first: true, predicate: ["valueElement"], descendants: true }], ngImport: i0, template: "@if (icon() !== undefined && icon() !== null && icon() !== '') { @if (hasClickHandler) { @if (tooltip()) {\n<clr-tooltip>\n <cds-icon\n clrTooltipTrigger\n [attr.shape]=\"icon()\"\n class=\"value-icon value-link\"\n tabindex=\"0\"\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n ></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen> {{ tooltip() }}</clr-tooltip-content>\n</clr-tooltip>\n} @else {\n<cds-icon\n [attr.shape]=\"icon()\"\n class=\"value-icon value-link\"\n tabindex=\"0\"\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n></cds-icon>\n} } @else { @if (tooltip()) {\n<clr-tooltip>\n <cds-icon clrTooltipTrigger [attr.shape]=\"icon()\" class=\"value-icon value-icon-neutral\"></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen> {{ tooltip() }}</clr-tooltip-content>\n</clr-tooltip>\n} @else {\n<cds-icon [attr.shape]=\"icon()\" class=\"value-icon value-icon-neutral\"></cds-icon>\n} } } @else if (value() !== undefined && value() !== null && value() !== '') { @if (hasClickHandler) {
|
|
15796
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: ClrSummaryItemValue, isStandalone: true, selector: "clr-summary-item-value", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, host: { properties: { "class.has-icon": "this.hasIcon", "class.has-text": "this.hasText", "class.hidden": "this.isHidden" } }, providers: [provideAnimations()], viewQueries: [{ propertyName: "projectedContent", first: true, predicate: ["projectedContent"], descendants: true }, { propertyName: "valueElement", first: true, predicate: ["valueElement"], descendants: true }], ngImport: i0, template: "@if (icon() !== undefined && icon() !== null && icon() !== '') { @if (hasClickHandler) { @if (tooltip()) {\n<clr-tooltip>\n <cds-icon\n clrTooltipTrigger\n [attr.shape]=\"icon()\"\n class=\"value-icon value-link\"\n tabindex=\"0\"\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n ></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen> {{ tooltip() }}</clr-tooltip-content>\n</clr-tooltip>\n} @else {\n<cds-icon\n [attr.shape]=\"icon()\"\n class=\"value-icon value-link\"\n tabindex=\"0\"\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n></cds-icon>\n} } @else { @if (tooltip()) {\n<clr-tooltip>\n <cds-icon clrTooltipTrigger [attr.shape]=\"icon()\" class=\"value-icon value-icon-neutral\"></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen> {{ tooltip() }}</clr-tooltip-content>\n</clr-tooltip>\n} @else {\n<cds-icon [attr.shape]=\"icon()\" class=\"value-icon value-icon-neutral\"></cds-icon>\n} } } @else if (value() !== undefined && value() !== null && value() !== '') { @if (hasClickHandler) {\n<clr-tooltip>\n <span\n #valueElement\n class=\"value value-link\"\n clrTooltipTrigger\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n >\n {{ value() }}\n </span>\n @if (effectiveTooltip) {\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen>\n {{ effectiveTooltip }}</clr-tooltip-content\n >\n }\n</clr-tooltip>\n} @else {\n<clr-tooltip>\n <span #valueElement class=\"value\" clrTooltipTrigger>{{ value() }}</span>\n @if (effectiveTooltip) {\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen>\n {{ effectiveTooltip }}</clr-tooltip-content\n >\n }\n</clr-tooltip>\n} } @else {\n<span class=\"projected-wrapper\" #projectedContent>\n <ng-content></ng-content>\n</span>\n}\n", styles: [":host{display:inline-flex;flex-direction:row;align-items:center;gap:.25rem;flex:0 1 auto;max-width:100%;min-width:0;overflow:visible}:host.hidden{display:none}:host(.has-icon){flex:0 0 auto;width:auto}.value,.value-link,.projected-wrapper,clr-tooltip [clrTooltipTrigger]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}cds-icon{flex-shrink:0}.value-icon{height:20px;width:20px}.value-icon-neutral{color:var(--cds-alias-status-neutral)}.value-link,.edit-link{color:var(--cds-alias-typography-link-color);text-decoration:underline;cursor:pointer}.value-link:visited,.edit-link:visited{color:var(--cds-alias-typography-link-color-visited)}.value-link:hover,.value-link:focus,.edit-link:hover,.edit-link:focus{color:var(--cds-alias-typography-link-color-hover);text-decoration:underline}.value{display:inline-block}clr-tooltip{display:inline-flex;flex:1 1 auto;min-width:0;overflow:visible}clr-tooltip [clrTooltipTrigger]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.error){color:var(--cds-alias-status-danger)}:host(.error) cds-icon{color:var(--cds-alias-status-danger)!important}:host(.error) .value{color:var(--cds-alias-status-danger)}:host(.warning){color:var(--cds-alias-status-warning)}:host(.warning) cds-icon{color:var(--cds-alias-status-warning)!important}:host(.warning) .value{color:var(--cds-alias-status-warning)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: ClarityModule }, { kind: "directive", type: i1$1.CdsIconCustomTag, selector: "cds-icon" }, { kind: "directive", type: i1$1.ClrIfOpen, selector: "[clrIfOpen]", inputs: ["clrIfOpen"], outputs: ["clrIfOpenChange"] }, { kind: "component", type: i1$1.ClrTooltip, selector: "clr-tooltip" }, { kind: "directive", type: i1$1.ClrTooltipTrigger, selector: "[clrTooltipTrigger]" }, { kind: "component", type: i1$1.ClrTooltipContent, selector: "clr-tooltip-content", inputs: ["id", "clrPosition", "clrSize"] }, { kind: "ngmodule", type: ClrIconModule }] }); }
|
|
15780
15797
|
}
|
|
15781
15798
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ClrSummaryItemValue, decorators: [{
|
|
15782
15799
|
type: Component,
|
|
15783
|
-
args: [{ selector: 'clr-summary-item-value', standalone: true, imports: [CommonModule, RouterModule, ClarityModule, ClrIconModule], providers: [provideAnimations()], template: "@if (icon() !== undefined && icon() !== null && icon() !== '') { @if (hasClickHandler) { @if (tooltip()) {\n<clr-tooltip>\n <cds-icon\n clrTooltipTrigger\n [attr.shape]=\"icon()\"\n class=\"value-icon value-link\"\n tabindex=\"0\"\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n ></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen> {{ tooltip() }}</clr-tooltip-content>\n</clr-tooltip>\n} @else {\n<cds-icon\n [attr.shape]=\"icon()\"\n class=\"value-icon value-link\"\n tabindex=\"0\"\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n></cds-icon>\n} } @else { @if (tooltip()) {\n<clr-tooltip>\n <cds-icon clrTooltipTrigger [attr.shape]=\"icon()\" class=\"value-icon value-icon-neutral\"></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen> {{ tooltip() }}</clr-tooltip-content>\n</clr-tooltip>\n} @else {\n<cds-icon [attr.shape]=\"icon()\" class=\"value-icon value-icon-neutral\"></cds-icon>\n} } } @else if (value() !== undefined && value() !== null && value() !== '') { @if (hasClickHandler) {
|
|
15784
|
-
}], propDecorators: { projectedContent: [{
|
|
15800
|
+
args: [{ selector: 'clr-summary-item-value', standalone: true, imports: [CommonModule, RouterModule, ClarityModule, ClrIconModule], providers: [provideAnimations()], template: "@if (icon() !== undefined && icon() !== null && icon() !== '') { @if (hasClickHandler) { @if (tooltip()) {\n<clr-tooltip>\n <cds-icon\n clrTooltipTrigger\n [attr.shape]=\"icon()\"\n class=\"value-icon value-link\"\n tabindex=\"0\"\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n ></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen> {{ tooltip() }}</clr-tooltip-content>\n</clr-tooltip>\n} @else {\n<cds-icon\n [attr.shape]=\"icon()\"\n class=\"value-icon value-link\"\n tabindex=\"0\"\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n></cds-icon>\n} } @else { @if (tooltip()) {\n<clr-tooltip>\n <cds-icon clrTooltipTrigger [attr.shape]=\"icon()\" class=\"value-icon value-icon-neutral\"></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen> {{ tooltip() }}</clr-tooltip-content>\n</clr-tooltip>\n} @else {\n<cds-icon [attr.shape]=\"icon()\" class=\"value-icon value-icon-neutral\"></cds-icon>\n} } } @else if (value() !== undefined && value() !== null && value() !== '') { @if (hasClickHandler) {\n<clr-tooltip>\n <span\n #valueElement\n class=\"value value-link\"\n clrTooltipTrigger\n (click)=\"handleClick()\"\n (keydown.enter)=\"handleClick()\"\n >\n {{ value() }}\n </span>\n @if (effectiveTooltip) {\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen>\n {{ effectiveTooltip }}</clr-tooltip-content\n >\n }\n</clr-tooltip>\n} @else {\n<clr-tooltip>\n <span #valueElement class=\"value\" clrTooltipTrigger>{{ value() }}</span>\n @if (effectiveTooltip) {\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen>\n {{ effectiveTooltip }}</clr-tooltip-content\n >\n }\n</clr-tooltip>\n} } @else {\n<span class=\"projected-wrapper\" #projectedContent>\n <ng-content></ng-content>\n</span>\n}\n", styles: [":host{display:inline-flex;flex-direction:row;align-items:center;gap:.25rem;flex:0 1 auto;max-width:100%;min-width:0;overflow:visible}:host.hidden{display:none}:host(.has-icon){flex:0 0 auto;width:auto}.value,.value-link,.projected-wrapper,clr-tooltip [clrTooltipTrigger]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}cds-icon{flex-shrink:0}.value-icon{height:20px;width:20px}.value-icon-neutral{color:var(--cds-alias-status-neutral)}.value-link,.edit-link{color:var(--cds-alias-typography-link-color);text-decoration:underline;cursor:pointer}.value-link:visited,.edit-link:visited{color:var(--cds-alias-typography-link-color-visited)}.value-link:hover,.value-link:focus,.edit-link:hover,.edit-link:focus{color:var(--cds-alias-typography-link-color-hover);text-decoration:underline}.value{display:inline-block}clr-tooltip{display:inline-flex;flex:1 1 auto;min-width:0;overflow:visible}clr-tooltip [clrTooltipTrigger]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.error){color:var(--cds-alias-status-danger)}:host(.error) cds-icon{color:var(--cds-alias-status-danger)!important}:host(.error) .value{color:var(--cds-alias-status-danger)}:host(.warning){color:var(--cds-alias-status-warning)}:host(.warning) cds-icon{color:var(--cds-alias-status-warning)!important}:host(.warning) .value{color:var(--cds-alias-status-warning)}\n"] }]
|
|
15801
|
+
}], ctorParameters: () => [], propDecorators: { projectedContent: [{
|
|
15785
15802
|
type: ViewChild,
|
|
15786
15803
|
args: ['projectedContent']
|
|
15787
15804
|
}], valueElement: [{
|
|
@@ -15807,25 +15824,51 @@ ClarityIcons.addIcons(copyToClipboardIcon, successStandardIcon);
|
|
|
15807
15824
|
class ClrSummaryItemValueCopyButton {
|
|
15808
15825
|
constructor() {
|
|
15809
15826
|
this.value = input.required();
|
|
15810
|
-
this.
|
|
15827
|
+
this.tooltipText = input('Copy to clipboard');
|
|
15828
|
+
this.showCopiedIcon = false;
|
|
15829
|
+
this.tooltipSize = 'md';
|
|
15811
15830
|
this.cdr = inject(ChangeDetectorRef);
|
|
15831
|
+
this.resetTimeout = null;
|
|
15812
15832
|
}
|
|
15813
|
-
|
|
15814
|
-
|
|
15833
|
+
ngOnInit() {
|
|
15834
|
+
const newSize = this.tooltipText && this.tooltipText().length < 30 ? 'sm' : 'md';
|
|
15835
|
+
if (this.tooltipSize !== newSize) {
|
|
15836
|
+
this.tooltipSize = newSize;
|
|
15837
|
+
this.cdr.markForCheck();
|
|
15838
|
+
}
|
|
15839
|
+
}
|
|
15840
|
+
ngOnDestroy() {
|
|
15841
|
+
if (this.resetTimeout) {
|
|
15842
|
+
clearTimeout(this.resetTimeout);
|
|
15843
|
+
this.resetTimeout = null;
|
|
15844
|
+
}
|
|
15845
|
+
}
|
|
15846
|
+
/**
|
|
15847
|
+
* Called when the clipboard copy operation completes.
|
|
15848
|
+
* @param success Whether the copy was successful
|
|
15849
|
+
*/
|
|
15850
|
+
onCopied(success) {
|
|
15851
|
+
if (!success) {
|
|
15815
15852
|
return;
|
|
15816
15853
|
}
|
|
15817
|
-
|
|
15818
|
-
|
|
15819
|
-
this.
|
|
15820
|
-
|
|
15821
|
-
|
|
15854
|
+
// Clear any pending reset timeout to restart the timer
|
|
15855
|
+
if (this.resetTimeout) {
|
|
15856
|
+
clearTimeout(this.resetTimeout);
|
|
15857
|
+
}
|
|
15858
|
+
this.showCopiedIcon = true;
|
|
15859
|
+
this.cdr.markForCheck();
|
|
15860
|
+
this.resetTimeout = setTimeout(() => {
|
|
15861
|
+
this.showCopiedIcon = false;
|
|
15862
|
+
this.resetTimeout = null;
|
|
15863
|
+
this.cdr.markForCheck();
|
|
15864
|
+
}, 1000);
|
|
15822
15865
|
}
|
|
15823
15866
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ClrSummaryItemValueCopyButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15824
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.16", type: ClrSummaryItemValueCopyButton, isStandalone: true, selector: "clr-summary-area-value-copy-button", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<cds-icon\n
|
|
15867
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.16", type: ClrSummaryItemValueCopyButton, isStandalone: true, selector: "clr-summary-area-value-copy-button", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, tooltipText: { classPropertyName: "tooltipText", publicName: "tooltipText", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<clr-tooltip>\n <cds-icon\n clrTooltipTrigger\n class=\"summary-item-copy-value-icon\"\n [cdkCopyToClipboard]=\"value()\"\n (cdkCopyToClipboardCopied)=\"onCopied($event)\"\n [attr.shape]=\"showCopiedIcon ? 'success-standard' : 'copy-to-clipboard'\"\n [ngClass]=\"{ 'attribute-was-copied-color': showCopiedIcon }\"\n ></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen\n >{{ tooltipText() }}</clr-tooltip-content\n >\n</clr-tooltip>\n", styles: [":host,.tooltip{display:flex;align-items:center}.summary-item-copy-value-icon{cursor:pointer;color:var(--cds-alias-status-disabled-tint)!important}.summary-item-copy-value-icon:hover{color:var(--cds-alias-typography-link-color)!important}.attribute-was-copied-color{color:var(--cds-alias-status-success)!important}\n"], dependencies: [{ kind: "directive", type: CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ClrIconModule }, { kind: "directive", type: i1$1.CdsIconCustomTag, selector: "cds-icon" }, { kind: "ngmodule", type: ClrTooltipModule }, { kind: "component", type: i1$1.ClrTooltip, selector: "clr-tooltip" }, { kind: "directive", type: i1$1.ClrTooltipTrigger, selector: "[clrTooltipTrigger]" }, { kind: "component", type: i1$1.ClrTooltipContent, selector: "clr-tooltip-content", inputs: ["id", "clrPosition", "clrSize"] }, { kind: "directive", type: i1$1.ClrIfOpen, selector: "[clrIfOpen]", inputs: ["clrIfOpen"], outputs: ["clrIfOpenChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15825
15868
|
}
|
|
15826
15869
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ClrSummaryItemValueCopyButton, decorators: [{
|
|
15827
15870
|
type: Component,
|
|
15828
|
-
args: [{ selector: 'clr-summary-area-value-copy-button', imports: [CdkCopyToClipboard, NgClass, ClrIconModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<cds-icon\n
|
|
15871
|
+
args: [{ selector: 'clr-summary-area-value-copy-button', imports: [CdkCopyToClipboard, NgClass, ClrIconModule, ClrTooltipModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<clr-tooltip>\n <cds-icon\n clrTooltipTrigger\n class=\"summary-item-copy-value-icon\"\n [cdkCopyToClipboard]=\"value()\"\n (cdkCopyToClipboardCopied)=\"onCopied($event)\"\n [attr.shape]=\"showCopiedIcon ? 'success-standard' : 'copy-to-clipboard'\"\n [ngClass]=\"{ 'attribute-was-copied-color': showCopiedIcon }\"\n ></cds-icon>\n <clr-tooltip-content [clrSize]=\"tooltipSize\" clrPosition=\"top-right\" *clrIfOpen\n >{{ tooltipText() }}</clr-tooltip-content\n >\n</clr-tooltip>\n", styles: [":host,.tooltip{display:flex;align-items:center}.summary-item-copy-value-icon{cursor:pointer;color:var(--cds-alias-status-disabled-tint)!important}.summary-item-copy-value-icon:hover{color:var(--cds-alias-typography-link-color)!important}.attribute-was-copied-color{color:var(--cds-alias-status-success)!important}\n"] }]
|
|
15829
15872
|
}] });
|
|
15830
15873
|
|
|
15831
15874
|
/*
|
|
@@ -15842,6 +15885,7 @@ class ClrSummaryItem {
|
|
|
15842
15885
|
this.editConfig = input();
|
|
15843
15886
|
this.showOnEmptyValue = input(true);
|
|
15844
15887
|
this.valueCopyable = input(false);
|
|
15888
|
+
this.copyButtonTooltip = input('Copy to clipboard');
|
|
15845
15889
|
this.hasProjectedContent = false;
|
|
15846
15890
|
this.cdr = inject(ChangeDetectorRef);
|
|
15847
15891
|
this.contentCheckScheduled = false;
|
|
@@ -15876,7 +15920,8 @@ class ClrSummaryItem {
|
|
|
15876
15920
|
return this.warning()?.click;
|
|
15877
15921
|
}
|
|
15878
15922
|
get showEditButton() {
|
|
15879
|
-
return (!this.
|
|
15923
|
+
return (!this.hasNonIconTextValue() &&
|
|
15924
|
+
!this.hasLoading &&
|
|
15880
15925
|
!this.hasError &&
|
|
15881
15926
|
!this.hasWarning &&
|
|
15882
15927
|
!this.hasProjectedContent &&
|
|
@@ -16003,22 +16048,24 @@ class ClrSummaryItem {
|
|
|
16003
16048
|
return false;
|
|
16004
16049
|
}
|
|
16005
16050
|
// Skip internal elements by class
|
|
16006
|
-
|
|
16051
|
+
return !(element.classList.contains('edit-link') ||
|
|
16007
16052
|
element.classList.contains('value-placeholder') ||
|
|
16008
|
-
element.classList.contains('summary-item-loading'))
|
|
16009
|
-
return false;
|
|
16010
|
-
}
|
|
16011
|
-
return true;
|
|
16053
|
+
element.classList.contains('summary-item-loading'));
|
|
16012
16054
|
}
|
|
16013
16055
|
return false;
|
|
16014
16056
|
});
|
|
16015
16057
|
}
|
|
16058
|
+
hasNonIconTextValue() {
|
|
16059
|
+
return this.valueChildren.toArray().some(child => {
|
|
16060
|
+
return !child.hasIcon && !!child.value()?.trim();
|
|
16061
|
+
});
|
|
16062
|
+
}
|
|
16016
16063
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ClrSummaryItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16017
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: ClrSummaryItem, isStandalone: true, selector: "clr-summary-item", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, warning: { classPropertyName: "warning", publicName: "warning", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, editConfig: { classPropertyName: "editConfig", publicName: "editConfig", isSignal: true, isRequired: false, transformFunction: null }, showOnEmptyValue: { classPropertyName: "showOnEmptyValue", publicName: "showOnEmptyValue", isSignal: true, isRequired: false, transformFunction: null }, valueCopyable: { classPropertyName: "valueCopyable", publicName: "valueCopyable", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "valueChildren", predicate: ClrSummaryItemValue, descendants: true }], viewQueries: [{ propertyName: "template", first: true, predicate: ["itemTemplate"], descendants: true, static: true }, { propertyName: "valuesContainer", first: true, predicate: ["valuesContainer"], descendants: true }], ngImport: i0, template: "<ng-template #itemTemplate>\n <div\n class=\"summary-item\"\n [class.hidden]=\"\n !hasProjectedContent && !hasLoading && !hasError && !hasWarning && !showEditButton && !showOnEmptyValue()\n \"\n >\n <span class=\"summary-item-label\">{{ label() }}:</span>\n <div class=\"summary-item-values\" #valuesContainer>\n @if (hasLoading) {\n <div class=\"summary-item-loading\">\n <span class=\"spinner spinner-inline\"></span>\n <span>{{ loadingText }}</span>\n </div>\n } @else if (hasError) {\n <clr-summary-item-value icon=\"error-standard\" class=\"error\"></clr-summary-item-value>\n <clr-summary-item-value\n [value]=\"errorText\"\n [clickable]=\"true\"\n (clicked)=\"errorClick()\"\n class=\"error\"\n ></clr-summary-item-value>\n } @else if (hasWarning) {\n <clr-summary-item-value icon=\"warning-standard\" class=\"warning\"></clr-summary-item-value>\n <clr-summary-item-value\n [value]=\"warningText\"\n [clickable]=\"true\"\n (clicked)=\"warningClick()\"\n class=\"warning\"\n ></clr-summary-item-value>\n } @else {\n <ng-content select=\"clr-summary-item-value\"></ng-content>\n <ng-content></ng-content>\n @if (showEditButton) {\n <
|
|
16064
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: ClrSummaryItem, isStandalone: true, selector: "clr-summary-item", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, warning: { classPropertyName: "warning", publicName: "warning", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, editConfig: { classPropertyName: "editConfig", publicName: "editConfig", isSignal: true, isRequired: false, transformFunction: null }, showOnEmptyValue: { classPropertyName: "showOnEmptyValue", publicName: "showOnEmptyValue", isSignal: true, isRequired: false, transformFunction: null }, valueCopyable: { classPropertyName: "valueCopyable", publicName: "valueCopyable", isSignal: true, isRequired: false, transformFunction: null }, copyButtonTooltip: { classPropertyName: "copyButtonTooltip", publicName: "copyButtonTooltip", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "valueChildren", predicate: ClrSummaryItemValue, descendants: true }], viewQueries: [{ propertyName: "template", first: true, predicate: ["itemTemplate"], descendants: true, static: true }, { propertyName: "valuesContainer", first: true, predicate: ["valuesContainer"], descendants: true }], ngImport: i0, template: "<ng-template #itemTemplate>\n <div\n class=\"summary-item\"\n [class.hidden]=\"\n !hasProjectedContent && !hasLoading && !hasError && !hasWarning && !showEditButton && !showOnEmptyValue()\n \"\n >\n <span class=\"summary-item-label\">{{ label() }}:</span>\n <div class=\"summary-item-values\" #valuesContainer>\n @if (hasLoading) {\n <div class=\"summary-item-loading\">\n <span class=\"spinner spinner-inline\"></span>\n <span>{{ loadingText }}</span>\n </div>\n } @else if (hasError) {\n <clr-summary-item-value icon=\"error-standard\" class=\"error\"></clr-summary-item-value>\n <clr-summary-item-value\n [value]=\"errorText\"\n [clickable]=\"true\"\n (clicked)=\"errorClick()\"\n class=\"error\"\n ></clr-summary-item-value>\n } @else if (hasWarning) {\n <clr-summary-item-value icon=\"warning-standard\" class=\"warning\"></clr-summary-item-value>\n <clr-summary-item-value\n [value]=\"warningText\"\n [clickable]=\"true\"\n (clicked)=\"warningClick()\"\n class=\"warning\"\n ></clr-summary-item-value>\n } @else {\n <ng-content select=\"clr-summary-item-value\"></ng-content>\n @if (showCopyButton) {\n <clr-summary-area-value-copy-button\n [value]=\"copyableValue\"\n [tooltipText]=\"copyButtonTooltip()\"\n ></clr-summary-area-value-copy-button>\n }\n <ng-content></ng-content>\n @if (showEditButton) {\n <clr-summary-item-value [value]=\"editText\" [clickable]=\"true\" (clicked)=\"editClick()\"></clr-summary-item-value>\n } @else if (!hasProjectedContent) {\n <span class=\"value value-placeholder\">—</span>\n } }\n </div>\n </div>\n</ng-template>\n", styles: [":host{display:block;min-width:0;max-width:100%;overflow:hidden}.summary-item{display:flex;flex-direction:row;align-items:center;gap:.25rem;width:100%;min-width:0}.summary-item.hidden{display:none}.summary-item-label{flex-shrink:0;white-space:nowrap;font-weight:600}.summary-item-values{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:.25rem;flex:1 1 auto;min-width:0;max-width:100%;overflow:visible}clr-summary-area-value-copy-button{flex:0 0 auto}.summary-item-loading{display:flex;align-items:center}.summary-item-loading .loading-spinner{width:20px;height:20px;flex-shrink:0}.summary-item-loading .loading-text{color:var(--cds-alias-typography-color-300);white-space:nowrap}.value{display:inline-block;flex:1 1 auto;min-width:0;overflow:visible;text-overflow:ellipsis;white-space:nowrap}.value-link,.edit-link{color:var(--cds-alias-typography-link-color);text-decoration:underline;cursor:pointer}.value-link:visited,.edit-link:visited{color:var(--cds-alias-typography-link-color-visited)}.value-link:hover,.value-link:focus,.edit-link:hover,.edit-link:focus{color:var(--cds-alias-typography-link-color-hover);text-decoration:underline}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ClarityModule }, { kind: "component", type: ClrSummaryItemValue, selector: "clr-summary-item-value", inputs: ["value", "icon", "tooltip", "clickable"], outputs: ["clicked"] }, { kind: "component", type: ClrSummaryItemValueCopyButton, selector: "clr-summary-area-value-copy-button", inputs: ["value", "tooltipText"] }] }); }
|
|
16018
16065
|
}
|
|
16019
16066
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ClrSummaryItem, decorators: [{
|
|
16020
16067
|
type: Component,
|
|
16021
|
-
args: [{ selector: 'clr-summary-item', standalone: true, imports: [CommonModule, ClarityModule, ClrSummaryItemValue, ClrSummaryItemValueCopyButton], template: "<ng-template #itemTemplate>\n <div\n class=\"summary-item\"\n [class.hidden]=\"\n !hasProjectedContent && !hasLoading && !hasError && !hasWarning && !showEditButton && !showOnEmptyValue()\n \"\n >\n <span class=\"summary-item-label\">{{ label() }}:</span>\n <div class=\"summary-item-values\" #valuesContainer>\n @if (hasLoading) {\n <div class=\"summary-item-loading\">\n <span class=\"spinner spinner-inline\"></span>\n <span>{{ loadingText }}</span>\n </div>\n } @else if (hasError) {\n <clr-summary-item-value icon=\"error-standard\" class=\"error\"></clr-summary-item-value>\n <clr-summary-item-value\n [value]=\"errorText\"\n [clickable]=\"true\"\n (clicked)=\"errorClick()\"\n class=\"error\"\n ></clr-summary-item-value>\n } @else if (hasWarning) {\n <clr-summary-item-value icon=\"warning-standard\" class=\"warning\"></clr-summary-item-value>\n <clr-summary-item-value\n [value]=\"warningText\"\n [clickable]=\"true\"\n (clicked)=\"warningClick()\"\n class=\"warning\"\n ></clr-summary-item-value>\n } @else {\n <ng-content select=\"clr-summary-item-value\"></ng-content>\n <ng-content></ng-content>\n @if (showEditButton) {\n <
|
|
16068
|
+
args: [{ selector: 'clr-summary-item', standalone: true, imports: [CommonModule, ClarityModule, ClrSummaryItemValue, ClrSummaryItemValueCopyButton], template: "<ng-template #itemTemplate>\n <div\n class=\"summary-item\"\n [class.hidden]=\"\n !hasProjectedContent && !hasLoading && !hasError && !hasWarning && !showEditButton && !showOnEmptyValue()\n \"\n >\n <span class=\"summary-item-label\">{{ label() }}:</span>\n <div class=\"summary-item-values\" #valuesContainer>\n @if (hasLoading) {\n <div class=\"summary-item-loading\">\n <span class=\"spinner spinner-inline\"></span>\n <span>{{ loadingText }}</span>\n </div>\n } @else if (hasError) {\n <clr-summary-item-value icon=\"error-standard\" class=\"error\"></clr-summary-item-value>\n <clr-summary-item-value\n [value]=\"errorText\"\n [clickable]=\"true\"\n (clicked)=\"errorClick()\"\n class=\"error\"\n ></clr-summary-item-value>\n } @else if (hasWarning) {\n <clr-summary-item-value icon=\"warning-standard\" class=\"warning\"></clr-summary-item-value>\n <clr-summary-item-value\n [value]=\"warningText\"\n [clickable]=\"true\"\n (clicked)=\"warningClick()\"\n class=\"warning\"\n ></clr-summary-item-value>\n } @else {\n <ng-content select=\"clr-summary-item-value\"></ng-content>\n @if (showCopyButton) {\n <clr-summary-area-value-copy-button\n [value]=\"copyableValue\"\n [tooltipText]=\"copyButtonTooltip()\"\n ></clr-summary-area-value-copy-button>\n }\n <ng-content></ng-content>\n @if (showEditButton) {\n <clr-summary-item-value [value]=\"editText\" [clickable]=\"true\" (clicked)=\"editClick()\"></clr-summary-item-value>\n } @else if (!hasProjectedContent) {\n <span class=\"value value-placeholder\">—</span>\n } }\n </div>\n </div>\n</ng-template>\n", styles: [":host{display:block;min-width:0;max-width:100%;overflow:hidden}.summary-item{display:flex;flex-direction:row;align-items:center;gap:.25rem;width:100%;min-width:0}.summary-item.hidden{display:none}.summary-item-label{flex-shrink:0;white-space:nowrap;font-weight:600}.summary-item-values{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:.25rem;flex:1 1 auto;min-width:0;max-width:100%;overflow:visible}clr-summary-area-value-copy-button{flex:0 0 auto}.summary-item-loading{display:flex;align-items:center}.summary-item-loading .loading-spinner{width:20px;height:20px;flex-shrink:0}.summary-item-loading .loading-text{color:var(--cds-alias-typography-color-300);white-space:nowrap}.value{display:inline-block;flex:1 1 auto;min-width:0;overflow:visible;text-overflow:ellipsis;white-space:nowrap}.value-link,.edit-link{color:var(--cds-alias-typography-link-color);text-decoration:underline;cursor:pointer}.value-link:visited,.edit-link:visited{color:var(--cds-alias-typography-link-color-visited)}.value-link:hover,.value-link:focus,.edit-link:hover,.edit-link:focus{color:var(--cds-alias-typography-link-color-hover);text-decoration:underline}\n"] }]
|
|
16022
16069
|
}], propDecorators: { template: [{
|
|
16023
16070
|
type: ViewChild,
|
|
16024
16071
|
args: ['itemTemplate', { static: true }]
|
|
@@ -16039,36 +16086,54 @@ const defaultSummaryAreaCollapsedKey = 'clrSummaryAreaCollapsed';
|
|
|
16039
16086
|
class ClrSummaryAreaStateService {
|
|
16040
16087
|
constructor() {
|
|
16041
16088
|
this.collapsedMap = new Map();
|
|
16089
|
+
this.effectsInitialized = new Set();
|
|
16090
|
+
this.injector = inject(Injector);
|
|
16042
16091
|
}
|
|
16043
16092
|
collapsed(key) {
|
|
16044
16093
|
const storageKey = key || defaultSummaryAreaCollapsedKey;
|
|
16045
|
-
|
|
16094
|
+
// Use untracked to avoid reactive context issues when getting/creating the signal
|
|
16095
|
+
return untracked(() => {
|
|
16096
|
+
if (!this.collapsedMap.has(storageKey)) {
|
|
16097
|
+
const collapsedSignal = signal(this.readInitialState(storageKey));
|
|
16098
|
+
this.collapsedMap.set(storageKey, collapsedSignal);
|
|
16099
|
+
// Schedule effect creation outside of any reactive context
|
|
16100
|
+
this.scheduleEffectCreation(storageKey, collapsedSignal);
|
|
16101
|
+
}
|
|
16102
|
+
return this.collapsedMap.get(storageKey);
|
|
16103
|
+
});
|
|
16104
|
+
}
|
|
16105
|
+
scheduleEffectCreation(storageKey, collapsedSignal) {
|
|
16106
|
+
if (this.effectsInitialized.has(storageKey)) {
|
|
16107
|
+
return;
|
|
16108
|
+
}
|
|
16109
|
+
this.effectsInitialized.add(storageKey);
|
|
16110
|
+
// Use setTimeout to ensure effect is created outside of any reactive context
|
|
16111
|
+
setTimeout(() => {
|
|
16112
|
+
runInInjectionContext(this.injector, () => {
|
|
16113
|
+
effect(() => {
|
|
16114
|
+
const value = collapsedSignal();
|
|
16115
|
+
try {
|
|
16116
|
+
localStorage.setItem(storageKey, String(value));
|
|
16117
|
+
}
|
|
16118
|
+
catch (e) {
|
|
16119
|
+
// Ignore storage errors
|
|
16120
|
+
}
|
|
16121
|
+
});
|
|
16122
|
+
});
|
|
16123
|
+
});
|
|
16046
16124
|
}
|
|
16047
16125
|
toggle(key) {
|
|
16048
16126
|
const storageKey = key || defaultSummaryAreaCollapsedKey;
|
|
16049
|
-
const
|
|
16050
|
-
|
|
16051
|
-
|
|
16052
|
-
this.persistToStorage(storageKey, newValue);
|
|
16053
|
-
}
|
|
16054
|
-
setCollapsed(key, value) {
|
|
16055
|
-
const entry = this.getOrCreateEntry(key);
|
|
16056
|
-
entry.signal.set(value);
|
|
16057
|
-
this.persistToStorage(key, value);
|
|
16058
|
-
}
|
|
16059
|
-
getOrCreateEntry(storageKey) {
|
|
16060
|
-
if (!this.collapsedMap.has(storageKey)) {
|
|
16061
|
-
const collapsedSignal = signal(this.readInitialState(storageKey));
|
|
16062
|
-
this.collapsedMap.set(storageKey, { signal: collapsedSignal, storageKey });
|
|
16127
|
+
const collapsedSignal = this.collapsedMap.get(storageKey);
|
|
16128
|
+
if (collapsedSignal) {
|
|
16129
|
+
collapsedSignal.update(value => !value);
|
|
16063
16130
|
}
|
|
16064
|
-
return this.collapsedMap.get(storageKey);
|
|
16065
16131
|
}
|
|
16066
|
-
|
|
16067
|
-
|
|
16068
|
-
|
|
16069
|
-
|
|
16070
|
-
|
|
16071
|
-
// Ignore storage errors
|
|
16132
|
+
setCollapsed(key, value) {
|
|
16133
|
+
const storageKey = key || defaultSummaryAreaCollapsedKey;
|
|
16134
|
+
const collapsedSignal = this.collapsedMap.get(storageKey);
|
|
16135
|
+
if (collapsedSignal) {
|
|
16136
|
+
collapsedSignal.set(value);
|
|
16072
16137
|
}
|
|
16073
16138
|
}
|
|
16074
16139
|
readInitialState(storageKey) {
|
|
@@ -16100,24 +16165,102 @@ class ClrSummaryArea {
|
|
|
16100
16165
|
this.warning = input();
|
|
16101
16166
|
this.loading = input();
|
|
16102
16167
|
this.currentColumns = 5;
|
|
16103
|
-
this.currentRows =
|
|
16168
|
+
this.currentRows = this.rows();
|
|
16169
|
+
this.panelHeight = '0px';
|
|
16170
|
+
this.loadingPanelHeight = '0px';
|
|
16171
|
+
this.loadingVisible = false;
|
|
16172
|
+
this.prevErrorActive = false;
|
|
16173
|
+
this.prevWarningActive = false;
|
|
16174
|
+
this.prevCollapsed = true;
|
|
16175
|
+
this.prevHasLoading = false;
|
|
16176
|
+
this.loadingVisibleTimeout = null;
|
|
16104
16177
|
this.state = inject(ClrSummaryAreaStateService);
|
|
16105
16178
|
this.cdr = inject(ChangeDetectorRef);
|
|
16106
16179
|
this.defaultLoadingText = 'Loading...';
|
|
16107
16180
|
this.defaultErrorText = 'Error';
|
|
16108
16181
|
this.defaultWarningText = 'Warning';
|
|
16109
16182
|
this.maxColumns = 5;
|
|
16110
|
-
this.
|
|
16111
|
-
|
|
16183
|
+
this.errorActive = computed(() => this.error()?.active() ?? false);
|
|
16184
|
+
this.warningActive = computed(() => this.warning()?.active() ?? false);
|
|
16185
|
+
// Effect to handle expand/collapse with smooth height transition
|
|
16186
|
+
effect(() => {
|
|
16187
|
+
const collapsed = this.isCollapsed();
|
|
16188
|
+
if (!collapsed) {
|
|
16189
|
+
// Expanding: update grid first, then measure and set height
|
|
16190
|
+
this.updateGrid();
|
|
16191
|
+
requestAnimationFrame(() => {
|
|
16192
|
+
this.updateGrid();
|
|
16193
|
+
this.updatePanelHeight();
|
|
16194
|
+
});
|
|
16195
|
+
}
|
|
16196
|
+
else if (!this.prevCollapsed && collapsed) {
|
|
16197
|
+
// Collapsing: set current height first, then animate to 0
|
|
16198
|
+
this.animateCollapse();
|
|
16199
|
+
}
|
|
16200
|
+
this.prevCollapsed = collapsed;
|
|
16112
16201
|
});
|
|
16113
|
-
|
|
16202
|
+
// Effect for tracking changes in the error state (using computed signal)
|
|
16114
16203
|
effect(() => {
|
|
16115
|
-
|
|
16204
|
+
const errorActive = this.errorActive();
|
|
16205
|
+
const collapsed = this.isCollapsed();
|
|
16206
|
+
// If error active state changed and area is NOT collapsed, recalculate panel height
|
|
16207
|
+
if (errorActive !== this.prevErrorActive && !collapsed) {
|
|
16208
|
+
this.updateGrid();
|
|
16209
|
+
this.cdr.detectChanges();
|
|
16210
|
+
requestAnimationFrame(() => {
|
|
16211
|
+
this.recalculatePanelHeight();
|
|
16212
|
+
});
|
|
16213
|
+
}
|
|
16214
|
+
this.prevErrorActive = errorActive;
|
|
16215
|
+
});
|
|
16216
|
+
// Effect for tracking changes in the warning state (using computed signal)
|
|
16217
|
+
effect(() => {
|
|
16218
|
+
const warningActive = this.warningActive();
|
|
16219
|
+
const collapsed = this.isCollapsed();
|
|
16220
|
+
// If error active state changed and area is NOT collapsed, recalculate panel height
|
|
16221
|
+
if (warningActive !== this.prevWarningActive && !collapsed) {
|
|
16222
|
+
this.updateGrid();
|
|
16223
|
+
this.cdr.detectChanges();
|
|
16224
|
+
requestAnimationFrame(() => {
|
|
16225
|
+
this.recalculatePanelHeight();
|
|
16226
|
+
});
|
|
16227
|
+
}
|
|
16228
|
+
this.prevWarningActive = warningActive;
|
|
16229
|
+
});
|
|
16230
|
+
// Effect to delay loading indicator visibility for smooth fade-in animation
|
|
16231
|
+
effect(() => {
|
|
16232
|
+
const loading = this.hasLoading;
|
|
16233
|
+
const collapsed = this.isCollapsed();
|
|
16234
|
+
// Clear any pending timeout
|
|
16235
|
+
if (this.loadingVisibleTimeout) {
|
|
16236
|
+
clearTimeout(this.loadingVisibleTimeout);
|
|
16237
|
+
this.loadingVisibleTimeout = null;
|
|
16238
|
+
}
|
|
16239
|
+
if (loading && !collapsed) {
|
|
16240
|
+
// Delay showing loading indicator to allow parent panel to become visible first
|
|
16241
|
+
this.loadingVisibleTimeout = setTimeout(() => {
|
|
16242
|
+
this.loadingVisible = true;
|
|
16243
|
+
this.cdr.markForCheck();
|
|
16244
|
+
}, 50);
|
|
16245
|
+
}
|
|
16246
|
+
else {
|
|
16247
|
+
this.loadingVisible = false;
|
|
16248
|
+
this.loadingPanelHeight = '0px';
|
|
16249
|
+
this.cdr.markForCheck();
|
|
16250
|
+
}
|
|
16251
|
+
if (this.prevHasLoading !== loading && !collapsed) {
|
|
16116
16252
|
this.updateGrid();
|
|
16117
|
-
|
|
16253
|
+
this.cdr.detectChanges();
|
|
16254
|
+
requestAnimationFrame(() => {
|
|
16255
|
+
this.recalculatePanelHeight();
|
|
16256
|
+
});
|
|
16118
16257
|
}
|
|
16258
|
+
this.prevHasLoading = loading;
|
|
16119
16259
|
});
|
|
16120
16260
|
}
|
|
16261
|
+
ngOnInit() {
|
|
16262
|
+
this.isCollapsed = this.state.collapsed(this.localStorageKey());
|
|
16263
|
+
}
|
|
16121
16264
|
/**
|
|
16122
16265
|
* Depending on the current rows input only a specific amount of items can be visible to the user.
|
|
16123
16266
|
* The summary area only supports up to 5 columns.
|
|
@@ -16136,7 +16279,7 @@ class ClrSummaryArea {
|
|
|
16136
16279
|
return this.loading()?.text || this.defaultLoadingText;
|
|
16137
16280
|
}
|
|
16138
16281
|
get hasError() {
|
|
16139
|
-
return !this.hasLoading && !!this.error() && this.error().active;
|
|
16282
|
+
return !this.hasLoading && !!this.error() && this.error().active();
|
|
16140
16283
|
}
|
|
16141
16284
|
get errorText() {
|
|
16142
16285
|
return this.error()?.text || this.defaultErrorText;
|
|
@@ -16148,7 +16291,7 @@ class ClrSummaryArea {
|
|
|
16148
16291
|
return this.error()?.click;
|
|
16149
16292
|
}
|
|
16150
16293
|
get hasWarning() {
|
|
16151
|
-
return !this.hasLoading && !this.hasError && !!this.warning() && this.warning().active;
|
|
16294
|
+
return !this.hasLoading && !this.hasError && !!this.warning() && this.warning().active();
|
|
16152
16295
|
}
|
|
16153
16296
|
get warningText() {
|
|
16154
16297
|
return this.warning()?.text || this.defaultWarningText;
|
|
@@ -16162,11 +16305,51 @@ class ClrSummaryArea {
|
|
|
16162
16305
|
onResize() {
|
|
16163
16306
|
if (!this.isCollapsed()) {
|
|
16164
16307
|
this.updateGrid();
|
|
16308
|
+
this.cdr.detectChanges();
|
|
16309
|
+
// Recalculate height after grid update for responsive changes
|
|
16310
|
+
// Use setTimeout to ensure DOM is updated with new grid layout
|
|
16311
|
+
setTimeout(() => {
|
|
16312
|
+
this.recalculatePanelHeight();
|
|
16313
|
+
}, 0);
|
|
16165
16314
|
}
|
|
16166
16315
|
}
|
|
16167
16316
|
ngAfterViewInit() {
|
|
16168
16317
|
this.updateGrid();
|
|
16169
16318
|
this.cdr.detectChanges();
|
|
16319
|
+
// Set initial height after content is rendered
|
|
16320
|
+
if (!this.isCollapsed()) {
|
|
16321
|
+
// Use setTimeout to ensure DOM is fully painted
|
|
16322
|
+
setTimeout(() => {
|
|
16323
|
+
// If loading, calculate height immediately based on rows
|
|
16324
|
+
if (this.hasLoading || this.hasError || this.hasWarning) {
|
|
16325
|
+
const calculatedHeight = this.calculateGridHeight();
|
|
16326
|
+
this.panelHeight = calculatedHeight + 'px';
|
|
16327
|
+
this.cdr.detectChanges();
|
|
16328
|
+
}
|
|
16329
|
+
else {
|
|
16330
|
+
this.recalculatePanelHeight();
|
|
16331
|
+
}
|
|
16332
|
+
}, 0);
|
|
16333
|
+
}
|
|
16334
|
+
// Subscribe to content changes (when items get dynamically added/removed)
|
|
16335
|
+
this.itemsSubscription = this.items.changes.subscribe(() => {
|
|
16336
|
+
// Force layout recalculation after DOM update
|
|
16337
|
+
setTimeout(() => {
|
|
16338
|
+
this.updateGrid();
|
|
16339
|
+
this.cdr.detectChanges();
|
|
16340
|
+
if (!this.isCollapsed()) {
|
|
16341
|
+
setTimeout(() => {
|
|
16342
|
+
this.recalculatePanelHeight();
|
|
16343
|
+
}, 0);
|
|
16344
|
+
}
|
|
16345
|
+
}, 0);
|
|
16346
|
+
});
|
|
16347
|
+
}
|
|
16348
|
+
ngOnDestroy() {
|
|
16349
|
+
this.itemsSubscription?.unsubscribe();
|
|
16350
|
+
if (this.loadingVisibleTimeout) {
|
|
16351
|
+
clearTimeout(this.loadingVisibleTimeout);
|
|
16352
|
+
}
|
|
16170
16353
|
}
|
|
16171
16354
|
updateGrid() {
|
|
16172
16355
|
if (this.items && this.items.length > 0) {
|
|
@@ -16188,15 +16371,121 @@ class ClrSummaryArea {
|
|
|
16188
16371
|
this.cdr.detectChanges();
|
|
16189
16372
|
}
|
|
16190
16373
|
}
|
|
16374
|
+
updatePanelHeight() {
|
|
16375
|
+
if (this.panelsRef?.nativeElement) {
|
|
16376
|
+
const el = this.panelsRef.nativeElement;
|
|
16377
|
+
// For loading/error/warning states, use calculated height
|
|
16378
|
+
if (this.hasLoading || this.hasError || this.hasWarning) {
|
|
16379
|
+
const calculatedHeight = this.calculateGridHeight();
|
|
16380
|
+
// Set to 0 first for animation start
|
|
16381
|
+
this.panelHeight = '0px';
|
|
16382
|
+
this.cdr.detectChanges();
|
|
16383
|
+
void el.offsetHeight;
|
|
16384
|
+
// Animate to calculated height
|
|
16385
|
+
requestAnimationFrame(() => {
|
|
16386
|
+
this.panelHeight = calculatedHeight + 'px';
|
|
16387
|
+
this.cdr.markForCheck();
|
|
16388
|
+
});
|
|
16389
|
+
return;
|
|
16390
|
+
}
|
|
16391
|
+
// For grid state, measure the DOM
|
|
16392
|
+
// Set to 0 first for animation start
|
|
16393
|
+
this.panelHeight = '0px';
|
|
16394
|
+
this.cdr.detectChanges();
|
|
16395
|
+
// Force reflow
|
|
16396
|
+
void el.offsetHeight;
|
|
16397
|
+
// Temporarily set to auto to measure the full content height
|
|
16398
|
+
el.style.height = 'auto';
|
|
16399
|
+
const scrollHeight = el.scrollHeight;
|
|
16400
|
+
// Reset to 0 to prepare for animation
|
|
16401
|
+
el.style.height = '0px';
|
|
16402
|
+
// Force reflow again
|
|
16403
|
+
void el.offsetHeight;
|
|
16404
|
+
// Animate to measured height
|
|
16405
|
+
requestAnimationFrame(() => {
|
|
16406
|
+
this.panelHeight = scrollHeight + 'px';
|
|
16407
|
+
this.cdr.markForCheck();
|
|
16408
|
+
});
|
|
16409
|
+
}
|
|
16410
|
+
}
|
|
16411
|
+
recalculatePanelHeight() {
|
|
16412
|
+
if (this.panelsRef?.nativeElement && !this.isCollapsed()) {
|
|
16413
|
+
// If specific states are active, use calculated height
|
|
16414
|
+
if (this.hasLoading || this.hasError || this.hasWarning) {
|
|
16415
|
+
const calculatedHeight = this.calculateGridHeight();
|
|
16416
|
+
this.panelHeight = calculatedHeight + 'px';
|
|
16417
|
+
this.cdr.detectChanges();
|
|
16418
|
+
return;
|
|
16419
|
+
}
|
|
16420
|
+
const el = this.panelsRef.nativeElement;
|
|
16421
|
+
// Set height to auto temporarily to measure true content height
|
|
16422
|
+
const currentHeight = el.style.height;
|
|
16423
|
+
el.style.height = 'auto';
|
|
16424
|
+
// Force reflow to ensure measurement is accurate
|
|
16425
|
+
void el.offsetHeight;
|
|
16426
|
+
// Measure the actual content height
|
|
16427
|
+
const scrollHeight = el.scrollHeight;
|
|
16428
|
+
// Restore height and set new value
|
|
16429
|
+
el.style.height = currentHeight;
|
|
16430
|
+
this.panelHeight = scrollHeight + 'px';
|
|
16431
|
+
this.cdr.detectChanges();
|
|
16432
|
+
setTimeout(() => {
|
|
16433
|
+
this.cdr.markForCheck();
|
|
16434
|
+
}, 0);
|
|
16435
|
+
}
|
|
16436
|
+
}
|
|
16437
|
+
/**
|
|
16438
|
+
* Calculate the expected grid height based on currentRows.
|
|
16439
|
+
* This is used when the grid isn't rendered (e.g., during loading state).
|
|
16440
|
+
* The loading container should match the grid height exactly.
|
|
16441
|
+
*
|
|
16442
|
+
* Grid structure:
|
|
16443
|
+
* - .summary-area-container: margin 0 24px 9px 24px
|
|
16444
|
+
* - .summary-grid: padding 3px 0, row-gap 6px
|
|
16445
|
+
* - .summary-item: height 20px
|
|
16446
|
+
*
|
|
16447
|
+
* Formula: (rows * itemHeight) + ((rows - 1) * rowGap) + gridPadding + containerMargin
|
|
16448
|
+
*/
|
|
16449
|
+
calculateGridHeight() {
|
|
16450
|
+
const itemHeight = 20; // .summary-item height
|
|
16451
|
+
const rowGap = 6; // .summary-grid row-gap
|
|
16452
|
+
const gridPadding = 6; // .summary-grid padding (3px top + 3px bottom)
|
|
16453
|
+
// For error/warning states, use a smaller fixed height
|
|
16454
|
+
if (this.hasError || this.hasWarning) {
|
|
16455
|
+
const alertHeight = itemHeight + 2 * rowGap;
|
|
16456
|
+
return alertHeight + gridPadding;
|
|
16457
|
+
}
|
|
16458
|
+
// For loading state, calculate based on current rows
|
|
16459
|
+
const gridHeight = this.currentRows * itemHeight + (this.currentRows - 1) * rowGap;
|
|
16460
|
+
return gridHeight + gridPadding;
|
|
16461
|
+
}
|
|
16462
|
+
animateCollapse() {
|
|
16463
|
+
if (this.panelsRef?.nativeElement) {
|
|
16464
|
+
const el = this.panelsRef.nativeElement;
|
|
16465
|
+
// Set current height explicitly first
|
|
16466
|
+
this.panelHeight = el.scrollHeight + 'px';
|
|
16467
|
+
this.cdr.detectChanges();
|
|
16468
|
+
// Force reflow
|
|
16469
|
+
void el.offsetHeight;
|
|
16470
|
+
// Then animate to 0
|
|
16471
|
+
requestAnimationFrame(() => {
|
|
16472
|
+
this.panelHeight = '0px';
|
|
16473
|
+
this.cdr.markForCheck();
|
|
16474
|
+
});
|
|
16475
|
+
}
|
|
16476
|
+
}
|
|
16191
16477
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ClrSummaryArea, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16192
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: ClrSummaryArea, isStandalone: true, selector: "clr-summary-area", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, localStorageKey: { classPropertyName: "localStorageKey", publicName: "localStorageKey", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, warning: { classPropertyName: "warning", publicName: "warning", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:resize": "onResize()" } }, queries: [{ propertyName: "items", predicate: ClrSummaryItem, descendants: true }], ngImport: i0, template: "
|
|
16478
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: ClrSummaryArea, isStandalone: true, selector: "clr-summary-area", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, localStorageKey: { classPropertyName: "localStorageKey", publicName: "localStorageKey", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, warning: { classPropertyName: "warning", publicName: "warning", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:resize": "onResize()" } }, queries: [{ propertyName: "items", predicate: ClrSummaryItem, descendants: true }], viewQueries: [{ propertyName: "panelsRef", first: true, predicate: ["panelsRef"], descendants: true, static: true }], ngImport: i0, template: "<div\n #panelsRef\n class=\"summary-area-panels\"\n [class.is-active]=\"!isCollapsed()\"\n [class.loading-active]=\"hasLoading\"\n [style.height]=\"panelHeight\"\n>\n <div\n class=\"summary-area-panel summary-area-panel--state\"\n [class.is-active]=\"!isCollapsed() && (hasLoading || hasError || hasWarning)\"\n [class.is-error]=\"hasError\"\n [class.is-warning]=\"hasWarning\"\n [style.--rows]=\"currentRows\"\n [attr.aria-hidden]=\"isCollapsed() || !(hasLoading || hasError || hasWarning) ? 'true' : 'false'\"\n [attr.inert]=\"isCollapsed() || !(hasLoading || hasError || hasWarning) ? '' : null\"\n >\n <div class=\"summary-area-panel__body\">\n <div\n class=\"summary-area-loading\"\n [class.is-visible]=\"loadingVisible\"\n [attr.aria-hidden]=\"!hasLoading\"\n [style.height]=\"loadingPanelHeight\"\n >\n <clr-spinner [clrMedium]=\"true\"></clr-spinner>\n <span class=\"loading-text\">{{ loadingText }}</span>\n </div>\n @if (hasError) {\n <div class=\"summary-area-alert\">\n <clr-alert [clrAlertLightweight]=\"true\" [clrAlertType]=\"'danger'\">\n <clr-alert-item>\n @if (errorLinkText && errorClick) {\n <span class=\"alert-text\">{{ errorText }}</span>\n <span class=\"alert-action\" (click)=\"errorClick()\" (keydown.enter)=\"errorClick()\">{{ errorLinkText }}</span>\n } @else if (errorClick) {\n <span class=\"alert-action\" (click)=\"errorClick()\" (keydown.enter)=\"errorClick()\">{{ errorText }}</span>\n } @else {\n <span class=\"alert-text\">{{ errorText }}</span>\n }\n </clr-alert-item>\n </clr-alert>\n </div>\n } @else if (hasWarning) {\n <div class=\"summary-area-alert\">\n <clr-alert [clrAlertLightweight]=\"true\" [clrAlertType]=\"'warning'\">\n <clr-alert-item>\n @if (warningLinkText && warningClick) {\n <span class=\"alert-text\">{{ warningText }}</span>\n <span class=\"alert-action\" (click)=\"warningClick()\" (keydown.enter)=\"warningClick()\"\n >{{ warningLinkText }}</span\n >\n } @else if (warningClick) {\n <span class=\"alert-action\" (click)=\"warningClick()\" (keydown.enter)=\"warningClick()\"\n >{{ warningText }}</span\n >\n } @else {\n <span class=\"alert-text\">{{ warningText }}</span>\n }\n </clr-alert-item>\n </clr-alert>\n </div>\n }\n </div>\n </div>\n\n <div\n class=\"summary-area-panel summary-area-panel--grid\"\n [class.is-active]=\"!isCollapsed() && !hasError && !hasWarning && !hasLoading\"\n [attr.aria-hidden]=\"isCollapsed() || hasError || hasWarning || hasLoading ? 'true' : 'false'\"\n [attr.inert]=\"isCollapsed() || hasError || hasWarning || hasLoading ? '' : null\"\n >\n <div class=\"summary-area-panel__body\">\n <div class=\"summary-area-container\">\n <div class=\"summary-grid\" [style.--columns]=\"currentColumns\" [style.--rows]=\"currentRows\">\n <ng-container *ngFor=\"let item of visibleItems\">\n <ng-container *ngTemplateOutlet=\"item.template\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: [".summary-area-container,.summary-area-alert{margin:0 24px 9px;max-width:100%;overflow-x:auto}.summary-grid{display:grid;grid-template-columns:repeat(var(--columns),minmax(0,320px));grid-template-rows:repeat(var(--rows),auto);grid-auto-flow:column;max-width:100%;column-gap:36px;row-gap:6px;padding:3px 0}.summary-item{max-width:320px;min-width:0;height:20px;overflow:visible;display:flex;flex-direction:column}clr-alert-item{display:flex;align-items:center;gap:.5rem;flex-wrap:nowrap}clr-alert-item .alert-text{flex:none;width:auto;white-space:nowrap;align-self:flex-start}clr-alert-item .alert-action{white-space:nowrap}.alert-action{color:var(--cds-alias-typography-link-color)!important;cursor:pointer}.alert-action:visited{color:var(--cds-alias-typography-link-color-visited)}.alert-action:hover,.alert-action:focus{color:var(--cds-alias-typography-link-color-hover)}clr-alert ::ng-deep>.alert-lightweight{padding-left:0;padding-right:0}.summary-area-panels{position:relative;height:0;opacity:0;transform-origin:top center;pointer-events:none;visibility:hidden;overflow:hidden;margin:0 0 9px;transition:height .3s cubic-bezier(.4,0,.2,1),opacity .4s ease-in-out,visibility .4s ease-in-out}.summary-area-panels.is-active{opacity:1;pointer-events:auto;visibility:visible;overflow:visible;transition:height .3s cubic-bezier(.4,0,.2,1),opacity .4s ease-in-out,visibility .4s ease-in-out}.summary-area-panels.loading-active{display:flex;align-items:center;justify-content:center;opacity:1;transition:opacity .4s ease-in-out}.summary-area-panel{transform-origin:top center;opacity:0;pointer-events:none;transition:opacity .4s ease-in-out;position:absolute;top:0;left:0;right:0}.summary-area-panel__body{will-change:opacity}.summary-area-panel.is-active{opacity:1;pointer-events:auto;position:relative;transition:opacity .4s ease-in-out}.summary-area-panel.is-active .summary-area-panel__body{overflow:visible}.summary-area-loading{display:flex;align-items:center;justify-content:center;gap:.75rem;margin:0 24px;padding:3px 0;opacity:0;transition:opacity 0s ease-in-out}.summary-area-loading.is-visible{opacity:1;transition:opacity .4s ease-in-out}.summary-area-loading .loading-text{color:var(--cds-alias-typography-color-300)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ClarityModule }, { kind: "component", type: i1$1.ClrAlert, selector: "clr-alert", inputs: ["clrAlertSizeSmall", "clrAlertClosable", "clrAlertAppLevel", "clrCloseButtonAriaLabel", "clrAlertLightweight", "clrAlertType", "clrAlertIcon", "clrAlertClosed"], outputs: ["clrAlertClosedChange"] }, { kind: "component", type: i1$1.ClrAlertItem, selector: "clr-alert-item" }, { kind: "directive", type: i1$1.ClrAlertText, selector: ".alert-text" }, { kind: "component", type: i1$1.ClrSpinner, selector: "clr-spinner", inputs: ["clrInline", "clrInverse", "clrSmall", "clrMedium"] }] }); }
|
|
16193
16479
|
}
|
|
16194
16480
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ClrSummaryArea, decorators: [{
|
|
16195
16481
|
type: Component,
|
|
16196
|
-
args: [{ selector: 'clr-summary-area', standalone: true, imports: [CommonModule, ClarityModule], template: "
|
|
16482
|
+
args: [{ selector: 'clr-summary-area', standalone: true, imports: [CommonModule, ClarityModule], template: "<div\n #panelsRef\n class=\"summary-area-panels\"\n [class.is-active]=\"!isCollapsed()\"\n [class.loading-active]=\"hasLoading\"\n [style.height]=\"panelHeight\"\n>\n <div\n class=\"summary-area-panel summary-area-panel--state\"\n [class.is-active]=\"!isCollapsed() && (hasLoading || hasError || hasWarning)\"\n [class.is-error]=\"hasError\"\n [class.is-warning]=\"hasWarning\"\n [style.--rows]=\"currentRows\"\n [attr.aria-hidden]=\"isCollapsed() || !(hasLoading || hasError || hasWarning) ? 'true' : 'false'\"\n [attr.inert]=\"isCollapsed() || !(hasLoading || hasError || hasWarning) ? '' : null\"\n >\n <div class=\"summary-area-panel__body\">\n <div\n class=\"summary-area-loading\"\n [class.is-visible]=\"loadingVisible\"\n [attr.aria-hidden]=\"!hasLoading\"\n [style.height]=\"loadingPanelHeight\"\n >\n <clr-spinner [clrMedium]=\"true\"></clr-spinner>\n <span class=\"loading-text\">{{ loadingText }}</span>\n </div>\n @if (hasError) {\n <div class=\"summary-area-alert\">\n <clr-alert [clrAlertLightweight]=\"true\" [clrAlertType]=\"'danger'\">\n <clr-alert-item>\n @if (errorLinkText && errorClick) {\n <span class=\"alert-text\">{{ errorText }}</span>\n <span class=\"alert-action\" (click)=\"errorClick()\" (keydown.enter)=\"errorClick()\">{{ errorLinkText }}</span>\n } @else if (errorClick) {\n <span class=\"alert-action\" (click)=\"errorClick()\" (keydown.enter)=\"errorClick()\">{{ errorText }}</span>\n } @else {\n <span class=\"alert-text\">{{ errorText }}</span>\n }\n </clr-alert-item>\n </clr-alert>\n </div>\n } @else if (hasWarning) {\n <div class=\"summary-area-alert\">\n <clr-alert [clrAlertLightweight]=\"true\" [clrAlertType]=\"'warning'\">\n <clr-alert-item>\n @if (warningLinkText && warningClick) {\n <span class=\"alert-text\">{{ warningText }}</span>\n <span class=\"alert-action\" (click)=\"warningClick()\" (keydown.enter)=\"warningClick()\"\n >{{ warningLinkText }}</span\n >\n } @else if (warningClick) {\n <span class=\"alert-action\" (click)=\"warningClick()\" (keydown.enter)=\"warningClick()\"\n >{{ warningText }}</span\n >\n } @else {\n <span class=\"alert-text\">{{ warningText }}</span>\n }\n </clr-alert-item>\n </clr-alert>\n </div>\n }\n </div>\n </div>\n\n <div\n class=\"summary-area-panel summary-area-panel--grid\"\n [class.is-active]=\"!isCollapsed() && !hasError && !hasWarning && !hasLoading\"\n [attr.aria-hidden]=\"isCollapsed() || hasError || hasWarning || hasLoading ? 'true' : 'false'\"\n [attr.inert]=\"isCollapsed() || hasError || hasWarning || hasLoading ? '' : null\"\n >\n <div class=\"summary-area-panel__body\">\n <div class=\"summary-area-container\">\n <div class=\"summary-grid\" [style.--columns]=\"currentColumns\" [style.--rows]=\"currentRows\">\n <ng-container *ngFor=\"let item of visibleItems\">\n <ng-container *ngTemplateOutlet=\"item.template\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: [".summary-area-container,.summary-area-alert{margin:0 24px 9px;max-width:100%;overflow-x:auto}.summary-grid{display:grid;grid-template-columns:repeat(var(--columns),minmax(0,320px));grid-template-rows:repeat(var(--rows),auto);grid-auto-flow:column;max-width:100%;column-gap:36px;row-gap:6px;padding:3px 0}.summary-item{max-width:320px;min-width:0;height:20px;overflow:visible;display:flex;flex-direction:column}clr-alert-item{display:flex;align-items:center;gap:.5rem;flex-wrap:nowrap}clr-alert-item .alert-text{flex:none;width:auto;white-space:nowrap;align-self:flex-start}clr-alert-item .alert-action{white-space:nowrap}.alert-action{color:var(--cds-alias-typography-link-color)!important;cursor:pointer}.alert-action:visited{color:var(--cds-alias-typography-link-color-visited)}.alert-action:hover,.alert-action:focus{color:var(--cds-alias-typography-link-color-hover)}clr-alert ::ng-deep>.alert-lightweight{padding-left:0;padding-right:0}.summary-area-panels{position:relative;height:0;opacity:0;transform-origin:top center;pointer-events:none;visibility:hidden;overflow:hidden;margin:0 0 9px;transition:height .3s cubic-bezier(.4,0,.2,1),opacity .4s ease-in-out,visibility .4s ease-in-out}.summary-area-panels.is-active{opacity:1;pointer-events:auto;visibility:visible;overflow:visible;transition:height .3s cubic-bezier(.4,0,.2,1),opacity .4s ease-in-out,visibility .4s ease-in-out}.summary-area-panels.loading-active{display:flex;align-items:center;justify-content:center;opacity:1;transition:opacity .4s ease-in-out}.summary-area-panel{transform-origin:top center;opacity:0;pointer-events:none;transition:opacity .4s ease-in-out;position:absolute;top:0;left:0;right:0}.summary-area-panel__body{will-change:opacity}.summary-area-panel.is-active{opacity:1;pointer-events:auto;position:relative;transition:opacity .4s ease-in-out}.summary-area-panel.is-active .summary-area-panel__body{overflow:visible}.summary-area-loading{display:flex;align-items:center;justify-content:center;gap:.75rem;margin:0 24px;padding:3px 0;opacity:0;transition:opacity 0s ease-in-out}.summary-area-loading.is-visible{opacity:1;transition:opacity .4s ease-in-out}.summary-area-loading .loading-text{color:var(--cds-alias-typography-color-300)}\n"] }]
|
|
16197
16483
|
}], ctorParameters: () => [], propDecorators: { items: [{
|
|
16198
16484
|
type: ContentChildren,
|
|
16199
16485
|
args: [ClrSummaryItem, { descendants: true }]
|
|
16486
|
+
}], panelsRef: [{
|
|
16487
|
+
type: ViewChild,
|
|
16488
|
+
args: ['panelsRef', { static: true }]
|
|
16200
16489
|
}], onResize: [{
|
|
16201
16490
|
type: HostListener,
|
|
16202
16491
|
args: ['window:resize']
|