@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.
@@ -1,75 +0,0 @@
1
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
2
- import { IndexLookupDefinitions, ThesaurusEntry } from '@myrmidon/cadmus-core';
3
- import { DialogService } from '@myrmidon/ngx-mat-tools';
4
- import { AssertedCompositeId } from '../asserted-composite-id/asserted-composite-id.component';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Asserted composite IDs editor.
8
- */
9
- export declare class AssertedCompositeIdsComponent {
10
- private _dialogService;
11
- private _ids;
12
- private _editedIndex;
13
- edited?: AssertedCompositeId;
14
- /**
15
- * The asserted IDs.
16
- */
17
- get ids(): AssertedCompositeId[];
18
- set ids(value: AssertedCompositeId[]);
19
- readonly idScopeEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
20
- readonly idTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
21
- readonly assTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
22
- readonly refTypeEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
23
- readonly refTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
24
- /**
25
- * True when the internal UI preselected mode should be by type rather than
26
- * by item. User can change mode unless modeSwitching is false.
27
- */
28
- readonly pinByTypeMode: import("@angular/core").InputSignal<boolean | undefined>;
29
- /**
30
- * True when the user can switch between by-type and by-item mode in
31
- * the internal UI.
32
- */
33
- readonly canSwitchMode: import("@angular/core").InputSignal<boolean | undefined>;
34
- /**
35
- * True when the user can edit the target's gid/label for internal targets.
36
- */
37
- readonly canEditTarget: import("@angular/core").InputSignal<boolean | undefined>;
38
- /**
39
- * The lookup definitions to be used for the by-type lookup in the internal UI.
40
- * If not specified, the lookup definitions will be got via injection
41
- * when available; if the injected definitions are empty, the
42
- * lookup definitions will be built from the model-types thesaurus;
43
- * if this is not available either, the by-type lookup will be
44
- * disabled.
45
- */
46
- readonly lookupDefinitions: import("@angular/core").InputSignal<IndexLookupDefinitions | undefined>;
47
- /**
48
- * The default part type key.
49
- */
50
- readonly defaultPartTypeKey: import("@angular/core").InputSignal<string | undefined>;
51
- /**
52
- * True if when a new ID is set it should be internal rather than
53
- * external by default.
54
- */
55
- readonly internalDefault: import("@angular/core").InputSignal<boolean | undefined>;
56
- /**
57
- * Emitted whenever any ID changes.
58
- */
59
- readonly idsChange: import("@angular/core").OutputEmitterRef<AssertedCompositeId[]>;
60
- entries: FormControl<AssertedCompositeId[]>;
61
- form: FormGroup;
62
- constructor(formBuilder: FormBuilder, _dialogService: DialogService);
63
- private updateForm;
64
- private emitIdsChange;
65
- addId(): void;
66
- editId(id: AssertedCompositeId, index: number): void;
67
- closeId(): void;
68
- saveId(entry: AssertedCompositeId): void;
69
- deleteId(index: number): void;
70
- moveIdUp(index: number): void;
71
- moveIdDown(index: number): void;
72
- onIdChange(id?: AssertedCompositeId): void;
73
- static ɵfac: i0.ɵɵFactoryDeclaration<AssertedCompositeIdsComponent, never>;
74
- static ɵcmp: i0.ɵɵ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>;
75
- }
@@ -1,65 +0,0 @@
1
- import { OnDestroy, OnInit } from '@angular/core';
2
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
- import { IndexLookupDefinitions, ThesaurusEntry } from '@myrmidon/cadmus-core';
4
- import { Assertion } from '@myrmidon/cadmus-refs-assertion';
5
- import { PinRefLookupService } from '../services/pin-ref-lookup.service';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * An asserted ID.
9
- */
10
- export interface AssertedId {
11
- tag?: string;
12
- value: string;
13
- label?: string;
14
- scope: string;
15
- assertion?: Assertion;
16
- }
17
- /**
18
- * Asserted ID editor component.
19
- */
20
- export declare class AssertedIdComponent implements OnInit, OnDestroy {
21
- lookupService: PinRefLookupService;
22
- lookupDefs: IndexLookupDefinitions;
23
- private _sub?;
24
- private _updatingForm;
25
- tag: FormControl<string | null>;
26
- value: FormControl<string | null>;
27
- label: FormControl<string | null>;
28
- scope: FormControl<string | null>;
29
- assertion: FormControl<Assertion | null>;
30
- form: FormGroup;
31
- lookupExpanded: boolean;
32
- readonly idScopeEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
33
- readonly idTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
34
- readonly assTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
35
- readonly refTypeEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
36
- readonly refTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
37
- /**
38
- * The asserted ID being edited.
39
- */
40
- readonly id: import("@angular/core").ModelSignal<AssertedId | undefined>;
41
- /**
42
- * True to hide the pin-based EID lookup UI.
43
- */
44
- readonly noEidLookup: import("@angular/core").InputSignal<boolean | undefined>;
45
- /**
46
- * True to show the submit button.
47
- */
48
- readonly hasSubmit: import("@angular/core").InputSignal<boolean | undefined>;
49
- /**
50
- * Emitted when the editor is closed.
51
- */
52
- readonly editorClose: import("@angular/core").OutputEmitterRef<void>;
53
- constructor(formBuilder: FormBuilder, lookupService: PinRefLookupService, lookupDefs: IndexLookupDefinitions);
54
- ngOnInit(): void;
55
- ngOnDestroy(): void;
56
- onAssertionChange(assertion: Assertion | undefined): void;
57
- onIdPick(id: string): void;
58
- private updateForm;
59
- private getId;
60
- emitIdChange(): void;
61
- cancel(): void;
62
- save(): void;
63
- static ɵfac: i0.ɵɵFactoryDeclaration<AssertedIdComponent, never>;
64
- static ɵcmp: i0.ɵɵ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>;
65
- }
@@ -1,36 +0,0 @@
1
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
2
- import { ThesaurusEntry } from '@myrmidon/cadmus-core';
3
- import { DialogService } from '@myrmidon/ngx-mat-tools';
4
- import { AssertedId } from '../asserted-id/asserted-id.component';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Asserted IDs editor.
8
- */
9
- export declare class AssertedIdsComponent {
10
- private _dialogService;
11
- private _editedIndex;
12
- edited?: AssertedId;
13
- /**
14
- * The asserted IDs.
15
- */
16
- readonly ids: import("@angular/core").ModelSignal<AssertedId[]>;
17
- readonly idScopeEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
18
- readonly idTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
19
- readonly assTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
20
- readonly refTypeEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
21
- readonly refTagEntries: import("@angular/core").InputSignal<ThesaurusEntry[] | undefined>;
22
- entries: FormControl<AssertedId[]>;
23
- form: FormGroup;
24
- constructor(formBuilder: FormBuilder, _dialogService: DialogService);
25
- private updateForm;
26
- addId(): void;
27
- editId(id: AssertedId, index: number): void;
28
- closeId(): void;
29
- saveId(entry: AssertedId): void;
30
- deleteId(index: number): void;
31
- moveIdUp(index: number): void;
32
- moveIdDown(index: number): void;
33
- onIdChange(id?: AssertedId): void;
34
- static ɵfac: i0.ɵɵFactoryDeclaration<AssertedIdsComponent, never>;
35
- static ɵcmp: i0.ɵɵ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>;
36
- }
@@ -1,156 +0,0 @@
1
- import { OnDestroy, OnInit } from '@angular/core';
2
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
- import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
4
- import { DataPinInfo, IndexLookupDefinition, IndexLookupDefinitions, Item, Part, ThesaurusEntry } from '@myrmidon/cadmus-core';
5
- import { MatSnackBar } from '@angular/material/snack-bar';
6
- import { RefLookupConfig, RefLookupSetEvent } from '@myrmidon/cadmus-refs-lookup';
7
- import { PinRefLookupFilter, PinRefLookupService } from '../services/pin-ref-lookup.service';
8
- import { ItemRefLookupService } from '../services/item-ref-lookup.service';
9
- import * as i0 from "@angular/core";
10
- interface MetadataPart extends Part {
11
- metadata: {
12
- type?: string;
13
- name: string;
14
- value: string;
15
- }[];
16
- }
17
- /**
18
- * Pin lookup data used internally by the component.
19
- */
20
- export interface PinLookupData {
21
- pin: DataPinInfo;
22
- item?: Item;
23
- metaPart?: MetadataPart;
24
- }
25
- /**
26
- * A pin-based target. This includes pin's name and value, and
27
- * the item's ID and optional part IDs. The label is a user friendly
28
- * string representation of the target, while the gid is a globally
29
- * unique identifier for the target.
30
- */
31
- export interface PinTarget {
32
- gid: string;
33
- label: string;
34
- itemId?: string;
35
- partId?: string;
36
- partTypeId?: string;
37
- roleId?: string;
38
- name?: string;
39
- value?: string;
40
- }
41
- export declare class PinTargetLookupComponent implements OnInit, OnDestroy {
42
- private _presetLookupDefs;
43
- itemLookupService: ItemRefLookupService;
44
- pinLookupService: PinRefLookupService;
45
- private _itemService;
46
- private _thesService;
47
- private _snackbar;
48
- private readonly _subs;
49
- private _noTargetUpdate?;
50
- private _noFormUpdate?;
51
- private _startWithByTypeMode?;
52
- /**
53
- * True when the by-type pin lookup mode is active.
54
- * User can change mode unless modeSwitching is false.
55
- */
56
- readonly pinByTypeMode: import("@angular/core").ModelSignal<boolean | undefined>;
57
- /**
58
- * True when the user can switch between by-type and by-item mode.
59
- */
60
- readonly canSwitchMode: import("@angular/core").ModelSignal<boolean | undefined>;
61
- /**
62
- * True when the user can edit the target's gid/label for internal
63
- * targets.
64
- */
65
- readonly canEditTarget: import("@angular/core").InputSignal<boolean | undefined>;
66
- /**
67
- * The lookup definitions to be used for the by-type lookup. If
68
- * not specified, the lookup definitions will be got via injection
69
- * when available; if the injected definitions are empty, the
70
- * lookup definitions will be built from the model-types thesaurus;
71
- * if this is not available either, the by-type lookup will be
72
- * disabled.
73
- */
74
- readonly lookupDefinitions: import("@angular/core").ModelSignal<IndexLookupDefinitions | undefined>;
75
- /**
76
- * The optional configurations for using external lookup services.
77
- */
78
- readonly extLookupConfigs: import("@angular/core").InputSignal<RefLookupConfig[]>;
79
- /**
80
- * True if when a new target is set it should be internal rather than
81
- * external by default.
82
- */
83
- readonly internalDefault: import("@angular/core").InputSignal<boolean | undefined>;
84
- /**
85
- * The target to be edited.
86
- */
87
- readonly target: import("@angular/core").ModelSignal<PinTarget | undefined>;
88
- /**
89
- * The default value for part type key when the by-type mode is active.
90
- */
91
- readonly defaultPartTypeKey: import("@angular/core").InputSignal<string | undefined>;
92
- /**
93
- * Emitted when user closes the editor.
94
- */
95
- readonly editorClose: import("@angular/core").OutputEmitterRef<void>;
96
- /**
97
- * Emitted when the user requests more items from an external lookup.
98
- */
99
- readonly extMoreRequest: import("@angular/core").OutputEmitterRef<RefLookupSetEvent>;
100
- /**
101
- * Emitted when the user changes the external lookup configuration.
102
- */
103
- readonly extLookupConfigChange: import("@angular/core").OutputEmitterRef<RefLookupConfig>;
104
- modelEntries: ThesaurusEntry[];
105
- partTypeKeys: string[];
106
- itemParts: Part[];
107
- item: FormControl<Item | null>;
108
- itemPart: FormControl<Part | null>;
109
- partTypeKey: FormControl<string | null>;
110
- gid: FormControl<string | null>;
111
- label: FormControl<string | null>;
112
- byTypeMode: FormControl<boolean>;
113
- external: FormControl<boolean>;
114
- form: FormGroup;
115
- filter: PinRefLookupFilter;
116
- pinFilterOptions?: IndexLookupDefinition;
117
- lookupData?: PinLookupData;
118
- constructor(_presetLookupDefs: IndexLookupDefinitions, itemLookupService: ItemRefLookupService, pinLookupService: PinRefLookupService, _itemService: ItemService, _thesService: ThesaurusService, _snackbar: MatSnackBar, formBuilder: FormBuilder);
119
- private forceByItem;
120
- private setupKeys;
121
- ngOnInit(): void;
122
- ngOnDestroy(): void;
123
- private buildGid;
124
- private buildLabel;
125
- private getTarget;
126
- private emitChange;
127
- private updateTarget;
128
- private updateForm;
129
- /**
130
- * Called when the item lookup changes (item is looked up
131
- * by its title).
132
- *
133
- * @param item The item got from lookup.
134
- */
135
- onItemLookupChange(item: unknown): void;
136
- private loadItemInfo;
137
- /**
138
- * Called when the pin lookup change. A pin is looked up by its
139
- * name and value (=the filter's text), and optionally by:
140
- * - its index lookup definition (selected by partTypeKey).
141
- * - its item (defined by item, in filter).
142
- * - its part (defined by itemPart, in filter).
143
- *
144
- * @param info The pin info from pin lookup.
145
- */
146
- onPinLookupChange(info: unknown): void;
147
- onExtItemChange(event: RefLookupSetEvent): void;
148
- onExtMoreRequest(event: RefLookupSetEvent): void;
149
- onCopied(): void;
150
- onExtConfigChange(config: RefLookupConfig): void;
151
- close(): void;
152
- save(): void;
153
- static ɵfac: i0.ɵɵFactoryDeclaration<PinTargetLookupComponent, never>;
154
- static ɵcmp: i0.ɵɵ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>;
155
- }
156
- export {};
@@ -1,41 +0,0 @@
1
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
2
- import { ItemService } from '@myrmidon/cadmus-api';
3
- import { DataPinInfo, IndexLookupDefinitions, Item, Part } from '@myrmidon/cadmus-core';
4
- import { PinRefLookupService } from '../services/pin-ref-lookup.service';
5
- import * as i0 from "@angular/core";
6
- interface MetadataPart extends Part {
7
- metadata: {
8
- type?: string;
9
- name: string;
10
- value: string;
11
- }[];
12
- }
13
- interface LookupInfo {
14
- pin: DataPinInfo;
15
- item?: Item;
16
- part?: MetadataPart;
17
- }
18
- export declare class ScopedPinLookupComponent {
19
- private _itemService;
20
- lookupService: PinRefLookupService;
21
- lookupDefs: IndexLookupDefinitions;
22
- key: FormControl<string | null>;
23
- keyForm: FormGroup;
24
- keys: string[];
25
- info?: LookupInfo;
26
- id: FormControl<string | null>;
27
- idForm: FormGroup;
28
- /**
29
- * Emitted whenever the user picks an ID.
30
- */
31
- readonly idPick: import("@angular/core").OutputEmitterRef<string>;
32
- constructor(formBuilder: FormBuilder, _itemService: ItemService, lookupService: PinRefLookupService, lookupDefs: IndexLookupDefinitions);
33
- ngOnInit(): void;
34
- onItemChange(item: unknown): void;
35
- appendIdComponent(type: string, metaIndex?: number): void;
36
- pickId(): void;
37
- resetId(): void;
38
- static ɵfac: i0.ɵɵFactoryDeclaration<ScopedPinLookupComponent, never>;
39
- static ɵcmp: i0.ɵɵComponentDeclaration<ScopedPinLookupComponent, "cadmus-scoped-pin-lookup", never, {}, { "idPick": "idPick"; }, never, never, true, never>;
40
- }
41
- export {};
@@ -1,13 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { ItemService } from '@myrmidon/cadmus-api';
3
- import { Item } from '@myrmidon/cadmus-core';
4
- import { RefLookupFilter, RefLookupService } from '@myrmidon/cadmus-refs-lookup';
5
- import * as i0 from "@angular/core";
6
- export declare class ItemRefLookupService implements RefLookupService {
7
- private _itemService;
8
- constructor(_itemService: ItemService);
9
- lookup(filter: RefLookupFilter, options?: any): Observable<Item[]>;
10
- getName(item: Item): string;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<ItemRefLookupService, never>;
12
- static ɵprov: i0.ɵɵInjectableDeclaration<ItemRefLookupService>;
13
- }
@@ -1,27 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { ItemService } from '@myrmidon/cadmus-api';
3
- import { RefLookupFilter, RefLookupService } from '@myrmidon/cadmus-refs-lookup';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Pin-based lookup filter. This is a RefLookupFilter with the addition
7
- * of the item ID and part ID, which are used to filter the results
8
- * by the ItemPinLookupComponent.
9
- */
10
- export interface PinRefLookupFilter extends RefLookupFilter {
11
- itemId?: string;
12
- partId?: string;
13
- }
14
- /**
15
- * Cadmus pin-based lookup data service. The text being searched here is just
16
- * the pin's value, according to the options specified. These options correspond
17
- * to an index lookup definition. The resulting items are of type DataPinInfo.
18
- */
19
- export declare class PinRefLookupService implements RefLookupService {
20
- private _itemService;
21
- constructor(_itemService: ItemService);
22
- getName(item: any | undefined): string;
23
- private buildQuery;
24
- lookup(filter: PinRefLookupFilter, options?: any): Observable<any[]>;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<PinRefLookupService, never>;
26
- static ɵprov: i0.ɵɵInjectableDeclaration<PinRefLookupService>;
27
- }
package/public-api.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from './lib/asserted-id/asserted-id.component';
2
- export * from './lib/asserted-ids/asserted-ids.component';
3
- export * from './lib/scoped-pin-lookup/scoped-pin-lookup.component';
4
- export * from './lib/asserted-composite-id/asserted-composite-id.component';
5
- export * from './lib/asserted-composite-ids/asserted-composite-ids.component';
6
- export * from './lib/pin-target-lookup/pin-target-lookup.component';
7
- export * from './lib/services/pin-ref-lookup.service';
8
- export * from './lib/services/item-ref-lookup.service';