@ngutil/floating 0.0.102 → 0.0.104
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/fesm2022/ngutil-floating.mjs +21 -23
- package/fesm2022/ngutil-floating.mjs.map +1 -1
- package/index.d.ts +415 -5
- package/package.json +7 -7
- package/floating/floating-ref.d.ts +0 -64
- package/floating/floating.service.d.ts +0 -57
- package/floating/index.d.ts +0 -3
- package/floating/traits/_base.d.ts +0 -6
- package/floating/traits/animation.d.ts +0 -30
- package/floating/traits/attribute.d.ts +0 -18
- package/floating/traits/backdrop.d.ts +0 -16
- package/floating/traits/close-trigger.d.ts +0 -35
- package/floating/traits/focus.d.ts +0 -19
- package/floating/traits/index.d.ts +0 -9
- package/floating/traits/modal.d.ts +0 -5
- package/floating/traits/position.d.ts +0 -43
- package/floating/traits/style.d.ts +0 -10
- package/layer/backdrop-ref.d.ts +0 -15
- package/layer/child-ref.d.ts +0 -45
- package/layer/container-ref.d.ts +0 -17
- package/layer/external-ref.d.ts +0 -3
- package/layer/index.d.ts +0 -6
- package/layer/layer-container.d.ts +0 -22
- package/layer/layer.service.d.ts +0 -20
- package/layer/portal-ref.d.ts +0 -32
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { Focusable, FocusState } from "@ngutil/aria";
|
|
3
|
-
import { ElementInput } from "@ngutil/common";
|
|
4
|
-
import { FloatingRef } from "../floating-ref";
|
|
5
|
-
import { FloatingTrait } from "./_base";
|
|
6
|
-
export interface FocusOptions {
|
|
7
|
-
trap?: boolean;
|
|
8
|
-
connect?: Focusable | FocusState;
|
|
9
|
-
tabindex?: number;
|
|
10
|
-
focusOnClose?: ElementInput;
|
|
11
|
-
}
|
|
12
|
-
export declare class FocusTrait implements FloatingTrait<unknown> {
|
|
13
|
-
#private;
|
|
14
|
-
readonly options: FocusOptions;
|
|
15
|
-
readonly name = "focus";
|
|
16
|
-
constructor(options: FocusOptions);
|
|
17
|
-
connect(floatingRef: FloatingRef): Observable<unknown>;
|
|
18
|
-
}
|
|
19
|
-
export declare function focus(options: FocusOptions): FocusTrait;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function modal(): (import("./animation").AnimationTrait | import("./backdrop").BackdropTrait | {
|
|
2
|
-
readonly name: "close-trigger";
|
|
3
|
-
readonly options: import("./close-trigger").CloseTriggerOptions;
|
|
4
|
-
connect(floatingRef: import("@ngutil/floating").FloatingRef): import("rxjs").Observable<import("./close-trigger").CloseTriggerEvent | void>;
|
|
5
|
-
} | import("./focus").FocusTrait | import("./position").PositionTrait)[];
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { ElementInput } from "@ngutil/common";
|
|
3
|
-
import { FloatingPosition, FloatingPositionAltInput, FloatingPositionAnchorOptions, FloatingPositionContentOptions, FloatingPositionPlacementOptions } from "@ngutil/style";
|
|
4
|
-
import { FloatingRef } from "../floating-ref";
|
|
5
|
-
import { FloatingTrait } from "./_base";
|
|
6
|
-
export type PositionTraitElementRef = ElementInput | Window | "layer" | "viewport";
|
|
7
|
-
export type PositionTraitOptions = {
|
|
8
|
-
content?: Omit<FloatingPositionContentOptions, "constraints"> & {
|
|
9
|
-
constraints?: SizeConstraintsInput;
|
|
10
|
-
};
|
|
11
|
-
anchor?: FloatingPositionAnchorOptions & {
|
|
12
|
-
ref: PositionTraitElementRef;
|
|
13
|
-
};
|
|
14
|
-
placement?: FloatingPositionPlacementOptions & {
|
|
15
|
-
ref: PositionTraitElementRef;
|
|
16
|
-
};
|
|
17
|
-
horizontalAlt?: FloatingPositionAltInput;
|
|
18
|
-
verticalAlt?: FloatingPositionAltInput;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Width ot height input values
|
|
22
|
-
*
|
|
23
|
-
* - `number`: excact value
|
|
24
|
-
* - `ElementInput`: element reference, and take the dimension from it
|
|
25
|
-
* - `link`: take the dimension from the anchor element and only apply on connection dimension.
|
|
26
|
-
* eg.: `anchor.link = "left bottom"` and `content.link = "left top"`, in this case only width will be applied.
|
|
27
|
-
*/
|
|
28
|
-
type SizeInputConst = number | ElementInput | "link" | "viewport";
|
|
29
|
-
type SizeInput = SizeInputConst | Observable<SizeInputConst>;
|
|
30
|
-
interface SizeConstraintsInput {
|
|
31
|
-
minWidth?: SizeInput;
|
|
32
|
-
maxWidth?: SizeInput;
|
|
33
|
-
minHeight?: SizeInput;
|
|
34
|
-
maxHeight?: SizeInput;
|
|
35
|
-
}
|
|
36
|
-
export declare class PositionTrait implements FloatingTrait<FloatingPosition> {
|
|
37
|
-
readonly name = "position";
|
|
38
|
-
readonly options: Required<PositionTraitOptions>;
|
|
39
|
-
constructor(options: PositionTraitOptions);
|
|
40
|
-
connect(floatingRef: FloatingRef<any>): Observable<FloatingPosition>;
|
|
41
|
-
}
|
|
42
|
-
export declare function position(options: PositionTraitOptions): PositionTrait;
|
|
43
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { FloatingRef } from "../floating-ref";
|
|
3
|
-
import { FloatingTrait } from "./_base";
|
|
4
|
-
export declare class StyleTrait implements FloatingTrait<Partial<CSSStyleDeclaration>> {
|
|
5
|
-
readonly styles: Partial<CSSStyleDeclaration>;
|
|
6
|
-
readonly name = "style";
|
|
7
|
-
constructor(styles: Partial<CSSStyleDeclaration>);
|
|
8
|
-
connect(floatingRef: FloatingRef): Observable<Partial<CSSStyleDeclaration>>;
|
|
9
|
-
}
|
|
10
|
-
export declare function style(styles: Partial<CSSStyleDeclaration>): StyleTrait;
|
package/layer/backdrop-ref.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CoverRef } from "@ngutil/graphics";
|
|
2
|
-
import { CoverOptions } from "@ngutil/graphics";
|
|
3
|
-
import { ChildRef } from "./child-ref";
|
|
4
|
-
export type BackdropOptions = CoverOptions;
|
|
5
|
-
export declare class BackdropRef extends ChildRef {
|
|
6
|
-
#private;
|
|
7
|
-
readonly coverRef: CoverRef<any>;
|
|
8
|
-
readonly under: ChildRef;
|
|
9
|
-
readonly options: CoverOptions;
|
|
10
|
-
readonly group: string;
|
|
11
|
-
set visible(visible: boolean);
|
|
12
|
-
get visible(): boolean;
|
|
13
|
-
constructor(coverRef: CoverRef<any>, under: ChildRef, options: CoverOptions);
|
|
14
|
-
show(): import("rxjs").Observable<void>;
|
|
15
|
-
}
|
package/layer/child-ref.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ElementRef } from "@angular/core";
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
import { Lifecycle } from "@ngutil/common";
|
|
4
|
-
export type DisposeHandler<T> = (ref: T) => Observable<void>;
|
|
5
|
-
export declare enum AlwaysOnTop {
|
|
6
|
-
/**
|
|
7
|
-
* Display as open order
|
|
8
|
-
*/
|
|
9
|
-
None = 0,
|
|
10
|
-
/**
|
|
11
|
-
* Modals
|
|
12
|
-
*/
|
|
13
|
-
Modal = 2,
|
|
14
|
-
/**
|
|
15
|
-
* User access control
|
|
16
|
-
*/
|
|
17
|
-
UAC = 3,
|
|
18
|
-
/**
|
|
19
|
-
* Toast...
|
|
20
|
-
*/
|
|
21
|
-
Toast = 4,
|
|
22
|
-
/**
|
|
23
|
-
* Like select drop down, tooltip, stb...
|
|
24
|
-
*/
|
|
25
|
-
Control = 5
|
|
26
|
-
}
|
|
27
|
-
export declare abstract class ChildRef<T extends HTMLElement = HTMLElement> extends ElementRef<T> {
|
|
28
|
-
readonly alwaysOnTop: AlwaysOnTop;
|
|
29
|
-
readonly state: Lifecycle<{
|
|
30
|
-
showing: {};
|
|
31
|
-
shown: {};
|
|
32
|
-
disposing: {
|
|
33
|
-
cancellable: false;
|
|
34
|
-
};
|
|
35
|
-
disposed: {
|
|
36
|
-
cancellable: false;
|
|
37
|
-
order: "sequential";
|
|
38
|
-
};
|
|
39
|
-
}, "showing" | "shown" | "disposing" | "disposed">;
|
|
40
|
-
get zIndex(): number;
|
|
41
|
-
private _zIndex;
|
|
42
|
-
protected readonly disposed$: Observable<"disposed">;
|
|
43
|
-
constructor(nativeElement: T, alwaysOnTop?: AlwaysOnTop);
|
|
44
|
-
dispose(): Observable<void>;
|
|
45
|
-
}
|
package/layer/container-ref.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Injector, Provider } from "@angular/core";
|
|
2
|
-
import { AlwaysOnTop, ChildRef } from "./child-ref";
|
|
3
|
-
export interface ContainerOptions {
|
|
4
|
-
alwaysOnTop?: AlwaysOnTop;
|
|
5
|
-
elevation?: number;
|
|
6
|
-
classes?: string[];
|
|
7
|
-
attributes?: Record<string, string>;
|
|
8
|
-
injector?: Injector;
|
|
9
|
-
providers?: Provider[];
|
|
10
|
-
}
|
|
11
|
-
export declare class ContainerRef extends ChildRef {
|
|
12
|
-
readonly options: ContainerOptions;
|
|
13
|
-
readonly injector: Injector;
|
|
14
|
-
protected injectorName: string;
|
|
15
|
-
constructor(options: ContainerOptions);
|
|
16
|
-
protected getProviders(): Provider[];
|
|
17
|
-
}
|
package/layer/external-ref.d.ts
DELETED
package/layer/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from "@angular/core";
|
|
2
|
-
import { ChildRef } from "./child-ref";
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare const LAYER_CONTAINER_ZINDEX_START: InjectionToken<number>;
|
|
5
|
-
export declare abstract class LayerContainer {
|
|
6
|
-
#private;
|
|
7
|
-
abstract readonly root: HTMLElement;
|
|
8
|
-
readonly zIndexStart: number;
|
|
9
|
-
append<T extends ChildRef>(ref: T): T;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LayerContainer, never>;
|
|
11
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<LayerContainer, never, never, {}, {}, never, never, true, never>;
|
|
12
|
-
}
|
|
13
|
-
export declare class RootLayer extends LayerContainer {
|
|
14
|
-
readonly root: HTMLElement;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RootLayer, never>;
|
|
16
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<RootLayer>;
|
|
17
|
-
}
|
|
18
|
-
export declare class IndividualLayer extends LayerContainer {
|
|
19
|
-
readonly root: any;
|
|
20
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<IndividualLayer, never>;
|
|
21
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<IndividualLayer, never, never, {}, {}, never, never, true, never>;
|
|
22
|
-
}
|
package/layer/layer.service.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ComponentType } from "@angular/cdk/portal";
|
|
2
|
-
import { TemplateRef } from "@angular/core";
|
|
3
|
-
import { ElementInput } from "@ngutil/common";
|
|
4
|
-
import { BackdropOptions, BackdropRef } from "./backdrop-ref";
|
|
5
|
-
import { AlwaysOnTop, ChildRef } from "./child-ref";
|
|
6
|
-
import { ContainerOptions, ContainerRef } from "./container-ref";
|
|
7
|
-
import { ExternalRef } from "./external-ref";
|
|
8
|
-
import { ComponentPortalOptions, ComponentPortalRef, TemplatePortalOptions, TemplatePortalRef } from "./portal-ref";
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
export declare class LayerService {
|
|
11
|
-
#private;
|
|
12
|
-
get root(): HTMLElement;
|
|
13
|
-
newComponentPortal<T>(component: ComponentType<T>, options: ComponentPortalOptions<T>): ComponentPortalRef<T>;
|
|
14
|
-
newTemplatePortal<T>(tpl: TemplateRef<T>, options: TemplatePortalOptions<T>): TemplatePortalRef<T>;
|
|
15
|
-
newContainer(options: ContainerOptions): ContainerRef;
|
|
16
|
-
newBackdrop(under: ChildRef, options: BackdropOptions): BackdropRef;
|
|
17
|
-
addExternal(element: ElementInput, alwaysOnTop?: AlwaysOnTop): ExternalRef;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LayerService, never>;
|
|
19
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<LayerService>;
|
|
20
|
-
}
|
package/layer/portal-ref.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ComponentPortal, ComponentType, PortalOutlet, TemplatePortal } from "@angular/cdk/portal";
|
|
2
|
-
import { Provider, TemplateRef, ViewContainerRef } from "@angular/core";
|
|
3
|
-
import { ContainerOptions, ContainerRef } from "./container-ref";
|
|
4
|
-
export interface PortalOptions extends ContainerOptions {
|
|
5
|
-
}
|
|
6
|
-
export declare abstract class PortalRef extends ContainerRef {
|
|
7
|
-
protected injectorName: string;
|
|
8
|
-
protected outlet: PortalOutlet;
|
|
9
|
-
constructor(options: PortalOptions);
|
|
10
|
-
protected getProviders(): Provider[];
|
|
11
|
-
}
|
|
12
|
-
export interface ComponentPortalOptions<T = any> extends PortalOptions {
|
|
13
|
-
viewContainerRef?: ViewContainerRef;
|
|
14
|
-
}
|
|
15
|
-
export declare class ComponentPortalRef<T = any> extends PortalRef {
|
|
16
|
-
readonly component: ComponentType<T>;
|
|
17
|
-
protected injectorName: string;
|
|
18
|
-
protected readonly portal: ComponentPortal<T>;
|
|
19
|
-
constructor(component: ComponentType<T>, options: ComponentPortalOptions<T>);
|
|
20
|
-
protected getProviders(): Provider[];
|
|
21
|
-
}
|
|
22
|
-
export interface TemplatePortalOptions<T = any> extends PortalOptions {
|
|
23
|
-
viewContainerRef: ViewContainerRef;
|
|
24
|
-
context?: T;
|
|
25
|
-
}
|
|
26
|
-
export declare class TemplatePortalRef<T = any> extends PortalRef {
|
|
27
|
-
readonly template: TemplateRef<T>;
|
|
28
|
-
protected injectorName: string;
|
|
29
|
-
protected readonly portal: TemplatePortal<T>;
|
|
30
|
-
constructor(template: TemplateRef<T>, options: TemplatePortalOptions<T>);
|
|
31
|
-
protected getProviders(): Provider[];
|
|
32
|
-
}
|