@myrmidon/cadmus-part-lexicography-word-forms 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,63 @@
1
+ # CadmusPartLexicographyWordForms
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
+
9
+ ```bash
10
+ ng generate component component-name
11
+ ```
12
+
13
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
+
15
+ ```bash
16
+ ng generate --help
17
+ ```
18
+
19
+ ## Building
20
+
21
+ To build the library, run:
22
+
23
+ ```bash
24
+ ng build cadmus-part-lexicography-word-forms
25
+ ```
26
+
27
+ This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
+
29
+ ### Publishing the Library
30
+
31
+ Once the project is built, you can publish your library by following these steps:
32
+
33
+ 1. Navigate to the `dist` directory:
34
+ ```bash
35
+ cd dist/cadmus-part-lexicography-word-forms
36
+ ```
37
+
38
+ 2. Run the `npm publish` command to publish your library to the npm registry:
39
+ ```bash
40
+ npm publish
41
+ ```
42
+
43
+ ## Running unit tests
44
+
45
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
46
+
47
+ ```bash
48
+ ng test
49
+ ```
50
+
51
+ ## Running end-to-end tests
52
+
53
+ For end-to-end (e2e) testing, run:
54
+
55
+ ```bash
56
+ ng e2e
57
+ ```
58
+
59
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
60
+
61
+ ## Additional Resources
62
+
63
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
@@ -0,0 +1,271 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, Component } from '@angular/core';
3
+ import * as i2 from '@angular/forms';
4
+ import { ReactiveFormsModule } from '@angular/forms';
5
+ import { TitleCasePipe } from '@angular/common';
6
+ import { MatCard, MatCardActions, MatCardContent, MatCardHeader, MatCardTitle } from '@angular/material/card';
7
+ import { MatTooltip } from '@angular/material/tooltip';
8
+ import { MatIcon } from '@angular/material/icon';
9
+ import { ModelEditorComponentBase, CloseSaveButtonsComponent } from '@myrmidon/cadmus-ui';
10
+ import { WordFormSetEditor } from '@myrmidon/cadmus-part-lexicography-lemma';
11
+ import * as i1 from '@myrmidon/auth-jwt-login';
12
+ import * as i4 from '@myrmidon/cadmus-state';
13
+ import { EditPartFeatureBase } from '@myrmidon/cadmus-state';
14
+ import { CurrentItemBarComponent } from '@myrmidon/cadmus-ui-pg';
15
+ import * as i1$1 from '@angular/router';
16
+ import * as i2$1 from '@angular/material/snack-bar';
17
+ import * as i3 from '@myrmidon/cadmus-api';
18
+
19
+ /**
20
+ * The type ID used to identify the LexWordFormsPart type.
21
+ */
22
+ const LEX_WORD_FORMS_PART_TYPEID = 'it.vedph.lexicography.word-forms';
23
+ /**
24
+ * JSON schema for the LexWordForms part.
25
+ * You can use the JSON schema tool at https://jsonschema.net/.
26
+ */
27
+ const LEX_WORD_FORMS_PART_SCHEMA = {
28
+ $schema: 'http://json-schema.org/draft-07/schema#',
29
+ $id: 'www.vedph.it/cadmus/parts/lexicography/' + LEX_WORD_FORMS_PART_TYPEID + '.json',
30
+ type: 'object',
31
+ title: 'LexWordFormsPart',
32
+ required: [
33
+ 'id',
34
+ 'itemId',
35
+ 'typeId',
36
+ 'timeCreated',
37
+ 'creatorId',
38
+ 'timeModified',
39
+ 'userId',
40
+ 'forms',
41
+ ],
42
+ properties: {
43
+ timeCreated: {
44
+ type: 'string',
45
+ pattern: '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d+Z$',
46
+ },
47
+ creatorId: {
48
+ type: 'string',
49
+ },
50
+ timeModified: {
51
+ type: 'string',
52
+ pattern: '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d+Z$',
53
+ },
54
+ userId: {
55
+ type: 'string',
56
+ },
57
+ id: {
58
+ type: 'string',
59
+ pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$',
60
+ },
61
+ itemId: {
62
+ type: 'string',
63
+ pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$',
64
+ },
65
+ typeId: {
66
+ type: 'string',
67
+ pattern: '^[a-z][-0-9a-z._]*$',
68
+ },
69
+ roleId: {
70
+ type: ['string', 'null'],
71
+ pattern: '^([a-z][-0-9a-z._]*)?$',
72
+ },
73
+ forms: {
74
+ type: 'array',
75
+ minItems: 1,
76
+ items: {
77
+ type: 'object',
78
+ required: ['type', 'value', 'pos'],
79
+ properties: {
80
+ type: {
81
+ type: 'string',
82
+ },
83
+ prefix: {
84
+ type: 'string',
85
+ },
86
+ value: {
87
+ type: 'string',
88
+ },
89
+ suffix: {
90
+ type: 'string',
91
+ },
92
+ pos: {
93
+ type: 'string',
94
+ },
95
+ features: {
96
+ type: 'array',
97
+ items: {
98
+ type: 'string',
99
+ },
100
+ },
101
+ tags: {
102
+ type: 'array',
103
+ items: {
104
+ type: 'string',
105
+ },
106
+ },
107
+ note: {
108
+ type: 'string',
109
+ },
110
+ },
111
+ additionalProperties: false,
112
+ },
113
+ },
114
+ },
115
+ };
116
+
117
+ /**
118
+ * Lexicography word forms part editor component.
119
+ * Thesauri: lex-word-form-types, lex-word-form-prefixes, lex-word-form-suffixes,
120
+ * lex-pos-tags, lex-word-form-features, lex-word-form-tags.
121
+ */
122
+ class LexWordFormsPartEditor extends ModelEditorComponentBase {
123
+ forms;
124
+ // lex-word-form-types
125
+ typeEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "typeEntries" }] : []));
126
+ // lex-word-form-prefixes
127
+ prefixEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "prefixEntries" }] : []));
128
+ // lex-word-form-suffixes
129
+ suffixEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "suffixEntries" }] : []));
130
+ // lex-pos-tags (required)
131
+ posEntries = signal([], ...(ngDevMode ? [{ debugName: "posEntries" }] : []));
132
+ // lex-word-form-features
133
+ featureEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "featureEntries" }] : []));
134
+ // lex-word-form-tags
135
+ tagEntries = signal(undefined, ...(ngDevMode ? [{ debugName: "tagEntries" }] : []));
136
+ constructor(authService, formBuilder) {
137
+ super(authService, formBuilder);
138
+ // form
139
+ this.forms = formBuilder.control([], { nonNullable: true });
140
+ }
141
+ ngOnInit() {
142
+ super.ngOnInit();
143
+ }
144
+ buildForm(formBuilder) {
145
+ return formBuilder.group({
146
+ forms: this.forms,
147
+ });
148
+ }
149
+ updateThesauri(thesauri) {
150
+ let key = 'lex-word-form-types';
151
+ if (this.hasThesaurus(key)) {
152
+ this.typeEntries.set(thesauri[key].entries);
153
+ }
154
+ else {
155
+ this.typeEntries.set(undefined);
156
+ }
157
+ key = 'lex-word-form-prefixes';
158
+ if (this.hasThesaurus(key)) {
159
+ this.prefixEntries.set(thesauri[key].entries);
160
+ }
161
+ else {
162
+ this.prefixEntries.set(undefined);
163
+ }
164
+ key = 'lex-word-form-suffixes';
165
+ if (this.hasThesaurus(key)) {
166
+ this.suffixEntries.set(thesauri[key].entries);
167
+ }
168
+ else {
169
+ this.suffixEntries.set(undefined);
170
+ }
171
+ key = 'lex-pos-tags';
172
+ if (this.hasThesaurus(key)) {
173
+ this.posEntries.set(thesauri[key].entries);
174
+ }
175
+ else {
176
+ this.posEntries.set([]);
177
+ }
178
+ key = 'lex-word-form-features';
179
+ if (this.hasThesaurus(key)) {
180
+ this.featureEntries.set(thesauri[key].entries);
181
+ }
182
+ else {
183
+ this.featureEntries.set(undefined);
184
+ }
185
+ key = 'lex-word-form-tags';
186
+ if (this.hasThesaurus(key)) {
187
+ this.tagEntries.set(thesauri[key].entries);
188
+ }
189
+ else {
190
+ this.tagEntries.set(undefined);
191
+ }
192
+ }
193
+ updateForm(part) {
194
+ if (!part) {
195
+ this.form.reset();
196
+ return;
197
+ }
198
+ this.forms.setValue(part.forms || []);
199
+ this.form.markAsPristine();
200
+ }
201
+ onFormsChange(forms) {
202
+ this.forms.setValue(forms || []);
203
+ this.form.markAsDirty();
204
+ this.forms.updateValueAndValidity();
205
+ }
206
+ onDataSet(data) {
207
+ // thesauri
208
+ if (data?.thesauri) {
209
+ this.updateThesauri(data.thesauri);
210
+ }
211
+ // form
212
+ this.updateForm(data?.value);
213
+ }
214
+ getValue() {
215
+ let part = this.getEditedPart(LEX_WORD_FORMS_PART_TYPEID);
216
+ part.forms = this.forms.value || [];
217
+ return part;
218
+ }
219
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LexWordFormsPartEditor, deps: [{ token: i1.AuthJwtService }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
220
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: LexWordFormsPartEditor, isStandalone: true, selector: "cadmus-lex-word-forms-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) || 'Word Forms Part' }}\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[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: "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: 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" }] });
221
+ }
222
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LexWordFormsPartEditor, decorators: [{
223
+ type: Component,
224
+ args: [{ selector: 'cadmus-lex-word-forms-part-editor', imports: [
225
+ ReactiveFormsModule,
226
+ MatCard,
227
+ MatCardActions,
228
+ MatCardContent,
229
+ MatCardHeader,
230
+ MatCardTitle,
231
+ MatIcon,
232
+ MatTooltip,
233
+ TitleCasePipe,
234
+ CloseSaveButtonsComponent,
235
+ WordFormSetEditor,
236
+ ], 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) || 'Word Forms Part' }}\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\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"] }]
237
+ }], ctorParameters: () => [{ type: i1.AuthJwtService }, { type: i2.FormBuilder }] });
238
+
239
+ class LexWordFormsPartFeature extends EditPartFeatureBase {
240
+ constructor(router, route, snackbar, itemService, thesaurusService, editorService) {
241
+ super(router, route, snackbar, itemService, thesaurusService, editorService);
242
+ }
243
+ getReqThesauriIds() {
244
+ this.roleIdInThesauri = true;
245
+ return [
246
+ 'lex-word-form-types',
247
+ 'lex-word-form-prefixes',
248
+ 'lex-word-form-suffixes',
249
+ 'lex-pos-tags',
250
+ 'lex-word-form-features',
251
+ 'lex-word-form-tags',
252
+ ];
253
+ }
254
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LexWordFormsPartFeature, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i2$1.MatSnackBar }, { token: i3.ItemService }, { token: i3.ThesaurusService }, { token: i4.PartEditorService }], target: i0.ɵɵFactoryTarget.Component });
255
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.9", type: LexWordFormsPartFeature, isStandalone: true, selector: "cadmus-lex-word-forms-part-feature", usesInheritance: true, ngImport: i0, template: "<cadmus-current-item-bar />\r\n<cadmus-lex-word-forms-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: LexWordFormsPartEditor, selector: "cadmus-lex-word-forms-part-editor" }] });
256
+ }
257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: LexWordFormsPartFeature, decorators: [{
258
+ type: Component,
259
+ args: [{ selector: 'cadmus-lex-word-forms-part-feature', imports: [CurrentItemBarComponent, LexWordFormsPartEditor], template: "<cadmus-current-item-bar />\r\n<cadmus-lex-word-forms-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" }]
260
+ }], ctorParameters: () => [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i2$1.MatSnackBar }, { type: i3.ItemService }, { type: i3.ThesaurusService }, { type: i4.PartEditorService }] });
261
+
262
+ /*
263
+ * Public API Surface of cadmus-part-lexicography-word-forms
264
+ */
265
+
266
+ /**
267
+ * Generated bundle index. Do not edit.
268
+ */
269
+
270
+ export { LEX_WORD_FORMS_PART_SCHEMA, LEX_WORD_FORMS_PART_TYPEID, LexWordFormsPartEditor, LexWordFormsPartFeature };
271
+ //# sourceMappingURL=myrmidon-cadmus-part-lexicography-word-forms.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"myrmidon-cadmus-part-lexicography-word-forms.mjs","sources":["../../../../projects/myrmidon/cadmus-part-lexicography-word-forms/src/lib/lex-word-forms-part.ts","../../../../projects/myrmidon/cadmus-part-lexicography-word-forms/src/lib/components/lex-word-forms-part-editor/lex-word-forms-part-editor.ts","../../../../projects/myrmidon/cadmus-part-lexicography-word-forms/src/lib/components/lex-word-forms-part-editor/lex-word-forms-part-editor.html","../../../../projects/myrmidon/cadmus-part-lexicography-word-forms/src/lib/components/lex-word-forms-part-feature/lex-word-forms-part-feature.ts","../../../../projects/myrmidon/cadmus-part-lexicography-word-forms/src/lib/components/lex-word-forms-part-feature/lex-word-forms-part-feature.html","../../../../projects/myrmidon/cadmus-part-lexicography-word-forms/src/public-api.ts","../../../../projects/myrmidon/cadmus-part-lexicography-word-forms/src/myrmidon-cadmus-part-lexicography-word-forms.ts"],"sourcesContent":["import { Part } from '@myrmidon/cadmus-core';\r\n\r\nimport { WordForm } from '@myrmidon/cadmus-part-lexicography-lemma';\r\n\r\n/**\r\n * The LexWordForms part model.\r\n */\r\nexport interface LexWordFormsPart extends Part {\r\n forms: WordForm[];\r\n}\r\n\r\n/**\r\n * The type ID used to identify the LexWordFormsPart type.\r\n */\r\nexport const LEX_WORD_FORMS_PART_TYPEID = 'it.vedph.lexicography.word-forms';\r\n\r\n/**\r\n * JSON schema for the LexWordForms part.\r\n * You can use the JSON schema tool at https://jsonschema.net/.\r\n */\r\nexport const LEX_WORD_FORMS_PART_SCHEMA = {\r\n $schema: 'http://json-schema.org/draft-07/schema#',\r\n $id: 'www.vedph.it/cadmus/parts/lexicography/' + LEX_WORD_FORMS_PART_TYPEID + '.json',\r\n type: 'object',\r\n title: 'LexWordFormsPart',\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 '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 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};\r\n","import { Component, OnInit, signal } from '@angular/core';\r\nimport {\r\n FormControl,\r\n FormBuilder,\r\n FormGroup,\r\n UntypedFormGroup,\r\n ReactiveFormsModule,\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 { AuthJwtService } from '@myrmidon/auth-jwt-login';\r\nimport { EditedObject, ThesauriSet, ThesaurusEntry } from '@myrmidon/cadmus-core';\r\nimport { CloseSaveButtonsComponent, ModelEditorComponentBase } from '@myrmidon/cadmus-ui';\r\nimport { WordForm, WordFormSetEditor } from '@myrmidon/cadmus-part-lexicography-lemma';\r\nimport { LEX_WORD_FORMS_PART_TYPEID, LexWordFormsPart } from '../../lex-word-forms-part';\r\n\r\n/**\r\n * Lexicography word forms 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-word-forms-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 MatIcon,\r\n MatTooltip,\r\n TitleCasePipe,\r\n CloseSaveButtonsComponent,\r\n WordFormSetEditor,\r\n ],\r\n templateUrl: './lex-word-forms-part-editor.html',\r\n styleUrl: './lex-word-forms-part-editor.css',\r\n})\r\nexport class LexWordFormsPartEditor\r\n extends ModelEditorComponentBase<LexWordFormsPart>\r\n implements OnInit\r\n{\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.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 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?: LexWordFormsPart | null): void {\r\n if (!part) {\r\n this.form.reset();\r\n return;\r\n }\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<LexWordFormsPart>): 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(): LexWordFormsPart {\r\n let part = this.getEditedPart(LEX_WORD_FORMS_PART_TYPEID) as LexWordFormsPart;\r\n part.forms = this.forms.value || [];\r\n return part;\r\n }\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) || 'Word Forms Part' }}\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\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 { LexWordFormsPartEditor } from '../lex-word-forms-part-editor/lex-word-forms-part-editor';\r\n\r\n@Component({\r\n selector: 'cadmus-lex-word-forms-part-feature',\r\n imports: [CurrentItemBarComponent, LexWordFormsPartEditor],\r\n templateUrl: './lex-word-forms-part-feature.html',\r\n styleUrl: './lex-word-forms-part-feature.css',\r\n})\r\nexport class LexWordFormsPartFeature 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 this.roleIdInThesauri = true;\r\n\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-word-forms-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-word-forms\r\n */\r\n\r\nexport * from './lib/lex-word-forms-part';\r\nexport * from './lib/components/lex-word-forms-part-editor/lex-word-forms-part-editor';\r\nexport * from './lib/components/lex-word-forms-part-feature/lex-word-forms-part-feature';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;AAWA;;AAEG;AACI,MAAM,0BAA0B,GAAG;AAE1C;;;AAGG;AACI,MAAM,0BAA0B,GAAG;AACxC,IAAA,OAAO,EAAE,yCAAyC;AAClD,IAAA,GAAG,EAAE,yCAAyC,GAAG,0BAA0B,GAAG,OAAO;AACrF,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,KAAK,EAAE,kBAAkB;AACzB,IAAA,QAAQ,EAAE;QACR,IAAI;QACJ,QAAQ;QACR,QAAQ;QACR,aAAa;QACb,WAAW;QACX,cAAc;QACd,QAAQ;QACR,OAAO;AACR,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,WAAW,EAAE;AACX,YAAA,IAAI,EAAE,QAAQ;AACd,YA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ACxB,oBAAoB;SACrB;IACH;uGAvBW,uBAAuB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,IAAA,CAAA,MAAA,EAAA,EAAA,EAAA,KAAA,EAAAA,IAAA,CAAA,cAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,IAAA,CAAA,WAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,iBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oCAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChBpC,4PAQA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDIY,uBAAuB,oEAAE,sBAAsB,EAAA,QAAA,EAAA,mCAAA,EAAA,CAAA,EAAA,CAAA;;2FAI9C,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBANnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oCAAoC,EAAA,OAAA,EACrC,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,EAAA,QAAA,EAAA,4PAAA,EAAA;;;AEZ5D;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,141 @@
1
+ import { Part, ThesaurusEntry, EditedObject } from '@myrmidon/cadmus-core';
2
+ import { WordForm } from '@myrmidon/cadmus-part-lexicography-lemma';
3
+ import * as _angular_core from '@angular/core';
4
+ import { OnInit } from '@angular/core';
5
+ import { FormControl, FormBuilder, FormGroup, UntypedFormGroup } from '@angular/forms';
6
+ import { AuthJwtService } from '@myrmidon/auth-jwt-login';
7
+ import { ModelEditorComponentBase } from '@myrmidon/cadmus-ui';
8
+ import { MatSnackBar } from '@angular/material/snack-bar';
9
+ import { Router, ActivatedRoute } from '@angular/router';
10
+ import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
11
+ import { EditPartFeatureBase, PartEditorService } from '@myrmidon/cadmus-state';
12
+
13
+ /**
14
+ * The LexWordForms part model.
15
+ */
16
+ interface LexWordFormsPart extends Part {
17
+ forms: WordForm[];
18
+ }
19
+ /**
20
+ * The type ID used to identify the LexWordFormsPart type.
21
+ */
22
+ declare const LEX_WORD_FORMS_PART_TYPEID = "it.vedph.lexicography.word-forms";
23
+ /**
24
+ * JSON schema for the LexWordForms part.
25
+ * You can use the JSON schema tool at https://jsonschema.net/.
26
+ */
27
+ declare const LEX_WORD_FORMS_PART_SCHEMA: {
28
+ $schema: string;
29
+ $id: string;
30
+ type: string;
31
+ title: string;
32
+ required: string[];
33
+ properties: {
34
+ timeCreated: {
35
+ type: string;
36
+ pattern: string;
37
+ };
38
+ creatorId: {
39
+ type: string;
40
+ };
41
+ timeModified: {
42
+ type: string;
43
+ pattern: string;
44
+ };
45
+ userId: {
46
+ type: string;
47
+ };
48
+ id: {
49
+ type: string;
50
+ pattern: string;
51
+ };
52
+ itemId: {
53
+ type: string;
54
+ pattern: string;
55
+ };
56
+ typeId: {
57
+ type: string;
58
+ pattern: string;
59
+ };
60
+ roleId: {
61
+ type: string[];
62
+ pattern: string;
63
+ };
64
+ forms: {
65
+ type: string;
66
+ minItems: number;
67
+ items: {
68
+ type: string;
69
+ required: string[];
70
+ properties: {
71
+ type: {
72
+ type: string;
73
+ };
74
+ prefix: {
75
+ type: string;
76
+ };
77
+ value: {
78
+ type: string;
79
+ };
80
+ suffix: {
81
+ type: string;
82
+ };
83
+ pos: {
84
+ type: string;
85
+ };
86
+ features: {
87
+ type: string;
88
+ items: {
89
+ type: string;
90
+ };
91
+ };
92
+ tags: {
93
+ type: string;
94
+ items: {
95
+ type: string;
96
+ };
97
+ };
98
+ note: {
99
+ type: string;
100
+ };
101
+ };
102
+ additionalProperties: boolean;
103
+ };
104
+ };
105
+ };
106
+ };
107
+
108
+ /**
109
+ * Lexicography word forms part editor component.
110
+ * Thesauri: lex-word-form-types, lex-word-form-prefixes, lex-word-form-suffixes,
111
+ * lex-pos-tags, lex-word-form-features, lex-word-form-tags.
112
+ */
113
+ declare class LexWordFormsPartEditor extends ModelEditorComponentBase<LexWordFormsPart> implements OnInit {
114
+ forms: FormControl<WordForm[]>;
115
+ readonly typeEntries: _angular_core.WritableSignal<ThesaurusEntry[] | undefined>;
116
+ readonly prefixEntries: _angular_core.WritableSignal<ThesaurusEntry[] | undefined>;
117
+ readonly suffixEntries: _angular_core.WritableSignal<ThesaurusEntry[] | undefined>;
118
+ readonly posEntries: _angular_core.WritableSignal<ThesaurusEntry[]>;
119
+ readonly featureEntries: _angular_core.WritableSignal<ThesaurusEntry[] | undefined>;
120
+ readonly tagEntries: _angular_core.WritableSignal<ThesaurusEntry[] | undefined>;
121
+ constructor(authService: AuthJwtService, formBuilder: FormBuilder);
122
+ ngOnInit(): void;
123
+ protected buildForm(formBuilder: FormBuilder): FormGroup | UntypedFormGroup;
124
+ private updateThesauri;
125
+ private updateForm;
126
+ onFormsChange(forms: WordForm[]): void;
127
+ protected onDataSet(data?: EditedObject<LexWordFormsPart>): void;
128
+ protected getValue(): LexWordFormsPart;
129
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<LexWordFormsPartEditor, never>;
130
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<LexWordFormsPartEditor, "cadmus-lex-word-forms-part-editor", never, {}, {}, never, never, true, never>;
131
+ }
132
+
133
+ declare class LexWordFormsPartFeature extends EditPartFeatureBase implements OnInit {
134
+ constructor(router: Router, route: ActivatedRoute, snackbar: MatSnackBar, itemService: ItemService, thesaurusService: ThesaurusService, editorService: PartEditorService);
135
+ protected getReqThesauriIds(): string[];
136
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<LexWordFormsPartFeature, never>;
137
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<LexWordFormsPartFeature, "cadmus-lex-word-forms-part-feature", never, {}, {}, never, never, true, never>;
138
+ }
139
+
140
+ export { LEX_WORD_FORMS_PART_SCHEMA, LEX_WORD_FORMS_PART_TYPEID, LexWordFormsPartEditor, LexWordFormsPartFeature };
141
+ export type { LexWordFormsPart };
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@myrmidon/cadmus-part-lexicography-word-forms",
3
+ "version": "0.0.1",
4
+ "description": "Cadmus - Lexicography word forms 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
+ "@myrmidon/cadmus-part-lexicography-lemma": "^0.0.1"
22
+ },
23
+ "dependencies": {
24
+ "tslib": "^2.3.0"
25
+ },
26
+ "sideEffects": false,
27
+ "module": "fesm2022/myrmidon-cadmus-part-lexicography-word-forms.mjs",
28
+ "typings": "index.d.ts",
29
+ "exports": {
30
+ "./package.json": {
31
+ "default": "./package.json"
32
+ },
33
+ ".": {
34
+ "types": "./index.d.ts",
35
+ "default": "./fesm2022/myrmidon-cadmus-part-lexicography-word-forms.mjs"
36
+ }
37
+ }
38
+ }