design-angular-kit 0.13.0 → 1.0.0-0
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 +61 -31
- package/esm2020/design-angular-kit.mjs +5 -0
- package/esm2020/lib/badge/badge.directive.mjs +83 -0
- package/esm2020/lib/breadcrumb/breadcrumb-item.component.mjs +66 -0
- package/esm2020/lib/breadcrumb/breadcrumb.component.mjs +89 -0
- package/esm2020/lib/button/button.directive.mjs +185 -0
- package/esm2020/lib/button/button.module.mjs +18 -0
- package/esm2020/lib/checkbox/checkbox.component.mjs +138 -0
- package/esm2020/lib/collapse/collapse-group.component.mjs +57 -0
- package/esm2020/lib/collapse/collapse-item.component.mjs +79 -0
- package/esm2020/lib/collapse/collapse.config.mjs +12 -0
- package/esm2020/lib/collapse/collapse.directive.mjs +55 -0
- package/esm2020/lib/collapse/collapse.module.mjs +22 -0
- package/esm2020/lib/design-angular-kit.module.mjs +142 -0
- package/esm2020/lib/dropdown/dropdown-divider.component.mjs +11 -0
- package/esm2020/lib/dropdown/dropdown-item.component.mjs +97 -0
- package/esm2020/lib/dropdown/dropdown.component.mjs +143 -0
- package/esm2020/lib/dropdown/dropdown.config.mjs +12 -0
- package/esm2020/lib/dropdown/dropdown.directive.mjs +156 -0
- package/esm2020/lib/dropdown/dropdown.module.mjs +25 -0
- package/esm2020/lib/enums/icons.enum.mjs +27 -0
- package/esm2020/lib/form-input/form-input-password.utils.mjs +154 -0
- package/esm2020/lib/form-input/form-input.component.mjs +495 -0
- package/esm2020/lib/form-input/it-prefix.directive.mjs +13 -0
- package/esm2020/lib/form-input/it-suffix.directive.mjs +13 -0
- package/esm2020/lib/form-input/it-text-prefix.directive.mjs +13 -0
- package/esm2020/lib/form-input/it-text-suffix.directive.mjs +13 -0
- package/esm2020/lib/form-input/mark-matching-text.pipe.mjs +36 -0
- package/esm2020/lib/icon/icon.component.mjs +87 -0
- package/esm2020/lib/icon/icon.module.mjs +18 -0
- package/esm2020/lib/models/Alignment.mjs +15 -0
- package/esm2020/lib/models/ButtonSize.mjs +15 -0
- package/esm2020/lib/models/InputType.mjs +44 -0
- package/esm2020/lib/models/ThemeColor.mjs +30 -0
- package/esm2020/lib/popover/popover.config.mjs +17 -0
- package/esm2020/lib/popover/popover.directive.mjs +33 -0
- package/esm2020/lib/popover/popover.module.mjs +19 -0
- package/esm2020/lib/progress-bar/progress-bar.component.mjs +98 -0
- package/esm2020/lib/radio/radio.component.mjs +287 -0
- package/esm2020/lib/radio/unique-selection-dispatcher.mjs +55 -0
- package/esm2020/lib/tabs/tab-group.component.mjs +177 -0
- package/esm2020/lib/tabs/tab.component.mjs +73 -0
- package/esm2020/lib/tabs/tabs.module.mjs +20 -0
- package/esm2020/lib/toggle/toggle.component.mjs +86 -0
- package/esm2020/lib/tooltip/tooltip.config.mjs +17 -0
- package/esm2020/lib/tooltip/tooltip.directive.mjs +43 -0
- package/esm2020/lib/tooltip/tooltip.module.mjs +19 -0
- package/esm2020/lib/util/focus-mouse.directive.mjs +32 -0
- package/esm2020/lib/util/util.mjs +12 -0
- package/esm2020/lib/util/utils.module.mjs +16 -0
- package/esm2020/public_api.mjs +40 -0
- package/fesm2015/design-angular-kit.mjs +3181 -0
- package/fesm2015/design-angular-kit.mjs.map +1 -0
- package/fesm2020/design-angular-kit.mjs +3160 -0
- package/fesm2020/design-angular-kit.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/badge/badge.directive.d.ts +11 -5
- package/lib/breadcrumb/breadcrumb-item.component.d.ts +16 -5
- package/lib/breadcrumb/breadcrumb.component.d.ts +12 -5
- package/lib/button/button.directive.d.ts +72 -0
- package/lib/button/button.module.d.ts +8 -0
- package/lib/checkbox/checkbox.component.d.ts +25 -5
- package/lib/collapse/collapse-group.component.d.ts +6 -2
- package/lib/collapse/collapse-item.component.d.ts +16 -8
- package/lib/collapse/collapse.config.d.ts +6 -0
- package/lib/collapse/collapse.directive.d.ts +13 -28
- package/lib/collapse/collapse.module.d.ts +12 -0
- package/lib/design-angular-kit.module.d.ts +27 -0
- package/lib/dropdown/dropdown-divider.component.d.ts +3 -0
- package/lib/dropdown/dropdown-item.component.d.ts +22 -8
- package/lib/dropdown/dropdown.component.d.ts +34 -26
- package/lib/dropdown/dropdown.config.d.ts +6 -0
- package/lib/dropdown/dropdown.directive.d.ts +77 -0
- package/lib/dropdown/dropdown.module.d.ts +15 -0
- package/lib/enums/icons.enum.d.ts +23 -0
- package/lib/form-input/form-input-password.utils.d.ts +45 -0
- package/lib/form-input/form-input.component.d.ts +202 -20
- package/lib/form-input/it-prefix.directive.d.ts +5 -0
- package/lib/form-input/it-suffix.directive.d.ts +5 -0
- package/lib/form-input/it-text-prefix.directive.d.ts +5 -0
- package/lib/form-input/it-text-suffix.directive.d.ts +5 -0
- package/lib/form-input/mark-matching-text.pipe.d.ts +10 -0
- package/lib/icon/icon.component.d.ts +34 -0
- package/lib/icon/icon.module.d.ts +8 -0
- package/lib/models/Alignment.d.ts +12 -0
- package/lib/models/ButtonSize.d.ts +1 -1
- package/lib/models/InputType.d.ts +22 -1
- package/lib/models/ThemeColor.d.ts +1 -1
- package/lib/popover/popover.config.d.ts +5 -6
- package/lib/popover/popover.directive.d.ts +13 -108
- package/lib/popover/popover.module.d.ts +9 -0
- package/lib/progress-bar/progress-bar.component.d.ts +25 -19
- package/lib/radio/radio.component.d.ts +22 -10
- package/lib/radio/unique-selection-dispatcher.d.ts +3 -0
- package/lib/tabs/tab-group.component.d.ts +17 -11
- package/lib/tabs/tab.component.d.ts +6 -2
- package/lib/tabs/tabs.module.d.ts +10 -0
- package/lib/toggle/toggle.component.d.ts +9 -4
- package/lib/tooltip/tooltip.config.d.ts +7 -7
- package/lib/tooltip/tooltip.directive.d.ts +12 -92
- package/lib/tooltip/tooltip.module.d.ts +9 -0
- package/lib/util/focus-mouse.directive.d.ts +13 -0
- package/lib/util/utils.module.d.ts +7 -0
- package/package.json +34 -20
- package/public_api.d.ts +16 -2
- package/bundles/design-angular-kit.umd.js +0 -6258
- package/bundles/design-angular-kit.umd.js.map +0 -1
- package/bundles/design-angular-kit.umd.min.js +0 -31
- package/bundles/design-angular-kit.umd.min.js.map +0 -1
- package/design-angular-kit.d.ts +0 -8
- package/design-angular-kit.metadata.json +0 -1
- package/esm2015/design-angular-kit.js +0 -14
- package/esm2015/lib/badge/badge.directive.js +0 -116
- package/esm2015/lib/breadcrumb/breadcrumb-item.component.js +0 -117
- package/esm2015/lib/breadcrumb/breadcrumb.component.js +0 -128
- package/esm2015/lib/button/button.component.js +0 -165
- package/esm2015/lib/checkbox/checkbox.component.js +0 -170
- package/esm2015/lib/collapse/collapse-group.component.js +0 -87
- package/esm2015/lib/collapse/collapse-item.component.js +0 -148
- package/esm2015/lib/collapse/collapse.directive.js +0 -153
- package/esm2015/lib/design-angular-kit.module.js +0 -90
- package/esm2015/lib/dropdown/dropdown-divider.component.js +0 -18
- package/esm2015/lib/dropdown/dropdown-header.component.js +0 -29
- package/esm2015/lib/dropdown/dropdown-item.component.js +0 -157
- package/esm2015/lib/dropdown/dropdown.component.js +0 -248
- package/esm2015/lib/form-input/form-input.component.js +0 -489
- package/esm2015/lib/models/ButtonSize.js +0 -25
- package/esm2015/lib/models/IconPosition.js +0 -21
- package/esm2015/lib/models/InputType.js +0 -33
- package/esm2015/lib/models/InteractionTrigger.js +0 -35
- package/esm2015/lib/models/ThemeColor.js +0 -45
- package/esm2015/lib/popover/popover.component.js +0 -134
- package/esm2015/lib/popover/popover.config.js +0 -35
- package/esm2015/lib/popover/popover.directive.js +0 -433
- package/esm2015/lib/popover/popup.js +0 -105
- package/esm2015/lib/popover/positioning.js +0 -349
- package/esm2015/lib/popover/triggers.js +0 -99
- package/esm2015/lib/progress-bar/progress-bar.component.js +0 -170
- package/esm2015/lib/radio/radio.component.js +0 -526
- package/esm2015/lib/radio/unique-selection-dispatcher.js +0 -70
- package/esm2015/lib/tabs/tab-group.component.js +0 -339
- package/esm2015/lib/tabs/tab.component.js +0 -143
- package/esm2015/lib/toggle/toggle.component.js +0 -173
- package/esm2015/lib/tooltip/popup.js +0 -105
- package/esm2015/lib/tooltip/positioning.js +0 -349
- package/esm2015/lib/tooltip/tooltip.component.js +0 -77
- package/esm2015/lib/tooltip/tooltip.config.js +0 -31
- package/esm2015/lib/tooltip/tooltip.directive.js +0 -384
- package/esm2015/lib/tooltip/triggers.js +0 -99
- package/esm2015/lib/util/util.js +0 -30
- package/esm2015/public_api.js +0 -31
- package/esm5/design-angular-kit.js +0 -14
- package/esm5/lib/badge/badge.directive.js +0 -145
- package/esm5/lib/breadcrumb/breadcrumb-item.component.js +0 -135
- package/esm5/lib/breadcrumb/breadcrumb.component.js +0 -164
- package/esm5/lib/button/button.component.js +0 -221
- package/esm5/lib/checkbox/checkbox.component.js +0 -200
- package/esm5/lib/collapse/collapse-group.component.js +0 -102
- package/esm5/lib/collapse/collapse-item.component.js +0 -183
- package/esm5/lib/collapse/collapse.directive.js +0 -210
- package/esm5/lib/design-angular-kit.module.js +0 -94
- package/esm5/lib/dropdown/dropdown-divider.component.js +0 -20
- package/esm5/lib/dropdown/dropdown-header.component.js +0 -27
- package/esm5/lib/dropdown/dropdown-item.component.js +0 -197
- package/esm5/lib/dropdown/dropdown.component.js +0 -309
- package/esm5/lib/form-input/form-input.component.js +0 -582
- package/esm5/lib/models/ButtonSize.js +0 -25
- package/esm5/lib/models/IconPosition.js +0 -21
- package/esm5/lib/models/InputType.js +0 -33
- package/esm5/lib/models/InteractionTrigger.js +0 -35
- package/esm5/lib/models/ThemeColor.js +0 -45
- package/esm5/lib/popover/popover.component.js +0 -144
- package/esm5/lib/popover/popover.config.js +0 -37
- package/esm5/lib/popover/popover.directive.js +0 -573
- package/esm5/lib/popover/popup.js +0 -116
- package/esm5/lib/popover/positioning.js +0 -446
- package/esm5/lib/popover/triggers.js +0 -115
- package/esm5/lib/progress-bar/progress-bar.component.js +0 -218
- package/esm5/lib/radio/radio.component.js +0 -610
- package/esm5/lib/radio/unique-selection-dispatcher.js +0 -108
- package/esm5/lib/tabs/tab-group.component.js +0 -401
- package/esm5/lib/tabs/tab.component.js +0 -156
- package/esm5/lib/toggle/toggle.component.js +0 -200
- package/esm5/lib/tooltip/popup.js +0 -116
- package/esm5/lib/tooltip/positioning.js +0 -446
- package/esm5/lib/tooltip/tooltip.component.js +0 -80
- package/esm5/lib/tooltip/tooltip.config.js +0 -33
- package/esm5/lib/tooltip/tooltip.directive.js +0 -516
- package/esm5/lib/tooltip/triggers.js +0 -115
- package/esm5/lib/util/util.js +0 -48
- package/esm5/public_api.js +0 -31
- package/fesm2015/design-angular-kit.js +0 -5094
- package/fesm2015/design-angular-kit.js.map +0 -1
- package/fesm5/design-angular-kit.js +0 -6314
- package/fesm5/design-angular-kit.js.map +0 -1
- package/lib/button/button.component.d.ts +0 -50
- package/lib/dropdown/dropdown-header.component.d.ts +0 -3
- package/lib/models/IconPosition.d.ts +0 -9
- package/lib/models/InteractionTrigger.d.ts +0 -19
- package/lib/popover/popover.component.d.ts +0 -25
- package/lib/popover/popup.d.ts +0 -27
- package/lib/popover/positioning.d.ts +0 -32
- package/lib/popover/triggers.d.ts +0 -18
- package/lib/tooltip/popup.d.ts +0 -27
- package/lib/tooltip/positioning.d.ts +0 -32
- package/lib/tooltip/tooltip.component.d.ts +0 -20
- package/lib/tooltip/triggers.d.ts +0 -18
|
@@ -0,0 +1,3181 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, EventEmitter, forwardRef, ViewChild, Output, Injectable, Directive, Inject, NgModule, HostListener, HostBinding, ContentChildren, Optional, ContentChild, Host, Pipe, ViewEncapsulation, TemplateRef } from '@angular/core';
|
|
3
|
+
import * as t from 'io-ts';
|
|
4
|
+
import * as i1 from '@angular/common';
|
|
5
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
6
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
7
|
+
import { NgbPopoverConfig, NgbPopover, NgbPopoverModule, NgbTooltipConfig, NgbTooltip, NgbTooltipModule, NgbDropdownConfig, NgbNavbar, NgbDropdownItem, NgbDropdownMenu, NgbDropdownAnchor, NgbDropdownToggle, NgbDropdown, NgbCollapseConfig, NgbCollapse, NgbCollapseModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
8
|
+
import { merge, Subscription, Subject } from 'rxjs';
|
|
9
|
+
import * as i1$1 from '@angular/platform-browser';
|
|
10
|
+
|
|
11
|
+
const ThemeColor = t.keyof({
|
|
12
|
+
primary: null,
|
|
13
|
+
secondary: null,
|
|
14
|
+
danger: null,
|
|
15
|
+
warning: null,
|
|
16
|
+
info: null,
|
|
17
|
+
success: null,
|
|
18
|
+
light: null,
|
|
19
|
+
dark: null,
|
|
20
|
+
});
|
|
21
|
+
const PRIMARY = 'primary';
|
|
22
|
+
const SECONDARY = 'secondary';
|
|
23
|
+
const DANGER = 'danger';
|
|
24
|
+
const WARNING = 'warning';
|
|
25
|
+
const INFO = 'info';
|
|
26
|
+
const SUCCESS = 'success';
|
|
27
|
+
const LIGHT = 'light';
|
|
28
|
+
const DARK = 'dark';
|
|
29
|
+
const THEME_COLORS = {
|
|
30
|
+
PRIMARY: PRIMARY,
|
|
31
|
+
SECONDARY: SECONDARY,
|
|
32
|
+
DANGER: DANGER,
|
|
33
|
+
WARNING: WARNING,
|
|
34
|
+
INFO: INFO,
|
|
35
|
+
SUCCESS: SUCCESS,
|
|
36
|
+
LIGHT: LIGHT,
|
|
37
|
+
DARK: DARK
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
class Util {
|
|
41
|
+
static coerceBooleanProperty(value) {
|
|
42
|
+
return value != null && `${value}` !== 'false';
|
|
43
|
+
}
|
|
44
|
+
static coerceNumberProperty(value, fallbackValue = 0) {
|
|
45
|
+
return Util._isNumberValue(value) ? Number(value) : fallbackValue;
|
|
46
|
+
}
|
|
47
|
+
static _isNumberValue(value) {
|
|
48
|
+
return !isNaN(parseFloat(value)) && !isNaN(Number(value));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let progressbarId = 0;
|
|
53
|
+
/**
|
|
54
|
+
* Una barra di avanzamento con design bootstrap italia.
|
|
55
|
+
*/
|
|
56
|
+
class ProgressBarComponent {
|
|
57
|
+
constructor() {
|
|
58
|
+
this.progressbarId = `it-progress-bar-${progressbarId++}`;
|
|
59
|
+
this._min = ProgressBarComponent.PROGRESS_BAR_DEFAULT_MIN;
|
|
60
|
+
this._max = ProgressBarComponent.PROGRESS_BAR_DEFAULT_MAX;
|
|
61
|
+
this._value = ProgressBarComponent.PROGRESS_BAR_DEFAULT_VALUE;
|
|
62
|
+
this._label = ProgressBarComponent.PROGRESS_BAR_DEFAULT_LABEL;
|
|
63
|
+
this._indeterminate = false;
|
|
64
|
+
this._indeterminateHiddenText = "In elaborazione...";
|
|
65
|
+
this._color = THEME_COLORS.PRIMARY;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Il valore minimo della barra di avanzamento.
|
|
69
|
+
*/
|
|
70
|
+
get min() { return this._min; }
|
|
71
|
+
set min(v) { this._min = Math.round(v); }
|
|
72
|
+
/**
|
|
73
|
+
* Il valore massimo della barra di avanzamento.
|
|
74
|
+
*/
|
|
75
|
+
get max() { return this._max; }
|
|
76
|
+
set max(v) { this._max = Math.round(v); }
|
|
77
|
+
/**
|
|
78
|
+
* L'attuale valore della barra di avanzamento.
|
|
79
|
+
*/
|
|
80
|
+
get value() { return this._value; }
|
|
81
|
+
set value(v) { this._value = Math.min(Math.max(v, this._min), this._max); }
|
|
82
|
+
/**
|
|
83
|
+
* L'etichetta della barra di avanzamento.
|
|
84
|
+
*/
|
|
85
|
+
get label() { return this._label; }
|
|
86
|
+
set label(v) { this._label = v; }
|
|
87
|
+
get indeterminate() { return this._indeterminate; }
|
|
88
|
+
set indeterminate(value) { this._indeterminate = Util.coerceBooleanProperty(value); }
|
|
89
|
+
get indeterminateHiddenText() { return this._indeterminateHiddenText; }
|
|
90
|
+
set indeterminateHiddenText(v) { this._indeterminateHiddenText = v; }
|
|
91
|
+
/**
|
|
92
|
+
* Il colore della barra di avanzamento.
|
|
93
|
+
*/
|
|
94
|
+
get color() {
|
|
95
|
+
return this._color;
|
|
96
|
+
}
|
|
97
|
+
set color(value) {
|
|
98
|
+
if (ThemeColor.is(value)) {
|
|
99
|
+
this._color = value;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
this._color = THEME_COLORS.PRIMARY;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
valuePercentage() {
|
|
106
|
+
return ((this.value - this.min) * 100) / (this.max - this.min);
|
|
107
|
+
}
|
|
108
|
+
pgStyle() {
|
|
109
|
+
return this.indeterminate ? null : { 'width': this.valuePercentage() + '%' };
|
|
110
|
+
}
|
|
111
|
+
get progressBarClass() {
|
|
112
|
+
const progressbarClass = new Set();
|
|
113
|
+
progressbarClass.add('progress-bar');
|
|
114
|
+
if (this.color) {
|
|
115
|
+
progressbarClass.add(`bg-${this.color}`);
|
|
116
|
+
}
|
|
117
|
+
return progressbarClass;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
ProgressBarComponent.PROGRESS_BAR_DEFAULT_MIN = 0;
|
|
121
|
+
ProgressBarComponent.PROGRESS_BAR_DEFAULT_MAX = 100;
|
|
122
|
+
ProgressBarComponent.PROGRESS_BAR_DEFAULT_VALUE = 0;
|
|
123
|
+
ProgressBarComponent.PROGRESS_BAR_DEFAULT_LABEL = '';
|
|
124
|
+
ProgressBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
+
ProgressBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: ProgressBarComponent, selector: "it-progress-bar", inputs: { min: "min", max: "max", value: "value", label: "label", indeterminate: "indeterminate", indeterminateHiddenText: "indeterminateHiddenText", color: "color" }, ngImport: i0, template: "<ng-container *ngIf = \"label; else progressBarEl\">\n <div class=\"progress-bar-wrapper\">\n <div class=\"progress-bar-label\"><span class=\"visually-hidden\">Progresso </span>{{label}}</div>\n <ng-container *ngTemplateOutlet=\"progressBarEl\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #progressBarEl>\n <div class=\"progress\" [class.progress-indeterminate] = \"indeterminate\">\n <span class=\"visually-hidden\" *ngIf=\"indeterminate && indeterminateHiddenText\">{{indeterminateHiddenText}}</span>\n <div role=\"progressbar\" [id]=\"progressbarId\" \n [ngClass]=\"progressBarClass\" \n [ngStyle]=\"pgStyle()\"\n [attr.aria-valuenow]=\"value\" [attr.aria-valuemin]=\"min\" [attr.aria-valuemax]=\"max\" >\n </div>\n </div>\n</ng-template>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
127
|
+
type: Component,
|
|
128
|
+
args: [{ selector: 'it-progress-bar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf = \"label; else progressBarEl\">\n <div class=\"progress-bar-wrapper\">\n <div class=\"progress-bar-label\"><span class=\"visually-hidden\">Progresso </span>{{label}}</div>\n <ng-container *ngTemplateOutlet=\"progressBarEl\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #progressBarEl>\n <div class=\"progress\" [class.progress-indeterminate] = \"indeterminate\">\n <span class=\"visually-hidden\" *ngIf=\"indeterminate && indeterminateHiddenText\">{{indeterminateHiddenText}}</span>\n <div role=\"progressbar\" [id]=\"progressbarId\" \n [ngClass]=\"progressBarClass\" \n [ngStyle]=\"pgStyle()\"\n [attr.aria-valuenow]=\"value\" [attr.aria-valuemin]=\"min\" [attr.aria-valuemax]=\"max\" >\n </div>\n </div>\n</ng-template>" }]
|
|
129
|
+
}], ctorParameters: function () { return []; }, propDecorators: { min: [{
|
|
130
|
+
type: Input
|
|
131
|
+
}], max: [{
|
|
132
|
+
type: Input
|
|
133
|
+
}], value: [{
|
|
134
|
+
type: Input
|
|
135
|
+
}], label: [{
|
|
136
|
+
type: Input
|
|
137
|
+
}], indeterminate: [{
|
|
138
|
+
type: Input
|
|
139
|
+
}], indeterminateHiddenText: [{
|
|
140
|
+
type: Input
|
|
141
|
+
}], color: [{
|
|
142
|
+
type: Input
|
|
143
|
+
}] } });
|
|
144
|
+
|
|
145
|
+
let identifier$9 = 0;
|
|
146
|
+
class CheckboxChange {
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Una checkbox con design bootstrap italia. Supporta tutte le funzionalità di una checkbox HTML5,
|
|
150
|
+
* ed espone una API simile. Una `<it-checkbox>` può essere checked, unchecked, o disabled.
|
|
151
|
+
*/
|
|
152
|
+
class CheckboxComponent {
|
|
153
|
+
constructor(_changeDetectorRef) {
|
|
154
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
155
|
+
this._checked = false;
|
|
156
|
+
this._grouped = false;
|
|
157
|
+
this._disabled = false;
|
|
158
|
+
this._inline = false;
|
|
159
|
+
this._indeterminate = false;
|
|
160
|
+
this.indeterminateChange = new EventEmitter();
|
|
161
|
+
this.focus = false;
|
|
162
|
+
/**
|
|
163
|
+
* Evento emesso quando il valore `checked` della checkbox cambia.
|
|
164
|
+
*/
|
|
165
|
+
this.change = new EventEmitter();
|
|
166
|
+
this.inputId = `checkbox-${identifier$9++}`;
|
|
167
|
+
this._onTouched = () => { };
|
|
168
|
+
this._controlValueAccessorChangeFn = () => { };
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Se la checkbox è selezionata.
|
|
172
|
+
*/
|
|
173
|
+
get checked() { return this._checked; }
|
|
174
|
+
set checked(value) {
|
|
175
|
+
if (value !== this.checked) {
|
|
176
|
+
this._checked = value;
|
|
177
|
+
if (this._checked) {
|
|
178
|
+
this.indeterminate = false;
|
|
179
|
+
}
|
|
180
|
+
this._changeDetectorRef.markForCheck();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
get grouped() { return this._grouped; }
|
|
184
|
+
set grouped(value) { this._grouped = Util.coerceBooleanProperty(value); }
|
|
185
|
+
/**
|
|
186
|
+
* Se la checkbox è disabilitata.
|
|
187
|
+
*/
|
|
188
|
+
get disabled() { return this._disabled; }
|
|
189
|
+
set disabled(value) {
|
|
190
|
+
if (value !== this.disabled) {
|
|
191
|
+
this._disabled = value;
|
|
192
|
+
this._changeDetectorRef.markForCheck();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
get inline() { return this._inline; }
|
|
196
|
+
set inline(value) { this._inline = Util.coerceBooleanProperty(value); }
|
|
197
|
+
get indeterminate() { return this._indeterminate; }
|
|
198
|
+
set indeterminate(value) {
|
|
199
|
+
const newValue = Util.coerceBooleanProperty(value);
|
|
200
|
+
const changed = this._indeterminate !== newValue;
|
|
201
|
+
if (changed) {
|
|
202
|
+
this._indeterminate = newValue;
|
|
203
|
+
this.indeterminateChange.emit(this._indeterminate);
|
|
204
|
+
if (this._indeterminate) {
|
|
205
|
+
queueMicrotask(() => {
|
|
206
|
+
this.checked = false;
|
|
207
|
+
this._emitChangeEvent();
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
onFocus() {
|
|
213
|
+
this.focus = true;
|
|
214
|
+
}
|
|
215
|
+
onBlur() {
|
|
216
|
+
this.focus = false;
|
|
217
|
+
}
|
|
218
|
+
writeValue(value) {
|
|
219
|
+
this.checked = !!value;
|
|
220
|
+
}
|
|
221
|
+
registerOnChange(fn) {
|
|
222
|
+
this._controlValueAccessorChangeFn = fn;
|
|
223
|
+
}
|
|
224
|
+
registerOnTouched(fn) {
|
|
225
|
+
this._onTouched = fn;
|
|
226
|
+
}
|
|
227
|
+
handleChange(event) {
|
|
228
|
+
event.stopPropagation();
|
|
229
|
+
if (!this.disabled) {
|
|
230
|
+
if (!this.indeterminate) {
|
|
231
|
+
this._toggle();
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
this.indeterminate = false;
|
|
235
|
+
// reset proprietà "checked" per prevenire il comportamento di default dell'elemento HTML
|
|
236
|
+
this._inputElement.nativeElement.checked = this.checked;
|
|
237
|
+
}
|
|
238
|
+
this._emitChangeEvent();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
_toggle() {
|
|
242
|
+
this.checked = !this.checked;
|
|
243
|
+
}
|
|
244
|
+
_emitChangeEvent() {
|
|
245
|
+
const event = new CheckboxChange();
|
|
246
|
+
event.source = this;
|
|
247
|
+
event.checked = this.checked;
|
|
248
|
+
this._controlValueAccessorChangeFn(this.checked);
|
|
249
|
+
this.change.emit(event);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: CheckboxComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
253
|
+
CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: CheckboxComponent, selector: "it-checkbox", inputs: { checked: "checked", grouped: "grouped", label: "label", disabled: "disabled", inline: "inline", indeterminate: "indeterminate" }, outputs: { indeterminateChange: "indeterminateChange", change: "change" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CheckboxComponent), multi: true }], viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div class=\"form-check\" [class.form-check-group] = \"grouped\" [class.form-check-inline] = \"inline\" >\n <input #input type=\"checkbox\"\n [id]=\"inputId\"\n [class.focus--mouse] = \"focus\"\n [class.semi-checked] = \"indeterminate\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"handleChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n >\n <label\n [attr.for]=\"inputId\" *ngIf = \"label\">{{label}}</label>\n \n <ng-content></ng-content>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
255
|
+
type: Component,
|
|
256
|
+
args: [{ selector: 'it-checkbox', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CheckboxComponent), multi: true }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-check\" [class.form-check-group] = \"grouped\" [class.form-check-inline] = \"inline\" >\n <input #input type=\"checkbox\"\n [id]=\"inputId\"\n [class.focus--mouse] = \"focus\"\n [class.semi-checked] = \"indeterminate\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"handleChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n >\n <label\n [attr.for]=\"inputId\" *ngIf = \"label\">{{label}}</label>\n \n <ng-content></ng-content>\n</div>" }]
|
|
257
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _inputElement: [{
|
|
258
|
+
type: ViewChild,
|
|
259
|
+
args: ['input']
|
|
260
|
+
}], checked: [{
|
|
261
|
+
type: Input
|
|
262
|
+
}], grouped: [{
|
|
263
|
+
type: Input
|
|
264
|
+
}], label: [{
|
|
265
|
+
type: Input
|
|
266
|
+
}], disabled: [{
|
|
267
|
+
type: Input
|
|
268
|
+
}], inline: [{
|
|
269
|
+
type: Input
|
|
270
|
+
}], indeterminate: [{
|
|
271
|
+
type: Input
|
|
272
|
+
}], indeterminateChange: [{
|
|
273
|
+
type: Output
|
|
274
|
+
}], change: [{
|
|
275
|
+
type: Output
|
|
276
|
+
}] } });
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Servizio di configurazione per la direttiva ItPopover.
|
|
280
|
+
* Il servizio può essere iniettato, tipicamente in un root component, per impostare i valori delle proprietà in
|
|
281
|
+
* modo tale da fornire i valori di default per tutti i popover utilizzati in un'applicazione.
|
|
282
|
+
*/
|
|
283
|
+
class ItPopoverConfig extends NgbPopoverConfig {
|
|
284
|
+
}
|
|
285
|
+
ItPopoverConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPopoverConfig, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
286
|
+
ItPopoverConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPopoverConfig, providedIn: 'root' });
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPopoverConfig, decorators: [{
|
|
288
|
+
type: Injectable,
|
|
289
|
+
args: [{ providedIn: 'root' }]
|
|
290
|
+
}] });
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* A lightweight and extensible directive for fancy popover creation.
|
|
294
|
+
*/
|
|
295
|
+
class ItPopover extends NgbPopover {
|
|
296
|
+
constructor(_elementRef, _renderer, injector, viewContainerRef, config, _ngZone, _document, _changeDetector, applicationRef) {
|
|
297
|
+
super(_elementRef, _renderer, injector, viewContainerRef, config, _ngZone, _document, _changeDetector, applicationRef);
|
|
298
|
+
}
|
|
299
|
+
ngOnInit() {
|
|
300
|
+
super.ngOnInit();
|
|
301
|
+
super.ngbPopover = this.itPopover;
|
|
302
|
+
this.popoverClass = 'it-popover-window';
|
|
303
|
+
}
|
|
304
|
+
ngOnDestroy() {
|
|
305
|
+
super.ngOnDestroy();
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
ItPopover.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPopover, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: i0.ViewContainerRef }, { token: ItPopoverConfig }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i0.ChangeDetectorRef }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
309
|
+
ItPopover.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItPopover, selector: "[itPopover]", inputs: { itPopover: "itPopover" }, exportAs: ["itPopover"], usesInheritance: true, ngImport: i0 });
|
|
310
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPopover, decorators: [{
|
|
311
|
+
type: Directive,
|
|
312
|
+
args: [{ selector: '[itPopover]', exportAs: 'itPopover' }]
|
|
313
|
+
}], ctorParameters: function () {
|
|
314
|
+
return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i0.ViewContainerRef }, { type: ItPopoverConfig }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
315
|
+
type: Inject,
|
|
316
|
+
args: [DOCUMENT]
|
|
317
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ApplicationRef }];
|
|
318
|
+
}, propDecorators: { itPopover: [{
|
|
319
|
+
type: Input
|
|
320
|
+
}] } });
|
|
321
|
+
|
|
322
|
+
class ItPopoverModule {
|
|
323
|
+
}
|
|
324
|
+
ItPopoverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPopoverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
325
|
+
ItPopoverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: ItPopoverModule, declarations: [ItPopover], imports: [CommonModule, NgbPopoverModule], exports: [ItPopover] });
|
|
326
|
+
ItPopoverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPopoverModule, imports: [CommonModule, NgbPopoverModule] });
|
|
327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPopoverModule, decorators: [{
|
|
328
|
+
type: NgModule,
|
|
329
|
+
args: [{
|
|
330
|
+
declarations: [ItPopover],
|
|
331
|
+
exports: [ItPopover],
|
|
332
|
+
imports: [CommonModule, NgbPopoverModule]
|
|
333
|
+
}]
|
|
334
|
+
}] });
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Aggiunge la classe "focus--mouse" quando viene effettuato il focus sull'elemento a cui è applicata la direttiva
|
|
338
|
+
*/
|
|
339
|
+
class FocusMouseDirective {
|
|
340
|
+
constructor(elementRef) {
|
|
341
|
+
this.elementRef = elementRef;
|
|
342
|
+
}
|
|
343
|
+
onFocus() {
|
|
344
|
+
this.elementRef.nativeElement.classList.add('focus--mouse');
|
|
345
|
+
}
|
|
346
|
+
onBlur() {
|
|
347
|
+
this.elementRef.nativeElement.classList.remove('focus--mouse');
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
FocusMouseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FocusMouseDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
351
|
+
FocusMouseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: FocusMouseDirective, selector: "[focusMouse]", host: { listeners: { "focus": "onFocus()", "blur": "onBlur()" } }, exportAs: ["focusMouse"], ngImport: i0 });
|
|
352
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FocusMouseDirective, decorators: [{
|
|
353
|
+
type: Directive,
|
|
354
|
+
args: [{
|
|
355
|
+
selector: '[focusMouse]',
|
|
356
|
+
exportAs: 'focusMouse'
|
|
357
|
+
}]
|
|
358
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onFocus: [{
|
|
359
|
+
type: HostListener,
|
|
360
|
+
args: ['focus']
|
|
361
|
+
}], onBlur: [{
|
|
362
|
+
type: HostListener,
|
|
363
|
+
args: ['blur']
|
|
364
|
+
}] } });
|
|
365
|
+
|
|
366
|
+
let identifier$8 = 0;
|
|
367
|
+
class ToggleChange {
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Una toggle con design bootstrap italia. Supporta tutte le funzionalità di una checkbox HTML5,
|
|
371
|
+
* ed espone una API simile. Una `<it-toggle>` può essere checked, unchecked, o disabled.
|
|
372
|
+
*/
|
|
373
|
+
class ToggleComponent {
|
|
374
|
+
constructor(_changeDetectorRef) {
|
|
375
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
376
|
+
this._checked = false;
|
|
377
|
+
this._disabled = false;
|
|
378
|
+
/**
|
|
379
|
+
* Evento emesso quando il valore `checked` della toggle cambia.
|
|
380
|
+
*/
|
|
381
|
+
this.change = new EventEmitter();
|
|
382
|
+
this.inputId = `toggle-${identifier$8++}`;
|
|
383
|
+
this._onTouched = () => { };
|
|
384
|
+
this._controlValueAccessorChangeFn = () => { };
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Se la toggle è selezionata.
|
|
388
|
+
*/
|
|
389
|
+
get checked() { return this._checked; }
|
|
390
|
+
set checked(value) {
|
|
391
|
+
if (value !== this.checked) {
|
|
392
|
+
this._checked = value;
|
|
393
|
+
this._changeDetectorRef.markForCheck();
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Se la toggle è disabilitata.
|
|
398
|
+
*/
|
|
399
|
+
get disabled() { return this._disabled; }
|
|
400
|
+
set disabled(value) {
|
|
401
|
+
if (value !== this.disabled) {
|
|
402
|
+
this._disabled = value;
|
|
403
|
+
this._changeDetectorRef.markForCheck();
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
writeValue(value) {
|
|
407
|
+
this.checked = !!value;
|
|
408
|
+
}
|
|
409
|
+
registerOnChange(fn) {
|
|
410
|
+
this._controlValueAccessorChangeFn = fn;
|
|
411
|
+
}
|
|
412
|
+
registerOnTouched(fn) {
|
|
413
|
+
this._onTouched = fn;
|
|
414
|
+
}
|
|
415
|
+
handleChange(event) {
|
|
416
|
+
event.stopPropagation();
|
|
417
|
+
if (!this.disabled) {
|
|
418
|
+
this._toggle();
|
|
419
|
+
this._emitChangeEvent();
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
_toggle() {
|
|
423
|
+
this.checked = !this.checked;
|
|
424
|
+
}
|
|
425
|
+
_emitChangeEvent() {
|
|
426
|
+
const event = new ToggleChange();
|
|
427
|
+
event.source = this;
|
|
428
|
+
event.checked = this.checked;
|
|
429
|
+
this._controlValueAccessorChangeFn(this.checked);
|
|
430
|
+
this.change.emit(event);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
ToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ToggleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
434
|
+
ToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: ToggleComponent, selector: "it-toggle", inputs: { checked: "checked", label: "label", disabled: "disabled" }, outputs: { change: "change" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ToggleComponent), multi: true }], ngImport: i0, template: "<div class=\"form-check\">\n <div class=\"toggles\">\n <label [attr.for]=inputId>\n {{label}}\n <input type=checkbox\n focusMouse\n [id]=inputId\n [checked]=checked\n [disabled]=disabled\n (change)=handleChange($event)>\n <span class=\"lever\"></span>\n </label>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: FocusMouseDirective, selector: "[focusMouse]", exportAs: ["focusMouse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
435
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ToggleComponent, decorators: [{
|
|
436
|
+
type: Component,
|
|
437
|
+
args: [{ selector: 'it-toggle', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ToggleComponent), multi: true }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-check\">\n <div class=\"toggles\">\n <label [attr.for]=inputId>\n {{label}}\n <input type=checkbox\n focusMouse\n [id]=inputId\n [checked]=checked\n [disabled]=disabled\n (change)=handleChange($event)>\n <span class=\"lever\"></span>\n </label>\n </div>\n</div>" }]
|
|
438
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { checked: [{
|
|
439
|
+
type: Input
|
|
440
|
+
}], label: [{
|
|
441
|
+
type: Input
|
|
442
|
+
}], disabled: [{
|
|
443
|
+
type: Input
|
|
444
|
+
}], change: [{
|
|
445
|
+
type: Output
|
|
446
|
+
}] } });
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* @license
|
|
450
|
+
* Copyright Google LLC All Rights Reserved.
|
|
451
|
+
*
|
|
452
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
453
|
+
* found in the LICENSE file at https://angular.io/license
|
|
454
|
+
*/
|
|
455
|
+
/**
|
|
456
|
+
* Class to coordinate unique selection based on name.
|
|
457
|
+
* Intended to be consumed as an Angular service.
|
|
458
|
+
* This service is needed because native radio change events are only fired on the item currently
|
|
459
|
+
* being selected, and we still need to uncheck the previous selection.
|
|
460
|
+
*
|
|
461
|
+
* This service does not *store* any IDs and names because they may change at any time, so it is
|
|
462
|
+
* less error-prone if they are simply passed through when the events occur.
|
|
463
|
+
*/
|
|
464
|
+
class UniqueSelectionDispatcher {
|
|
465
|
+
constructor() {
|
|
466
|
+
this._listeners = [];
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Notify other items that selection for the given name has been set.
|
|
470
|
+
* @param id ID of the item.
|
|
471
|
+
* @param name Name of the item.
|
|
472
|
+
*/
|
|
473
|
+
notify(id, name) {
|
|
474
|
+
for (const listener of this._listeners) {
|
|
475
|
+
listener(id, name);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Listen for future changes to item selection.
|
|
480
|
+
* @return Function used to deregister listener
|
|
481
|
+
*/
|
|
482
|
+
listen(listener) {
|
|
483
|
+
this._listeners.push(listener);
|
|
484
|
+
return () => {
|
|
485
|
+
this._listeners = this._listeners.filter((registered) => {
|
|
486
|
+
return listener !== registered;
|
|
487
|
+
});
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
ngOnDestroy() {
|
|
491
|
+
this._listeners = [];
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
UniqueSelectionDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UniqueSelectionDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
495
|
+
UniqueSelectionDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UniqueSelectionDispatcher, providedIn: 'root' });
|
|
496
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UniqueSelectionDispatcher, decorators: [{
|
|
497
|
+
type: Injectable,
|
|
498
|
+
args: [{ providedIn: 'root' }]
|
|
499
|
+
}] });
|
|
500
|
+
|
|
501
|
+
let identifier$7 = 0;
|
|
502
|
+
function _coerceBooleanProperty(value) {
|
|
503
|
+
return value != null && `${value}` !== 'false';
|
|
504
|
+
}
|
|
505
|
+
class RadioChange {
|
|
506
|
+
constructor(source, value) {
|
|
507
|
+
this.source = source;
|
|
508
|
+
this.value = value;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
class RadioGroupDirective {
|
|
512
|
+
constructor(_changeDetector) {
|
|
513
|
+
this._changeDetector = _changeDetector;
|
|
514
|
+
this.role = 'radiogroup';
|
|
515
|
+
/**
|
|
516
|
+
* Il valore selezionato per il gruppo. Dovrebbe essere uguale al valore del radio button selezionato se
|
|
517
|
+
* *esiste* un radio button con un valore corrispondente. Se *non esiste* un radio button corrispondente
|
|
518
|
+
* questo valore persiste ed è applicato nel caso in cui un nuovo radio button viene aggiunto con il valore
|
|
519
|
+
* corrispondente.
|
|
520
|
+
*/
|
|
521
|
+
this._value = null;
|
|
522
|
+
/** L'attributo HTML name da applicare ai radio button in questo gruppo */
|
|
523
|
+
this._name = `it-radio-group-${identifier$7++}`;
|
|
524
|
+
/** Il radio button attualmente selezionato. */
|
|
525
|
+
this._selected = null;
|
|
526
|
+
/** se `value` è stato settato al suo valore iniziale. */
|
|
527
|
+
this._isInitialized = false;
|
|
528
|
+
/** Se il radio group è disabilitato. */
|
|
529
|
+
this._disabled = false;
|
|
530
|
+
/**
|
|
531
|
+
* Evento emesso quando il valore del gruppo cambia.
|
|
532
|
+
* Gli eventi di change sono emessi soltanto quando il valore cambia a causa dell'interazione dell'utente
|
|
533
|
+
* con il radio button (stesso comportamento di `<input type-"radio">`).
|
|
534
|
+
*/
|
|
535
|
+
this.change = new EventEmitter();
|
|
536
|
+
/** Il metodo da chiamare per aggiornare ngModel */
|
|
537
|
+
this._controlValueAccessorChangeFn = () => { };
|
|
538
|
+
this.onTouched = () => { };
|
|
539
|
+
}
|
|
540
|
+
/** Nome del gruppo di radio button. Tutti i radio button all'interno del gruppo avranno questo nome. */
|
|
541
|
+
get name() { return this._name; }
|
|
542
|
+
set name(value) {
|
|
543
|
+
this._name = value;
|
|
544
|
+
this._updateRadioButtonNames();
|
|
545
|
+
}
|
|
546
|
+
/** Valore del radio button. */
|
|
547
|
+
get value() { return this._value; }
|
|
548
|
+
set value(newValue) {
|
|
549
|
+
if (this._value !== newValue) {
|
|
550
|
+
this._value = newValue;
|
|
551
|
+
this._updateSelectedRadioFromValue();
|
|
552
|
+
this._checkSelectedRadioButton();
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
_checkSelectedRadioButton() {
|
|
556
|
+
if (this._selected && !this._selected.checked) {
|
|
557
|
+
this._selected.checked = true;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
/** Il radio button selezionato. */
|
|
561
|
+
get selected() { return this._selected; }
|
|
562
|
+
set selected(selected) {
|
|
563
|
+
this._selected = selected;
|
|
564
|
+
this.value = selected ? selected.value : null;
|
|
565
|
+
this._checkSelectedRadioButton();
|
|
566
|
+
}
|
|
567
|
+
/** Se il gruppo è disabled */
|
|
568
|
+
get disabled() { return this._disabled; }
|
|
569
|
+
set disabled(value) {
|
|
570
|
+
this._disabled = _coerceBooleanProperty(value);
|
|
571
|
+
this._markRadiosForCheck();
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Inizializza le proprietà quando il contenuto dei figliè disponibile.
|
|
575
|
+
* Questo permette di propagare gli attributi rilevanti ai radio buttons associati.
|
|
576
|
+
*/
|
|
577
|
+
ngAfterContentInit() {
|
|
578
|
+
this._isInitialized = true;
|
|
579
|
+
}
|
|
580
|
+
_touch() {
|
|
581
|
+
if (this.onTouched) {
|
|
582
|
+
this.onTouched();
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
_updateRadioButtonNames() {
|
|
586
|
+
if (this._radios) {
|
|
587
|
+
this._radios.forEach(radio => {
|
|
588
|
+
radio.name = this.name;
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
/** Aggiorna il radio button `selected` a seconda del suo _value. */
|
|
593
|
+
_updateSelectedRadioFromValue() {
|
|
594
|
+
this._selected = null;
|
|
595
|
+
this._radios.forEach(radio => {
|
|
596
|
+
radio.checked = this.value === radio.value;
|
|
597
|
+
if (radio.checked) {
|
|
598
|
+
this._selected = radio;
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
/** Invia l'evento change con la selezione corrente e il valore del gruppo. */
|
|
603
|
+
_emitChangeEvent() {
|
|
604
|
+
if (this._isInitialized) {
|
|
605
|
+
this.change.emit(new RadioChange(this._selected, this._value));
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
_markRadiosForCheck() {
|
|
609
|
+
if (this._radios) {
|
|
610
|
+
this._radios.forEach(radio => radio._markForCheck());
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
writeValue(value) {
|
|
614
|
+
this.value = value;
|
|
615
|
+
this._changeDetector.markForCheck();
|
|
616
|
+
}
|
|
617
|
+
registerOnChange(fn) {
|
|
618
|
+
this._controlValueAccessorChangeFn = fn;
|
|
619
|
+
}
|
|
620
|
+
registerOnTouched(fn) {
|
|
621
|
+
this.onTouched = fn;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
RadioGroupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: RadioGroupDirective, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
625
|
+
RadioGroupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: RadioGroupDirective, selector: "it-radio-group", inputs: { name: "name", value: "value", selected: "selected", disabled: "disabled" }, outputs: { change: "change" }, host: { properties: { "attr.role": "this.role" } }, providers: [{
|
|
626
|
+
provide: NG_VALUE_ACCESSOR,
|
|
627
|
+
useExisting: forwardRef(() => RadioGroupDirective),
|
|
628
|
+
multi: true
|
|
629
|
+
}], queries: [{ propertyName: "_radios", predicate: i0.forwardRef(function () { return RadioButtonComponent; }), descendants: true }], exportAs: ["itRadioGroup"], ngImport: i0 });
|
|
630
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: RadioGroupDirective, decorators: [{
|
|
631
|
+
type: Directive,
|
|
632
|
+
args: [{
|
|
633
|
+
selector: 'it-radio-group',
|
|
634
|
+
exportAs: 'itRadioGroup',
|
|
635
|
+
providers: [{
|
|
636
|
+
provide: NG_VALUE_ACCESSOR,
|
|
637
|
+
useExisting: forwardRef(() => RadioGroupDirective),
|
|
638
|
+
multi: true
|
|
639
|
+
}]
|
|
640
|
+
}]
|
|
641
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { role: [{
|
|
642
|
+
type: HostBinding,
|
|
643
|
+
args: ['attr.role']
|
|
644
|
+
}], change: [{
|
|
645
|
+
type: Output
|
|
646
|
+
}], _radios: [{
|
|
647
|
+
type: ContentChildren,
|
|
648
|
+
args: [forwardRef(() => RadioButtonComponent), { descendants: true }]
|
|
649
|
+
}], name: [{
|
|
650
|
+
type: Input
|
|
651
|
+
}], value: [{
|
|
652
|
+
type: Input
|
|
653
|
+
}], selected: [{
|
|
654
|
+
type: Input
|
|
655
|
+
}], disabled: [{
|
|
656
|
+
type: Input
|
|
657
|
+
}] } });
|
|
658
|
+
/**
|
|
659
|
+
* Un radio button con design bootstrap italia. Supporta tutte le funzionalità di una radio HTML5,
|
|
660
|
+
* ed espone una API simile. Una `<it-radio-button>` può essere checked, unchecked, o disabled.
|
|
661
|
+
*/
|
|
662
|
+
class RadioButtonComponent {
|
|
663
|
+
constructor(radioGroup, _changeDetector, _radioDispatcher) {
|
|
664
|
+
this._changeDetector = _changeDetector;
|
|
665
|
+
this._radioDispatcher = _radioDispatcher;
|
|
666
|
+
this.id = `radio-${identifier$7++}`;
|
|
667
|
+
/**
|
|
668
|
+
* Evento emesso quando il valore `checked` del radio button cambia.
|
|
669
|
+
*/
|
|
670
|
+
this.change = new EventEmitter();
|
|
671
|
+
/** Se il radio button è checked. */
|
|
672
|
+
this._checked = false;
|
|
673
|
+
/** il valore assegnato al radio button. */
|
|
674
|
+
this._value = null;
|
|
675
|
+
this._removeUniqueSelectionListener = () => { };
|
|
676
|
+
this.radioGroup = radioGroup;
|
|
677
|
+
this._removeUniqueSelectionListener =
|
|
678
|
+
_radioDispatcher.listen((id, name) => {
|
|
679
|
+
if (id !== this.id && name === this.name) {
|
|
680
|
+
this.checked = false;
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
/** se il radio button è checked. */
|
|
685
|
+
get checked() { return this._checked; }
|
|
686
|
+
set checked(value) {
|
|
687
|
+
const newCheckedState = _coerceBooleanProperty(value);
|
|
688
|
+
if (this._checked !== newCheckedState) {
|
|
689
|
+
this._checked = newCheckedState;
|
|
690
|
+
if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {
|
|
691
|
+
this.radioGroup.selected = this;
|
|
692
|
+
}
|
|
693
|
+
else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {
|
|
694
|
+
this.radioGroup.selected = null;
|
|
695
|
+
}
|
|
696
|
+
if (newCheckedState) {
|
|
697
|
+
this._radioDispatcher.notify(this.id, this.name);
|
|
698
|
+
}
|
|
699
|
+
this._changeDetector.markForCheck();
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
/** Il valore di questo radio button. */
|
|
703
|
+
get value() { return this._value; }
|
|
704
|
+
set value(value) {
|
|
705
|
+
if (this._value !== value) {
|
|
706
|
+
this._value = value;
|
|
707
|
+
if (this.radioGroup !== null) {
|
|
708
|
+
if (!this.checked) {
|
|
709
|
+
this.checked = this.radioGroup.value === value;
|
|
710
|
+
}
|
|
711
|
+
if (this.checked) {
|
|
712
|
+
this.radioGroup.selected = this;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
/** Se il radio button è disabled. */
|
|
718
|
+
get disabled() {
|
|
719
|
+
return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);
|
|
720
|
+
}
|
|
721
|
+
set disabled(value) {
|
|
722
|
+
const newDisabledState = !!value;
|
|
723
|
+
if (this._disabled !== newDisabledState) {
|
|
724
|
+
this._disabled = newDisabledState;
|
|
725
|
+
this._changeDetector.markForCheck();
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Segna il radio button come da controllare per la change detection.
|
|
730
|
+
*/
|
|
731
|
+
_markForCheck() {
|
|
732
|
+
this._changeDetector.markForCheck();
|
|
733
|
+
}
|
|
734
|
+
ngOnInit() {
|
|
735
|
+
if (this.radioGroup) {
|
|
736
|
+
// Se il radio button è all'interno di un gruppo, determina se deve essere selezionato
|
|
737
|
+
this.checked = this.radioGroup.value === this._value;
|
|
738
|
+
// Copia il `name` del radio group
|
|
739
|
+
this.name = this.radioGroup.name;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
ngOnDestroy() {
|
|
743
|
+
this._removeUniqueSelectionListener();
|
|
744
|
+
}
|
|
745
|
+
_emitChangeEvent() {
|
|
746
|
+
this.change.emit(new RadioChange(this, this._value));
|
|
747
|
+
}
|
|
748
|
+
_onInputChange(event) {
|
|
749
|
+
event.stopPropagation();
|
|
750
|
+
const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;
|
|
751
|
+
this.checked = true;
|
|
752
|
+
this._emitChangeEvent();
|
|
753
|
+
if (this.radioGroup) {
|
|
754
|
+
this.radioGroup._controlValueAccessorChangeFn(this.value);
|
|
755
|
+
this.radioGroup._touch();
|
|
756
|
+
if (groupValueChanged) {
|
|
757
|
+
this.radioGroup._emitChangeEvent();
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
RadioButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: RadioButtonComponent, deps: [{ token: RadioGroupDirective, optional: true }, { token: i0.ChangeDetectorRef }, { token: UniqueSelectionDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
763
|
+
RadioButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: RadioButtonComponent, selector: "it-radio-button", inputs: { name: "name", label: "label", checked: "checked", value: "value", disabled: "disabled" }, outputs: { change: "change" }, exportAs: ["itRadioButton"], ngImport: i0, template: "<div class=\"form-check\">\n <input type=\"radio\"\n focusMouse\n [id]=\"id\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.name]=\"name\"\n (change)=\"_onInputChange($event)\">\n <label\n [attr.for]=\"id\">{{label}}</label>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: FocusMouseDirective, selector: "[focusMouse]", exportAs: ["focusMouse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
764
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: RadioButtonComponent, decorators: [{
|
|
765
|
+
type: Component,
|
|
766
|
+
args: [{ selector: 'it-radio-button', exportAs: 'itRadioButton', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-check\">\n <input type=\"radio\"\n focusMouse\n [id]=\"id\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.name]=\"name\"\n (change)=\"_onInputChange($event)\">\n <label\n [attr.for]=\"id\">{{label}}</label>\n</div>\n" }]
|
|
767
|
+
}], ctorParameters: function () {
|
|
768
|
+
return [{ type: RadioGroupDirective, decorators: [{
|
|
769
|
+
type: Optional
|
|
770
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: UniqueSelectionDispatcher }];
|
|
771
|
+
}, propDecorators: { name: [{
|
|
772
|
+
type: Input
|
|
773
|
+
}], label: [{
|
|
774
|
+
type: Input
|
|
775
|
+
}], checked: [{
|
|
776
|
+
type: Input
|
|
777
|
+
}], value: [{
|
|
778
|
+
type: Input
|
|
779
|
+
}], disabled: [{
|
|
780
|
+
type: Input
|
|
781
|
+
}], change: [{
|
|
782
|
+
type: Output
|
|
783
|
+
}] } });
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* Servizio di configurazione per la direttiva ItPopover.
|
|
787
|
+
* Il servizio può essere iniettato, tipicamente in un root component, per impostare i valori delle proprietà in
|
|
788
|
+
* modo tale da fornire i valori di default per tutti i popover utilizzati in un'applicazione.
|
|
789
|
+
*/
|
|
790
|
+
class ItTooltipConfig extends NgbTooltipConfig {
|
|
791
|
+
}
|
|
792
|
+
ItTooltipConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTooltipConfig, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
793
|
+
ItTooltipConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTooltipConfig, providedIn: 'root' });
|
|
794
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTooltipConfig, decorators: [{
|
|
795
|
+
type: Injectable,
|
|
796
|
+
args: [{ providedIn: 'root' }]
|
|
797
|
+
}] });
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* @license
|
|
801
|
+
* Copyright Angular ng-bootstrap team All Rights Reserved.
|
|
802
|
+
*
|
|
803
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
804
|
+
* found in the LICENSE file at https://raw.githubusercontent.com/ng-bootstrap/ng-bootstrap/master/LICENSE
|
|
805
|
+
*/
|
|
806
|
+
/**
|
|
807
|
+
* Una direttiva per la creazione di un tooltip.
|
|
808
|
+
*/
|
|
809
|
+
class ItTooltip extends NgbTooltip {
|
|
810
|
+
constructor(_elementRef, _renderer, injector, viewContainerRef, config, _ngZone, _document, _changeDetector, applicationRef) {
|
|
811
|
+
super(_elementRef, _renderer, injector, viewContainerRef, config, _ngZone, _document, _changeDetector, applicationRef);
|
|
812
|
+
}
|
|
813
|
+
ngOnInit() {
|
|
814
|
+
super.ngOnInit();
|
|
815
|
+
super.ngbTooltip = this.itTooltip;
|
|
816
|
+
this.tooltipClass = 'it-tooltip-window';
|
|
817
|
+
}
|
|
818
|
+
ngOnDestroy() {
|
|
819
|
+
super.ngOnDestroy();
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
ItTooltip.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTooltip, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: i0.ViewContainerRef }, { token: ItTooltipConfig }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i0.ChangeDetectorRef }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
823
|
+
ItTooltip.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItTooltip, selector: "[itTooltip]", inputs: { itTooltip: "itTooltip" }, exportAs: ["itTooltip"], usesInheritance: true, ngImport: i0 });
|
|
824
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTooltip, decorators: [{
|
|
825
|
+
type: Directive,
|
|
826
|
+
args: [{
|
|
827
|
+
selector: '[itTooltip]',
|
|
828
|
+
exportAs: 'itTooltip'
|
|
829
|
+
}]
|
|
830
|
+
}], ctorParameters: function () {
|
|
831
|
+
return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i0.ViewContainerRef }, { type: ItTooltipConfig }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
832
|
+
type: Inject,
|
|
833
|
+
args: [DOCUMENT]
|
|
834
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ApplicationRef }];
|
|
835
|
+
}, propDecorators: { itTooltip: [{
|
|
836
|
+
type: Input
|
|
837
|
+
}] } });
|
|
838
|
+
|
|
839
|
+
class ItTooltipModule {
|
|
840
|
+
}
|
|
841
|
+
ItTooltipModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
842
|
+
ItTooltipModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: ItTooltipModule, declarations: [ItTooltip], imports: [CommonModule, NgbTooltipModule], exports: [ItTooltip] });
|
|
843
|
+
ItTooltipModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTooltipModule, imports: [CommonModule, NgbTooltipModule] });
|
|
844
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTooltipModule, decorators: [{
|
|
845
|
+
type: NgModule,
|
|
846
|
+
args: [{
|
|
847
|
+
declarations: [ItTooltip],
|
|
848
|
+
exports: [ItTooltip],
|
|
849
|
+
imports: [CommonModule, NgbTooltipModule]
|
|
850
|
+
}]
|
|
851
|
+
}] });
|
|
852
|
+
|
|
853
|
+
const ButtonSize = t.keyof({
|
|
854
|
+
lg: null,
|
|
855
|
+
sm: null,
|
|
856
|
+
xs: null,
|
|
857
|
+
});
|
|
858
|
+
const LG = 'lg';
|
|
859
|
+
const SM = 'sm';
|
|
860
|
+
const XS = 'xs';
|
|
861
|
+
const BUTTON_SIZES = {
|
|
862
|
+
LG: LG,
|
|
863
|
+
SM: SM,
|
|
864
|
+
XS: XS,
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
var IconSizeEnum;
|
|
868
|
+
(function (IconSizeEnum) {
|
|
869
|
+
IconSizeEnum["sx"] = "icon-xs";
|
|
870
|
+
IconSizeEnum["sm"] = "icon-sm";
|
|
871
|
+
IconSizeEnum["lg"] = "icon-lg";
|
|
872
|
+
IconSizeEnum["xl"] = "icon-xl";
|
|
873
|
+
IconSizeEnum["default"] = "";
|
|
874
|
+
})(IconSizeEnum || (IconSizeEnum = {}));
|
|
875
|
+
var IconColorEnum;
|
|
876
|
+
(function (IconColorEnum) {
|
|
877
|
+
IconColorEnum["default"] = "default";
|
|
878
|
+
IconColorEnum["primary"] = "primary";
|
|
879
|
+
IconColorEnum["secondary"] = "secondary";
|
|
880
|
+
IconColorEnum["info"] = "info";
|
|
881
|
+
IconColorEnum["success"] = "success";
|
|
882
|
+
IconColorEnum["warning"] = "warning";
|
|
883
|
+
IconColorEnum["danger"] = "danger";
|
|
884
|
+
IconColorEnum["disable"] = "disable";
|
|
885
|
+
IconColorEnum["light"] = "light";
|
|
886
|
+
IconColorEnum["white"] = "white";
|
|
887
|
+
})(IconColorEnum || (IconColorEnum = {}));
|
|
888
|
+
var IconBackgroundColorEnum;
|
|
889
|
+
(function (IconBackgroundColorEnum) {
|
|
890
|
+
IconBackgroundColorEnum["light"] = "light";
|
|
891
|
+
IconBackgroundColorEnum["dark"] = "dark";
|
|
892
|
+
})(IconBackgroundColorEnum || (IconBackgroundColorEnum = {}));
|
|
893
|
+
|
|
894
|
+
var VerticalAlign;
|
|
895
|
+
(function (VerticalAlign) {
|
|
896
|
+
VerticalAlign["top"] = "top";
|
|
897
|
+
VerticalAlign["middle"] = "middle";
|
|
898
|
+
VerticalAlign["bottom"] = "bottom";
|
|
899
|
+
})(VerticalAlign || (VerticalAlign = {}));
|
|
900
|
+
var HorizontalAlign;
|
|
901
|
+
(function (HorizontalAlign) {
|
|
902
|
+
HorizontalAlign["left"] = "left";
|
|
903
|
+
HorizontalAlign["right"] = "right";
|
|
904
|
+
})(HorizontalAlign || (HorizontalAlign = {}));
|
|
905
|
+
const HORIZONTAL_ALIGN = t.keyof(HorizontalAlign);
|
|
906
|
+
const VERTICAL_ALIGN = t.keyof(VerticalAlign);
|
|
907
|
+
|
|
908
|
+
class IconComponent {
|
|
909
|
+
constructor(_cdr) {
|
|
910
|
+
this._cdr = _cdr;
|
|
911
|
+
this.rounded = false;
|
|
912
|
+
this.roundedColor = null;
|
|
913
|
+
this.iconName = '';
|
|
914
|
+
this.wai = 'wai';
|
|
915
|
+
this.size = IconSizeEnum.default;
|
|
916
|
+
this.color = IconColorEnum.primary;
|
|
917
|
+
this.bgColor = null;
|
|
918
|
+
this.padded = false;
|
|
919
|
+
this.expand = false;
|
|
920
|
+
/**
|
|
921
|
+
* Allineamento orizzontale dell'icona rispetto al contenitor: 'left' | 'right'
|
|
922
|
+
*/
|
|
923
|
+
this.position = HorizontalAlign.right;
|
|
924
|
+
this._verticalAlign = VerticalAlign.middle;
|
|
925
|
+
this.svgPath = null;
|
|
926
|
+
}
|
|
927
|
+
changeColor(color) {
|
|
928
|
+
if (this.color !== color) {
|
|
929
|
+
this.color = color;
|
|
930
|
+
this._cdr.markForCheck();
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
get roundedColorClass() {
|
|
934
|
+
return this.roundedColor ? ' rounded-' + this.roundedColor : '';
|
|
935
|
+
}
|
|
936
|
+
set icon(newIcon) {
|
|
937
|
+
if (newIcon) {
|
|
938
|
+
this.svgPath = IconComponent.ICON_BASE_URL + newIcon;
|
|
939
|
+
this.iconName = newIcon;
|
|
940
|
+
}
|
|
941
|
+
else {
|
|
942
|
+
this.svgPath = null;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Allineamento verticale dell'icona rispetto al contenitore: 'top' | 'middle' | 'bottom'
|
|
947
|
+
*/
|
|
948
|
+
get verticalAlign() {
|
|
949
|
+
return this._verticalAlign;
|
|
950
|
+
}
|
|
951
|
+
set verticalAlign(value) {
|
|
952
|
+
if (VERTICAL_ALIGN.is(value)) {
|
|
953
|
+
this._verticalAlign = value;
|
|
954
|
+
}
|
|
955
|
+
else {
|
|
956
|
+
this._verticalAlign = VerticalAlign.middle;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
IconComponent.ICON_BASE_URL = 'bootstrap-italia/dist/svg/sprites.svg#';
|
|
961
|
+
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: IconComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
962
|
+
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: IconComponent, selector: "it-icon", inputs: { rounded: "rounded", roundedColor: "roundedColor", icon: "icon", wai: "wai", size: "size", color: "color", bgColor: "bgColor", padded: "padded", expand: "expand", position: "position", verticalAlign: "verticalAlign" }, ngImport: i0, template: "<ng-container *ngIf = \"iconName && svgPath\">\n <ng-container *ngIf = \"rounded; else svgIcon\">\n <span [class] = \"'rounded-icon' + roundedColorClass\">\n <ng-container *ngTemplateOutlet=\"svgIcon\"></ng-container>\n </span>\n </ng-container>\n</ng-container>\n<ng-template #svgIcon>\n <svg\n class=\"icon {{iconName}} {{size}} icon-{{color}} {{ bgColor ? 'bg-' + bgColor : '' }} {{position}} align-{{verticalAlign}}\" \n [class.icon-expand]=\"expand\" [class.icon-padded]=\"padded\">\n\n <use [attr.xlink:href]=\"svgPath\" [attr.href]=\"svgPath\"></use>\n</svg> \n</ng-template>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: IconComponent, decorators: [{
|
|
964
|
+
type: Component,
|
|
965
|
+
args: [{ selector: 'it-icon', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf = \"iconName && svgPath\">\n <ng-container *ngIf = \"rounded; else svgIcon\">\n <span [class] = \"'rounded-icon' + roundedColorClass\">\n <ng-container *ngTemplateOutlet=\"svgIcon\"></ng-container>\n </span>\n </ng-container>\n</ng-container>\n<ng-template #svgIcon>\n <svg\n class=\"icon {{iconName}} {{size}} icon-{{color}} {{ bgColor ? 'bg-' + bgColor : '' }} {{position}} align-{{verticalAlign}}\" \n [class.icon-expand]=\"expand\" [class.icon-padded]=\"padded\">\n\n <use [attr.xlink:href]=\"svgPath\" [attr.href]=\"svgPath\"></use>\n</svg> \n</ng-template>" }]
|
|
966
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { rounded: [{
|
|
967
|
+
type: Input
|
|
968
|
+
}], roundedColor: [{
|
|
969
|
+
type: Input
|
|
970
|
+
}], icon: [{
|
|
971
|
+
type: Input
|
|
972
|
+
}], wai: [{
|
|
973
|
+
type: Input
|
|
974
|
+
}], size: [{
|
|
975
|
+
type: Input
|
|
976
|
+
}], color: [{
|
|
977
|
+
type: Input
|
|
978
|
+
}], bgColor: [{
|
|
979
|
+
type: Input
|
|
980
|
+
}], padded: [{
|
|
981
|
+
type: Input
|
|
982
|
+
}], expand: [{
|
|
983
|
+
type: Input
|
|
984
|
+
}], position: [{
|
|
985
|
+
type: Input
|
|
986
|
+
}], verticalAlign: [{
|
|
987
|
+
type: Input
|
|
988
|
+
}] } });
|
|
989
|
+
|
|
990
|
+
class ItDropdownConfig extends NgbDropdownConfig {
|
|
991
|
+
}
|
|
992
|
+
ItDropdownConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownConfig, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
993
|
+
ItDropdownConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownConfig, providedIn: 'root' });
|
|
994
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownConfig, decorators: [{
|
|
995
|
+
type: Injectable,
|
|
996
|
+
args: [{ providedIn: 'root' }]
|
|
997
|
+
}] });
|
|
998
|
+
|
|
999
|
+
class ItNavbar extends NgbNavbar {
|
|
1000
|
+
}
|
|
1001
|
+
ItNavbar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItNavbar, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1002
|
+
ItNavbar.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItNavbar, selector: ".navbar", usesInheritance: true, ngImport: i0 });
|
|
1003
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItNavbar, decorators: [{
|
|
1004
|
+
type: Directive,
|
|
1005
|
+
args: [{ selector: '.navbar' }]
|
|
1006
|
+
}] });
|
|
1007
|
+
/**
|
|
1008
|
+
* A directive you should put on a dropdown item to enable keyboard navigation.
|
|
1009
|
+
* Arrow keys will move focus between items marked with this directive.
|
|
1010
|
+
*
|
|
1011
|
+
* @since 4.1.0
|
|
1012
|
+
*/
|
|
1013
|
+
class ItDropdownItem extends NgbDropdownItem {
|
|
1014
|
+
constructor(elementRef, _renderer) {
|
|
1015
|
+
super(elementRef, _renderer);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
ItDropdownItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownItem, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1019
|
+
ItDropdownItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItDropdownItem, selector: "[itDropdownItem]", usesInheritance: true, ngImport: i0 });
|
|
1020
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownItem, decorators: [{
|
|
1021
|
+
type: Directive,
|
|
1022
|
+
args: [{
|
|
1023
|
+
selector: '[itDropdownItem]'
|
|
1024
|
+
}]
|
|
1025
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
1026
|
+
/**
|
|
1027
|
+
* A directive that wraps dropdown menu content and dropdown items.
|
|
1028
|
+
*/
|
|
1029
|
+
class ItDropdownMenu extends NgbDropdownMenu {
|
|
1030
|
+
constructor(dropdown, _elementRef) {
|
|
1031
|
+
super(dropdown, _elementRef);
|
|
1032
|
+
this.dropdown = dropdown;
|
|
1033
|
+
}
|
|
1034
|
+
ngAfterContentInit() {
|
|
1035
|
+
super.menuItems = this.menuItems;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
ItDropdownMenu.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownMenu, deps: [{ token: forwardRef(() => ItDropdown) }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1039
|
+
ItDropdownMenu.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItDropdownMenu, selector: "[itDropdownMenu]", host: { properties: { "attr.data-popper-placement": "placement" } }, queries: [{ propertyName: "menuItems", predicate: ItDropdownItem }], usesInheritance: true, ngImport: i0 });
|
|
1040
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownMenu, decorators: [{
|
|
1041
|
+
type: Directive,
|
|
1042
|
+
args: [{
|
|
1043
|
+
selector: '[itDropdownMenu]',
|
|
1044
|
+
host: {
|
|
1045
|
+
'[attr.data-popper-placement]': 'placement'
|
|
1046
|
+
}
|
|
1047
|
+
}]
|
|
1048
|
+
}], ctorParameters: function () {
|
|
1049
|
+
return [{ type: ItDropdown, decorators: [{
|
|
1050
|
+
type: Inject,
|
|
1051
|
+
args: [forwardRef(() => ItDropdown)]
|
|
1052
|
+
}] }, { type: i0.ElementRef }];
|
|
1053
|
+
}, propDecorators: { menuItems: [{
|
|
1054
|
+
type: ContentChildren,
|
|
1055
|
+
args: [ItDropdownItem]
|
|
1056
|
+
}] } });
|
|
1057
|
+
/**
|
|
1058
|
+
* A directive to mark an element to which dropdown menu will be anchored.
|
|
1059
|
+
*
|
|
1060
|
+
* This is a simple version of the `NgbDropdownToggle` directive.
|
|
1061
|
+
* It plays the same role, but doesn't listen to click events to toggle dropdown menu thus enabling support
|
|
1062
|
+
* for events other than click.
|
|
1063
|
+
*
|
|
1064
|
+
* @since 1.1.0
|
|
1065
|
+
*/
|
|
1066
|
+
class ItDropdownAnchor extends NgbDropdownAnchor {
|
|
1067
|
+
constructor(dropdown, _elementRef) {
|
|
1068
|
+
super(dropdown, _elementRef);
|
|
1069
|
+
this.dropdown = dropdown;
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
ItDropdownAnchor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownAnchor, deps: [{ token: forwardRef(() => ItDropdown) }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1073
|
+
ItDropdownAnchor.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItDropdownAnchor, selector: "[itDropdownAnchor]", usesInheritance: true, ngImport: i0 });
|
|
1074
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownAnchor, decorators: [{
|
|
1075
|
+
type: Directive,
|
|
1076
|
+
args: [{ selector: '[itDropdownAnchor]' }]
|
|
1077
|
+
}], ctorParameters: function () {
|
|
1078
|
+
return [{ type: ItDropdown, decorators: [{
|
|
1079
|
+
type: Inject,
|
|
1080
|
+
args: [forwardRef(() => ItDropdown)]
|
|
1081
|
+
}] }, { type: i0.ElementRef }];
|
|
1082
|
+
} });
|
|
1083
|
+
/**
|
|
1084
|
+
* A directive to mark an element that will toggle dropdown via the `click` event.
|
|
1085
|
+
*
|
|
1086
|
+
* You can also use `NgbDropdownAnchor` as an alternative.
|
|
1087
|
+
*/
|
|
1088
|
+
class ItDropdownToggle extends NgbDropdownToggle {
|
|
1089
|
+
constructor(dropdown, elementRef) {
|
|
1090
|
+
super(dropdown, elementRef);
|
|
1091
|
+
this.dropdown = dropdown;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
ItDropdownToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownToggle, deps: [{ token: forwardRef(() => ItDropdown) }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1095
|
+
ItDropdownToggle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItDropdownToggle, selector: "[itDropdownToggle]", host: { properties: { "class": "placement" } }, providers: [{ provide: ItDropdownAnchor, useExisting: forwardRef(() => ItDropdownToggle) }], usesInheritance: true, ngImport: i0 });
|
|
1096
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownToggle, decorators: [{
|
|
1097
|
+
type: Directive,
|
|
1098
|
+
args: [{
|
|
1099
|
+
selector: '[itDropdownToggle]',
|
|
1100
|
+
host: {
|
|
1101
|
+
'[class]': 'placement'
|
|
1102
|
+
},
|
|
1103
|
+
providers: [{ provide: ItDropdownAnchor, useExisting: forwardRef(() => ItDropdownToggle) }]
|
|
1104
|
+
}]
|
|
1105
|
+
}], ctorParameters: function () {
|
|
1106
|
+
return [{ type: ItDropdown, decorators: [{
|
|
1107
|
+
type: Inject,
|
|
1108
|
+
args: [forwardRef(() => ItDropdown)]
|
|
1109
|
+
}] }, { type: i0.ElementRef }];
|
|
1110
|
+
} });
|
|
1111
|
+
/**
|
|
1112
|
+
* A directive that provides contextual overlays for displaying lists of links and more.
|
|
1113
|
+
*/
|
|
1114
|
+
class ItDropdown extends NgbDropdown {
|
|
1115
|
+
constructor(_changeDetector, config, _document, _ngZone, _elementRef, _renderer, itNavbar) {
|
|
1116
|
+
super(_changeDetector, config, _document, _ngZone, _elementRef, _renderer, itNavbar);
|
|
1117
|
+
/**
|
|
1118
|
+
* An event fired when the dropdown is opened or closed.
|
|
1119
|
+
*
|
|
1120
|
+
* The event payload is a `boolean`:
|
|
1121
|
+
* * `true` - the dropdown was opened
|
|
1122
|
+
* * `false` - the dropdown was closed
|
|
1123
|
+
*/
|
|
1124
|
+
this.openChange = new EventEmitter();
|
|
1125
|
+
}
|
|
1126
|
+
ngAfterContentInit() {
|
|
1127
|
+
super["_menu"] = this._itMenu;
|
|
1128
|
+
super["_anchor"] = this._itAnchor;
|
|
1129
|
+
super.ngAfterContentInit();
|
|
1130
|
+
}
|
|
1131
|
+
ngOnChanges(changes) {
|
|
1132
|
+
super.ngOnChanges(changes);
|
|
1133
|
+
}
|
|
1134
|
+
ngOnDestroy() { super.ngOnDestroy(); }
|
|
1135
|
+
}
|
|
1136
|
+
ItDropdown.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdown, deps: [{ token: i0.ChangeDetectorRef }, { token: ItDropdownConfig }, { token: DOCUMENT }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: ItNavbar, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1137
|
+
ItDropdown.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItDropdown, selector: "[itDropdown]", outputs: { openChange: "openChange" }, queries: [{ propertyName: "_itMenu", first: true, predicate: ItDropdownMenu, descendants: true }, { propertyName: "_itAnchor", first: true, predicate: ItDropdownAnchor, descendants: true }], exportAs: ["itDropdown"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
1138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdown, decorators: [{
|
|
1139
|
+
type: Directive,
|
|
1140
|
+
args: [{ selector: '[itDropdown]', exportAs: 'itDropdown' }]
|
|
1141
|
+
}], ctorParameters: function () {
|
|
1142
|
+
return [{ type: i0.ChangeDetectorRef }, { type: ItDropdownConfig }, { type: undefined, decorators: [{
|
|
1143
|
+
type: Inject,
|
|
1144
|
+
args: [DOCUMENT]
|
|
1145
|
+
}] }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: ItNavbar, decorators: [{
|
|
1146
|
+
type: Optional
|
|
1147
|
+
}] }];
|
|
1148
|
+
}, propDecorators: { _itMenu: [{
|
|
1149
|
+
type: ContentChild,
|
|
1150
|
+
args: [ItDropdownMenu, { static: false }]
|
|
1151
|
+
}], _itAnchor: [{
|
|
1152
|
+
type: ContentChild,
|
|
1153
|
+
args: [ItDropdownAnchor, { static: false }]
|
|
1154
|
+
}], openChange: [{
|
|
1155
|
+
type: Output
|
|
1156
|
+
}] } });
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* Un bottone con design bootstrap italia. Supporta tutte le funzionalità di un bottone HTML5.
|
|
1160
|
+
*/
|
|
1161
|
+
class ItButtonDirective {
|
|
1162
|
+
constructor(dropdownToggle, _cdr) {
|
|
1163
|
+
this._cdr = _cdr;
|
|
1164
|
+
this._isDropdownButton = false;
|
|
1165
|
+
this.autoUpdateIconColor = true;
|
|
1166
|
+
this._disabled = false;
|
|
1167
|
+
this._onFocus = false;
|
|
1168
|
+
this._outline = false;
|
|
1169
|
+
this._block = false;
|
|
1170
|
+
this._isDropdownButton = !!dropdownToggle;
|
|
1171
|
+
}
|
|
1172
|
+
isLightColor(color) {
|
|
1173
|
+
return color === IconColorEnum.light || color === IconColorEnum.info ||
|
|
1174
|
+
color === IconColorEnum.white;
|
|
1175
|
+
}
|
|
1176
|
+
set color(value) {
|
|
1177
|
+
if (ThemeColor.is(value)) {
|
|
1178
|
+
this._color = value;
|
|
1179
|
+
}
|
|
1180
|
+
else {
|
|
1181
|
+
this._color = this._isDropdownButton ? "dropdown" : IconColorEnum.primary;
|
|
1182
|
+
}
|
|
1183
|
+
if (this.autoUpdateIconColor) {
|
|
1184
|
+
this.updateButtonIconColor();
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
updateButtonIconColor() {
|
|
1188
|
+
var _a;
|
|
1189
|
+
(_a = this.iconComponents) === null || _a === void 0 ? void 0 : _a.forEach(icon => {
|
|
1190
|
+
let newIconColor = IconColorEnum.primary;
|
|
1191
|
+
if (this._color === "dropdown") {
|
|
1192
|
+
newIconColor = IconColorEnum.primary;
|
|
1193
|
+
}
|
|
1194
|
+
else if (this.isLightColor(this._color)) {
|
|
1195
|
+
newIconColor = IconColorEnum.default;
|
|
1196
|
+
}
|
|
1197
|
+
else {
|
|
1198
|
+
newIconColor = IconColorEnum.white;
|
|
1199
|
+
}
|
|
1200
|
+
icon.changeColor(newIconColor);
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Stabilisce il colore del pulsante a seconda delle classi di bootstrap.
|
|
1205
|
+
* Può avere valori:
|
|
1206
|
+
* <ul>
|
|
1207
|
+
* <li> primary
|
|
1208
|
+
* <li> secondary
|
|
1209
|
+
* <li> danger
|
|
1210
|
+
* <li> warning
|
|
1211
|
+
* <li> info
|
|
1212
|
+
* <li> success
|
|
1213
|
+
* <li> light
|
|
1214
|
+
* <li> dark
|
|
1215
|
+
* </ul>
|
|
1216
|
+
*/
|
|
1217
|
+
get color() {
|
|
1218
|
+
return this._color;
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Se presente, il pulsante avrà un effetto di trasparenza e non reagirà al click
|
|
1222
|
+
*/
|
|
1223
|
+
get disabled() { return this._disabled; }
|
|
1224
|
+
set disabled(value) { this._disabled = Util.coerceBooleanProperty(value); }
|
|
1225
|
+
onFocus() {
|
|
1226
|
+
this._onFocus = true;
|
|
1227
|
+
}
|
|
1228
|
+
onBlur() {
|
|
1229
|
+
this._onFocus = false;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Stabilisce se lo stile del pulsante avrà un contorno.
|
|
1233
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore.
|
|
1234
|
+
* Deve funzionare solo in congiunzione con un colore definito, altrimenti l'attributo viene ignorato.
|
|
1235
|
+
*/
|
|
1236
|
+
get outline() { return this._outline; }
|
|
1237
|
+
set outline(value) { this._outline = Util.coerceBooleanProperty(value); }
|
|
1238
|
+
/**
|
|
1239
|
+
* Indica se il pulsante occupa tutta l'ampiezza a sua disposizione.
|
|
1240
|
+
*/
|
|
1241
|
+
get block() { return this._block; }
|
|
1242
|
+
set block(value) { this._block = Util.coerceBooleanProperty(value); }
|
|
1243
|
+
/**
|
|
1244
|
+
* Indica la grandezza del pulsante. Può assumere i valori:
|
|
1245
|
+
* <ul>
|
|
1246
|
+
* <li> lg
|
|
1247
|
+
* <li> sm
|
|
1248
|
+
* <li> xs
|
|
1249
|
+
* </ul>
|
|
1250
|
+
*/
|
|
1251
|
+
get size() {
|
|
1252
|
+
return this._size;
|
|
1253
|
+
}
|
|
1254
|
+
set size(value) {
|
|
1255
|
+
if (ButtonSize.is(value)) {
|
|
1256
|
+
this._size = value;
|
|
1257
|
+
}
|
|
1258
|
+
else {
|
|
1259
|
+
this._size = undefined;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
get hostClasses() {
|
|
1263
|
+
var _a;
|
|
1264
|
+
let cssClass = 'btn';
|
|
1265
|
+
if (this.color) {
|
|
1266
|
+
if (this.outline) {
|
|
1267
|
+
cssClass += ` btn-outline-${this.color}`;
|
|
1268
|
+
}
|
|
1269
|
+
else {
|
|
1270
|
+
cssClass += ` btn-${this.color}`;
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
if (this.size) {
|
|
1274
|
+
cssClass += ` btn-${this.size}`;
|
|
1275
|
+
}
|
|
1276
|
+
if (this.block) {
|
|
1277
|
+
cssClass += ' btn-block';
|
|
1278
|
+
}
|
|
1279
|
+
if (this.disabled) {
|
|
1280
|
+
cssClass += ' disabled';
|
|
1281
|
+
}
|
|
1282
|
+
if (this._onFocus) {
|
|
1283
|
+
cssClass += ' focus--mouse';
|
|
1284
|
+
}
|
|
1285
|
+
if (((_a = this.iconComponents) === null || _a === void 0 ? void 0 : _a.length) && !this.progressBar) {
|
|
1286
|
+
cssClass += ' btn-icon';
|
|
1287
|
+
}
|
|
1288
|
+
if (this.progressBar) {
|
|
1289
|
+
cssClass += ' btn-progress';
|
|
1290
|
+
}
|
|
1291
|
+
return cssClass;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
ItButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItButtonDirective, deps: [{ token: ItDropdownToggle, host: true, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1295
|
+
ItButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItButtonDirective, selector: "[itButton]", inputs: { autoUpdateIconColor: "autoUpdateIconColor", color: ["itButton", "color"], disabled: "disabled", outline: "outline", block: "block", size: "size" }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()" }, properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "progressBar", first: true, predicate: ProgressBarComponent, descendants: true }, { propertyName: "iconComponents", predicate: IconComponent }], exportAs: ["itButton"], ngImport: i0 });
|
|
1296
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItButtonDirective, decorators: [{
|
|
1297
|
+
type: Directive,
|
|
1298
|
+
args: [{
|
|
1299
|
+
selector: '[itButton]',
|
|
1300
|
+
exportAs: 'itButton'
|
|
1301
|
+
}]
|
|
1302
|
+
}], ctorParameters: function () {
|
|
1303
|
+
return [{ type: ItDropdownToggle, decorators: [{
|
|
1304
|
+
type: Optional
|
|
1305
|
+
}, {
|
|
1306
|
+
type: Host
|
|
1307
|
+
}] }, { type: i0.ChangeDetectorRef }];
|
|
1308
|
+
}, propDecorators: { autoUpdateIconColor: [{
|
|
1309
|
+
type: Input
|
|
1310
|
+
}], color: [{
|
|
1311
|
+
type: Input,
|
|
1312
|
+
args: ['itButton']
|
|
1313
|
+
}], disabled: [{
|
|
1314
|
+
type: Input
|
|
1315
|
+
}], onFocus: [{
|
|
1316
|
+
type: HostListener,
|
|
1317
|
+
args: ['focus']
|
|
1318
|
+
}], onBlur: [{
|
|
1319
|
+
type: HostListener,
|
|
1320
|
+
args: ['blur']
|
|
1321
|
+
}], iconComponents: [{
|
|
1322
|
+
type: ContentChildren,
|
|
1323
|
+
args: [IconComponent]
|
|
1324
|
+
}], progressBar: [{
|
|
1325
|
+
type: ContentChild,
|
|
1326
|
+
args: [ProgressBarComponent]
|
|
1327
|
+
}], outline: [{
|
|
1328
|
+
type: Input
|
|
1329
|
+
}], block: [{
|
|
1330
|
+
type: Input
|
|
1331
|
+
}], size: [{
|
|
1332
|
+
type: Input
|
|
1333
|
+
}], hostClasses: [{
|
|
1334
|
+
type: HostBinding,
|
|
1335
|
+
args: ['class']
|
|
1336
|
+
}] } });
|
|
1337
|
+
|
|
1338
|
+
class ItIconModule {
|
|
1339
|
+
}
|
|
1340
|
+
ItIconModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItIconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1341
|
+
ItIconModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: ItIconModule, declarations: [IconComponent], imports: [CommonModule], exports: [IconComponent] });
|
|
1342
|
+
ItIconModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItIconModule, imports: [CommonModule] });
|
|
1343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItIconModule, decorators: [{
|
|
1344
|
+
type: NgModule,
|
|
1345
|
+
args: [{
|
|
1346
|
+
imports: [CommonModule],
|
|
1347
|
+
declarations: [IconComponent],
|
|
1348
|
+
exports: [IconComponent]
|
|
1349
|
+
}]
|
|
1350
|
+
}] });
|
|
1351
|
+
|
|
1352
|
+
class ItButtonModule {
|
|
1353
|
+
}
|
|
1354
|
+
ItButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1355
|
+
ItButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: ItButtonModule, declarations: [ItButtonDirective], imports: [ItIconModule], exports: [ItButtonDirective] });
|
|
1356
|
+
ItButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItButtonModule, imports: [ItIconModule] });
|
|
1357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItButtonModule, decorators: [{
|
|
1358
|
+
type: NgModule,
|
|
1359
|
+
args: [{
|
|
1360
|
+
declarations: [ItButtonDirective],
|
|
1361
|
+
imports: [ItIconModule],
|
|
1362
|
+
exports: [ItButtonDirective]
|
|
1363
|
+
}]
|
|
1364
|
+
}] });
|
|
1365
|
+
|
|
1366
|
+
/**
|
|
1367
|
+
* Una badge con design bootstrap italia.
|
|
1368
|
+
*/
|
|
1369
|
+
class BadgeDirective {
|
|
1370
|
+
constructor(el) {
|
|
1371
|
+
this.el = el;
|
|
1372
|
+
this._badgeColor = THEME_COLORS.LIGHT;
|
|
1373
|
+
this._badgeText = '';
|
|
1374
|
+
this._isPill = false;
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* (Opzionale) indica il colore del badge. Può essere `primary`, `secondary`, `danger`, `warning`, `info`, `success`, `light` o `dark`.
|
|
1378
|
+
* Se non viene fornito o il valore è diverso da quelli previsti il suo valore di default è `light`.
|
|
1379
|
+
*/
|
|
1380
|
+
get badgeColor() {
|
|
1381
|
+
return this._badgeColor;
|
|
1382
|
+
}
|
|
1383
|
+
set badgeColor(value) {
|
|
1384
|
+
if (ThemeColor.is(value)) {
|
|
1385
|
+
this._badgeColor = value;
|
|
1386
|
+
}
|
|
1387
|
+
else {
|
|
1388
|
+
this._badgeColor = THEME_COLORS.LIGHT;
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* La direttiva che abilita l'elemento come badge. Mostra il testo come contenuto del badge.
|
|
1393
|
+
* Se valutato ad `undefined`, `null` o stringa vuota il badge non viene mostrato.
|
|
1394
|
+
*/
|
|
1395
|
+
get badgeText() { return this._badgeText; }
|
|
1396
|
+
set badgeText(value) {
|
|
1397
|
+
if (value) {
|
|
1398
|
+
this._badgeText = value;
|
|
1399
|
+
}
|
|
1400
|
+
else {
|
|
1401
|
+
this._badgeText = '';
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Indica se il badge è arrotondato o meno.
|
|
1406
|
+
*/
|
|
1407
|
+
get isPill() { return this._isPill; }
|
|
1408
|
+
set isPill(value) {
|
|
1409
|
+
this._isPill = Util.coerceBooleanProperty(value);
|
|
1410
|
+
}
|
|
1411
|
+
getBadgeColorClassName() {
|
|
1412
|
+
return `bg-${this._badgeColor}`;
|
|
1413
|
+
}
|
|
1414
|
+
get hostClasses() {
|
|
1415
|
+
return [
|
|
1416
|
+
'badge',
|
|
1417
|
+
this.getBadgeColorClassName(),
|
|
1418
|
+
this.isPill ? 'rounded-pill' : '',
|
|
1419
|
+
].join(' ');
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
BadgeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BadgeDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1423
|
+
BadgeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: BadgeDirective, selector: "[itBadge]", inputs: { badgeColor: "badgeColor", badgeText: ["itBadge", "badgeText"], isPill: "isPill" }, host: { properties: { "innerText": "this.badgeText", "class": "this.hostClasses" } }, exportAs: ["itBadge"], ngImport: i0 });
|
|
1424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BadgeDirective, decorators: [{
|
|
1425
|
+
type: Directive,
|
|
1426
|
+
args: [{
|
|
1427
|
+
selector: '[itBadge]',
|
|
1428
|
+
exportAs: 'itBadge'
|
|
1429
|
+
}]
|
|
1430
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { badgeColor: [{
|
|
1431
|
+
type: Input
|
|
1432
|
+
}], badgeText: [{
|
|
1433
|
+
type: Input,
|
|
1434
|
+
args: ['itBadge']
|
|
1435
|
+
}, {
|
|
1436
|
+
type: HostBinding,
|
|
1437
|
+
args: ['innerText']
|
|
1438
|
+
}], isPill: [{
|
|
1439
|
+
type: Input
|
|
1440
|
+
}], hostClasses: [{
|
|
1441
|
+
type: HostBinding,
|
|
1442
|
+
args: ['class']
|
|
1443
|
+
}] } });
|
|
1444
|
+
|
|
1445
|
+
class ItCollapseConfig extends NgbCollapseConfig {
|
|
1446
|
+
}
|
|
1447
|
+
ItCollapseConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseConfig, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1448
|
+
ItCollapseConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseConfig, providedIn: 'root' });
|
|
1449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseConfig, decorators: [{
|
|
1450
|
+
type: Injectable,
|
|
1451
|
+
args: [{ providedIn: 'root' }]
|
|
1452
|
+
}] });
|
|
1453
|
+
|
|
1454
|
+
/**
|
|
1455
|
+
* Per ottimizzare l’ingombro dei contenuti di una pagina si possono usare degli elementi richiudibili
|
|
1456
|
+
* (in gergo definiti collassabili o collapse), che possono essere attivati indipendentemente l’uno dall’altro
|
|
1457
|
+
*/
|
|
1458
|
+
class ItCollapseDirective extends NgbCollapse {
|
|
1459
|
+
constructor(_cd, _elementRef, _config, _ngZone) {
|
|
1460
|
+
super(_elementRef, _config, _ngZone);
|
|
1461
|
+
this._cd = _cd;
|
|
1462
|
+
this.itCollapseChange = new EventEmitter();
|
|
1463
|
+
}
|
|
1464
|
+
ngOnInit() {
|
|
1465
|
+
super.ngOnInit();
|
|
1466
|
+
super.collapsed = Util.coerceBooleanProperty(this.itCollapse);
|
|
1467
|
+
super.ngbCollapseChange = this.itCollapseChange;
|
|
1468
|
+
this._cd.detectChanges();
|
|
1469
|
+
}
|
|
1470
|
+
ngOnChanges({ itCollapse }) {
|
|
1471
|
+
const coercedValue = Util.coerceBooleanProperty(itCollapse.currentValue);
|
|
1472
|
+
super.collapsed = coercedValue;
|
|
1473
|
+
super.ngOnChanges({ collapsed: itCollapse });
|
|
1474
|
+
}
|
|
1475
|
+
get isCollapsed() {
|
|
1476
|
+
return this.collapsed;
|
|
1477
|
+
}
|
|
1478
|
+
show() {
|
|
1479
|
+
if (this.isCollapsed) {
|
|
1480
|
+
super.toggle();
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
hide() {
|
|
1484
|
+
if (!this.isCollapsed) {
|
|
1485
|
+
super.toggle();
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
ItCollapseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: ItCollapseConfig }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1490
|
+
ItCollapseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItCollapseDirective, selector: "[itCollapse]", inputs: { itCollapse: "itCollapse" }, outputs: { itCollapseChange: "itCollapseChange" }, exportAs: ["itCollapse"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
1491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseDirective, decorators: [{
|
|
1492
|
+
type: Directive,
|
|
1493
|
+
args: [{
|
|
1494
|
+
// tslint:disable-next-line:directive-selector
|
|
1495
|
+
selector: '[itCollapse]',
|
|
1496
|
+
exportAs: 'itCollapse'
|
|
1497
|
+
}]
|
|
1498
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: ItCollapseConfig }, { type: i0.NgZone }]; }, propDecorators: { itCollapse: [{
|
|
1499
|
+
type: Input
|
|
1500
|
+
}], itCollapseChange: [{
|
|
1501
|
+
type: Output
|
|
1502
|
+
}] } });
|
|
1503
|
+
|
|
1504
|
+
let identifier$6 = 0;
|
|
1505
|
+
class ItCollapseItemComponent {
|
|
1506
|
+
constructor(elementRef) {
|
|
1507
|
+
this.elementRef = elementRef;
|
|
1508
|
+
this.id = `collapse-item-${identifier$6++}`;
|
|
1509
|
+
this.headingId = `${this.id}-heading`;
|
|
1510
|
+
this._showEvent = new EventEmitter();
|
|
1511
|
+
this._shownEvent = new EventEmitter();
|
|
1512
|
+
this._hideEvent = new EventEmitter();
|
|
1513
|
+
this._hiddenEvent = new EventEmitter();
|
|
1514
|
+
}
|
|
1515
|
+
/**
|
|
1516
|
+
* Testo del bottone di apertura/chiusura del collapse item
|
|
1517
|
+
*/
|
|
1518
|
+
get header() { return this._header; }
|
|
1519
|
+
set header(value) { this._header = value; }
|
|
1520
|
+
/**
|
|
1521
|
+
* Evento da emettere quando il collapse sta per essere mostrato
|
|
1522
|
+
*/
|
|
1523
|
+
get showEvent() { return this._showEvent; }
|
|
1524
|
+
set showEvent(value) { this._showEvent = value; }
|
|
1525
|
+
/**
|
|
1526
|
+
* Evento da emettere quando il collapse è mostrato
|
|
1527
|
+
*/
|
|
1528
|
+
get shownEvent() { return this._shownEvent; }
|
|
1529
|
+
set shownEvent(value) { this._shownEvent = value; }
|
|
1530
|
+
/**
|
|
1531
|
+
* Evento da emettere quando il collapse sta per essere nascosto
|
|
1532
|
+
*/
|
|
1533
|
+
get hideEvent() { return this._hideEvent; }
|
|
1534
|
+
set hideEvent(value) { this._hideEvent = value; }
|
|
1535
|
+
/**
|
|
1536
|
+
* Evento da emettere quando il collapse è nascosto
|
|
1537
|
+
*/
|
|
1538
|
+
get hiddenEvent() { return this._hiddenEvent; }
|
|
1539
|
+
set hiddenEvent(value) { this._hiddenEvent = value; }
|
|
1540
|
+
show() {
|
|
1541
|
+
this.showEvent.emit(this);
|
|
1542
|
+
}
|
|
1543
|
+
hide() {
|
|
1544
|
+
this.hideEvent.emit(this);
|
|
1545
|
+
}
|
|
1546
|
+
shown() {
|
|
1547
|
+
this.shownEvent.emit(this);
|
|
1548
|
+
}
|
|
1549
|
+
hidden() {
|
|
1550
|
+
this.hiddenEvent.emit(this);
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
ItCollapseItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseItemComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1554
|
+
ItCollapseItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: ItCollapseItemComponent, selector: "it-collapse-item", inputs: { header: "header" }, outputs: { showEvent: "show", shownEvent: "shown", hideEvent: "hide", hiddenEvent: "hidden" }, viewQueries: [{ propertyName: "directive", first: true, predicate: ItCollapseDirective, descendants: true, static: true }], ngImport: i0, template: "<div class=\"collapse-header\" [id]=\"headingId\">\n <button #toggleButton focusMouse data-toggle=\"collapse\" [attr.aria-expanded]=\"!collapse.isCollapsed\" [attr.aria-controls]=\"id\" (click)=\"collapse.toggle()\" [ngClass]=\"{'collapsed' : collapse.isCollapsed}\">\n {{header}}\n </button>\n</div>\n<div [id]=\"id\" #collapse=\"itCollapse\" itCollapse (shown)=\"shown()\" (hidden)=\"hidden()\" role=\"tabpanel\" [attr.aria-labelledby]=\"headingId\">\n <div class=\"collapse-body\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: FocusMouseDirective, selector: "[focusMouse]", exportAs: ["focusMouse"] }, { kind: "directive", type: ItCollapseDirective, selector: "[itCollapse]", inputs: ["itCollapse"], outputs: ["itCollapseChange"], exportAs: ["itCollapse"] }] });
|
|
1555
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseItemComponent, decorators: [{
|
|
1556
|
+
type: Component,
|
|
1557
|
+
args: [{ selector: 'it-collapse-item', template: "<div class=\"collapse-header\" [id]=\"headingId\">\n <button #toggleButton focusMouse data-toggle=\"collapse\" [attr.aria-expanded]=\"!collapse.isCollapsed\" [attr.aria-controls]=\"id\" (click)=\"collapse.toggle()\" [ngClass]=\"{'collapsed' : collapse.isCollapsed}\">\n {{header}}\n </button>\n</div>\n<div [id]=\"id\" #collapse=\"itCollapse\" itCollapse (shown)=\"shown()\" (hidden)=\"hidden()\" role=\"tabpanel\" [attr.aria-labelledby]=\"headingId\">\n <div class=\"collapse-body\">\n <ng-content></ng-content>\n </div>\n</div>\n" }]
|
|
1558
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { directive: [{
|
|
1559
|
+
type: ViewChild,
|
|
1560
|
+
args: [ItCollapseDirective, { static: true }]
|
|
1561
|
+
}], header: [{
|
|
1562
|
+
type: Input
|
|
1563
|
+
}], showEvent: [{
|
|
1564
|
+
type: Output,
|
|
1565
|
+
args: ['show']
|
|
1566
|
+
}], shownEvent: [{
|
|
1567
|
+
type: Output,
|
|
1568
|
+
args: ['shown']
|
|
1569
|
+
}], hideEvent: [{
|
|
1570
|
+
type: Output,
|
|
1571
|
+
args: ['hide']
|
|
1572
|
+
}], hiddenEvent: [{
|
|
1573
|
+
type: Output,
|
|
1574
|
+
args: ['hidden']
|
|
1575
|
+
}] } });
|
|
1576
|
+
|
|
1577
|
+
let identifier$5 = 0;
|
|
1578
|
+
class ItCollapseGroupComponent {
|
|
1579
|
+
constructor() {
|
|
1580
|
+
this.id = `collapse-group-${identifier$5++}`;
|
|
1581
|
+
this._accordion = false;
|
|
1582
|
+
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Indica se gli item del gruppo sono mutuamente richiudibili (o accordion)
|
|
1585
|
+
*/
|
|
1586
|
+
get accordion() { return this._accordion; }
|
|
1587
|
+
set accordion(value) { this._accordion = Util.coerceBooleanProperty(value); }
|
|
1588
|
+
onClick(target) {
|
|
1589
|
+
if (this.accordion) {
|
|
1590
|
+
const items = this._items.toArray();
|
|
1591
|
+
items.forEach(currentItem => {
|
|
1592
|
+
const isTargetPartOfItem = currentItem.elementRef.nativeElement.contains(target);
|
|
1593
|
+
if (!isTargetPartOfItem) {
|
|
1594
|
+
if (!currentItem.directive.isCollapsed) {
|
|
1595
|
+
currentItem.directive.toggle();
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
ngOnChanges(simpleChanges) {
|
|
1602
|
+
if (simpleChanges['accordion']) {
|
|
1603
|
+
const isAccordion = simpleChanges['accordion'].currentValue;
|
|
1604
|
+
if (isAccordion) {
|
|
1605
|
+
const items = this._items.toArray();
|
|
1606
|
+
items.forEach(currentItem => {
|
|
1607
|
+
if (!currentItem.directive.isCollapsed) {
|
|
1608
|
+
currentItem.directive.toggle();
|
|
1609
|
+
}
|
|
1610
|
+
});
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
ItCollapseGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1616
|
+
ItCollapseGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: ItCollapseGroupComponent, selector: "it-collapse-group", inputs: { accordion: "accordion" }, host: { listeners: { "click": "onClick($event.target)" } }, queries: [{ propertyName: "_items", predicate: i0.forwardRef(function () { return ItCollapseItemComponent; }), descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [id]=\"id\" class=\"collapse-div\" role=\"tablist\">\n <ng-content></ng-content>\n</div>", styles: [""] });
|
|
1617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseGroupComponent, decorators: [{
|
|
1618
|
+
type: Component,
|
|
1619
|
+
args: [{ selector: 'it-collapse-group', template: "<div [id]=\"id\" class=\"collapse-div\" role=\"tablist\">\n <ng-content></ng-content>\n</div>" }]
|
|
1620
|
+
}], propDecorators: { accordion: [{
|
|
1621
|
+
type: Input
|
|
1622
|
+
}], _items: [{
|
|
1623
|
+
type: ContentChildren,
|
|
1624
|
+
args: [forwardRef(() => ItCollapseItemComponent), { descendants: true }]
|
|
1625
|
+
}], onClick: [{
|
|
1626
|
+
type: HostListener,
|
|
1627
|
+
args: ['click', ['$event.target']]
|
|
1628
|
+
}] } });
|
|
1629
|
+
|
|
1630
|
+
class ItUtilsModule {
|
|
1631
|
+
}
|
|
1632
|
+
ItUtilsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItUtilsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1633
|
+
ItUtilsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: ItUtilsModule, declarations: [FocusMouseDirective], exports: [FocusMouseDirective] });
|
|
1634
|
+
ItUtilsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItUtilsModule });
|
|
1635
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItUtilsModule, decorators: [{
|
|
1636
|
+
type: NgModule,
|
|
1637
|
+
args: [{
|
|
1638
|
+
declarations: [FocusMouseDirective],
|
|
1639
|
+
exports: [FocusMouseDirective]
|
|
1640
|
+
}]
|
|
1641
|
+
}] });
|
|
1642
|
+
|
|
1643
|
+
class ItCollapseModule {
|
|
1644
|
+
}
|
|
1645
|
+
ItCollapseModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1646
|
+
ItCollapseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseModule, declarations: [ItCollapseDirective, ItCollapseItemComponent, ItCollapseGroupComponent], imports: [CommonModule, NgbCollapseModule, ItUtilsModule], exports: [ItCollapseDirective, ItCollapseItemComponent, ItCollapseGroupComponent] });
|
|
1647
|
+
ItCollapseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseModule, imports: [CommonModule, NgbCollapseModule, ItUtilsModule] });
|
|
1648
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItCollapseModule, decorators: [{
|
|
1649
|
+
type: NgModule,
|
|
1650
|
+
args: [{
|
|
1651
|
+
imports: [CommonModule, NgbCollapseModule, ItUtilsModule],
|
|
1652
|
+
declarations: [ItCollapseDirective, ItCollapseItemComponent, ItCollapseGroupComponent],
|
|
1653
|
+
exports: [ItCollapseDirective, ItCollapseItemComponent, ItCollapseGroupComponent],
|
|
1654
|
+
}]
|
|
1655
|
+
}] });
|
|
1656
|
+
|
|
1657
|
+
const InputType = t.keyof({
|
|
1658
|
+
text: null,
|
|
1659
|
+
email: null,
|
|
1660
|
+
password: null,
|
|
1661
|
+
number: null,
|
|
1662
|
+
time: null,
|
|
1663
|
+
search: null,
|
|
1664
|
+
date: null,
|
|
1665
|
+
radio: null,
|
|
1666
|
+
checkbox: null,
|
|
1667
|
+
textarea: null,
|
|
1668
|
+
button: null,
|
|
1669
|
+
reset: null,
|
|
1670
|
+
submit: null,
|
|
1671
|
+
'datetime-local': null,
|
|
1672
|
+
hidden: null,
|
|
1673
|
+
image: null,
|
|
1674
|
+
month: null,
|
|
1675
|
+
range: null,
|
|
1676
|
+
tel: null,
|
|
1677
|
+
url: null,
|
|
1678
|
+
week: null,
|
|
1679
|
+
datetime: null,
|
|
1680
|
+
color: null,
|
|
1681
|
+
file: null
|
|
1682
|
+
});
|
|
1683
|
+
const TEXT = 'text';
|
|
1684
|
+
const EMAIL = 'email';
|
|
1685
|
+
const PASSWORD = 'password';
|
|
1686
|
+
const NUMBER = 'number';
|
|
1687
|
+
const TIME = 'time';
|
|
1688
|
+
const SEARCH = 'search';
|
|
1689
|
+
const DATE = 'date';
|
|
1690
|
+
const INPUT_TYPES = {
|
|
1691
|
+
TEXT: TEXT,
|
|
1692
|
+
EMAIL: EMAIL,
|
|
1693
|
+
PASSWORD: PASSWORD,
|
|
1694
|
+
NUMBER: NUMBER,
|
|
1695
|
+
SEARCH: SEARCH,
|
|
1696
|
+
TIME: TIME,
|
|
1697
|
+
DATE: DATE
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
/**
|
|
1701
|
+
* Classe di utility creata sulla base del seguente sorgente di bootstrap-italia: https://github.com/italia/bootstrap-italia/blob/main/src/js/plugins/input-password.js
|
|
1702
|
+
* TODO: Da sostituire una volta che i metodi scoreText, scoreColor, e calculateScore
|
|
1703
|
+
* saranno importabili dalla libreria bootstrap-italia.
|
|
1704
|
+
*/
|
|
1705
|
+
class FormInputPasswordUtils {
|
|
1706
|
+
constructor(_config) {
|
|
1707
|
+
this._config = _config;
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Returns a value between -1 and 100 to score
|
|
1711
|
+
* the user's password.
|
|
1712
|
+
*
|
|
1713
|
+
* @param string password The password to be checked.
|
|
1714
|
+
* @return int
|
|
1715
|
+
*/
|
|
1716
|
+
calculateScore(password) {
|
|
1717
|
+
var score = 0;
|
|
1718
|
+
// empty password
|
|
1719
|
+
if (password.trim().length === 0) {
|
|
1720
|
+
return -2;
|
|
1721
|
+
}
|
|
1722
|
+
// password < this._config.minimumLength
|
|
1723
|
+
if (password.length < this._config.minimumLength) {
|
|
1724
|
+
return -1;
|
|
1725
|
+
}
|
|
1726
|
+
// password length
|
|
1727
|
+
score += password.length * 4;
|
|
1728
|
+
score += this._checkRepetition(1, password).length - password.length;
|
|
1729
|
+
score += this._checkRepetition(2, password).length - password.length;
|
|
1730
|
+
score += this._checkRepetition(3, password).length - password.length;
|
|
1731
|
+
score += this._checkRepetition(4, password).length - password.length;
|
|
1732
|
+
// password has 3 numbers
|
|
1733
|
+
if (password.match(/(.*[0-9].*[0-9].*[0-9])/)) {
|
|
1734
|
+
score += 5;
|
|
1735
|
+
}
|
|
1736
|
+
// password has at least 2 sybols
|
|
1737
|
+
let symbols = '.*[!,@,#,$,%,^,&,*,?,_,~]';
|
|
1738
|
+
symbols = new RegExp('(' + symbols + symbols + ')');
|
|
1739
|
+
if (password.match(symbols)) {
|
|
1740
|
+
score += 5;
|
|
1741
|
+
}
|
|
1742
|
+
// password has Upper and Lower chars
|
|
1743
|
+
if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) {
|
|
1744
|
+
score += 10;
|
|
1745
|
+
}
|
|
1746
|
+
// password has number and chars
|
|
1747
|
+
if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) {
|
|
1748
|
+
score += 15;
|
|
1749
|
+
}
|
|
1750
|
+
// password has number and symbol
|
|
1751
|
+
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/)) {
|
|
1752
|
+
score += 15;
|
|
1753
|
+
}
|
|
1754
|
+
// password has char and symbol
|
|
1755
|
+
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/)) {
|
|
1756
|
+
score += 15;
|
|
1757
|
+
}
|
|
1758
|
+
// password is just numbers or chars
|
|
1759
|
+
if (password.match(/^\w+$/) || password.match(/^\d+$/)) {
|
|
1760
|
+
score -= 10;
|
|
1761
|
+
}
|
|
1762
|
+
if (score > 100) {
|
|
1763
|
+
score = 100;
|
|
1764
|
+
}
|
|
1765
|
+
if (score < 0) {
|
|
1766
|
+
score = 0;
|
|
1767
|
+
}
|
|
1768
|
+
return score;
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* Checks for repetition of characters in
|
|
1772
|
+
* a string
|
|
1773
|
+
*
|
|
1774
|
+
* @param int rLen Repetition length.
|
|
1775
|
+
* @param string str The string to be checked.
|
|
1776
|
+
* @return string
|
|
1777
|
+
*/
|
|
1778
|
+
_checkRepetition(rLen, str) {
|
|
1779
|
+
var res = '', repeated = false;
|
|
1780
|
+
for (var i = 0; i < str.length; i++) {
|
|
1781
|
+
repeated = true;
|
|
1782
|
+
for (var j = 0; j < rLen && j + i + rLen < str.length; j++) {
|
|
1783
|
+
repeated = repeated && str.charAt(j + i) === str.charAt(j + i + rLen);
|
|
1784
|
+
}
|
|
1785
|
+
if (j < rLen) {
|
|
1786
|
+
repeated = false;
|
|
1787
|
+
}
|
|
1788
|
+
if (repeated) {
|
|
1789
|
+
i += rLen - 1;
|
|
1790
|
+
repeated = false;
|
|
1791
|
+
}
|
|
1792
|
+
else {
|
|
1793
|
+
res += str.charAt(i);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
return res;
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* Returns strings based on the score given.
|
|
1800
|
+
*
|
|
1801
|
+
* @param int score Score base.
|
|
1802
|
+
* @return string
|
|
1803
|
+
*/
|
|
1804
|
+
scoreText(score) {
|
|
1805
|
+
if (score === -1) {
|
|
1806
|
+
return this._config.shortPass;
|
|
1807
|
+
}
|
|
1808
|
+
else if (score === -2) {
|
|
1809
|
+
return this._config.enterPass;
|
|
1810
|
+
}
|
|
1811
|
+
score = score < 0 ? 0 : score;
|
|
1812
|
+
if (score < 26) {
|
|
1813
|
+
return this._config.shortPass;
|
|
1814
|
+
}
|
|
1815
|
+
if (score < 51) {
|
|
1816
|
+
return this._config.badPass;
|
|
1817
|
+
}
|
|
1818
|
+
if (score < 76) {
|
|
1819
|
+
return this._config.goodPass;
|
|
1820
|
+
}
|
|
1821
|
+
return this._config.strongPass;
|
|
1822
|
+
}
|
|
1823
|
+
scoreColor(score) {
|
|
1824
|
+
if (score === -1) {
|
|
1825
|
+
return 'danger';
|
|
1826
|
+
}
|
|
1827
|
+
if (score === -2) {
|
|
1828
|
+
return 'muted';
|
|
1829
|
+
}
|
|
1830
|
+
score = score < 0 ? 0 : score;
|
|
1831
|
+
if (score < 26) {
|
|
1832
|
+
return 'danger';
|
|
1833
|
+
}
|
|
1834
|
+
if (score < 51) {
|
|
1835
|
+
return 'warning';
|
|
1836
|
+
}
|
|
1837
|
+
if (score < 76) {
|
|
1838
|
+
return 'success';
|
|
1839
|
+
}
|
|
1840
|
+
return 'success';
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
FormInputPasswordUtils.DEFAULT_CONFIG = {
|
|
1844
|
+
shortPass: 'Password molto debole',
|
|
1845
|
+
badPass: 'Password debole',
|
|
1846
|
+
goodPass: 'Password sicura',
|
|
1847
|
+
strongPass: 'Password molto sicura',
|
|
1848
|
+
enterPass: 'Inserisci almeno 8 caratteri e una lettera maiuscola',
|
|
1849
|
+
alertCaps: 'CAPS LOCK inserito',
|
|
1850
|
+
showText: true,
|
|
1851
|
+
minimumLength: 4,
|
|
1852
|
+
};
|
|
1853
|
+
|
|
1854
|
+
class ItPrefixDirective {
|
|
1855
|
+
}
|
|
1856
|
+
ItPrefixDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1857
|
+
ItPrefixDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItPrefixDirective, selector: "[itPrefix]", ngImport: i0 });
|
|
1858
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItPrefixDirective, decorators: [{
|
|
1859
|
+
type: Directive,
|
|
1860
|
+
args: [{
|
|
1861
|
+
selector: '[itPrefix]'
|
|
1862
|
+
}]
|
|
1863
|
+
}] });
|
|
1864
|
+
|
|
1865
|
+
class ItSuffixDirective {
|
|
1866
|
+
}
|
|
1867
|
+
ItSuffixDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1868
|
+
ItSuffixDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItSuffixDirective, selector: "[itSuffix]", ngImport: i0 });
|
|
1869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItSuffixDirective, decorators: [{
|
|
1870
|
+
type: Directive,
|
|
1871
|
+
args: [{
|
|
1872
|
+
selector: '[itSuffix]'
|
|
1873
|
+
}]
|
|
1874
|
+
}] });
|
|
1875
|
+
|
|
1876
|
+
class ItTextPrefixDirective {
|
|
1877
|
+
}
|
|
1878
|
+
ItTextPrefixDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTextPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1879
|
+
ItTextPrefixDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItTextPrefixDirective, selector: "[itTextPrefix]", ngImport: i0 });
|
|
1880
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTextPrefixDirective, decorators: [{
|
|
1881
|
+
type: Directive,
|
|
1882
|
+
args: [{
|
|
1883
|
+
selector: '[itTextPrefix]'
|
|
1884
|
+
}]
|
|
1885
|
+
}] });
|
|
1886
|
+
|
|
1887
|
+
class ItTextSuffixDirective {
|
|
1888
|
+
}
|
|
1889
|
+
ItTextSuffixDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTextSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1890
|
+
ItTextSuffixDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.11", type: ItTextSuffixDirective, selector: "[itTextSuffix]", ngImport: i0 });
|
|
1891
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTextSuffixDirective, decorators: [{
|
|
1892
|
+
type: Directive,
|
|
1893
|
+
args: [{
|
|
1894
|
+
selector: '[itTextSuffix]'
|
|
1895
|
+
}]
|
|
1896
|
+
}] });
|
|
1897
|
+
|
|
1898
|
+
class MarkMatchingTextPipe {
|
|
1899
|
+
constructor(domSanitizer) {
|
|
1900
|
+
this.domSanitizer = domSanitizer;
|
|
1901
|
+
}
|
|
1902
|
+
transform(allString, searchString) {
|
|
1903
|
+
if (!searchString) {
|
|
1904
|
+
return allString;
|
|
1905
|
+
}
|
|
1906
|
+
else if (!allString) {
|
|
1907
|
+
return "";
|
|
1908
|
+
}
|
|
1909
|
+
// Check if search string is a substring of pivot string (no case-sensitive)
|
|
1910
|
+
const idxOfMatchString = allString.toLowerCase().indexOf(searchString.toLowerCase());
|
|
1911
|
+
if (idxOfMatchString !== -1) {
|
|
1912
|
+
// retrieve the exactly substring
|
|
1913
|
+
const matchingString = allString.substring(idxOfMatchString, idxOfMatchString + searchString.length);
|
|
1914
|
+
// Replace original string marking as <strong> (bold) the matchinng substring
|
|
1915
|
+
const regEx = new RegExp('(' + matchingString + ')', 'gi');
|
|
1916
|
+
const res = allString.replace(regEx, '<mark>$1</mark>');
|
|
1917
|
+
return this.domSanitizer.bypassSecurityTrustHtml(res);
|
|
1918
|
+
}
|
|
1919
|
+
return allString;
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
MarkMatchingTextPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MarkMatchingTextPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1923
|
+
MarkMatchingTextPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: MarkMatchingTextPipe, name: "markMatchingText" });
|
|
1924
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MarkMatchingTextPipe, decorators: [{
|
|
1925
|
+
type: Pipe,
|
|
1926
|
+
args: [{
|
|
1927
|
+
name: 'markMatchingText'
|
|
1928
|
+
}]
|
|
1929
|
+
}], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; } });
|
|
1930
|
+
|
|
1931
|
+
let identifier$4 = 0;
|
|
1932
|
+
class FormInputChange {
|
|
1933
|
+
constructor(source, value) {
|
|
1934
|
+
this.source = source;
|
|
1935
|
+
this.value = value;
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* Elementi e stili per la creazione di input accessibili e responsivi.
|
|
1940
|
+
*/
|
|
1941
|
+
class FormInputComponent {
|
|
1942
|
+
constructor(_changeDetector) {
|
|
1943
|
+
this._changeDetector = _changeDetector;
|
|
1944
|
+
this.INPUT_TYPES = INPUT_TYPES;
|
|
1945
|
+
this._readonlyPlainText = false;
|
|
1946
|
+
this._enablePasswordStrengthMeter = false;
|
|
1947
|
+
/**
|
|
1948
|
+
* Punteggio di sicurezza calcolato in base alla password immessa se enablePasswordStrengthMeter ha valore true
|
|
1949
|
+
*/
|
|
1950
|
+
this.passwordScore = 0;
|
|
1951
|
+
/**
|
|
1952
|
+
* Dimensione dell'input di autocomplete. Di default ha dimensione standard.
|
|
1953
|
+
*/
|
|
1954
|
+
this.autocompleteWrapperSize = 'default';
|
|
1955
|
+
this._passwordStrengthMeterConfig = FormInputPasswordUtils.DEFAULT_CONFIG;
|
|
1956
|
+
this._id = `form-input-${identifier$4++}`;
|
|
1957
|
+
this._type = INPUT_TYPES.TEXT;
|
|
1958
|
+
this._labelVisuallyHidden = false;
|
|
1959
|
+
this._step = 1;
|
|
1960
|
+
this._disabled = false;
|
|
1961
|
+
this._currency = false;
|
|
1962
|
+
this._percentage = false;
|
|
1963
|
+
this._adaptive = false;
|
|
1964
|
+
this._readonly = false;
|
|
1965
|
+
/**
|
|
1966
|
+
* Evento emesso quando il valore dell'input cambia.
|
|
1967
|
+
* Gli eventi di change sono emessi soltanto quando il valore cambia a causa dell'interazione dell'utente
|
|
1968
|
+
* con il campo d'input.
|
|
1969
|
+
*/
|
|
1970
|
+
this.change = new EventEmitter();
|
|
1971
|
+
this._disableCapsLockAlert = false;
|
|
1972
|
+
/**
|
|
1973
|
+
* Indica se è attivo il CAPS LOCK
|
|
1974
|
+
*/
|
|
1975
|
+
this.isCapsLockActive = false;
|
|
1976
|
+
/**
|
|
1977
|
+
* La label da mostrare in caso sia attivo il CAPS LOCK
|
|
1978
|
+
*/
|
|
1979
|
+
this.capsLockActiveLabel = 'CAPS LOCK inserito';
|
|
1980
|
+
this._isPasswordMode = false;
|
|
1981
|
+
this._isPasswordVisible = false;
|
|
1982
|
+
this.showAutocompletion = false;
|
|
1983
|
+
this._isInitialized = false;
|
|
1984
|
+
this._controlValueAccessorChangeFn = () => { };
|
|
1985
|
+
this._onTouched = () => { };
|
|
1986
|
+
/** Indica se è stato effettuato il focus sul campo di input */
|
|
1987
|
+
this.focus = false;
|
|
1988
|
+
}
|
|
1989
|
+
/**
|
|
1990
|
+
* Opzionale. Indica se mostrare gli input readonly nella forma stilizzata come testo normale
|
|
1991
|
+
*/
|
|
1992
|
+
get readonlyPlainText() { return this._readonlyPlainText; }
|
|
1993
|
+
set readonlyPlainText(value) { this._readonlyPlainText = Util.coerceBooleanProperty(value); }
|
|
1994
|
+
/**
|
|
1995
|
+
* Opzionale. Indica se abilitare il controllo sulla sicurezza della password
|
|
1996
|
+
*/
|
|
1997
|
+
get enablePasswordStrengthMeter() { return this._enablePasswordStrengthMeter; }
|
|
1998
|
+
set enablePasswordStrengthMeter(value) { this._enablePasswordStrengthMeter = Util.coerceBooleanProperty(value); }
|
|
1999
|
+
set passwordStrengthMeterConfig(newConfig) {
|
|
2000
|
+
this._passwordStrengthMeterConfig = Object.assign(Object.assign({}, this._passwordStrengthMeterConfig), newConfig);
|
|
2001
|
+
}
|
|
2002
|
+
get passwordStrengthMeterConfig() {
|
|
2003
|
+
return this._passwordStrengthMeterConfig;
|
|
2004
|
+
}
|
|
2005
|
+
/**
|
|
2006
|
+
* Indica l'id dell'elemento HTML
|
|
2007
|
+
*/
|
|
2008
|
+
get id() {
|
|
2009
|
+
return this._id;
|
|
2010
|
+
}
|
|
2011
|
+
set id(value) {
|
|
2012
|
+
this._id = value;
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* Indica l'attributo name del componente HTML
|
|
2016
|
+
*/
|
|
2017
|
+
get name() {
|
|
2018
|
+
return this._name;
|
|
2019
|
+
}
|
|
2020
|
+
set name(value) {
|
|
2021
|
+
this._name = value;
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2024
|
+
* Indica il tipo di campo. Puo' assumere i valori text, email, password e number
|
|
2025
|
+
*/
|
|
2026
|
+
get type() {
|
|
2027
|
+
return this._type;
|
|
2028
|
+
}
|
|
2029
|
+
set type(value) {
|
|
2030
|
+
if (InputType.is(value)) {
|
|
2031
|
+
if (value === INPUT_TYPES.NUMBER) {
|
|
2032
|
+
if (isNaN(Number(this.value))) {
|
|
2033
|
+
this.value = '';
|
|
2034
|
+
this.onChange();
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
this._type = value;
|
|
2038
|
+
}
|
|
2039
|
+
else {
|
|
2040
|
+
this._type = INPUT_TYPES.TEXT;
|
|
2041
|
+
}
|
|
2042
|
+
this._isPasswordMode = this._type === INPUT_TYPES.PASSWORD;
|
|
2043
|
+
this._isPasswordVisible = false;
|
|
2044
|
+
this.showAutocompletion = false;
|
|
2045
|
+
}
|
|
2046
|
+
/**
|
|
2047
|
+
* Indica il valore della label da visualizzare
|
|
2048
|
+
*/
|
|
2049
|
+
get label() { return this._label; }
|
|
2050
|
+
set label(value) { this._label = value; }
|
|
2051
|
+
/**
|
|
2052
|
+
* Indica se la label dell'input deve essere visualizzata dall'utente o solamente visibile per lo screen reader
|
|
2053
|
+
*/
|
|
2054
|
+
get labelVisuallyHidden() { return this._labelVisuallyHidden; }
|
|
2055
|
+
set labelVisuallyHidden(value) { this._labelVisuallyHidden = value; }
|
|
2056
|
+
/**
|
|
2057
|
+
* Indica il valore che avrà l'attributo HTML "min" per l'input di tipo number
|
|
2058
|
+
*/
|
|
2059
|
+
get min() { return this._min; }
|
|
2060
|
+
set min(value) { this._min = Util.coerceNumberProperty(value); }
|
|
2061
|
+
/**
|
|
2062
|
+
* Indica il valore che avrà l'attributo HTML "max" per l'input di tipo number
|
|
2063
|
+
*/
|
|
2064
|
+
get max() { return this._max; }
|
|
2065
|
+
set max(value) { this._max = Util.coerceNumberProperty(value); }
|
|
2066
|
+
/**
|
|
2067
|
+
* Indica il valore che avrà l'attributo HTML "step" per l'input di tipo number
|
|
2068
|
+
*/
|
|
2069
|
+
get step() { return this._step; }
|
|
2070
|
+
set step(value) { this._step = Util.coerceNumberProperty(value); }
|
|
2071
|
+
/**
|
|
2072
|
+
* Indica il testo di aiuto sotto la input
|
|
2073
|
+
*/
|
|
2074
|
+
get note() { return this._note; }
|
|
2075
|
+
set note(value) { this._note = value; }
|
|
2076
|
+
/**
|
|
2077
|
+
* Indica il testo presente nel campo vuoto. Nel caso sia già presente la label, il placeholder non verrà mostrato
|
|
2078
|
+
*/
|
|
2079
|
+
get placeholder() {
|
|
2080
|
+
return this._placeholder || '';
|
|
2081
|
+
}
|
|
2082
|
+
set placeholder(value) { this._placeholder = value; }
|
|
2083
|
+
/**
|
|
2084
|
+
* Indica l'icona da visualizzare a sinistra del campo di input
|
|
2085
|
+
*/
|
|
2086
|
+
get icon() { return this._icon; }
|
|
2087
|
+
set icon(value) { this._icon = value; }
|
|
2088
|
+
/**
|
|
2089
|
+
* Opzionale.
|
|
2090
|
+
* Indica se il campo in questione è disabilitato.
|
|
2091
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2092
|
+
*/
|
|
2093
|
+
get disabled() { return this._disabled; }
|
|
2094
|
+
set disabled(value) { this._disabled = Util.coerceBooleanProperty(value); }
|
|
2095
|
+
/**
|
|
2096
|
+
* Opzionale.
|
|
2097
|
+
* Nel caso di input numerico, indica se il campo è una valuta.
|
|
2098
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2099
|
+
*/
|
|
2100
|
+
get currency() { return this._currency; }
|
|
2101
|
+
set currency(value) { this._currency = Util.coerceBooleanProperty(value); }
|
|
2102
|
+
/**
|
|
2103
|
+
* Opzionale.
|
|
2104
|
+
* Nel caso di input numerico, indica se il campo è una percentuale.
|
|
2105
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2106
|
+
*/
|
|
2107
|
+
get percentage() { return this._percentage; }
|
|
2108
|
+
set percentage(value) { this._percentage = Util.coerceBooleanProperty(value); }
|
|
2109
|
+
/**
|
|
2110
|
+
* Opzionale.
|
|
2111
|
+
* Nel caso di input numerico, indica se il campo si deve ridimensionare automaticamente a seconda del valore contenuto in esso.
|
|
2112
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2113
|
+
*/
|
|
2114
|
+
get adaptive() { return this._adaptive; }
|
|
2115
|
+
set adaptive(value) { this._adaptive = Util.coerceBooleanProperty(value); }
|
|
2116
|
+
/**
|
|
2117
|
+
* Opzionale.
|
|
2118
|
+
* Indica se il campo in questione è di sola lettura.
|
|
2119
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2120
|
+
*/
|
|
2121
|
+
get readonly() { return this._readonly; }
|
|
2122
|
+
set readonly(value) { this._readonly = Util.coerceBooleanProperty(value); }
|
|
2123
|
+
get value() { var _a, _b; return (_b = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.value; }
|
|
2124
|
+
set value(value) {
|
|
2125
|
+
if (this._inputElement) {
|
|
2126
|
+
this._inputElement.nativeElement.value = value;
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Opzionale.
|
|
2131
|
+
* Disponibile solo se il type è search.
|
|
2132
|
+
* Indica la lista di elementi ricercabili su cui basare il sistema di autocompletamento della input
|
|
2133
|
+
*/
|
|
2134
|
+
get autoCompleteData() { return this._autoCompleteData; }
|
|
2135
|
+
set autoCompleteData(value) { this._autoCompleteData = value; }
|
|
2136
|
+
/**
|
|
2137
|
+
* Opzionale.
|
|
2138
|
+
* Indica se disabilitare l'avviso di CAPS LOCK attivo
|
|
2139
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2140
|
+
*/
|
|
2141
|
+
get disableCapsLockAlert() { return this._disableCapsLockAlert; }
|
|
2142
|
+
set disableCapsLockAlert(value) { this._disableCapsLockAlert = Util.coerceBooleanProperty(value); }
|
|
2143
|
+
get isLabelActive() {
|
|
2144
|
+
return this._isLabelActive;
|
|
2145
|
+
}
|
|
2146
|
+
set isLabelActive(value) {
|
|
2147
|
+
const newValue = Util.coerceBooleanProperty(value);
|
|
2148
|
+
// In alcuni casi la label deve essere sempre posizionata sopra l'input per evitare sovrapposizioni
|
|
2149
|
+
// di testo, come in caso di presenza del placeholder o per l'input di tipo "date" o "time"
|
|
2150
|
+
if (newValue || (!this.value && !this.placeholder && this.type !== INPUT_TYPES.TIME &&
|
|
2151
|
+
this.type !== INPUT_TYPES.DATE && this.type !== INPUT_TYPES.NUMBER)) {
|
|
2152
|
+
this._isLabelActive = newValue;
|
|
2153
|
+
}
|
|
2154
|
+
else {
|
|
2155
|
+
this._isLabelActive = true;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
get isPasswordMode() {
|
|
2159
|
+
return this._isPasswordMode;
|
|
2160
|
+
}
|
|
2161
|
+
set isPasswordMode(value) {
|
|
2162
|
+
this._isPasswordMode = Util.coerceBooleanProperty(value);
|
|
2163
|
+
}
|
|
2164
|
+
get isPasswordVisible() {
|
|
2165
|
+
return this._isPasswordVisible;
|
|
2166
|
+
}
|
|
2167
|
+
set isPasswordVisible(value) {
|
|
2168
|
+
this._isPasswordVisible = Util.coerceBooleanProperty(value);
|
|
2169
|
+
this._type = this._isPasswordVisible ? INPUT_TYPES.TEXT : INPUT_TYPES.PASSWORD;
|
|
2170
|
+
}
|
|
2171
|
+
_emitChangeEvent() {
|
|
2172
|
+
if (this._isInitialized) {
|
|
2173
|
+
this.change.emit(new FormInputChange(this, this.value));
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
ngOnInit() {
|
|
2177
|
+
this.isLabelActive = false;
|
|
2178
|
+
this._formInputPasswordUtils = new FormInputPasswordUtils(this.passwordStrengthMeterConfig);
|
|
2179
|
+
}
|
|
2180
|
+
writeValue(value) {
|
|
2181
|
+
this.value = value;
|
|
2182
|
+
if (this.value) {
|
|
2183
|
+
this.isLabelActive = true;
|
|
2184
|
+
}
|
|
2185
|
+
this.onChange();
|
|
2186
|
+
if (this._isInitialized) {
|
|
2187
|
+
this._changeDetector.detectChanges();
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
registerOnChange(fn) {
|
|
2191
|
+
this._controlValueAccessorChangeFn = fn;
|
|
2192
|
+
}
|
|
2193
|
+
registerOnTouched(fn) {
|
|
2194
|
+
this._onTouched = fn;
|
|
2195
|
+
}
|
|
2196
|
+
ngAfterContentInit() {
|
|
2197
|
+
this._isInitialized = true;
|
|
2198
|
+
// Run change detection if the suffix or prefix changes.
|
|
2199
|
+
merge(this._prefixChildren.changes, this._suffixChildren.changes, this._textPrefixChildren.changes, this._textSuffixChildren.changes).subscribe(() => {
|
|
2200
|
+
this._changeDetector.markForCheck();
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
onChange() {
|
|
2204
|
+
this._emitChangeEvent();
|
|
2205
|
+
this._controlValueAccessorChangeFn(this.value);
|
|
2206
|
+
}
|
|
2207
|
+
onInput() {
|
|
2208
|
+
if (this.isPasswordMode && this._enablePasswordStrengthMeter) {
|
|
2209
|
+
this.recalculatePasswordStrength();
|
|
2210
|
+
}
|
|
2211
|
+
this.showAutocompletion = this._type === INPUT_TYPES.SEARCH && this.isAutocompletable() && this.value;
|
|
2212
|
+
this._emitChangeEvent();
|
|
2213
|
+
this._controlValueAccessorChangeFn(this.value);
|
|
2214
|
+
}
|
|
2215
|
+
onFocus() {
|
|
2216
|
+
this.focus = true;
|
|
2217
|
+
this.isLabelActive = true;
|
|
2218
|
+
}
|
|
2219
|
+
onBlur() {
|
|
2220
|
+
this.focus = false;
|
|
2221
|
+
const inputValue = this.value;
|
|
2222
|
+
if (!inputValue || inputValue.length === 0) {
|
|
2223
|
+
this.isLabelActive = false;
|
|
2224
|
+
if (this.type === INPUT_TYPES.NUMBER) {
|
|
2225
|
+
this.value = '';
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
get noteId() {
|
|
2230
|
+
return `${this.id}-note`;
|
|
2231
|
+
}
|
|
2232
|
+
getRelatedEntries() {
|
|
2233
|
+
if (this.value) {
|
|
2234
|
+
const lowercaseValue = this.value.toLowerCase();
|
|
2235
|
+
const lowercaseData = this._autoCompleteData.filter((item) => item.value).map(item => {
|
|
2236
|
+
return Object.assign(Object.assign({}, item), { original: item.value, lowercase: item.value.toLowerCase() });
|
|
2237
|
+
});
|
|
2238
|
+
const relatedEntries = [];
|
|
2239
|
+
lowercaseData.forEach(lowercaseEntry => {
|
|
2240
|
+
const matching = (lowercaseEntry.lowercase).includes(lowercaseValue);
|
|
2241
|
+
if (matching) {
|
|
2242
|
+
relatedEntries.push(lowercaseEntry);
|
|
2243
|
+
}
|
|
2244
|
+
});
|
|
2245
|
+
return relatedEntries;
|
|
2246
|
+
}
|
|
2247
|
+
else {
|
|
2248
|
+
return [];
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
isAutocompletable() {
|
|
2252
|
+
if (this._autoCompleteData && this._type === INPUT_TYPES.SEARCH) {
|
|
2253
|
+
return this._autoCompleteData.length > 0;
|
|
2254
|
+
}
|
|
2255
|
+
else {
|
|
2256
|
+
return false;
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
onEntryClick(entry, event) {
|
|
2260
|
+
// Se non è stato definito un link associato all'elemento dell'autocomplete, probabilmente il desiderata
|
|
2261
|
+
// non è effettuare la navigazione al default '#', pertanto in tal caso meglio annullare la navigazione.
|
|
2262
|
+
if (!entry.link) {
|
|
2263
|
+
event.preventDefault();
|
|
2264
|
+
}
|
|
2265
|
+
this.value = entry.value;
|
|
2266
|
+
this.showAutocompletion = false;
|
|
2267
|
+
this.onChange();
|
|
2268
|
+
}
|
|
2269
|
+
/**
|
|
2270
|
+
* indica se il campo di input è composto da altri elementi accessori come
|
|
2271
|
+
* icone o bottoni da posizionare adiacenti al campo di input
|
|
2272
|
+
*/
|
|
2273
|
+
get isInputGroup() {
|
|
2274
|
+
return this._textPrefixChildren.length > 0 || this._prefixChildren.length > 0 || !!this.icon
|
|
2275
|
+
|| this._suffixChildren.length > 0 || this._textSuffixChildren.length > 0;
|
|
2276
|
+
}
|
|
2277
|
+
/**
|
|
2278
|
+
* Ricalcola il punteggio di sicurezza in base al valore corrente
|
|
2279
|
+
*/
|
|
2280
|
+
recalculatePasswordStrength() {
|
|
2281
|
+
this.passwordScore = this._formInputPasswordUtils.calculateScore(this.value);
|
|
2282
|
+
}
|
|
2283
|
+
get passwordScoreText() {
|
|
2284
|
+
return this._formInputPasswordUtils.scoreText(this.passwordScore);
|
|
2285
|
+
}
|
|
2286
|
+
get passwordScoreColor() {
|
|
2287
|
+
return this._formInputPasswordUtils.scoreColor(this.passwordScore);
|
|
2288
|
+
}
|
|
2289
|
+
get valueLength() {
|
|
2290
|
+
if (!this.value) {
|
|
2291
|
+
return 0;
|
|
2292
|
+
}
|
|
2293
|
+
return this.value.toString().length;
|
|
2294
|
+
}
|
|
2295
|
+
onKeyUp(event) {
|
|
2296
|
+
this.isCapsLockActive = event.getModifierState && event.getModifierState('CapsLock');
|
|
2297
|
+
}
|
|
2298
|
+
autocompleteItemTrackByValueFn(index, item) {
|
|
2299
|
+
return item.value;
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* Incrementa il valore dell'input numerico di tanto quanto vale lo step
|
|
2303
|
+
*/
|
|
2304
|
+
incrementNumberValue() {
|
|
2305
|
+
if (this.type === INPUT_TYPES.NUMBER) {
|
|
2306
|
+
const tempValue = +this.value + this.step;
|
|
2307
|
+
if (this.max === undefined || tempValue <= this.max) {
|
|
2308
|
+
this.value = tempValue;
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
/**
|
|
2313
|
+
* Decrementa il valore dell'input numerico di tanto quanto vale lo step
|
|
2314
|
+
*/
|
|
2315
|
+
decrementNumberValue() {
|
|
2316
|
+
if (this.type === INPUT_TYPES.NUMBER) {
|
|
2317
|
+
const tempValue = +this.value - this.step;
|
|
2318
|
+
if (this.min === undefined || tempValue >= this.min) {
|
|
2319
|
+
this.value = tempValue;
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
FormInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FormInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2325
|
+
FormInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: FormInputComponent, selector: "it-input", inputs: { readonlyPlainText: "readonlyPlainText", enablePasswordStrengthMeter: "enablePasswordStrengthMeter", autocompleteWrapperSize: "autocompleteWrapperSize", passwordStrengthMeterConfig: "passwordStrengthMeterConfig", id: "id", name: "name", type: "type", label: "label", labelVisuallyHidden: "labelVisuallyHidden", min: "min", max: "max", step: "step", note: "note", placeholder: "placeholder", icon: "icon", disabled: "disabled", currency: "currency", percentage: "percentage", adaptive: "adaptive", readonly: "readonly", autoCompleteData: "autoCompleteData", disableCapsLockAlert: "disableCapsLockAlert", capsLockActiveLabel: "capsLockActiveLabel" }, outputs: { change: "change" }, host: { listeners: { "window:click": "onKeyUp($event)", "window:keydown": "onKeyUp($event)", "window:keyup": "onKeyUp($event)" } }, providers: [{
|
|
2326
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2327
|
+
useExisting: forwardRef(() => FormInputComponent),
|
|
2328
|
+
multi: true
|
|
2329
|
+
}], queries: [{ propertyName: "_prefixChildren", predicate: ItPrefixDirective, descendants: true }, { propertyName: "_textPrefixChildren", predicate: ItTextPrefixDirective, descendants: true }, { propertyName: "_suffixChildren", predicate: ItSuffixDirective, descendants: true }, { propertyName: "_textSuffixChildren", predicate: ItTextSuffixDirective, descendants: true }], viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["inputElement"], descendants: true }], ngImport: i0, template: "<div class=\"form-group\" [class.autocomplete-wrapper-big]=\"autocompleteWrapperSize === 'big'\">\n <div class=\"input-group\" *ngIf = \"isInputGroup; else formInputWithLabel\">\n <ng-container *ngIf=\"_textPrefixChildren.length || _prefixChildren.length || icon\">\n <div class=\"input-group-prepend\">\n\n <!-- Gli elementi figli di \"it-input\" con la direttiva \"itTextPrefix\" -->\n <ng-container *ngIf=\"_textPrefixChildren.length || icon\">\n\n <div class=\"input-group-text\" >\n <ng-container *ngIf=\"icon\">\n <it-icon [icon] = \"icon\" size=\"icon-sm\"></it-icon>\n </ng-container>\n\n <ng-container *ngIf=\"_textPrefixChildren.length\">\n <ng-content select = \"[itTextPrefix]\"></ng-content>\n </ng-container>\n </div>\n </ng-container>\n \n <ng-container *ngIf=\"_prefixChildren.length\">\n <!-- Gli elementi figli di \"it-input\" con la direttiva \"itPrefix\" -->\n <ng-content select = \"[itPrefix]\"></ng-content>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container [ngTemplateOutlet]=\"formInputWithLabel\"></ng-container>\n\n <ng-container *ngIf=\"_suffixChildren.length || _textSuffixChildren.length\">\n <div class=\"input-group-append\">\n <!-- Gli elementi figli di \"it-input\" con la direttiva \"itTextSuffix\" -->\n <ng-container *ngIf=\"_textSuffixChildren.length\">\n <div class=\"input-group-text\" >\n <ng-content select = \"[itTextSuffix]\"></ng-content>\n </div>\n </ng-container>\n \n <ng-container *ngIf=\"_suffixChildren.length\">\n <!-- Gli elementi figli di \"it-input\" con la direttiva \"itSuffix\" -->\n <ng-content select = \"[itSuffix]\"></ng-content>\n </ng-container>\n </div>\n </ng-container>\n \n \n </div>\n\n\n\n <ng-template #formInput>\n <input #inputElement\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (change)=\"onChange()\"\n (input)=\"onInput()\"\n [type]=\"type\"\n [id]=\"id\"\n [min]=\"min\"\n [max]=\"max\"\n [step]=\"step\"\n [class.focus--mouse]=\"focus\"\n [class.input-password]=\"isPasswordMode\"\n [attr.name]=\"name\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [placeholder]=\"placeholder\"\n [style.width]=\"adaptive && valueLength ? 'calc(44px + ' + valueLength + 'ch)' : null\"\n [ngClass]=\"{\n 'form-control' : (!readonly || !readonlyPlainText) && type !== INPUT_TYPES.NUMBER,\n 'form-control-plaintext' : readonly && readonlyPlainText,\n 'autocomplete' : isAutocompletable()\n }\"\n [attr.aria-describedby]=\"note ? noteId : undefined\"/> \n </ng-template>\n\n\n\n <ng-template #formInputWithLabel>\n <label [attr.for]=\"id\" *ngIf=\"label\" \n [class.visually-hidden]=\"labelVisuallyHidden\"\n [class.input-number-label]=\"type === INPUT_TYPES.NUMBER\"\n [class.active] = \"isLabelActive && !labelVisuallyHidden\" >\n {{label}}\n </label>\n \n <!-- INIZIO gestione input di tipo NUMBER -->\n\n <ng-container *ngIf=\"type === INPUT_TYPES.NUMBER; else formInput\">\n <span class=\"input-number\" \n [class.input-number-adaptive]=\"adaptive\"\n [class.input-number-currency]=\"currency\" \n [class.input-number-percentage]=\"percentage\">\n\n <ng-container [ngTemplateOutlet]=\"formInput\"></ng-container>\n\n <button class=\"input-number-add\" (click)=\"incrementNumberValue()\" focusMouse>\n <span class=\"visually-hidden\">Aumenta valore di {{step}} Euro</span>\n </button>\n <button class=\"input-number-sub\" (click)=\"decrementNumberValue()\" focusMouse>\n <span class=\"visually-hidden\">Diminuisci valore di {{step}} Euro</span>\n </button>\n </span>\n </ng-container>\n\n <!-- FINE gestione input di tipo NUMBER -->\n\n </ng-template>\n\n <small [id]=\"noteId\" class=\"form-text\" *ngIf=\"note\">\n {{note}}\n </small>\n\n\n <!-- INIZIO gestione input di tipo PASSWORD -->\n\n <ng-container *ngIf=\"isPasswordMode\">\n <!-- Icona dell'occhio per la vedere/nascondere la password -->\n <span \n class = \"password-icon\"\n aria-hidden=\"true\"\n (click)=\"isPasswordVisible = !isPasswordVisible\">\n <it-icon [icon]=\"'it-password-' + (isPasswordVisible ? 'invisible' : 'visible')\" size=\"icon-sm\" color=\"default\"></it-icon>\n </span>\n\n <!-- Indicatore di sicurezza della password -->\n <div class=\"password-strength-meter\" *ngIf=\"isPasswordMode && enablePasswordStrengthMeter\">\n <small class=\"form-text\" \n [ngClass] = \"['text-' + passwordScoreColor]\"\n *ngIf = \"passwordStrengthMeterConfig.showText\">{{ passwordScoreText }}\n </small>\n <div class=\"password-meter progress rounded-0 position-absolute\">\n <div class=\"row position-absolute w-100 m-0\">\n <div class=\"col-3 border-start border-end border-white\"></div>\n <div class=\"col-3 border-start border-end border-white\"></div>\n <div class=\"col-3 border-start border-end border-white\"></div>\n <div class=\"col-3 border-start border-end border-white\"></div>\n </div>\n\n <div class=\"progress-bar\" \n [class]=\"['bg-' + passwordScoreColor]\"\n role=\"progressbar\" [attr.aria-valuenow]=\"passwordScore >= 0 ? passwordScore : 0\" aria-valuemin=\"0\" aria-valuemax=\"100\" [style.width.%]=\"passwordScore >= 0 ? passwordScore : 0\">\n </div>\n </div>\n </div>\n\n </ng-container>\n\n <!-- FINE gestione input di tipo PASSWORD -->\n\n\n\n\n <!-- Avviso CAPS LOCK Attivo -->\n <small *ngIf=\"isCapsLockActive && !disableCapsLockAlert && type !== INPUT_TYPES.NUMBER\" class=\"password-caps form-text text-warning position-absolute bg-white w-100\">{{capsLockActiveLabel}}</small>\n\n\n\n <!-- INIZIO gestione AUTOCOMPLETAMENTO -->\n\n\n <!-- Icona lente per autocompletamento -->\n <span class=\"autocomplete-icon\" aria-hidden=\"true\" *ngIf=\"isAutocompletable()\">\n <it-icon icon = \"it-search\" size=\"icon-sm\" color=\"default\"></it-icon>\n </span>\n\n\n <!-- Lista di autocompletamento -->\n <ul class=\"autocomplete-list\" *ngIf=\"isAutocompletable()\" [class.autocomplete-list-show]=\"showAutocompletion\">\n <li *ngFor=\"let entry of getRelatedEntries(); trackBy: autocompleteItemTrackByValueFn\" (click)=\"onEntryClick(entry, $event)\">\n <a [href]=\"entry.link\" >\n <ng-container *ngTemplateOutlet=\"autocompleteItemTemplate\"></ng-container>\n </a>\n <ng-template #autocompleteItemTemplate>\n <div class=\"avatar size-sm\" *ngIf=\"entry.avatarSrcPath\">\n <img [src]=\"entry.avatarSrcPath\" [alt]=\"entry.avatarAltText\">\n </div>\n <it-icon *ngIf=\"entry.icon\" [icon]=\"entry.icon\" size=\"icon-sm\"></it-icon>\n <span class=\"autocomplete-list-text\">\n <span [innerHTML] = \"entry.original | markMatchingText: value\"></span>\n <em *ngIf=\"entry.label\">{{entry.label}}</em>\n </span>\n </ng-template>\n </li>\n </ul>\n\n</div>\n\n <!-- FINE gestione AUTOCOMPLETAMENTO -->", styles: ["label{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: FocusMouseDirective, selector: "[focusMouse]", exportAs: ["focusMouse"] }, { kind: "component", type: IconComponent, selector: "it-icon", inputs: ["rounded", "roundedColor", "icon", "wai", "size", "color", "bgColor", "padded", "expand", "position", "verticalAlign"] }, { kind: "pipe", type: MarkMatchingTextPipe, name: "markMatchingText" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FormInputComponent, decorators: [{
|
|
2331
|
+
type: Component,
|
|
2332
|
+
args: [{ selector: 'it-input', changeDetection: ChangeDetectionStrategy.OnPush, providers: [{
|
|
2333
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2334
|
+
useExisting: forwardRef(() => FormInputComponent),
|
|
2335
|
+
multi: true
|
|
2336
|
+
}], template: "<div class=\"form-group\" [class.autocomplete-wrapper-big]=\"autocompleteWrapperSize === 'big'\">\n <div class=\"input-group\" *ngIf = \"isInputGroup; else formInputWithLabel\">\n <ng-container *ngIf=\"_textPrefixChildren.length || _prefixChildren.length || icon\">\n <div class=\"input-group-prepend\">\n\n <!-- Gli elementi figli di \"it-input\" con la direttiva \"itTextPrefix\" -->\n <ng-container *ngIf=\"_textPrefixChildren.length || icon\">\n\n <div class=\"input-group-text\" >\n <ng-container *ngIf=\"icon\">\n <it-icon [icon] = \"icon\" size=\"icon-sm\"></it-icon>\n </ng-container>\n\n <ng-container *ngIf=\"_textPrefixChildren.length\">\n <ng-content select = \"[itTextPrefix]\"></ng-content>\n </ng-container>\n </div>\n </ng-container>\n \n <ng-container *ngIf=\"_prefixChildren.length\">\n <!-- Gli elementi figli di \"it-input\" con la direttiva \"itPrefix\" -->\n <ng-content select = \"[itPrefix]\"></ng-content>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container [ngTemplateOutlet]=\"formInputWithLabel\"></ng-container>\n\n <ng-container *ngIf=\"_suffixChildren.length || _textSuffixChildren.length\">\n <div class=\"input-group-append\">\n <!-- Gli elementi figli di \"it-input\" con la direttiva \"itTextSuffix\" -->\n <ng-container *ngIf=\"_textSuffixChildren.length\">\n <div class=\"input-group-text\" >\n <ng-content select = \"[itTextSuffix]\"></ng-content>\n </div>\n </ng-container>\n \n <ng-container *ngIf=\"_suffixChildren.length\">\n <!-- Gli elementi figli di \"it-input\" con la direttiva \"itSuffix\" -->\n <ng-content select = \"[itSuffix]\"></ng-content>\n </ng-container>\n </div>\n </ng-container>\n \n \n </div>\n\n\n\n <ng-template #formInput>\n <input #inputElement\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (change)=\"onChange()\"\n (input)=\"onInput()\"\n [type]=\"type\"\n [id]=\"id\"\n [min]=\"min\"\n [max]=\"max\"\n [step]=\"step\"\n [class.focus--mouse]=\"focus\"\n [class.input-password]=\"isPasswordMode\"\n [attr.name]=\"name\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [placeholder]=\"placeholder\"\n [style.width]=\"adaptive && valueLength ? 'calc(44px + ' + valueLength + 'ch)' : null\"\n [ngClass]=\"{\n 'form-control' : (!readonly || !readonlyPlainText) && type !== INPUT_TYPES.NUMBER,\n 'form-control-plaintext' : readonly && readonlyPlainText,\n 'autocomplete' : isAutocompletable()\n }\"\n [attr.aria-describedby]=\"note ? noteId : undefined\"/> \n </ng-template>\n\n\n\n <ng-template #formInputWithLabel>\n <label [attr.for]=\"id\" *ngIf=\"label\" \n [class.visually-hidden]=\"labelVisuallyHidden\"\n [class.input-number-label]=\"type === INPUT_TYPES.NUMBER\"\n [class.active] = \"isLabelActive && !labelVisuallyHidden\" >\n {{label}}\n </label>\n \n <!-- INIZIO gestione input di tipo NUMBER -->\n\n <ng-container *ngIf=\"type === INPUT_TYPES.NUMBER; else formInput\">\n <span class=\"input-number\" \n [class.input-number-adaptive]=\"adaptive\"\n [class.input-number-currency]=\"currency\" \n [class.input-number-percentage]=\"percentage\">\n\n <ng-container [ngTemplateOutlet]=\"formInput\"></ng-container>\n\n <button class=\"input-number-add\" (click)=\"incrementNumberValue()\" focusMouse>\n <span class=\"visually-hidden\">Aumenta valore di {{step}} Euro</span>\n </button>\n <button class=\"input-number-sub\" (click)=\"decrementNumberValue()\" focusMouse>\n <span class=\"visually-hidden\">Diminuisci valore di {{step}} Euro</span>\n </button>\n </span>\n </ng-container>\n\n <!-- FINE gestione input di tipo NUMBER -->\n\n </ng-template>\n\n <small [id]=\"noteId\" class=\"form-text\" *ngIf=\"note\">\n {{note}}\n </small>\n\n\n <!-- INIZIO gestione input di tipo PASSWORD -->\n\n <ng-container *ngIf=\"isPasswordMode\">\n <!-- Icona dell'occhio per la vedere/nascondere la password -->\n <span \n class = \"password-icon\"\n aria-hidden=\"true\"\n (click)=\"isPasswordVisible = !isPasswordVisible\">\n <it-icon [icon]=\"'it-password-' + (isPasswordVisible ? 'invisible' : 'visible')\" size=\"icon-sm\" color=\"default\"></it-icon>\n </span>\n\n <!-- Indicatore di sicurezza della password -->\n <div class=\"password-strength-meter\" *ngIf=\"isPasswordMode && enablePasswordStrengthMeter\">\n <small class=\"form-text\" \n [ngClass] = \"['text-' + passwordScoreColor]\"\n *ngIf = \"passwordStrengthMeterConfig.showText\">{{ passwordScoreText }}\n </small>\n <div class=\"password-meter progress rounded-0 position-absolute\">\n <div class=\"row position-absolute w-100 m-0\">\n <div class=\"col-3 border-start border-end border-white\"></div>\n <div class=\"col-3 border-start border-end border-white\"></div>\n <div class=\"col-3 border-start border-end border-white\"></div>\n <div class=\"col-3 border-start border-end border-white\"></div>\n </div>\n\n <div class=\"progress-bar\" \n [class]=\"['bg-' + passwordScoreColor]\"\n role=\"progressbar\" [attr.aria-valuenow]=\"passwordScore >= 0 ? passwordScore : 0\" aria-valuemin=\"0\" aria-valuemax=\"100\" [style.width.%]=\"passwordScore >= 0 ? passwordScore : 0\">\n </div>\n </div>\n </div>\n\n </ng-container>\n\n <!-- FINE gestione input di tipo PASSWORD -->\n\n\n\n\n <!-- Avviso CAPS LOCK Attivo -->\n <small *ngIf=\"isCapsLockActive && !disableCapsLockAlert && type !== INPUT_TYPES.NUMBER\" class=\"password-caps form-text text-warning position-absolute bg-white w-100\">{{capsLockActiveLabel}}</small>\n\n\n\n <!-- INIZIO gestione AUTOCOMPLETAMENTO -->\n\n\n <!-- Icona lente per autocompletamento -->\n <span class=\"autocomplete-icon\" aria-hidden=\"true\" *ngIf=\"isAutocompletable()\">\n <it-icon icon = \"it-search\" size=\"icon-sm\" color=\"default\"></it-icon>\n </span>\n\n\n <!-- Lista di autocompletamento -->\n <ul class=\"autocomplete-list\" *ngIf=\"isAutocompletable()\" [class.autocomplete-list-show]=\"showAutocompletion\">\n <li *ngFor=\"let entry of getRelatedEntries(); trackBy: autocompleteItemTrackByValueFn\" (click)=\"onEntryClick(entry, $event)\">\n <a [href]=\"entry.link\" >\n <ng-container *ngTemplateOutlet=\"autocompleteItemTemplate\"></ng-container>\n </a>\n <ng-template #autocompleteItemTemplate>\n <div class=\"avatar size-sm\" *ngIf=\"entry.avatarSrcPath\">\n <img [src]=\"entry.avatarSrcPath\" [alt]=\"entry.avatarAltText\">\n </div>\n <it-icon *ngIf=\"entry.icon\" [icon]=\"entry.icon\" size=\"icon-sm\"></it-icon>\n <span class=\"autocomplete-list-text\">\n <span [innerHTML] = \"entry.original | markMatchingText: value\"></span>\n <em *ngIf=\"entry.label\">{{entry.label}}</em>\n </span>\n </ng-template>\n </li>\n </ul>\n\n</div>\n\n <!-- FINE gestione AUTOCOMPLETAMENTO -->", styles: ["label{pointer-events:none}\n"] }]
|
|
2337
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _prefixChildren: [{
|
|
2338
|
+
type: ContentChildren,
|
|
2339
|
+
args: [ItPrefixDirective, { descendants: true }]
|
|
2340
|
+
}], _textPrefixChildren: [{
|
|
2341
|
+
type: ContentChildren,
|
|
2342
|
+
args: [ItTextPrefixDirective, { descendants: true }]
|
|
2343
|
+
}], _suffixChildren: [{
|
|
2344
|
+
type: ContentChildren,
|
|
2345
|
+
args: [ItSuffixDirective, { descendants: true }]
|
|
2346
|
+
}], _textSuffixChildren: [{
|
|
2347
|
+
type: ContentChildren,
|
|
2348
|
+
args: [ItTextSuffixDirective, { descendants: true }]
|
|
2349
|
+
}], _inputElement: [{
|
|
2350
|
+
type: ViewChild,
|
|
2351
|
+
args: ['inputElement', { static: false }]
|
|
2352
|
+
}], readonlyPlainText: [{
|
|
2353
|
+
type: Input
|
|
2354
|
+
}], enablePasswordStrengthMeter: [{
|
|
2355
|
+
type: Input
|
|
2356
|
+
}], autocompleteWrapperSize: [{
|
|
2357
|
+
type: Input
|
|
2358
|
+
}], passwordStrengthMeterConfig: [{
|
|
2359
|
+
type: Input
|
|
2360
|
+
}], id: [{
|
|
2361
|
+
type: Input
|
|
2362
|
+
}], name: [{
|
|
2363
|
+
type: Input
|
|
2364
|
+
}], type: [{
|
|
2365
|
+
type: Input
|
|
2366
|
+
}], label: [{
|
|
2367
|
+
type: Input
|
|
2368
|
+
}], labelVisuallyHidden: [{
|
|
2369
|
+
type: Input
|
|
2370
|
+
}], min: [{
|
|
2371
|
+
type: Input
|
|
2372
|
+
}], max: [{
|
|
2373
|
+
type: Input
|
|
2374
|
+
}], step: [{
|
|
2375
|
+
type: Input
|
|
2376
|
+
}], note: [{
|
|
2377
|
+
type: Input
|
|
2378
|
+
}], placeholder: [{
|
|
2379
|
+
type: Input
|
|
2380
|
+
}], icon: [{
|
|
2381
|
+
type: Input
|
|
2382
|
+
}], disabled: [{
|
|
2383
|
+
type: Input
|
|
2384
|
+
}], currency: [{
|
|
2385
|
+
type: Input
|
|
2386
|
+
}], percentage: [{
|
|
2387
|
+
type: Input
|
|
2388
|
+
}], adaptive: [{
|
|
2389
|
+
type: Input
|
|
2390
|
+
}], readonly: [{
|
|
2391
|
+
type: Input
|
|
2392
|
+
}], autoCompleteData: [{
|
|
2393
|
+
type: Input
|
|
2394
|
+
}], change: [{
|
|
2395
|
+
type: Output
|
|
2396
|
+
}], disableCapsLockAlert: [{
|
|
2397
|
+
type: Input
|
|
2398
|
+
}], capsLockActiveLabel: [{
|
|
2399
|
+
type: Input
|
|
2400
|
+
}], onKeyUp: [{
|
|
2401
|
+
type: HostListener,
|
|
2402
|
+
args: ['window:click', ['$event']]
|
|
2403
|
+
}, {
|
|
2404
|
+
type: HostListener,
|
|
2405
|
+
args: ['window:keydown', ['$event']]
|
|
2406
|
+
}, {
|
|
2407
|
+
type: HostListener,
|
|
2408
|
+
args: ['window:keyup', ['$event']]
|
|
2409
|
+
}] } });
|
|
2410
|
+
|
|
2411
|
+
let identifier$3 = 0;
|
|
2412
|
+
/**
|
|
2413
|
+
* Componente usata per visualizzare una voce di menù all'interno di una dropdown
|
|
2414
|
+
*/
|
|
2415
|
+
class DropdownItemComponent {
|
|
2416
|
+
constructor() {
|
|
2417
|
+
this.id = `dropdown-item-${identifier$3++}`;
|
|
2418
|
+
this._link = '';
|
|
2419
|
+
this._active = false;
|
|
2420
|
+
this._disabled = false;
|
|
2421
|
+
this._large = false;
|
|
2422
|
+
this._icon = undefined;
|
|
2423
|
+
this._iconPosition = HorizontalAlign.right;
|
|
2424
|
+
this._iconColor = IconColorEnum.primary;
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
* Il link alla pagina verso cui andare al click sull'elemento del dropdown
|
|
2428
|
+
*/
|
|
2429
|
+
get link() { return !this.disabled ? this._link : ''; }
|
|
2430
|
+
set link(value) { this._link = value; }
|
|
2431
|
+
/**
|
|
2432
|
+
* Se presente indica che l'elemento viene renderizzato come elemento attivo.
|
|
2433
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2434
|
+
*/
|
|
2435
|
+
get active() { return this._active; }
|
|
2436
|
+
set active(value) { this._active = Util.coerceBooleanProperty(value); }
|
|
2437
|
+
/**
|
|
2438
|
+
* Se presente indica che l'elemento è disabilitato.
|
|
2439
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2440
|
+
*/
|
|
2441
|
+
get disabled() { return this._disabled; }
|
|
2442
|
+
set disabled(value) {
|
|
2443
|
+
this._disabled = Util.coerceBooleanProperty(value);
|
|
2444
|
+
}
|
|
2445
|
+
/**
|
|
2446
|
+
* Se presente indica che il testo dell'elemento viene renderizzato più grande.
|
|
2447
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2448
|
+
*/
|
|
2449
|
+
get large() { return this._large; }
|
|
2450
|
+
set large(value) { this._large = Util.coerceBooleanProperty(value); }
|
|
2451
|
+
/**
|
|
2452
|
+
* La classe dell'icona da usare prima o dopo del testo dell'elemento del dropdown
|
|
2453
|
+
*/
|
|
2454
|
+
get icon() { return this._icon; }
|
|
2455
|
+
set icon(value) { this._icon = value; }
|
|
2456
|
+
/**
|
|
2457
|
+
* La posizione dell'icona rispetto al testo dell'elemento del dropdown.
|
|
2458
|
+
* Può assumere valori right o left.
|
|
2459
|
+
*/
|
|
2460
|
+
get iconPosition() { return this._iconPosition; }
|
|
2461
|
+
set iconPosition(value) {
|
|
2462
|
+
if (HORIZONTAL_ALIGN.is(value)) {
|
|
2463
|
+
this._iconPosition = value;
|
|
2464
|
+
}
|
|
2465
|
+
else {
|
|
2466
|
+
this._iconPosition = HorizontalAlign.right;
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
get iconColor() { return this._iconColor; }
|
|
2470
|
+
set iconColor(value) { this._iconColor = value; }
|
|
2471
|
+
get dropdownItemClass() {
|
|
2472
|
+
return `list-item ${this.iconPosition}-icon`;
|
|
2473
|
+
}
|
|
2474
|
+
get iconClass() {
|
|
2475
|
+
return `${this.icon} ${this.iconPosition}`;
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
DropdownItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DropdownItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2479
|
+
DropdownItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: DropdownItemComponent, selector: "it-dropdown-item", inputs: { link: "link", active: "active", disabled: "disabled", large: "large", icon: "icon", iconPosition: "iconPosition", iconColor: "iconColor" }, ngImport: i0, template: "<li [id]=\"id\">\n <a itDropdownItem focusMouse\n [attr.href]=\"link\"\n [attr.tabindex]=\"this.disabled ? -1 : 0\"\n [class]=\"dropdownItemClass\"\n [ngClass]=\"{\n 'large' : large, \n 'active' : active,\n 'disabled' : disabled,\n 'disabled-item-link' : disabled,\n 'left-icon': iconPosition === 'left',\n 'right-icon': iconPosition === 'right'\n }\">\n <span>\n <ng-content></ng-content>\n </span>\n <it-icon *ngIf = \"icon\" [icon]=\"icon\" [position]=\"iconPosition\" [color] = \"iconColor\"></it-icon>\n </a>\n</li>", styles: [".disabled-item-link{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "it-icon", inputs: ["rounded", "roundedColor", "icon", "wai", "size", "color", "bgColor", "padded", "expand", "position", "verticalAlign"] }, { kind: "directive", type: FocusMouseDirective, selector: "[focusMouse]", exportAs: ["focusMouse"] }, { kind: "directive", type: ItDropdownItem, selector: "[itDropdownItem]" }] });
|
|
2480
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DropdownItemComponent, decorators: [{
|
|
2481
|
+
type: Component,
|
|
2482
|
+
args: [{ selector: 'it-dropdown-item', template: "<li [id]=\"id\">\n <a itDropdownItem focusMouse\n [attr.href]=\"link\"\n [attr.tabindex]=\"this.disabled ? -1 : 0\"\n [class]=\"dropdownItemClass\"\n [ngClass]=\"{\n 'large' : large, \n 'active' : active,\n 'disabled' : disabled,\n 'disabled-item-link' : disabled,\n 'left-icon': iconPosition === 'left',\n 'right-icon': iconPosition === 'right'\n }\">\n <span>\n <ng-content></ng-content>\n </span>\n <it-icon *ngIf = \"icon\" [icon]=\"icon\" [position]=\"iconPosition\" [color] = \"iconColor\"></it-icon>\n </a>\n</li>", styles: [".disabled-item-link{pointer-events:none}\n"] }]
|
|
2483
|
+
}], propDecorators: { link: [{
|
|
2484
|
+
type: Input
|
|
2485
|
+
}], active: [{
|
|
2486
|
+
type: Input
|
|
2487
|
+
}], disabled: [{
|
|
2488
|
+
type: Input
|
|
2489
|
+
}], large: [{
|
|
2490
|
+
type: Input
|
|
2491
|
+
}], icon: [{
|
|
2492
|
+
type: Input
|
|
2493
|
+
}], iconPosition: [{
|
|
2494
|
+
type: Input
|
|
2495
|
+
}], iconColor: [{
|
|
2496
|
+
type: Input
|
|
2497
|
+
}] } });
|
|
2498
|
+
|
|
2499
|
+
let identifier$2 = 0;
|
|
2500
|
+
const DEFAULT_COLOR = 'dropdown';
|
|
2501
|
+
/**
|
|
2502
|
+
* Componente usata per attivare o disattivare overlay contestuali per visualizzare elenchi di link e altro ancora con questi menù a tendina
|
|
2503
|
+
*/
|
|
2504
|
+
class DropdownComponent {
|
|
2505
|
+
constructor() {
|
|
2506
|
+
this.id = `dropdown-${identifier$2++}`;
|
|
2507
|
+
this.menuHeading = "";
|
|
2508
|
+
this.expandIcon = "it-expand";
|
|
2509
|
+
this.expandIconPosition = 'end';
|
|
2510
|
+
this._dark = false;
|
|
2511
|
+
this._fullWidth = false;
|
|
2512
|
+
this._color = DEFAULT_COLOR;
|
|
2513
|
+
this._label = '';
|
|
2514
|
+
this._onOpen = new EventEmitter();
|
|
2515
|
+
this._onClose = new EventEmitter();
|
|
2516
|
+
this.isOpen = false;
|
|
2517
|
+
this.autoUpdateMenuItemsIconColor = true;
|
|
2518
|
+
}
|
|
2519
|
+
get menuPlacement() {
|
|
2520
|
+
return this._menuPlacement;
|
|
2521
|
+
}
|
|
2522
|
+
set menuPlacement(value) {
|
|
2523
|
+
if (value === 'left-start') {
|
|
2524
|
+
this.expandIconPosition = 'start';
|
|
2525
|
+
}
|
|
2526
|
+
else if (value === 'right-start') {
|
|
2527
|
+
this.expandIconPosition = 'end';
|
|
2528
|
+
}
|
|
2529
|
+
this._menuPlacement = value;
|
|
2530
|
+
}
|
|
2531
|
+
/**
|
|
2532
|
+
* Se presente indica che il dropdown utilizza il tema di colorazione scura.
|
|
2533
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2534
|
+
*/
|
|
2535
|
+
get dark() { return this._dark; }
|
|
2536
|
+
set dark(value) {
|
|
2537
|
+
this._dark = Util.coerceBooleanProperty(value);
|
|
2538
|
+
if (this.autoUpdateMenuItemsIconColor) {
|
|
2539
|
+
this.updateMenuItemsIconColor();
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
/**
|
|
2543
|
+
* Se presente indica che le voci del dropdown si sviluppano orizzontalmente.
|
|
2544
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2545
|
+
*/
|
|
2546
|
+
get fullWidth() { return this._fullWidth; }
|
|
2547
|
+
set fullWidth(value) { this._fullWidth = Util.coerceBooleanProperty(value); }
|
|
2548
|
+
/**
|
|
2549
|
+
* Il colore del pulsante che attiva il dropdown.
|
|
2550
|
+
* Può assumere i valori primary, secondary, danger, warning, info, warning, success, light e dark
|
|
2551
|
+
*/
|
|
2552
|
+
get color() { return this._color; }
|
|
2553
|
+
set color(value) {
|
|
2554
|
+
if (ThemeColor.is(value)) {
|
|
2555
|
+
this._color = value;
|
|
2556
|
+
}
|
|
2557
|
+
else {
|
|
2558
|
+
this._color = DEFAULT_COLOR;
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
/**
|
|
2562
|
+
* Il testo presente sul pulsante che attiva il dropdown
|
|
2563
|
+
*/
|
|
2564
|
+
get label() { return this._label; }
|
|
2565
|
+
set label(value) { this._label = value; }
|
|
2566
|
+
/**
|
|
2567
|
+
* Evento che viene lanciato ogni volta che il dropdown viene aperto
|
|
2568
|
+
*/
|
|
2569
|
+
get onOpen() { return this._onOpen; }
|
|
2570
|
+
set onOpen(value) { this._onOpen = value; }
|
|
2571
|
+
/**
|
|
2572
|
+
* Evento che viene lanciato ogni volta che il dropdown viene chiuso
|
|
2573
|
+
*/
|
|
2574
|
+
get onClose() { return this._onClose; }
|
|
2575
|
+
set onClose(value) { this._onClose = value; }
|
|
2576
|
+
onOpenChange(isOpen) {
|
|
2577
|
+
this.isOpen = isOpen;
|
|
2578
|
+
if (this.isOpen) {
|
|
2579
|
+
this.onOpen.emit();
|
|
2580
|
+
}
|
|
2581
|
+
else {
|
|
2582
|
+
this.onClose.emit();
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
updateMenuItemsIconColor() {
|
|
2586
|
+
var _a;
|
|
2587
|
+
(_a = this.menuItems) === null || _a === void 0 ? void 0 : _a.forEach(item => {
|
|
2588
|
+
item.iconColor = this._dark ? IconColorEnum.light : IconColorEnum.primary;
|
|
2589
|
+
});
|
|
2590
|
+
}
|
|
2591
|
+
get isDropend() {
|
|
2592
|
+
return this._menuPlacement === 'right-start';
|
|
2593
|
+
}
|
|
2594
|
+
get isDropstart() {
|
|
2595
|
+
return this._menuPlacement === 'left-start';
|
|
2596
|
+
}
|
|
2597
|
+
get isDropup() {
|
|
2598
|
+
return this._menuPlacement === 'top-start';
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
DropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2602
|
+
DropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: DropdownComponent, selector: "it-dropdown", inputs: { menuHeading: "menuHeading", expandIcon: "expandIcon", expandIconPosition: "expandIconPosition", menuPlacement: "menuPlacement", dark: "dark", fullWidth: "fullWidth", color: "color", label: "label", autoUpdateMenuItemsIconColor: "autoUpdateMenuItemsIconColor" }, outputs: { onOpen: "onOpen", onClose: "onClose" }, queries: [{ propertyName: "menuItems", predicate: DropdownItemComponent }], ngImport: i0, template: "<div itDropdown (openChange)=\"onOpenChange($event)\" \n [placement]=\"menuPlacement\"\n [class.dropstart] = \"isDropstart\"\n [class.dropend] = \"isDropend\"\n [class.dropup] = \"isDropup\">\n <button class=\"dropdown-toggle\" [itButton]=\"color\" itDropdownToggle id=\"dropdownMenuButton\" aria-haspopup=\"true\">\n <it-icon *ngIf = \"expandIcon && expandIconPosition === 'start'\" [icon]=\"expandIcon\" [expand]=\"true\"> </it-icon>\n {{label}}\n <it-icon *ngIf = \"expandIcon && expandIconPosition === 'end'\" [icon]=\"expandIcon\" [expand]=\"true\"> </it-icon>\n </button>\n <div itDropdownMenu aria-labelledby=\"dropdownMenuButton\" [class.dark]=\"dark\" [class.full-width]=\"fullWidth\">\n <div class=\"link-list-wrapper\">\n <div class=\"link-list-heading\" *ngIf = \"menuHeading\">{{menuHeading}}</div>\n <ul class=\"link-list\">\n <ng-content></ng-content>\n </ul>\n </div>\n </div>\n</div>\n", styles: [".dropup .dropdown-toggle:after{display:none}.dropup .dropdown-toggle .icon-expand,.dropup .btn-dropdown .icon-expand{transform:scaleY(-1)}.dropup .btn-dropdown[aria-expanded=true] .icon-expand,.dropup .dropdown-toggle[aria-expanded=true] .icon-expand{transform:scaleY(1)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "it-icon", inputs: ["rounded", "roundedColor", "icon", "wai", "size", "color", "bgColor", "padded", "expand", "position", "verticalAlign"] }, { kind: "directive", type: ItButtonDirective, selector: "[itButton]", inputs: ["autoUpdateIconColor", "itButton", "disabled", "outline", "block", "size"], exportAs: ["itButton"] }, { kind: "directive", type: ItDropdown, selector: "[itDropdown]", outputs: ["openChange"], exportAs: ["itDropdown"] }, { kind: "directive", type: ItDropdownMenu, selector: "[itDropdownMenu]" }, { kind: "directive", type: ItDropdownToggle, selector: "[itDropdownToggle]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
2604
|
+
type: Component,
|
|
2605
|
+
args: [{ selector: 'it-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div itDropdown (openChange)=\"onOpenChange($event)\" \n [placement]=\"menuPlacement\"\n [class.dropstart] = \"isDropstart\"\n [class.dropend] = \"isDropend\"\n [class.dropup] = \"isDropup\">\n <button class=\"dropdown-toggle\" [itButton]=\"color\" itDropdownToggle id=\"dropdownMenuButton\" aria-haspopup=\"true\">\n <it-icon *ngIf = \"expandIcon && expandIconPosition === 'start'\" [icon]=\"expandIcon\" [expand]=\"true\"> </it-icon>\n {{label}}\n <it-icon *ngIf = \"expandIcon && expandIconPosition === 'end'\" [icon]=\"expandIcon\" [expand]=\"true\"> </it-icon>\n </button>\n <div itDropdownMenu aria-labelledby=\"dropdownMenuButton\" [class.dark]=\"dark\" [class.full-width]=\"fullWidth\">\n <div class=\"link-list-wrapper\">\n <div class=\"link-list-heading\" *ngIf = \"menuHeading\">{{menuHeading}}</div>\n <ul class=\"link-list\">\n <ng-content></ng-content>\n </ul>\n </div>\n </div>\n</div>\n", styles: [".dropup .dropdown-toggle:after{display:none}.dropup .dropdown-toggle .icon-expand,.dropup .btn-dropdown .icon-expand{transform:scaleY(-1)}.dropup .btn-dropdown[aria-expanded=true] .icon-expand,.dropup .dropdown-toggle[aria-expanded=true] .icon-expand{transform:scaleY(1)}\n"] }]
|
|
2606
|
+
}], propDecorators: { menuItems: [{
|
|
2607
|
+
type: ContentChildren,
|
|
2608
|
+
args: [DropdownItemComponent]
|
|
2609
|
+
}], menuHeading: [{
|
|
2610
|
+
type: Input
|
|
2611
|
+
}], expandIcon: [{
|
|
2612
|
+
type: Input
|
|
2613
|
+
}], expandIconPosition: [{
|
|
2614
|
+
type: Input
|
|
2615
|
+
}], menuPlacement: [{
|
|
2616
|
+
type: Input
|
|
2617
|
+
}], dark: [{
|
|
2618
|
+
type: Input
|
|
2619
|
+
}], fullWidth: [{
|
|
2620
|
+
type: Input
|
|
2621
|
+
}], color: [{
|
|
2622
|
+
type: Input
|
|
2623
|
+
}], label: [{
|
|
2624
|
+
type: Input
|
|
2625
|
+
}], onOpen: [{
|
|
2626
|
+
type: Output
|
|
2627
|
+
}], onClose: [{
|
|
2628
|
+
type: Output
|
|
2629
|
+
}], autoUpdateMenuItemsIconColor: [{
|
|
2630
|
+
type: Input
|
|
2631
|
+
}] } });
|
|
2632
|
+
|
|
2633
|
+
class DropdownDividerComponent {
|
|
2634
|
+
}
|
|
2635
|
+
DropdownDividerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DropdownDividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2636
|
+
DropdownDividerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: DropdownDividerComponent, selector: "it-dropdown-divider", ngImport: i0, template: "<li>\n <span class=\"divider\"></span>\n</li>", styles: [""] });
|
|
2637
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DropdownDividerComponent, decorators: [{
|
|
2638
|
+
type: Component,
|
|
2639
|
+
args: [{ selector: 'it-dropdown-divider', template: "<li>\n <span class=\"divider\"></span>\n</li>" }]
|
|
2640
|
+
}] });
|
|
2641
|
+
|
|
2642
|
+
let identifier$1 = 0;
|
|
2643
|
+
class BreadcrumbItemComponent {
|
|
2644
|
+
constructor(_cdRef, _elemRef) {
|
|
2645
|
+
this._cdRef = _cdRef;
|
|
2646
|
+
this._elemRef = _elemRef;
|
|
2647
|
+
this.id = `it-breadcrumb-item-${identifier$1++}`;
|
|
2648
|
+
this._isLast = false;
|
|
2649
|
+
this.customClass = '';
|
|
2650
|
+
}
|
|
2651
|
+
/**
|
|
2652
|
+
* Il link alla pagina verso cui andare al click di questo elemento del breadcrumb
|
|
2653
|
+
*/
|
|
2654
|
+
get link() { return this._link; }
|
|
2655
|
+
set link(value) { this._link = value; }
|
|
2656
|
+
/**
|
|
2657
|
+
* La classe dell'icona da usare prima del testo dell'elemento del breadcrumb
|
|
2658
|
+
*/
|
|
2659
|
+
get icon() { return this._icon; }
|
|
2660
|
+
set icon(value) { this._icon = value; }
|
|
2661
|
+
get iconColor() { return this._iconColor; }
|
|
2662
|
+
set iconColor(value) {
|
|
2663
|
+
if (this._iconColor !== value) {
|
|
2664
|
+
this._iconColor = value;
|
|
2665
|
+
this._cdRef.detectChanges();
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
get separator() { return this._separator; }
|
|
2669
|
+
set separator(value) { this._separator = value; }
|
|
2670
|
+
get isLast() { return this._isLast; }
|
|
2671
|
+
set isLast(value) {
|
|
2672
|
+
this._isLast = value;
|
|
2673
|
+
const breadcrumbItem = this._elemRef.nativeElement.querySelector('.breadcrumb-item');
|
|
2674
|
+
if (this._isLast) {
|
|
2675
|
+
breadcrumbItem.setAttribute('aria-current', 'page');
|
|
2676
|
+
}
|
|
2677
|
+
else {
|
|
2678
|
+
if (breadcrumbItem.hasAttribute('aria-current')) {
|
|
2679
|
+
breadcrumbItem.removeAttribute('aria-current');
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
this._cdRef.detectChanges();
|
|
2683
|
+
}
|
|
2684
|
+
get breadcrumbClass() {
|
|
2685
|
+
var _a;
|
|
2686
|
+
return 'breadcrumb-item ' + ((_a = this.customClass) !== null && _a !== void 0 ? _a : '') + (this.isLast ? ' active' : '');
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
BreadcrumbItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BreadcrumbItemComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2690
|
+
BreadcrumbItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: BreadcrumbItemComponent, selector: "it-breadcrumb-item", inputs: { link: "link", icon: "icon", iconColor: "iconColor", customClass: "customClass" }, ngImport: i0, template: "<li [class]=\"breadcrumbClass\" [id]=\"id\">\n <it-icon [icon] = \"icon\" [color] = \"iconColor\"></it-icon>\n\n <a [href]=\"link\" focusMouse>\n <ng-content></ng-content>\n </a> \n <span class=\"separator\" *ngIf=\"!isLast\">{{separator}}</span>\n</li>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: FocusMouseDirective, selector: "[focusMouse]", exportAs: ["focusMouse"] }, { kind: "component", type: IconComponent, selector: "it-icon", inputs: ["rounded", "roundedColor", "icon", "wai", "size", "color", "bgColor", "padded", "expand", "position", "verticalAlign"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2691
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BreadcrumbItemComponent, decorators: [{
|
|
2692
|
+
type: Component,
|
|
2693
|
+
args: [{ selector: 'it-breadcrumb-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<li [class]=\"breadcrumbClass\" [id]=\"id\">\n <it-icon [icon] = \"icon\" [color] = \"iconColor\"></it-icon>\n\n <a [href]=\"link\" focusMouse>\n <ng-content></ng-content>\n </a> \n <span class=\"separator\" *ngIf=\"!isLast\">{{separator}}</span>\n</li>\n" }]
|
|
2694
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { link: [{
|
|
2695
|
+
type: Input
|
|
2696
|
+
}], icon: [{
|
|
2697
|
+
type: Input
|
|
2698
|
+
}], iconColor: [{
|
|
2699
|
+
type: Input
|
|
2700
|
+
}], customClass: [{
|
|
2701
|
+
type: Input
|
|
2702
|
+
}] } });
|
|
2703
|
+
|
|
2704
|
+
const DEFAULT_SEPARATOR = '/';
|
|
2705
|
+
let identifier = 0;
|
|
2706
|
+
/**
|
|
2707
|
+
* Una componente che indica la posizione della pagina corrente all’interno di una gerarchia di navigazione
|
|
2708
|
+
*/
|
|
2709
|
+
class BreadcrumbComponent {
|
|
2710
|
+
constructor() {
|
|
2711
|
+
this.id = `it-breadcrumb-${identifier++}`;
|
|
2712
|
+
this._dark = false;
|
|
2713
|
+
this._separator = DEFAULT_SEPARATOR;
|
|
2714
|
+
this.customClass = '';
|
|
2715
|
+
this.ariaLabel = 'breadcrumb';
|
|
2716
|
+
this._subscription = Subscription.EMPTY;
|
|
2717
|
+
}
|
|
2718
|
+
/**
|
|
2719
|
+
* Indica che il breadcrumb utilizza il tema di colorazione scura.
|
|
2720
|
+
* Accetta una espressione booleana o può essere usato come attributo senza valore
|
|
2721
|
+
*/
|
|
2722
|
+
get dark() { return this._dark; }
|
|
2723
|
+
set dark(value) {
|
|
2724
|
+
this._dark = Util.coerceBooleanProperty(value);
|
|
2725
|
+
}
|
|
2726
|
+
/**
|
|
2727
|
+
* Il carattere che verrà usato come separatore tra gli elementi del breadcrumb
|
|
2728
|
+
*/
|
|
2729
|
+
get separator() { return this._separator; }
|
|
2730
|
+
set separator(value) { this._separator = value ? value : DEFAULT_SEPARATOR; }
|
|
2731
|
+
get breadcrumbClass() {
|
|
2732
|
+
var _a;
|
|
2733
|
+
return 'breadcrumb ' + ((_a = this.customClass) !== null && _a !== void 0 ? _a : '') + (this._dark ? ' dark' : '');
|
|
2734
|
+
}
|
|
2735
|
+
ngAfterContentInit() {
|
|
2736
|
+
this._reloadBreadcrumbs(this._items);
|
|
2737
|
+
}
|
|
2738
|
+
ngOnChanges(changes) {
|
|
2739
|
+
if (changes['separator']) {
|
|
2740
|
+
if (!changes['separator'].firstChange) {
|
|
2741
|
+
this._reloadBreadcrumbs(this._items);
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
else if (changes['dark']) {
|
|
2745
|
+
this._reloadBreadcrumbs(this._items);
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
ngOnDestroy() {
|
|
2749
|
+
if (this._subscription) {
|
|
2750
|
+
this._subscription.unsubscribe();
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
_reloadBreadcrumbs(currentItems) {
|
|
2754
|
+
currentItems.forEach(item => {
|
|
2755
|
+
item.separator = this.separator;
|
|
2756
|
+
item.isLast = (item === currentItems.last);
|
|
2757
|
+
item.iconColor = item.iconColor || (this._dark ? 'white' : 'primary');
|
|
2758
|
+
});
|
|
2759
|
+
this._subscribeToChanges();
|
|
2760
|
+
}
|
|
2761
|
+
_subscribeToChanges() {
|
|
2762
|
+
if (this._subscription) {
|
|
2763
|
+
this._subscription.unsubscribe();
|
|
2764
|
+
}
|
|
2765
|
+
this._subscription = this._items.changes.subscribe(items => {
|
|
2766
|
+
this._reloadBreadcrumbs(items);
|
|
2767
|
+
});
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
BreadcrumbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2771
|
+
BreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: BreadcrumbComponent, selector: "it-breadcrumb", inputs: { dark: "dark", separator: "separator", customClass: "customClass", ariaLabel: "ariaLabel" }, queries: [{ propertyName: "_items", predicate: i0.forwardRef(function () { return BreadcrumbItemComponent; }), descendants: true }], usesOnChanges: true, ngImport: i0, template: "<nav class=\"breadcrumb-container\" [attr.aria-label]=\"ariaLabel\" [id]=\"id\">\n <ol [ngClass]=\"breadcrumbClass\">\n <ng-content></ng-content>\n </ol>\n</nav>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2772
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BreadcrumbComponent, decorators: [{
|
|
2773
|
+
type: Component,
|
|
2774
|
+
args: [{ selector: 'it-breadcrumb', changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav class=\"breadcrumb-container\" [attr.aria-label]=\"ariaLabel\" [id]=\"id\">\n <ol [ngClass]=\"breadcrumbClass\">\n <ng-content></ng-content>\n </ol>\n</nav>" }]
|
|
2775
|
+
}], propDecorators: { dark: [{
|
|
2776
|
+
type: Input
|
|
2777
|
+
}], separator: [{
|
|
2778
|
+
type: Input
|
|
2779
|
+
}], _items: [{
|
|
2780
|
+
type: ContentChildren,
|
|
2781
|
+
args: [forwardRef(() => BreadcrumbItemComponent), { descendants: true }]
|
|
2782
|
+
}], customClass: [{
|
|
2783
|
+
type: Input
|
|
2784
|
+
}], ariaLabel: [{
|
|
2785
|
+
type: Input
|
|
2786
|
+
}] } });
|
|
2787
|
+
|
|
2788
|
+
/**
|
|
2789
|
+
* Un componente tab con design bootstrap italia. Indica la singola tab di un insieme di tab.
|
|
2790
|
+
* Utilizzabile con il tag `<it-tab>` all'interno di un tag `<it-tab-group>`.
|
|
2791
|
+
*/
|
|
2792
|
+
class ItTabComponent {
|
|
2793
|
+
constructor() {
|
|
2794
|
+
/** Testo della tab. */
|
|
2795
|
+
this.label = ''; // tslint:disable-line
|
|
2796
|
+
this._disabled = false;
|
|
2797
|
+
/**
|
|
2798
|
+
* La stringa rappresentante l'icona da utilizzare nel titolo della tab. Es. `it-file`
|
|
2799
|
+
*/
|
|
2800
|
+
this.icon = null;
|
|
2801
|
+
/** Emette un evento ogni volta che la label cambia. */
|
|
2802
|
+
this._labelChange = new Subject();
|
|
2803
|
+
/** Emette un evento ogni volta che l'attributo disabled cambia */
|
|
2804
|
+
this._disableChange = new Subject();
|
|
2805
|
+
/**
|
|
2806
|
+
* La posizione relativa della tab dove 0 rappresenta il centro, i negativi sono a sinistra
|
|
2807
|
+
* e i positivi sono a destra.
|
|
2808
|
+
*/
|
|
2809
|
+
this.position = null;
|
|
2810
|
+
/**
|
|
2811
|
+
* Se il tab è attivo.
|
|
2812
|
+
*/
|
|
2813
|
+
this.isActive = false;
|
|
2814
|
+
}
|
|
2815
|
+
/** Se la tab è disabilitata. */
|
|
2816
|
+
get disabled() { return this._disabled; }
|
|
2817
|
+
set disabled(value) {
|
|
2818
|
+
this._disabled = Util.coerceBooleanProperty(value);
|
|
2819
|
+
}
|
|
2820
|
+
ngOnDestroy() {
|
|
2821
|
+
this._disableChange.complete();
|
|
2822
|
+
this._labelChange.complete();
|
|
2823
|
+
}
|
|
2824
|
+
ngOnChanges(changes) {
|
|
2825
|
+
if (changes.hasOwnProperty('label')
|
|
2826
|
+
|| changes.hasOwnProperty('ariaLabel')
|
|
2827
|
+
|| changes.hasOwnProperty('ariaLabelledby')) {
|
|
2828
|
+
this._labelChange.next();
|
|
2829
|
+
}
|
|
2830
|
+
if (changes.hasOwnProperty('disabled')) {
|
|
2831
|
+
this._disableChange.next();
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
ItTabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2836
|
+
ItTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: ItTabComponent, selector: "it-tab", inputs: { label: "label", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], disabled: "disabled", icon: "icon" }, viewQueries: [{ propertyName: "_implicitContent", first: true, predicate: TemplateRef, descendants: true, static: true }], exportAs: ["itTab"], usesOnChanges: true, ngImport: i0, template: "<ng-template><ng-content></ng-content></ng-template>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2837
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTabComponent, decorators: [{
|
|
2838
|
+
type: Component,
|
|
2839
|
+
args: [{ selector: 'it-tab', exportAs: 'itTab', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-template><ng-content></ng-content></ng-template>\n" }]
|
|
2840
|
+
}], propDecorators: { label: [{
|
|
2841
|
+
type: Input
|
|
2842
|
+
}], ariaLabel: [{
|
|
2843
|
+
type: Input,
|
|
2844
|
+
args: ['aria-label']
|
|
2845
|
+
}], ariaLabelledby: [{
|
|
2846
|
+
type: Input,
|
|
2847
|
+
args: ['aria-labelledby']
|
|
2848
|
+
}], disabled: [{
|
|
2849
|
+
type: Input
|
|
2850
|
+
}], icon: [{
|
|
2851
|
+
type: Input
|
|
2852
|
+
}], _implicitContent: [{
|
|
2853
|
+
type: ViewChild,
|
|
2854
|
+
args: [TemplateRef, { static: true }]
|
|
2855
|
+
}] } });
|
|
2856
|
+
|
|
2857
|
+
/** Usato per generare ID univoci per ogni componente tab */
|
|
2858
|
+
let nextId = 0;
|
|
2859
|
+
/** Un change event emesso ai cambi di selezione. */
|
|
2860
|
+
class TabChangeEvent {
|
|
2861
|
+
}
|
|
2862
|
+
/**
|
|
2863
|
+
* Un componente tab-group con design bootstrap italia. Utilizzabile con il tag `<it-tab-group>`.
|
|
2864
|
+
*
|
|
2865
|
+
* Supporta al suo interno tab di base `<it-tab>` con una label e un contenuto.
|
|
2866
|
+
*/
|
|
2867
|
+
class ItTabGroupComponent {
|
|
2868
|
+
constructor(_changeDetectorRef) {
|
|
2869
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
2870
|
+
/** L'indice del tab che dovrebbe essere selezionato dopo che il contenuto e' stato controllato */
|
|
2871
|
+
this._indexToSelect = 0;
|
|
2872
|
+
/** Subscription all'aggiunta e rimozione di tab. */
|
|
2873
|
+
this._tabsSubscription = Subscription.EMPTY;
|
|
2874
|
+
/** Subscription ai cambiamenti alle label dei tab. */
|
|
2875
|
+
this._tabLabelSubscription = Subscription.EMPTY;
|
|
2876
|
+
this._isPill = false;
|
|
2877
|
+
this._selectedIndex = null;
|
|
2878
|
+
this._dark = false;
|
|
2879
|
+
/** abilita il supporto al data-binding bidirezionale `[(selectedIndex)]` */
|
|
2880
|
+
this.selectedIndexChange = new EventEmitter();
|
|
2881
|
+
/** emesso quando la selezione del tab cambia. */
|
|
2882
|
+
this.selectedTabChange = new EventEmitter(true);
|
|
2883
|
+
this._groupId = nextId++;
|
|
2884
|
+
}
|
|
2885
|
+
/** Se le tab sono formattate come pill. */
|
|
2886
|
+
get pill() { return this._isPill; }
|
|
2887
|
+
set pill(value) {
|
|
2888
|
+
this._isPill = Util.coerceBooleanProperty(value);
|
|
2889
|
+
}
|
|
2890
|
+
/** L'indice della tab attiva. */
|
|
2891
|
+
get selectedIndex() { return this._selectedIndex; }
|
|
2892
|
+
set selectedIndex(value) {
|
|
2893
|
+
this._indexToSelect = Util.coerceNumberProperty(value, null);
|
|
2894
|
+
}
|
|
2895
|
+
/**
|
|
2896
|
+
* Se il tab-group ha un tema scuro
|
|
2897
|
+
*/
|
|
2898
|
+
get dark() { return this._dark; }
|
|
2899
|
+
set dark(value) {
|
|
2900
|
+
this._dark = Util.coerceBooleanProperty(value);
|
|
2901
|
+
}
|
|
2902
|
+
/**
|
|
2903
|
+
* Dopo che il contenuto è controllato, il componente conosce i tab che sono stati definiti
|
|
2904
|
+
* e qual è l'indice del tab selezionato.
|
|
2905
|
+
*/
|
|
2906
|
+
ngAfterContentChecked() {
|
|
2907
|
+
this.changeTab(this._indexToSelect);
|
|
2908
|
+
}
|
|
2909
|
+
changeTab(newIndex) {
|
|
2910
|
+
// Non fissare `indexToSelect` immediatamente nel setter perchè può accadere che
|
|
2911
|
+
// il numero di tab cambi prima che avvenga la change detection.
|
|
2912
|
+
const indexToSelect = this._indexToSelect = this._clampTabIndex(newIndex);
|
|
2913
|
+
// Se il nuovo tab è disabilitato, non fare niente
|
|
2914
|
+
if (this._tabs && this._tabs.length > 0 && this._tabs.toArray()[indexToSelect].disabled) {
|
|
2915
|
+
return;
|
|
2916
|
+
}
|
|
2917
|
+
if (this._selectedIndex !== indexToSelect && this._selectedIndex != null) {
|
|
2918
|
+
const tabChangeEvent = this._createChangeEvent(indexToSelect);
|
|
2919
|
+
this.selectedTabChange.emit(tabChangeEvent);
|
|
2920
|
+
// Emetto questo valore dopo che è partita la change detection
|
|
2921
|
+
// dal momento che il contenuto controllato potrebbe contenere questa variabile
|
|
2922
|
+
Promise.resolve().then(() => this.selectedIndexChange.emit(indexToSelect));
|
|
2923
|
+
}
|
|
2924
|
+
// Setta la posizione per ogni tab.
|
|
2925
|
+
this._tabs.forEach((tab, index) => {
|
|
2926
|
+
tab.position = index - indexToSelect;
|
|
2927
|
+
tab.isActive = index === indexToSelect;
|
|
2928
|
+
});
|
|
2929
|
+
if (this._selectedIndex !== indexToSelect) {
|
|
2930
|
+
this._selectedIndex = indexToSelect;
|
|
2931
|
+
this._changeDetectorRef.markForCheck();
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
ngAfterContentInit() {
|
|
2935
|
+
this._subscribeToTabLabels();
|
|
2936
|
+
// Sottoscrivi al cambiamento nel numero di tab, così da
|
|
2937
|
+
// poter ri-renderizzare il contenuto quando nuove tab vengono aggiunte o rimosse.
|
|
2938
|
+
this._tabsSubscription = this._tabs.changes.subscribe(() => {
|
|
2939
|
+
const indexToSelect = this._clampTabIndex(this._indexToSelect);
|
|
2940
|
+
// Mantieni il tab selezionato precedentemente se un nuovo tab è aggiunto o rimosso e non ci sono
|
|
2941
|
+
// cambiamenti espliciti che selezionino un tab differente.
|
|
2942
|
+
if (indexToSelect === this._selectedIndex) {
|
|
2943
|
+
const tabs = this._tabs.toArray();
|
|
2944
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
2945
|
+
if (tabs[i].isActive) {
|
|
2946
|
+
// Assegna `_indexToSelect` e `_selectedIndex` in modo da non emettere un change event
|
|
2947
|
+
// per evitare al consumer loop infiniti in alcuni casi limite come ad esempio
|
|
2948
|
+
// se si aggiunge un tab all'interno dell'evento `selectedIndexChange`.
|
|
2949
|
+
this._indexToSelect = this._selectedIndex = i;
|
|
2950
|
+
break;
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
this._subscribeToTabLabels();
|
|
2955
|
+
this._changeDetectorRef.markForCheck();
|
|
2956
|
+
});
|
|
2957
|
+
}
|
|
2958
|
+
ngOnDestroy() {
|
|
2959
|
+
this._tabsSubscription.unsubscribe();
|
|
2960
|
+
this._tabLabelSubscription.unsubscribe();
|
|
2961
|
+
}
|
|
2962
|
+
_createChangeEvent(index) {
|
|
2963
|
+
const event = new TabChangeEvent;
|
|
2964
|
+
event.index = index;
|
|
2965
|
+
if (this._tabs && this._tabs.length) {
|
|
2966
|
+
event.tab = this._tabs.toArray()[index];
|
|
2967
|
+
}
|
|
2968
|
+
return event;
|
|
2969
|
+
}
|
|
2970
|
+
/**
|
|
2971
|
+
* Sottoscrivi a cambiamenti nelle label dei tab. Necessario perchè l'input per la label è sul TabComponent
|
|
2972
|
+
* mentre il data binding è all'interno di TabGroupComponent. Per fare in modo che il binding sia aggiornato
|
|
2973
|
+
* bisogna sottoscriversi ai cambiamenti e azionare la change detection in maniera manuale.
|
|
2974
|
+
*/
|
|
2975
|
+
_subscribeToTabLabels() {
|
|
2976
|
+
if (this._tabLabelSubscription) {
|
|
2977
|
+
this._tabLabelSubscription.unsubscribe();
|
|
2978
|
+
}
|
|
2979
|
+
this._tabLabelSubscription = merge(...this._tabs.map(tab => tab._disableChange), ...this._tabs.map(tab => tab._labelChange)).subscribe(() => {
|
|
2980
|
+
this._changeDetectorRef.markForCheck();
|
|
2981
|
+
});
|
|
2982
|
+
}
|
|
2983
|
+
/** fissa l'indice tra 0 e la dimensione dei tab. */
|
|
2984
|
+
_clampTabIndex(index) {
|
|
2985
|
+
return Math.min(this._tabs.length - 1, Math.max(index || 0, 0));
|
|
2986
|
+
}
|
|
2987
|
+
/** ritorna un id univoco per ogni label di tab */
|
|
2988
|
+
_getTabLabelId(i) {
|
|
2989
|
+
return `it-tab-label-${this._groupId}-${i}`;
|
|
2990
|
+
}
|
|
2991
|
+
/** ritorna un id univoco per ogni elemento di contenuto del tab */
|
|
2992
|
+
_getTabContentId(i) {
|
|
2993
|
+
return `it-tab-content-${this._groupId}-${i}`;
|
|
2994
|
+
}
|
|
2995
|
+
/** restituisce il tabIndex del tab. */
|
|
2996
|
+
_getTabIndex(tab, idx) {
|
|
2997
|
+
if (tab.disabled) {
|
|
2998
|
+
return null;
|
|
2999
|
+
}
|
|
3000
|
+
return this.selectedIndex === idx ? 0 : -1;
|
|
3001
|
+
}
|
|
3002
|
+
_handleClick($event, index) {
|
|
3003
|
+
$event.preventDefault();
|
|
3004
|
+
this.changeTab(index);
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
ItTabGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTabGroupComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3008
|
+
ItTabGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.11", type: ItTabGroupComponent, selector: "it-tab-group", inputs: { pill: "pill", selectedIndex: "selectedIndex", dark: "dark" }, outputs: { selectedIndexChange: "selectedIndexChange", selectedTabChange: "selectedTabChange" }, queries: [{ propertyName: "_tabs", predicate: ItTabComponent }], exportAs: ["itTabGroup"], ngImport: i0, template: "<ul class=\"nav\" [ngClass]=\"{'nav-dark': dark, 'nav-tabs': !pill, 'nav-pills mb-3': pill}\" role=\"tablist\">\n\n <li class=\"nav-item\" *ngFor=\"let tab of _tabs; let i = index\">\n <a\n focusMouse\n href=\"#\"\n role=\"tab\"\n [attr.aria-controls]=\"_getTabContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"tab.ariaLabel || null\"\n [attr.aria-labelledby]=\"(!tab.ariaLabel && tab.ariaLabelledby) ? tab.ariaLabelledby : null\"\n [ngClass]=\"{ 'nav-link': true, 'active': selectedIndex == i, 'disabled': tab.disabled }\"\n [id]=\"_getTabLabelId(i)\"\n (click)=\"_handleClick($event, i)\"\n >\n <i *ngIf=\"tab.icon\" class=\"it-ico-lg d-block text-center\" [ngClass]=\"tab.icon\"></i>\n {{tab.label}}\n </a>\n </li>\n</ul>\n<div class=\"tab-content\">\n <ng-container *ngFor=\"let tab of _tabs; let i = index\">\n <div\n [ngClass]=\"{ 'tab-pane p-3': true, 'show active': selectedIndex == i }\"\n [id]=\"_getTabContentId(i)\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"_getTabLabelId(i)\">\n <ng-container *ngTemplateOutlet=\"tab._implicitContent\"></ng-container>\n </div>\n </ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: FocusMouseDirective, selector: "[focusMouse]", exportAs: ["focusMouse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3009
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTabGroupComponent, decorators: [{
|
|
3010
|
+
type: Component,
|
|
3011
|
+
args: [{ selector: 'it-tab-group', exportAs: 'itTabGroup', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ul class=\"nav\" [ngClass]=\"{'nav-dark': dark, 'nav-tabs': !pill, 'nav-pills mb-3': pill}\" role=\"tablist\">\n\n <li class=\"nav-item\" *ngFor=\"let tab of _tabs; let i = index\">\n <a\n focusMouse\n href=\"#\"\n role=\"tab\"\n [attr.aria-controls]=\"_getTabContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"tab.ariaLabel || null\"\n [attr.aria-labelledby]=\"(!tab.ariaLabel && tab.ariaLabelledby) ? tab.ariaLabelledby : null\"\n [ngClass]=\"{ 'nav-link': true, 'active': selectedIndex == i, 'disabled': tab.disabled }\"\n [id]=\"_getTabLabelId(i)\"\n (click)=\"_handleClick($event, i)\"\n >\n <i *ngIf=\"tab.icon\" class=\"it-ico-lg d-block text-center\" [ngClass]=\"tab.icon\"></i>\n {{tab.label}}\n </a>\n </li>\n</ul>\n<div class=\"tab-content\">\n <ng-container *ngFor=\"let tab of _tabs; let i = index\">\n <div\n [ngClass]=\"{ 'tab-pane p-3': true, 'show active': selectedIndex == i }\"\n [id]=\"_getTabContentId(i)\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"_getTabLabelId(i)\">\n <ng-container *ngTemplateOutlet=\"tab._implicitContent\"></ng-container>\n </div>\n </ng-container>\n</div>\n" }]
|
|
3012
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _tabs: [{
|
|
3013
|
+
type: ContentChildren,
|
|
3014
|
+
args: [ItTabComponent]
|
|
3015
|
+
}], pill: [{
|
|
3016
|
+
type: Input
|
|
3017
|
+
}], selectedIndex: [{
|
|
3018
|
+
type: Input
|
|
3019
|
+
}], dark: [{
|
|
3020
|
+
type: Input
|
|
3021
|
+
}], selectedIndexChange: [{
|
|
3022
|
+
type: Output
|
|
3023
|
+
}], selectedTabChange: [{
|
|
3024
|
+
type: Output
|
|
3025
|
+
}] } });
|
|
3026
|
+
|
|
3027
|
+
class ItDropdownModule {
|
|
3028
|
+
}
|
|
3029
|
+
ItDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3030
|
+
ItDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownModule, declarations: [DropdownComponent, DropdownDividerComponent, DropdownItemComponent, ItDropdown, ItNavbar, ItDropdownMenu, ItDropdownAnchor, ItDropdownToggle, ItDropdownItem], imports: [CommonModule, NgbDropdownModule, ItIconModule, ItButtonModule, ItUtilsModule], exports: [DropdownComponent, DropdownDividerComponent, DropdownItemComponent, ItDropdown, ItNavbar, ItDropdownMenu, ItDropdownAnchor, ItDropdownToggle, ItDropdownItem] });
|
|
3031
|
+
ItDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownModule, imports: [CommonModule, NgbDropdownModule, ItIconModule, ItButtonModule, ItUtilsModule] });
|
|
3032
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItDropdownModule, decorators: [{
|
|
3033
|
+
type: NgModule,
|
|
3034
|
+
args: [{
|
|
3035
|
+
declarations: [DropdownComponent, DropdownDividerComponent, DropdownItemComponent, ItDropdown, ItNavbar, ItDropdownMenu, ItDropdownAnchor, ItDropdownToggle, ItDropdownItem],
|
|
3036
|
+
imports: [CommonModule, NgbDropdownModule, ItIconModule, ItButtonModule, ItUtilsModule],
|
|
3037
|
+
exports: [DropdownComponent, DropdownDividerComponent, DropdownItemComponent, ItDropdown, ItNavbar, ItDropdownMenu, ItDropdownAnchor, ItDropdownToggle, ItDropdownItem]
|
|
3038
|
+
}]
|
|
3039
|
+
}] });
|
|
3040
|
+
|
|
3041
|
+
class ItTabsModule {
|
|
3042
|
+
}
|
|
3043
|
+
ItTabsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3044
|
+
ItTabsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: ItTabsModule, declarations: [ItTabComponent, ItTabGroupComponent], imports: [CommonModule, ItUtilsModule], exports: [ItTabComponent, ItTabGroupComponent] });
|
|
3045
|
+
ItTabsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTabsModule, imports: [CommonModule, ItUtilsModule] });
|
|
3046
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ItTabsModule, decorators: [{
|
|
3047
|
+
type: NgModule,
|
|
3048
|
+
args: [{
|
|
3049
|
+
declarations: [ItTabComponent, ItTabGroupComponent],
|
|
3050
|
+
exports: [ItTabComponent, ItTabGroupComponent],
|
|
3051
|
+
imports: [CommonModule, ItUtilsModule]
|
|
3052
|
+
}]
|
|
3053
|
+
}] });
|
|
3054
|
+
|
|
3055
|
+
class DesignAngularKitModule {
|
|
3056
|
+
}
|
|
3057
|
+
DesignAngularKitModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DesignAngularKitModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3058
|
+
DesignAngularKitModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: DesignAngularKitModule, declarations: [CheckboxComponent,
|
|
3059
|
+
ToggleComponent,
|
|
3060
|
+
RadioGroupDirective,
|
|
3061
|
+
RadioButtonComponent,
|
|
3062
|
+
BadgeDirective,
|
|
3063
|
+
ProgressBarComponent,
|
|
3064
|
+
FormInputComponent,
|
|
3065
|
+
BreadcrumbComponent,
|
|
3066
|
+
BreadcrumbItemComponent,
|
|
3067
|
+
ItPrefixDirective,
|
|
3068
|
+
ItSuffixDirective,
|
|
3069
|
+
ItTextPrefixDirective,
|
|
3070
|
+
ItTextSuffixDirective,
|
|
3071
|
+
MarkMatchingTextPipe], imports: [CommonModule,
|
|
3072
|
+
ItUtilsModule,
|
|
3073
|
+
FormsModule,
|
|
3074
|
+
ItPopoverModule,
|
|
3075
|
+
ItTooltipModule,
|
|
3076
|
+
ItCollapseModule,
|
|
3077
|
+
ItDropdownModule,
|
|
3078
|
+
ItIconModule,
|
|
3079
|
+
ItButtonModule,
|
|
3080
|
+
ItTabsModule], exports: [CheckboxComponent,
|
|
3081
|
+
ToggleComponent,
|
|
3082
|
+
RadioGroupDirective,
|
|
3083
|
+
RadioButtonComponent,
|
|
3084
|
+
BadgeDirective,
|
|
3085
|
+
ProgressBarComponent,
|
|
3086
|
+
ItButtonModule,
|
|
3087
|
+
FormInputComponent,
|
|
3088
|
+
BreadcrumbComponent,
|
|
3089
|
+
BreadcrumbItemComponent,
|
|
3090
|
+
ItIconModule,
|
|
3091
|
+
ItPrefixDirective,
|
|
3092
|
+
ItSuffixDirective,
|
|
3093
|
+
ItTextPrefixDirective,
|
|
3094
|
+
ItTextSuffixDirective,
|
|
3095
|
+
ItPopoverModule,
|
|
3096
|
+
ItTooltipModule,
|
|
3097
|
+
ItCollapseModule,
|
|
3098
|
+
ItDropdownModule,
|
|
3099
|
+
ItUtilsModule] });
|
|
3100
|
+
DesignAngularKitModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DesignAngularKitModule, imports: [CommonModule,
|
|
3101
|
+
ItUtilsModule,
|
|
3102
|
+
FormsModule,
|
|
3103
|
+
ItPopoverModule,
|
|
3104
|
+
ItTooltipModule,
|
|
3105
|
+
ItCollapseModule,
|
|
3106
|
+
ItDropdownModule,
|
|
3107
|
+
ItIconModule,
|
|
3108
|
+
ItButtonModule,
|
|
3109
|
+
ItTabsModule, ItButtonModule,
|
|
3110
|
+
ItIconModule,
|
|
3111
|
+
ItPopoverModule,
|
|
3112
|
+
ItTooltipModule,
|
|
3113
|
+
ItCollapseModule,
|
|
3114
|
+
ItDropdownModule,
|
|
3115
|
+
ItUtilsModule] });
|
|
3116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DesignAngularKitModule, decorators: [{
|
|
3117
|
+
type: NgModule,
|
|
3118
|
+
args: [{
|
|
3119
|
+
imports: [
|
|
3120
|
+
CommonModule,
|
|
3121
|
+
ItUtilsModule,
|
|
3122
|
+
FormsModule,
|
|
3123
|
+
ItPopoverModule,
|
|
3124
|
+
ItTooltipModule,
|
|
3125
|
+
ItCollapseModule,
|
|
3126
|
+
ItDropdownModule,
|
|
3127
|
+
ItIconModule,
|
|
3128
|
+
ItButtonModule,
|
|
3129
|
+
ItTabsModule,
|
|
3130
|
+
],
|
|
3131
|
+
declarations: [
|
|
3132
|
+
CheckboxComponent,
|
|
3133
|
+
ToggleComponent,
|
|
3134
|
+
RadioGroupDirective,
|
|
3135
|
+
RadioButtonComponent,
|
|
3136
|
+
BadgeDirective,
|
|
3137
|
+
ProgressBarComponent,
|
|
3138
|
+
FormInputComponent,
|
|
3139
|
+
BreadcrumbComponent,
|
|
3140
|
+
BreadcrumbItemComponent,
|
|
3141
|
+
ItPrefixDirective,
|
|
3142
|
+
ItSuffixDirective,
|
|
3143
|
+
ItTextPrefixDirective,
|
|
3144
|
+
ItTextSuffixDirective,
|
|
3145
|
+
MarkMatchingTextPipe
|
|
3146
|
+
],
|
|
3147
|
+
exports: [
|
|
3148
|
+
CheckboxComponent,
|
|
3149
|
+
ToggleComponent,
|
|
3150
|
+
RadioGroupDirective,
|
|
3151
|
+
RadioButtonComponent,
|
|
3152
|
+
BadgeDirective,
|
|
3153
|
+
ProgressBarComponent,
|
|
3154
|
+
ItButtonModule,
|
|
3155
|
+
FormInputComponent,
|
|
3156
|
+
BreadcrumbComponent,
|
|
3157
|
+
BreadcrumbItemComponent,
|
|
3158
|
+
ItIconModule,
|
|
3159
|
+
ItPrefixDirective,
|
|
3160
|
+
ItSuffixDirective,
|
|
3161
|
+
ItTextPrefixDirective,
|
|
3162
|
+
ItTextSuffixDirective,
|
|
3163
|
+
ItPopoverModule,
|
|
3164
|
+
ItTooltipModule,
|
|
3165
|
+
ItCollapseModule,
|
|
3166
|
+
ItDropdownModule,
|
|
3167
|
+
ItUtilsModule
|
|
3168
|
+
]
|
|
3169
|
+
}]
|
|
3170
|
+
}] });
|
|
3171
|
+
|
|
3172
|
+
/*
|
|
3173
|
+
* Public API Surface of design-angular-kit
|
|
3174
|
+
*/
|
|
3175
|
+
|
|
3176
|
+
/**
|
|
3177
|
+
* Generated bundle index. Do not edit.
|
|
3178
|
+
*/
|
|
3179
|
+
|
|
3180
|
+
export { BadgeDirective, BreadcrumbComponent, BreadcrumbItemComponent, CheckboxChange, CheckboxComponent, DesignAngularKitModule, DropdownComponent, DropdownDividerComponent, DropdownItemComponent, FocusMouseDirective, FormInputChange, FormInputComponent, IconComponent, ItButtonDirective, ItButtonModule, ItCollapseDirective, ItCollapseGroupComponent, ItCollapseItemComponent, ItCollapseModule, ItDropdown, ItDropdownAnchor, ItDropdownConfig, ItDropdownItem, ItDropdownMenu, ItDropdownModule, ItDropdownToggle, ItIconModule, ItNavbar, ItPopover, ItPopoverConfig, ItPopoverModule, ItPrefixDirective, ItSuffixDirective, ItTabGroupComponent, ItTextPrefixDirective, ItTextSuffixDirective, ItTooltip, ItTooltipConfig, ItTooltipModule, ItUtilsModule, ProgressBarComponent, RadioButtonComponent, RadioChange, RadioGroupDirective, TabChangeEvent, ToggleChange, ToggleComponent };
|
|
3181
|
+
//# sourceMappingURL=design-angular-kit.mjs.map
|