@mintplayer/ng-spark 22.0.6 → 22.0.8

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.
@@ -3,9 +3,10 @@ import { Type } from '@angular/core';
3
3
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
4
4
  import { Color } from '@mintplayer/ng-bootstrap';
5
5
  import { InMemoryTreeSelectProvider, TreeNode } from '@mintplayer/ng-bootstrap/tree-select';
6
+ import * as _mintplayer_ng_spark_models from '@mintplayer/ng-spark/models';
7
+ import { EntityType, ValidationError, PersistentObject, LookupReference, EntityAttributeDefinition, EntityPermissions, ELookupDisplayType, EReferenceDisplayType, AttributeTab, AttributeGroup, LookupReferenceValue } from '@mintplayer/ng-spark/models';
6
8
  import { DatatableSettings } from '@mintplayer/ng-bootstrap/datatable';
7
9
  import { PaginationResponse } from '@mintplayer/pagination';
8
- import { EntityType, ValidationError, PersistentObject, LookupReference, EntityAttributeDefinition, EntityPermissions, LookupReferenceValue, ELookupDisplayType, AttributeTab, AttributeGroup } from '@mintplayer/ng-spark/models';
9
10
 
10
11
  declare class SparkPoFormComponent {
11
12
  private readonly sparkService;
@@ -32,27 +33,14 @@ declare class SparkPoFormComponent {
32
33
  editingArrayIndex: _angular_core.WritableSignal<number | null>;
33
34
  asDetailPermissions: _angular_core.WritableSignal<Record<string, EntityPermissions>>;
34
35
  asDetailReferenceOptions: _angular_core.WritableSignal<Record<string, Record<string, PersistentObject[]>>>;
35
- editingReferenceAttr: _angular_core.WritableSignal<EntityAttributeDefinition | null>;
36
- showReferenceModal: _angular_core.WritableSignal<boolean>;
37
- referenceModalItems: _angular_core.WritableSignal<PersistentObject[]>;
38
- referenceModalEntityType: _angular_core.WritableSignal<EntityType | null>;
39
- referenceModalPagination: _angular_core.WritableSignal<PaginationResponse<PersistentObject> | undefined>;
40
- referenceModalSettings: _angular_core.WritableSignal<DatatableSettings>;
41
- referenceSearchTerm: string;
42
- editingLookupAttr: _angular_core.WritableSignal<EntityAttributeDefinition | null>;
43
- showLookupModal: _angular_core.WritableSignal<boolean>;
44
- lookupModalItems: _angular_core.WritableSignal<LookupReferenceValue[]>;
45
- lookupSearchTerm: _angular_core.WritableSignal<string>;
46
36
  ELookupDisplayType: typeof ELookupDisplayType;
37
+ EReferenceDisplayType: typeof EReferenceDisplayType;
47
38
  editableAttributes: _angular_core.Signal<EntityAttributeDefinition[]>;
48
39
  private static readonly DEFAULT_TAB;
49
40
  ungroupedAttributes: _angular_core.Signal<EntityAttributeDefinition[]>;
50
41
  resolvedTabs: _angular_core.Signal<AttributeTab[]>;
51
42
  groupsForTab(tab: AttributeTab): AttributeGroup[];
52
43
  attrsForGroup(group: AttributeGroup): EntityAttributeDefinition[];
53
- referenceVisibleAttributes: _angular_core.Signal<EntityAttributeDefinition[]>;
54
- referenceModalRows: _angular_core.Signal<PersistentObject[]>;
55
- filteredLookupItems: _angular_core.Signal<LookupReferenceValue[]>;
56
44
  constructor();
57
45
  private toRecord;
58
46
  loadReferenceOptions(): Promise<void>;
@@ -67,11 +55,9 @@ declare class SparkPoFormComponent {
67
55
  onReferenceTreeChange(attr: EntityAttributeDefinition, value: TreeNode | TreeNode[] | null): void;
68
56
  loadAsDetailTypes(): Promise<void>;
69
57
  loadLookupReferenceOptions(): Promise<void>;
70
- getReferenceOptions(attr: EntityAttributeDefinition): PersistentObject[];
71
58
  getLookupOptions(attr: EntityAttributeDefinition): LookupReferenceValue[];
72
- openLookupSelector(attr: EntityAttributeDefinition): void;
73
- selectLookupItem(item: LookupReferenceValue): void;
74
- closeLookupModal(): void;
59
+ onReferenceValueChange(attr: EntityAttributeDefinition, id: string | null): void;
60
+ onLookupValueChange(attr: EntityAttributeDefinition, key: string | null): void;
75
61
  getEditRendererComponent(attr: EntityAttributeDefinition): Type<any> | null;
76
62
  getEditRendererInputs(attr: EntityAttributeDefinition): Record<string, any>;
77
63
  /** Column renderer for a cell of an AsDetail sub-table (so embedded rows honor `col.renderer` too). */
@@ -95,14 +81,83 @@ declare class SparkPoFormComponent {
95
81
  editArrayItem(attr: EntityAttributeDefinition, index: number): void;
96
82
  removeArrayItem(attr: EntityAttributeDefinition, index: number): void;
97
83
  onAsDetailReorder(attr: EntityAttributeDefinition, event: CdkDragDrop<Record<string, any>[]>): void;
98
- openReferenceSelector(attr: EntityAttributeDefinition): Promise<void>;
99
- onReferenceSearchChange(): void;
100
- applyReferenceFilter(): void;
101
- clearReferenceSearch(): void;
102
- selectReferenceItem(item: PersistentObject): void;
103
- closeReferenceModal(): void;
104
84
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkPoFormComponent, never>;
105
85
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SparkPoFormComponent, "spark-po-form", never, { "entityType": { "alias": "entityType"; "required": false; "isSignal": true; }; "formData": { "alias": "formData"; "required": false; "isSignal": true; }; "validationErrors": { "alias": "validationErrors"; "required": false; "isSignal": true; }; "showButtons": { "alias": "showButtons"; "required": false; "isSignal": true; }; "isSaving": { "alias": "isSaving"; "required": false; "isSignal": true; }; "parentId": { "alias": "parentId"; "required": false; "isSignal": true; }; "parentType": { "alias": "parentType"; "required": false; "isSignal": true; }; }, { "formData": "formDataChange"; "save": "save"; "cancel": "cancel"; }, never, never, true, never>;
106
86
  }
107
87
 
108
- export { SparkPoFormComponent };
88
+ /**
89
+ * Reusable Reference value picker: a readonly textbox showing the current selection's
90
+ * breadcrumb/name plus a "…" button that opens a searchable modal grid over the candidate
91
+ * `options`. Per-instance state (no single top-level slot), so it works for top-level
92
+ * reference attributes and for individual inline AsDetail reference cells alike.
93
+ *
94
+ * The parent pre-loads `options` (the query result) and passes `referenceType` (the target
95
+ * CLR type); the component lazily loads that EntityType's metadata on first open to render
96
+ * the grid's column headers. Emits the picked id via `valueChange`.
97
+ */
98
+ declare class SparkReferencePickerComponent {
99
+ private readonly sparkService;
100
+ private readonly lang;
101
+ /** Currently selected referenced id (or null when unset). */
102
+ value: _angular_core.InputSignal<string | null>;
103
+ /** Candidate items to pick from (the full query result, pre-loaded by the parent). */
104
+ options: _angular_core.InputSignal<PersistentObject[]>;
105
+ /** Target entity type's CLR type name; used to load the grid's column headers. */
106
+ referenceType: _angular_core.InputSignal<string | undefined>;
107
+ /** Renders the field with the Bootstrap is-invalid state. */
108
+ isInvalid: _angular_core.InputSignal<boolean>;
109
+ /** Optional id forwarded to the readonly input (for label association). */
110
+ inputId: _angular_core.InputSignal<string | undefined>;
111
+ /** Optional resolved label appended to the modal header ("Select {title}"). */
112
+ title: _angular_core.InputSignal<string>;
113
+ valueChange: _angular_core.OutputEmitterRef<string | null>;
114
+ colors: typeof Color;
115
+ showModal: _angular_core.WritableSignal<boolean>;
116
+ entityType: _angular_core.WritableSignal<EntityType | null>;
117
+ pagination: _angular_core.WritableSignal<PaginationResponse<PersistentObject> | undefined>;
118
+ settings: _angular_core.WritableSignal<DatatableSettings>;
119
+ searchTerm: string;
120
+ visibleAttributes: _angular_core.Signal<_mintplayer_ng_spark_models.EntityAttributeDefinition[]>;
121
+ rows: _angular_core.Signal<PersistentObject[]>;
122
+ displayValue: _angular_core.Signal<string>;
123
+ open(): Promise<void>;
124
+ onSearchChange(): void;
125
+ applyFilter(): void;
126
+ clearSearch(): void;
127
+ select(item: PersistentObject): void;
128
+ close(): void;
129
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkReferencePickerComponent, never>;
130
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SparkReferencePickerComponent, "spark-reference-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "referenceType": { "alias": "referenceType"; "required": false; "isSignal": true; }; "isInvalid": { "alias": "isInvalid"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
131
+ }
132
+
133
+ /**
134
+ * Reusable LookupReference value picker: a readonly textbox showing the current selection's
135
+ * translated label plus a "…" button that opens a searchable modal list over the active
136
+ * `options`. Per-instance state, so it serves both top-level lookup attributes (display type
137
+ * Modal) and individual inline AsDetail lookup cells. Emits the picked key via `valueChange`.
138
+ */
139
+ declare class SparkLookupPickerComponent {
140
+ /** Currently selected lookup key (or null when unset). */
141
+ value: _angular_core.InputSignal<string | null>;
142
+ /** Active lookup values to pick from. */
143
+ options: _angular_core.InputSignal<LookupReferenceValue[]>;
144
+ /** Renders the field with the Bootstrap is-invalid state. */
145
+ isInvalid: _angular_core.InputSignal<boolean>;
146
+ /** Optional id forwarded to the readonly input (for label association). */
147
+ inputId: _angular_core.InputSignal<string | undefined>;
148
+ /** Optional resolved label appended to the modal header ("Select {title}"). */
149
+ title: _angular_core.InputSignal<string>;
150
+ valueChange: _angular_core.OutputEmitterRef<string | null>;
151
+ colors: typeof Color;
152
+ showModal: _angular_core.WritableSignal<boolean>;
153
+ searchTerm: _angular_core.WritableSignal<string>;
154
+ displayValue: _angular_core.Signal<string>;
155
+ filteredItems: _angular_core.Signal<LookupReferenceValue[]>;
156
+ open(): void;
157
+ select(item: LookupReferenceValue): void;
158
+ close(): void;
159
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkLookupPickerComponent, never>;
160
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SparkLookupPickerComponent, "spark-lookup-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "isInvalid": { "alias": "isInvalid"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
161
+ }
162
+
163
+ export { SparkLookupPickerComponent, SparkPoFormComponent, SparkReferencePickerComponent };