@myrmidon/cadmus-part-lexicography-lemma 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
ADDED
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import { CommonModule, TitleCasePipe } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { model, output, input, effect, Component, signal } from '@angular/core';
|
|
4
|
+
import * as i2 from '@angular/forms';
|
|
5
|
+
import { Validators, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import * as i2$1 from '@angular/material/button';
|
|
7
|
+
import { MatButtonModule, MatButton, MatIconButton } from '@angular/material/button';
|
|
8
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
9
|
+
import * as i3 from '@angular/material/form-field';
|
|
10
|
+
import { MatFormFieldModule, MatError, MatFormField, MatLabel } from '@angular/material/form-field';
|
|
11
|
+
import * as i4 from '@angular/material/icon';
|
|
12
|
+
import { MatIconModule, MatIcon } from '@angular/material/icon';
|
|
13
|
+
import * as i5 from '@angular/material/input';
|
|
14
|
+
import { MatInputModule, MatInput } from '@angular/material/input';
|
|
15
|
+
import * as i6 from '@angular/material/select';
|
|
16
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
17
|
+
import * as i7 from '@angular/material/tooltip';
|
|
18
|
+
import { MatTooltipModule, MatTooltip } from '@angular/material/tooltip';
|
|
19
|
+
import { ThesEntriesPickerComponent, ModelEditorComponentBase, CloseSaveButtonsComponent } from '@myrmidon/cadmus-ui';
|
|
20
|
+
import { MatExpansionPanel, MatExpansionPanelHeader, MatExpansionPanelTitle } from '@angular/material/expansion';
|
|
21
|
+
import { FlatLookupPipe } from '@myrmidon/ngx-tools';
|
|
22
|
+
import * as i1 from '@myrmidon/ngx-mat-tools';
|
|
23
|
+
import * as i4$1 from '@myrmidon/cadmus-state';
|
|
24
|
+
import { EditPartFeatureBase } from '@myrmidon/cadmus-state';
|
|
25
|
+
import { CurrentItemBarComponent } from '@myrmidon/cadmus-ui-pg';
|
|
26
|
+
import { MatCard, MatCardActions, MatCardContent, MatCardHeader, MatCardTitle } from '@angular/material/card';
|
|
27
|
+
import * as i1$1 from '@myrmidon/auth-jwt-login';
|
|
28
|
+
import * as i1$2 from '@angular/router';
|
|
29
|
+
import * as i2$2 from '@angular/material/snack-bar';
|
|
30
|
+
import * as i3$1 from '@myrmidon/cadmus-api';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The type ID used to identify the lemma part type.
|
|
34
|
+
*/
|
|
35
|
+
const LEX_LEMMA_PART_TYPEID = 'it.vedph.lexicography.lemma';
|
|
36
|
+
/**
|
|
37
|
+
* JSON schema for the lemma part.
|
|
38
|
+
* You can use the JSON schema tool at https://jsonschema.net/.
|
|
39
|
+
*/
|
|
40
|
+
const LEX_LEMMA_PART_SCHEMA = {
|
|
41
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
42
|
+
$id: 'www.vedph.it/cadmus/parts/myrmidon/lexicography/' + LEX_LEMMA_PART_TYPEID + '.json',
|
|
43
|
+
type: 'object',
|
|
44
|
+
title: 'LexLemmaPart',
|
|
45
|
+
required: [
|
|
46
|
+
'id',
|
|
47
|
+
'itemId',
|
|
48
|
+
'typeId',
|
|
49
|
+
'timeCreated',
|
|
50
|
+
'creatorId',
|
|
51
|
+
'timeModified',
|
|
52
|
+
'userId',
|
|
53
|
+
'lid',
|
|
54
|
+
'forms',
|
|
55
|
+
],
|
|
56
|
+
properties: {
|
|
57
|
+
timeCreated: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
pattern: '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d+Z$',
|
|
60
|
+
},
|
|
61
|
+
creatorId: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
},
|
|
64
|
+
timeModified: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
pattern: '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d+Z$',
|
|
67
|
+
},
|
|
68
|
+
userId: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
},
|
|
71
|
+
id: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$',
|
|
74
|
+
},
|
|
75
|
+
itemId: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$',
|
|
78
|
+
},
|
|
79
|
+
typeId: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
pattern: '^[a-z][-0-9a-z._]*$',
|
|
82
|
+
},
|
|
83
|
+
roleId: {
|
|
84
|
+
type: ['string', 'null'],
|
|
85
|
+
pattern: '^([a-z][-0-9a-z._]*)?$',
|
|
86
|
+
},
|
|
87
|
+
lid: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
},
|
|
90
|
+
homograph: {
|
|
91
|
+
type: ['integer', 'null'],
|
|
92
|
+
},
|
|
93
|
+
forms: {
|
|
94
|
+
type: 'array',
|
|
95
|
+
minItems: 1,
|
|
96
|
+
items: {
|
|
97
|
+
type: 'object',
|
|
98
|
+
required: ['type', 'value', 'pos'],
|
|
99
|
+
properties: {
|
|
100
|
+
type: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
},
|
|
103
|
+
prefix: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
},
|
|
106
|
+
value: {
|
|
107
|
+
type: 'string',
|
|
108
|
+
},
|
|
109
|
+
suffix: {
|
|
110
|
+
type: 'string',
|
|
111
|
+
},
|
|
112
|
+
pos: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
},
|
|
115
|
+
features: {
|
|
116
|
+
type: 'array',
|
|
117
|
+
items: {
|
|
118
|
+
type: 'string',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
tags: {
|
|
122
|
+
type: 'array',
|
|
123
|
+
items: {
|
|
124
|
+
type: 'string',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
note: {
|
|
128
|
+
type: 'string',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
additionalProperties: false,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
additionalProperties: false,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
class WordFormEditor {
|
|
139
|
+
form = model(...(ngDevMode ? [undefined, { debugName: "form" }] : []));
|
|
140
|
+
cancelEdit = output();
|
|
141
|
+
// lex-word-form-types
|
|
142
|
+
typeEntries = input(...(ngDevMode ? [undefined, { debugName: "typeEntries" }] : []));
|
|
143
|
+
// lex-word-form-prefixes
|
|
144
|
+
prefixEntries = input(...(ngDevMode ? [undefined, { debugName: "prefixEntries" }] : []));
|
|
145
|
+
// lex-word-form-suffixes
|
|
146
|
+
suffixEntries = input(...(ngDevMode ? [undefined, { debugName: "suffixEntries" }] : []));
|
|
147
|
+
// lex-pos-tags
|
|
148
|
+
posEntries = input.required(...(ngDevMode ? [{ debugName: "posEntries" }] : []));
|
|
149
|
+
// lex-word-form-features
|
|
150
|
+
featureEntries = input(...(ngDevMode ? [undefined, { debugName: "featureEntries" }] : []));
|
|
151
|
+
// lex-word-form-tags
|
|
152
|
+
tagEntries = input(...(ngDevMode ? [undefined, { debugName: "tagEntries" }] : []));
|
|
153
|
+
type;
|
|
154
|
+
prefix;
|
|
155
|
+
value;
|
|
156
|
+
suffix;
|
|
157
|
+
pos;
|
|
158
|
+
features;
|
|
159
|
+
tags;
|
|
160
|
+
note;
|
|
161
|
+
formCtl;
|
|
162
|
+
constructor(formBuilder) {
|
|
163
|
+
// form
|
|
164
|
+
this.type = formBuilder.control('', {
|
|
165
|
+
nonNullable: true,
|
|
166
|
+
validators: [Validators.required, Validators.maxLength(50)],
|
|
167
|
+
});
|
|
168
|
+
this.prefix = formBuilder.control(null, { validators: [Validators.maxLength(50)] });
|
|
169
|
+
this.value = formBuilder.control('', {
|
|
170
|
+
nonNullable: true,
|
|
171
|
+
validators: [Validators.required, Validators.maxLength(500)],
|
|
172
|
+
});
|
|
173
|
+
this.suffix = formBuilder.control(null, { validators: [Validators.maxLength(50)] });
|
|
174
|
+
this.pos = formBuilder.control({ id: '', value: '' }, {
|
|
175
|
+
nonNullable: true,
|
|
176
|
+
validators: Validators.required,
|
|
177
|
+
});
|
|
178
|
+
this.features = formBuilder.control([], { nonNullable: true });
|
|
179
|
+
this.tags = formBuilder.control([], { nonNullable: true });
|
|
180
|
+
this.note = formBuilder.control(null);
|
|
181
|
+
this.formCtl = formBuilder.group({
|
|
182
|
+
type: this.type,
|
|
183
|
+
prefix: this.prefix,
|
|
184
|
+
value: this.value,
|
|
185
|
+
suffix: this.suffix,
|
|
186
|
+
pos: this.pos,
|
|
187
|
+
features: this.features,
|
|
188
|
+
tags: this.tags,
|
|
189
|
+
note: this.note,
|
|
190
|
+
});
|
|
191
|
+
// when model changes, update form
|
|
192
|
+
effect(() => {
|
|
193
|
+
const data = this.form();
|
|
194
|
+
this.updateForm(data);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
mapIdToEntry(id, entries) {
|
|
198
|
+
if (!id)
|
|
199
|
+
return null;
|
|
200
|
+
if (!entries)
|
|
201
|
+
return { id, value: id };
|
|
202
|
+
return entries.find((e) => e.id === id) || { id, value: id };
|
|
203
|
+
}
|
|
204
|
+
mapIdsToEntries(ids, entries) {
|
|
205
|
+
if (!entries)
|
|
206
|
+
return ids.map((id) => ({ id, value: id }));
|
|
207
|
+
return ids.map((id) => entries.find((e) => e.id === id) || { id, value: id });
|
|
208
|
+
}
|
|
209
|
+
updateForm(data) {
|
|
210
|
+
if (!data) {
|
|
211
|
+
this.formCtl.reset();
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
this.type.setValue(data.type || '');
|
|
215
|
+
this.prefix.setValue(data.prefix || null);
|
|
216
|
+
this.value.setValue(data.value || '');
|
|
217
|
+
this.suffix.setValue(data.suffix || null);
|
|
218
|
+
this.pos.setValue(this.mapIdToEntry(data.pos, this.posEntries()) || this.posEntries()?.[0]);
|
|
219
|
+
this.features.setValue(this.mapIdsToEntries(data.features || [], this.featureEntries()));
|
|
220
|
+
this.tags.setValue(this.mapIdsToEntries(data.tags || [], this.tagEntries()));
|
|
221
|
+
this.note.setValue(data.note || null);
|
|
222
|
+
this.formCtl.markAsPristine();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
onPosEntriesChange(entries) {
|
|
226
|
+
this.pos.setValue(entries[0]);
|
|
227
|
+
this.pos.markAsDirty();
|
|
228
|
+
this.pos.updateValueAndValidity();
|
|
229
|
+
}
|
|
230
|
+
onFeatureEntriesChange(entries) {
|
|
231
|
+
this.features.setValue(entries);
|
|
232
|
+
this.features.markAsDirty();
|
|
233
|
+
this.features.updateValueAndValidity();
|
|
234
|
+
}
|
|
235
|
+
onTagEntriesChange(entries) {
|
|
236
|
+
this.tags.setValue(entries);
|
|
237
|
+
this.tags.markAsDirty();
|
|
238
|
+
this.tags.updateValueAndValidity();
|
|
239
|
+
}
|
|
240
|
+
getData() {
|
|
241
|
+
return {
|
|
242
|
+
type: this.type.value,
|
|
243
|
+
prefix: this.prefix.value || undefined,
|
|
244
|
+
value: this.value.value,
|
|
245
|
+
suffix: this.suffix.value || undefined,
|
|
246
|
+
pos: this.pos.value.id,
|
|
247
|
+
features: this.features.value.map((e) => e.id),
|
|
248
|
+
tags: this.tags.value.map((e) => e.id),
|
|
249
|
+
note: this.note.value?.trim() || undefined,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
cancel() {
|
|
253
|
+
this.cancelEdit.emit();
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Saves the current form data by updating the `data` model signal.
|
|
257
|
+
* This method can be called manually (e.g., by a Save button) or
|
|
258
|
+
* automatically (via auto-save).
|
|
259
|
+
* @param pristine If true (default), the form is marked as pristine
|
|
260
|
+
* after saving.
|
|
261
|
+
* Set to false for auto-save if you want the form to remain dirty.
|
|
262
|
+
*/
|
|
263
|
+
save(pristine = true) {
|
|
264
|
+
if (this.formCtl.invalid) {
|
|
265
|
+
// show validation errors
|
|
266
|
+
this.formCtl.markAllAsTouched();
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
const data = this.getData();
|
|
270
|
+
this.form.set(data);
|
|
271
|
+
if (pristine) {
|
|
272
|
+
this.formCtl.markAsPristine();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: WordFormEditor, deps: [{ token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
276
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: WordFormEditor, isStandalone: true, selector: "cadmus-word-form-editor", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, typeEntries: { classPropertyName: "typeEntries", publicName: "typeEntries", isSignal: true, isRequired: false, transformFunction: null }, prefixEntries: { classPropertyName: "prefixEntries", publicName: "prefixEntries", isSignal: true, isRequired: false, transformFunction: null }, suffixEntries: { classPropertyName: "suffixEntries", publicName: "suffixEntries", isSignal: true, isRequired: false, transformFunction: null }, posEntries: { classPropertyName: "posEntries", publicName: "posEntries", isSignal: true, isRequired: true, transformFunction: null }, featureEntries: { classPropertyName: "featureEntries", publicName: "featureEntries", isSignal: true, isRequired: false, transformFunction: null }, tagEntries: { classPropertyName: "tagEntries", publicName: "tagEntries", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { form: "formChange", cancelEdit: "cancelEdit" }, ngImport: i0, template: "<form [formGroup]=\"formCtl\" (submit)=\"save()\">\r\n <div class=\"form-row\">\r\n <!-- type (bound) -->\r\n @if (typeEntries()?.length) {\r\n <mat-form-field>\r\n <mat-label>type</mat-label>\r\n <mat-select [formControl]=\"type\">\r\n @for (e of typeEntries(); track e.id) {\r\n <mat-option [value]=\"e.id\">{{ e.value }}</mat-option>\r\n }\r\n </mat-select>\r\n @if ($any(type).errors?.required && (type.dirty || type.touched)) {\r\n <mat-error>type required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- type (free) -->\r\n <mat-form-field>\r\n <mat-label>type</mat-label>\r\n <input matInput [formControl]=\"type\" />\r\n @if ($any(type).errors?.required && (type.dirty || type.touched)) {\r\n <mat-error>type required</mat-error>\r\n } @if ($any(type).errors?.maxLength && (type.dirty || type.touched)) {\r\n <mat-error>type too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n\r\n <!-- pos (always bound) -->\r\n <cadmus-thes-entries-picker\r\n [availableEntries]=\"posEntries()!\"\r\n [entries]=\"[this.pos.value]\"\r\n [hierarchicLabels]=\"true\"\r\n [minEntries]=\"1\"\r\n [maxEntries]=\"1\"\r\n (entriesChange)=\"onPosEntriesChange($event!)\"\r\n />\r\n </div>\r\n <div class=\"form-row\">\r\n <!-- prefix (bound) -->\r\n @if (prefixEntries()?.length) {\r\n <mat-form-field>\r\n <mat-label>prefix</mat-label>\r\n <mat-select [formControl]=\"prefix\">\r\n @for (e of prefixEntries(); track e.id) {\r\n <mat-option [value]=\"e.id\">{{ e.value }}</mat-option>\r\n }\r\n </mat-select>\r\n @if ($any(prefix).errors?.required && (prefix.dirty || prefix.touched)) {\r\n <mat-error>prefix required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- prefix (free) -->\r\n <mat-form-field>\r\n <mat-label>prefix</mat-label>\r\n <input matInput [formControl]=\"prefix\" />\r\n @if ($any(prefix).errors?.required && (prefix.dirty || prefix.touched)) {\r\n <mat-error>prefix required</mat-error>\r\n } @if ($any(prefix).errors?.maxLength && (prefix.dirty || prefix.touched)) {\r\n <mat-error>prefix too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n\r\n <!-- value -->\r\n <mat-form-field>\r\n <mat-label>value</mat-label>\r\n <input matInput [formControl]=\"value\" />\r\n @if ($any(value).errors?.required && (value.dirty || value.touched)) {\r\n <mat-error>value required</mat-error>\r\n } @if ($any(value).errors?.maxLength && (value.dirty || value.touched)) {\r\n <mat-error>value too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <!-- suffix (bound) -->\r\n @if (suffixEntries()?.length) {\r\n <mat-form-field>\r\n <mat-label>suffix</mat-label>\r\n <mat-select [formControl]=\"suffix\">\r\n @for (e of suffixEntries(); track e.id) {\r\n <mat-option [value]=\"e.id\">{{ e.value }}</mat-option>\r\n }\r\n </mat-select>\r\n @if ($any(suffix).errors?.required && (suffix.dirty || suffix.touched)) {\r\n <mat-error>suffix required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- suffix (free) -->\r\n <mat-form-field>\r\n <mat-label>suffix</mat-label>\r\n <input matInput [formControl]=\"suffix\" />\r\n @if ($any(suffix).errors?.required && (suffix.dirty || suffix.touched)) {\r\n <mat-error>suffix required</mat-error>\r\n } @if ($any(suffix).errors?.maxLength && (suffix.dirty || suffix.touched)) {\r\n <mat-error>suffix too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n <!-- features -->\r\n @if (featureEntries()?.length) {\r\n <div>\r\n <fieldset>\r\n <legend>features</legend>\r\n <cadmus-thes-entries-picker\r\n [availableEntries]=\"featureEntries()!\"\r\n [entries]=\"features.value\"\r\n [hierarchicLabels]=\"true\"\r\n (entriesChange)=\"onFeatureEntriesChange($event!)\"\r\n />\r\n </fieldset>\r\n </div>\r\n }\r\n <!-- tags -->\r\n @if (tagEntries()?.length) {\r\n <div>\r\n <fieldset>\r\n <legend>tags</legend>\r\n <cadmus-thes-entries-picker\r\n [availableEntries]=\"tagEntries()!\"\r\n [entries]=\"tags.value\"\r\n (entriesChange)=\"onTagEntriesChange($event!)\"\r\n />\r\n </fieldset>\r\n </div>\r\n }\r\n <!-- note -->\r\n <div>\r\n <mat-form-field class=\"long-text\">\r\n <mat-label>note</mat-label>\r\n <textarea matInput [formControl]=\"note\" rows=\"3\"></textarea>\r\n @if ($any(note).errors?.maxLength && (note.dirty || note.touched)) {\r\n <mat-error>note too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n <!-- buttons -->\r\n <div>\r\n <button type=\"button\" mat-icon-button matTooltip=\"Discard changes\" (click)=\"cancel()\">\r\n <mat-icon class=\"mat-warn\">clear</mat-icon>\r\n </button>\r\n <button\r\n type=\"submit\"\r\n mat-icon-button\r\n matTooltip=\"Accept changes\"\r\n [disabled]=\"formCtl.invalid || formCtl.pristine\"\r\n >\r\n <mat-icon class=\"mat-primary\">check_circle</mat-icon>\r\n </button>\r\n </div>\r\n</form>\r\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.long-text{width:100%;max-width:800px}fieldset{border:1px solid silver;border-radius:6px;padding:6px}legend{color:silver}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6.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", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ThesEntriesPickerComponent, selector: "cadmus-thes-entries-picker", inputs: ["availableEntries", "entries", "hierarchicLabels", "autoSort", "allowCustom", "minEntries", "maxEntries", "expanded", "emptyMessage"], outputs: ["entriesChange", "expandedChange"] }] });
|
|
277
|
+
}
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: WordFormEditor, decorators: [{
|
|
279
|
+
type: Component,
|
|
280
|
+
args: [{ selector: 'cadmus-word-form-editor', imports: [
|
|
281
|
+
CommonModule,
|
|
282
|
+
ReactiveFormsModule,
|
|
283
|
+
MatButtonModule,
|
|
284
|
+
MatCheckboxModule,
|
|
285
|
+
MatFormFieldModule,
|
|
286
|
+
MatIconModule,
|
|
287
|
+
MatInputModule,
|
|
288
|
+
MatSelectModule,
|
|
289
|
+
MatTooltipModule,
|
|
290
|
+
ThesEntriesPickerComponent,
|
|
291
|
+
], template: "<form [formGroup]=\"formCtl\" (submit)=\"save()\">\r\n <div class=\"form-row\">\r\n <!-- type (bound) -->\r\n @if (typeEntries()?.length) {\r\n <mat-form-field>\r\n <mat-label>type</mat-label>\r\n <mat-select [formControl]=\"type\">\r\n @for (e of typeEntries(); track e.id) {\r\n <mat-option [value]=\"e.id\">{{ e.value }}</mat-option>\r\n }\r\n </mat-select>\r\n @if ($any(type).errors?.required && (type.dirty || type.touched)) {\r\n <mat-error>type required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- type (free) -->\r\n <mat-form-field>\r\n <mat-label>type</mat-label>\r\n <input matInput [formControl]=\"type\" />\r\n @if ($any(type).errors?.required && (type.dirty || type.touched)) {\r\n <mat-error>type required</mat-error>\r\n } @if ($any(type).errors?.maxLength && (type.dirty || type.touched)) {\r\n <mat-error>type too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n\r\n <!-- pos (always bound) -->\r\n <cadmus-thes-entries-picker\r\n [availableEntries]=\"posEntries()!\"\r\n [entries]=\"[this.pos.value]\"\r\n [hierarchicLabels]=\"true\"\r\n [minEntries]=\"1\"\r\n [maxEntries]=\"1\"\r\n (entriesChange)=\"onPosEntriesChange($event!)\"\r\n />\r\n </div>\r\n <div class=\"form-row\">\r\n <!-- prefix (bound) -->\r\n @if (prefixEntries()?.length) {\r\n <mat-form-field>\r\n <mat-label>prefix</mat-label>\r\n <mat-select [formControl]=\"prefix\">\r\n @for (e of prefixEntries(); track e.id) {\r\n <mat-option [value]=\"e.id\">{{ e.value }}</mat-option>\r\n }\r\n </mat-select>\r\n @if ($any(prefix).errors?.required && (prefix.dirty || prefix.touched)) {\r\n <mat-error>prefix required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- prefix (free) -->\r\n <mat-form-field>\r\n <mat-label>prefix</mat-label>\r\n <input matInput [formControl]=\"prefix\" />\r\n @if ($any(prefix).errors?.required && (prefix.dirty || prefix.touched)) {\r\n <mat-error>prefix required</mat-error>\r\n } @if ($any(prefix).errors?.maxLength && (prefix.dirty || prefix.touched)) {\r\n <mat-error>prefix too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n\r\n <!-- value -->\r\n <mat-form-field>\r\n <mat-label>value</mat-label>\r\n <input matInput [formControl]=\"value\" />\r\n @if ($any(value).errors?.required && (value.dirty || value.touched)) {\r\n <mat-error>value required</mat-error>\r\n } @if ($any(value).errors?.maxLength && (value.dirty || value.touched)) {\r\n <mat-error>value too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <!-- suffix (bound) -->\r\n @if (suffixEntries()?.length) {\r\n <mat-form-field>\r\n <mat-label>suffix</mat-label>\r\n <mat-select [formControl]=\"suffix\">\r\n @for (e of suffixEntries(); track e.id) {\r\n <mat-option [value]=\"e.id\">{{ e.value }}</mat-option>\r\n }\r\n </mat-select>\r\n @if ($any(suffix).errors?.required && (suffix.dirty || suffix.touched)) {\r\n <mat-error>suffix required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- suffix (free) -->\r\n <mat-form-field>\r\n <mat-label>suffix</mat-label>\r\n <input matInput [formControl]=\"suffix\" />\r\n @if ($any(suffix).errors?.required && (suffix.dirty || suffix.touched)) {\r\n <mat-error>suffix required</mat-error>\r\n } @if ($any(suffix).errors?.maxLength && (suffix.dirty || suffix.touched)) {\r\n <mat-error>suffix too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n <!-- features -->\r\n @if (featureEntries()?.length) {\r\n <div>\r\n <fieldset>\r\n <legend>features</legend>\r\n <cadmus-thes-entries-picker\r\n [availableEntries]=\"featureEntries()!\"\r\n [entries]=\"features.value\"\r\n [hierarchicLabels]=\"true\"\r\n (entriesChange)=\"onFeatureEntriesChange($event!)\"\r\n />\r\n </fieldset>\r\n </div>\r\n }\r\n <!-- tags -->\r\n @if (tagEntries()?.length) {\r\n <div>\r\n <fieldset>\r\n <legend>tags</legend>\r\n <cadmus-thes-entries-picker\r\n [availableEntries]=\"tagEntries()!\"\r\n [entries]=\"tags.value\"\r\n (entriesChange)=\"onTagEntriesChange($event!)\"\r\n />\r\n </fieldset>\r\n </div>\r\n }\r\n <!-- note -->\r\n <div>\r\n <mat-form-field class=\"long-text\">\r\n <mat-label>note</mat-label>\r\n <textarea matInput [formControl]=\"note\" rows=\"3\"></textarea>\r\n @if ($any(note).errors?.maxLength && (note.dirty || note.touched)) {\r\n <mat-error>note too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n <!-- buttons -->\r\n <div>\r\n <button type=\"button\" mat-icon-button matTooltip=\"Discard changes\" (click)=\"cancel()\">\r\n <mat-icon class=\"mat-warn\">clear</mat-icon>\r\n </button>\r\n <button\r\n type=\"submit\"\r\n mat-icon-button\r\n matTooltip=\"Accept changes\"\r\n [disabled]=\"formCtl.invalid || formCtl.pristine\"\r\n >\r\n <mat-icon class=\"mat-primary\">check_circle</mat-icon>\r\n </button>\r\n </div>\r\n</form>\r\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.long-text{width:100%;max-width:800px}fieldset{border:1px solid silver;border-radius:6px;padding:6px}legend{color:silver}\n"] }]
|
|
292
|
+
}], ctorParameters: () => [{ type: i2.FormBuilder }], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }, { type: i0.Output, args: ["formChange"] }], cancelEdit: [{ type: i0.Output, args: ["cancelEdit"] }], typeEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeEntries", required: false }] }], prefixEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefixEntries", required: false }] }], suffixEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffixEntries", required: false }] }], posEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "posEntries", required: true }] }], featureEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "featureEntries", required: false }] }], tagEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagEntries", required: false }] }] } });
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Editor for a set of word forms.
|
|
296
|
+
*/
|
|
297
|
+
class WordFormSetEditor {
|
|
298
|
+
_dialogService;
|
|
299
|
+
/**
|
|
300
|
+
* The forms to edit.
|
|
301
|
+
*/
|
|
302
|
+
forms = model([], ...(ngDevMode ? [{ debugName: "forms" }] : []));
|
|
303
|
+
/**
|
|
304
|
+
* The form being edited.
|
|
305
|
+
*/
|
|
306
|
+
edited = signal(undefined, ...(ngDevMode ? [{ debugName: "edited" }] : []));
|
|
307
|
+
/**
|
|
308
|
+
* The index of the form being edited, -1 if a new one.
|
|
309
|
+
*/
|
|
310
|
+
editedIndex = signal(-1, ...(ngDevMode ? [{ debugName: "editedIndex" }] : []));
|
|
311
|
+
// lex-word-form-types
|
|
312
|
+
typeEntries = input(...(ngDevMode ? [undefined, { debugName: "typeEntries" }] : []));
|
|
313
|
+
// lex-word-form-prefixes
|
|
314
|
+
prefixEntries = input(...(ngDevMode ? [undefined, { debugName: "prefixEntries" }] : []));
|
|
315
|
+
// lex-word-form-suffixes
|
|
316
|
+
suffixEntries = input(...(ngDevMode ? [undefined, { debugName: "suffixEntries" }] : []));
|
|
317
|
+
// lex-pos-tags (required)
|
|
318
|
+
posEntries = input.required(...(ngDevMode ? [{ debugName: "posEntries" }] : []));
|
|
319
|
+
// lex-word-form-features
|
|
320
|
+
featureEntries = input(...(ngDevMode ? [undefined, { debugName: "featureEntries" }] : []));
|
|
321
|
+
// lex-word-form-tags
|
|
322
|
+
tagEntries = input(...(ngDevMode ? [undefined, { debugName: "tagEntries" }] : []));
|
|
323
|
+
constructor(_dialogService) {
|
|
324
|
+
this._dialogService = _dialogService;
|
|
325
|
+
}
|
|
326
|
+
addForm() {
|
|
327
|
+
const entry = {
|
|
328
|
+
type: this.typeEntries()?.[0]?.id ?? '',
|
|
329
|
+
pos: this.posEntries()?.[0]?.id ?? '',
|
|
330
|
+
value: '',
|
|
331
|
+
};
|
|
332
|
+
this.editedIndex.set(-1);
|
|
333
|
+
this.edited.set(entry);
|
|
334
|
+
}
|
|
335
|
+
editForm(entry, index) {
|
|
336
|
+
this.editedIndex.set(index);
|
|
337
|
+
this.edited.set(structuredClone(entry));
|
|
338
|
+
}
|
|
339
|
+
closeForm() {
|
|
340
|
+
this.editedIndex.set(-1);
|
|
341
|
+
this.edited.set(undefined);
|
|
342
|
+
}
|
|
343
|
+
saveForm(entry) {
|
|
344
|
+
const forms = [...this.forms()];
|
|
345
|
+
if (this.editedIndex() === -1) {
|
|
346
|
+
forms.push(entry);
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
forms.splice(this.editedIndex(), 1, entry);
|
|
350
|
+
}
|
|
351
|
+
this.forms.set(forms);
|
|
352
|
+
this.closeForm();
|
|
353
|
+
}
|
|
354
|
+
deleteForm(index) {
|
|
355
|
+
this._dialogService
|
|
356
|
+
.confirm('Confirmation', `Delete form #${index + 1}?`)
|
|
357
|
+
.subscribe((yes) => {
|
|
358
|
+
if (yes) {
|
|
359
|
+
if (this.editedIndex() === index) {
|
|
360
|
+
this.closeForm();
|
|
361
|
+
}
|
|
362
|
+
const forms = [...this.forms()];
|
|
363
|
+
forms.splice(index, 1);
|
|
364
|
+
this.forms.set(forms);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
moveFormUp(index) {
|
|
369
|
+
if (index < 1) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
const form = this.forms()[index];
|
|
373
|
+
const forms = [...this.forms()];
|
|
374
|
+
forms.splice(index, 1);
|
|
375
|
+
forms.splice(index - 1, 0, form);
|
|
376
|
+
this.forms.set(forms);
|
|
377
|
+
}
|
|
378
|
+
moveFormDown(index) {
|
|
379
|
+
if (index + 1 >= this.forms().length) {
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
const form = this.forms()[index];
|
|
383
|
+
const forms = [...this.forms()];
|
|
384
|
+
forms.splice(index, 1);
|
|
385
|
+
forms.splice(index + 1, 0, form);
|
|
386
|
+
this.forms.set(forms);
|
|
387
|
+
}
|
|
388
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: WordFormSetEditor, deps: [{ token: i1.DialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
389
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: WordFormSetEditor, isStandalone: true, selector: "cadmus-word-form-set-editor", inputs: { forms: { classPropertyName: "forms", publicName: "forms", isSignal: true, isRequired: false, transformFunction: null }, typeEntries: { classPropertyName: "typeEntries", publicName: "typeEntries", isSignal: true, isRequired: false, transformFunction: null }, prefixEntries: { classPropertyName: "prefixEntries", publicName: "prefixEntries", isSignal: true, isRequired: false, transformFunction: null }, suffixEntries: { classPropertyName: "suffixEntries", publicName: "suffixEntries", isSignal: true, isRequired: false, transformFunction: null }, posEntries: { classPropertyName: "posEntries", publicName: "posEntries", isSignal: true, isRequired: true, transformFunction: null }, featureEntries: { classPropertyName: "featureEntries", publicName: "featureEntries", isSignal: true, isRequired: false, transformFunction: null }, tagEntries: { classPropertyName: "tagEntries", publicName: "tagEntries", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { forms: "formsChange" }, ngImport: i0, template: "<div>\r\n <button type=\"button\" mat-flat-button class=\"mat-primary\" (click)=\"addForm()\">\r\n <mat-icon>add_circle</mat-icon> form\r\n </button>\r\n</div>\r\n@if (forms().length) {\r\n<table>\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>type</th>\r\n <th>prefix</th>\r\n <th>value</th>\r\n <th>suffix</th>\r\n <th>POS</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (entry of forms(); track entry; let i = $index; let first = $first; let last = $last)\r\n {\r\n <tr [class.selected]=\"i === editedIndex()\">\r\n <td class=\"fit-width\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Edit this form\"\r\n (click)=\"editForm(entry, i)\"\r\n >\r\n <mat-icon class=\"mat-primary\">edit</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this form up\"\r\n [disabled]=\"first\"\r\n (click)=\"moveFormUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this form down\"\r\n [disabled]=\"last\"\r\n (click)=\"moveFormDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Delete this form\"\r\n (click)=\"deleteForm(i)\"\r\n >\r\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ entry.type | flatLookup : typeEntries() : 'id' : 'value' }}</td>\r\n <td>{{ entry.prefix | flatLookup : prefixEntries() : 'id' : 'value' }}</td>\r\n <td>{{ entry.value }}</td>\r\n <td>{{ entry.suffix | flatLookup : suffixEntries() : 'id' : 'value' }}</td>\r\n <td>{{ entry.pos | flatLookup : posEntries() : 'id' : 'value' }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n</table>\r\n} @if (edited()) {\r\n<fieldset>\r\n <mat-expansion-panel [expanded]=\"edited()\" [disabled]=\"!edited()\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>form #</mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <cadmus-word-form-editor\r\n [typeEntries]=\"typeEntries()\"\r\n [prefixEntries]=\"prefixEntries()\"\r\n [suffixEntries]=\"suffixEntries()\"\r\n [posEntries]=\"posEntries()\"\r\n [featureEntries]=\"featureEntries()\"\r\n [tagEntries]=\"tagEntries()\"\r\n [form]=\"edited()!\"\r\n (formChange)=\"saveForm($event!)\"\r\n (editorClose)=\"closeForm()\"\r\n />\r\n </mat-expansion-panel>\r\n</fieldset>\r\n}\r\n", styles: ["table{width:100%;border-collapse:collapse}tbody tr:nth-child(odd){background-color:#e2e2e2}th{text-align:left;font-weight:400;color:silver}td.fit-width{width:1px;white-space:nowrap}tr.selected{background-color:#d0d0d0!important}fieldset{border:1px solid silver;border-radius:6px;padding:6px}\n"], dependencies: [{ kind: "component", type: MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: WordFormEditor, selector: "cadmus-word-form-editor", inputs: ["form", "typeEntries", "prefixEntries", "suffixEntries", "posEntries", "featureEntries", "tagEntries"], outputs: ["formChange", "cancelEdit"] }, { kind: "pipe", type: FlatLookupPipe, name: "flatLookup" }] });
|
|
390
|
+
}
|
|
391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: WordFormSetEditor, decorators: [{
|
|
392
|
+
type: Component,
|
|
393
|
+
args: [{ selector: 'cadmus-word-form-set-editor', imports: [
|
|
394
|
+
MatExpansionPanel,
|
|
395
|
+
MatExpansionPanelHeader,
|
|
396
|
+
MatExpansionPanelTitle,
|
|
397
|
+
MatButton,
|
|
398
|
+
MatIconButton,
|
|
399
|
+
MatIcon,
|
|
400
|
+
MatTooltip,
|
|
401
|
+
FlatLookupPipe,
|
|
402
|
+
WordFormEditor,
|
|
403
|
+
], template: "<div>\r\n <button type=\"button\" mat-flat-button class=\"mat-primary\" (click)=\"addForm()\">\r\n <mat-icon>add_circle</mat-icon> form\r\n </button>\r\n</div>\r\n@if (forms().length) {\r\n<table>\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>type</th>\r\n <th>prefix</th>\r\n <th>value</th>\r\n <th>suffix</th>\r\n <th>POS</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (entry of forms(); track entry; let i = $index; let first = $first; let last = $last)\r\n {\r\n <tr [class.selected]=\"i === editedIndex()\">\r\n <td class=\"fit-width\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Edit this form\"\r\n (click)=\"editForm(entry, i)\"\r\n >\r\n <mat-icon class=\"mat-primary\">edit</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this form up\"\r\n [disabled]=\"first\"\r\n (click)=\"moveFormUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this form down\"\r\n [disabled]=\"last\"\r\n (click)=\"moveFormDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Delete this form\"\r\n (click)=\"deleteForm(i)\"\r\n >\r\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ entry.type | flatLookup : typeEntries() : 'id' : 'value' }}</td>\r\n <td>{{ entry.prefix | flatLookup : prefixEntries() : 'id' : 'value' }}</td>\r\n <td>{{ entry.value }}</td>\r\n <td>{{ entry.suffix | flatLookup : suffixEntries() : 'id' : 'value' }}</td>\r\n <td>{{ entry.pos | flatLookup : posEntries() : 'id' : 'value' }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n</table>\r\n} @if (edited()) {\r\n<fieldset>\r\n <mat-expansion-panel [expanded]=\"edited()\" [disabled]=\"!edited()\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>form #</mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <cadmus-word-form-editor\r\n [typeEntries]=\"typeEntries()\"\r\n [prefixEntries]=\"prefixEntries()\"\r\n [suffixEntries]=\"suffixEntries()\"\r\n [posEntries]=\"posEntries()\"\r\n [featureEntries]=\"featureEntries()\"\r\n [tagEntries]=\"tagEntries()\"\r\n [form]=\"edited()!\"\r\n (formChange)=\"saveForm($event!)\"\r\n (editorClose)=\"closeForm()\"\r\n />\r\n </mat-expansion-panel>\r\n</fieldset>\r\n}\r\n", styles: ["table{width:100%;border-collapse:collapse}tbody tr:nth-child(odd){background-color:#e2e2e2}th{text-align:left;font-weight:400;color:silver}td.fit-width{width:1px;white-space:nowrap}tr.selected{background-color:#d0d0d0!important}fieldset{border:1px solid silver;border-radius:6px;padding:6px}\n"] }]
|
|
404
|
+
}], ctorParameters: () => [{ type: i1.DialogService }], propDecorators: { forms: [{ type: i0.Input, args: [{ isSignal: true, alias: "forms", required: false }] }, { type: i0.Output, args: ["formsChange"] }], typeEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeEntries", required: false }] }], prefixEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefixEntries", required: false }] }], suffixEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffixEntries", required: false }] }], posEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "posEntries", required: true }] }], featureEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "featureEntries", required: false }] }], tagEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagEntries", required: false }] }] } });
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Lexicography lemma part editor component.
|
|
408
|
+
* Thesauri: lex-word-form-types, lex-word-form-prefixes, lex-word-form-suffixes,
|
|
409
|
+
* lex-pos-tags, lex-word-form-features, lex-word-form-tags.
|
|
410
|
+
*/
|
|
411
|
+
class LexLemmaPartEditor extends ModelEditorComponentBase {
|
|
412
|
+
lid;
|
|
413
|
+
homograph;
|
|
414
|
+
forms;
|
|
415
|
+
// lex-word-form-types
|
|
416
|
+
typeEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "typeEntries" }] : []));
|
|
417
|
+
// lex-word-form-prefixes
|
|
418
|
+
prefixEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "prefixEntries" }] : []));
|
|
419
|
+
// lex-word-form-suffixes
|
|
420
|
+
suffixEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "suffixEntries" }] : []));
|
|
421
|
+
// lex-pos-tags (required)
|
|
422
|
+
posEntries = signal([], ...(ngDevMode ? [{ debugName: "posEntries" }] : []));
|
|
423
|
+
// lex-word-form-features
|
|
424
|
+
featureEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "featureEntries" }] : []));
|
|
425
|
+
// lex-word-form-tags
|
|
426
|
+
tagEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "tagEntries" }] : []));
|
|
427
|
+
constructor(authService, formBuilder) {
|
|
428
|
+
super(authService, formBuilder);
|
|
429
|
+
// form
|
|
430
|
+
this.lid = formBuilder.control(null, {
|
|
431
|
+
nonNullable: true,
|
|
432
|
+
validators: [Validators.required, Validators.maxLength(300)],
|
|
433
|
+
});
|
|
434
|
+
this.homograph = formBuilder.control(0, { nonNullable: true });
|
|
435
|
+
this.forms = formBuilder.control([], { nonNullable: true });
|
|
436
|
+
}
|
|
437
|
+
ngOnInit() {
|
|
438
|
+
super.ngOnInit();
|
|
439
|
+
}
|
|
440
|
+
buildForm(formBuilder) {
|
|
441
|
+
return formBuilder.group({
|
|
442
|
+
lid: this.lid,
|
|
443
|
+
homograph: this.homograph,
|
|
444
|
+
forms: this.forms,
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
updateThesauri(thesauri) {
|
|
448
|
+
let key = 'lex-word-form-types';
|
|
449
|
+
if (this.hasThesaurus(key)) {
|
|
450
|
+
this.typeEntries.set(thesauri[key].entries);
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
this.typeEntries.set(undefined);
|
|
454
|
+
}
|
|
455
|
+
key = 'lex-word-form-prefixes';
|
|
456
|
+
if (this.hasThesaurus(key)) {
|
|
457
|
+
this.prefixEntries.set(thesauri[key].entries);
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
this.prefixEntries.set(undefined);
|
|
461
|
+
}
|
|
462
|
+
key = 'lex-word-form-suffixes';
|
|
463
|
+
if (this.hasThesaurus(key)) {
|
|
464
|
+
this.suffixEntries.set(thesauri[key].entries);
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
this.suffixEntries.set(undefined);
|
|
468
|
+
}
|
|
469
|
+
key = 'lex-pos-tags';
|
|
470
|
+
if (this.hasThesaurus(key)) {
|
|
471
|
+
this.posEntries.set(thesauri[key].entries);
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
this.posEntries.set([]);
|
|
475
|
+
}
|
|
476
|
+
key = 'lex-word-form-features';
|
|
477
|
+
if (this.hasThesaurus(key)) {
|
|
478
|
+
this.featureEntries.set(thesauri[key].entries);
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
this.featureEntries.set(undefined);
|
|
482
|
+
}
|
|
483
|
+
key = 'lex-word-form-tags';
|
|
484
|
+
if (this.hasThesaurus(key)) {
|
|
485
|
+
this.tagEntries.set(thesauri[key].entries);
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
this.tagEntries.set(undefined);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
updateForm(part) {
|
|
492
|
+
if (!part) {
|
|
493
|
+
this.form.reset();
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
this.lid.setValue(part.lid || null);
|
|
497
|
+
this.homograph.setValue(part.homograph || 0);
|
|
498
|
+
this.forms.setValue(part.forms || []);
|
|
499
|
+
this.form.markAsPristine();
|
|
500
|
+
}
|
|
501
|
+
onFormsChange(forms) {
|
|
502
|
+
this.forms.setValue(forms || []);
|
|
503
|
+
this.form.markAsDirty();
|
|
504
|
+
this.forms.updateValueAndValidity();
|
|
505
|
+
}
|
|
506
|
+
onDataSet(data) {
|
|
507
|
+
// thesauri
|
|
508
|
+
if (data?.thesauri) {
|
|
509
|
+
this.updateThesauri(data.thesauri);
|
|
510
|
+
}
|
|
511
|
+
// form
|
|
512
|
+
this.updateForm(data?.value);
|
|
513
|
+
}
|
|
514
|
+
getValue() {
|
|
515
|
+
let part = this.getEditedPart(LEX_LEMMA_PART_TYPEID);
|
|
516
|
+
part.lid = this.lid.value || '';
|
|
517
|
+
part.homograph = this.homograph.value || undefined;
|
|
518
|
+
part.forms = this.forms.value || [];
|
|
519
|
+
return part;
|
|
520
|
+
}
|
|
521
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LexLemmaPartEditor, deps: [{ token: i1$1.AuthJwtService }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
522
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: LexLemmaPartEditor, isStandalone: true, selector: "cadmus-lex-lemma-part-editor", usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"form\" (submit)=\"save()\">\r\n <mat-card>\r\n <mat-card-header>\r\n <div mat-card-avatar>\r\n <mat-icon>picture_in_picture</mat-icon>\r\n </div>\r\n <mat-card-title>\r\n {{ (modelName() | titlecase) || 'Lemma Part' }}\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div class=\"form-row\">\r\n <!-- lid -->\r\n <mat-form-field>\r\n <mat-label>LID</mat-label>\r\n <input matInput [formControl]=\"lid\" />\r\n @if ($any(lid).errors?.required && (lid.dirty || lid.touched)) {\r\n <mat-error>LID required</mat-error>\r\n } @if ($any(lid).errors?.maxLength && (lid.dirty || lid.touched)) {\r\n <mat-error>LID too long</mat-error>\r\n }\r\n </mat-form-field>\r\n <!-- button -->\r\n <button type=\"button\" mat-icon-button matTooltip=\"Generate LID\">\r\n <mat-icon class=\"mat-primary\">arrow_circle_left</mat-icon>\r\n </button>\r\n <!-- homograph -->\r\n <mat-form-field class=\"nr\">\r\n <mat-label>hom.</mat-label>\r\n <input matInput [formControl]=\"homograph\" type=\"number\" min=\"0\" max=\"50\" />\r\n </mat-form-field>\r\n </div>\r\n <!-- forms -->\r\n <div>\r\n <fieldset>\r\n <legend>\r\n forms @if (!this.forms.value.length) {\r\n <span id=\"forms-error\" matTooltip=\"Form(s) required\"\r\n ><mat-icon class=\"mat-warn\">error</mat-icon></span\r\n >\r\n }\r\n </legend>\r\n <cadmus-word-form-set-editor\r\n [typeEntries]=\"typeEntries()\"\r\n [prefixEntries]=\"prefixEntries()\"\r\n [suffixEntries]=\"suffixEntries()\"\r\n [posEntries]=\"posEntries()\"\r\n [featureEntries]=\"featureEntries()\"\r\n [tagEntries]=\"tagEntries()\"\r\n [forms]=\"forms.value\"\r\n (formsChange)=\"onFormsChange($event)\"\r\n />\r\n </fieldset>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <cadmus-close-save-buttons [form]=\"form\" [noSave]=\"userLevel < 2\" (closeRequest)=\"close()\" />\r\n </mat-card-actions>\r\n </mat-card>\r\n</form>\r\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.nr{width:5em}#forms-error{color:#8b0000;margin-left:8px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.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: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "component", type: MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: CloseSaveButtonsComponent, selector: "cadmus-close-save-buttons", inputs: ["form", "noSave"], outputs: ["closeRequest"] }, { kind: "component", type: WordFormSetEditor, selector: "cadmus-word-form-set-editor", inputs: ["forms", "typeEntries", "prefixEntries", "suffixEntries", "posEntries", "featureEntries", "tagEntries"], outputs: ["formsChange"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
523
|
+
}
|
|
524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LexLemmaPartEditor, decorators: [{
|
|
525
|
+
type: Component,
|
|
526
|
+
args: [{ selector: 'cadmus-lex-lemma-part-editor', imports: [
|
|
527
|
+
ReactiveFormsModule,
|
|
528
|
+
MatCard,
|
|
529
|
+
MatCardActions,
|
|
530
|
+
MatCardContent,
|
|
531
|
+
MatCardHeader,
|
|
532
|
+
MatCardTitle,
|
|
533
|
+
MatError,
|
|
534
|
+
MatFormField,
|
|
535
|
+
MatIcon,
|
|
536
|
+
MatIconButton,
|
|
537
|
+
MatInput,
|
|
538
|
+
MatLabel,
|
|
539
|
+
MatTooltip,
|
|
540
|
+
TitleCasePipe,
|
|
541
|
+
CloseSaveButtonsComponent,
|
|
542
|
+
WordFormSetEditor,
|
|
543
|
+
], template: "<form [formGroup]=\"form\" (submit)=\"save()\">\r\n <mat-card>\r\n <mat-card-header>\r\n <div mat-card-avatar>\r\n <mat-icon>picture_in_picture</mat-icon>\r\n </div>\r\n <mat-card-title>\r\n {{ (modelName() | titlecase) || 'Lemma Part' }}\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div class=\"form-row\">\r\n <!-- lid -->\r\n <mat-form-field>\r\n <mat-label>LID</mat-label>\r\n <input matInput [formControl]=\"lid\" />\r\n @if ($any(lid).errors?.required && (lid.dirty || lid.touched)) {\r\n <mat-error>LID required</mat-error>\r\n } @if ($any(lid).errors?.maxLength && (lid.dirty || lid.touched)) {\r\n <mat-error>LID too long</mat-error>\r\n }\r\n </mat-form-field>\r\n <!-- button -->\r\n <button type=\"button\" mat-icon-button matTooltip=\"Generate LID\">\r\n <mat-icon class=\"mat-primary\">arrow_circle_left</mat-icon>\r\n </button>\r\n <!-- homograph -->\r\n <mat-form-field class=\"nr\">\r\n <mat-label>hom.</mat-label>\r\n <input matInput [formControl]=\"homograph\" type=\"number\" min=\"0\" max=\"50\" />\r\n </mat-form-field>\r\n </div>\r\n <!-- forms -->\r\n <div>\r\n <fieldset>\r\n <legend>\r\n forms @if (!this.forms.value.length) {\r\n <span id=\"forms-error\" matTooltip=\"Form(s) required\"\r\n ><mat-icon class=\"mat-warn\">error</mat-icon></span\r\n >\r\n }\r\n </legend>\r\n <cadmus-word-form-set-editor\r\n [typeEntries]=\"typeEntries()\"\r\n [prefixEntries]=\"prefixEntries()\"\r\n [suffixEntries]=\"suffixEntries()\"\r\n [posEntries]=\"posEntries()\"\r\n [featureEntries]=\"featureEntries()\"\r\n [tagEntries]=\"tagEntries()\"\r\n [forms]=\"forms.value\"\r\n (formsChange)=\"onFormsChange($event)\"\r\n />\r\n </fieldset>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <cadmus-close-save-buttons [form]=\"form\" [noSave]=\"userLevel < 2\" (closeRequest)=\"close()\" />\r\n </mat-card-actions>\r\n </mat-card>\r\n</form>\r\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.nr{width:5em}#forms-error{color:#8b0000;margin-left:8px}\n"] }]
|
|
544
|
+
}], ctorParameters: () => [{ type: i1$1.AuthJwtService }, { type: i2.FormBuilder }] });
|
|
545
|
+
|
|
546
|
+
class LexLemmaPartFeature extends EditPartFeatureBase {
|
|
547
|
+
constructor(router, route, snackbar, itemService, thesaurusService, editorService) {
|
|
548
|
+
super(router, route, snackbar, itemService, thesaurusService, editorService);
|
|
549
|
+
}
|
|
550
|
+
getReqThesauriIds() {
|
|
551
|
+
return [
|
|
552
|
+
'lex-word-form-types',
|
|
553
|
+
'lex-word-form-prefixes',
|
|
554
|
+
'lex-word-form-suffixes',
|
|
555
|
+
'lex-pos-tags',
|
|
556
|
+
'lex-word-form-features',
|
|
557
|
+
'lex-word-form-tags',
|
|
558
|
+
];
|
|
559
|
+
}
|
|
560
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LexLemmaPartFeature, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i2$2.MatSnackBar }, { token: i3$1.ItemService }, { token: i3$1.ThesaurusService }, { token: i4$1.PartEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
561
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.9", type: LexLemmaPartFeature, isStandalone: true, selector: "cadmus-lex-lemma-part-feature", usesInheritance: true, ngImport: i0, template: "<cadmus-current-item-bar />\r\n<cadmus-lex-lemma-part-editor\r\n [identity]=\"identity\"\r\n [data]=\"$any(data)\"\r\n (dataChange)=\"save($event!.value!)\"\r\n (editorClose)=\"close()\"\r\n (dirtyChange)=\"onDirtyChange($event)\"\r\n/>\r\n", styles: [""], dependencies: [{ kind: "component", type: CurrentItemBarComponent, selector: "cadmus-current-item-bar" }, { kind: "component", type: LexLemmaPartEditor, selector: "cadmus-lex-lemma-part-editor" }] });
|
|
562
|
+
}
|
|
563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LexLemmaPartFeature, decorators: [{
|
|
564
|
+
type: Component,
|
|
565
|
+
args: [{ selector: 'cadmus-lex-lemma-part-feature', imports: [CurrentItemBarComponent, LexLemmaPartEditor], template: "<cadmus-current-item-bar />\r\n<cadmus-lex-lemma-part-editor\r\n [identity]=\"identity\"\r\n [data]=\"$any(data)\"\r\n (dataChange)=\"save($event!.value!)\"\r\n (editorClose)=\"close()\"\r\n (dirtyChange)=\"onDirtyChange($event)\"\r\n/>\r\n" }]
|
|
566
|
+
}], ctorParameters: () => [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i2$2.MatSnackBar }, { type: i3$1.ItemService }, { type: i3$1.ThesaurusService }, { type: i4$1.PartEditorService }] });
|
|
567
|
+
|
|
568
|
+
/*
|
|
569
|
+
* Public API Surface of cadmus-part-lexicography-lemma
|
|
570
|
+
*/
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Generated bundle index. Do not edit.
|
|
574
|
+
*/
|
|
575
|
+
|
|
576
|
+
export { LEX_LEMMA_PART_SCHEMA, LEX_LEMMA_PART_TYPEID, LexLemmaPartFeature, WordFormEditor, WordFormSetEditor };
|
|
577
|
+
//# sourceMappingURL=myrmidon-cadmus-part-lexicography-lemma.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"myrmidon-cadmus-part-lexicography-lemma.mjs","sources":["../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/lib/lex-lemma-part.ts","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/lib/components/word-form-editor/word-form-editor.ts","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/lib/components/word-form-editor/word-form-editor.html","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/lib/components/word-form-set-editor/word-form-set-editor.ts","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/lib/components/word-form-set-editor/word-form-set-editor.html","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/lib/components/lex-lemma-part-editor/lex-lemma-part-editor.ts","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/lib/components/lex-lemma-part-editor/lex-lemma-part-editor.html","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/lib/components/lex-lemma-part-feature/lex-lemma-part-feature.ts","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/lib/components/lex-lemma-part-feature/lex-lemma-part-feature.html","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/public-api.ts","../../../../projects/myrmidon/cadmus-part-lexicography-lemma/src/myrmidon-cadmus-part-lexicography-lemma.ts"],"sourcesContent":["import { Part } from '@myrmidon/cadmus-core';\r\n\r\n/**\r\n * A word form.\r\n */\r\nexport interface WordForm {\r\n type: string;\r\n prefix?: string;\r\n value: string;\r\n suffix?: string;\r\n pos: string;\r\n features?: string[];\r\n tags?: string[];\r\n note?: string;\r\n}\r\n\r\n/**\r\n * The lemma part model.\r\n */\r\nexport interface LexLemmaPart extends Part {\r\n lid: string;\r\n homograph?: number;\r\n forms: WordForm[];\r\n}\r\n\r\n/**\r\n * The type ID used to identify the lemma part type.\r\n */\r\nexport const LEX_LEMMA_PART_TYPEID = 'it.vedph.lexicography.lemma';\r\n\r\n/**\r\n * JSON schema for the lemma part.\r\n * You can use the JSON schema tool at https://jsonschema.net/.\r\n */\r\nexport const LEX_LEMMA_PART_SCHEMA = {\r\n $schema: 'http://json-schema.org/draft-07/schema#',\r\n $id: 'www.vedph.it/cadmus/parts/myrmidon/lexicography/' + LEX_LEMMA_PART_TYPEID + '.json',\r\n type: 'object',\r\n title: 'LexLemmaPart',\r\n required: [\r\n 'id',\r\n 'itemId',\r\n 'typeId',\r\n 'timeCreated',\r\n 'creatorId',\r\n 'timeModified',\r\n 'userId',\r\n 'lid',\r\n 'forms',\r\n ],\r\n properties: {\r\n timeCreated: {\r\n type: 'string',\r\n pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}.\\\\d+Z$',\r\n },\r\n creatorId: {\r\n type: 'string',\r\n },\r\n timeModified: {\r\n type: 'string',\r\n pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}.\\\\d+Z$',\r\n },\r\n userId: {\r\n type: 'string',\r\n },\r\n id: {\r\n type: 'string',\r\n pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$',\r\n },\r\n itemId: {\r\n type: 'string',\r\n pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$',\r\n },\r\n typeId: {\r\n type: 'string',\r\n pattern: '^[a-z][-0-9a-z._]*$',\r\n },\r\n roleId: {\r\n type: ['string', 'null'],\r\n pattern: '^([a-z][-0-9a-z._]*)?$',\r\n },\r\n lid: {\r\n type: 'string',\r\n },\r\n homograph: {\r\n type: ['integer', 'null'],\r\n },\r\n forms: {\r\n type: 'array',\r\n minItems: 1,\r\n items: {\r\n type: 'object',\r\n required: ['type', 'value', 'pos'],\r\n properties: {\r\n type: {\r\n type: 'string',\r\n },\r\n prefix: {\r\n type: 'string',\r\n },\r\n value: {\r\n type: 'string',\r\n },\r\n suffix: {\r\n type: 'string',\r\n },\r\n pos: {\r\n type: 'string',\r\n },\r\n features: {\r\n type: 'array',\r\n items: {\r\n type: 'string',\r\n },\r\n },\r\n tags: {\r\n type: 'array',\r\n items: {\r\n type: 'string',\r\n },\r\n },\r\n note: {\r\n type: 'string',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n },\r\n },\r\n additionalProperties: false,\r\n};\r\n","import { CommonModule } from '@angular/common';\r\nimport { Component, effect, input, model, output, signal } from '@angular/core';\r\nimport {\r\n FormBuilder,\r\n FormControl,\r\n FormGroup,\r\n ReactiveFormsModule,\r\n Validators,\r\n} from '@angular/forms';\r\n\r\n// material\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\nimport { NgxToolsValidators } from '@myrmidon/ngx-tools';\r\nimport { ThesaurusEntry } from '@myrmidon/cadmus-core';\r\nimport { ThesEntriesPickerComponent } from '@myrmidon/cadmus-ui';\r\n\r\nimport { WordForm } from '../../lex-lemma-part';\r\n\r\n@Component({\r\n selector: 'cadmus-word-form-editor',\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n MatButtonModule,\r\n MatCheckboxModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatSelectModule,\r\n MatTooltipModule,\r\n ThesEntriesPickerComponent,\r\n ],\r\n templateUrl: './word-form-editor.html',\r\n styleUrl: './word-form-editor.css',\r\n})\r\nexport class WordFormEditor {\r\n public readonly form = model<WordForm | undefined>();\r\n public readonly cancelEdit = output();\r\n\r\n // lex-word-form-types\r\n public readonly typeEntries = input<ThesaurusEntry[] | undefined>();\r\n // lex-word-form-prefixes\r\n public readonly prefixEntries = input<ThesaurusEntry[] | undefined>();\r\n // lex-word-form-suffixes\r\n public readonly suffixEntries = input<ThesaurusEntry[] | undefined>();\r\n // lex-pos-tags\r\n public readonly posEntries = input.required<ThesaurusEntry[]>();\r\n // lex-word-form-features\r\n public readonly featureEntries = input<ThesaurusEntry[] | undefined>();\r\n // lex-word-form-tags\r\n public readonly tagEntries = input<ThesaurusEntry[] | undefined>();\r\n\r\n public type: FormControl<string>;\r\n public prefix: FormControl<string | null>;\r\n public value: FormControl<string>;\r\n public suffix: FormControl<string | null>;\r\n public pos: FormControl<ThesaurusEntry>;\r\n public features: FormControl<ThesaurusEntry[]>;\r\n public tags: FormControl<ThesaurusEntry[]>;\r\n public note: FormControl<string | null>;\r\n public formCtl: FormGroup;\r\n\r\n constructor(formBuilder: FormBuilder) {\r\n // form\r\n this.type = formBuilder.control('', {\r\n nonNullable: true,\r\n validators: [Validators.required, Validators.maxLength(50)],\r\n });\r\n this.prefix = formBuilder.control(null, { validators: [Validators.maxLength(50)] });\r\n this.value = formBuilder.control('', {\r\n nonNullable: true,\r\n validators: [Validators.required, Validators.maxLength(500)],\r\n });\r\n this.suffix = formBuilder.control(null, { validators: [Validators.maxLength(50)] });\r\n this.pos = formBuilder.control(\r\n { id: '', value: '' },\r\n {\r\n nonNullable: true,\r\n validators: Validators.required,\r\n }\r\n );\r\n this.features = formBuilder.control([], { nonNullable: true });\r\n this.tags = formBuilder.control([], { nonNullable: true });\r\n this.note = formBuilder.control(null);\r\n this.formCtl = formBuilder.group({\r\n type: this.type,\r\n prefix: this.prefix,\r\n value: this.value,\r\n suffix: this.suffix,\r\n pos: this.pos,\r\n features: this.features,\r\n tags: this.tags,\r\n note: this.note,\r\n });\r\n\r\n // when model changes, update form\r\n effect(() => {\r\n const data = this.form();\r\n this.updateForm(data);\r\n });\r\n }\r\n\r\n public mapIdToEntry(\r\n id: string | null,\r\n entries: ThesaurusEntry[] | undefined\r\n ): ThesaurusEntry | null {\r\n if (!id) return null;\r\n if (!entries) return { id, value: id };\r\n return entries.find((e) => e.id === id) || { id, value: id };\r\n }\r\n\r\n private mapIdsToEntries(ids: string[], entries: ThesaurusEntry[] | undefined): ThesaurusEntry[] {\r\n if (!entries) return ids.map((id) => ({ id, value: id }));\r\n return ids.map((id) => entries.find((e) => e.id === id) || { id, value: id });\r\n }\r\n\r\n private updateForm(data: WordForm | undefined | null): void {\r\n if (!data) {\r\n this.formCtl.reset();\r\n } else {\r\n this.type.setValue(data.type || '');\r\n this.prefix.setValue(data.prefix || null);\r\n this.value.setValue(data.value || '');\r\n this.suffix.setValue(data.suffix || null);\r\n this.pos.setValue(this.mapIdToEntry(data.pos, this.posEntries()) || this.posEntries()?.[0]!);\r\n this.features.setValue(this.mapIdsToEntries(data.features || [], this.featureEntries()));\r\n this.tags.setValue(this.mapIdsToEntries(data.tags || [], this.tagEntries()));\r\n this.note.setValue(data.note || null);\r\n this.formCtl.markAsPristine();\r\n }\r\n }\r\n\r\n public onPosEntriesChange(entries: ThesaurusEntry[]): void {\r\n this.pos.setValue(entries[0]);\r\n this.pos.markAsDirty();\r\n this.pos.updateValueAndValidity();\r\n }\r\n\r\n public onFeatureEntriesChange(entries: ThesaurusEntry[]): void {\r\n this.features.setValue(entries);\r\n this.features.markAsDirty();\r\n this.features.updateValueAndValidity();\r\n }\r\n\r\n public onTagEntriesChange(entries: ThesaurusEntry[]): void {\r\n this.tags.setValue(entries);\r\n this.tags.markAsDirty();\r\n this.tags.updateValueAndValidity();\r\n }\r\n\r\n private getData(): WordForm {\r\n return {\r\n type: this.type.value,\r\n prefix: this.prefix.value || undefined,\r\n value: this.value.value,\r\n suffix: this.suffix.value || undefined,\r\n pos: this.pos.value.id,\r\n features: this.features.value.map((e) => e.id),\r\n tags: this.tags.value.map((e) => e.id),\r\n note: this.note.value?.trim() || undefined,\r\n };\r\n }\r\n\r\n public cancel(): void {\r\n this.cancelEdit.emit();\r\n }\r\n\r\n /**\r\n * Saves the current form data by updating the `data` model signal.\r\n * This method can be called manually (e.g., by a Save button) or\r\n * automatically (via auto-save).\r\n * @param pristine If true (default), the form is marked as pristine\r\n * after saving.\r\n * Set to false for auto-save if you want the form to remain dirty.\r\n */\r\n public save(pristine = true): void {\r\n if (this.formCtl.invalid) {\r\n // show validation errors\r\n this.formCtl.markAllAsTouched();\r\n return;\r\n }\r\n\r\n const data = this.getData();\r\n this.form.set(data);\r\n\r\n if (pristine) {\r\n this.formCtl.markAsPristine();\r\n }\r\n }\r\n}\r\n","<form [formGroup]=\"formCtl\" (submit)=\"save()\">\r\n <div class=\"form-row\">\r\n <!-- type (bound) -->\r\n @if (typeEntries()?.length) {\r\n <mat-form-field>\r\n <mat-label>type</mat-label>\r\n <mat-select [formControl]=\"type\">\r\n @for (e of typeEntries(); track e.id) {\r\n <mat-option [value]=\"e.id\">{{ e.value }}</mat-option>\r\n }\r\n </mat-select>\r\n @if ($any(type).errors?.required && (type.dirty || type.touched)) {\r\n <mat-error>type required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- type (free) -->\r\n <mat-form-field>\r\n <mat-label>type</mat-label>\r\n <input matInput [formControl]=\"type\" />\r\n @if ($any(type).errors?.required && (type.dirty || type.touched)) {\r\n <mat-error>type required</mat-error>\r\n } @if ($any(type).errors?.maxLength && (type.dirty || type.touched)) {\r\n <mat-error>type too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n\r\n <!-- pos (always bound) -->\r\n <cadmus-thes-entries-picker\r\n [availableEntries]=\"posEntries()!\"\r\n [entries]=\"[this.pos.value]\"\r\n [hierarchicLabels]=\"true\"\r\n [minEntries]=\"1\"\r\n [maxEntries]=\"1\"\r\n (entriesChange)=\"onPosEntriesChange($event!)\"\r\n />\r\n </div>\r\n <div class=\"form-row\">\r\n <!-- prefix (bound) -->\r\n @if (prefixEntries()?.length) {\r\n <mat-form-field>\r\n <mat-label>prefix</mat-label>\r\n <mat-select [formControl]=\"prefix\">\r\n @for (e of prefixEntries(); track e.id) {\r\n <mat-option [value]=\"e.id\">{{ e.value }}</mat-option>\r\n }\r\n </mat-select>\r\n @if ($any(prefix).errors?.required && (prefix.dirty || prefix.touched)) {\r\n <mat-error>prefix required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- prefix (free) -->\r\n <mat-form-field>\r\n <mat-label>prefix</mat-label>\r\n <input matInput [formControl]=\"prefix\" />\r\n @if ($any(prefix).errors?.required && (prefix.dirty || prefix.touched)) {\r\n <mat-error>prefix required</mat-error>\r\n } @if ($any(prefix).errors?.maxLength && (prefix.dirty || prefix.touched)) {\r\n <mat-error>prefix too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n\r\n <!-- value -->\r\n <mat-form-field>\r\n <mat-label>value</mat-label>\r\n <input matInput [formControl]=\"value\" />\r\n @if ($any(value).errors?.required && (value.dirty || value.touched)) {\r\n <mat-error>value required</mat-error>\r\n } @if ($any(value).errors?.maxLength && (value.dirty || value.touched)) {\r\n <mat-error>value too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <!-- suffix (bound) -->\r\n @if (suffixEntries()?.length) {\r\n <mat-form-field>\r\n <mat-label>suffix</mat-label>\r\n <mat-select [formControl]=\"suffix\">\r\n @for (e of suffixEntries(); track e.id) {\r\n <mat-option [value]=\"e.id\">{{ e.value }}</mat-option>\r\n }\r\n </mat-select>\r\n @if ($any(suffix).errors?.required && (suffix.dirty || suffix.touched)) {\r\n <mat-error>suffix required</mat-error>\r\n }\r\n </mat-form-field>\r\n } @else {\r\n <!-- suffix (free) -->\r\n <mat-form-field>\r\n <mat-label>suffix</mat-label>\r\n <input matInput [formControl]=\"suffix\" />\r\n @if ($any(suffix).errors?.required && (suffix.dirty || suffix.touched)) {\r\n <mat-error>suffix required</mat-error>\r\n } @if ($any(suffix).errors?.maxLength && (suffix.dirty || suffix.touched)) {\r\n <mat-error>suffix too long</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n <!-- features -->\r\n @if (featureEntries()?.length) {\r\n <div>\r\n <fieldset>\r\n <legend>features</legend>\r\n <cadmus-thes-entries-picker\r\n [availableEntries]=\"featureEntries()!\"\r\n [entries]=\"features.value\"\r\n [hierarchicLabels]=\"true\"\r\n (entriesChange)=\"onFeatureEntriesChange($event!)\"\r\n />\r\n </fieldset>\r\n </div>\r\n }\r\n <!-- tags -->\r\n @if (tagEntries()?.length) {\r\n <div>\r\n <fieldset>\r\n <legend>tags</legend>\r\n <cadmus-thes-entries-picker\r\n [availableEntries]=\"tagEntries()!\"\r\n [entries]=\"tags.value\"\r\n (entriesChange)=\"onTagEntriesChange($event!)\"\r\n />\r\n </fieldset>\r\n </div>\r\n }\r\n <!-- note -->\r\n <div>\r\n <mat-form-field class=\"long-text\">\r\n <mat-label>note</mat-label>\r\n <textarea matInput [formControl]=\"note\" rows=\"3\"></textarea>\r\n @if ($any(note).errors?.maxLength && (note.dirty || note.touched)) {\r\n <mat-error>note too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n <!-- buttons -->\r\n <div>\r\n <button type=\"button\" mat-icon-button matTooltip=\"Discard changes\" (click)=\"cancel()\">\r\n <mat-icon class=\"mat-warn\">clear</mat-icon>\r\n </button>\r\n <button\r\n type=\"submit\"\r\n mat-icon-button\r\n matTooltip=\"Accept changes\"\r\n [disabled]=\"formCtl.invalid || formCtl.pristine\"\r\n >\r\n <mat-icon class=\"mat-primary\">check_circle</mat-icon>\r\n </button>\r\n </div>\r\n</form>\r\n","import { Component, input, model, signal } from '@angular/core';\r\n\r\nimport {\r\n MatExpansionPanel,\r\n MatExpansionPanelHeader,\r\n MatExpansionPanelTitle,\r\n} from '@angular/material/expansion';\r\nimport { MatButton, MatIconButton } from '@angular/material/button';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\n\r\nimport { ThesaurusEntry } from '@myrmidon/cadmus-core';\r\nimport { DialogService } from '@myrmidon/ngx-mat-tools';\r\nimport { FlatLookupPipe } from '@myrmidon/ngx-tools';\r\n\r\nimport { WordForm } from '../../lex-lemma-part';\r\nimport { WordFormEditor } from '../word-form-editor/word-form-editor';\r\n\r\n/**\r\n * Editor for a set of word forms.\r\n */\r\n@Component({\r\n selector: 'cadmus-word-form-set-editor',\r\n imports: [\r\n MatExpansionPanel,\r\n MatExpansionPanelHeader,\r\n MatExpansionPanelTitle,\r\n MatButton,\r\n MatIconButton,\r\n MatIcon,\r\n MatTooltip,\r\n FlatLookupPipe,\r\n WordFormEditor,\r\n ],\r\n templateUrl: './word-form-set-editor.html',\r\n styleUrl: './word-form-set-editor.css',\r\n})\r\nexport class WordFormSetEditor {\r\n /**\r\n * The forms to edit.\r\n */\r\n public readonly forms = model<WordForm[]>([]);\r\n /**\r\n * The form being edited.\r\n */\r\n public readonly edited = signal<WordForm | undefined>(undefined);\r\n /**\r\n * The index of the form being edited, -1 if a new one.\r\n */\r\n public readonly editedIndex = signal<number>(-1);\r\n\r\n // lex-word-form-types\r\n public readonly typeEntries = input<ThesaurusEntry[] | undefined>();\r\n // lex-word-form-prefixes\r\n public readonly prefixEntries = input<ThesaurusEntry[] | undefined>();\r\n // lex-word-form-suffixes\r\n public readonly suffixEntries = input<ThesaurusEntry[] | undefined>();\r\n // lex-pos-tags (required)\r\n public readonly posEntries = input.required<ThesaurusEntry[]>();\r\n // lex-word-form-features\r\n public readonly featureEntries = input<ThesaurusEntry[] | undefined>();\r\n // lex-word-form-tags\r\n public readonly tagEntries = input<ThesaurusEntry[] | undefined>();\r\n\r\n constructor(private _dialogService: DialogService) {}\r\n\r\n public addForm(): void {\r\n const entry: WordForm = {\r\n type: this.typeEntries()?.[0]?.id ?? '',\r\n pos: this.posEntries()?.[0]?.id ?? '',\r\n value: '',\r\n };\r\n this.editedIndex.set(-1);\r\n this.edited.set(entry);\r\n }\r\n\r\n public editForm(entry: WordForm, index: number): void {\r\n this.editedIndex.set(index);\r\n this.edited.set(structuredClone(entry));\r\n }\r\n\r\n public closeForm(): void {\r\n this.editedIndex.set(-1);\r\n this.edited.set(undefined);\r\n }\r\n\r\n public saveForm(entry: WordForm): void {\r\n const forms = [...this.forms()];\r\n if (this.editedIndex() === -1) {\r\n forms.push(entry);\r\n } else {\r\n forms.splice(this.editedIndex(), 1, entry);\r\n }\r\n this.forms.set(forms);\r\n this.closeForm();\r\n }\r\n\r\n public deleteForm(index: number): void {\r\n this._dialogService\r\n .confirm('Confirmation', `Delete form #${index + 1}?`)\r\n .subscribe((yes: boolean | undefined) => {\r\n if (yes) {\r\n if (this.editedIndex() === index) {\r\n this.closeForm();\r\n }\r\n const forms = [...this.forms()];\r\n forms.splice(index, 1);\r\n this.forms.set(forms);\r\n }\r\n });\r\n }\r\n\r\n public moveFormUp(index: number): void {\r\n if (index < 1) {\r\n return;\r\n }\r\n const form = this.forms()[index];\r\n const forms = [...this.forms()];\r\n forms.splice(index, 1);\r\n forms.splice(index - 1, 0, form);\r\n this.forms.set(forms);\r\n }\r\n\r\n public moveFormDown(index: number): void {\r\n if (index + 1 >= this.forms().length) {\r\n return;\r\n }\r\n const form = this.forms()[index];\r\n const forms = [...this.forms()];\r\n forms.splice(index, 1);\r\n forms.splice(index + 1, 0, form);\r\n this.forms.set(forms);\r\n }\r\n}\r\n","<div>\r\n <button type=\"button\" mat-flat-button class=\"mat-primary\" (click)=\"addForm()\">\r\n <mat-icon>add_circle</mat-icon> form\r\n </button>\r\n</div>\r\n@if (forms().length) {\r\n<table>\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>type</th>\r\n <th>prefix</th>\r\n <th>value</th>\r\n <th>suffix</th>\r\n <th>POS</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (entry of forms(); track entry; let i = $index; let first = $first; let last = $last)\r\n {\r\n <tr [class.selected]=\"i === editedIndex()\">\r\n <td class=\"fit-width\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Edit this form\"\r\n (click)=\"editForm(entry, i)\"\r\n >\r\n <mat-icon class=\"mat-primary\">edit</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this form up\"\r\n [disabled]=\"first\"\r\n (click)=\"moveFormUp(i)\"\r\n >\r\n <mat-icon>arrow_upward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Move this form down\"\r\n [disabled]=\"last\"\r\n (click)=\"moveFormDown(i)\"\r\n >\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Delete this form\"\r\n (click)=\"deleteForm(i)\"\r\n >\r\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ entry.type | flatLookup : typeEntries() : 'id' : 'value' }}</td>\r\n <td>{{ entry.prefix | flatLookup : prefixEntries() : 'id' : 'value' }}</td>\r\n <td>{{ entry.value }}</td>\r\n <td>{{ entry.suffix | flatLookup : suffixEntries() : 'id' : 'value' }}</td>\r\n <td>{{ entry.pos | flatLookup : posEntries() : 'id' : 'value' }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n</table>\r\n} @if (edited()) {\r\n<fieldset>\r\n <mat-expansion-panel [expanded]=\"edited()\" [disabled]=\"!edited()\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>form #</mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <cadmus-word-form-editor\r\n [typeEntries]=\"typeEntries()\"\r\n [prefixEntries]=\"prefixEntries()\"\r\n [suffixEntries]=\"suffixEntries()\"\r\n [posEntries]=\"posEntries()\"\r\n [featureEntries]=\"featureEntries()\"\r\n [tagEntries]=\"tagEntries()\"\r\n [form]=\"edited()!\"\r\n (formChange)=\"saveForm($event!)\"\r\n (editorClose)=\"closeForm()\"\r\n />\r\n </mat-expansion-panel>\r\n</fieldset>\r\n}\r\n","import { Component, OnInit, signal } from '@angular/core';\r\nimport {\r\n FormBuilder,\r\n FormControl,\r\n FormGroup,\r\n ReactiveFormsModule,\r\n UntypedFormGroup,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { TitleCasePipe } from '@angular/common';\r\n\r\nimport {\r\n MatCard,\r\n MatCardActions,\r\n MatCardContent,\r\n MatCardHeader,\r\n MatCardTitle,\r\n} from '@angular/material/card';\r\nimport { MatError, MatFormField, MatLabel } from '@angular/material/form-field';\r\nimport { MatIconButton } from '@angular/material/button';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\nimport { MatIcon } from '@angular/material/icon';\r\n\r\nimport { EditedObject, ThesauriSet, ThesaurusEntry } from '@myrmidon/cadmus-core';\r\nimport { CloseSaveButtonsComponent, ModelEditorComponentBase } from '@myrmidon/cadmus-ui';\r\nimport { AuthJwtService } from '@myrmidon/auth-jwt-login';\r\n\r\nimport { LEX_LEMMA_PART_TYPEID, LexLemmaPart, WordForm } from '../../lex-lemma-part';\r\nimport { WordFormSetEditor } from '../word-form-set-editor/word-form-set-editor';\r\n\r\n/**\r\n * Lexicography lemma part editor component.\r\n * Thesauri: lex-word-form-types, lex-word-form-prefixes, lex-word-form-suffixes,\r\n * lex-pos-tags, lex-word-form-features, lex-word-form-tags.\r\n */\r\n@Component({\r\n selector: 'cadmus-lex-lemma-part-editor',\r\n imports: [\r\n ReactiveFormsModule,\r\n MatCard,\r\n MatCardActions,\r\n MatCardContent,\r\n MatCardHeader,\r\n MatCardTitle,\r\n MatError,\r\n MatFormField,\r\n MatIcon,\r\n MatIconButton,\r\n MatInput,\r\n MatLabel,\r\n MatTooltip,\r\n TitleCasePipe,\r\n CloseSaveButtonsComponent,\r\n WordFormSetEditor,\r\n ],\r\n templateUrl: './lex-lemma-part-editor.html',\r\n styleUrl: './lex-lemma-part-editor.css',\r\n})\r\nexport class LexLemmaPartEditor extends ModelEditorComponentBase<LexLemmaPart> implements OnInit {\r\n public lid: FormControl<string | null>;\r\n public homograph: FormControl<number>;\r\n public forms: FormControl<WordForm[]>;\r\n\r\n // lex-word-form-types\r\n public readonly typeEntries = signal<ThesaurusEntry[] | undefined>(undefined);\r\n // lex-word-form-prefixes\r\n public readonly prefixEntries = signal<ThesaurusEntry[] | undefined>(undefined);\r\n // lex-word-form-suffixes\r\n public readonly suffixEntries = signal<ThesaurusEntry[] | undefined>(undefined);\r\n // lex-pos-tags (required)\r\n public readonly posEntries = signal<ThesaurusEntry[]>([]);\r\n // lex-word-form-features\r\n public readonly featureEntries = signal<ThesaurusEntry[] | undefined>(undefined);\r\n // lex-word-form-tags\r\n public readonly tagEntries = signal<ThesaurusEntry[] | undefined>(undefined);\r\n\r\n constructor(authService: AuthJwtService, formBuilder: FormBuilder) {\r\n super(authService, formBuilder);\r\n // form\r\n this.lid = formBuilder.control(null, {\r\n nonNullable: true,\r\n validators: [Validators.required, Validators.maxLength(300)],\r\n });\r\n this.homograph = formBuilder.control(0, { nonNullable: true });\r\n this.forms = formBuilder.control([], { nonNullable: true });\r\n }\r\n\r\n public override ngOnInit(): void {\r\n super.ngOnInit();\r\n }\r\n\r\n protected buildForm(formBuilder: FormBuilder): FormGroup | UntypedFormGroup {\r\n return formBuilder.group({\r\n lid: this.lid,\r\n homograph: this.homograph,\r\n forms: this.forms,\r\n });\r\n }\r\n\r\n private updateThesauri(thesauri: ThesauriSet): void {\r\n let key = 'lex-word-form-types';\r\n if (this.hasThesaurus(key)) {\r\n this.typeEntries.set(thesauri[key].entries);\r\n } else {\r\n this.typeEntries.set(undefined);\r\n }\r\n key = 'lex-word-form-prefixes';\r\n if (this.hasThesaurus(key)) {\r\n this.prefixEntries.set(thesauri[key].entries);\r\n } else {\r\n this.prefixEntries.set(undefined);\r\n }\r\n key = 'lex-word-form-suffixes';\r\n if (this.hasThesaurus(key)) {\r\n this.suffixEntries.set(thesauri[key].entries);\r\n } else {\r\n this.suffixEntries.set(undefined);\r\n }\r\n key = 'lex-pos-tags';\r\n if (this.hasThesaurus(key)) {\r\n this.posEntries.set(thesauri[key].entries!);\r\n } else {\r\n this.posEntries.set([]);\r\n }\r\n key = 'lex-word-form-features';\r\n if (this.hasThesaurus(key)) {\r\n this.featureEntries.set(thesauri[key].entries);\r\n } else {\r\n this.featureEntries.set(undefined);\r\n }\r\n key = 'lex-word-form-tags';\r\n if (this.hasThesaurus(key)) {\r\n this.tagEntries.set(thesauri[key].entries);\r\n } else {\r\n this.tagEntries.set(undefined);\r\n }\r\n }\r\n\r\n private updateForm(part?: LexLemmaPart | null): void {\r\n if (!part) {\r\n this.form.reset();\r\n return;\r\n }\r\n this.lid.setValue(part.lid || null);\r\n this.homograph.setValue(part.homograph || 0);\r\n this.forms.setValue(part.forms || []);\r\n this.form.markAsPristine();\r\n }\r\n\r\n public onFormsChange(forms: WordForm[]): void {\r\n this.forms.setValue(forms || []);\r\n this.form.markAsDirty();\r\n this.forms.updateValueAndValidity();\r\n }\r\n\r\n protected override onDataSet(data?: EditedObject<LexLemmaPart>): void {\r\n // thesauri\r\n if (data?.thesauri) {\r\n this.updateThesauri(data.thesauri);\r\n }\r\n\r\n // form\r\n this.updateForm(data?.value);\r\n }\r\n\r\n protected getValue(): LexLemmaPart {\r\n let part = this.getEditedPart(LEX_LEMMA_PART_TYPEID) as LexLemmaPart;\r\n part.lid = this.lid.value || '';\r\n part.homograph = this.homograph.value || undefined;\r\n part.forms = this.forms.value || [];\r\n return part;\r\n }\r\n\r\n // TODO: generate LID\r\n}\r\n","<form [formGroup]=\"form\" (submit)=\"save()\">\r\n <mat-card>\r\n <mat-card-header>\r\n <div mat-card-avatar>\r\n <mat-icon>picture_in_picture</mat-icon>\r\n </div>\r\n <mat-card-title>\r\n {{ (modelName() | titlecase) || 'Lemma Part' }}\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div class=\"form-row\">\r\n <!-- lid -->\r\n <mat-form-field>\r\n <mat-label>LID</mat-label>\r\n <input matInput [formControl]=\"lid\" />\r\n @if ($any(lid).errors?.required && (lid.dirty || lid.touched)) {\r\n <mat-error>LID required</mat-error>\r\n } @if ($any(lid).errors?.maxLength && (lid.dirty || lid.touched)) {\r\n <mat-error>LID too long</mat-error>\r\n }\r\n </mat-form-field>\r\n <!-- button -->\r\n <button type=\"button\" mat-icon-button matTooltip=\"Generate LID\">\r\n <mat-icon class=\"mat-primary\">arrow_circle_left</mat-icon>\r\n </button>\r\n <!-- homograph -->\r\n <mat-form-field class=\"nr\">\r\n <mat-label>hom.</mat-label>\r\n <input matInput [formControl]=\"homograph\" type=\"number\" min=\"0\" max=\"50\" />\r\n </mat-form-field>\r\n </div>\r\n <!-- forms -->\r\n <div>\r\n <fieldset>\r\n <legend>\r\n forms @if (!this.forms.value.length) {\r\n <span id=\"forms-error\" matTooltip=\"Form(s) required\"\r\n ><mat-icon class=\"mat-warn\">error</mat-icon></span\r\n >\r\n }\r\n </legend>\r\n <cadmus-word-form-set-editor\r\n [typeEntries]=\"typeEntries()\"\r\n [prefixEntries]=\"prefixEntries()\"\r\n [suffixEntries]=\"suffixEntries()\"\r\n [posEntries]=\"posEntries()\"\r\n [featureEntries]=\"featureEntries()\"\r\n [tagEntries]=\"tagEntries()\"\r\n [forms]=\"forms.value\"\r\n (formsChange)=\"onFormsChange($event)\"\r\n />\r\n </fieldset>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <cadmus-close-save-buttons [form]=\"form\" [noSave]=\"userLevel < 2\" (closeRequest)=\"close()\" />\r\n </mat-card-actions>\r\n </mat-card>\r\n</form>\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { MatSnackBar } from '@angular/material/snack-bar';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';\r\nimport { EditPartFeatureBase, PartEditorService } from '@myrmidon/cadmus-state';\r\nimport { CurrentItemBarComponent } from '@myrmidon/cadmus-ui-pg';\r\n\r\nimport { LexLemmaPartEditor } from '../lex-lemma-part-editor/lex-lemma-part-editor';\r\n\r\n@Component({\r\n selector: 'cadmus-lex-lemma-part-feature',\r\n imports: [CurrentItemBarComponent, LexLemmaPartEditor],\r\n templateUrl: './lex-lemma-part-feature.html',\r\n styleUrl: './lex-lemma-part-feature.css',\r\n})\r\nexport class LexLemmaPartFeature extends EditPartFeatureBase implements OnInit {\r\n constructor(\r\n router: Router,\r\n route: ActivatedRoute,\r\n snackbar: MatSnackBar,\r\n itemService: ItemService,\r\n thesaurusService: ThesaurusService,\r\n editorService: PartEditorService\r\n ) {\r\n super(router, route, snackbar, itemService, thesaurusService, editorService);\r\n }\r\n\r\n protected override getReqThesauriIds(): string[] {\r\n return [\r\n 'lex-word-form-types',\r\n 'lex-word-form-prefixes',\r\n 'lex-word-form-suffixes',\r\n 'lex-pos-tags',\r\n 'lex-word-form-features',\r\n 'lex-word-form-tags',\r\n ];\r\n }\r\n}\r\n","<cadmus-current-item-bar />\r\n<cadmus-lex-lemma-part-editor\r\n [identity]=\"identity\"\r\n [data]=\"$any(data)\"\r\n (dataChange)=\"save($event!.value!)\"\r\n (editorClose)=\"close()\"\r\n (dirtyChange)=\"onDirtyChange($event)\"\r\n/>\r\n","/*\r\n * Public API Surface of cadmus-part-lexicography-lemma\r\n */\r\n\r\nexport * from './lib/lex-lemma-part';\r\nexport * from './lib/components/word-form-editor/word-form-editor';\r\nexport * from './lib/components/word-form-set-editor/word-form-set-editor';\r\nexport * from './lib/components/lex-lemma-part-feature/lex-lemma-part-feature';\r\n","/**\n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mB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,+BAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChBhC,uPAQA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDIY,uBAAuB,oEAAE,kBAAkB,EAAA,QAAA,EAAA,8BAAA,EAAA,CAAA,EAAA,CAAA;;2FAI1C,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+BAA+B,EAAA,OAAA,EAChC,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,EAAA,QAAA,EAAA,uPAAA,EAAA;;;AEZxD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { Part, ThesaurusEntry } from '@myrmidon/cadmus-core';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { OnInit } from '@angular/core';
|
|
4
|
+
import { FormControl, FormGroup, FormBuilder } from '@angular/forms';
|
|
5
|
+
import { DialogService } from '@myrmidon/ngx-mat-tools';
|
|
6
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
7
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
8
|
+
import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
9
|
+
import { EditPartFeatureBase, PartEditorService } from '@myrmidon/cadmus-state';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A word form.
|
|
13
|
+
*/
|
|
14
|
+
interface WordForm {
|
|
15
|
+
type: string;
|
|
16
|
+
prefix?: string;
|
|
17
|
+
value: string;
|
|
18
|
+
suffix?: string;
|
|
19
|
+
pos: string;
|
|
20
|
+
features?: string[];
|
|
21
|
+
tags?: string[];
|
|
22
|
+
note?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The lemma part model.
|
|
26
|
+
*/
|
|
27
|
+
interface LexLemmaPart extends Part {
|
|
28
|
+
lid: string;
|
|
29
|
+
homograph?: number;
|
|
30
|
+
forms: WordForm[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The type ID used to identify the lemma part type.
|
|
34
|
+
*/
|
|
35
|
+
declare const LEX_LEMMA_PART_TYPEID = "it.vedph.lexicography.lemma";
|
|
36
|
+
/**
|
|
37
|
+
* JSON schema for the lemma part.
|
|
38
|
+
* You can use the JSON schema tool at https://jsonschema.net/.
|
|
39
|
+
*/
|
|
40
|
+
declare const LEX_LEMMA_PART_SCHEMA: {
|
|
41
|
+
$schema: string;
|
|
42
|
+
$id: string;
|
|
43
|
+
type: string;
|
|
44
|
+
title: string;
|
|
45
|
+
required: string[];
|
|
46
|
+
properties: {
|
|
47
|
+
timeCreated: {
|
|
48
|
+
type: string;
|
|
49
|
+
pattern: string;
|
|
50
|
+
};
|
|
51
|
+
creatorId: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
54
|
+
timeModified: {
|
|
55
|
+
type: string;
|
|
56
|
+
pattern: string;
|
|
57
|
+
};
|
|
58
|
+
userId: {
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
id: {
|
|
62
|
+
type: string;
|
|
63
|
+
pattern: string;
|
|
64
|
+
};
|
|
65
|
+
itemId: {
|
|
66
|
+
type: string;
|
|
67
|
+
pattern: string;
|
|
68
|
+
};
|
|
69
|
+
typeId: {
|
|
70
|
+
type: string;
|
|
71
|
+
pattern: string;
|
|
72
|
+
};
|
|
73
|
+
roleId: {
|
|
74
|
+
type: string[];
|
|
75
|
+
pattern: string;
|
|
76
|
+
};
|
|
77
|
+
lid: {
|
|
78
|
+
type: string;
|
|
79
|
+
};
|
|
80
|
+
homograph: {
|
|
81
|
+
type: string[];
|
|
82
|
+
};
|
|
83
|
+
forms: {
|
|
84
|
+
type: string;
|
|
85
|
+
minItems: number;
|
|
86
|
+
items: {
|
|
87
|
+
type: string;
|
|
88
|
+
required: string[];
|
|
89
|
+
properties: {
|
|
90
|
+
type: {
|
|
91
|
+
type: string;
|
|
92
|
+
};
|
|
93
|
+
prefix: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
96
|
+
value: {
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
suffix: {
|
|
100
|
+
type: string;
|
|
101
|
+
};
|
|
102
|
+
pos: {
|
|
103
|
+
type: string;
|
|
104
|
+
};
|
|
105
|
+
features: {
|
|
106
|
+
type: string;
|
|
107
|
+
items: {
|
|
108
|
+
type: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
tags: {
|
|
112
|
+
type: string;
|
|
113
|
+
items: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
note: {
|
|
118
|
+
type: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
additionalProperties: boolean;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
additionalProperties: boolean;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
declare class WordFormEditor {
|
|
129
|
+
readonly form: _angular_core.ModelSignal<WordForm | undefined>;
|
|
130
|
+
readonly cancelEdit: _angular_core.OutputEmitterRef<void>;
|
|
131
|
+
readonly typeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
132
|
+
readonly prefixEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
133
|
+
readonly suffixEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
134
|
+
readonly posEntries: _angular_core.InputSignal<ThesaurusEntry[]>;
|
|
135
|
+
readonly featureEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
136
|
+
readonly tagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
137
|
+
type: FormControl<string>;
|
|
138
|
+
prefix: FormControl<string | null>;
|
|
139
|
+
value: FormControl<string>;
|
|
140
|
+
suffix: FormControl<string | null>;
|
|
141
|
+
pos: FormControl<ThesaurusEntry>;
|
|
142
|
+
features: FormControl<ThesaurusEntry[]>;
|
|
143
|
+
tags: FormControl<ThesaurusEntry[]>;
|
|
144
|
+
note: FormControl<string | null>;
|
|
145
|
+
formCtl: FormGroup;
|
|
146
|
+
constructor(formBuilder: FormBuilder);
|
|
147
|
+
mapIdToEntry(id: string | null, entries: ThesaurusEntry[] | undefined): ThesaurusEntry | null;
|
|
148
|
+
private mapIdsToEntries;
|
|
149
|
+
private updateForm;
|
|
150
|
+
onPosEntriesChange(entries: ThesaurusEntry[]): void;
|
|
151
|
+
onFeatureEntriesChange(entries: ThesaurusEntry[]): void;
|
|
152
|
+
onTagEntriesChange(entries: ThesaurusEntry[]): void;
|
|
153
|
+
private getData;
|
|
154
|
+
cancel(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Saves the current form data by updating the `data` model signal.
|
|
157
|
+
* This method can be called manually (e.g., by a Save button) or
|
|
158
|
+
* automatically (via auto-save).
|
|
159
|
+
* @param pristine If true (default), the form is marked as pristine
|
|
160
|
+
* after saving.
|
|
161
|
+
* Set to false for auto-save if you want the form to remain dirty.
|
|
162
|
+
*/
|
|
163
|
+
save(pristine?: boolean): void;
|
|
164
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WordFormEditor, never>;
|
|
165
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WordFormEditor, "cadmus-word-form-editor", never, { "form": { "alias": "form"; "required": false; "isSignal": true; }; "typeEntries": { "alias": "typeEntries"; "required": false; "isSignal": true; }; "prefixEntries": { "alias": "prefixEntries"; "required": false; "isSignal": true; }; "suffixEntries": { "alias": "suffixEntries"; "required": false; "isSignal": true; }; "posEntries": { "alias": "posEntries"; "required": true; "isSignal": true; }; "featureEntries": { "alias": "featureEntries"; "required": false; "isSignal": true; }; "tagEntries": { "alias": "tagEntries"; "required": false; "isSignal": true; }; }, { "form": "formChange"; "cancelEdit": "cancelEdit"; }, never, never, true, never>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Editor for a set of word forms.
|
|
170
|
+
*/
|
|
171
|
+
declare class WordFormSetEditor {
|
|
172
|
+
private _dialogService;
|
|
173
|
+
/**
|
|
174
|
+
* The forms to edit.
|
|
175
|
+
*/
|
|
176
|
+
readonly forms: _angular_core.ModelSignal<WordForm[]>;
|
|
177
|
+
/**
|
|
178
|
+
* The form being edited.
|
|
179
|
+
*/
|
|
180
|
+
readonly edited: _angular_core.WritableSignal<WordForm | undefined>;
|
|
181
|
+
/**
|
|
182
|
+
* The index of the form being edited, -1 if a new one.
|
|
183
|
+
*/
|
|
184
|
+
readonly editedIndex: _angular_core.WritableSignal<number>;
|
|
185
|
+
readonly typeEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
186
|
+
readonly prefixEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
187
|
+
readonly suffixEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
188
|
+
readonly posEntries: _angular_core.InputSignal<ThesaurusEntry[]>;
|
|
189
|
+
readonly featureEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
190
|
+
readonly tagEntries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
191
|
+
constructor(_dialogService: DialogService);
|
|
192
|
+
addForm(): void;
|
|
193
|
+
editForm(entry: WordForm, index: number): void;
|
|
194
|
+
closeForm(): void;
|
|
195
|
+
saveForm(entry: WordForm): void;
|
|
196
|
+
deleteForm(index: number): void;
|
|
197
|
+
moveFormUp(index: number): void;
|
|
198
|
+
moveFormDown(index: number): void;
|
|
199
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WordFormSetEditor, never>;
|
|
200
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WordFormSetEditor, "cadmus-word-form-set-editor", never, { "forms": { "alias": "forms"; "required": false; "isSignal": true; }; "typeEntries": { "alias": "typeEntries"; "required": false; "isSignal": true; }; "prefixEntries": { "alias": "prefixEntries"; "required": false; "isSignal": true; }; "suffixEntries": { "alias": "suffixEntries"; "required": false; "isSignal": true; }; "posEntries": { "alias": "posEntries"; "required": true; "isSignal": true; }; "featureEntries": { "alias": "featureEntries"; "required": false; "isSignal": true; }; "tagEntries": { "alias": "tagEntries"; "required": false; "isSignal": true; }; }, { "forms": "formsChange"; }, never, never, true, never>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare class LexLemmaPartFeature extends EditPartFeatureBase implements OnInit {
|
|
204
|
+
constructor(router: Router, route: ActivatedRoute, snackbar: MatSnackBar, itemService: ItemService, thesaurusService: ThesaurusService, editorService: PartEditorService);
|
|
205
|
+
protected getReqThesauriIds(): string[];
|
|
206
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LexLemmaPartFeature, never>;
|
|
207
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LexLemmaPartFeature, "cadmus-lex-lemma-part-feature", never, {}, {}, never, never, true, never>;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export { LEX_LEMMA_PART_SCHEMA, LEX_LEMMA_PART_TYPEID, LexLemmaPartFeature, WordFormEditor, WordFormSetEditor };
|
|
211
|
+
export type { LexLemmaPart, WordForm };
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@myrmidon/cadmus-part-lexicography-lemma",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Cadmus - Lexicography lemma part",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Cadmus",
|
|
7
|
+
"lexicography"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/vedph/cadmus-lexicography-shell",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/vedph/cadmus-lexicography-shell"
|
|
13
|
+
},
|
|
14
|
+
"author": {
|
|
15
|
+
"name": "Daniele Fusi"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"@angular/common": "^20.0.0",
|
|
19
|
+
"@angular/core": "^20.0.0",
|
|
20
|
+
"@angular/material": "^20.0.0"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tslib": "^2.3.0"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"module": "fesm2022/myrmidon-cadmus-part-lexicography-lemma.mjs",
|
|
27
|
+
"typings": "index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
"./package.json": {
|
|
30
|
+
"default": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./index.d.ts",
|
|
34
|
+
"default": "./fesm2022/myrmidon-cadmus-part-lexicography-lemma.mjs"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|