@myrmidon/cadmus-refs-asserted-ids 9.0.0 → 10.0.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.
- package/fesm2022/myrmidon-cadmus-refs-asserted-ids.mjs +27 -31
- package/fesm2022/myrmidon-cadmus-refs-asserted-ids.mjs.map +1 -1
- package/index.d.ts +494 -3
- package/package.json +6 -6
- package/lib/asserted-composite-id/asserted-composite-id.component.d.ts +0 -111
- package/lib/asserted-composite-ids/asserted-composite-ids.component.d.ts +0 -75
- package/lib/asserted-id/asserted-id.component.d.ts +0 -65
- package/lib/asserted-ids/asserted-ids.component.d.ts +0 -36
- package/lib/pin-target-lookup/pin-target-lookup.component.d.ts +0 -156
- package/lib/scoped-pin-lookup/scoped-pin-lookup.component.d.ts +0 -41
- package/lib/services/item-ref-lookup.service.d.ts +0 -13
- package/lib/services/pin-ref-lookup.service.d.ts +0 -27
- package/public-api.d.ts +0 -8
package/index.d.ts
CHANGED
|
@@ -1,5 +1,496 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
3
|
+
import { FormControl, FormGroup, FormBuilder } from '@angular/forms';
|
|
4
|
+
import { IndexLookupDefinitions, ThesaurusEntry, DataPinInfo, Item, Part, IndexLookupDefinition } from '@myrmidon/cadmus-core';
|
|
5
|
+
import { Assertion } from '@myrmidon/cadmus-refs-assertion';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
8
|
+
import { RefLookupService, RefLookupFilter, RefLookupConfig, RefLookupSetEvent } from '@myrmidon/cadmus-refs-lookup';
|
|
9
|
+
import { DialogService } from '@myrmidon/ngx-mat-tools';
|
|
10
|
+
import { RamStorageService } from '@myrmidon/ngx-tools';
|
|
11
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
12
|
+
|
|
1
13
|
/**
|
|
2
|
-
*
|
|
14
|
+
* Pin-based lookup filter. This is a RefLookupFilter with the addition
|
|
15
|
+
* of the item ID and part ID, which are used to filter the results
|
|
16
|
+
* by the ItemPinLookupComponent.
|
|
3
17
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
18
|
+
interface PinRefLookupFilter extends RefLookupFilter {
|
|
19
|
+
itemId?: string;
|
|
20
|
+
partId?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Cadmus pin-based lookup data service. The text being searched here is just
|
|
24
|
+
* the pin's value, according to the options specified. These options correspond
|
|
25
|
+
* to an index lookup definition. The resulting items are of type DataPinInfo.
|
|
26
|
+
*/
|
|
27
|
+
declare class PinRefLookupService implements RefLookupService {
|
|
28
|
+
private _itemService;
|
|
29
|
+
constructor(_itemService: ItemService);
|
|
30
|
+
getName(item: any | undefined): string;
|
|
31
|
+
private buildQuery;
|
|
32
|
+
lookup(filter: PinRefLookupFilter, options?: any): Observable<any[]>;
|
|
33
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PinRefLookupService, never>;
|
|
34
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<PinRefLookupService>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* An asserted ID.
|
|
39
|
+
*/
|
|
40
|
+
interface AssertedId {
|
|
41
|
+
tag?: string;
|
|
42
|
+
value: string;
|
|
43
|
+
label?: string;
|
|
44
|
+
scope: string;
|
|
45
|
+
assertion?: Assertion;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Asserted ID editor component.
|
|
49
|
+
*/
|
|
50
|
+
declare class AssertedIdComponent implements OnInit, OnDestroy {
|
|
51
|
+
lookupService: PinRefLookupService;
|
|
52
|
+
lookupDefs: IndexLookupDefinitions;
|
|
53
|
+
private _sub?;
|
|
54
|
+
private _updatingForm;
|
|
55
|
+
tag: FormControl<string | null>;
|
|
56
|
+
value: FormControl<string | null>;
|
|
57
|
+
label: FormControl<string | null>;
|
|
58
|
+
scope: FormControl<string | null>;
|
|
59
|
+
assertion: FormControl<Assertion | null>;
|
|
60
|
+
form: FormGroup;
|
|
61
|
+
lookupExpanded: boolean;
|
|
62
|
+
readonly idScopeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
63
|
+
readonly idTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
64
|
+
readonly assTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
65
|
+
readonly refTypeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
66
|
+
readonly refTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
67
|
+
/**
|
|
68
|
+
* The asserted ID being edited.
|
|
69
|
+
*/
|
|
70
|
+
readonly id: _angular_core.ModelSignal<AssertedId | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* True to hide the pin-based EID lookup UI.
|
|
73
|
+
*/
|
|
74
|
+
readonly noEidLookup: _angular_core.InputSignal<boolean | undefined>;
|
|
75
|
+
/**
|
|
76
|
+
* True to show the submit button.
|
|
77
|
+
*/
|
|
78
|
+
readonly hasSubmit: _angular_core.InputSignal<boolean | undefined>;
|
|
79
|
+
/**
|
|
80
|
+
* Emitted when the editor is closed.
|
|
81
|
+
*/
|
|
82
|
+
readonly editorClose: _angular_core.OutputEmitterRef<void>;
|
|
83
|
+
constructor(formBuilder: FormBuilder, lookupService: PinRefLookupService, lookupDefs: IndexLookupDefinitions);
|
|
84
|
+
ngOnInit(): void;
|
|
85
|
+
ngOnDestroy(): void;
|
|
86
|
+
onAssertionChange(assertion: Assertion | undefined): void;
|
|
87
|
+
onIdPick(id: string): void;
|
|
88
|
+
private updateForm;
|
|
89
|
+
private getId;
|
|
90
|
+
emitIdChange(): void;
|
|
91
|
+
cancel(): void;
|
|
92
|
+
save(): void;
|
|
93
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AssertedIdComponent, never>;
|
|
94
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AssertedIdComponent, "cadmus-refs-asserted-id", never, { "idScopeEntries": { "alias": "idScopeEntries"; "required": false; "isSignal": true; }; "idTagEntries": { "alias": "idTagEntries"; "required": false; "isSignal": true; }; "assTagEntries": { "alias": "assTagEntries"; "required": false; "isSignal": true; }; "refTypeEntries": { "alias": "refTypeEntries"; "required": false; "isSignal": true; }; "refTagEntries": { "alias": "refTagEntries"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "noEidLookup": { "alias": "noEidLookup"; "required": false; "isSignal": true; }; "hasSubmit": { "alias": "hasSubmit"; "required": false; "isSignal": true; }; }, { "id": "idChange"; "editorClose": "editorClose"; }, never, never, true, never>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Asserted IDs editor.
|
|
99
|
+
*/
|
|
100
|
+
declare class AssertedIdsComponent {
|
|
101
|
+
private _dialogService;
|
|
102
|
+
private _editedIndex;
|
|
103
|
+
edited?: AssertedId;
|
|
104
|
+
/**
|
|
105
|
+
* The asserted IDs.
|
|
106
|
+
*/
|
|
107
|
+
readonly ids: _angular_core.ModelSignal<AssertedId[]>;
|
|
108
|
+
readonly idScopeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
109
|
+
readonly idTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
110
|
+
readonly assTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
111
|
+
readonly refTypeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
112
|
+
readonly refTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
113
|
+
entries: FormControl<AssertedId[]>;
|
|
114
|
+
form: FormGroup;
|
|
115
|
+
constructor(formBuilder: FormBuilder, _dialogService: DialogService);
|
|
116
|
+
private updateForm;
|
|
117
|
+
addId(): void;
|
|
118
|
+
editId(id: AssertedId, index: number): void;
|
|
119
|
+
closeId(): void;
|
|
120
|
+
saveId(entry: AssertedId): void;
|
|
121
|
+
deleteId(index: number): void;
|
|
122
|
+
moveIdUp(index: number): void;
|
|
123
|
+
moveIdDown(index: number): void;
|
|
124
|
+
onIdChange(id?: AssertedId): void;
|
|
125
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AssertedIdsComponent, never>;
|
|
126
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AssertedIdsComponent, "cadmus-refs-asserted-ids", never, { "ids": { "alias": "ids"; "required": false; "isSignal": true; }; "idScopeEntries": { "alias": "idScopeEntries"; "required": false; "isSignal": true; }; "idTagEntries": { "alias": "idTagEntries"; "required": false; "isSignal": true; }; "assTagEntries": { "alias": "assTagEntries"; "required": false; "isSignal": true; }; "refTypeEntries": { "alias": "refTypeEntries"; "required": false; "isSignal": true; }; "refTagEntries": { "alias": "refTagEntries"; "required": false; "isSignal": true; }; }, { "ids": "idsChange"; }, never, never, true, never>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface MetadataPart$1 extends Part {
|
|
130
|
+
metadata: {
|
|
131
|
+
type?: string;
|
|
132
|
+
name: string;
|
|
133
|
+
value: string;
|
|
134
|
+
}[];
|
|
135
|
+
}
|
|
136
|
+
interface LookupInfo {
|
|
137
|
+
pin: DataPinInfo;
|
|
138
|
+
item?: Item;
|
|
139
|
+
part?: MetadataPart$1;
|
|
140
|
+
}
|
|
141
|
+
declare class ScopedPinLookupComponent {
|
|
142
|
+
private _itemService;
|
|
143
|
+
lookupService: PinRefLookupService;
|
|
144
|
+
lookupDefs: IndexLookupDefinitions;
|
|
145
|
+
key: FormControl<string | null>;
|
|
146
|
+
keyForm: FormGroup;
|
|
147
|
+
keys: string[];
|
|
148
|
+
info?: LookupInfo;
|
|
149
|
+
id: FormControl<string | null>;
|
|
150
|
+
idForm: FormGroup;
|
|
151
|
+
/**
|
|
152
|
+
* Emitted whenever the user picks an ID.
|
|
153
|
+
*/
|
|
154
|
+
readonly idPick: _angular_core.OutputEmitterRef<string>;
|
|
155
|
+
constructor(formBuilder: FormBuilder, _itemService: ItemService, lookupService: PinRefLookupService, lookupDefs: IndexLookupDefinitions);
|
|
156
|
+
ngOnInit(): void;
|
|
157
|
+
onItemChange(item: unknown): void;
|
|
158
|
+
appendIdComponent(type: string, metaIndex?: number): void;
|
|
159
|
+
pickId(): void;
|
|
160
|
+
resetId(): void;
|
|
161
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScopedPinLookupComponent, never>;
|
|
162
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScopedPinLookupComponent, "cadmus-scoped-pin-lookup", never, {}, { "idPick": "idPick"; }, never, never, true, never>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
declare class ItemRefLookupService implements RefLookupService {
|
|
166
|
+
private _itemService;
|
|
167
|
+
constructor(_itemService: ItemService);
|
|
168
|
+
lookup(filter: RefLookupFilter, options?: any): Observable<Item[]>;
|
|
169
|
+
getName(item: Item): string;
|
|
170
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ItemRefLookupService, never>;
|
|
171
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ItemRefLookupService>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
interface MetadataPart extends Part {
|
|
175
|
+
metadata: {
|
|
176
|
+
type?: string;
|
|
177
|
+
name: string;
|
|
178
|
+
value: string;
|
|
179
|
+
}[];
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Pin lookup data used internally by the component.
|
|
183
|
+
*/
|
|
184
|
+
interface PinLookupData {
|
|
185
|
+
pin: DataPinInfo;
|
|
186
|
+
item?: Item;
|
|
187
|
+
metaPart?: MetadataPart;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* A pin-based target. This includes pin's name and value, and
|
|
191
|
+
* the item's ID and optional part IDs. The label is a user friendly
|
|
192
|
+
* string representation of the target, while the gid is a globally
|
|
193
|
+
* unique identifier for the target.
|
|
194
|
+
*/
|
|
195
|
+
interface PinTarget {
|
|
196
|
+
gid: string;
|
|
197
|
+
label: string;
|
|
198
|
+
itemId?: string;
|
|
199
|
+
partId?: string;
|
|
200
|
+
partTypeId?: string;
|
|
201
|
+
roleId?: string;
|
|
202
|
+
name?: string;
|
|
203
|
+
value?: string;
|
|
204
|
+
}
|
|
205
|
+
declare class PinTargetLookupComponent implements OnInit, OnDestroy {
|
|
206
|
+
private _presetLookupDefs;
|
|
207
|
+
itemLookupService: ItemRefLookupService;
|
|
208
|
+
pinLookupService: PinRefLookupService;
|
|
209
|
+
private _itemService;
|
|
210
|
+
private _thesService;
|
|
211
|
+
private _snackbar;
|
|
212
|
+
private readonly _subs;
|
|
213
|
+
private _noTargetUpdate?;
|
|
214
|
+
private _noFormUpdate?;
|
|
215
|
+
private _startWithByTypeMode?;
|
|
216
|
+
/**
|
|
217
|
+
* True when the by-type pin lookup mode is active.
|
|
218
|
+
* User can change mode unless modeSwitching is false.
|
|
219
|
+
*/
|
|
220
|
+
readonly pinByTypeMode: _angular_core.ModelSignal<boolean | undefined>;
|
|
221
|
+
/**
|
|
222
|
+
* True when the user can switch between by-type and by-item mode.
|
|
223
|
+
*/
|
|
224
|
+
readonly canSwitchMode: _angular_core.ModelSignal<boolean | undefined>;
|
|
225
|
+
/**
|
|
226
|
+
* True when the user can edit the target's gid/label for internal
|
|
227
|
+
* targets.
|
|
228
|
+
*/
|
|
229
|
+
readonly canEditTarget: _angular_core.InputSignal<boolean | undefined>;
|
|
230
|
+
/**
|
|
231
|
+
* The lookup definitions to be used for the by-type lookup. If
|
|
232
|
+
* not specified, the lookup definitions will be got via injection
|
|
233
|
+
* when available; if the injected definitions are empty, the
|
|
234
|
+
* lookup definitions will be built from the model-types thesaurus;
|
|
235
|
+
* if this is not available either, the by-type lookup will be
|
|
236
|
+
* disabled.
|
|
237
|
+
*/
|
|
238
|
+
readonly lookupDefinitions: _angular_core.ModelSignal<IndexLookupDefinitions | undefined>;
|
|
239
|
+
/**
|
|
240
|
+
* The optional configurations for using external lookup services.
|
|
241
|
+
*/
|
|
242
|
+
readonly extLookupConfigs: _angular_core.InputSignal<RefLookupConfig[]>;
|
|
243
|
+
/**
|
|
244
|
+
* True if when a new target is set it should be internal rather than
|
|
245
|
+
* external by default.
|
|
246
|
+
*/
|
|
247
|
+
readonly internalDefault: _angular_core.InputSignal<boolean | undefined>;
|
|
248
|
+
/**
|
|
249
|
+
* The target to be edited.
|
|
250
|
+
*/
|
|
251
|
+
readonly target: _angular_core.ModelSignal<PinTarget | undefined>;
|
|
252
|
+
/**
|
|
253
|
+
* The default value for part type key when the by-type mode is active.
|
|
254
|
+
*/
|
|
255
|
+
readonly defaultPartTypeKey: _angular_core.InputSignal<string | undefined>;
|
|
256
|
+
/**
|
|
257
|
+
* Emitted when user closes the editor.
|
|
258
|
+
*/
|
|
259
|
+
readonly editorClose: _angular_core.OutputEmitterRef<void>;
|
|
260
|
+
/**
|
|
261
|
+
* Emitted when the user requests more items from an external lookup.
|
|
262
|
+
*/
|
|
263
|
+
readonly extMoreRequest: _angular_core.OutputEmitterRef<RefLookupSetEvent>;
|
|
264
|
+
/**
|
|
265
|
+
* Emitted when the user changes the external lookup configuration.
|
|
266
|
+
*/
|
|
267
|
+
readonly extLookupConfigChange: _angular_core.OutputEmitterRef<RefLookupConfig>;
|
|
268
|
+
modelEntries: ThesaurusEntry[];
|
|
269
|
+
partTypeKeys: string[];
|
|
270
|
+
itemParts: Part[];
|
|
271
|
+
item: FormControl<Item | null>;
|
|
272
|
+
itemPart: FormControl<Part | null>;
|
|
273
|
+
partTypeKey: FormControl<string | null>;
|
|
274
|
+
gid: FormControl<string | null>;
|
|
275
|
+
label: FormControl<string | null>;
|
|
276
|
+
byTypeMode: FormControl<boolean>;
|
|
277
|
+
external: FormControl<boolean>;
|
|
278
|
+
form: FormGroup;
|
|
279
|
+
filter: PinRefLookupFilter;
|
|
280
|
+
pinFilterOptions?: IndexLookupDefinition;
|
|
281
|
+
lookupData?: PinLookupData;
|
|
282
|
+
constructor(_presetLookupDefs: IndexLookupDefinitions, itemLookupService: ItemRefLookupService, pinLookupService: PinRefLookupService, _itemService: ItemService, _thesService: ThesaurusService, _snackbar: MatSnackBar, formBuilder: FormBuilder);
|
|
283
|
+
private forceByItem;
|
|
284
|
+
private setupKeys;
|
|
285
|
+
ngOnInit(): void;
|
|
286
|
+
ngOnDestroy(): void;
|
|
287
|
+
private buildGid;
|
|
288
|
+
private buildLabel;
|
|
289
|
+
private getTarget;
|
|
290
|
+
private emitChange;
|
|
291
|
+
private updateTarget;
|
|
292
|
+
private updateForm;
|
|
293
|
+
/**
|
|
294
|
+
* Called when the item lookup changes (item is looked up
|
|
295
|
+
* by its title).
|
|
296
|
+
*
|
|
297
|
+
* @param item The item got from lookup.
|
|
298
|
+
*/
|
|
299
|
+
onItemLookupChange(item: unknown): void;
|
|
300
|
+
private loadItemInfo;
|
|
301
|
+
/**
|
|
302
|
+
* Called when the pin lookup change. A pin is looked up by its
|
|
303
|
+
* name and value (=the filter's text), and optionally by:
|
|
304
|
+
* - its index lookup definition (selected by partTypeKey).
|
|
305
|
+
* - its item (defined by item, in filter).
|
|
306
|
+
* - its part (defined by itemPart, in filter).
|
|
307
|
+
*
|
|
308
|
+
* @param info The pin info from pin lookup.
|
|
309
|
+
*/
|
|
310
|
+
onPinLookupChange(info: unknown): void;
|
|
311
|
+
onExtItemChange(event: RefLookupSetEvent): void;
|
|
312
|
+
onExtMoreRequest(event: RefLookupSetEvent): void;
|
|
313
|
+
onCopied(): void;
|
|
314
|
+
onExtConfigChange(config: RefLookupConfig): void;
|
|
315
|
+
close(): void;
|
|
316
|
+
save(): void;
|
|
317
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PinTargetLookupComponent, never>;
|
|
318
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PinTargetLookupComponent, "cadmus-pin-target-lookup", never, { "pinByTypeMode": { "alias": "pinByTypeMode"; "required": false; "isSignal": true; }; "canSwitchMode": { "alias": "canSwitchMode"; "required": false; "isSignal": true; }; "canEditTarget": { "alias": "canEditTarget"; "required": false; "isSignal": true; }; "lookupDefinitions": { "alias": "lookupDefinitions"; "required": false; "isSignal": true; }; "extLookupConfigs": { "alias": "extLookupConfigs"; "required": false; "isSignal": true; }; "internalDefault": { "alias": "internalDefault"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; "defaultPartTypeKey": { "alias": "defaultPartTypeKey"; "required": false; "isSignal": true; }; }, { "pinByTypeMode": "pinByTypeModeChange"; "canSwitchMode": "canSwitchModeChange"; "lookupDefinitions": "lookupDefinitionsChange"; "target": "targetChange"; "editorClose": "editorClose"; "extMoreRequest": "extMoreRequest"; "extLookupConfigChange": "extLookupConfigChange"; }, never, never, true, never>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* An asserted composite ID. This can be an external ID, having only the ID value
|
|
323
|
+
* as its target.gid property; or a lookup ID, with a pin-based target.
|
|
324
|
+
* In both cases, we can add a tag, a scope, and an assertion.
|
|
325
|
+
*/
|
|
326
|
+
interface AssertedCompositeId {
|
|
327
|
+
target: PinTarget;
|
|
328
|
+
tag?: string;
|
|
329
|
+
scope?: string;
|
|
330
|
+
assertion?: Assertion;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* The key to be used to retrieve the external lookup configs from the
|
|
334
|
+
* settings storage. This is equal to the selector of
|
|
335
|
+
* AssertedCompositeIdComponent plus ".configs".
|
|
336
|
+
*/
|
|
337
|
+
declare const ASSERTED_COMPOSITE_ID_CONFIGS_KEY = "cadmus-refs-asserted-composite-id.configs";
|
|
338
|
+
/**
|
|
339
|
+
* An asserted composite ID editor. This allows the user to edit an asserted
|
|
340
|
+
* composite ID, which can be an external ID or a lookup ID.
|
|
341
|
+
*/
|
|
342
|
+
declare class AssertedCompositeIdComponent implements OnInit, OnDestroy {
|
|
343
|
+
lookupService: PinRefLookupService;
|
|
344
|
+
lookupDefs: IndexLookupDefinitions;
|
|
345
|
+
private _sub?;
|
|
346
|
+
private _updatingForm;
|
|
347
|
+
extLookupConfigs: RefLookupConfig[];
|
|
348
|
+
targetExpanded: boolean;
|
|
349
|
+
target: FormControl<PinTarget | null>;
|
|
350
|
+
scope: FormControl<string | null>;
|
|
351
|
+
tag: FormControl<string | null>;
|
|
352
|
+
assertion: FormControl<Assertion | null>;
|
|
353
|
+
form: FormGroup;
|
|
354
|
+
readonly idScopeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
355
|
+
readonly idTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
356
|
+
readonly assTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
357
|
+
readonly refTypeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
358
|
+
readonly refTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
359
|
+
/**
|
|
360
|
+
* The ID being edited.
|
|
361
|
+
*/
|
|
362
|
+
readonly id: _angular_core.ModelSignal<AssertedCompositeId | undefined>;
|
|
363
|
+
/**
|
|
364
|
+
* True if when a new ID is set it should be internal rather than
|
|
365
|
+
* external by default.
|
|
366
|
+
*/
|
|
367
|
+
readonly internalDefault: _angular_core.InputSignal<boolean | undefined>;
|
|
368
|
+
/**
|
|
369
|
+
* True if the UI has a submit button.
|
|
370
|
+
*/
|
|
371
|
+
readonly hasSubmit: _angular_core.InputSignal<boolean | undefined>;
|
|
372
|
+
/**
|
|
373
|
+
* True when the internal UI preselected mode should be by type rather than
|
|
374
|
+
* by item. User can change mode unless modeSwitching is false.
|
|
375
|
+
*/
|
|
376
|
+
readonly pinByTypeMode: _angular_core.InputSignal<boolean | undefined>;
|
|
377
|
+
/**
|
|
378
|
+
* True when the user can switch between by-type and by-item mode in
|
|
379
|
+
* the internal UI.
|
|
380
|
+
*/
|
|
381
|
+
readonly canSwitchMode: _angular_core.InputSignal<boolean | undefined>;
|
|
382
|
+
/**
|
|
383
|
+
* True when the user can edit the target's gid/label for internal targets.
|
|
384
|
+
*/
|
|
385
|
+
readonly canEditTarget: _angular_core.InputSignal<boolean | undefined>;
|
|
386
|
+
/**
|
|
387
|
+
* The lookup definitions to be used for the by-type lookup in the internal UI.
|
|
388
|
+
* If not specified, the lookup definitions will be got via injection
|
|
389
|
+
* when available; if the injected definitions are empty, the
|
|
390
|
+
* lookup definitions will be built from the model-types thesaurus;
|
|
391
|
+
* if this is not available either, the by-type lookup will be
|
|
392
|
+
* disabled.
|
|
393
|
+
*/
|
|
394
|
+
readonly lookupDefinitions: _angular_core.InputSignal<IndexLookupDefinitions | undefined>;
|
|
395
|
+
/**
|
|
396
|
+
* The default part type key to be used.
|
|
397
|
+
*/
|
|
398
|
+
readonly defaultPartTypeKey: _angular_core.InputSignal<string | undefined>;
|
|
399
|
+
/**
|
|
400
|
+
* Emitted whenever the user requests to close the editor.
|
|
401
|
+
*/
|
|
402
|
+
readonly editorClose: _angular_core.OutputEmitterRef<void>;
|
|
403
|
+
/**
|
|
404
|
+
* Emitted when the user requests more.
|
|
405
|
+
*/
|
|
406
|
+
readonly extMoreRequest: _angular_core.OutputEmitterRef<RefLookupSetEvent>;
|
|
407
|
+
constructor(formBuilder: FormBuilder, lookupService: PinRefLookupService, lookupDefs: IndexLookupDefinitions, settings: RamStorageService);
|
|
408
|
+
ngOnInit(): void;
|
|
409
|
+
ngOnDestroy(): void;
|
|
410
|
+
onAssertionChange(assertion: Assertion | undefined): void;
|
|
411
|
+
onTargetChange(target?: PinTarget): void;
|
|
412
|
+
private updateForm;
|
|
413
|
+
private getId;
|
|
414
|
+
emitIdChange(): void;
|
|
415
|
+
onEditorClose(): void;
|
|
416
|
+
onExtMoreRequest(event: RefLookupSetEvent): void;
|
|
417
|
+
onExtLookupConfigChange(config: RefLookupConfig): void;
|
|
418
|
+
cancel(): void;
|
|
419
|
+
save(): void;
|
|
420
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AssertedCompositeIdComponent, never>;
|
|
421
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AssertedCompositeIdComponent, "cadmus-refs-asserted-composite-id", never, { "idScopeEntries": { "alias": "idScopeEntries"; "required": false; "isSignal": true; }; "idTagEntries": { "alias": "idTagEntries"; "required": false; "isSignal": true; }; "assTagEntries": { "alias": "assTagEntries"; "required": false; "isSignal": true; }; "refTypeEntries": { "alias": "refTypeEntries"; "required": false; "isSignal": true; }; "refTagEntries": { "alias": "refTagEntries"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "internalDefault": { "alias": "internalDefault"; "required": false; "isSignal": true; }; "hasSubmit": { "alias": "hasSubmit"; "required": false; "isSignal": true; }; "pinByTypeMode": { "alias": "pinByTypeMode"; "required": false; "isSignal": true; }; "canSwitchMode": { "alias": "canSwitchMode"; "required": false; "isSignal": true; }; "canEditTarget": { "alias": "canEditTarget"; "required": false; "isSignal": true; }; "lookupDefinitions": { "alias": "lookupDefinitions"; "required": false; "isSignal": true; }; "defaultPartTypeKey": { "alias": "defaultPartTypeKey"; "required": false; "isSignal": true; }; }, { "id": "idChange"; "editorClose": "editorClose"; "extMoreRequest": "extMoreRequest"; }, never, never, true, never>;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Asserted composite IDs editor.
|
|
426
|
+
*/
|
|
427
|
+
declare class AssertedCompositeIdsComponent {
|
|
428
|
+
private _dialogService;
|
|
429
|
+
private _ids;
|
|
430
|
+
private _editedIndex;
|
|
431
|
+
edited?: AssertedCompositeId;
|
|
432
|
+
/**
|
|
433
|
+
* The asserted IDs.
|
|
434
|
+
*/
|
|
435
|
+
get ids(): AssertedCompositeId[];
|
|
436
|
+
set ids(value: AssertedCompositeId[]);
|
|
437
|
+
readonly idScopeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
438
|
+
readonly idTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
439
|
+
readonly assTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
440
|
+
readonly refTypeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
441
|
+
readonly refTagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
442
|
+
/**
|
|
443
|
+
* True when the internal UI preselected mode should be by type rather than
|
|
444
|
+
* by item. User can change mode unless modeSwitching is false.
|
|
445
|
+
*/
|
|
446
|
+
readonly pinByTypeMode: _angular_core.InputSignal<boolean | undefined>;
|
|
447
|
+
/**
|
|
448
|
+
* True when the user can switch between by-type and by-item mode in
|
|
449
|
+
* the internal UI.
|
|
450
|
+
*/
|
|
451
|
+
readonly canSwitchMode: _angular_core.InputSignal<boolean | undefined>;
|
|
452
|
+
/**
|
|
453
|
+
* True when the user can edit the target's gid/label for internal targets.
|
|
454
|
+
*/
|
|
455
|
+
readonly canEditTarget: _angular_core.InputSignal<boolean | undefined>;
|
|
456
|
+
/**
|
|
457
|
+
* The lookup definitions to be used for the by-type lookup in the internal UI.
|
|
458
|
+
* If not specified, the lookup definitions will be got via injection
|
|
459
|
+
* when available; if the injected definitions are empty, the
|
|
460
|
+
* lookup definitions will be built from the model-types thesaurus;
|
|
461
|
+
* if this is not available either, the by-type lookup will be
|
|
462
|
+
* disabled.
|
|
463
|
+
*/
|
|
464
|
+
readonly lookupDefinitions: _angular_core.InputSignal<IndexLookupDefinitions | undefined>;
|
|
465
|
+
/**
|
|
466
|
+
* The default part type key.
|
|
467
|
+
*/
|
|
468
|
+
readonly defaultPartTypeKey: _angular_core.InputSignal<string | undefined>;
|
|
469
|
+
/**
|
|
470
|
+
* True if when a new ID is set it should be internal rather than
|
|
471
|
+
* external by default.
|
|
472
|
+
*/
|
|
473
|
+
readonly internalDefault: _angular_core.InputSignal<boolean | undefined>;
|
|
474
|
+
/**
|
|
475
|
+
* Emitted whenever any ID changes.
|
|
476
|
+
*/
|
|
477
|
+
readonly idsChange: _angular_core.OutputEmitterRef<AssertedCompositeId[]>;
|
|
478
|
+
entries: FormControl<AssertedCompositeId[]>;
|
|
479
|
+
form: FormGroup;
|
|
480
|
+
constructor(formBuilder: FormBuilder, _dialogService: DialogService);
|
|
481
|
+
private updateForm;
|
|
482
|
+
private emitIdsChange;
|
|
483
|
+
addId(): void;
|
|
484
|
+
editId(id: AssertedCompositeId, index: number): void;
|
|
485
|
+
closeId(): void;
|
|
486
|
+
saveId(entry: AssertedCompositeId): void;
|
|
487
|
+
deleteId(index: number): void;
|
|
488
|
+
moveIdUp(index: number): void;
|
|
489
|
+
moveIdDown(index: number): void;
|
|
490
|
+
onIdChange(id?: AssertedCompositeId): void;
|
|
491
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AssertedCompositeIdsComponent, never>;
|
|
492
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AssertedCompositeIdsComponent, "cadmus-refs-asserted-composite-ids", never, { "ids": { "alias": "ids"; "required": false; }; "idScopeEntries": { "alias": "idScopeEntries"; "required": false; "isSignal": true; }; "idTagEntries": { "alias": "idTagEntries"; "required": false; "isSignal": true; }; "assTagEntries": { "alias": "assTagEntries"; "required": false; "isSignal": true; }; "refTypeEntries": { "alias": "refTypeEntries"; "required": false; "isSignal": true; }; "refTagEntries": { "alias": "refTagEntries"; "required": false; "isSignal": true; }; "pinByTypeMode": { "alias": "pinByTypeMode"; "required": false; "isSignal": true; }; "canSwitchMode": { "alias": "canSwitchMode"; "required": false; "isSignal": true; }; "canEditTarget": { "alias": "canEditTarget"; "required": false; "isSignal": true; }; "lookupDefinitions": { "alias": "lookupDefinitions"; "required": false; "isSignal": true; }; "defaultPartTypeKey": { "alias": "defaultPartTypeKey"; "required": false; "isSignal": true; }; "internalDefault": { "alias": "internalDefault"; "required": false; "isSignal": true; }; }, { "idsChange": "idsChange"; }, never, never, true, never>;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export { ASSERTED_COMPOSITE_ID_CONFIGS_KEY, AssertedCompositeIdComponent, AssertedCompositeIdsComponent, AssertedIdComponent, AssertedIdsComponent, ItemRefLookupService, PinRefLookupService, PinTargetLookupComponent, ScopedPinLookupComponent };
|
|
496
|
+
export type { AssertedCompositeId, AssertedId, PinLookupData, PinRefLookupFilter, PinTarget };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrmidon/cadmus-refs-asserted-ids",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Cadmus - asserted IDs components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Cadmus",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"name": "Daniele Fusi"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@angular/common": "^
|
|
19
|
-
"@angular/core": "^
|
|
20
|
-
"@myrmidon/ngx-mat-tools": "^0.0
|
|
21
|
-
"@myrmidon/cadmus-api": "^
|
|
22
|
-
"@myrmidon/cadmus-refs-assertion": "^
|
|
18
|
+
"@angular/common": "^20.0.0",
|
|
19
|
+
"@angular/core": "^20.0.0",
|
|
20
|
+
"@myrmidon/ngx-mat-tools": "^1.0.0",
|
|
21
|
+
"@myrmidon/cadmus-api": "^13.0.0",
|
|
22
|
+
"@myrmidon/cadmus-refs-assertion": "^10.0.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"tslib": "^2.3.0"
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { RamStorageService } from '@myrmidon/ngx-tools';
|
|
4
|
-
import { IndexLookupDefinitions, ThesaurusEntry } from '@myrmidon/cadmus-core';
|
|
5
|
-
import { Assertion } from '@myrmidon/cadmus-refs-assertion';
|
|
6
|
-
import { RefLookupConfig, RefLookupSetEvent } from '@myrmidon/cadmus-refs-lookup';
|
|
7
|
-
import { PinRefLookupService } from '../services/pin-ref-lookup.service';
|
|
8
|
-
import { PinTarget } from '../pin-target-lookup/pin-target-lookup.component';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
/**
|
|
11
|
-
* An asserted composite ID. This can be an external ID, having only the ID value
|
|
12
|
-
* as its target.gid property; or a lookup ID, with a pin-based target.
|
|
13
|
-
* In both cases, we can add a tag, a scope, and an assertion.
|
|
14
|
-
*/
|
|
15
|
-
export interface AssertedCompositeId {
|
|
16
|
-
target: PinTarget;
|
|
17
|
-
tag?: string;
|
|
18
|
-
scope?: string;
|
|
19
|
-
assertion?: Assertion;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* The key to be used to retrieve the external lookup configs from the
|
|
23
|
-
* settings storage. This is equal to the selector of
|
|
24
|
-
* AssertedCompositeIdComponent plus ".configs".
|
|
25
|
-
*/
|
|
26
|
-
export declare const ASSERTED_COMPOSITE_ID_CONFIGS_KEY = "cadmus-refs-asserted-composite-id.configs";
|
|
27
|
-
/**
|
|
28
|
-
* An asserted composite ID editor. This allows the user to edit an asserted
|
|
29
|
-
* composite ID, which can be an external ID or a lookup ID.
|
|
30
|
-
*/
|
|
31
|
-
export declare class AssertedCompositeIdComponent implements OnInit, OnDestroy {
|
|
32
|
-
lookupService: PinRefLookupService;
|
|
33
|
-
lookupDefs: IndexLookupDefinitions;
|
|
34
|
-
private _sub?;
|
|
35
|
-
private _updatingForm;
|
|
36
|
-
extLookupConfigs: RefLookupConfig[];
|
|
37
|
-
targetExpanded: boolean;
|
|
38
|
-
target: FormControl<PinTarget | null>;
|
|
39
|
-
scope: FormControl<string | null>;
|
|
40
|
-
tag: FormControl<string | null>;
|
|
41
|
-
assertion: FormControl<Assertion | null>;
|
|
42
|
-
form: FormGroup;
|
|
43
|
-
readonly idScopeEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
|
|
44
|
-
readonly idTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
|
|
45
|
-
readonly assTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
|
|
46
|
-
readonly refTypeEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
|
|
47
|
-
readonly refTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
|
|
48
|
-
/**
|
|
49
|
-
* The ID being edited.
|
|
50
|
-
*/
|
|
51
|
-
readonly id: import("@angular/core").ModelSignal<AssertedCompositeId | undefined>;
|
|
52
|
-
/**
|
|
53
|
-
* True if when a new ID is set it should be internal rather than
|
|
54
|
-
* external by default.
|
|
55
|
-
*/
|
|
56
|
-
readonly internalDefault: import("@angular/core").InputSignal<boolean | undefined>;
|
|
57
|
-
/**
|
|
58
|
-
* True if the UI has a submit button.
|
|
59
|
-
*/
|
|
60
|
-
readonly hasSubmit: import("@angular/core").InputSignal<boolean | undefined>;
|
|
61
|
-
/**
|
|
62
|
-
* True when the internal UI preselected mode should be by type rather than
|
|
63
|
-
* by item. User can change mode unless modeSwitching is false.
|
|
64
|
-
*/
|
|
65
|
-
readonly pinByTypeMode: import("@angular/core").InputSignal<boolean | undefined>;
|
|
66
|
-
/**
|
|
67
|
-
* True when the user can switch between by-type and by-item mode in
|
|
68
|
-
* the internal UI.
|
|
69
|
-
*/
|
|
70
|
-
readonly canSwitchMode: import("@angular/core").InputSignal<boolean | undefined>;
|
|
71
|
-
/**
|
|
72
|
-
* True when the user can edit the target's gid/label for internal targets.
|
|
73
|
-
*/
|
|
74
|
-
readonly canEditTarget: import("@angular/core").InputSignal<boolean | undefined>;
|
|
75
|
-
/**
|
|
76
|
-
* The lookup definitions to be used for the by-type lookup in the internal UI.
|
|
77
|
-
* If not specified, the lookup definitions will be got via injection
|
|
78
|
-
* when available; if the injected definitions are empty, the
|
|
79
|
-
* lookup definitions will be built from the model-types thesaurus;
|
|
80
|
-
* if this is not available either, the by-type lookup will be
|
|
81
|
-
* disabled.
|
|
82
|
-
*/
|
|
83
|
-
readonly lookupDefinitions: import("@angular/core").InputSignal<IndexLookupDefinitions | undefined>;
|
|
84
|
-
/**
|
|
85
|
-
* The default part type key to be used.
|
|
86
|
-
*/
|
|
87
|
-
readonly defaultPartTypeKey: import("@angular/core").InputSignal<string | undefined>;
|
|
88
|
-
/**
|
|
89
|
-
* Emitted whenever the user requests to close the editor.
|
|
90
|
-
*/
|
|
91
|
-
readonly editorClose: import("@angular/core").OutputEmitterRef<void>;
|
|
92
|
-
/**
|
|
93
|
-
* Emitted when the user requests more.
|
|
94
|
-
*/
|
|
95
|
-
readonly extMoreRequest: import("@angular/core").OutputEmitterRef<RefLookupSetEvent>;
|
|
96
|
-
constructor(formBuilder: FormBuilder, lookupService: PinRefLookupService, lookupDefs: IndexLookupDefinitions, settings: RamStorageService);
|
|
97
|
-
ngOnInit(): void;
|
|
98
|
-
ngOnDestroy(): void;
|
|
99
|
-
onAssertionChange(assertion: Assertion | undefined): void;
|
|
100
|
-
onTargetChange(target?: PinTarget): void;
|
|
101
|
-
private updateForm;
|
|
102
|
-
private getId;
|
|
103
|
-
emitIdChange(): void;
|
|
104
|
-
onEditorClose(): void;
|
|
105
|
-
onExtMoreRequest(event: RefLookupSetEvent): void;
|
|
106
|
-
onExtLookupConfigChange(config: RefLookupConfig): void;
|
|
107
|
-
cancel(): void;
|
|
108
|
-
save(): void;
|
|
109
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AssertedCompositeIdComponent, never>;
|
|
110
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AssertedCompositeIdComponent, "cadmus-refs-asserted-composite-id", never, { "idScopeEntries": { "alias": "idScopeEntries"; "required": false; "isSignal": true; }; "idTagEntries": { "alias": "idTagEntries"; "required": false; "isSignal": true; }; "assTagEntries": { "alias": "assTagEntries"; "required": false; "isSignal": true; }; "refTypeEntries": { "alias": "refTypeEntries"; "required": false; "isSignal": true; }; "refTagEntries": { "alias": "refTagEntries"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "internalDefault": { "alias": "internalDefault"; "required": false; "isSignal": true; }; "hasSubmit": { "alias": "hasSubmit"; "required": false; "isSignal": true; }; "pinByTypeMode": { "alias": "pinByTypeMode"; "required": false; "isSignal": true; }; "canSwitchMode": { "alias": "canSwitchMode"; "required": false; "isSignal": true; }; "canEditTarget": { "alias": "canEditTarget"; "required": false; "isSignal": true; }; "lookupDefinitions": { "alias": "lookupDefinitions"; "required": false; "isSignal": true; }; "defaultPartTypeKey": { "alias": "defaultPartTypeKey"; "required": false; "isSignal": true; }; }, { "id": "idChange"; "editorClose": "editorClose"; "extMoreRequest": "extMoreRequest"; }, never, never, true, never>;
|
|
111
|
-
}
|