we-report-angular 0.6.0 → 0.8.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 +270 -45
  6. package/esm2022/lib/designer/designer-fields.mjs +47 -13
  7. package/esm2022/lib/designer/designer-state.mjs +57 -3
  8. package/esm2022/lib/designer/expression-editor.component.mjs +11 -5
  9. package/esm2022/lib/designer/property-panel.component.mjs +117 -5
  10. package/esm2022/lib/designer/we-report-designer.component.mjs +224 -20
  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 +1713 -131
  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 +22 -1
  25. package/lib/designer/designer-fields.d.ts +9 -1
  26. package/lib/designer/designer-state.d.ts +8 -0
  27. package/lib/designer/property-panel.component.d.ts +33 -3
  28. package/lib/designer/we-report-designer.component.d.ts +53 -3
  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 = {
@@ -20,8 +22,17 @@ export type DesignerDragData = {
20
22
  path: string;
21
23
  parent: boolean;
22
24
  format?: string;
25
+ caption?: string;
23
26
  };
24
27
  export declare const DRAG_MIME = "application/x-we-report";
28
+ /**
29
+ * Fields to start a chart or cross table with: text fields that repeat (fewest different values
30
+ * first; a name on every row does not group) and the number field with the largest total.
31
+ */
32
+ export declare function guessBindings(rows: readonly unknown[]): {
33
+ groups: string[];
34
+ amount?: string;
35
+ };
25
36
  export interface Rect {
26
37
  x: number;
27
38
  y: number;
@@ -64,6 +75,13 @@ export declare class DesignSurfaceComponent implements OnDestroy {
64
75
  private readonly fontsService;
65
76
  /** Texts (without Grow to fit text) whose content does not fit, measured with the report's fonts like the print. */
66
77
  readonly cutTexts: import("@angular/core").WritableSignal<ReadonlySet<string>>;
78
+ /**
79
+ * Sub-reports, cross tables and charts drawn inside their box as they print, from the sample
80
+ * data: a sub-report with the sample row around it, the others over all sample rows.
81
+ */
82
+ protected readonly previewPages: import("@angular/core").WritableSignal<ReadonlyMap<string, LayoutPage>>;
83
+ private previewRun;
84
+ private readonly previewItems;
67
85
  private measureRun;
68
86
  private readonly measureTexts;
69
87
  /** The rubber band while dragging on an empty part of a section (mm in that section). */
@@ -115,6 +133,8 @@ export declare class DesignSurfaceComponent implements OnDestroy {
115
133
  protected isBound(c: ReportControl): boolean;
116
134
  protected boundExpression(c: ReportControl): string;
117
135
  protected caption(c: ReportControl, band?: Band): string;
136
+ /** A rich text's styled pieces; its `{formula}` fields show the sample data, else the formula. */
137
+ protected richRuns(c: ReportControl, band?: Band): RichRun[];
118
138
  protected textStyle(c: ReportControl): Record<string, string>;
119
139
  /** Cells of a table control in mm relative to the control, with their text and look. */
120
140
  protected tableCells(c: ReportControl, band?: Band): {
@@ -185,6 +205,7 @@ export declare class DesignSurfaceComponent implements OnDestroy {
185
205
  } | null;
186
206
  /** Fixed watermark text, or its formula, shown faintly on the design page. */
187
207
  protected watermarkText(): string;
208
+ protected crosstabLabel(c: ReportControl): string;
188
209
  protected chartLabel(c: ReportControl): string;
189
210
  private readFile;
190
211
  /** A picture at (x, y) mm, at its natural size up to 80 mm wide (PNG/JPEG data URI). */
@@ -2,7 +2,10 @@ import { FieldType, ReportDefinition } from 'we-report-core';
2
2
  /** A field the user can drop or pick, flattened from the data schema. */
3
3
  export interface DesignerField {
4
4
  path: string;
5
+ /** The host's display name (`fieldLabels`), else the field name. */
5
6
  label: string;
7
+ /** The host's display name when it gave one; captions dropped fields. */
8
+ caption?: string;
6
9
  type: FieldType;
7
10
  /** Belongs to the object around the rows (`[^.x]`), e.g. the invoice header. */
8
11
  parent: boolean;
@@ -13,9 +16,14 @@ export interface DesignerField {
13
16
  * Row fields, fields of the object holding the rows (when the rows are a nested list), the lists
14
17
  * inside a row (for an inner list) and the fields of the inner list's items.
15
18
  */
16
- export declare function designerFields(report: ReportDefinition, data?: unknown): {
19
+ export declare function designerFields(report: ReportDefinition, data?: unknown,
20
+ /** Inside a sub-report: the row around it, whose fields `[^.field]` reads. */
21
+ outerRow?: unknown,
22
+ /** Display names by path from the data root (`Supplier.SupplierName`, `Items.ProductName`). */
23
+ labels?: Record<string, string>): {
17
24
  rows: DesignerField[];
18
25
  parent: DesignerField[];
19
26
  lists: string[];
27
+ listLabels: Record<string, string>;
20
28
  inner: DesignerField[];
21
29
  };
@@ -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,13 @@ 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
+ /** Display names of the lists (`fieldLabels` of the designer), by list path. */
17
+ readonly listLabels: import("@angular/core").InputSignal<Record<string, string>>;
18
+ /** A sub-report's design: its page comes from the box, so paper and margins are not offered. */
19
+ readonly embedded: import("@angular/core").InputSignal<boolean>;
16
20
  protected readonly state: DesignerState;
21
+ /** Prefix of this panel's datalist ids: two designers may share a page. */
22
+ protected readonly listId: string;
17
23
  protected readonly papers: readonly import("we-report-core").PaperSize[];
18
24
  protected readonly symbologies: readonly string[];
19
25
  protected readonly formats: {
@@ -64,10 +70,18 @@ export declare class PropertyPanelComponent {
64
70
  protected setWatermark(patch: Partial<Watermark>): void;
65
71
  protected setPaper(paper: string): void;
66
72
  protected setPage(key: 'orientation' | 'width' | 'height', value: string): void;
73
+ protected setPageOption(key: 'color' | 'mirrorMargins', value: string | boolean | undefined): void;
67
74
  protected setMargin(side: 'top' | 'right' | 'bottom' | 'left', value: string): void;
68
75
  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;
76
+ protected setBand(key: 'height' | 'groupBy' | 'sort' | 'backgroundColor' | 'alternateBackgroundColor' | 'visible' | 'rowsPath', value: string): void;
77
+ /** Groups in the order of a formula over their rows; an empty formula goes back to the key order. */
78
+ protected setGroupOrder(expression: string, descending: boolean): void;
79
+ protected setGroupTop(value: string): void;
80
+ protected bookmarkValue(b: Band): Bindable<string>;
81
+ protected setBookmark(value: Bindable<string>): void;
82
+ protected toggleBand(key: 'keepTogether' | 'keepWithFirstRow' | 'repeatOnEveryPage' | 'resetPageNumber' | 'pageBreakBefore' | 'pageBreakAfter' | 'printAtBottom', value: boolean): void;
83
+ /** Printed is the default, so only `false` is stored. */
84
+ protected setPrintOn(key: 'printOnFirstPage' | 'printOnLastPage', value: boolean): void;
71
85
  protected labelSheetName(l: LabelSheet): string;
72
86
  protected applyLabelSheet(id: string): void;
73
87
  protected readonly fieldExpressions: import("@angular/core").Signal<Set<string>>;
@@ -83,7 +97,23 @@ export declare class PropertyPanelComponent {
83
97
  protected setBindable(key: 'text' | 'value' | 'source' | 'checked' | 'visible', value: Bindable<string>): void;
84
98
  protected visibleValue(c: ReportControl): Bindable<string>;
85
99
  protected setVisible(value: Bindable<string>): void;
100
+ /** A sparkline is a line-height chart: a full-size chart box shrinks to fit a row. */
101
+ protected setChartType(type: ChartType): void;
102
+ protected setOptionalChartRows(expression: string): void;
86
103
  protected setExpression(key: 'category' | 'value', expression: string): void;
104
+ protected readonly crosstabKeys: {
105
+ key: 'rows' | 'columns' | 'value';
106
+ label: 'crosstabRows' | 'crosstabColumns' | 'crosstabValue';
107
+ }[];
108
+ protected setCrosstab(key: 'rows' | 'columns' | 'value', expression: string): void;
109
+ /** A file chosen for "Use a saved report" could not be read. */
110
+ protected readonly subreportError: import("@angular/core").WritableSignal<boolean>;
111
+ /** A formula that may be left empty (then the property goes away). */
112
+ protected setOptionalExpression(key: 'rows' | 'filter', expression: string): void;
113
+ /** Puts a saved report (or an RDLC / REPX one, converted) into the selected sub-report. */
114
+ protected chooseSubreport(event: Event): Promise<void>;
115
+ protected subreportParamValue(c: ReportControl, name: string): Bindable<string>;
116
+ protected setSubreportParam(name: string, value: Bindable<string>): void;
87
117
  /** Row/column commands act on the clicked cell, or on the last row/column. */
88
118
  protected tableOp(op: 'insertRow' | 'insertColumn' | 'deleteRow' | 'deleteColumn' | 'mergeRight' | 'splitCell'): void;
89
119
  private updateCell;
@@ -108,5 +138,5 @@ export declare class PropertyPanelComponent {
108
138
  protected num(value: number | undefined | null): string;
109
139
  protected asNumber(value: string, fallback: number): number;
110
140
  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>;
141
+ 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; }; "listLabels": { "alias": "listLabels"; "required": false; "isSignal": true; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
112
142
  }
@@ -21,8 +21,19 @@ 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>;
28
+ /**
29
+ * Display names for data fields by path from the data root: `OrderNumber`, `Supplier.SupplierName`,
30
+ * `Items.ProductName` (lists without `[]`), and objects or lists themselves (`Supplier`, `Items`).
31
+ * Only what the designer shows; formulas and the saved report keep the real names.
32
+ */
33
+ readonly fieldLabels: import("@angular/core").InputSignal<Record<string, string> | undefined>;
24
34
  protected readonly state: DesignerState;
25
35
  private readonly fontsService;
36
+ private readonly config;
26
37
  private readonly defaultLocale;
27
38
  protected readonly strings: import("@angular/core").Signal<WeReportLocale>;
28
39
  protected readonly toolbox: {
@@ -50,6 +61,7 @@ export declare class WeReportDesignerComponent {
50
61
  };
51
62
  } | null>;
52
63
  private readonly canvas;
64
+ private readonly injector;
53
65
  private readonly host;
54
66
  private readonly surface;
55
67
  protected readonly shortcutsOpen: import("@angular/core").WritableSignal<boolean>;
@@ -106,16 +118,31 @@ export declare class WeReportDesignerComponent {
106
118
  rows: DesignerField[];
107
119
  parent: DesignerField[];
108
120
  lists: string[];
121
+ listLabels: Record<string, string>;
109
122
  inner: DesignerField[];
110
123
  }>;
111
124
  protected readonly fieldFilter: import("@angular/core").WritableSignal<string>;
112
- /** The field list narrowed to names containing the filter text. */
125
+ /** Objects opened in the field list (`rows:Supplier`); all start closed. */
126
+ protected readonly openNodes: import("@angular/core").WritableSignal<ReadonlySet<string>>;
127
+ /**
128
+ * The field list with closed objects' fields hidden; a filter shows the fields whose label or
129
+ * name contains it, with the objects around them open.
130
+ */
113
131
  protected readonly shownFields: import("@angular/core").Signal<{
114
132
  rows: DesignerField[];
133
+ inner: DesignerField[];
115
134
  parent: DesignerField[];
116
135
  lists: string[];
117
- inner: DesignerField[];
136
+ listLabels: Record<string, string>;
118
137
  }>;
138
+ protected nodeOpen(section: string, path: string): boolean;
139
+ protected toggleNode(section: string, path: string): void;
140
+ /** Lists in the data the detail rows can come from ("Rows: Items"); empty when there is no choice. */
141
+ protected readonly rowLists: import("@angular/core").Signal<{
142
+ path: string;
143
+ label: string;
144
+ }[]>;
145
+ protected setRowsPath(path: string): void;
119
146
  protected readonly allFields: import("@angular/core").Signal<DesignerField[]>;
120
147
  protected readonly addableBands: import("@angular/core").Signal<BandKind[]>;
121
148
  constructor();
@@ -133,6 +160,7 @@ export declare class WeReportDesignerComponent {
133
160
  private readonly rememberView;
134
161
  protected pickZoom(value: string): void;
135
162
  protected fitWidth(): void;
163
+ /** Ctrl + wheel (and a trackpad pinch) zooms around the pointer. */
136
164
  protected onCanvasWheel(e: WheelEvent): void;
137
165
  protected openContextMenu(e: MouseEvent): void;
138
166
  /** A new text where the section was right-clicked, ready to type in. */
@@ -145,12 +173,33 @@ export declare class WeReportDesignerComponent {
145
173
  protected groupByValue(): void;
146
174
  /** Puts `Sum(...)` of the selected column under it in every group footer and the report footer. */
147
175
  protected addTotal(): void;
176
+ /** The sub-report whose design is open in its own designer window. */
177
+ protected readonly openSubreport: import("@angular/core").Signal<import("we-report-core").SubreportControl | null>;
178
+ /** The sub-report on a page as wide as its box and as tall as its content, as it prints. */
179
+ protected readonly subreportDesign: import("@angular/core").Signal<ReportDefinition | null>;
180
+ /**
181
+ * Sample data for the sub-report's designer: its rows formula over the first row, else the data
182
+ * of the source it is bound to (its own, or one of this report's, as in the layout).
183
+ */
184
+ protected readonly subreportData: import("@angular/core").Signal<unknown>;
185
+ /** The window closes when its sub-report is gone (deleted, or undone away), and takes the focus when it opens. */
186
+ private readonly subreportWindow;
187
+ /** Edits from the sub-report's designer; one undo step per burst of edits here. */
188
+ protected setSubreport(id: string, report: ReportDefinition): void;
148
189
  protected readonly hasTextSelected: import("@angular/core").Signal<boolean>;
149
190
  /**
150
191
  * Sizes the selected texts to what they show on the page (fixed text, or the sample value),
151
192
  * measured with the report's fonts, so it matches the printed size.
152
193
  */
153
194
  protected fitToText(): Promise<void>;
195
+ protected tidySelection(): void;
196
+ protected tidyBand(bandId: string): void;
197
+ /**
198
+ * What a bound text prints with the first data row, also while *Show data* is off (the page
199
+ * then shows the formula); `null` when there is no data to evaluate with.
200
+ * shortcut: inner-list texts use the detail row, so their size may be off; measure them with *Show data* on.
201
+ */
202
+ private printedText;
154
203
  /** Shrinks (or grows) a section to just below its lowest item. */
155
204
  protected fitBand(bandId: string | null): void;
156
205
  /** Runs a context-menu command and closes the menu. */
@@ -177,6 +226,7 @@ export declare class WeReportDesignerComponent {
177
226
  title: string;
178
227
  fields: {
179
228
  name: string;
229
+ label: string;
180
230
  on: boolean;
181
231
  }[];
182
232
  groupBy: string;
@@ -199,5 +249,5 @@ export declare class WeReportDesignerComponent {
199
249
  protected fixIssue(issue: ReportIssue): void;
200
250
  protected onKeydown(e: KeyboardEvent): void;
201
251
  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>;
252
+ 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; }; "fieldLabels": { "alias": "fieldLabels"; "required": false; "isSignal": true; }; }, { "report": "reportChange"; }, never, never, true, never>;
203
253
  }
@@ -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;