@myrmidon/cadmus-ui 15.1.4 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/cadmus-ui",
3
- "version": "15.1.4",
3
+ "version": "16.0.0",
4
4
  "description": "Cadmus - general UI components.",
5
5
  "keywords": [
6
6
  "Cadmus"
@@ -1,15 +1,11 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, ElementRef, OnDestroy, Type } from '@angular/core';
2
+ import { OnInit, ElementRef, OnDestroy } from '@angular/core';
3
3
  import { FormGroup, UntypedFormGroup, FormArray, FormControl, FormBuilder, UntypedFormControl, UntypedFormBuilder, ValidatorFn, AbstractControl } from '@angular/forms';
4
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
+ import { TokenLocation, TextLayerService, FacetDefinition, FlagDefinition, LayerHint, DataPinInfo, IndexLookupDefinitions, Thesaurus, PartTypeIds, Part, Fragment, PartIdentity, FragmentIdentity, EditedObject } from '@myrmidon/cadmus-core';
6
6
  import { DialogService } from '@myrmidon/ngx-mat-tools';
7
7
  import { Observable, BehaviorSubject } from 'rxjs';
8
8
  import { ItemService, FacetService, UserService } from '@myrmidon/cadmus-api';
9
- import { CdkDragDrop } from '@angular/cdk/drag-drop';
10
- import { PagedTreeStoreService, TreeNodeFilter, PagedTreeNode, PagedTreeStore, PageChangeRequest } from '@myrmidon/paged-data-browsers';
11
- import { DataPage } from '@myrmidon/ngx-tools';
12
- import { MatDialogRef } from '@angular/material/dialog';
13
9
  import { AuthJwtService, User } from '@myrmidon/auth-jwt-login';
14
10
  import { AppRepository } from '@myrmidon/cadmus-state';
15
11
  import { RefLookupService, RefLookupFilter } from '@myrmidon/cadmus-refs-lookup';
@@ -231,168 +227,6 @@ declare class LookupPinComponent implements OnInit {
231
227
  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>;
232
228
  }
233
229
 
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
-
304
- interface ThesaurusEntry {
305
- id: string;
306
- value: string;
307
- }
308
- /**
309
- * The filter for thesaurus entry nodes. The only filtered property is
310
- * the node's label.
311
- */
312
- interface ThesEntryNodeFilter extends TreeNodeFilter {
313
- label?: string;
314
- }
315
- /**
316
- * The tree node for thesaurus entries in a paging tree node.
317
- */
318
- interface ThesEntryPagedTreeNode extends PagedTreeNode<ThesEntryNodeFilter> {
319
- key: string;
320
- value: string;
321
- }
322
- /**
323
- * A label rendering function which removes from a label
324
- * all the characters past the last colon, trimming the result.
325
- * This is a typical rendering when dealing with hierarchical
326
- * thesaurus entries, e.g. "furniture: table: color", where
327
- * we can shorten the label to just "color", as "furniture"
328
- * and "table" are its ancestors.
329
- */
330
- declare const renderLabelFromLastColon: (label: string) => string;
331
- /**
332
- * A static paged tree store service for thesaurus entries.
333
- * This builds the tree nodes from the thesaurus entries, assuming
334
- * that entry IDs are hierarchical and separated by dots (.).
335
- */
336
- declare class StaticThesPagedTreeStoreService implements PagedTreeStoreService<ThesEntryNodeFilter> {
337
- private _renderLabel?;
338
- private _nodes;
339
- private _built;
340
- private readonly _entries;
341
- constructor(entries: ThesaurusEntry[], _renderLabel?: ((label: string) => string) | undefined);
342
- private ensureNodes;
343
- /**
344
- * Get the specified page of nodes.
345
- * @param filter The filter.
346
- * @param pageNumber The page number.
347
- * @param pageSize The page size.
348
- * @param hasMockRoot Whether the root node is a mock node. Not used here.
349
- */
350
- getNodes(filter: ThesEntryNodeFilter, pageNumber: number, pageSize: number, hasMockRoot?: boolean): Observable<DataPage<ThesEntryPagedTreeNode>>;
351
- }
352
-
353
- declare class ThesPagedTreeBrowserComponent implements OnInit, OnDestroy {
354
- private _dialog;
355
- private _sub?;
356
- /**
357
- * The service to use to load the nodes.
358
- */
359
- readonly service: _angular_core.InputSignal<StaticThesPagedTreeStoreService>;
360
- /**
361
- * Emitted when a node is clicked.
362
- */
363
- readonly nodePick: _angular_core.OutputEmitterRef<ThesEntryPagedTreeNode>;
364
- /**
365
- * The store instance, built from the service.
366
- */
367
- readonly store: _angular_core.Signal<PagedTreeStore<ThesEntryPagedTreeNode, ThesEntryNodeFilter>>;
368
- readonly loading: _angular_core.WritableSignal<boolean>;
369
- debug: FormControl<boolean>;
370
- hideLoc: FormControl<boolean>;
371
- hideFilter: FormControl<boolean>;
372
- filter$: Observable<Readonly<ThesEntryNodeFilter>>;
373
- nodes$: Observable<Readonly<ThesEntryPagedTreeNode[]>>;
374
- label: FormControl<string | null>;
375
- form: FormGroup<{
376
- label: FormControl<string | null>;
377
- }>;
378
- constructor();
379
- ngOnInit(): void;
380
- ngOnDestroy(): void;
381
- reset(): void;
382
- onToggleExpanded(node: ThesEntryPagedTreeNode): void;
383
- onPageChangeRequest(request: PageChangeRequest): void;
384
- onFilterChange(filter: ThesEntryNodeFilter | null | undefined): void;
385
- onEditFilterRequest(node: ThesEntryPagedTreeNode): void;
386
- expandAll(): void;
387
- collapseAll(): void;
388
- clear(): void;
389
- onNodeClick(node: ThesEntryPagedTreeNode): void;
390
- findLabels(): void;
391
- removeHilites(): void;
392
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThesPagedTreeBrowserComponent, never>;
393
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThesPagedTreeBrowserComponent, "cadmus-thes-paged-tree-browser", never, { "service": { "alias": "service"; "required": false; "isSignal": true; }; }, { "nodePick": "nodePick"; }, never, never, true, never>;
394
- }
395
-
396
230
  declare enum PartBadgeType {
397
231
  partAndRole = 0,
398
232
  partOnly = 1,
@@ -461,68 +295,6 @@ declare class PartBadgeComponent {
461
295
  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>;
462
296
  }
463
297
 
464
- /**
465
- * A filter to be used for thesaurus paged tree browsers.
466
- */
467
- declare class ThesPagedTreeFilterComponent implements OnInit {
468
- readonly dialogRef: MatDialogRef<ThesPagedTreeFilterComponent, any> | null;
469
- readonly data: any;
470
- /**
471
- * The filter.
472
- */
473
- readonly filter: _angular_core.ModelSignal<ThesEntryNodeFilter | null | undefined>;
474
- readonly wrapped: _angular_core.WritableSignal<boolean>;
475
- label: FormControl<string | null>;
476
- form: FormGroup;
477
- constructor();
478
- ngOnInit(): void;
479
- private updateForm;
480
- private getFilter;
481
- reset(): void;
482
- apply(): void;
483
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThesPagedTreeFilterComponent, never>;
484
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThesPagedTreeFilterComponent, "cadmus-thes-paged-tree-filter", never, { "filter": { "alias": "filter"; "required": false; "isSignal": true; }; }, { "filter": "filterChange"; }, never, never, true, never>;
485
- }
486
-
487
- /**
488
- * Thesaurus tree component.
489
- * This component displays a set of hierarchical thesaurus entries
490
- * in a tree, provided that each entry marks its hierarchy with
491
- * dots. For instance, say you have the hierarchy "furniture" -
492
- * "type" - "color". You might have an entry whose ID is
493
- * "furniture.table.red", with a sibling "furniture.table.green",
494
- * and a parent "furniture.table". This parent is there only to
495
- * provide a label to the parent node, but only leaf nodes can be
496
- * picked by the user. Whenever one is picked, the entryChange
497
- * event is emitted. Note that even if you specify a label renderer
498
- * function, the event always emits the original label.
499
- */
500
- declare class ThesaurusTreeComponent {
501
- /**
502
- * The thesaurus entries.
503
- */
504
- readonly entries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
505
- /**
506
- * The optional node label rendering function.
507
- */
508
- readonly renderLabel: _angular_core.InputSignal<(label: string) => string>;
509
- /**
510
- * Fired when a thesaurus entry is selected.
511
- */
512
- readonly entryChange: _angular_core.OutputEmitterRef<ThesaurusEntry>;
513
- /**
514
- * The tree store service, dependent on the current entries and renderLabel.
515
- */
516
- readonly service: _angular_core.Signal<StaticThesPagedTreeStoreService>;
517
- /**
518
- * The filter component class to use.
519
- */
520
- readonly filterComponent: Type<ThesPagedTreeFilterComponent>;
521
- onNodePick(node: ThesEntryPagedTreeNode): void;
522
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThesaurusTreeComponent, never>;
523
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThesaurusTreeComponent, "cadmus-thesaurus-tree", never, { "entries": { "alias": "entries"; "required": false; "isSignal": true; }; "renderLabel": { "alias": "renderLabel"; "required": false; "isSignal": true; }; }, { "entryChange": "entryChange"; }, never, never, true, never>;
524
- }
525
-
526
298
  /**
527
299
  * Base class for part/fragment editors dumb components.
528
300
  * The model type is the templated argument T.
@@ -727,5 +499,5 @@ declare const extractTouchedChanges: (control: ObjectLike<AbstractControl, "mark
727
499
  */
728
500
  declare const extractPristineChanges: (control: ObjectLike<AbstractControl, "markAsPristine" | "markAsDirty">) => Observable<boolean>;
729
501
 
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 };
731
- export type { ArgumentsType, FacetBadgeData, FlagsBadgeData, ThesEntryNodeFilter, ThesEntryPagedTreeNode, ThesaurusEntry, UserWithRoles };
502
+ export { CloseSaveButtonsComponent, ColorService, CustomValidators, DecoratedTokenTextComponent, ErrorListComponent, FacetBadgeComponent, FlagsBadgeComponent, JsonValidators, LayerHintsComponent, LookupPinComponent, ModelEditorComponentBase, PartBadgeComponent, PartBadgeType, UserRefLookupService, extractPristineChanges, extractTouchedChanges, getPartIdName };
503
+ export type { ArgumentsType, FacetBadgeData, FlagsBadgeData, UserWithRoles };