we-report-angular 0.0.0-stage → 0.2.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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -2
  3. package/esm2022/lib/designer/bindable-input.component.mjs +111 -0
  4. package/esm2022/lib/designer/control-factory.mjs +48 -0
  5. package/esm2022/lib/designer/data-sources-dialog.component.mjs +266 -0
  6. package/esm2022/lib/designer/database-source-editor.component.mjs +412 -0
  7. package/esm2022/lib/designer/design-surface.component.mjs +695 -0
  8. package/esm2022/lib/designer/designer-fields.mjs +37 -0
  9. package/esm2022/lib/designer/designer-state.mjs +315 -0
  10. package/esm2022/lib/designer/expression-editor.component.mjs +168 -0
  11. package/esm2022/lib/designer/formatting-rule.mjs +41 -0
  12. package/esm2022/lib/designer/property-panel.component.mjs +295 -0
  13. package/esm2022/lib/designer/we-report-designer.component.mjs +318 -0
  14. package/esm2022/lib/locales/de.mjs +326 -0
  15. package/esm2022/lib/locales/es.mjs +326 -0
  16. package/esm2022/lib/locales/fr.mjs +326 -0
  17. package/esm2022/lib/viewer/we-report-page.component.mjs +206 -0
  18. package/esm2022/lib/viewer/we-report-viewer.component.mjs +301 -0
  19. package/esm2022/lib/we-report-backend.service.mjs +17 -0
  20. package/esm2022/lib/we-report-config.mjs +26 -0
  21. package/esm2022/lib/we-report-fonts.service.mjs +75 -0
  22. package/esm2022/lib/we-report-icon.pipe.mjs +19 -0
  23. package/esm2022/lib/we-report-icons.mjs +47 -0
  24. package/esm2022/lib/we-report-locale.mjs +654 -0
  25. package/esm2022/lib/we-report-locales.mjs +21 -0
  26. package/esm2022/public-api.mjs +18 -0
  27. package/esm2022/we-report-angular.mjs +5 -0
  28. package/fesm2022/we-report-angular.mjs +4977 -0
  29. package/fesm2022/we-report-angular.mjs.map +1 -0
  30. package/index.d.ts +5 -0
  31. package/lib/designer/bindable-input.component.d.ts +27 -0
  32. package/lib/designer/control-factory.d.ts +14 -0
  33. package/lib/designer/data-sources-dialog.component.d.ts +61 -0
  34. package/lib/designer/database-source-editor.component.d.ts +58 -0
  35. package/lib/designer/design-surface.component.d.ts +112 -0
  36. package/lib/designer/designer-fields.d.ts +16 -0
  37. package/lib/designer/designer-state.d.ts +74 -0
  38. package/lib/designer/expression-editor.component.d.ts +39 -0
  39. package/lib/designer/formatting-rule.d.ts +14 -0
  40. package/lib/designer/property-panel.component.d.ts +87 -0
  41. package/lib/designer/we-report-designer.component.d.ts +90 -0
  42. package/lib/locales/de.d.ts +3 -0
  43. package/lib/locales/es.d.ts +3 -0
  44. package/lib/locales/fr.d.ts +3 -0
  45. package/lib/viewer/we-report-page.component.d.ts +19 -0
  46. package/lib/viewer/we-report-viewer.component.d.ts +56 -0
  47. package/lib/we-report-backend.service.d.ts +10 -0
  48. package/lib/we-report-config.d.ts +34 -0
  49. package/lib/we-report-fonts.service.d.ts +19 -0
  50. package/lib/we-report-icon.pipe.d.ts +12 -0
  51. package/lib/we-report-icons.d.ts +44 -0
  52. package/lib/we-report-locale.d.ts +283 -0
  53. package/lib/we-report-locales.d.ts +8 -0
  54. package/package.json +48 -3
  55. package/public-api.d.ts +14 -0
  56. package/styles/we-report-theme.scss +106 -0
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="we-report-angular" />
5
+ export * from './public-api';
@@ -0,0 +1,27 @@
1
+ import { Bindable } from 'we-report-core';
2
+ import { WeReportLocale } from '../we-report-locale';
3
+ import { DesignerField } from './designer-fields';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Edits a value that is either fixed or comes from data: "Fixed text" with a text box, or
7
+ * "From data" with a field picker and the formula it produces.
8
+ */
9
+ export declare class BindableInputComponent {
10
+ readonly value: import("@angular/core").InputSignal<Bindable<string>>;
11
+ readonly fields: import("@angular/core").InputSignal<DesignerField[]>;
12
+ readonly strings: import("@angular/core").InputSignal<WeReportLocale>;
13
+ readonly multiline: import("@angular/core").InputSignal<boolean>;
14
+ readonly valueChange: import("@angular/core").OutputEmitterRef<Bindable<string>>;
15
+ protected readonly editorOpen: import("@angular/core").WritableSignal<boolean>;
16
+ protected readonly bound: import("@angular/core").Signal<boolean>;
17
+ protected readonly expression: import("@angular/core").Signal<string>;
18
+ protected readonly fixedText: import("@angular/core").Signal<string>;
19
+ protected readonly fieldMatch: import("@angular/core").Signal<boolean>;
20
+ protected toFixed(): void;
21
+ protected toBound(): void;
22
+ protected pickField(expression: string): void;
23
+ protected setExpression(expression: string): void;
24
+ protected setFixed(text: string): void;
25
+ 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>;
27
+ }
@@ -0,0 +1,14 @@
1
+ import { FieldSchema, ReportControl, ReportControlType } from 'we-report-core';
2
+ export { captionFor } from 'we-report-core';
3
+ /** Toolbox entries in display order. */
4
+ export declare const TOOLBOX_ITEMS: {
5
+ type: ReportControlType;
6
+ icon: string;
7
+ variant?: string;
8
+ }[];
9
+ /** A new control with sensible defaults, top-left corner at (x, y) mm. */
10
+ export declare function createControl(type: ReportControlType, id: string, x: number, y: number, text: string, variant?: string): ReportControl;
11
+ /** Default display format for a data field type. */
12
+ export declare function formatFor(field: FieldSchema): string | undefined;
13
+ /** Bracketed field reference; `parent` fields read the object around the rows (`[^.number]`). */
14
+ export declare function fieldExpression(path: string, parent: boolean): string;
@@ -0,0 +1,61 @@
1
+ import { DatabaseDataSource, DataSourceDefinition, ParameterType, ReportParameter, WebServiceDataSource } from 'we-report-core';
2
+ import { WeReportLocale } from '../we-report-locale';
3
+ import { DesignerState } from './designer-state';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Data sources and parameters of the report: paste JSON/CSV, or describe a web service and test it.
7
+ * The test response is saved as the source's sample so fields show up and the design has data.
8
+ */
9
+ export declare class DataSourcesDialogComponent {
10
+ readonly strings: import("@angular/core").InputSignal<WeReportLocale>;
11
+ readonly fetchFn: import("@angular/core").InputSignal<typeof fetch | undefined>;
12
+ readonly closed: import("@angular/core").OutputEmitterRef<void>;
13
+ protected readonly state: DesignerState;
14
+ private readonly backend;
15
+ protected readonly report: import("@angular/core").Signal<import("we-report-core").ReportDefinition>;
16
+ protected readonly selectedId: import("@angular/core").WritableSignal<string | null>;
17
+ protected readonly source: import("@angular/core").Signal<DataSourceDefinition>;
18
+ protected readonly isMain: import("@angular/core").Signal<boolean>;
19
+ protected readonly listPaths: import("@angular/core").Signal<string[]>;
20
+ protected readonly rowCount: import("@angular/core").Signal<number>;
21
+ protected readonly jsonError: import("@angular/core").WritableSignal<string | null>;
22
+ protected readonly testing: import("@angular/core").WritableSignal<boolean>;
23
+ protected readonly testResult: import("@angular/core").WritableSignal<{
24
+ ok: boolean;
25
+ message: string;
26
+ } | null>;
27
+ protected readonly types: ParameterType[];
28
+ protected add(kind: DataSourceDefinition['kind']): void;
29
+ protected remove(): void;
30
+ protected select(id: string): void;
31
+ /** Edits the selected source in one undoable, coalesced step. */
32
+ protected edit(mutate: (s: DataSourceDefinition) => void, key: string): void;
33
+ protected setName(name: string): void;
34
+ protected useForRows(): void;
35
+ protected setRowsPath(path: string): void;
36
+ protected jsonText(s: DataSourceDefinition): string;
37
+ protected setJson(text: string): void;
38
+ protected setCsv(text: string): void;
39
+ protected csvRows(s: DataSourceDefinition): number;
40
+ protected web(s: DataSourceDefinition): WebServiceDataSource | null;
41
+ protected setWeb(key: 'url' | 'method' | 'body' | 'via', value: string): void;
42
+ protected db(s: DataSourceDefinition): DatabaseDataSource | null;
43
+ protected applyDbEdit(e: {
44
+ mutate: (s: DatabaseDataSource) => void;
45
+ key: string;
46
+ }): void;
47
+ protected addHeader(): void;
48
+ protected setHeader(index: number, key: 'name' | 'value', value: string): void;
49
+ protected removeHeader(index: number): void;
50
+ protected test(): Promise<void>;
51
+ /** When the main source is an object with exactly one list in it, rows come from that list. */
52
+ private autoPath;
53
+ protected addParameter(): void;
54
+ protected setParameter(index: number, key: keyof ReportParameter, value: string): void;
55
+ protected removeParameter(index: number): void;
56
+ protected typeLabel(t: ParameterType): string;
57
+ protected kindLabel(s: DataSourceDefinition): string;
58
+ private uniqueSourceId;
59
+ 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>;
61
+ }
@@ -0,0 +1,58 @@
1
+ import { BackendConnection, BackendSchema, DatabaseDataSource, QueryCondition, ReportParameter, StructuredQuery } from 'we-report-core';
2
+ import { WeReportBackendService } from '../we-report-backend.service';
3
+ import { WeReportLocale } from '../we-report-locale';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Visual query builder for a database source: backend → connection → table → columns → filters
7
+ * → order → limit, or free SQL where the connection allows it. Produces protocol/schemas/query.json.
8
+ */
9
+ export declare class DatabaseSourceEditorComponent {
10
+ readonly source: import("@angular/core").InputSignal<DatabaseDataSource>;
11
+ readonly parameters: import("@angular/core").InputSignal<ReportParameter[]>;
12
+ readonly strings: import("@angular/core").InputSignal<WeReportLocale>;
13
+ readonly fetchFn: import("@angular/core").InputSignal<typeof fetch | undefined>;
14
+ /** Emits a mutation of the source; the dialog applies it as one undoable step. */
15
+ readonly edit: import("@angular/core").OutputEmitterRef<{
16
+ mutate: (s: DatabaseDataSource) => void;
17
+ key: string;
18
+ }>;
19
+ protected readonly backend: WeReportBackendService;
20
+ protected readonly operators: ("=" | "!=" | "<" | "<=" | ">" | ">=" | "like" | "in" | "isNull" | "notNull")[];
21
+ protected readonly connections: import("@angular/core").WritableSignal<BackendConnection[]>;
22
+ protected readonly schema: import("@angular/core").WritableSignal<BackendSchema | null>;
23
+ protected readonly status: import("@angular/core").WritableSignal<{
24
+ ok: boolean;
25
+ message: string;
26
+ } | null>;
27
+ protected readonly testing: import("@angular/core").WritableSignal<boolean>;
28
+ protected readonly testResult: import("@angular/core").WritableSignal<{
29
+ ok: boolean;
30
+ message: string;
31
+ } | null>;
32
+ protected readonly query: import("@angular/core").Signal<StructuredQuery>;
33
+ protected readonly connection: import("@angular/core").Signal<BackendConnection | null>;
34
+ protected readonly tableColumns: import("@angular/core").Signal<{
35
+ name: string;
36
+ type: string;
37
+ }[]>;
38
+ constructor();
39
+ private get options();
40
+ connect(connectionId?: string): Promise<void>;
41
+ private loadSchema;
42
+ protected setConnection(id: string): Promise<void>;
43
+ private setQuery;
44
+ protected setTable(table: string): void;
45
+ protected isColumnOn(name: string): boolean;
46
+ protected toggleColumn(name: string, on: boolean): void;
47
+ protected addWhere(): void;
48
+ protected setWhere(i: number, key: 'column' | 'op' | 'value' | 'param', value: string): void;
49
+ protected removeWhere(i: number): void;
50
+ protected setOrder(column: string, dir: string): void;
51
+ protected setLimit(value: string): void;
52
+ protected toggleSql(on: boolean): void;
53
+ protected setSql(sql: string): void;
54
+ protected opLabel(op: QueryCondition['op']): string;
55
+ protected test(): Promise<void>;
56
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatabaseSourceEditorComponent, never>;
57
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatabaseSourceEditorComponent, "we-report-database-source-editor", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; "parameters": { "alias": "parameters"; "required": false; "isSignal": true; }; "strings": { "alias": "strings"; "required": true; "isSignal": true; }; "fetchFn": { "alias": "fetchFn"; "required": false; "isSignal": true; }; }, { "edit": "edit"; }, never, never, true, never>;
58
+ }
@@ -0,0 +1,112 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { Band, ReportControl, ReportControlType } from 'we-report-core';
3
+ import { WeReportLocale } from '../we-report-locale';
4
+ import { DesignerState } from './designer-state';
5
+ import * as i0 from "@angular/core";
6
+ /** First row of the data, shown inside bound controls while designing. */
7
+ export interface DesignSample {
8
+ row: unknown;
9
+ rows: readonly unknown[];
10
+ parent: unknown;
11
+ }
12
+ /** Payload of an HTML5 drag from the toolbox or the field list. */
13
+ export type DesignerDragData = {
14
+ kind: 'control';
15
+ type: ReportControlType;
16
+ variant?: string;
17
+ } | {
18
+ kind: 'field';
19
+ path: string;
20
+ parent: boolean;
21
+ format?: string;
22
+ };
23
+ export declare const DRAG_MIME = "application/x-we-report";
24
+ interface Guide {
25
+ bandId: string;
26
+ orientation: 'v' | 'h';
27
+ at: number;
28
+ }
29
+ type Handle = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
30
+ /** The page, its bands and controls, with selection, drag, resize, snapping and drop targets. */
31
+ export declare class DesignSurfaceComponent implements OnDestroy {
32
+ readonly strings: import("@angular/core").InputSignal<WeReportLocale>;
33
+ readonly zoom: import("@angular/core").InputSignal<number>;
34
+ /** Snap grid in mm; 0 turns snapping off. */
35
+ readonly gridSize: import("@angular/core").InputSignal<number>;
36
+ /** When set, bound text shows this data instead of its formula. */
37
+ readonly sample: import("@angular/core").InputSignal<DesignSample | null>;
38
+ protected readonly state: DesignerState;
39
+ private readonly config;
40
+ private readonly dom;
41
+ private readonly host;
42
+ protected readonly handles: Handle[];
43
+ protected readonly guides: import("@angular/core").WritableSignal<Guide[]>;
44
+ protected readonly geometry: import("@angular/core").Signal<import("we-report-core").PageGeometry>;
45
+ /** Top ruler in screen pixels: 0 at the left margin, a tick per millimetre, a label per centimetre. */
46
+ protected readonly ruler: import("@angular/core").Signal<{
47
+ width: number;
48
+ left: number;
49
+ right: number;
50
+ ticks: string;
51
+ labels: {
52
+ x: number;
53
+ text: string;
54
+ }[];
55
+ selection: {
56
+ x: number;
57
+ width: number;
58
+ } | null;
59
+ }>;
60
+ protected readonly padding: import("@angular/core").Signal<string>;
61
+ private op;
62
+ private readonly onMove;
63
+ private readonly onUp;
64
+ private opCounter;
65
+ ngOnDestroy(): void;
66
+ protected bandLabel(band: Band): string;
67
+ protected isSelected(id: string): boolean;
68
+ protected isOnlySelected(id: string): boolean;
69
+ protected isBandSelected(id: string): boolean;
70
+ protected guidesFor(bandId: string): Guide[];
71
+ protected isBound(c: ReportControl): boolean;
72
+ protected boundExpression(c: ReportControl): string;
73
+ protected caption(c: ReportControl): string;
74
+ protected textStyle(c: ReportControl): Record<string, string>;
75
+ protected shapeStyle(c: ReportControl): Record<string, string>;
76
+ protected lineCoords(c: ReportControl): [number, number, number, number];
77
+ protected lineColor(c: ReportControl): string;
78
+ protected lineWidth(c: ReportControl): number;
79
+ protected staticImage(c: ReportControl): string | null;
80
+ protected objectFit(c: ReportControl): string;
81
+ protected isQr(c: ReportControl): boolean;
82
+ protected barcodeLabel(c: ReportControl): string;
83
+ protected selectBand(id: string): void;
84
+ protected onBodyPointerDown(e: PointerEvent): void;
85
+ protected onControlPointerDown(e: PointerEvent, c: ReportControl, band: Band): void;
86
+ protected onHandlePointerDown(e: PointerEvent, c: ReportControl, band: Band, handle: Handle): void;
87
+ protected onBandResizePointerDown(e: PointerEvent, band: Band): void;
88
+ private begin;
89
+ private stopListening;
90
+ private rectsOf;
91
+ private pointerMove;
92
+ private pointerUp;
93
+ private bandBodyAt;
94
+ private bandBodyRect;
95
+ private otherRects;
96
+ /** Finds the closest edge/centre alignment among `others` for any of `candidates`. */
97
+ private snapAxis;
98
+ private snapEdge;
99
+ private snapToGrid;
100
+ protected onDragOver(e: DragEvent): void;
101
+ protected onDrop(e: DragEvent, band: Band): void;
102
+ protected readonly defaultWatermarkColor = "#e3e6ea";
103
+ /** Fixed watermark text, or its formula, shown faintly on the design page. */
104
+ protected watermarkText(): string;
105
+ protected chartLabel(c: ReportControl): string;
106
+ /** Creates controls for a drop at (x, y) mm inside `band`. */
107
+ dropAt(data: DesignerDragData, band: Band, x: number, y: number): void;
108
+ private growBand;
109
+ static ɵfac: i0.ɵɵFactoryDeclaration<DesignSurfaceComponent, never>;
110
+ static ɵcmp: i0.ɵɵComponentDeclaration<DesignSurfaceComponent, "we-report-design-surface", never, { "strings": { "alias": "strings"; "required": true; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "gridSize": { "alias": "gridSize"; "required": false; "isSignal": true; }; "sample": { "alias": "sample"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
111
+ }
112
+ export {};
@@ -0,0 +1,16 @@
1
+ import { FieldType, ReportDefinition } from 'we-report-core';
2
+ /** A field the user can drop or pick, flattened from the data schema. */
3
+ export interface DesignerField {
4
+ path: string;
5
+ label: string;
6
+ type: FieldType;
7
+ /** Belongs to the object around the rows (`[^.x]`), e.g. the invoice header. */
8
+ parent: boolean;
9
+ expression: string;
10
+ depth: number;
11
+ }
12
+ /** Row fields, then fields of the object holding the rows (when the rows are a nested list). */
13
+ export declare function designerFields(report: ReportDefinition, data?: unknown): {
14
+ rows: DesignerField[];
15
+ parent: DesignerField[];
16
+ };
@@ -0,0 +1,74 @@
1
+ import { Band, ReportControl, ReportDefinition } from 'we-report-core';
2
+ import * as i0 from "@angular/core";
3
+ export type Selection = {
4
+ kind: 'none';
5
+ } | {
6
+ kind: 'controls';
7
+ ids: string[];
8
+ } | {
9
+ kind: 'band';
10
+ id: string;
11
+ };
12
+ export type AlignEdge = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
13
+ /**
14
+ * The designer's document, selection and undo history. Every edit goes through `update`, which
15
+ * snapshots the previous state — so every edit is undoable and observable.
16
+ */
17
+ export declare class DesignerState {
18
+ readonly report: import("@angular/core").WritableSignal<ReportDefinition>;
19
+ readonly selection: import("@angular/core").WritableSignal<Selection>;
20
+ readonly canUndo: import("@angular/core").WritableSignal<boolean>;
21
+ readonly canRedo: import("@angular/core").WritableSignal<boolean>;
22
+ /** The first data row and its scope, for live values in the design and the formula editor. */
23
+ readonly sample: import("@angular/core").WritableSignal<{
24
+ row: unknown;
25
+ rows: readonly unknown[];
26
+ parent: unknown;
27
+ } | null>;
28
+ readonly selectedControls: import("@angular/core").Signal<ReportControl[]>;
29
+ readonly selectedBand: import("@angular/core").Signal<Band | null>;
30
+ private past;
31
+ private future;
32
+ private lastKey;
33
+ private lastTime;
34
+ /** Replaces the document and clears history (a new report was opened). */
35
+ load(report: ReportDefinition): void;
36
+ /**
37
+ * Applies an edit to a copy of the document. Consecutive edits with the same `coalesce` key
38
+ * (typing in a field, dragging) within a moment become one undo step.
39
+ */
40
+ update(mutate: (draft: ReportDefinition) => void, coalesce?: string): void;
41
+ undo(): void;
42
+ redo(): void;
43
+ /** A new id not used by any band or control. */
44
+ newId(prefix: string): string;
45
+ findBandOf(controlId: string, def?: ReportDefinition): Band | undefined;
46
+ addControls(bandId: string, controls: ReportControl[]): void;
47
+ /** Mutates every selected control (or the given ids) in one undoable step. */
48
+ updateControls(ids: string[], mutate: (control: ReportControl, band: Band) => void, coalesce?: string): void;
49
+ updateBand(id: string, mutate: (band: Band) => void, coalesce?: string): void;
50
+ deleteSelection(): void;
51
+ removeBand(id: string): void;
52
+ duplicateSelection(): void;
53
+ /** Copies the selected controls to the designer clipboard (shared by every designer on the page). */
54
+ copySelection(): boolean;
55
+ cutSelection(): void;
56
+ /** Pastes into `bandId`, else the selected band, else each control's original kind of band. */
57
+ paste(bandId?: string): void;
58
+ hasClipboard(): boolean;
59
+ /** Selects every control of the selected band, or of the whole report. */
60
+ selectAll(): void;
61
+ /** Aligns the selection to the first selected control (the one clicked first). */
62
+ align(edge: AlignEdge): void;
63
+ /** Equal gaps between three or more controls, keeping the outermost two in place. */
64
+ distribute(axis: 'h' | 'v'): void;
65
+ /** Gives the selection the width and/or height of the first selected control. */
66
+ sameSize(dimension: 'width' | 'height' | 'both'): void;
67
+ /** Draw order inside a band: later controls paint on top. */
68
+ arrange(to: 'front' | 'back'): void;
69
+ select(id: string, additive: boolean): void;
70
+ private pruneSelection;
71
+ private syncFlags;
72
+ static ɵfac: i0.ɵɵFactoryDeclaration<DesignerState, never>;
73
+ static ɵprov: i0.ɵɵInjectableDeclaration<DesignerState>;
74
+ }
@@ -0,0 +1,39 @@
1
+ import { AfterViewInit } from '@angular/core';
2
+ import { FunctionCategory, FunctionInfo } from 'we-report-core';
3
+ import { WeReportLocale } from '../we-report-locale';
4
+ import { DesignerField } from './designer-fields';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * A sheet for writing a formula: fields, parameters and every function with a one-line
8
+ * explanation, inserted at the cursor, and the result for the first data row as you type.
9
+ */
10
+ export declare class ExpressionEditorComponent implements AfterViewInit {
11
+ readonly expression: import("@angular/core").InputSignal<string>;
12
+ readonly fields: import("@angular/core").InputSignal<DesignerField[]>;
13
+ readonly strings: import("@angular/core").InputSignal<WeReportLocale>;
14
+ readonly applied: import("@angular/core").OutputEmitterRef<string>;
15
+ readonly closed: import("@angular/core").OutputEmitterRef<void>;
16
+ private readonly state;
17
+ private readonly config;
18
+ private readonly area;
19
+ protected readonly categories: {
20
+ id: FunctionCategory;
21
+ label: keyof WeReportLocale;
22
+ }[];
23
+ protected readonly draft: import("@angular/core").WritableSignal<string>;
24
+ protected readonly category: import("@angular/core").WritableSignal<FunctionCategory>;
25
+ protected readonly parameters: import("@angular/core").Signal<import("we-report-core").ReportParameter[]>;
26
+ protected readonly visibleFunctions: import("@angular/core").Signal<FunctionInfo[]>;
27
+ /** What the formula gives for the first row, or why it cannot be evaluated. */
28
+ protected readonly result: import("@angular/core").Signal<{
29
+ text: string;
30
+ error: boolean;
31
+ }>;
32
+ ngAfterViewInit(): void;
33
+ /** Inserts at the caret (replacing a selection); `caretBack` moves the caret left afterwards. */
34
+ protected insert(text: string, caretBack?: number): void;
35
+ /** Inserts `Name()` and puts the cursor between the brackets. */
36
+ protected insertFunction(f: FunctionInfo): void;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExpressionEditorComponent, never>;
38
+ 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
+ }
@@ -0,0 +1,14 @@
1
+ /** The no-formula form of a conditional-formatting rule: `[field] op value`. */
2
+ export interface SimpleCondition {
3
+ field: string;
4
+ op: ConditionOp;
5
+ value: string;
6
+ }
7
+ export type ConditionOp = '=' | '!=' | '<' | '<=' | '>' | '>=' | 'contains';
8
+ export declare const CONDITION_OPS: {
9
+ op: ConditionOp;
10
+ label: string;
11
+ }[];
12
+ export declare function buildCondition(c: SimpleCondition): string;
13
+ /** Reads a formula back into the simple form, or `null` when it is something else. */
14
+ export declare function parseCondition(expression: string): SimpleCondition | null;
@@ -0,0 +1,87 @@
1
+ import { Band, Bindable, BorderStyle, ChartAggregate, ChartType, FormattingRule, Watermark, ReportControl, ReportStyle } from 'we-report-core';
2
+ import { WeReportIcons } from '../we-report-icons';
3
+ import { WeReportLocale } from '../we-report-locale';
4
+ import { DesignerField } from './designer-fields';
5
+ import { AlignEdge, DesignerState } from './designer-state';
6
+ import { SimpleCondition } from './formatting-rule';
7
+ import * as i0 from "@angular/core";
8
+ /** Plain-language properties of the selection: a control, a band, or the report itself. */
9
+ export declare class PropertyPanelComponent {
10
+ readonly strings: import("@angular/core").InputSignal<WeReportLocale>;
11
+ readonly fields: import("@angular/core").InputSignal<DesignerField[]>;
12
+ readonly fontFamilies: import("@angular/core").InputSignal<string[]>;
13
+ readonly advanced: import("@angular/core").InputSignal<boolean>;
14
+ protected readonly state: DesignerState;
15
+ protected readonly papers: readonly import("we-report-core").PaperSize[];
16
+ protected readonly symbologies: readonly string[];
17
+ protected readonly formats: {
18
+ value: string;
19
+ key: keyof WeReportLocale;
20
+ }[];
21
+ protected readonly alignActions: {
22
+ edge: AlignEdge;
23
+ icon: keyof WeReportIcons;
24
+ label: keyof WeReportLocale & `arrange${string}`;
25
+ }[];
26
+ protected readonly chartTypes: {
27
+ type: ChartType;
28
+ label: keyof WeReportLocale;
29
+ }[];
30
+ protected readonly cultures: {
31
+ id: string;
32
+ name: string;
33
+ }[];
34
+ protected readonly currencies: string[];
35
+ protected readonly aggregates: {
36
+ value: ChartAggregate;
37
+ label: keyof WeReportLocale;
38
+ }[];
39
+ protected readonly conditionOps: {
40
+ op: import("./formatting-rule").ConditionOp;
41
+ label: string;
42
+ }[];
43
+ protected readonly controls: import("@angular/core").Signal<ReportControl[]>;
44
+ protected readonly control: import("@angular/core").Signal<ReportControl | null>;
45
+ protected readonly band: import("@angular/core").Signal<Band | null>;
46
+ protected readonly report: import("@angular/core").Signal<import("we-report-core").ReportDefinition>;
47
+ protected readonly style: import("@angular/core").Signal<import("we-report-core").ResolvedStyle | null>;
48
+ protected readonly hasText: import("@angular/core").Signal<boolean>;
49
+ protected readonly formatIsCustom: import("@angular/core").Signal<boolean>;
50
+ protected setReport<K extends 'name'>(key: K, value: string): void;
51
+ /** Empty means "use the app's setting". */
52
+ protected setCulture(key: 'locale' | 'currency', value: string): void;
53
+ /** Empty text removes the watermark. */
54
+ protected setWatermark(patch: Partial<Watermark>): void;
55
+ protected setPaper(paper: string): void;
56
+ protected setPage(key: 'orientation' | 'width' | 'height', value: string): void;
57
+ protected setMargin(side: 'top' | 'right' | 'bottom' | 'left', value: string): void;
58
+ protected setRowsPath(path: string): void;
59
+ protected setBand(key: 'height' | 'groupBy' | 'sort' | 'backgroundColor', value: string): void;
60
+ protected toggleBand(key: 'keepTogether' | 'repeatOnEveryPage' | 'pageBreakBefore' | 'pageBreakAfter', value: boolean): void;
61
+ protected removeBand(): void;
62
+ protected ids(): string[];
63
+ protected setGeometry(key: 'x' | 'y' | 'width' | 'height', value: string): void;
64
+ /** Sets one property on the selected control(s) of a given type. */
65
+ protected set(key: string, value: unknown, coalesce?: string): void;
66
+ protected setBindable(key: 'text' | 'value' | 'source' | 'checked' | 'visible', value: Bindable<string>): void;
67
+ protected visibleValue(c: ReportControl): Bindable<string>;
68
+ protected setVisible(value: Bindable<string>): void;
69
+ protected setExpression(key: 'category' | 'value', expression: string): void;
70
+ protected condition(when: string): SimpleCondition | null;
71
+ private updateRules;
72
+ protected addRule(): void;
73
+ protected removeRule(index: number): void;
74
+ protected setRule(index: number, patch: Partial<FormattingRule>): void;
75
+ protected setCondition(index: number, current: SimpleCondition, key: keyof SimpleCondition, value: string): void;
76
+ protected setRuleStyle<K extends keyof ReportStyle>(index: number, key: K, value: ReportStyle[K] | undefined): void;
77
+ protected checkedValue(c: ReportControl): Bindable<string>;
78
+ protected setStyle<K extends keyof ReportStyle>(key: K, value: ReportStyle[K] | undefined): void;
79
+ protected setBorder(patch: Partial<BorderStyle> | null): void;
80
+ protected toggleBorderSide(side: keyof BorderStyle['sides'], on: boolean): void;
81
+ protected chooseImage(event: Event): Promise<void>;
82
+ protected textValue(c: ReportControl): Bindable<string>;
83
+ protected num(value: number | undefined | null): string;
84
+ protected asNumber(value: string, fallback: number): number;
85
+ static ɵfac: i0.ɵɵFactoryDeclaration<PropertyPanelComponent, never>;
86
+ 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; }; }, {}, never, never, true, never>;
87
+ }
@@ -0,0 +1,90 @@
1
+ import { Band, BandKind, ReportControl, ReportControlType, ReportDefinition, ReportIssue } from 'we-report-core';
2
+ import { WeReportIcons } from '../we-report-icons';
3
+ import { WeReportLocale } from '../we-report-locale';
4
+ import { DesignSample } from './design-surface.component';
5
+ import { DesignerField } from './designer-fields';
6
+ import { DesignerState } from './designer-state';
7
+ import * as i0 from "@angular/core";
8
+ /** Keeps bands in the order they print; sort is stable, so group nesting is preserved. */
9
+ export declare function orderBands(bands: Band[]): Band[];
10
+ /**
11
+ * The end-user report designer: toolbox and data fields on the left, the page in the middle,
12
+ * properties on the right, and a live preview tab. Two-way bind `[(report)]`.
13
+ */
14
+ export declare class WeReportDesignerComponent {
15
+ /** The report being designed. Updated on every edit. */
16
+ readonly report: import("@angular/core").ModelSignal<ReportDefinition>;
17
+ /** Sample data for the field list and preview; replaces the report's own data source data. */
18
+ readonly data: import("@angular/core").InputSignal<unknown>;
19
+ /** Overrides the `WE_REPORT_LOCALE` token, e.g. to switch language at runtime. */
20
+ readonly locale: import("@angular/core").InputSignal<WeReportLocale | undefined>;
21
+ readonly zoom: import("@angular/core").InputSignal<number>;
22
+ /** Fetch used for web-service data sources (testing in the designer and the preview). */
23
+ readonly fetchFn: import("@angular/core").InputSignal<typeof fetch | undefined>;
24
+ protected readonly state: DesignerState;
25
+ private readonly fontsService;
26
+ private readonly defaultLocale;
27
+ protected readonly strings: import("@angular/core").Signal<WeReportLocale>;
28
+ protected readonly toolbox: {
29
+ type: ReportControlType;
30
+ icon: string;
31
+ variant?: string;
32
+ }[];
33
+ protected readonly tab: import("@angular/core").WritableSignal<"design" | "preview">;
34
+ protected readonly advanced: import("@angular/core").WritableSignal<boolean>;
35
+ protected readonly zoomLevel: import("@angular/core").WritableSignal<number>;
36
+ protected readonly fontFamilies: import("@angular/core").WritableSignal<string[]>;
37
+ protected readonly bandMenuOpen: import("@angular/core").WritableSignal<boolean>;
38
+ protected readonly dataDialogOpen: import("@angular/core").WritableSignal<boolean>;
39
+ protected readonly problemsOpen: import("@angular/core").WritableSignal<boolean>;
40
+ protected readonly leftTab: import("@angular/core").WritableSignal<"add" | "outline">;
41
+ /** Right-click menu: screen position and the band it was opened on. */
42
+ protected readonly contextMenu: import("@angular/core").WritableSignal<{
43
+ x: number;
44
+ y: number;
45
+ bandId: string | null;
46
+ onControl: boolean;
47
+ } | null>;
48
+ private readonly canvas;
49
+ /** Design problems, checked on every edit; field names are judged only when there is data. */
50
+ protected readonly issues: import("@angular/core").Signal<ReportIssue[]>;
51
+ /** Show the first data row inside bound controls instead of their formulas. */
52
+ protected readonly showData: import("@angular/core").WritableSignal<boolean>;
53
+ protected readonly sample: import("@angular/core").Signal<DesignSample | null>;
54
+ protected readonly fields: import("@angular/core").Signal<{
55
+ rows: DesignerField[];
56
+ parent: DesignerField[];
57
+ }>;
58
+ protected readonly allFields: import("@angular/core").Signal<DesignerField[]>;
59
+ protected readonly addableBands: import("@angular/core").Signal<BandKind[]>;
60
+ constructor();
61
+ /** Short label of a control for the outline: its name, its text or formula, else its type. */
62
+ protected outlineLabel(c: ReportControl): string;
63
+ protected outlineIcon(c: ReportControl): keyof WeReportIcons;
64
+ protected selectFromOutline(e: MouseEvent, id: string): void;
65
+ protected isSelected(id: string): boolean;
66
+ protected fitWidth(): void;
67
+ protected onCanvasWheel(e: WheelEvent): void;
68
+ protected openContextMenu(e: MouseEvent): void;
69
+ /** Runs a context-menu command and closes the menu. */
70
+ protected menu(action: () => void): void;
71
+ protected closeMenus(e: PointerEvent): void;
72
+ protected iconName(name: string): keyof WeReportIcons;
73
+ protected setZoom(value: number): void;
74
+ protected onToolDragStart(e: DragEvent, item: {
75
+ type: ReportControlType;
76
+ variant?: string;
77
+ }): void;
78
+ protected onFieldDragStart(e: DragEvent, field: DesignerField): void;
79
+ private setDrag;
80
+ protected addBand(kind: BandKind): void;
81
+ /** Replaces the layout with a tidy list of the data (undoable): the fastest way to a first report. */
82
+ protected autoDesign(): void;
83
+ protected issueText(issue: ReportIssue): string;
84
+ protected showIssue(issue: ReportIssue): void;
85
+ /** Moves (and if needed narrows) an item back inside the paper. */
86
+ protected fixIssue(issue: ReportIssue): void;
87
+ protected onKeydown(e: KeyboardEvent): void;
88
+ static ɵfac: i0.ɵɵFactoryDeclaration<WeReportDesignerComponent, never>;
89
+ 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>;
90
+ }
@@ -0,0 +1,3 @@
1
+ import { WeReportLocale } from '../we-report-locale';
2
+ /** Deutsch. */
3
+ export declare const weReportLocaleDe: WeReportLocale;
@@ -0,0 +1,3 @@
1
+ import { WeReportLocale } from '../we-report-locale';
2
+ /** Español. */
3
+ export declare const weReportLocaleEs: WeReportLocale;
@@ -0,0 +1,3 @@
1
+ import { WeReportLocale } from '../we-report-locale';
2
+ /** Français. */
3
+ export declare const weReportLocaleFr: WeReportLocale;