UNPKG

5.09 kBSource Map (JSON)View Raw
1{"version":3,"file":"TeachingBubble.base.js","sourceRoot":"../src/","sources":["components/TeachingBubble/TeachingBubble.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAOhE,OAAO,EAAE,OAAO,EAAiB,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,IAAM,aAAa,GAAG,kBAAkB,EAAoD,CAAC;AAM7F;IAAwC,sCAA2D;IAoBjG,cAAc;IACd,4BAAY,KAA2B;QAAvC,YACE,kBAAM,KAAK,CAAC,SAYb;QAjBM,iBAAW,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAOrD,sBAAsB,CAAC,KAAI,CAAC,CAAC;QAC7B,KAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAEhB,KAAI,CAAC,oBAAoB,GAAG;YAC1B,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,CAAC;YACX,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,KAAK;YACjB,eAAe,EAAE,eAAe,CAAC,WAAW;SAC7C,CAAC;;IACJ,CAAC;IAEM,kCAAK,GAAZ;QACE,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;YAC5B,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SAClC;IACH,CAAC;IAEM,mCAAM,GAAb;QACQ,IAAA,eAYQ,EAXZ,iCAA6B;QAC7B,mDAAmD;QACnD,gCAAa,EACb,wBAAS;QACT,2CAA2C;QAC3C,mDAAmD;QACnD,sBAAwC;QAFxC,2CAA2C;QAC3C,mDAAmD;QACnD,6DAAwC,EACxC,kBAAM,EACN,kBAAM,EACN,gBAAK,EACL,kBACY,CAAC;QACf,IAAM,YAAY,yBAAQ,IAAI,CAAC,oBAAoB,GAAK,eAAe,CAAE,CAAC;QAC1E,IAAM,WAAW,GAA8B;YAC7C,KAAK,EAAE,KAAM;YACb,MAAM,QAAA;YACN,YAAY,wBAAO,YAAY,KAAE,KAAK,EAAE,YAAY,CAAC,KAAM,GAAE;YAC7D,cAAc,gBAAA;SACf,CAAC;QAEF,IAAM,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACtD,IAAM,aAAa,GAAG,UAAU,CAAC,kBAAkB;YACjD,CAAC,CAAE,UAAU,CAAC,kBAAwD,CAAC,OAAO;YAC9E,CAAC,CAAC,SAAS,CAAC;QAEd,OAAO,CACL,oBAAC,OAAO,aACN,MAAM,EAAE,MAAM,IAAI,aAAa,EAC/B,SAAS,EAAE,SAAS,IAChB,YAAY,IAChB,SAAS,EAAE,UAAU,CAAC,IAAI,EAC1B,MAAM,EAAE,aAAa,EACrB,YAAY;YAEZ,6BAAK,GAAG,EAAE,IAAI,CAAC,WAAW;gBACxB,oBAAC,qBAAqB,eAAK,IAAI,CAAC,KAAK,EAAI,CACrC,CACE,CACX,CAAC;IACJ,CAAC;IAlFa,+BAAY,GAAG;QAC3B;;;;WAIG;QACH,mDAAmD;QACnD,YAAY,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,CAAC;YACX,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,KAAK;YACjB,eAAe,EAAE,eAAe,CAAC,WAAW;SAC7C;KACF,CAAC;IAqEJ,yBAAC;CAAA,AApFD,CAAwC,KAAK,CAAC,SAAS,GAoFtD;SApFY,kBAAkB","sourcesContent":["import * as React from 'react';\nimport { initializeComponentRef, classNamesFunction } from '../../Utilities';\nimport { TeachingBubbleContent } from './TeachingBubbleContent';\nimport {\n ITeachingBubbleProps,\n ITeachingBubbleStyleProps,\n ITeachingBubbleStyles,\n ITeachingBubbleSubComponentStyles,\n} from './TeachingBubble.types';\nimport { Callout, ICalloutProps } from '../../Callout';\nimport { DirectionalHint } from '../../common/DirectionalHint';\n\nconst getClassNames = classNamesFunction<ITeachingBubbleStyleProps, ITeachingBubbleStyles>();\n\nexport interface ITeachingBubbleState {\n isTeachingBubbleVisible?: boolean;\n}\n\nexport class TeachingBubbleBase extends React.Component<ITeachingBubbleProps, ITeachingBubbleState> {\n public static defaultProps = {\n /**\n * Default calloutProps is deprecated in favor of private `_defaultCalloutProps`.\n * Remove in next release.\n * @deprecated In favor of private `_defaultCalloutProps`.\n */\n // eslint-disable-next-line deprecation/deprecation\n calloutProps: {\n beakWidth: 16,\n gapSpace: 0,\n setInitialFocus: true,\n doNotLayer: false,\n directionalHint: DirectionalHint.rightCenter,\n },\n };\n\n public rootElement = React.createRef<HTMLDivElement>();\n private _defaultCalloutProps: ICalloutProps;\n\n // Constructor\n constructor(props: ITeachingBubbleProps) {\n super(props);\n\n initializeComponentRef(this);\n this.state = {};\n\n this._defaultCalloutProps = {\n beakWidth: 16,\n gapSpace: 0,\n setInitialFocus: true,\n doNotLayer: false,\n directionalHint: DirectionalHint.rightCenter,\n };\n }\n\n public focus(): void {\n if (this.rootElement.current) {\n this.rootElement.current.focus();\n }\n }\n\n public render(): JSX.Element {\n const {\n calloutProps: setCalloutProps,\n // eslint-disable-next-line deprecation/deprecation\n targetElement,\n onDismiss,\n // Default to deprecated value if provided.\n // eslint-disable-next-line deprecation/deprecation\n hasCloseButton = this.props.hasCloseIcon,\n isWide,\n styles,\n theme,\n target,\n } = this.props;\n const calloutProps = { ...this._defaultCalloutProps, ...setCalloutProps };\n const stylesProps: ITeachingBubbleStyleProps = {\n theme: theme!,\n isWide,\n calloutProps: { ...calloutProps, theme: calloutProps.theme! },\n hasCloseButton,\n };\n\n const classNames = getClassNames(styles, stylesProps);\n const calloutStyles = classNames.subComponentStyles\n ? (classNames.subComponentStyles as ITeachingBubbleSubComponentStyles).callout\n : undefined;\n\n return (\n <Callout\n target={target || targetElement}\n onDismiss={onDismiss}\n {...calloutProps}\n className={classNames.root}\n styles={calloutStyles}\n hideOverflow\n >\n <div ref={this.rootElement}>\n <TeachingBubbleContent {...this.props} />\n </div>\n </Callout>\n );\n }\n}\n"]}
\No newline at end of file