bways-report 0.1.4 → 0.1.5

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.
@@ -1,3 +1,4 @@
1
1
  export { DynamicFormBuilder } from './dynamic-form-builder.service';
2
2
  export { ReportSessionContextService } from './report-session-context.service';
3
3
  export type { SessionParamMatch, DerivedParametersResult, } from './report-session-context.service';
4
+ export { ReportStorageService } from './report-storage.service';
@@ -0,0 +1,26 @@
1
+ import { ReportStorage } from '../tokens/storage.token';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Angular injectable service wrapping report storage operations.
5
+ * Provides type-safe JSON serialization/deserialization and environment-agnostic access.
6
+ */
7
+ export declare class ReportStorageService implements ReportStorage {
8
+ private readonly storage;
9
+ getItem(key: string): string | null;
10
+ setItem(key: string, value: string): void;
11
+ removeItem(key: string): void;
12
+ clear(): void;
13
+ key(index: number): string | null;
14
+ get length(): number;
15
+ /**
16
+ * Safely retrieves and parses a JSON value from storage.
17
+ * Returns fallback if key is missing or parsing fails.
18
+ */
19
+ getJSON<T>(key: string, fallback: T): T;
20
+ /**
21
+ * Safely serializes and stores a JSON value in storage.
22
+ */
23
+ setJSON<T>(key: string, value: T): void;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<ReportStorageService, never>;
25
+ static ɵprov: i0.ɵɵInjectableDeclaration<ReportStorageService>;
26
+ }
@@ -2,3 +2,5 @@ export { REPORTING_CONFIG, GRID_COMPONENT, CHART_COMPONENT, } from './reporting-
2
2
  export type { ReportingConfig, } from './reporting-config.token';
3
3
  export { REPORT_SESSION_CONTEXT, REPORT_SESSION_PROVIDER, SessionContextProvider, } from './session-context.token';
4
4
  export type { SessionParamPrimitive, SessionContextMap, SessionContextProviderFn, SessionContextSource, } from './session-context.token';
5
+ export { REPORT_STORAGE, BrowserReportStorage, MemoryReportStorage, } from './storage.token';
6
+ export type { ReportStorage, } from './storage.token';
@@ -0,0 +1,48 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ /**
3
+ * Storage contract for reading and writing report configurations,
4
+ * presets, and layout states across environments (Browser, SSR, sandboxed iframes).
5
+ */
6
+ export interface ReportStorage {
7
+ getItem(key: string): string | null;
8
+ setItem(key: string, value: string): void;
9
+ removeItem(key: string): void;
10
+ clear(): void;
11
+ key?(index: number): string | null;
12
+ readonly length?: number;
13
+ }
14
+ /**
15
+ * In-memory fallback implementation of ReportStorage.
16
+ * Safe for SSR, unit tests, and sandboxed iframes where localStorage access is denied.
17
+ */
18
+ export declare class MemoryReportStorage implements ReportStorage {
19
+ private readonly store;
20
+ getItem(key: string): string | null;
21
+ setItem(key: string, value: string): void;
22
+ removeItem(key: string): void;
23
+ clear(): void;
24
+ key(index: number): string | null;
25
+ get length(): number;
26
+ }
27
+ /**
28
+ * Browser localStorage-backed implementation of ReportStorage
29
+ * with transparent in-memory fallback on DOMException or SSR.
30
+ */
31
+ export declare class BrowserReportStorage implements ReportStorage {
32
+ private readonly memory;
33
+ private readonly isSupported;
34
+ constructor();
35
+ private checkStorageSupport;
36
+ getItem(key: string): string | null;
37
+ setItem(key: string, value: string): void;
38
+ removeItem(key: string): void;
39
+ clear(): void;
40
+ key(index: number): string | null;
41
+ get length(): number;
42
+ }
43
+ /**
44
+ * Injection token for the report storage engine.
45
+ * Defaults to `BrowserReportStorage`, which transparently falls back to
46
+ * `MemoryReportStorage` when browser localStorage is unavailable or restricted.
47
+ */
48
+ export declare const REPORT_STORAGE: InjectionToken<ReportStorage>;
@@ -4,6 +4,7 @@ import { ReportDefinition, ReportSummary } from '../../core/models/report-defini
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class LocalStorageReportPersistenceAdapter extends ReportPersistenceAdapter {
6
6
  private readonly templateService;
7
+ private readonly storage;
7
8
  constructor();
8
9
  private seedDefaultBlueprintsIfEmpty;
9
10
  private getIndex;
@@ -24,6 +24,7 @@ export declare class RptGridOutletDirective implements OnDestroy {
24
24
  }
25
25
  export declare class ReportGridBridgeComponent {
26
26
  private readonly injectedGrid;
27
+ private readonly storage;
27
28
  constructor();
28
29
  readonly gridDefinition: import("@angular/core").InputSignal<ReportGridDefinition>;
29
30
  readonly data: import("@angular/core").InputSignal<unknown[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bways-report",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Enterprise-grade, metadata-driven reporting engine and visual page builder for Angular 18+ ERP applications.",
5
5
  "keywords": [
6
6
  "angular",
@@ -15,6 +15,14 @@
15
15
  ],
16
16
  "author": "CCPL / BWays Team",
17
17
  "license": "SEE LICENSE IN LICENSE",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/ccplProject/BWays-CustomeReport.git"
21
+ },
22
+ "homepage": "https://github.com/ccplProject/BWays-CustomeReport#readme",
23
+ "bugs": {
24
+ "url": "https://github.com/ccplProject/BWays-CustomeReport/issues"
25
+ },
18
26
  "peerDependencies": {
19
27
  "@angular/common": ">=18.0.0",
20
28
  "@angular/core": ">=18.0.0",