UNPKG

@microsoft/mgt

Version:
135 lines (134 loc) 4.62 kB
/** * ------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. * See License in the project root for license information. * ------------------------------------------------------------------------------------------- */ import * as MicrosoftGraph from '@microsoft/microsoft-graph-types'; import { PropertyValues, TemplateResult } from 'lit-element'; import '../../styles/fabric-icon-font'; import '../sub-components/mgt-flyout/mgt-flyout'; import { MgtTemplatedComponent } from '../templatedComponent'; import { PersonCardInteraction } from './../PersonCardInteraction'; /** * The person component is used to display a person or contact by using their photo, name, and/or email address. * * @export * @class MgtPerson * @extends {MgtTemplatedComponent} */ export declare class MgtPerson extends MgtTemplatedComponent { /** * Array of styles to apply to the element. The styles should be defined * user the `css` tag function. */ static get styles(): import("lit-element").CSSResult[]; /** * allows developer to define name of person for component * @type {string} */ personQuery: string; /** * user-id property allows developer to use id value to determine person * @type {string} */ userId: string; /** * determines if person component renders user-name * @type {boolean} */ showName: false; /** * determines if person component renders email * @type {boolean} */ showEmail: false; /** * object containing Graph details on person * @type {MgtPersonDetails} */ personDetails: MicrosoftGraph.User | MicrosoftGraph.Person | MicrosoftGraph.Contact; /** * Set the image of the person * Set to '@' to look up image from the graph * * @type {string} * @memberof MgtPersonCard */ personImage: string; /** * Sets how the person-card is invoked * Set to PersonCardInteraction.none to not show the card * * @type {PersonCardInteraction} * @memberof MgtPerson */ personCardInteraction: PersonCardInteraction; private isPersonCardVisible; private personCardShouldRender; private _mouseLeaveTimeout; private _mouseEnterTimeout; constructor(); /** * Synchronizes property values when attributes change. * * @param {*} name * @param {*} oldValue * @param {*} newValue * @memberof MgtPerson */ attributeChangedCallback(name: any, oldval: any, newval: any): void; /** * Invoked when the element is first updated. Implement to perform one time * work on the element after update. * * Setting properties inside this method will trigger the element to update * again after this update cycle completes. * * * @param _changedProperties Map of changed properties with old values */ firstUpdated(): void; /** * Invoked each time the custom element is appended into a document-connected element * * @memberof MgtPerson */ connectedCallback(): void; /** * Invoked each time the custom element is disconnected from the document's DOM * * @memberof MgtPerson */ disconnectedCallback(): void; /** * Invoked on each update to perform rendering tasks. This method must return * a lit-html TemplateResult. Setting properties inside this method will *not* * trigger the element to update. */ render(): TemplateResult; /** * Invoked whenever the element is updated. Implement to perform * post-updating tasks via DOM APIs, for example, focusing an element. * * Setting properties inside this method will trigger the element to update * again after this update cycle completes. * * * @param changedProperties Map of changed properties with old values */ protected updated(changedProps: PropertyValues): void; private handleWindowClick; private loadData; private loadImage; private handleMouseClick; private handleMouseEnter; private handleMouseLeave; private showPersonCard; private hidePersonCard; private getImage; private renderFlyout; private renderDetails; private renderImage; private renderEmptyImage; private renderNameAndEmail; private getInitials; }