we-report-angular 0.5.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 (35) 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 +309 -52
  6. package/esm2022/lib/designer/designer-fields.mjs +21 -4
  7. package/esm2022/lib/designer/designer-state.mjs +65 -3
  8. package/esm2022/lib/designer/expression-editor.component.mjs +131 -5
  9. package/esm2022/lib/designer/property-panel.component.mjs +115 -5
  10. package/esm2022/lib/designer/we-report-designer.component.mjs +295 -29
  11. package/esm2022/lib/locales/de.mjs +94 -1
  12. package/esm2022/lib/locales/es.mjs +94 -1
  13. package/esm2022/lib/locales/fr.mjs +94 -1
  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 +5 -1
  18. package/esm2022/lib/we-report-locale.mjs +187 -1
  19. package/fesm2022/we-report-angular.mjs +1968 -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 +26 -1
  25. package/lib/designer/designer-fields.d.ts +3 -1
  26. package/lib/designer/designer-state.d.ts +11 -0
  27. package/lib/designer/expression-editor.component.d.ts +21 -0
  28. package/lib/designer/property-panel.component.d.ts +31 -3
  29. package/lib/designer/we-report-designer.component.d.ts +56 -3
  30. package/lib/viewer/page-canvas.d.ts +8 -0
  31. package/lib/viewer/we-report-viewer.component.d.ts +45 -2
  32. package/lib/we-report-icons.d.ts +4 -0
  33. package/lib/we-report-locale.d.ts +81 -0
  34. package/package.json +2 -2
  35. 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;
@@ -61,6 +71,18 @@ export declare class DesignSurfaceComponent implements OnDestroy {
61
71
  protected readonly handles: Handle[];
62
72
  protected readonly guides: import("@angular/core").WritableSignal<Guide[]>;
63
73
  protected readonly gaps: import("@angular/core").WritableSignal<Gap[]>;
74
+ private readonly fontsService;
75
+ /** Texts (without Grow to fit text) whose content does not fit, measured with the report's fonts like the print. */
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;
84
+ private measureRun;
85
+ private readonly measureTexts;
64
86
  /** The rubber band while dragging on an empty part of a section (mm in that section). */
65
87
  protected readonly marquee: import("@angular/core").WritableSignal<{
66
88
  bandId: string;
@@ -110,6 +132,8 @@ export declare class DesignSurfaceComponent implements OnDestroy {
110
132
  protected isBound(c: ReportControl): boolean;
111
133
  protected boundExpression(c: ReportControl): string;
112
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[];
113
137
  protected textStyle(c: ReportControl): Record<string, string>;
114
138
  /** Cells of a table control in mm relative to the control, with their text and look. */
115
139
  protected tableCells(c: ReportControl, band?: Band): {
@@ -180,6 +204,7 @@ export declare class DesignSurfaceComponent implements OnDestroy {
180
204
  } | null;
181
205
  /** Fixed watermark text, or its formula, shown faintly on the design page. */
182
206
  protected watermarkText(): string;
207
+ protected crosstabLabel(c: ReportControl): string;
183
208
  protected chartLabel(c: ReportControl): string;
184
209
  private readFile;
185
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[];
@@ -24,9 +24,14 @@ export declare class DesignerState {
24
24
  readonly canRedo: import("@angular/core").WritableSignal<boolean>;
25
25
  /** The table cell last clicked; the inspector edits it while its table is selected. */
26
26
  readonly tableCell: import("@angular/core").WritableSignal<TableCellRef | null>;
27
+ /** Sections folded away in the designer to save room (not saved in the report). */
28
+ readonly collapsed: import("@angular/core").WritableSignal<ReadonlySet<string>>;
29
+ toggleCollapsed(bandId: string): void;
27
30
  /** Format painter: the look picked up from one item, applied to the next item clicked. */
28
31
  readonly painter: import("@angular/core").WritableSignal<Pick<ReportControl, "style" | "styleOverrides"> | null>;
29
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>;
30
35
  readonly editing: import("@angular/core").WritableSignal<{
31
36
  controlId: string;
32
37
  row?: number;
@@ -43,6 +48,7 @@ export declare class DesignerState {
43
48
  row: unknown;
44
49
  rows: readonly unknown[];
45
50
  parent: unknown;
51
+ calculated?: Record<string, string>;
46
52
  } | null>;
47
53
  readonly selectedControls: import("@angular/core").Signal<ReportControl[]>;
48
54
  readonly selectedBand: import("@angular/core").Signal<Band | null>;
@@ -83,6 +89,11 @@ export declare class DesignerState {
83
89
  selectAll(): void;
84
90
  /** Aligns the selection to the first selected control (the one clicked first). */
85
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;
86
97
  /** Equal gaps between three or more controls, keeping the outermost two in place. */
87
98
  distribute(axis: 'h' | 'v'): void;
88
99
  /** Gives the selection the width and/or height of the first selected control. */
@@ -3,6 +3,13 @@ import { FunctionCategory, FunctionInfo } from 'we-report-core';
3
3
  import { WeReportLocale } from '../we-report-locale';
4
4
  import { DesignerField } from './designer-fields';
5
5
  import * as i0 from "@angular/core";
6
+ interface Suggestion {
7
+ label: string;
8
+ insert: string;
9
+ /** How far the caret moves back after inserting (into a function's brackets). */
10
+ back: number;
11
+ help: string;
12
+ }
6
13
  /**
7
14
  * A sheet for writing a formula: fields, parameters and every function with a one-line
8
15
  * explanation, inserted at the cursor, and the result for the first data row as you type.
@@ -32,8 +39,22 @@ export declare class ExpressionEditorComponent implements AfterViewInit {
32
39
  ngAfterViewInit(): void;
33
40
  /** Inserts at the caret (replacing a selection); `caretBack` moves the caret left afterwards. */
34
41
  protected insert(text: string, caretBack?: number): void;
42
+ /** The word (or `[field` start) before the caret that suggestions complete. */
43
+ protected readonly token: import("@angular/core").WritableSignal<{
44
+ start: number;
45
+ text: string;
46
+ field: boolean;
47
+ } | null>;
48
+ protected readonly active: import("@angular/core").WritableSignal<number>;
49
+ /** Functions, fields and parameters matching the word being typed, best first. */
50
+ protected readonly suggestions: import("@angular/core").Signal<Suggestion[]>;
51
+ /** Finds the word at the caret: letters after an operator, or an unfinished `[field`. */
52
+ protected findToken(): void;
53
+ protected onKey(e: KeyboardEvent): void;
54
+ protected accept(s: Suggestion): void;
35
55
  /** Inserts `Name()` and puts the cursor between the brackets. */
36
56
  protected insertFunction(f: FunctionInfo): void;
37
57
  static ɵfac: i0.ɵɵFactoryDeclaration<ExpressionEditorComponent, never>;
38
58
  static ɵcmp: i0.ɵɵComponentDeclaration<ExpressionEditorComponent, "we-report-expression-editor", never, { "expression": { "alias": "expression"; "required": false; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; "isSignal": true; }; "strings": { "alias": "strings"; "required": true; "isSignal": true; }; }, { "applied": "applied"; "closed": "closed"; }, never, never, true, never>;
39
59
  }
60
+ export {};
@@ -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,8 @@ export declare class WeReportDesignerComponent {
50
55
  };
51
56
  } | null>;
52
57
  private readonly canvas;
58
+ private readonly injector;
59
+ private readonly host;
53
60
  private readonly surface;
54
61
  protected readonly shortcutsOpen: import("@angular/core").WritableSignal<boolean>;
55
62
  /** Side panel widths in px; 0 hides a panel. Remembered in this browser. */
@@ -107,6 +114,14 @@ export declare class WeReportDesignerComponent {
107
114
  lists: string[];
108
115
  inner: DesignerField[];
109
116
  }>;
117
+ protected readonly fieldFilter: import("@angular/core").WritableSignal<string>;
118
+ /** The field list narrowed to names containing the filter text. */
119
+ protected readonly shownFields: import("@angular/core").Signal<{
120
+ rows: DesignerField[];
121
+ parent: DesignerField[];
122
+ lists: string[];
123
+ inner: DesignerField[];
124
+ }>;
110
125
  protected readonly allFields: import("@angular/core").Signal<DesignerField[]>;
111
126
  protected readonly addableBands: import("@angular/core").Signal<BandKind[]>;
112
127
  constructor();
@@ -115,12 +130,16 @@ export declare class WeReportDesignerComponent {
115
130
  protected outlineIcon(c: ReportControl): keyof WeReportIcons;
116
131
  protected selectFromOutline(e: MouseEvent, id: string): void;
117
132
  protected isSelected(id: string): boolean;
133
+ /** Unique per designer, so two designers on one page do not share the size list. */
134
+ protected readonly sizeListId: string;
118
135
  protected readonly zoomSteps: number[];
119
136
  protected readonly gridSteps: number[];
120
137
  /** Snap grid in mm; 0 turns the grid off. */
121
138
  protected readonly gridSize: import("@angular/core").WritableSignal<number>;
139
+ private readonly rememberView;
122
140
  protected pickZoom(value: string): void;
123
141
  protected fitWidth(): void;
142
+ /** Ctrl + wheel (and a trackpad pinch) zooms around the pointer. */
124
143
  protected onCanvasWheel(e: WheelEvent): void;
125
144
  protected openContextMenu(e: MouseEvent): void;
126
145
  /** A new text where the section was right-clicked, ready to type in. */
@@ -128,6 +147,38 @@ export declare class WeReportDesignerComponent {
128
147
  x: number;
129
148
  y: number;
130
149
  }): void;
150
+ /** A single bound text in the detail section: it can get a total ("insert summary"). */
151
+ protected readonly totalTarget: import("@angular/core").Signal<import("we-report-core").TextControl | null>;
152
+ protected groupByValue(): void;
153
+ /** Puts `Sum(...)` of the selected column under it in every group footer and the report footer. */
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;
168
+ protected readonly hasTextSelected: import("@angular/core").Signal<boolean>;
169
+ /**
170
+ * Sizes the selected texts to what they show on the page (fixed text, or the sample value),
171
+ * measured with the report's fonts, so it matches the printed size.
172
+ */
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;
131
182
  /** Shrinks (or grows) a section to just below its lowest item. */
132
183
  protected fitBand(bandId: string | null): void;
133
184
  /** Runs a context-menu command and closes the menu. */
@@ -148,7 +199,7 @@ export declare class WeReportDesignerComponent {
148
199
  }): void;
149
200
  protected onFieldDragStart(e: DragEvent, field: DesignerField): void;
150
201
  private setDrag;
151
- protected addBand(kind: BandKind): void;
202
+ protected addBand(kind: BandKind, groupBy?: string): void;
152
203
  /** The report wizard's choices while it is open. */
153
204
  protected readonly wizard: import("@angular/core").WritableSignal<{
154
205
  title: string;
@@ -164,15 +215,17 @@ export declare class WeReportDesignerComponent {
164
215
  } | null>;
165
216
  /** Opens the report wizard: pick columns, grouping, totals and paper, then a tidy list is built. */
166
217
  protected autoDesign(): void;
218
+ /** At least one column (or a grouping) to build from. */
219
+ protected readonly wizardReady: import("@angular/core").Signal<boolean>;
167
220
  protected updateWizard(change: Partial<NonNullable<ReturnType<typeof this.wizard>>>): void;
168
221
  protected toggleWizardField(name: string): void;
169
222
  /** Replaces the layout with the wizard's list report (undoable). */
170
223
  protected runWizard(): void;
171
224
  protected issueText(issue: ReportIssue): string;
172
225
  protected showIssue(issue: ReportIssue): void;
173
- /** Moves (and if needed narrows) an item back inside the paper. */
226
+ /** Moves (and if needed narrows) an item back inside the paper; a cut text grows to fit instead. */
174
227
  protected fixIssue(issue: ReportIssue): void;
175
228
  protected onKeydown(e: KeyboardEvent): void;
176
229
  static ɵfac: i0.ɵɵFactoryDeclaration<WeReportDesignerComponent, never>;
177
- 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>;
178
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;
@@ -42,6 +45,7 @@ export interface WeReportIcons {
42
45
  fitHeight: string;
43
46
  noColor: string;
44
47
  wand: string;
48
+ sum: string;
45
49
  arrangeLeft: string;
46
50
  arrangeCenter: string;
47
51
  arrangeRight: string;