UNPKG

ngx-foldable

Version:

Angular library to help you build dual-screen experiences for foldable or dual-screen devices

52 lines (51 loc) 2.18 kB
import { OnDestroy } from '@angular/core'; import { SafeStyle } from '@angular/platform-browser'; import { ScreenContext } from './screen-context'; import { SplitLayoutDirective } from './split-layout.directive'; import * as i0 from "@angular/core"; /** * This directive is used to set specify on which window segment the container * should be placed on multi screen devices. * * When used on a single screen device, no layout change (CSS) is added. * Only devices with up to two screen are currently supported, meaning that the * window segment value must be either 0 or 1. * * This directive can only be used within a {@link SplitLayoutDirective}. * If {@link SplitLayoutMode} is set to `absolute`, you can assign multiple * container element to the same window segment. * * Note that if you have set the read direction to Right-To-Left mode (`rtl`) * in CSS, the first segment will be the rightmost one. * * If the {@link WindowOrder} option is set to {@link WindowOrder.Reverse}, * the window segments order will be reversed in horizontal spanning mode. * * @example * <div fdSplitLayout="grid"> * <section fdWindow="0">Will be displayed on first screen</section> * <section fdWindow="1">Will be displayed on second screen (if available)</section> * </div> */ export declare class WindowDirective implements OnDestroy { private screenContext; private splitLayout; private segment; private layoutStyle; private screenContextSubscription; /** @ignore */ get style(): SafeStyle; /** * Sets the target window segment to display this container on when multi * screen is detected. * * @param segment The target window segment, must be 0 or 1. */ set fdWindow(segment: number | string); constructor(screenContext: ScreenContext, splitLayout: SplitLayoutDirective); /** @ignore */ ngOnDestroy(): void; private updateStyle; static ɵfac: i0.ɵɵFactoryDeclaration<WindowDirective, [null, { host: true; }]>; static ɵdir: i0.ɵɵDirectiveDeclaration<WindowDirective, "[fdWindow]", never, { "fdWindow": "fdWindow"; }, {}, never, never, false, never>; }