@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,73 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
|
3
|
+
import { ScreenService, SelectableModel } from '@arsedizioni/ars-utils/core';
|
|
4
|
+
import { SupportNotificationInfo, SupportNotificationsSearchParams } from '@arsedizioni/ars-utils/support.common';
|
|
5
|
+
|
|
6
|
+
declare class SupportNotificationsBrowserComponent {
|
|
7
|
+
readonly paginator: _angular_core.Signal<MatPaginator>;
|
|
8
|
+
protected readonly screenService: ScreenService;
|
|
9
|
+
private readonly supportService;
|
|
10
|
+
private readonly broadcastService;
|
|
11
|
+
private readonly dialogService;
|
|
12
|
+
private readonly destroyRef;
|
|
13
|
+
protected selection: SelectableModel<SupportNotificationInfo, number>;
|
|
14
|
+
protected searchParams: SupportNotificationsSearchParams;
|
|
15
|
+
protected total: _angular_core.WritableSignal<number>;
|
|
16
|
+
protected items: _angular_core.WritableSignal<SupportNotificationInfo[]>;
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* Scrolls the notifications list back to the top.
|
|
20
|
+
*/
|
|
21
|
+
private updateScroll;
|
|
22
|
+
/**
|
|
23
|
+
* Resets the `isMenuOpen` flag on all items after a context menu is closed.
|
|
24
|
+
*/
|
|
25
|
+
protected updateMenuButtonsVisibility(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the ids of the currently selected items.
|
|
28
|
+
* Shows an error and returns `undefined` when the selection exceeds 50 items.
|
|
29
|
+
* @returns An array of selected notification ids, or `undefined` on validation failure.
|
|
30
|
+
*/
|
|
31
|
+
private getSelectedIds;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the CSS class to apply to the read-state indicator stripe.
|
|
34
|
+
* @param item - The notification to evaluate.
|
|
35
|
+
* @returns `'unread-bg'` when the notification has not been read, otherwise `undefined`.
|
|
36
|
+
*/
|
|
37
|
+
protected getItemStateCssClass(item: SupportNotificationInfo): string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the tooltip text for the read-state indicator stripe.
|
|
40
|
+
* @param item - The notification to evaluate.
|
|
41
|
+
* @returns `'Non letto'` when unread, otherwise an empty string.
|
|
42
|
+
*/
|
|
43
|
+
protected getItemStateTooltip(item: SupportNotificationInfo): string;
|
|
44
|
+
/**
|
|
45
|
+
* Resets pagination to page 0 and fetches a fresh result set.
|
|
46
|
+
*/
|
|
47
|
+
protected find(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Fetches the current page of notifications from the server.
|
|
50
|
+
*/
|
|
51
|
+
private fetch;
|
|
52
|
+
/**
|
|
53
|
+
* Handles paginator page changes and loads the corresponding result page.
|
|
54
|
+
* @param e - The `PageEvent` emitted by `MatPaginator`.
|
|
55
|
+
*/
|
|
56
|
+
protected fetchMore(e: PageEvent): void;
|
|
57
|
+
/**
|
|
58
|
+
* Marks one or more notifications as read or unread.
|
|
59
|
+
* When no specific item is supplied, acts on the current selection.
|
|
60
|
+
* @param item - A single notification to mark, or `undefined` to use the selection.
|
|
61
|
+
* @param unmark - `true` to mark as unread; `false` (default) to mark as read.
|
|
62
|
+
*/
|
|
63
|
+
protected mark(item?: SupportNotificationInfo, unmark?: boolean): void;
|
|
64
|
+
/**
|
|
65
|
+
* Opens the notification detail dialog for the given item.
|
|
66
|
+
* @param item - The notification to display.
|
|
67
|
+
*/
|
|
68
|
+
protected show(item: SupportNotificationInfo): void;
|
|
69
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SupportNotificationsBrowserComponent, never>;
|
|
70
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SupportNotificationsBrowserComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { SupportNotificationsBrowserComponent };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MatPaginatorIntl } from '@angular/material/paginator';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** Italian localisation for the Material paginator labels. */
|
|
5
|
+
declare class PaginatorIntl extends MatPaginatorIntl {
|
|
6
|
+
itemsPerPageLabel: string;
|
|
7
|
+
nextPageLabel: string;
|
|
8
|
+
previousPageLabel: string;
|
|
9
|
+
lastPageLabel: string;
|
|
10
|
+
firstPageLabel: string;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the human-readable range label shown inside the paginator.
|
|
13
|
+
* @param page - Zero-based index of the current page.
|
|
14
|
+
* @param pageSize - Number of items displayed per page.
|
|
15
|
+
* @param length - Total number of items, or `-1` when the total is still being calculated.
|
|
16
|
+
* @returns A formatted string such as `"1 - 25 di 100"`.
|
|
17
|
+
*/
|
|
18
|
+
getRangeLabel: (page: number, pageSize: number, length: number) => string;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaginatorIntl, never>;
|
|
20
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PaginatorIntl>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { PaginatorIntl };
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Content of a shell message.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately a subset of `InfoDialogData`: the shell speaks before a route exists, so it
|
|
8
|
+
* says one thing and offers one way out. Anything richer belongs to `DialogService`.
|
|
9
|
+
*/
|
|
10
|
+
interface ShellMessageData {
|
|
11
|
+
/** Heading shown above the message. */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** HTML body of the message. */
|
|
14
|
+
message: string;
|
|
15
|
+
/** Optional technical detail (a log, a stack trace) shown in a secondary panel. */
|
|
16
|
+
details?: string;
|
|
17
|
+
/** Label of the dismiss button. */
|
|
18
|
+
okCaption?: string;
|
|
19
|
+
/** Auto-dismiss delay in milliseconds; the message stays until dismissed when omitted. */
|
|
20
|
+
dismissAfter?: number;
|
|
21
|
+
/** Maximum width of the panel in pixels. */
|
|
22
|
+
width?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Handle over an open shell message.
|
|
26
|
+
*
|
|
27
|
+
* Not a `MatDialogRef`: there is no Material here, and the shell never needs to reach into
|
|
28
|
+
* the component instance. Closing it and knowing when it closed is the whole contract.
|
|
29
|
+
*/
|
|
30
|
+
interface ShellMessageRef {
|
|
31
|
+
/**
|
|
32
|
+
* Closes the message. Does nothing when it has already been closed.
|
|
33
|
+
* @returns void
|
|
34
|
+
*/
|
|
35
|
+
close(): void;
|
|
36
|
+
/** Resolves once the message has been removed from the DOM. */
|
|
37
|
+
readonly closed: Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Visual style of the busy indicator. */
|
|
41
|
+
type ShellBusyType = 'bar' | 'spinner' | 'wait' | 'hourglass';
|
|
42
|
+
/** Progress mode of the bar and of the spinner. */
|
|
43
|
+
type ShellBusyMode = 'determinate' | 'indeterminate';
|
|
44
|
+
/**
|
|
45
|
+
* Overlay that blocks interaction while an operation is running, in the four styles the
|
|
46
|
+
* applications use: progress bar, spinner, hourglass and bare wait.
|
|
47
|
+
*
|
|
48
|
+
* Reproduces `mat-progress-bar` and `mat-progress-spinner` in CSS and SVG rather than importing
|
|
49
|
+
* them, because this overlay is shown from the boot path — an HTTP interceptor calls it before
|
|
50
|
+
* any route exists — and `ui.shell` exists precisely so that path costs no Material.
|
|
51
|
+
*
|
|
52
|
+
* The instance is created once by {@link ShellService} and then reused: showing and hiding is a
|
|
53
|
+
* class on the host, never a `createComponent`, so the 40-odd calls a screen costs nothing.
|
|
54
|
+
*/
|
|
55
|
+
declare class ShellBusyComponent {
|
|
56
|
+
/** Whether the overlay is on screen. Hidden with `display: none`, so it costs no layout. */
|
|
57
|
+
readonly visible: _angular_core.WritableSignal<boolean>;
|
|
58
|
+
/** Visual style of the indicator. */
|
|
59
|
+
readonly type: _angular_core.WritableSignal<ShellBusyType>;
|
|
60
|
+
/** Current progress value (0-100), used when {@link progressMode} is `'determinate'`. */
|
|
61
|
+
readonly progress: _angular_core.WritableSignal<number>;
|
|
62
|
+
/** Progress mode of the bar and of the spinner. */
|
|
63
|
+
readonly progressMode: _angular_core.WritableSignal<ShellBusyMode>;
|
|
64
|
+
/** Message displayed above the indicator. */
|
|
65
|
+
readonly message: _angular_core.WritableSignal<string>;
|
|
66
|
+
/** Circumference of the spinner circle, bound to `stroke-dasharray`. */
|
|
67
|
+
protected readonly circumference: number;
|
|
68
|
+
/** Length of the spinner arc still to be drawn, derived from {@link progress}. */
|
|
69
|
+
protected readonly dashOffset: _angular_core.Signal<number>;
|
|
70
|
+
/**
|
|
71
|
+
* Updates the overlay state.
|
|
72
|
+
*
|
|
73
|
+
* Same contract as the `BusyDialogComponent` it replaces, down to the two implicit rules that
|
|
74
|
+
* callers rely on: an empty message keeps the previous text (so `wait()` does not wipe it), and
|
|
75
|
+
* a progress above zero forces `'determinate'` whatever the caller passed.
|
|
76
|
+
* @param message - New message to display. An empty string preserves the current one.
|
|
77
|
+
* @param progress - Current progress value (0-100). Above zero it forces determinate mode.
|
|
78
|
+
* @param progressMode - Progress mode to use. Defaults to `'indeterminate'`.
|
|
79
|
+
* @param type - Visual style to use. Defaults to `'bar'`.
|
|
80
|
+
* @returns void
|
|
81
|
+
*/
|
|
82
|
+
set(message: string, progress: number, progressMode?: ShellBusyMode, type?: ShellBusyType): void;
|
|
83
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ShellBusyComponent, never>;
|
|
84
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShellBusyComponent, "ars-shell-busy", never, {}, {}, never, never, true, never>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Everything the application can say to the user without asking anything back: a message, an
|
|
89
|
+
* error, and the wait overlay. No Angular Material behind any of it.
|
|
90
|
+
*
|
|
91
|
+
* `DialogService` extends this class, so a route component injects `DialogService` and has both
|
|
92
|
+
* halves; shell, HTTP interceptors, route guards and app initializers inject `ShellService` and
|
|
93
|
+
* pay for neither `mat-dialog` nor `cdk/overlay` on the boot path — measured at 445 KB of the
|
|
94
|
+
* 905 KB initial bundle on myARS, more than every route of the application put together.
|
|
95
|
+
*
|
|
96
|
+
* The methods keep the parameter order of the `DialogService` ones they came from, so no call
|
|
97
|
+
* site changed when they moved here.
|
|
98
|
+
*
|
|
99
|
+
* ## Stacking
|
|
100
|
+
*
|
|
101
|
+
* Outside the CDK overlay stack the order is a fixed z-index: the busy overlay sits at 1090 and
|
|
102
|
+
* the message at 1100, both above the `cdk-overlay-container` (1000). So an error raised while a
|
|
103
|
+
* Material dialog is open lands on top of it, which is what an error should do, and the busy
|
|
104
|
+
* overlay covers the dialog it belongs to. The one case a fixed number cannot express is a dialog
|
|
105
|
+
* opened while the overlay is still up — `DialogService.open()` takes the busy away immediately
|
|
106
|
+
* rather than with the grace period, precisely so that case cannot happen.
|
|
107
|
+
*/
|
|
108
|
+
declare class ShellService {
|
|
109
|
+
private readonly appRef;
|
|
110
|
+
private readonly environmentInjector;
|
|
111
|
+
private messageRef?;
|
|
112
|
+
private messageKind?;
|
|
113
|
+
private resolveClosed?;
|
|
114
|
+
private previousOverflow?;
|
|
115
|
+
private previouslyFocused?;
|
|
116
|
+
private busyRef?;
|
|
117
|
+
private busyVisible;
|
|
118
|
+
private busyActionSubscription?;
|
|
119
|
+
private clearBusyTimer?;
|
|
120
|
+
/**
|
|
121
|
+
* Shows an informational message.
|
|
122
|
+
* @param message - HTML message to display.
|
|
123
|
+
* @param title - Heading. Defaults to `'Informazioni'`.
|
|
124
|
+
* @param okCaption - Dismiss button label. Defaults to `'Ok'`.
|
|
125
|
+
* @param width - Maximum panel width in pixels. Defaults to `500`.
|
|
126
|
+
* @param dismissAfter - Auto-close delay in milliseconds (optional).
|
|
127
|
+
* @param details - Optional secondary details text.
|
|
128
|
+
* @returns A handle over the open message, or `null` outside the browser.
|
|
129
|
+
*/
|
|
130
|
+
info(message: string, title?: string, okCaption?: string, width?: number, dismissAfter?: number, details?: string): ShellMessageRef | null;
|
|
131
|
+
/**
|
|
132
|
+
* Shows an error message. When one is already on screen its content is replaced in place: a
|
|
133
|
+
* failing API answers many requests at once, and each of them must not add a panel of its own.
|
|
134
|
+
* @param message - HTML error message to display.
|
|
135
|
+
* @param log - Optional technical log or stack trace shown in the details panel.
|
|
136
|
+
* @param title - Heading. Defaults to `'Errore'`.
|
|
137
|
+
* @param okCaption - Dismiss button label. Defaults to `'Ok'`.
|
|
138
|
+
* @param width - Maximum panel width in pixels. Defaults to `500`.
|
|
139
|
+
* @param dismissAfter - Auto-close delay in milliseconds (optional).
|
|
140
|
+
* @returns A handle over the open message, or `null` outside the browser.
|
|
141
|
+
*/
|
|
142
|
+
error(message: string, log?: string, title?: string, okCaption?: string, width?: number, dismissAfter?: number): ShellMessageRef | null;
|
|
143
|
+
/**
|
|
144
|
+
* Closes the message currently on screen, if any. Does not touch the busy overlay.
|
|
145
|
+
* @returns void
|
|
146
|
+
*/
|
|
147
|
+
closeMessage(): void;
|
|
148
|
+
/**
|
|
149
|
+
* Opens the message panel, or updates the one already open when it is showing the same kind of
|
|
150
|
+
* message.
|
|
151
|
+
* @param kind - Whether this is an informational or an error message.
|
|
152
|
+
* @param data - The content to display.
|
|
153
|
+
* @returns A handle over the open message, or `null` outside the browser.
|
|
154
|
+
*/
|
|
155
|
+
private showMessage;
|
|
156
|
+
/**
|
|
157
|
+
* Builds the handle returned to callers, wiring its `closed` promise to the current message.
|
|
158
|
+
* @returns The handle over the message currently on screen.
|
|
159
|
+
*/
|
|
160
|
+
private messageHandle;
|
|
161
|
+
/**
|
|
162
|
+
* Shows or updates the busy overlay.
|
|
163
|
+
*
|
|
164
|
+
* Called dozens of times per screen, so it creates nothing after the first time: the component
|
|
165
|
+
* is built once and then kept, and showing it again is a class on the host element. The state
|
|
166
|
+
* is written to signals and checked synchronously before returning, so the message on screen is
|
|
167
|
+
* always the last one asked for — a second `busy()` in the same task never leaves the previous
|
|
168
|
+
* text behind.
|
|
169
|
+
* @param message - Text to display. An empty string keeps the current one.
|
|
170
|
+
* @param progress - Progress value (`-1` = indeterminate). Defaults to `-1`.
|
|
171
|
+
* @param progressMode - Progress mode. Defaults to `'indeterminate'`.
|
|
172
|
+
* @param type - Visual style of the overlay. Defaults to `'bar'`.
|
|
173
|
+
* @param action - Optional observable; the overlay is dismissed when it first emits. It
|
|
174
|
+
* replaces the one passed to a previous call, which is unsubscribed.
|
|
175
|
+
* @returns `true` if the overlay was brought up by this call, `false` if it was already up.
|
|
176
|
+
*/
|
|
177
|
+
setBusy(message: string, progress?: number, progressMode?: ShellBusyMode, type?: ShellBusyType, action?: Observable<unknown>): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Shows or updates the busy overlay using the progress-bar style.
|
|
180
|
+
* @param message - Text to display inside the overlay.
|
|
181
|
+
* @param progress - Progress value (`-1` = indeterminate). Defaults to `-1`.
|
|
182
|
+
* @param progressMode - Progress mode. Defaults to `'indeterminate'`.
|
|
183
|
+
* @param action - Optional observable; the overlay is dismissed when it emits.
|
|
184
|
+
* @returns `true` if the overlay was brought up by this call.
|
|
185
|
+
*/
|
|
186
|
+
busy(message: string, progress?: number, progressMode?: ShellBusyMode, action?: Observable<unknown>): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Shows or updates the busy overlay using the spinner style.
|
|
189
|
+
* @param message - Text to display inside the overlay.
|
|
190
|
+
* @param progress - Progress value (`-1` = indeterminate). Defaults to `-1`.
|
|
191
|
+
* @param progressMode - Progress mode. Defaults to `'indeterminate'`.
|
|
192
|
+
* @param action - Optional observable; the overlay is dismissed when it emits.
|
|
193
|
+
* @returns `true` if the overlay was brought up by this call.
|
|
194
|
+
*/
|
|
195
|
+
busySpinner(message: string, progress?: number, progressMode?: ShellBusyMode, action?: Observable<unknown>): boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Shows or updates the busy overlay using the hourglass style.
|
|
198
|
+
* @param message - Text to display inside the overlay.
|
|
199
|
+
* @param action - Optional observable; the overlay is dismissed when it emits.
|
|
200
|
+
* @returns `true` if the overlay was brought up by this call.
|
|
201
|
+
*/
|
|
202
|
+
busyHourglass(message: string, action?: Observable<unknown>): boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Shows a bare wait indicator, with no panel and no message.
|
|
205
|
+
* @param action - Optional observable; the overlay is dismissed when it emits.
|
|
206
|
+
* @returns `true` if the overlay was brought up by this call.
|
|
207
|
+
*/
|
|
208
|
+
wait(action?: Observable<unknown>): boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Returns a {@link BusyTimer} that brings the overlay up only if the operation is still running
|
|
211
|
+
* after a debounce delay.
|
|
212
|
+
* @param message - Text to display. Defaults to `'Operazione in corso...'`.
|
|
213
|
+
* @param due - Delay in milliseconds before the overlay appears. Defaults to `100`.
|
|
214
|
+
* @returns A timer that must be disposed with `clear()` when the operation ends.
|
|
215
|
+
*/
|
|
216
|
+
busyTimer(message?: string, due?: number): BusyTimer;
|
|
217
|
+
/**
|
|
218
|
+
* Takes the busy overlay away.
|
|
219
|
+
*
|
|
220
|
+
* By default it waits a short grace period, so that a chain of quick operations does not make
|
|
221
|
+
* the overlay blink between one and the next; any `setBusy()` in the meantime cancels the
|
|
222
|
+
* pending removal. Pass `true` when something is about to be drawn underneath it and the wait
|
|
223
|
+
* would be visible — that is what `DialogService.open()` does.
|
|
224
|
+
* @param immediate - When `true`, removes the overlay without waiting for the grace period.
|
|
225
|
+
* @returns void
|
|
226
|
+
*/
|
|
227
|
+
clearBusy(immediate?: boolean): void;
|
|
228
|
+
/**
|
|
229
|
+
* Hides the busy overlay without destroying it, so the next call can reuse the instance.
|
|
230
|
+
* @returns void
|
|
231
|
+
*/
|
|
232
|
+
private hideBusy;
|
|
233
|
+
/**
|
|
234
|
+
* Returns the busy component, creating and attaching it the first time it is needed.
|
|
235
|
+
* @returns The reused busy component reference.
|
|
236
|
+
*/
|
|
237
|
+
private ensureBusy;
|
|
238
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ShellService, never>;
|
|
239
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ShellService>;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Shows the busy overlay only if the operation is still running after a debounce delay, so that
|
|
244
|
+
* an operation that answers in 30 ms never makes the screen flash.
|
|
245
|
+
*
|
|
246
|
+
* Whoever creates one owns it: {@link clear} must be called when the operation ends, otherwise
|
|
247
|
+
* the overlay appears after the fact and stays.
|
|
248
|
+
*/
|
|
249
|
+
declare class BusyTimer {
|
|
250
|
+
private readonly shellService;
|
|
251
|
+
private readonly subscription;
|
|
252
|
+
/**
|
|
253
|
+
* Arms the timer.
|
|
254
|
+
* @param shellService - The service that owns the overlay. A `DialogService` is accepted too,
|
|
255
|
+
* since it extends `ShellService`.
|
|
256
|
+
* @param due - Delay in milliseconds before the overlay appears. Defaults to `100`.
|
|
257
|
+
* @param message - Text to display. Defaults to `'Operazione in corso...'`.
|
|
258
|
+
*/
|
|
259
|
+
constructor(shellService: ShellService, due?: number, message?: string);
|
|
260
|
+
/**
|
|
261
|
+
* Disarms the timer and takes the overlay away.
|
|
262
|
+
* @returns void
|
|
263
|
+
*/
|
|
264
|
+
clear(): void;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The shell's message panel: a modal that looks like a Material dialog and owes nothing to
|
|
269
|
+
* Material.
|
|
270
|
+
*
|
|
271
|
+
* It exists because shell, interceptors, guards and app initializers must be able to say
|
|
272
|
+
* "the session is gone" before a single route has been loaded, and paying for `mat-dialog`,
|
|
273
|
+
* `cdk/overlay` and the rest of that stack on the boot path costs the initial bundle more
|
|
274
|
+
* than every route of the application put together. The look is matched through CSS custom
|
|
275
|
+
* properties (`--ars-*` first, Material's `--mat-sys-*` next, a literal last), so an
|
|
276
|
+
* application that themes Material gets the same surface here for free.
|
|
277
|
+
*
|
|
278
|
+
* Instantiated imperatively by {@link ShellService}, never declared in a template: that is
|
|
279
|
+
* what lets an interceptor open it.
|
|
280
|
+
*/
|
|
281
|
+
declare class ShellMessageComponent {
|
|
282
|
+
/** Emitted when the user dismisses the message, whichever way they did it. */
|
|
283
|
+
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
284
|
+
private readonly panel;
|
|
285
|
+
private readonly okButton;
|
|
286
|
+
/** Unique id tying the panel to its heading for assistive technology. */
|
|
287
|
+
protected readonly titleId: string;
|
|
288
|
+
/** Current content, with the defaults the shell relies on already applied. */
|
|
289
|
+
protected readonly data: _angular_core.WritableSignal<ShellMessageData>;
|
|
290
|
+
/** True for a moment after a successful copy, so the button can acknowledge it. */
|
|
291
|
+
protected readonly copied: _angular_core.WritableSignal<boolean>;
|
|
292
|
+
private dismissTimer?;
|
|
293
|
+
private copiedTimer?;
|
|
294
|
+
private closing;
|
|
295
|
+
constructor();
|
|
296
|
+
/**
|
|
297
|
+
* Replaces the content shown by the panel and restarts the auto-dismiss timer.
|
|
298
|
+
*
|
|
299
|
+
* Called on an already open panel by `ShellService.error()` so that a burst of failures
|
|
300
|
+
* updates one message instead of stacking modals nobody can dismiss.
|
|
301
|
+
* @param data - The new content to display.
|
|
302
|
+
* @returns void
|
|
303
|
+
*/
|
|
304
|
+
setData(data: ShellMessageData): void;
|
|
305
|
+
/**
|
|
306
|
+
* Dismisses the panel. Safe to call more than once: only the first call is announced.
|
|
307
|
+
* @returns void
|
|
308
|
+
*/
|
|
309
|
+
close(): void;
|
|
310
|
+
/**
|
|
311
|
+
* Closes the panel on Escape, mirroring a Material dialog opened with the default config.
|
|
312
|
+
* @param e - The keyboard event captured at document level.
|
|
313
|
+
* @returns void
|
|
314
|
+
*/
|
|
315
|
+
protected onKeydown(e: KeyboardEvent): void;
|
|
316
|
+
/**
|
|
317
|
+
* Keeps Tab inside the panel while the message is up.
|
|
318
|
+
*
|
|
319
|
+
* A hand-rolled two-element version of what `cdk/a11y` does, which is all this panel needs:
|
|
320
|
+
* it never holds more than the copy button and the dismiss button.
|
|
321
|
+
* @param e - The Tab keydown event.
|
|
322
|
+
* @returns void
|
|
323
|
+
*/
|
|
324
|
+
private trapFocus;
|
|
325
|
+
/**
|
|
326
|
+
* (Re)schedules the auto-dismiss timer, cancelling any pending one so a timer armed for an
|
|
327
|
+
* earlier message can never close a newer one.
|
|
328
|
+
* @param dismissAfter - Delay in milliseconds; no-op when falsy.
|
|
329
|
+
* @returns void
|
|
330
|
+
*/
|
|
331
|
+
private scheduleDismiss;
|
|
332
|
+
/**
|
|
333
|
+
* Copies the message and its details to the clipboard, as both HTML and plain text.
|
|
334
|
+
*
|
|
335
|
+
* Unlike `InfoDialogComponent` there is no toast to report the outcome — the shell has no
|
|
336
|
+
* toast — so the button itself acknowledges it for a moment.
|
|
337
|
+
* @returns A promise that resolves once the copy has been attempted.
|
|
338
|
+
*/
|
|
339
|
+
protected copy(): Promise<void>;
|
|
340
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ShellMessageComponent, never>;
|
|
341
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShellMessageComponent, "ars-shell-message", never, {}, { "closed": "closed"; }, never, never, true, never>;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export { BusyTimer, ShellBusyComponent, ShellMessageComponent, ShellService };
|
|
345
|
+
export type { ShellBusyMode, ShellBusyType, ShellMessageData, ShellMessageRef };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class TinymceUtils {
|
|
4
|
+
/**
|
|
5
|
+
* Returns `true` when the user agent currently prefers a dark color scheme.
|
|
6
|
+
* Evaluated on demand (not frozen at module load) and SSR-safe.
|
|
7
|
+
*/
|
|
8
|
+
private static prefersDark;
|
|
9
|
+
/** URL of the TinyMCE script hosted on the Tiny Cloud CDN. */
|
|
10
|
+
static readonly CDN_URL = "https://cdn.tiny.cloud/1/5lnoc6ohmpjau6zyzgqyhyf52cueoennkcs8v1yfoak57ku9/tinymce/7/tinymce.min.js";
|
|
11
|
+
/** URL of the locally bundled TinyMCE script. */
|
|
12
|
+
static readonly LOCAL_URL = "/assets/tinymce/tinymce.min.js";
|
|
13
|
+
/**
|
|
14
|
+
* Full-featured TinyMCE base configuration with all standard plugins and toolbar.
|
|
15
|
+
*/
|
|
16
|
+
static TinymceConfig: Record<string, any>;
|
|
17
|
+
/**
|
|
18
|
+
* Compact TinyMCE configuration with autoresize, bottom toolbar, and grouped toolbar buttons.
|
|
19
|
+
* Extends `TinymceConfig` with reduced height and a simplified toolbar.
|
|
20
|
+
*/
|
|
21
|
+
static TinymceCompactConfig: Record<string, any>;
|
|
22
|
+
/**
|
|
23
|
+
* Extended compact TinyMCE configuration that adds fullscreen support and an insert group.
|
|
24
|
+
* Extends `TinymceCompactConfig`.
|
|
25
|
+
*/
|
|
26
|
+
static TinymceCompactExtendedConfig: Record<string, any>;
|
|
27
|
+
/**
|
|
28
|
+
* Inject the TinyMCE script tag into the document head if it is not already present.
|
|
29
|
+
* @param useCDN - When `true`, loads from the Tiny Cloud CDN; otherwise uses the local asset.
|
|
30
|
+
*/
|
|
31
|
+
static loadTinyMCEScript(useCDN?: boolean): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface FullScreenEditorDialogData {
|
|
35
|
+
text: string;
|
|
36
|
+
configuration: Record<string, any>;
|
|
37
|
+
infoButtonLabel?: string;
|
|
38
|
+
onShowInfo?: Function;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
}
|
|
41
|
+
declare class FullScreenEditorComponent {
|
|
42
|
+
/** Emitted with the edited text when the user saves. */
|
|
43
|
+
readonly saving: _angular_core.OutputEmitterRef<string>;
|
|
44
|
+
private readonly dialogRef;
|
|
45
|
+
/** Dialog configuration, injected and exposed as a signal. */
|
|
46
|
+
protected readonly dialogData: _angular_core.WritableSignal<FullScreenEditorDialogData>;
|
|
47
|
+
/** Whether the editor is in read-only mode. */
|
|
48
|
+
protected readonly disabled: _angular_core.WritableSignal<boolean>;
|
|
49
|
+
/** Current editor content, kept as a plain field for [(ngModel)] two-way binding. */
|
|
50
|
+
protected text: string;
|
|
51
|
+
/** TinyMCE editor configuration. */
|
|
52
|
+
protected tinymceConfig: Record<string, any>;
|
|
53
|
+
constructor();
|
|
54
|
+
/**
|
|
55
|
+
* Save the current editor content and close the dialog.
|
|
56
|
+
*/
|
|
57
|
+
protected ok(): void;
|
|
58
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FullScreenEditorComponent, never>;
|
|
59
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FullScreenEditorComponent, "ng-component", never, {}, { "saving": "saving"; }, never, never, true, never>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { FullScreenEditorComponent, TinymceUtils };
|
|
63
|
+
export type { FullScreenEditorDialogData };
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export * from '@arsedizioni/ars-utils/support.ui';
|
|
6
|
-
export * from '@arsedizioni/ars-utils/help';
|
|
7
|
-
export * from '@arsedizioni/ars-utils/clipper.common';
|
|
8
|
-
export * from '@arsedizioni/ars-utils/clipper.ui';
|
|
9
|
-
export * from '@arsedizioni/ars-utils/tinymce';
|
|
10
|
-
export * from '@arsedizioni/ars-utils/evolution.common';
|
|
1
|
+
/** Version of the library, aligned with the supported Angular major. */
|
|
2
|
+
declare const ARS_UTILS_VERSION = "22.1.5";
|
|
3
|
+
|
|
4
|
+
export { ARS_UTILS_VERSION };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
in application:
|
|
2
|
+
1) install tinymce (npm install tinymce)
|
|
3
|
+
1) install @tinymce/tinymce-angular (npm install @tinymce/tinymce-angular)
|
|
4
|
+
2) setup assets in angular.json
|
|
5
|
+
{
|
|
6
|
+
"glob": "**/*",
|
|
7
|
+
"input": "node_modules/tinymce",
|
|
8
|
+
"output": "assets/tinymce"
|
|
9
|
+
}
|
|
10
|
+
3) download language from
|
|
11
|
+
https://github.com/tinymce/tinymce/blob/develop/modules/tinymce/src/langs/it.js and put it in
|
|
12
|
+
"assets/tinymce/langs/it.js"
|