@design-factory/design-factory 15.2.3 → 16.0.1
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 +17 -1
- package/assets/fonts/amadeus-neue/bold/AmadeusNeue-Bold.ttf +0 -0
- package/assets/fonts/amadeus-neue/bold/AmadeusNeue-Bold.woff +0 -0
- package/assets/fonts/amadeus-neue/bold/AmadeusNeue-Bold.woff2 +0 -0
- package/assets/fonts/amadeus-neue/bold/AmadeusNeue-BoldItalic.ttf +0 -0
- package/assets/fonts/amadeus-neue/bold/AmadeusNeue-BoldItalic.woff +0 -0
- package/assets/fonts/amadeus-neue/bold/AmadeusNeue-BoldItalic.woff2 +0 -0
- package/assets/fonts/amadeus-neue/light/AmadeusNeue-Light.ttf +0 -0
- package/assets/fonts/amadeus-neue/light/AmadeusNeue-Light.woff +0 -0
- package/assets/fonts/amadeus-neue/light/AmadeusNeue-Light.woff2 +0 -0
- package/assets/fonts/amadeus-neue/light/AmadeusNeue-LightItalic.ttf +0 -0
- package/assets/fonts/amadeus-neue/light/AmadeusNeue-LightItalic.woff +0 -0
- package/assets/fonts/amadeus-neue/light/AmadeusNeue-LightItalic.woff2 +0 -0
- package/assets/fonts/amadeus-neue/medium/AmadeusNeue-Medium.ttf +0 -0
- package/assets/fonts/amadeus-neue/medium/AmadeusNeue-Medium.woff +0 -0
- package/assets/fonts/amadeus-neue/medium/AmadeusNeue-Medium.woff2 +0 -0
- package/assets/fonts/amadeus-neue/medium/AmadeusNeue-MediumItalic.ttf +0 -0
- package/assets/fonts/amadeus-neue/medium/AmadeusNeue-MediumItalic.woff +0 -0
- package/assets/fonts/amadeus-neue/medium/AmadeusNeue-MediumItalic.woff2 +0 -0
- package/assets/fonts/amadeus-neue/regular/AmadeusNeue-Regular.ttf +0 -0
- package/assets/fonts/amadeus-neue/regular/AmadeusNeue-Regular.woff +0 -0
- package/assets/fonts/amadeus-neue/regular/AmadeusNeue-Regular.woff2 +0 -0
- package/assets/fonts/amadeus-neue/regular/AmadeusNeue-RegularItalic.ttf +0 -0
- package/assets/fonts/amadeus-neue/regular/AmadeusNeue-RegularItalic.woff +0 -0
- package/assets/fonts/amadeus-neue/regular/AmadeusNeue-RegularItalic.woff2 +0 -0
- package/design-factory-initial-branding.css +1 -0
- package/design-factory-initial-branding.scss +1 -0
- package/design-factory.css +1 -3
- package/design-factory.scss +1 -0
- package/esm2022/lib/angular/accessibility/components/skip-links-container/skip-links-container.component.mjs +3 -3
- package/esm2022/lib/angular/df.module.mjs +102 -0
- package/esm2022/lib/angular/icon/amadeus-icon.mjs +2 -2
- package/esm2022/lib/angular/sidenav/sidenavlist.component.mjs +3 -12
- package/esm2022/lib/angular/stepper/stepper.component.mjs +65 -0
- package/esm2022/lib/angular/stepper/stepper.directive.mjs +174 -0
- package/esm2022/lib/angular/stepper/stepper.module.mjs +17 -0
- package/esm2022/lib/angular/stepper/stepper.service.mjs +213 -0
- package/esm2022/lib/angular/tooltip/truncate/tooltipTruncate.directive.mjs +5 -3
- package/esm2022/lib/index.mjs +9 -96
- package/fesm2022/design-factory.mjs +1838 -1427
- package/fesm2022/design-factory.mjs.map +1 -1
- package/lib/angular/df.module.d.ts +26 -0
- package/lib/angular/stepper/stepper.component.d.ts +31 -0
- package/lib/angular/stepper/stepper.directive.d.ts +37 -0
- package/lib/angular/stepper/stepper.module.d.ts +8 -0
- package/lib/angular/stepper/stepper.service.d.ts +126 -0
- package/lib/angular/tooltip/truncate/tooltipTruncate.directive.d.ts +1 -0
- package/lib/index.d.ts +7 -23
- package/package.json +23 -4
- package/schematics/migrations/15_0_0/remove-ngx-slider/index.js +0 -1
- package/schematics/migrations/16_0_0/navbar-logo-dark/index.d.ts +9 -0
- package/schematics/migrations/16_0_0/navbar-logo-dark/index.js +43 -0
- package/schematics/migrations/16_0_0/revert-to-old-brand/index.d.ts +7 -0
- package/schematics/migrations/16_0_0/revert-to-old-brand/index.js +115 -0
- package/schematics/migrations/16_0_0/scss-var/files/removed.json +55 -0
- package/schematics/migrations/16_0_0/scss-var/files/renames.json +76 -0
- package/schematics/migrations/16_0_0/scss-var/index.d.ts +7 -0
- package/schematics/migrations/16_0_0/scss-var/index.js +57 -0
- package/schematics/migrations/16_0_0/stepper-classes/index.d.ts +13 -0
- package/schematics/migrations/16_0_0/stepper-classes/index.js +63 -0
- package/schematics/migrations/helpers.js +0 -1
- package/schematics/migrations/migration.json +23 -1
- package/schematics/migrations/utils/component-resource-collector.d.ts +44 -0
- package/schematics/migrations/utils/component-resource-collector.js +166 -0
- package/schematics/migrations/utils/project_tsconfig_paths.js +0 -1
- package/schematics/migrations/utils/style-updater.d.ts +9 -0
- package/schematics/migrations/utils/style-updater.js +38 -0
- package/schematics/migrations/utils/template-updater.d.ts +9 -0
- package/schematics/migrations/utils/template-updater.js +38 -0
- package/schematics/migrations/utils/typescript/compiler_host.js +0 -1
- package/schematics/migrations/utils/typescript/decorators.d.ts +22 -0
- package/schematics/migrations/utils/typescript/decorators.js +41 -0
- package/schematics/migrations/utils/typescript/functions.d.ts +14 -0
- package/schematics/migrations/utils/typescript/functions.js +20 -0
- package/schematics/migrations/utils/typescript/imports.d.ts +17 -0
- package/schematics/migrations/utils/typescript/imports.js +110 -0
- package/schematics/migrations/utils/typescript/line-mappings.d.ts +21 -0
- package/schematics/migrations/utils/typescript/line-mappings.js +75 -0
- package/schematics/migrations/utils/typescript/parse_tsconfig.js +0 -1
- package/schematics/migrations/utils/typescript/property-name.d.ts +18 -0
- package/schematics/migrations/utils/typescript/property-name.js +27 -0
- package/schematics/ng-add/index.js +0 -1
- package/schematics/ng-add/schema.js +0 -1
- package/styles/scss/_common.root.scss +37 -0
- package/styles/scss/_common.scss +3 -9
- package/styles/scss/_common.variables.scss +16 -6
- package/styles/scss/_variables.scss +0 -1
- package/styles/scss/bootstrap/_maps.scss +10 -9
- package/styles/scss/bootstrap/_mixins-override.scss +26 -0
- package/styles/scss/bootstrap/_variables.scss +927 -267
- package/styles/scss/components/accordion/_accordion.scss +31 -14
- package/styles/scss/components/accordion/_accordion.variables.scss +5 -5
- package/styles/scss/components/alert/_alert.scss +130 -228
- package/styles/scss/components/alert/_alert.variables.scss +22 -33
- package/styles/scss/components/badge/_badge.scss +130 -118
- package/styles/scss/components/badge/_badge.variables.scss +14 -8
- package/styles/scss/components/brand-color/_brand-color.mixins.scss +19 -4
- package/styles/scss/components/brand-color/_brand-color.scss +4 -6
- package/styles/scss/components/brand-color/_brand-color.variables.scss +1 -7
- package/styles/scss/components/brand-color/_brand-color_container.scss +28 -0
- package/styles/scss/components/breadcrumbs/_breadcrumbs.scss +77 -65
- package/styles/scss/components/breadcrumbs/_breadcrumbs.variables.scss +6 -4
- package/styles/scss/components/button/_button.scss +120 -55
- package/styles/scss/components/button/_button.variables.scss +18 -4
- package/styles/scss/components/button/_button_container.scss +9 -45
- package/styles/scss/components/card/_card.scss +90 -58
- package/styles/scss/components/card/_card.variables.scss +13 -13
- package/styles/scss/components/carousel/_carousel.scss +22 -23
- package/styles/scss/components/carousel/_carousel.variables.scss +2 -1
- package/styles/scss/components/checkbox/_checkbox.scss +14 -8
- package/styles/scss/components/checkbox/_checkbox.variables.scss +2 -2
- package/styles/scss/components/collapse/_collapse.scss +15 -7
- package/styles/scss/components/collapse/_collapse.variables.scss +3 -3
- package/styles/scss/components/datepicker/_datepicker.scss +178 -122
- package/styles/scss/components/datepicker/_datepicker.variables.scss +22 -15
- package/styles/scss/components/dropdown/_dropdown.mixins.scss +4 -4
- package/styles/scss/components/dropdown/_dropdown.scss +39 -19
- package/styles/scss/components/dropdown/_dropdown.variables.scss +4 -4
- package/styles/scss/components/fieldset/_fieldset.scss +4 -2
- package/styles/scss/components/fonts/_fonts-family.scss +112 -29
- package/styles/scss/components/fonts/_fonts.root.scss +27 -0
- package/styles/scss/components/fonts/_fonts.scss +25 -26
- package/styles/scss/components/fonts/_fonts.variables.scss +2 -2
- package/styles/scss/components/footer/_footer.scss +48 -18
- package/styles/scss/components/footer/_footer.variables.scss +4 -2
- package/styles/scss/components/form/_form.scss +69 -16
- package/styles/scss/components/form/_form.variables.scss +23 -3
- package/styles/scss/components/icon/_amadeus-icon.scss +2 -2
- package/styles/scss/components/icon/_amadeus-icon.variables.scss +1 -0
- package/styles/scss/components/inputs/_inputs.mixin.scss +8 -4
- package/styles/scss/components/inputs/_inputs.root.scss +8 -0
- package/styles/scss/components/inputs/_inputs.scss +159 -118
- package/styles/scss/components/inputs/_inputs.variables.scss +2 -1
- package/styles/scss/components/link/_link.mixins.scss +49 -49
- package/styles/scss/components/link/_link.scss +84 -22
- package/styles/scss/components/link/_link.variables.scss +6 -6
- package/styles/scss/components/list/_list.scss +10 -5
- package/styles/scss/components/list-group/_list-group.scss +54 -48
- package/styles/scss/components/list-group/_list-group.variables.scss +6 -14
- package/styles/scss/components/media/_media.scss +17 -9
- package/styles/scss/components/media/_media.variables.scss +2 -1
- package/styles/scss/components/modal/_modal.scss +88 -39
- package/styles/scss/components/modal/_modal.variables.scss +4 -5
- package/styles/scss/components/navbar/_navbar.scss +298 -115
- package/styles/scss/components/navbar/_navbar.variables.scss +29 -18
- package/styles/scss/components/pagination/_pagination.scss +68 -82
- package/styles/scss/components/pagination/_pagination.variables.scss +5 -8
- package/styles/scss/components/pagination/_pagination_container.scss +3 -0
- package/styles/scss/components/popover/_popover.mixin.scss +20 -33
- package/styles/scss/components/popover/_popover.scss +25 -7
- package/styles/scss/components/popover/_popover_container.scss +123 -74
- package/styles/scss/components/progressbar/_progressbar.scss +15 -7
- package/styles/scss/components/progressbar/_progressbar.variables.scss +3 -2
- package/styles/scss/components/radio/_radio.scss +19 -14
- package/styles/scss/components/rating/_rating.scss +41 -22
- package/styles/scss/components/rating/_rating.variables.scss +5 -5
- package/styles/scss/components/scrollspy/_scrollspy.scss +30 -13
- package/styles/scss/components/scrollspy/_scrollspy.variables.scss +2 -1
- package/styles/scss/components/select/_select.scss +232 -166
- package/styles/scss/components/select/_select.variables.scss +15 -15
- package/styles/scss/components/separator/_separator.scss +2 -1
- package/styles/scss/components/sidenav/_sidenav.scss +208 -135
- package/styles/scss/components/sidenav/_sidenav.variables.scss +19 -20
- package/styles/scss/components/skip-links/_skip-links.scss +31 -16
- package/styles/scss/components/skip-links/_skip-links.variables.scss +6 -6
- package/styles/scss/components/slider/_slider.scss +11 -10
- package/styles/scss/components/slider/_slider.variables.scss +8 -8
- package/styles/scss/components/speechbubble/_speechbubble.scss +50 -30
- package/styles/scss/components/speechbubble/_speechbubble.variables.scss +4 -2
- package/styles/scss/components/spinner/_spinner.scss +34 -29
- package/styles/scss/components/stepper/_stepper.mixins.scss +111 -151
- package/styles/scss/components/stepper/_stepper.scss +163 -69
- package/styles/scss/components/stepper/_stepper.variables.scss +23 -17
- package/styles/scss/components/table/_advancedtables.scss +50 -31
- package/styles/scss/components/table/_table.variables.scss +3 -2
- package/styles/scss/components/tabs/_tabs.scss +98 -49
- package/styles/scss/components/tabs/_tabs.variables.scss +11 -10
- package/styles/scss/components/toast/_toast.scss +136 -68
- package/styles/scss/components/toast/_toast.variables.scss +4 -4
- package/styles/scss/components/toggle/_toggle.scss +90 -44
- package/styles/scss/components/toggle/_toggle.variables.scss +7 -5
- package/styles/scss/components/typeahead/_typeahead.scss +18 -8
- package/styles/scss/components/typeahead/_typeahead.variables.scss +1 -1
- package/styles/scss/df-styles-namespace.scss +8 -11
- package/styles/scss/df-styles.scss +6 -3
- package/styles/scss/themes/brand2023/_variables.scss +588 -0
- package/styles/scss/utilities/_common.utilities.scss +112 -32
- package/assets/fonts/amadeus-light/amadeus-light.svg +0 -8658
- package/assets/fonts/amadeus-light/amadeus-light.ttf +0 -0
- package/assets/fonts/amadeus-light/amadeus-light.woff +0 -0
- package/assets/fonts/amadeus-light/amadeus-light.woff2 +0 -0
- package/assets/icon-amadeus.svg +0 -1
- package/esm2022/lib/angular/utils/html-element-helper.mjs +0 -8
- package/esm2022/lib/angular/utils/titleTruncate.directive.mjs +0 -39
- package/lib/angular/utils/html-element-helper.d.ts +0 -5
- package/lib/angular/utils/titleTruncate.directive.d.ts +0 -16
- package/schematics/migrations/15_0_0/remove-ngx-slider/index.js.map +0 -1
- package/schematics/migrations/helpers.js.map +0 -1
- package/schematics/migrations/utils/project_tsconfig_paths.js.map +0 -1
- package/schematics/migrations/utils/typescript/compiler_host.js.map +0 -1
- package/schematics/migrations/utils/typescript/parse_tsconfig.js.map +0 -1
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/schema.js.map +0 -1
- package/styles/scss/components/tooltip/_tooltip.scss +0 -3
- package/styles/scss/components/tooltip/_tooltip.variables.scss +0 -5
|
@@ -1,16 +1,118 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive,
|
|
2
|
+
import { EventEmitter, Directive, Inject, HostBinding, Output, HostListener, Component, ChangeDetectionStrategy, ContentChildren, NgModule, Input, Injectable, InjectionToken, PLATFORM_ID, ViewEncapsulation, ComponentRef, TemplateRef, Optional, forwardRef, ViewChild, ContentChild, inject, Host, Renderer2, ElementRef, numberAttribute } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@angular/common';
|
|
4
|
+
import { DOCUMENT, isPlatformBrowser, CommonModule, NgIf, NgTemplateOutlet } from '@angular/common';
|
|
5
|
+
import { merge, BehaviorSubject, fromEvent, Subscription, combineLatest, Subject, Observable, EMPTY, of, timer, race } from 'rxjs';
|
|
3
6
|
import * as i1 from '@ng-bootstrap/ng-bootstrap';
|
|
4
|
-
import { NgbAlertModule, NgbDatepickerKeyboardService, NgbDate, NgbDropdownModule, NgbDatepickerModule, NgbPopoverConfig, NgbPopoverModule, NgbProgressbarModule,
|
|
5
|
-
import
|
|
6
|
-
import { NgSelectModule } from '@ng-select/ng-select';
|
|
7
|
-
import * as i1$2 from '@angular/common';
|
|
8
|
-
import { CommonModule, DOCUMENT, NgIf, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
|
|
9
|
-
import { merge, Subject, Subscription, BehaviorSubject, fromEvent, combineLatest, Observable, EMPTY, of, timer, race } from 'rxjs';
|
|
7
|
+
import { NgbToastModule, NgbAlertModule, NgbDatepickerKeyboardService, NgbDate, NgbDropdownModule, NgbDatepickerModule, NgbAccordionModule, NgbPopoverConfig, NgbPopoverModule, NgbProgressbarModule, NgbCollapseModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
|
8
|
+
import { take, map, switchMap, distinctUntilChanged, throttleTime, tap, filter, endWith, takeUntil } from 'rxjs/operators';
|
|
10
9
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
11
|
-
import { throttleTime, tap, distinctUntilChanged, filter, take, map, switchMap, endWith, takeUntil } from 'rxjs/operators';
|
|
12
10
|
import * as i3 from '@angular/router';
|
|
13
11
|
import { RouterModule } from '@angular/router';
|
|
12
|
+
import * as i1$2 from '@ng-select/ng-select';
|
|
13
|
+
import { NgSelectModule } from '@ng-select/ng-select';
|
|
14
|
+
|
|
15
|
+
class SkipLinkDirective {
|
|
16
|
+
onFocus() {
|
|
17
|
+
this.inFocus.emit(true);
|
|
18
|
+
}
|
|
19
|
+
onClick() {
|
|
20
|
+
this.focusOnTarget();
|
|
21
|
+
}
|
|
22
|
+
onBlur() {
|
|
23
|
+
this.inFocus.emit(false);
|
|
24
|
+
}
|
|
25
|
+
constructor(element, document) {
|
|
26
|
+
this.element = element;
|
|
27
|
+
this.document = document;
|
|
28
|
+
this.class = 'list-group-item list-group-item-action';
|
|
29
|
+
this.inFocus = new EventEmitter();
|
|
30
|
+
}
|
|
31
|
+
focusOnTarget() {
|
|
32
|
+
const href = String(this.element.nativeElement.getAttribute('href'));
|
|
33
|
+
const parts = href.split('#');
|
|
34
|
+
if (parts.length < 2) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const id = parts.pop();
|
|
38
|
+
if (!id) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
const target = this.document.getElementById(id);
|
|
43
|
+
if (target) {
|
|
44
|
+
target.focus();
|
|
45
|
+
this.onBlur();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SkipLinkDirective, deps: [{ token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
50
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: SkipLinkDirective, isStandalone: true, selector: "[dfSkipLink]", outputs: { inFocus: "inFocus" }, host: { listeners: { "focus": "onFocus()", "click": "onClick()", "blur": "onBlur()" }, properties: { "class": "this.class" } }, ngImport: i0 }); }
|
|
51
|
+
}
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SkipLinkDirective, decorators: [{
|
|
53
|
+
type: Directive,
|
|
54
|
+
args: [{
|
|
55
|
+
selector: '[dfSkipLink]',
|
|
56
|
+
standalone: true
|
|
57
|
+
}]
|
|
58
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
59
|
+
type: Inject,
|
|
60
|
+
args: [DOCUMENT]
|
|
61
|
+
}] }]; }, propDecorators: { class: [{
|
|
62
|
+
type: HostBinding
|
|
63
|
+
}], inFocus: [{
|
|
64
|
+
type: Output
|
|
65
|
+
}], onFocus: [{
|
|
66
|
+
type: HostListener,
|
|
67
|
+
args: ['focus']
|
|
68
|
+
}], onClick: [{
|
|
69
|
+
type: HostListener,
|
|
70
|
+
args: ['click']
|
|
71
|
+
}], onBlur: [{
|
|
72
|
+
type: HostListener,
|
|
73
|
+
args: ['blur']
|
|
74
|
+
}] } });
|
|
75
|
+
|
|
76
|
+
class SkipLinksContainerComponent {
|
|
77
|
+
constructor(changeDetector) {
|
|
78
|
+
this.changeDetector = changeDetector;
|
|
79
|
+
this.inFocus = false;
|
|
80
|
+
}
|
|
81
|
+
ngAfterContentInit() {
|
|
82
|
+
if (!this.links.length) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.focusSubscription = merge(...this.links.map((link) => link.inFocus)).subscribe((focus) => {
|
|
86
|
+
this.inFocus = focus;
|
|
87
|
+
this.changeDetector.detectChanges();
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
ngOnDestroy() {
|
|
91
|
+
this.focusSubscription.unsubscribe();
|
|
92
|
+
}
|
|
93
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SkipLinksContainerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
94
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: SkipLinksContainerComponent, isStandalone: true, selector: "df-skip-links-container", queries: [{ propertyName: "links", predicate: SkipLinkDirective }], ngImport: i0, template: "<section class=\"df-skip-links__section\">\n <div class=\"df-skip-links\">\n <div\n class=\"df-skip-links-wrap list-group\"\n [class.focus]=\"inFocus\"\n (blur)=\"inFocus=false\"\n >\n <ng-content></ng-content>\n </div>\n </div>\n</section>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
95
|
+
}
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SkipLinksContainerComponent, decorators: [{
|
|
97
|
+
type: Component,
|
|
98
|
+
args: [{ selector: 'df-skip-links-container', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<section class=\"df-skip-links__section\">\n <div class=\"df-skip-links\">\n <div\n class=\"df-skip-links-wrap list-group\"\n [class.focus]=\"inFocus\"\n (blur)=\"inFocus=false\"\n >\n <ng-content></ng-content>\n </div>\n </div>\n</section>\n" }]
|
|
99
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { links: [{
|
|
100
|
+
type: ContentChildren,
|
|
101
|
+
args: [SkipLinkDirective]
|
|
102
|
+
}] } });
|
|
103
|
+
|
|
104
|
+
class DfAccessibilityModule {
|
|
105
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfAccessibilityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
106
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfAccessibilityModule, imports: [SkipLinkDirective, SkipLinksContainerComponent], exports: [SkipLinkDirective, SkipLinksContainerComponent] }); }
|
|
107
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfAccessibilityModule }); }
|
|
108
|
+
}
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfAccessibilityModule, decorators: [{
|
|
110
|
+
type: NgModule,
|
|
111
|
+
args: [{
|
|
112
|
+
imports: [SkipLinkDirective, SkipLinksContainerComponent],
|
|
113
|
+
exports: [SkipLinkDirective, SkipLinksContainerComponent]
|
|
114
|
+
}]
|
|
115
|
+
}] });
|
|
14
116
|
|
|
15
117
|
class DfInsertIconDirective {
|
|
16
118
|
constructor(el, renderer) {
|
|
@@ -70,6 +172,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
70
172
|
}]
|
|
71
173
|
}] });
|
|
72
174
|
|
|
175
|
+
class DfToastModule {
|
|
176
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfToastModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
177
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfToastModule, imports: [DfInsertIconModule], exports: [NgbToastModule, DfInsertIconModule] }); }
|
|
178
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfToastModule, imports: [DfInsertIconModule, NgbToastModule, DfInsertIconModule] }); }
|
|
179
|
+
}
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfToastModule, decorators: [{
|
|
181
|
+
type: NgModule,
|
|
182
|
+
args: [{
|
|
183
|
+
imports: [DfInsertIconModule],
|
|
184
|
+
exports: [NgbToastModule, DfInsertIconModule]
|
|
185
|
+
}]
|
|
186
|
+
}] });
|
|
187
|
+
|
|
73
188
|
class DfAlertModule {
|
|
74
189
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
75
190
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfAlertModule, imports: [DfInsertIconModule], exports: [NgbAlertModule, DfInsertIconModule] }); }
|
|
@@ -539,242 +654,425 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
539
654
|
}]
|
|
540
655
|
}] });
|
|
541
656
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
657
|
+
// Default DF breakpoints
|
|
658
|
+
const DF_BREAKPOINTS_VAR_DEFAULT = {
|
|
659
|
+
xs: '--df-breakpoint-xs',
|
|
660
|
+
sm: '--df-breakpoint-sm',
|
|
661
|
+
md: '--df-breakpoint-md',
|
|
662
|
+
lg: '--df-breakpoint-lg',
|
|
663
|
+
xl: '--df-breakpoint-xl',
|
|
664
|
+
xxl: '--df-breakpoint-xxl',
|
|
665
|
+
xxxl: '--df-breakpoint-xxxl'
|
|
666
|
+
};
|
|
667
|
+
const BREAKPOINTS_VARS = new InjectionToken('Bootstrap Breakpoints', {
|
|
668
|
+
providedIn: 'root',
|
|
669
|
+
factory() {
|
|
670
|
+
return DF_BREAKPOINTS_VAR_DEFAULT;
|
|
550
671
|
}
|
|
551
|
-
|
|
552
|
-
|
|
672
|
+
});
|
|
673
|
+
class DfBreakpoints {
|
|
674
|
+
constructor(_breakPointsVar, platformID) {
|
|
675
|
+
this._breakPointsVar = _breakPointsVar;
|
|
676
|
+
this.platformID = platformID;
|
|
677
|
+
this._breakPoints$ = new BehaviorSubject(null);
|
|
678
|
+
this.initBreakpoints();
|
|
553
679
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
this.arrowLeftInnerHandler(event);
|
|
557
|
-
}
|
|
558
|
-
else {
|
|
559
|
-
this.arrowRightInnerHandler(event);
|
|
560
|
-
}
|
|
680
|
+
get breakPoints$() {
|
|
681
|
+
return this._breakPoints$.asObservable();
|
|
561
682
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
if (
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
683
|
+
initBreakpoints() {
|
|
684
|
+
let breakPoints = null;
|
|
685
|
+
if (isPlatformBrowser(this.platformID) && this._breakPoints$.value === null) {
|
|
686
|
+
// we are in a browser so CSS variable are accessible
|
|
687
|
+
// we init the BP only once
|
|
688
|
+
const styles = window.getComputedStyle(document.documentElement);
|
|
689
|
+
const bpArray = [];
|
|
690
|
+
for (const el of Object.keys(this._breakPointsVar)) {
|
|
691
|
+
const curValue = this._breakPointsVar[el];
|
|
692
|
+
const bpValue = Number.parseInt(styles.getPropertyValue(curValue), 10);
|
|
693
|
+
if (isNaN(bpValue)) {
|
|
694
|
+
// We should never enter here. Only if people did not put the correct list of CSS vars...
|
|
695
|
+
// Or if the CSS is not arrived yet.
|
|
696
|
+
// What should we do then?
|
|
697
|
+
// TODO init from the default list provided if we want to?
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
bpArray.push([el, bpValue]);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
breakPoints = this.generate(bpArray);
|
|
704
|
+
// In case the first page contains the directive and the CSS vars are not available
|
|
705
|
+
// We may need to launch a second init at load time.
|
|
706
|
+
if (Object.keys(breakPoints).length === 0) {
|
|
707
|
+
fromEvent(window, 'load')
|
|
708
|
+
.pipe(take(1))
|
|
709
|
+
.subscribe(() => {
|
|
710
|
+
// Init once as the service is available everywhere
|
|
711
|
+
// We do not check if the CSS variable are changing over time
|
|
712
|
+
// here onload the CSS var should be available
|
|
713
|
+
this.initBreakpoints();
|
|
714
|
+
});
|
|
568
715
|
}
|
|
569
716
|
}
|
|
717
|
+
this._breakPoints$.next(breakPoints);
|
|
570
718
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
if (currentPos !== -1) {
|
|
584
|
-
if (currentPos === listBadge.length - 1) {
|
|
585
|
-
this.select.focus();
|
|
719
|
+
// Utilities to use if you want to create your own queries with your values.
|
|
720
|
+
// sizes is an array of array BreakPoints with sizes[0] --> identifier of the BreakPoint
|
|
721
|
+
// sizes[1] px value of the BreakPoint
|
|
722
|
+
generate(sizes) {
|
|
723
|
+
sizes = sizes.sort((a, b) => a[1] - b[1]);
|
|
724
|
+
const dict = {};
|
|
725
|
+
for (let i = 0; i < sizes.length; i++) {
|
|
726
|
+
const name = sizes[i][0];
|
|
727
|
+
const min = sizes[i][1];
|
|
728
|
+
const max = i === sizes.length - 1 ? undefined : sizes[i + 1][1];
|
|
729
|
+
if (min === 0) {
|
|
730
|
+
dict[name] = `(max-width: ${max - 0.01}px)`;
|
|
586
731
|
}
|
|
587
|
-
else {
|
|
588
|
-
|
|
732
|
+
else if (max) {
|
|
733
|
+
dict[name] = `(max-width: ${max - 0.01}px) and (min-width: ${min}px)`;
|
|
589
734
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
event.target.nodeName === 'INPUT' &&
|
|
593
|
-
event.target.selectionStart === event.target.value.length) {
|
|
594
|
-
const clearEl = this.element.nativeElement.querySelector('.ng-clear-wrapper') ||
|
|
595
|
-
this.element.nativeElement.querySelector('.ng-clear');
|
|
596
|
-
if (clearEl) {
|
|
597
|
-
// Event if it can be added multiple time it is not an issue I think.
|
|
598
|
-
this.renderer.listen(clearEl, 'keydown.Enter', (e) => {
|
|
599
|
-
e.stopPropagation(); // kill the event to forbid default ng-select behavior (open the dropdown)
|
|
600
|
-
this.select.handleClearClick();
|
|
601
|
-
});
|
|
602
|
-
clearEl.setAttribute('tabindex', '1'); // To be able to focus the element in chrome
|
|
603
|
-
clearEl.focus();
|
|
735
|
+
else {
|
|
736
|
+
dict[name] = `(min-width: ${min}px)`;
|
|
604
737
|
}
|
|
605
738
|
}
|
|
739
|
+
return dict;
|
|
606
740
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
741
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfBreakpoints, deps: [{ token: BREAKPOINTS_VARS }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
742
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfBreakpoints, providedIn: 'root' }); }
|
|
743
|
+
}
|
|
744
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfBreakpoints, decorators: [{
|
|
745
|
+
type: Injectable,
|
|
746
|
+
args: [{ providedIn: 'root' }]
|
|
747
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
748
|
+
type: Inject,
|
|
749
|
+
args: [BREAKPOINTS_VARS]
|
|
750
|
+
}] }, { type: Object, decorators: [{
|
|
751
|
+
type: Inject,
|
|
752
|
+
args: [PLATFORM_ID]
|
|
753
|
+
}] }]; } });
|
|
754
|
+
class DfMediaQuery {
|
|
755
|
+
constructor(platformId) {
|
|
756
|
+
this._isBrowser = isPlatformBrowser(platformId);
|
|
757
|
+
}
|
|
758
|
+
notSupported(query) {
|
|
759
|
+
return { matches: false, media: query, addEventListener: () => { }, removeEventListener: () => { } };
|
|
760
|
+
}
|
|
761
|
+
matchMedia(query) {
|
|
762
|
+
if (this._isBrowser && window.matchMedia) {
|
|
763
|
+
return window.matchMedia(query);
|
|
764
|
+
}
|
|
765
|
+
else {
|
|
766
|
+
return this.notSupported(query);
|
|
622
767
|
}
|
|
623
768
|
}
|
|
624
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
625
|
-
static { this.ɵ
|
|
769
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaQuery, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
770
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaQuery, providedIn: 'root' }); }
|
|
626
771
|
}
|
|
627
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
628
|
-
type:
|
|
629
|
-
args: [{
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
type: HostListener,
|
|
640
|
-
args: ['keydown.Backspace', ['$event']]
|
|
641
|
-
}], handleKeyDownRight: [{
|
|
642
|
-
type: HostListener,
|
|
643
|
-
args: ['keydown.arrowRight', ['$event']]
|
|
644
|
-
}] } });
|
|
645
|
-
|
|
646
|
-
// Put to avoid opening of the select after removal. See why in file:
|
|
647
|
-
// https://github.com/ng-select/ng-select/blob/57c6671a972d23beddcca2b6acc9418544c17a2e/src/ng-select/ng-select.component.ts#L307
|
|
648
|
-
const NG_SELECT_CLASS_IDENTIFIER = 'ng-value-icon';
|
|
649
|
-
class DfManageBadgeEventsDirective {
|
|
650
|
-
constructor(renderer, element) {
|
|
651
|
-
this.renderer = renderer;
|
|
652
|
-
this.element = element;
|
|
653
|
-
this.tabindex = '-1';
|
|
654
|
-
this.renderer.addClass(this.element.nativeElement, DF_SELECT_CLASS);
|
|
655
|
-
this.renderer.addClass(this.element.nativeElement, NG_SELECT_CLASS_IDENTIFIER);
|
|
772
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaQuery, decorators: [{
|
|
773
|
+
type: Injectable,
|
|
774
|
+
args: [{ providedIn: 'root' }]
|
|
775
|
+
}], ctorParameters: function () { return [{ type: Object, decorators: [{
|
|
776
|
+
type: Inject,
|
|
777
|
+
args: [PLATFORM_ID]
|
|
778
|
+
}] }]; } });
|
|
779
|
+
class DfMediaObserver {
|
|
780
|
+
constructor(_mediaQuery) {
|
|
781
|
+
this._mediaQuery = _mediaQuery;
|
|
782
|
+
this._subscription = new Subscription();
|
|
783
|
+
this._queries = new Map();
|
|
656
784
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
785
|
+
/**
|
|
786
|
+
* Verifies if at least one of the provided media-queries is matching
|
|
787
|
+
* the current viewport
|
|
788
|
+
*/
|
|
789
|
+
matches(queries) {
|
|
790
|
+
queries = this._flattenQueries(Array.isArray(queries) ? queries : [queries]);
|
|
791
|
+
return queries.some(q => this._registerQuery(q).mediaQueryList.matches);
|
|
663
792
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
793
|
+
/**
|
|
794
|
+
* Produces an observable for a set of media-queries that will emit
|
|
795
|
+
* meta information for any changes of the given queries.
|
|
796
|
+
* @param value One or more media-queries to be observed.
|
|
797
|
+
* @returns A stream of matches meta object for the given media-queries.
|
|
798
|
+
*/
|
|
799
|
+
observe(queries) {
|
|
800
|
+
queries = this._flattenQueries(Array.isArray(queries) ? queries : [queries]);
|
|
801
|
+
return combineLatest(queries.map(q => this._registerQuery(q).mediaQueryList$)).pipe(map((events) => events.reduce((result, event) => {
|
|
802
|
+
result.matches = result.matches || event.matches;
|
|
803
|
+
result.breakpoints[event.media] = event.matches;
|
|
804
|
+
return result;
|
|
805
|
+
}, { matches: false, breakpoints: {} })));
|
|
667
806
|
}
|
|
668
|
-
|
|
669
|
-
this.
|
|
670
|
-
event.stopPropagation();
|
|
807
|
+
ngOnDestroy() {
|
|
808
|
+
this._subscription.unsubscribe();
|
|
671
809
|
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
event.stopPropagation();
|
|
810
|
+
_flattenQueries(queries) {
|
|
811
|
+
return queries.map(q => q.split(',')).reduce((flat, a) => flat.concat(a));
|
|
675
812
|
}
|
|
676
|
-
|
|
677
|
-
this.
|
|
678
|
-
|
|
813
|
+
_registerQuery(query) {
|
|
814
|
+
if (this._queries.has(query)) {
|
|
815
|
+
return this._queries.get(query);
|
|
816
|
+
}
|
|
817
|
+
const queryList = this._mediaQuery.matchMedia(query);
|
|
818
|
+
const queryList$ = new BehaviorSubject({
|
|
819
|
+
media: query,
|
|
820
|
+
matches: queryList.matches
|
|
821
|
+
});
|
|
822
|
+
this._subscription.add(fromEvent(queryList, 'change').subscribe((event) => {
|
|
823
|
+
queryList$.next(event);
|
|
824
|
+
}));
|
|
825
|
+
const meta = { mediaQueryList: queryList, mediaQueryList$: queryList$ };
|
|
826
|
+
this._queries.set(query, meta);
|
|
827
|
+
return meta;
|
|
679
828
|
}
|
|
680
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
681
|
-
static { this.ɵ
|
|
829
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaObserver, deps: [{ token: DfMediaQuery }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
830
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaObserver, providedIn: 'root' }); }
|
|
682
831
|
}
|
|
683
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
684
|
-
type:
|
|
685
|
-
args: [{
|
|
686
|
-
|
|
687
|
-
standalone: true
|
|
688
|
-
}]
|
|
689
|
-
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { dfManageBadgeEventsSelect: [{
|
|
690
|
-
type: Input
|
|
691
|
-
}], tabindex: [{
|
|
692
|
-
type: HostBinding,
|
|
693
|
-
args: ['attr.tabindex']
|
|
694
|
-
}], handleKeyDownBackspace: [{
|
|
695
|
-
type: HostListener,
|
|
696
|
-
args: ['keydown.Backspace', ['$event']]
|
|
697
|
-
}], handleClick: [{
|
|
698
|
-
type: HostListener,
|
|
699
|
-
args: ['click', ['$event']]
|
|
700
|
-
}], handleKeyDownEnter: [{
|
|
701
|
-
type: HostListener,
|
|
702
|
-
args: ['keydown.Enter', ['$event']]
|
|
703
|
-
}], handleKeyDownDelete: [{
|
|
704
|
-
type: HostListener,
|
|
705
|
-
args: ['keydown.Delete', ['$event']]
|
|
706
|
-
}] } });
|
|
832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaObserver, decorators: [{
|
|
833
|
+
type: Injectable,
|
|
834
|
+
args: [{ providedIn: 'root' }]
|
|
835
|
+
}], ctorParameters: function () { return [{ type: DfMediaQuery }]; } });
|
|
707
836
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
837
|
+
/**
|
|
838
|
+
* Services you can use to get indication about the current width screen of your application
|
|
839
|
+
* the matchMedia JS feature (https://developer.mozilla.org/fr/docs/Web/API/Window/matchMedia)
|
|
840
|
+
*/
|
|
841
|
+
class DfMedia {
|
|
842
|
+
constructor(mediaObserver, _breakPointsService) {
|
|
843
|
+
this.mediaObserver = mediaObserver;
|
|
844
|
+
this._breakPointsService = _breakPointsService;
|
|
714
845
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
846
|
+
initQueries(mediaOrBreakpoints, breakPoints = {}) {
|
|
847
|
+
const queries = [];
|
|
848
|
+
if (Array.isArray(mediaOrBreakpoints)) {
|
|
849
|
+
for (const el of mediaOrBreakpoints) {
|
|
850
|
+
queries.push(breakPoints[el] ? breakPoints[el] : el);
|
|
851
|
+
}
|
|
721
852
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
this.label = this.element.innerHTML;
|
|
725
|
-
if (this.canHighlight) {
|
|
726
|
-
this.highlightLabel();
|
|
853
|
+
else {
|
|
854
|
+
queries.push(breakPoints[mediaOrBreakpoints] ? breakPoints[mediaOrBreakpoints] : mediaOrBreakpoints);
|
|
727
855
|
}
|
|
856
|
+
return queries;
|
|
728
857
|
}
|
|
729
|
-
|
|
730
|
-
|
|
858
|
+
/**
|
|
859
|
+
* Getter to have the observable indication if you are or not in the current scope of your queries
|
|
860
|
+
* If one queries is matching result is `True` otherwise result is `False`
|
|
861
|
+
* @param mediaOrBreakpoints either media query string/Array of string or/and in case of BS usage a
|
|
862
|
+
* string/Array of string of the breakpoints name (sm...).
|
|
863
|
+
*/
|
|
864
|
+
getObservable(mediaOrBreakpoints) {
|
|
865
|
+
return this._breakPointsService.breakPoints$.pipe(map(breakpoints => {
|
|
866
|
+
return breakpoints ? this.initQueries(mediaOrBreakpoints, breakpoints) : this.initQueries(mediaOrBreakpoints);
|
|
867
|
+
}), switchMap(query => {
|
|
868
|
+
return this.mediaObserver.observe(query);
|
|
869
|
+
}), map(value => value.matches), distinctUntilChanged());
|
|
731
870
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
871
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMedia, deps: [{ token: DfMediaObserver }, { token: DfBreakpoints }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
872
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMedia, providedIn: 'root' }); }
|
|
873
|
+
}
|
|
874
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMedia, decorators: [{
|
|
875
|
+
type: Injectable,
|
|
876
|
+
args: [{ providedIn: 'root' }]
|
|
877
|
+
}], ctorParameters: function () { return [{ type: DfMediaObserver }, { type: DfBreakpoints }]; } });
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Directive using the matchMedia JS feature (https://developer.mozilla.org/fr/docs/Web/API/Window/matchMedia)
|
|
881
|
+
* to be able to add or remove an element like ngIf is doing.
|
|
882
|
+
* Import DfMediaModule from DF to use all media elements provided
|
|
883
|
+
*/
|
|
884
|
+
class DfIfMediaDirective {
|
|
885
|
+
/**
|
|
886
|
+
* Input of the directive
|
|
887
|
+
* @param mediaOrBreakpoints either media query string/Array of string or in case of BS usage a
|
|
888
|
+
* string/Array of string of the breakpoints name (sm...).
|
|
889
|
+
*/
|
|
890
|
+
set dfIfMedia(mediaOrBreakpoints) {
|
|
891
|
+
this._subscription.add(this._mediaService.getObservable(mediaOrBreakpoints).subscribe((isValidated) => {
|
|
892
|
+
this.update(isValidated);
|
|
893
|
+
}));
|
|
741
894
|
}
|
|
742
|
-
|
|
743
|
-
|
|
895
|
+
constructor(_viewContainerRef, _template, _mediaService) {
|
|
896
|
+
this._viewContainerRef = _viewContainerRef;
|
|
897
|
+
this._template = _template;
|
|
898
|
+
this._mediaService = _mediaService;
|
|
899
|
+
this._viewInstance = null;
|
|
900
|
+
this._subscription = new Subscription();
|
|
744
901
|
}
|
|
745
|
-
|
|
746
|
-
|
|
902
|
+
ngOnDestroy() {
|
|
903
|
+
if (this._viewInstance) {
|
|
904
|
+
this._viewContainerRef.clear();
|
|
905
|
+
}
|
|
906
|
+
this._subscription.unsubscribe();
|
|
747
907
|
}
|
|
748
|
-
|
|
749
|
-
|
|
908
|
+
update(matches) {
|
|
909
|
+
if (matches && this._viewInstance === null) {
|
|
910
|
+
this._viewInstance = this._viewContainerRef.createEmbeddedView(this._template);
|
|
911
|
+
}
|
|
912
|
+
else if (!matches) {
|
|
913
|
+
this._viewContainerRef.clear();
|
|
914
|
+
this._viewInstance = null;
|
|
915
|
+
}
|
|
750
916
|
}
|
|
751
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
752
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type:
|
|
917
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfIfMediaDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: DfMedia }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
918
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfIfMediaDirective, isStandalone: true, selector: "[dfIfMedia]", inputs: { dfIfMedia: "dfIfMedia" }, ngImport: i0 }); }
|
|
753
919
|
}
|
|
754
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
920
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfIfMediaDirective, decorators: [{
|
|
755
921
|
type: Directive,
|
|
922
|
+
args: [{ selector: '[dfIfMedia]', standalone: true }]
|
|
923
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: DfMedia }]; }, propDecorators: { dfIfMedia: [{
|
|
924
|
+
type: Input
|
|
925
|
+
}] } });
|
|
926
|
+
|
|
927
|
+
class DfMediaModule {
|
|
928
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
929
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfMediaModule, imports: [DfIfMediaDirective], exports: [DfIfMediaDirective] }); }
|
|
930
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaModule }); }
|
|
931
|
+
}
|
|
932
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaModule, decorators: [{
|
|
933
|
+
type: NgModule,
|
|
756
934
|
args: [{
|
|
757
|
-
|
|
758
|
-
|
|
935
|
+
imports: [DfIfMediaDirective],
|
|
936
|
+
exports: [DfIfMediaDirective]
|
|
759
937
|
}]
|
|
760
|
-
}]
|
|
761
|
-
type: Input,
|
|
762
|
-
args: ['dfOptionHighlight']
|
|
763
|
-
}] } });
|
|
938
|
+
}] });
|
|
764
939
|
|
|
765
|
-
class
|
|
766
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
767
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type:
|
|
768
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
940
|
+
class DfFooterModule {
|
|
941
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfFooterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
942
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfFooterModule, imports: [DfMediaModule, NgbAccordionModule], exports: [DfMediaModule, NgbAccordionModule] }); }
|
|
943
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfFooterModule, imports: [DfMediaModule, NgbAccordionModule, DfMediaModule, NgbAccordionModule] }); }
|
|
769
944
|
}
|
|
770
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfFooterModule, decorators: [{
|
|
771
946
|
type: NgModule,
|
|
772
947
|
args: [{
|
|
773
|
-
imports: [
|
|
774
|
-
exports: [
|
|
948
|
+
imports: [DfMediaModule, NgbAccordionModule],
|
|
949
|
+
exports: [DfMediaModule, NgbAccordionModule]
|
|
950
|
+
}]
|
|
951
|
+
}] });
|
|
952
|
+
|
|
953
|
+
class DfAmadeusIconComponent {
|
|
954
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfAmadeusIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
955
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfAmadeusIconComponent, isStandalone: true, selector: "df-amadeus-icon", ngImport: i0, template: `
|
|
956
|
+
<svg
|
|
957
|
+
version="1.1"
|
|
958
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
959
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
960
|
+
x="0px"
|
|
961
|
+
y="0px"
|
|
962
|
+
viewBox="0 0 510.2 67.9"
|
|
963
|
+
style="enable-background:new 0 0 510.2 67.9;"
|
|
964
|
+
xml:space="preserve"
|
|
965
|
+
>
|
|
966
|
+
<g id="Layer_2"></g>
|
|
967
|
+
<g id="Layer_1">
|
|
968
|
+
<path
|
|
969
|
+
d="M269.7,0c-8.3,0-19.8,1.4-26.9,4v61.9c5.8,1.2,16.8,2,24.4,2c26,0,36.1-10.2,36.1-34.4C303.4,12.5,290.5,0,269.7,0
|
|
970
|
+
M257.5,12.6c2.4-0.5,7-1.1,11.6-1.1c10.6,0,18.8,5.9,18.8,22c0,15.5-4.1,22.9-20.2,22.9c-5.2,0-10.3-0.8-10.3-0.8V12.6z
|
|
971
|
+
M461.5,65.5c0,0,9,2.4,21.7,2.4c12,0,27-4.1,27-20.3c0-10.6-7.8-15.1-20.5-19.7c-6.9-2.5-12.7-4.8-12.7-9.5
|
|
972
|
+
c0-2.3,1.7-6.7,10.5-6.7c8.2,0,16.6,3.8,16.6,3.8l3.7-10.8C505.2,3.4,497.2,0,486.1,0c-12.1,0-23.8,6.4-23.8,19.3
|
|
973
|
+
c0,13.3,12.1,17.3,21.5,20.5c6.4,2.2,11.8,4.4,11.8,8.7c0,4.1-2.3,7.7-13.1,7.7c-8.9,0-18.3-2-18.3-2L461.5,65.5z M429.6,50.3
|
|
974
|
+
c-3.5,1.7-11,4.5-17.9,4.5c-10,0-11.7-4.5-11.7-14.9V0.6h-2.2c-3.3,0-10.6,0.6-12.4,0.9v40.3c0,17.6,4.3,26,22.2,26
|
|
975
|
+
c13.7,0,21.7-5.3,22.2-5.3c0.2,0,4.9,2.9,14.3,2.9v-64c-1-0.2-8.1-0.9-11.7-0.9h-2.9V50.3z M198.5,0c-13,0-23.2,3.2-27.1,5.2
|
|
976
|
+
l3.1,10.9c0,0,10-3.6,19.8-3.6c8.4,0,12.7,2.4,12.7,10.6v4.7h-12.7c-21.6,0-28,9.9-28,20.8c0,14.5,11.3,19.1,21.6,19.1
|
|
977
|
+
c12,0,18.9-5,19.8-5c0.7,0,3.1,2.6,14,2.6V19.3C221.7,5.5,213.1,0,198.5,0 M207.1,52.7c-3.1,1.2-10.7,3.7-16.2,3.7
|
|
978
|
+
c-6,0-10.6-2.1-10.6-8.7c0-5.7,3.1-9,11.4-9.3l15.4-0.6V52.7z M32.2,0C19.2,0,9,3.2,5.1,5.2l3.1,10.9c0,0,10-3.6,19.8-3.6
|
|
979
|
+
c8.4,0,12.7,2.4,12.7,10.6v4.7H28c-21.6,0-28,9.9-28,20.8c0,14.5,11.3,19.1,21.6,19.1c12,0,18.9-5,19.8-5c0.7,0,3.1,2.6,14,2.6
|
|
980
|
+
V19.3C55.4,5.5,46.8,0,32.2,0 M40.9,52.7c-3.1,1.2-10.7,3.7-16.2,3.7c-6,0-10.6-2.1-10.6-8.7c0-5.7,3.1-9,11.4-9.3l15.4-0.6V52.7z
|
|
981
|
+
M114,39c-0.4,0.9-0.8,2.7-1.1,3.8c-0.3-1-0.8-2.8-1.1-3.8L99,6.1C96.8,0.7,93.4,0,87.2,0c-2.2,0-6.6,0.3-6.6,0.3L74,66.9h14.6
|
|
982
|
+
l3.2-44.7l13.9,33.8c1,2.6,3.1,3.7,7.3,3.7c4.1,0,6.2-1,7.3-3.7L134,22.2l3.2,44.7h14.6l-6.6-66.6c0,0-4.4-0.3-6.6-0.3
|
|
983
|
+
c-6.2,0-9.6,0.7-11.8,6.1L114,39z M320.8,64.7c0,0,11.2,3.1,25.5,3.1c15.3,0,22.3-1.7,22.3-1.7V54.8c0,0-7.6,1.5-18.3,1.5
|
|
984
|
+
c-9.3,0-15.1-1.2-15.1-1.2v-16h28.9V27.8h-28.9V12.5c0,0,5.7-1,14.1-1c9.5,0,18.1,1.5,18.1,1.5V1.6c0,0-7.5-1.6-19.8-1.6
|
|
985
|
+
c-16.3,0-27,2.9-27,2.9V64.7z"
|
|
986
|
+
/>
|
|
987
|
+
</g>
|
|
988
|
+
</svg>
|
|
989
|
+
`, isInline: true, styles: [":root{--df-navbar-height: 3.5rem}:host{min-width:60px}:host svg{margin:10%}:host.icon-primary{fill:var(--df-primary-500)}:host.icon-white{fill:#fff}\n"] }); }
|
|
990
|
+
}
|
|
991
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfAmadeusIconComponent, decorators: [{
|
|
992
|
+
type: Component,
|
|
993
|
+
args: [{ selector: 'df-amadeus-icon', template: `
|
|
994
|
+
<svg
|
|
995
|
+
version="1.1"
|
|
996
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
997
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
998
|
+
x="0px"
|
|
999
|
+
y="0px"
|
|
1000
|
+
viewBox="0 0 510.2 67.9"
|
|
1001
|
+
style="enable-background:new 0 0 510.2 67.9;"
|
|
1002
|
+
xml:space="preserve"
|
|
1003
|
+
>
|
|
1004
|
+
<g id="Layer_2"></g>
|
|
1005
|
+
<g id="Layer_1">
|
|
1006
|
+
<path
|
|
1007
|
+
d="M269.7,0c-8.3,0-19.8,1.4-26.9,4v61.9c5.8,1.2,16.8,2,24.4,2c26,0,36.1-10.2,36.1-34.4C303.4,12.5,290.5,0,269.7,0
|
|
1008
|
+
M257.5,12.6c2.4-0.5,7-1.1,11.6-1.1c10.6,0,18.8,5.9,18.8,22c0,15.5-4.1,22.9-20.2,22.9c-5.2,0-10.3-0.8-10.3-0.8V12.6z
|
|
1009
|
+
M461.5,65.5c0,0,9,2.4,21.7,2.4c12,0,27-4.1,27-20.3c0-10.6-7.8-15.1-20.5-19.7c-6.9-2.5-12.7-4.8-12.7-9.5
|
|
1010
|
+
c0-2.3,1.7-6.7,10.5-6.7c8.2,0,16.6,3.8,16.6,3.8l3.7-10.8C505.2,3.4,497.2,0,486.1,0c-12.1,0-23.8,6.4-23.8,19.3
|
|
1011
|
+
c0,13.3,12.1,17.3,21.5,20.5c6.4,2.2,11.8,4.4,11.8,8.7c0,4.1-2.3,7.7-13.1,7.7c-8.9,0-18.3-2-18.3-2L461.5,65.5z M429.6,50.3
|
|
1012
|
+
c-3.5,1.7-11,4.5-17.9,4.5c-10,0-11.7-4.5-11.7-14.9V0.6h-2.2c-3.3,0-10.6,0.6-12.4,0.9v40.3c0,17.6,4.3,26,22.2,26
|
|
1013
|
+
c13.7,0,21.7-5.3,22.2-5.3c0.2,0,4.9,2.9,14.3,2.9v-64c-1-0.2-8.1-0.9-11.7-0.9h-2.9V50.3z M198.5,0c-13,0-23.2,3.2-27.1,5.2
|
|
1014
|
+
l3.1,10.9c0,0,10-3.6,19.8-3.6c8.4,0,12.7,2.4,12.7,10.6v4.7h-12.7c-21.6,0-28,9.9-28,20.8c0,14.5,11.3,19.1,21.6,19.1
|
|
1015
|
+
c12,0,18.9-5,19.8-5c0.7,0,3.1,2.6,14,2.6V19.3C221.7,5.5,213.1,0,198.5,0 M207.1,52.7c-3.1,1.2-10.7,3.7-16.2,3.7
|
|
1016
|
+
c-6,0-10.6-2.1-10.6-8.7c0-5.7,3.1-9,11.4-9.3l15.4-0.6V52.7z M32.2,0C19.2,0,9,3.2,5.1,5.2l3.1,10.9c0,0,10-3.6,19.8-3.6
|
|
1017
|
+
c8.4,0,12.7,2.4,12.7,10.6v4.7H28c-21.6,0-28,9.9-28,20.8c0,14.5,11.3,19.1,21.6,19.1c12,0,18.9-5,19.8-5c0.7,0,3.1,2.6,14,2.6
|
|
1018
|
+
V19.3C55.4,5.5,46.8,0,32.2,0 M40.9,52.7c-3.1,1.2-10.7,3.7-16.2,3.7c-6,0-10.6-2.1-10.6-8.7c0-5.7,3.1-9,11.4-9.3l15.4-0.6V52.7z
|
|
1019
|
+
M114,39c-0.4,0.9-0.8,2.7-1.1,3.8c-0.3-1-0.8-2.8-1.1-3.8L99,6.1C96.8,0.7,93.4,0,87.2,0c-2.2,0-6.6,0.3-6.6,0.3L74,66.9h14.6
|
|
1020
|
+
l3.2-44.7l13.9,33.8c1,2.6,3.1,3.7,7.3,3.7c4.1,0,6.2-1,7.3-3.7L134,22.2l3.2,44.7h14.6l-6.6-66.6c0,0-4.4-0.3-6.6-0.3
|
|
1021
|
+
c-6.2,0-9.6,0.7-11.8,6.1L114,39z M320.8,64.7c0,0,11.2,3.1,25.5,3.1c15.3,0,22.3-1.7,22.3-1.7V54.8c0,0-7.6,1.5-18.3,1.5
|
|
1022
|
+
c-9.3,0-15.1-1.2-15.1-1.2v-16h28.9V27.8h-28.9V12.5c0,0,5.7-1,14.1-1c9.5,0,18.1,1.5,18.1,1.5V1.6c0,0-7.5-1.6-19.8-1.6
|
|
1023
|
+
c-16.3,0-27,2.9-27,2.9V64.7z"
|
|
1024
|
+
/>
|
|
1025
|
+
</g>
|
|
1026
|
+
</svg>
|
|
1027
|
+
`, standalone: true, styles: [":root{--df-navbar-height: 3.5rem}:host{min-width:60px}:host svg{margin:10%}:host.icon-primary{fill:var(--df-primary-500)}:host.icon-white{fill:#fff}\n"] }]
|
|
1028
|
+
}] });
|
|
1029
|
+
|
|
1030
|
+
class DfIconModule {
|
|
1031
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfIconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1032
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfIconModule, imports: [DfAmadeusIconComponent], exports: [DfAmadeusIconComponent] }); }
|
|
1033
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfIconModule }); }
|
|
1034
|
+
}
|
|
1035
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfIconModule, decorators: [{
|
|
1036
|
+
type: NgModule,
|
|
1037
|
+
args: [{
|
|
1038
|
+
imports: [DfAmadeusIconComponent],
|
|
1039
|
+
exports: [DfAmadeusIconComponent]
|
|
775
1040
|
}]
|
|
776
1041
|
}] });
|
|
777
1042
|
|
|
1043
|
+
class DfModalService {
|
|
1044
|
+
constructor(modalService, rendererFactory) {
|
|
1045
|
+
this.modalService = modalService;
|
|
1046
|
+
this.rendererFactory = rendererFactory;
|
|
1047
|
+
this.renderer = this.rendererFactory.createRenderer(null, null);
|
|
1048
|
+
}
|
|
1049
|
+
open(content, options) {
|
|
1050
|
+
let modalRef;
|
|
1051
|
+
if (options && options.container) {
|
|
1052
|
+
modalRef = this.modalService.open(content, options);
|
|
1053
|
+
}
|
|
1054
|
+
else {
|
|
1055
|
+
modalRef = this.modalService.open(content, Object.assign({}, { container: 'body' }, options));
|
|
1056
|
+
}
|
|
1057
|
+
// we add the 'df-modal-open' class to the body when the modal is open. We remove it when the modal is closed/dismissed
|
|
1058
|
+
this.renderer.addClass(document.body, 'df-modal-open');
|
|
1059
|
+
modalRef.result.then(() => {
|
|
1060
|
+
this.renderer.removeClass(document.body, 'df-modal-open');
|
|
1061
|
+
}, () => {
|
|
1062
|
+
this.renderer.removeClass(document.body, 'df-modal-open');
|
|
1063
|
+
});
|
|
1064
|
+
return modalRef;
|
|
1065
|
+
}
|
|
1066
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfModalService, deps: [{ token: i1.NgbModal }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1067
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfModalService, providedIn: 'root' }); }
|
|
1068
|
+
}
|
|
1069
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfModalService, decorators: [{
|
|
1070
|
+
type: Injectable,
|
|
1071
|
+
args: [{
|
|
1072
|
+
providedIn: 'root'
|
|
1073
|
+
}]
|
|
1074
|
+
}], ctorParameters: function () { return [{ type: i1.NgbModal }, { type: i0.RendererFactory2 }]; } });
|
|
1075
|
+
|
|
778
1076
|
class DfPopoverConfig extends NgbPopoverConfig {
|
|
779
1077
|
constructor(ngbConfig) {
|
|
780
1078
|
super(ngbConfig || { animation: true });
|
|
@@ -929,7 +1227,7 @@ class DfProgressbarComponent {
|
|
|
929
1227
|
this.maxValue = 100;
|
|
930
1228
|
}
|
|
931
1229
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
932
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfProgressbarComponent, isStandalone: true, selector: "df-progressbar", inputs: { infiniteAnimation: "infiniteAnimation", value: "value", maxValue: "maxValue", text: "text", start$: "start$", end$: "end$", ariaLabelledBy: "ariaLabelledBy", ariaLabel: "ariaLabel" }, outputs: { percentageValueChange: "percentageValueChange" }, ngImport: i0, template: "<ng-container *ngIf=\"displayProgressBar\">\n <div *ngIf=\"computedText\" class=\"progressbar-text mb-2\">{{ computedText }}</div>\n <div class=\"progress\">\n <ng-container *ngIf=\"infiniteAnimation; else withValue\">\n <div\n class=\"progress-bar infinite-animation\"\n role=\"progressbar\"\n aria-valuetext=\"indeterminate\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-label]=\"!ariaLabelledBy && ariaLabel ? ariaLabel : null\"\n ></div>\n </ng-container>\n <ng-template #withValue>\n <div\n [style.width.%]=\"percentageValue\"\n class=\"progress-bar\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"value\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"maxValue\"\n [attr.aria-valuetext]=\"computedText ? computedText : null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-label]=\"!ariaLabelledBy && ariaLabel ? ariaLabel : null\"\n ></div>\n </ng-template>\n </div>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$
|
|
1230
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfProgressbarComponent, isStandalone: true, selector: "df-progressbar", inputs: { infiniteAnimation: "infiniteAnimation", value: "value", maxValue: "maxValue", text: "text", start$: "start$", end$: "end$", ariaLabelledBy: "ariaLabelledBy", ariaLabel: "ariaLabel" }, outputs: { percentageValueChange: "percentageValueChange" }, ngImport: i0, template: "<ng-container *ngIf=\"displayProgressBar\">\n <div *ngIf=\"computedText\" class=\"progressbar-text mb-2\">{{ computedText }}</div>\n <div class=\"progress\">\n <ng-container *ngIf=\"infiniteAnimation; else withValue\">\n <div\n class=\"progress-bar infinite-animation\"\n role=\"progressbar\"\n aria-valuetext=\"indeterminate\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-label]=\"!ariaLabelledBy && ariaLabel ? ariaLabel : null\"\n ></div>\n </ng-container>\n <ng-template #withValue>\n <div\n [style.width.%]=\"percentageValue\"\n class=\"progress-bar\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"value\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"maxValue\"\n [attr.aria-valuetext]=\"computedText ? computedText : null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-label]=\"!ariaLabelledBy && ariaLabel ? ariaLabel : null\"\n ></div>\n </ng-template>\n </div>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
933
1231
|
}
|
|
934
1232
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressbarComponent, decorators: [{
|
|
935
1233
|
type: Component,
|
|
@@ -967,195 +1265,437 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
967
1265
|
}]
|
|
968
1266
|
}] });
|
|
969
1267
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1268
|
+
var DfProgressIndicatorContentType;
|
|
1269
|
+
(function (DfProgressIndicatorContentType) {
|
|
1270
|
+
DfProgressIndicatorContentType["SPINNER"] = "spinner";
|
|
1271
|
+
DfProgressIndicatorContentType["PROGRESSBAR"] = "progressbar";
|
|
1272
|
+
})(DfProgressIndicatorContentType || (DfProgressIndicatorContentType = {}));
|
|
1273
|
+
class DfProgressIndicatorContentSpinner {
|
|
1274
|
+
constructor(spinnerInput) {
|
|
1275
|
+
this.type = DfProgressIndicatorContentType.SPINNER;
|
|
1276
|
+
this.spinnerInput = spinnerInput;
|
|
973
1277
|
}
|
|
974
|
-
|
|
975
|
-
|
|
1278
|
+
}
|
|
1279
|
+
class DfProgressIndicatorContentProgressBar {
|
|
1280
|
+
constructor(progressBarInput, position) {
|
|
1281
|
+
this.type = DfProgressIndicatorContentType.PROGRESSBAR;
|
|
1282
|
+
this.progressBarInput = progressBarInput;
|
|
1283
|
+
this.position = position || DfProgressIndicatorContentPosition.TOP;
|
|
976
1284
|
}
|
|
977
|
-
|
|
978
|
-
|
|
1285
|
+
}
|
|
1286
|
+
var DfProgressIndicatorContentPosition;
|
|
1287
|
+
(function (DfProgressIndicatorContentPosition) {
|
|
1288
|
+
DfProgressIndicatorContentPosition["TOP"] = "top";
|
|
1289
|
+
DfProgressIndicatorContentPosition["BOTTOM"] = "bottom";
|
|
1290
|
+
DfProgressIndicatorContentPosition["CENTERED"] = "centered";
|
|
1291
|
+
})(DfProgressIndicatorContentPosition || (DfProgressIndicatorContentPosition = {}));
|
|
1292
|
+
|
|
1293
|
+
class DfProgressIndicatorContainerComponent {
|
|
1294
|
+
constructor() {
|
|
1295
|
+
this.DEFAULT_CLASS_POSITION = 'df-progressindicator-centered';
|
|
1296
|
+
this.positionClass = this.DEFAULT_CLASS_POSITION;
|
|
979
1297
|
}
|
|
980
|
-
|
|
981
|
-
this.
|
|
982
|
-
this.document = document;
|
|
983
|
-
this.class = 'list-group-item list-group-item-action';
|
|
984
|
-
this.inFocus = new EventEmitter();
|
|
1298
|
+
get classes() {
|
|
1299
|
+
return `df-progressindicator-container ${this.containerClass || ''} ${this.positionClass}`;
|
|
985
1300
|
}
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1301
|
+
set position(newPosition) {
|
|
1302
|
+
switch (newPosition) {
|
|
1303
|
+
case DfProgressIndicatorContentPosition.TOP:
|
|
1304
|
+
this.positionClass = 'df-progressindicator-top';
|
|
1305
|
+
break;
|
|
1306
|
+
case DfProgressIndicatorContentPosition.BOTTOM:
|
|
1307
|
+
this.positionClass = 'df-progressindicator-bottom';
|
|
1308
|
+
break;
|
|
1309
|
+
default:
|
|
1310
|
+
this.positionClass = this.DEFAULT_CLASS_POSITION;
|
|
995
1311
|
}
|
|
996
|
-
|
|
997
|
-
const target = this.document.getElementById(id);
|
|
998
|
-
if (target) {
|
|
999
|
-
target.focus();
|
|
1000
|
-
this.onBlur();
|
|
1001
|
-
}
|
|
1002
|
-
});
|
|
1312
|
+
this._position = newPosition;
|
|
1003
1313
|
}
|
|
1004
|
-
|
|
1005
|
-
|
|
1314
|
+
get position() {
|
|
1315
|
+
return this._position;
|
|
1316
|
+
}
|
|
1317
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1318
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfProgressIndicatorContainerComponent, isStandalone: true, selector: "df-progressindicator-container", inputs: { containerClass: "containerClass", position: "position" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
|
|
1319
|
+
<ng-content></ng-content>
|
|
1320
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1006
1321
|
}
|
|
1007
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
1008
|
-
type:
|
|
1322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorContainerComponent, decorators: [{
|
|
1323
|
+
type: Component,
|
|
1009
1324
|
args: [{
|
|
1010
|
-
selector: '
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
type:
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
}],
|
|
1024
|
-
type:
|
|
1025
|
-
args: ['click']
|
|
1026
|
-
}], onBlur: [{
|
|
1027
|
-
type: HostListener,
|
|
1028
|
-
args: ['blur']
|
|
1325
|
+
selector: 'df-progressindicator-container',
|
|
1326
|
+
encapsulation: ViewEncapsulation.None,
|
|
1327
|
+
template: `
|
|
1328
|
+
<ng-content></ng-content>
|
|
1329
|
+
`,
|
|
1330
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1331
|
+
standalone: true
|
|
1332
|
+
}]
|
|
1333
|
+
}], propDecorators: { classes: [{
|
|
1334
|
+
type: HostBinding,
|
|
1335
|
+
args: ['class']
|
|
1336
|
+
}], containerClass: [{
|
|
1337
|
+
type: Input
|
|
1338
|
+
}], position: [{
|
|
1339
|
+
type: Input
|
|
1029
1340
|
}] } });
|
|
1030
1341
|
|
|
1031
|
-
class
|
|
1032
|
-
constructor(
|
|
1033
|
-
this.
|
|
1034
|
-
this.
|
|
1035
|
-
}
|
|
1036
|
-
ngAfterContentInit() {
|
|
1037
|
-
if (!this.links.length) {
|
|
1038
|
-
return;
|
|
1039
|
-
}
|
|
1040
|
-
this.focusSubscription = merge(...this.links.map((link) => link.inFocus)).subscribe((focus) => {
|
|
1041
|
-
this.inFocus = focus;
|
|
1042
|
-
this.changeDetector.detectChanges();
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
ngOnDestroy() {
|
|
1046
|
-
this.focusSubscription.unsubscribe();
|
|
1342
|
+
class DfDefaultSpinnerComponent {
|
|
1343
|
+
constructor() {
|
|
1344
|
+
this.isGlobalSpinner = false;
|
|
1345
|
+
this.contentClass = 'spinner-border text-primary';
|
|
1047
1346
|
}
|
|
1048
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
1049
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type:
|
|
1347
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfDefaultSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1348
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfDefaultSpinnerComponent, isStandalone: true, selector: "df-default-spinner", inputs: { isGlobalSpinner: "isGlobalSpinner", contentClass: "contentClass", ariaLabel: "ariaLabel" }, ngImport: i0, template: "<div [ngClass]=\"contentClass\" [attr.role]=\"isGlobalSpinner ? 'alert' : 'status'\">\n <span class=\"visually-hidden\">\n <ng-container *ngIf=\"ariaLabel; else defaultAriaLabel\">{{ ariaLabel }}</ng-container>\n </span>\n</div>\n\n<ng-template #defaultAriaLabel>\n <ng-container i18n=\"@@df.progressindicator.default.spinner.ariaLabel\">Loading...</ng-container>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1050
1349
|
}
|
|
1051
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
1350
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfDefaultSpinnerComponent, decorators: [{
|
|
1052
1351
|
type: Component,
|
|
1053
|
-
args: [{ selector: 'df-
|
|
1054
|
-
}],
|
|
1055
|
-
type:
|
|
1056
|
-
|
|
1352
|
+
args: [{ selector: 'df-default-spinner', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [CommonModule], template: "<div [ngClass]=\"contentClass\" [attr.role]=\"isGlobalSpinner ? 'alert' : 'status'\">\n <span class=\"visually-hidden\">\n <ng-container *ngIf=\"ariaLabel; else defaultAriaLabel\">{{ ariaLabel }}</ng-container>\n </span>\n</div>\n\n<ng-template #defaultAriaLabel>\n <ng-container i18n=\"@@df.progressindicator.default.spinner.ariaLabel\">Loading...</ng-container>\n</ng-template>\n" }]
|
|
1353
|
+
}], propDecorators: { isGlobalSpinner: [{
|
|
1354
|
+
type: Input
|
|
1355
|
+
}], contentClass: [{
|
|
1356
|
+
type: Input
|
|
1357
|
+
}], ariaLabel: [{
|
|
1358
|
+
type: Input
|
|
1057
1359
|
}] } });
|
|
1058
1360
|
|
|
1059
|
-
class
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1361
|
+
class DfProgressIndicatorBackdropComponent {
|
|
1362
|
+
constructor() {
|
|
1363
|
+
this.isGlobalBackdrop = true;
|
|
1364
|
+
}
|
|
1365
|
+
get classes() {
|
|
1366
|
+
return `df-progressindicator-backdrop ${this.backdropClass || ''} ${this.isGlobalBackdrop ? 'df-progressindicator-backdrop-global' : 'df-progressindicator-backdrop-contextual'}`;
|
|
1367
|
+
}
|
|
1368
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1369
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfProgressIndicatorBackdropComponent, isStandalone: true, selector: "df-progressindicator-backdrop", inputs: { backdropClass: "backdropClass", isGlobalBackdrop: "isGlobalBackdrop" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1063
1370
|
}
|
|
1064
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
1065
|
-
type:
|
|
1371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorBackdropComponent, decorators: [{
|
|
1372
|
+
type: Component,
|
|
1066
1373
|
args: [{
|
|
1067
|
-
|
|
1068
|
-
|
|
1374
|
+
selector: 'df-progressindicator-backdrop',
|
|
1375
|
+
template: '',
|
|
1376
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1377
|
+
standalone: true
|
|
1069
1378
|
}]
|
|
1070
|
-
}]
|
|
1379
|
+
}], propDecorators: { classes: [{
|
|
1380
|
+
type: HostBinding,
|
|
1381
|
+
args: ['class']
|
|
1382
|
+
}], backdropClass: [{
|
|
1383
|
+
type: Input
|
|
1384
|
+
}], isGlobalBackdrop: [{
|
|
1385
|
+
type: Input
|
|
1386
|
+
}] } });
|
|
1071
1387
|
|
|
1072
|
-
class
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1388
|
+
class DfProgressIndicatorRef {
|
|
1389
|
+
constructor(containerRef, contentRef, backdropRef) {
|
|
1390
|
+
this.containerRef = containerRef;
|
|
1391
|
+
this.contentRef = contentRef;
|
|
1392
|
+
this.backdropRef = backdropRef;
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
const noop$1 = () => { };
|
|
1397
|
+
/**
|
|
1398
|
+
* Utility to handle the scrollbar.
|
|
1399
|
+
*
|
|
1400
|
+
* It allows to compensate the lack of a vertical scrollbar by adding an
|
|
1401
|
+
* equivalent padding on the right of the body, and to remove this compensation.
|
|
1402
|
+
*
|
|
1403
|
+
* It is a copy of https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/util/scrollbar.ts
|
|
1404
|
+
*/
|
|
1405
|
+
class ScrollBar {
|
|
1406
|
+
constructor(_document) {
|
|
1407
|
+
this._document = _document;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* To be called right before a potential vertical scrollbar would be removed:
|
|
1411
|
+
*
|
|
1412
|
+
* - if there was a scrollbar, adds some compensation padding to the body
|
|
1413
|
+
* to keep the same layout as when the scrollbar is there
|
|
1414
|
+
* - if there was none, there is nothing to do
|
|
1415
|
+
*
|
|
1416
|
+
* @return a callback used to revert the compensation (noop if there was none,
|
|
1417
|
+
* otherwise a function removing the padding)
|
|
1418
|
+
*/
|
|
1419
|
+
compensate() {
|
|
1420
|
+
const width = this._getWidth();
|
|
1421
|
+
return !this._isPresent(width) ? noop$1 : this._adjustBody(width);
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* Adds a padding of the given width on the right of the body.
|
|
1425
|
+
*
|
|
1426
|
+
* @return a callback used to revert the padding to its previous value
|
|
1427
|
+
*/
|
|
1428
|
+
_adjustBody(scrollbarWidth) {
|
|
1429
|
+
const body = this._document.body;
|
|
1430
|
+
const userSetPaddingStyle = body.style.paddingRight;
|
|
1431
|
+
const paddingRight = 'padding-right';
|
|
1432
|
+
const actualPadding = parseFloat(window.getComputedStyle(body)[paddingRight]);
|
|
1433
|
+
body.style[paddingRight] = `${actualPadding + scrollbarWidth}px`;
|
|
1434
|
+
return () => (body.style[paddingRight] = userSetPaddingStyle);
|
|
1435
|
+
}
|
|
1436
|
+
/**
|
|
1437
|
+
* Tells whether a scrollbar is currently present on the body.
|
|
1438
|
+
*
|
|
1439
|
+
* @return true if scrollbar is present, false otherwise
|
|
1440
|
+
*/
|
|
1441
|
+
_isPresent(scrollbarWidth) {
|
|
1442
|
+
const rect = this._document.body.getBoundingClientRect();
|
|
1443
|
+
const bodyToViewportGap = window.innerWidth - (rect.left + rect.right);
|
|
1444
|
+
const uncertainty = 0.1 * scrollbarWidth;
|
|
1445
|
+
return bodyToViewportGap >= scrollbarWidth - uncertainty;
|
|
1446
|
+
}
|
|
1447
|
+
/**
|
|
1448
|
+
* Calculates and returns the width of a scrollbar.
|
|
1449
|
+
*
|
|
1450
|
+
* @return the width of a scrollbar on this page
|
|
1451
|
+
*/
|
|
1452
|
+
_getWidth() {
|
|
1453
|
+
const measurer = this._document.createElement('div');
|
|
1454
|
+
measurer.className = 'modal-scrollbar-measure';
|
|
1455
|
+
const body = this._document.body;
|
|
1456
|
+
body.appendChild(measurer);
|
|
1457
|
+
const width = measurer.getBoundingClientRect().width - measurer.clientWidth;
|
|
1458
|
+
body.removeChild(measurer);
|
|
1459
|
+
return width;
|
|
1460
|
+
}
|
|
1461
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ScrollBar, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1462
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ScrollBar, providedIn: 'root' }); }
|
|
1463
|
+
}
|
|
1464
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ScrollBar, decorators: [{
|
|
1465
|
+
type: Injectable,
|
|
1466
|
+
args: [{ providedIn: 'root' }]
|
|
1467
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1468
|
+
type: Inject,
|
|
1469
|
+
args: [DOCUMENT]
|
|
1470
|
+
}] }]; } });
|
|
1471
|
+
|
|
1472
|
+
class DfProgressIndicatorService {
|
|
1473
|
+
constructor(document, rendererFactory, componentFactoryResolver, appRef, injector, scrollbar) {
|
|
1474
|
+
this.document = document;
|
|
1475
|
+
this.rendererFactory = rendererFactory;
|
|
1476
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
1477
|
+
this.appRef = appRef;
|
|
1478
|
+
this.injector = injector;
|
|
1479
|
+
this.scrollbar = scrollbar;
|
|
1480
|
+
this.BODY_CLASS = 'df-progressindicator-open';
|
|
1481
|
+
// TODO - Remove it when https://github.com/angular/angular/issues/22567
|
|
1482
|
+
this.containerAttributes = ['containerClass', 'position'];
|
|
1483
|
+
this.backdropAttributes = ['backdropClass', 'isGlobalBackdrop'];
|
|
1484
|
+
this.defaultSpinnerAttributes = ['contentClass', 'ariaLabel', 'isGlobalSpinner'];
|
|
1485
|
+
this.defaultProgressBarAttributes = ['infiniteAnimation', 'ariaLabel'];
|
|
1486
|
+
this.activeInstances = [];
|
|
1487
|
+
this.renderer = this.rendererFactory.createRenderer(null, null);
|
|
1488
|
+
}
|
|
1489
|
+
open(content, options) {
|
|
1490
|
+
const containerElt = this.getContainer(this.document, options);
|
|
1491
|
+
if (!containerElt) {
|
|
1492
|
+
throw new Error(`[Design Factory] The specified progress indicator container "${options?.container ||
|
|
1493
|
+
'body'}" was not found in the DOM.`);
|
|
1494
|
+
}
|
|
1495
|
+
// Create needed components
|
|
1496
|
+
const backdropRef = options?.backdrop !== false
|
|
1497
|
+
? this.createComponent(DfProgressIndicatorBackdropComponent, this.componentFactoryResolver, undefined, containerElt)
|
|
1498
|
+
: undefined;
|
|
1499
|
+
const contentRef = this.getContent(content, this.componentFactoryResolver, containerElt);
|
|
1500
|
+
const containerCmpRef = this.createComponent(DfProgressIndicatorContainerComponent, this.componentFactoryResolver, contentRef, containerElt);
|
|
1501
|
+
const onDestroyOperations = [];
|
|
1502
|
+
// Add aria attributes on the container
|
|
1503
|
+
this.renderer.setAttribute(containerElt, 'aria-busy', 'true');
|
|
1504
|
+
onDestroyOperations.push(() => {
|
|
1505
|
+
this.renderer.removeAttribute(containerElt, 'aria-busy');
|
|
1506
|
+
});
|
|
1507
|
+
// Override some styles if body is the container
|
|
1508
|
+
if (containerElt === this.document.body) {
|
|
1509
|
+
const scrollCompensation = this.scrollbar.compensate();
|
|
1510
|
+
this.renderer.addClass(this.document.body, this.BODY_CLASS);
|
|
1511
|
+
this.renderer.setAttribute(this.document.body, 'aria-busy', 'true');
|
|
1512
|
+
onDestroyOperations.push(() => {
|
|
1513
|
+
scrollCompensation();
|
|
1514
|
+
this.renderer.removeClass(this.document.body, this.BODY_CLASS);
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1517
|
+
if (onDestroyOperations.length > 0) {
|
|
1518
|
+
containerCmpRef.onDestroy(() => {
|
|
1519
|
+
onDestroyOperations.forEach(operation => {
|
|
1520
|
+
operation();
|
|
1521
|
+
});
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
// Force override of position in case of the use of a progress bar component
|
|
1525
|
+
if (content instanceof DfProgressIndicatorContentProgressBar) {
|
|
1526
|
+
options = {
|
|
1527
|
+
...options,
|
|
1528
|
+
position: content.position
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
// Apply options to the created components
|
|
1532
|
+
if (backdropRef) {
|
|
1533
|
+
this.applyOptions(backdropRef, this.backdropAttributes, { ...options, isGlobalBackdrop: containerElt === this.document.body });
|
|
1534
|
+
}
|
|
1535
|
+
this.applyOptions(containerCmpRef, this.containerAttributes, options);
|
|
1536
|
+
const progressIndicatorRef = new DfProgressIndicatorRef(containerCmpRef, contentRef, backdropRef);
|
|
1537
|
+
this.activeInstances.push(progressIndicatorRef);
|
|
1538
|
+
return progressIndicatorRef;
|
|
1539
|
+
}
|
|
1540
|
+
close(progressIndicatorRef) {
|
|
1541
|
+
const instanceIndex = this.activeInstances.indexOf(progressIndicatorRef);
|
|
1542
|
+
if (instanceIndex > -1) {
|
|
1543
|
+
Object.keys(progressIndicatorRef).forEach(key => {
|
|
1544
|
+
const propertyValue = progressIndicatorRef[key];
|
|
1545
|
+
if (propertyValue && propertyValue instanceof ComponentRef) {
|
|
1546
|
+
propertyValue.destroy();
|
|
1547
|
+
progressIndicatorRef[key] = undefined;
|
|
1548
|
+
}
|
|
1549
|
+
});
|
|
1550
|
+
this.activeInstances.splice(instanceIndex, 1);
|
|
1551
|
+
}
|
|
1552
|
+
else {
|
|
1553
|
+
throw new Error('[Design Factory] The specified progress indicator reference is no longer active and cannot be closed.');
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* Retrieve container according to the desired options.
|
|
1558
|
+
*/
|
|
1559
|
+
getContainer(document, options) {
|
|
1560
|
+
if (options?.container instanceof HTMLElement) {
|
|
1561
|
+
return options.container;
|
|
1562
|
+
}
|
|
1563
|
+
return options?.container ? document.querySelector(options.container) : document.body;
|
|
1564
|
+
}
|
|
1565
|
+
getContent(content, cfr, container) {
|
|
1566
|
+
if (!content) {
|
|
1567
|
+
return this.createComponent(DfDefaultSpinnerComponent, cfr);
|
|
1568
|
+
}
|
|
1569
|
+
else if (content instanceof DfProgressIndicatorContentSpinner) {
|
|
1570
|
+
const cmpRef = this.createComponent(DfDefaultSpinnerComponent, cfr);
|
|
1571
|
+
this.applyOptions(cmpRef, this.defaultSpinnerAttributes, { ...content.spinnerInput, isGlobalSpinner: container === this.document.body });
|
|
1572
|
+
return cmpRef;
|
|
1573
|
+
}
|
|
1574
|
+
else if (content instanceof DfProgressIndicatorContentProgressBar) {
|
|
1575
|
+
const cmpRef = this.createComponent(DfProgressbarComponent, cfr);
|
|
1576
|
+
this.applyOptions(cmpRef, this.defaultProgressBarAttributes, { ...content.progressBarInput, infiniteAnimation: true });
|
|
1577
|
+
return cmpRef;
|
|
1578
|
+
}
|
|
1579
|
+
else if (content instanceof TemplateRef) {
|
|
1580
|
+
const viewRef = content.createEmbeddedView({});
|
|
1581
|
+
this.appRef.attachView(viewRef);
|
|
1582
|
+
return viewRef;
|
|
1583
|
+
}
|
|
1584
|
+
else {
|
|
1585
|
+
return this.createComponent(content, cfr);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
createComponent(cmpType, cfr, childrenProjectables, container) {
|
|
1589
|
+
const cmpFactory = cfr.resolveComponentFactory(cmpType);
|
|
1590
|
+
let cmpRef;
|
|
1591
|
+
if (childrenProjectables) {
|
|
1592
|
+
if (childrenProjectables instanceof ComponentRef) {
|
|
1593
|
+
cmpRef = cmpFactory.create(this.injector, [[childrenProjectables.location.nativeElement]]);
|
|
1594
|
+
}
|
|
1595
|
+
else {
|
|
1596
|
+
cmpRef = cmpFactory.create(this.injector, [childrenProjectables.rootNodes]);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
else {
|
|
1600
|
+
cmpRef = cmpFactory.create(this.injector);
|
|
1601
|
+
}
|
|
1602
|
+
this.appRef.attachView(cmpRef.hostView);
|
|
1603
|
+
if (container) {
|
|
1604
|
+
container.appendChild(cmpRef.location.nativeElement);
|
|
1605
|
+
}
|
|
1606
|
+
return cmpRef;
|
|
1607
|
+
}
|
|
1608
|
+
applyOptions(cmpRef, availableOptions, options) {
|
|
1609
|
+
if (options) {
|
|
1610
|
+
const cmpInst = cmpRef.instance;
|
|
1611
|
+
availableOptions.forEach((option) => {
|
|
1612
|
+
const optionValue = options[option];
|
|
1613
|
+
if (optionValue !== null && optionValue !== undefined) {
|
|
1614
|
+
cmpInst[option] = optionValue;
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorService, deps: [{ token: DOCUMENT }, { token: i0.RendererFactory2 }, { token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: ScrollBar }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1620
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorService, providedIn: 'root' }); }
|
|
1109
1621
|
}
|
|
1110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
1111
|
-
type:
|
|
1112
|
-
args: [{
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
viewBox="0 0 510.2 67.9"
|
|
1120
|
-
style="enable-background:new 0 0 510.2 67.9;"
|
|
1121
|
-
xml:space="preserve"
|
|
1122
|
-
>
|
|
1123
|
-
<g id="Layer_2"></g>
|
|
1124
|
-
<g id="Layer_1">
|
|
1125
|
-
<path
|
|
1126
|
-
d="M269.7,0c-8.3,0-19.8,1.4-26.9,4v61.9c5.8,1.2,16.8,2,24.4,2c26,0,36.1-10.2,36.1-34.4C303.4,12.5,290.5,0,269.7,0
|
|
1127
|
-
M257.5,12.6c2.4-0.5,7-1.1,11.6-1.1c10.6,0,18.8,5.9,18.8,22c0,15.5-4.1,22.9-20.2,22.9c-5.2,0-10.3-0.8-10.3-0.8V12.6z
|
|
1128
|
-
M461.5,65.5c0,0,9,2.4,21.7,2.4c12,0,27-4.1,27-20.3c0-10.6-7.8-15.1-20.5-19.7c-6.9-2.5-12.7-4.8-12.7-9.5
|
|
1129
|
-
c0-2.3,1.7-6.7,10.5-6.7c8.2,0,16.6,3.8,16.6,3.8l3.7-10.8C505.2,3.4,497.2,0,486.1,0c-12.1,0-23.8,6.4-23.8,19.3
|
|
1130
|
-
c0,13.3,12.1,17.3,21.5,20.5c6.4,2.2,11.8,4.4,11.8,8.7c0,4.1-2.3,7.7-13.1,7.7c-8.9,0-18.3-2-18.3-2L461.5,65.5z M429.6,50.3
|
|
1131
|
-
c-3.5,1.7-11,4.5-17.9,4.5c-10,0-11.7-4.5-11.7-14.9V0.6h-2.2c-3.3,0-10.6,0.6-12.4,0.9v40.3c0,17.6,4.3,26,22.2,26
|
|
1132
|
-
c13.7,0,21.7-5.3,22.2-5.3c0.2,0,4.9,2.9,14.3,2.9v-64c-1-0.2-8.1-0.9-11.7-0.9h-2.9V50.3z M198.5,0c-13,0-23.2,3.2-27.1,5.2
|
|
1133
|
-
l3.1,10.9c0,0,10-3.6,19.8-3.6c8.4,0,12.7,2.4,12.7,10.6v4.7h-12.7c-21.6,0-28,9.9-28,20.8c0,14.5,11.3,19.1,21.6,19.1
|
|
1134
|
-
c12,0,18.9-5,19.8-5c0.7,0,3.1,2.6,14,2.6V19.3C221.7,5.5,213.1,0,198.5,0 M207.1,52.7c-3.1,1.2-10.7,3.7-16.2,3.7
|
|
1135
|
-
c-6,0-10.6-2.1-10.6-8.7c0-5.7,3.1-9,11.4-9.3l15.4-0.6V52.7z M32.2,0C19.2,0,9,3.2,5.1,5.2l3.1,10.9c0,0,10-3.6,19.8-3.6
|
|
1136
|
-
c8.4,0,12.7,2.4,12.7,10.6v4.7H28c-21.6,0-28,9.9-28,20.8c0,14.5,11.3,19.1,21.6,19.1c12,0,18.9-5,19.8-5c0.7,0,3.1,2.6,14,2.6
|
|
1137
|
-
V19.3C55.4,5.5,46.8,0,32.2,0 M40.9,52.7c-3.1,1.2-10.7,3.7-16.2,3.7c-6,0-10.6-2.1-10.6-8.7c0-5.7,3.1-9,11.4-9.3l15.4-0.6V52.7z
|
|
1138
|
-
M114,39c-0.4,0.9-0.8,2.7-1.1,3.8c-0.3-1-0.8-2.8-1.1-3.8L99,6.1C96.8,0.7,93.4,0,87.2,0c-2.2,0-6.6,0.3-6.6,0.3L74,66.9h14.6
|
|
1139
|
-
l3.2-44.7l13.9,33.8c1,2.6,3.1,3.7,7.3,3.7c4.1,0,6.2-1,7.3-3.7L134,22.2l3.2,44.7h14.6l-6.6-66.6c0,0-4.4-0.3-6.6-0.3
|
|
1140
|
-
c-6.2,0-9.6,0.7-11.8,6.1L114,39z M320.8,64.7c0,0,11.2,3.1,25.5,3.1c15.3,0,22.3-1.7,22.3-1.7V54.8c0,0-7.6,1.5-18.3,1.5
|
|
1141
|
-
c-9.3,0-15.1-1.2-15.1-1.2v-16h28.9V27.8h-28.9V12.5c0,0,5.7-1,14.1-1c9.5,0,18.1,1.5,18.1,1.5V1.6c0,0-7.5-1.6-19.8-1.6
|
|
1142
|
-
c-16.3,0-27,2.9-27,2.9V64.7z"
|
|
1143
|
-
/>
|
|
1144
|
-
</g>
|
|
1145
|
-
</svg>
|
|
1146
|
-
`, standalone: true, styles: [":host{min-width:60px}:host svg{margin:10%}:host.icon-primary{fill:#005eb8}:host.icon-white{fill:#fff}\n"] }]
|
|
1147
|
-
}] });
|
|
1622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorService, decorators: [{
|
|
1623
|
+
type: Injectable,
|
|
1624
|
+
args: [{
|
|
1625
|
+
providedIn: 'root'
|
|
1626
|
+
}]
|
|
1627
|
+
}], ctorParameters: function () { return [{ type: Document, decorators: [{
|
|
1628
|
+
type: Inject,
|
|
1629
|
+
args: [DOCUMENT]
|
|
1630
|
+
}] }, { type: i0.RendererFactory2 }, { type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }, { type: ScrollBar }]; } });
|
|
1148
1631
|
|
|
1149
|
-
class
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1632
|
+
class DfProgressIndicatorDirective {
|
|
1633
|
+
constructor(elementRef, progressService) {
|
|
1634
|
+
this.elementRef = elementRef;
|
|
1635
|
+
this.progressService = progressService;
|
|
1636
|
+
}
|
|
1637
|
+
ngOnChanges(changes) {
|
|
1638
|
+
if (changes['dfProgressIndicator']) {
|
|
1639
|
+
const isProgressing = this.dfProgressIndicator;
|
|
1640
|
+
if (isProgressing) {
|
|
1641
|
+
const config = {
|
|
1642
|
+
...this.dfProgressIndicatorConfig?.options,
|
|
1643
|
+
container: this.elementRef.nativeElement
|
|
1644
|
+
};
|
|
1645
|
+
this.progressIndicatorRef = this.progressService.open(this.dfProgressIndicatorConfig?.content, config);
|
|
1646
|
+
}
|
|
1647
|
+
else if (!isProgressing && this.progressIndicatorRef) {
|
|
1648
|
+
this.progressService.close(this.progressIndicatorRef);
|
|
1649
|
+
this.progressIndicatorRef = undefined;
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorDirective, deps: [{ token: i0.ElementRef }, { token: DfProgressIndicatorService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1654
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfProgressIndicatorDirective, isStandalone: true, selector: "[dfProgressIndicator]", inputs: { dfProgressIndicator: "dfProgressIndicator", dfProgressIndicatorConfig: "dfProgressIndicatorConfig" }, usesOnChanges: true, ngImport: i0 }); }
|
|
1153
1655
|
}
|
|
1154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
1656
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorDirective, decorators: [{
|
|
1657
|
+
type: Directive,
|
|
1658
|
+
args: [{
|
|
1659
|
+
selector: '[dfProgressIndicator]',
|
|
1660
|
+
standalone: true
|
|
1661
|
+
}]
|
|
1662
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: DfProgressIndicatorService }]; }, propDecorators: { dfProgressIndicator: [{
|
|
1663
|
+
type: Input
|
|
1664
|
+
}], dfProgressIndicatorConfig: [{
|
|
1665
|
+
type: Input
|
|
1666
|
+
}] } });
|
|
1667
|
+
|
|
1668
|
+
class DfProgressIndicatorModule {
|
|
1669
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1670
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorModule, imports: [DfDefaultSpinnerComponent,
|
|
1671
|
+
DfProgressbarModule,
|
|
1672
|
+
DfProgressIndicatorBackdropComponent,
|
|
1673
|
+
DfProgressIndicatorContainerComponent,
|
|
1674
|
+
DfProgressIndicatorDirective], exports: [DfProgressbarModule,
|
|
1675
|
+
DfProgressIndicatorContainerComponent,
|
|
1676
|
+
DfProgressIndicatorDirective,
|
|
1677
|
+
DfProgressIndicatorBackdropComponent,
|
|
1678
|
+
DfDefaultSpinnerComponent] }); }
|
|
1679
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorModule, imports: [DfDefaultSpinnerComponent,
|
|
1680
|
+
DfProgressbarModule, DfProgressbarModule] }); }
|
|
1681
|
+
}
|
|
1682
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorModule, decorators: [{
|
|
1155
1683
|
type: NgModule,
|
|
1156
1684
|
args: [{
|
|
1157
|
-
imports: [
|
|
1158
|
-
|
|
1685
|
+
imports: [
|
|
1686
|
+
DfDefaultSpinnerComponent,
|
|
1687
|
+
DfProgressbarModule,
|
|
1688
|
+
DfProgressIndicatorBackdropComponent,
|
|
1689
|
+
DfProgressIndicatorContainerComponent,
|
|
1690
|
+
DfProgressIndicatorDirective
|
|
1691
|
+
],
|
|
1692
|
+
exports: [
|
|
1693
|
+
DfProgressbarModule,
|
|
1694
|
+
DfProgressIndicatorContainerComponent,
|
|
1695
|
+
DfProgressIndicatorDirective,
|
|
1696
|
+
DfProgressIndicatorBackdropComponent,
|
|
1697
|
+
DfDefaultSpinnerComponent
|
|
1698
|
+
]
|
|
1159
1699
|
}]
|
|
1160
1700
|
}] });
|
|
1161
1701
|
|
|
@@ -1413,9 +1953,9 @@ const options = {
|
|
|
1413
1953
|
return (passiveOptionAccessed = true);
|
|
1414
1954
|
}
|
|
1415
1955
|
};
|
|
1416
|
-
const noop
|
|
1417
|
-
w.addEventListener && w.addEventListener('p', noop
|
|
1418
|
-
w.removeEventListener && w.removeEventListener('p', noop
|
|
1956
|
+
const noop = () => { };
|
|
1957
|
+
w.addEventListener && w.addEventListener('p', noop, options);
|
|
1958
|
+
w.removeEventListener && w.removeEventListener('p', noop, false);
|
|
1419
1959
|
const supportsPassiveEvents = passiveOptionAccessed;
|
|
1420
1960
|
/**
|
|
1421
1961
|
* Helper class to attach event listeners to DOM elements with debounce support using rxjs
|
|
@@ -3687,7 +4227,7 @@ class SliderComponent {
|
|
|
3687
4227
|
return changeContext;
|
|
3688
4228
|
}
|
|
3689
4229
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SliderComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3690
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: SliderComponent, isStandalone: true, selector: "ngx-slider", inputs: { value: "value", highValue: "highValue", options: "options", manualRefresh: "manualRefresh", triggerFocus: "triggerFocus" }, outputs: { valueChange: "valueChange", highValueChange: "highValueChange", userChangeStart: "userChangeStart", userChange: "userChange", userChangeEnd: "userChangeEnd" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "class": "this.class", "class.vertical": "this.sliderElementVerticalClass", "class.animate": "this.sliderElementAnimateClass", "class.with-legend": "this.sliderElementWithLegendClass", "attr.disabled": "this.sliderElementDisabledAttr", "attr.aria-label": "this.sliderElementAriaLabel" } }, providers: [NGX_SLIDER_CONTROL_VALUE_ACCESSOR], queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["tooltipTemplate"], descendants: true }], viewQueries: [{ propertyName: "leftOuterSelectionBarElement", first: true, predicate: ["leftOuterSelectionBar"], descendants: true, read: SliderElementDirective }, { propertyName: "rightOuterSelectionBarElement", first: true, predicate: ["rightOuterSelectionBar"], descendants: true, read: SliderElementDirective }, { propertyName: "fullBarElement", first: true, predicate: ["fullBar"], descendants: true, read: SliderElementDirective }, { propertyName: "selectionBarElement", first: true, predicate: ["selectionBar"], descendants: true, read: SliderElementDirective }, { propertyName: "minHandleElement", first: true, predicate: ["minHandle"], descendants: true, read: SliderHandleDirective }, { propertyName: "maxHandleElement", first: true, predicate: ["maxHandle"], descendants: true, read: SliderHandleDirective }, { propertyName: "floorLabelElement", first: true, predicate: ["floorLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "ceilLabelElement", first: true, predicate: ["ceilLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "minHandleLabelElement", first: true, predicate: ["minHandleLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "maxHandleLabelElement", first: true, predicate: ["maxHandleLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "combinedLabelElement", first: true, predicate: ["combinedLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "ticksElement", first: true, predicate: ["ticksElement"], descendants: true, read: SliderElementDirective }], usesOnChanges: true, ngImport: i0, template: "<!-- // 0 Left selection bar outside two handles -->\n<span ngxSliderElement #leftOuterSelectionBar class=\"ngx-slider-span ngx-slider-bar-wrapper ngx-slider-left-out-selection\">\n <span class=\"ngx-slider-span ngx-slider-bar\"></span>\n</span>\n<!-- // 1 Right selection bar outside two handles -->\n<span ngxSliderElement #rightOuterSelectionBar class=\"ngx-slider-span ngx-slider-bar-wrapper ngx-slider-right-out-selection\">\n <span class=\"ngx-slider-span ngx-slider-bar\"></span>\n</span>\n<!-- // 2 The whole slider bar -->\n<span ngxSliderElement #fullBar [class.ngx-slider-transparent]=\"fullBarTransparentClass\" class=\"ngx-slider-span ngx-slider-bar-wrapper ngx-slider-full-bar\">\n <span class=\"ngx-slider-span ngx-slider-bar\"></span>\n</span>\n<!-- // 3 Selection bar between two handles -->\n<span ngxSliderElement #selectionBar [class.ngx-slider-draggable]=\"selectionBarDraggableClass\" class=\"ngx-slider-span ngx-slider-bar-wrapper ngx-slider-selection-bar\">\n <span class=\"ngx-slider-span ngx-slider-bar ngx-slider-selection\" [ngStyle]=\"barStyle\"></span>\n</span>\n<!-- // 4 Low slider handle -->\n<span ngxSliderHandle #minHandle class=\"ngx-slider-span ngx-slider-pointer ngx-slider-pointer-min\" [ngStyle]=minPointerStyle></span>\n<!-- // 5 High slider handle -->\n<span ngxSliderHandle #maxHandle [style.display]=\"range ? 'inherit' : 'none'\" class=\"ngx-slider-span ngx-slider-pointer ngx-slider-pointer-max\" [ngStyle]=maxPointerStyle></span>\n<!-- // 6 Floor label -->\n<span ngxSliderLabel #floorLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-limit ngx-slider-floor\"></span>\n<!-- // 7 Ceiling label -->\n<span ngxSliderLabel #ceilLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-limit ngx-slider-ceil\"></span>\n<!-- // 8 Label above the low slider handle -->\n<span ngxSliderLabel #minHandleLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-model-value\"></span>\n<!-- // 9 Label above the high slider handle -->\n<span ngxSliderLabel #maxHandleLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-model-high\"></span>\n<!-- // 10 Combined range label when the slider handles are close ex. 15 - 17 -->\n<span ngxSliderLabel #combinedLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-combined\"></span>\n<!-- // 11 The ticks -->\n<span ngxSliderElement #ticksElement [hidden]=\"!showTicks\" [class.ngx-slider-ticks-values-under]=\"ticksUnderValuesClass\" class=\"ngx-slider-ticks\">\n <span *ngFor=\"let t of ticks\" class=\"ngx-slider-tick\" [ngClass]=\"{'ngx-slider-selected': t.selected}\" [ngStyle]=\"t.style\">\n <ngx-slider-tooltip-wrapper [template]=\"tooltipTemplate\" [tooltip]=\"t.tooltip\" [placement]=\"t.tooltipPlacement\"></ngx-slider-tooltip-wrapper>\n <ngx-slider-tooltip-wrapper *ngIf=\"t.value !== null\" class=\"ngx-slider-span ngx-slider-tick-value\"\n [template]=\"tooltipTemplate\" [tooltip]=\"t.valueTooltip\" [placement]=\"t.valueTooltipPlacement\" [content]=\"t.value\"></ngx-slider-tooltip-wrapper>\n <span *ngIf=\"t.legend !== null\" class=\"ngx-slider-span ngx-slider-tick-legend\" [innerHTML]=\"t.legend\"></span>\n </span>\n</span>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$
|
|
4230
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: SliderComponent, isStandalone: true, selector: "ngx-slider", inputs: { value: "value", highValue: "highValue", options: "options", manualRefresh: "manualRefresh", triggerFocus: "triggerFocus" }, outputs: { valueChange: "valueChange", highValueChange: "highValueChange", userChangeStart: "userChangeStart", userChange: "userChange", userChangeEnd: "userChangeEnd" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "class": "this.class", "class.vertical": "this.sliderElementVerticalClass", "class.animate": "this.sliderElementAnimateClass", "class.with-legend": "this.sliderElementWithLegendClass", "attr.disabled": "this.sliderElementDisabledAttr", "attr.aria-label": "this.sliderElementAriaLabel" } }, providers: [NGX_SLIDER_CONTROL_VALUE_ACCESSOR], queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["tooltipTemplate"], descendants: true }], viewQueries: [{ propertyName: "leftOuterSelectionBarElement", first: true, predicate: ["leftOuterSelectionBar"], descendants: true, read: SliderElementDirective }, { propertyName: "rightOuterSelectionBarElement", first: true, predicate: ["rightOuterSelectionBar"], descendants: true, read: SliderElementDirective }, { propertyName: "fullBarElement", first: true, predicate: ["fullBar"], descendants: true, read: SliderElementDirective }, { propertyName: "selectionBarElement", first: true, predicate: ["selectionBar"], descendants: true, read: SliderElementDirective }, { propertyName: "minHandleElement", first: true, predicate: ["minHandle"], descendants: true, read: SliderHandleDirective }, { propertyName: "maxHandleElement", first: true, predicate: ["maxHandle"], descendants: true, read: SliderHandleDirective }, { propertyName: "floorLabelElement", first: true, predicate: ["floorLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "ceilLabelElement", first: true, predicate: ["ceilLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "minHandleLabelElement", first: true, predicate: ["minHandleLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "maxHandleLabelElement", first: true, predicate: ["maxHandleLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "combinedLabelElement", first: true, predicate: ["combinedLabel"], descendants: true, read: SliderLabelDirective }, { propertyName: "ticksElement", first: true, predicate: ["ticksElement"], descendants: true, read: SliderElementDirective }], usesOnChanges: true, ngImport: i0, template: "<!-- // 0 Left selection bar outside two handles -->\n<span ngxSliderElement #leftOuterSelectionBar class=\"ngx-slider-span ngx-slider-bar-wrapper ngx-slider-left-out-selection\">\n <span class=\"ngx-slider-span ngx-slider-bar\"></span>\n</span>\n<!-- // 1 Right selection bar outside two handles -->\n<span ngxSliderElement #rightOuterSelectionBar class=\"ngx-slider-span ngx-slider-bar-wrapper ngx-slider-right-out-selection\">\n <span class=\"ngx-slider-span ngx-slider-bar\"></span>\n</span>\n<!-- // 2 The whole slider bar -->\n<span ngxSliderElement #fullBar [class.ngx-slider-transparent]=\"fullBarTransparentClass\" class=\"ngx-slider-span ngx-slider-bar-wrapper ngx-slider-full-bar\">\n <span class=\"ngx-slider-span ngx-slider-bar\"></span>\n</span>\n<!-- // 3 Selection bar between two handles -->\n<span ngxSliderElement #selectionBar [class.ngx-slider-draggable]=\"selectionBarDraggableClass\" class=\"ngx-slider-span ngx-slider-bar-wrapper ngx-slider-selection-bar\">\n <span class=\"ngx-slider-span ngx-slider-bar ngx-slider-selection\" [ngStyle]=\"barStyle\"></span>\n</span>\n<!-- // 4 Low slider handle -->\n<span ngxSliderHandle #minHandle class=\"ngx-slider-span ngx-slider-pointer ngx-slider-pointer-min\" [ngStyle]=minPointerStyle></span>\n<!-- // 5 High slider handle -->\n<span ngxSliderHandle #maxHandle [style.display]=\"range ? 'inherit' : 'none'\" class=\"ngx-slider-span ngx-slider-pointer ngx-slider-pointer-max\" [ngStyle]=maxPointerStyle></span>\n<!-- // 6 Floor label -->\n<span ngxSliderLabel #floorLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-limit ngx-slider-floor\"></span>\n<!-- // 7 Ceiling label -->\n<span ngxSliderLabel #ceilLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-limit ngx-slider-ceil\"></span>\n<!-- // 8 Label above the low slider handle -->\n<span ngxSliderLabel #minHandleLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-model-value\"></span>\n<!-- // 9 Label above the high slider handle -->\n<span ngxSliderLabel #maxHandleLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-model-high\"></span>\n<!-- // 10 Combined range label when the slider handles are close ex. 15 - 17 -->\n<span ngxSliderLabel #combinedLabel class=\"ngx-slider-span ngx-slider-bubble ngx-slider-combined\"></span>\n<!-- // 11 The ticks -->\n<span ngxSliderElement #ticksElement [hidden]=\"!showTicks\" [class.ngx-slider-ticks-values-under]=\"ticksUnderValuesClass\" class=\"ngx-slider-ticks\">\n <span *ngFor=\"let t of ticks\" class=\"ngx-slider-tick\" [ngClass]=\"{'ngx-slider-selected': t.selected}\" [ngStyle]=\"t.style\">\n <ngx-slider-tooltip-wrapper [template]=\"tooltipTemplate\" [tooltip]=\"t.tooltip\" [placement]=\"t.tooltipPlacement\"></ngx-slider-tooltip-wrapper>\n <ngx-slider-tooltip-wrapper *ngIf=\"t.value !== null\" class=\"ngx-slider-span ngx-slider-tick-value\"\n [template]=\"tooltipTemplate\" [tooltip]=\"t.valueTooltip\" [placement]=\"t.valueTooltipPlacement\" [content]=\"t.value\"></ngx-slider-tooltip-wrapper>\n <span *ngIf=\"t.legend !== null\" class=\"ngx-slider-span ngx-slider-tick-legend\" [innerHTML]=\"t.legend\"></span>\n </span>\n</span>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: TooltipWrapperComponent, selector: "ngx-slider-tooltip-wrapper", inputs: ["template", "tooltip", "placement", "content"] }, { kind: "directive", type: SliderLabelDirective, selector: "[ngxSliderLabel]" }, { kind: "directive", type: SliderHandleDirective, selector: "[ngxSliderHandle]" }, { kind: "directive", type: SliderElementDirective, selector: "[ngxSliderElement]" }] }); }
|
|
3691
4231
|
}
|
|
3692
4232
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SliderComponent, decorators: [{
|
|
3693
4233
|
type: Component,
|
|
@@ -3795,54 +4335,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
3795
4335
|
}]
|
|
3796
4336
|
}] });
|
|
3797
4337
|
|
|
3798
|
-
/**
|
|
3799
|
-
* @param element the HTML element
|
|
3800
|
-
* @returns whether the element is overflowing
|
|
3801
|
-
*/
|
|
3802
|
-
function hasOverflow(element) {
|
|
3803
|
-
return element?.offsetHeight < element?.scrollHeight || element?.offsetWidth < element?.scrollWidth;
|
|
3804
|
-
}
|
|
3805
|
-
|
|
3806
|
-
/**
|
|
3807
|
-
* My dfTooltipTruncate directive
|
|
3808
|
-
*/
|
|
3809
|
-
class DfTooltipTruncateDirective {
|
|
3810
|
-
constructor(tooltip, elementRef, renderer) {
|
|
3811
|
-
this.tooltip = tooltip;
|
|
3812
|
-
this.elementRef = elementRef;
|
|
3813
|
-
this.renderer = renderer;
|
|
3814
|
-
}
|
|
3815
|
-
ngOnInit() {
|
|
3816
|
-
this.renderer.addClass(this.elementRef.nativeElement, 'text-truncate');
|
|
3817
|
-
}
|
|
3818
|
-
ngDoCheck() {
|
|
3819
|
-
this.tooltip.disableTooltip = !hasOverflow(this.elementRef.nativeElement);
|
|
3820
|
-
}
|
|
3821
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipTruncateDirective, deps: [{ token: i1.NgbTooltip }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3822
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfTooltipTruncateDirective, isStandalone: true, selector: "[dfTooltipTruncate]", exportAs: ["dfTooltipTruncate"], ngImport: i0 }); }
|
|
3823
|
-
}
|
|
3824
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipTruncateDirective, decorators: [{
|
|
3825
|
-
type: Directive,
|
|
3826
|
-
args: [{
|
|
3827
|
-
exportAs: 'dfTooltipTruncate',
|
|
3828
|
-
selector: '[dfTooltipTruncate]',
|
|
3829
|
-
standalone: true
|
|
3830
|
-
}]
|
|
3831
|
-
}], ctorParameters: function () { return [{ type: i1.NgbTooltip }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
3832
|
-
|
|
3833
|
-
class DfTooltipModule {
|
|
3834
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3835
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipModule, imports: [DfTooltipTruncateDirective], exports: [DfTooltipTruncateDirective, NgbTooltipModule] }); }
|
|
3836
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipModule, imports: [NgbTooltipModule] }); }
|
|
3837
|
-
}
|
|
3838
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipModule, decorators: [{
|
|
3839
|
-
type: NgModule,
|
|
3840
|
-
args: [{
|
|
3841
|
-
imports: [DfTooltipTruncateDirective],
|
|
3842
|
-
exports: [DfTooltipTruncateDirective, NgbTooltipModule]
|
|
3843
|
-
}]
|
|
3844
|
-
}] });
|
|
3845
|
-
|
|
3846
4338
|
/**
|
|
3847
4339
|
* A configuration service for the [DfSideNavService](#/components/sidenav/api#DfSideNavComponent) component.
|
|
3848
4340
|
*
|
|
@@ -3931,534 +4423,251 @@ class DfSideNavService {
|
|
|
3931
4423
|
this.dispatchSideNavItems();
|
|
3932
4424
|
}
|
|
3933
4425
|
/**
|
|
3934
|
-
* Use this to active the item pass as input
|
|
3935
|
-
* This function inactivate all the other items of the service
|
|
3936
|
-
* It will then dispatch the list of items of the sideNav to activeItem$
|
|
3937
|
-
*
|
|
3938
|
-
*/
|
|
3939
|
-
activeItem(item) {
|
|
3940
|
-
this.inactiveItems(this._items);
|
|
3941
|
-
item.isActive = true;
|
|
3942
|
-
this._activeItem$.next(item);
|
|
3943
|
-
this.dispatchSideNavItems();
|
|
3944
|
-
}
|
|
3945
|
-
/**
|
|
3946
|
-
* Getter to know when to put/remove the overlay.
|
|
3947
|
-
* `True` in case of overlay needed
|
|
3948
|
-
*
|
|
3949
|
-
*/
|
|
3950
|
-
get isAppOverlay$() {
|
|
3951
|
-
return this._isAppOverlay$.asObservable();
|
|
3952
|
-
}
|
|
3953
|
-
/**
|
|
3954
|
-
* Getter to know if the sidenav is in an overlay panel or not
|
|
3955
|
-
* `True` in case of overlay panel
|
|
3956
|
-
*
|
|
3957
|
-
*/
|
|
3958
|
-
get isInMenuOverlay$() {
|
|
3959
|
-
return this._isInMenuOverlay$.asObservable();
|
|
3960
|
-
}
|
|
3961
|
-
/**
|
|
3962
|
-
* Getter to know the current activeItem a user clicked on
|
|
3963
|
-
*
|
|
3964
|
-
*/
|
|
3965
|
-
get activeItem$() {
|
|
3966
|
-
return this._activeItem$.asObservable();
|
|
3967
|
-
}
|
|
3968
|
-
/**
|
|
3969
|
-
* Getter to know if the sideNav is present in the page
|
|
3970
|
-
* SideNav may be collapsed here or not
|
|
3971
|
-
*
|
|
3972
|
-
*/
|
|
3973
|
-
get isPresent$() {
|
|
3974
|
-
return this._isPresent$.asObservable();
|
|
3975
|
-
}
|
|
3976
|
-
/**
|
|
3977
|
-
* Future Options
|
|
3978
|
-
*/
|
|
3979
|
-
get isMinimized$() {
|
|
3980
|
-
return this._isMinmized$.asObservable();
|
|
3981
|
-
}
|
|
3982
|
-
/**
|
|
3983
|
-
* Getter to know if the SideNav is collapsed or not
|
|
3984
|
-
* If `true` the SideNav is collapsed
|
|
3985
|
-
*
|
|
3986
|
-
*/
|
|
3987
|
-
get isCollapsed$() {
|
|
3988
|
-
return this._isCollapsed$.asObservable();
|
|
3989
|
-
}
|
|
3990
|
-
/**
|
|
3991
|
-
* Getter of the SideNav Items after they have beens changed
|
|
3992
|
-
*
|
|
3993
|
-
*/
|
|
3994
|
-
get sideNavItems$() {
|
|
3995
|
-
return this._sideNavItems$.asObservable();
|
|
3996
|
-
}
|
|
3997
|
-
/**
|
|
3998
|
-
* Getter to know the mode Apply for the SideNav
|
|
3999
|
-
* If `true` the SideNav can be in overlay (but not necessary is).
|
|
4000
|
-
*
|
|
4001
|
-
*/
|
|
4002
|
-
get isAppOverlayMode() {
|
|
4003
|
-
return this._isAppOverlayMode;
|
|
4004
|
-
}
|
|
4005
|
-
// initItems must be used to push new items to the service
|
|
4006
|
-
get items() {
|
|
4007
|
-
return this._items;
|
|
4008
|
-
}
|
|
4009
|
-
/**
|
|
4010
|
-
* Use this to toggle a SideNav Item (either from expand to collapse or the other way around).
|
|
4011
|
-
* isCollapsed attribute of the input item is changed.
|
|
4012
|
-
* All items are push again to the stream of items.
|
|
4013
|
-
* This is used internally by the SideNav in case of click and Enter on an Item with subMenus
|
|
4014
|
-
*/
|
|
4015
|
-
toggle(itemInput) {
|
|
4016
|
-
itemInput.isCollapsed = !itemInput.isCollapsed;
|
|
4017
|
-
this.dispatchSideNavItems();
|
|
4018
|
-
}
|
|
4019
|
-
/**
|
|
4020
|
-
*
|
|
4021
|
-
* @param itemInput
|
|
4022
|
-
*/
|
|
4023
|
-
collapseItem(itemInput) {
|
|
4024
|
-
this.collapse(itemInput, this._items);
|
|
4025
|
-
this.dispatchSideNavItems();
|
|
4026
|
-
}
|
|
4027
|
-
/**
|
|
4028
|
-
* Use this to collapseAll items
|
|
4426
|
+
* Use this to active the item pass as input
|
|
4427
|
+
* This function inactivate all the other items of the service
|
|
4428
|
+
* It will then dispatch the list of items of the sideNav to activeItem$
|
|
4429
|
+
*
|
|
4029
4430
|
*/
|
|
4030
|
-
|
|
4031
|
-
this.
|
|
4431
|
+
activeItem(item) {
|
|
4432
|
+
this.inactiveItems(this._items);
|
|
4433
|
+
item.isActive = true;
|
|
4434
|
+
this._activeItem$.next(item);
|
|
4032
4435
|
this.dispatchSideNavItems();
|
|
4033
4436
|
}
|
|
4034
4437
|
/**
|
|
4035
|
-
*
|
|
4036
|
-
*
|
|
4037
|
-
* (when not collapsed)
|
|
4438
|
+
* Getter to know when to put/remove the overlay.
|
|
4439
|
+
* `True` in case of overlay needed
|
|
4038
4440
|
*
|
|
4039
4441
|
*/
|
|
4040
|
-
|
|
4041
|
-
this.
|
|
4442
|
+
get isAppOverlay$() {
|
|
4443
|
+
return this._isAppOverlay$.asObservable();
|
|
4042
4444
|
}
|
|
4043
4445
|
/**
|
|
4044
|
-
*
|
|
4446
|
+
* Getter to know if the sidenav is in an overlay panel or not
|
|
4447
|
+
* `True` in case of overlay panel
|
|
4045
4448
|
*
|
|
4046
4449
|
*/
|
|
4047
|
-
|
|
4048
|
-
this.
|
|
4450
|
+
get isInMenuOverlay$() {
|
|
4451
|
+
return this._isInMenuOverlay$.asObservable();
|
|
4049
4452
|
}
|
|
4050
4453
|
/**
|
|
4051
|
-
*
|
|
4454
|
+
* Getter to know the current activeItem a user clicked on
|
|
4052
4455
|
*
|
|
4053
4456
|
*/
|
|
4054
|
-
|
|
4055
|
-
this.
|
|
4457
|
+
get activeItem$() {
|
|
4458
|
+
return this._activeItem$.asObservable();
|
|
4056
4459
|
}
|
|
4057
4460
|
/**
|
|
4058
|
-
*
|
|
4461
|
+
* Getter to know if the sideNav is present in the page
|
|
4462
|
+
* SideNav may be collapsed here or not
|
|
4059
4463
|
*
|
|
4060
4464
|
*/
|
|
4061
|
-
|
|
4062
|
-
this.
|
|
4063
|
-
}
|
|
4064
|
-
// internal usage from the SideNav. Call when component is destroy
|
|
4065
|
-
removeSideBar() {
|
|
4066
|
-
this._isCollapsed$.next(false);
|
|
4067
|
-
this._isPresent$.next(false);
|
|
4465
|
+
get isPresent$() {
|
|
4466
|
+
return this._isPresent$.asObservable();
|
|
4068
4467
|
}
|
|
4069
4468
|
/**
|
|
4070
|
-
*
|
|
4071
|
-
* Input `True` if you want to set the AppOverlay
|
|
4072
|
-
* An event is send to isAppOverlay$ depending on your status
|
|
4073
|
-
* if Input = `True` and isCollapsed = `False` then isAppOverlay$
|
|
4074
|
-
* will be `True`
|
|
4075
|
-
*
|
|
4469
|
+
* Future Options
|
|
4076
4470
|
*/
|
|
4077
|
-
|
|
4078
|
-
this.
|
|
4079
|
-
this.updateOverLay();
|
|
4080
|
-
}
|
|
4081
|
-
// Internal usage to the sidenav component
|
|
4082
|
-
// Do not use
|
|
4083
|
-
setSideNav() {
|
|
4084
|
-
this._isPresent$.next(true);
|
|
4471
|
+
get isMinimized$() {
|
|
4472
|
+
return this._isMinmized$.asObservable();
|
|
4085
4473
|
}
|
|
4086
4474
|
/**
|
|
4475
|
+
* Getter to know if the SideNav is collapsed or not
|
|
4476
|
+
* If `true` the SideNav is collapsed
|
|
4087
4477
|
*
|
|
4088
|
-
* @param itemInput
|
|
4089
|
-
* @param itemsList
|
|
4090
4478
|
*/
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
if (item === itemInput && item.subMenus) {
|
|
4094
|
-
item.isCollapsed = true;
|
|
4095
|
-
return true; // propagate the collapse up
|
|
4096
|
-
}
|
|
4097
|
-
else if (item === itemInput) {
|
|
4098
|
-
return true;
|
|
4099
|
-
}
|
|
4100
|
-
else if (item.subMenus) {
|
|
4101
|
-
const needcol = this.collapse(itemInput, item.subMenus);
|
|
4102
|
-
if (needcol) {
|
|
4103
|
-
item.isCollapsed = true; // collapse it
|
|
4104
|
-
return true; // propagate the collapse up
|
|
4105
|
-
}
|
|
4106
|
-
}
|
|
4107
|
-
}
|
|
4108
|
-
return false;
|
|
4479
|
+
get isCollapsed$() {
|
|
4480
|
+
return this._isCollapsed$.asObservable();
|
|
4109
4481
|
}
|
|
4110
4482
|
/**
|
|
4483
|
+
* Getter of the SideNav Items after they have beens changed
|
|
4111
4484
|
*
|
|
4112
|
-
* @param itemsList
|
|
4113
4485
|
*/
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
if (item.subMenus) {
|
|
4117
|
-
item.isCollapsed = true;
|
|
4118
|
-
this.collapseAll(item.subMenus);
|
|
4119
|
-
}
|
|
4120
|
-
});
|
|
4121
|
-
}
|
|
4122
|
-
// Only one item at the time must be active
|
|
4123
|
-
// Active flag in item is only valid for action button and link
|
|
4124
|
-
// Router link does not use this active flag to work
|
|
4125
|
-
// It is up to you to inactivateItems when needed when you mix actionButton and router link
|
|
4126
|
-
// To avoid more than one active state visible
|
|
4127
|
-
setActiveItem(items, foundAnActive = false) {
|
|
4128
|
-
let foundActive = foundAnActive;
|
|
4129
|
-
items.forEach(item => {
|
|
4130
|
-
if (item.isActive && foundAnActive) {
|
|
4131
|
-
throw Error('DfSideNavService must be init with only one isActive item');
|
|
4132
|
-
}
|
|
4133
|
-
else if (item.isActive) {
|
|
4134
|
-
this._activeItem$.next(item);
|
|
4135
|
-
foundActive = true;
|
|
4136
|
-
}
|
|
4137
|
-
if (item.subMenus) {
|
|
4138
|
-
foundActive = this.setActiveItem(item.subMenus, foundActive);
|
|
4139
|
-
}
|
|
4140
|
-
});
|
|
4141
|
-
return foundActive;
|
|
4142
|
-
}
|
|
4143
|
-
addNavItemType(withRouter, items = this._items) {
|
|
4144
|
-
items.forEach(item => {
|
|
4145
|
-
if (!item.type) {
|
|
4146
|
-
if (item.subMenus) {
|
|
4147
|
-
item.type = DfNavItemType.subMenus;
|
|
4148
|
-
}
|
|
4149
|
-
else if (item.isExternal) {
|
|
4150
|
-
item.type = DfNavItemType.externalLink;
|
|
4151
|
-
}
|
|
4152
|
-
else if (withRouter) {
|
|
4153
|
-
item.type = DfNavItemType.routerLink;
|
|
4154
|
-
}
|
|
4155
|
-
else {
|
|
4156
|
-
item.type = DfNavItemType.actionButton;
|
|
4157
|
-
}
|
|
4158
|
-
}
|
|
4159
|
-
if (item.subMenus) {
|
|
4160
|
-
this.addNavItemType(withRouter, item.subMenus);
|
|
4161
|
-
}
|
|
4162
|
-
});
|
|
4163
|
-
}
|
|
4164
|
-
dispatchSideNavItems() {
|
|
4165
|
-
this._sideNavItems$.next(this._items);
|
|
4166
|
-
}
|
|
4167
|
-
updateOverLay() {
|
|
4168
|
-
this._isAppOverlay$.next(this.isAppOverlayMode && this._isCollapsed$.value === false);
|
|
4169
|
-
}
|
|
4170
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavService, deps: [{ token: DfSideNavConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4171
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavService, providedIn: 'root' }); }
|
|
4172
|
-
}
|
|
4173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavService, decorators: [{
|
|
4174
|
-
type: Injectable,
|
|
4175
|
-
args: [{
|
|
4176
|
-
providedIn: 'root'
|
|
4177
|
-
}]
|
|
4178
|
-
}], ctorParameters: function () { return [{ type: DfSideNavConfig }]; } });
|
|
4179
|
-
|
|
4180
|
-
// Default DF breakpoints
|
|
4181
|
-
const DF_BREAKPOINTS_VAR_DEFAULT = {
|
|
4182
|
-
xs: '--df-breakpoint-xs',
|
|
4183
|
-
sm: '--df-breakpoint-sm',
|
|
4184
|
-
md: '--df-breakpoint-md',
|
|
4185
|
-
lg: '--df-breakpoint-lg',
|
|
4186
|
-
xl: '--df-breakpoint-xl',
|
|
4187
|
-
xxl: '--df-breakpoint-xxl',
|
|
4188
|
-
xxxl: '--df-breakpoint-xxxl'
|
|
4189
|
-
};
|
|
4190
|
-
const BREAKPOINTS_VARS = new InjectionToken('Bootstrap Breakpoints', {
|
|
4191
|
-
providedIn: 'root',
|
|
4192
|
-
factory() {
|
|
4193
|
-
return DF_BREAKPOINTS_VAR_DEFAULT;
|
|
4194
|
-
}
|
|
4195
|
-
});
|
|
4196
|
-
class DfBreakpoints {
|
|
4197
|
-
constructor(_breakPointsVar, platformID) {
|
|
4198
|
-
this._breakPointsVar = _breakPointsVar;
|
|
4199
|
-
this.platformID = platformID;
|
|
4200
|
-
this._breakPoints$ = new BehaviorSubject(null);
|
|
4201
|
-
this.initBreakpoints();
|
|
4202
|
-
}
|
|
4203
|
-
get breakPoints$() {
|
|
4204
|
-
return this._breakPoints$.asObservable();
|
|
4205
|
-
}
|
|
4206
|
-
initBreakpoints() {
|
|
4207
|
-
let breakPoints = null;
|
|
4208
|
-
if (isPlatformBrowser(this.platformID) && this._breakPoints$.value === null) {
|
|
4209
|
-
// we are in a browser so CSS variable are accessible
|
|
4210
|
-
// we init the BP only once
|
|
4211
|
-
const styles = window.getComputedStyle(document.documentElement);
|
|
4212
|
-
const bpArray = [];
|
|
4213
|
-
for (const el of Object.keys(this._breakPointsVar)) {
|
|
4214
|
-
const curValue = this._breakPointsVar[el];
|
|
4215
|
-
const bpValue = Number.parseInt(styles.getPropertyValue(curValue), 10);
|
|
4216
|
-
if (isNaN(bpValue)) {
|
|
4217
|
-
// We should never enter here. Only if people did not put the correct list of CSS vars...
|
|
4218
|
-
// Or if the CSS is not arrived yet.
|
|
4219
|
-
// What should we do then?
|
|
4220
|
-
// TODO init from the default list provided if we want to?
|
|
4221
|
-
}
|
|
4222
|
-
else {
|
|
4223
|
-
bpArray.push([el, bpValue]);
|
|
4224
|
-
}
|
|
4225
|
-
}
|
|
4226
|
-
breakPoints = this.generate(bpArray);
|
|
4227
|
-
// In case the first page contains the directive and the CSS vars are not available
|
|
4228
|
-
// We may need to launch a second init at load time.
|
|
4229
|
-
if (Object.keys(breakPoints).length === 0) {
|
|
4230
|
-
fromEvent(window, 'load')
|
|
4231
|
-
.pipe(take(1))
|
|
4232
|
-
.subscribe(() => {
|
|
4233
|
-
// Init once as the service is available everywhere
|
|
4234
|
-
// We do not check if the CSS variable are changing over time
|
|
4235
|
-
// here onload the CSS var should be available
|
|
4236
|
-
this.initBreakpoints();
|
|
4237
|
-
});
|
|
4238
|
-
}
|
|
4239
|
-
}
|
|
4240
|
-
this._breakPoints$.next(breakPoints);
|
|
4241
|
-
}
|
|
4242
|
-
// Utilities to use if you want to create your own queries with your values.
|
|
4243
|
-
// sizes is an array of array BreakPoints with sizes[0] --> identifier of the BreakPoint
|
|
4244
|
-
// sizes[1] px value of the BreakPoint
|
|
4245
|
-
generate(sizes) {
|
|
4246
|
-
sizes = sizes.sort((a, b) => a[1] - b[1]);
|
|
4247
|
-
const dict = {};
|
|
4248
|
-
for (let i = 0; i < sizes.length; i++) {
|
|
4249
|
-
const name = sizes[i][0];
|
|
4250
|
-
const min = sizes[i][1];
|
|
4251
|
-
const max = i === sizes.length - 1 ? undefined : sizes[i + 1][1];
|
|
4252
|
-
if (min === 0) {
|
|
4253
|
-
dict[name] = `(max-width: ${max - 0.01}px)`;
|
|
4254
|
-
}
|
|
4255
|
-
else if (max) {
|
|
4256
|
-
dict[name] = `(max-width: ${max - 0.01}px) and (min-width: ${min}px)`;
|
|
4257
|
-
}
|
|
4258
|
-
else {
|
|
4259
|
-
dict[name] = `(min-width: ${min}px)`;
|
|
4260
|
-
}
|
|
4261
|
-
}
|
|
4262
|
-
return dict;
|
|
4263
|
-
}
|
|
4264
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfBreakpoints, deps: [{ token: BREAKPOINTS_VARS }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4265
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfBreakpoints, providedIn: 'root' }); }
|
|
4266
|
-
}
|
|
4267
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfBreakpoints, decorators: [{
|
|
4268
|
-
type: Injectable,
|
|
4269
|
-
args: [{ providedIn: 'root' }]
|
|
4270
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
4271
|
-
type: Inject,
|
|
4272
|
-
args: [BREAKPOINTS_VARS]
|
|
4273
|
-
}] }, { type: Object, decorators: [{
|
|
4274
|
-
type: Inject,
|
|
4275
|
-
args: [PLATFORM_ID]
|
|
4276
|
-
}] }]; } });
|
|
4277
|
-
class DfMediaQuery {
|
|
4278
|
-
constructor(platformId) {
|
|
4279
|
-
this._isBrowser = isPlatformBrowser(platformId);
|
|
4486
|
+
get sideNavItems$() {
|
|
4487
|
+
return this._sideNavItems$.asObservable();
|
|
4280
4488
|
}
|
|
4281
|
-
|
|
4282
|
-
|
|
4489
|
+
/**
|
|
4490
|
+
* Getter to know the mode Apply for the SideNav
|
|
4491
|
+
* If `true` the SideNav can be in overlay (but not necessary is).
|
|
4492
|
+
*
|
|
4493
|
+
*/
|
|
4494
|
+
get isAppOverlayMode() {
|
|
4495
|
+
return this._isAppOverlayMode;
|
|
4283
4496
|
}
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
}
|
|
4288
|
-
else {
|
|
4289
|
-
return this.notSupported(query);
|
|
4290
|
-
}
|
|
4497
|
+
// initItems must be used to push new items to the service
|
|
4498
|
+
get items() {
|
|
4499
|
+
return this._items;
|
|
4291
4500
|
}
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
}] }]; } });
|
|
4302
|
-
class DfMediaObserver {
|
|
4303
|
-
constructor(_mediaQuery) {
|
|
4304
|
-
this._mediaQuery = _mediaQuery;
|
|
4305
|
-
this._subscription = new Subscription();
|
|
4306
|
-
this._queries = new Map();
|
|
4501
|
+
/**
|
|
4502
|
+
* Use this to toggle a SideNav Item (either from expand to collapse or the other way around).
|
|
4503
|
+
* isCollapsed attribute of the input item is changed.
|
|
4504
|
+
* All items are push again to the stream of items.
|
|
4505
|
+
* This is used internally by the SideNav in case of click and Enter on an Item with subMenus
|
|
4506
|
+
*/
|
|
4507
|
+
toggle(itemInput) {
|
|
4508
|
+
itemInput.isCollapsed = !itemInput.isCollapsed;
|
|
4509
|
+
this.dispatchSideNavItems();
|
|
4307
4510
|
}
|
|
4308
4511
|
/**
|
|
4309
|
-
*
|
|
4310
|
-
*
|
|
4512
|
+
*
|
|
4513
|
+
* @param itemInput
|
|
4311
4514
|
*/
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4515
|
+
collapseItem(itemInput) {
|
|
4516
|
+
this.collapse(itemInput, this._items);
|
|
4517
|
+
this.dispatchSideNavItems();
|
|
4315
4518
|
}
|
|
4316
4519
|
/**
|
|
4317
|
-
*
|
|
4318
|
-
* meta information for any changes of the given queries.
|
|
4319
|
-
* @param value One or more media-queries to be observed.
|
|
4320
|
-
* @returns A stream of matches meta object for the given media-queries.
|
|
4520
|
+
* Use this to collapseAll items
|
|
4321
4521
|
*/
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
result.matches = result.matches || event.matches;
|
|
4326
|
-
result.breakpoints[event.media] = event.matches;
|
|
4327
|
-
return result;
|
|
4328
|
-
}, { matches: false, breakpoints: {} })));
|
|
4522
|
+
collapseAllItems() {
|
|
4523
|
+
this.collapseAll(this._items);
|
|
4524
|
+
this.dispatchSideNavItems();
|
|
4329
4525
|
}
|
|
4330
|
-
|
|
4331
|
-
|
|
4526
|
+
/**
|
|
4527
|
+
* Use this to set/unset the SideNav in an Overlay Menu
|
|
4528
|
+
* If input is `True` then the SideNav will be in an Overlay Menu
|
|
4529
|
+
* (when not collapsed)
|
|
4530
|
+
*
|
|
4531
|
+
*/
|
|
4532
|
+
setInMenuSideNav(on) {
|
|
4533
|
+
this._isInMenuOverlay$.next(on);
|
|
4332
4534
|
}
|
|
4333
|
-
|
|
4334
|
-
|
|
4535
|
+
/**
|
|
4536
|
+
* Use this to collapse the SideNav
|
|
4537
|
+
*
|
|
4538
|
+
*/
|
|
4539
|
+
hideSideNav() {
|
|
4540
|
+
this._isCollapsed$.next(true);
|
|
4335
4541
|
}
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
media: query,
|
|
4343
|
-
matches: queryList.matches
|
|
4344
|
-
});
|
|
4345
|
-
this._subscription.add(fromEvent(queryList, 'change').subscribe((event) => {
|
|
4346
|
-
queryList$.next(event);
|
|
4347
|
-
}));
|
|
4348
|
-
const meta = { mediaQueryList: queryList, mediaQueryList$: queryList$ };
|
|
4349
|
-
this._queries.set(query, meta);
|
|
4350
|
-
return meta;
|
|
4542
|
+
/**
|
|
4543
|
+
* Use this to make the SideNav visible (uncollapse)
|
|
4544
|
+
*
|
|
4545
|
+
*/
|
|
4546
|
+
showSideNav() {
|
|
4547
|
+
this._isCollapsed$.next(false);
|
|
4351
4548
|
}
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
}], ctorParameters: function () { return [{ type: DfMediaQuery }]; } });
|
|
4359
|
-
|
|
4360
|
-
/**
|
|
4361
|
-
* Services you can use to get indication about the current width screen of your application
|
|
4362
|
-
* the matchMedia JS feature (https://developer.mozilla.org/fr/docs/Web/API/Window/matchMedia)
|
|
4363
|
-
*/
|
|
4364
|
-
class DfMedia {
|
|
4365
|
-
constructor(mediaObserver, _breakPointsService) {
|
|
4366
|
-
this.mediaObserver = mediaObserver;
|
|
4367
|
-
this._breakPointsService = _breakPointsService;
|
|
4549
|
+
/**
|
|
4550
|
+
* Use this to toggle the SideNav status collapse/visible
|
|
4551
|
+
*
|
|
4552
|
+
*/
|
|
4553
|
+
toggleSideNav() {
|
|
4554
|
+
this._isCollapsed$.next(!this._isCollapsed$.value);
|
|
4368
4555
|
}
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
queries.push(breakPoints[el] ? breakPoints[el] : el);
|
|
4374
|
-
}
|
|
4375
|
-
}
|
|
4376
|
-
else {
|
|
4377
|
-
queries.push(breakPoints[mediaOrBreakpoints] ? breakPoints[mediaOrBreakpoints] : mediaOrBreakpoints);
|
|
4378
|
-
}
|
|
4379
|
-
return queries;
|
|
4556
|
+
// internal usage from the SideNav. Call when component is destroy
|
|
4557
|
+
removeSideBar() {
|
|
4558
|
+
this._isCollapsed$.next(false);
|
|
4559
|
+
this._isPresent$.next(false);
|
|
4380
4560
|
}
|
|
4381
4561
|
/**
|
|
4382
|
-
*
|
|
4383
|
-
*
|
|
4384
|
-
*
|
|
4385
|
-
*
|
|
4562
|
+
* Use this to set the App Overlay Mode
|
|
4563
|
+
* Input `True` if you want to set the AppOverlay
|
|
4564
|
+
* An event is send to isAppOverlay$ depending on your status
|
|
4565
|
+
* if Input = `True` and isCollapsed = `False` then isAppOverlay$
|
|
4566
|
+
* will be `True`
|
|
4567
|
+
*
|
|
4386
4568
|
*/
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4569
|
+
setAppOverlayMode(on) {
|
|
4570
|
+
this._isAppOverlayMode = on;
|
|
4571
|
+
this.updateOverLay();
|
|
4572
|
+
}
|
|
4573
|
+
// Internal usage to the sidenav component
|
|
4574
|
+
// Do not use
|
|
4575
|
+
setSideNav() {
|
|
4576
|
+
this._isPresent$.next(true);
|
|
4393
4577
|
}
|
|
4394
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMedia, deps: [{ token: DfMediaObserver }, { token: DfBreakpoints }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4395
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMedia, providedIn: 'root' }); }
|
|
4396
|
-
}
|
|
4397
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMedia, decorators: [{
|
|
4398
|
-
type: Injectable,
|
|
4399
|
-
args: [{ providedIn: 'root' }]
|
|
4400
|
-
}], ctorParameters: function () { return [{ type: DfMediaObserver }, { type: DfBreakpoints }]; } });
|
|
4401
|
-
|
|
4402
|
-
/**
|
|
4403
|
-
* Directive using the matchMedia JS feature (https://developer.mozilla.org/fr/docs/Web/API/Window/matchMedia)
|
|
4404
|
-
* to be able to add or remove an element like ngIf is doing.
|
|
4405
|
-
* Import DfMediaModule from DF to use all media elements provided
|
|
4406
|
-
*/
|
|
4407
|
-
class DfIfMediaDirective {
|
|
4408
4578
|
/**
|
|
4409
|
-
*
|
|
4410
|
-
* @param
|
|
4411
|
-
*
|
|
4579
|
+
*
|
|
4580
|
+
* @param itemInput
|
|
4581
|
+
* @param itemsList
|
|
4412
4582
|
*/
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4583
|
+
collapse(itemInput, itemsList) {
|
|
4584
|
+
for (const item of itemsList) {
|
|
4585
|
+
if (item === itemInput && item.subMenus) {
|
|
4586
|
+
item.isCollapsed = true;
|
|
4587
|
+
return true; // propagate the collapse up
|
|
4588
|
+
}
|
|
4589
|
+
else if (item === itemInput) {
|
|
4590
|
+
return true;
|
|
4591
|
+
}
|
|
4592
|
+
else if (item.subMenus) {
|
|
4593
|
+
const needcol = this.collapse(itemInput, item.subMenus);
|
|
4594
|
+
if (needcol) {
|
|
4595
|
+
item.isCollapsed = true; // collapse it
|
|
4596
|
+
return true; // propagate the collapse up
|
|
4597
|
+
}
|
|
4598
|
+
}
|
|
4599
|
+
}
|
|
4600
|
+
return false;
|
|
4417
4601
|
}
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4602
|
+
/**
|
|
4603
|
+
*
|
|
4604
|
+
* @param itemsList
|
|
4605
|
+
*/
|
|
4606
|
+
collapseAll(itemsList) {
|
|
4607
|
+
itemsList.forEach(item => {
|
|
4608
|
+
if (item.subMenus) {
|
|
4609
|
+
item.isCollapsed = true;
|
|
4610
|
+
this.collapseAll(item.subMenus);
|
|
4611
|
+
}
|
|
4612
|
+
});
|
|
4613
|
+
}
|
|
4614
|
+
// Only one item at the time must be active
|
|
4615
|
+
// Active flag in item is only valid for action button and link
|
|
4616
|
+
// Router link does not use this active flag to work
|
|
4617
|
+
// It is up to you to inactivateItems when needed when you mix actionButton and router link
|
|
4618
|
+
// To avoid more than one active state visible
|
|
4619
|
+
setActiveItem(items, foundAnActive = false) {
|
|
4620
|
+
let foundActive = foundAnActive;
|
|
4621
|
+
items.forEach(item => {
|
|
4622
|
+
if (item.isActive && foundAnActive) {
|
|
4623
|
+
throw Error('DfSideNavService must be init with only one isActive item');
|
|
4624
|
+
}
|
|
4625
|
+
else if (item.isActive) {
|
|
4626
|
+
this._activeItem$.next(item);
|
|
4627
|
+
foundActive = true;
|
|
4628
|
+
}
|
|
4629
|
+
if (item.subMenus) {
|
|
4630
|
+
foundActive = this.setActiveItem(item.subMenus, foundActive);
|
|
4631
|
+
}
|
|
4632
|
+
});
|
|
4633
|
+
return foundActive;
|
|
4634
|
+
}
|
|
4635
|
+
addNavItemType(withRouter, items = this._items) {
|
|
4636
|
+
items.forEach(item => {
|
|
4637
|
+
if (!item.type) {
|
|
4638
|
+
if (item.subMenus) {
|
|
4639
|
+
item.type = DfNavItemType.subMenus;
|
|
4640
|
+
}
|
|
4641
|
+
else if (item.isExternal) {
|
|
4642
|
+
item.type = DfNavItemType.externalLink;
|
|
4643
|
+
}
|
|
4644
|
+
else if (withRouter) {
|
|
4645
|
+
item.type = DfNavItemType.routerLink;
|
|
4646
|
+
}
|
|
4647
|
+
else {
|
|
4648
|
+
item.type = DfNavItemType.actionButton;
|
|
4649
|
+
}
|
|
4650
|
+
}
|
|
4651
|
+
if (item.subMenus) {
|
|
4652
|
+
this.addNavItemType(withRouter, item.subMenus);
|
|
4653
|
+
}
|
|
4654
|
+
});
|
|
4424
4655
|
}
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
this._viewContainerRef.clear();
|
|
4428
|
-
}
|
|
4429
|
-
this._subscription.unsubscribe();
|
|
4656
|
+
dispatchSideNavItems() {
|
|
4657
|
+
this._sideNavItems$.next(this._items);
|
|
4430
4658
|
}
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
this._viewInstance = this._viewContainerRef.createEmbeddedView(this._template);
|
|
4434
|
-
}
|
|
4435
|
-
else if (!matches) {
|
|
4436
|
-
this._viewContainerRef.clear();
|
|
4437
|
-
this._viewInstance = null;
|
|
4438
|
-
}
|
|
4659
|
+
updateOverLay() {
|
|
4660
|
+
this._isAppOverlay$.next(this.isAppOverlayMode && this._isCollapsed$.value === false);
|
|
4439
4661
|
}
|
|
4440
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
4441
|
-
static { this.ɵ
|
|
4442
|
-
}
|
|
4443
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfIfMediaDirective, decorators: [{
|
|
4444
|
-
type: Directive,
|
|
4445
|
-
args: [{ selector: '[dfIfMedia]', standalone: true }]
|
|
4446
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: DfMedia }]; }, propDecorators: { dfIfMedia: [{
|
|
4447
|
-
type: Input
|
|
4448
|
-
}] } });
|
|
4449
|
-
|
|
4450
|
-
class DfMediaModule {
|
|
4451
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4452
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfMediaModule, imports: [DfIfMediaDirective], exports: [DfIfMediaDirective] }); }
|
|
4453
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfMediaModule }); }
|
|
4662
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavService, deps: [{ token: DfSideNavConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4663
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavService, providedIn: 'root' }); }
|
|
4454
4664
|
}
|
|
4455
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
4456
|
-
type:
|
|
4665
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavService, decorators: [{
|
|
4666
|
+
type: Injectable,
|
|
4457
4667
|
args: [{
|
|
4458
|
-
|
|
4459
|
-
exports: [DfIfMediaDirective]
|
|
4668
|
+
providedIn: 'root'
|
|
4460
4669
|
}]
|
|
4461
|
-
}] });
|
|
4670
|
+
}], ctorParameters: function () { return [{ type: DfSideNavConfig }]; } });
|
|
4462
4671
|
|
|
4463
4672
|
const environment = {
|
|
4464
4673
|
animation: true,
|
|
@@ -4820,42 +5029,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
4820
5029
|
}]
|
|
4821
5030
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
4822
5031
|
|
|
4823
|
-
/**
|
|
4824
|
-
* DfTitleTruncate directive
|
|
4825
|
-
* It adds the title attribute with the element's inner text as value
|
|
4826
|
-
* when the element is truncated.
|
|
4827
|
-
*/
|
|
4828
|
-
class DfTitleTruncateDirective {
|
|
4829
|
-
constructor(elementRef, renderer) {
|
|
4830
|
-
this.elementRef = elementRef;
|
|
4831
|
-
this.renderer = renderer;
|
|
4832
|
-
}
|
|
4833
|
-
ngOnInit() {
|
|
4834
|
-
this.renderer.addClass(this.elementRef.nativeElement, 'text-truncate');
|
|
4835
|
-
}
|
|
4836
|
-
ngDoCheck() {
|
|
4837
|
-
const { nativeElement } = this.elementRef;
|
|
4838
|
-
const titleAttributeName = 'title';
|
|
4839
|
-
if (hasOverflow(nativeElement)) {
|
|
4840
|
-
const value = nativeElement.innerText;
|
|
4841
|
-
nativeElement.setAttribute(titleAttributeName, value);
|
|
4842
|
-
}
|
|
4843
|
-
else if (nativeElement.getAttribute(titleAttributeName)) {
|
|
4844
|
-
nativeElement.removeAttribute(titleAttributeName);
|
|
4845
|
-
}
|
|
4846
|
-
}
|
|
4847
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTitleTruncateDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4848
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfTitleTruncateDirective, isStandalone: true, selector: "[dfTitleTruncate]", exportAs: ["dfTitleTruncate"], ngImport: i0 }); }
|
|
4849
|
-
}
|
|
4850
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTitleTruncateDirective, decorators: [{
|
|
4851
|
-
type: Directive,
|
|
4852
|
-
args: [{
|
|
4853
|
-
exportAs: 'dfTitleTruncate',
|
|
4854
|
-
selector: '[dfTitleTruncate]',
|
|
4855
|
-
standalone: true
|
|
4856
|
-
}]
|
|
4857
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
4858
|
-
|
|
4859
5032
|
let uniqueId = 0;
|
|
4860
5033
|
/**
|
|
4861
5034
|
* SideNav is a component to provide navigation feature with a panel on the side of your page
|
|
@@ -4876,19 +5049,11 @@ class DfSideNavListComponent {
|
|
|
4876
5049
|
return `df-sidenav-id-${uniqueId};`;
|
|
4877
5050
|
}
|
|
4878
5051
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4879
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfSideNavListComponent, isStandalone: true, selector: "df-sidenavlist", inputs: { items: "items", tplIcon: "tplIcon", tplItem: "tplItem", currentItem: "currentItem", id: "id" }, ngImport: i0, template: "<ul class=\"df-sidenav-list\" [ngbCollapse]=\"currentItem?.isCollapsed ?? false\" [attr.id]=\"id\">\n <li *ngFor=\"let item of items; let i = index\" [ngSwitch]=\"item.type\" dfManageSideNav>\n <ng-container *ngSwitchCase=\"sideNavService.type.subMenus\">\n <ng-template #subMenus>\n <button\n class=\"df-sidenav-item d-flex align-items-center\"\n (click)=\"sideNavService.toggle(item)\"\n type=\"button\"\n [attr.aria-expanded]=\"!item.isCollapsed\"\n [attr.aria-controls]=\"'sidenavControl' + controlledUniqueId.toString() + '-' + i\"\n [class.df-sidenav-item-withicon]=\"item.icon\"\n >\n <ng-template\n *ngIf=\"tplIcon && item.icon; else elseIcon\"\n [ngTemplateOutlet]=\"tplIcon.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n <ng-template #elseIcon>\n <span *ngIf=\"item.icon\" aria-hidden=\"true\" class=\"{{ item.icon }} df-sidenav-icon\"></span>\n </ng-template>\n <span class=\"flex-grow-1 text-nowrap\"
|
|
5052
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfSideNavListComponent, isStandalone: true, selector: "df-sidenavlist", inputs: { items: "items", tplIcon: "tplIcon", tplItem: "tplItem", currentItem: "currentItem", id: "id" }, ngImport: i0, template: "<ul class=\"df-sidenav-list\" [ngbCollapse]=\"currentItem?.isCollapsed ?? false\" [attr.id]=\"id\">\n <li *ngFor=\"let item of items; let i = index\" [ngSwitch]=\"item.type\" dfManageSideNav>\n <ng-container *ngSwitchCase=\"sideNavService.type.subMenus\">\n <ng-template #subMenus>\n <button\n class=\"df-sidenav-item d-flex align-items-center\"\n (click)=\"sideNavService.toggle(item)\"\n type=\"button\"\n [attr.aria-expanded]=\"!item.isCollapsed\"\n [attr.aria-controls]=\"'sidenavControl' + controlledUniqueId.toString() + '-' + i\"\n [class.df-sidenav-item-withicon]=\"item.icon\"\n >\n <ng-template\n *ngIf=\"tplIcon && item.icon; else elseIcon\"\n [ngTemplateOutlet]=\"tplIcon.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n <ng-template #elseIcon>\n <span *ngIf=\"item.icon\" aria-hidden=\"true\" class=\"{{ item.icon }} df-sidenav-icon\"></span>\n </ng-template>\n <span class=\"flex-grow-1 text-nowrap text-truncate\">{{ item.title }}</span>\n <span\n class=\"ms-3\"\n [class.icon-chevron-down]=\"item.isCollapsed\"\n [class.icon-chevron-up]=\"!item.isCollapsed\"\n ></span>\n <!-- put the chevron as icon directly in the menu -->\n <!-- todo the icon and the minimized -->\n </button>\n <!-- we don't pass the icons as they are not suppose to have ones ??-->\n <df-sidenavlist\n [items]=\"item.subMenus ?? []\"\n [tplItem]=\"tplItem\"\n [currentItem]=\"item\"\n [id]=\"'sidenavControl' + controlledUniqueId.toString() + '-' + i\"\n ></df-sidenavlist>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseSubMenus\">\n <ng-container *ngTemplateOutlet=\"subMenus\"></ng-container>\n </ng-container>\n <ng-template #elseSubMenus>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"subMenus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-template #dfSideNavItemContent>\n <ng-template\n *ngIf=\"tplIcon && item.icon; else elseIcon\"\n [ngTemplateOutlet]=\"tplIcon.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n <ng-template #elseIcon>\n <span *ngIf=\"item.icon\" aria-hidden=\"true\" class=\"{{ item.icon }} df-sidenav-icon me-5\"></span>\n </ng-template>\n <span class=\"flex-grow-1 text-nowrap text-truncate\">{{ item.title }}</span>\n </ng-template>\n <ng-container *ngSwitchCase=\"sideNavService.type.actionButton\">\n <ng-template #dfSideNavItemButton>\n <button\n class=\"df-sidenav-item d-flex align-items-center flex-nowrap\"\n (click)=\"sideNavService.activeItem(item)\"\n [class.active]=\"item.isActive\"\n >\n <ng-container *ngTemplateOutlet=\"dfSideNavItemContent\"></ng-container>\n </button>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseAction\">\n <ng-container *ngTemplateOutlet=\"dfSideNavItemButton\"></ng-container>\n </ng-container>\n <ng-template #elseAction>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfSideNavItemButton\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-template #dfRouterTemplate>\n <a\n class=\"df-sidenav-item d-flex align-items-center flex-nowrap\"\n routerLinkActive=\"active\"\n routerLink=\"{{ item.value }}\"\n ariaCurrentWhenActive=\"page\"\n >\n <ng-container *ngTemplateOutlet=\"dfSideNavItemContent\"></ng-container>\n </a>\n </ng-template>\n <ng-container *ngSwitchCase=\"sideNavService.type.routerLink\">\n <ng-container *ngIf=\"!item.breakpoints; else elseRouterLink\">\n <ng-container *ngTemplateOutlet=\"dfRouterTemplate\"></ng-container>\n </ng-container>\n <ng-template #elseRouterLink>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfRouterTemplate\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"sideNavService.type.separator\">\n <ng-template #dfSeparatorTmp>\n <hr class=\"spacing-01\" />\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseSeparator\">\n <ng-container *ngTemplateOutlet=\"dfSeparatorTmp\"></ng-container>\n </ng-container>\n <ng-template #elseSeparator>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfSeparatorTmp\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"sideNavService.type.template\">\n <ng-template\n *ngIf=\"tplItem\"\n [ngTemplateOutlet]=\"tplItem.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"sideNavService.type.title\">\n <ng-template #dfTitleTmp>\n <div class=\"df-sidenav-item df-sidenav-title d-flex align-items-center flex-grow-1\">\n <span class=\"text-nowrap text-truncate text-uppercase text-muted\">{{ item.title }}</span>\n </div>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseTitle\">\n <ng-container *ngTemplateOutlet=\"dfTitleTmp\"></ng-container>\n </ng-container>\n <ng-template #elseTitle>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfTitleTmp\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-template #dfLinkDefaultTmp>\n <a\n class=\"df-sidenav-item d-flex align-items-center flex-nowrap\"\n href=\"{{ item.value }}\"\n [class.active]=\"item.isActive && item.type === sideNavService.type.link\"\n [attr.target]=\"item.type === sideNavService.type.externalLink ? '_blank' : ''\"\n >\n <ng-container *ngTemplateOutlet=\"dfSideNavItemContent\"></ng-container>\n </a>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseDefault\">\n <ng-container *ngTemplateOutlet=\"dfLinkDefaultTmp\"></ng-container>\n </ng-container>\n <ng-template #elseDefault>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfLinkDefaultTmp\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n </li>\n</ul>\n", dependencies: [{ kind: "component", type: DfSideNavListComponent, selector: "df-sidenavlist", inputs: ["items", "tplIcon", "tplItem", "currentItem", "id"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "ngmodule", type: NgbCollapseModule }, { kind: "directive", type: i1.NgbCollapse, selector: "[ngbCollapse]", inputs: ["animation", "ngbCollapse", "horizontal"], outputs: ["ngbCollapseChange", "shown", "hidden"], exportAs: ["ngbCollapse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "ngmodule", type: DfMediaModule }, { kind: "directive", type: DfIfMediaDirective, selector: "[dfIfMedia]", inputs: ["dfIfMedia"] }, { kind: "ngmodule", type: DfSideNavCollapseModule }, { kind: "directive", type: DfManageSideNavDirective, selector: "[dfManageSideNav]" }] }); }
|
|
4880
5053
|
}
|
|
4881
5054
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavListComponent, decorators: [{
|
|
4882
5055
|
type: Component,
|
|
4883
|
-
args: [{ selector: 'df-sidenavlist', standalone: true, imports: [
|
|
4884
|
-
CommonModule,
|
|
4885
|
-
NgbCollapseModule,
|
|
4886
|
-
RouterModule,
|
|
4887
|
-
DfMediaModule,
|
|
4888
|
-
DfSideNavCollapseModule,
|
|
4889
|
-
DfManageSideNavDirective,
|
|
4890
|
-
DfTitleTruncateDirective
|
|
4891
|
-
], template: "<ul class=\"df-sidenav-list\" [ngbCollapse]=\"currentItem?.isCollapsed ?? false\" [attr.id]=\"id\">\n <li *ngFor=\"let item of items; let i = index\" [ngSwitch]=\"item.type\" dfManageSideNav>\n <ng-container *ngSwitchCase=\"sideNavService.type.subMenus\">\n <ng-template #subMenus>\n <button\n class=\"df-sidenav-item d-flex align-items-center\"\n (click)=\"sideNavService.toggle(item)\"\n type=\"button\"\n [attr.aria-expanded]=\"!item.isCollapsed\"\n [attr.aria-controls]=\"'sidenavControl' + controlledUniqueId.toString() + '-' + i\"\n [class.df-sidenav-item-withicon]=\"item.icon\"\n >\n <ng-template\n *ngIf=\"tplIcon && item.icon; else elseIcon\"\n [ngTemplateOutlet]=\"tplIcon.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n <ng-template #elseIcon>\n <span *ngIf=\"item.icon\" aria-hidden=\"true\" class=\"{{ item.icon }} df-sidenav-icon\"></span>\n </ng-template>\n <span class=\"flex-grow-1 text-nowrap\" dfTitleTruncate>{{ item.title }}</span>\n <span\n class=\"ms-3\"\n [class.icon-chevron-down]=\"item.isCollapsed\"\n [class.icon-chevron-up]=\"!item.isCollapsed\"\n ></span>\n <!-- put the chevron as icon directly in the menu -->\n <!-- todo the icon and the minimized -->\n </button>\n <!-- we don't pass the icons as they are not suppose to have ones ??-->\n <df-sidenavlist\n [items]=\"item.subMenus ?? []\"\n [tplItem]=\"tplItem\"\n [currentItem]=\"item\"\n [id]=\"'sidenavControl' + controlledUniqueId.toString() + '-' + i\"\n ></df-sidenavlist>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseSubMenus\">\n <ng-container *ngTemplateOutlet=\"subMenus\"></ng-container>\n </ng-container>\n <ng-template #elseSubMenus>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"subMenus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-template #dfSideNavItemContent>\n <ng-template\n *ngIf=\"tplIcon && item.icon; else elseIcon\"\n [ngTemplateOutlet]=\"tplIcon.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n <ng-template #elseIcon>\n <span *ngIf=\"item.icon\" aria-hidden=\"true\" class=\"{{ item.icon }} df-sidenav-icon me-5\"></span>\n </ng-template>\n <span class=\"flex-grow-1 text-nowrap\" dfTitleTruncate>{{ item.title }}</span>\n </ng-template>\n <ng-container *ngSwitchCase=\"sideNavService.type.actionButton\">\n <ng-template #dfSideNavItemButton>\n <button\n class=\"df-sidenav-item d-flex align-items-center flex-nowrap\"\n (click)=\"sideNavService.activeItem(item)\"\n [class.active]=\"item.isActive\"\n >\n <ng-container *ngTemplateOutlet=\"dfSideNavItemContent\"></ng-container>\n </button>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseAction\">\n <ng-container *ngTemplateOutlet=\"dfSideNavItemButton\"></ng-container>\n </ng-container>\n <ng-template #elseAction>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfSideNavItemButton\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-template #dfRouterTemplate>\n <a\n class=\"df-sidenav-item d-flex align-items-center flex-nowrap\"\n routerLinkActive=\"active\"\n routerLink=\"{{ item.value }}\"\n ariaCurrentWhenActive=\"page\"\n >\n <ng-container *ngTemplateOutlet=\"dfSideNavItemContent\"></ng-container>\n </a>\n </ng-template>\n <ng-container *ngSwitchCase=\"sideNavService.type.routerLink\">\n <ng-container *ngIf=\"!item.breakpoints; else elseRouterLink\">\n <ng-container *ngTemplateOutlet=\"dfRouterTemplate\"></ng-container>\n </ng-container>\n <ng-template #elseRouterLink>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfRouterTemplate\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"sideNavService.type.separator\">\n <ng-template #dfSeparatorTmp>\n <hr class=\"spacing-01\" />\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseSeparator\">\n <ng-container *ngTemplateOutlet=\"dfSeparatorTmp\"></ng-container>\n </ng-container>\n <ng-template #elseSeparator>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfSeparatorTmp\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"sideNavService.type.template\">\n <ng-template\n *ngIf=\"tplItem\"\n [ngTemplateOutlet]=\"tplItem.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"sideNavService.type.title\">\n <ng-template #dfTitleTmp>\n <div class=\"df-sidenav-item df-sidenav-title d-flex align-items-center flex-grow-1\">\n <span class=\"text-nowrap text-uppercase text-muted\" dfTitleTruncate>{{ item.title }}</span>\n </div>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseTitle\">\n <ng-container *ngTemplateOutlet=\"dfTitleTmp\"></ng-container>\n </ng-container>\n <ng-template #elseTitle>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfTitleTmp\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-template #dfLinkDefaultTmp>\n <a\n class=\"df-sidenav-item d-flex align-items-center flex-nowrap\"\n href=\"{{ item.value }}\"\n [class.active]=\"item.isActive && item.type === sideNavService.type.link\"\n [attr.target]=\"item.type === sideNavService.type.externalLink ? '_blank' : ''\"\n >\n <ng-container *ngTemplateOutlet=\"dfSideNavItemContent\"></ng-container>\n </a>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseDefault\">\n <ng-container *ngTemplateOutlet=\"dfLinkDefaultTmp\"></ng-container>\n </ng-container>\n <ng-template #elseDefault>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfLinkDefaultTmp\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n </li>\n</ul>\n" }]
|
|
5056
|
+
args: [{ selector: 'df-sidenavlist', standalone: true, imports: [CommonModule, NgbCollapseModule, RouterModule, DfMediaModule, DfSideNavCollapseModule, DfManageSideNavDirective], template: "<ul class=\"df-sidenav-list\" [ngbCollapse]=\"currentItem?.isCollapsed ?? false\" [attr.id]=\"id\">\n <li *ngFor=\"let item of items; let i = index\" [ngSwitch]=\"item.type\" dfManageSideNav>\n <ng-container *ngSwitchCase=\"sideNavService.type.subMenus\">\n <ng-template #subMenus>\n <button\n class=\"df-sidenav-item d-flex align-items-center\"\n (click)=\"sideNavService.toggle(item)\"\n type=\"button\"\n [attr.aria-expanded]=\"!item.isCollapsed\"\n [attr.aria-controls]=\"'sidenavControl' + controlledUniqueId.toString() + '-' + i\"\n [class.df-sidenav-item-withicon]=\"item.icon\"\n >\n <ng-template\n *ngIf=\"tplIcon && item.icon; else elseIcon\"\n [ngTemplateOutlet]=\"tplIcon.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n <ng-template #elseIcon>\n <span *ngIf=\"item.icon\" aria-hidden=\"true\" class=\"{{ item.icon }} df-sidenav-icon\"></span>\n </ng-template>\n <span class=\"flex-grow-1 text-nowrap text-truncate\">{{ item.title }}</span>\n <span\n class=\"ms-3\"\n [class.icon-chevron-down]=\"item.isCollapsed\"\n [class.icon-chevron-up]=\"!item.isCollapsed\"\n ></span>\n <!-- put the chevron as icon directly in the menu -->\n <!-- todo the icon and the minimized -->\n </button>\n <!-- we don't pass the icons as they are not suppose to have ones ??-->\n <df-sidenavlist\n [items]=\"item.subMenus ?? []\"\n [tplItem]=\"tplItem\"\n [currentItem]=\"item\"\n [id]=\"'sidenavControl' + controlledUniqueId.toString() + '-' + i\"\n ></df-sidenavlist>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseSubMenus\">\n <ng-container *ngTemplateOutlet=\"subMenus\"></ng-container>\n </ng-container>\n <ng-template #elseSubMenus>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"subMenus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-template #dfSideNavItemContent>\n <ng-template\n *ngIf=\"tplIcon && item.icon; else elseIcon\"\n [ngTemplateOutlet]=\"tplIcon.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n <ng-template #elseIcon>\n <span *ngIf=\"item.icon\" aria-hidden=\"true\" class=\"{{ item.icon }} df-sidenav-icon me-5\"></span>\n </ng-template>\n <span class=\"flex-grow-1 text-nowrap text-truncate\">{{ item.title }}</span>\n </ng-template>\n <ng-container *ngSwitchCase=\"sideNavService.type.actionButton\">\n <ng-template #dfSideNavItemButton>\n <button\n class=\"df-sidenav-item d-flex align-items-center flex-nowrap\"\n (click)=\"sideNavService.activeItem(item)\"\n [class.active]=\"item.isActive\"\n >\n <ng-container *ngTemplateOutlet=\"dfSideNavItemContent\"></ng-container>\n </button>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseAction\">\n <ng-container *ngTemplateOutlet=\"dfSideNavItemButton\"></ng-container>\n </ng-container>\n <ng-template #elseAction>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfSideNavItemButton\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-template #dfRouterTemplate>\n <a\n class=\"df-sidenav-item d-flex align-items-center flex-nowrap\"\n routerLinkActive=\"active\"\n routerLink=\"{{ item.value }}\"\n ariaCurrentWhenActive=\"page\"\n >\n <ng-container *ngTemplateOutlet=\"dfSideNavItemContent\"></ng-container>\n </a>\n </ng-template>\n <ng-container *ngSwitchCase=\"sideNavService.type.routerLink\">\n <ng-container *ngIf=\"!item.breakpoints; else elseRouterLink\">\n <ng-container *ngTemplateOutlet=\"dfRouterTemplate\"></ng-container>\n </ng-container>\n <ng-template #elseRouterLink>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfRouterTemplate\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"sideNavService.type.separator\">\n <ng-template #dfSeparatorTmp>\n <hr class=\"spacing-01\" />\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseSeparator\">\n <ng-container *ngTemplateOutlet=\"dfSeparatorTmp\"></ng-container>\n </ng-container>\n <ng-template #elseSeparator>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfSeparatorTmp\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"sideNavService.type.template\">\n <ng-template\n *ngIf=\"tplItem\"\n [ngTemplateOutlet]=\"tplItem.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"sideNavService.type.title\">\n <ng-template #dfTitleTmp>\n <div class=\"df-sidenav-item df-sidenav-title d-flex align-items-center flex-grow-1\">\n <span class=\"text-nowrap text-truncate text-uppercase text-muted\">{{ item.title }}</span>\n </div>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseTitle\">\n <ng-container *ngTemplateOutlet=\"dfTitleTmp\"></ng-container>\n </ng-container>\n <ng-template #elseTitle>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfTitleTmp\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-template #dfLinkDefaultTmp>\n <a\n class=\"df-sidenav-item d-flex align-items-center flex-nowrap\"\n href=\"{{ item.value }}\"\n [class.active]=\"item.isActive && item.type === sideNavService.type.link\"\n [attr.target]=\"item.type === sideNavService.type.externalLink ? '_blank' : ''\"\n >\n <ng-container *ngTemplateOutlet=\"dfSideNavItemContent\"></ng-container>\n </a>\n </ng-template>\n <ng-container *ngIf=\"!item.breakpoints; else elseDefault\">\n <ng-container *ngTemplateOutlet=\"dfLinkDefaultTmp\"></ng-container>\n </ng-container>\n <ng-template #elseDefault>\n <ng-container *dfIfMedia=\"item.breakpoints!\">\n <ng-container *ngTemplateOutlet=\"dfLinkDefaultTmp\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n </li>\n</ul>\n" }]
|
|
4892
5057
|
}], propDecorators: { items: [{
|
|
4893
5058
|
type: Input
|
|
4894
5059
|
}], tplIcon: [{
|
|
@@ -4958,7 +5123,7 @@ class DfSideNavComponent {
|
|
|
4958
5123
|
this.sideNavService.removeSideBar();
|
|
4959
5124
|
}
|
|
4960
5125
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4961
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfSideNavComponent, isStandalone: true, selector: "df-sidenav", host: { properties: { "class.df-sidenav-menu-overlay": "this.overlayClass", "class": "this.elements" } }, queries: [{ propertyName: "tplHeader", first: true, predicate: DfSideNavHeaderDirective, descendants: true }, { propertyName: "tplIcon", first: true, predicate: DfSideNavIconDirective, descendants: true }, { propertyName: "tplItem", first: true, predicate: DfSideNavItemDirective, descendants: true }], ngImport: i0, template: "<ng-template *ngIf=\"tplHeader\" [ngTemplateOutlet]=\"tplHeader.templateRef\"></ng-template>\n<df-sidenavlist [items]=\"(sideNavService.sideNavItems$ | async) ?? []\" [tplIcon]=\"tplIcon\" [tplItem]=\"tplItem\"></df-sidenavlist>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$
|
|
5126
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfSideNavComponent, isStandalone: true, selector: "df-sidenav", host: { properties: { "class.df-sidenav-menu-overlay": "this.overlayClass", "class": "this.elements" } }, queries: [{ propertyName: "tplHeader", first: true, predicate: DfSideNavHeaderDirective, descendants: true }, { propertyName: "tplIcon", first: true, predicate: DfSideNavIconDirective, descendants: true }, { propertyName: "tplItem", first: true, predicate: DfSideNavItemDirective, descendants: true }], ngImport: i0, template: "<ng-template *ngIf=\"tplHeader\" [ngTemplateOutlet]=\"tplHeader.templateRef\"></ng-template>\n<df-sidenavlist [items]=\"(sideNavService.sideNavItems$ | async) ?? []\" [tplIcon]=\"tplIcon\" [tplItem]=\"tplItem\"></df-sidenavlist>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "component", type: DfSideNavListComponent, selector: "df-sidenavlist", inputs: ["items", "tplIcon", "tplItem", "currentItem", "id"] }] }); }
|
|
4962
5127
|
}
|
|
4963
5128
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavComponent, decorators: [{
|
|
4964
5129
|
type: Component,
|
|
@@ -5032,598 +5197,835 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
5032
5197
|
type: Input
|
|
5033
5198
|
}] } });
|
|
5034
5199
|
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5200
|
+
const DF_SELECT_CLASS = 'df-ym';
|
|
5201
|
+
|
|
5202
|
+
class DfManageNavSelectDirective {
|
|
5203
|
+
constructor(select, element, rtlDirectionService, renderer) {
|
|
5204
|
+
this.select = select;
|
|
5205
|
+
this.element = element;
|
|
5206
|
+
this.rtlDirectionService = rtlDirectionService;
|
|
5207
|
+
this.renderer = renderer;
|
|
5208
|
+
}
|
|
5209
|
+
ngOnInit() {
|
|
5210
|
+
this.direction = this.rtlDirectionService.getPageDirection(this.element);
|
|
5211
|
+
}
|
|
5212
|
+
handleKeyDown(event) {
|
|
5213
|
+
if (this.direction === RightToLeftDirectionEnum.LeftToRight) {
|
|
5214
|
+
this.arrowLeftInnerHandler(event);
|
|
5215
|
+
}
|
|
5216
|
+
else {
|
|
5217
|
+
this.arrowRightInnerHandler(event);
|
|
5218
|
+
}
|
|
5219
|
+
}
|
|
5220
|
+
handleKeyDownBackspace(event) {
|
|
5221
|
+
// Clear on backspace is already handled by ng select when clearable is true
|
|
5222
|
+
if (!this.select.clearable && !this.select.searchTerm) {
|
|
5223
|
+
const listBadge = this.element.nativeElement.querySelectorAll(`.${DF_SELECT_CLASS}`);
|
|
5224
|
+
if (listBadge.length > 0) {
|
|
5225
|
+
listBadge[listBadge.length - 1].click();
|
|
5226
|
+
}
|
|
5227
|
+
}
|
|
5228
|
+
}
|
|
5229
|
+
handleKeyDownRight(event) {
|
|
5230
|
+
if (this.direction === RightToLeftDirectionEnum.LeftToRight) {
|
|
5231
|
+
this.arrowRightInnerHandler(event);
|
|
5232
|
+
}
|
|
5233
|
+
else {
|
|
5234
|
+
this.arrowLeftInnerHandler(event);
|
|
5235
|
+
}
|
|
5236
|
+
}
|
|
5237
|
+
arrowRightInnerHandler(event) {
|
|
5238
|
+
const listBadge = this.element.nativeElement.querySelectorAll(`.${DF_SELECT_CLASS}`);
|
|
5239
|
+
const currentPos = Array.prototype.indexOf.call(listBadge, document.activeElement);
|
|
5240
|
+
// Test if the focus is in the list (otherwise it is in the input and we do nothing)
|
|
5241
|
+
if (currentPos !== -1) {
|
|
5242
|
+
if (currentPos === listBadge.length - 1) {
|
|
5243
|
+
this.select.focus();
|
|
5244
|
+
}
|
|
5245
|
+
else {
|
|
5246
|
+
(listBadge[currentPos + 1] || document.activeElement).focus();
|
|
5247
|
+
}
|
|
5248
|
+
}
|
|
5249
|
+
else if (event.target.selectionStart === event.target.selectionEnd &&
|
|
5250
|
+
event.target.nodeName === 'INPUT' &&
|
|
5251
|
+
event.target.selectionStart === event.target.value.length) {
|
|
5252
|
+
const clearEl = this.element.nativeElement.querySelector('.ng-clear-wrapper') ||
|
|
5253
|
+
this.element.nativeElement.querySelector('.ng-clear');
|
|
5254
|
+
if (clearEl) {
|
|
5255
|
+
// Event if it can be added multiple time it is not an issue I think.
|
|
5256
|
+
this.renderer.listen(clearEl, 'keydown.Enter', (e) => {
|
|
5257
|
+
e.stopPropagation(); // kill the event to forbid default ng-select behavior (open the dropdown)
|
|
5258
|
+
this.select.handleClearClick();
|
|
5259
|
+
});
|
|
5260
|
+
clearEl.setAttribute('tabindex', '1'); // To be able to focus the element in chrome
|
|
5261
|
+
clearEl.focus();
|
|
5262
|
+
}
|
|
5263
|
+
}
|
|
5264
|
+
}
|
|
5265
|
+
arrowLeftInnerHandler(event) {
|
|
5266
|
+
const listBadge = this.element.nativeElement.querySelectorAll(`.${DF_SELECT_CLASS}`);
|
|
5267
|
+
if (event.target.selectionStart === event.target.selectionEnd &&
|
|
5268
|
+
event.target.selectionStart === 0 &&
|
|
5269
|
+
event.target.nodeName === 'INPUT') {
|
|
5270
|
+
if (listBadge.length > 0) {
|
|
5271
|
+
listBadge[listBadge.length - 1].focus();
|
|
5272
|
+
}
|
|
5273
|
+
}
|
|
5274
|
+
else if (event.target.classList.contains('ng-clear-wrapper') || event.target.classList.contains('ng-clear')) {
|
|
5275
|
+
this.select.focus();
|
|
5276
|
+
}
|
|
5277
|
+
else {
|
|
5278
|
+
const currentPos = Array.prototype.indexOf.call(listBadge, document.activeElement);
|
|
5279
|
+
(listBadge[currentPos - 1] || document.activeElement).focus();
|
|
5280
|
+
}
|
|
5281
|
+
}
|
|
5282
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfManageNavSelectDirective, deps: [{ token: i1$2.NgSelectComponent, host: true }, { token: i0.ElementRef }, { token: DfDirectionDetectionService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5283
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfManageNavSelectDirective, isStandalone: true, selector: "[dfManageNavSelect]", host: { listeners: { "keydown.arrowLeft": "handleKeyDown($event)", "keydown.Backspace": "handleKeyDownBackspace($event)", "keydown.arrowRight": "handleKeyDownRight($event)" } }, ngImport: i0 }); }
|
|
5052
5284
|
}
|
|
5053
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5054
|
-
type:
|
|
5285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfManageNavSelectDirective, decorators: [{
|
|
5286
|
+
type: Directive,
|
|
5055
5287
|
args: [{
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5288
|
+
selector: '[dfManageNavSelect]',
|
|
5289
|
+
standalone: true
|
|
5290
|
+
}]
|
|
5291
|
+
}], ctorParameters: function () { return [{ type: i1$2.NgSelectComponent, decorators: [{
|
|
5292
|
+
type: Host
|
|
5293
|
+
}] }, { type: i0.ElementRef }, { type: DfDirectionDetectionService }, { type: i0.Renderer2 }]; }, propDecorators: { handleKeyDown: [{
|
|
5294
|
+
type: HostListener,
|
|
5295
|
+
args: ['keydown.arrowLeft', ['$event']]
|
|
5296
|
+
}], handleKeyDownBackspace: [{
|
|
5297
|
+
type: HostListener,
|
|
5298
|
+
args: ['keydown.Backspace', ['$event']]
|
|
5299
|
+
}], handleKeyDownRight: [{
|
|
5300
|
+
type: HostListener,
|
|
5301
|
+
args: ['keydown.arrowRight', ['$event']]
|
|
5302
|
+
}] } });
|
|
5303
|
+
|
|
5304
|
+
// Copy of https://github.com/ng-select/ng-select/blob/master/src/ng-option-highlight/lib/ng-option-highlight.directive.ts
|
|
5305
|
+
class DfOptionHighlightDirective {
|
|
5306
|
+
constructor(elementRef, renderer) {
|
|
5307
|
+
this.elementRef = elementRef;
|
|
5308
|
+
this.renderer = renderer;
|
|
5309
|
+
this.element = this.elementRef.nativeElement;
|
|
5310
|
+
}
|
|
5311
|
+
ngOnChanges() {
|
|
5312
|
+
if (this.canHighlight) {
|
|
5313
|
+
this.highlightLabel();
|
|
5314
|
+
}
|
|
5315
|
+
else if (this.label) { // unhighlight if there was some
|
|
5316
|
+
this.setInnerHtml(this.label);
|
|
5317
|
+
}
|
|
5318
|
+
}
|
|
5319
|
+
ngAfterViewInit() {
|
|
5320
|
+
this.label = this.element.innerHTML;
|
|
5321
|
+
if (this.canHighlight) {
|
|
5322
|
+
this.highlightLabel();
|
|
5323
|
+
}
|
|
5324
|
+
}
|
|
5325
|
+
escapeRegExp(str) {
|
|
5326
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
5327
|
+
}
|
|
5328
|
+
highlightLabel() {
|
|
5329
|
+
const label = this.label;
|
|
5330
|
+
if (!this.term) {
|
|
5331
|
+
this.setInnerHtml(label);
|
|
5332
|
+
return;
|
|
5333
|
+
}
|
|
5334
|
+
const alternationString = this.escapeRegExp(this.term).replace(' ', '|');
|
|
5335
|
+
const termRegex = new RegExp(alternationString, 'gi');
|
|
5336
|
+
this.setInnerHtml(label.replace(termRegex, `<span class=\"highlighted\">$&</span>`));
|
|
5337
|
+
}
|
|
5338
|
+
get canHighlight() {
|
|
5339
|
+
return this.isDefined(this.term) && this.isDefined(this.label);
|
|
5340
|
+
}
|
|
5341
|
+
setInnerHtml(html) {
|
|
5342
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'innerHTML', html);
|
|
5343
|
+
}
|
|
5344
|
+
isDefined(value) {
|
|
5345
|
+
return value !== undefined && value !== null;
|
|
5346
|
+
}
|
|
5347
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfOptionHighlightDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5348
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfOptionHighlightDirective, isStandalone: true, selector: "[dfOptionHighlight]", inputs: { term: ["dfOptionHighlight", "term"] }, usesOnChanges: true, ngImport: i0 }); }
|
|
5349
|
+
}
|
|
5350
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfOptionHighlightDirective, decorators: [{
|
|
5351
|
+
type: Directive,
|
|
5352
|
+
args: [{
|
|
5353
|
+
selector: '[dfOptionHighlight]',
|
|
5354
|
+
standalone: true
|
|
5074
5355
|
}]
|
|
5075
|
-
}] }
|
|
5356
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { term: [{
|
|
5357
|
+
type: Input,
|
|
5358
|
+
args: ['dfOptionHighlight']
|
|
5359
|
+
}] } });
|
|
5076
5360
|
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
}
|
|
5083
|
-
else {
|
|
5084
|
-
this.renderer.removeClass(this.element.nativeElement, selectedClass);
|
|
5085
|
-
}
|
|
5086
|
-
}
|
|
5087
|
-
constructor(element, renderer) {
|
|
5088
|
-
this.element = element;
|
|
5361
|
+
// Put to avoid opening of the select after removal. See why in file:
|
|
5362
|
+
// https://github.com/ng-select/ng-select/blob/57c6671a972d23beddcca2b6acc9418544c17a2e/src/ng-select/ng-select.component.ts#L307
|
|
5363
|
+
const NG_SELECT_CLASS_IDENTIFIER = 'ng-value-icon';
|
|
5364
|
+
class DfManageBadgeEventsDirective {
|
|
5365
|
+
constructor(renderer, element) {
|
|
5089
5366
|
this.renderer = renderer;
|
|
5367
|
+
this.element = element;
|
|
5368
|
+
this.tabindex = '-1';
|
|
5369
|
+
this.renderer.addClass(this.element.nativeElement, DF_SELECT_CLASS);
|
|
5370
|
+
this.renderer.addClass(this.element.nativeElement, NG_SELECT_CLASS_IDENTIFIER);
|
|
5090
5371
|
}
|
|
5091
5372
|
ngAfterViewInit() {
|
|
5092
|
-
|
|
5093
|
-
|
|
5373
|
+
const childs = this.element.nativeElement.children;
|
|
5374
|
+
const map = Array.from(childs);
|
|
5375
|
+
map.forEach((element) => {
|
|
5376
|
+
this.renderer.addClass(element, NG_SELECT_CLASS_IDENTIFIER);
|
|
5377
|
+
});
|
|
5094
5378
|
}
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
// The card must have only one input
|
|
5099
|
-
if (!(target.classList.contains('form-check-input') || target.classList.contains('form-check-label'))) {
|
|
5100
|
-
this.input.click();
|
|
5101
|
-
}
|
|
5102
|
-
else {
|
|
5103
|
-
this.element.nativeElement.focus();
|
|
5104
|
-
}
|
|
5379
|
+
handleKeyDownBackspace(event) {
|
|
5380
|
+
this.dfManageBadgeEventsSelect[0](this.dfManageBadgeEventsSelect[1]);
|
|
5381
|
+
event.stopPropagation();
|
|
5105
5382
|
}
|
|
5106
|
-
|
|
5107
|
-
|
|
5383
|
+
handleClick(event) {
|
|
5384
|
+
this.dfManageBadgeEventsSelect[0](this.dfManageBadgeEventsSelect[1]);
|
|
5385
|
+
event.stopPropagation();
|
|
5386
|
+
}
|
|
5387
|
+
handleKeyDownEnter(event) {
|
|
5388
|
+
this.dfManageBadgeEventsSelect[0](this.dfManageBadgeEventsSelect[1]);
|
|
5389
|
+
event.stopPropagation();
|
|
5390
|
+
}
|
|
5391
|
+
handleKeyDownDelete(event) {
|
|
5392
|
+
this.dfManageBadgeEventsSelect[0](this.dfManageBadgeEventsSelect[1]);
|
|
5393
|
+
event.stopPropagation();
|
|
5394
|
+
}
|
|
5395
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfManageBadgeEventsDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5396
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfManageBadgeEventsDirective, isStandalone: true, selector: "[dfManageBadgeEventsSelect]", inputs: { dfManageBadgeEventsSelect: "dfManageBadgeEventsSelect" }, host: { listeners: { "keydown.Backspace": "handleKeyDownBackspace($event)", "click": "handleClick($event)", "keydown.Enter": "handleKeyDownEnter($event)", "keydown.Delete": "handleKeyDownDelete($event)" }, properties: { "attr.tabindex": "this.tabindex" } }, ngImport: i0 }); }
|
|
5108
5397
|
}
|
|
5109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfManageBadgeEventsDirective, decorators: [{
|
|
5110
5399
|
type: Directive,
|
|
5111
5400
|
args: [{
|
|
5112
|
-
selector: '[
|
|
5401
|
+
selector: '[dfManageBadgeEventsSelect]',
|
|
5113
5402
|
standalone: true
|
|
5114
5403
|
}]
|
|
5115
|
-
}], ctorParameters: function () { return [{ type: i0.
|
|
5404
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { dfManageBadgeEventsSelect: [{
|
|
5116
5405
|
type: Input
|
|
5117
|
-
}],
|
|
5406
|
+
}], tabindex: [{
|
|
5407
|
+
type: HostBinding,
|
|
5408
|
+
args: ['attr.tabindex']
|
|
5409
|
+
}], handleKeyDownBackspace: [{
|
|
5410
|
+
type: HostListener,
|
|
5411
|
+
args: ['keydown.Backspace', ['$event']]
|
|
5412
|
+
}], handleClick: [{
|
|
5118
5413
|
type: HostListener,
|
|
5119
5414
|
args: ['click', ['$event']]
|
|
5415
|
+
}], handleKeyDownEnter: [{
|
|
5416
|
+
type: HostListener,
|
|
5417
|
+
args: ['keydown.Enter', ['$event']]
|
|
5418
|
+
}], handleKeyDownDelete: [{
|
|
5419
|
+
type: HostListener,
|
|
5420
|
+
args: ['keydown.Delete', ['$event']]
|
|
5120
5421
|
}] } });
|
|
5121
5422
|
|
|
5122
|
-
class
|
|
5123
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5124
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5125
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5423
|
+
class DfSelectModule {
|
|
5424
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
5425
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfSelectModule, imports: [DfManageNavSelectDirective, DfManageBadgeEventsDirective, DfOptionHighlightDirective], exports: [DfManageNavSelectDirective, DfManageBadgeEventsDirective, DfOptionHighlightDirective, NgSelectModule] }); }
|
|
5426
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSelectModule, imports: [NgSelectModule] }); }
|
|
5126
5427
|
}
|
|
5127
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5428
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSelectModule, decorators: [{
|
|
5128
5429
|
type: NgModule,
|
|
5129
5430
|
args: [{
|
|
5130
|
-
imports: [
|
|
5131
|
-
exports: [
|
|
5431
|
+
imports: [DfManageNavSelectDirective, DfManageBadgeEventsDirective, DfOptionHighlightDirective],
|
|
5432
|
+
exports: [DfManageNavSelectDirective, DfManageBadgeEventsDirective, DfOptionHighlightDirective, NgSelectModule]
|
|
5132
5433
|
}]
|
|
5133
5434
|
}] });
|
|
5134
5435
|
|
|
5135
|
-
|
|
5136
|
-
(function (DfProgressIndicatorContentType) {
|
|
5137
|
-
DfProgressIndicatorContentType["SPINNER"] = "spinner";
|
|
5138
|
-
DfProgressIndicatorContentType["PROGRESSBAR"] = "progressbar";
|
|
5139
|
-
})(DfProgressIndicatorContentType || (DfProgressIndicatorContentType = {}));
|
|
5140
|
-
class DfProgressIndicatorContentSpinner {
|
|
5141
|
-
constructor(spinnerInput) {
|
|
5142
|
-
this.type = DfProgressIndicatorContentType.SPINNER;
|
|
5143
|
-
this.spinnerInput = spinnerInput;
|
|
5144
|
-
}
|
|
5145
|
-
}
|
|
5146
|
-
class DfProgressIndicatorContentProgressBar {
|
|
5147
|
-
constructor(progressBarInput, position) {
|
|
5148
|
-
this.type = DfProgressIndicatorContentType.PROGRESSBAR;
|
|
5149
|
-
this.progressBarInput = progressBarInput;
|
|
5150
|
-
this.position = position || DfProgressIndicatorContentPosition.TOP;
|
|
5151
|
-
}
|
|
5152
|
-
}
|
|
5153
|
-
var DfProgressIndicatorContentPosition;
|
|
5154
|
-
(function (DfProgressIndicatorContentPosition) {
|
|
5155
|
-
DfProgressIndicatorContentPosition["TOP"] = "top";
|
|
5156
|
-
DfProgressIndicatorContentPosition["BOTTOM"] = "bottom";
|
|
5157
|
-
DfProgressIndicatorContentPosition["CENTERED"] = "centered";
|
|
5158
|
-
})(DfProgressIndicatorContentPosition || (DfProgressIndicatorContentPosition = {}));
|
|
5159
|
-
|
|
5160
|
-
class DfProgressIndicatorContainerComponent {
|
|
5436
|
+
class DfStepperService {
|
|
5161
5437
|
constructor() {
|
|
5162
|
-
this.
|
|
5163
|
-
this.
|
|
5438
|
+
this.setFocus = false;
|
|
5439
|
+
this._stepperState$ = new BehaviorSubject({
|
|
5440
|
+
steps: [],
|
|
5441
|
+
active: 0,
|
|
5442
|
+
isLinear: false,
|
|
5443
|
+
isInline: false,
|
|
5444
|
+
isVertical: false
|
|
5445
|
+
});
|
|
5446
|
+
this._state = {
|
|
5447
|
+
steps: [],
|
|
5448
|
+
active: 0,
|
|
5449
|
+
isLinear: false,
|
|
5450
|
+
isInline: false,
|
|
5451
|
+
isVertical: false
|
|
5452
|
+
};
|
|
5453
|
+
this._completedLabel = 'Completed';
|
|
5454
|
+
this._warningLabel = 'Warning';
|
|
5455
|
+
this._stepperAriaLabel = 'Stepper';
|
|
5164
5456
|
}
|
|
5165
|
-
get
|
|
5166
|
-
return
|
|
5457
|
+
get stepperState$() {
|
|
5458
|
+
return this._stepperState$.asObservable();
|
|
5167
5459
|
}
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
this.positionClass = 'df-progressindicator-top';
|
|
5172
|
-
break;
|
|
5173
|
-
case DfProgressIndicatorContentPosition.BOTTOM:
|
|
5174
|
-
this.positionClass = 'df-progressindicator-bottom';
|
|
5175
|
-
break;
|
|
5176
|
-
default:
|
|
5177
|
-
this.positionClass = this.DEFAULT_CLASS_POSITION;
|
|
5178
|
-
}
|
|
5179
|
-
this._position = newPosition;
|
|
5460
|
+
// initState must be used to push new Steps to the service
|
|
5461
|
+
get state() {
|
|
5462
|
+
return this._state;
|
|
5180
5463
|
}
|
|
5181
|
-
|
|
5182
|
-
|
|
5464
|
+
dispatchStepperState() {
|
|
5465
|
+
this._stepperState$.next(this._state);
|
|
5183
5466
|
}
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5188
|
-
}
|
|
5189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfProgressIndicatorContainerComponent, decorators: [{
|
|
5190
|
-
type: Component,
|
|
5191
|
-
args: [{
|
|
5192
|
-
selector: 'df-progressindicator-container',
|
|
5193
|
-
encapsulation: ViewEncapsulation.None,
|
|
5194
|
-
template: `
|
|
5195
|
-
<ng-content></ng-content>
|
|
5196
|
-
`,
|
|
5197
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5198
|
-
standalone: true
|
|
5199
|
-
}]
|
|
5200
|
-
}], propDecorators: { classes: [{
|
|
5201
|
-
type: HostBinding,
|
|
5202
|
-
args: ['class']
|
|
5203
|
-
}], containerClass: [{
|
|
5204
|
-
type: Input
|
|
5205
|
-
}], position: [{
|
|
5206
|
-
type: Input
|
|
5207
|
-
}] } });
|
|
5208
|
-
|
|
5209
|
-
class DfDefaultSpinnerComponent {
|
|
5210
|
-
constructor() {
|
|
5211
|
-
this.isGlobalSpinner = false;
|
|
5212
|
-
this.contentClass = 'spinner-border text-primary';
|
|
5467
|
+
updateStepperState() {
|
|
5468
|
+
this._state = this.normalizeState(this._state);
|
|
5469
|
+
this.dispatchStepperState();
|
|
5213
5470
|
}
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
}], ariaLabel: [{
|
|
5225
|
-
type: Input
|
|
5226
|
-
}] } });
|
|
5227
|
-
|
|
5228
|
-
class DfProgressIndicatorBackdropComponent {
|
|
5229
|
-
constructor() {
|
|
5230
|
-
this.isGlobalBackdrop = true;
|
|
5471
|
+
// API
|
|
5472
|
+
/**
|
|
5473
|
+
* Use this to init the list of Elements from your stepper
|
|
5474
|
+
*
|
|
5475
|
+
* Here we are not deep copying the array --> the function will change it
|
|
5476
|
+
*/
|
|
5477
|
+
initStepperState(state) {
|
|
5478
|
+
// normalize the steps here
|
|
5479
|
+
this._state = this.normalizeState(state);
|
|
5480
|
+
this.dispatchStepperState();
|
|
5231
5481
|
}
|
|
5232
|
-
|
|
5233
|
-
|
|
5482
|
+
/**
|
|
5483
|
+
* Use this to normalize the state of the stepper (completed, warning, current, future)
|
|
5484
|
+
* @param state
|
|
5485
|
+
* @returns
|
|
5486
|
+
*/
|
|
5487
|
+
normalizeState(state) {
|
|
5488
|
+
const stepsList = [];
|
|
5489
|
+
for (let i = 0; i < state.steps.length; i++) {
|
|
5490
|
+
if (state.steps[i].warning) {
|
|
5491
|
+
stepsList.push({ ...state.steps[i], type: 'warning' });
|
|
5492
|
+
}
|
|
5493
|
+
else if (i === state.active) {
|
|
5494
|
+
stepsList.push({ ...state.steps[i], type: 'current' });
|
|
5495
|
+
}
|
|
5496
|
+
else if (state.steps[i].completed) {
|
|
5497
|
+
stepsList.push({ ...state.steps[i], type: 'completed' });
|
|
5498
|
+
}
|
|
5499
|
+
else {
|
|
5500
|
+
stepsList.push({ ...state.steps[i], type: 'future' });
|
|
5501
|
+
}
|
|
5502
|
+
}
|
|
5503
|
+
return { ...state, steps: stepsList };
|
|
5234
5504
|
}
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
args: [{
|
|
5241
|
-
selector: 'df-progressindicator-backdrop',
|
|
5242
|
-
template: '',
|
|
5243
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5244
|
-
standalone: true
|
|
5245
|
-
}]
|
|
5246
|
-
}], propDecorators: { classes: [{
|
|
5247
|
-
type: HostBinding,
|
|
5248
|
-
args: ['class']
|
|
5249
|
-
}], backdropClass: [{
|
|
5250
|
-
type: Input
|
|
5251
|
-
}], isGlobalBackdrop: [{
|
|
5252
|
-
type: Input
|
|
5253
|
-
}] } });
|
|
5254
|
-
|
|
5255
|
-
class DfProgressIndicatorRef {
|
|
5256
|
-
constructor(containerRef, contentRef, backdropRef) {
|
|
5257
|
-
this.containerRef = containerRef;
|
|
5258
|
-
this.contentRef = contentRef;
|
|
5259
|
-
this.backdropRef = backdropRef;
|
|
5505
|
+
/**
|
|
5506
|
+
* Internal to get the stepper aria label in the template
|
|
5507
|
+
*/
|
|
5508
|
+
get stepperAriaLabel() {
|
|
5509
|
+
return this._stepperAriaLabel;
|
|
5260
5510
|
}
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
class ScrollBar {
|
|
5273
|
-
constructor(_document) {
|
|
5274
|
-
this._document = _document;
|
|
5511
|
+
/**
|
|
5512
|
+
* Use this to set the stepper aria label (i18n)
|
|
5513
|
+
*/
|
|
5514
|
+
set stepperAriaLabel(label) {
|
|
5515
|
+
this._stepperAriaLabel = label;
|
|
5516
|
+
}
|
|
5517
|
+
/**
|
|
5518
|
+
* Internal to get the completed label in the template
|
|
5519
|
+
*/
|
|
5520
|
+
get completedLabel() {
|
|
5521
|
+
return this._completedLabel;
|
|
5275
5522
|
}
|
|
5276
5523
|
/**
|
|
5277
|
-
*
|
|
5278
|
-
*
|
|
5279
|
-
* - if there was a scrollbar, adds some compensation padding to the body
|
|
5280
|
-
* to keep the same layout as when the scrollbar is there
|
|
5281
|
-
* - if there was none, there is nothing to do
|
|
5282
|
-
*
|
|
5283
|
-
* @return a callback used to revert the compensation (noop if there was none,
|
|
5284
|
-
* otherwise a function removing the padding)
|
|
5524
|
+
* Internal to get the waring label in the template
|
|
5285
5525
|
*/
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
return !this._isPresent(width) ? noop : this._adjustBody(width);
|
|
5526
|
+
get warningLabel() {
|
|
5527
|
+
return this._warningLabel;
|
|
5289
5528
|
}
|
|
5290
5529
|
/**
|
|
5291
|
-
*
|
|
5292
|
-
*
|
|
5293
|
-
* @return a callback used to revert the padding to its previous value
|
|
5530
|
+
* Use this to set the completed label (i18n)
|
|
5294
5531
|
*/
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
const userSetPaddingStyle = body.style.paddingRight;
|
|
5298
|
-
const paddingRight = 'padding-right';
|
|
5299
|
-
const actualPadding = parseFloat(window.getComputedStyle(body)[paddingRight]);
|
|
5300
|
-
body.style[paddingRight] = `${actualPadding + scrollbarWidth}px`;
|
|
5301
|
-
return () => (body.style[paddingRight] = userSetPaddingStyle);
|
|
5532
|
+
set completedLabel(label) {
|
|
5533
|
+
this._completedLabel = label;
|
|
5302
5534
|
}
|
|
5303
5535
|
/**
|
|
5304
|
-
*
|
|
5305
|
-
*
|
|
5306
|
-
* @return true if scrollbar is present, false otherwise
|
|
5536
|
+
* Use this to set the warning label (i18n)
|
|
5307
5537
|
*/
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5538
|
+
set warningLabel(label) {
|
|
5539
|
+
this._warningLabel = label;
|
|
5540
|
+
}
|
|
5541
|
+
/**
|
|
5542
|
+
* TODO make it customizable
|
|
5543
|
+
* @param index - index of the step
|
|
5544
|
+
* @returns - string of the step number to display
|
|
5545
|
+
*/
|
|
5546
|
+
getStepNumberLabel(index) {
|
|
5547
|
+
return `${index + 1}`;
|
|
5548
|
+
}
|
|
5549
|
+
resetFocus() {
|
|
5550
|
+
this.setFocus = false;
|
|
5313
5551
|
}
|
|
5314
5552
|
/**
|
|
5315
|
-
* Calculates and returns the width of a scrollbar.
|
|
5316
5553
|
*
|
|
5317
|
-
* @
|
|
5554
|
+
* @param isLinear - true if the stepper is linear
|
|
5318
5555
|
*/
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
const body = this._document.body;
|
|
5323
|
-
body.appendChild(measurer);
|
|
5324
|
-
const width = measurer.getBoundingClientRect().width - measurer.clientWidth;
|
|
5325
|
-
body.removeChild(measurer);
|
|
5326
|
-
return width;
|
|
5556
|
+
setLinear(isLinear) {
|
|
5557
|
+
this._state.isLinear = isLinear;
|
|
5558
|
+
this.dispatchStepperState();
|
|
5327
5559
|
}
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
type: Inject,
|
|
5336
|
-
args: [DOCUMENT]
|
|
5337
|
-
}] }]; } });
|
|
5338
|
-
|
|
5339
|
-
class DfProgressIndicatorService {
|
|
5340
|
-
constructor(document, rendererFactory, componentFactoryResolver, appRef, injector, scrollbar) {
|
|
5341
|
-
this.document = document;
|
|
5342
|
-
this.rendererFactory = rendererFactory;
|
|
5343
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
5344
|
-
this.appRef = appRef;
|
|
5345
|
-
this.injector = injector;
|
|
5346
|
-
this.scrollbar = scrollbar;
|
|
5347
|
-
this.BODY_CLASS = 'df-progressindicator-open';
|
|
5348
|
-
// TODO - Remove it when https://github.com/angular/angular/issues/22567
|
|
5349
|
-
this.containerAttributes = ['containerClass', 'position'];
|
|
5350
|
-
this.backdropAttributes = ['backdropClass', 'isGlobalBackdrop'];
|
|
5351
|
-
this.defaultSpinnerAttributes = ['contentClass', 'ariaLabel', 'isGlobalSpinner'];
|
|
5352
|
-
this.defaultProgressBarAttributes = ['infiniteAnimation', 'ariaLabel'];
|
|
5353
|
-
this.activeInstances = [];
|
|
5354
|
-
this.renderer = this.rendererFactory.createRenderer(null, null);
|
|
5560
|
+
/**
|
|
5561
|
+
*
|
|
5562
|
+
* @param isInline - true if the stepper is inline
|
|
5563
|
+
*/
|
|
5564
|
+
setInline(isInline) {
|
|
5565
|
+
this._state.isInline = isInline;
|
|
5566
|
+
this.dispatchStepperState();
|
|
5355
5567
|
}
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
const backdropRef = options?.backdrop !== false
|
|
5364
|
-
? this.createComponent(DfProgressIndicatorBackdropComponent, this.componentFactoryResolver, undefined, containerElt)
|
|
5365
|
-
: undefined;
|
|
5366
|
-
const contentRef = this.getContent(content, this.componentFactoryResolver, containerElt);
|
|
5367
|
-
const containerCmpRef = this.createComponent(DfProgressIndicatorContainerComponent, this.componentFactoryResolver, contentRef, containerElt);
|
|
5368
|
-
const onDestroyOperations = [];
|
|
5369
|
-
// Add aria attributes on the container
|
|
5370
|
-
this.renderer.setAttribute(containerElt, 'aria-busy', 'true');
|
|
5371
|
-
onDestroyOperations.push(() => {
|
|
5372
|
-
this.renderer.removeAttribute(containerElt, 'aria-busy');
|
|
5373
|
-
});
|
|
5374
|
-
// Override some styles if body is the container
|
|
5375
|
-
if (containerElt === this.document.body) {
|
|
5376
|
-
const scrollCompensation = this.scrollbar.compensate();
|
|
5377
|
-
this.renderer.addClass(this.document.body, this.BODY_CLASS);
|
|
5378
|
-
this.renderer.setAttribute(this.document.body, 'aria-busy', 'true');
|
|
5379
|
-
onDestroyOperations.push(() => {
|
|
5380
|
-
scrollCompensation();
|
|
5381
|
-
this.renderer.removeClass(this.document.body, this.BODY_CLASS);
|
|
5382
|
-
});
|
|
5383
|
-
}
|
|
5384
|
-
if (onDestroyOperations.length > 0) {
|
|
5385
|
-
containerCmpRef.onDestroy(() => {
|
|
5386
|
-
onDestroyOperations.forEach(operation => {
|
|
5387
|
-
operation();
|
|
5388
|
-
});
|
|
5389
|
-
});
|
|
5390
|
-
}
|
|
5391
|
-
// Force override of position in case of the use of a progress bar component
|
|
5392
|
-
if (content instanceof DfProgressIndicatorContentProgressBar) {
|
|
5393
|
-
options = {
|
|
5394
|
-
...options,
|
|
5395
|
-
position: content.position
|
|
5396
|
-
};
|
|
5397
|
-
}
|
|
5398
|
-
// Apply options to the created components
|
|
5399
|
-
if (backdropRef) {
|
|
5400
|
-
this.applyOptions(backdropRef, this.backdropAttributes, { ...options, isGlobalBackdrop: containerElt === this.document.body });
|
|
5568
|
+
/**
|
|
5569
|
+
*
|
|
5570
|
+
* @param index - index of the step to select start at 0
|
|
5571
|
+
*/
|
|
5572
|
+
selectStep(index) {
|
|
5573
|
+
if (index < 0 || index >= this._state.steps.length) {
|
|
5574
|
+
return;
|
|
5401
5575
|
}
|
|
5402
|
-
this.
|
|
5403
|
-
|
|
5404
|
-
this.activeInstances.push(progressIndicatorRef);
|
|
5405
|
-
return progressIndicatorRef;
|
|
5576
|
+
this._state.active = index;
|
|
5577
|
+
this.updateStepperState();
|
|
5406
5578
|
}
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
progressIndicatorRef[key] = undefined;
|
|
5415
|
-
}
|
|
5416
|
-
});
|
|
5417
|
-
this.activeInstances.splice(instanceIndex, 1);
|
|
5418
|
-
}
|
|
5419
|
-
else {
|
|
5420
|
-
throw new Error('[Design Factory] The specified progress indicator reference is no longer active and cannot be closed.');
|
|
5579
|
+
/**
|
|
5580
|
+
* Same as selectStep but with focus on the step selected
|
|
5581
|
+
* @param index - index of the step to select start at 0
|
|
5582
|
+
*/
|
|
5583
|
+
selectWithFocus(index) {
|
|
5584
|
+
if (index < 0 || index >= this._state.steps.length) {
|
|
5585
|
+
return;
|
|
5421
5586
|
}
|
|
5587
|
+
this.setFocus = true;
|
|
5588
|
+
this.selectStep(index);
|
|
5422
5589
|
}
|
|
5423
5590
|
/**
|
|
5424
|
-
*
|
|
5591
|
+
*
|
|
5592
|
+
* @param index - index of the step to complete start at 0
|
|
5425
5593
|
*/
|
|
5426
|
-
|
|
5427
|
-
if (
|
|
5428
|
-
return
|
|
5594
|
+
completeStep(index) {
|
|
5595
|
+
if (index < 0 || index >= this._state.steps.length) {
|
|
5596
|
+
return;
|
|
5429
5597
|
}
|
|
5430
|
-
|
|
5598
|
+
this._state.steps[index].completed = true;
|
|
5599
|
+
this._state.steps[index].warning = false;
|
|
5600
|
+
this.updateStepperState();
|
|
5431
5601
|
}
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5602
|
+
/**
|
|
5603
|
+
*
|
|
5604
|
+
* @param index - index of the step to complete start at 0
|
|
5605
|
+
*/
|
|
5606
|
+
completeStepAndGoNext(index) {
|
|
5607
|
+
this.completeStep(index);
|
|
5608
|
+
this.selectStep(index + 1);
|
|
5609
|
+
}
|
|
5610
|
+
/**
|
|
5611
|
+
* Attention if the step was completed it will be uncompleted after.
|
|
5612
|
+
* @param index - index of the step to make Warning start at 0
|
|
5613
|
+
* @param warningLabel - label to display in the warning by default it will take the warningLabel if it exists or the label
|
|
5614
|
+
*/
|
|
5615
|
+
makeWarning(index, warningLabel) {
|
|
5616
|
+
if (index < 0 || index >= this._state.steps.length) {
|
|
5617
|
+
return;
|
|
5435
5618
|
}
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5619
|
+
this._state.steps[index].warning = true;
|
|
5620
|
+
this._state.steps[index].completed = false;
|
|
5621
|
+
this._state.steps[index].warningLabel = warningLabel
|
|
5622
|
+
? warningLabel
|
|
5623
|
+
: this._state.steps[index].warningLabel
|
|
5624
|
+
? this._state.steps[index].warningLabel
|
|
5625
|
+
: this._state.steps[index].label;
|
|
5626
|
+
this.updateStepperState();
|
|
5627
|
+
}
|
|
5628
|
+
/**
|
|
5629
|
+
*
|
|
5630
|
+
* @param index - index of the step to remove Warning start at 0
|
|
5631
|
+
*/
|
|
5632
|
+
removeWarning(index) {
|
|
5633
|
+
if (index < 0 || index >= this._state.steps.length) {
|
|
5634
|
+
return;
|
|
5440
5635
|
}
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5636
|
+
this._state.steps[index].warning = false;
|
|
5637
|
+
this.updateStepperState();
|
|
5638
|
+
}
|
|
5639
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5640
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperService }); }
|
|
5641
|
+
}
|
|
5642
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperService, decorators: [{
|
|
5643
|
+
type: Injectable
|
|
5644
|
+
}] });
|
|
5645
|
+
|
|
5646
|
+
const DF_STEP_CLASS = 'df-stepper-step';
|
|
5647
|
+
class DfStepperStepDirective {
|
|
5648
|
+
constructor() {
|
|
5649
|
+
this.unlistener = [];
|
|
5650
|
+
this.renderer2 = inject(Renderer2);
|
|
5651
|
+
this.element = inject(ElementRef);
|
|
5652
|
+
}
|
|
5653
|
+
ngOnInit() {
|
|
5654
|
+
this.unlistener.push(this.renderer2.listen(this.element.nativeElement, 'focus', () => {
|
|
5655
|
+
this.handleFocusTabIndex();
|
|
5656
|
+
}));
|
|
5657
|
+
this.unlistener.push(this.renderer2.listen(this.element.nativeElement, 'blur', (event) => {
|
|
5658
|
+
this.handleBlurTabIndex(event);
|
|
5659
|
+
}));
|
|
5660
|
+
}
|
|
5661
|
+
handleFocusTabIndex() {
|
|
5662
|
+
this.element.nativeElement.tabIndex = 0;
|
|
5663
|
+
}
|
|
5664
|
+
handleBlurTabIndex(event) {
|
|
5665
|
+
if (event.relatedTarget &&
|
|
5666
|
+
'classList' in event.relatedTarget &&
|
|
5667
|
+
event.relatedTarget.classList.contains(DF_STEP_CLASS)) {
|
|
5668
|
+
this.element.nativeElement.tabIndex = -1;
|
|
5445
5669
|
}
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5670
|
+
}
|
|
5671
|
+
ngOnDestroy() {
|
|
5672
|
+
this.unlistener.forEach((ul) => ul());
|
|
5673
|
+
}
|
|
5674
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperStepDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5675
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfStepperStepDirective, isStandalone: true, selector: "[dfStepperStep]", exportAs: ["dfStepperStep"], ngImport: i0 }); }
|
|
5676
|
+
}
|
|
5677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperStepDirective, decorators: [{
|
|
5678
|
+
type: Directive,
|
|
5679
|
+
args: [{
|
|
5680
|
+
selector: '[dfStepperStep]',
|
|
5681
|
+
exportAs: 'dfStepperStep',
|
|
5682
|
+
standalone: true
|
|
5683
|
+
}]
|
|
5684
|
+
}] });
|
|
5685
|
+
class DfStepperDirective {
|
|
5686
|
+
constructor() {
|
|
5687
|
+
this.stepperService = inject(DfStepperService);
|
|
5688
|
+
this.element = inject(ElementRef);
|
|
5689
|
+
this.rtlDirectionService = inject(DfDirectionDetectionService);
|
|
5690
|
+
}
|
|
5691
|
+
ngOnInit() {
|
|
5692
|
+
this.direction = this.rtlDirectionService.getPageDirection(this.element);
|
|
5693
|
+
}
|
|
5694
|
+
handleEnterDown() {
|
|
5695
|
+
this.handleSelect();
|
|
5696
|
+
}
|
|
5697
|
+
handleSpaceDown() {
|
|
5698
|
+
this.handleSelect();
|
|
5699
|
+
}
|
|
5700
|
+
handleGoPrevious() {
|
|
5701
|
+
if (this.direction === RightToLeftDirectionEnum.LeftToRight) {
|
|
5702
|
+
this.arrowLeftInnerHandler();
|
|
5450
5703
|
}
|
|
5451
5704
|
else {
|
|
5452
|
-
|
|
5705
|
+
this.arrowRightInnerHandler();
|
|
5453
5706
|
}
|
|
5454
5707
|
}
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
if (childrenProjectables) {
|
|
5459
|
-
if (childrenProjectables instanceof ComponentRef) {
|
|
5460
|
-
cmpRef = cmpFactory.create(this.injector, [[childrenProjectables.location.nativeElement]]);
|
|
5461
|
-
}
|
|
5462
|
-
else {
|
|
5463
|
-
cmpRef = cmpFactory.create(this.injector, [childrenProjectables.rootNodes]);
|
|
5464
|
-
}
|
|
5708
|
+
handleGoNext() {
|
|
5709
|
+
if (this.direction === RightToLeftDirectionEnum.LeftToRight) {
|
|
5710
|
+
this.arrowRightInnerHandler();
|
|
5465
5711
|
}
|
|
5466
5712
|
else {
|
|
5467
|
-
|
|
5713
|
+
this.arrowLeftInnerHandler();
|
|
5468
5714
|
}
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5715
|
+
}
|
|
5716
|
+
handleKeyDownRight(event) {
|
|
5717
|
+
if (!this.stepperService.state.isVertical) {
|
|
5718
|
+
this.handleGoNext();
|
|
5719
|
+
event.preventDefault();
|
|
5472
5720
|
}
|
|
5473
|
-
return cmpRef;
|
|
5474
5721
|
}
|
|
5475
|
-
|
|
5476
|
-
if (
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
const optionValue = options[option];
|
|
5480
|
-
if (optionValue !== null && optionValue !== undefined) {
|
|
5481
|
-
cmpInst[option] = optionValue;
|
|
5482
|
-
}
|
|
5483
|
-
});
|
|
5722
|
+
handleKeyDown(event) {
|
|
5723
|
+
if (!this.stepperService.state.isVertical) {
|
|
5724
|
+
this.handleGoPrevious();
|
|
5725
|
+
event.preventDefault();
|
|
5484
5726
|
}
|
|
5485
5727
|
}
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
}] }, { type: i0.RendererFactory2 }, { type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }, { type: ScrollBar }]; } });
|
|
5498
|
-
|
|
5499
|
-
class DfProgressIndicatorDirective {
|
|
5500
|
-
constructor(elementRef, progressService) {
|
|
5501
|
-
this.elementRef = elementRef;
|
|
5502
|
-
this.progressService = progressService;
|
|
5728
|
+
handleKeyDownUp(event) {
|
|
5729
|
+
if (this.stepperService.state.isVertical) {
|
|
5730
|
+
this.handleGoNext();
|
|
5731
|
+
event.preventDefault();
|
|
5732
|
+
}
|
|
5733
|
+
}
|
|
5734
|
+
handleKeyDownDown(event) {
|
|
5735
|
+
if (this.stepperService.state.isVertical) {
|
|
5736
|
+
this.handleGoPrevious();
|
|
5737
|
+
event.preventDefault();
|
|
5738
|
+
}
|
|
5503
5739
|
}
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5740
|
+
getSteps() {
|
|
5741
|
+
return this.element.nativeElement.querySelectorAll(`:scope .${DF_STEP_CLASS}`);
|
|
5742
|
+
}
|
|
5743
|
+
handleSelect() {
|
|
5744
|
+
const listStep = this.getSteps();
|
|
5745
|
+
const currentPos = Array.prototype.indexOf.call(listStep, document.activeElement);
|
|
5746
|
+
if (currentPos !== -1) {
|
|
5747
|
+
listStep[currentPos].click();
|
|
5748
|
+
}
|
|
5749
|
+
}
|
|
5750
|
+
arrowRightInnerHandler() {
|
|
5751
|
+
const listStep = this.getSteps();
|
|
5752
|
+
const currentPos = Array.prototype.indexOf.call(listStep, document.activeElement);
|
|
5753
|
+
// Test if the focus is in the list (otherwise we do nothing)
|
|
5754
|
+
if (currentPos !== -1) {
|
|
5755
|
+
// we put the focus on the next element.
|
|
5756
|
+
if (currentPos === listStep.length - 1) {
|
|
5757
|
+
listStep[0].focus();
|
|
5513
5758
|
}
|
|
5514
|
-
else
|
|
5515
|
-
|
|
5516
|
-
this.progressIndicatorRef = undefined;
|
|
5759
|
+
else {
|
|
5760
|
+
listStep[currentPos + 1].focus();
|
|
5517
5761
|
}
|
|
5518
5762
|
}
|
|
5519
5763
|
}
|
|
5520
|
-
|
|
5521
|
-
|
|
5764
|
+
arrowLeftInnerHandler() {
|
|
5765
|
+
const listStep = this.getSteps();
|
|
5766
|
+
const currentPos = Array.prototype.indexOf.call(listStep, document.activeElement);
|
|
5767
|
+
// Test if the focus is in the list (otherwise we do nothing)
|
|
5768
|
+
if (currentPos !== -1) {
|
|
5769
|
+
// we put the focus on the next element.
|
|
5770
|
+
if (currentPos === 0) {
|
|
5771
|
+
listStep[listStep.length - 1].focus();
|
|
5772
|
+
}
|
|
5773
|
+
else {
|
|
5774
|
+
listStep[currentPos - 1].focus();
|
|
5775
|
+
}
|
|
5776
|
+
}
|
|
5777
|
+
}
|
|
5778
|
+
ngAfterViewChecked() {
|
|
5779
|
+
// Put back the focus on the active elements
|
|
5780
|
+
if (this.stepperService.setFocus) {
|
|
5781
|
+
const listStep = this.getSteps();
|
|
5782
|
+
listStep[this.stepperService.state.active].focus();
|
|
5783
|
+
this.stepperService.resetFocus();
|
|
5784
|
+
}
|
|
5785
|
+
}
|
|
5786
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5787
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfStepperDirective, isStandalone: true, selector: "[dfStepperLogic]", host: { listeners: { "keydown.Enter": "handleEnterDown()", "keydown.Space": "handleSpaceDown()", "keydown.arrowRight": "handleKeyDownRight($event)", "keydown.arrowLeft": "handleKeyDown($event)", "keydown.arrowDown": "handleKeyDownUp($event)", "keydown.arrowUp": "handleKeyDownDown($event)" } }, exportAs: ["dfStepperLogic"], ngImport: i0 }); }
|
|
5522
5788
|
}
|
|
5523
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperDirective, decorators: [{
|
|
5524
5790
|
type: Directive,
|
|
5525
5791
|
args: [{
|
|
5526
|
-
selector: '[
|
|
5792
|
+
selector: '[dfStepperLogic]',
|
|
5793
|
+
exportAs: 'dfStepperLogic',
|
|
5527
5794
|
standalone: true
|
|
5528
5795
|
}]
|
|
5529
|
-
}],
|
|
5530
|
-
type:
|
|
5531
|
-
|
|
5532
|
-
|
|
5796
|
+
}], propDecorators: { handleEnterDown: [{
|
|
5797
|
+
type: HostListener,
|
|
5798
|
+
args: ['keydown.Enter']
|
|
5799
|
+
}], handleSpaceDown: [{
|
|
5800
|
+
type: HostListener,
|
|
5801
|
+
args: ['keydown.Space']
|
|
5802
|
+
}], handleKeyDownRight: [{
|
|
5803
|
+
type: HostListener,
|
|
5804
|
+
args: ['keydown.arrowRight', ['$event']]
|
|
5805
|
+
}], handleKeyDown: [{
|
|
5806
|
+
type: HostListener,
|
|
5807
|
+
args: ['keydown.arrowLeft', ['$event']]
|
|
5808
|
+
}], handleKeyDownUp: [{
|
|
5809
|
+
type: HostListener,
|
|
5810
|
+
args: ['keydown.arrowDown', ['$event']]
|
|
5811
|
+
}], handleKeyDownDown: [{
|
|
5812
|
+
type: HostListener,
|
|
5813
|
+
args: ['keydown.arrowUp', ['$event']]
|
|
5533
5814
|
}] } });
|
|
5534
5815
|
|
|
5535
|
-
class
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
static { this.ɵ
|
|
5547
|
-
DfProgressbarModule, DfProgressbarModule] }); }
|
|
5816
|
+
class DfStepperStepContentDirective {
|
|
5817
|
+
constructor() {
|
|
5818
|
+
this.templateRef = inject(TemplateRef);
|
|
5819
|
+
/**
|
|
5820
|
+
* The step index
|
|
5821
|
+
* -1 means that the input index is not set
|
|
5822
|
+
*/
|
|
5823
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
5824
|
+
this.dfStepperStepContent = -1;
|
|
5825
|
+
}
|
|
5826
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperStepContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5827
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfStepperStepContentDirective, isStandalone: true, selector: "ng-template[dfStepperStepContent]", inputs: { dfStepperStepContent: ["dfStepperStepContent", "dfStepperStepContent", (value) => numberAttribute(value, -1)] }, ngImport: i0 }); }
|
|
5548
5828
|
}
|
|
5549
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5829
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperStepContentDirective, decorators: [{
|
|
5830
|
+
type: Directive,
|
|
5831
|
+
args: [{ selector: 'ng-template[dfStepperStepContent]', standalone: true }]
|
|
5832
|
+
}], propDecorators: { dfStepperStepContent: [{
|
|
5833
|
+
type: Input,
|
|
5834
|
+
args: [{ transform: (value) => numberAttribute(value, -1) }]
|
|
5835
|
+
}] } });
|
|
5836
|
+
/**
|
|
5837
|
+
* Stepper component is a component to provide a step by step navigation
|
|
5838
|
+
* You have two ways to navigate through the steps:
|
|
5839
|
+
* - Using the linear navigation, where you can only go to the next step
|
|
5840
|
+
* - Using the non-linear navigation, where you can go to any step
|
|
5841
|
+
*/
|
|
5842
|
+
class DfStepperComponent {
|
|
5843
|
+
constructor() {
|
|
5844
|
+
this.stepperService = inject(DfStepperService);
|
|
5845
|
+
this.mapStepToContent = new Map();
|
|
5846
|
+
this.stepperService.stepperState$.subscribe((state) => {
|
|
5847
|
+
this.state = state;
|
|
5848
|
+
});
|
|
5849
|
+
}
|
|
5850
|
+
ngAfterContentInit() {
|
|
5851
|
+
this.tplStepsContent.forEach((tplStepContent) => {
|
|
5852
|
+
if (tplStepContent.dfStepperStepContent !== -1) {
|
|
5853
|
+
this.mapStepToContent.set(tplStepContent.dfStepperStepContent, tplStepContent.templateRef);
|
|
5854
|
+
}
|
|
5855
|
+
});
|
|
5856
|
+
}
|
|
5857
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5858
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DfStepperComponent, isStandalone: true, selector: "[dfStepper]", host: { attributes: { "role": "tablist" }, properties: { "class.df-vertical-stepper": "state?.isVertical", "attr.aria-label": "stepperService.stepperAriaLabel", "attr.aria-orientation": "state?.isVertical ? \"vertical\": null" }, classAttribute: "df-stepper mb-2" }, queries: [{ propertyName: "tplStepsContent", predicate: DfStepperStepContentDirective }], hostDirectives: [{ directive: DfStepperDirective }], ngImport: i0, template: "<ng-template #myStepperLine>\n <div class=\"df-stepper-line-wrapper\">\n <div class=\"df-stepper-line\">\n <div class=\"df-stepper-horizontal-line\"></div>\n </div>\n <div class=\"df-stepper-line d-none d-sm-flex\">\n <div class=\"flex-grow-1\"></div>\n </div>\n </div>\n</ng-template>\n<ng-container *ngIf=\"state\">\n <ng-template ngFor let-step [ngForOf]=\"state.steps\" let-i=\"index\">\n <button #stepbasic class=\"btn btn-link df-stepper-step\"\n dfStepperStep\n [class.active]=\"i === state.active\"\n [class.flex-row]=\"state.isInline\"\n [attr.tabIndex]=\"i === state.active ? 0 : -1\"\n [class.df-stepper-step-warning]=\"step.type === 'warning'\"\n [class.df-stepper-step-completed]=\"step.type === 'completed'\"\n [class.df-stepper-step-current]=\"step.type === 'current'\"\n [class.df-stepper-step-future]=\"step.type === 'future'\"\n [disabled]=\"state.isLinear && (step.type === 'future' || step.type === 'completed')\"\n role=\"tab\"\n [attr.aria-selected]=\"i === state.active ? 'true': 'false'\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"state.steps.length\" [attr.aria-controls]=\"step.ariaControl\" (click)=\"stepperService.selectWithFocus(i)\">\n <div\n [class.df-stepper-number-current]=\"step.type === 'current'\"\n [class.df-stepper-outline-icon]=\"step.type === 'warning'\"\n [class.icon-exclamation-triangle]=\"step.type === 'warning'\"\n [class.df-stepper-icon]=\"step.type === 'completed'\"\n [class.icon-check]=\"step.type === 'completed'\"\n [class.df-stepper-outline-number-future]=\"step.type === 'future'\"\n >\n <span aria-hidden=\"true\">{{stepperService.getStepNumberLabel(i)}}</span>\n </div>\n <div [class.align-items-center]=\"!state.isInline\"\n [class.flex-column]=\"state.isInline\"\n [class.mt-1]=\"!state.isInline\"\n [class.d-none]=\"!state.isVertical\"\n [class.d-sm-flex]=\"!state.isVertical\"\n [class.d-flex]=\"state.isVertical\">\n <span *ngIf=\"step.type === 'warning'\" class=\"visually-hidden\">{{stepperService.warningLabel}}</span>\n <span class=\"df-stepper-label\">{{step.label}}</span>\n <span *ngIf=\"state.isInline && step.optionalLabel\" class=\"df-stepper-optional-label\">{{step.optionalLabel}}</span>\n <span *ngIf=\"step.completed\" class=\"visually-hidden\">{{stepperService.completedLabel}}</span>\n </div>\n </button>\n <ng-container *ngIf=\"!state.isVertical && i < state.steps.length - 1 \" [ngTemplateOutlet]=\"myStepperLine\"></ng-container>\n <div *ngIf=\"state.isVertical && i < state.steps.length\" [class.d-none]=\"state.steps.length - 1 === i\" role=\"tabpanel\" [id]=\"step.ariaControl\" class=\"df-vertical-stepper-panel df-vertical-stepper-line\">\n <ng-template *ngIf=\"mapStepToContent.has(i) && state.active === i\" [ngTemplateOutlet]=\"mapStepToContent.get(i) || null\" [ngTemplateOutletContext]=\"{state, index: i, service: stepperService}\"></ng-template>\n </div>\n </ng-template>\n</ng-container>\n<div class=\"text-primary mb-2\"\n [class.d-block]=\"!state.isVertical\"\n [class.d-sm-none]=\"!state.isVertical\"\n [class.d-none]=\"state.isVertical\"\n *ngIf=\"stepperService.stepperState$ | async as state\">\n <span class=\"df-stepper-label\">{{state.steps[state.active].label}}</span>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "directive", type: DfStepperStepDirective, selector: "[dfStepperStep]", exportAs: ["dfStepperStep"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5859
|
+
}
|
|
5860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperComponent, decorators: [{
|
|
5861
|
+
type: Component,
|
|
5862
|
+
args: [{ selector: '[dfStepper]', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, DfStepperDirective, DfStepperStepDirective], hostDirectives: [DfStepperDirective], host: {
|
|
5863
|
+
role: 'tablist',
|
|
5864
|
+
class: 'df-stepper mb-2',
|
|
5865
|
+
'[class.df-vertical-stepper]': 'state?.isVertical',
|
|
5866
|
+
'[attr.aria-label]': 'stepperService.stepperAriaLabel',
|
|
5867
|
+
'[attr.aria-orientation]': 'state?.isVertical ? "vertical": null'
|
|
5868
|
+
}, template: "<ng-template #myStepperLine>\n <div class=\"df-stepper-line-wrapper\">\n <div class=\"df-stepper-line\">\n <div class=\"df-stepper-horizontal-line\"></div>\n </div>\n <div class=\"df-stepper-line d-none d-sm-flex\">\n <div class=\"flex-grow-1\"></div>\n </div>\n </div>\n</ng-template>\n<ng-container *ngIf=\"state\">\n <ng-template ngFor let-step [ngForOf]=\"state.steps\" let-i=\"index\">\n <button #stepbasic class=\"btn btn-link df-stepper-step\"\n dfStepperStep\n [class.active]=\"i === state.active\"\n [class.flex-row]=\"state.isInline\"\n [attr.tabIndex]=\"i === state.active ? 0 : -1\"\n [class.df-stepper-step-warning]=\"step.type === 'warning'\"\n [class.df-stepper-step-completed]=\"step.type === 'completed'\"\n [class.df-stepper-step-current]=\"step.type === 'current'\"\n [class.df-stepper-step-future]=\"step.type === 'future'\"\n [disabled]=\"state.isLinear && (step.type === 'future' || step.type === 'completed')\"\n role=\"tab\"\n [attr.aria-selected]=\"i === state.active ? 'true': 'false'\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"state.steps.length\" [attr.aria-controls]=\"step.ariaControl\" (click)=\"stepperService.selectWithFocus(i)\">\n <div\n [class.df-stepper-number-current]=\"step.type === 'current'\"\n [class.df-stepper-outline-icon]=\"step.type === 'warning'\"\n [class.icon-exclamation-triangle]=\"step.type === 'warning'\"\n [class.df-stepper-icon]=\"step.type === 'completed'\"\n [class.icon-check]=\"step.type === 'completed'\"\n [class.df-stepper-outline-number-future]=\"step.type === 'future'\"\n >\n <span aria-hidden=\"true\">{{stepperService.getStepNumberLabel(i)}}</span>\n </div>\n <div [class.align-items-center]=\"!state.isInline\"\n [class.flex-column]=\"state.isInline\"\n [class.mt-1]=\"!state.isInline\"\n [class.d-none]=\"!state.isVertical\"\n [class.d-sm-flex]=\"!state.isVertical\"\n [class.d-flex]=\"state.isVertical\">\n <span *ngIf=\"step.type === 'warning'\" class=\"visually-hidden\">{{stepperService.warningLabel}}</span>\n <span class=\"df-stepper-label\">{{step.label}}</span>\n <span *ngIf=\"state.isInline && step.optionalLabel\" class=\"df-stepper-optional-label\">{{step.optionalLabel}}</span>\n <span *ngIf=\"step.completed\" class=\"visually-hidden\">{{stepperService.completedLabel}}</span>\n </div>\n </button>\n <ng-container *ngIf=\"!state.isVertical && i < state.steps.length - 1 \" [ngTemplateOutlet]=\"myStepperLine\"></ng-container>\n <div *ngIf=\"state.isVertical && i < state.steps.length\" [class.d-none]=\"state.steps.length - 1 === i\" role=\"tabpanel\" [id]=\"step.ariaControl\" class=\"df-vertical-stepper-panel df-vertical-stepper-line\">\n <ng-template *ngIf=\"mapStepToContent.has(i) && state.active === i\" [ngTemplateOutlet]=\"mapStepToContent.get(i) || null\" [ngTemplateOutletContext]=\"{state, index: i, service: stepperService}\"></ng-template>\n </div>\n </ng-template>\n</ng-container>\n<div class=\"text-primary mb-2\"\n [class.d-block]=\"!state.isVertical\"\n [class.d-sm-none]=\"!state.isVertical\"\n [class.d-none]=\"state.isVertical\"\n *ngIf=\"stepperService.stepperState$ | async as state\">\n <span class=\"df-stepper-label\">{{state.steps[state.active].label}}</span>\n</div>" }]
|
|
5869
|
+
}], ctorParameters: function () { return []; }, propDecorators: { tplStepsContent: [{
|
|
5870
|
+
type: ContentChildren,
|
|
5871
|
+
args: [DfStepperStepContentDirective]
|
|
5872
|
+
}] } });
|
|
5873
|
+
|
|
5874
|
+
class DfStepperModule {
|
|
5875
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
5876
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfStepperModule, imports: [DfStepperDirective, DfStepperStepDirective, DfStepperComponent, DfStepperStepContentDirective], exports: [DfStepperDirective, DfStepperStepDirective, DfStepperComponent, DfStepperStepContentDirective] }); }
|
|
5877
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperModule, imports: [DfStepperComponent] }); }
|
|
5878
|
+
}
|
|
5879
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfStepperModule, decorators: [{
|
|
5550
5880
|
type: NgModule,
|
|
5551
5881
|
args: [{
|
|
5552
|
-
imports: [
|
|
5553
|
-
|
|
5554
|
-
DfProgressbarModule,
|
|
5555
|
-
DfProgressIndicatorBackdropComponent,
|
|
5556
|
-
DfProgressIndicatorContainerComponent,
|
|
5557
|
-
DfProgressIndicatorDirective
|
|
5558
|
-
],
|
|
5559
|
-
exports: [
|
|
5560
|
-
DfProgressbarModule,
|
|
5561
|
-
DfProgressIndicatorContainerComponent,
|
|
5562
|
-
DfProgressIndicatorDirective,
|
|
5563
|
-
DfProgressIndicatorBackdropComponent,
|
|
5564
|
-
DfDefaultSpinnerComponent
|
|
5565
|
-
]
|
|
5882
|
+
imports: [DfStepperDirective, DfStepperStepDirective, DfStepperComponent, DfStepperStepContentDirective],
|
|
5883
|
+
exports: [DfStepperDirective, DfStepperStepDirective, DfStepperComponent, DfStepperStepContentDirective]
|
|
5566
5884
|
}]
|
|
5567
5885
|
}] });
|
|
5568
5886
|
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5887
|
+
/**
|
|
5888
|
+
* My dfTooltipTruncate directive
|
|
5889
|
+
*/
|
|
5890
|
+
class DfTooltipTruncateDirective {
|
|
5891
|
+
constructor(tooltip, elementRef, renderer) {
|
|
5892
|
+
this.tooltip = tooltip;
|
|
5893
|
+
this.elementRef = elementRef;
|
|
5894
|
+
this.renderer = renderer;
|
|
5895
|
+
}
|
|
5896
|
+
ngOnInit() {
|
|
5897
|
+
this.renderer.addClass(this.elementRef.nativeElement, 'text-truncate');
|
|
5898
|
+
}
|
|
5899
|
+
ngDoCheck() {
|
|
5900
|
+
this.tooltip.disableTooltip = !this.hasOverflow(this.elementRef.nativeElement);
|
|
5901
|
+
}
|
|
5902
|
+
hasOverflow(element) {
|
|
5903
|
+
return element?.offsetHeight < element?.scrollHeight || element?.offsetWidth < element?.scrollWidth;
|
|
5904
|
+
}
|
|
5905
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipTruncateDirective, deps: [{ token: i1.NgbTooltip }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5906
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfTooltipTruncateDirective, isStandalone: true, selector: "[dfTooltipTruncate]", exportAs: ["dfTooltipTruncate"], ngImport: i0 }); }
|
|
5573
5907
|
}
|
|
5574
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5908
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipTruncateDirective, decorators: [{
|
|
5909
|
+
type: Directive,
|
|
5910
|
+
args: [{
|
|
5911
|
+
exportAs: 'dfTooltipTruncate',
|
|
5912
|
+
selector: '[dfTooltipTruncate]',
|
|
5913
|
+
standalone: true
|
|
5914
|
+
}]
|
|
5915
|
+
}], ctorParameters: function () { return [{ type: i1.NgbTooltip }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
5916
|
+
|
|
5917
|
+
class DfTooltipModule {
|
|
5918
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
5919
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipModule, imports: [DfTooltipTruncateDirective], exports: [DfTooltipTruncateDirective, NgbTooltipModule] }); }
|
|
5920
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipModule, imports: [NgbTooltipModule] }); }
|
|
5921
|
+
}
|
|
5922
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfTooltipModule, decorators: [{
|
|
5575
5923
|
type: NgModule,
|
|
5576
5924
|
args: [{
|
|
5577
|
-
imports: [
|
|
5578
|
-
exports: [
|
|
5925
|
+
imports: [DfTooltipTruncateDirective],
|
|
5926
|
+
exports: [DfTooltipTruncateDirective, NgbTooltipModule]
|
|
5579
5927
|
}]
|
|
5580
5928
|
}] });
|
|
5581
5929
|
|
|
5582
|
-
class
|
|
5583
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5584
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5585
|
-
|
|
5930
|
+
class DfSideNavModule {
|
|
5931
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
5932
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavModule, imports: [DfManageSideNavDirective,
|
|
5933
|
+
DfSideNavComponent,
|
|
5934
|
+
DfSideNavHeaderDirective,
|
|
5935
|
+
DfExcludeTrapDirective,
|
|
5936
|
+
DfSideNavIconDirective,
|
|
5937
|
+
DfSideNavItemDirective], exports: [DfManageSideNavDirective,
|
|
5938
|
+
DfSideNavComponent,
|
|
5939
|
+
DfSideNavHeaderDirective,
|
|
5940
|
+
DfExcludeTrapDirective,
|
|
5941
|
+
DfSideNavIconDirective,
|
|
5942
|
+
DfSideNavItemDirective,
|
|
5943
|
+
DfSideNavCollapseModule,
|
|
5944
|
+
DfMediaModule] }); }
|
|
5945
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavModule, imports: [DfSideNavComponent, DfSideNavCollapseModule,
|
|
5946
|
+
DfMediaModule] }); }
|
|
5586
5947
|
}
|
|
5587
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5948
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfSideNavModule, decorators: [{
|
|
5588
5949
|
type: NgModule,
|
|
5589
5950
|
args: [{
|
|
5590
|
-
imports: [
|
|
5591
|
-
|
|
5951
|
+
imports: [
|
|
5952
|
+
DfManageSideNavDirective,
|
|
5953
|
+
DfSideNavComponent,
|
|
5954
|
+
DfSideNavHeaderDirective,
|
|
5955
|
+
DfExcludeTrapDirective,
|
|
5956
|
+
DfSideNavIconDirective,
|
|
5957
|
+
DfSideNavItemDirective
|
|
5958
|
+
],
|
|
5959
|
+
exports: [
|
|
5960
|
+
DfManageSideNavDirective,
|
|
5961
|
+
DfSideNavComponent,
|
|
5962
|
+
DfSideNavHeaderDirective,
|
|
5963
|
+
DfExcludeTrapDirective,
|
|
5964
|
+
DfSideNavIconDirective,
|
|
5965
|
+
DfSideNavItemDirective,
|
|
5966
|
+
DfSideNavCollapseModule,
|
|
5967
|
+
DfMediaModule
|
|
5968
|
+
]
|
|
5592
5969
|
}]
|
|
5593
5970
|
}] });
|
|
5594
5971
|
|
|
5595
|
-
class
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5972
|
+
class DfManageCardSelectionDirective {
|
|
5973
|
+
set dfManageCardSelected(isSelected) {
|
|
5974
|
+
const selectedClass = 'df-card-selected';
|
|
5975
|
+
if (isSelected === true) {
|
|
5976
|
+
this.renderer.addClass(this.element.nativeElement, selectedClass);
|
|
5977
|
+
}
|
|
5978
|
+
else {
|
|
5979
|
+
this.renderer.removeClass(this.element.nativeElement, selectedClass);
|
|
5980
|
+
}
|
|
5600
5981
|
}
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5982
|
+
constructor(element, renderer) {
|
|
5983
|
+
this.element = element;
|
|
5984
|
+
this.renderer = renderer;
|
|
5985
|
+
}
|
|
5986
|
+
ngAfterViewInit() {
|
|
5987
|
+
this.input = this.element.nativeElement.querySelector('.form-check-input');
|
|
5988
|
+
this.renderer.setAttribute(this.input, 'tabIndex', '-1');
|
|
5989
|
+
}
|
|
5990
|
+
click(event) {
|
|
5991
|
+
const target = event.target;
|
|
5992
|
+
// If the input or the label is clicked then the selection is already made
|
|
5993
|
+
// The card must have only one input
|
|
5994
|
+
if (!(target.classList.contains('form-check-input') || target.classList.contains('form-check-label'))) {
|
|
5995
|
+
this.input.click();
|
|
5605
5996
|
}
|
|
5606
5997
|
else {
|
|
5607
|
-
|
|
5998
|
+
this.element.nativeElement.focus();
|
|
5608
5999
|
}
|
|
5609
|
-
// we add the 'df-modal-open' class to the body when the modal is open. We remove it when the modal is closed/dismissed
|
|
5610
|
-
this.renderer.addClass(document.body, 'df-modal-open');
|
|
5611
|
-
modalRef.result.then(() => {
|
|
5612
|
-
this.renderer.removeClass(document.body, 'df-modal-open');
|
|
5613
|
-
}, () => {
|
|
5614
|
-
this.renderer.removeClass(document.body, 'df-modal-open');
|
|
5615
|
-
});
|
|
5616
|
-
return modalRef;
|
|
5617
6000
|
}
|
|
5618
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5619
|
-
static { this.ɵ
|
|
6001
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfManageCardSelectionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6002
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: DfManageCardSelectionDirective, isStandalone: true, selector: "[dfManageCardSelected]", inputs: { dfManageCardSelected: "dfManageCardSelected" }, host: { listeners: { "click": "click($event)" } }, ngImport: i0 }); }
|
|
5620
6003
|
}
|
|
5621
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
5622
|
-
type:
|
|
6004
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfManageCardSelectionDirective, decorators: [{
|
|
6005
|
+
type: Directive,
|
|
5623
6006
|
args: [{
|
|
5624
|
-
|
|
6007
|
+
selector: '[dfManageCardSelected]',
|
|
6008
|
+
standalone: true
|
|
5625
6009
|
}]
|
|
5626
|
-
}], ctorParameters: function () { return [{ type:
|
|
6010
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { dfManageCardSelected: [{
|
|
6011
|
+
type: Input
|
|
6012
|
+
}], click: [{
|
|
6013
|
+
type: HostListener,
|
|
6014
|
+
args: ['click', ['$event']]
|
|
6015
|
+
}] } });
|
|
6016
|
+
|
|
6017
|
+
class DfAdvancedCardModule {
|
|
6018
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfAdvancedCardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
6019
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfAdvancedCardModule, imports: [DfManageCardSelectionDirective], exports: [DfManageCardSelectionDirective] }); }
|
|
6020
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfAdvancedCardModule }); }
|
|
6021
|
+
}
|
|
6022
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfAdvancedCardModule, decorators: [{
|
|
6023
|
+
type: NgModule,
|
|
6024
|
+
args: [{
|
|
6025
|
+
imports: [DfManageCardSelectionDirective],
|
|
6026
|
+
exports: [DfManageCardSelectionDirective]
|
|
6027
|
+
}]
|
|
6028
|
+
}] });
|
|
5627
6029
|
|
|
5628
6030
|
const DF_MODULES = [
|
|
5629
6031
|
DfAlertModule,
|
|
@@ -5641,8 +6043,12 @@ const DF_MODULES = [
|
|
|
5641
6043
|
DfSideNavCollapseModule,
|
|
5642
6044
|
DfAdvancedCardModule,
|
|
5643
6045
|
DfFooterModule,
|
|
5644
|
-
DfToastModule
|
|
6046
|
+
DfToastModule,
|
|
6047
|
+
DfStepperModule
|
|
5645
6048
|
];
|
|
6049
|
+
/**
|
|
6050
|
+
* @deprecated Import only the needed modules or use standalone components instead of DfModule
|
|
6051
|
+
*/
|
|
5646
6052
|
class DfModule {
|
|
5647
6053
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
5648
6054
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: DfModule, imports: [DfAlertModule,
|
|
@@ -5660,7 +6066,8 @@ class DfModule {
|
|
|
5660
6066
|
DfSideNavCollapseModule,
|
|
5661
6067
|
DfAdvancedCardModule,
|
|
5662
6068
|
DfFooterModule,
|
|
5663
|
-
DfToastModule
|
|
6069
|
+
DfToastModule,
|
|
6070
|
+
DfStepperModule], exports: [DfAlertModule,
|
|
5664
6071
|
DfDatePickerModule,
|
|
5665
6072
|
DfSelectModule,
|
|
5666
6073
|
DfProgressbarModule,
|
|
@@ -5675,7 +6082,8 @@ class DfModule {
|
|
|
5675
6082
|
DfSideNavCollapseModule,
|
|
5676
6083
|
DfAdvancedCardModule,
|
|
5677
6084
|
DfFooterModule,
|
|
5678
|
-
DfToastModule
|
|
6085
|
+
DfToastModule,
|
|
6086
|
+
DfStepperModule] }); }
|
|
5679
6087
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfModule, imports: [DF_MODULES, DfAlertModule,
|
|
5680
6088
|
DfDatePickerModule,
|
|
5681
6089
|
DfSelectModule,
|
|
@@ -5691,7 +6099,8 @@ class DfModule {
|
|
|
5691
6099
|
DfSideNavCollapseModule,
|
|
5692
6100
|
DfAdvancedCardModule,
|
|
5693
6101
|
DfFooterModule,
|
|
5694
|
-
DfToastModule
|
|
6102
|
+
DfToastModule,
|
|
6103
|
+
DfStepperModule] }); }
|
|
5695
6104
|
}
|
|
5696
6105
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DfModule, decorators: [{
|
|
5697
6106
|
type: NgModule,
|
|
@@ -5701,6 +6110,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
5701
6110
|
}]
|
|
5702
6111
|
}] });
|
|
5703
6112
|
|
|
6113
|
+
// Accessibility
|
|
6114
|
+
|
|
5704
6115
|
/**
|
|
5705
6116
|
* Public API Surface of design-factory
|
|
5706
6117
|
*/
|
|
@@ -5709,5 +6120,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
5709
6120
|
* Generated bundle index. Do not edit.
|
|
5710
6121
|
*/
|
|
5711
6122
|
|
|
5712
|
-
export { BREAKPOINTS_VARS, ChangeContext, CloseInputDatePickerDirective, DF_BREAKPOINTS_VAR_DEFAULT, DfAccessibilityModule, DfAdvancedCardModule, DfAdvancedInputModule, DfAlertModule, DfAmadeusIconComponent, DfBreakpoints, DfDatePickerModule, DfDatepickerRangeDirective, DfDatepickerRangeService, DfDefaultSpinnerComponent, DfDirectionDetectionService, DfExcludeTrapDirective, DfFooterModule, DfIconModule, DfIfMediaDirective, DfInputIconDirective, DfInsertIconDirective, DfInsertIconModule, DfManageBadgeEventsDirective, DfManageCardSelectionDirective, DfManageNavSelectDirective, DfManageSideNavDirective, DfMedia, DfMediaModule, DfMediaObserver, DfMediaQuery, DfModalService, DfModule, DfNavItemType, DfOptionHighlightDirective, DfPopoverConfig, DfPopoverModule, DfProgressIndicatorBackdropComponent, DfProgressIndicatorContainerComponent, DfProgressIndicatorContentPosition, DfProgressIndicatorContentProgressBar, DfProgressIndicatorContentSpinner, DfProgressIndicatorContentType, DfProgressIndicatorDirective, DfProgressIndicatorModule, DfProgressIndicatorRef, DfProgressIndicatorService, DfProgressbarComponent, DfProgressbarModule, DfSelectModule, DfSideNavCollapseDirective, DfSideNavCollapseModule, DfSideNavCollapseService, DfSideNavComponent, DfSideNavHeaderDirective, DfSideNavIconDirective, DfSideNavItemDirective, DfSideNavModule, DfSideNavService, DfSliderDirectionDirective, DfSliderModule,
|
|
6123
|
+
export { BREAKPOINTS_VARS, ChangeContext, CloseInputDatePickerDirective, DF_BREAKPOINTS_VAR_DEFAULT, DfAccessibilityModule, DfAdvancedCardModule, DfAdvancedInputModule, DfAlertModule, DfAmadeusIconComponent, DfBreakpoints, DfDatePickerModule, DfDatepickerRangeDirective, DfDatepickerRangeService, DfDefaultSpinnerComponent, DfDirectionDetectionService, DfExcludeTrapDirective, DfFooterModule, DfIconModule, DfIfMediaDirective, DfInputIconDirective, DfInsertIconDirective, DfInsertIconModule, DfManageBadgeEventsDirective, DfManageCardSelectionDirective, DfManageNavSelectDirective, DfManageSideNavDirective, DfMedia, DfMediaModule, DfMediaObserver, DfMediaQuery, DfModalService, DfModule, DfNavItemType, DfOptionHighlightDirective, DfPopoverConfig, DfPopoverModule, DfProgressIndicatorBackdropComponent, DfProgressIndicatorContainerComponent, DfProgressIndicatorContentPosition, DfProgressIndicatorContentProgressBar, DfProgressIndicatorContentSpinner, DfProgressIndicatorContentType, DfProgressIndicatorDirective, DfProgressIndicatorModule, DfProgressIndicatorRef, DfProgressIndicatorService, DfProgressbarComponent, DfProgressbarModule, DfSelectModule, DfSideNavCollapseDirective, DfSideNavCollapseModule, DfSideNavCollapseService, DfSideNavComponent, DfSideNavHeaderDirective, DfSideNavIconDirective, DfSideNavItemDirective, DfSideNavModule, DfSideNavService, DfSliderDirectionDirective, DfSliderModule, DfStepperComponent, DfStepperDirective, DfStepperModule, DfStepperService, DfStepperStepContentDirective, DfStepperStepDirective, DfToastModule, DfTooltipModule, DfTooltipTruncateDirective, DfTriggerClickDirective, LabelType, Options, PointerType, RightToLeftDirectionEnum, SkipLinkDirective, SkipLinksContainerComponent, SliderComponent };
|
|
5713
6124
|
//# sourceMappingURL=design-factory.mjs.map
|