Skip to content

Commit

Permalink
chore: rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea committed Feb 2, 2024
1 parent d0764da commit dd37ffa
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {Component, DebugElement} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {TuiIdService} from '@taiga-ui/cdk';
import {TuiRootModule} from '@taiga-ui/core';
import {TuiPageObject} from '@taiga-ui/testing';

Expand Down Expand Up @@ -31,14 +30,7 @@ describe('Mobile Dialog with TUI_MOBILE_DIALOG_OPTIONS', () => {
TestBed.configureTestingModule({
imports: [NoopAnimationsModule, TuiRootModule, TuiMobileDialogModule],
declarations: [TestComponent],
providers: [
tuiMobileDialogOptionsProvider({label}),
{
provide: TuiMobileDialogService,
useFactory: () =>
new TuiMobileDialogService(TestBed.inject(TuiIdService)),
},
],
providers: [tuiMobileDialogOptionsProvider({label})],
});
await TestBed.compileComponents();
fixture = TestBed.createComponent(TestComponent);
Expand Down
1 change: 0 additions & 1 deletion projects/cdk/services/popover.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export type TuiPopover<T, O> = T &
};

@Injectable()
// eslint-disable-next-line @typescript-eslint/naming-convention
export abstract class TuiPopoverService<T, K = void> {
private readonly component: PolymorpheusComponent<any>;
private readonly items$: BehaviorSubject<ReadonlyArray<TuiPopover<T, any>>>;
Expand Down
1 change: 0 additions & 1 deletion projects/core/abstract/driver.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {ExistingProvider, Type} from '@angular/core';
import {Observable} from 'rxjs';

// eslint-disable-next-line @typescript-eslint/naming-convention
export abstract class TuiDriver extends Observable<boolean> {
abstract readonly type: string;
}
Expand Down
3 changes: 1 addition & 2 deletions projects/core/abstract/position-accessor.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {ExistingProvider, FactoryProvider, Optional, SkipSelf, Type} from '@angular/core';
import {TuiPoint} from '@taiga-ui/core/types';

// eslint-disable-next-line @typescript-eslint/naming-convention
export abstract class TuiPositionAccessor {
abstract readonly type: string;
abstract getPosition(rect: ClientRect): TuiPoint;
abstract getPosition(rect: DOMRect): TuiPoint;
}

export function tuiPositionAccessorFor(
Expand Down
1 change: 0 additions & 1 deletion projects/core/abstract/rect-accessor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {ExistingProvider, FactoryProvider, SkipSelf, Type} from '@angular/core';

// TODO: Rename to getBoundingClientRect to match the DOM API
// eslint-disable-next-line @typescript-eslint/naming-convention
export abstract class TuiRectAccessor {
abstract readonly type: string;
abstract getClientRect(): DOMRect;
Expand Down
1 change: 0 additions & 1 deletion projects/core/abstract/vehicle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {ExistingProvider, Type} from '@angular/core';

// eslint-disable-next-line @typescript-eslint/naming-convention
export abstract class TuiVehicle {
abstract readonly type: string;
abstract toggle(value: boolean): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
import {Component} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {TuiIdService} from '@taiga-ui/cdk';
import {TuiDialogHarness} from '@taiga-ui/testing';

import {TuiRootModule} from '../../root/root.module';
Expand All @@ -29,13 +28,7 @@ describe('Dialog with TUI_DIALOG_OPTIONS', () => {
TestBed.configureTestingModule({
imports: [NoopAnimationsModule, TuiRootModule, TuiDialogModule],
declarations: [TestComponent],
providers: [
tuiDialogOptionsProvider({closeable}),
{
provide: TuiDialogService,
useFactory: () => new TuiDialogService(TestBed.inject(TuiIdService)),
},
],
providers: [tuiDialogOptionsProvider({closeable})],
});
await TestBed.compileComponents();
fixture = TestBed.createComponent(TestComponent);
Expand Down
15 changes: 9 additions & 6 deletions projects/core/components/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
inject,
ViewEncapsulation,
} from '@angular/core';
import {TUI_IS_ANDROID, TUI_IS_IOS, TUI_VERSION} from '@taiga-ui/cdk';
import {TUI_IS_ANDROID, TUI_IS_IOS, TUI_IS_MOBILE, TUI_VERSION} from '@taiga-ui/cdk';
import {TUI_DIALOGS} from '@taiga-ui/core/components/dialog';
import {TuiBreakpointService} from '@taiga-ui/core/services';
import {TUI_ANIMATIONS_SPEED, TUI_REDUCED_MOTION, TUI_THEME} from '@taiga-ui/core/tokens';
import {tuiGetDuration} from '@taiga-ui/core/utils';
import {debounceTime, map, Observable} from 'rxjs';
import {debounceTime, map, Observable, of} from 'rxjs';

@Component({
selector: 'tui-root',
Expand All @@ -38,14 +38,17 @@ export class TuiRootComponent {
map(breakpoint => breakpoint === 'mobile'),
);

readonly scrollbars$: Observable<boolean> = this.dialogs$.pipe(
map(({length}) => !length),
debounceTime(0),
);
readonly scrollbars$: Observable<boolean> = this.isMobile
? of(false)
: this.dialogs$.pipe(
map(dialogs => !dialogs.length),
debounceTime(0),
);

constructor(
@Inject(TUI_REDUCED_MOTION) readonly reducedMotion: boolean,
@Inject(TUI_DIALOGS) private readonly dialogs$: Observable<readonly unknown[]>,
@Inject(TUI_IS_MOBILE) private readonly isMobile: boolean,
@Inject(TuiBreakpointService) private readonly breakpoint: TuiBreakpointService,
@Inject(TUI_IS_IOS) readonly isIOS: boolean,
@Inject(TUI_IS_ANDROID) readonly isAndroid: boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {Component, DebugElement} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {DomSanitizer} from '@angular/platform-browser';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {TuiIdService} from '@taiga-ui/cdk';
import {TuiRootModule} from '@taiga-ui/core';
import {TuiPageObject} from '@taiga-ui/testing';

Expand Down Expand Up @@ -33,14 +32,7 @@ describe('Pdf Viewer with TUI_PDF_VIEWER_OPTIONS', () => {
TestBed.configureTestingModule({
imports: [NoopAnimationsModule, TuiRootModule, TuiPdfViewerModule],
declarations: [TestComponent],
providers: [
tuiPdfViewerOptionsProvider({label}),
{
provide: TuiPdfViewerService,
useFactory: () =>
new TuiPdfViewerService(TestBed.inject(TuiIdService)),
},
],
providers: [tuiPdfViewerOptionsProvider({label})],
});
await TestBed.compileComponents();
fixture = TestBed.createComponent(TestComponent);
Expand Down

0 comments on commit dd37ffa

Please sign in to comment.