bways-report 0.2.0 → 0.2.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 (33) hide show
  1. package/README.md +46 -0
  2. package/esm2022/lib/core/models/report-grid.model.mjs +1 -1
  3. package/esm2022/lib/core/services/report-overlay.service.mjs +79 -0
  4. package/esm2022/lib/core/utils/report-parameter.util.mjs +68 -15
  5. package/esm2022/lib/data-access/adapters/endpoint-datasource.adapter.mjs +10 -2
  6. package/esm2022/lib/data-access/adapters/endpoint-lookup.adapter.mjs +10 -1
  7. package/esm2022/lib/data-access/adapters/http-datasource.adapter.mjs +10 -1
  8. package/esm2022/lib/data-access/adapters/http-lookup.adapter.mjs +10 -1
  9. package/esm2022/lib/features/designer/components/design-canvas/design-canvas.component.mjs +6 -4
  10. package/esm2022/lib/features/designer/components/dialogs/report-saved-dialog.component.mjs +11 -10
  11. package/esm2022/lib/features/designer/components/property-editor/parameter-binding-editor.component.mjs +39 -6
  12. package/esm2022/lib/features/designer/components/property-editor/property-editor-grid.component.mjs +3 -3
  13. package/esm2022/lib/features/designer/components/property-editor/property-editor.component.mjs +5 -3
  14. package/esm2022/lib/features/designer/designer.component.mjs +11 -6
  15. package/esm2022/lib/features/runtime/dynamic-renderer.component.mjs +2 -2
  16. package/esm2022/lib/features/runtime/report-execution.service.mjs +35 -4
  17. package/esm2022/lib/features/runtime/report-grid-bridge.component.mjs +15 -20
  18. package/esm2022/lib/primitives/components/dropdown/rpt-dropdown.component.mjs +21 -10
  19. package/esm2022/lib/primitives/components/radio/rpt-radio.component.mjs +15 -5
  20. package/esm2022/lib/primitives/components/searchable-select/rpt-searchable-select.component.mjs +6 -6
  21. package/fesm2022/bways-report.mjs +324 -88
  22. package/fesm2022/bways-report.mjs.map +1 -1
  23. package/lib/core/models/report-grid.model.d.ts +1 -1
  24. package/lib/core/services/report-overlay.service.d.ts +14 -0
  25. package/lib/core/utils/report-parameter.util.d.ts +13 -1
  26. package/lib/features/designer/components/property-editor/parameter-binding-editor.component.d.ts +5 -0
  27. package/lib/features/designer/designer.component.d.ts +1 -0
  28. package/lib/features/runtime/report-grid-bridge.component.d.ts +2 -2
  29. package/lib/primitives/components/dropdown/rpt-dropdown.component.d.ts +1 -2
  30. package/lib/primitives/components/searchable-select/rpt-searchable-select.component.d.ts +0 -1
  31. package/package.json +8 -5
  32. package/styles/theme.css +184 -0
  33. package/third-party-notices/angular-cdk-LICENSE.txt +21 -0
@@ -92,7 +92,7 @@ export interface GridOptionsDefinition {
92
92
  pageSize?: number;
93
93
  /** Whether pagination is enabled. */
94
94
  pagination?: boolean;
95
- /** Whether row selection is enabled. */
95
+ /** Whether row selection is enabled. Defaults to true; set false to disable. */
96
96
  selectable?: boolean;
97
97
  /** Selection mode when selectable is true. Defaults to 'multiple'. */
98
98
  selectionMode?: 'single' | 'multiple';
@@ -0,0 +1,14 @@
1
+ import { ScrollStrategy } from '@angular/cdk/overlay';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ReportOverlayService {
4
+ private readonly document;
5
+ private readonly nonce;
6
+ private readonly overlay;
7
+ private readonly scrollDispatcher;
8
+ private readonly zone;
9
+ ensureStyles(): void;
10
+ /** Retain CDK's scroll strategy; cover native, unregistered host ancestors too. */
11
+ scrollStrategy(origin: () => HTMLElement): ScrollStrategy;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ReportOverlayService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<ReportOverlayService>;
14
+ }
@@ -1,6 +1,16 @@
1
1
  import { ReportDefinition } from '../models/report-definition.model';
2
2
  import { ReportDataSourceDefinition } from '../models/report-datasource.model';
3
3
  export type ParameterMappings = Record<string, string | number | boolean>;
4
+ /** Supported wire formats for date-bound procedure/API parameters. */
5
+ export declare const PARAMETER_DATE_FORMATS: readonly ["yyyy-MM-dd", "yyyyMMdd", "dd/MM/yyyy", "MM/dd/yyyy", "dd-MM-yyyy"];
6
+ export type ParameterDateFormat = typeof PARAMETER_DATE_FORMATS[number];
7
+ /** The optional date pipe is persisted in existing string mappings. */
8
+ export declare function parseParameterToken(raw: string): {
9
+ field: string;
10
+ dateFormat?: ParameterDateFormat;
11
+ } | null;
12
+ /** Format calendar parts directly, avoiding UTC/time-zone shifts and locale parsing. */
13
+ export declare function formatParameterDate(value: unknown, format: ParameterDateFormat): string;
4
14
  /** Resolves `{{context.xxx}}` presets such as today / startOfMonth. */
5
15
  export declare function resolveContextPreset(key: string): string;
6
16
  /**
@@ -34,7 +44,9 @@ export declare function parseSqlExecStatement(sql: string): ParsedSqlExec | null
34
44
  * - anything else -> sanitized literal value (fixed value)
35
45
  */
36
46
  export declare function resolveParameterValue(raw: unknown, session: Record<string, unknown>, formValues: Record<string, unknown>): unknown;
37
- /** Resolves every mapping into concrete values (de-duplicating `@name` / `name`). */
47
+ /** Canonical SQL argument names. Equal aliases collapse; conflicting values fail explicitly. */
48
+ export declare function normalizeParameterNames(parameters: Record<string, unknown>): Record<string, unknown>;
49
+ /** Resolves mappings into one concrete value per parameter, without @ aliases. */
38
50
  export declare function resolveParameterMappings(mappings: ParameterMappings | undefined, session: Record<string, unknown>, formValues: Record<string, unknown>): Record<string, unknown>;
39
51
  /**
40
52
  * Returns canvas field keys referenced by mappings that currently have no value.
@@ -1,5 +1,6 @@
1
1
  import { ProcedureParameterMetadata } from '../../../../data-access/contracts/schema-discovery.contract';
2
2
  import { ReportComponentDefinition } from '../../../../core/models/report-component.model';
3
+ import { ParameterDateFormat } from '../../../../core/utils/report-parameter.util';
3
4
  import * as i0 from "@angular/core";
4
5
  export type ParameterBindingMode = 'session' | 'control' | 'fixed' | 'context' | 'custom';
5
6
  export declare class ParameterBindingEditorComponent {
@@ -25,6 +26,10 @@ export declare class ParameterBindingEditorComponent {
25
26
  value: string | number;
26
27
  }[]>;
27
28
  readonly compatibleControls: import("@angular/core").Signal<ReportComponentDefinition[]>;
29
+ readonly dateFormats: readonly ["yyyy-MM-dd", "yyyyMMdd", "dd/MM/yyyy", "MM/dd/yyyy", "dd-MM-yyyy"];
30
+ readonly selectedDateField: import("@angular/core").Signal<ReportComponentDefinition | undefined>;
31
+ readonly selectedDateFormat: import("@angular/core").Signal<"dd/MM/yyyy" | "yyyy-MM-dd" | "yyyyMMdd" | "MM/dd/yyyy" | "dd-MM-yyyy">;
32
+ onDateFormatSelected(format: ParameterDateFormat): void;
28
33
  readonly hasValue: import("@angular/core").Signal<boolean>;
29
34
  readonly activeMode: import("@angular/core").Signal<ParameterBindingMode>;
30
35
  readonly isAutoSessionDerived: import("@angular/core").Signal<boolean>;
@@ -22,6 +22,7 @@ export declare class DesignerComponent implements OnInit {
22
22
  private readonly sessionService;
23
23
  private readonly executionService;
24
24
  private readonly dialog;
25
+ private readonly overlaySupport;
25
26
  private readonly router;
26
27
  private readonly reportingConfig;
27
28
  /** Optional reportId to load from persistence adapter */
@@ -80,6 +80,7 @@ export declare class ReportGridBridgeComponent {
80
80
  readonly gridInstanceKey: import("@angular/core").Signal<string>;
81
81
  readonly gridStateKey: import("@angular/core").Signal<string>;
82
82
  readonly gridConfig: import("@angular/core").Signal<{
83
+ selectable: boolean;
83
84
  rowSelection: "single" | "multiple";
84
85
  selectionMode: "single" | "multiple";
85
86
  checkboxSelection: boolean;
@@ -87,7 +88,6 @@ export declare class ReportGridBridgeComponent {
87
88
  stateKey: string;
88
89
  pageSize?: number;
89
90
  pagination?: boolean;
90
- selectable?: boolean;
91
91
  showRowNumbers?: boolean;
92
92
  allowColumnReorder?: boolean;
93
93
  allowExport?: boolean;
@@ -155,6 +155,7 @@ export declare class ReportGridBridgeComponent {
155
155
  }[];
156
156
  rowData: unknown[];
157
157
  config: {
158
+ selectable: boolean;
158
159
  rowSelection: "single" | "multiple";
159
160
  selectionMode: "single" | "multiple";
160
161
  checkboxSelection: boolean;
@@ -162,7 +163,6 @@ export declare class ReportGridBridgeComponent {
162
163
  stateKey: string;
163
164
  pageSize?: number;
164
165
  pagination?: boolean;
165
- selectable?: boolean;
166
166
  showRowNumbers?: boolean;
167
167
  allowColumnReorder?: boolean;
168
168
  allowExport?: boolean;
@@ -13,7 +13,6 @@ export declare class RptDropdownComponent implements OnDestroy {
13
13
  private readonly sessionService;
14
14
  private readonly elementRef;
15
15
  private readonly reportingConfig;
16
- private readonly overlay;
17
16
  readonly scrollStrategy: ScrollStrategy;
18
17
  readonly triggerWidth: import("@angular/core").WritableSignal<string | number>;
19
18
  readonly overlayPositions: ConnectedPosition[];
@@ -66,7 +65,7 @@ export declare class RptDropdownComponent implements OnDestroy {
66
65
  readonly hasExcessOptions: import("@angular/core").Signal<boolean>;
67
66
  readonly excessOptionsCount: import("@angular/core").Signal<number>;
68
67
  readonly waitingLabel: import("@angular/core").Signal<string>;
69
- readonly statusKind: import("@angular/core").Signal<"error" | "idle" | "loading" | "ok" | "waiting" | "empty">;
68
+ readonly statusKind: import("@angular/core").Signal<"error" | "waiting" | "idle" | "loading" | "ok" | "empty">;
70
69
  readonly statusText: import("@angular/core").Signal<string>;
71
70
  readonly isInvalid: import("@angular/core").Signal<boolean>;
72
71
  readonly errorMessage: import("@angular/core").Signal<string>;
@@ -13,7 +13,6 @@ export interface SearchableSelectOption<T = any> {
13
13
  }
14
14
  export declare class RptSearchableSelectComponent implements ControlValueAccessor {
15
15
  private readonly elementRef;
16
- private readonly overlay;
17
16
  readonly panelId: string;
18
17
  readonly scrollStrategy: ScrollStrategy;
19
18
  readonly triggerWidth: import("@angular/core").WritableSignal<string | number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bways-report",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Enterprise-grade, metadata-driven reporting engine and visual page builder for Angular 18+ ERP applications.",
5
5
  "keywords": [
6
6
  "angular",
@@ -40,10 +40,11 @@
40
40
  "tslib": "^2.3.0"
41
41
  },
42
42
  "schematics": "./schematics/collection.json",
43
- "sideEffects": false,
44
- "module": "fesm2022/bways-report.mjs",
45
- "typings": "index.d.ts",
43
+ "sideEffects": [
44
+ "**/*.css"
45
+ ],
46
46
  "exports": {
47
+ "./styles/theme.css": "./styles/theme.css",
47
48
  "./package.json": {
48
49
  "default": "./package.json"
49
50
  },
@@ -53,5 +54,7 @@
53
54
  "esm": "./esm2022/bways-report.mjs",
54
55
  "default": "./fesm2022/bways-report.mjs"
55
56
  }
56
- }
57
+ },
58
+ "module": "fesm2022/bways-report.mjs",
59
+ "typings": "index.d.ts"
57
60
  }
@@ -0,0 +1,184 @@
1
+ /**
2
+ * BWays-Report Default CSS Theme Variables & Design Tokens
3
+ *
4
+ * Designed according to Enterprise Precision & Data-Dense Dashboard standards.
5
+ * Host ERP applications can easily override any of these variables
6
+ * in their global styles or container elements to match their design system.
7
+ */
8
+ :root {
9
+ /* Typography */
10
+ --rpt-font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Helvetica, Arial, sans-serif;
11
+ --rpt-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Fira Code', monospace;
12
+ --rpt-font-size-xs: 0.6875rem; /* 11px */
13
+ --rpt-font-size-sm: 0.75rem; /* 12px */
14
+ --rpt-font-size-base: 0.875rem; /* 14px */
15
+ --rpt-font-size-md: 1rem; /* 16px */
16
+ --rpt-font-size-lg: 1.125rem; /* 18px */
17
+ --rpt-font-size-xl: 1.375rem; /* 22px */
18
+ --rpt-font-size-2xl: 1.75rem; /* 28px */
19
+ --rpt-font-weight-normal: 400;
20
+ --rpt-font-weight-medium: 500;
21
+ --rpt-font-weight-semibold: 600;
22
+ --rpt-font-weight-bold: 700;
23
+
24
+ /* Spacing Scale (4/8px Rhythm) */
25
+ --rpt-space-xs: 4px;
26
+ --rpt-space-sm: 8px;
27
+ --rpt-space-md: 12px;
28
+ --rpt-space-lg: 16px;
29
+ --rpt-space-xl: 24px;
30
+ --rpt-space-2xl: 32px;
31
+
32
+ /* Brand / Primary Color Scale */
33
+ --rpt-color-primary: #2563eb;
34
+ --rpt-color-primary-hover: #1d4ed8;
35
+ --rpt-color-primary-active: #1e40af;
36
+ --rpt-color-primary-light: #eff6ff;
37
+ --rpt-color-primary-focus: rgba(37, 99, 235, 0.25);
38
+ --rpt-color-primary-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
39
+
40
+ /* Neutral Backgrounds & Surfaces */
41
+ --rpt-color-bg: #f8fafc;
42
+ --rpt-color-surface: #ffffff;
43
+ --rpt-color-surface-hover: #f1f5f9;
44
+ --rpt-color-surface-active: #e2e8f0;
45
+ --rpt-color-surface-elevated: #ffffff;
46
+
47
+ /* Text & Foreground */
48
+ --rpt-color-text: #0f172a;
49
+ --rpt-color-text-secondary: #334155;
50
+ --rpt-color-text-muted: #64748b;
51
+ --rpt-color-text-inverse: #ffffff;
52
+
53
+ /* Borders & Dividers */
54
+ --rpt-color-border: #cbd5e1;
55
+ --rpt-color-border-subtle: #e2e8f0;
56
+ --rpt-color-border-hover: #94a3b8;
57
+ --rpt-color-border-focus: #2563eb;
58
+
59
+ /* Status Colors */
60
+ --rpt-color-danger: #ef4444;
61
+ --rpt-color-danger-hover: #dc2626;
62
+ --rpt-color-danger-bg: #fef2f2;
63
+ --rpt-color-danger-border: #fecaca;
64
+ --rpt-color-success: #10b981;
65
+ --rpt-color-success-bg: #ecfdf5;
66
+ --rpt-color-success-border: #a7f3d0;
67
+ --rpt-color-warning: #f59e0b;
68
+ --rpt-color-warning-bg: #fffbeb;
69
+ --rpt-color-warning-border: #fde68a;
70
+ --rpt-color-info: #0284c7;
71
+ --rpt-color-info-bg: #f0f9ff;
72
+ --rpt-color-info-border: #bae6fd;
73
+
74
+ /* Border Radii */
75
+ --rpt-border-radius-xs: 3px;
76
+ --rpt-border-radius-sm: 4px;
77
+ --rpt-border-radius: 6px;
78
+ --rpt-border-radius-lg: 8px;
79
+ --rpt-border-radius-xl: 12px;
80
+ --rpt-border-radius-full: 9999px;
81
+
82
+ /* Transitions & Animation Speeds */
83
+ --rpt-transition-speed-fast: 100ms;
84
+ --rpt-transition-speed: 150ms;
85
+ --rpt-transition-speed-smooth: 250ms;
86
+ --rpt-transition-ease: cubic-bezier(0.16, 1, 0.3, 1);
87
+
88
+ /* Elevation Shadows */
89
+ --rpt-box-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
90
+ --rpt-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
91
+ --rpt-box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
92
+ --rpt-box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
93
+ --rpt-box-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
94
+ --rpt-box-shadow-focus: 0 0 0 3px var(--rpt-color-primary-focus);
95
+
96
+ /* Glassmorphism */
97
+ --rpt-glass-bg: rgba(255, 255, 255, 0.85);
98
+ --rpt-glass-border: rgba(255, 255, 255, 0.4);
99
+ --rpt-glass-blur: blur(10px);
100
+ }
101
+
102
+ /* ==========================================================================
103
+ Global Helper & Accessibility Utilities
104
+ ========================================================================== */
105
+ .rpt-tabular-nums {
106
+ font-variant-numeric: tabular-nums;
107
+ }
108
+
109
+ /* Universal Form Control Typography Reset */
110
+ button,
111
+ input,
112
+ select,
113
+ textarea {
114
+ font-family: inherit;
115
+ }
116
+
117
+ /* Remove increment / decrement stepper arrows from all number inputs */
118
+ input[type=number]::-webkit-inner-spin-button,
119
+ input[type=number]::-webkit-outer-spin-button {
120
+ -webkit-appearance: none;
121
+ margin: 0;
122
+ }
123
+
124
+ input[type=number] {
125
+ -moz-appearance: textfield;
126
+ appearance: textfield;
127
+ }
128
+
129
+ /* Accessible focus ring */
130
+ :focus-visible {
131
+ outline: 2px solid var(--rpt-color-primary);
132
+ outline-offset: 2px;
133
+ }
134
+
135
+ /* Respect reduced motion */
136
+ @media (prefers-reduced-motion: reduce) {
137
+ *, ::before, ::after {
138
+ animation-duration: 0.01ms !important;
139
+ animation-iteration-count: 1 !important;
140
+ transition-duration: 0.01ms !important;
141
+ scroll-behavior: auto !important;
142
+ }
143
+ }
144
+
145
+ /* CDK Drag and Drop Global Styles */
146
+ .cdk-drag-preview {
147
+ box-sizing: border-box;
148
+ border-radius: var(--rpt-border-radius-lg, 8px);
149
+ box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.15);
150
+ opacity: 0.96;
151
+ background: var(--rpt-color-surface, #ffffff);
152
+ border: 1px solid var(--rpt-color-primary, #2563eb);
153
+ z-index: 10000 !important;
154
+ font-family: var(--rpt-font-family, system-ui, sans-serif) !important;
155
+ }
156
+
157
+ .cdk-drag-preview * {
158
+ font-family: inherit !important;
159
+ }
160
+
161
+ .cdk-drag-placeholder {
162
+ opacity: 0.25 !important;
163
+ border: 2px dashed var(--rpt-color-primary, #2563eb) !important;
164
+ border-radius: var(--rpt-border-radius-lg, 8px) !important;
165
+ background: var(--rpt-color-primary-light, rgba(37, 99, 235, 0.05)) !important;
166
+ }
167
+
168
+ .cdk-drag-animating {
169
+ transition: transform 220ms var(--rpt-transition-ease, cubic-bezier(0.16, 1, 0.3, 1));
170
+ }
171
+
172
+ .canvas-grid.cdk-drop-list-dragging .canvas-component-card:not(.cdk-drag-placeholder) {
173
+ transition: transform 220ms var(--rpt-transition-ease, cubic-bezier(0.16, 1, 0.3, 1));
174
+ }
175
+
176
+ /* Optional library dialog appearance. Structural positioning is installed by the library. */
177
+ .rpt-dialog-panel {
178
+ max-width: 95vw;
179
+ max-height: 95vh;
180
+ }
181
+ .rpt-dialog-backdrop {
182
+ background-color: rgba(15, 23, 42, 0.48);
183
+ backdrop-filter: blur(3px);
184
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2024 Google LLC.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.