@agorapulse/ui-charts 20.1.16 → 20.1.17

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import * as i0 from '@angular/core';
2
- import { AfterViewInit, OnChanges, OnDestroy, ElementRef, SimpleChanges, EventEmitter } from '@angular/core';
3
- import { Options, SeriesOptions, Chart, SeriesBarOptions, SeriesColumnOptions, SeriesHeatmapOptions, SeriesOptionsType, Series, SeriesPieOptions, SeriesSplineOptions } from 'highcharts';
1
+ import * as _angular_core from '@angular/core';
2
+ import { Signal } from '@angular/core';
3
+ import Highcharts, { Options, Chart, SeriesBarOptions, SeriesColumnOptions, SeriesHeatmapOptions, SeriesOptionsType, Series, SeriesPieOptions, SeriesSplineOptions } from 'highcharts';
4
4
 
5
5
  declare enum ChartColor {
6
6
  Grey = 0,
@@ -85,79 +85,65 @@ declare class ChartColors {
85
85
  static getColors(seriesCount: number, color: ChartColor | undefined): string[];
86
86
  }
87
87
 
88
- declare abstract class AbstractChartComponent implements AfterViewInit, OnChanges, OnDestroy {
89
- chartRef: ElementRef;
90
- chartOptions: Options;
91
- color: ChartColor;
92
- labelDateFormat: string;
93
- locale: string;
94
- series: SeriesOptions[];
95
- protected chart: Chart;
88
+ declare abstract class AbstractChartComponent {
89
+ private readonly destroyRef;
90
+ /** Highcharts renders into the component's host element directly — no inner template ref needed. */
91
+ protected readonly hostElement: HTMLElement;
92
+ readonly chartOptions: _angular_core.InputSignal<Options>;
93
+ readonly color: _angular_core.InputSignal<ChartColor>;
94
+ readonly labelDateFormat: _angular_core.InputSignal<string>;
95
+ readonly locale: _angular_core.InputSignal<string>;
96
+ protected chart?: Chart;
97
+ private readonly viewReady;
96
98
  private resizeObserver?;
97
- ngOnChanges(changes: SimpleChanges): void;
98
- ngAfterViewInit(): void;
99
- ngOnDestroy(): void;
100
- abstract initChart(): void;
101
- static ɵfac: i0.ɵɵFactoryDeclaration<AbstractChartComponent, never>;
102
- static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractChartComponent, never, never, { "chartOptions": { "alias": "chartOptions"; "required": false; }; "color": { "alias": "color"; "required": false; }; "labelDateFormat": { "alias": "labelDateFormat"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "series": { "alias": "series"; "required": false; }; }, {}, never, never, true, never>;
99
+ /** Each subclass exposes its typed series input here so the base can react to it. */
100
+ protected abstract readonly series: Signal<readonly unknown[]>;
101
+ constructor();
102
+ protected abstract initChart(): void;
103
+ private onResize;
104
+ private rebuild;
105
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AbstractChartComponent, never>;
106
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AbstractChartComponent, never, never, { "chartOptions": { "alias": "chartOptions"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "labelDateFormat": { "alias": "labelDateFormat"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
103
107
  }
104
108
 
105
109
  declare class ChartBarComponent extends AbstractChartComponent {
106
- categories: string[];
107
- opposite: boolean;
108
- stacked: boolean;
109
- series: SeriesBarOptions[];
110
+ readonly categories: _angular_core.InputSignal<string[]>;
111
+ readonly opposite: _angular_core.InputSignal<boolean>;
112
+ readonly stacked: _angular_core.InputSignal<boolean>;
113
+ readonly series: _angular_core.InputSignal<SeriesBarOptions[]>;
110
114
  initChart(): void;
111
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartBarComponent, never>;
112
- static ɵcmp: i0.ɵɵComponentDeclaration<ChartBarComponent, "ap-chart-bar", never, { "categories": { "alias": "categories"; "required": false; }; "opposite": { "alias": "opposite"; "required": false; }; "stacked": { "alias": "stacked"; "required": false; }; "series": { "alias": "series"; "required": false; }; }, {}, never, never, true, never>;
115
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartBarComponent, never>;
116
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartBarComponent, "ap-chart-bar", never, { "categories": { "alias": "categories"; "required": false; "isSignal": true; }; "opposite": { "alias": "opposite"; "required": false; "isSignal": true; }; "stacked": { "alias": "stacked"; "required": false; "isSignal": true; }; "series": { "alias": "series"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
113
117
  }
114
118
 
115
119
  declare class ChartColumnComponent extends AbstractChartComponent {
116
- series: SeriesColumnOptions[];
117
- stacked: i0.InputSignal<boolean>;
118
- chartInitialized: EventEmitter<Chart>;
120
+ readonly stacked: _angular_core.InputSignal<boolean>;
121
+ readonly series: _angular_core.InputSignal<SeriesColumnOptions[]>;
122
+ readonly chartInitialized: _angular_core.OutputEmitterRef<Chart>;
119
123
  initChart(): void;
120
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartColumnComponent, never>;
121
- static ɵcmp: i0.ɵɵComponentDeclaration<ChartColumnComponent, "ap-chart-column", never, { "series": { "alias": "series"; "required": false; }; "stacked": { "alias": "stacked"; "required": false; "isSignal": true; }; }, { "chartInitialized": "chartInitialized"; }, never, never, true, never>;
124
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartColumnComponent, never>;
125
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartColumnComponent, "ap-chart-column", never, { "stacked": { "alias": "stacked"; "required": false; "isSignal": true; }; "series": { "alias": "series"; "required": false; "isSignal": true; }; }, { "chartInitialized": "chartInitialized"; }, never, never, true, never>;
122
126
  }
123
127
 
124
- type LabelKeys = 'least' | 'most';
128
+ type LegendLabels = {
129
+ least: string;
130
+ most: string;
131
+ };
125
132
  declare class ChartHeatmapComponent extends AbstractChartComponent {
126
- categoriesX: string[];
127
- categoriesY: string[];
128
- series: SeriesHeatmapOptions[];
129
- legendLabels: i0.InputSignal<Record<LabelKeys, string> | undefined>;
130
- private readonly legendLabelsEffect;
131
- initChart(): void;
132
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartHeatmapComponent, never>;
133
- static ɵcmp: i0.ɵɵComponentDeclaration<ChartHeatmapComponent, "ap-chart-heatmap", never, { "categoriesX": { "alias": "categoriesX"; "required": false; }; "categoriesY": { "alias": "categoriesY"; "required": false; }; "series": { "alias": "series"; "required": false; }; "legendLabels": { "alias": "legendLabels"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
134
- }
135
-
136
- declare enum ChartMetricType {
137
- default = 0,
138
- total = 1
139
- }
140
- declare class ChartMetric {
141
- children?: ChartMetric[];
142
- name: string;
143
- type?: ChartMetricType;
144
- value: number;
145
- }
146
-
147
- declare class ChartMetricsListComponent {
148
- metrics: ChartMetric[];
149
- locale: string;
150
- ChartMetricType: typeof ChartMetricType;
151
- digitsInfo: string;
152
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartMetricsListComponent, never>;
153
- static ɵcmp: i0.ɵɵComponentDeclaration<ChartMetricsListComponent, "ap-chart-metrics-list", never, { "metrics": { "alias": "metrics"; "required": true; }; "locale": { "alias": "locale"; "required": false; }; }, {}, never, never, true, never>;
133
+ readonly categoriesX: _angular_core.InputSignal<string[]>;
134
+ readonly categoriesY: _angular_core.InputSignal<string[]>;
135
+ readonly series: _angular_core.InputSignal<SeriesHeatmapOptions[]>;
136
+ readonly legendLabels: _angular_core.InputSignal<LegendLabels | undefined>;
137
+ protected initChart(): void;
138
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartHeatmapComponent, never>;
139
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartHeatmapComponent, "ap-chart-heatmap", never, { "categoriesX": { "alias": "categoriesX"; "required": false; "isSignal": true; }; "categoriesY": { "alias": "categoriesY"; "required": false; "isSignal": true; }; "series": { "alias": "series"; "required": false; "isSignal": true; }; "legendLabels": { "alias": "legendLabels"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
154
140
  }
155
141
 
156
142
  declare class ChartMixedComponent extends AbstractChartComponent {
157
- series: SeriesOptionsType[];
158
- initChart(): void;
159
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartMixedComponent, never>;
160
- static ɵcmp: i0.ɵɵComponentDeclaration<ChartMixedComponent, "ap-chart-mixed", never, { "series": { "alias": "series"; "required": false; }; }, {}, never, never, true, never>;
143
+ readonly series: _angular_core.InputSignal<SeriesOptionsType[]>;
144
+ protected initChart(): void;
145
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartMixedComponent, never>;
146
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartMixedComponent, "ap-chart-mixed", never, { "series": { "alias": "series"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
161
147
  }
162
148
 
163
149
  interface SeriesRoundedColumnOptions extends SeriesColumnOptions {
@@ -169,39 +155,39 @@ interface SeriesRoundedColumnOptions extends SeriesColumnOptions {
169
155
  }
170
156
 
171
157
  declare class ChartOptions {
172
- static readonly DEFAULT_DATE_FORMAT: string;
158
+ static readonly DEFAULT_DATE_FORMAT = "%A, %b %e, %Y";
173
159
  static readonly DEFAULT_OPTIONS: Options;
174
160
  static build(options: Options, locale: string): Options;
175
161
  static configure(series: SeriesOptionsType[], options: Options, color: ChartColor | undefined, labelDateFormat?: string): void;
176
162
  static redrawWithHighestEdgesRounded(chart: Chart): void;
177
163
  static roundHighestSerie(series: Series[], serie: SeriesRoundedColumnOptions, serieIndex: number): void;
178
- private static getPointX;
179
- private static findPointAtAbscissa;
180
- private static getPointValue;
181
164
  }
165
+ /**
166
+ * Deep-merges `source` onto a clone of `target` without mutating either, with one deliberate
167
+ * deviation from `es-toolkit`'s `toMerged`: arrays are treated as opaque values (replaced wholesale)
168
+ * rather than element-merged, which matches how Highcharts options are intended to be overridden.
169
+ */
182
170
  declare function mergeDeep(target: any, source: any): any;
183
171
 
184
172
  declare class ChartPieComponent extends AbstractChartComponent {
185
- innerLabels: boolean;
186
- mouseEventEnabled: boolean;
187
- series: SeriesPieOptions[];
188
- colors: i0.InputSignal<string[] | undefined>;
189
- metricFormat: i0.InputSignal<"value" | "percentage">;
190
- private domReady;
191
- constructor();
192
- initChart(): void;
193
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartPieComponent, never>;
194
- static ɵcmp: i0.ɵɵComponentDeclaration<ChartPieComponent, "ap-chart-pie", never, { "innerLabels": { "alias": "innerLabels"; "required": false; }; "mouseEventEnabled": { "alias": "mouseEventEnabled"; "required": false; }; "series": { "alias": "series"; "required": false; }; "colors": { "alias": "colors"; "required": false; "isSignal": true; }; "metricFormat": { "alias": "metricFormat"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
173
+ readonly innerLabels: _angular_core.InputSignal<boolean>;
174
+ readonly mouseEventEnabled: _angular_core.InputSignal<boolean>;
175
+ readonly series: _angular_core.InputSignal<SeriesPieOptions[]>;
176
+ readonly colors: _angular_core.InputSignal<string[] | undefined>;
177
+ readonly metricFormat: _angular_core.InputSignal<"value" | "percentage">;
178
+ protected initChart(): void;
179
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartPieComponent, never>;
180
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartPieComponent, "ap-chart-pie", never, { "innerLabels": { "alias": "innerLabels"; "required": false; "isSignal": true; }; "mouseEventEnabled": { "alias": "mouseEventEnabled"; "required": false; "isSignal": true; }; "series": { "alias": "series"; "required": false; "isSignal": true; }; "colors": { "alias": "colors"; "required": false; "isSignal": true; }; "metricFormat": { "alias": "metricFormat"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
195
181
  }
196
182
 
197
183
  declare class ChartSplineComponent extends AbstractChartComponent {
198
- series: SeriesSplineOptions[];
199
- chartInitialized: EventEmitter<Chart>;
200
- initChart(): void;
201
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartSplineComponent, never>;
202
- static ɵcmp: i0.ɵɵComponentDeclaration<ChartSplineComponent, "ap-chart-spline", never, { "series": { "alias": "series"; "required": false; }; }, { "chartInitialized": "chartInitialized"; }, never, never, true, never>;
184
+ readonly series: _angular_core.InputSignal<SeriesSplineOptions[]>;
185
+ readonly chartInitialized: _angular_core.OutputEmitterRef<Chart>;
186
+ protected initChart(): void;
187
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartSplineComponent, never>;
188
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartSplineComponent, "ap-chart-spline", never, { "series": { "alias": "series"; "required": false; "isSignal": true; }; }, { "chartInitialized": "chartInitialized"; }, never, never, true, never>;
203
189
  }
204
190
 
205
- declare const borderRadiusPlugin: (H: any) => void;
191
+ declare function borderRadiusPlugin(H: typeof Highcharts): void;
206
192
 
207
- export { AbstractChartComponent, ChartBarComponent, ChartColor, ChartColors, ChartColumnComponent, ChartHeatmapComponent, ChartMetric, ChartMetricType, ChartMetricsListComponent, ChartMixedComponent, ChartOptions, ChartPieComponent, ChartSplineComponent, borderRadiusPlugin, mergeDeep };
193
+ export { AbstractChartComponent, ChartBarComponent, ChartColor, ChartColors, ChartColumnComponent, ChartHeatmapComponent, ChartMixedComponent, ChartOptions, ChartPieComponent, ChartSplineComponent, borderRadiusPlugin, mergeDeep };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agorapulse/ui-charts",
3
3
  "description": "Agorapulse UI Charts Components Library",
4
- "version": "20.1.16",
4
+ "version": "20.1.17",
5
5
  "author": "Benoit Hediard",
6
6
  "repository": {
7
7
  "type": "git",
Binary file