@myrmidon/cadmus-ui 15.1.0 → 15.1.2

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/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { OnInit, ElementRef, OnDestroy, Type } from '@angular/core';
3
3
  import { FormGroup, UntypedFormGroup, FormArray, FormControl, FormBuilder, UntypedFormControl, UntypedFormBuilder, ValidatorFn, AbstractControl } from '@angular/forms';
4
- import { TokenLocation, TextLayerService, FacetDefinition, FlagDefinition, LayerHint, DataPinInfo, IndexLookupDefinitions, Thesaurus, PartTypeIds, Part, Fragment, PartIdentity, FragmentIdentity, EditedObject } from '@myrmidon/cadmus-core';
4
+ import * as _myrmidon_cadmus_core from '@myrmidon/cadmus-core';
5
+ import { TokenLocation, TextLayerService, FacetDefinition, FlagDefinition, LayerHint, DataPinInfo, IndexLookupDefinitions, ThesaurusEntry as ThesaurusEntry$1, Thesaurus, PartTypeIds, Part, Fragment, PartIdentity, FragmentIdentity, EditedObject } from '@myrmidon/cadmus-core';
5
6
  import { DialogService } from '@myrmidon/ngx-mat-tools';
6
7
  import { Observable, BehaviorSubject } from 'rxjs';
7
8
  import { ItemService, FacetService, UserService } from '@myrmidon/cadmus-api';
9
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
8
10
  import { PagedTreeStoreService, TreeNodeFilter, PagedTreeNode, PagedTreeStore, PageChangeRequest } from '@myrmidon/paged-data-browsers';
9
11
  import { DataPage } from '@myrmidon/ngx-tools';
10
12
  import { MatDialogRef } from '@angular/material/dialog';
@@ -229,6 +231,76 @@ declare class LookupPinComponent implements OnInit {
229
231
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<LookupPinComponent, "cadmus-lookup-pin", never, { "initialValue": { "alias": "initialValue"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "limit": { "alias": "limit"; "required": false; "isSignal": true; }; "resetOnPick": { "alias": "resetOnPick"; "required": false; "isSignal": true; }; "lookupKey": { "alias": "lookupKey"; "required": false; "isSignal": true; }; }, { "entryChange": "entryChange"; }, never, never, true, never>;
230
232
  }
231
233
 
234
+ /**
235
+ * The prefix added to custom entries' IDs.
236
+ */
237
+ declare const CUSTOM_ENTRY_PREFIX = "$";
238
+ /**
239
+ * A picker component for thesaurus entries.
240
+ * This component allows picking one or more entries from a given thesaurus.
241
+ * In its collapsed state, it shows the picked entries as chips; when
242
+ * expanded, it shows the thesaurus tree to pick from. Custom entries
243
+ * (not in the thesaurus) can be optionally allowed.
244
+ */
245
+ declare class ThesEntriesPickerComponent {
246
+ /**
247
+ * The thesaurus entries to pick from (required).
248
+ */
249
+ readonly availableEntries: _angular_core.InputSignal<ThesaurusEntry$1[]>;
250
+ /**
251
+ * The picked entries.
252
+ */
253
+ readonly entries: _angular_core.ModelSignal<ThesaurusEntry$1[]>;
254
+ /**
255
+ * True to show the entries with labels shortened according to
256
+ * their hierarchy.
257
+ */
258
+ readonly hierarchicLabels: _angular_core.InputSignal<boolean>;
259
+ /**
260
+ * True to automatically sort entries (disables drag-and-drop).
261
+ * When false, entries can be manually reordered via drag-and-drop.
262
+ */
263
+ readonly autoSort: _angular_core.InputSignal<boolean>;
264
+ /**
265
+ * True to allow custom values (not in the entries list).
266
+ */
267
+ readonly allowCustom: _angular_core.InputSignal<boolean>;
268
+ /**
269
+ * The minimum number of entries to pick.
270
+ */
271
+ readonly minEntries: _angular_core.InputSignal<number>;
272
+ /**
273
+ * The maximum number of entries to pick (0=unlimited).
274
+ */
275
+ readonly maxEntries: _angular_core.InputSignal<number>;
276
+ /**
277
+ * True when the picker is expanded (showing the entries list).
278
+ */
279
+ readonly expanded: _angular_core.ModelSignal<boolean>;
280
+ /**
281
+ * The message to show when there are no picked entries.
282
+ */
283
+ readonly emptyMessage: _angular_core.InputSignal<string>;
284
+ /**
285
+ * The number of remaining entries that can be picked (0=unlimited).
286
+ * This is displayed only if maxEntries > 1.
287
+ */
288
+ readonly remaining: _angular_core.Signal<number>;
289
+ id: FormControl<string>;
290
+ value: FormControl<string>;
291
+ form: FormGroup;
292
+ constructor(formBuilder: FormBuilder);
293
+ renderLabel: (label: string) => string;
294
+ private sortEntries;
295
+ onEntryChange(entry: ThesaurusEntry$1): void;
296
+ addCustomEntry(): void;
297
+ removeEntry(entry: ThesaurusEntry$1): void;
298
+ clear(): void;
299
+ onDrop(event: CdkDragDrop<ThesaurusEntry$1[]>): void;
300
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThesEntriesPickerComponent, never>;
301
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThesEntriesPickerComponent, "cadmus-thes-entries-picker", never, { "availableEntries": { "alias": "availableEntries"; "required": true; "isSignal": true; }; "entries": { "alias": "entries"; "required": false; "isSignal": true; }; "hierarchicLabels": { "alias": "hierarchicLabels"; "required": false; "isSignal": true; }; "autoSort": { "alias": "autoSort"; "required": false; "isSignal": true; }; "allowCustom": { "alias": "allowCustom"; "required": false; "isSignal": true; }; "minEntries": { "alias": "minEntries"; "required": false; "isSignal": true; }; "maxEntries": { "alias": "maxEntries"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; }, { "entries": "entriesChange"; "expanded": "expandedChange"; }, never, never, true, never>;
302
+ }
303
+
232
304
  interface ThesaurusEntry {
233
305
  id: string;
234
306
  value: string;
@@ -344,7 +416,6 @@ declare function getPartIdName(typeId: string, roleId?: string | null, typeThesa
344
416
  */
345
417
  declare class PartBadgeComponent {
346
418
  private _facetService;
347
- private _colorService;
348
419
  /**
349
420
  * The badge type: 0=part and role, 1=part only, 2=role only.
350
421
  */
@@ -361,20 +432,31 @@ declare class PartBadgeComponent {
361
432
  * The part type IDs.
362
433
  */
363
434
  readonly partTypeIds: _angular_core.InputSignal<PartTypeIds | undefined>;
364
- readonly typeName: _angular_core.WritableSignal<string | undefined>;
365
- readonly roleName: _angular_core.WritableSignal<string | undefined>;
366
- readonly color: _angular_core.WritableSignal<string>;
367
- readonly contrastColor: _angular_core.WritableSignal<string>;
368
- constructor(_facetService: FacetService, _colorService: ColorService);
435
+ /**
436
+ * The part type name.
437
+ */
438
+ readonly typeName: _angular_core.Signal<string | undefined>;
439
+ /**
440
+ * The part role name.
441
+ */
442
+ readonly roleName: _angular_core.Signal<string | undefined>;
443
+ /**
444
+ * The part badge color.
445
+ */
446
+ readonly color: _angular_core.Signal<string>;
447
+ /**
448
+ * The part definition matching the part type ID and role ID.
449
+ */
450
+ readonly partDefinition: _angular_core.Signal<_myrmidon_cadmus_core.PartDefinition | undefined>;
451
+ constructor(_facetService: FacetService);
369
452
  private getPartColor;
370
453
  /**
371
454
  * Get the role's human-friendly name from its ID.
372
455
  * @param roleId The role ID.
373
456
  * @param typeThesaurus The types thesaurus.
374
- * @returns The name.?
457
+ * @returns The name or undefined.
375
458
  */
376
459
  private getRoleIdName;
377
- private updateBadge;
378
460
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PartBadgeComponent, never>;
379
461
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<PartBadgeComponent, "cadmus-part-badge", never, { "badgeType": { "alias": "badgeType"; "required": false; "isSignal": true; }; "typeThesaurus": { "alias": "typeThesaurus"; "required": false; "isSignal": true; }; "facetDefinition": { "alias": "facetDefinition"; "required": false; "isSignal": true; }; "partTypeIds": { "alias": "partTypeIds"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
380
462
  }
@@ -645,5 +727,5 @@ declare const extractTouchedChanges: (control: ObjectLike<AbstractControl, "mark
645
727
  */
646
728
  declare const extractPristineChanges: (control: ObjectLike<AbstractControl, "markAsPristine" | "markAsDirty">) => Observable<boolean>;
647
729
 
648
- export { CloseSaveButtonsComponent, ColorService, CustomValidators, DecoratedTokenTextComponent, ErrorListComponent, FacetBadgeComponent, FlagsBadgeComponent, JsonValidators, LayerHintsComponent, LookupPinComponent, ModelEditorComponentBase, PartBadgeComponent, PartBadgeType, StaticThesPagedTreeStoreService, ThesPagedTreeBrowserComponent, ThesaurusTreeComponent, UserRefLookupService, extractPristineChanges, extractTouchedChanges, getPartIdName, renderLabelFromLastColon };
730
+ export { CUSTOM_ENTRY_PREFIX, CloseSaveButtonsComponent, ColorService, CustomValidators, DecoratedTokenTextComponent, ErrorListComponent, FacetBadgeComponent, FlagsBadgeComponent, JsonValidators, LayerHintsComponent, LookupPinComponent, ModelEditorComponentBase, PartBadgeComponent, PartBadgeType, StaticThesPagedTreeStoreService, ThesEntriesPickerComponent, ThesPagedTreeBrowserComponent, ThesaurusTreeComponent, UserRefLookupService, extractPristineChanges, extractTouchedChanges, getPartIdName, renderLabelFromLastColon };
649
731
  export type { ArgumentsType, FacetBadgeData, FlagsBadgeData, ThesEntryNodeFilter, ThesEntryPagedTreeNode, ThesaurusEntry, UserWithRoles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/cadmus-ui",
3
- "version": "15.1.0",
3
+ "version": "15.1.2",
4
4
  "description": "Cadmus - general UI components.",
5
5
  "keywords": [
6
6
  "Cadmus"
@@ -18,7 +18,7 @@
18
18
  "@angular/core": "^20.0.0",
19
19
  "@angular/material": "^20.0.0",
20
20
  "@myrmidon/ngx-tools": "^2.0.0",
21
- "@myrmidon/cadmus-refs-lookup": "^10.0.3",
21
+ "@myrmidon/cadmus-refs-lookup": "^10.0.5",
22
22
  "@myrmidon/cadmus-core": "^12.0.2"
23
23
  },
24
24
  "dependencies": {