@porscheinformatik/clr-addons 19.15.2 → 19.17.0
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/charts/area-chart/area-chart.component.d.ts +40 -0
- package/charts/bar-chart/bar-chart.component.d.ts +92 -0
- package/charts/chart-alert-overlay/chart-alert-overlay.component.d.ts +7 -0
- package/charts/chart-export/chart-export-button.component.d.ts +9 -0
- package/charts/chart-export/chart-export.service.d.ts +10 -0
- package/charts/chart-legend/chart-legend.component.d.ts +12 -0
- package/charts/chart-tooltip/chart-tooltip.component.d.ts +16 -0
- package/charts/charts.module.d.ts +21 -0
- package/charts/combo-chart/combo-chart.component.d.ts +77 -0
- package/charts/constants/alert-message-constants.d.ts +5 -0
- package/charts/constants/index.d.ts +1 -0
- package/charts/directives/auto-position.directive.d.ts +16 -0
- package/charts/directives/index.d.ts +4 -0
- package/charts/directives/outside-click.directive.d.ts +10 -0
- package/charts/directives/screen-state.service.d.ts +35 -0
- package/charts/directives/tenant-full-date-range.directive.d.ts +10 -0
- package/charts/directives/window-resize.directive.d.ts +12 -0
- package/charts/funnel-chart/funnel-chart.component.d.ts +153 -0
- package/charts/index.d.ts +8 -0
- package/charts/line-chart/line-chart.component.d.ts +40 -0
- package/charts/pie-chart/pie-chart.component.d.ts +39 -0
- package/charts/shared/chart-base.d.ts +37 -0
- package/charts/shared/chart-skeleton.component.d.ts +8 -0
- package/charts/shared/d3-chart-axes.d.ts +28 -0
- package/charts/shared/d3-dots.d.ts +10 -0
- package/charts/shared/xy-chart.types.d.ts +35 -0
- package/charts/utils/color.utils.d.ts +9 -0
- package/charts/utils/index.d.ts +3 -0
- package/charts/utils/text.utils.d.ts +8 -0
- package/charts/utils/utils.d.ts +2 -0
- package/clr-addons.module.d.ts +4 -3
- package/control-enter-submit/clr-control-enter-submit.directive.d.ts +1 -1
- package/copy-to-clipboard/copy-to-clipboard.d.ts +30 -0
- package/copy-to-clipboard/index.d.ts +1 -0
- package/fesm2022/clr-addons.mjs +2834 -308
- package/fesm2022/clr-addons.mjs.map +1 -1
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/styles/clr-addons-phs.css +52 -0
- 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/summary-area/index.d.ts +0 -1
- package/summary-area/summary-item-value-copy-button/summary-item-value-copy-button.d.ts +0 -24
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ChartLegendItem } from '../chart-legend/chart-legend.component';
|
|
3
|
+
import { ChartBase } from '../shared/chart-base';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface PieChartData {
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
fullLabel?: string;
|
|
9
|
+
value: number;
|
|
10
|
+
color: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PieChartValue {
|
|
13
|
+
key: string;
|
|
14
|
+
label: string;
|
|
15
|
+
value: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class PieChartComponent extends ChartBase<PieChartData> implements OnChanges {
|
|
18
|
+
readonly data: import("@angular/core").InputSignal<PieChartData[]>;
|
|
19
|
+
readonly donut: import("@angular/core").InputSignal<boolean>;
|
|
20
|
+
readonly showLegend: import("@angular/core").InputSignal<boolean>;
|
|
21
|
+
readonly showExportButton: import("@angular/core").InputSignal<boolean>;
|
|
22
|
+
readonly exportFilename: import("@angular/core").InputSignal<string>;
|
|
23
|
+
readonly tooltipOrientation: import("@angular/core").InputSignal<"top" | "bottom">;
|
|
24
|
+
readonly noItemsMessage: import("@angular/core").InputSignal<string>;
|
|
25
|
+
readonly tooltipPercentOfTotal: import("@angular/core").InputSignal<string>;
|
|
26
|
+
readonly valueClicked: import("@angular/core").OutputEmitterRef<PieChartValue>;
|
|
27
|
+
protected readonly hasData: import("@angular/core").Signal<boolean>;
|
|
28
|
+
protected readonly total: import("@angular/core").Signal<number>;
|
|
29
|
+
readonly alertMessageAndType: import("@angular/core").Signal<[string, string]>;
|
|
30
|
+
readonly legendItems: import("@angular/core").Signal<ChartLegendItem[]>;
|
|
31
|
+
private svg;
|
|
32
|
+
private arcGen;
|
|
33
|
+
ngOnChanges(_changes: SimpleChanges): void;
|
|
34
|
+
ngAfterViewInit(): void;
|
|
35
|
+
protected updateChart(): void;
|
|
36
|
+
private openTooltip;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PieChartComponent, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PieChartComponent, "clr-pie-chart", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "donut": { "alias": "donut"; "required": false; "isSignal": true; }; "showLegend": { "alias": "showLegend"; "required": false; "isSignal": true; }; "showExportButton": { "alias": "showExportButton"; "required": false; "isSignal": true; }; "exportFilename": { "alias": "exportFilename"; "required": false; "isSignal": true; }; "tooltipOrientation": { "alias": "tooltipOrientation"; "required": false; "isSignal": true; }; "noItemsMessage": { "alias": "noItemsMessage"; "required": false; "isSignal": true; }; "tooltipPercentOfTotal": { "alias": "tooltipPercentOfTotal"; "required": false; "isSignal": true; }; }, { "valueClicked": "valueClicked"; }, never, never, false, never>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Abstract base class shared by all chart components.
|
|
5
|
+
* ...
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class ChartBase<TSelected = unknown> implements AfterViewInit {
|
|
8
|
+
/** Whether the chart is in loading state (shows skeleton). */
|
|
9
|
+
readonly loading: import("@angular/core").InputSignal<boolean>;
|
|
10
|
+
/** Reference to the `<svg #chart>` element in the component template. */
|
|
11
|
+
protected readonly chartRef: import("@angular/core").Signal<ElementRef<any>>;
|
|
12
|
+
/** Reference to the `<div #container>` host element in the component template. */
|
|
13
|
+
protected readonly containerRef: import("@angular/core").Signal<ElementRef<any>>;
|
|
14
|
+
/** Exposes the raw SVG element for the chart-export button. */
|
|
15
|
+
readonly svgElement: import("@angular/core").Signal<SVGSVGElement>;
|
|
16
|
+
protected readonly selectedItem: import("@angular/core").WritableSignal<TSelected>;
|
|
17
|
+
protected readonly tooltipPosition: import("@angular/core").WritableSignal<{
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
}>;
|
|
21
|
+
/** Schedules the first render after the view is ready. */
|
|
22
|
+
ngAfterViewInit(): void;
|
|
23
|
+
/** Each chart implements its own D3 rendering logic here. */
|
|
24
|
+
protected abstract updateChart(): void;
|
|
25
|
+
/** Returns the pixel dimensions of the container div. */
|
|
26
|
+
protected getContainerDimensions(): {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Clears the active tooltip. Override in subclasses that have additional
|
|
32
|
+
* selection state
|
|
33
|
+
*/
|
|
34
|
+
resetTooltip(): void;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChartBase<any>, never>;
|
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ChartBase<any>, never, never, { "loading": { "alias": "loading"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class ChartSkeletonComponent {
|
|
3
|
+
readonly skeletonType: import("@angular/core").InputSignal<"placeholder" | "loading">;
|
|
4
|
+
readonly orientation: import("@angular/core").InputSignal<"horizontal" | "vertical">;
|
|
5
|
+
protected readonly animationStyle: import("@angular/core").Signal<string>;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChartSkeletonComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChartSkeletonComponent, "cng-bar-chart-skeleton", never, { "skeletonType": { "alias": "skeletonType"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AxisScale, ScaleLinear, Selection } from 'd3';
|
|
2
|
+
/** Options passed to {@link drawXYAxes}. */
|
|
3
|
+
export interface XYAxisOptions {
|
|
4
|
+
/** Maps each X key to its display label. */
|
|
5
|
+
xLabelMap: Map<string, string>;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
/** Optional description label rendered below the X axis. */
|
|
9
|
+
xAxisLabel?: string;
|
|
10
|
+
/** Optional description label rendered rotated left of the Y axis. */
|
|
11
|
+
yAxisLabel?: string;
|
|
12
|
+
/** Left margin already accounting for the Y-axis label offset. */
|
|
13
|
+
effectiveLeft: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Draws the X and Y axes (with integer-only Y ticks and grid lines) plus
|
|
17
|
+
* optional description labels onto the given D3 group.
|
|
18
|
+
*
|
|
19
|
+
* @param g The D3 group element to append into.
|
|
20
|
+
* @param x Any D3 axis scale keyed on strings (`ScalePoint` or `ScaleBand`).
|
|
21
|
+
* @param y The linear Y scale.
|
|
22
|
+
* @param opts Axis configuration options.
|
|
23
|
+
*/
|
|
24
|
+
export declare function drawXYAxes(g: Selection<SVGGElement, unknown, null, undefined>, x: AxisScale<string>, y: ScaleLinear<number, number>, opts: XYAxisOptions): void;
|
|
25
|
+
/**
|
|
26
|
+
* Styles all D3 grid tick lines inside `g` with the neutral chart grid color.
|
|
27
|
+
*/
|
|
28
|
+
export declare function styleGridLines(g: Selection<SVGGElement, unknown, null, undefined>): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ScaleLinear, ScalePoint, Selection } from 'd3';
|
|
2
|
+
import { XYChartPoint, XYChartSeries } from './xy-chart.types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders interactive dot circles for a single XY series onto the given D3 group.
|
|
5
|
+
*
|
|
6
|
+
* - Default radius: 4px, hover radius: 6px.
|
|
7
|
+
* - Calls `onClick` with the clicked element, data point and series when a dot is clicked.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare function renderDots(g: Selection<SVGGElement, unknown, null, undefined>, series: XYChartSeries, x: ScalePoint<string>, y: ScaleLinear<number, number>, onClick: (el: SVGCircleElement, point: XYChartPoint, series: XYChartSeries) => void): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single data point on an XY chart (line, area).
|
|
3
|
+
* `x` is used as the category key; `xLabel` is the optional display label for the axis tick.
|
|
4
|
+
*/
|
|
5
|
+
export interface XYChartPoint {
|
|
6
|
+
/** Unique key used as the X-axis category. */
|
|
7
|
+
x: string;
|
|
8
|
+
/** Optional display label for the X-axis tick (defaults to `x`). */
|
|
9
|
+
xLabel?: string;
|
|
10
|
+
/** Y value. */
|
|
11
|
+
value: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A named data series for an XY chart.
|
|
15
|
+
*/
|
|
16
|
+
export interface XYChartSeries {
|
|
17
|
+
/** Unique identifier. */
|
|
18
|
+
key: string;
|
|
19
|
+
/** Display name shown in the legend and tooltip. */
|
|
20
|
+
label: string;
|
|
21
|
+
/** Line / area / dot colour. Accepts hex or CSS custom property. */
|
|
22
|
+
color: string;
|
|
23
|
+
/** Ordered data points for this series. */
|
|
24
|
+
data: XYChartPoint[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Emitted when the user clicks a data point on an XY chart.
|
|
28
|
+
*/
|
|
29
|
+
export interface XYChartValue {
|
|
30
|
+
seriesKey: string;
|
|
31
|
+
seriesLabel: string;
|
|
32
|
+
x: string;
|
|
33
|
+
xLabel?: string;
|
|
34
|
+
value: number;
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a chart color value to a CSS-compatible string.
|
|
3
|
+
*
|
|
4
|
+
* Supports:
|
|
5
|
+
* - Hex values: '#e57200' → returned as-is
|
|
6
|
+
* - CSS custom props: '--cds-global-color-lavender-1000' → wrapped in var(...)
|
|
7
|
+
* - Any other string: 'rgb(...)' / 'hsl(...)' → returned as-is
|
|
8
|
+
*/
|
|
9
|
+
export declare function toChartColor(color: string | undefined): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class TextRenderer {
|
|
2
|
+
private canvas;
|
|
3
|
+
private context;
|
|
4
|
+
private cachedFont;
|
|
5
|
+
private cachedEllipsisWidth;
|
|
6
|
+
constructor();
|
|
7
|
+
render(text: string, availableHeight: number, availableWidth: number, fontSize?: string, fontFamily?: string): string;
|
|
8
|
+
}
|
package/clr-addons.module.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./
|
|
3
|
-
import * as i2 from "./
|
|
2
|
+
import * as i1 from "./focus-first-invalid-field/focus-first-invalid-field.directive";
|
|
3
|
+
import * as i2 from "./control-enter-submit/clr-control-enter-submit.directive";
|
|
4
4
|
import * as i3 from "./view-edit-section/view-edit-section.module";
|
|
5
5
|
import * as i4 from "./pager/pager.module";
|
|
6
6
|
import * as i5 from "./dot-pager/dot-pager.module";
|
|
@@ -38,8 +38,9 @@ import * as i36 from "./action-panel/action-panel.module";
|
|
|
38
38
|
import * as i37 from "./readonly/readonly.module";
|
|
39
39
|
import * as i38 from "./datagrid/column-reorder/datagrid-column-reorder.module";
|
|
40
40
|
import * as i39 from "./signpost/signpost.module";
|
|
41
|
+
import * as i40 from "./charts/charts.module";
|
|
41
42
|
export declare class ClrAddonsModule {
|
|
42
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<ClrAddonsModule, never>;
|
|
43
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ClrAddonsModule, [typeof i1.
|
|
44
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ClrAddonsModule, never, [typeof i1.ClrFocusFirstInvalidFieldDirective, typeof i2.ClrControlEnterSubmitDirective], [typeof i3.ClrViewEditSectionModule, typeof i4.ClrPagerModule, typeof i5.ClrDotPagerModule, typeof i6.ClrPagedSearchResultListModule, typeof i7.ClrCollapseExpandSectionModule, typeof i8.ClrBreadcrumbModule, typeof i9.ClrMainNavGroupModule, typeof i10.ClrContentPanelModule, typeof i11.ClrNotificationModule, typeof i12.ClrFlowBarModule, typeof i13.ClrBackButtonModule, typeof i14.ClrNumericFieldModule, typeof i15.ClrSearchFieldModule, typeof i16.ClrTreetableModule, typeof i17.ClrProgressSpinnerModule, typeof i18.ClrDateTimeModule, typeof i19.ClrQuickListModule, typeof i20.ClrIconAvatarModule, typeof i21.ClrLetterAvatarModule, typeof i22.ClrMultilingualModule, typeof i23.ClrGenericQuickListModule, typeof i24.ClrDataListValidatorModule, typeof i25.ClrHistoryModule, typeof i26.ClrAutocompleteOffModule, typeof i27.ClrBrandAvatarModule, typeof i28.ClrLocationBarModule, typeof i29.ClrFormModule, typeof i30.ClrDropdownOverflowModule, typeof i31.ClrDatagridStatePersistenceModule, typeof i32.ClrEnumFilterModule, typeof i33.ClrDateFilterModule, typeof i34.ClrDaterangepickerModule, typeof i35.ClrIfWarningModule, typeof i36.ClrActionPanelModule, typeof i37.ClrReadonlyDirectiveModule, typeof i38.ClrDatagridColumnReorderModule, typeof i39.ClrSignpostAddonModule, typeof i1.ClrFocusFirstInvalidFieldDirective, typeof i2.ClrControlEnterSubmitDirective, typeof i40.ClrChartsModule]>;
|
|
44
45
|
static ɵinj: i0.ɵɵInjectorDeclaration<ClrAddonsModule>;
|
|
45
46
|
}
|
|
@@ -12,5 +12,5 @@ export declare class ClrControlEnterSubmitDirective implements AfterContentInit,
|
|
|
12
12
|
ngAfterViewChecked(): void;
|
|
13
13
|
private setTooltip;
|
|
14
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<ClrControlEnterSubmitDirective, [null, null, { optional: true; host: true; }]>;
|
|
15
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ClrControlEnterSubmitDirective, "form[clrControlEnterSubmit]", never, { "tooltipText": { "alias": "clrControlEnterSubmit"; "required": false; }; }, {}, never, never,
|
|
15
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClrControlEnterSubmitDirective, "form[clrControlEnterSubmit]", never, { "tooltipText": { "alias": "clrControlEnterSubmit"; "required": false; }; }, {}, never, never, true, never>;
|
|
16
16
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ClrCopyToClipboard implements OnInit, AfterViewInit, OnDestroy {
|
|
4
|
+
value: import("@angular/core").InputSignal<string>;
|
|
5
|
+
tooltipText: import("@angular/core").InputSignal<string>;
|
|
6
|
+
hiddenUntilHovered: import("@angular/core").InputSignal<boolean>;
|
|
7
|
+
showCopiedIcon: boolean;
|
|
8
|
+
parentHovered: boolean;
|
|
9
|
+
protected tooltipSize: string;
|
|
10
|
+
tooltipPosition: 'bottom-right' | 'bottom-left';
|
|
11
|
+
private readonly cdr;
|
|
12
|
+
private readonly elementRef;
|
|
13
|
+
private resetTimeout;
|
|
14
|
+
private resizeListener?;
|
|
15
|
+
private parentEnterListener?;
|
|
16
|
+
private parentLeaveListener?;
|
|
17
|
+
ngOnInit(): void;
|
|
18
|
+
ngAfterViewInit(): void;
|
|
19
|
+
ngOnDestroy(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Called when the clipboard copy operation completes.
|
|
22
|
+
* @param success Whether the copy was successful
|
|
23
|
+
*/
|
|
24
|
+
onCopied(success: boolean): void;
|
|
25
|
+
private setupParentHoverListeners;
|
|
26
|
+
private teardownParentHoverListeners;
|
|
27
|
+
private updateTooltipPosition;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClrCopyToClipboard, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ClrCopyToClipboard, "clr-copy-to-clipboard", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "tooltipText": { "alias": "tooltipText"; "required": false; "isSignal": true; }; "hiddenUntilHovered": { "alias": "hiddenUntilHovered"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './copy-to-clipboard';
|