@myrmidon/cadmus-item-editor 8.1.2 → 8.1.3

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.
@@ -895,11 +895,11 @@ class ItemEditorComponent {
895
895
  this._repository.setPartThesaurusScope(request.ids, request.scope);
896
896
  }
897
897
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: ItemEditorComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i2$2.MatSnackBar }, { token: i1.AppRepository }, { token: EditedItemRepository }, { token: i2.ItemService }, { token: i6.ItemListRepository }, { token: i7.LibraryRouteService }, { token: i3$1.DialogService }, { token: i9$1.AuthJwtService }, { token: i2.UserLevelService }, { token: i10.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
898
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.2", type: ItemEditorComponent, selector: "cadmus-item-editor", ngImport: i0, template: "<mat-card appearance=\"outlined\">\n <mat-card-header>\n <mat-card-title>\n {{ (item$ | async)?.title || \"Item\" }}\n </mat-card-title>\n <mat-card-subtitle>\n {{ (item$ | async)?.description }}\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n @if (id) {\n <p>\n ID:\n <input\n [cdkCopyToClipboard]=\"(item$ | async)?.id || ''\"\n type=\"text\"\n readonly=\"true\"\n spellcheck=\"false\"\n matTooltip=\"Click to copy\"\n [value]=\"(item$ | async)?.id\"\n class=\"id\"\n />\n </p>\n } @if (item$ | async; as item) {\n <p>\n Last saved {{ item.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }} by\n {{ item.userId }}.<br />\n Created {{ item.timeCreated | date : \"yyyy-MM-dd HH:mm:ss\" }} by\n {{ item.creatorId }}.\n </p>\n } @if (busy) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n\n <!-- item content -->\n <mat-tab-group [selectedIndex]=\"id ? 1 : 0\">\n <!-- metadata -->\n <mat-tab label=\"Metadata\">\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\n <div class=\"form-row\">\n <!-- title -->\n <mat-form-field style=\"flex: 1 0 auto\">\n <mat-label>title</mat-label>\n <input matInput type=\"text\" id=\"title\" [formControl]=\"title\" />\n @if ( title.hasError('required') && (title.touched || title.dirty)\n ) {\n <mat-error>enter title</mat-error>\n } @if ( title.hasError('maxLength') && (title.touched ||\n title.dirty) ) {\n <mat-error> title too long</mat-error>\n }\n </mat-form-field>\n\n <!-- sortKey -->\n <mat-form-field style=\"flex: 1 0 auto\">\n <mat-label>sort key</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"sortKey\"\n [formControl]=\"sortKey\"\n />\n @if ( sortKey.hasError('required') && (sortKey.touched ||\n sortKey.dirty) ) {\n <mat-error>enter sort key</mat-error>\n } @if ( sortKey.hasError('maxLength') && (sortKey.touched ||\n sortKey.dirty) ) {\n <mat-error>sort key too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- description -->\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>description</mat-label>\n <textarea\n rows=\"2\"\n matInput\n id=\"description\"\n [formControl]=\"description\"\n ></textarea>\n @if ( description.hasError('required') && (description.touched ||\n description.dirty) ) {\n <mat-error>enter description</mat-error>\n } @if ( description.hasError('maxLength') && (description.touched\n || description.dirty) ) {\n <mat-error>description too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- facet -->\n <div class=\"form-row\">\n <mat-form-field>\n <mat-label>facet</mat-label>\n <mat-select [formControl]=\"facet\" required=\"true\">\n @for (f of facets$ | async; track f) {\n <mat-option [value]=\"f.id\">\n {{ f.label }}\n </mat-option>\n }\n </mat-select>\n <mat-error>please select a facet</mat-error>\n </mat-form-field>\n\n <!-- group -->\n <mat-form-field>\n <mat-label>group ID</mat-label>\n <input matInput [formControl]=\"group\" />\n @if ( group.hasError('maxLength') && (group.dirty ||\n group.touched) ) {\n <mat-error>too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- flags -->\n <fieldset>\n <legend>flags</legend>\n @if (flagDefinitions) {\n <div formArrayName=\"flagChecks\">\n @for (c of flagChecks.controls; track c; let i = $index) {\n <mat-checkbox class=\"flag\" [formControlName]=\"i\">\n <span [style.color]=\"'#' + flagDefinitions[i].colorKey\"\n >&#x2b24;</span\n >\n &nbsp;\n {{ flagDefinitions[i].label }}\n </mat-checkbox>\n }\n </div>\n }\n </fieldset>\n <br />\n\n <div>\n @if ( user?.roles?.length && (user?.roles?.includes('admin') ||\n user?.roles?.includes('editor') ||\n user?.roles?.includes('operator')) ) {\n <button\n type=\"submit\"\n mat-raised-button\n color=\"primary\"\n class=\"mat-primary\"\n [disabled]=\"userLevel < 2 || busy\"\n matTooltip=\"Save metadata\"\n >\n <mat-icon>save</mat-icon> save\n </button>\n }\n </div>\n </form>\n </mat-tab>\n\n <!-- parts -->\n @if (id) {\n <mat-tab label=\"Parts\">\n <div class=\"new-part\">\n <form [formGroup]=\"newPart\">\n <mat-form-field>\n <mat-label>part</mat-label>\n <mat-select [formControl]=\"newPartType\" required>\n @for (p of newPartDefinitions$ | async; track p) {\n <mat-option [value]=\"p\">\n <span [style.color]=\"'#' + p.colorKey\" class=\"new-part-icon\"\n >&#x2b24;</span\n >\n {{ p.name }}\n @if (p.roleId) {\n <span class=\"new-part-role\">{{ p.roleId }}</span>\n }\n </mat-option>\n }\n </mat-select>\n <mat-error>part type required</mat-error>\n </mat-form-field>\n &nbsp;\n <button\n mat-stroked-button\n color=\"primary\"\n class=\"mat-primary\"\n type=\"button\"\n [disabled]=\"userLevel < 2 || busy || !newPart.valid\"\n (click)=\"addPart()\"\n matTooltip=\"Add a new part of the selected type\"\n >\n <mat-icon>add_circle</mat-icon>\n part\n </button>\n </form>\n </div>\n <mat-divider></mat-divider>\n @for (group of partGroups$ | async; track group) {\n <mat-expansion-panel expanded=\"true\" class=\"group-header\">\n <mat-expansion-panel-header>\n <mat-panel-title\n ><strong>{{ group.label }}</strong></mat-panel-title\n >\n <mat-panel-description>{{\n group.parts.length\n }}</mat-panel-description>\n </mat-expansion-panel-header>\n <table class=\"parts-table\">\n <thead>\n <tr>\n <th></th>\n <th>type</th>\n <th>role</th>\n <th class=\"noif-lt-xs\">modified</th>\n <th class=\"noif-lt-xs\">user</th>\n </tr>\n </thead>\n <tbody>\n @for (part of group.parts; track part) {\n <tr>\n <!-- edit -->\n <td class=\"fit-width\">\n <button\n mat-icon-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"busy\"\n (click)=\"editPart(part)\"\n matTooltip=\"Edit this part\"\n >\n <mat-icon class=\"mat-primary\">create</mat-icon>\n </button>\n <!-- delete -->\n @if ( user?.roles?.length && (user?.roles?.includes('admin')\n || user?.roles?.includes('editor') ||\n user?.roles?.includes('operator')) ) {\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"userLevel < 2 || busy\"\n (click)=\"deletePart(part)\"\n matTooltip=\"Delete this part\"\n >\n <mat-icon color=\"warn\" class=\"mat-warn\">delete</mat-icon>\n </button>\n }\n <!-- copy -->\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Copy this part ID\"\n [cdkCopyToClipboard]=\"part.id\"\n >\n <mat-icon>assignment</mat-icon>\n </button>\n <!-- preview -->\n @if ( part | hasPreview : (previewJKeys$ | async) :\n (previewFKeys$ | async) ) {\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Preview this part\"\n (click)=\"previewPart(part)\"\n >\n <mat-icon>preview</mat-icon>\n </button>\n }\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"1\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"2\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td class=\"noif-lt-xs\">\n {{ part.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }}\n </td>\n <td class=\"noif-lt-xs\">{{ part.userId }}</td>\n </tr>\n }\n </tbody>\n </table>\n </mat-expansion-panel>\n }\n <cadmus-missing-parts\n [partDefinitions]=\"(facet$ | async)?.partDefinitions\"\n [parts]=\"(parts$ | async) || undefined\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n (addRequest)=\"addPart($event)\"\n ></cadmus-missing-parts>\n </mat-tab>\n } @if (id) {\n <mat-tab label=\"Layers\">\n @if (layerPartInfos$ | async; as parts) {\n <table id=\"layers\">\n <thead>\n <th></th>\n <th>type</th>\n <th>role</th>\n <th>frr.</th>\n <th>last modified</th>\n </thead>\n <tbody>\n @for (part of parts; track part) {\n <tr>\n <td class=\"fit-width\">\n @if (!part.isAbsent) {\n <button\n type=\"button\"\n color=\"primary\"\n mat-icon-button\n matTooltip=\"Edit this layer part\"\n (click)=\"editPart(part)\"\n >\n <mat-icon class=\"mat-primary\">edit</mat-icon>\n </button>\n } @if (part.isAbsent) {\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n matTooltip=\"Add this layer part\"\n [disabled]=\"userLevel < 2\"\n (click)=\"addLayerPart(part)\"\n >\n <mat-icon class=\"mat-primary\">add_circle</mat-icon>\n </button>\n } @if (!part.isAbsent) {\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n matTooltip=\"Delete this layer part\"\n [disabled]=\"userLevel < 2\"\n (click)=\"deletePart(part)\"\n >\n <mat-icon class=\"mat-warn\">delete</mat-icon>\n </button>\n } @if (!part.isAbsent) {\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Copy this part ID\"\n [cdkCopyToClipboard]=\"part.id\"\n >\n <mat-icon>assignment</mat-icon>\n </button>\n }\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"1\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"2\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td\n [ngClass]=\"{\n 'count-n': part.fragmentCount,\n 'count-z': !part.fragmentCount\n }\"\n >\n {{ part.fragmentCount }}\n </td>\n <td>\n @if (!part.isAbsent) {\n <span>\n {{ part.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }}\n </span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n </mat-tab>\n } @if (parts$ | async; as parts) {\n <mat-tab label=\"Th-Scopes\">\n <!-- [parts]=\"parts | sort: 'typeId' | sort: 'roleId'\" -->\n <cadmus-parts-scope-editor\n [parts]=\"parts\"\n [readonly]=\"userLevel < 2 || busy ? true : false\"\n (setScopeRequest)=\"setPartsScope($event)\"\n ></cadmus-parts-scope-editor>\n </mat-tab>\n }\n </mat-tab-group>\n </mat-card-content>\n</mat-card>\n", styles: [".full-width{width:100%}table{border-collapse:collapse}th{font-weight:400;color:silver}td.fit-width{width:1px;white-space:nowrap}tbody tr:nth-child(odd){background-color:#e2e2e2}#layers td{padding:0 6px}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}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.group-header{border-top:1px solid #ccc}table.parts-table{width:100%}table.parts-table th{text-align:left}fieldset{border:1px solid silver;border-radius:6px;padding:6px;margin:8px 0}@media only screen and (max-width: 599px){.noif-lt-xs{display:none}}\n"], dependencies: [{ kind: "directive", type: i11.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i10.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i10.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: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i10.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i10.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i10.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i10.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i10.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i10.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i12.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: i13.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i13.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i15.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i15.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i15.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i15.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "directive", type: i15.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i16.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i17.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i17.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i17.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i17.MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i10$1.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: i21.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i22.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i23.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i24.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i24.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i5.PartBadgeComponent, selector: "cadmus-part-badge", inputs: ["badgeType", "typeThesaurus", "facetDefinition", "partTypeIds"] }, { kind: "component", type: MissingPartsComponent, selector: "cadmus-missing-parts", inputs: ["partDefinitions", "parts", "typeThesaurus"], outputs: ["addRequest"] }, { kind: "component", type: PartsScopeEditorComponent, selector: "cadmus-parts-scope-editor", inputs: ["parts", "readonly"], outputs: ["setScopeRequest"] }, { kind: "pipe", type: i11.AsyncPipe, name: "async" }, { kind: "pipe", type: i11.DatePipe, name: "date" }, { kind: "pipe", type: HasPreviewPipe, name: "hasPreview" }] }); }
898
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.2", type: ItemEditorComponent, selector: "cadmus-item-editor", ngImport: i0, template: "<mat-card appearance=\"outlined\">\n <mat-card-header>\n <mat-card-title>\n {{ (item$ | async)?.title || \"Item\" }}\n </mat-card-title>\n <mat-card-subtitle>\n {{ (item$ | async)?.description }}\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n @if (id) {\n <p>\n ID:\n <input\n [cdkCopyToClipboard]=\"(item$ | async)?.id || ''\"\n type=\"text\"\n readonly=\"true\"\n spellcheck=\"false\"\n matTooltip=\"Click to copy\"\n [value]=\"(item$ | async)?.id\"\n class=\"id\"\n />\n </p>\n } @if (item$ | async; as item) {\n <p>\n Last saved {{ item.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }} by\n {{ item.userId }}.<br />\n Created {{ item.timeCreated | date : \"yyyy-MM-dd HH:mm:ss\" }} by\n {{ item.creatorId }}.\n </p>\n } @if (busy) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n\n <!-- item content -->\n <mat-tab-group [selectedIndex]=\"id ? 1 : 0\">\n <!-- metadata -->\n <mat-tab label=\"Metadata\">\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\n <div class=\"form-row\">\n <!-- title -->\n <mat-form-field style=\"flex: 1 0 auto\">\n <mat-label>title</mat-label>\n <input matInput type=\"text\" id=\"title\" [formControl]=\"title\" />\n @if ( title.hasError('required') && (title.touched || title.dirty)\n ) {\n <mat-error>enter title</mat-error>\n } @if ( title.hasError('maxLength') && (title.touched ||\n title.dirty) ) {\n <mat-error> title too long</mat-error>\n }\n </mat-form-field>\n\n <!-- sortKey -->\n <mat-form-field style=\"flex: 1 0 auto\">\n <mat-label>sort key</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"sortKey\"\n [formControl]=\"sortKey\"\n />\n @if ( sortKey.hasError('required') && (sortKey.touched ||\n sortKey.dirty) ) {\n <mat-error>enter sort key</mat-error>\n } @if ( sortKey.hasError('maxLength') && (sortKey.touched ||\n sortKey.dirty) ) {\n <mat-error>sort key too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- description -->\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>description</mat-label>\n <textarea\n rows=\"2\"\n matInput\n id=\"description\"\n [formControl]=\"description\"\n ></textarea>\n @if ( description.hasError('required') && (description.touched ||\n description.dirty) ) {\n <mat-error>enter description</mat-error>\n } @if ( description.hasError('maxLength') && (description.touched\n || description.dirty) ) {\n <mat-error>description too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- facet -->\n <div class=\"form-row\">\n <mat-form-field>\n <mat-label>facet</mat-label>\n <mat-select [formControl]=\"facet\" required=\"true\">\n @for (f of facets$ | async; track f) {\n <mat-option [value]=\"f.id\">\n {{ f.label }}\n </mat-option>\n }\n </mat-select>\n <mat-error>please select a facet</mat-error>\n </mat-form-field>\n\n <!-- group -->\n <mat-form-field>\n <mat-label>group ID</mat-label>\n <input matInput [formControl]=\"group\" />\n @if ( group.hasError('maxLength') && (group.dirty ||\n group.touched) ) {\n <mat-error>too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- flags -->\n <fieldset>\n <legend>flags</legend>\n @if (flagDefinitions) {\n <div formArrayName=\"flagChecks\">\n @for (c of flagChecks.controls; track c; let i = $index) {\n <mat-checkbox class=\"flag\" [formControlName]=\"i\">\n <span [style.color]=\"'#' + flagDefinitions[i].colorKey\"\n >&#x2b24;</span\n >\n &nbsp;\n {{ flagDefinitions[i].label }}\n </mat-checkbox>\n }\n </div>\n }\n </fieldset>\n <br />\n\n <div>\n @if ( user?.roles?.length && (user?.roles?.includes('admin') ||\n user?.roles?.includes('editor') ||\n user?.roles?.includes('operator')) ) {\n <button\n type=\"submit\"\n mat-raised-button\n color=\"primary\"\n class=\"mat-primary\"\n [disabled]=\"userLevel < 2 || busy\"\n matTooltip=\"Save metadata\"\n >\n <mat-icon>save</mat-icon> save\n </button>\n }\n </div>\n </form>\n </mat-tab>\n\n <!-- parts -->\n @if (id) {\n <mat-tab label=\"Parts\">\n <div class=\"new-part\">\n <form [formGroup]=\"newPart\" class=\"form-row\">\n <mat-form-field>\n <mat-label>part</mat-label>\n <mat-select [formControl]=\"newPartType\" required>\n @for (p of newPartDefinitions$ | async; track p) {\n <mat-option [value]=\"p\">\n <span [style.color]=\"'#' + p.colorKey\" class=\"new-part-icon\"\n >&#x2b24;</span\n >\n {{ p.name }}\n @if (p.roleId) {\n <span class=\"new-part-role\">{{ p.roleId }}</span>\n }\n </mat-option>\n }\n </mat-select>\n <mat-error>part type required</mat-error>\n </mat-form-field>\n <button\n mat-stroked-button\n color=\"primary\"\n class=\"mat-primary\"\n type=\"button\"\n [disabled]=\"userLevel < 2 || busy || !newPart.valid\"\n (click)=\"addPart()\"\n matTooltip=\"Add a new part of the selected type\"\n >\n <mat-icon>add_circle</mat-icon>\n part\n </button>\n </form>\n </div>\n <mat-divider></mat-divider>\n @for (group of partGroups$ | async; track group) {\n <mat-expansion-panel expanded=\"true\" class=\"group-header\">\n <mat-expansion-panel-header>\n <mat-panel-title\n ><strong>{{ group.label }}</strong></mat-panel-title\n >\n <mat-panel-description>{{\n group.parts.length\n }}</mat-panel-description>\n </mat-expansion-panel-header>\n <table class=\"parts-table\">\n <thead>\n <tr>\n <th></th>\n <th>type</th>\n <th>role</th>\n <th class=\"noif-lt-xs\">modified</th>\n <th class=\"noif-lt-xs\">user</th>\n </tr>\n </thead>\n <tbody>\n @for (part of group.parts; track part) {\n <tr>\n <!-- edit -->\n <td class=\"fit-width\">\n <button\n mat-icon-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"busy\"\n (click)=\"editPart(part)\"\n matTooltip=\"Edit this part\"\n >\n <mat-icon class=\"mat-primary\">create</mat-icon>\n </button>\n <!-- delete -->\n @if ( user?.roles?.length && (user?.roles?.includes('admin')\n || user?.roles?.includes('editor') ||\n user?.roles?.includes('operator')) ) {\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"userLevel < 2 || busy\"\n (click)=\"deletePart(part)\"\n matTooltip=\"Delete this part\"\n >\n <mat-icon color=\"warn\" class=\"mat-warn\">delete</mat-icon>\n </button>\n }\n <!-- copy -->\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Copy this part ID\"\n [cdkCopyToClipboard]=\"part.id\"\n >\n <mat-icon>assignment</mat-icon>\n </button>\n <!-- preview -->\n @if ( part | hasPreview : (previewJKeys$ | async) :\n (previewFKeys$ | async) ) {\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Preview this part\"\n (click)=\"previewPart(part)\"\n >\n <mat-icon>preview</mat-icon>\n </button>\n }\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"1\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"2\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td class=\"noif-lt-xs\">\n {{ part.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }}\n </td>\n <td class=\"noif-lt-xs\">{{ part.userId }}</td>\n </tr>\n }\n </tbody>\n </table>\n </mat-expansion-panel>\n }\n <cadmus-missing-parts\n [partDefinitions]=\"(facet$ | async)?.partDefinitions\"\n [parts]=\"(parts$ | async) || undefined\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n (addRequest)=\"addPart($event)\"\n ></cadmus-missing-parts>\n </mat-tab>\n } @if (id) {\n <mat-tab label=\"Layers\">\n @if (layerPartInfos$ | async; as parts) {\n <table id=\"layers\">\n <thead>\n <th></th>\n <th>type</th>\n <th>role</th>\n <th>frr.</th>\n <th>last modified</th>\n </thead>\n <tbody>\n @for (part of parts; track part) {\n <tr>\n <td class=\"fit-width\">\n @if (!part.isAbsent) {\n <button\n type=\"button\"\n color=\"primary\"\n mat-icon-button\n matTooltip=\"Edit this layer part\"\n (click)=\"editPart(part)\"\n >\n <mat-icon class=\"mat-primary\">edit</mat-icon>\n </button>\n } @if (part.isAbsent) {\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n matTooltip=\"Add this layer part\"\n [disabled]=\"userLevel < 2\"\n (click)=\"addLayerPart(part)\"\n >\n <mat-icon class=\"mat-primary\">add_circle</mat-icon>\n </button>\n } @if (!part.isAbsent) {\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n matTooltip=\"Delete this layer part\"\n [disabled]=\"userLevel < 2\"\n (click)=\"deletePart(part)\"\n >\n <mat-icon class=\"mat-warn\">delete</mat-icon>\n </button>\n } @if (!part.isAbsent) {\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Copy this part ID\"\n [cdkCopyToClipboard]=\"part.id\"\n >\n <mat-icon>assignment</mat-icon>\n </button>\n }\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"1\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"2\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td\n [ngClass]=\"{\n 'count-n': part.fragmentCount,\n 'count-z': !part.fragmentCount\n }\"\n >\n {{ part.fragmentCount }}\n </td>\n <td>\n @if (!part.isAbsent) {\n <span>\n {{ part.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }}\n </span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n </mat-tab>\n } @if (parts$ | async; as parts) {\n <mat-tab label=\"Th-Scopes\">\n <!-- [parts]=\"parts | sort: 'typeId' | sort: 'roleId'\" -->\n <cadmus-parts-scope-editor\n [parts]=\"parts\"\n [readonly]=\"userLevel < 2 || busy ? true : false\"\n (setScopeRequest)=\"setPartsScope($event)\"\n ></cadmus-parts-scope-editor>\n </mat-tab>\n }\n </mat-tab-group>\n </mat-card-content>\n</mat-card>\n", styles: [".full-width{width:100%}table{width:100%;border-collapse:collapse}th{font-weight:400;color:silver}td.fit-width{width:1px;white-space:nowrap}tbody tr:nth-child(odd){background-color:#e2e2e2}#layers td{padding:0 6px}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}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.group-header{border-top:1px solid #ccc}table.parts-table{width:100%}table.parts-table th{text-align:left}fieldset{border:1px solid silver;border-radius:6px;padding:6px;margin:8px 0}@media only screen and (max-width: 599px){.noif-lt-xs{display:none}}\n"], dependencies: [{ kind: "directive", type: i11.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i10.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i10.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: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i10.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i10.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i10.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i10.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i10.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i10.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i12.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: i13.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i13.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i15.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i15.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i15.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i15.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "directive", type: i15.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i16.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i17.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i17.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i17.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i17.MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i10$1.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: i21.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i22.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i23.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i24.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i24.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i5.PartBadgeComponent, selector: "cadmus-part-badge", inputs: ["badgeType", "typeThesaurus", "facetDefinition", "partTypeIds"] }, { kind: "component", type: MissingPartsComponent, selector: "cadmus-missing-parts", inputs: ["partDefinitions", "parts", "typeThesaurus"], outputs: ["addRequest"] }, { kind: "component", type: PartsScopeEditorComponent, selector: "cadmus-parts-scope-editor", inputs: ["parts", "readonly"], outputs: ["setScopeRequest"] }, { kind: "pipe", type: i11.AsyncPipe, name: "async" }, { kind: "pipe", type: i11.DatePipe, name: "date" }, { kind: "pipe", type: HasPreviewPipe, name: "hasPreview" }] }); }
899
899
  }
900
900
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: ItemEditorComponent, decorators: [{
901
901
  type: Component,
902
- args: [{ selector: 'cadmus-item-editor', template: "<mat-card appearance=\"outlined\">\n <mat-card-header>\n <mat-card-title>\n {{ (item$ | async)?.title || \"Item\" }}\n </mat-card-title>\n <mat-card-subtitle>\n {{ (item$ | async)?.description }}\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n @if (id) {\n <p>\n ID:\n <input\n [cdkCopyToClipboard]=\"(item$ | async)?.id || ''\"\n type=\"text\"\n readonly=\"true\"\n spellcheck=\"false\"\n matTooltip=\"Click to copy\"\n [value]=\"(item$ | async)?.id\"\n class=\"id\"\n />\n </p>\n } @if (item$ | async; as item) {\n <p>\n Last saved {{ item.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }} by\n {{ item.userId }}.<br />\n Created {{ item.timeCreated | date : \"yyyy-MM-dd HH:mm:ss\" }} by\n {{ item.creatorId }}.\n </p>\n } @if (busy) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n\n <!-- item content -->\n <mat-tab-group [selectedIndex]=\"id ? 1 : 0\">\n <!-- metadata -->\n <mat-tab label=\"Metadata\">\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\n <div class=\"form-row\">\n <!-- title -->\n <mat-form-field style=\"flex: 1 0 auto\">\n <mat-label>title</mat-label>\n <input matInput type=\"text\" id=\"title\" [formControl]=\"title\" />\n @if ( title.hasError('required') && (title.touched || title.dirty)\n ) {\n <mat-error>enter title</mat-error>\n } @if ( title.hasError('maxLength') && (title.touched ||\n title.dirty) ) {\n <mat-error> title too long</mat-error>\n }\n </mat-form-field>\n\n <!-- sortKey -->\n <mat-form-field style=\"flex: 1 0 auto\">\n <mat-label>sort key</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"sortKey\"\n [formControl]=\"sortKey\"\n />\n @if ( sortKey.hasError('required') && (sortKey.touched ||\n sortKey.dirty) ) {\n <mat-error>enter sort key</mat-error>\n } @if ( sortKey.hasError('maxLength') && (sortKey.touched ||\n sortKey.dirty) ) {\n <mat-error>sort key too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- description -->\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>description</mat-label>\n <textarea\n rows=\"2\"\n matInput\n id=\"description\"\n [formControl]=\"description\"\n ></textarea>\n @if ( description.hasError('required') && (description.touched ||\n description.dirty) ) {\n <mat-error>enter description</mat-error>\n } @if ( description.hasError('maxLength') && (description.touched\n || description.dirty) ) {\n <mat-error>description too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- facet -->\n <div class=\"form-row\">\n <mat-form-field>\n <mat-label>facet</mat-label>\n <mat-select [formControl]=\"facet\" required=\"true\">\n @for (f of facets$ | async; track f) {\n <mat-option [value]=\"f.id\">\n {{ f.label }}\n </mat-option>\n }\n </mat-select>\n <mat-error>please select a facet</mat-error>\n </mat-form-field>\n\n <!-- group -->\n <mat-form-field>\n <mat-label>group ID</mat-label>\n <input matInput [formControl]=\"group\" />\n @if ( group.hasError('maxLength') && (group.dirty ||\n group.touched) ) {\n <mat-error>too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- flags -->\n <fieldset>\n <legend>flags</legend>\n @if (flagDefinitions) {\n <div formArrayName=\"flagChecks\">\n @for (c of flagChecks.controls; track c; let i = $index) {\n <mat-checkbox class=\"flag\" [formControlName]=\"i\">\n <span [style.color]=\"'#' + flagDefinitions[i].colorKey\"\n >&#x2b24;</span\n >\n &nbsp;\n {{ flagDefinitions[i].label }}\n </mat-checkbox>\n }\n </div>\n }\n </fieldset>\n <br />\n\n <div>\n @if ( user?.roles?.length && (user?.roles?.includes('admin') ||\n user?.roles?.includes('editor') ||\n user?.roles?.includes('operator')) ) {\n <button\n type=\"submit\"\n mat-raised-button\n color=\"primary\"\n class=\"mat-primary\"\n [disabled]=\"userLevel < 2 || busy\"\n matTooltip=\"Save metadata\"\n >\n <mat-icon>save</mat-icon> save\n </button>\n }\n </div>\n </form>\n </mat-tab>\n\n <!-- parts -->\n @if (id) {\n <mat-tab label=\"Parts\">\n <div class=\"new-part\">\n <form [formGroup]=\"newPart\">\n <mat-form-field>\n <mat-label>part</mat-label>\n <mat-select [formControl]=\"newPartType\" required>\n @for (p of newPartDefinitions$ | async; track p) {\n <mat-option [value]=\"p\">\n <span [style.color]=\"'#' + p.colorKey\" class=\"new-part-icon\"\n >&#x2b24;</span\n >\n {{ p.name }}\n @if (p.roleId) {\n <span class=\"new-part-role\">{{ p.roleId }}</span>\n }\n </mat-option>\n }\n </mat-select>\n <mat-error>part type required</mat-error>\n </mat-form-field>\n &nbsp;\n <button\n mat-stroked-button\n color=\"primary\"\n class=\"mat-primary\"\n type=\"button\"\n [disabled]=\"userLevel < 2 || busy || !newPart.valid\"\n (click)=\"addPart()\"\n matTooltip=\"Add a new part of the selected type\"\n >\n <mat-icon>add_circle</mat-icon>\n part\n </button>\n </form>\n </div>\n <mat-divider></mat-divider>\n @for (group of partGroups$ | async; track group) {\n <mat-expansion-panel expanded=\"true\" class=\"group-header\">\n <mat-expansion-panel-header>\n <mat-panel-title\n ><strong>{{ group.label }}</strong></mat-panel-title\n >\n <mat-panel-description>{{\n group.parts.length\n }}</mat-panel-description>\n </mat-expansion-panel-header>\n <table class=\"parts-table\">\n <thead>\n <tr>\n <th></th>\n <th>type</th>\n <th>role</th>\n <th class=\"noif-lt-xs\">modified</th>\n <th class=\"noif-lt-xs\">user</th>\n </tr>\n </thead>\n <tbody>\n @for (part of group.parts; track part) {\n <tr>\n <!-- edit -->\n <td class=\"fit-width\">\n <button\n mat-icon-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"busy\"\n (click)=\"editPart(part)\"\n matTooltip=\"Edit this part\"\n >\n <mat-icon class=\"mat-primary\">create</mat-icon>\n </button>\n <!-- delete -->\n @if ( user?.roles?.length && (user?.roles?.includes('admin')\n || user?.roles?.includes('editor') ||\n user?.roles?.includes('operator')) ) {\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"userLevel < 2 || busy\"\n (click)=\"deletePart(part)\"\n matTooltip=\"Delete this part\"\n >\n <mat-icon color=\"warn\" class=\"mat-warn\">delete</mat-icon>\n </button>\n }\n <!-- copy -->\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Copy this part ID\"\n [cdkCopyToClipboard]=\"part.id\"\n >\n <mat-icon>assignment</mat-icon>\n </button>\n <!-- preview -->\n @if ( part | hasPreview : (previewJKeys$ | async) :\n (previewFKeys$ | async) ) {\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Preview this part\"\n (click)=\"previewPart(part)\"\n >\n <mat-icon>preview</mat-icon>\n </button>\n }\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"1\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"2\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td class=\"noif-lt-xs\">\n {{ part.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }}\n </td>\n <td class=\"noif-lt-xs\">{{ part.userId }}</td>\n </tr>\n }\n </tbody>\n </table>\n </mat-expansion-panel>\n }\n <cadmus-missing-parts\n [partDefinitions]=\"(facet$ | async)?.partDefinitions\"\n [parts]=\"(parts$ | async) || undefined\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n (addRequest)=\"addPart($event)\"\n ></cadmus-missing-parts>\n </mat-tab>\n } @if (id) {\n <mat-tab label=\"Layers\">\n @if (layerPartInfos$ | async; as parts) {\n <table id=\"layers\">\n <thead>\n <th></th>\n <th>type</th>\n <th>role</th>\n <th>frr.</th>\n <th>last modified</th>\n </thead>\n <tbody>\n @for (part of parts; track part) {\n <tr>\n <td class=\"fit-width\">\n @if (!part.isAbsent) {\n <button\n type=\"button\"\n color=\"primary\"\n mat-icon-button\n matTooltip=\"Edit this layer part\"\n (click)=\"editPart(part)\"\n >\n <mat-icon class=\"mat-primary\">edit</mat-icon>\n </button>\n } @if (part.isAbsent) {\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n matTooltip=\"Add this layer part\"\n [disabled]=\"userLevel < 2\"\n (click)=\"addLayerPart(part)\"\n >\n <mat-icon class=\"mat-primary\">add_circle</mat-icon>\n </button>\n } @if (!part.isAbsent) {\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n matTooltip=\"Delete this layer part\"\n [disabled]=\"userLevel < 2\"\n (click)=\"deletePart(part)\"\n >\n <mat-icon class=\"mat-warn\">delete</mat-icon>\n </button>\n } @if (!part.isAbsent) {\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Copy this part ID\"\n [cdkCopyToClipboard]=\"part.id\"\n >\n <mat-icon>assignment</mat-icon>\n </button>\n }\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"1\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"2\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td\n [ngClass]=\"{\n 'count-n': part.fragmentCount,\n 'count-z': !part.fragmentCount\n }\"\n >\n {{ part.fragmentCount }}\n </td>\n <td>\n @if (!part.isAbsent) {\n <span>\n {{ part.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }}\n </span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n </mat-tab>\n } @if (parts$ | async; as parts) {\n <mat-tab label=\"Th-Scopes\">\n <!-- [parts]=\"parts | sort: 'typeId' | sort: 'roleId'\" -->\n <cadmus-parts-scope-editor\n [parts]=\"parts\"\n [readonly]=\"userLevel < 2 || busy ? true : false\"\n (setScopeRequest)=\"setPartsScope($event)\"\n ></cadmus-parts-scope-editor>\n </mat-tab>\n }\n </mat-tab-group>\n </mat-card-content>\n</mat-card>\n", styles: [".full-width{width:100%}table{border-collapse:collapse}th{font-weight:400;color:silver}td.fit-width{width:1px;white-space:nowrap}tbody tr:nth-child(odd){background-color:#e2e2e2}#layers td{padding:0 6px}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}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.group-header{border-top:1px solid #ccc}table.parts-table{width:100%}table.parts-table th{text-align:left}fieldset{border:1px solid silver;border-radius:6px;padding:6px;margin:8px 0}@media only screen and (max-width: 599px){.noif-lt-xs{display:none}}\n"] }]
902
+ args: [{ selector: 'cadmus-item-editor', template: "<mat-card appearance=\"outlined\">\n <mat-card-header>\n <mat-card-title>\n {{ (item$ | async)?.title || \"Item\" }}\n </mat-card-title>\n <mat-card-subtitle>\n {{ (item$ | async)?.description }}\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n @if (id) {\n <p>\n ID:\n <input\n [cdkCopyToClipboard]=\"(item$ | async)?.id || ''\"\n type=\"text\"\n readonly=\"true\"\n spellcheck=\"false\"\n matTooltip=\"Click to copy\"\n [value]=\"(item$ | async)?.id\"\n class=\"id\"\n />\n </p>\n } @if (item$ | async; as item) {\n <p>\n Last saved {{ item.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }} by\n {{ item.userId }}.<br />\n Created {{ item.timeCreated | date : \"yyyy-MM-dd HH:mm:ss\" }} by\n {{ item.creatorId }}.\n </p>\n } @if (busy) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n\n <!-- item content -->\n <mat-tab-group [selectedIndex]=\"id ? 1 : 0\">\n <!-- metadata -->\n <mat-tab label=\"Metadata\">\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\n <div class=\"form-row\">\n <!-- title -->\n <mat-form-field style=\"flex: 1 0 auto\">\n <mat-label>title</mat-label>\n <input matInput type=\"text\" id=\"title\" [formControl]=\"title\" />\n @if ( title.hasError('required') && (title.touched || title.dirty)\n ) {\n <mat-error>enter title</mat-error>\n } @if ( title.hasError('maxLength') && (title.touched ||\n title.dirty) ) {\n <mat-error> title too long</mat-error>\n }\n </mat-form-field>\n\n <!-- sortKey -->\n <mat-form-field style=\"flex: 1 0 auto\">\n <mat-label>sort key</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"sortKey\"\n [formControl]=\"sortKey\"\n />\n @if ( sortKey.hasError('required') && (sortKey.touched ||\n sortKey.dirty) ) {\n <mat-error>enter sort key</mat-error>\n } @if ( sortKey.hasError('maxLength') && (sortKey.touched ||\n sortKey.dirty) ) {\n <mat-error>sort key too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- description -->\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>description</mat-label>\n <textarea\n rows=\"2\"\n matInput\n id=\"description\"\n [formControl]=\"description\"\n ></textarea>\n @if ( description.hasError('required') && (description.touched ||\n description.dirty) ) {\n <mat-error>enter description</mat-error>\n } @if ( description.hasError('maxLength') && (description.touched\n || description.dirty) ) {\n <mat-error>description too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- facet -->\n <div class=\"form-row\">\n <mat-form-field>\n <mat-label>facet</mat-label>\n <mat-select [formControl]=\"facet\" required=\"true\">\n @for (f of facets$ | async; track f) {\n <mat-option [value]=\"f.id\">\n {{ f.label }}\n </mat-option>\n }\n </mat-select>\n <mat-error>please select a facet</mat-error>\n </mat-form-field>\n\n <!-- group -->\n <mat-form-field>\n <mat-label>group ID</mat-label>\n <input matInput [formControl]=\"group\" />\n @if ( group.hasError('maxLength') && (group.dirty ||\n group.touched) ) {\n <mat-error>too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- flags -->\n <fieldset>\n <legend>flags</legend>\n @if (flagDefinitions) {\n <div formArrayName=\"flagChecks\">\n @for (c of flagChecks.controls; track c; let i = $index) {\n <mat-checkbox class=\"flag\" [formControlName]=\"i\">\n <span [style.color]=\"'#' + flagDefinitions[i].colorKey\"\n >&#x2b24;</span\n >\n &nbsp;\n {{ flagDefinitions[i].label }}\n </mat-checkbox>\n }\n </div>\n }\n </fieldset>\n <br />\n\n <div>\n @if ( user?.roles?.length && (user?.roles?.includes('admin') ||\n user?.roles?.includes('editor') ||\n user?.roles?.includes('operator')) ) {\n <button\n type=\"submit\"\n mat-raised-button\n color=\"primary\"\n class=\"mat-primary\"\n [disabled]=\"userLevel < 2 || busy\"\n matTooltip=\"Save metadata\"\n >\n <mat-icon>save</mat-icon> save\n </button>\n }\n </div>\n </form>\n </mat-tab>\n\n <!-- parts -->\n @if (id) {\n <mat-tab label=\"Parts\">\n <div class=\"new-part\">\n <form [formGroup]=\"newPart\" class=\"form-row\">\n <mat-form-field>\n <mat-label>part</mat-label>\n <mat-select [formControl]=\"newPartType\" required>\n @for (p of newPartDefinitions$ | async; track p) {\n <mat-option [value]=\"p\">\n <span [style.color]=\"'#' + p.colorKey\" class=\"new-part-icon\"\n >&#x2b24;</span\n >\n {{ p.name }}\n @if (p.roleId) {\n <span class=\"new-part-role\">{{ p.roleId }}</span>\n }\n </mat-option>\n }\n </mat-select>\n <mat-error>part type required</mat-error>\n </mat-form-field>\n <button\n mat-stroked-button\n color=\"primary\"\n class=\"mat-primary\"\n type=\"button\"\n [disabled]=\"userLevel < 2 || busy || !newPart.valid\"\n (click)=\"addPart()\"\n matTooltip=\"Add a new part of the selected type\"\n >\n <mat-icon>add_circle</mat-icon>\n part\n </button>\n </form>\n </div>\n <mat-divider></mat-divider>\n @for (group of partGroups$ | async; track group) {\n <mat-expansion-panel expanded=\"true\" class=\"group-header\">\n <mat-expansion-panel-header>\n <mat-panel-title\n ><strong>{{ group.label }}</strong></mat-panel-title\n >\n <mat-panel-description>{{\n group.parts.length\n }}</mat-panel-description>\n </mat-expansion-panel-header>\n <table class=\"parts-table\">\n <thead>\n <tr>\n <th></th>\n <th>type</th>\n <th>role</th>\n <th class=\"noif-lt-xs\">modified</th>\n <th class=\"noif-lt-xs\">user</th>\n </tr>\n </thead>\n <tbody>\n @for (part of group.parts; track part) {\n <tr>\n <!-- edit -->\n <td class=\"fit-width\">\n <button\n mat-icon-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"busy\"\n (click)=\"editPart(part)\"\n matTooltip=\"Edit this part\"\n >\n <mat-icon class=\"mat-primary\">create</mat-icon>\n </button>\n <!-- delete -->\n @if ( user?.roles?.length && (user?.roles?.includes('admin')\n || user?.roles?.includes('editor') ||\n user?.roles?.includes('operator')) ) {\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"userLevel < 2 || busy\"\n (click)=\"deletePart(part)\"\n matTooltip=\"Delete this part\"\n >\n <mat-icon color=\"warn\" class=\"mat-warn\">delete</mat-icon>\n </button>\n }\n <!-- copy -->\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Copy this part ID\"\n [cdkCopyToClipboard]=\"part.id\"\n >\n <mat-icon>assignment</mat-icon>\n </button>\n <!-- preview -->\n @if ( part | hasPreview : (previewJKeys$ | async) :\n (previewFKeys$ | async) ) {\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Preview this part\"\n (click)=\"previewPart(part)\"\n >\n <mat-icon>preview</mat-icon>\n </button>\n }\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"1\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"2\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td class=\"noif-lt-xs\">\n {{ part.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }}\n </td>\n <td class=\"noif-lt-xs\">{{ part.userId }}</td>\n </tr>\n }\n </tbody>\n </table>\n </mat-expansion-panel>\n }\n <cadmus-missing-parts\n [partDefinitions]=\"(facet$ | async)?.partDefinitions\"\n [parts]=\"(parts$ | async) || undefined\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n (addRequest)=\"addPart($event)\"\n ></cadmus-missing-parts>\n </mat-tab>\n } @if (id) {\n <mat-tab label=\"Layers\">\n @if (layerPartInfos$ | async; as parts) {\n <table id=\"layers\">\n <thead>\n <th></th>\n <th>type</th>\n <th>role</th>\n <th>frr.</th>\n <th>last modified</th>\n </thead>\n <tbody>\n @for (part of parts; track part) {\n <tr>\n <td class=\"fit-width\">\n @if (!part.isAbsent) {\n <button\n type=\"button\"\n color=\"primary\"\n mat-icon-button\n matTooltip=\"Edit this layer part\"\n (click)=\"editPart(part)\"\n >\n <mat-icon class=\"mat-primary\">edit</mat-icon>\n </button>\n } @if (part.isAbsent) {\n <button\n type=\"button\"\n mat-icon-button\n color=\"primary\"\n matTooltip=\"Add this layer part\"\n [disabled]=\"userLevel < 2\"\n (click)=\"addLayerPart(part)\"\n >\n <mat-icon class=\"mat-primary\">add_circle</mat-icon>\n </button>\n } @if (!part.isAbsent) {\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n matTooltip=\"Delete this layer part\"\n [disabled]=\"userLevel < 2\"\n (click)=\"deletePart(part)\"\n >\n <mat-icon class=\"mat-warn\">delete</mat-icon>\n </button>\n } @if (!part.isAbsent) {\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Copy this part ID\"\n [cdkCopyToClipboard]=\"part.id\"\n >\n <mat-icon>assignment</mat-icon>\n </button>\n }\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"1\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td>\n <cadmus-part-badge\n [partTypeIds]=\"part\"\n [facetDefinition]=\"(facet$ | async) || undefined\"\n [badgeType]=\"2\"\n [typeThesaurus]=\"(typeThesaurus$ | async) || undefined\"\n ></cadmus-part-badge>\n </td>\n <td\n [ngClass]=\"{\n 'count-n': part.fragmentCount,\n 'count-z': !part.fragmentCount\n }\"\n >\n {{ part.fragmentCount }}\n </td>\n <td>\n @if (!part.isAbsent) {\n <span>\n {{ part.timeModified | date : \"yyyy-MM-dd HH:mm:ss\" }}\n </span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n </mat-tab>\n } @if (parts$ | async; as parts) {\n <mat-tab label=\"Th-Scopes\">\n <!-- [parts]=\"parts | sort: 'typeId' | sort: 'roleId'\" -->\n <cadmus-parts-scope-editor\n [parts]=\"parts\"\n [readonly]=\"userLevel < 2 || busy ? true : false\"\n (setScopeRequest)=\"setPartsScope($event)\"\n ></cadmus-parts-scope-editor>\n </mat-tab>\n }\n </mat-tab-group>\n </mat-card-content>\n</mat-card>\n", styles: [".full-width{width:100%}table{width:100%;border-collapse:collapse}th{font-weight:400;color:silver}td.fit-width{width:1px;white-space:nowrap}tbody tr:nth-child(odd){background-color:#e2e2e2}#layers td{padding:0 6px}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}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.group-header{border-top:1px solid #ccc}table.parts-table{width:100%}table.parts-table th{text-align:left}fieldset{border:1px solid silver;border-radius:6px;padding:6px;margin:8px 0}@media only screen and (max-width: 599px){.noif-lt-xs{display:none}}\n"] }]
903
903
  }], ctorParameters: () => [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i2$2.MatSnackBar }, { type: i1.AppRepository }, { type: EditedItemRepository }, { type: i2.ItemService }, { type: i6.ItemListRepository }, { type: i7.LibraryRouteService }, { type: i3$1.DialogService }, { type: i9$1.AuthJwtService }, { type: i2.UserLevelService }, { type: i10.FormBuilder }] });
904
904
 
905
905
  // https://github.com/ng-packagr/ng-packagr/issues/778