File

projects/storefrontlib/shared/components/popover/popover.model.ts

Index

Properties

Properties

appendToBody
appendToBody: boolean
Type : boolean
Optional

Append popover component into 'body' selector.

autoPositioning
autoPositioning: boolean
Type : boolean
Optional

Flag used to define if popover should look for the best placement in case if there is not enough space in viewport for preferred position.

By default this property is set to true.

Value of this flag is omitted if preferred position is set to auto.

class
class: string
Type : string
Optional

Custom class name passed to popover component.

If this property is not set the default popover class is cx-popover.

disable
disable: boolean
Type : boolean
Optional

Flag used to prevent firing popover open function.

displayCloseButton
displayCloseButton: boolean
Type : boolean
Optional

Flag used to hide close button in popover component.

placement
placement: PopoverPosition
Type : PopoverPosition
Optional

The preferred placement of the popover. Default popover position is 'top'.

Allowed popover positions: 'auto', 'top', 'bottom', 'left', 'right', 'top-left', 'top-right', 'bottom-left', 'bottom-right', 'left-top', 'left-bottom', 'right-top', 'right-bottom'.

positionOnScroll
positionOnScroll: boolean
Type : boolean
Optional

Flag indicates if popover should be re-positioned on scroll event.

export type PopoverPosition =
  | 'auto'
  | 'top'
  | 'bottom'
  | 'left'
  | 'right'
  | 'top-left'
  | 'top-right'
  | 'bottom-left'
  | 'bottom-right'
  | 'left-top'
  | 'left-bottom'
  | 'right-top'
  | 'right-bottom';

export type PopoverPositionArray =
  | PopoverPosition
  | Array<PopoverPosition>
  | string;

export enum PopoverEvent {
  INSIDE_CLICK = 'insideClick',
  OUTSIDE_CLICK = 'outsideClick',
  ESCAPE_KEYDOWN = 'escapeKeydown',
  CLOSE_BUTTON_CLICK = 'closeButtonClick',
  CLOSE_BUTTON_KEYDOWN = 'closeButtonKeydown',
  ROUTE_CHANGE = 'routeChange',
  OPEN = 'open',
  OPEN_BY_KEYBOARD = 'openByKeyboard',
}

export interface PopoverOptions {
  /**
   * The preferred placement of the popover. Default popover position is 'top'.
   *
   *  Allowed popover positions: 'auto', 'top', 'bottom', 'left', 'right',
   * 'top-left', 'top-right', 'bottom-left', 'bottom-right',
   * 'left-top', 'left-bottom', 'right-top', 'right-bottom'.
   */
  placement?: PopoverPosition;

  /**
   * Flag used to define if popover should look for the best placement
   * in case if there is not enough space in viewport for preferred position.
   *
   * By default this property is set to `true`.
   *
   * Value of this flag is omitted if preferred position is set to `auto`.
   */
  autoPositioning?: boolean;

  /**
   * Flag used to prevent firing popover open function.
   */
  disable?: boolean;

  /**
   * Custom class name passed to popover component.
   *
   * If this property is not set the default popover class is `cx-popover`.
   */
  class?: string;

  /**
   * Flag used to hide close button in popover component.
   */
  displayCloseButton?: boolean;

  /**
   * Append popover component into 'body' selector.
   */
  appendToBody?: boolean;

  /**
   * Flag indicates if popover should be re-positioned on scroll event.
   */
  positionOnScroll?: boolean;
}

result-matching ""

    No results matching ""