bways-report 0.2.1 → 0.2.3

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 (38) hide show
  1. package/README.md +21 -1
  2. package/esm2022/lib/core/config/bways-report-config.mjs +1 -1
  3. package/esm2022/lib/core/services/designer-form-context.service.mjs +23 -0
  4. package/esm2022/lib/core/services/dynamic-form-builder.service.mjs +3 -2
  5. package/esm2022/lib/core/services/report-data-discovery.service.mjs +15 -6
  6. package/esm2022/lib/core/services/report-session-context.service.mjs +1 -44
  7. package/esm2022/lib/core/utils/report-form-values.util.mjs +25 -0
  8. package/esm2022/lib/core/utils/report-parameter.util.mjs +20 -4
  9. package/esm2022/lib/features/designer/components/design-canvas/design-canvas.component.mjs +20 -6
  10. package/esm2022/lib/features/designer/components/property-editor/parameter-binding-editor.component.mjs +94 -2
  11. package/esm2022/lib/features/designer/components/property-editor/property-editor-action.component.mjs +4 -2
  12. package/esm2022/lib/features/designer/components/property-editor/property-editor-datasource.component.mjs +9 -7
  13. package/esm2022/lib/features/designer/components/property-editor/property-editor-grid.component.mjs +7 -14
  14. package/esm2022/lib/features/designer/components/property-editor/property-editor.component.mjs +8 -4
  15. package/esm2022/lib/features/designer/components/toolbar/designer-toolbar.component.mjs +11 -11
  16. package/esm2022/lib/features/designer/designer.component.mjs +6 -5
  17. package/esm2022/lib/features/designer/services/designer-state.service.mjs +5 -3
  18. package/esm2022/lib/primitives/components/date/rpt-calendar-input.component.mjs +102 -0
  19. package/esm2022/lib/primitives/components/date/rpt-date.component.mjs +12 -3
  20. package/esm2022/lib/primitives/components/dropdown/rpt-dropdown.component.mjs +23 -4
  21. package/esm2022/lib/primitives/components/radio/rpt-radio.component.mjs +3 -2
  22. package/fesm2022/bways-report.mjs +1275 -1030
  23. package/fesm2022/bways-report.mjs.map +1 -1
  24. package/lib/core/config/bways-report-config.d.ts +3 -0
  25. package/lib/core/services/designer-form-context.service.d.ts +14 -0
  26. package/lib/core/services/report-data-discovery.service.d.ts +1 -1
  27. package/lib/core/services/report-session-context.service.d.ts +0 -5
  28. package/lib/core/utils/report-form-values.util.d.ts +5 -0
  29. package/lib/core/utils/report-parameter.util.d.ts +3 -0
  30. package/lib/features/designer/components/design-canvas/design-canvas.component.d.ts +1 -0
  31. package/lib/features/designer/components/property-editor/parameter-binding-editor.component.d.ts +12 -0
  32. package/lib/features/designer/components/property-editor/property-editor-action.component.d.ts +1 -0
  33. package/lib/features/designer/components/property-editor/property-editor-datasource.component.d.ts +1 -0
  34. package/lib/features/designer/components/property-editor/property-editor.component.d.ts +1 -0
  35. package/lib/primitives/components/date/rpt-calendar-input.component.d.ts +23 -0
  36. package/lib/primitives/components/dropdown/rpt-dropdown.component.d.ts +2 -0
  37. package/package.json +1 -1
  38. package/styles/theme.css +9 -12
@@ -105,6 +105,9 @@ export interface BwaysReportConfig {
105
105
  * a plain object, a factory function, an Observable, or a Signal.
106
106
  *
107
107
  * @example
108
+ * Browser login storage is never inspected automatically. Omitted page sessions inherit
109
+ * explicitly configured application sessions; use session: {} to isolate a page.
110
+ *
108
111
  * session: PlaygroundSessionService
109
112
  * session: () => inject(AuthService).session()
110
113
  * session: { branchId: 1, companyId: 10 }
@@ -0,0 +1,14 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import * as i0 from "@angular/core";
3
+ /** Owned by one designer, including the property editor and its live canvas. */
4
+ export declare class DesignerFormContextService {
5
+ private readonly form;
6
+ private readonly revision;
7
+ readonly dropdownColumns: import("@angular/core").WritableSignal<Record<string, string[]>>;
8
+ readonly values: import("@angular/core").Signal<Record<string, unknown>>;
9
+ bind(form: FormGroup): void;
10
+ refresh(): void;
11
+ setColumns(key: string, columns: string[]): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<DesignerFormContextService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<DesignerFormContextService>;
14
+ }
@@ -37,7 +37,7 @@ export declare class ReportDataDiscoveryService {
37
37
  method?: string;
38
38
  headers?: Record<string, string>;
39
39
  useProxy?: boolean;
40
- }): Observable<GridColumnDefinition[]>;
40
+ }, formValues?: Record<string, unknown>): Observable<GridColumnDefinition[]>;
41
41
  /**
42
42
  * Executes a sample API call and infers grid column definitions from the response records.
43
43
  */
@@ -74,11 +74,6 @@ export declare class ReportSessionContextService implements OnDestroy {
74
74
  * Always pulls the latest runtime state. Never throws or crashes the thread.
75
75
  */
76
76
  getCurrentSessionContext(): SessionContextMap;
77
- /**
78
- * Safely detects session parameters from host project browser storage
79
- * (sessionStorage: user_Info, currentUser; localStorage: currentUser, CompanyData, user_Info).
80
- */
81
- private detectBrowserSession;
82
77
  /**
83
78
  * Normalizes a parameter or session key into a lowercase alphanumeric string
84
79
  * for reliable, case-insensitive, and symbol-insensitive matching.
@@ -0,0 +1,5 @@
1
+ import type { AbstractControl, FormGroup } from '@angular/forms';
2
+ export declare function rememberSelectedOption(control: AbstractControl, value: unknown, record?: Record<string, unknown>): void;
3
+ /** Keep form values primitive. Selection metadata never becomes a wire argument. */
4
+ export declare function extractReportFormValues(form: FormGroup): Record<string, unknown>;
5
+ export declare function selectedOptionRecord(values: Record<string, unknown>, field: string): Record<string, unknown> | undefined;
@@ -8,6 +8,7 @@ export type ParameterDateFormat = typeof PARAMETER_DATE_FORMATS[number];
8
8
  export declare function parseParameterToken(raw: string): {
9
9
  field: string;
10
10
  dateFormat?: ParameterDateFormat;
11
+ column?: string;
11
12
  } | null;
12
13
  /** Format calendar parts directly, avoiding UTC/time-zone shifts and locale parsing. */
13
14
  export declare function formatParameterDate(value: unknown, format: ParameterDateFormat): string;
@@ -44,6 +45,8 @@ export declare function parseSqlExecStatement(sql: string): ParsedSqlExec | null
44
45
  * - anything else -> sanitized literal value (fixed value)
45
46
  */
46
47
  export declare function resolveParameterValue(raw: unknown, session: Record<string, unknown>, formValues: Record<string, unknown>): unknown;
48
+ /** Replace a single mapping and remove all stale aliases for the same argument. */
49
+ export declare function setParameterMapping(mappings: ParameterMappings | undefined, name: string, value: string | number | boolean): ParameterMappings;
47
50
  /** Canonical SQL argument names. Equal aliases collapse; conflicting values fail explicitly. */
48
51
  export declare function normalizeParameterNames(parameters: Record<string, unknown>): Record<string, unknown>;
49
52
  /** Resolves mappings into one concrete value per parameter, without @ aliases. */
@@ -6,6 +6,7 @@ import { getComponentIconName } from '../../utilities/canvas-layout.util';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class DesignCanvasComponent implements OnDestroy {
8
8
  private readonly requests;
9
+ private readonly formContext;
9
10
  constructor();
10
11
  private readonly designerState;
11
12
  private gridFilterDebounceTimer;
@@ -4,7 +4,9 @@ import { ParameterDateFormat } from '../../../../core/utils/report-parameter.uti
4
4
  import * as i0 from "@angular/core";
5
5
  export type ParameterBindingMode = 'session' | 'control' | 'fixed' | 'context' | 'custom';
6
6
  export declare class ParameterBindingEditorComponent {
7
+ private readonly formContext;
7
8
  private readonly sessionService;
9
+ private readonly reportingConfig;
8
10
  readonly param: import("@angular/core").InputSignal<ProcedureParameterMetadata>;
9
11
  readonly currentValue: import("@angular/core").InputSignal<string | number | boolean>;
10
12
  readonly allComponents: import("@angular/core").InputSignal<ReportComponentDefinition[]>;
@@ -18,6 +20,7 @@ export declare class ParameterBindingEditorComponent {
18
20
  }>;
19
21
  readonly internalMode: import("@angular/core").WritableSignal<ParameterBindingMode | null>;
20
22
  readonly sessionMatch: import("@angular/core").Signal<import("../../../../core/services/report-session-context.service").SessionParamMatch | null>;
23
+ readonly unavailableSessionBinding: import("@angular/core").Signal<boolean | undefined>;
21
24
  readonly friendlyLabel: import("@angular/core").Signal<string>;
22
25
  readonly displayType: import("@angular/core").Signal<"Date" | "Text" | "Number" | "Yes / No">;
23
26
  readonly isCurrentValue: (val: string | number) => boolean;
@@ -26,6 +29,15 @@ export declare class ParameterBindingEditorComponent {
26
29
  value: string | number;
27
30
  }[]>;
28
31
  readonly compatibleControls: import("@angular/core").Signal<ReportComponentDefinition[]>;
32
+ readonly selectedDropdownField: import("@angular/core").Signal<ReportComponentDefinition | undefined>;
33
+ readonly dropdownExample: import("@angular/core").Signal<{
34
+ label: string;
35
+ value: string;
36
+ } | null>;
37
+ readonly selectedDropdownColumn: import("@angular/core").Signal<string>;
38
+ readonly dropdownColumns: import("@angular/core").Signal<string[]>;
39
+ readonly dropdownParameterPreview: import("@angular/core").Signal<string | null>;
40
+ onDropdownColumnSelected(column: string): void;
29
41
  readonly dateFormats: readonly ["yyyy-MM-dd", "yyyyMMdd", "dd/MM/yyyy", "MM/dd/yyyy", "dd-MM-yyyy"];
30
42
  readonly selectedDateField: import("@angular/core").Signal<ReportComponentDefinition | undefined>;
31
43
  readonly selectedDateFormat: import("@angular/core").Signal<"dd/MM/yyyy" | "yyyy-MM-dd" | "yyyyMMdd" | "MM/dd/yyyy" | "dd-MM-yyyy">;
@@ -12,6 +12,7 @@ export interface ActionTypeOption {
12
12
  * Exporting to Excel/PDF, Crystal Report Printing, and Navigation.
13
13
  */
14
14
  export declare class PropertyEditorActionComponent {
15
+ private readonly formContext;
15
16
  private readonly designerState;
16
17
  private readonly discoveryAdapter;
17
18
  private readonly lookupAdapter;
@@ -12,6 +12,7 @@ export declare class PropertyEditorDatasourceComponent implements OnDestroy {
12
12
  private entitiesSub?;
13
13
  private readonly discoveryAdapter;
14
14
  private readonly sessionService;
15
+ private readonly reportingConfig;
15
16
  private readonly designerState;
16
17
  private readonly dataDiscovery;
17
18
  private readonly endpoints;
@@ -13,6 +13,7 @@ import * as i0 from "@angular/core";
13
13
  * and Rule 32 (Avoid God Components).
14
14
  */
15
15
  export declare class PropertyEditorComponent {
16
+ private readonly formContext;
16
17
  private readonly designerState;
17
18
  private readonly registry;
18
19
  private readonly discoveryAdapter;
@@ -0,0 +1,23 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { FormControl } from '@angular/forms';
3
+ import * as i0 from "@angular/core";
4
+ /** Stable display format with ISO form values; browser locale only affects the calendar popup. */
5
+ export declare class RptCalendarInputComponent implements OnInit {
6
+ readonly control: import("@angular/core").InputSignal<FormControl<any>>;
7
+ readonly elementId: import("@angular/core").InputSignal<string>;
8
+ readonly min: import("@angular/core").InputSignal<string | null>;
9
+ readonly max: import("@angular/core").InputSignal<string | null>;
10
+ readonly text: import("@angular/core").WritableSignal<string>;
11
+ readonly calendarValue: import("@angular/core").WritableSignal<string>;
12
+ readonly disabled: import("@angular/core").WritableSignal<boolean>;
13
+ readonly invalid: import("@angular/core").WritableSignal<boolean>;
14
+ readonly formatError: import("@angular/core").WritableSignal<boolean>;
15
+ private editing;
16
+ constructor();
17
+ ngOnInit(): void;
18
+ onText(value: string): void;
19
+ onCalendar(value: string): void;
20
+ openCalendar(picker: HTMLInputElement): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<RptCalendarInputComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<RptCalendarInputComponent, "rpt-calendar-input", never, { "control": { "alias": "control"; "required": true; "isSignal": true; }; "elementId": { "alias": "elementId"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
23
+ }
@@ -6,8 +6,10 @@ import * as i0 from "@angular/core";
6
6
  export interface DropdownOption {
7
7
  key: string | number;
8
8
  label: string;
9
+ raw?: Record<string, unknown>;
9
10
  }
10
11
  export declare class RptDropdownComponent implements OnDestroy {
12
+ private readonly formContext;
11
13
  private readonly masterDataProvider;
12
14
  private readonly lookupAdapter;
13
15
  private readonly sessionService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bways-report",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Enterprise-grade, metadata-driven reporting engine and visual page builder for Angular 18+ ERP applications.",
5
5
  "keywords": [
6
6
  "angular",
package/styles/theme.css CHANGED
@@ -9,13 +9,13 @@
9
9
  /* Typography */
10
10
  --rpt-font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Helvetica, Arial, sans-serif;
11
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 */
12
+ --rpt-font-size-xs: 11px; /* 11px */
13
+ --rpt-font-size-sm: 12px; /* 12px */
14
+ --rpt-font-size-base: 14px; /* 14px */
15
+ --rpt-font-size-md: 16px; /* 16px */
16
+ --rpt-font-size-lg: 18px; /* 18px */
17
+ --rpt-font-size-xl: 22px; /* 22px */
18
+ --rpt-font-size-2xl: 28px; /* 28px */
19
19
  --rpt-font-weight-normal: 400;
20
20
  --rpt-font-weight-medium: 500;
21
21
  --rpt-font-weight-semibold: 600;
@@ -106,11 +106,8 @@
106
106
  font-variant-numeric: tabular-nums;
107
107
  }
108
108
 
109
- /* Universal Form Control Typography Reset */
110
- button,
111
- input,
112
- select,
113
- textarea {
109
+ /* Library typography only: do not reset the host application controls. */
110
+ :where(rpt-designer, rpt-report-designer, rpt-runtime, rpt-report, rpt-report-saved-dialog) :is(button, input, select, textarea) {
114
111
  font-family: inherit;
115
112
  }
116
113