@myrmidon/cadmus-item-editor 0.0.13 → 0.3.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 (30) hide show
  1. package/README.md +24 -24
  2. package/esm2020/lib/cadmus-item-editor.module.mjs +83 -0
  3. package/esm2020/lib/item-editor/item-editor.component.mjs +353 -0
  4. package/esm2020/lib/missing-parts/missing-parts.component.mjs +71 -0
  5. package/esm2020/lib/parts-scope-editor/parts-scope-editor.component.mjs +118 -0
  6. package/esm2020/myrmidon-cadmus-item-editor.mjs +5 -0
  7. package/esm2020/public-api.mjs +6 -0
  8. package/fesm2015/myrmidon-cadmus-item-editor.mjs +607 -0
  9. package/fesm2015/myrmidon-cadmus-item-editor.mjs.map +1 -0
  10. package/fesm2020/myrmidon-cadmus-item-editor.mjs +604 -0
  11. package/fesm2020/myrmidon-cadmus-item-editor.mjs.map +1 -0
  12. package/lib/cadmus-item-editor.module.d.ts +19 -0
  13. package/lib/item-editor/item-editor.component.d.ts +20 -17
  14. package/lib/missing-parts/missing-parts.component.d.ts +12 -9
  15. package/lib/parts-scope-editor/parts-scope-editor.component.d.ts +8 -5
  16. package/myrmidon-cadmus-item-editor.d.ts +1 -2
  17. package/package.json +27 -15
  18. package/bundles/myrmidon-cadmus-item-editor.umd.js +0 -929
  19. package/bundles/myrmidon-cadmus-item-editor.umd.js.map +0 -1
  20. package/bundles/myrmidon-cadmus-item-editor.umd.min.js +0 -16
  21. package/bundles/myrmidon-cadmus-item-editor.umd.min.js.map +0 -1
  22. package/esm2015/lib/cadmus-item-editor.module.js +0 -45
  23. package/esm2015/lib/item-editor/item-editor.component.js +0 -337
  24. package/esm2015/lib/missing-parts/missing-parts.component.js +0 -62
  25. package/esm2015/lib/parts-scope-editor/parts-scope-editor.component.js +0 -115
  26. package/esm2015/myrmidon-cadmus-item-editor.js +0 -7
  27. package/esm2015/public-api.js +0 -6
  28. package/fesm2015/myrmidon-cadmus-item-editor.js +0 -554
  29. package/fesm2015/myrmidon-cadmus-item-editor.js.map +0 -1
  30. package/myrmidon-cadmus-item-editor.metadata.json +0 -1
@@ -0,0 +1,604 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
3
+ import * as i7 from '@angular/forms';
4
+ import { Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
5
+ import * as i1$1 from '@angular/router';
6
+ import { RouterModule } from '@angular/router';
7
+ import * as i2$2 from '@angular/material/snack-bar';
8
+ import * as i3$2 from '@myrmidon/cadmus-state';
9
+ import { CadmusStateModule } from '@myrmidon/cadmus-state';
10
+ import * as i4 from '@myrmidon/cadmus-core';
11
+ import { CadmusCoreModule } from '@myrmidon/cadmus-core';
12
+ import * as i3$1 from '@myrmidon/ng-mat-tools';
13
+ import { NgMatToolsModule } from '@myrmidon/ng-mat-tools';
14
+ import * as i2$1 from '@myrmidon/cadmus-api';
15
+ import { CadmusApiModule } from '@myrmidon/cadmus-api';
16
+ import * as i8 from '@angular/material/card';
17
+ import * as i9$1 from '@angular/material/progress-bar';
18
+ import * as i10 from '@angular/material/tabs';
19
+ import * as i6 from '@angular/material/form-field';
20
+ import * as i12 from '@angular/material/select';
21
+ import * as i13 from '@angular/material/core';
22
+ import * as i5$1 from '@angular/material/checkbox';
23
+ import * as i2 from '@angular/material/button';
24
+ import * as i1 from '@angular/material/icon';
25
+ import * as i17 from '@angular/material/divider';
26
+ import * as i18 from '@angular/material/expansion';
27
+ import * as i3 from '@myrmidon/cadmus-ui';
28
+ import { CustomValidators, CadmusUiModule } from '@myrmidon/cadmus-ui';
29
+ import * as i22 from '@angular/common';
30
+ import { CommonModule } from '@angular/common';
31
+ import * as i5 from '@angular/material/tooltip';
32
+ import * as i9 from '@angular/material/input';
33
+ import * as i11 from 'ngx-moment';
34
+ import { MomentModule } from 'ngx-moment';
35
+ import * as i24 from '@angular/cdk/clipboard';
36
+ import { ClipboardModule } from '@angular/cdk/clipboard';
37
+ import * as i26 from '@angular/flex-layout/extended';
38
+ import { CadmusMaterialModule } from '@myrmidon/cadmus-material';
39
+ import { NgToolsModule } from '@myrmidon/ng-tools';
40
+
41
+ class MissingPartsComponent {
42
+ constructor() {
43
+ this.missingDefinitions = [];
44
+ this.addRequest = new EventEmitter();
45
+ }
46
+ get partDefinitions() {
47
+ return this._partDefinitions;
48
+ }
49
+ set partDefinitions(value) {
50
+ this._partDefinitions = value;
51
+ this.updateMissing();
52
+ }
53
+ get parts() {
54
+ return this._parts;
55
+ }
56
+ set parts(value) {
57
+ this._parts = value;
58
+ this.updateMissing();
59
+ }
60
+ /**
61
+ * The types thesaurus.
62
+ */
63
+ get typeThesaurus() {
64
+ return this._typeThesaurus;
65
+ }
66
+ set typeThesaurus(value) {
67
+ this._typeThesaurus = value;
68
+ this.updateMissing();
69
+ }
70
+ ngOnInit() { }
71
+ isPartPresent(typeId, roleId) {
72
+ if (!this._partDefinitions) {
73
+ return false;
74
+ }
75
+ return this._partDefinitions.some((d) => d.typeId === typeId && d.roleId === roleId);
76
+ }
77
+ updateMissing() {
78
+ this.missingDefinitions.length = 0;
79
+ if (!this._partDefinitions) {
80
+ return;
81
+ }
82
+ for (let i = 0; i < this._partDefinitions.length; i++) {
83
+ const def = this._partDefinitions[i];
84
+ if (!this.isPartPresent(def.typeId, def.roleId)) {
85
+ this.missingDefinitions.push(def);
86
+ }
87
+ }
88
+ }
89
+ }
90
+ MissingPartsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: MissingPartsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
91
+ MissingPartsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: MissingPartsComponent, selector: "cadmus-missing-parts", inputs: { partDefinitions: "partDefinitions", parts: "parts", typeThesaurus: "typeThesaurus" }, outputs: { addRequest: "addRequest" }, ngImport: i0, template: "<div *ngIf=\"missingDefinitions.length\">\r\n <h3><mat-icon color=\"warn\">warning</mat-icon>&nbsp; Missing Parts</h3>\r\n <table>\r\n <tbody>\r\n <tr *ngFor=\"let def of missingDefinitions\">\r\n <td>\r\n <button type=\"button\" mat-icon-button matTooltip=\"Add this part\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td matTooltip=\"def.description\">\r\n <cadmus-part-badge\r\n [partTypeIds]=\"def\"\r\n [facetDefinition]=\"def\"\r\n [typeThesaurus]=\"typeThesaurus\"\r\n ></cadmus-part-badge>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n", styles: [""], components: [{ type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.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"] }, { type: i3.PartBadgeComponent, selector: "cadmus-part-badge", inputs: ["badgeType", "typeThesaurus", "facetDefinition", "partTypeIds"] }], directives: [{ type: i22.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i22.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: MissingPartsComponent, decorators: [{
93
+ type: Component,
94
+ args: [{ selector: 'cadmus-missing-parts', template: "<div *ngIf=\"missingDefinitions.length\">\r\n <h3><mat-icon color=\"warn\">warning</mat-icon>&nbsp; Missing Parts</h3>\r\n <table>\r\n <tbody>\r\n <tr *ngFor=\"let def of missingDefinitions\">\r\n <td>\r\n <button type=\"button\" mat-icon-button matTooltip=\"Add this part\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td matTooltip=\"def.description\">\r\n <cadmus-part-badge\r\n [partTypeIds]=\"def\"\r\n [facetDefinition]=\"def\"\r\n [typeThesaurus]=\"typeThesaurus\"\r\n ></cadmus-part-badge>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n", styles: [""] }]
95
+ }], ctorParameters: function () { return []; }, propDecorators: { partDefinitions: [{
96
+ type: Input
97
+ }], parts: [{
98
+ type: Input
99
+ }], typeThesaurus: [{
100
+ type: Input
101
+ }], addRequest: [{
102
+ type: Output
103
+ }] } });
104
+
105
+ /**
106
+ * Parts thesaurus scope dumb editor component.
107
+ * This is used to set the thesaurus scope of multiple item's parts at once
108
+ * in the item editor.
109
+ */
110
+ class PartsScopeEditorComponent {
111
+ constructor(_formBuilder, _facetService, _dialogService, _appQuery, _itemQuery) {
112
+ this._formBuilder = _formBuilder;
113
+ this._facetService = _facetService;
114
+ this._dialogService = _dialogService;
115
+ this._appQuery = _appQuery;
116
+ this._itemQuery = _itemQuery;
117
+ // events
118
+ this.setScopeRequest = new EventEmitter();
119
+ // form
120
+ this.checks = _formBuilder.array([], CustomValidators.minChecked(1));
121
+ this.scope = _formBuilder.control(null, [
122
+ Validators.maxLength(50),
123
+ Validators.pattern(/^[-a-zA-Z0-9_]+$/),
124
+ ]);
125
+ this.form = _formBuilder.group({
126
+ checks: this.checks,
127
+ scope: this.scope,
128
+ });
129
+ }
130
+ get parts() {
131
+ return this._parts;
132
+ }
133
+ set parts(value) {
134
+ this._parts = value;
135
+ this.updateForm();
136
+ }
137
+ ngOnInit() { }
138
+ updateForm() {
139
+ this.checks.clear();
140
+ if (!this._parts || this._parts.length === 0) {
141
+ return;
142
+ }
143
+ for (let i = 0; i < this._parts.length; i++) {
144
+ this.checks.push(this._formBuilder.control(false));
145
+ }
146
+ }
147
+ getPartColor(typeId, roleId) {
148
+ const state = this._itemQuery.getValue();
149
+ return this._facetService.getPartColor(typeId, roleId, state?.facet);
150
+ }
151
+ getTypeIdName(typeId) {
152
+ const state = this._appQuery.getValue();
153
+ if (!state || !state.typeThesaurus) {
154
+ return typeId;
155
+ }
156
+ // strip :suffix if any
157
+ const i = typeId.lastIndexOf(':');
158
+ if (i > -1) {
159
+ typeId = typeId.substr(0, i);
160
+ }
161
+ const entry = state.typeThesaurus.entries?.find((e) => e.id === typeId);
162
+ return entry ? entry.value : typeId;
163
+ }
164
+ getRoleIdName(roleId) {
165
+ if (!roleId || !roleId.startsWith('fr.')) {
166
+ return roleId;
167
+ }
168
+ return this.getTypeIdName(roleId);
169
+ }
170
+ submit() {
171
+ if (this.form.invalid || !this._parts) {
172
+ return;
173
+ }
174
+ const ids = [];
175
+ for (let i = 0; i < this.checks.length; i++) {
176
+ if (this.checks.controls[i].value === true) {
177
+ ids.push(this._parts[i].id);
178
+ }
179
+ }
180
+ let msg = this.scope.value
181
+ ? `Assign scope "${this.scope.value}" to ${ids.length} part`
182
+ : `Remove scope from ${ids.length} part`;
183
+ msg += ids.length > 1 ? 's?' : '?';
184
+ this._dialogService.confirm('Confirm Scopes', msg).subscribe((result) => {
185
+ if (!result) {
186
+ return;
187
+ }
188
+ this.setScopeRequest.emit({
189
+ ids,
190
+ scope: this.scope.value,
191
+ });
192
+ });
193
+ }
194
+ }
195
+ PartsScopeEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: PartsScopeEditorComponent, deps: [{ token: i7.FormBuilder }, { token: i2$1.FacetService }, { token: i3$1.DialogService }, { token: i3$2.AppQuery }, { token: i3$2.EditItemQuery }], target: i0.ɵɵFactoryTarget.Component });
196
+ PartsScopeEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: PartsScopeEditorComponent, selector: "cadmus-parts-scope-editor", inputs: { parts: "parts", readonly: "readonly" }, outputs: { setScopeRequest: "setScopeRequest" }, ngImport: i0, template: "<form [formGroup]=\"form\" (submit)=\"submit()\">\r\n <table id=\"parts\">\r\n <thead>\r\n <tr>\r\n <th style=\"min-width: 32px;\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>scope</th>\r\n <th>modified</th>\r\n <th>user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n formArrayName=\"checks\"\r\n *ngFor=\"let ctl of checks.controls; let i = index\"\r\n >\r\n <td>\r\n &nbsp;\r\n <mat-checkbox [formControlName]=\"i\"></mat-checkbox>\r\n </td>\r\n <td>\r\n <span\r\n class=\"model-type\"\r\n [style.background-color]=\"\r\n getPartColor(parts[i].typeId, parts[i].roleId)\r\n \"\r\n >{{ getTypeIdName(parts[i].typeId) }}</span\r\n >\r\n </td>\r\n <td>{{ getRoleIdName(parts[i].roleId) }}</td>\r\n <td>{{ parts[i].thesaurusScope }}</td>\r\n <td>{{ parts[i].timeModified | amLocal | amTimeAgo }}</td>\r\n <td>{{ parts[i].userId }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div>\r\n <mat-form-field>\r\n <input matInput placeholder=\"scope\" formControlName=\"scope\" />\r\n <mat-error\r\n *ngIf=\"scope.hasError('maxLength') && (scope.dirty || scope.touched)\"\r\n >too long</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"scope.hasError('pattern') && (scope.dirty || scope.touched)\"\r\n >invalid scope</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n <button\r\n mat-raised-button\r\n color=\"primary\"\r\n type=\"submit\"\r\n [disabled]=\"form.invalid || readonly\"\r\n matTooltip=\"Assign the scope to the checked parts\"\r\n >\r\n assign\r\n </button>\r\n</form>\r\n", styles: ["th{font-weight:normal;color:silver;text-align:left}span.model-type{padding:4px;border-radius:6px}table#parts{border-collapse:separate;border-spacing:0 8px}\n"], components: [{ type: i5$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2.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"] }], directives: [{ type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i22.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i22.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], pipes: { "amTimeAgo": i11.TimeAgoPipe, "amLocal": i11.LocalTimePipe } });
197
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: PartsScopeEditorComponent, decorators: [{
198
+ type: Component,
199
+ args: [{ selector: 'cadmus-parts-scope-editor', template: "<form [formGroup]=\"form\" (submit)=\"submit()\">\r\n <table id=\"parts\">\r\n <thead>\r\n <tr>\r\n <th style=\"min-width: 32px;\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>scope</th>\r\n <th>modified</th>\r\n <th>user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n formArrayName=\"checks\"\r\n *ngFor=\"let ctl of checks.controls; let i = index\"\r\n >\r\n <td>\r\n &nbsp;\r\n <mat-checkbox [formControlName]=\"i\"></mat-checkbox>\r\n </td>\r\n <td>\r\n <span\r\n class=\"model-type\"\r\n [style.background-color]=\"\r\n getPartColor(parts[i].typeId, parts[i].roleId)\r\n \"\r\n >{{ getTypeIdName(parts[i].typeId) }}</span\r\n >\r\n </td>\r\n <td>{{ getRoleIdName(parts[i].roleId) }}</td>\r\n <td>{{ parts[i].thesaurusScope }}</td>\r\n <td>{{ parts[i].timeModified | amLocal | amTimeAgo }}</td>\r\n <td>{{ parts[i].userId }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div>\r\n <mat-form-field>\r\n <input matInput placeholder=\"scope\" formControlName=\"scope\" />\r\n <mat-error\r\n *ngIf=\"scope.hasError('maxLength') && (scope.dirty || scope.touched)\"\r\n >too long</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"scope.hasError('pattern') && (scope.dirty || scope.touched)\"\r\n >invalid scope</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n <button\r\n mat-raised-button\r\n color=\"primary\"\r\n type=\"submit\"\r\n [disabled]=\"form.invalid || readonly\"\r\n matTooltip=\"Assign the scope to the checked parts\"\r\n >\r\n assign\r\n </button>\r\n</form>\r\n", styles: ["th{font-weight:normal;color:silver;text-align:left}span.model-type{padding:4px;border-radius:6px}table#parts{border-collapse:separate;border-spacing:0 8px}\n"] }]
200
+ }], ctorParameters: function () { return [{ type: i7.FormBuilder }, { type: i2$1.FacetService }, { type: i3$1.DialogService }, { type: i3$2.AppQuery }, { type: i3$2.EditItemQuery }]; }, propDecorators: { parts: [{
201
+ type: Input
202
+ }], readonly: [{
203
+ type: Input
204
+ }], setScopeRequest: [{
205
+ type: Output
206
+ }] } });
207
+
208
+ /**
209
+ * Item editor. This can edit a new or existing item's metadata and parts.
210
+ */
211
+ class ItemEditorComponent {
212
+ constructor(_router, _route, _snackbar, _appQuery, _query, _editItemService, _libraryRouteService, _dialogService, _authService, _formBuilder) {
213
+ this._router = _router;
214
+ this._route = _route;
215
+ this._snackbar = _snackbar;
216
+ this._appQuery = _appQuery;
217
+ this._query = _query;
218
+ this._editItemService = _editItemService;
219
+ this._libraryRouteService = _libraryRouteService;
220
+ this._dialogService = _dialogService;
221
+ this._authService = _authService;
222
+ this._formBuilder = _formBuilder;
223
+ this.id = this._route.snapshot.params.id;
224
+ this.flagDefinitions = [];
225
+ this.newPartDefinitions = [];
226
+ if (this.id === 'new') {
227
+ this.id = undefined;
228
+ }
229
+ // new part form
230
+ this.newPartType = _formBuilder.control(null, Validators.required);
231
+ this.newPart = _formBuilder.group({
232
+ newPartType: this.newPartType,
233
+ });
234
+ // item's metadata form
235
+ this.title = _formBuilder.control(null, [
236
+ Validators.required,
237
+ Validators.maxLength(500),
238
+ ]);
239
+ this.sortKey = _formBuilder.control(null, [
240
+ Validators.required,
241
+ Validators.maxLength(500),
242
+ ]);
243
+ this.sortKey.disable();
244
+ this.description = _formBuilder.control(null, [
245
+ Validators.required,
246
+ Validators.maxLength(1000),
247
+ ]);
248
+ this.facet = _formBuilder.control(null, Validators.required);
249
+ this.group = _formBuilder.control(null, Validators.maxLength(100));
250
+ this.flags = _formBuilder.control(0);
251
+ this.flagChecks = _formBuilder.array([]);
252
+ this.metadata = _formBuilder.group({
253
+ title: this.title,
254
+ sortKey: this.sortKey,
255
+ description: this.description,
256
+ facet: this.facet,
257
+ group: this.group,
258
+ flagChecks: this.flagChecks,
259
+ });
260
+ this.userLevel = 0;
261
+ this.item$ = this._query.selectItem();
262
+ this.parts$ = this._query.selectParts();
263
+ this.partGroups$ = this._query.select((state) => state.partGroups);
264
+ this.layerPartInfos$ = this._query.select((state) => state.layerPartInfos);
265
+ this.facet$ = this._query.selectFacet();
266
+ this.facets$ = this._appQuery.selectFacets();
267
+ this.typeThesaurus$ = this._appQuery.selectTypeThesaurus();
268
+ this.loading$ = this._query.selectLoading();
269
+ this.saving$ = this._query.selectSaving();
270
+ this.deletingPart$ = this._query.selectDeletingPart();
271
+ this.error$ = this._query.selectError();
272
+ }
273
+ ngOnInit() {
274
+ this._authService.currentUser$.subscribe((user) => {
275
+ this.user = user || undefined;
276
+ this.userLevel = this._authService.getCurrentUserLevel();
277
+ });
278
+ // rebuild the flags controls array when flags definitions change
279
+ this._appQuery.selectFlags().subscribe((defs) => {
280
+ this.flagDefinitions = defs;
281
+ this.buildFlagsControls();
282
+ });
283
+ // when flags controls values change, update the flags value
284
+ this.flagChecks.valueChanges.subscribe((_) => {
285
+ this.flags.setValue(this.getFlagsValue());
286
+ });
287
+ // update the metadata form when item changes
288
+ this.item$.subscribe((item) => {
289
+ this.updateMetadataForm(item);
290
+ this.newPartDefinitions = this.getNewPartDefinitions();
291
+ });
292
+ // load the item (if any) and its lookup
293
+ this._editItemService.load(this.id);
294
+ }
295
+ canDeactivate() {
296
+ return !this.metadata.dirty;
297
+ }
298
+ getExistingPartTypeAndRoleIds() {
299
+ const groups = this._query.getValue().partGroups;
300
+ if (!groups) {
301
+ return [];
302
+ }
303
+ const results = [];
304
+ for (const group of groups) {
305
+ for (const part of group.parts) {
306
+ results.push({
307
+ typeId: part.typeId,
308
+ roleId: part.roleId,
309
+ });
310
+ }
311
+ }
312
+ return results;
313
+ }
314
+ getNewPartDefinitions() {
315
+ const facet = this._query.getValue().facet;
316
+ if (!facet) {
317
+ return [];
318
+ }
319
+ const existingTypeRoleIds = this.getExistingPartTypeAndRoleIds();
320
+ const defs = [];
321
+ for (const def of facet.partDefinitions) {
322
+ // exclude layer parts, as these are in the layers tab
323
+ if (def.roleId?.startsWith('fr.')) {
324
+ continue;
325
+ }
326
+ // exclude parts present in the item
327
+ if (existingTypeRoleIds.find((tr) => {
328
+ return (tr.typeId === def.typeId &&
329
+ ((!tr.roleId && !def.roleId) || tr.roleId === def.roleId));
330
+ })) {
331
+ continue;
332
+ }
333
+ defs.push(def);
334
+ }
335
+ // sort by sort key
336
+ defs.sort((a, b) => {
337
+ return a.sortKey.localeCompare(b.sortKey);
338
+ });
339
+ return defs;
340
+ }
341
+ /**
342
+ * Builds the array of flags controls according to the current flags
343
+ * definitions and the current flags value.
344
+ */
345
+ buildFlagsControls() {
346
+ this.flagChecks.clear();
347
+ for (const def of this.flagDefinitions) {
348
+ const flagValue = def.id;
349
+ // tslint:disable-next-line: no-bitwise
350
+ const checked = (this.flags.value & flagValue) !== 0;
351
+ this.flagChecks.push(this._formBuilder.control(checked));
352
+ }
353
+ }
354
+ /**
355
+ * Update the flags controls from the current flags value.
356
+ */
357
+ updateFlagControls() {
358
+ if (!this.flagDefinitions) {
359
+ return;
360
+ }
361
+ for (let i = 0; i < this.flagDefinitions.length; i++) {
362
+ const flagValue = this.flagDefinitions[i].id;
363
+ // tslint:disable-next-line: no-bitwise
364
+ const checked = (this.flags.value & flagValue) !== 0;
365
+ this.flagChecks.at(i).setValue(checked);
366
+ }
367
+ }
368
+ /**
369
+ * Get the flags value from the flags controls.
370
+ */
371
+ getFlagsValue() {
372
+ let flagsValue = 0;
373
+ for (let i = 0; i < this.flagDefinitions.length; i++) {
374
+ const flagValue = this.flagDefinitions[i].id;
375
+ if (this.flagChecks.at(i).value) {
376
+ // tslint:disable-next-line: no-bitwise
377
+ flagsValue |= flagValue;
378
+ }
379
+ }
380
+ return flagsValue;
381
+ }
382
+ updateMetadataForm(item) {
383
+ if (!item) {
384
+ this.metadata.reset();
385
+ this.updateFlagControls();
386
+ }
387
+ else {
388
+ this.title.setValue(item.title);
389
+ this.sortKey.setValue(item.sortKey);
390
+ this.description.setValue(item.description);
391
+ this.facet.setValue(item.facetId);
392
+ this.group.setValue(item.groupId);
393
+ this.flags.setValue(item.flags);
394
+ this.updateFlagControls();
395
+ this.metadata.markAsPristine();
396
+ }
397
+ }
398
+ getTypeIdName(typeId) {
399
+ const state = this._appQuery.getValue();
400
+ if (!state || !state.typeThesaurus) {
401
+ return typeId;
402
+ }
403
+ // strip :suffix if any
404
+ const i = typeId.lastIndexOf(':');
405
+ if (i > -1) {
406
+ typeId = typeId.substr(0, i);
407
+ }
408
+ const entry = state.typeThesaurus.entries?.find((e) => e.id === typeId);
409
+ return entry ? entry.value : typeId;
410
+ }
411
+ getRoleIdName(roleId) {
412
+ if (!roleId || !roleId.startsWith('fr.')) {
413
+ return roleId;
414
+ }
415
+ return this.getTypeIdName(roleId);
416
+ }
417
+ tryTrim(value) {
418
+ return value ? value.trim() : value;
419
+ }
420
+ save() {
421
+ if (!this.metadata.valid) {
422
+ return;
423
+ }
424
+ const item = { ...this._query.getValue().item };
425
+ if (!item) {
426
+ return;
427
+ }
428
+ item.title = this.tryTrim(this.title.value);
429
+ item.sortKey = this.sortKey.value;
430
+ item.description = this.tryTrim(this.description.value);
431
+ item.facetId = this.tryTrim(this.facet.value);
432
+ item.groupId = this.tryTrim(this.group.value);
433
+ item.flags = this.flags.value;
434
+ // save and reload as edited if was new
435
+ this._editItemService.save(item).then((saved) => {
436
+ this.metadata.markAsPristine();
437
+ if (!item.id) {
438
+ this.id = saved.id;
439
+ this._router.navigate(['/items', saved.id]);
440
+ }
441
+ });
442
+ }
443
+ partExists(typeId, roleId) {
444
+ const groups = this._query.getValue().partGroups;
445
+ if (!groups) {
446
+ return false;
447
+ }
448
+ return groups.some((g) => {
449
+ return g.parts.some((p) => p.typeId === typeId && ((!p.roleId && !roleId) || p.roleId === roleId));
450
+ });
451
+ }
452
+ addPart(def) {
453
+ if (!def && !this.newPartType.valid) {
454
+ return;
455
+ }
456
+ if (!this.id) {
457
+ this._snackbar.open('Please save the item before adding parts', 'OK', {
458
+ duration: 3000,
459
+ });
460
+ return;
461
+ }
462
+ const typeId = def ? def.typeId : this.newPartType.value.typeId;
463
+ const roleId = def ? def.roleId : this.newPartType.value.roleId;
464
+ if (this.partExists(typeId, roleId)) {
465
+ return;
466
+ }
467
+ const route = this._libraryRouteService.buildPartEditorRoute(this.id, 'new', typeId, roleId);
468
+ // navigate to the editor
469
+ this._router.navigate([route.route], route.rid
470
+ ? {
471
+ queryParams: {
472
+ rid: route.rid,
473
+ },
474
+ }
475
+ : {});
476
+ }
477
+ editPart(part) {
478
+ // build the target route to the appropriate part editor
479
+ const route = this._libraryRouteService.buildPartEditorRoute(part.itemId, part.id, part.typeId, part.roleId);
480
+ // navigate to the editor
481
+ this._router.navigate([route.route], route.rid
482
+ ? {
483
+ queryParams: {
484
+ rid: route.rid,
485
+ },
486
+ }
487
+ : {});
488
+ }
489
+ deletePart(part) {
490
+ this._dialogService
491
+ .confirm('Confirm Deletion', `Delete part "${part.typeId}"?`)
492
+ .subscribe((result) => {
493
+ if (!result) {
494
+ return;
495
+ }
496
+ // delete
497
+ this._editItemService.deletePart(part.id).then((_) => {
498
+ // once deleted, refresh new-part definitions
499
+ this.newPartDefinitions = this.getNewPartDefinitions();
500
+ }, (error) => {
501
+ console.error(error);
502
+ this._snackbar.open('Error deleting part', 'OK');
503
+ });
504
+ });
505
+ }
506
+ addLayerPart(part) {
507
+ let name = this.getTypeIdName(part.typeId);
508
+ if (part.roleId) {
509
+ name += ' for ' + this.getRoleIdName(part.roleId);
510
+ }
511
+ this._dialogService
512
+ .confirm('Confirm Addition', `Add layer "${name}"?`)
513
+ .subscribe((result) => {
514
+ if (!result) {
515
+ return;
516
+ }
517
+ this._editItemService.addNewLayerPart(part.itemId, part.typeId, part.roleId);
518
+ });
519
+ }
520
+ setPartsScope(request) {
521
+ this._editItemService.setPartThesaurusScope(request.ids, request.scope);
522
+ }
523
+ }
524
+ ItemEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: ItemEditorComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i2$2.MatSnackBar }, { token: i3$2.AppQuery }, { token: i3$2.EditItemQuery }, { token: i3$2.EditItemService }, { token: i4.LibraryRouteService }, { token: i3$1.DialogService }, { token: i2$1.AuthService }, { token: i7.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
525
+ ItemEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: ItemEditorComponent, selector: "cadmus-item-editor", ngImport: i0, template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n {{ (item$ | async)?.title || \"Item\" }}\r\n </mat-card-title>\r\n <mat-card-subtitle>\r\n {{ (item$ | async)?.description }}\r\n </mat-card-subtitle>\r\n </mat-card-header>\r\n <mat-card-content *ngIf=\"!id || (item$ | async) as item\">\r\n <p *ngIf=\"id\">\r\n ID:\r\n <input\r\n [cdkCopyToClipboard]=\"item.id\"\r\n type=\"text\"\r\n readonly=\"true\"\r\n spellcheck=\"false\"\r\n matTooltip=\"Click to copy\"\r\n [value]=\"item.id\"\r\n class=\"id\"\r\n />\r\n </p>\r\n <p *ngIf=\"id\">\r\n Last saved {{ item.timeModified | amLocal | amTimeAgo }} by\r\n {{ item.userId }} on\r\n {{ item.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}.<br />\r\n Created {{ item.timeCreated | amLocal | amTimeAgo }} by\r\n {{ item.creatorId }} on\r\n {{ item.timeCreated | date: \"yyyy-MM-dd HH:mm:ss\" }}.\r\n </p>\r\n <p *ngIf=\"error$ | async as error\">\r\n <mat-error>\r\n {{ error }}\r\n </mat-error>\r\n </p>\r\n\r\n <mat-progress-bar\r\n mode=\"indeterminate\"\r\n *ngIf=\"(loading$ | async) || (saving$ | async)\"\r\n ></mat-progress-bar>\r\n\r\n <!-- item content -->\r\n <mat-tab-group [selectedIndex]=\"id ? 1 : 0\">\r\n <!-- metadata -->\r\n <mat-tab label=\"Metadata\">\r\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\r\n <!-- title -->\r\n <div>\r\n <mat-form-field>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"title\"\r\n placeholder=\"title\"\r\n formControlName=\"title\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n title.hasError('required') && (title.touched || title.dirty)\r\n \"\r\n >enter title</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n title.hasError('maxLength') && (title.touched || title.dirty)\r\n \"\r\n >\r\n title too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- sortKey -->\r\n <div>\r\n <mat-form-field>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"sortKey\"\r\n placeholder=\"sort key\"\r\n formControlName=\"sortKey\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n sortKey.hasError('required') &&\r\n (sortKey.touched || sortKey.dirty)\r\n \"\r\n >enter sort key</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n sortKey.hasError('maxLength') &&\r\n (sortKey.touched || sortKey.dirty)\r\n \"\r\n >sort key too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- description -->\r\n <div>\r\n <mat-form-field class=\"full-width\">\r\n <textarea\r\n rows=\"2\"\r\n matInput\r\n id=\"description\"\r\n placeholder=\"description\"\r\n formControlName=\"description\"\r\n ></textarea>\r\n <mat-error\r\n *ngIf=\"\r\n description.hasError('required') &&\r\n (description.touched || description.dirty)\r\n \"\r\n >enter description</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n description.hasError('maxLength') &&\r\n (description.touched || description.dirty)\r\n \"\r\n >description too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- facet -->\r\n <div>\r\n <mat-form-field style=\"width: 400px\">\r\n <mat-select\r\n placeholder=\"facet\"\r\n formControlName=\"facet\"\r\n required=\"true\"\r\n >\r\n <mat-option *ngFor=\"let f of facets$ | async\" [value]=\"f.id\">\r\n {{ f.label }}\r\n </mat-option>\r\n </mat-select>\r\n <mat-error>please select a facet</mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- group -->\r\n <div>\r\n <mat-form-field>\r\n <input matInput formControlName=\"group\" placeholder=\"group ID\" />\r\n <mat-error\r\n *ngIf=\"\r\n group.hasError('maxLength') && (group.dirty || group.touched)\r\n \"\r\n >too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- flags -->\r\n <div formArrayName=\"flagChecks\" *ngIf=\"flagDefinitions\">\r\n <mat-checkbox\r\n class=\"flag\"\r\n *ngFor=\"let c of flagChecks.controls; let i = index\"\r\n [formControlName]=\"i\"\r\n >\r\n <span [style.color]=\"'#' + flagDefinitions[i].colorKey\"\r\n >&#x2b24;</span\r\n >\r\n &nbsp;\r\n {{ flagDefinitions[i].label }}\r\n </mat-checkbox>\r\n </div>\r\n <br />\r\n\r\n <div>\r\n <button\r\n type=\"submit\"\r\n mat-raised-button\r\n color=\"primary\"\r\n [disabled]=\"\r\n userLevel < 2 || (saving$ | async) || (loading$ | async)\r\n \"\r\n matTooltip=\"Save metadata\"\r\n *ngIf=\"\r\n user?.roles?.length &&\r\n (user.roles.includes('admin') ||\r\n user.roles.includes('editor') ||\r\n user.roles.includes('operator'))\r\n \"\r\n >\r\n <mat-icon>save</mat-icon> save\r\n </button>\r\n </div>\r\n </form>\r\n </mat-tab>\r\n\r\n <!-- parts -->\r\n <mat-tab label=\"Parts\" *ngIf=\"id\">\r\n <div class=\"new-part\">\r\n <form [formGroup]=\"newPart\">\r\n <mat-form-field>\r\n <mat-select\r\n placeholder=\"part\"\r\n formControlName=\"newPartType\"\r\n required\r\n >\r\n <mat-option *ngFor=\"let p of newPartDefinitions\" [value]=\"p\">\r\n <span [style.color]=\"'#' + p.colorKey\" class=\"new-part-icon\"\r\n >&#x2b24;</span\r\n >\r\n {{ p.name }}\r\n <span *ngIf=\"p.roleId\" class=\"new-part-role\">{{\r\n p.roleId\r\n }}</span>\r\n </mat-option>\r\n </mat-select>\r\n <mat-error>part type required</mat-error>\r\n </mat-form-field>\r\n &nbsp;\r\n <button\r\n mat-stroked-button\r\n color=\"primary\"\r\n type=\"button\"\r\n [disabled]=\"userLevel < 2 || (loading$ | async) || !newPart.valid\"\r\n (click)=\"addPart()\"\r\n matTooltip=\"Add a new part of the selected type\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n add part\r\n </button>\r\n </form>\r\n </div>\r\n\r\n <mat-divider></mat-divider>\r\n\r\n <mat-expansion-panel\r\n *ngFor=\"let group of partGroups$ | async\"\r\n [expanded]=\"true\"\r\n >\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n ><strong>{{ group.label }}</strong></mat-panel-title\r\n >\r\n <mat-panel-description>{{\r\n group.parts.length\r\n }}</mat-panel-description>\r\n </mat-expansion-panel-header>\r\n\r\n <table>\r\n <thead>\r\n <tr>\r\n <th style=\"width: 124px\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th fxHide.xs>modified</th>\r\n <th fxHide.xs>user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let part of group.parts\">\r\n <!-- edit -->\r\n <td>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n color=\"primary\"\r\n matTooltip=\"Edit this part\"\r\n [disabled]=\"(loading$ | async) || (deletingPart$ | async)\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon>create</mat-icon>\r\n </button>\r\n <!-- delete -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Delete this part\"\r\n [disabled]=\"\r\n userLevel < 2 ||\r\n (loading$ | async) ||\r\n (deletingPart$ | async)\r\n \"\r\n (click)=\"deletePart(part)\"\r\n *ngIf=\"\r\n user?.roles?.length &&\r\n (user.roles.includes('admin') ||\r\n user.roles.includes('editor') ||\r\n user.roles.includes('operator'))\r\n \"\r\n >\r\n <mat-icon color=\"warn\">delete</mat-icon>\r\n </button>\r\n <!-- copy -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td fxHide.xs>{{ part.timeModified | amLocal | amTimeAgo }}</td>\r\n <td fxHide.xs>{{ part.userId }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </mat-expansion-panel>\r\n\r\n <cadmus-missing-parts\r\n [partDefinitions]=\"(facet$ | async)?.partDefinitions\"\r\n [parts]=\"parts$ | async\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n (addRequest)=\"addPart($event)\"\r\n ></cadmus-missing-parts>\r\n </mat-tab>\r\n\r\n <mat-tab label=\"Layers\" *ngIf=\"id\">\r\n <table *ngIf=\"layerPartInfos$ | async as parts\">\r\n <thead>\r\n <th></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>frr.</th>\r\n <th>last modified</th>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let part of parts\">\r\n <td>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n type=\"button\"\r\n color=\"primary\"\r\n mat-icon-button\r\n matTooltip=\"Edit this layer part\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"part.isAbsent\"\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Add this layer part\"\r\n [disabled]=\"userLevel < 2\"\r\n (click)=\"addLayerPart(part)\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n matTooltip=\"Delete this layer part\"\r\n [disabled]=\"userLevel < 2\"\r\n (click)=\"deletePart(part)\"\r\n >\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td\r\n [ngClass]=\"{\r\n 'count-n': part.fragmentCount,\r\n 'count-z': !part.fragmentCount\r\n }\"\r\n >\r\n {{ part.fragmentCount }}\r\n </td>\r\n <td>\r\n <span *ngIf=\"!part.isAbsent\">\r\n {{ part.timeModified | amLocal | amTimeAgo }}\r\n </span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </mat-tab>\r\n\r\n <mat-tab\r\n label=\"Th-Scopes\"\r\n *ngIf=\"parts$ | async | sort: 'typeId' | sort: 'roleId' as parts\"\r\n >\r\n <cadmus-parts-scope-editor\r\n [parts]=\"parts\"\r\n [readonly]=\"userLevel < 2 || (saving$ | async) || (loading$ | async)\"\r\n (setScopeRequest)=\"setPartsScope($event)\"\r\n ></cadmus-parts-scope-editor>\r\n </mat-tab>\r\n </mat-tab-group>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".full-width{width:100%}th{font-weight:normal;color:silver}div.new-part{margin-left:32px}span.new-part-role{color:gray;margin-left:8px;vertical-align:middle}span.new-part-icon{margin:0 4px;vertical-align:middle}td.count-n{text-align:center;color:#03c03c}td.count-z{text-align:center;color:#f34f41}input.id{font-family:\"Courier New\",Courier,monospace;color:gray;min-width:22em}.flag{margin-left:10px}\n"], components: [{ type: i8.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i8.MatCardHeader, selector: "mat-card-header" }, { type: i9$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i10.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i10.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby"], exportAs: ["matTab"] }, { type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i12.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i13.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i2.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"] }, { type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i17.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i18.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i18.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { type: i3.PartBadgeComponent, selector: "cadmus-part-badge", inputs: ["badgeType", "typeThesaurus", "facetDefinition", "partTypeIds"] }, { type: MissingPartsComponent, selector: "cadmus-missing-parts", inputs: ["partDefinitions", "parts", "typeThesaurus"], outputs: ["addRequest"] }, { type: PartsScopeEditorComponent, selector: "cadmus-parts-scope-editor", inputs: ["parts", "readonly"], outputs: ["setScopeRequest"] }], directives: [{ type: i8.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i8.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { type: i22.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i24.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i22.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i18.MatExpansionPanelTitle, selector: "mat-panel-title" }, { type: i18.MatExpansionPanelDescription, selector: "mat-panel-description" }, { type: i26.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { type: i22.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i26.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], pipes: { "async": i22.AsyncPipe, "amTimeAgo": i11.TimeAgoPipe, "amLocal": i11.LocalTimePipe, "date": i22.DatePipe, "sort": i4.SortPipe } });
526
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: ItemEditorComponent, decorators: [{
527
+ type: Component,
528
+ args: [{ selector: 'cadmus-item-editor', template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n {{ (item$ | async)?.title || \"Item\" }}\r\n </mat-card-title>\r\n <mat-card-subtitle>\r\n {{ (item$ | async)?.description }}\r\n </mat-card-subtitle>\r\n </mat-card-header>\r\n <mat-card-content *ngIf=\"!id || (item$ | async) as item\">\r\n <p *ngIf=\"id\">\r\n ID:\r\n <input\r\n [cdkCopyToClipboard]=\"item.id\"\r\n type=\"text\"\r\n readonly=\"true\"\r\n spellcheck=\"false\"\r\n matTooltip=\"Click to copy\"\r\n [value]=\"item.id\"\r\n class=\"id\"\r\n />\r\n </p>\r\n <p *ngIf=\"id\">\r\n Last saved {{ item.timeModified | amLocal | amTimeAgo }} by\r\n {{ item.userId }} on\r\n {{ item.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}.<br />\r\n Created {{ item.timeCreated | amLocal | amTimeAgo }} by\r\n {{ item.creatorId }} on\r\n {{ item.timeCreated | date: \"yyyy-MM-dd HH:mm:ss\" }}.\r\n </p>\r\n <p *ngIf=\"error$ | async as error\">\r\n <mat-error>\r\n {{ error }}\r\n </mat-error>\r\n </p>\r\n\r\n <mat-progress-bar\r\n mode=\"indeterminate\"\r\n *ngIf=\"(loading$ | async) || (saving$ | async)\"\r\n ></mat-progress-bar>\r\n\r\n <!-- item content -->\r\n <mat-tab-group [selectedIndex]=\"id ? 1 : 0\">\r\n <!-- metadata -->\r\n <mat-tab label=\"Metadata\">\r\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\r\n <!-- title -->\r\n <div>\r\n <mat-form-field>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"title\"\r\n placeholder=\"title\"\r\n formControlName=\"title\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n title.hasError('required') && (title.touched || title.dirty)\r\n \"\r\n >enter title</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n title.hasError('maxLength') && (title.touched || title.dirty)\r\n \"\r\n >\r\n title too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- sortKey -->\r\n <div>\r\n <mat-form-field>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"sortKey\"\r\n placeholder=\"sort key\"\r\n formControlName=\"sortKey\"\r\n />\r\n <mat-error\r\n *ngIf=\"\r\n sortKey.hasError('required') &&\r\n (sortKey.touched || sortKey.dirty)\r\n \"\r\n >enter sort key</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n sortKey.hasError('maxLength') &&\r\n (sortKey.touched || sortKey.dirty)\r\n \"\r\n >sort key too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- description -->\r\n <div>\r\n <mat-form-field class=\"full-width\">\r\n <textarea\r\n rows=\"2\"\r\n matInput\r\n id=\"description\"\r\n placeholder=\"description\"\r\n formControlName=\"description\"\r\n ></textarea>\r\n <mat-error\r\n *ngIf=\"\r\n description.hasError('required') &&\r\n (description.touched || description.dirty)\r\n \"\r\n >enter description</mat-error\r\n >\r\n <mat-error\r\n *ngIf=\"\r\n description.hasError('maxLength') &&\r\n (description.touched || description.dirty)\r\n \"\r\n >description too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- facet -->\r\n <div>\r\n <mat-form-field style=\"width: 400px\">\r\n <mat-select\r\n placeholder=\"facet\"\r\n formControlName=\"facet\"\r\n required=\"true\"\r\n >\r\n <mat-option *ngFor=\"let f of facets$ | async\" [value]=\"f.id\">\r\n {{ f.label }}\r\n </mat-option>\r\n </mat-select>\r\n <mat-error>please select a facet</mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- group -->\r\n <div>\r\n <mat-form-field>\r\n <input matInput formControlName=\"group\" placeholder=\"group ID\" />\r\n <mat-error\r\n *ngIf=\"\r\n group.hasError('maxLength') && (group.dirty || group.touched)\r\n \"\r\n >too long</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- flags -->\r\n <div formArrayName=\"flagChecks\" *ngIf=\"flagDefinitions\">\r\n <mat-checkbox\r\n class=\"flag\"\r\n *ngFor=\"let c of flagChecks.controls; let i = index\"\r\n [formControlName]=\"i\"\r\n >\r\n <span [style.color]=\"'#' + flagDefinitions[i].colorKey\"\r\n >&#x2b24;</span\r\n >\r\n &nbsp;\r\n {{ flagDefinitions[i].label }}\r\n </mat-checkbox>\r\n </div>\r\n <br />\r\n\r\n <div>\r\n <button\r\n type=\"submit\"\r\n mat-raised-button\r\n color=\"primary\"\r\n [disabled]=\"\r\n userLevel < 2 || (saving$ | async) || (loading$ | async)\r\n \"\r\n matTooltip=\"Save metadata\"\r\n *ngIf=\"\r\n user?.roles?.length &&\r\n (user.roles.includes('admin') ||\r\n user.roles.includes('editor') ||\r\n user.roles.includes('operator'))\r\n \"\r\n >\r\n <mat-icon>save</mat-icon> save\r\n </button>\r\n </div>\r\n </form>\r\n </mat-tab>\r\n\r\n <!-- parts -->\r\n <mat-tab label=\"Parts\" *ngIf=\"id\">\r\n <div class=\"new-part\">\r\n <form [formGroup]=\"newPart\">\r\n <mat-form-field>\r\n <mat-select\r\n placeholder=\"part\"\r\n formControlName=\"newPartType\"\r\n required\r\n >\r\n <mat-option *ngFor=\"let p of newPartDefinitions\" [value]=\"p\">\r\n <span [style.color]=\"'#' + p.colorKey\" class=\"new-part-icon\"\r\n >&#x2b24;</span\r\n >\r\n {{ p.name }}\r\n <span *ngIf=\"p.roleId\" class=\"new-part-role\">{{\r\n p.roleId\r\n }}</span>\r\n </mat-option>\r\n </mat-select>\r\n <mat-error>part type required</mat-error>\r\n </mat-form-field>\r\n &nbsp;\r\n <button\r\n mat-stroked-button\r\n color=\"primary\"\r\n type=\"button\"\r\n [disabled]=\"userLevel < 2 || (loading$ | async) || !newPart.valid\"\r\n (click)=\"addPart()\"\r\n matTooltip=\"Add a new part of the selected type\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n add part\r\n </button>\r\n </form>\r\n </div>\r\n\r\n <mat-divider></mat-divider>\r\n\r\n <mat-expansion-panel\r\n *ngFor=\"let group of partGroups$ | async\"\r\n [expanded]=\"true\"\r\n >\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n ><strong>{{ group.label }}</strong></mat-panel-title\r\n >\r\n <mat-panel-description>{{\r\n group.parts.length\r\n }}</mat-panel-description>\r\n </mat-expansion-panel-header>\r\n\r\n <table>\r\n <thead>\r\n <tr>\r\n <th style=\"width: 124px\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th fxHide.xs>modified</th>\r\n <th fxHide.xs>user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let part of group.parts\">\r\n <!-- edit -->\r\n <td>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n color=\"primary\"\r\n matTooltip=\"Edit this part\"\r\n [disabled]=\"(loading$ | async) || (deletingPart$ | async)\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon>create</mat-icon>\r\n </button>\r\n <!-- delete -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Delete this part\"\r\n [disabled]=\"\r\n userLevel < 2 ||\r\n (loading$ | async) ||\r\n (deletingPart$ | async)\r\n \"\r\n (click)=\"deletePart(part)\"\r\n *ngIf=\"\r\n user?.roles?.length &&\r\n (user.roles.includes('admin') ||\r\n user.roles.includes('editor') ||\r\n user.roles.includes('operator'))\r\n \"\r\n >\r\n <mat-icon color=\"warn\">delete</mat-icon>\r\n </button>\r\n <!-- copy -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td fxHide.xs>{{ part.timeModified | amLocal | amTimeAgo }}</td>\r\n <td fxHide.xs>{{ part.userId }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </mat-expansion-panel>\r\n\r\n <cadmus-missing-parts\r\n [partDefinitions]=\"(facet$ | async)?.partDefinitions\"\r\n [parts]=\"parts$ | async\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n (addRequest)=\"addPart($event)\"\r\n ></cadmus-missing-parts>\r\n </mat-tab>\r\n\r\n <mat-tab label=\"Layers\" *ngIf=\"id\">\r\n <table *ngIf=\"layerPartInfos$ | async as parts\">\r\n <thead>\r\n <th></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>frr.</th>\r\n <th>last modified</th>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let part of parts\">\r\n <td>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n type=\"button\"\r\n color=\"primary\"\r\n mat-icon-button\r\n matTooltip=\"Edit this layer part\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"part.isAbsent\"\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Add this layer part\"\r\n [disabled]=\"userLevel < 2\"\r\n (click)=\"addLayerPart(part)\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n matTooltip=\"Delete this layer part\"\r\n [disabled]=\"userLevel < 2\"\r\n (click)=\"deletePart(part)\"\r\n >\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n <button\r\n *ngIf=\"!part.isAbsent\"\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet$ | async\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus$ | async\"\r\n ></cadmus-part-badge>\r\n </td>\r\n <td\r\n [ngClass]=\"{\r\n 'count-n': part.fragmentCount,\r\n 'count-z': !part.fragmentCount\r\n }\"\r\n >\r\n {{ part.fragmentCount }}\r\n </td>\r\n <td>\r\n <span *ngIf=\"!part.isAbsent\">\r\n {{ part.timeModified | amLocal | amTimeAgo }}\r\n </span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </mat-tab>\r\n\r\n <mat-tab\r\n label=\"Th-Scopes\"\r\n *ngIf=\"parts$ | async | sort: 'typeId' | sort: 'roleId' as parts\"\r\n >\r\n <cadmus-parts-scope-editor\r\n [parts]=\"parts\"\r\n [readonly]=\"userLevel < 2 || (saving$ | async) || (loading$ | async)\"\r\n (setScopeRequest)=\"setPartsScope($event)\"\r\n ></cadmus-parts-scope-editor>\r\n </mat-tab>\r\n </mat-tab-group>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".full-width{width:100%}th{font-weight:normal;color:silver}div.new-part{margin-left:32px}span.new-part-role{color:gray;margin-left:8px;vertical-align:middle}span.new-part-icon{margin:0 4px;vertical-align:middle}td.count-n{text-align:center;color:#03c03c}td.count-z{text-align:center;color:#f34f41}input.id{font-family:\"Courier New\",Courier,monospace;color:gray;min-width:22em}.flag{margin-left:10px}\n"] }]
529
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i2$2.MatSnackBar }, { type: i3$2.AppQuery }, { type: i3$2.EditItemQuery }, { type: i3$2.EditItemService }, { type: i4.LibraryRouteService }, { type: i3$1.DialogService }, { type: i2$1.AuthService }, { type: i7.FormBuilder }]; } });
530
+
531
+ // https://github.com/ng-packagr/ng-packagr/issues/778
532
+ const RouterModuleForChild = RouterModule.forChild([
533
+ { path: '', pathMatch: 'full', component: ItemEditorComponent },
534
+ ]);
535
+ class CadmusItemEditorModule {
536
+ }
537
+ CadmusItemEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusItemEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
538
+ CadmusItemEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusItemEditorModule, declarations: [ItemEditorComponent,
539
+ MissingPartsComponent,
540
+ PartsScopeEditorComponent], imports: [CommonModule,
541
+ ReactiveFormsModule,
542
+ FormsModule, i1$1.RouterModule, ClipboardModule,
543
+ MomentModule,
544
+ // cadmus
545
+ CadmusCoreModule,
546
+ CadmusMaterialModule,
547
+ CadmusApiModule,
548
+ CadmusUiModule,
549
+ CadmusStateModule,
550
+ NgToolsModule,
551
+ NgMatToolsModule], exports: [ItemEditorComponent] });
552
+ CadmusItemEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusItemEditorModule, imports: [[
553
+ CommonModule,
554
+ ReactiveFormsModule,
555
+ FormsModule,
556
+ RouterModuleForChild,
557
+ ClipboardModule,
558
+ MomentModule,
559
+ // cadmus
560
+ CadmusCoreModule,
561
+ CadmusMaterialModule,
562
+ CadmusApiModule,
563
+ CadmusUiModule,
564
+ CadmusStateModule,
565
+ NgToolsModule,
566
+ NgMatToolsModule
567
+ ]] });
568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusItemEditorModule, decorators: [{
569
+ type: NgModule,
570
+ args: [{
571
+ imports: [
572
+ CommonModule,
573
+ ReactiveFormsModule,
574
+ FormsModule,
575
+ RouterModuleForChild,
576
+ ClipboardModule,
577
+ MomentModule,
578
+ // cadmus
579
+ CadmusCoreModule,
580
+ CadmusMaterialModule,
581
+ CadmusApiModule,
582
+ CadmusUiModule,
583
+ CadmusStateModule,
584
+ NgToolsModule,
585
+ NgMatToolsModule
586
+ ],
587
+ declarations: [
588
+ ItemEditorComponent,
589
+ MissingPartsComponent,
590
+ PartsScopeEditorComponent,
591
+ ],
592
+ exports: [ItemEditorComponent],
593
+ }]
594
+ }] });
595
+
596
+ /*
597
+ * Public API Surface of cadmus-item-editor
598
+ */
599
+
600
+ /**
601
+ * Generated bundle index. Do not edit.
602
+ */
603
+
604
+ export { CadmusItemEditorModule, ItemEditorComponent, RouterModuleForChild };