design-angular-kit 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +66 -60
  2. package/esm2022/lib/components/core/dimmer/dimmer.component.mjs +5 -5
  3. package/esm2022/lib/components/form/form.module.mjs +5 -1
  4. package/esm2022/lib/components/form/transfer/store/transfer.reducers.mjs +191 -0
  5. package/esm2022/lib/components/form/transfer/store/transfer.state.mjs +2 -0
  6. package/esm2022/lib/components/form/transfer/store/transfer.store.mjs +70 -0
  7. package/esm2022/lib/components/form/transfer/transfer-list/transfer-list.component.mjs +70 -0
  8. package/esm2022/lib/components/form/transfer/transfer.component.mjs +147 -0
  9. package/esm2022/lib/components/form/transfer/transfer.model.mjs +6 -0
  10. package/esm2022/lib/components/navigation/navscroll/navscroll-list-item.component.mjs +98 -0
  11. package/esm2022/lib/components/navigation/navscroll/navscroll-list-items.component.mjs +44 -0
  12. package/esm2022/lib/components/navigation/navscroll/navscroll.component.mjs +116 -0
  13. package/esm2022/lib/components/navigation/navscroll/navscroll.model.mjs +2 -0
  14. package/esm2022/lib/components/navigation/navscroll/navscroll.store.mjs +65 -0
  15. package/esm2022/lib/components/navigation/navscroll/navscroll.utils.mjs +23 -0
  16. package/esm2022/lib/design-angular-kit.module.mjs +10 -6
  17. package/esm2022/lib/provide-design-angular-kit.mjs +5 -5
  18. package/esm2022/public_api.mjs +25 -21
  19. package/fesm2022/design-angular-kit.mjs +1045 -255
  20. package/fesm2022/design-angular-kit.mjs.map +1 -1
  21. package/lib/components/form/form.module.d.ts +4 -3
  22. package/lib/components/form/transfer/store/transfer.reducers.d.ts +103 -0
  23. package/lib/components/form/transfer/store/transfer.state.d.ts +18 -0
  24. package/lib/components/form/transfer/store/transfer.store.d.ts +23 -0
  25. package/lib/components/form/transfer/transfer-list/transfer-list.component.d.ts +48 -0
  26. package/lib/components/form/transfer/transfer.component.d.ts +75 -0
  27. package/lib/components/form/transfer/transfer.model.d.ts +6 -0
  28. package/lib/components/navigation/navscroll/navscroll-list-item.component.d.ts +16 -0
  29. package/lib/components/navigation/navscroll/navscroll-list-items.component.d.ts +7 -0
  30. package/lib/components/navigation/navscroll/navscroll.component.d.ts +47 -0
  31. package/lib/components/navigation/navscroll/navscroll.model.d.ts +10 -0
  32. package/lib/components/navigation/navscroll/navscroll.store.d.ts +16 -0
  33. package/lib/components/navigation/navscroll/navscroll.utils.d.ts +6 -0
  34. package/lib/design-angular-kit.module.d.ts +8 -7
  35. package/package.json +5 -1
  36. package/public_api.d.ts +24 -20
  37. package/schematics/collection.json +19 -0
  38. package/schematics/ng-add/index.d.ts +3 -0
  39. package/schematics/ng-add/index.js +29 -0
  40. package/schematics/ng-add/index.js.map +1 -0
  41. package/schematics/ng-add/index.spec.d.ts +1 -0
  42. package/schematics/ng-add/index.spec.js +43 -0
  43. package/schematics/ng-add/index.spec.js.map +1 -0
  44. package/schematics/ng-add/rules/setup-project/add-animations.d.ts +2 -0
  45. package/schematics/ng-add/rules/setup-project/add-animations.js +11 -0
  46. package/schematics/ng-add/rules/setup-project/add-animations.js.map +1 -0
  47. package/schematics/ng-add/rules/setup-project/add-assets.d.ts +3 -0
  48. package/schematics/ng-add/rules/setup-project/add-assets.js +50 -0
  49. package/schematics/ng-add/rules/setup-project/add-assets.js.map +1 -0
  50. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.d.ts +3 -0
  51. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js +43 -0
  52. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js.map +1 -0
  53. package/schematics/ng-add/rules/setup-project/add-http-client.d.ts +2 -0
  54. package/schematics/ng-add/rules/setup-project/add-http-client.js +11 -0
  55. package/schematics/ng-add/rules/setup-project/add-http-client.js.map +1 -0
  56. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.d.ts +11 -0
  57. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js +112 -0
  58. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js.map +1 -0
  59. package/schematics/ng-add/rules/setup-project/add-localisation.d.ts +3 -0
  60. package/schematics/ng-add/rules/setup-project/add-localisation.js +50 -0
  61. package/schematics/ng-add/rules/setup-project/add-localisation.js.map +1 -0
  62. package/schematics/ng-add/rules/setup-project/angular-json-helper.d.ts +2 -0
  63. package/schematics/ng-add/rules/setup-project/angular-json-helper.js +13 -0
  64. package/schematics/ng-add/rules/setup-project/angular-json-helper.js.map +1 -0
  65. package/schematics/ng-add/rules/setup-project/exceptions.d.ts +7 -0
  66. package/schematics/ng-add/rules/setup-project/exceptions.js +17 -0
  67. package/schematics/ng-add/rules/setup-project/exceptions.js.map +1 -0
  68. package/schematics/ng-add/rules/setup-project/index.d.ts +6 -0
  69. package/schematics/ng-add/rules/setup-project/index.js +23 -0
  70. package/schematics/ng-add/rules/setup-project/index.js.map +1 -0
  71. package/schematics/ng-add/schema.d.ts +3 -0
  72. package/schematics/ng-add/schema.js +3 -0
  73. package/schematics/ng-add/schema.js.map +1 -0
  74. package/schematics/ng-add/schema.json +16 -0
  75. package/schematics/ng-add/setup-project.d.ts +3 -0
  76. package/schematics/ng-add/setup-project.js +37 -0
  77. package/schematics/ng-add/setup-project.js.map +1 -0
  78. package/schematics/ng-add/setup-project.spec.d.ts +1 -0
  79. package/schematics/ng-add/setup-project.spec.js +139 -0
  80. package/schematics/ng-add/setup-project.spec.js.map +1 -0
  81. package/schematics/ng-add/utils.d.ts +14 -0
  82. package/schematics/ng-add/utils.js +49 -0
  83. package/schematics/ng-add/utils.js.map +1 -0
  84. package/schematics/ng-add/versions-helper.d.ts +3 -0
  85. package/schematics/ng-add/versions-helper.js +40 -0
  86. package/schematics/ng-add/versions-helper.js.map +1 -0
@@ -1,85 +1,23 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, APP_INITIALIZER, importProvidersFrom, makeEnvironmentProviders, inject, Renderer2, ElementRef, ChangeDetectorRef, EventEmitter, Component, Input, Output, booleanAttribute, ChangeDetectionStrategy, ViewChild, TemplateRef, HostBinding, ContentChildren, NgModule, Directive, Optional, Host, HostListener, Inject, Injectable, Self, ViewChildren, ViewEncapsulation, Pipe } from '@angular/core';
3
- import { loadFonts, Collapse, Alert, Dropdown, CarouselBI, Modal, Notification, Popover, Tab, Tooltip, InputPassword, ProgressDonut, BackToTop, NavBarCollapsible, HeaderSticky } from 'bootstrap-italia';
2
+ import { inject, Renderer2, ElementRef, ChangeDetectorRef, EventEmitter, Component, Input, Output, booleanAttribute, ChangeDetectionStrategy, ViewChild, InjectionToken, TemplateRef, HostBinding, ContentChildren, NgModule, Directive, Optional, Host, HostListener, Inject, Injectable, Self, ViewChildren, ViewEncapsulation, Pipe, HostAttributeToken, DestroyRef, APP_INITIALIZER, importProvidersFrom, makeEnvironmentProviders } from '@angular/core';
3
+ import { Collapse, Alert, Dropdown, CarouselBI, Modal, Notification, Popover, Tab, Tooltip, InputPassword, ProgressDonut, BackToTop, NavBarCollapsible, HeaderSticky, loadFonts } from 'bootstrap-italia';
4
4
  import * as i1 from '@ngx-translate/core';
5
- import { TranslateModule, TranslateLoader, TranslateService, TranslatePipe } from '@ngx-translate/core';
6
- import { provideHttpClient, HttpClient } from '@angular/common/http';
7
- import { TranslateHttpLoader } from '@ngx-translate/http-loader';
8
- import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
5
+ import { TranslateModule, TranslatePipe, TranslateLoader, TranslateService } from '@ngx-translate/core';
9
6
  import * as i1$3 from '@angular/common';
10
- import { NgTemplateOutlet, NgClass, DOCUMENT, AsyncPipe, LowerCasePipe, NgOptimizedImage, DatePipe } from '@angular/common';
7
+ import { NgTemplateOutlet, NgClass, DOCUMENT, AsyncPipe, LowerCasePipe, DatePipe, NgOptimizedImage, TitleCasePipe, JsonPipe, ViewportScroller } from '@angular/common';
11
8
  import * as i1$4 from '@angular/router';
12
- import { RouterLink } from '@angular/router';
13
- import { startWith, Subject, filter, debounceTime, distinctUntilChanged, tap, switchMap, of, merge, map, Observable, take, forkJoin, timer, takeWhile, shareReplay } from 'rxjs';
9
+ import { RouterLink, Router, NavigationEnd, Scroll, RouterLinkActive, RouterLinkWithHref } from '@angular/router';
10
+ import { startWith, Subject, filter, debounceTime, distinctUntilChanged, tap, switchMap, of, merge, map, Observable, take, forkJoin, BehaviorSubject, shareReplay, combineLatest, skip, AsyncSubject, withLatestFrom, delay, timer, takeWhile } from 'rxjs';
14
11
  import { trigger, transition, style, animate } from '@angular/animations';
15
12
  import * as i1$1 from '@angular/forms';
16
- import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
13
+ import { FormControl, Validators, ReactiveFormsModule, NgModel, FormControlName } from '@angular/forms';
17
14
  import * as i1$2 from '@angular/platform-browser';
15
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
16
+ import { provideHttpClient, HttpClient } from '@angular/common/http';
17
+ import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
18
+ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
18
19
  import { map as map$1 } from 'rxjs/operators';
19
20
 
20
- /**
21
- * The bootstrap-italia asset folder path
22
- * @default ./bootstrap-italia
23
- */
24
- const IT_ASSET_BASE_PATH = new InjectionToken('it-asset-base-path');
25
-
26
- /**
27
- * Configures DesignAngularKit library
28
- * @param config the DesignAngularKit config
29
- */
30
- function provideDesignAngularKit(config) {
31
- let assetBasePath = './bootstrap-italia';
32
- if (config?.assetBasePath) {
33
- assetBasePath = config.assetBasePath.endsWith('/')
34
- ? config.assetBasePath.substring(0, config.assetBasePath.lastIndexOf('/'))
35
- : config.assetBasePath;
36
- }
37
- const providers = [
38
- {
39
- provide: IT_ASSET_BASE_PATH,
40
- useValue: assetBasePath,
41
- },
42
- provideAnimationsAsync(),
43
- provideHttpClient(),
44
- ];
45
- if (config?.loadFont !== false) {
46
- // Add provider to initialize the bootstrap-italia font
47
- providers.push({
48
- provide: APP_INITIALIZER,
49
- useFactory: () => {
50
- return () => {
51
- loadFonts(`${assetBasePath}/dist/fonts`);
52
- };
53
- },
54
- multi: true,
55
- });
56
- }
57
- // Add provider to initialize the TranslateModule
58
- const langPrefix = `${assetBasePath}/i18n/`;
59
- const langSuffix = `.json`; // TODO: add ?v${version} to prevent cache loading on version change
60
- providers.push(importProvidersFrom(TranslateModule.forRoot({
61
- loader: config?.translateLoader?.(langPrefix, langSuffix) ?? {
62
- provide: TranslateLoader,
63
- useFactory: (http) => new TranslateHttpLoader(http, langPrefix, langSuffix),
64
- deps: [HttpClient],
65
- },
66
- defaultLanguage: 'it',
67
- useDefaultLang: true,
68
- })));
69
- // Add provider to initialize library default languages
70
- providers.push({
71
- provide: APP_INITIALIZER,
72
- useFactory: (translateService) => {
73
- return () => {
74
- translateService.addLangs(['it', 'en']); // Adds 'it' and 'en' as available languages.
75
- };
76
- },
77
- multi: true,
78
- deps: [TranslateService],
79
- });
80
- return makeEnvironmentProviders(providers);
81
- }
82
-
83
21
  class ItAbstractComponent {
84
22
  /**
85
23
  * Counter of active instances
@@ -288,6 +226,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
288
226
  args: ['collapse']
289
227
  }] } });
290
228
 
229
+ /**
230
+ * The bootstrap-italia asset folder path
231
+ * @default ./bootstrap-italia
232
+ */
233
+ const IT_ASSET_BASE_PATH = new InjectionToken('it-asset-base-path');
234
+
291
235
  class ItIconComponent {
292
236
  /**
293
237
  * Return the icon href
@@ -1400,9 +1344,9 @@ class ItDimmerComponent {
1400
1344
  this.elementRef?.nativeElement?.parentElement?.classList?.add('dimmable');
1401
1345
  }
1402
1346
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItDimmerComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
1403
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItDimmerComponent, isStandalone: true, selector: "it-dimmer", inputs: { active: "active", color: "color" }, ngImport: i0, template: "@if (active) {\n <div class=\"dimmer\" @fade [ngClass]=\"[color]\">\n <div class=\"dimmer-inner\">\n <ng-content></ng-content>\n </div>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [
1347
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItDimmerComponent, isStandalone: true, selector: "it-dimmer", inputs: { active: "active", color: "color" }, ngImport: i0, template: "@if (active) {\n <div class=\"dimmer\" @fade [ngClass]=\"[color, 'show']\">\n <div class=\"dimmer-inner\">\n <ng-content></ng-content>\n </div>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [
1404
1348
  trigger('fade', [
1405
- transition(':enter', [style({ opacity: 0 }), animate('150ms', style({ opacity: 0.92 }))]),
1349
+ transition(':enter', [style({ opacity: 0 }), animate('150ms', style({ opacity: 0.9 }))]),
1406
1350
  transition(':leave', [animate('150ms', style({ opacity: 0 }))]),
1407
1351
  ]),
1408
1352
  ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
@@ -1411,10 +1355,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
1411
1355
  type: Component,
1412
1356
  args: [{ standalone: true, selector: 'it-dimmer', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
1413
1357
  trigger('fade', [
1414
- transition(':enter', [style({ opacity: 0 }), animate('150ms', style({ opacity: 0.92 }))]),
1358
+ transition(':enter', [style({ opacity: 0 }), animate('150ms', style({ opacity: 0.9 }))]),
1415
1359
  transition(':leave', [animate('150ms', style({ opacity: 0 }))]),
1416
1360
  ]),
1417
- ], imports: [NgClass], template: "@if (active) {\n <div class=\"dimmer\" @fade [ngClass]=\"[color]\">\n <div class=\"dimmer-inner\">\n <ng-content></ng-content>\n </div>\n </div>\n}\n" }]
1361
+ ], imports: [NgClass], template: "@if (active) {\n <div class=\"dimmer\" @fade [ngClass]=\"[color, 'show']\">\n <div class=\"dimmer-inner\">\n <ng-content></ng-content>\n </div>\n </div>\n}\n" }]
1418
1362
  }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { active: [{
1419
1363
  type: Input
1420
1364
  }], color: [{
@@ -1605,29 +1549,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
1605
1549
  }]
1606
1550
  }] });
1607
1551
 
1608
- class ItMegamenuComponent {
1609
- constructor() {
1610
- /**
1611
- * Megamenu mode
1612
- */
1613
- this.mode = 'normal';
1614
- }
1615
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItMegamenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1616
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItMegamenuComponent, isStandalone: true, selector: "it-megamenu", inputs: { mode: "mode", header: ["header", "header", inputToBoolean], footer: ["footer", "footer", inputToBoolean] }, ngImport: i0, template: "<div class=\"megamenu pb-5 pt-3 py-lg-0\">\n <div class=\"row\">\n @if (mode === 'left-section') {\n <div class=\"col-xs-12 col-lg-4 px-0\">\n <div class=\"row\">\n <div class=\"col-12 it-vertical it-description pb-lg-3\">\n <div class=\"description-content ps-4 ps-sm-5 ms-3\">\n <ng-content select=\"[megamenuLeftZone]\"></ng-content>\n </div>\n </div>\n </div>\n </div>\n }\n <div class=\"col-12\" [class.col-lg-8]=\"mode !== 'normal'\">\n @if (header) {\n <div class=\"it-heading-link-wrapper\">\n <ng-content select=\"[megamenuHeadingLink]\"></ng-content>\n </div>\n }\n <div class=\"row\">\n <ng-content select=\"[megamenuLinkList]\"></ng-content>\n </div>\n </div>\n @if (footer || mode === 'right-section') {\n <div [class.col-xs-12]=\"mode === 'right-section'\" [class.col-lg-4]=\"mode === 'right-section'\" [class.px-0]=\"mode === 'right-section'\">\n <div [class.it-footer-link-wrapper]=\"footer\" [class.it-footer-link-wrapper-vertical]=\"mode === 'right-section'\">\n <div class=\"d-flex flex-column justify-content-around\" [class.flex-lg-row]=\"mode !== 'right-section'\">\n <ng-content select=\"[megamenuFooter]\"></ng-content>\n </div>\n </div>\n </div>\n }\n </div>\n</div>\n", styles: ["::ng-deep .theme-light-desk .nav-link:before{background-color:#06c}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1617
- }
1618
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItMegamenuComponent, decorators: [{
1619
- type: Component,
1620
- args: [{ standalone: true, selector: 'it-megamenu', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], template: "<div class=\"megamenu pb-5 pt-3 py-lg-0\">\n <div class=\"row\">\n @if (mode === 'left-section') {\n <div class=\"col-xs-12 col-lg-4 px-0\">\n <div class=\"row\">\n <div class=\"col-12 it-vertical it-description pb-lg-3\">\n <div class=\"description-content ps-4 ps-sm-5 ms-3\">\n <ng-content select=\"[megamenuLeftZone]\"></ng-content>\n </div>\n </div>\n </div>\n </div>\n }\n <div class=\"col-12\" [class.col-lg-8]=\"mode !== 'normal'\">\n @if (header) {\n <div class=\"it-heading-link-wrapper\">\n <ng-content select=\"[megamenuHeadingLink]\"></ng-content>\n </div>\n }\n <div class=\"row\">\n <ng-content select=\"[megamenuLinkList]\"></ng-content>\n </div>\n </div>\n @if (footer || mode === 'right-section') {\n <div [class.col-xs-12]=\"mode === 'right-section'\" [class.col-lg-4]=\"mode === 'right-section'\" [class.px-0]=\"mode === 'right-section'\">\n <div [class.it-footer-link-wrapper]=\"footer\" [class.it-footer-link-wrapper-vertical]=\"mode === 'right-section'\">\n <div class=\"d-flex flex-column justify-content-around\" [class.flex-lg-row]=\"mode !== 'right-section'\">\n <ng-content select=\"[megamenuFooter]\"></ng-content>\n </div>\n </div>\n </div>\n }\n </div>\n</div>\n", styles: ["::ng-deep .theme-light-desk .nav-link:before{background-color:#06c}\n"] }]
1621
- }], propDecorators: { mode: [{
1622
- type: Input
1623
- }], header: [{
1624
- type: Input,
1625
- args: [{ transform: inputToBoolean }]
1626
- }], footer: [{
1627
- type: Input,
1628
- args: [{ transform: inputToBoolean }]
1629
- }] } });
1630
-
1631
1552
  /**
1632
1553
  * Modal windows
1633
1554
  * @description To show featured content, notifications to users, or personalized content.
@@ -3465,6 +3386,118 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
3465
3386
  }]
3466
3387
  }] });
3467
3388
 
3389
+ /**
3390
+ * Timeline Item
3391
+ * @description Represents a single event for Timeline component.
3392
+ */
3393
+ class ItTimelineItemComponent extends ItAbstractComponent {
3394
+ constructor() {
3395
+ super(...arguments);
3396
+ /**
3397
+ * Timeline element reference date format
3398
+ * @default dd/MM/yyyy
3399
+ */
3400
+ this.dateFormat = 'dd/MM/yyyy';
3401
+ /**
3402
+ * Timeline element PIN type
3403
+ * @default none
3404
+ */
3405
+ this.pinType = 'default';
3406
+ /**
3407
+ * Timeline element PIN icon
3408
+ * @default code-circle
3409
+ */
3410
+ this.pinIcon = 'code-circle';
3411
+ /**
3412
+ * Timeline element show detail link
3413
+ * @default false
3414
+ */
3415
+ this.showReadMore = false;
3416
+ /** Timeline element detail link
3417
+ * @default #
3418
+ */
3419
+ this.readMoreLink = '#';
3420
+ }
3421
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3422
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItTimelineItemComponent, isStandalone: true, selector: "it-timeline-item", inputs: { title: "title", text: "text", signature: "signature", eventDate: "eventDate", dateFormat: "dateFormat", pinText: "pinText", pinType: "pinType", pinIcon: "pinIcon", categoryTitle: "categoryTitle", categoryLink: "categoryLink", showReadMore: ["showReadMore", "showReadMore", inputToBoolean], readMoreLink: "readMoreLink" }, usesInheritance: true, ngImport: i0, template: "<div class=\"timeline-element\">\n @if (pinType === 'now') {\n <span class=\"it-now-label d-none d-lg-flex\">{{ 'it.timeline.today' | translate }}</span>\n }\n <div class=\"it-pin-wrapper\" [ngClass]=\"{ 'it-evidence': pinType === 'evidence', 'it-now': pinType === 'now' }\">\n <div class=\"pin-icon\">\n @if (pinIcon) {\n <it-icon [name]=\"pinIcon\"></it-icon>\n } @else {\n <it-icon name=\"code-circle\"></it-icon>\n }\n </div>\n <div class=\"pin-text\">\n <span>{{ pinText }}</span>\n </div>\n </div>\n <div class=\"card-wrapper\">\n <div class=\"card\">\n <div class=\"card-body\">\n @if ((categoryTitle && categoryLink) || eventDate) {\n <div class=\"category-top\">\n @if (categoryTitle) {\n <a class=\"category\" [href]=\"categoryLink\">{{ categoryTitle }}</a>\n }\n @if (eventDate) {\n <span class=\"data\">{{ eventDate | date: dateFormat }}</span>\n }\n </div>\n }\n <h5 class=\"card-title\">{{ title }}</h5>\n <p class=\"card-text\">{{ text }}</p>\n @if (signature) {\n <span class=\"card-signature\">{{ signature }}</span>\n }\n @if (showReadMore) {\n <a class=\"read-more\" [href]=\"readMoreLink\">\n <span class=\"text\">{{ 'it.timeline.read-more' | translate }}</span>\n <span class=\"visually-hidden\">{{ 'it.timeline.read-more-on' | translate: { title: title } }}</span>\n <it-icon name=\"arrow-right\"></it-icon>\n </a>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ItIconComponent, selector: "it-icon", inputs: ["name", "size", "color", "padded", "svgClass", "labelWaria"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3423
+ }
3424
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineItemComponent, decorators: [{
3425
+ type: Component,
3426
+ args: [{ standalone: true, selector: 'it-timeline-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ItIconComponent, DatePipe, TranslateModule, NgClass], template: "<div class=\"timeline-element\">\n @if (pinType === 'now') {\n <span class=\"it-now-label d-none d-lg-flex\">{{ 'it.timeline.today' | translate }}</span>\n }\n <div class=\"it-pin-wrapper\" [ngClass]=\"{ 'it-evidence': pinType === 'evidence', 'it-now': pinType === 'now' }\">\n <div class=\"pin-icon\">\n @if (pinIcon) {\n <it-icon [name]=\"pinIcon\"></it-icon>\n } @else {\n <it-icon name=\"code-circle\"></it-icon>\n }\n </div>\n <div class=\"pin-text\">\n <span>{{ pinText }}</span>\n </div>\n </div>\n <div class=\"card-wrapper\">\n <div class=\"card\">\n <div class=\"card-body\">\n @if ((categoryTitle && categoryLink) || eventDate) {\n <div class=\"category-top\">\n @if (categoryTitle) {\n <a class=\"category\" [href]=\"categoryLink\">{{ categoryTitle }}</a>\n }\n @if (eventDate) {\n <span class=\"data\">{{ eventDate | date: dateFormat }}</span>\n }\n </div>\n }\n <h5 class=\"card-title\">{{ title }}</h5>\n <p class=\"card-text\">{{ text }}</p>\n @if (signature) {\n <span class=\"card-signature\">{{ signature }}</span>\n }\n @if (showReadMore) {\n <a class=\"read-more\" [href]=\"readMoreLink\">\n <span class=\"text\">{{ 'it.timeline.read-more' | translate }}</span>\n <span class=\"visually-hidden\">{{ 'it.timeline.read-more-on' | translate: { title: title } }}</span>\n <it-icon name=\"arrow-right\"></it-icon>\n </a>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
3427
+ }], propDecorators: { title: [{
3428
+ type: Input,
3429
+ args: [{ required: true }]
3430
+ }], text: [{
3431
+ type: Input,
3432
+ args: [{ required: true }]
3433
+ }], signature: [{
3434
+ type: Input
3435
+ }], eventDate: [{
3436
+ type: Input
3437
+ }], dateFormat: [{
3438
+ type: Input
3439
+ }], pinText: [{
3440
+ type: Input,
3441
+ args: [{ required: true }]
3442
+ }], pinType: [{
3443
+ type: Input
3444
+ }], pinIcon: [{
3445
+ type: Input
3446
+ }], categoryTitle: [{
3447
+ type: Input
3448
+ }], categoryLink: [{
3449
+ type: Input
3450
+ }], showReadMore: [{
3451
+ type: Input,
3452
+ args: [{ transform: inputToBoolean }]
3453
+ }], readMoreLink: [{
3454
+ type: Input
3455
+ }] } });
3456
+
3457
+ /**
3458
+ * Timeline
3459
+ * @description Build timeline for chronological representation of events.
3460
+ */
3461
+ class ItTimelineComponent extends ItAbstractComponent {
3462
+ constructor() {
3463
+ super(...arguments);
3464
+ /**
3465
+ * Timeline elements array
3466
+ * @default []
3467
+ */
3468
+ this.timelineElements = [];
3469
+ /**
3470
+ * Default date format for timeline element reference date
3471
+ * @default dd/MM/yyyy
3472
+ */
3473
+ this.dateFormat = 'dd/MM/yyyy';
3474
+ }
3475
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3476
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItTimelineComponent, isStandalone: true, selector: "it-timeline", inputs: { timelineElements: "timelineElements", dateFormat: "dateFormat" }, usesInheritance: true, ngImport: i0, template: "<div class=\"it-timeline-wrapper\">\n <div class=\"row\">\n @for (element of timelineElements; track $index) {\n <div class=\"col-12\">\n <it-timeline-item\n [title]=\"element.title\"\n [text]=\"element.text\"\n [signature]=\"element.signature\"\n [pinType]=\"element.pin?.type\"\n [pinIcon]=\"element.pin?.icon\"\n [pinText]=\"element.pin?.text\"\n [eventDate]=\"element.eventDate\"\n [dateFormat]=\"dateFormat\"\n [categoryTitle]=\"element.category?.title\"\n [categoryLink]=\"element.category?.link\"\n [showReadMore]=\"!!element.link?.length\"\n [readMoreLink]=\"element.link\" />\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ItTimelineItemComponent, selector: "it-timeline-item", inputs: ["title", "text", "signature", "eventDate", "dateFormat", "pinText", "pinType", "pinIcon", "categoryTitle", "categoryLink", "showReadMore", "readMoreLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3477
+ }
3478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineComponent, decorators: [{
3479
+ type: Component,
3480
+ args: [{ standalone: true, selector: 'it-timeline', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ItIconComponent, TranslateModule, ItTimelineItemComponent], template: "<div class=\"it-timeline-wrapper\">\n <div class=\"row\">\n @for (element of timelineElements; track $index) {\n <div class=\"col-12\">\n <it-timeline-item\n [title]=\"element.title\"\n [text]=\"element.text\"\n [signature]=\"element.signature\"\n [pinType]=\"element.pin?.type\"\n [pinIcon]=\"element.pin?.icon\"\n [pinText]=\"element.pin?.text\"\n [eventDate]=\"element.eventDate\"\n [dateFormat]=\"dateFormat\"\n [categoryTitle]=\"element.category?.title\"\n [categoryLink]=\"element.category?.link\"\n [showReadMore]=\"!!element.link?.length\"\n [readMoreLink]=\"element.link\" />\n </div>\n }\n </div>\n</div>\n" }]
3481
+ }], propDecorators: { timelineElements: [{
3482
+ type: Input
3483
+ }], dateFormat: [{
3484
+ type: Input
3485
+ }] } });
3486
+
3487
+ const timelineComponents = [ItTimelineComponent, ItTimelineItemComponent];
3488
+ class ItTimelineModule {
3489
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3490
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineModule, imports: [ItTimelineComponent, ItTimelineItemComponent], exports: [ItTimelineComponent, ItTimelineItemComponent] }); }
3491
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineModule, imports: [timelineComponents] }); }
3492
+ }
3493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineModule, decorators: [{
3494
+ type: NgModule,
3495
+ args: [{
3496
+ imports: timelineComponents,
3497
+ exports: timelineComponents,
3498
+ }]
3499
+ }] });
3500
+
3468
3501
  class ItTooltipDirective {
3469
3502
  /**
3470
3503
  * Define the tooltip title
@@ -4494,52 +4527,510 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
4494
4527
  type: Output
4495
4528
  }] } });
4496
4529
 
4497
- const formComponents = [
4498
- ItAutocompleteComponent,
4499
- ItCheckboxComponent,
4500
- ItInputComponent,
4501
- ItPasswordInputComponent,
4502
- ItRadioButtonComponent,
4503
- ItRangeComponent,
4504
- ItRatingComponent,
4505
- ItSelectComponent,
4506
- ItTextareaComponent,
4507
- ItUploadDragDropComponent,
4508
- ItUploadFileListComponent,
4509
- ];
4510
- class ItFormModule {
4511
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4512
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.6", ngImport: i0, type: ItFormModule, imports: [ItAutocompleteComponent,
4513
- ItCheckboxComponent,
4514
- ItInputComponent,
4515
- ItPasswordInputComponent,
4516
- ItRadioButtonComponent,
4517
- ItRangeComponent,
4518
- ItRatingComponent,
4519
- ItSelectComponent,
4520
- ItTextareaComponent,
4521
- ItUploadDragDropComponent,
4522
- ItUploadFileListComponent], exports: [ItAutocompleteComponent,
4523
- ItCheckboxComponent,
4524
- ItInputComponent,
4525
- ItPasswordInputComponent,
4526
- ItRadioButtonComponent,
4527
- ItRangeComponent,
4528
- ItRatingComponent,
4529
- ItSelectComponent,
4530
- ItTextareaComponent,
4531
- ItUploadDragDropComponent,
4532
- ItUploadFileListComponent] }); }
4533
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItFormModule, imports: [formComponents] }); }
4534
- }
4535
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItFormModule, decorators: [{
4536
- type: NgModule,
4537
- args: [{
4538
- imports: formComponents,
4539
- exports: formComponents,
4540
- }]
4541
- }] });
4542
-
4530
+ //#region private utility functions
4531
+ const generateSelectAll = (checked, items) => {
4532
+ const selected = new Set();
4533
+ if (checked) {
4534
+ items.forEach(item => selected.add(item));
4535
+ }
4536
+ return selected;
4537
+ };
4538
+ const updateSelected = (set, item) => {
4539
+ if (set.has(item)) {
4540
+ set.delete(item);
4541
+ }
4542
+ else {
4543
+ set.add(item);
4544
+ }
4545
+ return set;
4546
+ };
4547
+ //#endregion
4548
+ //#region reducers
4549
+ const init = (state, { source, target }) => ({
4550
+ ...state,
4551
+ initialItems: {
4552
+ source: [...source],
4553
+ target: [...target],
4554
+ },
4555
+ current: {
4556
+ source: [...source],
4557
+ target: [...target],
4558
+ },
4559
+ });
4560
+ const transfer = (state) => {
4561
+ return {
4562
+ ...state,
4563
+ current: {
4564
+ ...state.current,
4565
+ source: state.current.source.filter(i => !state.selections.source.has(i)),
4566
+ target: Array.from(new Set([...state.current.target, ...Array.from(state.selections.source)])),
4567
+ },
4568
+ selections: {
4569
+ ...state.selections,
4570
+ source: new Set(),
4571
+ },
4572
+ operationsEnabled: {
4573
+ ...state.operationsEnabled,
4574
+ transfer: false,
4575
+ reset: true,
4576
+ },
4577
+ };
4578
+ };
4579
+ const backtransfer = (state) => {
4580
+ return {
4581
+ ...state,
4582
+ current: {
4583
+ ...state.current,
4584
+ target: state.current.target.filter(i => !state.selections.target.has(i)),
4585
+ source: Array.from(new Set([...state.current.source, ...Array.from(state.selections.target)])),
4586
+ },
4587
+ selections: {
4588
+ ...state.selections,
4589
+ target: new Set(),
4590
+ },
4591
+ operationsEnabled: {
4592
+ ...state.operationsEnabled,
4593
+ backtransfer: false,
4594
+ reset: true,
4595
+ },
4596
+ };
4597
+ };
4598
+ const reset = (state) => {
4599
+ return {
4600
+ ...state,
4601
+ current: {
4602
+ source: [...state.initialItems.source],
4603
+ target: [...state.initialItems.target],
4604
+ },
4605
+ operationsEnabled: {
4606
+ ...state.operationsEnabled,
4607
+ reset: false,
4608
+ },
4609
+ };
4610
+ };
4611
+ const selectAllSource = (state, { checked }) => {
4612
+ const items = state.current.source;
4613
+ const selected = generateSelectAll(checked, items);
4614
+ const transfer = Boolean(selected.size);
4615
+ return {
4616
+ ...state,
4617
+ selections: {
4618
+ ...state.selections,
4619
+ source: selected,
4620
+ },
4621
+ operationsEnabled: {
4622
+ ...state.operationsEnabled,
4623
+ transfer,
4624
+ },
4625
+ };
4626
+ };
4627
+ const selectAllTarget = (state, { checked }) => {
4628
+ const items = state.current.target;
4629
+ const selected = generateSelectAll(checked, items);
4630
+ const backtransfer = Boolean(selected.size);
4631
+ return {
4632
+ ...state,
4633
+ selections: {
4634
+ ...state.selections,
4635
+ target: selected,
4636
+ },
4637
+ operationsEnabled: {
4638
+ ...state.operationsEnabled,
4639
+ backtransfer,
4640
+ },
4641
+ };
4642
+ };
4643
+ const selectionItemSource = (previousState, { item }) => {
4644
+ const selected = updateSelected(previousState.selections.source, item);
4645
+ const selectedItems = Array.from(selected);
4646
+ const transfer = Boolean(selectedItems.length);
4647
+ const source = new Set([...selectedItems]);
4648
+ const state = {
4649
+ ...previousState,
4650
+ selections: {
4651
+ ...previousState.selections,
4652
+ source,
4653
+ },
4654
+ operationsEnabled: {
4655
+ ...previousState.operationsEnabled,
4656
+ transfer,
4657
+ },
4658
+ };
4659
+ return state;
4660
+ };
4661
+ const selectionItemTarget = (previousState, { item }) => {
4662
+ const selected = updateSelected(previousState.selections.target, item);
4663
+ const selectedItems = Array.from(selected);
4664
+ const backtransfer = Boolean(selectedItems.length);
4665
+ const target = new Set([...selectedItems]);
4666
+ const state = {
4667
+ ...previousState,
4668
+ selections: {
4669
+ ...previousState.selections,
4670
+ target,
4671
+ },
4672
+ operationsEnabled: {
4673
+ ...previousState.operationsEnabled,
4674
+ backtransfer,
4675
+ },
4676
+ };
4677
+ return state;
4678
+ };
4679
+ //#endregion reducers
4680
+ //#region public reducers
4681
+ const initialStateFn = () => ({
4682
+ initialItems: {
4683
+ source: [],
4684
+ target: [],
4685
+ },
4686
+ current: {
4687
+ source: [],
4688
+ target: [],
4689
+ },
4690
+ selections: {
4691
+ source: new Set(),
4692
+ target: new Set(),
4693
+ },
4694
+ operationsEnabled: {
4695
+ transfer: false,
4696
+ backtransfer: false,
4697
+ reset: false,
4698
+ },
4699
+ });
4700
+ const initFn = (payload) => (state) => init(state, payload);
4701
+ const transferFn = () => (state) => transfer(state);
4702
+ const backtransferFn = () => (state) => backtransfer(state);
4703
+ const resetFn = () => (state) => reset(state);
4704
+ const selectAllSourceFn = ({ checked }) => (state) => selectAllSource(state, { checked });
4705
+ const selectAllTargetFn = ({ checked }) => (state) => selectAllTarget(state, { checked });
4706
+ const selectionItemSourceFn = ({ item }) => (state) => selectionItemSource(state, { item });
4707
+ const selectionItemTargetFn = ({ item }) => (state) => selectionItemTarget(state, { item });
4708
+ //#endregion
4709
+ var reducers = {
4710
+ initialStateFn,
4711
+ initFn,
4712
+ transferFn,
4713
+ backtransferFn,
4714
+ resetFn,
4715
+ selectAllSourceFn,
4716
+ selectAllTargetFn,
4717
+ selectionItemSourceFn,
4718
+ selectionItemTargetFn,
4719
+ };
4720
+
4721
+ class TransferStore {
4722
+ constructor() {
4723
+ this._state = new BehaviorSubject(reducers.initialStateFn());
4724
+ this.sourceItems = this._state.pipe(map(state => state.current.source));
4725
+ this.targetItems = this._state.pipe(map(state => state.current.target));
4726
+ this.valueChanged = this._state.pipe(map(state => state.current.target), distinctUntilChanged());
4727
+ this.selectItems = (sourceType) => {
4728
+ if (sourceType === 'source') {
4729
+ return this.sourceItems;
4730
+ }
4731
+ if (sourceType === 'target') {
4732
+ return this.targetItems;
4733
+ }
4734
+ return of([]);
4735
+ };
4736
+ this.selectSelectedItems = (sourceType) => {
4737
+ if (sourceType === 'source') {
4738
+ return this._state.pipe(map(state => state.selections.source));
4739
+ }
4740
+ if (sourceType === 'target') {
4741
+ return this._state.pipe(map(state => state.selections.target));
4742
+ }
4743
+ return of(new Set());
4744
+ };
4745
+ this.transferEnabled = this._state.pipe(map(state => state.operationsEnabled.transfer));
4746
+ this.backtransferEnabled = this._state.pipe(map(state => state.operationsEnabled.backtransfer));
4747
+ this.resetEnabled = this._state.pipe(map(state => state.operationsEnabled.reset));
4748
+ }
4749
+ init({ source, target }) {
4750
+ this.updateState(reducers.initFn({ source, target }));
4751
+ }
4752
+ transfer() {
4753
+ this.updateState(reducers.transferFn());
4754
+ }
4755
+ backtransfer() {
4756
+ this.updateState(reducers.backtransferFn());
4757
+ }
4758
+ reset() {
4759
+ this.updateState(reducers.resetFn());
4760
+ }
4761
+ checkboxSelection(item, sourceType) {
4762
+ if (sourceType === 'source') {
4763
+ this.updateState(reducers.selectionItemSourceFn({ item }));
4764
+ }
4765
+ if (sourceType === 'target') {
4766
+ this.updateState(reducers.selectionItemTargetFn({ item }));
4767
+ }
4768
+ }
4769
+ selectAllSelection(checked, sourceType) {
4770
+ if (sourceType === 'source') {
4771
+ this.updateState(reducers.selectAllSourceFn({ checked }));
4772
+ }
4773
+ if (sourceType === 'target') {
4774
+ this.updateState(reducers.selectAllTargetFn({ checked }));
4775
+ }
4776
+ }
4777
+ updateState(reducerFn) {
4778
+ this._state.next(reducerFn(this._state.value));
4779
+ }
4780
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: TransferStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4781
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: TransferStore }); }
4782
+ }
4783
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: TransferStore, decorators: [{
4784
+ type: Injectable
4785
+ }] });
4786
+
4787
+ class ItTransferListComponent extends ItAbstractComponent {
4788
+ constructor(store) {
4789
+ super();
4790
+ this.store = store;
4791
+ /**
4792
+ * Widget title
4793
+ */
4794
+ this.title = inject(new HostAttributeToken('title'), { optional: true });
4795
+ this.sourceType = inject(new HostAttributeToken('sourceType'), { optional: true });
4796
+ this.items = this.store.selectItems(this.sourceType).pipe(distinctUntilChanged(), shareReplay());
4797
+ this.selected = this.store.selectSelectedItems(this.sourceType).pipe(distinctUntilChanged(), shareReplay());
4798
+ this.numberOfItems$ = this.items.pipe(map(items => ({ length: items.length })), startWith({ length: 0 }));
4799
+ this.selectAllDisabled = this.items.pipe(map(items => items.length === 0));
4800
+ /**
4801
+ * Items of the list
4802
+ * @default []
4803
+ */
4804
+ this.items$ = combineLatest([this.items, this.selected]).pipe(map(([items, selected]) => items.map(item => {
4805
+ item.selected = selected.has(item);
4806
+ return item;
4807
+ })));
4808
+ this.instanceId = this.getInstanceId();
4809
+ this.onItemsUpdate();
4810
+ }
4811
+ /**
4812
+ * Checkbox selection click handler
4813
+ */
4814
+ checkboxSelectionHandler(item) {
4815
+ this.store.checkboxSelection(item, this.sourceType);
4816
+ }
4817
+ /**
4818
+ * Checkbox select all selection handler
4819
+ */
4820
+ checkboxSelectAllHandler(event) {
4821
+ const checked = event.target.checked;
4822
+ this.store.selectAllSelection(checked, this.sourceType);
4823
+ }
4824
+ /**
4825
+ * Items update subscription
4826
+ */
4827
+ onItemsUpdate() {
4828
+ this.items
4829
+ .pipe(takeUntilDestroyed(), skip(1), tap(() => {
4830
+ if (this.selectAllCheckboxRef) {
4831
+ this.selectAllCheckboxRef.nativeElement.checked = false;
4832
+ }
4833
+ }))
4834
+ .subscribe();
4835
+ }
4836
+ getInstanceId() {
4837
+ return Math.floor(Math.random() * 100000000).toString();
4838
+ }
4839
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTransferListComponent, deps: [{ token: TransferStore }], target: i0.ɵɵFactoryTarget.Component }); }
4840
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItTransferListComponent, isStandalone: true, selector: "it-transfer-list", viewQueries: [{ propertyName: "selectAllCheckboxRef", first: true, predicate: ["selectAllCheckbox"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"it-transfer-wrapper source\">\n <div class=\"transfer-header\">\n <div class=\"form-check\" aria-describedby=\"\">\n <input\n #selectAllCheckbox\n type=\"checkbox\"\n id=\"{{ instanceId }}checkbox{{ title }}\"\n [disabled]=\"selectAllDisabled | async\"\n (click)=\"checkboxSelectAllHandler($event)\" />\n <label for=\"{{ instanceId }}checkbox{{ title }}\">\n <span>\n @if (numberOfItems$ | async; as numberOfItems) {\n <span class=\"num\"> {{ numberOfItems.length }} </span>\n <span> {{ numberOfItems.length > 1 ? 'ITEMS' : 'ITEM' }} </span>\n }\n </span>\n <span class=\"descr\">{{ title | titlecase }}</span>\n </label>\n </div>\n <!-- form check -->\n </div>\n <!-- transfer-header -->\n <div class=\"transfer-scroll\">\n <div class=\"transfer-group\">\n @for (item of items$ | async; track item.value) {\n <div class=\"form-check\" aria-describedby=\"\">\n <input\n type=\"checkbox\"\n id=\"{{ instanceId }}-{{ item.value }}\"\n [checked]=\"item.selected\"\n (click)=\"checkboxSelectionHandler(item)\" />\n <label for=\"{{ instanceId }}-{{ item.value }}\">\n <span>\n <span>{{ item.text }}</span>\n </span>\n </label>\n </div>\n }\n </div>\n </div>\n</div>\n<!-- it-transfer-wrapper -->\n", dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4841
+ }
4842
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTransferListComponent, decorators: [{
4843
+ type: Component,
4844
+ args: [{ selector: 'it-transfer-list', standalone: true, imports: [AsyncPipe, TitleCasePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"it-transfer-wrapper source\">\n <div class=\"transfer-header\">\n <div class=\"form-check\" aria-describedby=\"\">\n <input\n #selectAllCheckbox\n type=\"checkbox\"\n id=\"{{ instanceId }}checkbox{{ title }}\"\n [disabled]=\"selectAllDisabled | async\"\n (click)=\"checkboxSelectAllHandler($event)\" />\n <label for=\"{{ instanceId }}checkbox{{ title }}\">\n <span>\n @if (numberOfItems$ | async; as numberOfItems) {\n <span class=\"num\"> {{ numberOfItems.length }} </span>\n <span> {{ numberOfItems.length > 1 ? 'ITEMS' : 'ITEM' }} </span>\n }\n </span>\n <span class=\"descr\">{{ title | titlecase }}</span>\n </label>\n </div>\n <!-- form check -->\n </div>\n <!-- transfer-header -->\n <div class=\"transfer-scroll\">\n <div class=\"transfer-group\">\n @for (item of items$ | async; track item.value) {\n <div class=\"form-check\" aria-describedby=\"\">\n <input\n type=\"checkbox\"\n id=\"{{ instanceId }}-{{ item.value }}\"\n [checked]=\"item.selected\"\n (click)=\"checkboxSelectionHandler(item)\" />\n <label for=\"{{ instanceId }}-{{ item.value }}\">\n <span>\n <span>{{ item.text }}</span>\n </span>\n </label>\n </div>\n }\n </div>\n </div>\n</div>\n<!-- it-transfer-wrapper -->\n" }]
4845
+ }], ctorParameters: () => [{ type: TransferStore }], propDecorators: { selectAllCheckboxRef: [{
4846
+ type: ViewChild,
4847
+ args: ['selectAllCheckbox']
4848
+ }] } });
4849
+
4850
+ /**
4851
+ * Transfer
4852
+ * @description Component that allows the creation of checkbox lists.
4853
+ */
4854
+ class ItTransferComponent extends ItAbstractFormComponent {
4855
+ constructor(_ngControl, _translateService, store) {
4856
+ super(_translateService, _ngControl);
4857
+ this._ngControl = _ngControl;
4858
+ this._translateService = _translateService;
4859
+ this.store = store;
4860
+ /**
4861
+ * The select options (left side)
4862
+ */
4863
+ this.options = [];
4864
+ /**
4865
+ * The selected options (right side)
4866
+ */
4867
+ this.selected = [];
4868
+ /**
4869
+ * Fired when there is a transfer, a backtransfer or a reset event
4870
+ */
4871
+ this.transferChanges = new EventEmitter();
4872
+ /**
4873
+ * Enable transfer button
4874
+ * @default false
4875
+ */
4876
+ this.transferEnabled = this.store.transferEnabled;
4877
+ /**
4878
+ * Enable backtransfer button
4879
+ * @default false
4880
+ */
4881
+ this.backtransferEnabled = this.store.backtransferEnabled;
4882
+ /**
4883
+ * Enable reset button
4884
+ * @default false
4885
+ */
4886
+ this.resetEnabled = this.store.resetEnabled;
4887
+ this.destroyRef = inject(DestroyRef);
4888
+ }
4889
+ ngOnInit() {
4890
+ super.ngOnInit();
4891
+ this.storeInit();
4892
+ this.onStoreValueChanged();
4893
+ }
4894
+ /**
4895
+ * Transfer button click handler
4896
+ */
4897
+ transferClickHandler(event) {
4898
+ this.buttonEventHandler(event, () => this.store.transfer());
4899
+ }
4900
+ /**
4901
+ * Transfer button keypress handler
4902
+ */
4903
+ transferKeyPressHandler(event) {
4904
+ this.buttonEventHandler(event, () => this.store.transfer());
4905
+ }
4906
+ /**
4907
+ * Backtransfer button click handler
4908
+ */
4909
+ backtransferClickHandler(event) {
4910
+ this.buttonEventHandler(event, () => this.store.backtransfer());
4911
+ }
4912
+ /**
4913
+ * Backtransfer button keypress handler
4914
+ */
4915
+ backtransferKeyPressHandler(event) {
4916
+ this.buttonEventHandler(event, () => this.store.backtransfer());
4917
+ }
4918
+ /**
4919
+ * Reset button click handler
4920
+ */
4921
+ resetClickHandler(event) {
4922
+ this.buttonEventHandler(event, () => this.store.reset());
4923
+ }
4924
+ /**
4925
+ * Reset button keypress handler
4926
+ */
4927
+ resetKeyPressHandler(event) {
4928
+ this.buttonEventHandler(event, () => this.store.reset());
4929
+ }
4930
+ buttonEventHandler(event, updateStoreCb) {
4931
+ event.preventDefault();
4932
+ updateStoreCb();
4933
+ }
4934
+ storeInit() {
4935
+ let target = [];
4936
+ const ngControl = this._ngControl;
4937
+ const isNgControlDefined = Boolean(this._ngControl);
4938
+ // if ngControl is defined, take values from it. Input() target will be ignored
4939
+ if (isNgControlDefined) {
4940
+ console.debug('ngControl instanceof NgModel:', ngControl instanceof NgModel);
4941
+ console.debug('ngControl instanceof FormControlName:', ngControl instanceof FormControlName);
4942
+ // if ngControl is an ngModel (template-driven form use case), take values from it
4943
+ if (ngControl instanceof NgModel) {
4944
+ console.debug('ngControl instanceof NgModel');
4945
+ const model = ngControl.model;
4946
+ target = Array.isArray(model) ? model : [];
4947
+ }
4948
+ // if ngControl is an FormControlName (reactive form use case), take values from it
4949
+ if (ngControl instanceof FormControlName) {
4950
+ console.debug('ngControl instanceof FormControlName');
4951
+ const model = ngControl.control.value;
4952
+ target = Array.isArray(model) ? model : [];
4953
+ }
4954
+ console.debug('ngControl is defined. Input() target will be ignored');
4955
+ }
4956
+ else if (this.selected && Array.isArray(this.selected)) {
4957
+ target = [...this.selected];
4958
+ }
4959
+ console.debug('target:', this.selected, 'formControl:', this.control.value, 'ngModel:', this._ngControl);
4960
+ this.store.init({ source: [...this.options], target });
4961
+ }
4962
+ onStoreValueChanged() {
4963
+ this.store.valueChanged
4964
+ .pipe(takeUntilDestroyed(this.destroyRef), tap(value => this.writeValue(value)), tap(value => this.onChange(value)), tap(value => this.transferChanges.emit(value)))
4965
+ .subscribe();
4966
+ }
4967
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTransferComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i1.TranslateService }, { token: TransferStore }], target: i0.ɵɵFactoryTarget.Component }); }
4968
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItTransferComponent, isStandalone: true, selector: "it-transfer", inputs: { options: "options", selected: "selected" }, outputs: { transferChanges: "transferChanges" }, providers: [TransferStore], usesInheritance: true, ngImport: i0, template: "<div class=\"form-group\">\n @if (label) {\n <label [for]=\"id\" [class.active]=\"!!control.value\">{{ label }}</label>\n }\n <div class=\"row\">\n <div class=\"col-xs-12 col-md-5\">\n <it-transfer-list sourceType=\"source\" title=\"source\"></it-transfer-list>\n </div>\n <!-- col -->\n <div class=\"col-xs-12 col-md-2\">\n <!-- transfer buttons-->\n <div class=\"it-transfer-buttons\">\n <a\n class=\"transfer\"\n role=\"button\"\n href=\"#\"\n [ngClass]=\"{ active: transferEnabled | async }\"\n (click)=\"transferClickHandler($event)\"\n (keypress)=\"transferKeyPressHandler($event)\"\n aria-label=\"Sposta avanti\">\n <svg class=\"icon\"><use href=\"/bootstrap-italia/dist/svg/sprites.svg#it-arrow-right\"></use></svg>\n </a>\n <span class=\"visually-hidden\">Etichetta per freccia destra</span>\n <a\n class=\"backtransfer\"\n role=\"button\"\n href=\"#\"\n [ngClass]=\"{ active: backtransferEnabled | async }\"\n (click)=\"backtransferClickHandler($event)\"\n (keypress)=\"backtransferKeyPressHandler($event)\"\n aria-label=\"Sposta indietro\">\n <svg class=\"icon\"><use href=\"/bootstrap-italia/dist/svg/sprites.svg#it-arrow-left\"></use></svg>\n </a>\n <span class=\"visually-hidden\">Etichetta for freccia sinistra</span>\n <a\n class=\"reset\"\n role=\"button\"\n href=\"#\"\n [ngClass]=\"{ active: resetEnabled | async }\"\n (click)=\"resetClickHandler($event)\"\n (keypress)=\"resetKeyPressHandler($event)\"\n aria-label=\"Reset\">\n <svg class=\"icon\"><use href=\"/bootstrap-italia/dist/svg/sprites.svg#it-restore\"></use></svg>\n </a>\n <span class=\"visually-hidden\">Etichetta per icona di reset</span>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-5\">\n <it-transfer-list sourceType=\"target\" title=\"target\"></it-transfer-list>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ItTransferListComponent, selector: "it-transfer-list" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4969
+ }
4970
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTransferComponent, decorators: [{
4971
+ type: Component,
4972
+ args: [{ selector: 'it-transfer', standalone: true, imports: [ItTransferListComponent, NgClass, AsyncPipe, ReactiveFormsModule], providers: [TransferStore], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-group\">\n @if (label) {\n <label [for]=\"id\" [class.active]=\"!!control.value\">{{ label }}</label>\n }\n <div class=\"row\">\n <div class=\"col-xs-12 col-md-5\">\n <it-transfer-list sourceType=\"source\" title=\"source\"></it-transfer-list>\n </div>\n <!-- col -->\n <div class=\"col-xs-12 col-md-2\">\n <!-- transfer buttons-->\n <div class=\"it-transfer-buttons\">\n <a\n class=\"transfer\"\n role=\"button\"\n href=\"#\"\n [ngClass]=\"{ active: transferEnabled | async }\"\n (click)=\"transferClickHandler($event)\"\n (keypress)=\"transferKeyPressHandler($event)\"\n aria-label=\"Sposta avanti\">\n <svg class=\"icon\"><use href=\"/bootstrap-italia/dist/svg/sprites.svg#it-arrow-right\"></use></svg>\n </a>\n <span class=\"visually-hidden\">Etichetta per freccia destra</span>\n <a\n class=\"backtransfer\"\n role=\"button\"\n href=\"#\"\n [ngClass]=\"{ active: backtransferEnabled | async }\"\n (click)=\"backtransferClickHandler($event)\"\n (keypress)=\"backtransferKeyPressHandler($event)\"\n aria-label=\"Sposta indietro\">\n <svg class=\"icon\"><use href=\"/bootstrap-italia/dist/svg/sprites.svg#it-arrow-left\"></use></svg>\n </a>\n <span class=\"visually-hidden\">Etichetta for freccia sinistra</span>\n <a\n class=\"reset\"\n role=\"button\"\n href=\"#\"\n [ngClass]=\"{ active: resetEnabled | async }\"\n (click)=\"resetClickHandler($event)\"\n (keypress)=\"resetKeyPressHandler($event)\"\n aria-label=\"Reset\">\n <svg class=\"icon\"><use href=\"/bootstrap-italia/dist/svg/sprites.svg#it-restore\"></use></svg>\n </a>\n <span class=\"visually-hidden\">Etichetta per icona di reset</span>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-5\">\n <it-transfer-list sourceType=\"target\" title=\"target\"></it-transfer-list>\n </div>\n </div>\n</div>\n" }]
4973
+ }], ctorParameters: () => [{ type: i1$1.NgControl, decorators: [{
4974
+ type: Self
4975
+ }, {
4976
+ type: Optional
4977
+ }] }, { type: i1.TranslateService }, { type: TransferStore }], propDecorators: { options: [{
4978
+ type: Input
4979
+ }], selected: [{
4980
+ type: Input
4981
+ }], transferChanges: [{
4982
+ type: Output
4983
+ }] } });
4984
+
4985
+ const formComponents = [
4986
+ ItAutocompleteComponent,
4987
+ ItCheckboxComponent,
4988
+ ItInputComponent,
4989
+ ItPasswordInputComponent,
4990
+ ItRadioButtonComponent,
4991
+ ItRangeComponent,
4992
+ ItRatingComponent,
4993
+ ItSelectComponent,
4994
+ ItTextareaComponent,
4995
+ ItTransferComponent,
4996
+ ItUploadDragDropComponent,
4997
+ ItUploadFileListComponent,
4998
+ ];
4999
+ class ItFormModule {
5000
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
5001
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.6", ngImport: i0, type: ItFormModule, imports: [ItAutocompleteComponent,
5002
+ ItCheckboxComponent,
5003
+ ItInputComponent,
5004
+ ItPasswordInputComponent,
5005
+ ItRadioButtonComponent,
5006
+ ItRangeComponent,
5007
+ ItRatingComponent,
5008
+ ItSelectComponent,
5009
+ ItTextareaComponent,
5010
+ ItTransferComponent,
5011
+ ItUploadDragDropComponent,
5012
+ ItUploadFileListComponent], exports: [ItAutocompleteComponent,
5013
+ ItCheckboxComponent,
5014
+ ItInputComponent,
5015
+ ItPasswordInputComponent,
5016
+ ItRadioButtonComponent,
5017
+ ItRangeComponent,
5018
+ ItRatingComponent,
5019
+ ItSelectComponent,
5020
+ ItTextareaComponent,
5021
+ ItTransferComponent,
5022
+ ItUploadDragDropComponent,
5023
+ ItUploadFileListComponent] }); }
5024
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItFormModule, imports: [formComponents] }); }
5025
+ }
5026
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItFormModule, decorators: [{
5027
+ type: NgModule,
5028
+ args: [{
5029
+ imports: formComponents,
5030
+ exports: formComponents,
5031
+ }]
5032
+ }] });
5033
+
4543
5034
  class ItBackButtonComponent {
4544
5035
  constructor(_location) {
4545
5036
  this._location = _location;
@@ -4863,6 +5354,352 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
4863
5354
  args: [{ transform: inputToBoolean }]
4864
5355
  }] } });
4865
5356
 
5357
+ class ItMegamenuComponent {
5358
+ constructor() {
5359
+ /**
5360
+ * Megamenu mode
5361
+ */
5362
+ this.mode = 'normal';
5363
+ }
5364
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItMegamenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5365
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItMegamenuComponent, isStandalone: true, selector: "it-megamenu", inputs: { mode: "mode", header: ["header", "header", inputToBoolean], footer: ["footer", "footer", inputToBoolean] }, ngImport: i0, template: "<div class=\"megamenu pb-5 pt-3 py-lg-0\">\n <div class=\"row\">\n @if (mode === 'left-section') {\n <div class=\"col-xs-12 col-lg-4 px-0\">\n <div class=\"row\">\n <div class=\"col-12 it-vertical it-description pb-lg-3\">\n <div class=\"description-content ps-4 ps-sm-5 ms-3\">\n <ng-content select=\"[megamenuLeftZone]\"></ng-content>\n </div>\n </div>\n </div>\n </div>\n }\n <div class=\"col-12\" [class.col-lg-8]=\"mode !== 'normal'\">\n @if (header) {\n <div class=\"it-heading-link-wrapper\">\n <ng-content select=\"[megamenuHeadingLink]\"></ng-content>\n </div>\n }\n <div class=\"row\">\n <ng-content select=\"[megamenuLinkList]\"></ng-content>\n </div>\n </div>\n @if (footer || mode === 'right-section') {\n <div [class.col-xs-12]=\"mode === 'right-section'\" [class.col-lg-4]=\"mode === 'right-section'\" [class.px-0]=\"mode === 'right-section'\">\n <div [class.it-footer-link-wrapper]=\"footer\" [class.it-footer-link-wrapper-vertical]=\"mode === 'right-section'\">\n <div class=\"d-flex flex-column justify-content-around\" [class.flex-lg-row]=\"mode !== 'right-section'\">\n <ng-content select=\"[megamenuFooter]\"></ng-content>\n </div>\n </div>\n </div>\n }\n </div>\n</div>\n", styles: ["::ng-deep .theme-light-desk .nav-link:before{background-color:#06c}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5366
+ }
5367
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItMegamenuComponent, decorators: [{
5368
+ type: Component,
5369
+ args: [{ standalone: true, selector: 'it-megamenu', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], template: "<div class=\"megamenu pb-5 pt-3 py-lg-0\">\n <div class=\"row\">\n @if (mode === 'left-section') {\n <div class=\"col-xs-12 col-lg-4 px-0\">\n <div class=\"row\">\n <div class=\"col-12 it-vertical it-description pb-lg-3\">\n <div class=\"description-content ps-4 ps-sm-5 ms-3\">\n <ng-content select=\"[megamenuLeftZone]\"></ng-content>\n </div>\n </div>\n </div>\n </div>\n }\n <div class=\"col-12\" [class.col-lg-8]=\"mode !== 'normal'\">\n @if (header) {\n <div class=\"it-heading-link-wrapper\">\n <ng-content select=\"[megamenuHeadingLink]\"></ng-content>\n </div>\n }\n <div class=\"row\">\n <ng-content select=\"[megamenuLinkList]\"></ng-content>\n </div>\n </div>\n @if (footer || mode === 'right-section') {\n <div [class.col-xs-12]=\"mode === 'right-section'\" [class.col-lg-4]=\"mode === 'right-section'\" [class.px-0]=\"mode === 'right-section'\">\n <div [class.it-footer-link-wrapper]=\"footer\" [class.it-footer-link-wrapper-vertical]=\"mode === 'right-section'\">\n <div class=\"d-flex flex-column justify-content-around\" [class.flex-lg-row]=\"mode !== 'right-section'\">\n <ng-content select=\"[megamenuFooter]\"></ng-content>\n </div>\n </div>\n </div>\n }\n </div>\n</div>\n", styles: ["::ng-deep .theme-light-desk .nav-link:before{background-color:#06c}\n"] }]
5370
+ }], propDecorators: { mode: [{
5371
+ type: Input
5372
+ }], header: [{
5373
+ type: Input,
5374
+ args: [{ transform: inputToBoolean }]
5375
+ }], footer: [{
5376
+ type: Input,
5377
+ args: [{ transform: inputToBoolean }]
5378
+ }] } });
5379
+
5380
+ function searchFn(items, item) {
5381
+ //ricerca
5382
+ const nodes = Array.from(items);
5383
+ const parent = nodes.find(i => i.childs.includes(item));
5384
+ const ancestors = parent?.childs?.length ? searchFn(items, parent) : [];
5385
+ return [item, ...ancestors];
5386
+ }
5387
+ function flattenNavscrollItemsFn(items) {
5388
+ const result = [];
5389
+ function flatten(items) {
5390
+ for (const item of items) {
5391
+ result.push(item);
5392
+ if (item.childs && item.childs.length > 0) {
5393
+ flatten(item.childs);
5394
+ }
5395
+ }
5396
+ }
5397
+ flatten(items);
5398
+ return result;
5399
+ }
5400
+ const search = searchFn;
5401
+ const flattenNavscrollItems = flattenNavscrollItemsFn;
5402
+
5403
+ class NavscrollStore {
5404
+ constructor() {
5405
+ this.#state = new BehaviorSubject({
5406
+ items: new Set(),
5407
+ active: [],
5408
+ selected: undefined,
5409
+ progressBar: 0,
5410
+ isMobile: false,
5411
+ });
5412
+ this.#state$ = this.#state.asObservable();
5413
+ this.selected = this.#state$.pipe(map(({ selected }) => selected), distinctUntilChanged());
5414
+ this.progressBar = this.#state$.pipe(map(({ progressBar }) => progressBar), distinctUntilChanged());
5415
+ this.isMobile = this.#state$.pipe(map(({ isMobile }) => isMobile), distinctUntilChanged());
5416
+ this.#menuItemSelected = new Subject();
5417
+ this.menuItemSelected = this.#menuItemSelected.asObservable();
5418
+ }
5419
+ #state;
5420
+ #state$;
5421
+ #menuItemSelected;
5422
+ init(navscrollItems) {
5423
+ const flattenItems = flattenNavscrollItems(navscrollItems);
5424
+ //the first item is selected by default
5425
+ const selected = (flattenItems && flattenItems.length && flattenItems[0]) ?? undefined;
5426
+ const state = {
5427
+ items: new Set(flattenItems),
5428
+ active: selected ? [selected] : [],
5429
+ selected: selected,
5430
+ progressBar: 0,
5431
+ isMobile: false,
5432
+ };
5433
+ this.#state.next(state);
5434
+ }
5435
+ setActive(item) {
5436
+ const { items } = this.#state.value;
5437
+ const active = search(items, item);
5438
+ const state = this.#state.value;
5439
+ this.#state.next({ ...state, items, selected: item, active });
5440
+ }
5441
+ isActive$(item) {
5442
+ return this.#state.asObservable().pipe(map(state => state.active.includes(item)));
5443
+ }
5444
+ updateProgressBar(container) {
5445
+ if (!container) {
5446
+ return;
5447
+ }
5448
+ const offset = Math.abs(container.getBoundingClientRect().top);
5449
+ const height = container.getBoundingClientRect().height;
5450
+ const scrollAmount = (offset / height) * 100;
5451
+ const scrollValue = Math.min(100, Math.max(0, scrollAmount));
5452
+ const state = this.#state.value;
5453
+ this.#state.next({ ...state, progressBar: scrollValue });
5454
+ }
5455
+ selectMenuItem() {
5456
+ this.#menuItemSelected.next(undefined);
5457
+ }
5458
+ setMobile({ innerWidth }) {
5459
+ const isLessThan992px = innerWidth < 992;
5460
+ const isMobile = isLessThan992px;
5461
+ const state = this.#state.value;
5462
+ this.#state.next({ ...state, isMobile });
5463
+ }
5464
+ }
5465
+
5466
+ const ROUTER_LINK_ACTIVE_OPTIONS = {
5467
+ fragment: 'exact',
5468
+ paths: 'exact',
5469
+ queryParams: 'exact',
5470
+ matrixParams: 'exact',
5471
+ };
5472
+ class ItNavscrollListItemComponent {
5473
+ constructor() {
5474
+ this.checkActive = new EventEmitter();
5475
+ this.routerLinkActiveOptions = ROUTER_LINK_ACTIVE_OPTIONS;
5476
+ this.#initIsActive = new AsyncSubject();
5477
+ this.active = this.#initIsActive.asObservable().pipe(switchMap(item => this.#store.isActive$(item)));
5478
+ this.#router = inject(Router);
5479
+ this.#store = inject(NavscrollStore);
5480
+ this.#destroyRef = inject(DestroyRef);
5481
+ }
5482
+ #initIsActive;
5483
+ #router;
5484
+ #store;
5485
+ #destroyRef;
5486
+ ngOnInit() {
5487
+ this.#initIsActiveSub();
5488
+ this.#router.events
5489
+ .pipe(takeUntilDestroyed(this.#destroyRef), filter((event) => {
5490
+ const isNavigationEndEvent = event instanceof NavigationEnd;
5491
+ const isScrollEvent = event instanceof Scroll && event.routerEvent instanceof NavigationEnd;
5492
+ return isNavigationEndEvent || isScrollEvent;
5493
+ }), tap(() => {
5494
+ if (this.rtl?.isActive) {
5495
+ this.#store.setActive(this.item);
5496
+ }
5497
+ }))
5498
+ .subscribe();
5499
+ }
5500
+ clickHandler(event) {
5501
+ event.preventDefault();
5502
+ this.#store.selectMenuItem();
5503
+ this.#router.navigate([], { fragment: this.item.href });
5504
+ }
5505
+ #initIsActiveSub() {
5506
+ this.#initIsActive.next(this.item);
5507
+ this.#initIsActive.complete();
5508
+ }
5509
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItNavscrollListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5510
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.6", type: ItNavscrollListItemComponent, isStandalone: true, selector: "it-navscroll-list-item", inputs: { item: "item" }, outputs: { checkActive: "checkActive" }, viewQueries: [{ propertyName: "rtl", first: true, predicate: ["rtl"], descendants: true }], ngImport: i0, template: `
5511
+ <a
5512
+ class="nav-link"
5513
+ [class.active]="active | async"
5514
+ [routerLink]="[]"
5515
+ routerLinkActive
5516
+ [fragment]="item?.href"
5517
+ [routerLinkActiveOptions]="routerLinkActiveOptions"
5518
+ ariaCurrentWhenActive="page"
5519
+ #rtl="routerLinkActive"
5520
+ (click)="clickHandler($event)"
5521
+ ><span>{{ item?.title }}</span></a
5522
+ >
5523
+ `, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5524
+ }
5525
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItNavscrollListItemComponent, decorators: [{
5526
+ type: Component,
5527
+ args: [{
5528
+ selector: 'it-navscroll-list-item',
5529
+ standalone: true,
5530
+ imports: [RouterLink, RouterLinkActive, RouterLinkWithHref, ItNavscrollListItemsComponent, AsyncPipe],
5531
+ changeDetection: ChangeDetectionStrategy.OnPush,
5532
+ template: `
5533
+ <a
5534
+ class="nav-link"
5535
+ [class.active]="active | async"
5536
+ [routerLink]="[]"
5537
+ routerLinkActive
5538
+ [fragment]="item?.href"
5539
+ [routerLinkActiveOptions]="routerLinkActiveOptions"
5540
+ ariaCurrentWhenActive="page"
5541
+ #rtl="routerLinkActive"
5542
+ (click)="clickHandler($event)"
5543
+ ><span>{{ item?.title }}</span></a
5544
+ >
5545
+ `,
5546
+ }]
5547
+ }], propDecorators: { item: [{
5548
+ type: Input
5549
+ }], checkActive: [{
5550
+ type: Output
5551
+ }], rtl: [{
5552
+ type: ViewChild,
5553
+ args: ['rtl']
5554
+ }] } });
5555
+
5556
+ class ItNavscrollListItemsComponent {
5557
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItNavscrollListItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5558
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItNavscrollListItemsComponent, isStandalone: true, selector: "it-navscroll-list-items", inputs: { items: "items" }, ngImport: i0, template: `
5559
+ <ul class="link-list">
5560
+ @for (item of items; track item.href) {
5561
+ <li class="nav-item">
5562
+ <it-navscroll-list-item [item]="item"></it-navscroll-list-item>
5563
+ @if (item.childs?.length) {
5564
+ <it-navscroll-list-items [items]="item.childs"></it-navscroll-list-items>
5565
+ }
5566
+ </li>
5567
+ }
5568
+ </ul>
5569
+ `, isInline: true, dependencies: [{ kind: "component", type: ItNavscrollListItemsComponent, selector: "it-navscroll-list-items", inputs: ["items"] }, { kind: "component", type: ItNavscrollListItemComponent, selector: "it-navscroll-list-item", inputs: ["item"], outputs: ["checkActive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5570
+ }
5571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItNavscrollListItemsComponent, decorators: [{
5572
+ type: Component,
5573
+ args: [{
5574
+ selector: 'it-navscroll-list-items',
5575
+ standalone: true,
5576
+ imports: [NgTemplateOutlet, RouterLink, RouterLinkActive, RouterLinkWithHref, JsonPipe, ItNavscrollListItemComponent],
5577
+ changeDetection: ChangeDetectionStrategy.OnPush,
5578
+ template: `
5579
+ <ul class="link-list">
5580
+ @for (item of items; track item.href) {
5581
+ <li class="nav-item">
5582
+ <it-navscroll-list-item [item]="item"></it-navscroll-list-item>
5583
+ @if (item.childs?.length) {
5584
+ <it-navscroll-list-items [items]="item.childs"></it-navscroll-list-items>
5585
+ }
5586
+ </li>
5587
+ }
5588
+ </ul>
5589
+ `,
5590
+ }]
5591
+ }], propDecorators: { items: [{
5592
+ type: Input
5593
+ }] } });
5594
+
5595
+ /**
5596
+ * Navscroll
5597
+ * @description Show a list of links to anchor of the document.
5598
+ */
5599
+ class ItNavscrollComponent {
5600
+ onScroll() {
5601
+ const sectionContainer = this.#elementRef.nativeElement.querySelector('.it-page-sections-container');
5602
+ this.#store.updateProgressBar(sectionContainer);
5603
+ }
5604
+ onResize() {
5605
+ this.#setMobile();
5606
+ }
5607
+ #store;
5608
+ #scroller;
5609
+ #destroyRef;
5610
+ #elementRef;
5611
+ constructor() {
5612
+ /**
5613
+ * Header of the Navscroll
5614
+ */
5615
+ this.header = '';
5616
+ /**
5617
+ * Border position
5618
+ * @default left
5619
+ */
5620
+ this.borderPosition = 'left';
5621
+ /**
5622
+ * Alignment
5623
+ * @default top
5624
+ */
5625
+ this.alignment = 'top';
5626
+ /**
5627
+ * Theme
5628
+ * @default light
5629
+ */
5630
+ this.theme = 'light';
5631
+ this.#store = inject(NavscrollStore);
5632
+ this.#scroller = inject(ViewportScroller);
5633
+ this.#destroyRef = inject(DestroyRef);
5634
+ this.#elementRef = inject(ElementRef);
5635
+ this.selectedTitle = this.#store.selected.pipe(map(selected => selected?.title ?? ''));
5636
+ this.progressBarValue = this.#store.progressBar;
5637
+ this.isMobile = this.#store.isMobile;
5638
+ this.#store.menuItemSelected
5639
+ .pipe(takeUntilDestroyed(), withLatestFrom(this.isMobile), tap(v => {
5640
+ const isMobile = v[1];
5641
+ if (isMobile) {
5642
+ this.toggleButtonRef.nativeElement.click();
5643
+ }
5644
+ }))
5645
+ .subscribe();
5646
+ }
5647
+ ngOnInit() {
5648
+ this.#initViewScrollerSubscription();
5649
+ this.#store.init(this.items);
5650
+ this.#setMobile();
5651
+ }
5652
+ #initViewScrollerSubscription() {
5653
+ this.#store.selected
5654
+ .pipe(takeUntilDestroyed(this.#destroyRef), filter(selected => Boolean(selected)), map(v => v), delay(0), //WA
5655
+ tap({
5656
+ next: ({ href }) => {
5657
+ this.#scroller.scrollToAnchor(href);
5658
+ },
5659
+ }))
5660
+ .subscribe();
5661
+ }
5662
+ #setMobile() {
5663
+ this.#store.setMobile(window);
5664
+ }
5665
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItNavscrollComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5666
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItNavscrollComponent, isStandalone: true, selector: "it-navscroll", inputs: { header: "header", items: "items", borderPosition: "borderPosition", alignment: "alignment", theme: "theme", pageSectionsTemplate: "pageSectionsTemplate" }, host: { listeners: { "window:scroll": "onScroll($event)", "window:resize": "onResize($event)" } }, providers: [NavscrollStore], viewQueries: [{ propertyName: "toggleButtonRef", first: true, predicate: ["toggleButtonRef"], descendants: true }], ngImport: i0, template: "<div class=\"container py-lg-5\">\n <div class=\"row\">\n <div class=\"col-12 col-lg-4\">\n <div class=\"it-navscroll-sticky\" [ngClass]=\"{ 'it-navscroll-sticky-mobile': isMobile | async }\" data-bs-stackable=\"true\">\n <nav\n class=\"navbar it-navscroll-wrapper navbar-expand-lg\"\n [class.it-top-navscroll]=\"alignment === 'top'\"\n [class.it-bottom-navscroll]=\"alignment === 'bottom'\"\n [class.it-left-side]=\"borderPosition === 'left'\"\n [class.it-right-side]=\"borderPosition === 'right'\"\n [class.theme-dark-mobile]=\"theme === 'dark'\"\n [class.theme-dark-desktop]=\"theme === 'dark'\">\n <button\n class=\"custom-navbar-toggler\"\n type=\"button\"\n aria-controls=\"navbarNav\"\n aria-expanded=\"false\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"navbarcollapsible\"\n data-bs-target=\"#navbarNav\"\n #toggleButtonRef>\n <span class=\"it-list\"></span>{{ selectedTitle | async }}\n </button>\n <div class=\"progress custom-navbar-progressbar\">\n <div\n class=\"progress-bar it-navscroll-progressbar\"\n role=\"progressbar\"\n [style.width.%]=\"progressBarValue | async\"\n [attr.aria-valuenow]=\"progressBarValue | async\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"></div>\n </div>\n <div class=\"navbar-collapsable\" id=\"navbarNav\">\n <div class=\"overlay\"></div>\n <div class=\"close-div visually-hidden\">\n <button class=\"btn close-menu\" type=\"button\"><span class=\"it-close\"></span>Chiudi</button>\n </div>\n <button type=\"button\" class=\"it-back-button btn w-100 text-start\">\n <svg class=\"icon icon-sm icon-primary align-top\">\n <use\n href=\"/bootstrap-italia/dist/svg/sprites.svg#it-chevron-left\"\n xlink:href=\"/bootstrap-italia/dist/svg/sprites.svg#it-chevron-left\"></use>\n </svg>\n <span>Indietro</span>\n </button>\n <div class=\"menu-wrapper\">\n <div class=\"link-list-wrapper\">\n <h3>{{ header }}</h3>\n <div class=\"progress\">\n <div\n class=\"progress-bar it-navscroll-progressbar\"\n role=\"progressbar\"\n [style.width.%]=\"progressBarValue | async\"\n [attr.aria-valuenow]=\"progressBarValue | async\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"></div>\n </div>\n <it-navscroll-list-items [items]=\"items\"></it-navscroll-list-items>\n </div>\n </div>\n </div>\n </nav>\n </div>\n </div>\n <div class=\"col-12 col-lg-8 it-page-sections-container\">\n <ng-container\n *ngTemplateOutlet=\"pageSectionsTemplate ? pageSectionsTemplate : defaultPageSectionsTemplate; context: { items: items }\">\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #defaultPageSectionsTemplate let-items=\"items\">\n @for (item of items; track item.href) {\n <ng-container *ngTemplateOutlet=\"paragraphTemplate; context: { item: item, level: 1 }\"></ng-container>\n }\n</ng-template>\n\n<ng-template #paragraphTemplate let-item=\"item\" let-level=\"level\" let-nextLevel=\"level+1\">\n @switch (level) {\n @case (1) {\n <h2 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h2>\n }\n @case (2) {\n <h3 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h3>\n }\n @case (3) {\n <h4 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h4>\n }\n @case (4) {\n <h5 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h5>\n }\n @default {\n <h6 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h6>\n }\n }\n <p>{{ item.text }}</p>\n @for (item of item.childs; track item.href) {\n <ng-container *ngTemplateOutlet=\"paragraphTemplate; context: { item: item, level: nextLevel }\"></ng-container>\n }\n</ng-template>\n", styles: [".it-navscroll-sticky{position:sticky;top:0}.it-navscroll-sticky-mobile{z-index:1020}\n"], dependencies: [{ kind: "component", type: ItNavscrollListItemsComponent, selector: "it-navscroll-list-items", inputs: ["items"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5667
+ }
5668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItNavscrollComponent, decorators: [{
5669
+ type: Component,
5670
+ args: [{ selector: 'it-navscroll', standalone: true, imports: [
5671
+ ItNavscrollListItemsComponent,
5672
+ AsyncPipe,
5673
+ NgTemplateOutlet,
5674
+ RouterLink,
5675
+ RouterLinkActive,
5676
+ RouterLinkWithHref,
5677
+ AsyncPipe,
5678
+ NgClass,
5679
+ ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [NavscrollStore], template: "<div class=\"container py-lg-5\">\n <div class=\"row\">\n <div class=\"col-12 col-lg-4\">\n <div class=\"it-navscroll-sticky\" [ngClass]=\"{ 'it-navscroll-sticky-mobile': isMobile | async }\" data-bs-stackable=\"true\">\n <nav\n class=\"navbar it-navscroll-wrapper navbar-expand-lg\"\n [class.it-top-navscroll]=\"alignment === 'top'\"\n [class.it-bottom-navscroll]=\"alignment === 'bottom'\"\n [class.it-left-side]=\"borderPosition === 'left'\"\n [class.it-right-side]=\"borderPosition === 'right'\"\n [class.theme-dark-mobile]=\"theme === 'dark'\"\n [class.theme-dark-desktop]=\"theme === 'dark'\">\n <button\n class=\"custom-navbar-toggler\"\n type=\"button\"\n aria-controls=\"navbarNav\"\n aria-expanded=\"false\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"navbarcollapsible\"\n data-bs-target=\"#navbarNav\"\n #toggleButtonRef>\n <span class=\"it-list\"></span>{{ selectedTitle | async }}\n </button>\n <div class=\"progress custom-navbar-progressbar\">\n <div\n class=\"progress-bar it-navscroll-progressbar\"\n role=\"progressbar\"\n [style.width.%]=\"progressBarValue | async\"\n [attr.aria-valuenow]=\"progressBarValue | async\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"></div>\n </div>\n <div class=\"navbar-collapsable\" id=\"navbarNav\">\n <div class=\"overlay\"></div>\n <div class=\"close-div visually-hidden\">\n <button class=\"btn close-menu\" type=\"button\"><span class=\"it-close\"></span>Chiudi</button>\n </div>\n <button type=\"button\" class=\"it-back-button btn w-100 text-start\">\n <svg class=\"icon icon-sm icon-primary align-top\">\n <use\n href=\"/bootstrap-italia/dist/svg/sprites.svg#it-chevron-left\"\n xlink:href=\"/bootstrap-italia/dist/svg/sprites.svg#it-chevron-left\"></use>\n </svg>\n <span>Indietro</span>\n </button>\n <div class=\"menu-wrapper\">\n <div class=\"link-list-wrapper\">\n <h3>{{ header }}</h3>\n <div class=\"progress\">\n <div\n class=\"progress-bar it-navscroll-progressbar\"\n role=\"progressbar\"\n [style.width.%]=\"progressBarValue | async\"\n [attr.aria-valuenow]=\"progressBarValue | async\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"></div>\n </div>\n <it-navscroll-list-items [items]=\"items\"></it-navscroll-list-items>\n </div>\n </div>\n </div>\n </nav>\n </div>\n </div>\n <div class=\"col-12 col-lg-8 it-page-sections-container\">\n <ng-container\n *ngTemplateOutlet=\"pageSectionsTemplate ? pageSectionsTemplate : defaultPageSectionsTemplate; context: { items: items }\">\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #defaultPageSectionsTemplate let-items=\"items\">\n @for (item of items; track item.href) {\n <ng-container *ngTemplateOutlet=\"paragraphTemplate; context: { item: item, level: 1 }\"></ng-container>\n }\n</ng-template>\n\n<ng-template #paragraphTemplate let-item=\"item\" let-level=\"level\" let-nextLevel=\"level+1\">\n @switch (level) {\n @case (1) {\n <h2 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h2>\n }\n @case (2) {\n <h3 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h3>\n }\n @case (3) {\n <h4 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h4>\n }\n @case (4) {\n <h5 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h5>\n }\n @default {\n <h6 class=\"it-page-section\" id=\"{{ item.href }}\">{{ item.title }}</h6>\n }\n }\n <p>{{ item.text }}</p>\n @for (item of item.childs; track item.href) {\n <ng-container *ngTemplateOutlet=\"paragraphTemplate; context: { item: item, level: nextLevel }\"></ng-container>\n }\n</ng-template>\n", styles: [".it-navscroll-sticky{position:sticky;top:0}.it-navscroll-sticky-mobile{z-index:1020}\n"] }]
5680
+ }], ctorParameters: () => [], propDecorators: { header: [{
5681
+ type: Input
5682
+ }], items: [{
5683
+ type: Input
5684
+ }], borderPosition: [{
5685
+ type: Input
5686
+ }], alignment: [{
5687
+ type: Input
5688
+ }], theme: [{
5689
+ type: Input
5690
+ }], pageSectionsTemplate: [{
5691
+ type: Input
5692
+ }], onScroll: [{
5693
+ type: HostListener,
5694
+ args: ['window:scroll', ['$event']]
5695
+ }], onResize: [{
5696
+ type: HostListener,
5697
+ args: ['window:resize', ['$event']]
5698
+ }], toggleButtonRef: [{
5699
+ type: ViewChild,
5700
+ args: ['toggleButtonRef']
5701
+ }] } });
5702
+
4866
5703
  class ItSidebarComponent {
4867
5704
  constructor() {
4868
5705
  /**
@@ -5182,116 +6019,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
5182
6019
  }] });
5183
6020
 
5184
6021
  /**
5185
- * Timeline Item
5186
- * @description Represents a single event for Timeline component.
6022
+ * Configures DesignAngularKit library
6023
+ * @param config the DesignAngularKit config
5187
6024
  */
5188
- class ItTimelineItemComponent extends ItAbstractComponent {
5189
- constructor() {
5190
- super(...arguments);
5191
- /**
5192
- * Timeline element reference date format
5193
- * @default dd/MM/yyyy
5194
- */
5195
- this.dateFormat = 'dd/MM/yyyy';
5196
- /**
5197
- * Timeline element PIN type
5198
- * @default none
5199
- */
5200
- this.pinType = 'default';
5201
- /**
5202
- * Timeline element PIN icon
5203
- * @default code-circle
5204
- */
5205
- this.pinIcon = 'code-circle';
5206
- /**
5207
- * Timeline element show detail link
5208
- * @default false
5209
- */
5210
- this.showReadMore = false;
5211
- /** Timeline element detail link
5212
- * @default #
5213
- */
5214
- this.readMoreLink = '#';
6025
+ function provideDesignAngularKit(config) {
6026
+ let assetBasePath = './bootstrap-italia';
6027
+ if (config?.assetBasePath) {
6028
+ assetBasePath = config.assetBasePath.endsWith('/')
6029
+ ? config.assetBasePath.substring(0, config.assetBasePath.lastIndexOf('/'))
6030
+ : config.assetBasePath;
5215
6031
  }
5216
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5217
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItTimelineItemComponent, isStandalone: true, selector: "it-timeline-item", inputs: { title: "title", text: "text", signature: "signature", eventDate: "eventDate", dateFormat: "dateFormat", pinText: "pinText", pinType: "pinType", pinIcon: "pinIcon", categoryTitle: "categoryTitle", categoryLink: "categoryLink", showReadMore: ["showReadMore", "showReadMore", inputToBoolean], readMoreLink: "readMoreLink" }, usesInheritance: true, ngImport: i0, template: "<div class=\"timeline-element\">\n @if (pinType === 'now') {\n <span class=\"it-now-label d-none d-lg-flex\">{{ 'it.timeline.today' | translate }}</span>\n }\n <div class=\"it-pin-wrapper\" [ngClass]=\"{ 'it-evidence': pinType === 'evidence', 'it-now': pinType === 'now' }\">\n <div class=\"pin-icon\">\n @if (pinIcon) {\n <it-icon [name]=\"pinIcon\"></it-icon>\n } @else {\n <it-icon name=\"code-circle\"></it-icon>\n }\n </div>\n <div class=\"pin-text\">\n <span>{{ pinText }}</span>\n </div>\n </div>\n <div class=\"card-wrapper\">\n <div class=\"card\">\n <div class=\"card-body\">\n @if ((categoryTitle && categoryLink) || eventDate) {\n <div class=\"category-top\">\n @if (categoryTitle) {\n <a class=\"category\" [href]=\"categoryLink\">{{ categoryTitle }}</a>\n }\n @if (eventDate) {\n <span class=\"data\">{{ eventDate | date: dateFormat }}</span>\n }\n </div>\n }\n <h5 class=\"card-title\">{{ title }}</h5>\n <p class=\"card-text\">{{ text }}</p>\n @if (signature) {\n <span class=\"card-signature\">{{ signature }}</span>\n }\n @if (showReadMore) {\n <a class=\"read-more\" [href]=\"readMoreLink\">\n <span class=\"text\">{{ 'it.timeline.read-more' | translate }}</span>\n <span class=\"visually-hidden\">{{ 'it.timeline.read-more-on' | translate: { title: title } }}</span>\n <it-icon name=\"arrow-right\"></it-icon>\n </a>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ItIconComponent, selector: "it-icon", inputs: ["name", "size", "color", "padded", "svgClass", "labelWaria"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5218
- }
5219
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineItemComponent, decorators: [{
5220
- type: Component,
5221
- args: [{ standalone: true, selector: 'it-timeline-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ItIconComponent, DatePipe, TranslateModule, NgClass], template: "<div class=\"timeline-element\">\n @if (pinType === 'now') {\n <span class=\"it-now-label d-none d-lg-flex\">{{ 'it.timeline.today' | translate }}</span>\n }\n <div class=\"it-pin-wrapper\" [ngClass]=\"{ 'it-evidence': pinType === 'evidence', 'it-now': pinType === 'now' }\">\n <div class=\"pin-icon\">\n @if (pinIcon) {\n <it-icon [name]=\"pinIcon\"></it-icon>\n } @else {\n <it-icon name=\"code-circle\"></it-icon>\n }\n </div>\n <div class=\"pin-text\">\n <span>{{ pinText }}</span>\n </div>\n </div>\n <div class=\"card-wrapper\">\n <div class=\"card\">\n <div class=\"card-body\">\n @if ((categoryTitle && categoryLink) || eventDate) {\n <div class=\"category-top\">\n @if (categoryTitle) {\n <a class=\"category\" [href]=\"categoryLink\">{{ categoryTitle }}</a>\n }\n @if (eventDate) {\n <span class=\"data\">{{ eventDate | date: dateFormat }}</span>\n }\n </div>\n }\n <h5 class=\"card-title\">{{ title }}</h5>\n <p class=\"card-text\">{{ text }}</p>\n @if (signature) {\n <span class=\"card-signature\">{{ signature }}</span>\n }\n @if (showReadMore) {\n <a class=\"read-more\" [href]=\"readMoreLink\">\n <span class=\"text\">{{ 'it.timeline.read-more' | translate }}</span>\n <span class=\"visually-hidden\">{{ 'it.timeline.read-more-on' | translate: { title: title } }}</span>\n <it-icon name=\"arrow-right\"></it-icon>\n </a>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
5222
- }], propDecorators: { title: [{
5223
- type: Input,
5224
- args: [{ required: true }]
5225
- }], text: [{
5226
- type: Input,
5227
- args: [{ required: true }]
5228
- }], signature: [{
5229
- type: Input
5230
- }], eventDate: [{
5231
- type: Input
5232
- }], dateFormat: [{
5233
- type: Input
5234
- }], pinText: [{
5235
- type: Input,
5236
- args: [{ required: true }]
5237
- }], pinType: [{
5238
- type: Input
5239
- }], pinIcon: [{
5240
- type: Input
5241
- }], categoryTitle: [{
5242
- type: Input
5243
- }], categoryLink: [{
5244
- type: Input
5245
- }], showReadMore: [{
5246
- type: Input,
5247
- args: [{ transform: inputToBoolean }]
5248
- }], readMoreLink: [{
5249
- type: Input
5250
- }] } });
5251
-
5252
- /**
5253
- * Timeline
5254
- * @description Build timeline for chronological representation of events.
5255
- */
5256
- class ItTimelineComponent extends ItAbstractComponent {
5257
- constructor() {
5258
- super(...arguments);
5259
- /**
5260
- * Timeline elements array
5261
- * @default []
5262
- */
5263
- this.timelineElements = [];
5264
- /**
5265
- * Default date format for timeline element reference date
5266
- * @default dd/MM/yyyy
5267
- */
5268
- this.dateFormat = 'dd/MM/yyyy';
6032
+ const providers = [
6033
+ {
6034
+ provide: IT_ASSET_BASE_PATH,
6035
+ useValue: assetBasePath,
6036
+ },
6037
+ provideAnimationsAsync(),
6038
+ provideHttpClient(),
6039
+ ];
6040
+ if (config?.loadFont !== false) {
6041
+ // Add provider to initialize the bootstrap-italia font
6042
+ providers.push({
6043
+ provide: APP_INITIALIZER,
6044
+ useFactory: () => {
6045
+ return () => {
6046
+ loadFonts(`${assetBasePath}/dist/fonts`);
6047
+ };
6048
+ },
6049
+ multi: true,
6050
+ });
5269
6051
  }
5270
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5271
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: ItTimelineComponent, isStandalone: true, selector: "it-timeline", inputs: { timelineElements: "timelineElements", dateFormat: "dateFormat" }, usesInheritance: true, ngImport: i0, template: "<div class=\"it-timeline-wrapper\">\n <div class=\"row\">\n @for (element of timelineElements; track $index) {\n <div class=\"col-12\">\n <it-timeline-item\n [title]=\"element.title\"\n [text]=\"element.text\"\n [signature]=\"element.signature\"\n [pinType]=\"element.pin?.type\"\n [pinIcon]=\"element.pin?.icon\"\n [pinText]=\"element.pin?.text\"\n [eventDate]=\"element.eventDate\"\n [dateFormat]=\"dateFormat\"\n [categoryTitle]=\"element.category?.title\"\n [categoryLink]=\"element.category?.link\"\n [showReadMore]=\"!!element.link?.length\"\n [readMoreLink]=\"element.link\" />\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ItTimelineItemComponent, selector: "it-timeline-item", inputs: ["title", "text", "signature", "eventDate", "dateFormat", "pinText", "pinType", "pinIcon", "categoryTitle", "categoryLink", "showReadMore", "readMoreLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5272
- }
5273
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineComponent, decorators: [{
5274
- type: Component,
5275
- args: [{ standalone: true, selector: 'it-timeline', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ItIconComponent, TranslateModule, ItTimelineItemComponent], template: "<div class=\"it-timeline-wrapper\">\n <div class=\"row\">\n @for (element of timelineElements; track $index) {\n <div class=\"col-12\">\n <it-timeline-item\n [title]=\"element.title\"\n [text]=\"element.text\"\n [signature]=\"element.signature\"\n [pinType]=\"element.pin?.type\"\n [pinIcon]=\"element.pin?.icon\"\n [pinText]=\"element.pin?.text\"\n [eventDate]=\"element.eventDate\"\n [dateFormat]=\"dateFormat\"\n [categoryTitle]=\"element.category?.title\"\n [categoryLink]=\"element.category?.link\"\n [showReadMore]=\"!!element.link?.length\"\n [readMoreLink]=\"element.link\" />\n </div>\n }\n </div>\n</div>\n" }]
5276
- }], propDecorators: { timelineElements: [{
5277
- type: Input
5278
- }], dateFormat: [{
5279
- type: Input
5280
- }] } });
5281
-
5282
- const timelineComponents = [ItTimelineComponent, ItTimelineItemComponent];
5283
- class ItTimelineModule {
5284
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
5285
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineModule, imports: [ItTimelineComponent, ItTimelineItemComponent], exports: [ItTimelineComponent, ItTimelineItemComponent] }); }
5286
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineModule, imports: [timelineComponents] }); }
6052
+ // Add provider to initialize the TranslateModule
6053
+ const langPrefix = `${assetBasePath}/i18n/`;
6054
+ const langSuffix = `.json`; // TODO: add ?v${version} to prevent cache loading on version change
6055
+ providers.push(importProvidersFrom(TranslateModule.forRoot({
6056
+ loader: config?.translateLoader?.(langPrefix, langSuffix) ?? {
6057
+ provide: TranslateLoader,
6058
+ useFactory: (http) => new TranslateHttpLoader(http, langPrefix, langSuffix),
6059
+ deps: [HttpClient],
6060
+ },
6061
+ defaultLanguage: 'it',
6062
+ useDefaultLang: true,
6063
+ })));
6064
+ // Add provider to initialize library default languages
6065
+ providers.push({
6066
+ provide: APP_INITIALIZER,
6067
+ useFactory: (translateService) => {
6068
+ return () => {
6069
+ translateService.addLangs(['it', 'en']); // Adds 'it' and 'en' as available languages.
6070
+ };
6071
+ },
6072
+ multi: true,
6073
+ deps: [TranslateService],
6074
+ });
6075
+ return makeEnvironmentProviders(providers);
5287
6076
  }
5288
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ItTimelineModule, decorators: [{
5289
- type: NgModule,
5290
- args: [{
5291
- imports: timelineComponents,
5292
- exports: timelineComponents,
5293
- }]
5294
- }] });
5295
6077
 
5296
6078
  /**
5297
6079
  * Core components
@@ -5336,6 +6118,7 @@ const navigation = [
5336
6118
  ItNavBarModule,
5337
6119
  ItSidebarComponent,
5338
6120
  ItMegamenuComponent,
6121
+ ItNavscrollComponent,
5339
6122
  ];
5340
6123
  /**
5341
6124
  * Utils components
@@ -5398,7 +6181,8 @@ class DesignAngularKitModule {
5398
6181
  ItHeaderComponent,
5399
6182
  ItNavBarModule,
5400
6183
  ItSidebarComponent,
5401
- ItMegamenuComponent, ItErrorPageComponent, ItIconComponent, ItLanguageSwitcherComponent, ItDateAgoPipe, ItDurationPipe, ItMarkMatchingTextPipe], exports: [ItAccordionComponent,
6184
+ ItMegamenuComponent,
6185
+ ItNavscrollComponent, ItErrorPageComponent, ItIconComponent, ItLanguageSwitcherComponent, ItDateAgoPipe, ItDurationPipe, ItMarkMatchingTextPipe], exports: [ItAccordionComponent,
5402
6186
  ItAlertComponent,
5403
6187
  ItAvatarModule,
5404
6188
  ItBadgeDirective,
@@ -5431,7 +6215,8 @@ class DesignAngularKitModule {
5431
6215
  ItHeaderComponent,
5432
6216
  ItNavBarModule,
5433
6217
  ItSidebarComponent,
5434
- ItMegamenuComponent, ItErrorPageComponent, ItIconComponent, ItLanguageSwitcherComponent, ItDateAgoPipe, ItDurationPipe, ItMarkMatchingTextPipe] }); }
6218
+ ItMegamenuComponent,
6219
+ ItNavscrollComponent, ItErrorPageComponent, ItIconComponent, ItLanguageSwitcherComponent, ItDateAgoPipe, ItDurationPipe, ItMarkMatchingTextPipe] }); }
5435
6220
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: DesignAngularKitModule, imports: [ItAlertComponent,
5436
6221
  ItAvatarModule,
5437
6222
  ItCarouselModule,
@@ -5472,6 +6257,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
5472
6257
  }]
5473
6258
  }] });
5474
6259
 
6260
+ //Qs
6261
+ //Aria hidden?
6262
+ //state management with service?
6263
+ //interface?
6264
+
5475
6265
  const IconNameArray = [
5476
6266
  'arrow-down',
5477
6267
  'arrow-down-circle',
@@ -5808,5 +6598,5 @@ class ItDateUtils {
5808
6598
  * Generated bundle index. Do not edit.
5809
6599
  */
5810
6600
 
5811
- export { CAP_REGEX, DesignAngularKitModule, EMAIL_REGEX, IBAN_REGEX, ITALIAN_TAX_CODE_REGEX, IT_ASSET_BASE_PATH, IT_SORT_DEFAULT_OPTIONS, IconNameArray, ItAccordionComponent, ItAlertComponent, ItAutocompleteComponent, ItAvatarDirective, ItAvatarDropdownComponent, ItAvatarDropdownItemComponent, ItAvatarGroupComponent, ItAvatarGroupItemComponent, ItAvatarModule, ItBackButtonComponent, ItBackToTopComponent, ItBadgeDirective, ItBreadcrumbComponent, ItBreadcrumbItemComponent, ItBreadcrumbsModule, ItButtonDirective, ItCalloutComponent, ItCardComponent, ItCarouselComponent, ItCarouselItemComponent, ItCarouselModule, ItCheckboxComponent, ItChipComponent, ItCollapseComponent, ItDateAgoPipe, ItDateUtils, ItDimmerButtonsComponent, ItDimmerComponent, ItDimmerIconComponent, ItDimmerModule, ItDropdownComponent, ItDropdownItemComponent, ItDropdownModule, ItDurationPipe, ItErrorPageComponent, ItFileUtils, ItFormModule, ItForwardDirective, ItHeaderComponent, ItIconComponent, ItInputComponent, ItLanguageSwitcherComponent, ItLinkComponent, ItListComponent, ItListItemComponent, ItListModule, ItMarkMatchingTextPipe, ItMegamenuComponent, ItModalComponent, ItNavBarComponent, ItNavBarItemComponent, ItNavBarModule, ItNotificationService, ItNotificationsComponent, ItPaginationComponent, ItPasswordInputComponent, ItPopoverDirective, ItProgressBarComponent, ItProgressButtonComponent, ItRadioButtonComponent, ItRangeComponent, ItRatingComponent, ItSelectComponent, ItSidebarComponent, ItSortDirective, ItSortHeaderComponent, ItSpinnerComponent, ItSteppersContainerComponent, ItSteppersItemComponent, ItSteppersModule, ItTabContainerComponent, ItTabItemComponent, ItTabModule, ItTableComponent, ItTableModule, ItTextareaComponent, ItTimelineComponent, ItTimelineItemComponent, ItTimelineModule, ItTooltipDirective, ItUploadDragDropComponent, ItUploadFileListComponent, ItValidators, NotificationPosition, NotificationType, PHONE_NUMBER_REGEX, PLATE_REGEX, URL_REGEX, VAT_NUMBER_REGEX, provideDesignAngularKit };
6601
+ export { CAP_REGEX, DesignAngularKitModule, EMAIL_REGEX, IBAN_REGEX, ITALIAN_TAX_CODE_REGEX, IT_ASSET_BASE_PATH, IT_SORT_DEFAULT_OPTIONS, IconNameArray, ItAccordionComponent, ItAlertComponent, ItAutocompleteComponent, ItAvatarDirective, ItAvatarDropdownComponent, ItAvatarDropdownItemComponent, ItAvatarGroupComponent, ItAvatarGroupItemComponent, ItAvatarModule, ItBackButtonComponent, ItBackToTopComponent, ItBadgeDirective, ItBreadcrumbComponent, ItBreadcrumbItemComponent, ItBreadcrumbsModule, ItButtonDirective, ItCalloutComponent, ItCardComponent, ItCarouselComponent, ItCarouselItemComponent, ItCarouselModule, ItCheckboxComponent, ItChipComponent, ItCollapseComponent, ItDateAgoPipe, ItDateUtils, ItDimmerButtonsComponent, ItDimmerComponent, ItDimmerIconComponent, ItDimmerModule, ItDropdownComponent, ItDropdownItemComponent, ItDropdownModule, ItDurationPipe, ItErrorPageComponent, ItFileUtils, ItFormModule, ItForwardDirective, ItHeaderComponent, ItIconComponent, ItInputComponent, ItLanguageSwitcherComponent, ItLinkComponent, ItListComponent, ItListItemComponent, ItListModule, ItMarkMatchingTextPipe, ItMegamenuComponent, ItModalComponent, ItNavBarComponent, ItNavBarItemComponent, ItNavBarModule, ItNavscrollComponent, ItNotificationService, ItNotificationsComponent, ItPaginationComponent, ItPasswordInputComponent, ItPopoverDirective, ItProgressBarComponent, ItProgressButtonComponent, ItRadioButtonComponent, ItRangeComponent, ItRatingComponent, ItSelectComponent, ItSidebarComponent, ItSortDirective, ItSortHeaderComponent, ItSpinnerComponent, ItSteppersContainerComponent, ItSteppersItemComponent, ItSteppersModule, ItTabContainerComponent, ItTabItemComponent, ItTabModule, ItTableComponent, ItTableModule, ItTextareaComponent, ItTimelineComponent, ItTimelineItemComponent, ItTimelineModule, ItTooltipDirective, ItTransferComponent, ItUploadDragDropComponent, ItUploadFileListComponent, ItValidators, NotificationPosition, NotificationType, PHONE_NUMBER_REGEX, PLATE_REGEX, URL_REGEX, VAT_NUMBER_REGEX, provideDesignAngularKit };
5812
6602
  //# sourceMappingURL=design-angular-kit.mjs.map