@firestitch/report 18.18.2 → 18.20.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/app/reports/chart-axis-settings.d.ts +4 -0
- package/app/reports/components/report-canvas/report-canvas.component.d.ts +5 -1
- package/app/reports/components/report-component/report-component.component.d.ts +1 -0
- package/app/reports/dialogs/component-settings/component-settings.component.d.ts +24 -0
- package/app/reports/enums/report-chart-date-label.enum.d.ts +2 -1
- package/app/reports/enums/report-chart-span-mode.enum.d.ts +5 -0
- package/app/reports/enums/report-chart-span-through.enum.d.ts +3 -0
- package/app/reports/format.d.ts +1 -0
- package/app/reports/interfaces/canvas-landing-input.interface.d.ts +1 -0
- package/app/reports/interfaces/report-chart-axis-settings.interface.d.ts +6 -0
- package/app/reports/interfaces/report-chart-span.interface.d.ts +6 -0
- package/app/reports/interfaces/report.interface.d.ts +5 -0
- package/app/reports/views/report/fs-ai-report.component.d.ts +3 -0
- package/esm2022/app/reports/canvas-landing-page.mjs +7 -1
- package/esm2022/app/reports/chart-axis-settings.mjs +24 -0
- package/esm2022/app/reports/components/report-canvas/report-canvas.component.mjs +36 -4
- package/esm2022/app/reports/components/report-component/report-component.component.mjs +27 -4
- package/esm2022/app/reports/dialogs/component-settings/component-settings.component.mjs +121 -16
- package/esm2022/app/reports/enums/report-chart-date-label.enum.mjs +5 -2
- package/esm2022/app/reports/enums/report-chart-span-mode.enum.mjs +10 -0
- package/esm2022/app/reports/enums/report-chart-span-through.enum.mjs +11 -0
- package/esm2022/app/reports/format.mjs +3 -1
- package/esm2022/app/reports/interfaces/canvas-landing-input.interface.mjs +1 -1
- package/esm2022/app/reports/interfaces/report-chart-axis-settings.interface.mjs +2 -0
- package/esm2022/app/reports/interfaces/report-chart-span.interface.mjs +2 -0
- package/esm2022/app/reports/interfaces/report.interface.mjs +1 -1
- package/esm2022/app/reports/option-builder.mjs +34 -10
- package/esm2022/app/reports/views/report/fs-ai-report.component.mjs +32 -8
- package/esm2022/public_api.mjs +4 -1
- package/fesm2022/{firestitch-report-echarts-DKuqS_De.mjs → firestitch-report-echarts-CgZBsQWf.mjs} +2 -2
- package/fesm2022/{firestitch-report-echarts-DKuqS_De.mjs.map → firestitch-report-echarts-CgZBsQWf.mjs.map} +1 -1
- package/fesm2022/{firestitch-report-firestitch-report-CkTkXk5B.mjs → firestitch-report-firestitch-report-BQseFyHJ.mjs} +312 -59
- package/fesm2022/firestitch-report-firestitch-report-BQseFyHJ.mjs.map +1 -0
- package/fesm2022/firestitch-report.mjs +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +3 -0
- package/fesm2022/firestitch-report-firestitch-report-CkTkXk5B.mjs.map +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReportChartAxisSettings } from './interfaces/report-chart-axis-settings.interface';
|
|
2
|
+
import { ChartConfig } from './interfaces/report.interface';
|
|
3
|
+
export declare function chartAxisSettings(config: ChartConfig | null | undefined): ReportChartAxisSettings;
|
|
4
|
+
export declare function sameChartAxisSettings(a: ReportChartAxisSettings, b: ReportChartAxisSettings): boolean;
|
|
@@ -32,9 +32,11 @@ export declare class ReportCanvasComponent implements OnChanges, AfterViewInit {
|
|
|
32
32
|
report: Report;
|
|
33
33
|
editMode: boolean;
|
|
34
34
|
pageId: number | null;
|
|
35
|
+
busy: boolean;
|
|
35
36
|
componentSettings: EventEmitter<ReportComponent>;
|
|
36
37
|
reportChanged: EventEmitter<void>;
|
|
37
38
|
pageChanged: EventEmitter<number>;
|
|
39
|
+
refresh: EventEmitter<void>;
|
|
38
40
|
zoomPan: FsZoomPanComponent;
|
|
39
41
|
private _renderedComponents;
|
|
40
42
|
private _viewport;
|
|
@@ -64,6 +66,7 @@ export declare class ReportCanvasComponent implements OnChanges, AfterViewInit {
|
|
|
64
66
|
private _previousReportId;
|
|
65
67
|
private _emittedPageId;
|
|
66
68
|
private _editOnArrival;
|
|
69
|
+
private _keepPageId;
|
|
67
70
|
private _report;
|
|
68
71
|
private _pageValueComponents;
|
|
69
72
|
private _masterValueComponents;
|
|
@@ -104,6 +107,7 @@ export declare class ReportCanvasComponent implements OnChanges, AfterViewInit {
|
|
|
104
107
|
applyComponentSettings(componentId: number, settings: ComponentSettings): void;
|
|
105
108
|
selectComponent(componentId: number | null): void;
|
|
106
109
|
onCanvasPointerDown(): void;
|
|
110
|
+
refreshReport(): void;
|
|
107
111
|
onZoomed(scale: number): void;
|
|
108
112
|
zoomIn(): void;
|
|
109
113
|
zoomOut(): void;
|
|
@@ -139,6 +143,6 @@ export declare class ReportCanvasComponent implements OnChanges, AfterViewInit {
|
|
|
139
143
|
private _renderGuides;
|
|
140
144
|
private _clearGuides;
|
|
141
145
|
static ɵfac: i0.ɵɵFactoryDeclaration<ReportCanvasComponent, never>;
|
|
142
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ReportCanvasComponent, "app-report-canvas", never, { "report": { "alias": "report"; "required": false; }; "editMode": { "alias": "editMode"; "required": false; }; "pageId": { "alias": "pageId"; "required": false; }; }, { "componentSettings": "componentSettings"; "reportChanged": "reportChanged"; "pageChanged": "pageChanged"; }, never, never, true, never>;
|
|
146
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ReportCanvasComponent, "app-report-canvas", never, { "report": { "alias": "report"; "required": false; }; "editMode": { "alias": "editMode"; "required": false; }; "pageId": { "alias": "pageId"; "required": false; }; "busy": { "alias": "busy"; "required": false; }; }, { "componentSettings": "componentSettings"; "reportChanged": "reportChanged"; "pageChanged": "pageChanged"; "refresh": "refresh"; }, never, never, true, never>;
|
|
143
147
|
}
|
|
144
148
|
export {};
|
|
@@ -87,6 +87,7 @@ export declare class ReportComponentComponent implements OnInit, OnChanges {
|
|
|
87
87
|
applySettings(settings: ComponentSettings): void;
|
|
88
88
|
exportCsv(): void;
|
|
89
89
|
exportExcel(): void;
|
|
90
|
+
private _axisWith;
|
|
90
91
|
private _export;
|
|
91
92
|
onMarkClick(click: ReportMarkClick): void;
|
|
92
93
|
onMarkMiss(): void;
|
|
@@ -2,6 +2,8 @@ import { EventEmitter, OnInit } from '@angular/core';
|
|
|
2
2
|
import { AbstractControl } from '@angular/forms';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { ReportChangePolarity } from '../../enums/report-change-polarity.enum';
|
|
5
|
+
import { ReportChartDateLabel } from '../../enums/report-chart-date-label.enum';
|
|
6
|
+
import { ReportChartSpanMode } from '../../enums/report-chart-span-mode.enum';
|
|
5
7
|
import { ChartGranularity, ComponentSettings, Report, ReportComponent, ReportFilterType } from '../../interfaces/report.interface';
|
|
6
8
|
import { FilterBarPlacement } from '../../interfaces/filter-bar-placement.type';
|
|
7
9
|
import { FilterComponentToggleState } from '../../interfaces/filter-component-toggle-state.interface';
|
|
@@ -68,6 +70,23 @@ export declare class ComponentSettingsComponent implements OnInit {
|
|
|
68
70
|
readonly sparkline: import("@angular/core").WritableSignal<boolean>;
|
|
69
71
|
readonly sparklineGranularity: import("@angular/core").WritableSignal<ChartGranularity>;
|
|
70
72
|
readonly sparklinePeriods: import("@angular/core").WritableSignal<string | number>;
|
|
73
|
+
readonly dateLabelOptions: {
|
|
74
|
+
value: ReportChartDateLabel;
|
|
75
|
+
name: string;
|
|
76
|
+
}[];
|
|
77
|
+
readonly spanModeOptions: {
|
|
78
|
+
value: ReportChartSpanMode;
|
|
79
|
+
name: string;
|
|
80
|
+
}[];
|
|
81
|
+
readonly spanMinPeriods = 1;
|
|
82
|
+
readonly spanMaxPeriods = 400;
|
|
83
|
+
readonly ReportChartSpanMode: typeof ReportChartSpanMode;
|
|
84
|
+
readonly timeAxis: import("@angular/core").WritableSignal<boolean>;
|
|
85
|
+
readonly spanAllowed: import("@angular/core").WritableSignal<boolean>;
|
|
86
|
+
readonly dateLabel: import("@angular/core").WritableSignal<ReportChartDateLabel>;
|
|
87
|
+
readonly spanMode: import("@angular/core").WritableSignal<ReportChartSpanMode>;
|
|
88
|
+
readonly spanPeriods: import("@angular/core").WritableSignal<string | number>;
|
|
89
|
+
readonly spanStart: import("@angular/core").WritableSignal<Date>;
|
|
71
90
|
readonly sql: import("@angular/core").WritableSignal<string>;
|
|
72
91
|
readonly sqlBaseline: import("@angular/core").WritableSignal<boolean>;
|
|
73
92
|
readonly sqlTimezone: import("@angular/core").WritableSignal<string>;
|
|
@@ -106,6 +125,11 @@ export declare class ComponentSettingsComponent implements OnInit {
|
|
|
106
125
|
private _layerValues;
|
|
107
126
|
private _valueName;
|
|
108
127
|
private _seedKpiCard;
|
|
128
|
+
private _seedTimeAxis;
|
|
129
|
+
private _chartAxisSettings;
|
|
130
|
+
private _span;
|
|
131
|
+
private _sentAxisKeys;
|
|
132
|
+
private _savedChartAxis;
|
|
109
133
|
private _savedKpiCard;
|
|
110
134
|
private _kpiCardSettings;
|
|
111
135
|
private _targetShown;
|
package/app/reports/format.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export declare const DAY_LONG: Intl.DateTimeFormatOptions;
|
|
|
50
50
|
export declare const MONTH_LONG: Intl.DateTimeFormatOptions;
|
|
51
51
|
export declare const MONTH_YEAR: Intl.DateTimeFormatOptions;
|
|
52
52
|
export declare const MONTH_DAY: Intl.DateTimeFormatOptions;
|
|
53
|
+
export declare const DAY_NUMERIC: Intl.DateTimeFormatOptions;
|
|
53
54
|
export declare function formatLocalDate(date: Date, locale: ReportLocaleTag, options: Intl.DateTimeFormatOptions, timeZone?: string): string;
|
|
54
55
|
export declare function formatReportDate(value: unknown, timezone: string, locale: ReportLocaleTag): string;
|
|
55
56
|
export declare const TIME_SHORT: Intl.DateTimeFormatOptions;
|
|
@@ -11,6 +11,8 @@ import { ReportValueFormat } from '../enums/report-value-format.enum';
|
|
|
11
11
|
import { ReportValueFormula } from '../enums/report-value-formula.enum';
|
|
12
12
|
import { ComponentDataApplied } from './component-data-applied.interface';
|
|
13
13
|
import { ComponentDataDrill } from './component-data-drill.interface';
|
|
14
|
+
import { ReportChartAxisSettings } from './report-chart-axis-settings.interface';
|
|
15
|
+
import { ReportChartSpan } from './report-chart-span.interface';
|
|
14
16
|
import { ReportDrillStep } from './report-drill-step.interface';
|
|
15
17
|
import { GridConfig } from './report-grid-config.interface';
|
|
16
18
|
import { ReportViewerFeature } from './report-viewer-feature.type';
|
|
@@ -140,6 +142,7 @@ export interface ComponentSettings {
|
|
|
140
142
|
title: string;
|
|
141
143
|
padding: ComponentPadding;
|
|
142
144
|
kpi?: KpiCardSettings;
|
|
145
|
+
chartAxis?: ReportChartAxisSettings;
|
|
143
146
|
}
|
|
144
147
|
export interface KpiCardSettings {
|
|
145
148
|
increaseIs: ReportChangePolarity | null;
|
|
@@ -162,10 +165,12 @@ export interface ChartConfig {
|
|
|
162
165
|
granularity?: ChartGranularity;
|
|
163
166
|
label?: string;
|
|
164
167
|
dateLabel?: ReportChartDateLabel;
|
|
168
|
+
span?: ReportChartSpan;
|
|
165
169
|
};
|
|
166
170
|
measures?: ChartMeasure[];
|
|
167
171
|
splitBy?: {
|
|
168
172
|
column: string;
|
|
173
|
+
label?: string;
|
|
169
174
|
};
|
|
170
175
|
colorBy?: {
|
|
171
176
|
column: string;
|
|
@@ -12,6 +12,7 @@ export declare class FsAiReportComponent {
|
|
|
12
12
|
readonly pageChanged: import("@angular/core").OutputEmitterRef<number>;
|
|
13
13
|
readonly report: import("@angular/core").WritableSignal<Report>;
|
|
14
14
|
readonly editMode: import("@angular/core").WritableSignal<boolean>;
|
|
15
|
+
readonly busy: import("@angular/core").WritableSignal<boolean>;
|
|
15
16
|
readonly pageId: import("@angular/core").WritableSignal<number>;
|
|
16
17
|
readonly chatPageId: import("@angular/core").WritableSignal<number>;
|
|
17
18
|
readonly chatBasePath: import("@angular/core").Signal<string>;
|
|
@@ -47,6 +48,7 @@ export declare class FsAiReportComponent {
|
|
|
47
48
|
componentSettings(component: ReportComponentModel): void;
|
|
48
49
|
onCanvasPageChanged(pageId: number | null): void;
|
|
49
50
|
onCanvasReportChanged(): void;
|
|
51
|
+
onCanvasRefresh(): void;
|
|
50
52
|
exportPowerpoint(): void;
|
|
51
53
|
exportPdf(): void;
|
|
52
54
|
exportData(thisPage?: boolean, format?: ReportExportFormat): void;
|
|
@@ -58,6 +60,7 @@ export declare class FsAiReportComponent {
|
|
|
58
60
|
private _writePageToUrl;
|
|
59
61
|
private _pageIdFromUrl;
|
|
60
62
|
private _loadReport;
|
|
63
|
+
private _reportLoad;
|
|
61
64
|
private _reportGroups;
|
|
62
65
|
private _buildReportConfig;
|
|
63
66
|
private _openOnFirstSavedFilter;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// Which page the canvas opens when its report input changes.
|
|
2
2
|
//
|
|
3
|
+
// - A Refresh keeps the page that was on screen, by id, wherever it moved; when
|
|
4
|
+
// it is gone, the first page. A page that arrived with the refresh was added
|
|
5
|
+
// elsewhere (the MCP, another tab), so it does not take the viewer there.
|
|
3
6
|
// - The same report with more pages than before: a page was just added in
|
|
4
7
|
// this tab, so the canvas lands on the last page. The asked-for page does
|
|
5
8
|
// not beat it: that is a stale value the host still holds.
|
|
@@ -13,6 +16,9 @@
|
|
|
13
16
|
export function canvasLandingPage(input) {
|
|
14
17
|
const pageCount = input.pageIds.length;
|
|
15
18
|
const sameReport = input.reportId === input.previousReportId;
|
|
19
|
+
if (input.keepPageId !== null) {
|
|
20
|
+
return Math.max(input.pageIds.indexOf(input.keepPageId), 0);
|
|
21
|
+
}
|
|
16
22
|
if (sameReport && input.previousPageCount > 0 && pageCount > input.previousPageCount) {
|
|
17
23
|
return pageCount - 1;
|
|
18
24
|
}
|
|
@@ -23,4 +29,4 @@ export function canvasLandingPage(input) {
|
|
|
23
29
|
const index = sameReport ? input.activePageIndex : 0;
|
|
24
30
|
return index < pageCount ? index : 0;
|
|
25
31
|
}
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FudmFzLWxhbmRpbmctcGFnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3V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ldHVybiBNYXRoLm1heChpbnB1dC5wYWdlSWRzLmluZGV4T2YoaW5wdXQua2VlcFBhZ2VJZCksIDApO1xuICB9XG5cbiAgaWYgKHNhbWVSZXBvcnQgJiYgaW5wdXQucHJldmlvdXNQYWdlQ291bnQgPiAwICYmIHBhZ2VDb3VudCA+IGlucHV0LnByZXZpb3VzUGFnZUNvdW50KSB7XG4gICAgcmV0dXJuIHBhZ2VDb3VudCAtIDE7XG4gIH1cblxuICBjb25zdCBsaW5rZWQgPSBpbnB1dC5wYWdlSWQgPT0gbnVsbCA/IC0xIDogaW5wdXQucGFnZUlkcy5pbmRleE9mKGlucHV0LnBhZ2VJZCk7XG4gIGlmIChsaW5rZWQgPiAtMSkge1xuICAgIHJldHVybiBsaW5rZWQ7XG4gIH1cblxuICBjb25zdCBpbmRleCA9IHNhbWVSZXBvcnQgPyBpbnB1dC5hY3RpdmVQYWdlSW5kZXggOiAwO1xuXG4gIHJldHVybiBpbmRleCA8IHBhZ2VDb3VudCA/IGluZGV4IDogMDtcbn1cbiJdfQ==
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReportChartDateLabel } from './enums/report-chart-date-label.enum';
|
|
2
|
+
// A time-axis chart's settings-dialog keys (dateLabel and span), from its
|
|
3
|
+
// config.xAxis; null where the config has none.
|
|
4
|
+
export function chartAxisSettings(config) {
|
|
5
|
+
return {
|
|
6
|
+
dateLabel: config?.xAxis?.dateLabel ?? null,
|
|
7
|
+
span: config?.xAxis?.span ?? null,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
// Whether two sets of time-axis keys draw the same chart. Short and an absent
|
|
11
|
+
// dateLabel are one, as are a span's absent and null periods or start.
|
|
12
|
+
export function sameChartAxisSettings(a, b) {
|
|
13
|
+
return JSON.stringify(normalizedAxisSettings(a)) === JSON.stringify(normalizedAxisSettings(b));
|
|
14
|
+
}
|
|
15
|
+
function normalizedAxisSettings(settings) {
|
|
16
|
+
const { dateLabel, span } = settings;
|
|
17
|
+
return {
|
|
18
|
+
dateLabel: dateLabel === ReportChartDateLabel.Short ? null : (dateLabel ?? null),
|
|
19
|
+
span: span
|
|
20
|
+
? { through: span.through, periods: span.periods ?? undefined, start: span.start || undefined }
|
|
21
|
+
: null,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhcnQtYXhpcy1zZXR0aW5ncy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcHAvcmVwb3J0cy9jaGFydC1heGlzLXNldHRpbmdzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBSzVFLDBFQUEwRTtBQUMxRSxnREFBZ0Q7QUFDaEQsTUFBTSxVQUFVLGlCQUFpQixDQUFDLE1BQXNDO0lBQ3RFLE9BQU87UUFDTCxTQUFTLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxTQUFTLElBQUksSUFBSTtRQUMzQyxJQUFJLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxJQUFJLElBQUksSUFBSTtLQUNsQyxDQUFDO0FBQ0osQ0FBQztBQUVELDhFQUE4RTtBQUM5RSx1RUFBdUU7QUFDdkUsTUFBTSxVQUFVLHFCQUFxQixDQUFDLENBQTBCLEVBQUUsQ0FBMEI7SUFDMUYsT0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDLHNCQUFzQixDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssSUFBSSxDQUFDLFNBQVMsQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2pHLENBQUM7QUFFRCxTQUFTLHNCQUFzQixDQUFDLFFBQWlDO0lBQy9ELE1BQU0sRUFBRSxTQUFTLEVBQUUsSUFBSSxF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