File

libs/acl/angular/src/lib/acl-hint/acl-hint-origin.ts

Index

Properties

Properties

height
Type number
width
Type number
x
Type number
y
Type number
export interface AclHintOriginRect {
  x: number;
  y: number;
  width: number;
  height: number;
}

export function findFirstElementNode(nodes: readonly unknown[]): Element | null {
  const element = nodes.find((node): node is Element => node instanceof Element);
  return element ?? null;
}

export function snapshotAclHintOrigin(element: Element): AclHintOriginRect {
  const { left, top, width, height } = element.getBoundingClientRect();
  return { x: left, y: top, width, height };
}

results matching ""

    No results matching ""