design-angular-kit 1.0.0-9 → 1.0.0-prerelease.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 +212 -64
- package/assets/i18n/en.json +81 -12
- package/assets/i18n/it.json +80 -11
- package/esm2022/lib/abstracts/abstract-form.component.mjs +187 -0
- package/esm2022/lib/abstracts/abstract.component.mjs +45 -0
- package/esm2022/lib/components/core/accordion/accordion.component.mjs +39 -0
- package/esm2022/lib/components/core/alert/alert.component.mjs +71 -0
- package/esm2022/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.mjs +43 -0
- package/esm2022/lib/components/core/avatar/avatar-group/avatar-group.component.mjs +38 -0
- package/esm2022/lib/components/core/avatar/avatar.directive.mjs +78 -0
- package/esm2022/lib/components/core/avatar/avatar.module.mjs +33 -0
- package/esm2022/lib/components/core/badge/badge.directive.mjs +39 -0
- package/esm2022/lib/components/core/button/button.directive.mjs +86 -0
- package/esm2022/lib/components/core/callout/callout.component.mjs +57 -0
- package/esm2022/lib/components/core/card/card.component.mjs +59 -0
- package/esm2022/lib/components/core/carousel/carousel/carousel.component.mjs +84 -0
- package/esm2022/lib/components/core/carousel/carousel-item/carousel-item.component.mjs +19 -0
- package/esm2022/lib/components/core/carousel/carousel.module.mjs +18 -0
- package/esm2022/lib/components/core/chip/chip.component.mjs +136 -0
- package/esm2022/lib/components/core/collapse/collapse.component.mjs +104 -0
- package/esm2022/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.mjs +24 -0
- package/esm2022/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.mjs +11 -0
- package/esm2022/lib/components/core/dimmer/dimmer.component.mjs +55 -0
- package/esm2022/lib/components/core/dimmer/dimmer.module.mjs +19 -0
- package/esm2022/lib/components/core/dropdown/dropdown/dropdown.component.mjs +144 -0
- package/esm2022/lib/components/core/dropdown/dropdown-item/dropdown-item.component.mjs +61 -0
- package/esm2022/lib/components/core/dropdown/dropdown.module.mjs +18 -0
- package/esm2022/lib/components/core/forward/forward.directive.mjs +53 -0
- package/esm2022/lib/components/core/link/link.component.mjs +42 -0
- package/esm2022/lib/components/core/list/list/list.component.mjs +22 -0
- package/esm2022/lib/components/core/list/list-item/list-item.component.mjs +51 -0
- package/esm2022/lib/components/core/list/list.module.mjs +18 -0
- package/esm2022/lib/components/core/modal/modal.component.mjs +194 -0
- package/esm2022/lib/components/core/notifications/notifications.component.mjs +111 -0
- package/esm2022/lib/components/core/pagination/pagination.component.mjs +130 -0
- package/esm2022/lib/components/core/popover/popover.directive.mjs +176 -0
- package/esm2022/lib/components/core/progress-bar/progress-bar.component.mjs +34 -0
- package/esm2022/lib/components/core/progress-button/progress-button.component.mjs +25 -0
- package/esm2022/lib/components/core/spinner/spinner.component.mjs +30 -0
- package/esm2022/lib/components/core/steppers/steppers-container/steppers-container.component.mjs +116 -0
- package/esm2022/lib/components/core/steppers/steppers-item/steppers-item.component.mjs +20 -0
- package/esm2022/lib/components/core/steppers/steppers.module.mjs +18 -0
- package/esm2022/lib/components/core/tab/tab-container/tab-container.component.mjs +63 -0
- package/esm2022/lib/components/core/tab/tab-item/tab-item.component.mjs +39 -0
- package/esm2022/lib/components/core/tab/tab.module.mjs +18 -0
- package/esm2022/lib/components/core/table/sort/sort-header/sort-header.component.mjs +134 -0
- package/esm2022/lib/components/core/table/sort/sort.directive.mjs +123 -0
- package/esm2022/lib/components/core/table/table.component.mjs +45 -0
- package/esm2022/lib/components/core/table/table.module.mjs +19 -0
- package/esm2022/lib/components/core/tooltip/tooltip.directive.mjs +143 -0
- package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +106 -0
- package/esm2022/lib/components/form/checkbox/checkbox.component.mjs +48 -0
- package/esm2022/lib/components/form/form.module.mjs +59 -0
- package/esm2022/lib/components/form/input/input.component.mjs +187 -0
- package/esm2022/lib/components/form/password-input/password-input.component.mjs +149 -0
- package/esm2022/lib/components/form/radio-button/radio-button.component.mjs +60 -0
- package/esm2022/lib/components/form/range/range.component.mjs +64 -0
- package/esm2022/lib/components/form/rating/rating.component.mjs +50 -0
- package/esm2022/lib/components/form/select/select.component.mjs +70 -0
- package/esm2022/lib/components/form/textarea/textarea.component.mjs +55 -0
- package/esm2022/lib/components/form/upload-drag-drop/upload-drag-drop.component.mjs +142 -0
- package/esm2022/lib/components/form/upload-file-list/upload-file-list.component.mjs +107 -0
- package/esm2022/lib/components/navigation/back-button/back-button.component.mjs +67 -0
- package/esm2022/lib/components/navigation/back-to-top/back-to-top.component.mjs +58 -0
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.mjs +51 -0
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +21 -0
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumbs.module.mjs +18 -0
- package/esm2022/lib/components/navigation/header/header.component.mjs +87 -0
- package/esm2022/lib/components/navigation/megamenu/megamenu.component.mjs +27 -0
- package/esm2022/lib/components/navigation/navbar/navbar/navbar.component.mjs +40 -0
- package/esm2022/lib/components/navigation/navbar/navbar-item/navbar-item.component.mjs +11 -0
- package/esm2022/lib/components/navigation/navbar/navbar.module.mjs +18 -0
- package/esm2022/lib/components/utils/error-page/error-page.component.mjs +74 -0
- package/esm2022/lib/components/utils/icon/icon.component.mjs +58 -0
- package/esm2022/lib/components/utils/language-switcher/language-switcher.component.mjs +50 -0
- package/esm2022/lib/design-angular-kit.module.mjs +213 -0
- package/esm2022/lib/enums/colors.enums.mjs +12 -0
- package/esm2022/lib/enums/sizes.enum.mjs +9 -0
- package/esm2022/lib/interfaces/core.mjs +16 -0
- package/esm2022/lib/interfaces/design-angular-kit-config.mjs +7 -0
- package/esm2022/lib/interfaces/form.mjs +2 -0
- package/esm2022/lib/interfaces/icon.mjs +165 -0
- package/esm2022/lib/interfaces/sortable-table.mjs +6 -0
- package/esm2022/lib/pipes/date-ago.pipe.mjs +56 -0
- package/esm2022/lib/pipes/duration.pipe.mjs +110 -0
- package/esm2022/lib/pipes/mark-matching-text.pipe.mjs +48 -0
- package/esm2022/lib/provide-design-angular-kit.mjs +61 -0
- package/esm2022/lib/services/notification/notification.service.mjs +120 -0
- package/esm2022/lib/utils/coercion.mjs +18 -0
- package/esm2022/lib/utils/date-utils.mjs +160 -0
- package/esm2022/lib/utils/file-utils.mjs +73 -0
- package/esm2022/lib/utils/regex.mjs +31 -0
- package/esm2022/lib/validators/it-validators.mjs +153 -0
- package/esm2022/public_api.mjs +99 -0
- package/fesm2022/design-angular-kit.mjs +5556 -0
- package/fesm2022/design-angular-kit.mjs.map +1 -0
- package/lib/abstracts/{abstract-form-component.d.ts → abstract-form.component.d.ts} +12 -14
- package/lib/abstracts/abstract.component.d.ts +18 -8
- package/lib/components/core/accordion/accordion.component.d.ts +11 -5
- package/lib/components/core/alert/alert.component.d.ts +15 -10
- package/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.d.ts +29 -0
- package/lib/components/core/avatar/avatar-group/avatar-group.component.d.ts +13 -0
- package/lib/components/core/avatar/avatar.directive.d.ts +33 -0
- package/lib/components/core/avatar/avatar.module.d.ts +9 -0
- package/lib/components/core/badge/badge.directive.d.ts +14 -7
- package/lib/components/core/button/button.directive.d.ts +25 -15
- package/lib/components/core/callout/callout.component.d.ts +18 -20
- package/lib/components/core/card/card.component.d.ts +46 -18
- package/lib/components/core/carousel/carousel/carousel.component.d.ts +34 -15
- package/lib/components/core/carousel/carousel-item/carousel-item.component.d.ts +8 -3
- package/lib/components/core/carousel/carousel.module.d.ts +8 -0
- package/lib/components/core/chip/chip.component.d.ts +29 -15
- package/lib/components/core/collapse/collapse.component.d.ts +22 -15
- package/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.d.ts +3 -3
- package/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.d.ts +3 -3
- package/lib/components/core/dimmer/dimmer.component.d.ts +6 -6
- package/lib/components/core/dimmer/dimmer.module.d.ts +9 -0
- package/lib/components/core/dropdown/dropdown/dropdown.component.d.ts +30 -17
- package/lib/components/core/dropdown/dropdown-item/dropdown-item.component.d.ts +15 -12
- package/lib/components/core/dropdown/dropdown.module.d.ts +8 -0
- package/lib/components/core/forward/forward.directive.d.ts +3 -3
- package/lib/components/core/link/link.component.d.ts +14 -10
- package/lib/components/core/list/list/list.component.d.ts +20 -6
- package/lib/components/core/list/list-item/list-item.component.d.ts +23 -9
- package/lib/components/core/list/list.module.d.ts +8 -0
- package/lib/components/core/modal/modal.component.d.ts +89 -13
- package/lib/components/core/notifications/notifications.component.d.ts +9 -8
- package/lib/components/core/pagination/pagination.component.d.ts +71 -10
- package/lib/components/core/popover/popover.directive.d.ts +15 -14
- package/lib/components/core/progress-bar/progress-bar.component.d.ts +11 -8
- package/lib/components/core/progress-button/progress-button.component.d.ts +5 -6
- package/lib/components/core/spinner/spinner.component.d.ts +13 -10
- package/lib/components/core/steppers/steppers-container/steppers-container.component.d.ts +55 -27
- package/lib/components/core/steppers/steppers-item/steppers-item.component.d.ts +5 -4
- package/lib/components/core/steppers/steppers.module.d.ts +8 -0
- package/lib/components/core/tab/tab-container/tab-container.component.d.ts +15 -12
- package/lib/components/core/tab/tab-item/tab-item.component.d.ts +14 -10
- package/lib/components/core/tab/tab.module.d.ts +8 -0
- package/lib/components/core/table/sort/sort-header/sort-header.component.d.ts +72 -0
- package/lib/components/core/table/sort/sort.directive.d.ts +53 -0
- package/lib/components/core/table/table.component.d.ts +26 -20
- package/lib/components/core/table/table.module.d.ts +9 -0
- package/lib/components/core/tooltip/tooltip.directive.d.ts +12 -11
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +55 -0
- package/lib/components/form/checkbox/checkbox.component.d.ts +23 -12
- package/lib/components/form/form.module.d.ts +17 -0
- package/lib/components/form/input/input.component.d.ts +42 -43
- package/lib/components/form/password-input/password-input.component.d.ts +35 -10
- package/lib/components/form/radio-button/radio-button.component.d.ts +20 -11
- package/lib/components/form/range/range.component.d.ts +42 -0
- package/lib/components/form/rating/rating.component.d.ts +24 -0
- package/lib/components/form/select/select.component.d.ts +12 -6
- package/lib/components/form/textarea/textarea.component.d.ts +15 -5
- package/lib/components/form/upload-drag-drop/upload-drag-drop.component.d.ts +18 -12
- package/lib/components/form/upload-file-list/upload-file-list.component.d.ts +14 -11
- package/lib/components/navigation/back-button/back-button.component.d.ts +8 -8
- package/lib/components/navigation/back-to-top/back-to-top.component.d.ts +15 -16
- package/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.d.ts +12 -14
- package/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +9 -8
- package/lib/components/navigation/breadcrumbs/breadcrumbs.module.d.ts +8 -0
- package/lib/components/navigation/header/header.component.d.ts +28 -25
- package/lib/components/navigation/megamenu/megamenu.component.d.ts +22 -0
- package/lib/components/navigation/navbar/navbar/navbar.component.d.ts +16 -0
- package/lib/components/navigation/navbar/navbar-item/navbar-item.component.d.ts +5 -0
- package/lib/components/navigation/navbar/navbar.module.d.ts +8 -0
- package/lib/components/utils/error-page/error-page.component.d.ts +44 -0
- package/lib/components/utils/icon/icon.component.d.ts +25 -17
- package/lib/components/utils/language-switcher/language-switcher.component.d.ts +9 -5
- package/lib/design-angular-kit.module.d.ts +44 -7
- package/lib/enums/colors.enums.d.ts +10 -0
- package/lib/enums/sizes.enum.d.ts +7 -0
- package/lib/interfaces/core.d.ts +16 -15
- package/lib/interfaces/design-angular-kit-config.d.ts +30 -0
- package/lib/interfaces/form.d.ts +9 -9
- package/lib/interfaces/icon.d.ts +4 -3
- package/lib/interfaces/sortable-table.d.ts +33 -0
- package/lib/pipes/date-ago.pipe.d.ts +17 -0
- package/lib/pipes/duration.pipe.d.ts +35 -0
- package/lib/pipes/mark-matching-text.pipe.d.ts +15 -7
- package/lib/provide-design-angular-kit.d.ts +7 -0
- package/lib/services/{notifications/notifications.service.d.ts → notification/notification.service.d.ts} +3 -3
- package/lib/utils/coercion.d.ts +14 -0
- package/lib/utils/date-utils.d.ts +78 -0
- package/lib/utils/file-utils.d.ts +1 -1
- package/lib/utils/regex.d.ts +5 -0
- package/lib/validators/it-validators.d.ts +9 -2
- package/package.json +17 -22
- package/public_api.d.ts +31 -4
- package/esm2020/lib/abstracts/abstract-form-component.mjs +0 -174
- package/esm2020/lib/abstracts/abstract.component.mjs +0 -27
- package/esm2020/lib/components/core/accordion/accordion.component.mjs +0 -31
- package/esm2020/lib/components/core/alert/alert.component.mjs +0 -69
- package/esm2020/lib/components/core/badge/badge.directive.mjs +0 -34
- package/esm2020/lib/components/core/button/button.directive.mjs +0 -80
- package/esm2020/lib/components/core/callout/callout.component.mjs +0 -84
- package/esm2020/lib/components/core/card/card.component.mjs +0 -58
- package/esm2020/lib/components/core/carousel/carousel/carousel.component.mjs +0 -66
- package/esm2020/lib/components/core/carousel/carousel-item/carousel-item.component.mjs +0 -14
- package/esm2020/lib/components/core/chip/chip.component.mjs +0 -89
- package/esm2020/lib/components/core/collapse/collapse.component.mjs +0 -101
- package/esm2020/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.mjs +0 -24
- package/esm2020/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.mjs +0 -11
- package/esm2020/lib/components/core/dimmer/dimmer.component.mjs +0 -59
- package/esm2020/lib/components/core/dropdown/dropdown/dropdown.component.mjs +0 -130
- package/esm2020/lib/components/core/dropdown/dropdown-item/dropdown-item.component.mjs +0 -68
- package/esm2020/lib/components/core/forward/forward.directive.mjs +0 -51
- package/esm2020/lib/components/core/link/link.component.mjs +0 -40
- package/esm2020/lib/components/core/list/list/list.component.mjs +0 -13
- package/esm2020/lib/components/core/list/list-item/list-item.component.mjs +0 -36
- package/esm2020/lib/components/core/modal/modal.component.mjs +0 -98
- package/esm2020/lib/components/core/notifications/notifications.component.mjs +0 -110
- package/esm2020/lib/components/core/pagination/pagination.component.mjs +0 -51
- package/esm2020/lib/components/core/popover/popover.directive.mjs +0 -179
- package/esm2020/lib/components/core/progress-bar/progress-bar.component.mjs +0 -34
- package/esm2020/lib/components/core/progress-button/progress-button.component.mjs +0 -27
- package/esm2020/lib/components/core/spinner/spinner.component.mjs +0 -35
- package/esm2020/lib/components/core/steppers/steppers-container/steppers-container.component.mjs +0 -119
- package/esm2020/lib/components/core/steppers/steppers-item/steppers-item.component.mjs +0 -18
- package/esm2020/lib/components/core/tab/tab-container/tab-container.component.mjs +0 -59
- package/esm2020/lib/components/core/tab/tab-item/tab-item.component.mjs +0 -36
- package/esm2020/lib/components/core/table/table.component.mjs +0 -57
- package/esm2020/lib/components/core/tooltip/tooltip.directive.mjs +0 -143
- package/esm2020/lib/components/form/checkbox/checkbox.component.mjs +0 -40
- package/esm2020/lib/components/form/input/input.component.mjs +0 -222
- package/esm2020/lib/components/form/password-input/password-input.component.mjs +0 -112
- package/esm2020/lib/components/form/radio-button/radio-button.component.mjs +0 -53
- package/esm2020/lib/components/form/select/select.component.mjs +0 -62
- package/esm2020/lib/components/form/textarea/textarea.component.mjs +0 -46
- package/esm2020/lib/components/form/upload-drag-drop/upload-drag-drop.component.mjs +0 -137
- package/esm2020/lib/components/form/upload-file-list/upload-file-list.component.mjs +0 -104
- package/esm2020/lib/components/navigation/back-button/back-button.component.mjs +0 -69
- package/esm2020/lib/components/navigation/back-to-top/back-to-top.component.mjs +0 -74
- package/esm2020/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.mjs +0 -45
- package/esm2020/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +0 -23
- package/esm2020/lib/components/navigation/header/header.component.mjs +0 -63
- package/esm2020/lib/components/utils/icon/icon.component.mjs +0 -54
- package/esm2020/lib/components/utils/language-switcher/language-switcher.component.mjs +0 -39
- package/esm2020/lib/components/utils/not-found-page/not-found-page.component.mjs +0 -13
- package/esm2020/lib/design-angular-kit.module.mjs +0 -56
- package/esm2020/lib/interfaces/core.mjs +0 -16
- package/esm2020/lib/interfaces/form.mjs +0 -2
- package/esm2020/lib/interfaces/icon.mjs +0 -2
- package/esm2020/lib/modules/components.module.mjs +0 -257
- package/esm2020/lib/pipes/mark-matching-text.pipe.mjs +0 -36
- package/esm2020/lib/services/notifications/notifications.service.mjs +0 -120
- package/esm2020/lib/utils/boolean-input.mjs +0 -15
- package/esm2020/lib/utils/file-utils.mjs +0 -73
- package/esm2020/lib/utils/regex.mjs +0 -26
- package/esm2020/lib/validators/it-validators.mjs +0 -134
- package/esm2020/public_api.mjs +0 -70
- package/fesm2015/design-angular-kit.mjs +0 -3850
- package/fesm2015/design-angular-kit.mjs.map +0 -1
- package/fesm2020/design-angular-kit.mjs +0 -3797
- package/fesm2020/design-angular-kit.mjs.map +0 -1
- package/lib/components/utils/not-found-page/not-found-page.component.d.ts +0 -5
- package/lib/modules/components.module.d.ts +0 -61
- package/lib/utils/boolean-input.d.ts +0 -11
- /package/{esm2020 → esm2022}/design-angular-kit.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/interfaces/utils.mjs +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export type ItDurationPipeType = 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
|
|
5
|
+
/**
|
|
6
|
+
* Transform a number into a duration.
|
|
7
|
+
* Is necessary indicate the value expressed by the number, for example 'day'.
|
|
8
|
+
* @example
|
|
9
|
+
* - 1, 'day' -> 1 day
|
|
10
|
+
* - 5, 'day' -> 5 days
|
|
11
|
+
* - 7, 'day' -> 1 week
|
|
12
|
+
* - 365, 'day' -> 1 year
|
|
13
|
+
* - 2, 'week' -> 2 weeks
|
|
14
|
+
* ...
|
|
15
|
+
*/
|
|
16
|
+
export declare class ItDurationPipe extends TranslatePipe implements PipeTransform {
|
|
17
|
+
/**
|
|
18
|
+
* Transform a number into a duration.
|
|
19
|
+
* Is necessary indicate the value expressed by the number, for example 'day'.
|
|
20
|
+
* @example
|
|
21
|
+
* - 1, 'day' -> 1 day
|
|
22
|
+
* - 5, 'day' -> 5 days
|
|
23
|
+
* - 7, 'day' -> 1 week
|
|
24
|
+
* - 8, 'day' -> 1 week
|
|
25
|
+
* - 365, 'day' -> 1 year
|
|
26
|
+
* - 2, 'week' -> 2 weeks
|
|
27
|
+
* - 24, 'month' -> 1 year
|
|
28
|
+
* ...
|
|
29
|
+
* @param value the number
|
|
30
|
+
* @param type the number expressed type
|
|
31
|
+
*/
|
|
32
|
+
transform(value: string | number | undefined, type: ItDurationPipeType): string;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ItDurationPipe, never>;
|
|
34
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ItDurationPipe, "itDuration", true>;
|
|
35
|
+
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { PipeTransform } from
|
|
2
|
-
import { DomSanitizer } from
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Allows you to highlight text with the <mark> tag
|
|
6
|
+
*/
|
|
7
|
+
export declare class ItMarkMatchingTextPipe implements PipeTransform {
|
|
8
|
+
private readonly domSanitizer;
|
|
6
9
|
constructor(domSanitizer: DomSanitizer);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Allows you to highlight text with the <mark> tag
|
|
12
|
+
* @param allString the full text to search from
|
|
13
|
+
* @param searchString the string to search
|
|
14
|
+
*/
|
|
15
|
+
transform(allString: string | undefined, searchString: string | number | null | undefined): SafeHtml | string | undefined;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ItMarkMatchingTextPipe, never>;
|
|
17
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ItMarkMatchingTextPipe, "itMarkMatchingText", true>;
|
|
10
18
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { DesignAngularKitConfig } from './interfaces/design-angular-kit-config';
|
|
3
|
+
/**
|
|
4
|
+
* Configures DesignAngularKit library
|
|
5
|
+
* @param config the DesignAngularKit config
|
|
6
|
+
*/
|
|
7
|
+
export declare function provideDesignAngularKit(config?: DesignAngularKitConfig): EnvironmentProviders;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { Notification, NotificationPosition, NotificationType } from '../../interfaces/core';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class ItNotificationService {
|
|
5
5
|
private subject;
|
|
6
6
|
/**
|
|
7
7
|
* Listen on notification arrived
|
|
@@ -58,6 +58,6 @@ export declare class NotificationsService {
|
|
|
58
58
|
* @param position notification position
|
|
59
59
|
*/
|
|
60
60
|
info(title: string, message?: string, dismissible?: boolean, duration?: number, position?: NotificationPosition): void;
|
|
61
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
62
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ItNotificationService, never>;
|
|
62
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ItNotificationService>;
|
|
63
63
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type BooleanInput = "false" | "true" | boolean | undefined;
|
|
2
|
+
/**
|
|
3
|
+
* Transforms a value (typically a string) to a boolean.
|
|
4
|
+
* Intended to be used as a transform function of an input.
|
|
5
|
+
*
|
|
6
|
+
* @usageNotes
|
|
7
|
+
* ```typescript
|
|
8
|
+
* @Input({ transform: booleanAttribute }) status?: boolean;
|
|
9
|
+
* ```
|
|
10
|
+
* @param {BooleanInput} value Value to be transformed.
|
|
11
|
+
*
|
|
12
|
+
* @publicApi
|
|
13
|
+
*/
|
|
14
|
+
export declare function inputToBoolean(value: BooleanInput): boolean;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare class ItDateUtils {
|
|
3
|
+
/**
|
|
4
|
+
* Add seconds to date
|
|
5
|
+
* @param date the date
|
|
6
|
+
* @param seconds seconds to add
|
|
7
|
+
*/
|
|
8
|
+
static addSeconds(date: Date, seconds: number): Date;
|
|
9
|
+
/**
|
|
10
|
+
* Add minutes to date
|
|
11
|
+
* @param date the date
|
|
12
|
+
* @param minutes minutes to add
|
|
13
|
+
*/
|
|
14
|
+
static addMinutes(date: Date, minutes: number): Date;
|
|
15
|
+
/**
|
|
16
|
+
* Add hours to date
|
|
17
|
+
* @param date the date
|
|
18
|
+
* @param hours hours to add
|
|
19
|
+
*/
|
|
20
|
+
static addHours(date: Date, hours: number): Date;
|
|
21
|
+
/**
|
|
22
|
+
* Add days to date
|
|
23
|
+
* @param date the date
|
|
24
|
+
* @param days days to add
|
|
25
|
+
*/
|
|
26
|
+
static addDays(date: Date, days: number): Date;
|
|
27
|
+
/**
|
|
28
|
+
* Add years to date
|
|
29
|
+
* @param date the date
|
|
30
|
+
* @param months months to add
|
|
31
|
+
*/
|
|
32
|
+
static addMonths(date: Date, months: number): Date;
|
|
33
|
+
/**
|
|
34
|
+
* Add years to date
|
|
35
|
+
* @param date the date
|
|
36
|
+
* @param years years to add
|
|
37
|
+
*/
|
|
38
|
+
static addYears(date: Date, years: number): Date;
|
|
39
|
+
/**
|
|
40
|
+
* Calculate number of days between two date
|
|
41
|
+
* @param startDate the start date
|
|
42
|
+
* @param endDate the end date
|
|
43
|
+
*/
|
|
44
|
+
static countDays(startDate: Date, endDate: Date): number;
|
|
45
|
+
/**
|
|
46
|
+
* Check if string is a date with iso format
|
|
47
|
+
* @param value the string
|
|
48
|
+
*/
|
|
49
|
+
static isIsoString(value: string | null): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Convert iso string to Date
|
|
52
|
+
* @param isoString the iso string
|
|
53
|
+
*/
|
|
54
|
+
static isoStringToDate(isoString: string | null): Date | null;
|
|
55
|
+
/**
|
|
56
|
+
* Remove time from an iso date string
|
|
57
|
+
* @param isoString the iso string
|
|
58
|
+
*/
|
|
59
|
+
static isoStringRemoveTime(isoString: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Set iso string hours to 0 and format correctly the date (consider timezone offset)
|
|
62
|
+
* @example '2024-03-04T23:00:00.000Z' -> '2024-03-05T00:00:00.000Z'
|
|
63
|
+
* @param isoString the iso string
|
|
64
|
+
*/
|
|
65
|
+
static isoStringSetZeroTime(isoString: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Calculate the date time left and return the string format [d h m s]
|
|
68
|
+
* @param endDate
|
|
69
|
+
*/
|
|
70
|
+
static timeLeftString(endDate: Date): Observable<string>;
|
|
71
|
+
/**
|
|
72
|
+
* Calculate the next day of week
|
|
73
|
+
* @param dayOfWeek Day of week 0=Sunday, 1=Monday...4=Thursday...
|
|
74
|
+
* @param hour the specif hour
|
|
75
|
+
* @param minute the specific minute
|
|
76
|
+
*/
|
|
77
|
+
static nextWeekDayAndTime(dayOfWeek: number, hour?: number, minute?: number): Date;
|
|
78
|
+
}
|
package/lib/utils/regex.d.ts
CHANGED
|
@@ -16,8 +16,10 @@ export declare class ItValidators {
|
|
|
16
16
|
/**
|
|
17
17
|
* Check whether our password and confirm password are a match
|
|
18
18
|
* @param control
|
|
19
|
+
* @param passwordControlName the password formControlName
|
|
20
|
+
* @param confirmControlName the confirmPassword formControlName
|
|
19
21
|
*/
|
|
20
|
-
static passwordMatch(control: AbstractControl): AbstractControl | null;
|
|
22
|
+
static passwordMatch(control: AbstractControl, passwordControlName?: string, confirmControlName?: string): AbstractControl | null;
|
|
21
23
|
/**
|
|
22
24
|
* Password validator
|
|
23
25
|
* @param minLength minimum password length - default 10
|
|
@@ -25,8 +27,9 @@ export declare class ItValidators {
|
|
|
25
27
|
* @param hasCapitalCase check whether the entered password has upper case letter - default true
|
|
26
28
|
* @param hasSmallCase check whether the entered password has a lower-case letter - default true
|
|
27
29
|
* @param hasSpecialCharacters check whether the entered password has a special character - default true
|
|
30
|
+
* @param required the field is required - default true
|
|
28
31
|
*/
|
|
29
|
-
static password(minLength?: number, hasNumber?: boolean, hasCapitalCase?: boolean, hasSmallCase?: boolean, hasSpecialCharacters?: boolean): ValidatorFn;
|
|
32
|
+
static password(minLength?: number, hasNumber?: boolean, hasCapitalCase?: boolean, hasSmallCase?: boolean, hasSpecialCharacters?: boolean, required?: boolean): ValidatorFn;
|
|
30
33
|
/**
|
|
31
34
|
* Email validator
|
|
32
35
|
*/
|
|
@@ -51,6 +54,10 @@ export declare class ItValidators {
|
|
|
51
54
|
* Italian Postal Code validator (CAP)
|
|
52
55
|
*/
|
|
53
56
|
static get cap(): ValidatorFn;
|
|
57
|
+
/**
|
|
58
|
+
* IBAN validator
|
|
59
|
+
*/
|
|
60
|
+
static get iban(): ValidatorFn;
|
|
54
61
|
/**
|
|
55
62
|
* Check if value is a valid RegExp
|
|
56
63
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "design-angular-kit",
|
|
3
3
|
"description": "Un toolkit Angular conforme alle linee guida di design per i servizi web della PA",
|
|
4
|
-
"version": "1.0.0-
|
|
4
|
+
"version": "1.0.0-prerelease.2",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
@@ -28,22 +28,20 @@
|
|
|
28
28
|
}
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"tslib": "^2.
|
|
31
|
+
"tslib": "^2.6.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@angular/animations": "^
|
|
35
|
-
"@angular/common": "^
|
|
36
|
-
"@angular/core": "^
|
|
37
|
-
"@angular/platform-browser": "^
|
|
38
|
-
"@
|
|
39
|
-
"@ngx-translate/
|
|
40
|
-
"
|
|
34
|
+
"@angular/animations": "^17.0.0",
|
|
35
|
+
"@angular/common": "^17.0.0",
|
|
36
|
+
"@angular/core": "^17.0.0",
|
|
37
|
+
"@angular/platform-browser": "^17.0.0",
|
|
38
|
+
"@angular/router": "^17.0.0",
|
|
39
|
+
"@ngx-translate/core": "^15.0.0",
|
|
40
|
+
"@ngx-translate/http-loader": "^8.0.0",
|
|
41
|
+
"bootstrap-italia": "^2.8.2"
|
|
41
42
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"esm2020": "esm2020/design-angular-kit.mjs",
|
|
45
|
-
"fesm2020": "fesm2020/design-angular-kit.mjs",
|
|
46
|
-
"fesm2015": "fesm2015/design-angular-kit.mjs",
|
|
43
|
+
"sideEffects": false,
|
|
44
|
+
"module": "fesm2022/design-angular-kit.mjs",
|
|
47
45
|
"typings": "index.d.ts",
|
|
48
46
|
"exports": {
|
|
49
47
|
"./package.json": {
|
|
@@ -51,12 +49,9 @@
|
|
|
51
49
|
},
|
|
52
50
|
".": {
|
|
53
51
|
"types": "./index.d.ts",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"node": "./fesm2015/design-angular-kit.mjs",
|
|
58
|
-
"default": "./fesm2020/design-angular-kit.mjs"
|
|
52
|
+
"esm2022": "./esm2022/design-angular-kit.mjs",
|
|
53
|
+
"esm": "./esm2022/design-angular-kit.mjs",
|
|
54
|
+
"default": "./fesm2022/design-angular-kit.mjs"
|
|
59
55
|
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}
|
|
56
|
+
}
|
|
57
|
+
}
|
package/public_api.d.ts
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
+
export * from './lib/provide-design-angular-kit';
|
|
1
2
|
export * from './lib/design-angular-kit.module';
|
|
2
|
-
export * from './lib/modules/components.module';
|
|
3
3
|
export * from './lib/components/core/accordion/accordion.component';
|
|
4
4
|
export * from './lib/components/core/alert/alert.component';
|
|
5
|
+
export * from './lib/components/core/avatar/avatar.module';
|
|
6
|
+
export * from './lib/components/core/avatar/avatar.directive';
|
|
7
|
+
export * from './lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component';
|
|
8
|
+
export * from './lib/components/core/avatar/avatar-group/avatar-group.component';
|
|
5
9
|
export * from './lib/components/core/badge/badge.directive';
|
|
6
10
|
export * from './lib/components/core/button/button.directive';
|
|
7
11
|
export * from './lib/components/core/callout/callout.component';
|
|
8
12
|
export * from './lib/components/core/card/card.component';
|
|
13
|
+
export * from './lib/components/core/carousel/carousel.module';
|
|
9
14
|
export * from './lib/components/core/carousel/carousel/carousel.component';
|
|
10
15
|
export * from './lib/components/core/carousel/carousel-item/carousel-item.component';
|
|
11
16
|
export * from './lib/components/core/chip/chip.component';
|
|
12
17
|
export * from './lib/components/core/collapse/collapse.component';
|
|
13
|
-
export * from './lib/components/core/dimmer/dimmer
|
|
18
|
+
export * from './lib/components/core/dimmer/dimmer.module';
|
|
14
19
|
export * from './lib/components/core/dimmer/dimmer.component';
|
|
20
|
+
export * from './lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component';
|
|
15
21
|
export * from './lib/components/core/dimmer/dimmer-icon/dimmer-icon.component';
|
|
22
|
+
export * from './lib/components/core/dropdown/dropdown.module';
|
|
16
23
|
export * from './lib/components/core/dropdown/dropdown/dropdown.component';
|
|
17
24
|
export * from './lib/components/core/dropdown/dropdown-item/dropdown-item.component';
|
|
18
25
|
export * from './lib/components/core/forward/forward.directive';
|
|
19
26
|
export * from './lib/components/core/link/link.component';
|
|
27
|
+
export * from './lib/components/core/list/list.module';
|
|
20
28
|
export * from './lib/components/core/list/list/list.component';
|
|
21
29
|
export * from './lib/components/core/list/list-item/list-item.component';
|
|
22
30
|
export * from './lib/components/core/modal/modal.component';
|
|
@@ -26,34 +34,53 @@ export * from './lib/components/core/popover/popover.directive';
|
|
|
26
34
|
export * from './lib/components/core/progress-bar/progress-bar.component';
|
|
27
35
|
export * from './lib/components/core/progress-button/progress-button.component';
|
|
28
36
|
export * from './lib/components/core/spinner/spinner.component';
|
|
37
|
+
export * from './lib/components/core/steppers/steppers.module';
|
|
29
38
|
export * from './lib/components/core/steppers/steppers-container/steppers-container.component';
|
|
30
39
|
export * from './lib/components/core/steppers/steppers-item/steppers-item.component';
|
|
40
|
+
export * from './lib/components/core/tab/tab.module';
|
|
31
41
|
export * from './lib/components/core/tab/tab-container/tab-container.component';
|
|
32
42
|
export * from './lib/components/core/tab/tab-item/tab-item.component';
|
|
43
|
+
export * from './lib/components/core/table/table.module';
|
|
33
44
|
export * from './lib/components/core/table/table.component';
|
|
45
|
+
export * from './lib/components/core/table/sort/sort.directive';
|
|
46
|
+
export * from './lib/components/core/table/sort/sort-header/sort-header.component';
|
|
34
47
|
export * from './lib/components/core/tooltip/tooltip.directive';
|
|
48
|
+
export * from './lib/components/form/form.module';
|
|
49
|
+
export * from './lib/components/form/autocomplete/autocomplete.component';
|
|
35
50
|
export * from './lib/components/form/checkbox/checkbox.component';
|
|
36
51
|
export * from './lib/components/form/input/input.component';
|
|
37
52
|
export * from './lib/components/form/password-input/password-input.component';
|
|
38
53
|
export * from './lib/components/form/radio-button/radio-button.component';
|
|
54
|
+
export * from './lib/components/form/range/range.component';
|
|
55
|
+
export * from './lib/components/form/rating/rating.component';
|
|
39
56
|
export * from './lib/components/form/select/select.component';
|
|
40
57
|
export * from './lib/components/form/textarea/textarea.component';
|
|
41
58
|
export * from './lib/components/form/upload-drag-drop/upload-drag-drop.component';
|
|
42
59
|
export * from './lib/components/form/upload-file-list/upload-file-list.component';
|
|
43
60
|
export * from './lib/components/navigation/back-button/back-button.component';
|
|
44
61
|
export * from './lib/components/navigation/back-to-top/back-to-top.component';
|
|
62
|
+
export * from './lib/components/navigation/breadcrumbs/breadcrumbs.module';
|
|
45
63
|
export * from './lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component';
|
|
46
64
|
export * from './lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component';
|
|
47
65
|
export * from './lib/components/navigation/header/header.component';
|
|
66
|
+
export * from './lib/components/navigation/megamenu/megamenu.component';
|
|
67
|
+
export * from './lib/components/navigation/navbar/navbar.module';
|
|
68
|
+
export * from './lib/components/navigation/navbar/navbar/navbar.component';
|
|
69
|
+
export * from './lib/components/navigation/navbar/navbar-item/navbar-item.component';
|
|
70
|
+
export * from './lib/components/utils/error-page/error-page.component';
|
|
48
71
|
export * from './lib/components/utils/icon/icon.component';
|
|
49
72
|
export * from './lib/components/utils/language-switcher/language-switcher.component';
|
|
50
|
-
export * from './lib/
|
|
51
|
-
export * from './lib/
|
|
73
|
+
export * from './lib/services/notification/notification.service';
|
|
74
|
+
export * from './lib/pipes/date-ago.pipe';
|
|
75
|
+
export * from './lib/pipes/duration.pipe';
|
|
52
76
|
export * from './lib/pipes/mark-matching-text.pipe';
|
|
77
|
+
export * from './lib/interfaces/design-angular-kit-config';
|
|
78
|
+
export * from './lib/interfaces/sortable-table';
|
|
53
79
|
export * from './lib/interfaces/core';
|
|
54
80
|
export * from './lib/interfaces/form';
|
|
55
81
|
export * from './lib/interfaces/icon';
|
|
56
82
|
export * from './lib/interfaces/utils';
|
|
57
83
|
export * from './lib/utils/regex';
|
|
84
|
+
export * from './lib/utils/date-utils';
|
|
58
85
|
export * from './lib/utils/file-utils';
|
|
59
86
|
export * from './lib/validators/it-validators';
|
|
@@ -1,174 +0,0 @@
|
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWJzdHJhY3QtZm9ybS1jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9kZXNpZ24tYW5ndWxhci1raXQvc3JjL2xpYi9hYnN0cmFjdHMvYWJzdHJhY3QtZm9ybS1jb21wb25lbnQudHMiXS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component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class AbstractComponent {
|
|
4
|
-
constructor(_renderer, _elementRef, _changeDetectorRef) {
|
|
5
|
-
this._renderer = _renderer;
|
|
6
|
-
this._elementRef = _elementRef;
|
|
7
|
-
this._changeDetectorRef = _changeDetectorRef;
|
|
8
|
-
this.valueChanges = new EventEmitter();
|
|
9
|
-
}
|
|
10
|
-
ngAfterViewInit() {
|
|
11
|
-
this._renderer.removeAttribute(this._elementRef.nativeElement, 'id');
|
|
12
|
-
}
|
|
13
|
-
ngOnChanges(changes) {
|
|
14
|
-
this.valueChanges.next(); // The inputs were changed
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
AbstractComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbstractComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
-
AbstractComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AbstractComponent, selector: "ng-component", inputs: { id: "id" }, outputs: { valueChanges: "valueChanges" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbstractComponent, decorators: [{
|
|
20
|
-
type: Component,
|
|
21
|
-
args: [{ template: '' }]
|
|
22
|
-
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { id: [{
|
|
23
|
-
type: Input
|
|
24
|
-
}], valueChanges: [{
|
|
25
|
-
type: Output
|
|
26
|
-
}] } });
|
|
27
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWJzdHJhY3QuY29tcG9uZW50Lmpz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