angular-my-report 0.1.0 → 0.1.1

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 (88) hide show
  1. package/README.md +124 -40
  2. package/fesm2022/angular-my-report.mjs +7931 -0
  3. package/fesm2022/angular-my-report.mjs.map +1 -0
  4. package/index.d.ts +5 -0
  5. package/lib/engine/barcode.d.ts +17 -0
  6. package/lib/engine/chart.d.ts +26 -0
  7. package/lib/engine/chartLayout.d.ts +45 -0
  8. package/lib/engine/crosstab.d.ts +22 -0
  9. package/lib/engine/dataSources.d.ts +35 -0
  10. package/lib/engine/expressions.d.ts +46 -0
  11. package/lib/engine/measure.d.ts +7 -0
  12. package/lib/engine/parameters.d.ts +15 -0
  13. package/lib/engine/qr.d.ts +8 -0
  14. package/lib/engine/renderer.d.ts +43 -0
  15. package/lib/engine/table.d.ts +22 -0
  16. package/lib/model/defaults.d.ts +31 -0
  17. package/lib/model/factories.d.ts +31 -0
  18. package/lib/model/types.d.ts +244 -0
  19. package/lib/ui/css.d.ts +2 -0
  20. package/lib/ui/designer/banded-table-dialog.component.d.ts +27 -0
  21. package/lib/ui/designer/canvas.component.d.ts +41 -0
  22. package/lib/ui/designer/data-source-dialog.component.d.ts +37 -0
  23. package/lib/ui/designer/element-box.component.d.ts +32 -0
  24. package/lib/ui/designer/graphics.components.d.ts +36 -0
  25. package/lib/ui/designer/left-panel.component.d.ts +37 -0
  26. package/lib/ui/designer/safe-image.pipe.d.ts +13 -0
  27. package/lib/ui/designer/table-view.component.d.ts +19 -0
  28. package/lib/ui/designer.component.d.ts +59 -0
  29. package/lib/ui/designer.store.d.ts +82 -0
  30. package/lib/ui/inputs.d.ts +8 -0
  31. package/lib/ui/properties/band-props.component.d.ts +15 -0
  32. package/lib/ui/properties/element-props.component.d.ts +46 -0
  33. package/lib/ui/properties/expr-input.component.d.ts +43 -0
  34. package/lib/ui/properties/graphics-props.component.d.ts +52 -0
  35. package/lib/ui/properties/image-picker.component.d.ts +15 -0
  36. package/lib/ui/properties/properties-panel.component.d.ts +13 -0
  37. package/lib/ui/properties/report-extras.component.d.ts +40 -0
  38. package/lib/ui/properties/report-props.component.d.ts +34 -0
  39. package/lib/ui/properties/table-props.component.d.ts +31 -0
  40. package/lib/ui/viewer/page-view.component.d.ts +17 -0
  41. package/lib/ui/viewer/render.d.ts +43 -0
  42. package/lib/ui/viewer/viewer.component.d.ts +99 -0
  43. package/lib/ui/viewer.component.d.ts +40 -0
  44. package/package.json +16 -5
  45. package/{src/public-api.ts → public-api.d.ts} +0 -5
  46. package/ng-package.json +0 -7
  47. package/src/lib/engine/barcode.ts +0 -118
  48. package/src/lib/engine/chart.ts +0 -85
  49. package/src/lib/engine/chartLayout.ts +0 -265
  50. package/src/lib/engine/crosstab.ts +0 -96
  51. package/src/lib/engine/dataSources.ts +0 -204
  52. package/src/lib/engine/expressions.ts +0 -734
  53. package/src/lib/engine/measure.ts +0 -62
  54. package/src/lib/engine/parameters.ts +0 -96
  55. package/src/lib/engine/qr.ts +0 -26
  56. package/src/lib/engine/renderer.ts +0 -324
  57. package/src/lib/engine/table.ts +0 -58
  58. package/src/lib/model/defaults.ts +0 -249
  59. package/src/lib/model/factories.ts +0 -324
  60. package/src/lib/model/types.ts +0 -281
  61. package/src/lib/ui/css.ts +0 -12
  62. package/src/lib/ui/designer/banded-table-dialog.component.ts +0 -127
  63. package/src/lib/ui/designer/canvas.component.ts +0 -281
  64. package/src/lib/ui/designer/data-source-dialog.component.ts +0 -201
  65. package/src/lib/ui/designer/element-box.component.ts +0 -138
  66. package/src/lib/ui/designer/graphics.components.ts +0 -140
  67. package/src/lib/ui/designer/left-panel.component.ts +0 -189
  68. package/src/lib/ui/designer/safe-image.pipe.ts +0 -16
  69. package/src/lib/ui/designer/table-view.component.ts +0 -120
  70. package/src/lib/ui/designer.component.ts +0 -296
  71. package/src/lib/ui/designer.store.ts +0 -230
  72. package/src/lib/ui/inputs.ts +0 -34
  73. package/src/lib/ui/myreport.css +0 -267
  74. package/src/lib/ui/properties/band-props.component.ts +0 -86
  75. package/src/lib/ui/properties/element-props.component.ts +0 -326
  76. package/src/lib/ui/properties/expr-input.component.ts +0 -191
  77. package/src/lib/ui/properties/graphics-props.component.ts +0 -260
  78. package/src/lib/ui/properties/image-picker.component.ts +0 -62
  79. package/src/lib/ui/properties/properties-panel.component.ts +0 -37
  80. package/src/lib/ui/properties/report-extras.component.ts +0 -198
  81. package/src/lib/ui/properties/report-props.component.ts +0 -211
  82. package/src/lib/ui/properties/table-props.component.ts +0 -197
  83. package/src/lib/ui/viewer/page-view.component.ts +0 -73
  84. package/src/lib/ui/viewer/render.ts +0 -161
  85. package/src/lib/ui/viewer/viewer.component.ts +0 -555
  86. package/src/lib/ui/viewer.component.ts +0 -107
  87. package/tsconfig.lib.json +0 -12
  88. package/tsconfig.lib.prod.json +0 -5
@@ -0,0 +1,41 @@
1
+ import type { Band, ReportElement } from '../../model/types';
2
+ import { type FieldRef } from '../../model/factories';
3
+ import { DesignerStore } from '../designer.store';
4
+ import * as i0 from "@angular/core";
5
+ export declare const DRAG_MIME = "application/x-report-item";
6
+ export type DragPayload = {
7
+ kind: 'text' | 'line' | 'rect' | 'image';
8
+ } | {
9
+ kind: 'table' | 'chart' | 'barcode' | 'qrcode' | 'crosstab';
10
+ fields: FieldRef[];
11
+ } | {
12
+ kind: 'field';
13
+ field: string;
14
+ type?: string;
15
+ template?: string;
16
+ };
17
+ type DragMode = 'move' | 'e' | 's' | 'se';
18
+ /** Builds the element a toolbox/field drop creates, adjusted for the target band. */
19
+ export declare function elementFromPayload(p: DragPayload, band: Band, x: number, y: number, width: number): ReportElement;
20
+ export declare class CanvasComponent {
21
+ protected readonly store: DesignerStore;
22
+ protected readonly labels: Record<import("angular-my-report").BandType, string>;
23
+ protected readonly titleHeight = 20;
24
+ protected readonly width: import("@angular/core").Signal<number>;
25
+ protected readonly bands: import("@angular/core").Signal<Band[]>;
26
+ protected readonly totalHeight: import("@angular/core").Signal<number>;
27
+ protected isSelected(el: ReportElement): boolean;
28
+ protected isBandSelected(band: Band): boolean;
29
+ protected groupField(band: Band): string | null;
30
+ protected onBackgroundDown(e: PointerEvent): void;
31
+ protected onBodyDown(e: PointerEvent, band: Band): void;
32
+ protected onDragOver(e: DragEvent): void;
33
+ protected onDrop(e: DragEvent, band: Band): void;
34
+ protected startBandResize(e: PointerEvent, band: Band): void;
35
+ protected onElementDown(e: PointerEvent, el: ReportElement, band: Band): void;
36
+ protected onHandleDown(e: PointerEvent, el: ReportElement, band: Band, mode: DragMode): void;
37
+ private beginDrag;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<CanvasComponent, never>;
39
+ static ɵcmp: i0.ɵɵComponentDeclaration<CanvasComponent, "rpt-canvas", never, {}, {}, never, never, true, never>;
40
+ }
41
+ export {};
@@ -0,0 +1,37 @@
1
+ import type { DataSourceDef } from '../../model/types';
2
+ import { type LoadResult } from '../../engine/dataSources';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DataSourceDialogComponent {
5
+ private readonly store;
6
+ readonly closed: import("@angular/core").OutputEmitterRef<void>;
7
+ /** Working copy, edited with two-way binding and applied on "Apply". */
8
+ protected ds: DataSourceDef;
9
+ protected readonly busy: import("@angular/core").WritableSignal<boolean>;
10
+ protected readonly result: import("@angular/core").WritableSignal<LoadResult | null>;
11
+ protected readonly error: import("@angular/core").WritableSignal<string>;
12
+ protected readonly sets: import("@angular/core").WritableSignal<string[]>;
13
+ protected readonly setsMsg: import("@angular/core").WritableSignal<string>;
14
+ private readonly cdr;
15
+ /**
16
+ * Closes when clicking outside the dialog. Must return nothing: an Angular event handler that
17
+ * returns `false` calls preventDefault(), which would stop clicks from focusing the inputs.
18
+ */
19
+ protected onBackdropDown(e: PointerEvent): void;
20
+ protected readonly detecting: import("@angular/core").WritableSignal<boolean>;
21
+ protected readonly detectMsg: import("@angular/core").WritableSignal<{
22
+ text: string;
23
+ error: boolean;
24
+ } | null>;
25
+ /** Pasting a URL into the URL field configures the source straight away. */
26
+ protected onPaste(e: ClipboardEvent): void;
27
+ /** Fetches the URL, decides JSON vs OData, fills in the whole form and tests it. */
28
+ protected detect(): Promise<void>;
29
+ protected odataUrl(): string;
30
+ protected fieldSummary(res: LoadResult): string;
31
+ private normalized;
32
+ protected runTest(): Promise<void>;
33
+ protected fetchSets(): Promise<void>;
34
+ protected apply(): void;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataSourceDialogComponent, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataSourceDialogComponent, "rpt-data-source-dialog", never, {}, { "closed": "closed"; }, never, never, true, never>;
37
+ }
@@ -0,0 +1,32 @@
1
+ import { type Row } from '../../engine/expressions';
2
+ import type { ReportElement } from '../../model/types';
3
+ import { type TableRenderData } from './table-view.component';
4
+ import * as i0 from "@angular/core";
5
+ /** Draws one report element. Used by both the designer canvas and the preview. */
6
+ export declare class ElementBoxComponent {
7
+ readonly el: import("@angular/core").InputSignal<ReportElement>;
8
+ readonly content: import("@angular/core").InputSignal<string>;
9
+ readonly design: import("@angular/core").InputSignal<boolean>;
10
+ /** Overrides for grown/shifted elements in the preview. */
11
+ readonly top: import("@angular/core").InputSignal<number | undefined>;
12
+ readonly height: import("@angular/core").InputSignal<number | undefined>;
13
+ /** Rows to draw for a table; omitted in the designer (templates are shown). */
14
+ readonly tableData: import("@angular/core").InputSignal<TableRenderData | undefined>;
15
+ /** Rows for a chart / cross table in the preview (its band's scope). */
16
+ readonly rows: import("@angular/core").InputSignal<Row[] | undefined>;
17
+ private readonly store;
18
+ readonly designData: import("@angular/core").Signal<TableRenderData>;
19
+ /** In the designer, charts and cross tables show the loaded data. */
20
+ readonly chartRows: import("@angular/core").Signal<Row[]>;
21
+ readonly crosstab: import("@angular/core").Signal<{
22
+ table: ReportElement;
23
+ data: Row[];
24
+ render: TableRenderData;
25
+ } | null>;
26
+ /** Barcode/QR value: the evaluated text in the preview; in the designer, evaluated on the first data row. */
27
+ readonly codeValue: import("@angular/core").Signal<string>;
28
+ readonly hostStyle: import("@angular/core").Signal<string>;
29
+ readonly lineStyle: import("@angular/core").Signal<string>;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElementBoxComponent, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<ElementBoxComponent, "rpt-element", never, { "el": { "alias": "el"; "required": true; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "design": { "alias": "design"; "required": false; "isSignal": true; }; "top": { "alias": "top"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "tableData": { "alias": "tableData"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
32
+ }
@@ -0,0 +1,36 @@
1
+ import type { ReportElement } from '../../model/types';
2
+ import type { Row } from '../../engine/expressions';
3
+ import * as i0 from "@angular/core";
4
+ /** Chart element: SVG drawn from the engine's layout primitives. Marks carry a hover tooltip. */
5
+ export declare class ChartViewComponent {
6
+ readonly el: import("@angular/core").InputSignal<ReportElement>;
7
+ readonly rows: import("@angular/core").InputSignal<Row[]>;
8
+ readonly prims: import("@angular/core").Signal<import("../../engine/chartLayout").Prim[]>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartViewComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartViewComponent, "rpt-chart-view", never, { "el": { "alias": "el"; "required": true; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
11
+ }
12
+ /** Barcode element (Code 128 / EAN-13): bars as one crisp SVG path, optional human-readable text. */
13
+ export declare class BarcodeViewComponent {
14
+ readonly el: import("@angular/core").InputSignal<ReportElement>;
15
+ readonly value: import("@angular/core").InputSignal<string>;
16
+ readonly color: import("@angular/core").Signal<string>;
17
+ readonly model: import("@angular/core").Signal<{
18
+ error: string;
19
+ d: string;
20
+ text: string;
21
+ showText: boolean;
22
+ }>;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<BarcodeViewComponent, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<BarcodeViewComponent, "rpt-barcode-view", never, { "el": { "alias": "el"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
25
+ }
26
+ /** QR code element: dark modules as one SVG path, centred, with a 4-module quiet zone. */
27
+ export declare class QrViewComponent {
28
+ readonly el: import("@angular/core").InputSignal<ReportElement>;
29
+ readonly value: import("@angular/core").InputSignal<string>;
30
+ readonly model: import("@angular/core").Signal<{
31
+ error: string;
32
+ d: string;
33
+ }>;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<QrViewComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<QrViewComponent, "rpt-qr-view", never, { "el": { "alias": "el"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
36
+ }
@@ -0,0 +1,37 @@
1
+ import { DesignerStore } from '../designer.store';
2
+ import { type DragPayload } from './canvas.component';
3
+ import * as i0 from "@angular/core";
4
+ type DataToolKind = 'table' | 'chart' | 'crosstab' | 'barcode' | 'qrcode';
5
+ export declare class LeftPanelComponent {
6
+ protected readonly store: DesignerStore;
7
+ readonly openDataSource: import("@angular/core").OutputEmitterRef<void>;
8
+ readonly openBandedTable: import("@angular/core").OutputEmitterRef<void>;
9
+ protected readonly dataTools: {
10
+ kind: DataToolKind;
11
+ label: string;
12
+ icon: string;
13
+ hint: string;
14
+ }[];
15
+ protected readonly tools: {
16
+ kind: "text" | "line" | "rect" | "image";
17
+ label: string;
18
+ icon: string;
19
+ }[];
20
+ protected readonly specials: {
21
+ label: string;
22
+ template: string;
23
+ }[];
24
+ protected readonly typeIcon: Record<string, string>;
25
+ protected readonly data: import("@angular/core").WritableSignal<import("../designer.store").DataState>;
26
+ protected readonly params: import("@angular/core").Signal<import("angular-my-report").ReportParameter[]>;
27
+ protected readonly ds: import("@angular/core").Signal<import("angular-my-report").DataSourceDef>;
28
+ protected readonly dsLabel: import("@angular/core").Signal<string>;
29
+ /** Toolbox items that are pre-configured from the current data fields. */
30
+ protected dataPayload(kind: DataToolKind): DragPayload;
31
+ protected dragStart(e: DragEvent, payload: DragPayload): void;
32
+ /** Click / double-click: add to the selected band (or Detail) at the top-left. */
33
+ protected add(payload: DragPayload): void;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<LeftPanelComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<LeftPanelComponent, "rpt-left-panel", never, {}, { "openDataSource": "openDataSource"; "openBandedTable": "openBandedTable"; }, never, never, true, never>;
36
+ }
37
+ export {};
@@ -0,0 +1,13 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { type SafeUrl } from '@angular/platform-browser';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Image source for <img [src]>. Angular's sanitizer rejects some data: images (e.g. SVG); uploads
6
+ * are embedded as data:image/… URLs, so those are trusted here. An <img> never runs scripts.
7
+ */
8
+ export declare class SafeImagePipe implements PipeTransform {
9
+ private readonly sanitizer;
10
+ transform(url: string | null | undefined): SafeUrl | string;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<SafeImagePipe, never>;
12
+ static ɵpipe: i0.ɵɵPipeDeclaration<SafeImagePipe, "safeImage", true>;
13
+ }
@@ -0,0 +1,19 @@
1
+ import type { ReportElement } from '../../model/types';
2
+ import { type TableRenderData } from '../../engine/table';
3
+ import * as i0 from "@angular/core";
4
+ export type { TableRenderData };
5
+ /** Data for drawing a table in the designer: the column templates themselves. */
6
+ export declare function designTableData(el: ReportElement): TableRenderData;
7
+ /** Draws the inside of a table element (fills its parent box). Shared by designer and preview. */
8
+ export declare class TableViewComponent {
9
+ readonly el: import("@angular/core").InputSignal<ReportElement>;
10
+ readonly data: import("@angular/core").InputSignal<TableRenderData>;
11
+ private readonly line;
12
+ readonly hostStyle: import("@angular/core").Signal<string>;
13
+ readonly cellStyles: import("@angular/core").Signal<string[]>;
14
+ readonly headerRowStyle: import("@angular/core").Signal<string>;
15
+ readonly footerRowStyle: import("@angular/core").Signal<string>;
16
+ rowStyle(index: number, height: number): string;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableViewComponent, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableViewComponent, "rpt-table-view", never, { "el": { "alias": "el"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
19
+ }
@@ -0,0 +1,59 @@
1
+ import type { DataSourceType, ReportDefinition } from '../model/types';
2
+ import { DesignerStore } from './designer.store';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The report designer.
6
+ *
7
+ * ```html
8
+ * <myreport-designer path="/reports/sales.report.json" (save)="store($event)" />
9
+ * ```
10
+ */
11
+ export declare class MyReportDesignerComponent {
12
+ protected readonly store: DesignerStore;
13
+ private readonly host;
14
+ /** URL of a .report.json to open. */
15
+ readonly path: import("@angular/core").InputSignal<string | null | undefined>;
16
+ /** A report definition to open (object or JSON string); used when `path` is empty. */
17
+ readonly report: import("@angular/core").InputSignal<string | ReportDefinition | null | undefined>;
18
+ /** Replaces the report's data source while designing: a URL, a JSON string, or the data itself. */
19
+ readonly datasource: import("@angular/core").InputSignal<unknown>;
20
+ /** How `datasource` is read: `json` (default) or `odata`. */
21
+ readonly type: import("@angular/core").InputSignal<DataSourceType | null | undefined>;
22
+ /** Parameter values (object, JSON string or query string `a=1&b=2`). */
23
+ readonly params: import("@angular/core").InputSignal<string | Record<string, unknown> | null | undefined>;
24
+ /** localStorage key to autosave the report to (and restore from when no path/report is given). */
25
+ readonly persistKey: import("@angular/core").InputSignal<string | null | undefined>;
26
+ /** Shows a "Viewer ↗" link in the toolbar pointing at this URL. */
27
+ readonly viewerUrl: import("@angular/core").InputSignal<string | null | undefined>;
28
+ /** Save downloads a .report.json file (default true). The `save` event fires either way. */
29
+ readonly download: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
30
+ /** Toolbar title. */
31
+ readonly brand: import("@angular/core").InputSignal<string | null | undefined>;
32
+ /** Fires with the report when the user clicks Save. */
33
+ readonly save: import("@angular/core").OutputEmitterRef<ReportDefinition>;
34
+ /** Fires with the report after every change. */
35
+ readonly reportChange: import("@angular/core").OutputEmitterRef<ReportDefinition>;
36
+ /** Fires with the report after it was loaded from `path`. */
37
+ readonly loaded: import("@angular/core").OutputEmitterRef<ReportDefinition>;
38
+ /** Fires with a message when `path` could not be loaded. */
39
+ readonly loadError: import("@angular/core").OutputEmitterRef<string>;
40
+ protected readonly status: import("@angular/core").WritableSignal<{
41
+ text: string;
42
+ error?: boolean;
43
+ } | null>;
44
+ protected readonly showData: import("@angular/core").WritableSignal<boolean>;
45
+ protected readonly showPreview: import("@angular/core").WritableSignal<boolean>;
46
+ protected readonly showBanded: import("@angular/core").WritableSignal<boolean>;
47
+ protected readonly zooms: number[];
48
+ private clipboard;
49
+ constructor();
50
+ /** Starts a new report from a template (the select resets itself to "New ▾"). */
51
+ protected newFrom(kind: string): void;
52
+ protected saveReport(): void;
53
+ protected open(e: Event): Promise<void>;
54
+ /** Keys belong to the designer only when focus is inside it (or nowhere in particular). */
55
+ private ownsKey;
56
+ protected onKey(e: KeyboardEvent): void;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<MyReportDesignerComponent, never>;
58
+ static ɵcmp: i0.ɵɵComponentDeclaration<MyReportDesignerComponent, "myreport-designer", never, { "path": { "alias": "path"; "required": false; "isSignal": true; }; "report": { "alias": "report"; "required": false; "isSignal": true; }; "datasource": { "alias": "datasource"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "params": { "alias": "params"; "required": false; "isSignal": true; }; "persistKey": { "alias": "persistKey"; "required": false; "isSignal": true; }; "viewerUrl": { "alias": "viewerUrl"; "required": false; "isSignal": true; }; "download": { "alias": "download"; "required": false; "isSignal": true; }; "brand": { "alias": "brand"; "required": false; "isSignal": true; }; }, { "save": "save"; "reportChange": "reportChange"; "loaded": "loaded"; "loadError": "loadError"; }, never, never, true, never>;
59
+ }
@@ -0,0 +1,82 @@
1
+ import type { Band, DataSourceDef, DataSourceType, ReportDefinition, ReportElement } from '../model/types';
2
+ import { type FieldInfo } from '../engine/dataSources';
3
+ import { type Row } from '../engine/expressions';
4
+ import * as i0 from "@angular/core";
5
+ export interface Selection {
6
+ elementIds: string[];
7
+ bandId: string | null;
8
+ }
9
+ export interface DataState {
10
+ rows: Row[];
11
+ /** The whole loaded document (root.x in formulas) and its scalar fields. */
12
+ root?: unknown;
13
+ docFields?: {
14
+ name: string;
15
+ type: string;
16
+ }[];
17
+ fields: FieldInfo[];
18
+ status: 'idle' | 'loading' | 'ready' | 'error';
19
+ error?: string;
20
+ }
21
+ export declare const GRID = 8;
22
+ /**
23
+ * Data the host page supplies instead of the report's own data source:
24
+ * a URL (JSON file/API, or OData service / entity-set URL), a JSON string, or the data itself.
25
+ */
26
+ export interface DataOverride {
27
+ source: unknown;
28
+ type: DataSourceType;
29
+ }
30
+ /** Applies a host-supplied data source on top of the report's data source definition. */
31
+ export declare function overrideDataSource(ds: DataSourceDef, o: DataOverride | null): DataSourceDef;
32
+ export declare function findElement(r: ReportDefinition, id: string): {
33
+ band: Band;
34
+ el: ReportElement;
35
+ } | null;
36
+ /**
37
+ * All designer/viewer state: the report (with undo/redo), selection, view options and loaded data.
38
+ * Provided per component (myreport-designer / myreport-viewer), so several can live on one page.
39
+ */
40
+ export declare class DesignerStore {
41
+ readonly report: import("@angular/core").WritableSignal<ReportDefinition>;
42
+ readonly selection: import("@angular/core").WritableSignal<Selection>;
43
+ readonly zoom: import("@angular/core").WritableSignal<number>;
44
+ readonly snap: import("@angular/core").WritableSignal<boolean>;
45
+ readonly data: import("@angular/core").WritableSignal<DataState>;
46
+ /** localStorage key the report is autosaved to; null = no autosave. */
47
+ readonly persistKey: import("@angular/core").WritableSignal<string | null>;
48
+ /** Data supplied by the host page, replacing the report's data source. */
49
+ readonly dataOverride: import("@angular/core").WritableSignal<DataOverride | null>;
50
+ /** Parameter values supplied by the host page (below values typed in the parameter bar). */
51
+ readonly externalParams: import("@angular/core").WritableSignal<Record<string, unknown>>;
52
+ private readonly past;
53
+ private readonly future;
54
+ readonly canUndo: import("@angular/core").Signal<boolean>;
55
+ readonly canRedo: import("@angular/core").Signal<boolean>;
56
+ private readonly reloadToken;
57
+ /** Values typed in the preview's parameter bar (raw text), on top of host values and defaults. */
58
+ readonly paramInput: import("@angular/core").WritableSignal<Record<string, unknown>>;
59
+ /** Effective, typed parameter values. */
60
+ readonly params: import("@angular/core").Signal<import("../engine/parameters").ParamValues>;
61
+ /** The data source actually used: the report's own, or the host's override. */
62
+ readonly effectiveDataSource: import("@angular/core").Signal<DataSourceDef>;
63
+ /** Data source with {@Param} placeholders filled in; reloads when they change. */
64
+ private readonly dsKey;
65
+ constructor();
66
+ /** Applies a change to a copy of the report. `history=false` for live drag updates (after `checkpoint()`). */
67
+ update(recipe: (r: ReportDefinition) => void, history?: boolean): void;
68
+ checkpoint(): void;
69
+ undo(): void;
70
+ redo(): void;
71
+ load(r: ReportDefinition): void;
72
+ /** Loads the report autosaved under `key` (if any) and keeps autosaving there. */
73
+ restore(key: string): boolean;
74
+ select(s: Selection): void;
75
+ snapValue(v: number): number;
76
+ reloadData(): void;
77
+ static ɵfac: i0.ɵɵFactoryDeclaration<DesignerStore, never>;
78
+ static ɵprov: i0.ɵɵInjectableDeclaration<DesignerStore>;
79
+ }
80
+ /** Fetches a .report.json and checks it looks like a report definition. */
81
+ export declare function fetchReport(path: string, signal?: AbortSignal): Promise<ReportDefinition>;
82
+ export declare function validateReport(r: unknown): ReportDefinition;
@@ -0,0 +1,8 @@
1
+ import type { ReportDefinition } from '../model/types';
2
+ /**
3
+ * Normalizes a report given as an object or a JSON string (Web Component attributes are strings).
4
+ * Returns null when nothing usable was given.
5
+ */
6
+ export declare function parseReport(v: ReportDefinition | string | null | undefined): ReportDefinition | null;
7
+ /** Parameter values as an object, a JSON string, or a query string ("Country=Egypt&Year=2024"). */
8
+ export declare function parseParams(v: Record<string, unknown> | string | null | undefined): Record<string, unknown>;
@@ -0,0 +1,15 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class BandPropsComponent {
3
+ private readonly store;
4
+ readonly bandId: import("@angular/core").InputSignal<string>;
5
+ protected readonly labels: Record<import("angular-my-report").BandType, string>;
6
+ protected readonly band: import("@angular/core").Signal<import("angular-my-report").Band | undefined>;
7
+ protected readonly group: import("@angular/core").Signal<import("angular-my-report").Group | undefined>;
8
+ protected setHeight(v: number | null): void;
9
+ /** Removes the section from the report (kept hidden with its elements, so it can be shown again). */
10
+ protected hide(id: string): void;
11
+ protected setGroup(k: 'field' | 'direction', v: string): void;
12
+ protected removeGroup(gid: string): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<BandPropsComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<BandPropsComponent, "rpt-band-props", never, { "bandId": { "alias": "bandId"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
15
+ }
@@ -0,0 +1,46 @@
1
+ import type { ElementStyle, FormatKind, ReportElement, StyleRule } from '../../model/types';
2
+ import * as i0 from "@angular/core";
3
+ export declare const FORMAT_KINDS: FormatKind[];
4
+ export declare class ElementPropsComponent {
5
+ private readonly store;
6
+ readonly el: import("@angular/core").InputSignal<ReportElement>;
7
+ readonly count: import("@angular/core").InputSignal<number>;
8
+ protected readonly formatKinds: FormatKind[];
9
+ protected readonly numericFormats: string[];
10
+ protected readonly aggregates: string;
11
+ protected readonly isText: import("@angular/core").Signal<boolean>;
12
+ protected readonly isTable: import("@angular/core").Signal<boolean>;
13
+ protected readonly isCode: import("@angular/core").Signal<boolean>;
14
+ /** Elements that draw text with the element font (beyond labels/fields/tables). */
15
+ protected readonly hasFont: import("@angular/core").Signal<boolean>;
16
+ protected readonly title: import("@angular/core").Signal<string>;
17
+ private readonly width;
18
+ protected readonly setX: (v: number) => (e: ReportElement) => number;
19
+ protected readonly setY: (v: number) => (e: ReportElement) => number;
20
+ protected readonly setW: (v: number) => (e: ReportElement) => number;
21
+ protected readonly setH: (v: number) => (e: ReportElement) => number;
22
+ protected readonly setDecimals: (v: number) => (e: ReportElement) => number;
23
+ protected setText: (v: string) => (e: ReportElement) => string;
24
+ protected setDash: (v: "solid" | "dashed" | "dotted") => (e: ReportElement) => "dashed" | "dotted" | undefined;
25
+ protected setFit: (v: "contain" | "cover" | "fill") => (e: ReportElement) => "contain" | "cover" | "fill";
26
+ protected setVisible: (v: string) => (e: ReportElement) => string | undefined;
27
+ protected setGrow: (v: boolean) => (e: ReportElement) => boolean;
28
+ protected setFormatKind: (v: FormatKind) => (e: ReportElement) => FormatKind;
29
+ protected setCurrency: (v: string) => (e: ReportElement) => string;
30
+ protected readonly options: import("@angular/core").Signal<{
31
+ nullText: string;
32
+ hideDuplicates: boolean;
33
+ rules: StyleRule[];
34
+ }>;
35
+ protected setNullText(v: string): void;
36
+ protected setHideDuplicates(v: boolean): void;
37
+ protected addRule(): void;
38
+ protected setRule<K extends keyof StyleRule>(i: number, k: K, v: StyleRule[K]): void;
39
+ protected removeRule(i: number): void;
40
+ protected set(fn: (e: ReportElement) => void): void;
41
+ protected num(v: number | null, setter: (v: number) => (e: ReportElement) => void): void;
42
+ protected style<K extends keyof ElementStyle>(k: K, v: ElementStyle[K]): void;
43
+ protected numStyle(k: 'fontSize' | 'padding' | 'borderWidth', v: number | null): void;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElementPropsComponent, never>;
45
+ static ɵcmp: i0.ɵɵComponentDeclaration<ElementPropsComponent, "rpt-element-props", never, { "el": { "alias": "el"; "required": true; "isSignal": true; }; "count": { "alias": "count"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
46
+ }
@@ -0,0 +1,43 @@
1
+ import * as i0 from "@angular/core";
2
+ interface Suggestion {
3
+ label: string;
4
+ insert: string;
5
+ kind: 'field' | 'param' | 'fn' | 'special';
6
+ detail: string;
7
+ }
8
+ /**
9
+ * Text box for templates ("Total: {sum(Amount)}") or bare expressions ("Amount > 100") with
10
+ * autocomplete of fields, @parameters, functions and special fields, plus live validation.
11
+ * Template mode suggests inside {…}; expression mode suggests anywhere. Ctrl+Space opens the list.
12
+ */
13
+ export declare class ExprInputComponent {
14
+ private readonly store;
15
+ readonly value: import("@angular/core").InputSignal<string>;
16
+ readonly mode: import("@angular/core").InputSignal<"template" | "expression">;
17
+ readonly rows: import("@angular/core").InputSignal<number>;
18
+ readonly placeholder: import("@angular/core").InputSignal<string>;
19
+ readonly valueChange: import("@angular/core").OutputEmitterRef<string>;
20
+ private readonly box;
21
+ protected readonly icons: {
22
+ readonly field: "Ab";
23
+ readonly param: "@";
24
+ readonly fn: "ƒ";
25
+ readonly special: "★";
26
+ };
27
+ protected readonly open: import("@angular/core").WritableSignal<boolean>;
28
+ protected readonly active: import("@angular/core").WritableSignal<number>;
29
+ protected readonly items: import("@angular/core").WritableSignal<Suggestion[]>;
30
+ /** The partial word being completed: [start, end) in the box. */
31
+ private word;
32
+ protected readonly error: import("@angular/core").Signal<string | null>;
33
+ private readonly all;
34
+ protected onInput(): void;
35
+ /** Works out whether the caret is inside an expression and which word is being typed. */
36
+ protected refresh(force?: boolean): void;
37
+ protected onKey(e: KeyboardEvent): void;
38
+ /** Inserts the suggestion; functions get "()" with the caret inside, templates get a closing "}". */
39
+ protected accept(s: Suggestion): void;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExprInputComponent, never>;
41
+ static ɵcmp: i0.ɵɵComponentDeclaration<ExprInputComponent, "rpt-expr-input", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
42
+ }
43
+ export {};
@@ -0,0 +1,52 @@
1
+ import type { AggregateKind, ChartType, FormatKind, ReportElement } from '../../model/types';
2
+ import { DesignerStore } from '../designer.store';
3
+ import * as i0 from "@angular/core";
4
+ /** Base: edits one element in place by id (one undo step per change). */
5
+ declare abstract class SpecEditor {
6
+ protected readonly store: DesignerStore;
7
+ readonly el: import("@angular/core").InputSignal<ReportElement>;
8
+ protected readonly aggregates: AggregateKind[];
9
+ protected readonly valueFormats: FormatKind[];
10
+ protected edit(fn: (e: ReportElement) => void): void;
11
+ protected positive(v: number | null, fn: (n: number) => void): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecEditor, never>;
13
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SpecEditor, never, never, { "el": { "alias": "el"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
14
+ }
15
+ export declare class ChartPropsComponent extends SpecEditor {
16
+ protected readonly maxSeries: number;
17
+ protected readonly types: {
18
+ value: ChartType;
19
+ label: string;
20
+ icon: string;
21
+ }[];
22
+ protected readonly pie: import("@angular/core").Signal<boolean>;
23
+ protected set: <K extends keyof NonNullable<ReportElement["chart"]>>(k: K, v: NonNullable<ReportElement["chart"]>[K]) => (e: ReportElement) => import("angular-my-report").ChartSpec[K];
24
+ protected setMax: (n: number) => void;
25
+ protected setFormat: (k: FormatKind) => (e: ReportElement) => FormatKind;
26
+ protected setValues(v: string): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartPropsComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartPropsComponent, "rpt-chart-props", never, {}, {}, never, never, true, never>;
29
+ }
30
+ export declare class BarcodePropsComponent extends SpecEditor {
31
+ protected setType: (v: "code128" | "ean13") => (e: ReportElement) => "code128" | "ean13";
32
+ protected setShowText: (v: boolean) => (e: ReportElement) => boolean;
33
+ protected setColor: (v: string) => (e: ReportElement) => string;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<BarcodePropsComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<BarcodePropsComponent, "rpt-barcode-props", never, {}, {}, never, never, true, never>;
36
+ }
37
+ export declare class QrPropsComponent extends SpecEditor {
38
+ protected setLevel: (v: "L" | "M" | "Q" | "H") => (e: ReportElement) => "L" | "M" | "Q" | "H";
39
+ protected setColor: (v: string) => (e: ReportElement) => string;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<QrPropsComponent, never>;
41
+ static ɵcmp: i0.ɵɵComponentDeclaration<QrPropsComponent, "rpt-qr-props", never, {}, {}, never, never, true, never>;
42
+ }
43
+ export declare class CrosstabPropsComponent extends SpecEditor {
44
+ protected set: <K extends keyof NonNullable<ReportElement["crosstab"]>>(k: K, v: NonNullable<ReportElement["crosstab"]>[K]) => (e: ReportElement) => import("angular-my-report").CrossTabSpec[K];
45
+ protected setFormat: (k: FormatKind) => (e: ReportElement) => FormatKind;
46
+ protected setDecimals: (n: number) => void;
47
+ protected setHeaderH: (n: number) => void;
48
+ protected setRowH: (n: number) => void;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<CrosstabPropsComponent, never>;
50
+ static ɵcmp: i0.ɵɵComponentDeclaration<CrosstabPropsComponent, "rpt-crosstab-props", never, {}, {}, never, never, true, never>;
51
+ }
52
+ export {};
@@ -0,0 +1,15 @@
1
+ import * as i0 from "@angular/core";
2
+ /** Image source: a URL (may contain {Field}) or an uploaded file embedded as a base64 data URL. */
3
+ export declare class ImagePickerComponent {
4
+ readonly value: import("@angular/core").InputSignal<string>;
5
+ readonly placeholder: import("@angular/core").InputSignal<string>;
6
+ readonly valueChange: import("@angular/core").OutputEmitterRef<string>;
7
+ protected readonly message: import("@angular/core").WritableSignal<string>;
8
+ protected readonly embedded: import("@angular/core").Signal<boolean>;
9
+ /** Approximate decoded size of the embedded image. */
10
+ protected readonly size: import("@angular/core").Signal<string>;
11
+ /** Reads the file as base64 (data URL) so the image travels inside the report file. */
12
+ protected upload(e: Event): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<ImagePickerComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<ImagePickerComponent, "rpt-image-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
15
+ }
@@ -0,0 +1,13 @@
1
+ import { DesignerStore } from '../designer.store';
2
+ import * as i0 from "@angular/core";
3
+ /** Right-hand panel: properties of the selected element(s), else the selected band, else the report. */
4
+ export declare class PropertiesPanelComponent {
5
+ protected readonly store: DesignerStore;
6
+ protected readonly first: import("@angular/core").Signal<{
7
+ band: import("angular-my-report").Band;
8
+ el: import("angular-my-report").ReportElement;
9
+ } | null>;
10
+ protected readonly bandId: import("@angular/core").Signal<string | null>;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<PropertiesPanelComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<PropertiesPanelComponent, "rpt-properties-panel", never, {}, {}, never, never, true, never>;
13
+ }
@@ -0,0 +1,40 @@
1
+ import type { PageBackground, ParameterType, ReportParameter, Watermark } from '../../model/types';
2
+ import * as i0 from "@angular/core";
3
+ /** Report-level settings: parameters, row filter, watermark and page background. */
4
+ export declare class ReportExtrasComponent {
5
+ private readonly store;
6
+ protected readonly types: ParameterType[];
7
+ protected readonly parameters: import("@angular/core").Signal<ReportParameter[]>;
8
+ protected readonly filter: import("@angular/core").Signal<string>;
9
+ protected readonly watermark: import("@angular/core").Signal<{
10
+ enabled: boolean;
11
+ kind: "text" | "image";
12
+ text: string;
13
+ image: string;
14
+ opacity: number;
15
+ angle: number;
16
+ fontSize: number;
17
+ color: string;
18
+ bold: boolean;
19
+ imageScale: number;
20
+ layer: "behind" | "front";
21
+ pages: "all" | "first";
22
+ }>;
23
+ protected readonly background: import("@angular/core").Signal<{
24
+ enabled: boolean;
25
+ image: string;
26
+ fit: "cover" | "contain" | "stretch" | "center";
27
+ pages: "all" | "first";
28
+ }>;
29
+ /** Parameter names: letters, digits and _ only (they are used as @Name). */
30
+ protected clean(v: string): string;
31
+ protected addParam(): void;
32
+ protected setParam<K extends keyof ReportParameter>(i: number, k: K, v: ReportParameter[K]): void;
33
+ protected removeParam(i: number): void;
34
+ protected setFilter(v: string): void;
35
+ protected setWm<K extends keyof Watermark>(k: K, v: Watermark[K]): void;
36
+ protected num(v: number | null, k: 'fontSize' | 'imageScale', min: number): void;
37
+ protected setBg<K extends keyof PageBackground>(k: K, v: PageBackground[K]): void;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<ReportExtrasComponent, never>;
39
+ static ɵcmp: i0.ɵɵComponentDeclaration<ReportExtrasComponent, "rpt-report-extras", never, {}, {}, never, never, true, never>;
40
+ }