@myrmidon/cadmus-ui 15.0.0 → 15.1.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/fesm2022/myrmidon-cadmus-ui.mjs +425 -212
- package/fesm2022/myrmidon-cadmus-ui.mjs.map +1 -1
- package/index.d.ts +132 -57
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { OnInit, ElementRef, OnDestroy } from '@angular/core';
|
|
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,
|
|
4
|
+
import { TokenLocation, TextLayerService, FacetDefinition, FlagDefinition, LayerHint, DataPinInfo, IndexLookupDefinitions, Thesaurus, PartTypeIds, Part, Fragment, PartIdentity, FragmentIdentity, EditedObject } from '@myrmidon/cadmus-core';
|
|
5
5
|
import { DialogService } from '@myrmidon/ngx-mat-tools';
|
|
6
6
|
import { Observable, BehaviorSubject } from 'rxjs';
|
|
7
7
|
import { ItemService, FacetService, UserService } from '@myrmidon/cadmus-api';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { PagedTreeStoreService, TreeNodeFilter, PagedTreeNode, PagedTreeStore, PageChangeRequest } from '@myrmidon/paged-data-browsers';
|
|
9
|
+
import { DataPage } from '@myrmidon/ngx-tools';
|
|
10
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
10
11
|
import { AuthJwtService, User } from '@myrmidon/auth-jwt-login';
|
|
11
12
|
import { AppRepository } from '@myrmidon/cadmus-state';
|
|
12
13
|
import { RefLookupService, RefLookupFilter } from '@myrmidon/cadmus-refs-lookup';
|
|
@@ -228,6 +229,98 @@ declare class LookupPinComponent implements OnInit {
|
|
|
228
229
|
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>;
|
|
229
230
|
}
|
|
230
231
|
|
|
232
|
+
interface ThesaurusEntry {
|
|
233
|
+
id: string;
|
|
234
|
+
value: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* The filter for thesaurus entry nodes. The only filtered property is
|
|
238
|
+
* the node's label.
|
|
239
|
+
*/
|
|
240
|
+
interface ThesEntryNodeFilter extends TreeNodeFilter {
|
|
241
|
+
label?: string;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The tree node for thesaurus entries in a paging tree node.
|
|
245
|
+
*/
|
|
246
|
+
interface ThesEntryPagedTreeNode extends PagedTreeNode<ThesEntryNodeFilter> {
|
|
247
|
+
key: string;
|
|
248
|
+
value: string;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* A label rendering function which removes from a label
|
|
252
|
+
* all the characters past the last colon, trimming the result.
|
|
253
|
+
* This is a typical rendering when dealing with hierarchical
|
|
254
|
+
* thesaurus entries, e.g. "furniture: table: color", where
|
|
255
|
+
* we can shorten the label to just "color", as "furniture"
|
|
256
|
+
* and "table" are its ancestors.
|
|
257
|
+
*/
|
|
258
|
+
declare const renderLabelFromLastColon: (label: string) => string;
|
|
259
|
+
/**
|
|
260
|
+
* A static paged tree store service for thesaurus entries.
|
|
261
|
+
* This builds the tree nodes from the thesaurus entries, assuming
|
|
262
|
+
* that entry IDs are hierarchical and separated by dots (.).
|
|
263
|
+
*/
|
|
264
|
+
declare class StaticThesPagedTreeStoreService implements PagedTreeStoreService<ThesEntryNodeFilter> {
|
|
265
|
+
private _renderLabel?;
|
|
266
|
+
private _nodes;
|
|
267
|
+
private _built;
|
|
268
|
+
private readonly _entries;
|
|
269
|
+
constructor(entries: ThesaurusEntry[], _renderLabel?: ((label: string) => string) | undefined);
|
|
270
|
+
private ensureNodes;
|
|
271
|
+
/**
|
|
272
|
+
* Get the specified page of nodes.
|
|
273
|
+
* @param filter The filter.
|
|
274
|
+
* @param pageNumber The page number.
|
|
275
|
+
* @param pageSize The page size.
|
|
276
|
+
* @param hasMockRoot Whether the root node is a mock node. Not used here.
|
|
277
|
+
*/
|
|
278
|
+
getNodes(filter: ThesEntryNodeFilter, pageNumber: number, pageSize: number, hasMockRoot?: boolean): Observable<DataPage<ThesEntryPagedTreeNode>>;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare class ThesPagedTreeBrowserComponent implements OnInit, OnDestroy {
|
|
282
|
+
private _dialog;
|
|
283
|
+
private _sub?;
|
|
284
|
+
/**
|
|
285
|
+
* The service to use to load the nodes.
|
|
286
|
+
*/
|
|
287
|
+
readonly service: _angular_core.InputSignal<StaticThesPagedTreeStoreService>;
|
|
288
|
+
/**
|
|
289
|
+
* Emitted when a node is clicked.
|
|
290
|
+
*/
|
|
291
|
+
readonly nodePick: _angular_core.OutputEmitterRef<ThesEntryPagedTreeNode>;
|
|
292
|
+
/**
|
|
293
|
+
* The store instance, built from the service.
|
|
294
|
+
*/
|
|
295
|
+
readonly store: _angular_core.Signal<PagedTreeStore<ThesEntryPagedTreeNode, ThesEntryNodeFilter>>;
|
|
296
|
+
readonly loading: _angular_core.WritableSignal<boolean>;
|
|
297
|
+
debug: FormControl<boolean>;
|
|
298
|
+
hideLoc: FormControl<boolean>;
|
|
299
|
+
hideFilter: FormControl<boolean>;
|
|
300
|
+
filter$: Observable<Readonly<ThesEntryNodeFilter>>;
|
|
301
|
+
nodes$: Observable<Readonly<ThesEntryPagedTreeNode[]>>;
|
|
302
|
+
label: FormControl<string | null>;
|
|
303
|
+
form: FormGroup<{
|
|
304
|
+
label: FormControl<string | null>;
|
|
305
|
+
}>;
|
|
306
|
+
constructor();
|
|
307
|
+
ngOnInit(): void;
|
|
308
|
+
ngOnDestroy(): void;
|
|
309
|
+
reset(): void;
|
|
310
|
+
onToggleExpanded(node: ThesEntryPagedTreeNode): void;
|
|
311
|
+
onPageChangeRequest(request: PageChangeRequest): void;
|
|
312
|
+
onFilterChange(filter: ThesEntryNodeFilter | null | undefined): void;
|
|
313
|
+
onEditFilterRequest(node: ThesEntryPagedTreeNode): void;
|
|
314
|
+
expandAll(): void;
|
|
315
|
+
collapseAll(): void;
|
|
316
|
+
clear(): void;
|
|
317
|
+
onNodeClick(node: ThesEntryPagedTreeNode): void;
|
|
318
|
+
findLabels(): void;
|
|
319
|
+
removeHilites(): void;
|
|
320
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThesPagedTreeBrowserComponent, never>;
|
|
321
|
+
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>;
|
|
322
|
+
}
|
|
323
|
+
|
|
231
324
|
declare enum PartBadgeType {
|
|
232
325
|
partAndRole = 0,
|
|
233
326
|
partOnly = 1,
|
|
@@ -286,23 +379,29 @@ declare class PartBadgeComponent {
|
|
|
286
379
|
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>;
|
|
287
380
|
}
|
|
288
381
|
|
|
289
|
-
interface TreeNode {
|
|
290
|
-
id: string;
|
|
291
|
-
label: string;
|
|
292
|
-
originalLabel?: string;
|
|
293
|
-
parent?: TreeNode;
|
|
294
|
-
children?: TreeNode[];
|
|
295
|
-
clickable?: boolean;
|
|
296
|
-
}
|
|
297
382
|
/**
|
|
298
|
-
* A
|
|
299
|
-
* all the characters past the last colon, trimming the result.
|
|
300
|
-
* This is a typical rendering when dealing with hierarchical
|
|
301
|
-
* thesaurus entries, e.g. "furniture: table: color", where
|
|
302
|
-
* we can shorten the label to just "color", as "furniture"
|
|
303
|
-
* and "table" are its ancestors.
|
|
383
|
+
* A filter to be used for thesaurus paged tree browsers.
|
|
304
384
|
*/
|
|
305
|
-
declare
|
|
385
|
+
declare class ThesPagedTreeFilterComponent implements OnInit {
|
|
386
|
+
readonly dialogRef: MatDialogRef<ThesPagedTreeFilterComponent, any> | null;
|
|
387
|
+
readonly data: any;
|
|
388
|
+
/**
|
|
389
|
+
* The filter.
|
|
390
|
+
*/
|
|
391
|
+
readonly filter: _angular_core.ModelSignal<ThesEntryNodeFilter | null | undefined>;
|
|
392
|
+
readonly wrapped: _angular_core.WritableSignal<boolean>;
|
|
393
|
+
label: FormControl<string | null>;
|
|
394
|
+
form: FormGroup;
|
|
395
|
+
constructor();
|
|
396
|
+
ngOnInit(): void;
|
|
397
|
+
private updateForm;
|
|
398
|
+
private getFilter;
|
|
399
|
+
reset(): void;
|
|
400
|
+
apply(): void;
|
|
401
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThesPagedTreeFilterComponent, never>;
|
|
402
|
+
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>;
|
|
403
|
+
}
|
|
404
|
+
|
|
306
405
|
/**
|
|
307
406
|
* Thesaurus tree component.
|
|
308
407
|
* This component displays a set of hierarchical thesaurus entries
|
|
@@ -316,54 +415,30 @@ declare const renderLabelFromLastColon: (label: string) => string;
|
|
|
316
415
|
* event is emitted. Note that even if you specify a label renderer
|
|
317
416
|
* function, the event always emits the original label.
|
|
318
417
|
*/
|
|
319
|
-
declare class ThesaurusTreeComponent
|
|
418
|
+
declare class ThesaurusTreeComponent {
|
|
320
419
|
/**
|
|
321
420
|
* The thesaurus entries.
|
|
322
421
|
*/
|
|
323
422
|
readonly entries: _angular_core.InputSignal<ThesaurusEntry[] | undefined>;
|
|
324
|
-
/**
|
|
325
|
-
* The label for the root node.
|
|
326
|
-
*/
|
|
327
|
-
readonly rootLabel: _angular_core.InputSignal<string>;
|
|
328
423
|
/**
|
|
329
424
|
* The optional node label rendering function.
|
|
330
425
|
*/
|
|
331
|
-
readonly renderLabel: _angular_core.InputSignal<(
|
|
426
|
+
readonly renderLabel: _angular_core.InputSignal<(label: string) => string>;
|
|
332
427
|
/**
|
|
333
428
|
* Fired when a thesaurus entry is selected.
|
|
334
429
|
*/
|
|
335
430
|
readonly entryChange: _angular_core.OutputEmitterRef<ThesaurusEntry>;
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
ngOnInit(): void;
|
|
346
|
-
private initTree;
|
|
347
|
-
private getLabel;
|
|
348
|
-
private addNode;
|
|
349
|
-
/**
|
|
350
|
-
* Build a tree model from a list of name=value pairs,
|
|
351
|
-
* where each value can include one or more components separated by
|
|
352
|
-
* the specified separator.
|
|
353
|
-
* @param entries The entries to add.
|
|
354
|
-
* @param separator string The separator string to use for values.
|
|
355
|
-
*/
|
|
356
|
-
buildTreeModel(entries: ThesaurusEntry[], separator?: string): TreeNode;
|
|
357
|
-
onTreeNodeClick(node: TreeNode): void;
|
|
358
|
-
expandAll(): void;
|
|
359
|
-
collapseAll(): void;
|
|
360
|
-
private expandFromNode;
|
|
361
|
-
private expandMatchingNodes;
|
|
362
|
-
find(): void;
|
|
363
|
-
resetFilter(): void;
|
|
364
|
-
isFoundNode(node: TreeNode): boolean;
|
|
431
|
+
/**
|
|
432
|
+
* The tree store service, dependent on the current entries and renderLabel.
|
|
433
|
+
*/
|
|
434
|
+
readonly service: _angular_core.Signal<StaticThesPagedTreeStoreService>;
|
|
435
|
+
/**
|
|
436
|
+
* The filter component class to use.
|
|
437
|
+
*/
|
|
438
|
+
readonly filterComponent: Type<ThesPagedTreeFilterComponent>;
|
|
439
|
+
onNodePick(node: ThesEntryPagedTreeNode): void;
|
|
365
440
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThesaurusTreeComponent, never>;
|
|
366
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThesaurusTreeComponent, "cadmus-thesaurus-tree", never, { "entries": { "alias": "entries"; "required": false; "isSignal": true; }; "
|
|
441
|
+
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>;
|
|
367
442
|
}
|
|
368
443
|
|
|
369
444
|
/**
|
|
@@ -570,5 +645,5 @@ declare const extractTouchedChanges: (control: ObjectLike<AbstractControl, "mark
|
|
|
570
645
|
*/
|
|
571
646
|
declare const extractPristineChanges: (control: ObjectLike<AbstractControl, "markAsPristine" | "markAsDirty">) => Observable<boolean>;
|
|
572
647
|
|
|
573
|
-
export { CloseSaveButtonsComponent, ColorService, CustomValidators, DecoratedTokenTextComponent, ErrorListComponent, FacetBadgeComponent, FlagsBadgeComponent, JsonValidators, LayerHintsComponent, LookupPinComponent, ModelEditorComponentBase, PartBadgeComponent, PartBadgeType, ThesaurusTreeComponent, UserRefLookupService, extractPristineChanges, extractTouchedChanges, getPartIdName, renderLabelFromLastColon };
|
|
574
|
-
export type { ArgumentsType, FacetBadgeData, FlagsBadgeData, UserWithRoles };
|
|
648
|
+
export { CloseSaveButtonsComponent, ColorService, CustomValidators, DecoratedTokenTextComponent, ErrorListComponent, FacetBadgeComponent, FlagsBadgeComponent, JsonValidators, LayerHintsComponent, LookupPinComponent, ModelEditorComponentBase, PartBadgeComponent, PartBadgeType, StaticThesPagedTreeStoreService, ThesPagedTreeBrowserComponent, ThesaurusTreeComponent, UserRefLookupService, extractPristineChanges, extractTouchedChanges, getPartIdName, renderLabelFromLastColon };
|
|
649
|
+
export type { ArgumentsType, FacetBadgeData, FlagsBadgeData, ThesEntryNodeFilter, ThesEntryPagedTreeNode, ThesaurusEntry, UserWithRoles };
|