Skip to content

Commit

Permalink
fix(ngx-core): ngx prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
vapkse committed Jul 23, 2024
1 parent c726809 commit e08e71a
Show file tree
Hide file tree
Showing 12 changed files with 813 additions and 34 deletions.
797 changes: 788 additions & 9 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions projects/core/src/services/dialog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Type } from '@angular/core';
import { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';
import { Observable, ReplaySubject, switchMap, take, throttleTime } from 'rxjs';

import { AbstractLazyModule, NgxLazyLoaderService } from './lazy-loader.service';
import { NgxAbstractLazyModule, NgxLazyLoaderService } from './lazy-loader.service';

export abstract class NgxDialogService<ReturnType, DataType> {
protected openDialogSub$ = new ReplaySubject<MatDialogConfig<DataType>>(1);
Expand Down Expand Up @@ -42,5 +42,5 @@ export abstract class NgxDialogService<ReturnType, DataType> {
this.dialogRef.close();
}

protected abstract getModule(): Promise<Type<AbstractLazyModule<unknown>>>;
protected abstract getModule(): Promise<Type<NgxAbstractLazyModule<unknown>>>;
}
8 changes: 4 additions & 4 deletions projects/core/src/services/lazy-loader.service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ComponentType } from '@angular/cdk/portal';
import { Injectable, Injector, ɵcreateInjector as createInjector, Type } from '@angular/core';
import { from, map, Observable } from 'rxjs';
import { Injectable, Injector, Type, ɵcreateInjector as createInjector } from '@angular/core';
import { Observable, from, map } from 'rxjs';

export interface LoadModuleInfos<T> {
injector: Injector;
module: T;
}

export abstract class AbstractLazyModule<Component> {
export abstract class NgxAbstractLazyModule<Component> {
public constructor(
public componentType: ComponentType<Component>
) {}
Expand All @@ -21,7 +21,7 @@ export class NgxLazyLoaderService {
private injector: Injector
) {}

public loadModule$<T extends AbstractLazyModule<unknown>>(path: Promise<Type<T>>, parentInjector?: Injector): Observable<LoadModuleInfos<T>> {
public loadModule$<T extends NgxAbstractLazyModule<unknown>>(path: Promise<Type<T>>, parentInjector?: Injector): Observable<LoadModuleInfos<T>> {
return from(path).pipe(
map(elementModuleOrFactory => {
const injector = createInjector(elementModuleOrFactory, parentInjector ?? this.injector);
Expand Down
2 changes: 1 addition & 1 deletion projects/layout/src/layout.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, ContentChild, EventEmitter, HostBinding, Input, Output, TemplateRef, ViewChild, ViewEncapsulation, inject } from '@angular/core';
import { ChangeDetectionStrategy, Component, ContentChild, EventEmitter, HostBinding, inject, Input, Output, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatDrawer, MatSidenavModule } from '@angular/material/sidenav';
Expand Down
4 changes: 2 additions & 2 deletions projects/message-box-dialog/src/message-box-dialog.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MatButtonModule } from '@angular/material/button';
import { MatDialogModule } from '@angular/material/dialog';
import { MatIconModule } from '@angular/material/icon';
import { MatToolbarModule } from '@angular/material/toolbar';
import { AbstractLazyModule } from '@hug/ngx-core';
import { NgxAbstractLazyModule } from '@hug/ngx-core';

import { NgxMessageBoxDialogComponent } from './message-box-dialog.component';

Expand All @@ -19,7 +19,7 @@ import { NgxMessageBoxDialogComponent } from './message-box-dialog.component';
MatToolbarModule
]
})
export class NgxMessageBoxDialogModule extends AbstractLazyModule<NgxMessageBoxDialogComponent> {
export class NgxMessageBoxDialogModule extends NgxAbstractLazyModule<NgxMessageBoxDialogComponent> {
public constructor() {
super(NgxMessageBoxDialogComponent);
}
Expand Down
4 changes: 2 additions & 2 deletions projects/message-box-dialog/src/message-box-dialog.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Type } from '@angular/core';
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
import { AbstractLazyModule, NgxDialogService, NgxLazyLoaderService } from '@hug/ngx-core';
import { NgxAbstractLazyModule, NgxDialogService, NgxLazyLoaderService } from '@hug/ngx-core';
import { Observable, take } from 'rxjs';

import { MessageBoxDialogButtons, MessageBoxDialogData, MessageBoxDialogResponse } from './message-box-dialog.model';
Expand Down Expand Up @@ -44,7 +44,7 @@ export class NgxMessageBoxDialogService extends NgxDialogService<MessageBoxDialo
);
}

protected getModule(): Promise<Type<AbstractLazyModule<unknown>>> {
protected getModule(): Promise<Type<NgxAbstractLazyModule<unknown>>> {
return import('./message-box-dialog.module').then(m => m.NgxMessageBoxDialogModule);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Type } from '@angular/core';
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
import { AbstractLazyModule, NgxDialogService, NgxLazyLoaderService } from '@hug/ngx-core';
import { NgxAbstractLazyModule, NgxDialogService, NgxLazyLoaderService } from '@hug/ngx-core';

import { Status } from '../status.model';

Expand All @@ -21,7 +21,7 @@ export class NgxStatusDetailDialogService extends NgxDialogService<void, Status>
} as MatDialogConfig<Status>);
}

protected getModule(): Promise<Type<AbstractLazyModule<unknown>>> {
protected getModule(): Promise<Type<NgxAbstractLazyModule<unknown>>> {
return import('./status-detail.module').then(m => m.NgxStatusDetailModule);
}
}
4 changes: 2 additions & 2 deletions projects/status/src/status-detail/status-detail.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { AbstractLazyModule } from '@hug/ngx-core';
import { NgxAbstractLazyModule } from '@hug/ngx-core';
import { NgxMessageBoxComponent } from '@hug/ngx-message-box';

import { NgxStatusDetailComponent } from './status-detail.component';
Expand All @@ -17,7 +17,7 @@ import { NgxStatusDetailComponent } from './status-detail.component';
NgxMessageBoxComponent
]
})
export class NgxStatusDetailModule extends AbstractLazyModule<NgxStatusDetailComponent> {
export class NgxStatusDetailModule extends NgxAbstractLazyModule<NgxStatusDetailComponent> {
public constructor() {
super(NgxStatusDetailComponent);
}
Expand Down
4 changes: 2 additions & 2 deletions projects/status/src/status.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { AbstractLazyModule } from '@hug/ngx-core';
import { NgxAbstractLazyModule } from '@hug/ngx-core';
import { NgxSnackbarComponent } from '@hug/ngx-snackbar';

import { NgxStatusComponent } from './status.component';
Expand All @@ -17,7 +17,7 @@ import { NgxStatusComponent } from './status.component';
NgxSnackbarComponent
]
})
export class NgxStatusModule extends AbstractLazyModule<NgxStatusComponent> {
export class NgxStatusModule extends NgxAbstractLazyModule<NgxStatusComponent> {
public constructor() {
super(NgxStatusComponent);
}
Expand Down
8 changes: 4 additions & 4 deletions projects/tooltip/src/tooltip.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ConnectedPosition } from '@angular/cdk/overlay';
import { Type } from '@angular/core';
import { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';
import { AbstractLazyModule, NgxLazyLoaderService, subscribeWith } from '@hug/ngx-core';
import { NgxAbstractLazyModule, NgxLazyLoaderService, subscribeWith } from '@hug/ngx-core';
import { merge } from 'lodash-es';
import { debounceTime, delay, EMPTY, filter, fromEvent, map, mergeWith, Observable, shareReplay, Subject, switchMap, tap, withLatestFrom } from 'rxjs';
import { EMPTY, Observable, Subject, debounceTime, delay, filter, fromEvent, map, mergeWith, shareReplay, switchMap, tap, withLatestFrom } from 'rxjs';

import { NgxTooltipConfig } from './tooltip.model';
import { NgxTooltipComponentInterface } from './tooltip-component.interface';
import { NgxTooltipConfig } from './tooltip.model';

export abstract class NgxTooltipService<D> {
protected close$ = new Subject<void>();
Expand Down Expand Up @@ -254,5 +254,5 @@ export abstract class NgxTooltipService<D> {
);
}

protected abstract getModule(): Promise<Type<AbstractLazyModule<NgxTooltipComponentInterface>>>;
protected abstract getModule(): Promise<Type<NgxAbstractLazyModule<NgxTooltipComponentInterface>>>;
}
4 changes: 2 additions & 2 deletions projects/user-tooltip/src/user-tooltip.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { AbstractLazyModule } from '@hug/ngx-core';
import { NgxAbstractLazyModule } from '@hug/ngx-core';
import { NgxUserCardComponent } from '@hug/ngx-user-card';

import { NgxUserTooltipComponent } from './user-tooltip.component';
Expand All @@ -13,7 +13,7 @@ import { NgxUserTooltipComponent } from './user-tooltip.component';
NgxUserCardComponent
]
})
export class NgxUserTooltipModule extends AbstractLazyModule<NgxUserTooltipComponent> {
export class NgxUserTooltipModule extends NgxAbstractLazyModule<NgxUserTooltipComponent> {
public constructor() {
super(NgxUserTooltipComponent);
}
Expand Down
4 changes: 2 additions & 2 deletions projects/user-tooltip/src/user-tooltip.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Type } from '@angular/core';
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
import { AbstractLazyModule, NgxLazyLoaderService } from '@hug/ngx-core';
import { NgxAbstractLazyModule, NgxLazyLoaderService } from '@hug/ngx-core';
import { NgxTooltipComponentInterface, NgxTooltipService } from '@hug/ngx-tooltip';
import { NgxUserCard } from '@hug/ngx-user-card';

Expand All @@ -19,7 +19,7 @@ export class NgxUserTooltipService extends NgxTooltipService<NgxUserCard> {
} as MatDialogConfig<NgxUserCard>);
}

protected getModule(): Promise<Type<AbstractLazyModule<NgxTooltipComponentInterface>>> {
protected getModule(): Promise<Type<NgxAbstractLazyModule<NgxTooltipComponentInterface>>> {
return import('./user-tooltip.module').then(m => m.NgxUserTooltipModule);
}
}

0 comments on commit e08e71a

Please sign in to comment.