UNPKG

@dunite/au-fluent-ui

Version:

An Aurelia plugin project that wraps Microsoft Fluent UI React components.

55 lines (47 loc) 1.89 kB
import { TaskQueue, customElement, inject } from 'aurelia-framework'; import { Callout, ICalloutProps } from '@fluentui/react/lib/Callout'; import { AuReactWrapper, addPropertiesState, onlyAureliaBound } from '@dunite/au-react-wrapper'; // IMPORTANT // any function defined here will be called with _this as first parameter // following parameters are from the event // _this refers to the Aurelia class with all properties added let reactprops: ICalloutProps = <ICalloutProps>{}; reactprops.backgroundColor = <any>{}; reactprops.beakWidth = <any>{}; reactprops.className = <any>{}; reactprops.bounds = <any>{}; reactprops.calloutMaxHeight = <any>{}; reactprops.calloutMaxWidth = <any>{}; reactprops.calloutWidth = <any>{}; reactprops.coverTarget = <any>{}; reactprops.directionalHint = <any>{}; reactprops.directionalHintFixed = <any>{}; reactprops.doNotLayer = <any>{}; reactprops.finalHeight = <any>{}; reactprops.gapSpace = <any>{}; reactprops.hideOverflow = <any>{}; reactprops.hidden = <any>{}; reactprops.isBeakVisible = <any>{}; reactprops.layerProps = <any>{}; reactprops.minPagePadding = <any>{}; reactprops.onDismiss = <any>onlyAureliaBound; reactprops.onLayerMounted = <any>onlyAureliaBound; reactprops.onPositioned = <any>onlyAureliaBound; reactprops.onScroll = <any>onlyAureliaBound; reactprops.preventDismissOnLostFocus = <any>{}; reactprops.preventDismissOnScroll = <any>{}; reactprops.setInitialFocus = <any>{}; reactprops.target = <any>{}; @inject(Element, TaskQueue) @customElement('du-callout') export class DuCallout extends AuReactWrapper implements ICalloutProps { constructor(element, protected tq: TaskQueue) { super(element, tq); } hidden: boolean = false; attached() { this.renderReact(Callout, this.createState(reactprops)); } } addPropertiesState(DuCallout, reactprops);