@myrmidon/cadmus-refs-asserted-ids 0.0.1

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.
@@ -0,0 +1,368 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, ViewChildren, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
+ import { debounceTime } from 'rxjs/operators';
6
+ import * as i2 from '@angular/common';
7
+ import { CommonModule } from '@angular/common';
8
+ import * as i3 from '@angular/material/expansion';
9
+ import { MatExpansionModule } from '@angular/material/expansion';
10
+ import * as i4 from '@angular/material/form-field';
11
+ import { MatFormFieldModule } from '@angular/material/form-field';
12
+ import * as i5 from '@angular/material/input';
13
+ import { MatInputModule } from '@angular/material/input';
14
+ import * as i6 from '@angular/material/select';
15
+ import { MatSelectModule } from '@angular/material/select';
16
+ import * as i7 from '@angular/material/core';
17
+ import * as i8 from '@myrmidon/cadmus-refs-assertion';
18
+ import { CadmusRefsAssertionModule } from '@myrmidon/cadmus-refs-assertion';
19
+ import * as i3$1 from '@angular/material/button';
20
+ import { MatButtonModule } from '@angular/material/button';
21
+ import * as i6$1 from '@angular/material/icon';
22
+ import { MatIconModule } from '@angular/material/icon';
23
+ import { CadmusCoreModule } from '@myrmidon/cadmus-core';
24
+ import { CadmusRefsDocReferencesModule } from '@myrmidon/cadmus-refs-doc-references';
25
+
26
+ class AssertedIdComponent {
27
+ constructor(formBuilder) {
28
+ this.idChange = new EventEmitter();
29
+ // form
30
+ this.tag = formBuilder.control(null, Validators.maxLength(50));
31
+ this.value = formBuilder.control(null, [
32
+ Validators.required,
33
+ Validators.maxLength(500),
34
+ ]);
35
+ this.scope = formBuilder.control(null, Validators.maxLength(500));
36
+ this.form = formBuilder.group({
37
+ tag: this.tag,
38
+ value: this.value,
39
+ scope: this.scope,
40
+ });
41
+ }
42
+ get id() {
43
+ return this._id;
44
+ }
45
+ set id(value) {
46
+ this._id = value;
47
+ this.updateForm(value);
48
+ }
49
+ ngOnInit() {
50
+ this.form.valueChanges.pipe(debounceTime(300)).subscribe((_) => {
51
+ if (!this._updatingForm) {
52
+ this.emitIdChange();
53
+ }
54
+ });
55
+ }
56
+ onAssertionChange(assertion) {
57
+ this.assertion = assertion;
58
+ setTimeout(() => this.emitIdChange(), 0);
59
+ }
60
+ updateForm(value) {
61
+ this._updatingForm = true;
62
+ if (!value) {
63
+ this.form.reset();
64
+ this.assertion = undefined;
65
+ }
66
+ else {
67
+ this.tag.setValue(value.tag || null);
68
+ this.value.setValue(value.value);
69
+ this.scope.setValue(value.scope);
70
+ this.initialAssertion = value.assertion;
71
+ this.form.markAsPristine();
72
+ }
73
+ this._updatingForm = false;
74
+ this.emitIdChange();
75
+ }
76
+ getId() {
77
+ return {
78
+ tag: this.tag.value?.trim(),
79
+ value: this.value.value?.trim() || '',
80
+ scope: this.scope.value?.trim() || '',
81
+ assertion: this.assertion,
82
+ };
83
+ }
84
+ emitIdChange() {
85
+ this.idChange.emit(this.getId());
86
+ }
87
+ }
88
+ AssertedIdComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AssertedIdComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
89
+ AssertedIdComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: AssertedIdComponent, selector: "cadmus-refs-asserted-id", inputs: { scopeEntries: "scopeEntries", idTagEntries: "idTagEntries", assTagEntries: "assTagEntries", refTypeEntries: "refTypeEntries", refTagEntries: "refTagEntries", id: "id" }, outputs: { idChange: "idChange" }, ngImport: i0, template: "<form [formGroup]=\"form\">\n <div>\n <!-- tag (bound) -->\n <mat-form-field *ngIf=\"idTagEntries?.length\" style=\"width: 8em\">\n <mat-select [formControl]=\"tag\" placeholder=\"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 <input matInput [formControl]=\"tag\" placeholder=\"tag\" />\n <mat-error *ngIf=\"tag.errors?.maxLength && (tag.dirty || tag.touched)\"\n >tag too long</mat-error\n >\n </mat-form-field>\n &nbsp;\n\n <!-- scope (bound) -->\n <mat-form-field *ngIf=\"scopeEntries?.length\" style=\"width: 8em\">\n <mat-select [formControl]=\"scope\" placeholder=\"scope\">\n <mat-option *ngFor=\"let e of scopeEntries\" [value]=\"e.id\">{{\n e.value\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n <!-- scope (free) -->\n <mat-form-field *ngIf=\"!scopeEntries?.length\" style=\"width: 8em\">\n <input matInput [formControl]=\"scope\" placeholder=\"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 <!-- value -->\n &nbsp;\n <mat-form-field>\n <input matInput [formControl]=\"value\" placeholder=\"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 </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]=\"initialAssertion\"\n (assertionChange)=\"onAssertionChange($event)\"\n >\n </cadmus-refs-assertion>\n </mat-expansion-panel>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i4.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.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: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i8.AssertionComponent, selector: "cadmus-refs-assertion", inputs: ["assTagEntries", "refTypeEntries", "refTagEntries", "assertion"], outputs: ["assertionChange"] }] });
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AssertedIdComponent, decorators: [{
91
+ type: Component,
92
+ args: [{ selector: 'cadmus-refs-asserted-id', template: "<form [formGroup]=\"form\">\n <div>\n <!-- tag (bound) -->\n <mat-form-field *ngIf=\"idTagEntries?.length\" style=\"width: 8em\">\n <mat-select [formControl]=\"tag\" placeholder=\"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 <input matInput [formControl]=\"tag\" placeholder=\"tag\" />\n <mat-error *ngIf=\"tag.errors?.maxLength && (tag.dirty || tag.touched)\"\n >tag too long</mat-error\n >\n </mat-form-field>\n &nbsp;\n\n <!-- scope (bound) -->\n <mat-form-field *ngIf=\"scopeEntries?.length\" style=\"width: 8em\">\n <mat-select [formControl]=\"scope\" placeholder=\"scope\">\n <mat-option *ngFor=\"let e of scopeEntries\" [value]=\"e.id\">{{\n e.value\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n <!-- scope (free) -->\n <mat-form-field *ngIf=\"!scopeEntries?.length\" style=\"width: 8em\">\n <input matInput [formControl]=\"scope\" placeholder=\"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 <!-- value -->\n &nbsp;\n <mat-form-field>\n <input matInput [formControl]=\"value\" placeholder=\"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 </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]=\"initialAssertion\"\n (assertionChange)=\"onAssertionChange($event)\"\n >\n </cadmus-refs-assertion>\n </mat-expansion-panel>\n</form>\n" }]
93
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { scopeEntries: [{
94
+ type: Input
95
+ }], idTagEntries: [{
96
+ type: Input
97
+ }], assTagEntries: [{
98
+ type: Input
99
+ }], refTypeEntries: [{
100
+ type: Input
101
+ }], refTagEntries: [{
102
+ type: Input
103
+ }], id: [{
104
+ type: Input
105
+ }], idChange: [{
106
+ type: Output
107
+ }] } });
108
+
109
+ class AssertedIdsComponent {
110
+ constructor(_formBuilder) {
111
+ this._formBuilder = _formBuilder;
112
+ this._ids = [];
113
+ this._idsSubs = [];
114
+ this.idsChange = new EventEmitter();
115
+ this.assEdOpen = false;
116
+ // form
117
+ this.idsArr = _formBuilder.array([]);
118
+ this.form = _formBuilder.group({
119
+ idsArr: this.idsArr,
120
+ });
121
+ }
122
+ /**
123
+ * The asserted IDs.
124
+ */
125
+ get ids() {
126
+ return this._ids;
127
+ }
128
+ set ids(value) {
129
+ this._ids = value || [];
130
+ this.updateForm(value);
131
+ }
132
+ ngAfterViewInit() {
133
+ // focus on newly added ID
134
+ this._idSubscription = this.idQueryList?.changes
135
+ .pipe(debounceTime(300))
136
+ .subscribe((lst) => {
137
+ if (!this._updatingForm && lst.length > 0) {
138
+ lst.last.nativeElement.focus();
139
+ }
140
+ });
141
+ }
142
+ unsubscribeIds() {
143
+ for (let i = 0; i < this._idsSubs.length; i++) {
144
+ this._idsSubs[i].unsubscribe();
145
+ }
146
+ }
147
+ ngOnDestroy() {
148
+ this.unsubscribeIds();
149
+ this._idSubscription?.unsubscribe();
150
+ }
151
+ getIdGroup(id) {
152
+ return this._formBuilder.group({
153
+ value: this._formBuilder.control(id?.value, [
154
+ Validators.required,
155
+ Validators.maxLength(500),
156
+ ]),
157
+ scope: this._formBuilder.control(id?.scope, Validators.maxLength(50)),
158
+ tag: this._formBuilder.control(id?.tag, Validators.maxLength(50)),
159
+ assertion: this._formBuilder.control(id?.assertion),
160
+ });
161
+ }
162
+ addId(id) {
163
+ const g = this.getIdGroup(id);
164
+ this._idsSubs.push(g.valueChanges.pipe(debounceTime(300)).subscribe((_) => {
165
+ this.emitIdsChange();
166
+ }));
167
+ this.idsArr.push(g);
168
+ if (!this._updatingForm) {
169
+ this.emitIdsChange();
170
+ }
171
+ }
172
+ removeId(index) {
173
+ this.closeAssertion();
174
+ this._idsSubs[index].unsubscribe();
175
+ this._idsSubs.splice(index, 1);
176
+ this.idsArr.removeAt(index);
177
+ this.emitIdsChange();
178
+ }
179
+ swapArrElems(a, i, j) {
180
+ if (i === j) {
181
+ return;
182
+ }
183
+ const t = a[i];
184
+ a[i] = a[j];
185
+ a[j] = t;
186
+ }
187
+ moveIdUp(index) {
188
+ if (index < 1) {
189
+ return;
190
+ }
191
+ this.closeAssertion();
192
+ const ctl = this.idsArr.controls[index];
193
+ this.idsArr.removeAt(index);
194
+ this.idsArr.insert(index - 1, ctl);
195
+ this.swapArrElems(this._idsSubs, index, index - 1);
196
+ this.emitIdsChange();
197
+ }
198
+ moveIdDown(index) {
199
+ if (index + 1 >= this.idsArr.length) {
200
+ return;
201
+ }
202
+ this.closeAssertion();
203
+ const item = this.idsArr.controls[index];
204
+ this.idsArr.removeAt(index);
205
+ this.idsArr.insert(index + 1, item);
206
+ this.swapArrElems(this._idsSubs, index, index + 1);
207
+ this.emitIdsChange();
208
+ }
209
+ clearIds() {
210
+ this.closeAssertion();
211
+ this.idsArr.clear();
212
+ this.unsubscribeIds();
213
+ this._idsSubs = [];
214
+ if (!this._updatingForm) {
215
+ this.emitIdsChange();
216
+ }
217
+ }
218
+ editAssertion(index) {
219
+ // save the currently edited assertion if any
220
+ this.saveAssertion();
221
+ // edit the new assertion
222
+ this.initialAssertion = this.idsArr.at(index).controls['assertion'].value;
223
+ this.assertionNr = index + 1;
224
+ this.assEdOpen = true;
225
+ }
226
+ onAssertionChange(assertion) {
227
+ this.assertion = assertion;
228
+ }
229
+ saveAssertion() {
230
+ // save the currently edited assertion if any
231
+ if (this.assertionNr) {
232
+ const g = this.idsArr.at(this.assertionNr - 1);
233
+ g.controls['assertion'].setValue(this.assertion);
234
+ this.closeAssertion();
235
+ this.emitIdsChange();
236
+ }
237
+ }
238
+ closeAssertion() {
239
+ if (this.assertionNr) {
240
+ this.assEdOpen = false;
241
+ this.assertionNr = 0;
242
+ this.initialAssertion = undefined;
243
+ }
244
+ }
245
+ updateForm(ids) {
246
+ if (!this.idsArr) {
247
+ return;
248
+ }
249
+ this._updatingForm = true;
250
+ this.clearIds();
251
+ if (!ids) {
252
+ this.form.reset();
253
+ }
254
+ else {
255
+ for (const id of ids) {
256
+ this.addId(id);
257
+ }
258
+ this.form.markAsPristine();
259
+ }
260
+ this._updatingForm = false;
261
+ this.emitIdsChange();
262
+ }
263
+ getIds() {
264
+ const ids = [];
265
+ for (let i = 0; i < this.idsArr.length; i++) {
266
+ const g = this.idsArr.controls[i];
267
+ ids.push({
268
+ value: g.controls.value.value?.trim(),
269
+ scope: g.controls.scope.value?.trim(),
270
+ tag: g.controls.tag.value?.trim(),
271
+ assertion: g.controls.assertion.value,
272
+ });
273
+ }
274
+ return ids;
275
+ }
276
+ emitIdsChange() {
277
+ this.idsChange.emit(this.getIds());
278
+ }
279
+ }
280
+ AssertedIdsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AssertedIdsComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
281
+ AssertedIdsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: AssertedIdsComponent, selector: "cadmus-refs-asserted-ids", inputs: { ids: "ids", scopeEntries: "scopeEntries", tagEntries: "tagEntries", assTagEntries: "assTagEntries", refTypeEntries: "refTypeEntries", refTagEntries: "refTagEntries" }, outputs: { idsChange: "idsChange" }, viewQueries: [{ propertyName: "idQueryList", predicate: ["id"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"form\">\r\n <div formArrayName=\"idsArr\">\r\n <div>\r\n <button\r\n type=\"button\"\r\n mat-stroked-button\r\n color=\"primary\"\r\n (click)=\"addId()\"\r\n matTooltip=\"Add a new ID\"\r\n >\r\n <mat-icon>add_circle</mat-icon> add ID\r\n </button>\r\n </div>\r\n <div\r\n *ngFor=\"\r\n let item of idsArr.controls;\r\n let i = index;\r\n let first = first;\r\n let last = last\r\n \"\r\n >\r\n <!-- child form -->\r\n <div [formGroupName]=\"i\">\r\n <!-- child actions -->\r\n {{ i + 1 }}.\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Remove this ID\"\r\n color=\"warn\"\r\n (click)=\"removeId(i)\"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n <button\r\n [disabled]=\"first\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Move ID up\"\r\n (click)=\"moveIdUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n [disabled]=\"last\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Move ID down\"\r\n (click)=\"moveIdDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n\r\n <!-- child controls -->\r\n <!-- value -->\r\n <mat-form-field>\r\n <input\r\n #id\r\n autofocus\r\n matInput\r\n formControlName=\"value\"\r\n placeholder=\"external ID\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].value?.hasError('required') &&\r\n ($any(item)['controls'].value.dirty ||\r\n $any(item)['controls'].value.touched)\r\n \"\r\n >ID required\r\n </mat-error>\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].value?.hasError('max-length') &&\r\n ($any(item)['controls'].value.dirty ||\r\n $any(item)['controls'].value.touched)\r\n \"\r\n >ID too long\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n &nbsp;\r\n <!-- scope (bound) -->\r\n <ng-container *ngIf=\"scopeEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <mat-select formControlName=\"scope\" placeholder=\"scope\">\r\n <mat-option *ngFor=\"let e of scopeEntries\" [value]=\"e.id\">\r\n {{ e.value }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- scope (free) -->\r\n <ng-container *ngIf=\"!scopeEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <input matInput formControlName=\"scope\" placeholder=\"scope\" />\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].scope?.hasError('max-length') &&\r\n ($any(item)['controls'].scope.dirty ||\r\n $any(item)['controls'].scope.touched)\r\n \"\r\n >scope too long\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n &nbsp;\r\n <!-- tag (bound) -->\r\n <ng-container *ngIf=\"tagEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <mat-select formControlName=\"tag\" placeholder=\"tag\">\r\n <mat-option *ngFor=\"let e of tagEntries\" [value]=\"e.id\">\r\n {{ e.value }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- tag (free) -->\r\n <ng-container *ngIf=\"!tagEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <input matInput formControlName=\"tag\" placeholder=\"tag\" />\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].tag?.hasError('max-length') &&\r\n ($any(item)['controls'].tag.dirty ||\r\n $any(item)['controls'].tag.touched)\r\n \"\r\n >tag too long\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- assertion -->\r\n &nbsp;\r\n <button\r\n type=\"button\"\r\n color=\"primary\"\r\n mat-icon-button\r\n matTooltip=\"Edit assertion\"\r\n (click)=\"editAssertion(i)\"\r\n >\r\n <mat-icon>feedback</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <!-- assertion -->\r\n <mat-expansion-panel\r\n *ngIf=\"idsArr?.length\"\r\n [disabled]=\"!assertionNr\"\r\n [(expanded)]=\"assEdOpen\"\r\n >\r\n <mat-expansion-panel-header\r\n >#{{ assertionNr }} assertion</mat-expansion-panel-header\r\n >\r\n <cadmus-refs-assertion\r\n [assertion]=\"initialAssertion\"\r\n [assTagEntries]=\"assTagEntries\"\r\n [refTagEntries]=\"refTagEntries\"\r\n [refTypeEntries]=\"refTypeEntries\"\r\n (assertionChange)=\"onAssertionChange($event)\"\r\n ></cadmus-refs-assertion>\r\n <button\r\n color=\"primary\"\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"saveAssertion()\"\r\n >\r\n <mat-icon>check_circle</mat-icon> save assertion\r\n </button>\r\n </mat-expansion-panel>\r\n </div>\r\n</form>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i3$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i4.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5.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: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i8.AssertionComponent, selector: "cadmus-refs-assertion", inputs: ["assTagEntries", "refTypeEntries", "refTagEntries", "assertion"], outputs: ["assertionChange"] }] });
282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AssertedIdsComponent, decorators: [{
283
+ type: Component,
284
+ args: [{ selector: 'cadmus-refs-asserted-ids', template: "<form [formGroup]=\"form\">\r\n <div formArrayName=\"idsArr\">\r\n <div>\r\n <button\r\n type=\"button\"\r\n mat-stroked-button\r\n color=\"primary\"\r\n (click)=\"addId()\"\r\n matTooltip=\"Add a new ID\"\r\n >\r\n <mat-icon>add_circle</mat-icon> add ID\r\n </button>\r\n </div>\r\n <div\r\n *ngFor=\"\r\n let item of idsArr.controls;\r\n let i = index;\r\n let first = first;\r\n let last = last\r\n \"\r\n >\r\n <!-- child form -->\r\n <div [formGroupName]=\"i\">\r\n <!-- child actions -->\r\n {{ i + 1 }}.\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Remove this ID\"\r\n color=\"warn\"\r\n (click)=\"removeId(i)\"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n <button\r\n [disabled]=\"first\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Move ID up\"\r\n (click)=\"moveIdUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n [disabled]=\"last\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Move ID down\"\r\n (click)=\"moveIdDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n\r\n <!-- child controls -->\r\n <!-- value -->\r\n <mat-form-field>\r\n <input\r\n #id\r\n autofocus\r\n matInput\r\n formControlName=\"value\"\r\n placeholder=\"external ID\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].value?.hasError('required') &&\r\n ($any(item)['controls'].value.dirty ||\r\n $any(item)['controls'].value.touched)\r\n \"\r\n >ID required\r\n </mat-error>\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].value?.hasError('max-length') &&\r\n ($any(item)['controls'].value.dirty ||\r\n $any(item)['controls'].value.touched)\r\n \"\r\n >ID too long\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n &nbsp;\r\n <!-- scope (bound) -->\r\n <ng-container *ngIf=\"scopeEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <mat-select formControlName=\"scope\" placeholder=\"scope\">\r\n <mat-option *ngFor=\"let e of scopeEntries\" [value]=\"e.id\">\r\n {{ e.value }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- scope (free) -->\r\n <ng-container *ngIf=\"!scopeEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <input matInput formControlName=\"scope\" placeholder=\"scope\" />\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].scope?.hasError('max-length') &&\r\n ($any(item)['controls'].scope.dirty ||\r\n $any(item)['controls'].scope.touched)\r\n \"\r\n >scope too long\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n &nbsp;\r\n <!-- tag (bound) -->\r\n <ng-container *ngIf=\"tagEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <mat-select formControlName=\"tag\" placeholder=\"tag\">\r\n <mat-option *ngFor=\"let e of tagEntries\" [value]=\"e.id\">\r\n {{ e.value }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- tag (free) -->\r\n <ng-container *ngIf=\"!tagEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <input matInput formControlName=\"tag\" placeholder=\"tag\" />\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].tag?.hasError('max-length') &&\r\n ($any(item)['controls'].tag.dirty ||\r\n $any(item)['controls'].tag.touched)\r\n \"\r\n >tag too long\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- assertion -->\r\n &nbsp;\r\n <button\r\n type=\"button\"\r\n color=\"primary\"\r\n mat-icon-button\r\n matTooltip=\"Edit assertion\"\r\n (click)=\"editAssertion(i)\"\r\n >\r\n <mat-icon>feedback</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <!-- assertion -->\r\n <mat-expansion-panel\r\n *ngIf=\"idsArr?.length\"\r\n [disabled]=\"!assertionNr\"\r\n [(expanded)]=\"assEdOpen\"\r\n >\r\n <mat-expansion-panel-header\r\n >#{{ assertionNr }} assertion</mat-expansion-panel-header\r\n >\r\n <cadmus-refs-assertion\r\n [assertion]=\"initialAssertion\"\r\n [assTagEntries]=\"assTagEntries\"\r\n [refTagEntries]=\"refTagEntries\"\r\n [refTypeEntries]=\"refTypeEntries\"\r\n (assertionChange)=\"onAssertionChange($event)\"\r\n ></cadmus-refs-assertion>\r\n <button\r\n color=\"primary\"\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"saveAssertion()\"\r\n >\r\n <mat-icon>check_circle</mat-icon> save assertion\r\n </button>\r\n </mat-expansion-panel>\r\n </div>\r\n</form>\r\n" }]
285
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { idQueryList: [{
286
+ type: ViewChildren,
287
+ args: ['id']
288
+ }], ids: [{
289
+ type: Input
290
+ }], scopeEntries: [{
291
+ type: Input
292
+ }], tagEntries: [{
293
+ type: Input
294
+ }], assTagEntries: [{
295
+ type: Input
296
+ }], refTypeEntries: [{
297
+ type: Input
298
+ }], refTagEntries: [{
299
+ type: Input
300
+ }], idsChange: [{
301
+ type: Output
302
+ }] } });
303
+
304
+ class CadmusRefsAssertedIdsModule {
305
+ }
306
+ CadmusRefsAssertedIdsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CadmusRefsAssertedIdsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
307
+ CadmusRefsAssertedIdsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: CadmusRefsAssertedIdsModule, declarations: [AssertedIdComponent, AssertedIdsComponent], imports: [CommonModule,
308
+ FormsModule,
309
+ ReactiveFormsModule,
310
+ // material
311
+ MatButtonModule,
312
+ MatExpansionModule,
313
+ MatFormFieldModule,
314
+ MatIconModule,
315
+ MatInputModule,
316
+ MatSelectModule,
317
+ // Cadmus
318
+ CadmusCoreModule,
319
+ CadmusRefsDocReferencesModule,
320
+ CadmusRefsAssertionModule], exports: [AssertedIdComponent, AssertedIdsComponent] });
321
+ CadmusRefsAssertedIdsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CadmusRefsAssertedIdsModule, imports: [CommonModule,
322
+ FormsModule,
323
+ ReactiveFormsModule,
324
+ // material
325
+ MatButtonModule,
326
+ MatExpansionModule,
327
+ MatFormFieldModule,
328
+ MatIconModule,
329
+ MatInputModule,
330
+ MatSelectModule,
331
+ // Cadmus
332
+ CadmusCoreModule,
333
+ CadmusRefsDocReferencesModule,
334
+ CadmusRefsAssertionModule] });
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CadmusRefsAssertedIdsModule, decorators: [{
336
+ type: NgModule,
337
+ args: [{
338
+ declarations: [AssertedIdComponent, AssertedIdsComponent],
339
+ imports: [
340
+ CommonModule,
341
+ FormsModule,
342
+ ReactiveFormsModule,
343
+ // material
344
+ MatButtonModule,
345
+ MatExpansionModule,
346
+ MatFormFieldModule,
347
+ MatIconModule,
348
+ MatInputModule,
349
+ MatSelectModule,
350
+ // Cadmus
351
+ CadmusCoreModule,
352
+ CadmusRefsDocReferencesModule,
353
+ CadmusRefsAssertionModule,
354
+ ],
355
+ exports: [AssertedIdComponent, AssertedIdsComponent],
356
+ }]
357
+ }] });
358
+
359
+ /*
360
+ * Public API Surface of cadmus-refs-asserted-ids
361
+ */
362
+
363
+ /**
364
+ * Generated bundle index. Do not edit.
365
+ */
366
+
367
+ export { AssertedIdComponent, AssertedIdsComponent, CadmusRefsAssertedIdsModule };
368
+ //# sourceMappingURL=myrmidon-cadmus-refs-asserted-ids.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"myrmidon-cadmus-refs-asserted-ids.mjs","sources":["../../../../projects/myrmidon/cadmus-refs-asserted-ids/src/lib/asserted-id/asserted-id.component.ts","../../../../projects/myrmidon/cadmus-refs-asserted-ids/src/lib/asserted-id/asserted-id.component.html","../../../../projects/myrmidon/cadmus-refs-asserted-ids/src/lib/asserted-ids/asserted-ids.component.ts","../../../../projects/myrmidon/cadmus-refs-asserted-ids/src/lib/asserted-ids/asserted-ids.component.html","../../../../projects/myrmidon/cadmus-refs-asserted-ids/src/lib/cadmus-refs-asserted-ids.module.ts","../../../../projects/myrmidon/cadmus-refs-asserted-ids/src/public-api.ts","../../../../projects/myrmidon/cadmus-refs-asserted-ids/src/myrmidon-cadmus-refs-asserted-ids.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\r\nimport {\r\n FormBuilder,\r\n FormControl,\r\n FormGroup,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { ThesaurusEntry } from '@myrmidon/cadmus-core';\r\nimport { Assertion } from '@myrmidon/cadmus-refs-assertion';\r\nimport { debounceTime } from 'rxjs/operators';\r\n\r\nexport interface AssertedId {\r\n tag?: string;\r\n value: string;\r\n scope: string;\r\n assertion?: Assertion;\r\n}\r\n\r\n@Component({\r\n selector: 'cadmus-refs-asserted-id',\r\n templateUrl: './asserted-id.component.html',\r\n styleUrls: ['./asserted-id.component.css'],\r\n})\r\nexport class AssertedIdComponent implements OnInit {\r\n private _updatingForm: boolean | undefined;\r\n private _id: AssertedId | undefined;\r\n\r\n public tag: FormControl<string | null>;\r\n public value: FormControl<string | null>;\r\n public scope: FormControl<string | null>;\r\n public form: FormGroup;\r\n\r\n public initialAssertion?: Assertion;\r\n public assertion?: Assertion;\r\n\r\n @Input()\r\n public scopeEntries?: ThesaurusEntry[];\r\n\r\n @Input()\r\n public idTagEntries?: ThesaurusEntry[];\r\n\r\n @Input()\r\n public assTagEntries?: ThesaurusEntry[];\r\n\r\n @Input()\r\n public refTypeEntries: ThesaurusEntry[] | undefined;\r\n\r\n @Input()\r\n public refTagEntries: ThesaurusEntry[] | undefined;\r\n\r\n @Input()\r\n public get id(): AssertedId | undefined {\r\n return this._id;\r\n }\r\n public set id(value: AssertedId | undefined) {\r\n this._id = value;\r\n this.updateForm(value);\r\n }\r\n\r\n @Output()\r\n public idChange: EventEmitter<AssertedId>;\r\n\r\n constructor(formBuilder: FormBuilder) {\r\n this.idChange = new EventEmitter<AssertedId>();\r\n // form\r\n this.tag = formBuilder.control(null, Validators.maxLength(50));\r\n this.value = formBuilder.control(null, [\r\n Validators.required,\r\n Validators.maxLength(500),\r\n ]);\r\n this.scope = formBuilder.control(null, Validators.maxLength(500));\r\n this.form = formBuilder.group({\r\n tag: this.tag,\r\n value: this.value,\r\n scope: this.scope,\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n this.form.valueChanges.pipe(debounceTime(300)).subscribe((_) => {\r\n if (!this._updatingForm) {\r\n this.emitIdChange();\r\n }\r\n });\r\n }\r\n\r\n public onAssertionChange(assertion: Assertion | undefined): void {\r\n this.assertion = assertion;\r\n setTimeout(() => this.emitIdChange(), 0);\r\n }\r\n\r\n private updateForm(value: AssertedId | undefined): void {\r\n this._updatingForm = true;\r\n if (!value) {\r\n this.form.reset();\r\n this.assertion = undefined;\r\n } else {\r\n this.tag.setValue(value.tag || null);\r\n this.value.setValue(value.value);\r\n this.scope.setValue(value.scope);\r\n this.initialAssertion = value.assertion;\r\n this.form.markAsPristine();\r\n }\r\n this._updatingForm = false;\r\n this.emitIdChange();\r\n }\r\n\r\n private getId(): AssertedId {\r\n return {\r\n tag: this.tag.value?.trim(),\r\n value: this.value.value?.trim() || '',\r\n scope: this.scope.value?.trim() || '',\r\n assertion: this.assertion,\r\n };\r\n }\r\n\r\n public emitIdChange(): void {\r\n this.idChange.emit(this.getId());\r\n }\r\n}\r\n","<form [formGroup]=\"form\">\n <div>\n <!-- tag (bound) -->\n <mat-form-field *ngIf=\"idTagEntries?.length\" style=\"width: 8em\">\n <mat-select [formControl]=\"tag\" placeholder=\"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 <input matInput [formControl]=\"tag\" placeholder=\"tag\" />\n <mat-error *ngIf=\"tag.errors?.maxLength && (tag.dirty || tag.touched)\"\n >tag too long</mat-error\n >\n </mat-form-field>\n &nbsp;\n\n <!-- scope (bound) -->\n <mat-form-field *ngIf=\"scopeEntries?.length\" style=\"width: 8em\">\n <mat-select [formControl]=\"scope\" placeholder=\"scope\">\n <mat-option *ngFor=\"let e of scopeEntries\" [value]=\"e.id\">{{\n e.value\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n <!-- scope (free) -->\n <mat-form-field *ngIf=\"!scopeEntries?.length\" style=\"width: 8em\">\n <input matInput [formControl]=\"scope\" placeholder=\"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 <!-- value -->\n &nbsp;\n <mat-form-field>\n <input matInput [formControl]=\"value\" placeholder=\"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 </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]=\"initialAssertion\"\n (assertionChange)=\"onAssertionChange($event)\"\n >\n </cadmus-refs-assertion>\n </mat-expansion-panel>\n</form>\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnDestroy,\r\n Output,\r\n QueryList,\r\n ViewChildren,\r\n} from '@angular/core';\r\nimport { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';\r\n\r\nimport { ThesaurusEntry } from '@myrmidon/cadmus-core';\r\nimport { Assertion } from '@myrmidon/cadmus-refs-assertion';\r\n\r\nimport { Subscription } from 'rxjs';\r\nimport { debounceTime } from 'rxjs/operators';\r\nimport { AssertedId } from '../asserted-id/asserted-id.component';\r\n\r\n@Component({\r\n selector: 'cadmus-refs-asserted-ids',\r\n templateUrl: './asserted-ids.component.html',\r\n styleUrls: ['./asserted-ids.component.css'],\r\n})\r\nexport class AssertedIdsComponent implements OnDestroy {\r\n private _ids: AssertedId[];\r\n private _idSubscription: Subscription | undefined;\r\n private _idsSubs: Subscription[];\r\n private _updatingForm: boolean | undefined;\r\n\r\n @ViewChildren('id') idQueryList: QueryList<any> | undefined;\r\n\r\n /**\r\n * The asserted IDs.\r\n */\r\n @Input()\r\n public get ids(): AssertedId[] {\r\n return this._ids;\r\n }\r\n public set ids(value: AssertedId[]) {\r\n this._ids = value || [];\r\n this.updateForm(value);\r\n }\r\n\r\n /**\r\n * The ID scopes thesaurus entries.\r\n */\r\n @Input()\r\n public scopeEntries: ThesaurusEntry[] | undefined;\r\n\r\n /**\r\n * The ID tags thesaurus entries.\r\n */\r\n @Input()\r\n public tagEntries: ThesaurusEntry[] | undefined;\r\n\r\n // thesauri for assertions\r\n @Input()\r\n public assTagEntries?: ThesaurusEntry[];\r\n\r\n @Input()\r\n public refTypeEntries: ThesaurusEntry[] | undefined;\r\n\r\n @Input()\r\n public refTagEntries: ThesaurusEntry[] | undefined;\r\n\r\n /**\r\n * Emitted whenever any ID changes.\r\n */\r\n @Output()\r\n public idsChange: EventEmitter<AssertedId[]>;\r\n\r\n public idsArr: FormArray;\r\n public form: FormGroup;\r\n // edited assertion\r\n public assEdOpen: boolean;\r\n public assertionNr?: number;\r\n public initialAssertion?: Assertion;\r\n public assertion?: Assertion;\r\n\r\n constructor(private _formBuilder: FormBuilder) {\r\n this._ids = [];\r\n this._idsSubs = [];\r\n this.idsChange = new EventEmitter<AssertedId[]>();\r\n this.assEdOpen = false;\r\n // form\r\n this.idsArr = _formBuilder.array([]);\r\n this.form = _formBuilder.group({\r\n idsArr: this.idsArr,\r\n });\r\n }\r\n\r\n public ngAfterViewInit(): void {\r\n // focus on newly added ID\r\n this._idSubscription = this.idQueryList?.changes\r\n .pipe(debounceTime(300))\r\n .subscribe((lst: QueryList<any>) => {\r\n if (!this._updatingForm && lst.length > 0) {\r\n lst.last.nativeElement.focus();\r\n }\r\n });\r\n }\r\n\r\n private unsubscribeIds(): void {\r\n for (let i = 0; i < this._idsSubs.length; i++) {\r\n this._idsSubs[i].unsubscribe();\r\n }\r\n }\r\n\r\n public ngOnDestroy(): void {\r\n this.unsubscribeIds();\r\n this._idSubscription?.unsubscribe();\r\n }\r\n\r\n private getIdGroup(id?: AssertedId): FormGroup {\r\n return this._formBuilder.group({\r\n value: this._formBuilder.control(id?.value, [\r\n Validators.required,\r\n Validators.maxLength(500),\r\n ]),\r\n scope: this._formBuilder.control(id?.scope, Validators.maxLength(50)),\r\n tag: this._formBuilder.control(id?.tag, Validators.maxLength(50)),\r\n assertion: this._formBuilder.control(id?.assertion),\r\n });\r\n }\r\n\r\n public addId(id?: AssertedId): void {\r\n const g = this.getIdGroup(id);\r\n this._idsSubs.push(\r\n g.valueChanges.pipe(debounceTime(300)).subscribe((_) => {\r\n this.emitIdsChange();\r\n })\r\n );\r\n this.idsArr.push(g);\r\n if (!this._updatingForm) {\r\n this.emitIdsChange();\r\n }\r\n }\r\n\r\n public removeId(index: number): void {\r\n this.closeAssertion();\r\n this._idsSubs[index].unsubscribe();\r\n this._idsSubs.splice(index, 1);\r\n this.idsArr.removeAt(index);\r\n this.emitIdsChange();\r\n }\r\n\r\n private swapArrElems(a: any[], i: number, j: number): void {\r\n if (i === j) {\r\n return;\r\n }\r\n const t = a[i];\r\n a[i] = a[j];\r\n a[j] = t;\r\n }\r\n\r\n public moveIdUp(index: number): void {\r\n if (index < 1) {\r\n return;\r\n }\r\n this.closeAssertion();\r\n const ctl = this.idsArr.controls[index];\r\n this.idsArr.removeAt(index);\r\n this.idsArr.insert(index - 1, ctl);\r\n\r\n this.swapArrElems(this._idsSubs, index, index - 1);\r\n\r\n this.emitIdsChange();\r\n }\r\n\r\n public moveIdDown(index: number): void {\r\n if (index + 1 >= this.idsArr.length) {\r\n return;\r\n }\r\n this.closeAssertion();\r\n const item = this.idsArr.controls[index];\r\n this.idsArr.removeAt(index);\r\n this.idsArr.insert(index + 1, item);\r\n\r\n this.swapArrElems(this._idsSubs, index, index + 1);\r\n\r\n this.emitIdsChange();\r\n }\r\n\r\n public clearIds(): void {\r\n this.closeAssertion();\r\n this.idsArr.clear();\r\n this.unsubscribeIds();\r\n this._idsSubs = [];\r\n if (!this._updatingForm) {\r\n this.emitIdsChange();\r\n }\r\n }\r\n\r\n public editAssertion(index: number): void {\r\n // save the currently edited assertion if any\r\n this.saveAssertion();\r\n // edit the new assertion\r\n this.initialAssertion = (\r\n this.idsArr.at(index) as FormGroup\r\n ).controls['assertion'].value;\r\n this.assertionNr = index + 1;\r\n this.assEdOpen = true;\r\n }\r\n\r\n public onAssertionChange(assertion: Assertion | undefined): void {\r\n this.assertion = assertion;\r\n }\r\n\r\n public saveAssertion(): void {\r\n // save the currently edited assertion if any\r\n if (this.assertionNr) {\r\n const g = this.idsArr.at(this.assertionNr - 1) as FormGroup;\r\n g.controls['assertion'].setValue(this.assertion);\r\n this.closeAssertion();\r\n this.emitIdsChange();\r\n }\r\n }\r\n\r\n private closeAssertion(): void {\r\n if (this.assertionNr) {\r\n this.assEdOpen = false;\r\n this.assertionNr = 0;\r\n this.initialAssertion = undefined;\r\n }\r\n }\r\n\r\n private updateForm(ids: AssertedId[]): void {\r\n if (!this.idsArr) {\r\n return;\r\n }\r\n this._updatingForm = true;\r\n this.clearIds();\r\n\r\n if (!ids) {\r\n this.form.reset();\r\n } else {\r\n for (const id of ids) {\r\n this.addId(id);\r\n }\r\n this.form.markAsPristine();\r\n }\r\n this._updatingForm = false;\r\n this.emitIdsChange();\r\n }\r\n\r\n private getIds(): AssertedId[] {\r\n const ids: AssertedId[] = [];\r\n for (let i = 0; i < this.idsArr.length; i++) {\r\n const g = this.idsArr.controls[i] as FormGroup;\r\n ids.push({\r\n value: g.controls.value.value?.trim(),\r\n scope: g.controls.scope.value?.trim(),\r\n tag: g.controls.tag.value?.trim(),\r\n assertion: g.controls.assertion.value,\r\n });\r\n }\r\n return ids;\r\n }\r\n\r\n private emitIdsChange(): void {\r\n this.idsChange.emit(this.getIds());\r\n }\r\n}\r\n","<form [formGroup]=\"form\">\r\n <div formArrayName=\"idsArr\">\r\n <div>\r\n <button\r\n type=\"button\"\r\n mat-stroked-button\r\n color=\"primary\"\r\n (click)=\"addId()\"\r\n matTooltip=\"Add a new ID\"\r\n >\r\n <mat-icon>add_circle</mat-icon> add ID\r\n </button>\r\n </div>\r\n <div\r\n *ngFor=\"\r\n let item of idsArr.controls;\r\n let i = index;\r\n let first = first;\r\n let last = last\r\n \"\r\n >\r\n <!-- child form -->\r\n <div [formGroupName]=\"i\">\r\n <!-- child actions -->\r\n {{ i + 1 }}.\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Remove this ID\"\r\n color=\"warn\"\r\n (click)=\"removeId(i)\"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n <button\r\n [disabled]=\"first\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Move ID up\"\r\n (click)=\"moveIdUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n [disabled]=\"last\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Move ID down\"\r\n (click)=\"moveIdDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n\r\n <!-- child controls -->\r\n <!-- value -->\r\n <mat-form-field>\r\n <input\r\n #id\r\n autofocus\r\n matInput\r\n formControlName=\"value\"\r\n placeholder=\"external ID\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].value?.hasError('required') &&\r\n ($any(item)['controls'].value.dirty ||\r\n $any(item)['controls'].value.touched)\r\n \"\r\n >ID required\r\n </mat-error>\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].value?.hasError('max-length') &&\r\n ($any(item)['controls'].value.dirty ||\r\n $any(item)['controls'].value.touched)\r\n \"\r\n >ID too long\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n &nbsp;\r\n <!-- scope (bound) -->\r\n <ng-container *ngIf=\"scopeEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <mat-select formControlName=\"scope\" placeholder=\"scope\">\r\n <mat-option *ngFor=\"let e of scopeEntries\" [value]=\"e.id\">\r\n {{ e.value }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- scope (free) -->\r\n <ng-container *ngIf=\"!scopeEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <input matInput formControlName=\"scope\" placeholder=\"scope\" />\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].scope?.hasError('max-length') &&\r\n ($any(item)['controls'].scope.dirty ||\r\n $any(item)['controls'].scope.touched)\r\n \"\r\n >scope too long\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n &nbsp;\r\n <!-- tag (bound) -->\r\n <ng-container *ngIf=\"tagEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <mat-select formControlName=\"tag\" placeholder=\"tag\">\r\n <mat-option *ngFor=\"let e of tagEntries\" [value]=\"e.id\">\r\n {{ e.value }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- tag (free) -->\r\n <ng-container *ngIf=\"!tagEntries\">\r\n <mat-form-field style=\"width: 8em\">\r\n <input matInput formControlName=\"tag\" placeholder=\"tag\" />\r\n <mat-error\r\n *ngIf=\"\r\n $any(item)['controls'].tag?.hasError('max-length') &&\r\n ($any(item)['controls'].tag.dirty ||\r\n $any(item)['controls'].tag.touched)\r\n \"\r\n >tag too long\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- assertion -->\r\n &nbsp;\r\n <button\r\n type=\"button\"\r\n color=\"primary\"\r\n mat-icon-button\r\n matTooltip=\"Edit assertion\"\r\n (click)=\"editAssertion(i)\"\r\n >\r\n <mat-icon>feedback</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <!-- assertion -->\r\n <mat-expansion-panel\r\n *ngIf=\"idsArr?.length\"\r\n [disabled]=\"!assertionNr\"\r\n [(expanded)]=\"assEdOpen\"\r\n >\r\n <mat-expansion-panel-header\r\n >#{{ assertionNr }} assertion</mat-expansion-panel-header\r\n >\r\n <cadmus-refs-assertion\r\n [assertion]=\"initialAssertion\"\r\n [assTagEntries]=\"assTagEntries\"\r\n [refTagEntries]=\"refTagEntries\"\r\n [refTypeEntries]=\"refTypeEntries\"\r\n (assertionChange)=\"onAssertionChange($event)\"\r\n ></cadmus-refs-assertion>\r\n <button\r\n color=\"primary\"\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"saveAssertion()\"\r\n >\r\n <mat-icon>check_circle</mat-icon> save assertion\r\n </button>\r\n </mat-expansion-panel>\r\n </div>\r\n</form>\r\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\n\nimport { CadmusCoreModule } from '@myrmidon/cadmus-core';\nimport { CadmusRefsAssertionModule } from '@myrmidon/cadmus-refs-assertion';\nimport { CadmusRefsDocReferencesModule } from '@myrmidon/cadmus-refs-doc-references';\n\nimport { AssertedIdComponent } from './asserted-id/asserted-id.component';\nimport { AssertedIdsComponent } from './asserted-ids/asserted-ids.component';\n\n@NgModule({\n declarations: [AssertedIdComponent, AssertedIdsComponent],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n // material\n MatButtonModule,\n MatExpansionModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatSelectModule,\n // Cadmus\n CadmusCoreModule,\n CadmusRefsDocReferencesModule,\n CadmusRefsAssertionModule,\n ],\n exports: [AssertedIdComponent, AssertedIdsComponent],\n})\nexport class CadmusRefsAssertedIdsModule {}\n","/*\n * Public API Surface of cadmus-refs-asserted-ids\n */\n\nexport * from './lib/asserted-id/asserted-id.component';\nexport * from './lib/asserted-ids/asserted-ids.component';\nexport * from './lib/cadmus-refs-asserted-ids.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i3","i4","i5","i6","i7","i8","i9","i10"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAuBa,mBAAmB,CAAA;AAuC9B,IAAA,WAAA,CAAY,WAAwB,EAAA;AAClC,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAc,CAAC;;AAE/C,QAAA,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE;AACrC,YAAA,UAAU,CAAC,QAAQ;AACnB,YAAA,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC;AAC1B,SAAA,CAAC,CAAC;AACH,QAAA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AAmB,EAAE,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAExC,2BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAjBpC,YAAY;QACZ,WAAW;QACX,mBAAmB;;QAEnB,eAAe;QACf,kBAAkB;QAClB,kBAAkB;QAClB,aAAa;QACb,cAAc;QACd,eAAe;;QAEf,gBAAgB;QAChB,6BAA6B;QAC7B,yBAAyB,CAAA,EAAA,CAAA,CAAA;2FAIhB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBApBvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;AACzD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;;wBAEnB,eAAe;wBACf,kBAAkB;wBAClB,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd,eAAe;;wBAEf,gBAAgB;wBAChB,6BAA6B;wBAC7B,yBAAyB;AAC1B,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;AACrD,iBAAA,CAAA;;;ACrCD;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@myrmidon/cadmus-refs-asserted-ids" />
5
+ export * from './public-api';
@@ -0,0 +1,37 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
+ import { ThesaurusEntry } from '@myrmidon/cadmus-core';
4
+ import { Assertion } from '@myrmidon/cadmus-refs-assertion';
5
+ import * as i0 from "@angular/core";
6
+ export interface AssertedId {
7
+ tag?: string;
8
+ value: string;
9
+ scope: string;
10
+ assertion?: Assertion;
11
+ }
12
+ export declare class AssertedIdComponent implements OnInit {
13
+ private _updatingForm;
14
+ private _id;
15
+ tag: FormControl<string | null>;
16
+ value: FormControl<string | null>;
17
+ scope: FormControl<string | null>;
18
+ form: FormGroup;
19
+ initialAssertion?: Assertion;
20
+ assertion?: Assertion;
21
+ scopeEntries?: ThesaurusEntry[];
22
+ idTagEntries?: ThesaurusEntry[];
23
+ assTagEntries?: ThesaurusEntry[];
24
+ refTypeEntries: ThesaurusEntry[] | undefined;
25
+ refTagEntries: ThesaurusEntry[] | undefined;
26
+ get id(): AssertedId | undefined;
27
+ set id(value: AssertedId | undefined);
28
+ idChange: EventEmitter<AssertedId>;
29
+ constructor(formBuilder: FormBuilder);
30
+ ngOnInit(): void;
31
+ onAssertionChange(assertion: Assertion | undefined): void;
32
+ private updateForm;
33
+ private getId;
34
+ emitIdChange(): void;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssertedIdComponent, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<AssertedIdComponent, "cadmus-refs-asserted-id", never, { "scopeEntries": "scopeEntries"; "idTagEntries": "idTagEntries"; "assTagEntries": "assTagEntries"; "refTypeEntries": "refTypeEntries"; "refTagEntries": "refTagEntries"; "id": "id"; }, { "idChange": "idChange"; }, never, never, false>;
37
+ }
@@ -0,0 +1,60 @@
1
+ import { EventEmitter, OnDestroy, QueryList } from '@angular/core';
2
+ import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
3
+ import { ThesaurusEntry } from '@myrmidon/cadmus-core';
4
+ import { Assertion } from '@myrmidon/cadmus-refs-assertion';
5
+ import { AssertedId } from '../asserted-id/asserted-id.component';
6
+ import * as i0 from "@angular/core";
7
+ export declare class AssertedIdsComponent implements OnDestroy {
8
+ private _formBuilder;
9
+ private _ids;
10
+ private _idSubscription;
11
+ private _idsSubs;
12
+ private _updatingForm;
13
+ idQueryList: QueryList<any> | undefined;
14
+ /**
15
+ * The asserted IDs.
16
+ */
17
+ get ids(): AssertedId[];
18
+ set ids(value: AssertedId[]);
19
+ /**
20
+ * The ID scopes thesaurus entries.
21
+ */
22
+ scopeEntries: ThesaurusEntry[] | undefined;
23
+ /**
24
+ * The ID tags thesaurus entries.
25
+ */
26
+ tagEntries: ThesaurusEntry[] | undefined;
27
+ assTagEntries?: ThesaurusEntry[];
28
+ refTypeEntries: ThesaurusEntry[] | undefined;
29
+ refTagEntries: ThesaurusEntry[] | undefined;
30
+ /**
31
+ * Emitted whenever any ID changes.
32
+ */
33
+ idsChange: EventEmitter<AssertedId[]>;
34
+ idsArr: FormArray;
35
+ form: FormGroup;
36
+ assEdOpen: boolean;
37
+ assertionNr?: number;
38
+ initialAssertion?: Assertion;
39
+ assertion?: Assertion;
40
+ constructor(_formBuilder: FormBuilder);
41
+ ngAfterViewInit(): void;
42
+ private unsubscribeIds;
43
+ ngOnDestroy(): void;
44
+ private getIdGroup;
45
+ addId(id?: AssertedId): void;
46
+ removeId(index: number): void;
47
+ private swapArrElems;
48
+ moveIdUp(index: number): void;
49
+ moveIdDown(index: number): void;
50
+ clearIds(): void;
51
+ editAssertion(index: number): void;
52
+ onAssertionChange(assertion: Assertion | undefined): void;
53
+ saveAssertion(): void;
54
+ private closeAssertion;
55
+ private updateForm;
56
+ private getIds;
57
+ private emitIdsChange;
58
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssertedIdsComponent, never>;
59
+ static ɵcmp: i0.ɵɵComponentDeclaration<AssertedIdsComponent, "cadmus-refs-asserted-ids", never, { "ids": "ids"; "scopeEntries": "scopeEntries"; "tagEntries": "tagEntries"; "assTagEntries": "assTagEntries"; "refTypeEntries": "refTypeEntries"; "refTagEntries": "refTagEntries"; }, { "idsChange": "idsChange"; }, never, never, false>;
60
+ }
@@ -0,0 +1,19 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./asserted-id/asserted-id.component";
3
+ import * as i2 from "./asserted-ids/asserted-ids.component";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@angular/forms";
6
+ import * as i5 from "@angular/material/button";
7
+ import * as i6 from "@angular/material/expansion";
8
+ import * as i7 from "@angular/material/form-field";
9
+ import * as i8 from "@angular/material/icon";
10
+ import * as i9 from "@angular/material/input";
11
+ import * as i10 from "@angular/material/select";
12
+ import * as i11 from "@myrmidon/cadmus-core";
13
+ import * as i12 from "@myrmidon/cadmus-refs-doc-references";
14
+ import * as i13 from "@myrmidon/cadmus-refs-assertion";
15
+ export declare class CadmusRefsAssertedIdsModule {
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<CadmusRefsAssertedIdsModule, never>;
17
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CadmusRefsAssertedIdsModule, [typeof i1.AssertedIdComponent, typeof i2.AssertedIdsComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.MatButtonModule, typeof i6.MatExpansionModule, typeof i7.MatFormFieldModule, typeof i8.MatIconModule, typeof i9.MatInputModule, typeof i10.MatSelectModule, typeof i11.CadmusCoreModule, typeof i12.CadmusRefsDocReferencesModule, typeof i13.CadmusRefsAssertionModule], [typeof i1.AssertedIdComponent, typeof i2.AssertedIdsComponent]>;
18
+ static ɵinj: i0.ɵɵInjectorDeclaration<CadmusRefsAssertedIdsModule>;
19
+ }