@volo/ngx-lepton-x.core 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,21 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Inject, NgModule, Component, ViewEncapsulation, Input, Directive, Optional, Pipe, EventEmitter, Output, TemplateRef, ContentChild, inject, SecurityContext, HostListener, APP_INITIALIZER, Injector, SkipSelf } from '@angular/core';
2
+ import { inject, InjectionToken, Injectable, Inject, NgModule, Component, ViewEncapsulation, Input, Directive, Optional, Pipe, EventEmitter, Output, TemplateRef, ContentChild, SecurityContext, HostListener, APP_INITIALIZER, Injector, SkipSelf, ElementRef } from '@angular/core';
3
+ import * as i1$1 from '@angular/router';
4
+ import { Router, NavigationEnd, NavigationError, NavigationCancel, RouterModule } from '@angular/router';
3
5
  import * as i1 from '@angular/common';
4
6
  import { CommonModule, DOCUMENT } from '@angular/common';
5
7
  import { map, distinctUntilChanged, filter, take, tap, switchMap, startWith, distinctUntilKeyChanged } from 'rxjs/operators';
6
- import { BehaviorSubject, Subject, of, from, Observable, EMPTY, combineLatest, fromEvent, Subscription } from 'rxjs';
8
+ import { BehaviorSubject, Subject, of, from, Observable, EMPTY, filter as filter$1, combineLatest, fromEvent, Subscription } from 'rxjs';
7
9
  import { FormsModule } from '@angular/forms';
8
- import * as i1$1 from '@angular/router';
9
- import { NavigationEnd, RouterModule } from '@angular/router';
10
+ import PerfectScrollbar from 'perfect-scrollbar';
10
11
  import { DomSanitizer } from '@angular/platform-browser';
11
12
 
13
+ class LpxPerfectScrollbar {
14
+ constructor() {
15
+ this.router = inject(Router);
16
+ }
17
+ }
18
+
12
19
  const LPX_LANGUAGE = new InjectionToken('LPX_LANGUAGE');
13
20
 
14
21
  class DataStore {
@@ -680,6 +687,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
680
687
  }]
681
688
  }], ctorParameters: function () { return []; } });
682
689
 
690
+ class LpxPerfectScrollbarService extends LpxPerfectScrollbar {
691
+ setElement(value) {
692
+ if (value) {
693
+ this.elementRef = value;
694
+ }
695
+ }
696
+ setOptions(value) {
697
+ if (value) {
698
+ this.options = value;
699
+ }
700
+ }
701
+ createScrollbar() {
702
+ this.perfectScrollbar = new PerfectScrollbar(this.elementRef.nativeElement, this.options);
703
+ }
704
+ onResize() {
705
+ this.perfectScrollbar.update();
706
+ }
707
+ afterViewInit() {
708
+ this.createScrollbar();
709
+ this.subscription?.unsubscribe();
710
+ this.subscription = this.router.events
711
+ .pipe(filter$1((event) => event instanceof NavigationEnd ||
712
+ event instanceof NavigationError ||
713
+ event instanceof NavigationCancel))
714
+ .subscribe(() => {
715
+ const { element } = this.perfectScrollbar;
716
+ const { topAfterNavigate, leftAfterNavigate } = this.options || {};
717
+ element.scrollTop = topAfterNavigate || 0;
718
+ element.scrollLeft = leftAfterNavigate || 0;
719
+ });
720
+ }
721
+ ngOnDestroy() {
722
+ this.subscription?.unsubscribe();
723
+ }
724
+ }
725
+ LpxPerfectScrollbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: LpxPerfectScrollbarService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
726
+ LpxPerfectScrollbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: LpxPerfectScrollbarService });
727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: LpxPerfectScrollbarService, decorators: [{
728
+ type: Injectable
729
+ }] });
730
+
683
731
  class TranslatePipe {
684
732
  constructor(lpxThemeTranslateService) {
685
733
  this.lpxThemeTranslateService = lpxThemeTranslateService;
@@ -1456,15 +1504,22 @@ function listenDirectionChange(languageService, styleService) {
1456
1504
  };
1457
1505
  }
1458
1506
 
1507
+ const LPX_PERFECT_SCROLLBAR = new InjectionToken('LPX_PERFECT_SCROLLBAR');
1508
+
1459
1509
  class LpxCoreModule {
1460
1510
  static forRoot(options) {
1461
1511
  return {
1462
1512
  ngModule: LpxCoreModule,
1463
1513
  providers: [
1514
+ {
1515
+ provide: LPX_PERFECT_SCROLLBAR,
1516
+ useClass: LpxPerfectScrollbarService,
1517
+ },
1464
1518
  createResponsiveProvider(options?.responsiveSettings),
1465
1519
  createWindowProvider(options?.window),
1466
1520
  LpxIconModule.forRoot(options?.iconSettings).providers,
1467
- LpxLanguageModule.forRoot(options?.languageSettings).providers,
1521
+ LpxLanguageModule.forRoot(options?.languageSettings)
1522
+ .providers,
1468
1523
  LpxNavbarModule.forRoot(options?.navbarSettings).providers,
1469
1524
  LpxBreadcrumbModule.forRoot().providers,
1470
1525
  LPX_TRANSLATE_PROVIDERS,
@@ -1561,6 +1616,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1561
1616
  }]
1562
1617
  }] });
1563
1618
 
1619
+ class PerfectScrollbarDirective {
1620
+ constructor() {
1621
+ this.elementRef = inject(ElementRef);
1622
+ this.lpxPerfectService = inject(LPX_PERFECT_SCROLLBAR);
1623
+ }
1624
+ set lpxPerfectScrollbarOptions(value) {
1625
+ this.lpxPerfectService.setOptions(value);
1626
+ }
1627
+ onResize() {
1628
+ this.lpxPerfectService.onResize();
1629
+ }
1630
+ ngAfterViewInit() {
1631
+ this.lpxPerfectService.setElement(this.elementRef);
1632
+ this.lpxPerfectService.afterViewInit();
1633
+ }
1634
+ }
1635
+ PerfectScrollbarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PerfectScrollbarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1636
+ PerfectScrollbarDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: PerfectScrollbarDirective, isStandalone: true, selector: "[lpxPerfectScrollbar]", inputs: { lpxPerfectScrollbarOptions: "lpxPerfectScrollbarOptions" }, host: { listeners: { "window:resize": "onResize()" } }, ngImport: i0 });
1637
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PerfectScrollbarDirective, decorators: [{
1638
+ type: Directive,
1639
+ args: [{
1640
+ selector: '[lpxPerfectScrollbar]',
1641
+ standalone: true,
1642
+ }]
1643
+ }], propDecorators: { lpxPerfectScrollbarOptions: [{
1644
+ type: Input
1645
+ }], onResize: [{
1646
+ type: HostListener,
1647
+ args: ['window:resize']
1648
+ }] } });
1649
+
1564
1650
  class BreadcrumbPanelDirective {
1565
1651
  constructor(template) {
1566
1652
  this.template = template;
@@ -1786,5 +1872,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1786
1872
  * Generated bundle index. Do not edit.
1787
1873
  */
1788
1874
 
1789
- export { AvatarComponent, BodyService, BrandLogoComponent, BreadcrumbComponent, BreadcrumbPanelDirective, BreadcrumbRouteListenerService, BreadcrumbService, CONTENT_AFTER_ROUTES, CONTENT_BEFORE_ROUTES, ClickOutsideDirective, ContentPanelDirective, CurrentUserImagePanelDirective, CurrentUserPanelDirective, DataStore, DefaultAuthService, DefaultTranslateService, FooterComponent, FooterLinksService, FooterPanelDirective, ICON_MAP, IconComponent, LEPTON_X_ICON_SET, LPX_AUTH_SERVICE_PROVIDER, LPX_AUTH_SERVICE_TOKEN, LPX_INITIAL_STYLES, LPX_LANGUAGE, LPX_LAYOUT_STYLE_FINAL, LPX_MENU_ITEMS, LPX_RESPONSIVE_BREAKPOINTS_DEFAULTS, LPX_STYLE_FINAL, LPX_STYLE_PROVIDERS, LPX_TRANSLATE_SERVICE_TOKEN, LPX_TRANSLATE_TOKEN, LanguagePanelDirective, LanguageService, LanguageTranslateDefaults, LanguageTranslateKeys, LayoutService, LogoPanelDirective, LpxAvatarModule, LpxBrandLogoModule, LpxBreadcrumbModule, LpxClickOutsideModule, LpxCoreModule, LpxFooterModule, LpxIconModule, LpxLanguageModule, LpxLocalStorageService, LpxNavbarModule, LpxResponsiveModule, LpxThemeTranslateService, LpxTranslateModule, LpxVisibleDirective, MobileNavbarPanelDirective, NavbarComponent, NavbarPanelDirective, NavbarRoutesComponent, NavbarRoutesDirective, NavbarService, NavitemPanelDirective, PanelsModule, RESPONSIVE_BREAKPOINTS, ResponsiveDirective, ResponsiveService, SafeHtmlPipe, SettingsPanelDirective, StyleService, SubNavbarComponent, ToObservableModule, ToObservablePipe, ToolbarPanelDirective, TopNavbarPanelDirective, TranslatePipe, UserProfileService, WINDOW, breadCrumbInit, createDirectionProvider, createResponsiveProvider, createStyleFactory, createWindowProvider, exportedDeclarations, flatArrayDeepToObject, getStream$, listenDirectionChange, loadInitialStyles, sortItems, styleLoadFactory };
1875
+ export { AvatarComponent, BodyService, BrandLogoComponent, BreadcrumbComponent, BreadcrumbPanelDirective, BreadcrumbRouteListenerService, BreadcrumbService, CONTENT_AFTER_ROUTES, CONTENT_BEFORE_ROUTES, ClickOutsideDirective, ContentPanelDirective, CurrentUserImagePanelDirective, CurrentUserPanelDirective, DataStore, DefaultAuthService, DefaultTranslateService, FooterComponent, FooterLinksService, FooterPanelDirective, ICON_MAP, IconComponent, LEPTON_X_ICON_SET, LPX_AUTH_SERVICE_PROVIDER, LPX_AUTH_SERVICE_TOKEN, LPX_INITIAL_STYLES, LPX_LANGUAGE, LPX_LAYOUT_STYLE_FINAL, LPX_MENU_ITEMS, LPX_PERFECT_SCROLLBAR, LPX_RESPONSIVE_BREAKPOINTS_DEFAULTS, LPX_STYLE_FINAL, LPX_STYLE_PROVIDERS, LPX_TRANSLATE_SERVICE_TOKEN, LPX_TRANSLATE_TOKEN, LanguagePanelDirective, LanguageService, LanguageTranslateDefaults, LanguageTranslateKeys, LayoutService, LogoPanelDirective, LpxAvatarModule, LpxBrandLogoModule, LpxBreadcrumbModule, LpxClickOutsideModule, LpxCoreModule, LpxFooterModule, LpxIconModule, LpxLanguageModule, LpxLocalStorageService, LpxNavbarModule, LpxPerfectScrollbar, LpxPerfectScrollbarService, LpxResponsiveModule, LpxThemeTranslateService, LpxTranslateModule, LpxVisibleDirective, MobileNavbarPanelDirective, NavbarComponent, NavbarPanelDirective, NavbarRoutesComponent, NavbarRoutesDirective, NavbarService, NavitemPanelDirective, PanelsModule, PerfectScrollbarDirective, RESPONSIVE_BREAKPOINTS, ResponsiveDirective, ResponsiveService, SafeHtmlPipe, SettingsPanelDirective, StyleService, SubNavbarComponent, ToObservableModule, ToObservablePipe, ToolbarPanelDirective, TopNavbarPanelDirective, TranslatePipe, UserProfileService, WINDOW, breadCrumbInit, createDirectionProvider, createResponsiveProvider, createStyleFactory, createWindowProvider, exportedDeclarations, flatArrayDeepToObject, getStream$, listenDirectionChange, loadInitialStyles, sortItems, styleLoadFactory };
1790
1876
  //# sourceMappingURL=volo-ngx-lepton-x.core.mjs.map