we-report-angular 0.6.0 → 0.7.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.
Files changed (34) hide show
  1. package/esm2022/lib/designer/bindable-input.component.mjs +12 -10
  2. package/esm2022/lib/designer/control-factory.mjs +27 -2
  3. package/esm2022/lib/designer/data-sources-dialog.component.mjs +99 -6
  4. package/esm2022/lib/designer/database-source-editor.component.mjs +3 -3
  5. package/esm2022/lib/designer/design-surface.component.mjs +269 -44
  6. package/esm2022/lib/designer/designer-fields.mjs +21 -4
  7. package/esm2022/lib/designer/designer-state.mjs +57 -3
  8. package/esm2022/lib/designer/expression-editor.component.mjs +9 -3
  9. package/esm2022/lib/designer/property-panel.component.mjs +115 -5
  10. package/esm2022/lib/designer/we-report-designer.component.mjs +172 -12
  11. package/esm2022/lib/locales/de.mjs +85 -2
  12. package/esm2022/lib/locales/es.mjs +85 -2
  13. package/esm2022/lib/locales/fr.mjs +85 -2
  14. package/esm2022/lib/viewer/page-canvas.mjs +151 -0
  15. package/esm2022/lib/viewer/we-report-page.component.mjs +5 -1
  16. package/esm2022/lib/viewer/we-report-viewer.component.mjs +293 -33
  17. package/esm2022/lib/we-report-icons.mjs +4 -1
  18. package/esm2022/lib/we-report-locale.mjs +169 -3
  19. package/fesm2022/we-report-angular.mjs +1630 -110
  20. package/fesm2022/we-report-angular.mjs.map +1 -1
  21. package/lib/designer/bindable-input.component.d.ts +3 -1
  22. package/lib/designer/data-sources-dialog.component.d.ts +24 -1
  23. package/lib/designer/database-source-editor.component.d.ts +1 -1
  24. package/lib/designer/design-surface.component.d.ts +21 -1
  25. package/lib/designer/designer-fields.d.ts +3 -1
  26. package/lib/designer/designer-state.d.ts +8 -0
  27. package/lib/designer/property-panel.component.d.ts +31 -3
  28. package/lib/designer/we-report-designer.component.d.ts +29 -1
  29. package/lib/viewer/page-canvas.d.ts +8 -0
  30. package/lib/viewer/we-report-viewer.component.d.ts +45 -2
  31. package/lib/we-report-icons.d.ts +3 -0
  32. package/lib/we-report-locale.d.ts +72 -0
  33. package/package.json +2 -2
  34. package/styles/we-report-theme.scss +6 -3
@@ -11,6 +11,8 @@ export declare class BindableInputComponent {
11
11
  readonly fields: import("@angular/core").InputSignal<DesignerField[]>;
12
12
  readonly strings: import("@angular/core").InputSignal<WeReportLocale>;
13
13
  readonly multiline: import("@angular/core").InputSignal<boolean>;
14
+ /** What the value is, for screen readers (the visible caption sits outside the component). */
15
+ readonly label: import("@angular/core").InputSignal<string | undefined>;
14
16
  readonly valueChange: import("@angular/core").OutputEmitterRef<Bindable<string>>;
15
17
  protected readonly editorOpen: import("@angular/core").WritableSignal<boolean>;
16
18
  protected readonly bound: import("@angular/core").Signal<boolean>;
@@ -23,5 +25,5 @@ export declare class BindableInputComponent {
23
25
  protected setExpression(expression: string): void;
24
26
  protected setFixed(text: string): void;
25
27
  static ɵfac: i0.ɵɵFactoryDeclaration<BindableInputComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<BindableInputComponent, "we-report-bindable-input", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; "isSignal": true; }; "strings": { "alias": "strings"; "required": true; "isSignal": true; }; "multiline": { "alias": "multiline"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<BindableInputComponent, "we-report-bindable-input", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; "isSignal": true; }; "strings": { "alias": "strings"; "required": true; "isSignal": true; }; "multiline": { "alias": "multiline"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
27
29
  }
@@ -9,7 +9,13 @@ import * as i0 from "@angular/core";
9
9
  export declare class DataSourcesDialogComponent {
10
10
  readonly strings: import("@angular/core").InputSignal<WeReportLocale>;
11
11
  readonly fetchFn: import("@angular/core").InputSignal<typeof fetch | undefined>;
12
+ /** The host app passes the rows (the designer's `data`), so the main source's own data is a fallback. */
13
+ readonly hostData: import("@angular/core").InputSignal<boolean>;
12
14
  readonly closed: import("@angular/core").OutputEmitterRef<void>;
15
+ private readonly dialog;
16
+ constructor();
17
+ /** Escape closes the dialog, but not from a dialog inside it or a text area that saves on leaving. */
18
+ protected onEscape(e: Event): void;
13
19
  protected readonly state: DesignerState;
14
20
  private readonly backend;
15
21
  protected readonly report: import("@angular/core").Signal<import("we-report-core").ReportDefinition>;
@@ -25,6 +31,15 @@ export declare class DataSourcesDialogComponent {
25
31
  message: string;
26
32
  } | null>;
27
33
  protected readonly types: ParameterType[];
34
+ /** Plain fields of every source, offered as a parameter's list ("source|field"). */
35
+ protected readonly choiceFields: import("@angular/core").Signal<{
36
+ key: string;
37
+ label: string;
38
+ }[]>;
39
+ protected choicesText(p: ReportParameter): string;
40
+ protected choicesKey(p: ReportParameter): string;
41
+ /** A typed list ("A, B, C") or a data field ("source|field"); empty removes the list. */
42
+ protected setChoices(index: number, kind: 'values' | 'field', value: string): void;
28
43
  protected add(kind: DataSourceDefinition['kind']): void;
29
44
  protected remove(): void;
30
45
  protected select(id: string): void;
@@ -39,6 +54,8 @@ export declare class DataSourcesDialogComponent {
39
54
  protected csvRows(s: DataSourceDefinition): number;
40
55
  protected web(s: DataSourceDefinition): WebServiceDataSource | null;
41
56
  protected setWeb(key: 'url' | 'method' | 'body' | 'via', value: string): void;
57
+ /** Page size of a paged web service; empty turns paging off. */
58
+ protected setPaging(size: string): void;
42
59
  protected db(s: DataSourceDefinition): DatabaseDataSource | null;
43
60
  protected applyDbEdit(e: {
44
61
  mutate: (s: DatabaseDataSource) => void;
@@ -52,10 +69,16 @@ export declare class DataSourcesDialogComponent {
52
69
  private autoPath;
53
70
  protected addParameter(): void;
54
71
  protected setParameter(index: number, key: keyof ReportParameter, value: string): void;
72
+ protected addCalculated(): void;
73
+ /** Names are used as [name]: the box shows the cleaned name right away. */
74
+ protected setCalculatedName(index: number, input: HTMLInputElement): void;
75
+ protected setParameterName(index: number, input: HTMLInputElement): void;
76
+ protected setCalculated(index: number, key: 'name' | 'expression', value: string): void;
77
+ protected removeCalculated(index: number): void;
55
78
  protected removeParameter(index: number): void;
56
79
  protected typeLabel(t: ParameterType): string;
57
80
  protected kindLabel(s: DataSourceDefinition): string;
58
81
  private uniqueSourceId;
59
82
  static ɵfac: i0.ɵɵFactoryDeclaration<DataSourcesDialogComponent, never>;
60
- static ɵcmp: i0.ɵɵComponentDeclaration<DataSourcesDialogComponent, "we-report-data-sources-dialog", never, { "strings": { "alias": "strings"; "required": true; "isSignal": true; }; "fetchFn": { "alias": "fetchFn"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, never, true, never>;
83
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataSourcesDialogComponent, "we-report-data-sources-dialog", never, { "strings": { "alias": "strings"; "required": true; "isSignal": true; }; "fetchFn": { "alias": "fetchFn"; "required": false; "isSignal": true; }; "hostData": { "alias": "hostData"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, never, true, never>;
61
84
  }
@@ -17,7 +17,7 @@ export declare class DatabaseSourceEditorComponent {
17
17
  key: string;
18
18
  }>;
19
19
  protected readonly backend: WeReportBackendService;
20
- protected readonly operators: ("=" | "!=" | "<" | "<=" | ">" | ">=" | "like" | "in" | "isNull" | "notNull")[];
20
+ protected readonly operators: ("=" | "in" | "!=" | "<" | "<=" | ">" | ">=" | "like" | "isNull" | "notNull")[];
21
21
  protected readonly connections: import("@angular/core").WritableSignal<BackendConnection[]>;
22
22
  protected readonly schema: import("@angular/core").WritableSignal<BackendSchema | null>;
23
23
  protected readonly status: import("@angular/core").WritableSignal<{
@@ -1,5 +1,5 @@
1
1
  import { OnDestroy } from '@angular/core';
2
- import { Band, ReportControl, ReportControlType } from 'we-report-core';
2
+ import { Band, LayoutPage, ReportControl, ReportControlType, RichRun } from 'we-report-core';
3
3
  import { DesignerField } from './designer-fields';
4
4
  import { WeReportLocale } from '../we-report-locale';
5
5
  import { DesignerState } from './designer-state';
@@ -9,6 +9,8 @@ export interface DesignSample {
9
9
  row: unknown;
10
10
  rows: readonly unknown[];
11
11
  parent: unknown;
12
+ /** The report's calculated fields, so the sample shows them too. */
13
+ calculated?: Record<string, string>;
12
14
  }
13
15
  /** Payload of an HTML5 drag from the toolbox or the field list. */
14
16
  export type DesignerDragData = {
@@ -22,6 +24,14 @@ export type DesignerDragData = {
22
24
  format?: string;
23
25
  };
24
26
  export declare const DRAG_MIME = "application/x-we-report";
27
+ /**
28
+ * Fields to start a chart or cross table with: text fields that repeat (fewest different values
29
+ * first; a name on every row does not group) and the number field with the largest total.
30
+ */
31
+ export declare function guessBindings(rows: readonly unknown[]): {
32
+ groups: string[];
33
+ amount?: string;
34
+ };
25
35
  export interface Rect {
26
36
  x: number;
27
37
  y: number;
@@ -64,6 +74,13 @@ export declare class DesignSurfaceComponent implements OnDestroy {
64
74
  private readonly fontsService;
65
75
  /** Texts (without Grow to fit text) whose content does not fit, measured with the report's fonts like the print. */
66
76
  readonly cutTexts: import("@angular/core").WritableSignal<ReadonlySet<string>>;
77
+ /**
78
+ * Sub-reports, cross tables and charts drawn inside their box as they print, from the sample
79
+ * data: a sub-report with the sample row around it, the others over all sample rows.
80
+ */
81
+ protected readonly previewPages: import("@angular/core").WritableSignal<ReadonlyMap<string, LayoutPage>>;
82
+ private previewRun;
83
+ private readonly previewItems;
67
84
  private measureRun;
68
85
  private readonly measureTexts;
69
86
  /** The rubber band while dragging on an empty part of a section (mm in that section). */
@@ -115,6 +132,8 @@ export declare class DesignSurfaceComponent implements OnDestroy {
115
132
  protected isBound(c: ReportControl): boolean;
116
133
  protected boundExpression(c: ReportControl): string;
117
134
  protected caption(c: ReportControl, band?: Band): string;
135
+ /** A rich text's styled pieces; its `{formula}` fields show the sample data, else the formula. */
136
+ protected richRuns(c: ReportControl, band?: Band): RichRun[];
118
137
  protected textStyle(c: ReportControl): Record<string, string>;
119
138
  /** Cells of a table control in mm relative to the control, with their text and look. */
120
139
  protected tableCells(c: ReportControl, band?: Band): {
@@ -185,6 +204,7 @@ export declare class DesignSurfaceComponent implements OnDestroy {
185
204
  } | null;
186
205
  /** Fixed watermark text, or its formula, shown faintly on the design page. */
187
206
  protected watermarkText(): string;
207
+ protected crosstabLabel(c: ReportControl): string;
188
208
  protected chartLabel(c: ReportControl): string;
189
209
  private readFile;
190
210
  /** A picture at (x, y) mm, at its natural size up to 80 mm wide (PNG/JPEG data URI). */
@@ -13,7 +13,9 @@ export interface DesignerField {
13
13
  * Row fields, fields of the object holding the rows (when the rows are a nested list), the lists
14
14
  * inside a row (for an inner list) and the fields of the inner list's items.
15
15
  */
16
- export declare function designerFields(report: ReportDefinition, data?: unknown): {
16
+ export declare function designerFields(report: ReportDefinition, data?: unknown,
17
+ /** Inside a sub-report: the row around it, whose fields `[^.field]` reads. */
18
+ outerRow?: unknown): {
17
19
  rows: DesignerField[];
18
20
  parent: DesignerField[];
19
21
  lists: string[];
@@ -30,6 +30,8 @@ export declare class DesignerState {
30
30
  /** Format painter: the look picked up from one item, applied to the next item clicked. */
31
31
  readonly painter: import("@angular/core").WritableSignal<Pick<ReportControl, "style" | "styleOverrides"> | null>;
32
32
  /** Text being typed on the page (double-click / F2): a text control, or a cell of a table. */
33
+ /** Id of the sub-report whose design is open in its own designer window. */
34
+ readonly subreportOpen: import("@angular/core").WritableSignal<string | null>;
33
35
  readonly editing: import("@angular/core").WritableSignal<{
34
36
  controlId: string;
35
37
  row?: number;
@@ -46,6 +48,7 @@ export declare class DesignerState {
46
48
  row: unknown;
47
49
  rows: readonly unknown[];
48
50
  parent: unknown;
51
+ calculated?: Record<string, string>;
49
52
  } | null>;
50
53
  readonly selectedControls: import("@angular/core").Signal<ReportControl[]>;
51
54
  readonly selectedBand: import("@angular/core").Signal<Band | null>;
@@ -86,6 +89,11 @@ export declare class DesignerState {
86
89
  selectAll(): void;
87
90
  /** Aligns the selection to the first selected control (the one clicked first). */
88
91
  align(edge: AlignEdge): void;
92
+ /**
93
+ * "Tidy up": puts the items on the grid (`step` mm), lines up those that are nearly in a row
94
+ * (same top) or a column (same left), and gives the texts of a row one height. One undo step.
95
+ */
96
+ tidy(ids: string[], step: number): void;
89
97
  /** Equal gaps between three or more controls, keeping the outermost two in place. */
90
98
  distribute(axis: 'h' | 'v'): void;
91
99
  /** Gives the selection the width and/or height of the first selected control. */
@@ -13,7 +13,11 @@ export declare class PropertyPanelComponent {
13
13
  readonly advanced: import("@angular/core").InputSignal<boolean>;
14
14
  /** Lists inside a row that an inner list can repeat over. */
15
15
  readonly lists: import("@angular/core").InputSignal<string[]>;
16
+ /** A sub-report's design: its page comes from the box, so paper and margins are not offered. */
17
+ readonly embedded: import("@angular/core").InputSignal<boolean>;
16
18
  protected readonly state: DesignerState;
19
+ /** Prefix of this panel's datalist ids: two designers may share a page. */
20
+ protected readonly listId: string;
17
21
  protected readonly papers: readonly import("we-report-core").PaperSize[];
18
22
  protected readonly symbologies: readonly string[];
19
23
  protected readonly formats: {
@@ -64,10 +68,18 @@ export declare class PropertyPanelComponent {
64
68
  protected setWatermark(patch: Partial<Watermark>): void;
65
69
  protected setPaper(paper: string): void;
66
70
  protected setPage(key: 'orientation' | 'width' | 'height', value: string): void;
71
+ protected setPageOption(key: 'color' | 'mirrorMargins', value: string | boolean | undefined): void;
67
72
  protected setMargin(side: 'top' | 'right' | 'bottom' | 'left', value: string): void;
68
73
  protected setRowsPath(path: string): void;
69
- protected setBand(key: 'height' | 'groupBy' | 'sort' | 'backgroundColor' | 'rowsPath', value: string): void;
70
- protected toggleBand(key: 'keepTogether' | 'repeatOnEveryPage' | 'pageBreakBefore' | 'pageBreakAfter', value: boolean): void;
74
+ protected setBand(key: 'height' | 'groupBy' | 'sort' | 'backgroundColor' | 'alternateBackgroundColor' | 'visible' | 'rowsPath', value: string): void;
75
+ /** Groups in the order of a formula over their rows; an empty formula goes back to the key order. */
76
+ protected setGroupOrder(expression: string, descending: boolean): void;
77
+ protected setGroupTop(value: string): void;
78
+ protected bookmarkValue(b: Band): Bindable<string>;
79
+ protected setBookmark(value: Bindable<string>): void;
80
+ protected toggleBand(key: 'keepTogether' | 'keepWithFirstRow' | 'repeatOnEveryPage' | 'resetPageNumber' | 'pageBreakBefore' | 'pageBreakAfter' | 'printAtBottom', value: boolean): void;
81
+ /** Printed is the default, so only `false` is stored. */
82
+ protected setPrintOn(key: 'printOnFirstPage' | 'printOnLastPage', value: boolean): void;
71
83
  protected labelSheetName(l: LabelSheet): string;
72
84
  protected applyLabelSheet(id: string): void;
73
85
  protected readonly fieldExpressions: import("@angular/core").Signal<Set<string>>;
@@ -83,7 +95,23 @@ export declare class PropertyPanelComponent {
83
95
  protected setBindable(key: 'text' | 'value' | 'source' | 'checked' | 'visible', value: Bindable<string>): void;
84
96
  protected visibleValue(c: ReportControl): Bindable<string>;
85
97
  protected setVisible(value: Bindable<string>): void;
98
+ /** A sparkline is a line-height chart: a full-size chart box shrinks to fit a row. */
99
+ protected setChartType(type: ChartType): void;
100
+ protected setOptionalChartRows(expression: string): void;
86
101
  protected setExpression(key: 'category' | 'value', expression: string): void;
102
+ protected readonly crosstabKeys: {
103
+ key: 'rows' | 'columns' | 'value';
104
+ label: 'crosstabRows' | 'crosstabColumns' | 'crosstabValue';
105
+ }[];
106
+ protected setCrosstab(key: 'rows' | 'columns' | 'value', expression: string): void;
107
+ /** A file chosen for "Use a saved report" could not be read. */
108
+ protected readonly subreportError: import("@angular/core").WritableSignal<boolean>;
109
+ /** A formula that may be left empty (then the property goes away). */
110
+ protected setOptionalExpression(key: 'rows' | 'filter', expression: string): void;
111
+ /** Puts a saved report (or an RDLC / REPX one, converted) into the selected sub-report. */
112
+ protected chooseSubreport(event: Event): Promise<void>;
113
+ protected subreportParamValue(c: ReportControl, name: string): Bindable<string>;
114
+ protected setSubreportParam(name: string, value: Bindable<string>): void;
87
115
  /** Row/column commands act on the clicked cell, or on the last row/column. */
88
116
  protected tableOp(op: 'insertRow' | 'insertColumn' | 'deleteRow' | 'deleteColumn' | 'mergeRight' | 'splitCell'): void;
89
117
  private updateCell;
@@ -108,5 +136,5 @@ export declare class PropertyPanelComponent {
108
136
  protected num(value: number | undefined | null): string;
109
137
  protected asNumber(value: string, fallback: number): number;
110
138
  static ɵfac: i0.ɵɵFactoryDeclaration<PropertyPanelComponent, never>;
111
- static ɵcmp: i0.ɵɵComponentDeclaration<PropertyPanelComponent, "we-report-property-panel", never, { "strings": { "alias": "strings"; "required": true; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; "isSignal": true; }; "fontFamilies": { "alias": "fontFamilies"; "required": false; "isSignal": true; }; "advanced": { "alias": "advanced"; "required": false; "isSignal": true; }; "lists": { "alias": "lists"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
139
+ static ɵcmp: i0.ɵɵComponentDeclaration<PropertyPanelComponent, "we-report-property-panel", never, { "strings": { "alias": "strings"; "required": true; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; "isSignal": true; }; "fontFamilies": { "alias": "fontFamilies"; "required": false; "isSignal": true; }; "advanced": { "alias": "advanced"; "required": false; "isSignal": true; }; "lists": { "alias": "lists"; "required": false; "isSignal": true; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
112
140
  }
@@ -21,8 +21,13 @@ export declare class WeReportDesignerComponent {
21
21
  readonly zoom: import("@angular/core").InputSignal<number>;
22
22
  /** Fetch used for web-service data sources (testing in the designer and the preview). */
23
23
  readonly fetchFn: import("@angular/core").InputSignal<typeof fetch | undefined>;
24
+ /** When the report is a sub-report: a sample of the row around it, which its `[^.field]` reads. */
25
+ readonly outerRow: import("@angular/core").InputSignal<unknown>;
26
+ /** Designing a sub-report inside another designer: its page comes from the box (no paper settings). */
27
+ readonly embedded: import("@angular/core").InputSignal<boolean>;
24
28
  protected readonly state: DesignerState;
25
29
  private readonly fontsService;
30
+ private readonly config;
26
31
  private readonly defaultLocale;
27
32
  protected readonly strings: import("@angular/core").Signal<WeReportLocale>;
28
33
  protected readonly toolbox: {
@@ -50,6 +55,7 @@ export declare class WeReportDesignerComponent {
50
55
  };
51
56
  } | null>;
52
57
  private readonly canvas;
58
+ private readonly injector;
53
59
  private readonly host;
54
60
  private readonly surface;
55
61
  protected readonly shortcutsOpen: import("@angular/core").WritableSignal<boolean>;
@@ -133,6 +139,7 @@ export declare class WeReportDesignerComponent {
133
139
  private readonly rememberView;
134
140
  protected pickZoom(value: string): void;
135
141
  protected fitWidth(): void;
142
+ /** Ctrl + wheel (and a trackpad pinch) zooms around the pointer. */
136
143
  protected onCanvasWheel(e: WheelEvent): void;
137
144
  protected openContextMenu(e: MouseEvent): void;
138
145
  /** A new text where the section was right-clicked, ready to type in. */
@@ -145,12 +152,33 @@ export declare class WeReportDesignerComponent {
145
152
  protected groupByValue(): void;
146
153
  /** Puts `Sum(...)` of the selected column under it in every group footer and the report footer. */
147
154
  protected addTotal(): void;
155
+ /** The sub-report whose design is open in its own designer window. */
156
+ protected readonly openSubreport: import("@angular/core").Signal<import("we-report-core").SubreportControl | null>;
157
+ /** The sub-report on a page as wide as its box and as tall as its content, as it prints. */
158
+ protected readonly subreportDesign: import("@angular/core").Signal<ReportDefinition | null>;
159
+ /**
160
+ * Sample data for the sub-report's designer: its rows formula over the first row, else the data
161
+ * of the source it is bound to (its own, or one of this report's, as in the layout).
162
+ */
163
+ protected readonly subreportData: import("@angular/core").Signal<unknown>;
164
+ /** The window closes when its sub-report is gone (deleted, or undone away), and takes the focus when it opens. */
165
+ private readonly subreportWindow;
166
+ /** Edits from the sub-report's designer; one undo step per burst of edits here. */
167
+ protected setSubreport(id: string, report: ReportDefinition): void;
148
168
  protected readonly hasTextSelected: import("@angular/core").Signal<boolean>;
149
169
  /**
150
170
  * Sizes the selected texts to what they show on the page (fixed text, or the sample value),
151
171
  * measured with the report's fonts, so it matches the printed size.
152
172
  */
153
173
  protected fitToText(): Promise<void>;
174
+ protected tidySelection(): void;
175
+ protected tidyBand(bandId: string): void;
176
+ /**
177
+ * What a bound text prints with the first data row, also while *Show data* is off (the page
178
+ * then shows the formula); `null` when there is no data to evaluate with.
179
+ * shortcut: inner-list texts use the detail row, so their size may be off; measure them with *Show data* on.
180
+ */
181
+ private printedText;
154
182
  /** Shrinks (or grows) a section to just below its lowest item. */
155
183
  protected fitBand(bandId: string | null): void;
156
184
  /** Runs a context-menu command and closes the menu. */
@@ -199,5 +227,5 @@ export declare class WeReportDesignerComponent {
199
227
  protected fixIssue(issue: ReportIssue): void;
200
228
  protected onKeydown(e: KeyboardEvent): void;
201
229
  static ɵfac: i0.ɵɵFactoryDeclaration<WeReportDesignerComponent, never>;
202
- static ɵcmp: i0.ɵɵComponentDeclaration<WeReportDesignerComponent, "we-report-designer", never, { "report": { "alias": "report"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "fetchFn": { "alias": "fetchFn"; "required": false; "isSignal": true; }; }, { "report": "reportChange"; }, never, never, true, never>;
230
+ static ɵcmp: i0.ɵɵComponentDeclaration<WeReportDesignerComponent, "we-report-designer", never, { "report": { "alias": "report"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "fetchFn": { "alias": "fetchFn"; "required": false; "isSignal": true; }; "outerRow": { "alias": "outerRow"; "required": false; "isSignal": true; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; }, { "report": "reportChange"; }, never, never, true, never>;
203
231
  }
@@ -0,0 +1,8 @@
1
+ import { LayoutPage } from 'we-report-core';
2
+ /** A fetched picture as a PNG/JPEG `data:` URI (other formats, e.g. WebP or SVG, are converted to PNG). */
3
+ export declare function pictureDataUri(blob: Blob, doc?: Document): Promise<string>;
4
+ /**
5
+ * Draws a laid-out page on a canvas, `pxPerMm` pixels per millimetre, from the same positioned
6
+ * items (and the same registered fonts) as the on-screen SVG and the PDF.
7
+ */
8
+ export declare function drawPage(page: LayoutPage, pxPerMm: number, doc?: Document): Promise<HTMLCanvasElement>;
@@ -1,11 +1,16 @@
1
- import { LayoutDocument, LayoutProblem, ReportDefinition, ReportParameter } from 'we-report-core';
1
+ import { LayoutBookmark, LayoutDocument, LayoutProblem, ReportDefinition, ReportParameter } from 'we-report-core';
2
2
  import { WeReportLocale } from '../we-report-locale';
3
3
  import * as i0 from "@angular/core";
4
+ /** A part of the viewer's toolbar that the host can leave out (`hide`). */
5
+ export type WeReportViewerTool = 'print' | 'pdf' | 'excel' | 'png' | 'more' | 'search' | 'thumbnails' | 'map';
4
6
  /** Paged preview of a report with zoom, PDF download and print. No server involved. */
5
7
  export declare class WeReportViewerComponent {
6
8
  readonly report: import("@angular/core").InputSignal<ReportDefinition>;
7
9
  /** Rows (or an object holding them) to print; replaces the report's own data source data. */
8
10
  readonly data: import("@angular/core").InputSignal<unknown>;
11
+ /** The row around the report, read with `[^.field]` (e.g. previewing a sub-report on its own). */
12
+ readonly outerRow: import("@angular/core").InputSignal<unknown>;
13
+ /** Default 1; at 1, a page wider than the viewer (a phone) first shows at its width. */
9
14
  readonly zoom: import("@angular/core").InputSignal<number>;
10
15
  /** Overrides the `WE_REPORT_LOCALE` token. */
11
16
  readonly locale: import("@angular/core").InputSignal<WeReportLocale | undefined>;
@@ -13,6 +18,8 @@ export declare class WeReportViewerComponent {
13
18
  readonly printDate: import("@angular/core").InputSignal<Date | undefined>;
14
19
  /** Report parameter values from the host; the user can still change them in the parameter bar. */
15
20
  readonly parameters: import("@angular/core").InputSignal<Record<string, unknown>>;
21
+ /** Toolbar parts to leave out, e.g. `['excel', 'more']`; the methods (`toPdf()` …) stay available. */
22
+ readonly hide: import("@angular/core").InputSignal<readonly WeReportViewerTool[]>;
16
23
  /** Fetch used for web-service data sources (add auth, or route through your backend). */
17
24
  readonly fetchFn: import("@angular/core").InputSignal<typeof fetch | undefined>;
18
25
  readonly problems: import("@angular/core").OutputEmitterRef<LayoutProblem[]>;
@@ -31,14 +38,26 @@ export declare class WeReportViewerComponent {
31
38
  /** Values typed into the parameter bar, applied with "Run report". */
32
39
  private readonly draftParams;
33
40
  private readonly appliedParams;
41
+ /** Web-service and database responses of the last run, for parameter lists drawn from them. */
42
+ private readonly loadedSources;
43
+ protected readonly choices: import("@angular/core").Signal<{
44
+ [k: string]: {
45
+ value: string | number;
46
+ label: string;
47
+ }[];
48
+ }>;
34
49
  protected readonly pageLabel: import("@angular/core").Signal<string>;
35
50
  private fonts?;
36
51
  private run;
52
+ /** Pictures fetched for image addresses (URL → data URI), kept between runs; failures are tried again next run. */
53
+ private readonly pictures;
37
54
  /** What the current preview was laid out from, so exports use exactly the same data. */
38
55
  private lastInput;
39
56
  constructor();
40
57
  protected readonly zoomSteps: number[];
41
58
  protected readonly showThumbs: import("@angular/core").WritableSignal<boolean>;
59
+ /** The document map: the bookmarked groups and rows, for jumping to them. */
60
+ protected readonly showMap: import("@angular/core").WritableSignal<boolean>;
42
61
  protected readonly thumbZoom = 0.18;
43
62
  protected readonly currentPage: import("@angular/core").WritableSignal<number>;
44
63
  protected readonly pageTotal: import("@angular/core").Signal<number>;
@@ -61,26 +80,50 @@ export declare class WeReportViewerComponent {
61
80
  protected setQuery(value: string): void;
62
81
  protected nextMatch(step: 1 | -1): void;
63
82
  private revealHit;
83
+ /** Scrolls to a document-map entry: its page, then down to the section on it. */
84
+ protected goToBookmark(mark: LayoutBookmark): void;
64
85
  protected goToPage(n: number): void;
65
86
  /** The page whose top is nearest the top of the view is the current page. */
66
87
  protected onScroll(): void;
67
88
  private setCurrent;
89
+ /** Ctrl + wheel (and a trackpad pinch) zooms around the pointer, as desktop viewers do. */
90
+ protected onWheel(e: WheelEvent): void;
91
+ private readonly injector;
92
+ private fittedOnce;
93
+ /** On a screen narrower than the page (a phone), the first preview at the default zoom fits the page's width. */
94
+ private fitNarrowScreen;
68
95
  protected pickZoom(value: string): void;
69
96
  protected onKeydown(e: KeyboardEvent): void;
97
+ protected hidden(tool: WeReportViewerTool): boolean;
70
98
  protected setZoom(value: number): void;
71
99
  protected paramValue(p: ReportParameter): unknown;
72
100
  protected setParam(p: ReportParameter, value: unknown): void;
73
101
  protected applyParams(): void;
74
102
  private layout;
103
+ private fetchPictures;
75
104
  /** The current preview as PDF bytes. */
76
105
  toPdf(): Promise<Uint8Array>;
77
106
  /** The report's rows as an Excel workbook (one column per detail field, typed values). */
78
107
  toXlsx(): Uint8Array;
79
108
  protected downloadPdf(): Promise<void>;
109
+ /** One page of the current preview as a PNG image, `dpi` dots per inch (default 200). */
110
+ toPng(pageIndex?: number, dpi?: number): Promise<Blob>;
111
+ /** Every page as a PNG (`page-1.png` …) in one ZIP file. */
112
+ toPngZip(dpi?: number): Promise<Uint8Array>;
113
+ /** Every page in black and white dots, `pxPerMm(page)` dots per millimetre. */
114
+ private bitmaps;
115
+ /** Zebra ZPL for label printers: each page as a label, at the printer's `dpi` (203 or 300). */
116
+ toZpl(dpi?: number): Promise<string>;
117
+ /** ESC/POS for receipt printers: the page width fills `dots` (384 for 58 mm, 576 for 80 mm rolls). */
118
+ toEscPos(dots?: number): Promise<Uint8Array>;
119
+ /** The report's rows as CSV for spreadsheets (`;` and decimal commas in regions that write them). */
120
+ toCsv(): string;
121
+ protected downloadForPrinter(kind: string): Promise<void>;
122
+ protected downloadPng(): Promise<void>;
80
123
  protected downloadExcel(): void;
81
124
  private save;
82
125
  /** Prints the PDF through a hidden frame, so page size and margins are exact. */
83
126
  protected print(): Promise<void>;
84
127
  static ɵfac: i0.ɵɵFactoryDeclaration<WeReportViewerComponent, never>;
85
- static ɵcmp: i0.ɵɵComponentDeclaration<WeReportViewerComponent, "we-report-viewer", never, { "report": { "alias": "report"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "printDate": { "alias": "printDate"; "required": false; "isSignal": true; }; "parameters": { "alias": "parameters"; "required": false; "isSignal": true; }; "fetchFn": { "alias": "fetchFn"; "required": false; "isSignal": true; }; }, { "problems": "problems"; "rendered": "rendered"; }, never, never, true, never>;
128
+ static ɵcmp: i0.ɵɵComponentDeclaration<WeReportViewerComponent, "we-report-viewer", never, { "report": { "alias": "report"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "outerRow": { "alias": "outerRow"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "printDate": { "alias": "printDate"; "required": false; "isSignal": true; }; "parameters": { "alias": "parameters"; "required": false; "isSignal": true; }; "hide": { "alias": "hide"; "required": false; "isSignal": true; }; "fetchFn": { "alias": "fetchFn"; "required": false; "isSignal": true; }; }, { "problems": "problems"; "rendered": "rendered"; }, never, never, true, never>;
86
129
  }
@@ -18,11 +18,14 @@ export interface WeReportIcons {
18
18
  qrcode: string;
19
19
  pageInfo: string;
20
20
  checkbox: string;
21
+ signature: string;
21
22
  preview: string;
22
23
  design: string;
23
24
  database: string;
24
25
  chart: string;
25
26
  table: string;
27
+ subreport: string;
28
+ crosstab: string;
26
29
  textLeft: string;
27
30
  textCenter: string;
28
31
  textRight: string;
@@ -10,6 +10,13 @@ export interface WeReportLocale {
10
10
  print: string;
11
11
  downloadPdf: string;
12
12
  downloadExcel: string;
13
+ documentMap: string;
14
+ downloadPng: string;
15
+ pngAllPages: string;
16
+ printerOutput: string;
17
+ printerOutputHint: string;
18
+ printerZpl: string;
19
+ printerEscPos: string;
13
20
  /** `{0}` = number of pages. */
14
21
  pageCount: string;
15
22
  problems: string;
@@ -62,6 +69,9 @@ export interface WeReportLocale {
62
69
  removeBand: string;
63
70
  groupBy: string;
64
71
  newText: string;
72
+ /** Toolbox: a signature line. */
73
+ signature: string;
74
+ signatureCaption: string;
65
75
  showData: string;
66
76
  groupLayout: string;
67
77
  groupContent: string;
@@ -82,6 +92,9 @@ export interface WeReportLocale {
82
92
  marginRight: string;
83
93
  marginBottom: string;
84
94
  marginLeft: string;
95
+ pageColor: string;
96
+ mirrorMargins: string;
97
+ mirrorMarginsHint: string;
85
98
  left: string;
86
99
  top: string;
87
100
  content: string;
@@ -97,6 +110,8 @@ export interface WeReportLocale {
97
110
  formatPercent: string;
98
111
  formatDate: string;
99
112
  formatDateTime: string;
113
+ formatLongDate: string;
114
+ formatDayDate: string;
100
115
  font: string;
101
116
  fontSize: string;
102
117
  bold: string;
@@ -119,6 +134,8 @@ export interface WeReportLocale {
119
134
  padding: string;
120
135
  canGrow: string;
121
136
  canGrowHint: string;
137
+ richText: string;
138
+ richTextHint: string;
122
139
  visibleWhen: string;
123
140
  visibleWhenHint: string;
124
141
  symbology: string;
@@ -156,11 +173,29 @@ export interface WeReportLocale {
156
173
  sortNone: string;
157
174
  keepTogether: string;
158
175
  keepTogetherHint: string;
176
+ groupTop: string;
177
+ groupOrderBy: string;
178
+ groupOrderByHint: string;
179
+ largestFirst: string;
180
+ keepWithFirstRow: string;
181
+ printAtBottom: string;
182
+ printAtBottomHint: string;
183
+ printOnFirstPage: string;
184
+ printOnLastPage: string;
185
+ bookmark: string;
186
+ bookmarkHint: string;
187
+ alternateBackground: string;
188
+ bandVisible: string;
189
+ bandVisibleHint: string;
190
+ resetPageNumber: string;
191
+ resetPageNumberHint: string;
159
192
  repeatOnEveryPage: string;
160
193
  pageBreakBefore: string;
161
194
  pageBreakAfter: string;
162
195
  dataRows: string;
163
196
  dataRowsHint: string;
197
+ /** Shown under the main data source when the host app passes the rows. */
198
+ hostDataNote: string;
164
199
  dataSources: string;
165
200
  close: string;
166
201
  rowsSource: string;
@@ -172,6 +207,13 @@ export interface WeReportLocale {
172
207
  parameterType: string;
173
208
  parameterLabel: string;
174
209
  defaultValue: string;
210
+ calculatedFields: string;
211
+ calculatedFieldsHint: string;
212
+ calculatedFieldName: string;
213
+ addCalculatedField: string;
214
+ parameterChoices: string;
215
+ parameterChoicesFrom: string;
216
+ parameterNoList: string;
175
217
  addParameter: string;
176
218
  sourceName: string;
177
219
  wholeData: string;
@@ -216,6 +258,9 @@ export interface WeReportLocale {
216
258
  rowLimitReached: string;
217
259
  viaBackend: string;
218
260
  viaBackendHint: string;
261
+ paging: string;
262
+ pagingHint: string;
263
+ pageSize: string;
219
264
  autoDesign: string;
220
265
  autoDesignHint: string;
221
266
  newReportTitle: string;
@@ -227,6 +272,7 @@ export interface WeReportLocale {
227
272
  issueEmptyFormula: string;
228
273
  issueOverlap: string;
229
274
  issueOutsideColumn: string;
275
+ issueCheckDigit: string;
230
276
  fixIt: string;
231
277
  noProblems: string;
232
278
  chartType: string;
@@ -235,6 +281,12 @@ export interface WeReportLocale {
235
281
  chartLine: string;
236
282
  chartPie: string;
237
283
  chartDoughnut: string;
284
+ chartMax: string;
285
+ chartDataBar: string;
286
+ chartGauge: string;
287
+ chartSparkline: string;
288
+ chartRows: string;
289
+ chartRowsHint: string;
238
290
  chartCategory: string;
239
291
  chartValue: string;
240
292
  chartAggregate: string;
@@ -247,6 +299,24 @@ export interface WeReportLocale {
247
299
  showValues: string;
248
300
  showLegend: string;
249
301
  chartHint: string;
302
+ crosstabHint: string;
303
+ crosstabRows: string;
304
+ crosstabColumns: string;
305
+ crosstabValue: string;
306
+ crosstabTotals: string;
307
+ crosstabTitle: string;
308
+ subreportHint: string;
309
+ subreportEdit: string;
310
+ subreportLoad: string;
311
+ subreportLoadFailed: string;
312
+ subreportRows: string;
313
+ subreportRowsHint: string;
314
+ subreportFilter: string;
315
+ subreportFilterHint: string;
316
+ subreportParams: string;
317
+ subreportTitle: string;
318
+ subreportDone: string;
319
+ subreportPageHint: string;
250
320
  conditionalFormatting: string;
251
321
  watermark: string;
252
322
  firstPage: string;
@@ -279,6 +349,8 @@ export interface WeReportLocale {
279
349
  stretch: string;
280
350
  stretchHint: string;
281
351
  fitToText: string;
352
+ tidyUp: string;
353
+ tidyUpHint: string;
282
354
  collapseBand: string;
283
355
  expandBand: string;
284
356
  groupByThis: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "we-report-angular",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Free, native Angular banded report designer and viewer — drag-and-drop design, paper sizes, data binding, barcodes, PDF export. No backend required.",
5
5
  "license": "MIT",
6
6
  "author": "Emre CIRIK",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "tslib": "^2.3.0",
35
- "we-report-core": "~0.6.0"
35
+ "we-report-core": "~0.7.0"
36
36
  },
37
37
  "sideEffects": false,
38
38
  "module": "fesm2022/we-report-angular.mjs",