@arsedizioni/ars-utils 22.5.30 → 22.5.33
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 +15 -12
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +4 -5
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +118 -2
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +12 -12
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +320 -4
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +13 -13
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +7 -7
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs.map +1 -1
- package/package.json +1 -5
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +3 -3
- package/types/arsedizioni-ars-utils-core.validators.d.ts +52 -1
- package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +3 -3
- package/types/arsedizioni-ars-utils-ui.dialogs.d.ts +117 -2
- package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts +3 -3
- package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +1 -1
- package/types/arsedizioni-ars-utils-ui.files.d.ts +1 -1
- package/ui.application/package.json +4 -0
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ di vita proprio vive nel suo entry point. Importare sempre dal path specifico.
|
|
|
27
27
|
| L0.5 | `ui.shell` | `ShellService` (`info`, `error`, `busy*`, `wait`, `BusyTimer`), `ShellMessageComponent`, `ShellBusyComponent` | zero Material e zero CDK: e' quello che shell, interceptor, guard e app initializer possono permettersi sul percorso di boot |
|
|
28
28
|
| L1 | `ui` | `FlexLayoutModule`, `MediaObserver`, `UIService`, tipi dei dialog | kernel: deve restare magro, e non importa nulla da Material |
|
|
29
29
|
| L1 | `ui.paginator` | `PaginatorIntl` | isola `@angular/material/paginator`, che si porta dietro `mat-select` e `mat-option` |
|
|
30
|
-
| L1.5 | `ui.dialogs` | `DialogService` (estende `ShellService`) + confirm, delete, toast, `open
|
|
30
|
+
| L1.5 | `ui.dialogs` | `DialogService` (estende `ShellService`) + confirm, delete, toast, `open`, e le aperture pigre dei dialog pesanti | tutto cio' che chiede qualcosa all'utente, piu' il toast |
|
|
31
31
|
| L2 | `ui.dialogs.auth` | credentials, reset-password, recover-password, prompt-otp, `OtpInputComponent`, `PasswordStrengthComponent` | solo route di login/account |
|
|
32
32
|
| L2 | `ui.dialogs.prompt` | prompt, prompt-date, prompt-time | porta `@angular/material/datepicker` |
|
|
33
33
|
| L2 | `ui.dialogs.select` | select, select-tree, send-to | porta `mat-tree`, `mat-list`, `mat-chips` |
|
|
@@ -35,7 +35,6 @@ di vita proprio vive nel suo entry point. Importare sempre dal path specifico.
|
|
|
35
35
|
| L2 | `ui.controls` | button-selector, button-toggle, chips-selector, tree-picker, calendar-empty-header | |
|
|
36
36
|
| L2 | `ui.filters` | `FilterBarComponent` + modello `Filters` | |
|
|
37
37
|
| L2 | `ui.navigation` | `NavigationBarComponent` + definizioni | shell applicativa |
|
|
38
|
-
| L3 | `ui.application` | `ApplicationDialogService` | facade: carica i dialog pesanti con `import()` |
|
|
39
38
|
|
|
40
39
|
### Specifici ARS
|
|
41
40
|
|
|
@@ -69,24 +68,28 @@ ui.dialogs <-- DialogService extends ShellService: dipende da `ui` E da `ui
|
|
|
69
68
|
| | | | | |
|
|
70
69
|
| ui.dialogs.auth ui.dialogs.prompt ui.files ui.help ui.oauth
|
|
71
70
|
| ui.notifications (+ support.common)
|
|
72
|
-
ui.application --- import() ---> ui.dialogs.{auth,prompt,select}, ui.files
|
|
73
|
-
|
|
|
74
71
|
clipper.ui (+ clipper.common, ui.controls, ui.files, ui.dialogs.select)
|
|
72
|
+
|
|
73
|
+
`ui.dialogs` --- import() ---> ui.dialogs.{auth,prompt,select}, ui.files
|
|
74
|
+
Gli archi dinamici puntano all'insu' e sono l'unica ragione per cui quei quattro entry point
|
|
75
|
+
restano fuori dal bundle iniziale. Regge finche' NESSUNO di loro importa `DialogService`: per
|
|
76
|
+
`error()` e `busy()` iniettano `ShellService`.
|
|
75
77
|
```
|
|
76
78
|
|
|
77
79
|
`evolution.common` e `support.common` dipendono solo da `core`.
|
|
78
80
|
|
|
79
81
|
### Regole da rispettare
|
|
80
82
|
|
|
81
|
-
1. Il grafo tra entry point deve restare un DAG.
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
1. Il grafo **statico** tra entry point deve restare un DAG: `ui.dialogs` raggiunge i dialog
|
|
84
|
+
pesanti solo con `import()`, e quei quattro entry point non devono importare `DialogService`
|
|
85
|
+
in nessun modo — ng-packagr rifiuta la build con `circular dependency` al primo che lo fa.
|
|
86
|
+
Per messaggi e attesa iniettano `ShellService`, che sta sotto di loro nel grafo.
|
|
84
87
|
2. I tipi condivisi fra il facade e i dialog pesanti stanno in `ui` (`dialog.definitions.ts`).
|
|
85
88
|
Se un tipo servisse a entrambi e vivesse nel dialog, l'`import()` del facade tornerebbe statico.
|
|
86
89
|
3. Il facade usa `import type` per i tipi dei componenti e `import()` per i valori: e' quello
|
|
87
90
|
che tiene i dialog fuori dal bundle iniziale.
|
|
88
91
|
4. Dopo una modifica, verificare che gli `import()` sopravvivano alla build:
|
|
89
|
-
`grep -o "import('@arsedizioni[^']*')" dist/ars-utils/fesm2022/*ui.
|
|
92
|
+
`grep -o "import('@arsedizioni[^']*')" dist/ars-utils/fesm2022/*ui.dialogs.mjs` deve stampare i nove.
|
|
90
93
|
5. `ui.shell` non importa nulla da `@angular/material` ne' da `@angular/cdk`, e nemmeno da `ui`.
|
|
91
94
|
E' l'unica ragione per cui esiste: se ci finisce dentro un solo simbolo di Material, la shell
|
|
92
95
|
torna a pagare l'intero stack sul percorso di boot. Da verificare dopo ogni build:
|
|
@@ -125,14 +128,14 @@ significherebbe far dipendere tre entry point headless da uno di UI, cioe' rompe
|
|
|
125
128
|
La conseguenza pratica per chi scrive l'applicazione:
|
|
126
129
|
|
|
127
130
|
- shell, interceptor, guard, `provideAppInitializer` -> `ShellService` di `ui.shell`
|
|
128
|
-
- componenti di rotta -> `DialogService` di `ui.dialogs`,
|
|
131
|
+
- componenti di rotta -> `DialogService` di `ui.dialogs`, che apre anche i dialog pesanti
|
|
129
132
|
|
|
130
133
|
I tre servizi sono una catena, non tre servizi diversi:
|
|
131
134
|
|
|
132
135
|
```
|
|
133
136
|
ShellService info, error, busy*, wait, busyTimer ui.shell
|
|
134
|
-
└ DialogService + open, confirm, delete, toast
|
|
135
|
-
|
|
137
|
+
└ DialogService + open, confirm, delete, toast, ui.dialogs
|
|
138
|
+
select, prompt, sendTo, ... (pigri)
|
|
136
139
|
```
|
|
137
140
|
|
|
138
141
|
Quindi chi inietta `DialogService` ha tutto quello che aveva prima: `info`, `error` e `busy` non
|
|
@@ -147,7 +150,7 @@ iniettato e nient'altro.
|
|
|
147
150
|
|
|
148
151
|
- Nessun barrel radice: `@arsedizioni/ars-utils` esporta solo `ARS_UTILS_VERSION`.
|
|
149
152
|
- `ui` non contiene piu' i dialog: `DialogService` sta in `ui.dialogs`.
|
|
150
|
-
- `ui.application`
|
|
153
|
+
- `ui.application` non esiste piu': i nove metodi che apriva stanno in `DialogService`. I controlli sono in
|
|
151
154
|
`ui.controls`, i file in `ui.files`, i filtri in `ui.filters`, la navigazione in `ui.navigation`.
|
|
152
155
|
- `SystemUtils.markdownToHtml` non esiste piu': usare `MarkdownUtils.toHtml` da `core.markdown`.
|
|
153
156
|
- `SelectableModel` espone `first` e `selectedAny` al posto di `selectedFirst` e `selectedAll`.
|
|
@@ -50,10 +50,9 @@ import { switchMap, EMPTY, finalize, Subject } from 'rxjs';
|
|
|
50
50
|
import { debounceTime, finalize as finalize$1 } from 'rxjs/operators';
|
|
51
51
|
import { startOfToday, startOfDay, subDays, endOfDay, startOfMonth, endOfMonth } from 'date-fns';
|
|
52
52
|
import { Clipboard } from '@angular/cdk/clipboard';
|
|
53
|
-
import {
|
|
53
|
+
import { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';
|
|
54
54
|
import { SendToDialogComponent } from '@arsedizioni/ars-utils/ui.dialogs.select';
|
|
55
55
|
import saveAs from 'file-saver';
|
|
56
|
-
import { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';
|
|
57
56
|
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogClose, MatDialogContent, MatDialogTitle, MatDialogActions } from '@angular/material/dialog';
|
|
58
57
|
import { Router } from '@angular/router';
|
|
59
58
|
import { ShellService } from '@arsedizioni/ars-utils/ui.shell';
|
|
@@ -510,7 +509,7 @@ class ClipperDocumentManager {
|
|
|
510
509
|
this.clipboard = inject(Clipboard);
|
|
511
510
|
this.clipperService = inject(ClipperService);
|
|
512
511
|
this.broadcastService = inject(BroadcastService);
|
|
513
|
-
this.dialogService = inject(
|
|
512
|
+
this.dialogService = inject(DialogService);
|
|
514
513
|
this.canHandleTooManyResults = signal(false, /* @ts-ignore */
|
|
515
514
|
...(ngDevMode ? [{ debugName: "canHandleTooManyResults" }] : /* istanbul ignore next */ []));
|
|
516
515
|
this.canPopulateContacts = signal(false, /* @ts-ignore */
|
|
@@ -997,7 +996,7 @@ class ClipperDocumentViewerService {
|
|
|
997
996
|
}
|
|
998
997
|
// NB: `import()` here does NOT make the viewer lazy. ng-packagr flattens every file of an
|
|
999
998
|
// entry point into one FESM module, so a dynamic import of a sibling is inlined at build time
|
|
1000
|
-
// (the cross-entry-point ones in `
|
|
999
|
+
// (the cross-entry-point ones, like those in `DialogService`, are the ones that survive). It stays as an
|
|
1001
1000
|
// import() only because it keeps the module graph honest; to load the viewer on demand for
|
|
1002
1001
|
// real it would have to live in an entry point of its own.
|
|
1003
1002
|
Promise.resolve().then(function () { return document_component; }).then(({ ClipperDocumentComponent }) => {
|
|
@@ -1920,7 +1919,7 @@ class ClipperBrowserComponent extends ClipperSearchResultManager {
|
|
|
1920
1919
|
constructor() {
|
|
1921
1920
|
super();
|
|
1922
1921
|
/** Error text of a field: the message declared in the schema, or the shared fallback. */
|
|
1923
|
-
this.
|
|
1922
|
+
this.getErrorMessage = SignalsUtils.getFieldErrorMessage;
|
|
1924
1923
|
this.filterByNumber = viewChild('filterByNumber', /* @ts-ignore */
|
|
1925
1924
|
...(ngDevMode ? [{ debugName: "filterByNumber" }] : /* istanbul ignore next */ []));
|
|
1926
1925
|
this.filterByText = viewChild('filterByText', /* @ts-ignore */
|