@arsedizioni/ars-utils 22.1.5 → 22.5.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/README.md +158 -10
- package/clipper.ui/clipper.scss +564 -0
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +11 -7
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs +609 -0
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs +591 -0
- package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-core.mjs +270 -1449
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +1 -1
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs +1 -1
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.application.mjs +14 -4108
- package/fesm2022/arsedizioni-ars-utils-ui.application.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +962 -0
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +506 -0
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +450 -0
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +184 -0
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +825 -0
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +708 -0
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs +426 -0
- package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.help.mjs +531 -0
- package/fesm2022/arsedizioni-ars-utils-ui.help.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.mjs +54 -1227
- package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs +1049 -0
- package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs +263 -0
- package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +4 -3
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs +53 -0
- package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +517 -0
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs +246 -0
- package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils.mjs +13 -12
- package/fesm2022/arsedizioni-ars-utils.mjs.map +1 -1
- package/help/package.json +4 -0
- package/package.json +80 -14
- package/styles/ui.colors.scss +23 -0
- package/support.ui/package.json +4 -0
- package/tinymce/package.json +4 -0
- package/types/arsedizioni-ars-utils-clipper.common.d.ts +1 -2
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +4 -1
- package/types/arsedizioni-ars-utils-core.d.ts +684 -1004
- package/types/arsedizioni-ars-utils-core.date.d.ts +304 -0
- package/types/arsedizioni-ars-utils-core.markdown.d.ts +159 -0
- package/types/arsedizioni-ars-utils-ui.application.d.ts +10 -2022
- package/types/arsedizioni-ars-utils-ui.controls.d.ts +413 -0
- package/types/arsedizioni-ars-utils-ui.d.ts +183 -566
- package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +224 -0
- package/types/arsedizioni-ars-utils-ui.dialogs.d.ts +228 -0
- package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts +47 -0
- package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +309 -0
- package/types/arsedizioni-ars-utils-ui.files.d.ts +271 -0
- package/types/arsedizioni-ars-utils-ui.filters.d.ts +163 -0
- package/types/arsedizioni-ars-utils-ui.help.d.ts +220 -0
- package/types/arsedizioni-ars-utils-ui.navigation.d.ts +650 -0
- package/types/arsedizioni-ars-utils-ui.notifications.d.ts +73 -0
- package/types/arsedizioni-ars-utils-ui.paginator.d.ts +23 -0
- package/types/arsedizioni-ars-utils-ui.shell.d.ts +345 -0
- package/types/arsedizioni-ars-utils-ui.tinymce.d.ts +63 -0
- package/types/arsedizioni-ars-utils.d.ts +4 -10
- package/ui.tinymce/README.md +12 -0
- package/ui.tinymce/langs/it.js +466 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnDestroy } from '@angular/core';
|
|
3
|
+
import { MatCheckboxChange } from '@angular/material/checkbox';
|
|
4
|
+
import { MatSelectionList, MatSelectionListChange } from '@angular/material/list';
|
|
5
|
+
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
|
6
|
+
import { SearchFilterMetadata } from '@arsedizioni/ars-utils/core';
|
|
7
|
+
import { SelectDialogData, SelectDialogResult, SelectDialogEdit, SelectableItem, SelectDialogAppend, SelectDialogDelete, SelectDialogLookup, SelectDialogFilter, SelectableFilter, ItemNode, SelectTreeDialogResult, SelectTreeDialogData, ISendToDialog, SendToDialogResult, SendToPopulateData } from '@arsedizioni/ars-utils/ui';
|
|
8
|
+
import * as rxjs from 'rxjs';
|
|
9
|
+
import { MatTree } from '@angular/material/tree';
|
|
10
|
+
import { MatFormFieldAppearance } from '@angular/material/form-field';
|
|
11
|
+
|
|
12
|
+
declare class SelectDialogComponent {
|
|
13
|
+
readonly paginator: _angular_core.Signal<MatPaginator>;
|
|
14
|
+
readonly selection: _angular_core.Signal<MatSelectionList>;
|
|
15
|
+
private isViewReady;
|
|
16
|
+
private readonly dialogRef;
|
|
17
|
+
private readonly cdr;
|
|
18
|
+
protected readonly dialogData: _angular_core.WritableSignal<SelectDialogData>;
|
|
19
|
+
readonly done: _angular_core.OutputEmitterRef<SelectDialogResult>;
|
|
20
|
+
readonly edit: _angular_core.OutputEmitterRef<SelectDialogEdit>;
|
|
21
|
+
readonly view: _angular_core.OutputEmitterRef<SelectableItem>;
|
|
22
|
+
readonly append: _angular_core.OutputEmitterRef<SelectDialogAppend>;
|
|
23
|
+
readonly delete: _angular_core.OutputEmitterRef<SelectDialogDelete>;
|
|
24
|
+
readonly lookup: _angular_core.OutputEmitterRef<SelectDialogLookup>;
|
|
25
|
+
readonly lookupOptions: _angular_core.OutputEmitterRef<void>;
|
|
26
|
+
readonly filter: _angular_core.OutputEmitterRef<SelectDialogFilter>;
|
|
27
|
+
protected canEdit: _angular_core.WritableSignal<boolean>;
|
|
28
|
+
protected canView: _angular_core.WritableSignal<boolean>;
|
|
29
|
+
protected canAppend: _angular_core.WritableSignal<boolean>;
|
|
30
|
+
protected canDelete: _angular_core.WritableSignal<boolean>;
|
|
31
|
+
protected canPaginate: _angular_core.WritableSignal<boolean>;
|
|
32
|
+
protected okDisabled: _angular_core.WritableSignal<boolean>;
|
|
33
|
+
protected filterMetadata: SearchFilterMetadata;
|
|
34
|
+
protected filterText: string;
|
|
35
|
+
protected readonly filterOptions: _angular_core.WritableSignal<SelectableFilter[]>;
|
|
36
|
+
protected filterOptionsInfo: _angular_core.WritableSignal<string>;
|
|
37
|
+
protected lookupField: string;
|
|
38
|
+
private lookupParams?;
|
|
39
|
+
protected selectionInfo: _angular_core.WritableSignal<string>;
|
|
40
|
+
protected selectionMasterIndeterminate: _angular_core.WritableSignal<boolean>;
|
|
41
|
+
protected selectionMasterChecked: _angular_core.WritableSignal<boolean>;
|
|
42
|
+
protected total: _angular_core.WritableSignal<number>;
|
|
43
|
+
constructor();
|
|
44
|
+
/**
|
|
45
|
+
* Updates the total item count signal, triggering UI refresh.
|
|
46
|
+
* @param newTotal - The new total count; defaults to 0 if omitted.
|
|
47
|
+
*/
|
|
48
|
+
notifyChanges(newTotal?: number): void;
|
|
49
|
+
/** Returns `true` when every list item is currently selected. */
|
|
50
|
+
private isAllSelected;
|
|
51
|
+
/** Returns `true` when at least one list item is selected. */
|
|
52
|
+
private hasSelection;
|
|
53
|
+
/**
|
|
54
|
+
* Selects or deselects all items based on the master checkbox state.
|
|
55
|
+
* @param e - The checkbox change event.
|
|
56
|
+
*/
|
|
57
|
+
protected masterSelectionToggle(e: MatCheckboxChange): void;
|
|
58
|
+
/**
|
|
59
|
+
* Handles selection or deselection of a list item.
|
|
60
|
+
* @param e - The selection list change event.
|
|
61
|
+
*/
|
|
62
|
+
protected select(e: MatSelectionListChange): void;
|
|
63
|
+
/** Refreshes the selection info label shown in the dialog footer. */
|
|
64
|
+
private updateSelectionInfo;
|
|
65
|
+
/** Deselects all items and resets the master checkbox state. */
|
|
66
|
+
clearSelection(): void;
|
|
67
|
+
/** Emits the current selection and closes the dialog. */
|
|
68
|
+
protected ok(): void;
|
|
69
|
+
/** Clears the current filter text input. */
|
|
70
|
+
protected clearFilter(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Sets the filter text programmatically.
|
|
73
|
+
* @param text - The new filter string to apply.
|
|
74
|
+
*/
|
|
75
|
+
setFilter(text: string): void;
|
|
76
|
+
/**
|
|
77
|
+
* Returns the current filter text.
|
|
78
|
+
* @returns The active filter string.
|
|
79
|
+
*/
|
|
80
|
+
getFilter(): string;
|
|
81
|
+
/** Emits the `lookupOptions` output event to open the filter options panel. */
|
|
82
|
+
protected showFilterOptions(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Applies the given text filter, emitting a lookup when enabled.
|
|
85
|
+
* @param text - Optional filter string; populates `filterText` when provided.
|
|
86
|
+
* @param e - Optional keyboard event; lookup only fires on Enter.
|
|
87
|
+
*/
|
|
88
|
+
protected doFilter(text?: string, e?: KeyboardEvent): void;
|
|
89
|
+
/**
|
|
90
|
+
* Applies the current filter text, emitting a lookup event.
|
|
91
|
+
*/
|
|
92
|
+
private applyFilter;
|
|
93
|
+
/**
|
|
94
|
+
* Applies a structured filter option, emitting the filter output event.
|
|
95
|
+
* @param filterOption - The selected filter option object.
|
|
96
|
+
*/
|
|
97
|
+
private applyFilterByOptions;
|
|
98
|
+
/**
|
|
99
|
+
* Applies a structured filter option, emitting the filter output event.
|
|
100
|
+
* @param filterOption - The selected filter option object.
|
|
101
|
+
* @param apply - Optional flag to immediately apply the filter.
|
|
102
|
+
*/
|
|
103
|
+
protected doFilterByOptions(filterOption: any, apply?: boolean): void;
|
|
104
|
+
/**
|
|
105
|
+
* Triggers a server-side lookup with the given parameters (public API).
|
|
106
|
+
* @param params - An object containing the lookup query parameters.
|
|
107
|
+
*/
|
|
108
|
+
doLookup(params: any): void;
|
|
109
|
+
/**
|
|
110
|
+
* Updates the paginator length and resets it to the first page.
|
|
111
|
+
* @param total - The new total number of items.
|
|
112
|
+
*/
|
|
113
|
+
protected updateLookupPaginator(total: number): void;
|
|
114
|
+
/**
|
|
115
|
+
* Handles a paginator page change and triggers a new lookup.
|
|
116
|
+
* @param e - The paginator page change event.
|
|
117
|
+
*/
|
|
118
|
+
protected doLookupPage(e: PageEvent): void;
|
|
119
|
+
/** Emits the `append` output event to open the add-item flow. */
|
|
120
|
+
protected doAppend(): void;
|
|
121
|
+
/** Emits the `edit` output event for the currently selected item. */
|
|
122
|
+
protected doEdit(): void;
|
|
123
|
+
/** Emits the `view` output event for the currently selected item. */
|
|
124
|
+
protected doView(): void;
|
|
125
|
+
/** Emits the `delete` output event with all currently selected items. */
|
|
126
|
+
protected doDelete(): void;
|
|
127
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectDialogComponent, never>;
|
|
128
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectDialogComponent, "ng-component", never, {}, { "done": "done"; "edit": "edit"; "view": "view"; "append": "append"; "delete": "delete"; "lookup": "lookup"; "lookupOptions": "lookupOptions"; "filter": "filter"; }, never, never, true, never>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
declare class TreeDataSource implements OnDestroy {
|
|
132
|
+
private readonly _dataChange;
|
|
133
|
+
readonly dataChange$: rxjs.Observable<ItemNode[]>;
|
|
134
|
+
get data(): ItemNode[];
|
|
135
|
+
ngOnDestroy(): void;
|
|
136
|
+
initialize(data: ItemNode[]): void;
|
|
137
|
+
/**
|
|
138
|
+
* Find a node by id recursively.
|
|
139
|
+
* @param node - The source node to search from, or null to search from root.
|
|
140
|
+
* @param id - The id to search for.
|
|
141
|
+
* @returns The matching node, or undefined if not found.
|
|
142
|
+
*/
|
|
143
|
+
findNode(node: ItemNode | null, id: string): ItemNode | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Remove a node from the tree.
|
|
146
|
+
* @param id - The id of the node to remove.
|
|
147
|
+
*/
|
|
148
|
+
removeNode(id: string): void;
|
|
149
|
+
/**
|
|
150
|
+
* Insert a new node at the top of its parent (or root).
|
|
151
|
+
* @param node - The new node to insert.
|
|
152
|
+
*/
|
|
153
|
+
insertNode(node: ItemNode): void;
|
|
154
|
+
/**
|
|
155
|
+
* Rename a node in the tree.
|
|
156
|
+
* @param id - The id of the node to rename.
|
|
157
|
+
* @param name - The new name for the node.
|
|
158
|
+
* @returns The renamed node, or undefined if not found.
|
|
159
|
+
*/
|
|
160
|
+
renameNode(id: string, name: string): ItemNode | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* Notify all subscribers of the current data state.
|
|
163
|
+
*/
|
|
164
|
+
update(): void;
|
|
165
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeDataSource, never>;
|
|
166
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TreeDataSource>;
|
|
167
|
+
}
|
|
168
|
+
interface SelectTreeDialogAppend {
|
|
169
|
+
parent?: ItemNode;
|
|
170
|
+
owner?: any;
|
|
171
|
+
}
|
|
172
|
+
declare class SelectTreeDialogComponent {
|
|
173
|
+
/** Emitted when the user confirms a selection. */
|
|
174
|
+
readonly done: _angular_core.OutputEmitterRef<SelectTreeDialogResult>;
|
|
175
|
+
/** Emitted when the user requests to append a new node. */
|
|
176
|
+
readonly append: _angular_core.OutputEmitterRef<SelectTreeDialogAppend>;
|
|
177
|
+
private readonly destroyRef;
|
|
178
|
+
private readonly dialogRef;
|
|
179
|
+
/** Dialog configuration, injected and exposed as a signal. */
|
|
180
|
+
protected readonly dialogData: _angular_core.WritableSignal<SelectTreeDialogData>;
|
|
181
|
+
private readonly tree;
|
|
182
|
+
private readonly _elRef;
|
|
183
|
+
/** Reference to the Material tree component. */
|
|
184
|
+
protected readonly matTree: _angular_core.Signal<MatTree<ItemNode, ItemNode>>;
|
|
185
|
+
/** Provides children of a tree node to the tree component. */
|
|
186
|
+
protected readonly childrenAccessor: (node: ItemNode) => ItemNode[];
|
|
187
|
+
/** Root nodes used as the tree data source. */
|
|
188
|
+
protected readonly treeNodes: _angular_core.WritableSignal<ItemNode[]>;
|
|
189
|
+
/** Currently selected tree node. */
|
|
190
|
+
protected readonly currentNode: _angular_core.WritableSignal<ItemNode>;
|
|
191
|
+
/** Current filter text. */
|
|
192
|
+
protected readonly filterText: _angular_core.WritableSignal<string>;
|
|
193
|
+
/** Nodes matching the current filter text. */
|
|
194
|
+
protected readonly filteredItems: _angular_core.WritableSignal<ItemNode[]>;
|
|
195
|
+
/** Index of the currently highlighted filtered node (-1 = none). */
|
|
196
|
+
protected readonly filterIndex: _angular_core.WritableSignal<number>;
|
|
197
|
+
/** The currently highlighted filtered node, or null. */
|
|
198
|
+
protected readonly filteredNode: _angular_core.Signal<ItemNode>;
|
|
199
|
+
protected readonly canAppend: _angular_core.WritableSignal<boolean>;
|
|
200
|
+
/** Flat node map rebuilt whenever treeNodes changes. */
|
|
201
|
+
private readonly _nodeMap;
|
|
202
|
+
protected hasChild: (_: number, node: ItemNode) => boolean;
|
|
203
|
+
constructor();
|
|
204
|
+
/**
|
|
205
|
+
* Confirm the current selection and close the dialog.
|
|
206
|
+
*/
|
|
207
|
+
protected ok(): void;
|
|
208
|
+
/**
|
|
209
|
+
* Toggle selection of a tree node. Clicking the already-selected node deselects it.
|
|
210
|
+
* @param e - The mouse event (propagation is stopped).
|
|
211
|
+
* @param node - The node that was clicked.
|
|
212
|
+
*/
|
|
213
|
+
protected select(e: MouseEvent, node: ItemNode): void;
|
|
214
|
+
/**
|
|
215
|
+
* Clear the active filter text.
|
|
216
|
+
*/
|
|
217
|
+
protected clearFilter(): void;
|
|
218
|
+
/**
|
|
219
|
+
* Filter the tree nodes by name (minimum 3 characters).
|
|
220
|
+
*/
|
|
221
|
+
protected doFilter(): void;
|
|
222
|
+
/**
|
|
223
|
+
* Advance to the next matching filtered node and scroll it into view.
|
|
224
|
+
*/
|
|
225
|
+
protected nextFiltered(): void;
|
|
226
|
+
/**
|
|
227
|
+
* Returns true when the node is the currently highlighted filter match.
|
|
228
|
+
* @param node - tree node to check.
|
|
229
|
+
*/
|
|
230
|
+
protected isFilteredNode(node: ItemNode): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Expands ancestors of the target node and scrolls it into view.
|
|
233
|
+
* @param index - index within `items` to scroll to.
|
|
234
|
+
* @param items - current filtered items array.
|
|
235
|
+
*/
|
|
236
|
+
private _scrollToFiltered;
|
|
237
|
+
/**
|
|
238
|
+
* Expand a node and all of its parent nodes.
|
|
239
|
+
* @param node - The node to expand.
|
|
240
|
+
* @returns Always false.
|
|
241
|
+
*/
|
|
242
|
+
expand(node: ItemNode): boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Recursively find a node by id.
|
|
245
|
+
* @param nodes - Nodes to search.
|
|
246
|
+
* @param id - The id to find.
|
|
247
|
+
*/
|
|
248
|
+
private findInTree;
|
|
249
|
+
/**
|
|
250
|
+
* Append a new node to the tree.
|
|
251
|
+
* @param node - The node to insert.
|
|
252
|
+
*/
|
|
253
|
+
appendNode(node: ItemNode): void;
|
|
254
|
+
/**
|
|
255
|
+
* Collapse all tree nodes and reset the current selection.
|
|
256
|
+
*/
|
|
257
|
+
protected collapseAll(): void;
|
|
258
|
+
/**
|
|
259
|
+
* Expand all tree nodes and scroll to the selected node, if any.
|
|
260
|
+
*/
|
|
261
|
+
protected expandAll(): void;
|
|
262
|
+
/**
|
|
263
|
+
* Emit an append request with the currently selected node as the parent.
|
|
264
|
+
*/
|
|
265
|
+
protected doAppend(): void;
|
|
266
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectTreeDialogComponent, never>;
|
|
267
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectTreeDialogComponent, "ng-component", never, {}, { "done": "done"; "append": "append"; }, never, never, true, never>;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
interface SendToDialogData {
|
|
271
|
+
count: number;
|
|
272
|
+
canPopulate?: boolean;
|
|
273
|
+
title?: string;
|
|
274
|
+
text?: string;
|
|
275
|
+
subject?: string;
|
|
276
|
+
info?: string;
|
|
277
|
+
appearance?: MatFormFieldAppearance;
|
|
278
|
+
options?: any;
|
|
279
|
+
}
|
|
280
|
+
declare class SendToDialogComponent implements ISendToDialog {
|
|
281
|
+
/** Emitted when the user confirms and sends the message. */
|
|
282
|
+
readonly done: _angular_core.OutputEmitterRef<SendToDialogResult>;
|
|
283
|
+
/** Emitted when the user requests to populate the recipient list. */
|
|
284
|
+
readonly populate: _angular_core.OutputEmitterRef<SendToPopulateData>;
|
|
285
|
+
private readonly cdr;
|
|
286
|
+
/** Dialog configuration, injected and exposed as a signal. */
|
|
287
|
+
protected readonly dialogData: _angular_core.WritableSignal<SendToDialogData>;
|
|
288
|
+
/** Form model for the send-to form fields. */
|
|
289
|
+
protected item: SendToDialogResult;
|
|
290
|
+
/**
|
|
291
|
+
* Confirm the form and emit the result.
|
|
292
|
+
*/
|
|
293
|
+
protected ok(): void;
|
|
294
|
+
/**
|
|
295
|
+
* Request the host to populate the recipient list.
|
|
296
|
+
* Only emits if `canPopulate` is enabled in the dialog data.
|
|
297
|
+
*/
|
|
298
|
+
protected populateRecipients(): void;
|
|
299
|
+
/**
|
|
300
|
+
* Update the recipient list from an external caller.
|
|
301
|
+
* @param recipients - The new recipients string (semicolon-separated).
|
|
302
|
+
*/
|
|
303
|
+
updateRecipients(recipients: string): void;
|
|
304
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SendToDialogComponent, never>;
|
|
305
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SendToDialogComponent, "ng-component", never, {}, { "done": "done"; "populate": "populate"; }, never, never, true, never>;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export { SelectDialogComponent, SelectTreeDialogComponent, SendToDialogComponent, TreeDataSource };
|
|
309
|
+
export type { SelectTreeDialogAppend, SendToDialogData };
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnDestroy, DoCheck, ElementRef } from '@angular/core';
|
|
3
|
+
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
4
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
5
|
+
import { FileInfo } from '@arsedizioni/ars-utils/core';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import { SelectFile, SelectFileDialogData, SelectPictureFileDialogData } from '@arsedizioni/ars-utils/ui';
|
|
8
|
+
|
|
9
|
+
declare class FileInputComponent implements OnDestroy, DoCheck, MatFormFieldControl<FileInfo>, ControlValueAccessor {
|
|
10
|
+
ngControl: NgControl;
|
|
11
|
+
/** Reference to the hidden native file input element. */
|
|
12
|
+
protected readonly __file: _angular_core.Signal<ElementRef<any>>;
|
|
13
|
+
private readonly renderer;
|
|
14
|
+
private readonly uiService;
|
|
15
|
+
static nextId: number;
|
|
16
|
+
readonly stateChanges: Subject<void>;
|
|
17
|
+
private previousNativeValue;
|
|
18
|
+
controlType: string;
|
|
19
|
+
focused: boolean;
|
|
20
|
+
/** Whether the device supports camera capture. */
|
|
21
|
+
protected readonly canCapture: _angular_core.WritableSignal<boolean>;
|
|
22
|
+
/** Size in MB of the currently selected file. */
|
|
23
|
+
protected readonly fileSize: _angular_core.WritableSignal<number>;
|
|
24
|
+
private readonly _placeholder;
|
|
25
|
+
private _value;
|
|
26
|
+
set value(value: FileInfo);
|
|
27
|
+
/**
|
|
28
|
+
* Updates the internal state. Form propagation is skipped for model->view
|
|
29
|
+
* writes (writeValue) to avoid the CVA echo loop, and performed for
|
|
30
|
+
* user-driven changes (selectFile/clearFile) and the public value setter.
|
|
31
|
+
* @param value - The new file info to store and display.
|
|
32
|
+
* @param propagate - When `true`, notifies the registered onChange callback.
|
|
33
|
+
*/
|
|
34
|
+
private setValue;
|
|
35
|
+
get value(): FileInfo;
|
|
36
|
+
get size(): any;
|
|
37
|
+
private _required;
|
|
38
|
+
get required(): boolean;
|
|
39
|
+
set required(value: boolean);
|
|
40
|
+
private _disabled;
|
|
41
|
+
get disabled(): boolean;
|
|
42
|
+
set disabled(value: boolean);
|
|
43
|
+
get placeholder(): string;
|
|
44
|
+
set placeholder(value: string);
|
|
45
|
+
/** The currently displayed file name. Can be bound two-way from outside or updated on file selection. */
|
|
46
|
+
readonly fileName: _angular_core.ModelSignal<string>;
|
|
47
|
+
readonly maxSizeMb: _angular_core.InputSignal<number>;
|
|
48
|
+
readonly minSizeMb: _angular_core.InputSignal<number>;
|
|
49
|
+
readonly isNew: _angular_core.InputSignal<boolean>;
|
|
50
|
+
readonly canPreview: _angular_core.InputSignal<boolean>;
|
|
51
|
+
readonly appearance: _angular_core.InputSignal<"fill" | "outline">;
|
|
52
|
+
readonly accept: _angular_core.InputSignal<string>;
|
|
53
|
+
get empty(): boolean;
|
|
54
|
+
/** True when the control has validation errors and has been touched. */
|
|
55
|
+
get errorState(): boolean;
|
|
56
|
+
id: string;
|
|
57
|
+
/** True when the label should float above the field. */
|
|
58
|
+
get shouldLabelFloat(): boolean;
|
|
59
|
+
describedBy: string;
|
|
60
|
+
readonly changed: _angular_core.OutputEmitterRef<FileInfo>;
|
|
61
|
+
readonly download: _angular_core.OutputEmitterRef<void>;
|
|
62
|
+
readonly preview: _angular_core.OutputEmitterRef<void>;
|
|
63
|
+
private propagateChange;
|
|
64
|
+
private propagateTouched;
|
|
65
|
+
constructor(ngControl: NgControl);
|
|
66
|
+
/**
|
|
67
|
+
* Detects camera availability and updates the placeholder accordingly.
|
|
68
|
+
*/
|
|
69
|
+
private setupDevices;
|
|
70
|
+
ngOnDestroy(): void;
|
|
71
|
+
ngDoCheck(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Writes a new value to the component (called by the form layer).
|
|
74
|
+
* @param value - The new file info to display.
|
|
75
|
+
*/
|
|
76
|
+
writeValue(value: any): void;
|
|
77
|
+
/**
|
|
78
|
+
* Registers the on-change callback (called by the form layer).
|
|
79
|
+
* @param fn - Callback to invoke whenever the value changes.
|
|
80
|
+
*/
|
|
81
|
+
registerOnChange(fn: any): void;
|
|
82
|
+
/**
|
|
83
|
+
* Registers the on-touched callback (called by the form layer).
|
|
84
|
+
* @param fn - Callback to invoke when the control is touched.
|
|
85
|
+
*/
|
|
86
|
+
registerOnTouched(fn: any): void;
|
|
87
|
+
/**
|
|
88
|
+
* Sets the ARIA describedby attribute from the given element IDs.
|
|
89
|
+
* @param ids - Array of element IDs that describe this control.
|
|
90
|
+
*/
|
|
91
|
+
setDescribedByIds(ids: string[]): void;
|
|
92
|
+
/**
|
|
93
|
+
* Updates the disabled state of the underlying native element.
|
|
94
|
+
* @param isDisabled - Whether the control should be disabled.
|
|
95
|
+
*/
|
|
96
|
+
setDisabledState?(isDisabled: boolean): void;
|
|
97
|
+
/** Focuses the native input element and marks the control as touched. */
|
|
98
|
+
onContainerClick(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Checks whether the value has changed since the last dirty check and emits `stateChanges` if needed.
|
|
101
|
+
*/
|
|
102
|
+
protected updateInputDirtyCheck(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Handles file selection from the native input element.
|
|
105
|
+
* @param e - The DOM change event from the file input.
|
|
106
|
+
*/
|
|
107
|
+
protected selectFile(e: Event): void;
|
|
108
|
+
/**
|
|
109
|
+
* Checks whether a file is currently selected.
|
|
110
|
+
* @returns `true` if a file is attached to the current value.
|
|
111
|
+
*/
|
|
112
|
+
protected hasFile(): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Clears the currently selected file and resets the control.
|
|
115
|
+
*/
|
|
116
|
+
protected clearFile(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Emits the `download` output event if the file is not newly added.
|
|
119
|
+
*/
|
|
120
|
+
protected downloadFile(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Emits the `preview` output event if the file is not new and preview is enabled.
|
|
123
|
+
*/
|
|
124
|
+
protected previewFile(): void;
|
|
125
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileInputComponent, [{ optional: true; self: true; }]>;
|
|
126
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FileInputComponent, "file-input", never, { "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "fileName": { "alias": "fileName"; "required": false; "isSignal": true; }; "maxSizeMb": { "alias": "maxSizeMb"; "required": false; "isSignal": true; }; "minSizeMb": { "alias": "minSizeMb"; "required": false; "isSignal": true; }; "isNew": { "alias": "isNew"; "required": false; "isSignal": true; }; "canPreview": { "alias": "canPreview"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; }, { "fileName": "fileNameChange"; "changed": "changed"; "download": "download"; "preview": "preview"; }, never, never, true, never>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface FilePreviewDialogData {
|
|
130
|
+
url?: string;
|
|
131
|
+
embed?: boolean;
|
|
132
|
+
authToken?: string;
|
|
133
|
+
}
|
|
134
|
+
declare class FilePreviewComponent {
|
|
135
|
+
readonly iframe: _angular_core.Signal<ElementRef<any>>;
|
|
136
|
+
private readonly httpClient;
|
|
137
|
+
private readonly dialogService;
|
|
138
|
+
protected readonly dialogData: FilePreviewDialogData;
|
|
139
|
+
protected readonly url: _angular_core.WritableSignal<string>;
|
|
140
|
+
constructor();
|
|
141
|
+
/**
|
|
142
|
+
* Handles the iframe load event: scrolls to the top and centers a single image when present.
|
|
143
|
+
*/
|
|
144
|
+
protected loaded(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Opens the current file URL in a new browser tab for manual download.
|
|
147
|
+
*/
|
|
148
|
+
protected download(): void;
|
|
149
|
+
/**
|
|
150
|
+
* Displays a help dialog with browser-specific instructions for enabling PDF preview.
|
|
151
|
+
*/
|
|
152
|
+
protected troubles(): void;
|
|
153
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FilePreviewComponent, never>;
|
|
154
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FilePreviewComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
declare class SelectFileDialogComponent {
|
|
158
|
+
readonly done: _angular_core.OutputEmitterRef<SelectFile>;
|
|
159
|
+
private readonly dialogService;
|
|
160
|
+
private readonly dialogRef;
|
|
161
|
+
protected readonly dialogData: _angular_core.WritableSignal<SelectFileDialogData>;
|
|
162
|
+
protected readonly file: _angular_core.WritableSignal<File>;
|
|
163
|
+
protected fileClass: _angular_core.WritableSignal<"selectfile-file" | "selectfile-file-drop">;
|
|
164
|
+
/**
|
|
165
|
+
* Handles the native file input change event and delegates to `selectFile`.
|
|
166
|
+
* @param e - The DOM change event from the file input.
|
|
167
|
+
*/
|
|
168
|
+
protected update(e: Event): void;
|
|
169
|
+
/**
|
|
170
|
+
* Validates and sets the selected file, showing an error if size or type constraints are violated.
|
|
171
|
+
* @param file - The `File` object to validate and store.
|
|
172
|
+
*/
|
|
173
|
+
private selectFile;
|
|
174
|
+
/**
|
|
175
|
+
* Formats a byte count into a human-readable size string.
|
|
176
|
+
* @param size - File size in bytes.
|
|
177
|
+
* @returns A formatted size string (e.g. "1.2 MB").
|
|
178
|
+
*/
|
|
179
|
+
protected size(size: number): string;
|
|
180
|
+
/** Emits the selected file and options, then closes the dialog. */
|
|
181
|
+
protected ok(): void;
|
|
182
|
+
/** Highlights the drop zone when a drag enters the area.
|
|
183
|
+
* @param e - The drag event.
|
|
184
|
+
*/
|
|
185
|
+
protected onDragOver(e: DragEvent): void;
|
|
186
|
+
/** Highlights the drop zone when a dragged item enters.
|
|
187
|
+
* @param e - The drag event.
|
|
188
|
+
*/
|
|
189
|
+
protected onDragEnter(e: DragEvent): void;
|
|
190
|
+
/** Resets the drop zone style when dragging ends.
|
|
191
|
+
* @param e - The drag event.
|
|
192
|
+
*/
|
|
193
|
+
protected onDragEnd(e: DragEvent): void;
|
|
194
|
+
/** Resets the drop zone style when a dragged item leaves the area.
|
|
195
|
+
* @param e - The drag event.
|
|
196
|
+
*/
|
|
197
|
+
protected onDragLeave(e: DragEvent): void;
|
|
198
|
+
/**
|
|
199
|
+
* Handles a file drop event, extracting and processing the dropped files.
|
|
200
|
+
* @param e - The drop event.
|
|
201
|
+
*/
|
|
202
|
+
protected onDrop(e: DragEvent): void;
|
|
203
|
+
/**
|
|
204
|
+
* Picks the first file from the list and passes it to `selectFile`.
|
|
205
|
+
* @param files - The `FileList` from the drag-and-drop event.
|
|
206
|
+
*/
|
|
207
|
+
private addFiles;
|
|
208
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectFileDialogComponent, never>;
|
|
209
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectFileDialogComponent, "ng-component", never, {}, { "done": "done"; }, never, never, true, never>;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare class SelectPictureDialogComponent {
|
|
213
|
+
readonly done: _angular_core.OutputEmitterRef<SelectFile>;
|
|
214
|
+
private readonly dialogService;
|
|
215
|
+
private readonly dialogRef;
|
|
216
|
+
protected readonly dialogData: _angular_core.WritableSignal<SelectPictureFileDialogData>;
|
|
217
|
+
protected readonly file: _angular_core.WritableSignal<File>;
|
|
218
|
+
protected fileClass: _angular_core.WritableSignal<"selectpicture-file" | "selectpicture-file-drop">;
|
|
219
|
+
protected pictureWidth: _angular_core.WritableSignal<number>;
|
|
220
|
+
protected pictureHeight: _angular_core.WritableSignal<number>;
|
|
221
|
+
protected picturePreview: _angular_core.WritableSignal<any>;
|
|
222
|
+
/**
|
|
223
|
+
* Handles the native file input change event and delegates to `selectFile`.
|
|
224
|
+
* @param e - The DOM change event from the file input.
|
|
225
|
+
*/
|
|
226
|
+
protected update(e: Event): void;
|
|
227
|
+
/**
|
|
228
|
+
* Validates the file size and type, then reads it as a data URL to generate a preview.
|
|
229
|
+
* @param file - The `File` object to validate and preview.
|
|
230
|
+
*/
|
|
231
|
+
private selectFile;
|
|
232
|
+
/**
|
|
233
|
+
* Formats a byte count into a human-readable size string.
|
|
234
|
+
* @param size - File size in bytes.
|
|
235
|
+
* @returns A formatted size string (e.g. "1.2 MB").
|
|
236
|
+
*/
|
|
237
|
+
protected size(size: number): string;
|
|
238
|
+
/** Emits the selected file and options, then closes the dialog. */
|
|
239
|
+
protected ok(): void;
|
|
240
|
+
/** Highlights the drop zone when a dragged item is over it.
|
|
241
|
+
* @param e - The drag event.
|
|
242
|
+
*/
|
|
243
|
+
protected onDragOver(e: DragEvent): void;
|
|
244
|
+
/** Highlights the drop zone when a dragged item enters.
|
|
245
|
+
* @param e - The drag event.
|
|
246
|
+
*/
|
|
247
|
+
protected onDragEnter(e: DragEvent): void;
|
|
248
|
+
/** Resets the drop zone style when dragging ends.
|
|
249
|
+
* @param e - The drag event.
|
|
250
|
+
*/
|
|
251
|
+
protected onDragEnd(e: DragEvent): void;
|
|
252
|
+
/** Resets the drop zone style when a dragged item leaves.
|
|
253
|
+
* @param e - The drag event.
|
|
254
|
+
*/
|
|
255
|
+
protected onDragLeave(e: DragEvent): void;
|
|
256
|
+
/**
|
|
257
|
+
* Handles a file drop event, extracting and processing the dropped image.
|
|
258
|
+
* @param e - The drop event.
|
|
259
|
+
*/
|
|
260
|
+
protected onDrop(e: DragEvent): void;
|
|
261
|
+
/**
|
|
262
|
+
* Picks the first file from the list and passes it to `selectFile`.
|
|
263
|
+
* @param files - The `FileList` from the drag-and-drop event.
|
|
264
|
+
*/
|
|
265
|
+
private addFiles;
|
|
266
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectPictureDialogComponent, never>;
|
|
267
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectPictureDialogComponent, "ng-component", never, {}, { "done": "done"; }, never, never, true, never>;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export { FileInputComponent, FilePreviewComponent, SelectFileDialogComponent, SelectPictureDialogComponent };
|
|
271
|
+
export type { FilePreviewDialogData };
|