@myrmidon/cadmus-refs-asserted-ids 1.0.9 → 2.1.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.
Files changed (36) hide show
  1. package/README.md +96 -96
  2. package/esm2022/lib/asserted-composite-id/asserted-composite-id.component.mjs +142 -0
  3. package/esm2022/lib/asserted-composite-ids/asserted-composite-ids.component.mjs +154 -0
  4. package/esm2022/lib/asserted-id/asserted-id.component.mjs +133 -0
  5. package/esm2022/lib/asserted-ids/asserted-ids.component.mjs +147 -0
  6. package/esm2022/lib/cadmus-refs-asserted-ids.module.mjs +122 -0
  7. package/esm2022/lib/pin-target-lookup/pin-target-lookup.component.mjs +405 -0
  8. package/esm2022/lib/scoped-pin-lookup/scoped-pin-lookup.component.mjs +130 -0
  9. package/esm2022/lib/services/item-ref-lookup.service.mjs +29 -0
  10. package/esm2022/lib/services/pin-ref-lookup.service.mjs +85 -0
  11. package/{esm2020 → esm2022}/myrmidon-cadmus-refs-asserted-ids.mjs +4 -4
  12. package/esm2022/public-api.mjs +13 -0
  13. package/fesm2022/myrmidon-cadmus-refs-asserted-ids.mjs +1265 -0
  14. package/fesm2022/myrmidon-cadmus-refs-asserted-ids.mjs.map +1 -0
  15. package/index.d.ts +5 -5
  16. package/lib/asserted-composite-id/asserted-composite-id.component.d.ts +83 -0
  17. package/lib/asserted-composite-ids/asserted-composite-ids.component.d.ts +67 -0
  18. package/lib/asserted-id/asserted-id.component.d.ts +49 -49
  19. package/lib/asserted-ids/asserted-ids.component.d.ts +44 -44
  20. package/lib/cadmus-refs-asserted-ids.module.d.ts +28 -22
  21. package/lib/pin-target-lookup/pin-target-lookup.component.d.ts +139 -0
  22. package/lib/scoped-pin-lookup/scoped-pin-lookup.component.d.ts +39 -39
  23. package/lib/services/item-ref-lookup.service.d.ts +13 -0
  24. package/lib/services/pin-ref-lookup.service.d.ts +27 -18
  25. package/package.json +8 -14
  26. package/public-api.d.ts +9 -5
  27. package/esm2020/lib/asserted-id/asserted-id.component.mjs +0 -132
  28. package/esm2020/lib/asserted-ids/asserted-ids.component.mjs +0 -146
  29. package/esm2020/lib/cadmus-refs-asserted-ids.module.mjs +0 -91
  30. package/esm2020/lib/scoped-pin-lookup/scoped-pin-lookup.component.mjs +0 -129
  31. package/esm2020/lib/services/pin-ref-lookup.service.mjs +0 -72
  32. package/esm2020/public-api.mjs +0 -9
  33. package/fesm2015/myrmidon-cadmus-refs-asserted-ids.mjs +0 -554
  34. package/fesm2015/myrmidon-cadmus-refs-asserted-ids.mjs.map +0 -1
  35. package/fesm2020/myrmidon-cadmus-refs-asserted-ids.mjs +0 -547
  36. package/fesm2020/myrmidon-cadmus-refs-asserted-ids.mjs.map +0 -1
@@ -1,554 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, Inject, Output, Input, NgModule } from '@angular/core';
3
- import * as i1$1 from '@angular/forms';
4
- import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import { debounceTime } from 'rxjs/operators';
6
- import { of, map, forkJoin, take } from 'rxjs';
7
- import * as i1 from '@myrmidon/cadmus-api';
8
- import { CadmusApiModule } from '@myrmidon/cadmus-api';
9
- import * as i3 from '@angular/common';
10
- import { CommonModule } from '@angular/common';
11
- import * as i4 from '@angular/material/button';
12
- import { MatButtonModule } from '@angular/material/button';
13
- import * as i5 from '@angular/material/expansion';
14
- import { MatExpansionModule } from '@angular/material/expansion';
15
- import * as i7 from '@angular/material/form-field';
16
- import { MatFormFieldModule } from '@angular/material/form-field';
17
- import * as i8 from '@angular/material/icon';
18
- import { MatIconModule } from '@angular/material/icon';
19
- import * as i9 from '@angular/material/input';
20
- import { MatInputModule } from '@angular/material/input';
21
- import * as i10 from '@angular/material/select';
22
- import { MatSelectModule } from '@angular/material/select';
23
- import * as i11 from '@angular/material/core';
24
- import * as i11$1 from '@myrmidon/cadmus-refs-assertion';
25
- import { CadmusRefsAssertionModule } from '@myrmidon/cadmus-refs-assertion';
26
- import * as i12 from '@myrmidon/cadmus-refs-lookup';
27
- import { CadmusRefsLookupModule } from '@myrmidon/cadmus-refs-lookup';
28
- import * as i2 from '@myrmidon/ng-mat-tools';
29
- import { CadmusCoreModule } from '@myrmidon/cadmus-core';
30
- import { CadmusRefsDocReferencesModule } from '@myrmidon/cadmus-refs-doc-references';
31
-
32
- /**
33
- * Cadmus pin-based lookup data service. The text being searched here is just
34
- * the pin's value, according to the options specified. These options correspond
35
- * to an index lookup definition. The resulting items are of type DataPinInfo.
36
- */
37
- class PinRefLookupService {
38
- constructor(_itemService) {
39
- this._itemService = _itemService;
40
- }
41
- getName(item) {
42
- return (item === null || item === void 0 ? void 0 : item.value) || '';
43
- }
44
- buildQuery(def, text) {
45
- const sb = [];
46
- const AND = ' AND ';
47
- if (def.typeId) {
48
- sb.push(`[partTypeId=${def.typeId}]`);
49
- }
50
- if (def.roleId) {
51
- if (sb.length) {
52
- sb.push(AND);
53
- }
54
- sb.push(`[roleId=${def.roleId}]`);
55
- }
56
- if (def.name) {
57
- if (sb.length) {
58
- sb.push(AND);
59
- }
60
- sb.push(`[name=${def.name}]`);
61
- }
62
- if (text) {
63
- if (sb.length) {
64
- sb.push(AND);
65
- }
66
- // for other operators see backend SqlQueryBuilderBase.cs
67
- sb.push(`[value*=${text}]`); // *= is "contains"
68
- }
69
- return sb.join('');
70
- }
71
- lookup(filter, options) {
72
- // the index lookup definition is required
73
- const def = options;
74
- if (!def) {
75
- return of([]);
76
- }
77
- // build the corresponding pin query
78
- const query = this.buildQuery(def, filter.text);
79
- // search the index
80
- return this._itemService.searchPins(query, 1, filter.limit).pipe(map((w) => {
81
- var _a;
82
- if (w.error) {
83
- console.error(w.error);
84
- return [];
85
- }
86
- else {
87
- return ((_a = w.value) === null || _a === void 0 ? void 0 : _a.items) || [];
88
- }
89
- }));
90
- }
91
- }
92
- PinRefLookupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: PinRefLookupService, deps: [{ token: i1.ItemService }], target: i0.ɵɵFactoryTarget.Injectable });
93
- PinRefLookupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: PinRefLookupService, providedIn: 'root' });
94
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: PinRefLookupService, decorators: [{
95
- type: Injectable,
96
- args: [{
97
- providedIn: 'root',
98
- }]
99
- }], ctorParameters: function () { return [{ type: i1.ItemService }]; } });
100
-
101
- // from Cadmus general parts
102
- const METADATA_PART_ID = 'it.vedph.metadata';
103
- /*
104
- * Scoped pin-based lookup component. This component provides a list
105
- * of pin-based searches, with a lookup control. Whenever the user
106
- * picks a pin value, he gets the details about its item and part, and
107
- * item's metadata part, if any. He can then use these data to build
108
- * some EID by variously assembling these components.
109
- */
110
- class ScopedPinLookupComponent {
111
- constructor(formBuilder, _itemService, lookupService, lookupDefs) {
112
- this._itemService = _itemService;
113
- this.lookupService = lookupService;
114
- this.lookupDefs = lookupDefs;
115
- // lookup
116
- // keys are all the defined lookup searches
117
- this.keys = Object.keys(lookupDefs);
118
- // the selected key defines the lookup scope
119
- this.key = formBuilder.control(null);
120
- this.keyForm = formBuilder.group({
121
- key: this.key,
122
- });
123
- // id
124
- this.id = formBuilder.control(null, [
125
- Validators.required,
126
- Validators.maxLength(300),
127
- ]);
128
- this.idForm = formBuilder.group({
129
- id: this.id,
130
- });
131
- // event
132
- this.idPick = new EventEmitter();
133
- }
134
- ngOnInit() {
135
- // pre-select a unique key
136
- if (this.keys.length === 1) {
137
- this.key.setValue(this.keys[0]);
138
- this.key.markAsDirty();
139
- this.key.updateValueAndValidity();
140
- }
141
- }
142
- onItemChange(item) {
143
- const info = {
144
- pin: item,
145
- };
146
- // lookup item and its metadata part if any
147
- forkJoin({
148
- item: this._itemService.getItem(item.itemId, false),
149
- part: this._itemService.getPartFromTypeAndRole(item.itemId, METADATA_PART_ID),
150
- })
151
- .pipe(take(1))
152
- .subscribe({
153
- next: (result) => {
154
- info.item = result.item;
155
- info.part = result.part;
156
- this.info = info;
157
- },
158
- error: (error) => {
159
- console.error(error ? JSON.stringify(error) : 'Error loading item/metadata');
160
- },
161
- });
162
- }
163
- appendIdComponent(type, metaIndex = -1) {
164
- var _a, _b, _c, _d, _e;
165
- let id = this.id.value || '';
166
- switch (type) {
167
- case 'pin':
168
- id += (_a = this.info) === null || _a === void 0 ? void 0 : _a.pin.value;
169
- break;
170
- case 'itemId':
171
- id += ((_b = this.info.item) === null || _b === void 0 ? void 0 : _b.id) || '';
172
- break;
173
- case 'partId':
174
- id += ((_c = this.info.part) === null || _c === void 0 ? void 0 : _c.id) || '';
175
- break;
176
- case 'partTypeId':
177
- id += ((_d = this.info.part) === null || _d === void 0 ? void 0 : _d.typeId) || '';
178
- break;
179
- case 'partRoleId':
180
- id += ((_e = this.info.part) === null || _e === void 0 ? void 0 : _e.roleId) || '';
181
- break;
182
- case 'metadata':
183
- id += this.info.part.metadata[metaIndex].value;
184
- break;
185
- }
186
- this.id.setValue(id);
187
- this.id.markAsDirty();
188
- this.id.updateValueAndValidity();
189
- }
190
- pickId() {
191
- if (this.idForm.invalid) {
192
- return;
193
- }
194
- this.idPick.emit(this.id.value);
195
- this.info = undefined;
196
- }
197
- resetId() {
198
- this.id.reset();
199
- this.id.markAsDirty();
200
- this.id.updateValueAndValidity();
201
- }
202
- }
203
- ScopedPinLookupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: ScopedPinLookupComponent, deps: [{ token: i1$1.FormBuilder }, { token: i1.ItemService }, { token: PinRefLookupService }, { token: 'indexLookupDefinitions' }], target: i0.ɵɵFactoryTarget.Component });
204
- ScopedPinLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.3", type: ScopedPinLookupComponent, selector: "cadmus-scoped-pin-lookup", outputs: { idPick: "idPick" }, ngImport: i0, template: "<div>\n <!-- lookup -->\n <div>\n <form [formGroup]=\"keyForm\" class=\"form-row\">\n <!-- key -->\n <mat-form-field *ngIf=\"keys.length > 1\">\n <mat-label>type</mat-label>\n <mat-select [formControl]=\"key\">\n <mat-option *ngFor=\"let k of keys\" [value]=\"k\">{{ k }}</mat-option>\n </mat-select>\n <mat-error\n *ngIf=\"$any(key).errors?.required && (key.dirty || key.touched)\"\n >type required</mat-error\n >\n </mat-form-field>\n <cadmus-ref-lookup\n [service]=\"lookupService\"\n label=\"pin\"\n [options]=\"key.value ? lookupDefs[key.value] : undefined\"\n (itemChange)=\"onItemChange($event)\"\n ></cadmus-ref-lookup>\n </form>\n </div>\n\n <!-- builder -->\n <mat-expansion-panel *ngIf=\"info\" [expanded]=\"info\" [disabled]=\"!info\">\n <mat-expansion-panel-header>ID builder</mat-expansion-panel-header>\n <!-- ID -->\n <div>\n <form [formGroup]=\"idForm\" (submit)=\"pickId()\">\n <mat-form-field style=\"width: 100%\">\n <input matInput [formControl]=\"id\" />\n <mat-error\n *ngIf=\"$any(id).errors?.required && (id.dirty || id.touched)\"\n >ID required</mat-error\n >\n <mat-error\n *ngIf=\"$any(id).errors?.maxLength && (id.dirty || id.touched)\"\n >ID too long</mat-error\n >\n <button\n mat-icon-button\n type=\"button\"\n matSuffix\n (click)=\"resetId()\"\n [disabled]=\"!id.value\"\n >\n <mat-icon color=\"warn\">close</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matSuffix\n (click)=\"pickId()\"\n [disabled]=\"idForm.invalid\"\n >\n <mat-icon color=\"primary\">check_circle</mat-icon>\n </button>\n </mat-form-field>\n </form>\n </div>\n <!-- table -->\n <table>\n <thead>\n <th></th>\n <th>source</th>\n <th>value</th>\n </thead>\n <tbody>\n <!-- pin -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('pin')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>pin</td>\n <td>{{ info!.pin.value }}</td>\n </tr>\n <!-- item ID -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('itemId')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>item ID</td>\n <td>{{ info!.item?.id }}</td>\n </tr>\n <!-- item title -->\n <tr>\n <td></td>\n <td>item title</td>\n <td>{{ info!.item?.title }}</td>\n </tr>\n <!-- part ID -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('partId')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>part ID</td>\n <td>{{ info!.part?.id }}</td>\n </tr>\n <!-- part type ID -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('partTypeId')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>part type ID</td>\n <td>{{ info!.part?.typeId }}</td>\n </tr>\n <!-- part role ID -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('partRoleId')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>part role ID</td>\n <td>{{ info!.part?.roleId }}</td>\n </tr>\n\n <!-- part's metadata -->\n <tr *ngFor=\"let m of info!.part?.metadata; let i = index\">\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('metadata', i)\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td class=\"metadata\">{{ m.name }}</td>\n <td class=\"metadata\">{{ m.value }}</td>\n </tr>\n </tbody>\n </table>\n </mat-expansion-panel>\n</div>\n", styles: [".metadata{color:#4a3001}table{border:1px solid silver;border-radius:6px;padding:4px;margin-top:8px}tr:nth-child(odd){background-color:#f0f0f0}th{font-weight:400;text-align:left;color:silver}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i7.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i7.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i12.RefLookupComponent, selector: "cadmus-ref-lookup", inputs: ["label", "limit", "baseFilter", "service", "item", "required", "hasMore", "linkTemplate", "optDialog", "options"], outputs: ["itemChange", "moreRequest"] }] });
205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: ScopedPinLookupComponent, decorators: [{
206
- type: Component,
207
- args: [{ selector: 'cadmus-scoped-pin-lookup', template: "<div>\n <!-- lookup -->\n <div>\n <form [formGroup]=\"keyForm\" class=\"form-row\">\n <!-- key -->\n <mat-form-field *ngIf=\"keys.length > 1\">\n <mat-label>type</mat-label>\n <mat-select [formControl]=\"key\">\n <mat-option *ngFor=\"let k of keys\" [value]=\"k\">{{ k }}</mat-option>\n </mat-select>\n <mat-error\n *ngIf=\"$any(key).errors?.required && (key.dirty || key.touched)\"\n >type required</mat-error\n >\n </mat-form-field>\n <cadmus-ref-lookup\n [service]=\"lookupService\"\n label=\"pin\"\n [options]=\"key.value ? lookupDefs[key.value] : undefined\"\n (itemChange)=\"onItemChange($event)\"\n ></cadmus-ref-lookup>\n </form>\n </div>\n\n <!-- builder -->\n <mat-expansion-panel *ngIf=\"info\" [expanded]=\"info\" [disabled]=\"!info\">\n <mat-expansion-panel-header>ID builder</mat-expansion-panel-header>\n <!-- ID -->\n <div>\n <form [formGroup]=\"idForm\" (submit)=\"pickId()\">\n <mat-form-field style=\"width: 100%\">\n <input matInput [formControl]=\"id\" />\n <mat-error\n *ngIf=\"$any(id).errors?.required && (id.dirty || id.touched)\"\n >ID required</mat-error\n >\n <mat-error\n *ngIf=\"$any(id).errors?.maxLength && (id.dirty || id.touched)\"\n >ID too long</mat-error\n >\n <button\n mat-icon-button\n type=\"button\"\n matSuffix\n (click)=\"resetId()\"\n [disabled]=\"!id.value\"\n >\n <mat-icon color=\"warn\">close</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matSuffix\n (click)=\"pickId()\"\n [disabled]=\"idForm.invalid\"\n >\n <mat-icon color=\"primary\">check_circle</mat-icon>\n </button>\n </mat-form-field>\n </form>\n </div>\n <!-- table -->\n <table>\n <thead>\n <th></th>\n <th>source</th>\n <th>value</th>\n </thead>\n <tbody>\n <!-- pin -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('pin')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>pin</td>\n <td>{{ info!.pin.value }}</td>\n </tr>\n <!-- item ID -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('itemId')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>item ID</td>\n <td>{{ info!.item?.id }}</td>\n </tr>\n <!-- item title -->\n <tr>\n <td></td>\n <td>item title</td>\n <td>{{ info!.item?.title }}</td>\n </tr>\n <!-- part ID -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('partId')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>part ID</td>\n <td>{{ info!.part?.id }}</td>\n </tr>\n <!-- part type ID -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('partTypeId')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>part type ID</td>\n <td>{{ info!.part?.typeId }}</td>\n </tr>\n <!-- part role ID -->\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('partRoleId')\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td>part role ID</td>\n <td>{{ info!.part?.roleId }}</td>\n </tr>\n\n <!-- part's metadata -->\n <tr *ngFor=\"let m of info!.part?.metadata; let i = index\">\n <td>\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n (click)=\"appendIdComponent('metadata', i)\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td class=\"metadata\">{{ m.name }}</td>\n <td class=\"metadata\">{{ m.value }}</td>\n </tr>\n </tbody>\n </table>\n </mat-expansion-panel>\n</div>\n", styles: [".metadata{color:#4a3001}table{border:1px solid silver;border-radius:6px;padding:4px;margin-top:8px}tr:nth-child(odd){background-color:#f0f0f0}th{font-weight:400;text-align:left;color:silver}\n"] }]
208
- }], ctorParameters: function () {
209
- return [{ type: i1$1.FormBuilder }, { type: i1.ItemService }, { type: PinRefLookupService }, { type: undefined, decorators: [{
210
- type: Inject,
211
- args: ['indexLookupDefinitions']
212
- }] }];
213
- }, propDecorators: { idPick: [{
214
- type: Output
215
- }] } });
216
-
217
- class AssertedIdComponent {
218
- constructor(formBuilder, lookupService, lookupDefs) {
219
- this.lookupService = lookupService;
220
- this.lookupDefs = lookupDefs;
221
- this.tag = formBuilder.control(null, Validators.maxLength(50));
222
- this.value = formBuilder.control(null, [
223
- Validators.required,
224
- Validators.maxLength(500),
225
- ]);
226
- this.scope = formBuilder.control(null, Validators.maxLength(500));
227
- this.assertion = formBuilder.control(null);
228
- this.form = formBuilder.group({
229
- tag: this.tag,
230
- value: this.value,
231
- scope: this.scope,
232
- assertion: this.assertion
233
- });
234
- this.lookupExpanded = false;
235
- // events
236
- this.idChange = new EventEmitter();
237
- this.editorClose = new EventEmitter();
238
- }
239
- get id() {
240
- return this._id;
241
- }
242
- set id(value) {
243
- if (this._id !== value) {
244
- this._id = value || undefined;
245
- this.updateForm(this._id);
246
- }
247
- }
248
- ngOnInit() {
249
- this.form.valueChanges.pipe(debounceTime(300)).subscribe((_) => {
250
- if (!this._updatingForm) {
251
- this.emitIdChange();
252
- }
253
- });
254
- }
255
- onAssertionChange(assertion) {
256
- this.assertion.setValue(assertion || null);
257
- }
258
- onIdPick(id) {
259
- this.value.setValue(id);
260
- this.value.markAsDirty();
261
- this.value.updateValueAndValidity();
262
- this.lookupExpanded = false;
263
- }
264
- updateForm(value) {
265
- this._updatingForm = true;
266
- if (!value) {
267
- this.form.reset();
268
- }
269
- else {
270
- this.tag.setValue(value.tag || null);
271
- this.value.setValue(value.value);
272
- this.scope.setValue(value.scope);
273
- this.assertion.setValue(value.assertion || null);
274
- this.form.markAsPristine();
275
- }
276
- this._updatingForm = false;
277
- // this.emitIdChange();
278
- }
279
- getId() {
280
- var _a, _b, _c;
281
- return {
282
- tag: (_a = this.tag.value) === null || _a === void 0 ? void 0 : _a.trim(),
283
- value: ((_b = this.value.value) === null || _b === void 0 ? void 0 : _b.trim()) || '',
284
- scope: ((_c = this.scope.value) === null || _c === void 0 ? void 0 : _c.trim()) || '',
285
- assertion: this.assertion.value || undefined,
286
- };
287
- }
288
- emitIdChange() {
289
- if (!this.hasSubmit) {
290
- this._id = this.getId();
291
- this.idChange.emit(this._id);
292
- }
293
- }
294
- cancel() {
295
- this.editorClose.emit();
296
- }
297
- save() {
298
- if (this.form.valid) {
299
- this._id = this.getId();
300
- this.idChange.emit(this._id);
301
- }
302
- }
303
- }
304
- AssertedIdComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: AssertedIdComponent, deps: [{ token: i1$1.FormBuilder }, { token: PinRefLookupService }, { token: 'indexLookupDefinitions' }], target: i0.ɵɵFactoryTarget.Component });
305
- AssertedIdComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.3", type: AssertedIdComponent, selector: "cadmus-refs-asserted-id", inputs: { idScopeEntries: "idScopeEntries", idTagEntries: "idTagEntries", assTagEntries: "assTagEntries", refTypeEntries: "refTypeEntries", refTagEntries: "refTagEntries", id: "id", noEidLookup: "noEidLookup", hasSubmit: "hasSubmit" }, outputs: { idChange: "idChange", editorClose: "editorClose" }, ngImport: i0, template: "<form [formGroup]=\"form\" (submit)=\"save()\">\n <div>\n <div class=\"form-row\">\n <!-- tag (bound) -->\n <mat-form-field *ngIf=\"idTagEntries?.length\" style=\"width: 8em\">\n <mat-label>tag</mat-label>\n <mat-select [formControl]=\"tag\">\n <mat-option *ngFor=\"let e of idTagEntries\" [value]=\"e.id\">{{\n e.value\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n <!-- tag (free) -->\n <mat-form-field *ngIf=\"!idTagEntries?.length\" style=\"width: 8em\">\n <mat-label>tag</mat-label>\n <input matInput [formControl]=\"tag\" />\n <mat-error *ngIf=\"tag.errors?.maxLength && (tag.dirty || tag.touched)\"\n >tag too long</mat-error\n >\n </mat-form-field>\n\n <!-- scope (bound) -->\n <mat-form-field *ngIf=\"idScopeEntries?.length\" style=\"width: 8em\">\n <mat-label>scope</mat-label>\n <mat-select [formControl]=\"scope\">\n <mat-option *ngFor=\"let e of idScopeEntries\" [value]=\"e.id\">{{\n e.value\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n <!-- scope (free) -->\n <mat-form-field *ngIf=\"!idScopeEntries?.length\" style=\"width: 8em\">\n <mat-label>scope</mat-label>\n <input matInput [formControl]=\"scope\" />\n <mat-error\n *ngIf=\"scope.errors?.maxLength && (scope.dirty || scope.touched)\"\n >scope too long</mat-error\n >\n </mat-form-field>\n\n <!-- value -->\n <mat-form-field>\n <mat-label>value</mat-label>\n <input matInput [formControl]=\"value\" />\n <mat-error\n *ngIf=\"value.errors?.required && (value.dirty || value.touched)\"\n >value required</mat-error\n >\n <mat-error\n *ngIf=\"value.errors?.maxLength && (value.dirty || value.touched)\"\n >value too long</mat-error\n >\n </mat-form-field>\n\n <!-- lookup -->\n <div *ngIf=\"!noEidLookup\" style=\"margin-top: 4px\">\n <mat-expansion-panel [(expanded)]=\"lookupExpanded\">\n <mat-expansion-panel-header>lookup</mat-expansion-panel-header>\n <cadmus-scoped-pin-lookup\n (idPick)=\"onIdPick($event)\"\n ></cadmus-scoped-pin-lookup>\n </mat-expansion-panel>\n </div>\n </div>\n\n <!-- assertion -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>assertion</mat-expansion-panel-header>\n <cadmus-refs-assertion\n [assTagEntries]=\"assTagEntries\"\n [refTypeEntries]=\"refTypeEntries\"\n [refTagEntries]=\"refTagEntries\"\n [assertion]=\"assertion.value\"\n (assertionChange)=\"onAssertionChange($event)\"\n >\n </cadmus-refs-assertion>\n </mat-expansion-panel>\n </div>\n\n <!-- buttons -->\n <div *ngIf=\"hasSubmit\">\n <button mat-icon-button color=\"warn\" type=\"button\" (click)=\"cancel()\">\n <mat-icon>close</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"primary\"\n type=\"submit\"\n [disabled]=\"form.invalid\"\n >\n <mat-icon>check_circle</mat-icon>\n </button>\n </div>\n</form>\n", styles: [".form-row{display:flex;gap:8px;align-items:flex-start;flex-wrap:wrap}.form-row *{flex:0 0 auto}.pin-info{font-size:90%;color:silver}fieldset{border:1px solid silver;border-radius:6px;padding:6px}@media only screen and (max-width: 959px){div#container{grid-template-rows:1fr auto;grid-template-columns:1fr;grid-template-areas:\"editor\" \"lookup\"}}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i7.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i11$1.AssertionComponent, selector: "cadmus-refs-assertion", inputs: ["assTagEntries", "refTypeEntries", "refTagEntries", "assertion"], outputs: ["assertionChange"] }, { kind: "component", type: ScopedPinLookupComponent, selector: "cadmus-scoped-pin-lookup", outputs: ["idPick"] }] });
306
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: AssertedIdComponent, decorators: [{
307
- type: Component,
308
- args: [{ selector: 'cadmus-refs-asserted-id', template: "<form [formGroup]=\"form\" (submit)=\"save()\">\n <div>\n <div class=\"form-row\">\n <!-- tag (bound) -->\n <mat-form-field *ngIf=\"idTagEntries?.length\" style=\"width: 8em\">\n <mat-label>tag</mat-label>\n <mat-select [formControl]=\"tag\">\n <mat-option *ngFor=\"let e of idTagEntries\" [value]=\"e.id\">{{\n e.value\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n <!-- tag (free) -->\n <mat-form-field *ngIf=\"!idTagEntries?.length\" style=\"width: 8em\">\n <mat-label>tag</mat-label>\n <input matInput [formControl]=\"tag\" />\n <mat-error *ngIf=\"tag.errors?.maxLength && (tag.dirty || tag.touched)\"\n >tag too long</mat-error\n >\n </mat-form-field>\n\n <!-- scope (bound) -->\n <mat-form-field *ngIf=\"idScopeEntries?.length\" style=\"width: 8em\">\n <mat-label>scope</mat-label>\n <mat-select [formControl]=\"scope\">\n <mat-option *ngFor=\"let e of idScopeEntries\" [value]=\"e.id\">{{\n e.value\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n <!-- scope (free) -->\n <mat-form-field *ngIf=\"!idScopeEntries?.length\" style=\"width: 8em\">\n <mat-label>scope</mat-label>\n <input matInput [formControl]=\"scope\" />\n <mat-error\n *ngIf=\"scope.errors?.maxLength && (scope.dirty || scope.touched)\"\n >scope too long</mat-error\n >\n </mat-form-field>\n\n <!-- value -->\n <mat-form-field>\n <mat-label>value</mat-label>\n <input matInput [formControl]=\"value\" />\n <mat-error\n *ngIf=\"value.errors?.required && (value.dirty || value.touched)\"\n >value required</mat-error\n >\n <mat-error\n *ngIf=\"value.errors?.maxLength && (value.dirty || value.touched)\"\n >value too long</mat-error\n >\n </mat-form-field>\n\n <!-- lookup -->\n <div *ngIf=\"!noEidLookup\" style=\"margin-top: 4px\">\n <mat-expansion-panel [(expanded)]=\"lookupExpanded\">\n <mat-expansion-panel-header>lookup</mat-expansion-panel-header>\n <cadmus-scoped-pin-lookup\n (idPick)=\"onIdPick($event)\"\n ></cadmus-scoped-pin-lookup>\n </mat-expansion-panel>\n </div>\n </div>\n\n <!-- assertion -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>assertion</mat-expansion-panel-header>\n <cadmus-refs-assertion\n [assTagEntries]=\"assTagEntries\"\n [refTypeEntries]=\"refTypeEntries\"\n [refTagEntries]=\"refTagEntries\"\n [assertion]=\"assertion.value\"\n (assertionChange)=\"onAssertionChange($event)\"\n >\n </cadmus-refs-assertion>\n </mat-expansion-panel>\n </div>\n\n <!-- buttons -->\n <div *ngIf=\"hasSubmit\">\n <button mat-icon-button color=\"warn\" type=\"button\" (click)=\"cancel()\">\n <mat-icon>close</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"primary\"\n type=\"submit\"\n [disabled]=\"form.invalid\"\n >\n <mat-icon>check_circle</mat-icon>\n </button>\n </div>\n</form>\n", styles: [".form-row{display:flex;gap:8px;align-items:flex-start;flex-wrap:wrap}.form-row *{flex:0 0 auto}.pin-info{font-size:90%;color:silver}fieldset{border:1px solid silver;border-radius:6px;padding:6px}@media only screen and (max-width: 959px){div#container{grid-template-rows:1fr auto;grid-template-columns:1fr;grid-template-areas:\"editor\" \"lookup\"}}\n"] }]
309
- }], ctorParameters: function () {
310
- return [{ type: i1$1.FormBuilder }, { type: PinRefLookupService }, { type: undefined, decorators: [{
311
- type: Inject,
312
- args: ['indexLookupDefinitions']
313
- }] }];
314
- }, propDecorators: { idScopeEntries: [{
315
- type: Input
316
- }], idTagEntries: [{
317
- type: Input
318
- }], assTagEntries: [{
319
- type: Input
320
- }], refTypeEntries: [{
321
- type: Input
322
- }], refTagEntries: [{
323
- type: Input
324
- }], id: [{
325
- type: Input
326
- }], noEidLookup: [{
327
- type: Input
328
- }], hasSubmit: [{
329
- type: Input
330
- }], idChange: [{
331
- type: Output
332
- }], editorClose: [{
333
- type: Output
334
- }] } });
335
-
336
- /**
337
- * Asserted IDs editor.
338
- */
339
- class AssertedIdsComponent {
340
- constructor(formBuilder, _dialogService) {
341
- this._dialogService = _dialogService;
342
- this._ids = [];
343
- this._editedIndex = -1;
344
- this.idsChange = new EventEmitter();
345
- this.entries = formBuilder.control([], { nonNullable: true });
346
- // form
347
- this.form = formBuilder.group({
348
- ids: this.entries,
349
- });
350
- }
351
- /**
352
- * The asserted IDs.
353
- */
354
- get ids() {
355
- return this._ids;
356
- }
357
- set ids(value) {
358
- if (this._ids !== value) {
359
- this._ids = value || [];
360
- this.updateForm(value);
361
- }
362
- }
363
- updateForm(ids) {
364
- if (!(ids === null || ids === void 0 ? void 0 : ids.length)) {
365
- this.form.reset();
366
- return;
367
- }
368
- this.entries.setValue(ids, { emitEvent: false });
369
- this.entries.updateValueAndValidity();
370
- this.form.markAsPristine();
371
- }
372
- emitIdsChange() {
373
- this.idsChange.emit(this.entries.value);
374
- }
375
- addId() {
376
- this.editId({
377
- scope: '',
378
- value: '',
379
- }, -1);
380
- }
381
- editId(id, index) {
382
- this._editedIndex = index;
383
- this.edited = id;
384
- }
385
- closeId() {
386
- this._editedIndex = -1;
387
- this.edited = undefined;
388
- }
389
- saveId(entry) {
390
- const entries = [...this.entries.value];
391
- if (this._editedIndex === -1) {
392
- entries.push(entry);
393
- }
394
- else {
395
- entries.splice(this._editedIndex, 1, entry);
396
- }
397
- this.entries.setValue(entries);
398
- this.entries.markAsDirty();
399
- this.entries.updateValueAndValidity();
400
- this.closeId();
401
- }
402
- deleteId(index) {
403
- this._dialogService
404
- .confirm('Confirmation', 'Delete ID?')
405
- .pipe(take(1))
406
- .subscribe((yes) => {
407
- if (yes) {
408
- if (this._editedIndex === index) {
409
- this.closeId();
410
- }
411
- const entries = [...this.entries.value];
412
- entries.splice(index, 1);
413
- this.entries.setValue(entries);
414
- this.entries.markAsDirty();
415
- this.entries.updateValueAndValidity();
416
- this.emitIdsChange();
417
- }
418
- });
419
- }
420
- moveIdUp(index) {
421
- if (index < 1) {
422
- return;
423
- }
424
- const entry = this.entries.value[index];
425
- const entries = [...this.entries.value];
426
- entries.splice(index, 1);
427
- entries.splice(index - 1, 0, entry);
428
- this.entries.setValue(entries);
429
- this.entries.markAsDirty();
430
- this.entries.updateValueAndValidity();
431
- this.emitIdsChange();
432
- }
433
- moveIdDown(index) {
434
- if (index + 1 >= this.entries.value.length) {
435
- return;
436
- }
437
- const entry = this.entries.value[index];
438
- const entries = [...this.entries.value];
439
- entries.splice(index, 1);
440
- entries.splice(index + 1, 0, entry);
441
- this.entries.setValue(entries);
442
- this.entries.markAsDirty();
443
- this.entries.updateValueAndValidity();
444
- this.emitIdsChange();
445
- }
446
- onIdChange(id) {
447
- this.saveId(id);
448
- this.emitIdsChange();
449
- }
450
- }
451
- AssertedIdsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: AssertedIdsComponent, deps: [{ token: i1$1.FormBuilder }, { token: i2.DialogService }], target: i0.ɵɵFactoryTarget.Component });
452
- AssertedIdsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.3", type: AssertedIdsComponent, selector: "cadmus-refs-asserted-ids", inputs: { ids: "ids", idScopeEntries: "idScopeEntries", idTagEntries: "idTagEntries", assTagEntries: "assTagEntries", refTypeEntries: "refTypeEntries", refTagEntries: "refTagEntries" }, outputs: { idsChange: "idsChange" }, ngImport: i0, template: "<form [formGroup]=\"form\">\r\n <div>\r\n <button type=\"button\" mat-flat-button color=\"primary\" (click)=\"addId()\">\r\n <mat-icon>add_circle</mat-icon> ID\r\n </button>\r\n </div>\r\n <table *ngIf=\"entries.value?.length\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>scope</th>\r\n <th>value</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n *ngFor=\"\r\n let entry of entries.value;\r\n let i = index;\r\n let first = first;\r\n let last = last\r\n \"\r\n >\r\n <td>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Edit this ID\"\r\n (click)=\"editId(entry, i)\"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this ID up\"\r\n [disabled]=\"first\"\r\n (click)=\"moveIdUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this ID down\"\r\n [disabled]=\"last\"\r\n (click)=\"moveIdDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n matTooltip=\"Delete this ID\"\r\n (click)=\"deleteId(i)\"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ entry.scope }}</td>\r\n <td>{{ entry.value }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n <mat-expansion-panel [expanded]=\"edited\" [disabled]=\"!edited\">\r\n <mat-expansion-panel-header>ID {{edited?.value}}</mat-expansion-panel-header>\r\n <cadmus-refs-asserted-id\r\n [idScopeEntries]=\"idScopeEntries\"\r\n [idTagEntries]=\"idTagEntries\"\r\n [assTagEntries]=\"assTagEntries\"\r\n [refTypeEntries]=\"refTypeEntries\"\r\n [refTagEntries]=\"refTagEntries\"\r\n [hasSubmit]=\"true\"\r\n [id]=\"edited\"\r\n (idChange)=\"onIdChange($event)\"\r\n (editorClose)=\"closeId()\"\r\n ></cadmus-refs-asserted-id>\r\n </mat-expansion-panel>\r\n</form>\r\n", styles: ["th{font-weight:400;color:silver;text-align:left}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: AssertedIdComponent, selector: "cadmus-refs-asserted-id", inputs: ["idScopeEntries", "idTagEntries", "assTagEntries", "refTypeEntries", "refTagEntries", "id", "noEidLookup", "hasSubmit"], outputs: ["idChange", "editorClose"] }] });
453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: AssertedIdsComponent, decorators: [{
454
- type: Component,
455
- args: [{ selector: 'cadmus-refs-asserted-ids', template: "<form [formGroup]=\"form\">\r\n <div>\r\n <button type=\"button\" mat-flat-button color=\"primary\" (click)=\"addId()\">\r\n <mat-icon>add_circle</mat-icon> ID\r\n </button>\r\n </div>\r\n <table *ngIf=\"entries.value?.length\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>scope</th>\r\n <th>value</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n *ngFor=\"\r\n let entry of entries.value;\r\n let i = index;\r\n let first = first;\r\n let last = last\r\n \"\r\n >\r\n <td>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Edit this ID\"\r\n (click)=\"editId(entry, i)\"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this ID up\"\r\n [disabled]=\"first\"\r\n (click)=\"moveIdUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this ID down\"\r\n [disabled]=\"last\"\r\n (click)=\"moveIdDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n matTooltip=\"Delete this ID\"\r\n (click)=\"deleteId(i)\"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ entry.scope }}</td>\r\n <td>{{ entry.value }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n <mat-expansion-panel [expanded]=\"edited\" [disabled]=\"!edited\">\r\n <mat-expansion-panel-header>ID {{edited?.value}}</mat-expansion-panel-header>\r\n <cadmus-refs-asserted-id\r\n [idScopeEntries]=\"idScopeEntries\"\r\n [idTagEntries]=\"idTagEntries\"\r\n [assTagEntries]=\"assTagEntries\"\r\n [refTypeEntries]=\"refTypeEntries\"\r\n [refTagEntries]=\"refTagEntries\"\r\n [hasSubmit]=\"true\"\r\n [id]=\"edited\"\r\n (idChange)=\"onIdChange($event)\"\r\n (editorClose)=\"closeId()\"\r\n ></cadmus-refs-asserted-id>\r\n </mat-expansion-panel>\r\n</form>\r\n", styles: ["th{font-weight:400;color:silver;text-align:left}\n"] }]
456
- }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i2.DialogService }]; }, propDecorators: { ids: [{
457
- type: Input
458
- }], idScopeEntries: [{
459
- type: Input
460
- }], idTagEntries: [{
461
- type: Input
462
- }], assTagEntries: [{
463
- type: Input
464
- }], refTypeEntries: [{
465
- type: Input
466
- }], refTagEntries: [{
467
- type: Input
468
- }], idsChange: [{
469
- type: Output
470
- }] } });
471
-
472
- class CadmusRefsAssertedIdsModule {
473
- }
474
- CadmusRefsAssertedIdsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: CadmusRefsAssertedIdsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
475
- CadmusRefsAssertedIdsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.3", ngImport: i0, type: CadmusRefsAssertedIdsModule, declarations: [AssertedIdComponent,
476
- AssertedIdsComponent,
477
- ScopedPinLookupComponent], imports: [CommonModule,
478
- FormsModule,
479
- ReactiveFormsModule,
480
- // material
481
- MatButtonModule,
482
- MatExpansionModule,
483
- MatFormFieldModule,
484
- MatIconModule,
485
- MatInputModule,
486
- MatSelectModule,
487
- // Cadmus
488
- CadmusCoreModule,
489
- CadmusRefsDocReferencesModule,
490
- CadmusRefsAssertionModule,
491
- CadmusRefsLookupModule,
492
- CadmusApiModule], exports: [AssertedIdComponent,
493
- AssertedIdsComponent,
494
- ScopedPinLookupComponent] });
495
- CadmusRefsAssertedIdsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: CadmusRefsAssertedIdsModule, imports: [CommonModule,
496
- FormsModule,
497
- ReactiveFormsModule,
498
- // material
499
- MatButtonModule,
500
- MatExpansionModule,
501
- MatFormFieldModule,
502
- MatIconModule,
503
- MatInputModule,
504
- MatSelectModule,
505
- // Cadmus
506
- CadmusCoreModule,
507
- CadmusRefsDocReferencesModule,
508
- CadmusRefsAssertionModule,
509
- CadmusRefsLookupModule,
510
- CadmusApiModule] });
511
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: CadmusRefsAssertedIdsModule, decorators: [{
512
- type: NgModule,
513
- args: [{
514
- declarations: [
515
- AssertedIdComponent,
516
- AssertedIdsComponent,
517
- ScopedPinLookupComponent,
518
- ],
519
- imports: [
520
- CommonModule,
521
- FormsModule,
522
- ReactiveFormsModule,
523
- // material
524
- MatButtonModule,
525
- MatExpansionModule,
526
- MatFormFieldModule,
527
- MatIconModule,
528
- MatInputModule,
529
- MatSelectModule,
530
- // Cadmus
531
- CadmusCoreModule,
532
- CadmusRefsDocReferencesModule,
533
- CadmusRefsAssertionModule,
534
- CadmusRefsLookupModule,
535
- CadmusApiModule,
536
- ],
537
- exports: [
538
- AssertedIdComponent,
539
- AssertedIdsComponent,
540
- ScopedPinLookupComponent,
541
- ],
542
- }]
543
- }] });
544
-
545
- /*
546
- * Public API Surface of cadmus-refs-asserted-ids
547
- */
548
-
549
- /**
550
- * Generated bundle index. Do not edit.
551
- */
552
-
553
- export { AssertedIdComponent, AssertedIdsComponent, CadmusRefsAssertedIdsModule, PinRefLookupService, ScopedPinLookupComponent };
554
- //# sourceMappingURL=myrmidon-cadmus-refs-asserted-ids.mjs.map