@angular2-material/core

  • Version 2.0.0-alpha.8-3
  • Published
  • No dependencies
  • MIT license

Install

npm i @angular2-material/core
yarn add @angular2-material/core
pnpm add @angular2-material/core

Overview

Angular 2 Material core

Index

Variables

Functions

Classes

Interfaces

Type Aliases

Variables

variable DOWN_ARROW

const DOWN_ARROW: number;

    variable ENTER

    const ENTER: number;

      variable LEFT_ARROW

      const LEFT_ARROW: number;

        variable LIVE_ANNOUNCER_ELEMENT_TOKEN

        const LIVE_ANNOUNCER_ELEMENT_TOKEN: OpaqueToken;

          variable OVERLAY_PROVIDERS

          const OVERLAY_PROVIDERS: (
          | typeof ViewportRuler
          | typeof OverlayPositionBuilder
          | typeof OverlayContainer
          | typeof Overlay
          )[];
          • Providers for Overlay and its related injectables.

          variable RIGHT_ARROW

          const RIGHT_ARROW: number;

            variable TAB

            const TAB: number;

              variable UP_ARROW

              const UP_ARROW: number;

                Functions

                function applyCssTransform

                applyCssTransform: (element: HTMLElement, transformValue: string) => void;
                • Applies a CSS transform to an element, including browser-prefixed properties.

                  Parameter element

                  Parameter transformValue

                function BooleanFieldValue

                BooleanFieldValue: () => (target: any, key: string) => void;
                • Annotation Factory that allows HTML style boolean attributes. For example, a field declared like this:

                  @Directive({ selector: 'component' }) class MyComponent { @Input() @BooleanFieldValueFactory() myField: boolean; }

                  You could set it up this way: <component myField> or:

                  Deprecated

                Classes

                class BasePortalHost

                abstract class BasePortalHost implements PortalHost {}
                • Partial implementation of PortalHost that only deals with attaching either a ComponentPortal or a TemplatePortal.

                method attach

                attach: (portal: Portal<any>) => any;

                  method attachComponentPortal

                  abstract attachComponentPortal: <T>(
                  portal: ComponentPortal<T>
                  ) => ComponentRef<T>;

                    method attachTemplatePortal

                    abstract attachTemplatePortal: (portal: TemplatePortal) => Map<string, any>;

                      method detach

                      detach: () => void;

                        method dispose

                        dispose: () => void;

                          method hasAttached

                          hasAttached: () => boolean;
                          • Whether this host has an attached portal.

                          method setDisposeFn

                          setDisposeFn: (fn: () => void) => void;

                            class ComponentPortal

                            class ComponentPortal<T> extends Portal<ComponentRef<T>> {}
                            • A ComponentPortal is a portal that instantiates some Component upon attachment.

                            constructor

                            constructor(
                            component: ComponentType<T>,
                            viewContainerRef?: ViewContainerRef,
                            injector?: Injector
                            );

                              property component

                              component: ComponentType<T>;
                              • The type of the component that will be instantiated for attachment.

                              property injector

                              injector: Injector;
                              • [Optional] Injector used for the instantiation of the component.

                              property viewContainerRef

                              viewContainerRef: ViewContainerRef;
                              • [Optional] Where the attached component should live in Angular's *logical* component tree. This is different from where the component *renders*, which is determined by the PortalHost. The origin necessary when the host is outside of the Angular application context.

                              class ConnectedOverlayDirective

                              class ConnectedOverlayDirective implements OnInit, OnDestroy {}
                              • Directive to facilitate declarative creation of an Overlay using a ConnectedPositionStrategy.

                              constructor

                              constructor(
                              _overlay: Overlay,
                              templateRef: TemplateRef<any>,
                              viewContainerRef: ViewContainerRef
                              );

                                property origin

                                origin: OverlayOrigin;

                                  property overlayRef

                                  readonly overlayRef: OverlayRef;

                                    property positions

                                    positions: ConnectionPositionPair[];

                                      method ngOnDestroy

                                      ngOnDestroy: () => void;
                                      • TODO: internal

                                      method ngOnInit

                                      ngOnInit: () => void;
                                      • TODO: internal

                                      class ConnectedPositionStrategy

                                      class ConnectedPositionStrategy implements PositionStrategy {}
                                      • A strategy for positioning overlays. Using this strategy, an overlay is given an implict position relative some origin element. The relative position is defined in terms of a point on the origin element that is connected to a point on the overlay element. For example, a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner of the overlay.

                                      constructor

                                      constructor(
                                      _connectedTo: ElementRef,
                                      _originPos: OriginConnectionPosition,
                                      _overlayPos: OverlayConnectionPosition,
                                      _viewportRuler: ViewportRuler
                                      );

                                        property positions

                                        readonly positions: ConnectionPositionPair[];

                                          method apply

                                          apply: (element: HTMLElement) => Promise<void>;
                                          • Updates the position of the overlay element, using whichever preferred position relative to the origin fits on-screen. TODO: internal

                                          method withFallbackPosition

                                          withFallbackPosition: (
                                          originPos: OriginConnectionPosition,
                                          overlayPos: OverlayConnectionPosition
                                          ) => this;

                                            class ConnectionPositionPair

                                            class ConnectionPositionPair {}
                                            • The points of the origin element and the overlay element to connect.

                                            constructor

                                            constructor(
                                            origin: OriginConnectionPosition,
                                            overlay: OverlayConnectionPosition
                                            );

                                              property originX

                                              originX: HorizontalConnectionPos;

                                                property originY

                                                originY: VerticalConnectionPos;

                                                  property overlayX

                                                  overlayX: HorizontalConnectionPos;

                                                    property overlayY

                                                    overlayY: VerticalConnectionPos;

                                                      class Dir

                                                      class Dir {}
                                                      • Directive to listen to changes of direction of part of the DOM.

                                                        Applications should use this directive instead of the native attribute so that Material components can listen on changes of direction.

                                                      property dir

                                                      dir: LayoutDirection;

                                                        property dirChange

                                                        dirChange: EventEmitter<void>;

                                                          property value

                                                          value: LayoutDirection;

                                                            class DomPortalHost

                                                            class DomPortalHost extends BasePortalHost {}
                                                            • A PortalHost for attaching portals to an arbitrary DOM element outside of the Angular application context.

                                                              This is the only part of the portal core that directly touches the DOM.

                                                            constructor

                                                            constructor(
                                                            _hostDomElement: Element,
                                                            _componentFactoryResolver: ComponentFactoryResolver
                                                            );

                                                              method attachComponentPortal

                                                              attachComponentPortal: <T>(portal: ComponentPortal<T>) => ComponentRef<T>;
                                                              • Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.

                                                              method attachTemplatePortal

                                                              attachTemplatePortal: (portal: TemplatePortal) => Map<string, any>;

                                                                method dispose

                                                                dispose: () => void;

                                                                  class MdCoreModule

                                                                  class MdCoreModule {}

                                                                    method forRoot

                                                                    static forRoot: () => ModuleWithProviders;

                                                                      class MdError

                                                                      class MdError extends Error {}
                                                                      • Wrapper around Error that sets the error message.

                                                                      constructor

                                                                      constructor(value: string);

                                                                        class MdGestureConfig

                                                                        class MdGestureConfig extends HammerGestureConfig {}

                                                                          property events

                                                                          events: string[];

                                                                            method buildHammer

                                                                            buildHammer: (element: HTMLElement) => HammerManager;

                                                                              class MdLine

                                                                              class MdLine {}
                                                                              • Shared directive to count lines inside a text area, such as a list item. Line elements can be extracted with a @ContentChildren(MdLine) query, then counted by checking the query list's length.

                                                                              class MdLineModule

                                                                              class MdLineModule {}

                                                                                class MdLineSetter

                                                                                class MdLineSetter {}

                                                                                  constructor

                                                                                  constructor(
                                                                                  _lines: QueryList<MdLine>,
                                                                                  _renderer: Renderer,
                                                                                  _element: ElementRef
                                                                                  );

                                                                                    class MdLiveAnnouncer

                                                                                    class MdLiveAnnouncer {}

                                                                                      constructor

                                                                                      constructor(elementToken: any);

                                                                                        method announce

                                                                                        announce: (message: string, politeness?: AriaLivePoliteness) => void;
                                                                                        • Parameter message

                                                                                          Message to be announced to the screenreader

                                                                                          Parameter politeness

                                                                                          The politeness of the announcer element.

                                                                                        class MdRipple

                                                                                        class MdRipple implements OnInit, OnDestroy, OnChanges {}

                                                                                          constructor

                                                                                          constructor(_elementRef: ElementRef);

                                                                                            property backgroundColor

                                                                                            backgroundColor: string;
                                                                                            • Custom color for the ripple background.

                                                                                            property centered

                                                                                            centered: boolean;
                                                                                            • Whether the ripple always originates from the center of the host element's bounds, rather than originating from the location of the click event.

                                                                                            property color

                                                                                            color: string;
                                                                                            • Custom color for ripples.

                                                                                            property disabled

                                                                                            disabled: boolean;
                                                                                            • Whether click events will not trigger the ripple. It can still be triggered by manually calling start() and end().

                                                                                            property focused

                                                                                            focused: boolean;
                                                                                            • Whether the ripple background will be highlighted to indicated a focused state.

                                                                                            property maxRadius

                                                                                            maxRadius: number;
                                                                                            • If set, the radius in pixels of foreground ripples when fully expanded. If unset, the radius will be the distance from the center of the ripple to the furthest corner of the host element's bounding rectangle.

                                                                                            property speedFactor

                                                                                            speedFactor: number;
                                                                                            • If set, the normal duration of ripple animations is divided by this value. For example, setting it to 0.5 will cause the animations to take twice as long.

                                                                                            property trigger

                                                                                            trigger: HTMLElement;
                                                                                            • The element that triggers the ripple when click events are received. Defaults to the directive's host element.

                                                                                            property unbounded

                                                                                            unbounded: boolean;
                                                                                            • Whether foreground ripples should be visible outside the component's bounds.

                                                                                            method end

                                                                                            end: (left: number, top: number, forceCenter?: boolean) => void;
                                                                                            • Responds to the end of a ripple animation trigger by fading the background out, and creating a foreground ripple that expands from the event location (or from the center of the element if the "centered" property is set or forceCenter is true).

                                                                                            method ngOnChanges

                                                                                            ngOnChanges: (changes: { [propertyName: string]: SimpleChange }) => void;
                                                                                            • TODO: internal

                                                                                            method ngOnDestroy

                                                                                            ngOnDestroy: () => void;
                                                                                            • TODO: internal

                                                                                            method ngOnInit

                                                                                            ngOnInit: () => void;
                                                                                            • TODO: internal

                                                                                            method start

                                                                                            start: () => void;
                                                                                            • Responds to the start of a ripple animation trigger by fading the background in.

                                                                                            class MdRippleModule

                                                                                            class MdRippleModule {}

                                                                                              method forRoot

                                                                                              static forRoot: () => ModuleWithProviders;

                                                                                                class MdUniqueSelectionDispatcher

                                                                                                class MdUniqueSelectionDispatcher {}
                                                                                                • Class to coordinate unique selection based on name. Intended to be consumed as an Angular service. This service is needed because native radio change events are only fired on the item currently being selected, and we still need to uncheck the previous selection.

                                                                                                  This service does not *store* any IDs and names because they may change at any time, so it is less error-prone if they are simply passed through when the events occur.

                                                                                                method listen

                                                                                                listen: (listener: MdUniqueSelectionDispatcherListener) => void;
                                                                                                • Listen for future changes to item selection.

                                                                                                method notify

                                                                                                notify: (id: string, name: string) => void;
                                                                                                • Notify other items that selection for the given name has been set.

                                                                                                class Overlay

                                                                                                class Overlay {}
                                                                                                • Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be used as a low-level building building block for other components. Dialogs, tooltips, menus, selects, etc. can all be built using overlays. The service should primarily be used by authors of re-usable components rather than developers building end-user applications.

                                                                                                  An overlay *is* a PortalHost, so any kind of Portal can be loaded into one.

                                                                                                constructor

                                                                                                constructor(
                                                                                                _overlayContainer: OverlayContainer,
                                                                                                _componentFactoryResolver: ComponentFactoryResolver,
                                                                                                _positionBuilder: OverlayPositionBuilder
                                                                                                );

                                                                                                  method create

                                                                                                  create: (state?: OverlayState) => OverlayRef;
                                                                                                  • Creates an overlay.

                                                                                                    Parameter state

                                                                                                    State to apply to the overlay.

                                                                                                    Returns

                                                                                                    A reference to the created overlay.

                                                                                                  method position

                                                                                                  position: () => OverlayPositionBuilder;
                                                                                                  • Returns a position builder that can be used, via fluent API, to construct and configure a position strategy.

                                                                                                  class OverlayContainer

                                                                                                  class OverlayContainer {}
                                                                                                  • The OverlayContainer is the container in which all overlays will load. It should be provided in the root component to ensure it is properly shared.

                                                                                                  method getContainerElement

                                                                                                  getContainerElement: () => HTMLElement;
                                                                                                  • This method returns the overlay container element. It will lazily create the element the first time it is called to facilitate using the container in non-browser environments.

                                                                                                    Returns

                                                                                                    {HTMLElement} the container element

                                                                                                  class OverlayModule

                                                                                                  class OverlayModule {}

                                                                                                    method forRoot

                                                                                                    static forRoot: () => ModuleWithProviders;

                                                                                                      class OverlayOrigin

                                                                                                      class OverlayOrigin {}
                                                                                                      • Directive applied to an element to make it usable as an origin for an Overlay using a ConnectedPositionStrategy.

                                                                                                      constructor

                                                                                                      constructor(_elementRef: ElementRef);

                                                                                                        property elementRef

                                                                                                        readonly elementRef: ElementRef;

                                                                                                          class OverlayRef

                                                                                                          class OverlayRef implements PortalHost {}
                                                                                                          • Reference to an overlay that has been created with the Overlay service. Used to manipulate or dispose of said overlay.

                                                                                                          constructor

                                                                                                          constructor(_portalHost: PortalHost, _pane: HTMLElement, _state: OverlayState);

                                                                                                            method attach

                                                                                                            attach: (portal: Portal<any>) => any;

                                                                                                              method detach

                                                                                                              detach: () => Promise<any>;

                                                                                                                method dispose

                                                                                                                dispose: () => void;

                                                                                                                  method getState

                                                                                                                  getState: () => OverlayState;
                                                                                                                  • Gets the current state config of the overlay.

                                                                                                                  method hasAttached

                                                                                                                  hasAttached: () => boolean;

                                                                                                                    method updatePosition

                                                                                                                    updatePosition: () => void;
                                                                                                                    • Updates the position of the overlay based on the position strategy.

                                                                                                                    class OverlayState

                                                                                                                    class OverlayState {}
                                                                                                                    • OverlayState is a bag of values for either the initial configuration or current state of an overlay.

                                                                                                                    property positionStrategy

                                                                                                                    positionStrategy: PositionStrategy;
                                                                                                                    • Strategy with which to position the overlay.

                                                                                                                    class Portal

                                                                                                                    abstract class Portal<T> {}
                                                                                                                    • A Portal is something that you want to render somewhere else. It can be attach to / detached from a PortalHost.

                                                                                                                    property isAttached

                                                                                                                    readonly isAttached: boolean;
                                                                                                                    • Whether this portal is attached to a host.

                                                                                                                    method attach

                                                                                                                    attach: (host: PortalHost) => T;
                                                                                                                    • Attach this portal to a host.

                                                                                                                    method detach

                                                                                                                    detach: () => void;
                                                                                                                    • Detach this portal from its host

                                                                                                                    method setAttachedHost

                                                                                                                    setAttachedHost: (host: PortalHost) => void;
                                                                                                                    • Sets the PortalHost reference without performing attach(). This is used directly by the PortalHost when it is performing an attach() or detatch().

                                                                                                                    class PortalHostDirective

                                                                                                                    class PortalHostDirective extends BasePortalHost {}
                                                                                                                    • Directive version of a PortalHost. Because the directive *is* a PortalHost, portals can be directly attached to it, enabling declarative use.

                                                                                                                      Usage: <template [portalHost]="greeting">

                                                                                                                    constructor

                                                                                                                    constructor(
                                                                                                                    _componentFactoryResolver: ComponentFactoryResolver,
                                                                                                                    _viewContainerRef: ViewContainerRef
                                                                                                                    );

                                                                                                                      property portal

                                                                                                                      portal: Portal<any>;

                                                                                                                        method attachComponentPortal

                                                                                                                        attachComponentPortal: <T>(portal: ComponentPortal<T>) => ComponentRef<T>;
                                                                                                                        • Attach the given ComponentPortal to this PortlHost using the ComponentFactoryResolver.

                                                                                                                        method attachTemplatePortal

                                                                                                                        attachTemplatePortal: (portal: TemplatePortal) => Map<string, any>;
                                                                                                                        • Attach the given TemplatePortal to this PortlHost as an embedded View.

                                                                                                                        class PortalModule

                                                                                                                        class PortalModule {}

                                                                                                                          method forRoot

                                                                                                                          static forRoot: () => ModuleWithProviders;

                                                                                                                            class RtlModule

                                                                                                                            class RtlModule {}

                                                                                                                              method forRoot

                                                                                                                              static forRoot: () => ModuleWithProviders;

                                                                                                                                class TemplatePortal

                                                                                                                                class TemplatePortal extends Portal<Map<string, any>> {}
                                                                                                                                • A TemplatePortal is a portal that represents some embedded template (TemplateRef).

                                                                                                                                constructor

                                                                                                                                constructor(template: TemplateRef<any>, viewContainerRef: ViewContainerRef);

                                                                                                                                  property locals

                                                                                                                                  locals: Map<string, any>;
                                                                                                                                  • Additional locals for the instantiated embedded view. These locals can be seen as "exports" for the template, such as how ngFor has index / event / odd. See https://angular.io/docs/ts/latest/api/core/EmbeddedViewRef-class.html

                                                                                                                                  property origin

                                                                                                                                  readonly origin: ElementRef;

                                                                                                                                    property templateRef

                                                                                                                                    templateRef: TemplateRef<any>;
                                                                                                                                    • The embedded template that will be used to instantiate an embedded View in the host.

                                                                                                                                    property viewContainerRef

                                                                                                                                    viewContainerRef: ViewContainerRef;
                                                                                                                                    • Reference to the ViewContainer into which the template will be stamped out.

                                                                                                                                    method attach

                                                                                                                                    attach: (host: PortalHost, locals?: Map<string, any>) => Map<string, any>;

                                                                                                                                      method detach

                                                                                                                                      detach: () => void;

                                                                                                                                        class TemplatePortalDirective

                                                                                                                                        class TemplatePortalDirective extends TemplatePortal {}
                                                                                                                                        • Directive version of a TemplatePortal. Because the directive *is* a TemplatePortal, the directive instance itself can be attached to a host, enabling declarative use of portals.

                                                                                                                                          Usage: <template portal #greeting> Hello {{name}}

                                                                                                                                        constructor

                                                                                                                                        constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef);

                                                                                                                                          Interfaces

                                                                                                                                          interface ComponentType

                                                                                                                                          interface ComponentType<T> {}

                                                                                                                                            construct signature

                                                                                                                                            new (...args: any[]): T;

                                                                                                                                              interface OriginConnectionPosition

                                                                                                                                              interface OriginConnectionPosition {}
                                                                                                                                              • A connection point on the origin element.

                                                                                                                                              property originX

                                                                                                                                              originX: HorizontalConnectionPos;

                                                                                                                                                property originY

                                                                                                                                                originY: VerticalConnectionPos;

                                                                                                                                                  interface OverlayConnectionPosition

                                                                                                                                                  interface OverlayConnectionPosition {}
                                                                                                                                                  • A connection point on the overlay element.

                                                                                                                                                  property overlayX

                                                                                                                                                  overlayX: HorizontalConnectionPos;

                                                                                                                                                    property overlayY

                                                                                                                                                    overlayY: VerticalConnectionPos;

                                                                                                                                                      interface PortalHost

                                                                                                                                                      interface PortalHost {}
                                                                                                                                                      • A PortalHost is an space that can contain a single Portal.

                                                                                                                                                      method attach

                                                                                                                                                      attach: (portal: Portal<any>) => any;

                                                                                                                                                        method detach

                                                                                                                                                        detach: () => any;

                                                                                                                                                          method dispose

                                                                                                                                                          dispose: () => void;

                                                                                                                                                            method hasAttached

                                                                                                                                                            hasAttached: () => boolean;

                                                                                                                                                              Type Aliases

                                                                                                                                                              type AriaLivePoliteness

                                                                                                                                                              type AriaLivePoliteness = 'off' | 'polite' | 'assertive';

                                                                                                                                                                type HorizontalConnectionPos

                                                                                                                                                                type HorizontalConnectionPos = 'start' | 'center' | 'end';
                                                                                                                                                                • Horizontal dimension of a connection point on the perimeter of the origin or overlay element.

                                                                                                                                                                type LayoutDirection

                                                                                                                                                                type LayoutDirection = 'ltr' | 'rtl';

                                                                                                                                                                  type MdUniqueSelectionDispatcherListener

                                                                                                                                                                  type MdUniqueSelectionDispatcherListener = (id: string, name: string) => void;

                                                                                                                                                                    type VerticalConnectionPos

                                                                                                                                                                    type VerticalConnectionPos = 'top' | 'center' | 'bottom';
                                                                                                                                                                    • Vertical dimension of a connection point on the perimeter of the origin or overlay element.

                                                                                                                                                                    Package Files (23)

                                                                                                                                                                    Dependencies (0)

                                                                                                                                                                    No dependencies.

                                                                                                                                                                    Dev Dependencies (0)

                                                                                                                                                                    No dev dependencies.

                                                                                                                                                                    Peer Dependencies (2)

                                                                                                                                                                    Badge

                                                                                                                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@angular2-material/core.

                                                                                                                                                                    • Markdown
                                                                                                                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@angular2-material/core)
                                                                                                                                                                    • HTML
                                                                                                                                                                      <a href="https://www.jsdocs.io/package/@angular2-material/core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>