@arsedizioni/ars-utils 22.5.47 → 22.5.49
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/arsedizioni-ars-utils-ui.dialogs.auth.mjs +6 -3
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +100 -14
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-ui.d.ts +31 -2
- package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +2 -0
- package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +49 -3
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Searchable, INode,
|
|
1
|
+
import { Searchable, INode, SearchBag, DateInterval, NameValueItem } from '@arsedizioni/ars-utils/core';
|
|
2
2
|
import { MatFormFieldAppearance } from '@angular/material/form-field';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
4
|
import { TemplateRef, InjectionToken, Signal, ElementRef, Renderer2 } from '@angular/core';
|
|
@@ -111,6 +111,35 @@ interface SelectDialogData {
|
|
|
111
111
|
searchLabel?: string;
|
|
112
112
|
searchButtonLabel?: string;
|
|
113
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Data of `ListDialogComponent`: the read-only sibling of {@link SelectDialogData}.
|
|
116
|
+
*
|
|
117
|
+
* It carries no `can*` flag on purpose — the dialog shows a searchable list and closes, so there
|
|
118
|
+
* is nothing to enable — and no `mustSelect` / `okCaption` either, because there is no
|
|
119
|
+
* confirmation step to gate.
|
|
120
|
+
*/
|
|
121
|
+
interface ListDialogData {
|
|
122
|
+
/** Dialog title, rendered as HTML. */
|
|
123
|
+
title: string;
|
|
124
|
+
/** Optional description shown under the title, rendered as HTML. */
|
|
125
|
+
description?: string;
|
|
126
|
+
/** Optional header shown above the list, rendered as HTML. Hidden while the list is empty. */
|
|
127
|
+
header?: string;
|
|
128
|
+
/** Items to display. */
|
|
129
|
+
items?: SelectableItem[];
|
|
130
|
+
/** Initial search text. */
|
|
131
|
+
filter?: string;
|
|
132
|
+
/** Message shown in place of the list when there is nothing to display. Rendered as HTML. */
|
|
133
|
+
emptyMessage?: string;
|
|
134
|
+
/** Caption of the close button, which is always available. Defaults to `Chiudi`. */
|
|
135
|
+
closeCaption?: string;
|
|
136
|
+
/** Label of the search field. Defaults to `Cerca...`. */
|
|
137
|
+
searchLabel?: string;
|
|
138
|
+
/** Appearance of the search field. Defaults to `outline`. */
|
|
139
|
+
appearance?: MatFormFieldAppearance;
|
|
140
|
+
/** Preferred dialog width, in pixels, for the caller that opens it. */
|
|
141
|
+
width?: number;
|
|
142
|
+
}
|
|
114
143
|
interface SelectTreeDialogData {
|
|
115
144
|
title: string;
|
|
116
145
|
description?: string;
|
|
@@ -910,4 +939,4 @@ declare class FlexLayoutModule {
|
|
|
910
939
|
}
|
|
911
940
|
|
|
912
941
|
export { ALIAS_FAMILIES, BS5_BREAKPOINTS, CANONICAL_ALIASES, FlexLayoutModule, FxClassDirective, FxFlexAlignDirective, FxFlexDirective, FxFlexFillDirective, FxFlexOffsetDirective, FxFlexOrderDirective, FxGridAreaDirective, FxGridColumnDirective, FxGridDirective, FxLayoutAlignDirective, FxLayoutDirective, FxLayoutGapDirective, FxLayoutWrapDirective, FxShowHideDirective, FxStyleDirective, IfBpDirective, ItemNode, LAYOUT_BREAKPOINTS, LAYOUT_VALUES, MediaObserver, NON_CANONICAL_PRIORITY, PromptDialogType, ResponsiveBaseDirective, SelectableItem, SelectableNode, UIService, applyVisibility, buildAlignStyles, buildFlexStyles, buildLayoutCSS, resolve, resolveAll, resolveFlexInput, resolveNonCanonical, resolveParentFlow, validateBasis, validateLayoutValue, validateWrapValue };
|
|
913
|
-
export type { BpValues, BreakpointAlias, CanonicalKey, CredentialsDialogResult, DialogOption, DialogResult, ISelectableItem, ISendToDialog, NcValues, NonCanonicalKey, PromptDateDialogResult, PromptDialogData, PromptDialogResult, PromptOtpDialogResult, PromptTimeDialogData, RecoverPasswordDialogResult, ResetPasswordDialogResult, SelectDialogAppend, SelectDialogData, SelectDialogDelete, SelectDialogEdit, SelectDialogFilter, SelectDialogLookup, SelectDialogResult, SelectFile, SelectFileDialogData, SelectFileOption, SelectPictureFileDialogData, SelectTreeDialogData, SelectTreeDialogResult, SelectableFilter, SendToDialogResult, SendToPopulateData };
|
|
942
|
+
export type { BpValues, BreakpointAlias, CanonicalKey, CredentialsDialogResult, DialogOption, DialogResult, ISelectableItem, ISendToDialog, ListDialogData, NcValues, NonCanonicalKey, PromptDateDialogResult, PromptDialogData, PromptDialogResult, PromptOtpDialogResult, PromptTimeDialogData, RecoverPasswordDialogResult, ResetPasswordDialogResult, SelectDialogAppend, SelectDialogData, SelectDialogDelete, SelectDialogEdit, SelectDialogFilter, SelectDialogLookup, SelectDialogResult, SelectFile, SelectFileDialogData, SelectFileOption, SelectPictureFileDialogData, SelectTreeDialogData, SelectTreeDialogResult, SelectableFilter, SendToDialogResult, SendToPopulateData };
|
|
@@ -122,6 +122,7 @@ interface CredentialsDialogData {
|
|
|
122
122
|
user?: string;
|
|
123
123
|
okCaption?: string;
|
|
124
124
|
mode?: 'email' | 'user' | 'otp';
|
|
125
|
+
maxLength?: number;
|
|
125
126
|
appearance?: MatFormFieldAppearance;
|
|
126
127
|
}
|
|
127
128
|
/**
|
|
@@ -197,6 +198,7 @@ declare class CredentialsDialogComponent {
|
|
|
197
198
|
type ResetPasswordDialogMode = 'admin' | 'old' | 'otp' | 'forgot';
|
|
198
199
|
interface ResetPasswordDialogData {
|
|
199
200
|
mode: ResetPasswordDialogMode;
|
|
201
|
+
maxLength?: number;
|
|
200
202
|
userId?: number;
|
|
201
203
|
userEmail?: string;
|
|
202
204
|
appearance?: MatFormFieldAppearance;
|
|
@@ -1,16 +1,62 @@
|
|
|
1
1
|
import * as _angular_forms_signals from '@angular/forms/signals';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
3
|
import { OnDestroy } from '@angular/core';
|
|
4
|
+
import { SearchFilterMetadata } from '@arsedizioni/ars-utils/core';
|
|
5
|
+
import { ListDialogData, SelectableItem, SelectDialogData, SelectDialogResult, SelectDialogEdit, SelectDialogAppend, SelectDialogDelete, SelectDialogLookup, SelectDialogFilter, SelectableFilter, ItemNode, SelectTreeDialogResult, SelectTreeDialogData, ISendToDialog, SendToDialogResult, SendToPopulateData } from '@arsedizioni/ars-utils/ui';
|
|
4
6
|
import { MatCheckboxChange } from '@angular/material/checkbox';
|
|
5
7
|
import { MatSelectionList, MatSelectionListChange } from '@angular/material/list';
|
|
6
8
|
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
|
7
|
-
import { SearchFilterMetadata } from '@arsedizioni/ars-utils/core';
|
|
8
|
-
import { SelectDialogData, SelectDialogResult, SelectDialogEdit, SelectableItem, SelectDialogAppend, SelectDialogDelete, SelectDialogLookup, SelectDialogFilter, SelectableFilter, ItemNode, SelectTreeDialogResult, SelectTreeDialogData, ISendToDialog, SendToDialogResult, SendToPopulateData } from '@arsedizioni/ars-utils/ui';
|
|
9
9
|
import * as rxjs from 'rxjs';
|
|
10
10
|
import { MatTree } from '@angular/material/tree';
|
|
11
11
|
import { MatFormFieldAppearance } from '@angular/material/form-field';
|
|
12
12
|
import { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Read-only counterpart of `SelectDialogComponent`: it shows a list of items with a search box
|
|
16
|
+
* and nothing else.
|
|
17
|
+
*
|
|
18
|
+
* Deliberately not a selection: the list is a plain `mat-list`, not a `mat-selection-list`, so
|
|
19
|
+
* there is no selected state to read, no `done` payload and no Ok / Annulla pair — closing is the
|
|
20
|
+
* only way out and it is always available. It carries no add / edit / delete affordance either:
|
|
21
|
+
* a dialog that cannot change anything is the whole point, and a caller that needs commands wants
|
|
22
|
+
* `SelectDialogComponent` instead.
|
|
23
|
+
*
|
|
24
|
+
* Filtering is client-side, through the same `search` pipe the select dialog uses on its local
|
|
25
|
+
* items. There is no server-side lookup: paging a list nobody can act on would buy nothing.
|
|
26
|
+
*/
|
|
27
|
+
declare class ListDialogComponent {
|
|
28
|
+
private readonly cdr;
|
|
29
|
+
protected readonly dialogData: _angular_core.WritableSignal<ListDialogData>;
|
|
30
|
+
/** Items currently on screen. Seeded from the dialog data and replaceable through {@link setItems}. */
|
|
31
|
+
protected readonly items: _angular_core.WritableSignal<SelectableItem[]>;
|
|
32
|
+
/** Counters written by the `search` pipe while it filters, read back by the footer. */
|
|
33
|
+
protected filterMetadata: SearchFilterMetadata;
|
|
34
|
+
/** Current search text. */
|
|
35
|
+
protected readonly filterText: _angular_core.WritableSignal<string>;
|
|
36
|
+
/** Root signal form bound to the search input. */
|
|
37
|
+
protected readonly filterForm: _angular_forms_signals.FieldTree<string, string | number, "writable">;
|
|
38
|
+
/**
|
|
39
|
+
* Replaces the items on screen, for a caller that fills the list after opening the dialog or
|
|
40
|
+
* refreshes it while it is open.
|
|
41
|
+
* @param items - The new items to display; an empty array clears the list.
|
|
42
|
+
*/
|
|
43
|
+
setItems(items: SelectableItem[]): void;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the search text programmatically.
|
|
46
|
+
* @param text - The new search string to apply.
|
|
47
|
+
*/
|
|
48
|
+
setFilter(text: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the current search text.
|
|
51
|
+
* @returns The active search string.
|
|
52
|
+
*/
|
|
53
|
+
getFilter(): string;
|
|
54
|
+
/** Clears the search text, restoring the whole list. */
|
|
55
|
+
protected clearFilter(): void;
|
|
56
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListDialogComponent, never>;
|
|
57
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ListDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
58
|
+
}
|
|
59
|
+
|
|
14
60
|
declare class SelectDialogComponent {
|
|
15
61
|
readonly paginator: _angular_core.Signal<MatPaginator>;
|
|
16
62
|
readonly selection: _angular_core.Signal<MatSelectionList>;
|
|
@@ -345,5 +391,5 @@ declare class SendToDialogComponent implements ISendToDialog {
|
|
|
345
391
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SendToDialogComponent, "ng-component", never, {}, { "done": "done"; "populate": "populate"; }, never, never, true, never>;
|
|
346
392
|
}
|
|
347
393
|
|
|
348
|
-
export { SelectDialogComponent, SelectTreeDialogComponent, SendToDialogComponent, TreeDataSource };
|
|
394
|
+
export { ListDialogComponent, SelectDialogComponent, SelectTreeDialogComponent, SendToDialogComponent, TreeDataSource };
|
|
349
395
|
export type { SelectTreeDialogAppend, SendToDialogData };
|