design-angular-kit 1.0.0-0 → 1.0.0-10
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 +183 -24
- package/assets/i18n/en.json +93 -0
- package/assets/i18n/it.json +93 -0
- package/esm2020/lib/abstracts/abstract-form-component.mjs +174 -0
- package/esm2020/lib/abstracts/abstract.component.mjs +27 -0
- package/esm2020/lib/components/core/accordion/accordion.component.mjs +31 -0
- package/esm2020/lib/components/core/alert/alert.component.mjs +69 -0
- package/esm2020/lib/components/core/badge/badge.directive.mjs +34 -0
- package/esm2020/lib/components/core/button/button.directive.mjs +80 -0
- package/esm2020/lib/components/core/callout/callout.component.mjs +84 -0
- package/esm2020/lib/components/core/card/card.component.mjs +58 -0
- package/esm2020/lib/components/core/carousel/carousel/carousel.component.mjs +66 -0
- package/esm2020/lib/components/core/carousel/carousel-item/carousel-item.component.mjs +14 -0
- package/esm2020/lib/components/core/chip/chip.component.mjs +89 -0
- package/esm2020/lib/components/core/collapse/collapse.component.mjs +101 -0
- package/esm2020/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.mjs +24 -0
- package/esm2020/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.mjs +11 -0
- package/esm2020/lib/components/core/dimmer/dimmer.component.mjs +59 -0
- package/esm2020/lib/components/core/dropdown/dropdown/dropdown.component.mjs +130 -0
- package/esm2020/lib/components/core/dropdown/dropdown-item/dropdown-item.component.mjs +68 -0
- package/esm2020/lib/components/core/forward/forward.directive.mjs +51 -0
- package/esm2020/lib/components/core/link/link.component.mjs +40 -0
- package/esm2020/lib/components/core/list/list/list.component.mjs +13 -0
- package/esm2020/lib/components/core/list/list-item/list-item.component.mjs +36 -0
- package/esm2020/lib/components/core/modal/modal.component.mjs +98 -0
- package/esm2020/lib/components/core/notifications/notifications.component.mjs +110 -0
- package/esm2020/lib/components/core/pagination/pagination.component.mjs +51 -0
- package/esm2020/lib/components/core/popover/popover.directive.mjs +179 -0
- package/esm2020/lib/components/core/progress-bar/progress-bar.component.mjs +34 -0
- package/esm2020/lib/components/core/progress-button/progress-button.component.mjs +27 -0
- package/esm2020/lib/components/core/rating/rating.component.mjs +45 -0
- package/esm2020/lib/components/core/spinner/spinner.component.mjs +35 -0
- package/esm2020/lib/components/core/steppers/steppers-container/steppers-container.component.mjs +119 -0
- package/esm2020/lib/components/core/steppers/steppers-item/steppers-item.component.mjs +18 -0
- package/esm2020/lib/components/core/tab/tab-container/tab-container.component.mjs +59 -0
- package/esm2020/lib/components/core/tab/tab-item/tab-item.component.mjs +36 -0
- package/esm2020/lib/components/core/table/table.component.mjs +57 -0
- package/esm2020/lib/components/core/tooltip/tooltip.directive.mjs +143 -0
- package/esm2020/lib/components/form/checkbox/checkbox.component.mjs +40 -0
- package/esm2020/lib/components/form/input/input.component.mjs +222 -0
- package/esm2020/lib/components/form/password-input/password-input.component.mjs +112 -0
- package/esm2020/lib/components/form/radio-button/radio-button.component.mjs +53 -0
- package/esm2020/lib/components/form/select/select.component.mjs +62 -0
- package/esm2020/lib/components/form/textarea/textarea.component.mjs +46 -0
- package/esm2020/lib/components/form/upload-drag-drop/upload-drag-drop.component.mjs +137 -0
- package/esm2020/lib/components/form/upload-file-list/upload-file-list.component.mjs +104 -0
- package/esm2020/lib/components/navigation/back-button/back-button.component.mjs +69 -0
- package/esm2020/lib/components/navigation/back-to-top/back-to-top.component.mjs +74 -0
- package/esm2020/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.mjs +45 -0
- package/esm2020/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +23 -0
- package/esm2020/lib/components/navigation/header/header.component.mjs +63 -0
- package/esm2020/lib/components/utils/icon/icon.component.mjs +54 -0
- package/esm2020/lib/components/utils/language-switcher/language-switcher.component.mjs +39 -0
- package/esm2020/lib/components/utils/not-found-page/not-found-page.component.mjs +13 -0
- package/esm2020/lib/design-angular-kit.module.mjs +45 -131
- package/esm2020/lib/interfaces/core.mjs +16 -0
- package/esm2020/lib/interfaces/form.mjs +2 -0
- package/esm2020/lib/interfaces/icon.mjs +2 -0
- package/esm2020/lib/interfaces/utils.mjs +2 -0
- package/esm2020/lib/modules/components.module.mjs +261 -0
- package/esm2020/lib/pipes/mark-matching-text.pipe.mjs +36 -0
- package/esm2020/lib/services/notifications/notifications.service.mjs +120 -0
- package/esm2020/lib/utils/boolean-input.mjs +15 -0
- package/esm2020/lib/utils/file-utils.mjs +73 -0
- package/esm2020/lib/utils/regex.mjs +26 -0
- package/esm2020/lib/validators/it-validators.mjs +134 -0
- package/esm2020/public_api.mjs +67 -36
- package/fesm2015/design-angular-kit.mjs +3424 -2713
- package/fesm2015/design-angular-kit.mjs.map +1 -1
- package/fesm2020/design-angular-kit.mjs +3391 -2713
- package/fesm2020/design-angular-kit.mjs.map +1 -1
- package/lib/abstracts/abstract-form-component.d.ts +89 -0
- package/lib/abstracts/abstract.component.d.ts +20 -0
- package/lib/components/core/accordion/accordion.component.d.ts +12 -0
- package/lib/components/core/alert/alert.component.d.ts +39 -0
- package/lib/components/core/badge/badge.directive.d.ts +16 -0
- package/lib/components/core/button/button.directive.d.ts +36 -0
- package/lib/components/core/callout/callout.component.d.ts +47 -0
- package/lib/components/core/card/card.component.d.ts +41 -0
- package/lib/components/core/carousel/carousel/carousel.component.d.ts +46 -0
- package/lib/components/core/carousel/carousel-item/carousel-item.component.d.ts +10 -0
- package/lib/components/core/chip/chip.component.d.ts +62 -0
- package/lib/components/core/collapse/collapse.component.d.ts +60 -0
- package/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.d.ts +12 -0
- package/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.d.ts +5 -0
- package/lib/components/core/dimmer/dimmer.component.d.ts +24 -0
- package/lib/components/core/dropdown/dropdown/dropdown.component.d.ts +81 -0
- package/lib/components/core/dropdown/dropdown-item/dropdown-item.component.d.ts +39 -0
- package/lib/components/core/forward/forward.directive.d.ts +14 -0
- package/lib/components/core/link/link.component.d.ts +31 -0
- package/lib/components/core/list/list/list.component.d.ts +10 -0
- package/lib/components/core/list/list-item/list-item.component.d.ts +24 -0
- package/lib/components/core/modal/modal.component.d.ts +59 -0
- package/lib/components/core/notifications/notifications.component.d.ts +44 -0
- package/lib/components/core/pagination/pagination.component.d.ts +31 -0
- package/lib/components/core/popover/popover.directive.d.ts +98 -0
- package/lib/components/core/progress-bar/progress-bar.component.d.ts +28 -0
- package/lib/components/core/progress-button/progress-button.component.d.ts +22 -0
- package/lib/components/core/rating/rating.component.d.ts +20 -0
- package/lib/components/core/spinner/spinner.component.d.ts +21 -0
- package/lib/components/core/steppers/steppers-container/steppers-container.component.d.ts +102 -0
- package/lib/components/core/steppers/steppers-item/steppers-item.component.d.ts +19 -0
- package/lib/components/core/tab/tab-container/tab-container.component.d.ts +30 -0
- package/lib/components/core/tab/tab-item/tab-item.component.d.ts +34 -0
- package/lib/components/core/table/table.component.d.ts +54 -0
- package/lib/components/core/tooltip/tooltip.directive.d.ts +81 -0
- package/lib/components/form/checkbox/checkbox.component.d.ts +30 -0
- package/lib/components/form/input/input.component.d.ts +96 -0
- package/lib/components/form/password-input/password-input.component.d.ts +55 -0
- package/lib/components/form/radio-button/radio-button.component.d.ts +29 -0
- package/lib/components/form/select/select.component.d.ts +30 -0
- package/lib/components/form/textarea/textarea.component.d.ts +24 -0
- package/lib/components/form/upload-drag-drop/upload-drag-drop.component.d.ts +54 -0
- package/lib/components/form/upload-file-list/upload-file-list.component.d.ts +59 -0
- package/lib/components/navigation/back-button/back-button.component.d.ts +47 -0
- package/lib/components/navigation/back-to-top/back-to-top.component.d.ts +46 -0
- package/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.d.ts +30 -0
- package/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +22 -0
- package/lib/components/navigation/header/header.component.d.ts +30 -0
- package/lib/components/utils/icon/icon.component.d.ts +40 -0
- package/lib/components/utils/language-switcher/language-switcher.component.d.ts +23 -0
- package/lib/components/utils/not-found-page/not-found-page.component.d.ts +5 -0
- package/lib/design-angular-kit.module.d.ts +7 -24
- package/lib/interfaces/core.d.ts +59 -0
- package/lib/interfaces/form.d.ts +67 -0
- package/lib/interfaces/icon.d.ts +3 -0
- package/lib/interfaces/utils.d.ts +10 -0
- package/lib/modules/components.module.d.ts +62 -0
- package/lib/services/notifications/notifications.service.d.ts +63 -0
- package/lib/utils/boolean-input.d.ts +11 -0
- package/lib/utils/file-utils.d.ts +32 -0
- package/lib/utils/regex.d.ts +25 -0
- package/lib/validators/it-validators.d.ts +58 -0
- package/package.json +22 -12
- package/public_api.d.ts +59 -35
- package/esm2020/lib/badge/badge.directive.mjs +0 -83
- package/esm2020/lib/breadcrumb/breadcrumb-item.component.mjs +0 -66
- package/esm2020/lib/breadcrumb/breadcrumb.component.mjs +0 -89
- package/esm2020/lib/button/button.directive.mjs +0 -185
- package/esm2020/lib/button/button.module.mjs +0 -18
- package/esm2020/lib/checkbox/checkbox.component.mjs +0 -138
- package/esm2020/lib/collapse/collapse-group.component.mjs +0 -57
- package/esm2020/lib/collapse/collapse-item.component.mjs +0 -79
- package/esm2020/lib/collapse/collapse.config.mjs +0 -12
- package/esm2020/lib/collapse/collapse.directive.mjs +0 -55
- package/esm2020/lib/collapse/collapse.module.mjs +0 -22
- package/esm2020/lib/dropdown/dropdown-divider.component.mjs +0 -11
- package/esm2020/lib/dropdown/dropdown-item.component.mjs +0 -97
- package/esm2020/lib/dropdown/dropdown.component.mjs +0 -143
- package/esm2020/lib/dropdown/dropdown.config.mjs +0 -12
- package/esm2020/lib/dropdown/dropdown.directive.mjs +0 -156
- package/esm2020/lib/dropdown/dropdown.module.mjs +0 -25
- package/esm2020/lib/enums/icons.enum.mjs +0 -27
- package/esm2020/lib/form-input/form-input-password.utils.mjs +0 -154
- package/esm2020/lib/form-input/form-input.component.mjs +0 -495
- package/esm2020/lib/form-input/it-prefix.directive.mjs +0 -13
- package/esm2020/lib/form-input/it-suffix.directive.mjs +0 -13
- package/esm2020/lib/form-input/it-text-prefix.directive.mjs +0 -13
- package/esm2020/lib/form-input/it-text-suffix.directive.mjs +0 -13
- package/esm2020/lib/form-input/mark-matching-text.pipe.mjs +0 -36
- package/esm2020/lib/icon/icon.component.mjs +0 -87
- package/esm2020/lib/icon/icon.module.mjs +0 -18
- package/esm2020/lib/models/Alignment.mjs +0 -15
- package/esm2020/lib/models/ButtonSize.mjs +0 -15
- package/esm2020/lib/models/InputType.mjs +0 -44
- package/esm2020/lib/models/ThemeColor.mjs +0 -30
- package/esm2020/lib/popover/popover.config.mjs +0 -17
- package/esm2020/lib/popover/popover.directive.mjs +0 -33
- package/esm2020/lib/popover/popover.module.mjs +0 -19
- package/esm2020/lib/progress-bar/progress-bar.component.mjs +0 -98
- package/esm2020/lib/radio/radio.component.mjs +0 -287
- package/esm2020/lib/radio/unique-selection-dispatcher.mjs +0 -55
- package/esm2020/lib/tabs/tab-group.component.mjs +0 -177
- package/esm2020/lib/tabs/tab.component.mjs +0 -73
- package/esm2020/lib/tabs/tabs.module.mjs +0 -20
- package/esm2020/lib/toggle/toggle.component.mjs +0 -86
- package/esm2020/lib/tooltip/tooltip.config.mjs +0 -17
- package/esm2020/lib/tooltip/tooltip.directive.mjs +0 -43
- package/esm2020/lib/tooltip/tooltip.module.mjs +0 -19
- package/esm2020/lib/util/focus-mouse.directive.mjs +0 -32
- package/esm2020/lib/util/util.mjs +0 -12
- package/esm2020/lib/util/utils.module.mjs +0 -16
- package/lib/badge/badge.directive.d.ts +0 -33
- package/lib/breadcrumb/breadcrumb-item.component.d.ts +0 -33
- package/lib/breadcrumb/breadcrumb.component.d.ts +0 -33
- package/lib/button/button.directive.d.ts +0 -72
- package/lib/button/button.module.d.ts +0 -8
- package/lib/checkbox/checkbox.component.d.ts +0 -61
- package/lib/collapse/collapse-group.component.d.ts +0 -16
- package/lib/collapse/collapse-item.component.d.ts +0 -46
- package/lib/collapse/collapse.config.d.ts +0 -6
- package/lib/collapse/collapse.directive.d.ts +0 -25
- package/lib/collapse/collapse.module.d.ts +0 -12
- package/lib/dropdown/dropdown-divider.component.d.ts +0 -5
- package/lib/dropdown/dropdown-item.component.d.ts +0 -56
- package/lib/dropdown/dropdown.component.d.ts +0 -65
- package/lib/dropdown/dropdown.config.d.ts +0 -6
- package/lib/dropdown/dropdown.directive.d.ts +0 -77
- package/lib/dropdown/dropdown.module.d.ts +0 -15
- package/lib/enums/icons.enum.d.ts +0 -23
- package/lib/form-input/form-input-password.utils.d.ts +0 -45
- package/lib/form-input/form-input.component.d.ts +0 -283
- package/lib/form-input/it-prefix.directive.d.ts +0 -5
- package/lib/form-input/it-suffix.directive.d.ts +0 -5
- package/lib/form-input/it-text-prefix.directive.d.ts +0 -5
- package/lib/form-input/it-text-suffix.directive.d.ts +0 -5
- package/lib/icon/icon.component.d.ts +0 -34
- package/lib/icon/icon.module.d.ts +0 -8
- package/lib/models/Alignment.d.ts +0 -12
- package/lib/models/ButtonSize.d.ts +0 -11
- package/lib/models/InputType.d.ts +0 -36
- package/lib/models/ThemeColor.d.ts +0 -21
- package/lib/popover/popover.config.d.ts +0 -11
- package/lib/popover/popover.directive.d.ts +0 -20
- package/lib/popover/popover.module.d.ts +0 -9
- package/lib/progress-bar/progress-bar.component.d.ts +0 -55
- package/lib/radio/radio.component.d.ts +0 -116
- package/lib/radio/unique-selection-dispatcher.d.ts +0 -36
- package/lib/tabs/tab-group.component.d.ts +0 -71
- package/lib/tabs/tab.component.d.ts +0 -44
- package/lib/tabs/tabs.module.d.ts +0 -10
- package/lib/toggle/toggle.component.d.ts +0 -46
- package/lib/tooltip/tooltip.config.d.ts +0 -11
- package/lib/tooltip/tooltip.directive.d.ts +0 -27
- package/lib/tooltip/tooltip.module.d.ts +0 -9
- package/lib/util/focus-mouse.directive.d.ts +0 -13
- package/lib/util/util.d.ts +0 -5
- package/lib/util/utils.module.d.ts +0 -7
- /package/lib/{form-input → pipes}/mark-matching-text.pipe.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,39 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<h1 align="center">Design Angular Kit</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src=".github/angular_design_kit.png" alt="angular-logo" width="120px" height="120px"/>
|
|
5
|
+
<br>
|
|
6
|
+
<i>Design Angular Kit è un toolkit basato su Bootstrap Italia
|
|
7
|
+
<br> per la creazione di applicazioni web sviluppate con Angular.</i>
|
|
8
|
+
<br>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://italia.github.io/design-angular-kit"><strong>italia.github.io/design-angular-kit</strong></a>
|
|
13
|
+
<br>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://www.npmjs.com/package/design-angular-kit"><img src="https://img.shields.io/npm/v/design-angular-kit/unstable.svg" alt="NPM"></a>
|
|
18
|
+
<a href="https://github.com/italia/design-angular-kit/actions"><img src="https://github.com/italia/design-angular-kit/actions/workflows/ci.yml/badge.svg" alt="Build"></a>
|
|
19
|
+
<a href="https://codecov.io/gh/italia/design-angular-kit"><img src="https://codecov.io/gh/italia/design-angular-kit/branch/main/graph/badge.svg?token=0Ud6YSFi0r" alt="codecov"></a>
|
|
20
|
+
<a href="https://github.com/italia/design-angular-kit/blob/main/LICENSE"><img src="https://img.shields.io/github/license/italia/design-angular-kit.svg" alt="License"></a>
|
|
21
|
+
<a href="https://github.com/italia/design-angular-kit/issues"><img src="https://img.shields.io/github/issues/italia/design-angular-kit.svg" alt="GitHub issues"></a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="https://developersitalia.slack.com/messages/C04H3C19D52/">
|
|
26
|
+
<img src="https://img.shields.io/badge/Slack%20channel-%23design--dev--angular-blue.svg" alt="Join the #design-dev-angular channel" />
|
|
27
|
+
</a>
|
|
28
|
+
<a href="https://slack.developers.italia.it/">
|
|
29
|
+
<img src="https://slack.developers.italia.it/badge.svg" alt="Get invited" />
|
|
30
|
+
</a>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
_⚠️ Attenzione: questo codice è ancora in fase di sviluppo e non è pronto per essere utilizzato! Stiamo lavorando all'aggiornamento per portare il kit alla versione 1.0.0, commenti e contributi di tutta la community sono più che benvenuti! Se si necessita della vecchia versione il codice e la sua documentazione possono essere reperiti [qua](https://github.com/italia/design-angular-kit/tree/0.x)._
|
|
34
|
+
|
|
35
|
+
## Verso la versione 1.0.0 📣
|
|
36
|
+
|
|
37
|
+
Sono partite le lavorazioni per l'aggiornamento del kit Angular a Bootstrap Italia 2 (basato su Bootstrap 5).
|
|
38
|
+
Sul branch `main` potete trovare il codice dei lavori in corso e nella [milestone Version 1.0.0](https://github.com/italia/design-angular-kit/milestone/3) un piano preliminare delle attività. La vecchia versione è da considerarsi deprecata.
|
|
39
|
+
|
|
40
|
+
👉🏻 È possibile contribuire a questa nuova versione in vari modi:
|
|
41
|
+
|
|
42
|
+
* Con il proprio codice, prendendo in carico una issue tra quelle aperte e non già assegnate tra [le issue](https://github.com/italia/design-angular-kit/issues) di Angular Kit (è sufficiente anche un commento sulla issue per notificare la volontà di presa in carico).
|
|
43
|
+
* Attraverso la segnalazione di bug o miglioramenti al [repository ufficiale](https://github.com/italia/design-angular-kit/) di Angular Kit.
|
|
44
|
+
* Scrivendoci sul [canale dedicato](https://developersitalia.slack.com/messages/C04H3C19D52/) di Slack.
|
|
45
|
+
|
|
46
|
+
**Commenti e contributi di tutta la community sono più che benvenuti!** 🎉
|
|
47
|
+
|
|
48
|
+
## Link utili
|
|
49
|
+
- [Video Meetup Angular Roma: Angular, Bootstrap Italia e non solo..](https://www.youtube.com/live/asGk-mYU-zM?feature=share)
|
|
50
|
+
- [Demo Design Angular Kit](https://github.com/cri99/demo-design-angular-kit)
|
|
51
|
+
- [Preview di Vercel (aggiornata ad ogni commit)](https://design-angular-kit.vercel.app/)
|
|
52
|
+
- [Discussione sulla nuova release](https://github.com/italia/design-angular-kit/discussions/127)
|
|
53
|
+
- [Milestone 1.0.0](https://github.com/italia/design-angular-kit/milestone/3)
|
|
8
54
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Design Angular Kit è un toolkit basato su Bootstrap Italia per la creazione di applicazioni web sviluppate con Angular.
|
|
55
|
+
## Come iniziare
|
|
12
56
|
|
|
13
|
-
|
|
57
|
+
Design Angular Kit è disponibile su NPM, per installarlo su una applicazione esistente sulla quale provare la libreria (attualmente non stabile) esegui il comando
|
|
14
58
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
[Contribuire](https://github.com/italia/design-angular-kit/blob/main/CONTRIBUTING.md)
|
|
59
|
+
```
|
|
60
|
+
npm install design-angular-kit@unstable --save
|
|
61
|
+
```
|
|
19
62
|
|
|
20
|
-
|
|
63
|
+
Procedi a registrare `DesignAngularKitModule` nel tuo **app.module.ts**.
|
|
21
64
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
65
|
+
```typescript
|
|
66
|
+
@NgModule({
|
|
67
|
+
imports: [
|
|
68
|
+
...
|
|
69
|
+
DesignAngularKitModule
|
|
70
|
+
]
|
|
71
|
+
})
|
|
25
72
|
```
|
|
26
73
|
|
|
27
|
-
|
|
74
|
+
### Importazione stili bootstrap-italia
|
|
28
75
|
Configura gli stili richiesti nel file `styles.scss`. Importa la libreria SCSS come mostrato nell'esempio qui sotto.
|
|
29
76
|
|
|
30
77
|
```scss
|
|
31
78
|
// Importazione libreria SCSS di bootstrap-italia
|
|
32
|
-
@import
|
|
33
|
-
|
|
79
|
+
@import "bootstrap-italia/src/scss/bootstrap-italia";
|
|
34
80
|
```
|
|
35
81
|
|
|
36
|
-
|
|
82
|
+
<details>
|
|
83
|
+
<summary>Come personalizzare e sovrascrivere le variabili di default della libreria (es. colori, font-family, misure, ecc.)</summary>
|
|
37
84
|
|
|
38
85
|
Bootstrap Italia eredita ed estende tutte le variabili di default di Bootstrap, sovrascrivendo
|
|
39
86
|
alcuni valori in fase di compilazione e impostandone di nuovi all’occorenza. Un esempio fra tutti è
|
|
@@ -65,10 +112,106 @@ $font-family-sans-serif: 'Custom Font', Arial, Helvetica, sans-serif;
|
|
|
65
112
|
$font-family-monospace: 'Custom Font', 'Courier New', Courier, monospace;
|
|
66
113
|
|
|
67
114
|
// Importazione libreria SCSS di bootstrap-italia
|
|
68
|
-
@import '
|
|
115
|
+
@import 'bootstrap-italia/src/scss/bootstrap-italia';
|
|
116
|
+
```
|
|
117
|
+
</details>
|
|
118
|
+
|
|
119
|
+
### Supporto icone e assets
|
|
120
|
+
|
|
121
|
+
Per aggiungere il supporto icone/assets, modifica il tuo `angular.json` aggiungendo:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
"assets": [
|
|
125
|
+
...
|
|
126
|
+
{
|
|
127
|
+
"glob": "**/*",
|
|
128
|
+
"input": "./node_modules/bootstrap-italia/",
|
|
129
|
+
"output": "/bootstrap-italia/"
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Supporto i18n (localizzazione)
|
|
135
|
+
|
|
136
|
+
La libreria usa [ngx-translate](https://github.com/ngx-translate/core) per aggiungere le localizazioni i18n.
|
|
137
|
+
|
|
138
|
+
Modifica il tuo `angular.json` aggiungendo:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
"assets": [
|
|
142
|
+
...
|
|
143
|
+
{
|
|
144
|
+
"glob": "**/*",
|
|
145
|
+
"input": "./node_modules/design-angular-kit/assets/i18n",
|
|
146
|
+
"output": "/bootstrap-italia/i18n/"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Localizzazione esistente
|
|
152
|
+
|
|
153
|
+
Se utilizzi già i file di localizzazione nella tua app, puoi utilizzare la libreria [ngx-translate-multi-http-loader](https://www.npmjs.com/package/ngx-translate-multi-http-loader)
|
|
154
|
+
per caricare i file di localizzazione dell'app e di `design-angular-kit`
|
|
155
|
+
|
|
156
|
+
Modifica nel tuo `app.module.ts`:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
@NgModule({
|
|
160
|
+
imports: [
|
|
161
|
+
...
|
|
162
|
+
HttpClientModule,
|
|
163
|
+
TranslateModule.forRoot({
|
|
164
|
+
loader: {
|
|
165
|
+
provide: TranslateLoader,
|
|
166
|
+
useFactory: (http: HttpBackend) => new MultiTranslateHttpLoader(http, [
|
|
167
|
+
'./bootstrap-italia/i18n/', // Load library translations first, so you can edit the keys in your localization file
|
|
168
|
+
'./assets/i18n/' // Your i18n location
|
|
169
|
+
]),
|
|
170
|
+
deps: [HttpBackend]
|
|
171
|
+
},
|
|
172
|
+
defaultLanguage: 'it'
|
|
173
|
+
}),
|
|
174
|
+
DesignAngularKitModule
|
|
175
|
+
]
|
|
176
|
+
})
|
|
69
177
|
```
|
|
70
178
|
|
|
179
|
+
Se vuoi personalizzare le nostre label puoi aggiungere le localizzazioni nei tuoi file json, sovrascrivendo le [chiavi del json della libreria](projects/design-angular-kit/assets/i18n/it.json).
|
|
71
180
|
|
|
181
|
+
Puoi utilizzare le label localizzate di `design-angular-kit` nella tua applicazione, ad esempio `{{'it.errors.required-field' | translate}}`. [Vedi le nostre label](projects/design-angular-kit/assets/i18n/it.json)
|
|
182
|
+
|
|
183
|
+
#### Localizzazione non esistente
|
|
184
|
+
|
|
185
|
+
Se non utilizzi i file di localizzazione nella tua app, devi aggiungere il provider `TranslateStore` nel tuo `app.module.ts`:
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
@NgModule({
|
|
189
|
+
imports: [
|
|
190
|
+
...
|
|
191
|
+
DesignAngularKitModule,
|
|
192
|
+
],
|
|
193
|
+
providers: [
|
|
194
|
+
TranslateStore
|
|
195
|
+
],
|
|
196
|
+
})
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Se vuoi personalizzare le nostre label:
|
|
200
|
+
- Non includere il supporto i18n nel tuo `angular.json` ma crea i tuoi file di localizzazione personalizzati nella tua cartella `assets/bootstrap-italia/i18n/` (crea il percorso se non esiste).
|
|
201
|
+
- Il json deve avere [questo formato](projects/design-angular-kit/assets/i18n/it.json).
|
|
202
|
+
|
|
203
|
+
### Supporto animazione
|
|
204
|
+
|
|
205
|
+
La libreria usa BrowserAnimationsModule per gestire alcune animazioni.
|
|
206
|
+
|
|
207
|
+
Per abilitarle, bisogna aggiungere al tuo `app.module.ts` il modulo :
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
imports: [
|
|
211
|
+
...
|
|
212
|
+
BrowserAnimationsModule
|
|
213
|
+
]
|
|
214
|
+
```
|
|
72
215
|
|
|
73
216
|
## Segnalazione bug e richieste di aiuto
|
|
74
217
|
|
|
@@ -112,3 +255,19 @@ npm run start
|
|
|
112
255
|
```
|
|
113
256
|
npm run test
|
|
114
257
|
```
|
|
258
|
+
|
|
259
|
+
# Contributor della libreria
|
|
260
|
+
|
|
261
|
+
Un grazie speciale a chi ha reso possibile lo sviluppo di questa nuova versione!
|
|
262
|
+
|
|
263
|
+
[](https://github.com/cri99) | [](https://github.com/AntoninoBonanno) | [](https://www.net-serv.it/) | [](https://github.com/alenap93) |
|
|
264
|
+
--- | --- | --- | --- |
|
|
265
|
+
Cristian Borelli | Antonino Bonanno | NetService | Alessio Napolitano |
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
Tutti i contributor (*made with [contributors-img](https://contrib.rocks)*)
|
|
270
|
+
|
|
271
|
+
<a href = "https://github.com/italia/design-angular-kit/graphs/contributors">
|
|
272
|
+
<img src = "https://contrib.rocks/image?repo=italia/design-angular-kit"/>
|
|
273
|
+
</a>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"it": {
|
|
3
|
+
"general": {
|
|
4
|
+
"save": "Save",
|
|
5
|
+
"send": "Send",
|
|
6
|
+
"abort": "Abort",
|
|
7
|
+
"close": "Close",
|
|
8
|
+
"continue": "Continue",
|
|
9
|
+
"edit": "Edit",
|
|
10
|
+
"show-all": "Show all",
|
|
11
|
+
"details": "Details"
|
|
12
|
+
},
|
|
13
|
+
"errors": {
|
|
14
|
+
"generic": "An error has occurred",
|
|
15
|
+
"generic-support-message": "There was an unexpected error. Please try again later or contact support.",
|
|
16
|
+
"invalid-field": "This field is invalid",
|
|
17
|
+
"required-field": "This field is required",
|
|
18
|
+
"check-all-fields": "Check that you have filled in all the fields correctly",
|
|
19
|
+
"min-invalid": "The minimum value for this field is: {{min}}",
|
|
20
|
+
"max-invalid": "The maximum value for this field is: {{max}}",
|
|
21
|
+
"min-length-invalid": "The minimum length for this field is: {{min}}",
|
|
22
|
+
"max-length-invalid": "The minimum length for this field is: {{max}}",
|
|
23
|
+
"email-invalid": "Enter a valid email",
|
|
24
|
+
"tel-invalid": "Please enter a valid phone number format",
|
|
25
|
+
"url-invalid": "Please enter a valid URL",
|
|
26
|
+
"tax-code-invalid": "Enter a valid tax code",
|
|
27
|
+
"vat-number-invalid": "Enter a valid VAT number",
|
|
28
|
+
"cap-invalid": "Enter a valid zip code",
|
|
29
|
+
"regex-invalid": "Please enter a valid REGEX expression",
|
|
30
|
+
"pattern-invalid": "The field must have the pattern {{pattern}}",
|
|
31
|
+
"password-no-match": "Passwords must match",
|
|
32
|
+
"password-min-length": "Password must contain at least {{minLength}} characters!",
|
|
33
|
+
"password-number": "The password must have at least 1 number!",
|
|
34
|
+
"password-capital-case": "The password should contain at least 1 uppercase character!",
|
|
35
|
+
"password-small-case": "Password must contain at least 1 lowercase character!",
|
|
36
|
+
"password-special-character": "Password must contain at least 1 special character!"
|
|
37
|
+
},
|
|
38
|
+
"core": {
|
|
39
|
+
"close-modal": "Close modal window",
|
|
40
|
+
"close-notification": "Close Notification: {{title}}",
|
|
41
|
+
"close-alert": "Close alert",
|
|
42
|
+
"page": "Page",
|
|
43
|
+
"previous-page": "Previous page",
|
|
44
|
+
"next-page": "Next page",
|
|
45
|
+
"progress": "Progress",
|
|
46
|
+
"loading": "Loading",
|
|
47
|
+
"active": "Active",
|
|
48
|
+
"remove": "Delete",
|
|
49
|
+
"confirm": "Confirm",
|
|
50
|
+
"confirmed": "Confirmed",
|
|
51
|
+
"step": "Step",
|
|
52
|
+
"step-of": "Step {{current}} of {{available}}",
|
|
53
|
+
"back": "Back",
|
|
54
|
+
"forward": "Forward",
|
|
55
|
+
"rate-star": "Rate {{current}} out of {{total}} stars",
|
|
56
|
+
"rating-star": "Rating {{current}} out of {{total}} stars"
|
|
57
|
+
},
|
|
58
|
+
"form": {
|
|
59
|
+
"increase-value": "Increase value",
|
|
60
|
+
"decrease-value": "Decrease value",
|
|
61
|
+
"upload": "Upload",
|
|
62
|
+
"upload-drag-file": "Drag the file to upload it",
|
|
63
|
+
"upload-loading": "Loading...",
|
|
64
|
+
"upload-complete": "Upload completed",
|
|
65
|
+
"upload-or": "or",
|
|
66
|
+
"upload-select-device": "select it from the device",
|
|
67
|
+
"uploaded-file": "File uploaded: {{name}}",
|
|
68
|
+
"delete-file": "Delete file {{name}}"
|
|
69
|
+
},
|
|
70
|
+
"navigation": {
|
|
71
|
+
"home": "Home",
|
|
72
|
+
"go-back": "Go back",
|
|
73
|
+
"upper-level": "Upper level",
|
|
74
|
+
"secondary-navigation": "Secondary navigation",
|
|
75
|
+
"login": "Log in",
|
|
76
|
+
"full-login": "Access the personal area",
|
|
77
|
+
"search": "Search",
|
|
78
|
+
"website-search": "Search in the site",
|
|
79
|
+
"navigation-path": "Navigation path"
|
|
80
|
+
},
|
|
81
|
+
"utils": {
|
|
82
|
+
"selected": "Selected",
|
|
83
|
+
"language-selection": "Language selection: {{lang}}",
|
|
84
|
+
"select-language": "Select a language",
|
|
85
|
+
"404": {
|
|
86
|
+
"title": "Resource not found",
|
|
87
|
+
"description": "Oops! The resource you are looking for was not found, go back to the homepage and use the menu to continue browsing.",
|
|
88
|
+
"go-back": "Go back",
|
|
89
|
+
"go-to-homepage": "Return to homepage"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"it": {
|
|
3
|
+
"general": {
|
|
4
|
+
"save": "Salva",
|
|
5
|
+
"send": "Invia",
|
|
6
|
+
"abort": "Annulla",
|
|
7
|
+
"close": "Chiudi",
|
|
8
|
+
"continue": "Continua",
|
|
9
|
+
"edit": "Modifica",
|
|
10
|
+
"show-all": "Mostra tutto",
|
|
11
|
+
"details": "Dettagli"
|
|
12
|
+
},
|
|
13
|
+
"errors": {
|
|
14
|
+
"generic": "Si è verificato un errore",
|
|
15
|
+
"generic-support-message": "Si è verificato un errore imprevisto. Riprova più tardi o contatta il supporto.",
|
|
16
|
+
"invalid-field": "Questo campo non è valido",
|
|
17
|
+
"required-field": "Questo campo è obbligatorio",
|
|
18
|
+
"check-all-fields": "Verifica di aver compilato correttamente tutti i campi",
|
|
19
|
+
"min-invalid": "Il valore minimo per questo campo è: {{min}}",
|
|
20
|
+
"max-invalid": "Il valore massimo per questo campo è: {{max}}",
|
|
21
|
+
"min-length-invalid": "La lunghezza minima per questo campo è: {{min}}",
|
|
22
|
+
"max-length-invalid": "La lunghezza minima per questo campo è: {{max}}",
|
|
23
|
+
"email-invalid": "Inserisci un email valida",
|
|
24
|
+
"tel-invalid": "Inserisci un formato telefonico valido",
|
|
25
|
+
"url-invalid": "Inserisci un url valido",
|
|
26
|
+
"tax-code-invalid": "Inserisci un codice fiscale valido",
|
|
27
|
+
"vat-number-invalid": "Inserisci una partita iva valida",
|
|
28
|
+
"cap-invalid": "Inserisci un CAP valido",
|
|
29
|
+
"regex-invalid": "Inserisci un espressione REGEX valida",
|
|
30
|
+
"pattern-invalid": "Il campo deve avere il pattern {{pattern}}",
|
|
31
|
+
"password-no-match": "Le password devono essere identiche",
|
|
32
|
+
"password-min-length": "La password deve contenere almeno {{minLength}} caratteri!",
|
|
33
|
+
"password-number": "La password deve avere almeno 1 numero!",
|
|
34
|
+
"password-capital-case": "La password deve contenere almeno 1 carattere maiuscolo!",
|
|
35
|
+
"password-small-case": "La password deve contenere almeno 1 carattere minuscolo!",
|
|
36
|
+
"password-special-character": "La password deve contenere almeno 1 carattere speciale!"
|
|
37
|
+
},
|
|
38
|
+
"core": {
|
|
39
|
+
"close-modal": "Chiudi finestra modale",
|
|
40
|
+
"close-notification": "Chiudi notifica: {{title}}",
|
|
41
|
+
"close-alert": "Chiudi avviso",
|
|
42
|
+
"page": "Pagina",
|
|
43
|
+
"previous-page": "Pagina precedente",
|
|
44
|
+
"next-page": "Pagina successiva",
|
|
45
|
+
"progress": "Progresso",
|
|
46
|
+
"loading": "Caricamento",
|
|
47
|
+
"active": "Attivo",
|
|
48
|
+
"remove": "Elimina",
|
|
49
|
+
"confirm": "Conferma",
|
|
50
|
+
"confirmed": "Confermato",
|
|
51
|
+
"step": "Step",
|
|
52
|
+
"step-of": "Step {{current}} di {{available}}",
|
|
53
|
+
"back": "Indietro",
|
|
54
|
+
"forward": "Avanti",
|
|
55
|
+
"rate-star": "Valuta {{current}} stelle su {{total}}",
|
|
56
|
+
"rating-star": "Valutazione {{current}} stelle su {{total}}"
|
|
57
|
+
},
|
|
58
|
+
"form": {
|
|
59
|
+
"increase-value": "Aumenta valore",
|
|
60
|
+
"decrease-value": "Diminuisci valore",
|
|
61
|
+
"upload": "Upload",
|
|
62
|
+
"upload-drag-file": "Trascina il file per caricarlo",
|
|
63
|
+
"upload-loading": "Caricamento in corso...",
|
|
64
|
+
"upload-complete": "Caricamento completato",
|
|
65
|
+
"upload-or": "oppure",
|
|
66
|
+
"upload-select-device": "selezionalo dal dispositivo",
|
|
67
|
+
"uploaded-file": "File caricato: {{name}}",
|
|
68
|
+
"delete-file": "Elimina file {{name}}"
|
|
69
|
+
},
|
|
70
|
+
"navigation": {
|
|
71
|
+
"home": "Home",
|
|
72
|
+
"go-back": "Torna indietro",
|
|
73
|
+
"upper-level": "Livello superiore",
|
|
74
|
+
"secondary-navigation": "Navigazione secondaria",
|
|
75
|
+
"login": "Accedi",
|
|
76
|
+
"full-login": "Accedi all'area personale",
|
|
77
|
+
"search": "Cerca",
|
|
78
|
+
"website-search": "Cerca nel sito",
|
|
79
|
+
"navigation-path": "Percorso di navigazione"
|
|
80
|
+
},
|
|
81
|
+
"utils": {
|
|
82
|
+
"selected": "Selezionata",
|
|
83
|
+
"language-selection": "Selezione lingua: {{lang}}",
|
|
84
|
+
"select-language": "Seleziona una lingua",
|
|
85
|
+
"404": {
|
|
86
|
+
"title": "Risorsa non trovata",
|
|
87
|
+
"description": "Oops! La risorsa che cerchi non è stata trovata, torna alla homepage e utilizza il menu per continuare la navigazione.",
|
|
88
|
+
"go-back": "Torna indietro",
|
|
89
|
+
"go-to-homepage": "Torna alla homepage"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { FormControl } from '@angular/forms';
|
|
2
|
+
import { Component, Input, Optional, Self } from '@angular/core';
|
|
3
|
+
import { AbstractComponent } from './abstract.component';
|
|
4
|
+
import { isFalseBooleanInput, isTrueBooleanInput } from '../utils/boolean-input';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@angular/forms";
|
|
7
|
+
import * as i2 from "@ngx-translate/core";
|
|
8
|
+
export class AbstractFormComponent extends AbstractComponent {
|
|
9
|
+
constructor(_ngControl, _translateService, _renderer, _elementRef, _changeDetectorRef) {
|
|
10
|
+
super(_renderer, _elementRef, _changeDetectorRef);
|
|
11
|
+
this._ngControl = _ngControl;
|
|
12
|
+
this._translateService = _translateService;
|
|
13
|
+
this._renderer = _renderer;
|
|
14
|
+
this._elementRef = _elementRef;
|
|
15
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
16
|
+
/**
|
|
17
|
+
* Validation color display mode (validation triggered if field is touched or not pristine)
|
|
18
|
+
* - <b>true</b>: Always show the validation color
|
|
19
|
+
* - <b>false</b>: Never show validation color
|
|
20
|
+
* - <b>only-valid</b>: Show only valid validation color
|
|
21
|
+
* - <b>only-invalid</b>: Show only invalid validation color
|
|
22
|
+
* @default <b>only-invalid</b>: Show only invalid validation color
|
|
23
|
+
*/
|
|
24
|
+
this.validationMode = 'only-invalid';
|
|
25
|
+
this.onChange = (_) => {
|
|
26
|
+
};
|
|
27
|
+
this.onTouched = () => {
|
|
28
|
+
};
|
|
29
|
+
this.control = new FormControl();
|
|
30
|
+
this._ngControl && (this._ngControl.valueAccessor = this);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Set the disabled state
|
|
34
|
+
*/
|
|
35
|
+
set disabled(isDisabled) {
|
|
36
|
+
this.setDisabledState(isTrueBooleanInput(isDisabled));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if field is invalid (Validation failed)
|
|
40
|
+
*/
|
|
41
|
+
get isInvalid() {
|
|
42
|
+
if (this.validationMode === 'only-valid' || (this.validationMode !== 'only-invalid' && isFalseBooleanInput(this.validationMode))) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
if (this._ngControl) {
|
|
46
|
+
return this._ngControl.invalid === true && (!this._ngControl.pristine || this._ngControl.touched === true);
|
|
47
|
+
}
|
|
48
|
+
return this.control.invalid && (!this.control.pristine || this.control.touched);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Check if field is valid (Validation successful)
|
|
52
|
+
*/
|
|
53
|
+
get isValid() {
|
|
54
|
+
if (this.validationMode === 'only-invalid' || (this.validationMode !== 'only-valid' && isFalseBooleanInput(this.validationMode))) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
if (this._ngControl) {
|
|
58
|
+
return this._ngControl.valid === true && (!this._ngControl.pristine || this._ngControl.touched === true);
|
|
59
|
+
}
|
|
60
|
+
return this.control.valid && (!this.control.pristine || this.control.touched);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Return the invalid message string from TranslateService
|
|
64
|
+
*/
|
|
65
|
+
get invalidMessage() {
|
|
66
|
+
if (this.control.hasError('required')) {
|
|
67
|
+
return this._translateService.get('it.errors.required-field');
|
|
68
|
+
}
|
|
69
|
+
return this._translateService.get('it.errors.invalid-field');
|
|
70
|
+
}
|
|
71
|
+
ngOnInit() {
|
|
72
|
+
if (this._ngControl) {
|
|
73
|
+
this.control.setValidators(this._ngControl.control.validator);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
registerOnChange(fn) {
|
|
77
|
+
this.control.valueChanges.subscribe(fn);
|
|
78
|
+
this.onChange = fn;
|
|
79
|
+
}
|
|
80
|
+
registerOnTouched(fn) {
|
|
81
|
+
this.onTouched = fn;
|
|
82
|
+
}
|
|
83
|
+
setDisabledState(isDisabled) {
|
|
84
|
+
if (isDisabled) {
|
|
85
|
+
return this.control.disable();
|
|
86
|
+
}
|
|
87
|
+
this.control.enable();
|
|
88
|
+
}
|
|
89
|
+
writeValue(value) {
|
|
90
|
+
this.control.setValue(value, { emitEvent: false });
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Mark the control as touched
|
|
94
|
+
*/
|
|
95
|
+
markAsTouched() {
|
|
96
|
+
if (!this.control.touched) {
|
|
97
|
+
this.onTouched();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Fired to check if form control is touched
|
|
102
|
+
*/
|
|
103
|
+
ngDoCheck() {
|
|
104
|
+
if (this.control.touched) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (this._ngControl?.control?.touched) {
|
|
108
|
+
this.control.markAsTouched();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Add the validators in control and parent control
|
|
113
|
+
* @param validators the validators
|
|
114
|
+
* @protected
|
|
115
|
+
*/
|
|
116
|
+
addValidators(validators) {
|
|
117
|
+
if (!Array.isArray(validators)) {
|
|
118
|
+
validators = [validators];
|
|
119
|
+
}
|
|
120
|
+
validators.forEach(validator => {
|
|
121
|
+
if (!this.control.hasValidator(validator)) {
|
|
122
|
+
this.control.addValidators(validator);
|
|
123
|
+
}
|
|
124
|
+
if (this._ngControl?.control && !this._ngControl.control.hasValidator(validator)) {
|
|
125
|
+
this._ngControl.control.addValidators(validator);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Reports whether the control with the given path has the error specified. <br/>
|
|
131
|
+
* If the control is not present, false is returned.
|
|
132
|
+
* @param errorCode The code of the error to check
|
|
133
|
+
* @param path A list of control names that designates how to move from the current control
|
|
134
|
+
* to the control that should be queried for errors.
|
|
135
|
+
* @returns whether the given error is present in the control at the given path.
|
|
136
|
+
*/
|
|
137
|
+
hasError(errorCode, path) {
|
|
138
|
+
if (this._ngControl) {
|
|
139
|
+
return this._ngControl.hasError(errorCode, path);
|
|
140
|
+
}
|
|
141
|
+
return this.control.hasError(errorCode, path);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Reports error data for the control with the given path.
|
|
145
|
+
* @param errorCode The code of the error to check
|
|
146
|
+
* @param path A list of control names that designates how to move from the current control
|
|
147
|
+
* to the control that should be queried for errors.
|
|
148
|
+
* @returns error data for that particular error. If the control or error is not present,
|
|
149
|
+
* null is returned.
|
|
150
|
+
*/
|
|
151
|
+
getError(errorCode, path) {
|
|
152
|
+
if (this._ngControl) {
|
|
153
|
+
return this._ngControl.getError(errorCode, path);
|
|
154
|
+
}
|
|
155
|
+
return this.control.getError(errorCode, path);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
AbstractFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbstractFormComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i2.TranslateService }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
159
|
+
AbstractFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AbstractFormComponent, selector: "ng-component", inputs: { label: "label", validationMode: "validationMode", disabled: "disabled" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbstractFormComponent, decorators: [{
|
|
161
|
+
type: Component,
|
|
162
|
+
args: [{ template: '' }]
|
|
163
|
+
}], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
|
|
164
|
+
type: Self
|
|
165
|
+
}, {
|
|
166
|
+
type: Optional
|
|
167
|
+
}] }, { type: i2.TranslateService }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { label: [{
|
|
168
|
+
type: Input
|
|
169
|
+
}], validationMode: [{
|
|
170
|
+
type: Input
|
|
171
|
+
}], disabled: [{
|
|
172
|
+
type: Input
|
|
173
|
+
}] } });
|
|
174
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWJzdHJhY3QtZm9ybS1jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9kZXNpZ24tYW5ndWxhci1raXQvc3JjL2xpYi9hYnN0cmFjdHMvYWJzdHJhY3QtZm9ybS1jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF3QixXQUFXLEVBQTBCLE1BQU0sZ0JBQWdCLENBQUM7QUFDM0YsT0FBTyxFQUVMLFNBQVMsRUFHVCxLQUFLLEVBRUwsUUFBUSxFQUVSLElBQUksRUFDTCxNQUFNLGVBQWUsQ0FBQztBQUN2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