@volo/ngx-lepton-x.core 2.2.0-rc.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/index.mjs +2 -1
- package/esm2020/lib/abstracts/index.mjs +2 -0
- package/esm2020/lib/abstracts/perfect-scrollbar.mjs +8 -0
- package/esm2020/lib/directives/index.mjs +2 -1
- package/esm2020/lib/directives/perfect-scrollbar.directive.mjs +34 -0
- package/esm2020/lib/lepton-x-core.module.mjs +10 -3
- package/esm2020/lib/models/common.mjs +1 -1
- package/esm2020/lib/services/index.mjs +2 -1
- package/esm2020/lib/services/perfect-scrollbar.service.mjs +47 -0
- package/esm2020/lib/tokens/index.mjs +2 -1
- package/esm2020/lib/tokens/perfect-scrollbar.token.mjs +3 -0
- package/fesm2015/volo-ngx-lepton-x.core.mjs +94 -6
- package/fesm2015/volo-ngx-lepton-x.core.mjs.map +1 -1
- package/fesm2020/volo-ngx-lepton-x.core.mjs +92 -6
- package/fesm2020/volo-ngx-lepton-x.core.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/abstracts/index.d.ts +1 -0
- package/lib/abstracts/perfect-scrollbar.d.ts +15 -0
- package/lib/directives/index.d.ts +1 -0
- package/lib/directives/perfect-scrollbar.directive.d.ts +12 -0
- package/lib/models/common.d.ts +5 -0
- package/lib/services/index.d.ts +1 -0
- package/lib/services/perfect-scrollbar.service.d.ts +15 -0
- package/lib/tokens/index.d.ts +1 -0
- package/lib/tokens/perfect-scrollbar.token.d.ts +3 -0
- package/package.json +3 -2
|
@@ -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,
|
|
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, Observable, from, of, EMPTY, combineLatest, fromEvent, Subscription } from 'rxjs';
|
|
8
|
+
import { BehaviorSubject, Subject, Observable, from, of, EMPTY, filter as filter$1, combineLatest, fromEvent, Subscription } from 'rxjs';
|
|
7
9
|
import { FormsModule } from '@angular/forms';
|
|
8
|
-
import
|
|
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 {
|
|
@@ -717,6 +724,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
717
724
|
}]
|
|
718
725
|
}], ctorParameters: function () { return []; } });
|
|
719
726
|
|
|
727
|
+
class LpxPerfectScrollbarService extends LpxPerfectScrollbar {
|
|
728
|
+
setElement(value) {
|
|
729
|
+
if (value) {
|
|
730
|
+
this.elementRef = value;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
setOptions(value) {
|
|
734
|
+
if (value) {
|
|
735
|
+
this.options = value;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
createScrollbar() {
|
|
739
|
+
this.perfectScrollbar = new PerfectScrollbar(this.elementRef.nativeElement, this.options);
|
|
740
|
+
}
|
|
741
|
+
onResize() {
|
|
742
|
+
this.perfectScrollbar.update();
|
|
743
|
+
}
|
|
744
|
+
afterViewInit() {
|
|
745
|
+
this.createScrollbar();
|
|
746
|
+
this.subscription?.unsubscribe();
|
|
747
|
+
this.subscription = this.router.events
|
|
748
|
+
.pipe(filter$1((event) => event instanceof NavigationEnd ||
|
|
749
|
+
event instanceof NavigationError ||
|
|
750
|
+
event instanceof NavigationCancel))
|
|
751
|
+
.subscribe(() => {
|
|
752
|
+
const { element } = this.perfectScrollbar;
|
|
753
|
+
const { topAfterNavigate, leftAfterNavigate } = this.options || {};
|
|
754
|
+
element.scrollTop = topAfterNavigate || 0;
|
|
755
|
+
element.scrollLeft = leftAfterNavigate || 0;
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
ngOnDestroy() {
|
|
759
|
+
this.subscription?.unsubscribe();
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
LpxPerfectScrollbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: LpxPerfectScrollbarService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
763
|
+
LpxPerfectScrollbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: LpxPerfectScrollbarService });
|
|
764
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: LpxPerfectScrollbarService, decorators: [{
|
|
765
|
+
type: Injectable
|
|
766
|
+
}] });
|
|
767
|
+
|
|
720
768
|
class TranslatePipe {
|
|
721
769
|
constructor(lpxThemeTranslateService) {
|
|
722
770
|
this.lpxThemeTranslateService = lpxThemeTranslateService;
|
|
@@ -1508,15 +1556,22 @@ function listenDirectionChange(languageService, styleService) {
|
|
|
1508
1556
|
};
|
|
1509
1557
|
}
|
|
1510
1558
|
|
|
1559
|
+
const LPX_PERFECT_SCROLLBAR = new InjectionToken('LPX_PERFECT_SCROLLBAR');
|
|
1560
|
+
|
|
1511
1561
|
class LpxCoreModule {
|
|
1512
1562
|
static forRoot(options) {
|
|
1513
1563
|
return {
|
|
1514
1564
|
ngModule: LpxCoreModule,
|
|
1515
1565
|
providers: [
|
|
1566
|
+
{
|
|
1567
|
+
provide: LPX_PERFECT_SCROLLBAR,
|
|
1568
|
+
useClass: LpxPerfectScrollbarService,
|
|
1569
|
+
},
|
|
1516
1570
|
createResponsiveProvider(options?.responsiveSettings),
|
|
1517
1571
|
createWindowProvider(options?.window),
|
|
1518
1572
|
LpxIconModule.forRoot(options?.iconSettings).providers,
|
|
1519
|
-
LpxLanguageModule.forRoot(options?.languageSettings)
|
|
1573
|
+
LpxLanguageModule.forRoot(options?.languageSettings)
|
|
1574
|
+
.providers,
|
|
1520
1575
|
LpxNavbarModule.forRoot(options?.navbarSettings).providers,
|
|
1521
1576
|
LpxBreadcrumbModule.forRoot().providers,
|
|
1522
1577
|
LPX_TRANSLATE_PROVIDERS,
|
|
@@ -1613,6 +1668,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
1613
1668
|
}]
|
|
1614
1669
|
}] });
|
|
1615
1670
|
|
|
1671
|
+
class PerfectScrollbarDirective {
|
|
1672
|
+
constructor() {
|
|
1673
|
+
this.elementRef = inject(ElementRef);
|
|
1674
|
+
this.lpxPerfectService = inject(LPX_PERFECT_SCROLLBAR);
|
|
1675
|
+
}
|
|
1676
|
+
set lpxPerfectScrollbarOptions(value) {
|
|
1677
|
+
this.lpxPerfectService.setOptions(value);
|
|
1678
|
+
}
|
|
1679
|
+
onResize() {
|
|
1680
|
+
this.lpxPerfectService.onResize();
|
|
1681
|
+
}
|
|
1682
|
+
ngAfterViewInit() {
|
|
1683
|
+
this.lpxPerfectService.setElement(this.elementRef);
|
|
1684
|
+
this.lpxPerfectService.afterViewInit();
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
PerfectScrollbarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PerfectScrollbarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1688
|
+
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 });
|
|
1689
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PerfectScrollbarDirective, decorators: [{
|
|
1690
|
+
type: Directive,
|
|
1691
|
+
args: [{
|
|
1692
|
+
selector: '[lpxPerfectScrollbar]',
|
|
1693
|
+
standalone: true,
|
|
1694
|
+
}]
|
|
1695
|
+
}], propDecorators: { lpxPerfectScrollbarOptions: [{
|
|
1696
|
+
type: Input
|
|
1697
|
+
}], onResize: [{
|
|
1698
|
+
type: HostListener,
|
|
1699
|
+
args: ['window:resize']
|
|
1700
|
+
}] } });
|
|
1701
|
+
|
|
1616
1702
|
class BreadcrumbPanelDirective {
|
|
1617
1703
|
constructor(template) {
|
|
1618
1704
|
this.template = template;
|
|
@@ -1838,5 +1924,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
1838
1924
|
* Generated bundle index. Do not edit.
|
|
1839
1925
|
*/
|
|
1840
1926
|
|
|
1841
|
-
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, OTHERS_GROUP_KEY, PanelsModule, RESPONSIVE_BREAKPOINTS, ResponsiveDirective, ResponsiveService, SafeHtmlPipe, SettingsPanelDirective, StyleService, SubNavbarComponent, ToObservableModule, ToObservablePipe, ToolbarPanelDirective, TopNavbarPanelDirective, TranslatePipe, UserProfileService, WINDOW, breadCrumbInit, createDirectionProvider, createGroupMap, createResponsiveProvider, createStyleFactory, createWindowProvider, exportedDeclarations, flatArrayDeepToObject, getItemsFromGroup, getStream$, isArray, isNullOrUndefined, listenDirectionChange, loadInitialStyles, sortItems, styleLoadFactory };
|
|
1927
|
+
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, OTHERS_GROUP_KEY, PanelsModule, PerfectScrollbarDirective, RESPONSIVE_BREAKPOINTS, ResponsiveDirective, ResponsiveService, SafeHtmlPipe, SettingsPanelDirective, StyleService, SubNavbarComponent, ToObservableModule, ToObservablePipe, ToolbarPanelDirective, TopNavbarPanelDirective, TranslatePipe, UserProfileService, WINDOW, breadCrumbInit, createDirectionProvider, createGroupMap, createResponsiveProvider, createStyleFactory, createWindowProvider, exportedDeclarations, flatArrayDeepToObject, getItemsFromGroup, getStream$, isArray, isNullOrUndefined, listenDirectionChange, loadInitialStyles, sortItems, styleLoadFactory };
|
|
1842
1928
|
//# sourceMappingURL=volo-ngx-lepton-x.core.mjs.map
|