we-report-angular 0.2.0 → 0.4.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.
@@ -70,8 +70,27 @@ export declare class DesignSurfaceComponent implements OnDestroy {
70
70
  protected guidesFor(bandId: string): Guide[];
71
71
  protected isBound(c: ReportControl): boolean;
72
72
  protected boundExpression(c: ReportControl): string;
73
- protected caption(c: ReportControl): string;
73
+ protected caption(c: ReportControl, band?: Band): string;
74
74
  protected textStyle(c: ReportControl): Record<string, string>;
75
+ /** Cells of a table control in mm relative to the control, with their text and look. */
76
+ protected tableCells(c: ReportControl, band?: Band): {
77
+ row: number;
78
+ index: number;
79
+ x: number;
80
+ y: number;
81
+ width: number;
82
+ height: number;
83
+ text: string;
84
+ bound: boolean;
85
+ style: Record<string, string>;
86
+ }[];
87
+ /** Inside an inner list the sample is the first item of the first row that has items, around that row. */
88
+ private sampleFor;
89
+ protected isCellSelected(controlId: string, row: number, cell: number): boolean;
90
+ protected selectCell(controlId: string, row: number, cell: number): void;
91
+ /** Fixed text, or a formula shown with the first data row when there is one. */
92
+ private bindableText;
93
+ private styleOf;
75
94
  protected shapeStyle(c: ReportControl): Record<string, string>;
76
95
  protected lineCoords(c: ReportControl): [number, number, number, number];
77
96
  protected lineColor(c: ReportControl): string;
@@ -100,6 +119,11 @@ export declare class DesignSurfaceComponent implements OnDestroy {
100
119
  protected onDragOver(e: DragEvent): void;
101
120
  protected onDrop(e: DragEvent, band: Band): void;
102
121
  protected readonly defaultWatermarkColor = "#e3e6ea";
122
+ /** For a multi-column detail: where the first column ends (mm) and how many columns print. */
123
+ protected columnShade(band: Band): {
124
+ left: number;
125
+ count: number;
126
+ } | null;
103
127
  /** Fixed watermark text, or its formula, shown faintly on the design page. */
104
128
  protected watermarkText(): string;
105
129
  protected chartLabel(c: ReportControl): string;
@@ -9,8 +9,13 @@ export interface DesignerField {
9
9
  expression: string;
10
10
  depth: number;
11
11
  }
12
- /** Row fields, then fields of the object holding the rows (when the rows are a nested list). */
12
+ /**
13
+ * Row fields, fields of the object holding the rows (when the rows are a nested list), the lists
14
+ * inside a row (for an inner list) and the fields of the inner list's items.
15
+ */
13
16
  export declare function designerFields(report: ReportDefinition, data?: unknown): {
14
17
  rows: DesignerField[];
15
18
  parent: DesignerField[];
19
+ lists: string[];
20
+ inner: DesignerField[];
16
21
  };
@@ -1,4 +1,5 @@
1
1
  import { Band, ReportControl, ReportDefinition } from 'we-report-core';
2
+ import { TableCellRef } from './table-ops';
2
3
  import * as i0 from "@angular/core";
3
4
  export type Selection = {
4
5
  kind: 'none';
@@ -19,6 +20,8 @@ export declare class DesignerState {
19
20
  readonly selection: import("@angular/core").WritableSignal<Selection>;
20
21
  readonly canUndo: import("@angular/core").WritableSignal<boolean>;
21
22
  readonly canRedo: import("@angular/core").WritableSignal<boolean>;
23
+ /** The table cell last clicked; the inspector edits it while its table is selected. */
24
+ readonly tableCell: import("@angular/core").WritableSignal<TableCellRef | null>;
22
25
  /** The first data row and its scope, for live values in the design and the formula editor. */
23
26
  readonly sample: import("@angular/core").WritableSignal<{
24
27
  row: unknown;
@@ -1,4 +1,4 @@
1
- import { Band, Bindable, BorderStyle, ChartAggregate, ChartType, FormattingRule, Watermark, ReportControl, ReportStyle } from 'we-report-core';
1
+ import { Band, Bindable, BorderStyle, ChartAggregate, ChartType, FormattingRule, TableCell, TextAlign, Watermark, LabelSheet, ReportControl, ReportStyle } from 'we-report-core';
2
2
  import { WeReportIcons } from '../we-report-icons';
3
3
  import { WeReportLocale } from '../we-report-locale';
4
4
  import { DesignerField } from './designer-fields';
@@ -11,6 +11,8 @@ export declare class PropertyPanelComponent {
11
11
  readonly fields: import("@angular/core").InputSignal<DesignerField[]>;
12
12
  readonly fontFamilies: import("@angular/core").InputSignal<string[]>;
13
13
  readonly advanced: import("@angular/core").InputSignal<boolean>;
14
+ /** Lists inside a row that an inner list can repeat over. */
15
+ readonly lists: import("@angular/core").InputSignal<string[]>;
14
16
  protected readonly state: DesignerState;
15
17
  protected readonly papers: readonly import("we-report-core").PaperSize[];
16
18
  protected readonly symbologies: readonly string[];
@@ -31,6 +33,7 @@ export declare class PropertyPanelComponent {
31
33
  id: string;
32
34
  name: string;
33
35
  }[];
36
+ protected readonly labelSheets: readonly LabelSheet[];
34
37
  protected readonly currencies: string[];
35
38
  protected readonly aggregates: {
36
39
  value: ChartAggregate;
@@ -46,6 +49,13 @@ export declare class PropertyPanelComponent {
46
49
  protected readonly report: import("@angular/core").Signal<import("we-report-core").ReportDefinition>;
47
50
  protected readonly style: import("@angular/core").Signal<import("we-report-core").ResolvedStyle | null>;
48
51
  protected readonly hasText: import("@angular/core").Signal<boolean>;
52
+ /** The clicked cell of the selected table, with its row and first column. */
53
+ protected readonly selectedCell: import("@angular/core").Signal<{
54
+ cell: TableCell;
55
+ row: number;
56
+ index: number;
57
+ column: number;
58
+ } | null>;
49
59
  protected readonly formatIsCustom: import("@angular/core").Signal<boolean>;
50
60
  protected setReport<K extends 'name'>(key: K, value: string): void;
51
61
  /** Empty means "use the app's setting". */
@@ -56,8 +66,12 @@ export declare class PropertyPanelComponent {
56
66
  protected setPage(key: 'orientation' | 'width' | 'height', value: string): void;
57
67
  protected setMargin(side: 'top' | 'right' | 'bottom' | 'left', value: string): void;
58
68
  protected setRowsPath(path: string): void;
59
- protected setBand(key: 'height' | 'groupBy' | 'sort' | 'backgroundColor', value: string): void;
69
+ protected setBand(key: 'height' | 'groupBy' | 'sort' | 'backgroundColor' | 'rowsPath', value: string): void;
60
70
  protected toggleBand(key: 'keepTogether' | 'repeatOnEveryPage' | 'pageBreakBefore' | 'pageBreakAfter', value: boolean): void;
71
+ protected labelSheetName(l: LabelSheet): string;
72
+ protected applyLabelSheet(id: string): void;
73
+ /** Detail columns; one column removes the setting. */
74
+ protected setColumns(key: 'count' | 'gap', value: string): void;
61
75
  protected removeBand(): void;
62
76
  protected ids(): string[];
63
77
  protected setGeometry(key: 'x' | 'y' | 'width' | 'height', value: string): void;
@@ -67,6 +81,14 @@ export declare class PropertyPanelComponent {
67
81
  protected visibleValue(c: ReportControl): Bindable<string>;
68
82
  protected setVisible(value: Bindable<string>): void;
69
83
  protected setExpression(key: 'category' | 'value', expression: string): void;
84
+ /** Row/column commands act on the clicked cell, or on the last row/column. */
85
+ protected tableOp(op: 'insertRow' | 'insertColumn' | 'deleteRow' | 'deleteColumn' | 'mergeRight' | 'splitCell'): void;
86
+ private updateCell;
87
+ protected setCell(patch: Partial<TableCell>): void;
88
+ protected setCellStyle<K extends keyof ReportStyle>(key: K, value: ReportStyle[K] | undefined): void;
89
+ protected cellAlign(cell: TableCell): TextAlign;
90
+ protected setColumnWidth(column: number, value: string): void;
91
+ protected setRowHeight(row: number, value: string): void;
70
92
  protected condition(when: string): SimpleCondition | null;
71
93
  private updateRules;
72
94
  protected addRule(): void;
@@ -83,5 +105,5 @@ export declare class PropertyPanelComponent {
83
105
  protected num(value: number | undefined | null): string;
84
106
  protected asNumber(value: string, fallback: number): number;
85
107
  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>;
108
+ 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>;
87
109
  }
@@ -0,0 +1,23 @@
1
+ import { TableControl, TableRow } from 'we-report-core';
2
+ /** A cell of a table control, addressed by row and position in that row's `cells`. */
3
+ export interface TableCellRef {
4
+ controlId: string;
5
+ row: number;
6
+ cell: number;
7
+ }
8
+ /** First column (0-based) covered by a cell. */
9
+ export declare function columnOf(row: TableRow, cellIndex: number): number;
10
+ /** Index of the cell covering `column`, or -1. */
11
+ export declare function cellAt(row: TableRow, column: number): number;
12
+ /** Width and height follow the grid. */
13
+ export declare function syncSize(t: TableControl): void;
14
+ /** A new row under `rowIndex` with the same cell layout and look, but no content. */
15
+ export declare function insertRow(t: TableControl, rowIndex: number): void;
16
+ export declare function deleteRow(t: TableControl, rowIndex: number): void;
17
+ /** A new column right of `column`, as wide as it; a cell spanning across it just gets wider. */
18
+ export declare function insertColumn(t: TableControl, column: number): void;
19
+ export declare function deleteColumn(t: TableControl, column: number): void;
20
+ /** Joins a cell with the next one in its row; the first cell's content stays. */
21
+ export declare function mergeRight(t: TableControl, rowIndex: number, cellIndex: number): void;
22
+ /** Undoes a merge: the cell keeps one column and empty cells fill the rest. */
23
+ export declare function splitCell(t: TableControl, rowIndex: number, cellIndex: number): void;
@@ -54,6 +54,8 @@ export declare class WeReportDesignerComponent {
54
54
  protected readonly fields: import("@angular/core").Signal<{
55
55
  rows: DesignerField[];
56
56
  parent: DesignerField[];
57
+ lists: string[];
58
+ inner: DesignerField[];
57
59
  }>;
58
60
  protected readonly allFields: import("@angular/core").Signal<DesignerField[]>;
59
61
  protected readonly addableBands: import("@angular/core").Signal<BandKind[]>;
@@ -22,6 +22,7 @@ export interface WeReportIcons {
22
22
  design: string;
23
23
  database: string;
24
24
  chart: string;
25
+ table: string;
25
26
  arrangeLeft: string;
26
27
  arrangeCenter: string;
27
28
  arrangeRight: string;
@@ -226,6 +226,7 @@ export interface WeReportLocale {
226
226
  issueUnknownField: string;
227
227
  issueEmptyFormula: string;
228
228
  issueOverlap: string;
229
+ issueOutsideColumn: string;
229
230
  fixIt: string;
230
231
  noProblems: string;
231
232
  chartType: string;
@@ -248,6 +249,30 @@ export interface WeReportLocale {
248
249
  chartHint: string;
249
250
  conditionalFormatting: string;
250
251
  watermark: string;
252
+ innerList: string;
253
+ innerListOf: string;
254
+ innerListHint: string;
255
+ innerFields: string;
256
+ tableSection: string;
257
+ addRow: string;
258
+ addColumn: string;
259
+ deleteRow: string;
260
+ deleteColumn: string;
261
+ mergeCells: string;
262
+ splitCell: string;
263
+ selectedCell: string;
264
+ columnWidth: string;
265
+ rowHeight: string;
266
+ tableHint: string;
267
+ columnN: string;
268
+ labelSheet: string;
269
+ labelSheetChoose: string;
270
+ labelSheetHint: string;
271
+ labelsCount: string;
272
+ columnsCount: string;
273
+ columnGap: string;
274
+ columnsHint: string;
275
+ repeatsAcross: string;
251
276
  reportLocale: string;
252
277
  reportLocaleRegion: string;
253
278
  reportCurrency: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "we-report-angular",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Free, native Angular banded report designer and viewer — drag-and-drop design, paper sizes, data binding, barcodes, PDF export. No backend required.",
5
5
  "license": "MIT",
6
6
  "author": "Emre CIRIK",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "tslib": "^2.3.0",
35
- "we-report-core": "~0.2.0"
35
+ "we-report-core": "~0.4.0"
36
36
  },
37
37
  "sideEffects": false,
38
38
  "module": "fesm2022/we-report-angular.mjs",