{"version":3,"sources":["webpack:///src/utils/classnames.ts?8f2b","webpack:///src/components/container-background-image/container-background-image-helper.ts?d691","webpack:///src/components/container-background-image/container-backgroud-image.tsx?89dd","webpack:///src/components/base-components.tsx?5f88","webpack:///./lib/default-container/module-registration.js?41a8","webpack:///external \"React\"?c481","webpack:///external \"ReactDOM\"?4b2d","webpack:///src/modules/default-container/default-container.tsx?4334"],"names":["sizePattern","getColumnSizes","config","size","exec","cols","split","slice","translatedSize","prefix","toLowerCase","translatePrefix","sizePrefix","map","colWidth","showErrors","context","isDebug","isEditor","request","params","getColClassArray","options","xsmall","small","medium","large","filter","Boolean","colWidths","Map","getBackgroundRepeatProperty","repeat","getBackgroundSizeProperty","buildBackgroundImageStylesByViewport","props","containerType","image","configs","gridSettings","imageSettings","styles","largestGridSettingViewportName","getLargestGridSettingViewportName","authoringViewPorts","moduleName","layout","msdyn365Commerce","isBrowser","authoringHelper","window","_msdyn365","constructViewportInformationForImage","themeSettings","getAuthoringViewport","imgSettings","viewports","xs","w","h","sm","md","lg","xl","skipWidthAndHeightSettings","Object","keys","vp","viewport","minMaxWidth","getMinMaxWidth","urlSrc","getImageResizeUrl","src","externalProvider","apiSettings","maxWidth","max","minWidth","min","minHeight","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","setStyleAttribute","currentStyle","style","undefined","getDataBgSetAttribute","dataBgSetAttributes","push","join","BackgroundImage","React","constructor","state","super","this","stylesByViewport","_getCurrentStyle","mounted","_componentResize","bind","updateAttributes","componentDidMount","addEventListener","componentWillUnmount","removeEventListener","shouldComponentUpdate","nextProps","nextState","render","children","processedAtributes","_processAttributes","_isLazyload","attributes","_getAttributes","className","_getDefaultAttributes","lazyLoad","role","getBackgroundImageLazyloadAttributes","getBackgroundImageAttributes","selectedStyle","setState","winInnerWidth","innerWidth","Number","MAX_SAFE_INTEGER","_getDefaultStyle","disableLazyLoad","getContainerType","Container","typeName","id","backgroundImageRepeat","backgroundImageSize","moduleLayout","customClassName","containerContent","HeadingComponent","tag","headingText","textSize","Tag","classNameWithHeading","Text","text","editProps","onEdit","handleTextChange","requestContext","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","__bindings__","module","exports","ReactDOM","DefaultContainer","event","heading","target","value","slots","telemetry","data","log","LogLevel","Debug","values","headingProps","msdyn365__moduleLayout","content","index","_getChildColClassName","key","childrenWidth","_getWidthClass","s","get"],"mappings":";oPASA,MAAMA,EAAc,2BAmCPC,EAAiB,CAACC,EAAgBC,KAC3C,IAAKH,EAAYI,KAAKF,GAClB,OAAO,EAEX,MAAMG,EAAOH,EAAOI,MAAM,KAAKC,MAAM,GAC/BC,EA1BeC,KACrB,OAAQA,GAAUA,EAAOC,eACrB,IAAK,QACD,MAAO,KACX,IAAK,SACD,MAAO,KACX,IAAK,QACD,MAAO,KACX,IAAK,SACL,QACI,MAAO,KAgBQC,CAAgBR,GACjCS,EAAcJ,GAAc,WAAQA,IAAqB,GAC/D,OAAOH,EAAKQ,IAAKC,GAAD,aAA4BF,EAA5B,YAA0CE,KAGjDC,EAAcC,IACvB,MAAM,QAAEC,EAAF,SAAWC,GAAiCF,GAAWA,EAAQG,SAAWH,EAAQG,QAAQC,QAAW,GAC3G,QAASH,KAAaC,GAMbG,EAAoBC,GAEzB,CACIA,EAAQC,QAAUtB,EAAeqB,EAAQC,QACzCD,EAAQE,OAASvB,EAAeqB,EAAQE,MAAO,SAC/CF,EAAQG,QAAUxB,EAAeqB,EAAQG,OAAQ,UACjDH,EAAQI,OAASzB,EAAeqB,EAAQI,MAAO,UACjDC,OAAOC,SAGJC,EAAY,IAAIC,IAAoB,CAC7C,CAAC,MAAO,YACR,CAAC,MAAO,YACR,CAAC,QAAS,YACV,CAAC,OAAQ,YACT,CAAC,MAAO,YACR,CAAC,SAAU,gB,myBCrDf,MAAMC,EAA8B,CAAC5B,EAA0B6B,KAC3D,IAAK7B,GAAiB,UAATA,EACT,MAAO,YAEX,OAAQ6B,GACJ,IAAK,WACD,MAAO,YACX,IAAK,S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,EAA2BwE,IAEtC3F,uBAAKyB,UAAWrB,KAAKwF,wBAAyBC,IAAKF,GAC9CxE,KAUrByE,wBACJ,MACIxL,QAAQ,OAAE4C,EAAF,cAAU8I,IAClB1F,KAAK/D,MACT,OAAQW,GACJ,IAAI,OACA,MAAoB,SAAb8I,EAA2C,gBAAkB1F,KAAK2F,eAAeD,GAC5F,IAAI,UACJ,QACI,MAAO,UAIXC,eAAeC,GACnB,OAAOjK,IAAUkK,IAAID,GAAC,SAA+B,UAI9CpB,c","file":"static/js/70.4961ddb98bcf483eac8c.chunk.js","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport * as twoSlots from '../modules/default-container-2-slots/default-container-2-slots.props.autogenerated';\nimport * as threeSlots from '../modules/default-container-3-slots/default-container-3-slots.props.autogenerated';\n\nconst sizePattern = /col(_(\\d|auto){1,2}){2,}/;\n\nexport interface IShowErrorOptions {\n isDebug?: boolean;\n isEditor?: boolean;\n}\n\nexport interface IViewPortOptions {\n xsmall?: threeSlots.xsmall | twoSlots.xsmall;\n small?: threeSlots.small | twoSlots.small;\n medium?: threeSlots.medium | twoSlots.medium;\n large?: threeSlots.large | twoSlots.large;\n}\n\nconst translatePrefix = (prefix: `large` | `medium` | `small` | `xsmall` | undefined) => {\n switch (prefix && prefix.toLowerCase()) {\n case 'large':\n return 'lg';\n case 'medium':\n return 'md';\n case 'small':\n return 'sm';\n case 'xsmall':\n default:\n return '';\n }\n};\n\n/**\n * converts config option and size to bootstrap col class name\n * If size is auto or config option is invalid col-auto will be returned\n * If size is xsmall or size is invalid col-{config} will be returned\n * @param config configuration option e.g. col_12_12\n * @param size bootstrap gridsize\n */\nexport const getColumnSizes = (config: string, size?: `large` | `medium` | `small` | `xsmall`): string[] | boolean => {\n if (!sizePattern.exec(config)) {\n return false;\n }\n const cols = config.split('_').slice(1);\n const translatedSize = translatePrefix(size);\n const sizePrefix = (translatedSize && `-${translatedSize}`) || '';\n return cols.map((colWidth: string) => `col${sizePrefix}-${colWidth}`);\n};\n\nexport const showErrors = (context?: ICoreContext): Boolean => {\n const { isDebug, isEditor }: IShowErrorOptions = (context && context.request && context.request.params) || {};\n return !!isDebug || !!isEditor;\n};\n\n/**\n * Converts viewport configuration into a two dimensional array of class names\n */\nexport const getColClassArray = (options: IViewPortOptions): string[][] =>\n (\n [\n options.xsmall && getColumnSizes(options.xsmall),\n options.small && getColumnSizes(options.small, 'small'),\n options.medium && getColumnSizes(options.medium, 'medium'),\n options.large && getColumnSizes(options.large, 'large')\n ].filter(Boolean)\n );\n\nexport const colWidths = new Map([\n ['one', 'col-md-1'],\n ['two', 'col-md-2'],\n ['three', 'col-md-3'],\n ['four', 'col-md-4'],\n ['six', 'col-md-6'],\n ['twelve', 'col-md-12']\n]);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, {\n constructViewportInformationForImage,\n getImageResizeUrl,\n getLargestGridSettingViewportName,\n getMinMaxWidth,\n IAny,\n IGeneric,\n IViewPort,\n Viewport\n} from '@msdyn365-commerce/core-internal';\nimport { cloneDeep as _cloneDeep } from 'lodash';\nimport {\n BackgroundImageRepeat,\n BackgroundImageSize,\n IBackgroundImageAttributes,\n IBackgroundImageLazyloadAttributes,\n IBackgroundImageProps,\n IBackgroundImageStyle\n} from './container-background-image-interfaces';\n\nconst getBackgroundRepeatProperty = (size: string | undefined, repeat: string | undefined): BackgroundImageRepeat => {\n if (!size || size === 'cover') {\n return 'no-repeat';\n }\n switch (repeat) {\n case 'noRepeat':\n return 'no-repeat';\n case 'repeat':\n return 'repeat';\n default:\n return 'no-repeat';\n }\n};\n\nconst getBackgroundSizeProperty = (size: string | undefined): BackgroundImageSize => {\n switch (size) {\n case 'cover':\n return 'cover';\n case 'contain':\n return 'contain';\n case 'default':\n default:\n return undefined;\n }\n};\n\nconst getDefaultViewports = (): IViewPort => {\n return {\n xs: {\n w: 800,\n h: 600\n },\n sm: {\n w: 1200,\n h: 900\n },\n md: {\n w: 1600,\n h: 900\n },\n lg: {\n w: 1600,\n h: 700\n },\n xl: {\n w: 1600,\n h: 700\n }\n };\n};\n\nconst getAuthoringViewport = (moduleName: string | undefined, layout: string | undefined): IViewPort | undefined => {\n if (!msdyn365Commerce.isBrowser) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const authoringHelper = (window as any)._msdyn365.authoringHelper;\n if (!authoringHelper) {\n return;\n }\n\n // if authoring helper is setup, component is rendering from site builder. Build viewport based on layout selected.\n return constructViewportInformationForImage(moduleName, layout, 'backgroundImage', authoringHelper?.themeSettings) as IViewPort;\n};\n\nexport const buildBackgroundImageStylesByViewport = (props: IBackgroundImageProps): IGeneric => {\n const { containerType, image, request, configs } = props;\n\n const gridSettings = request.gridSettings ?? {};\n const imageSettings = image.imageSettings;\n\n const styles: IGeneric = {};\n\n const largestGridSettingViewportName = getLargestGridSettingViewportName(gridSettings);\n if (largestGridSettingViewportName && imageSettings) {\n // in site builder the layout may change, so use authoring viewports.\n const authoringViewPorts = getAuthoringViewport(containerType, configs?.layout);\n const imgSettings = {\n ...imageSettings,\n viewports: { ..._cloneDeep(authoringViewPorts || imageSettings.viewports || getDefaultViewports()) }\n };\n\n // Skip resizing width and height for background images.\n const skipWidthAndHeightSettings = true;\n Object.keys(imgSettings.viewports).map(vp => {\n const viewport = vp as Viewport;\n const minMaxWidth = getMinMaxWidth(gridSettings, imgSettings, viewport, largestGridSettingViewportName);\n const urlSrc = getImageResizeUrl(\n image.src,\n imgSettings.viewports[viewport],\n imgSettings,\n skipWidthAndHeightSettings,\n image?.externalProvider,\n request?.apiSettings\n );\n styles[viewport] = {\n maxWidth: minMaxWidth.max,\n minWidth: minMaxWidth.min,\n minHeight: imgSettings.viewports[viewport]?.h,\n backgroundImage: urlSrc,\n backgroundRepeat: getBackgroundRepeatProperty(configs?.size, configs?.repeat),\n backgroundSize: getBackgroundSizeProperty(configs?.size),\n backgroundPosition: 'center center'\n };\n });\n }\n\n return styles;\n};\n\nexport const setStyleAttribute = (currentStyle: IBackgroundImageStyle): IGeneric => {\n let style: IGeneric = {};\n if (currentStyle) {\n style = { ...currentStyle };\n style['minWidth'] = undefined;\n style['width'] = '100%';\n if (currentStyle.backgroundImage) {\n style['backgroundImage'] = `url('${currentStyle.backgroundImage}')`;\n }\n }\n return style;\n};\n\nexport const getBackgroundImageLazyloadAttributes = (\n className: string,\n currentStyle: IBackgroundImageStyle | undefined,\n styles: IGeneric\n): IBackgroundImageLazyloadAttributes => {\n const attributes = {\n role: 'img',\n className: `${className} lazyload`,\n 'data-bgset': getDataBgSetAttribute(styles)\n };\n\n if (currentStyle) {\n attributes['style'] = setStyleAttribute(currentStyle);\n // On lazyload, lazysizes plugin should pick which background image to use based on data-bgset attribute.\n attributes['style']['backgroundImage'] = undefined;\n }\n return attributes;\n};\n\nexport const getBackgroundImageAttributes = (\n className: string,\n currentStyle: IBackgroundImageStyle | undefined\n): IBackgroundImageAttributes => {\n const attributes = {\n role: 'img',\n className\n };\n\n if (currentStyle) {\n attributes['style'] = setStyleAttribute(currentStyle);\n }\n return attributes;\n};\n\nexport const getBgSetMinMaxWidthAttribute = (style: IBackgroundImageStyle): string => {\n if (style.maxWidth) {\n return `[(max-width: ${style.maxWidth}px)]`;\n }\n return '';\n};\n\nexport const getDataBgSetAttribute = (styles: IGeneric): string => {\n const dataBgSetAttributes: string[] = [];\n Object.keys(styles).map(vp => {\n if (styles[vp].backgroundImage) {\n dataBgSetAttributes.push(`${styles[vp].backgroundImage} ${getBgSetMinMaxWidthAttribute(styles[vp])}`);\n }\n });\n\n return dataBgSetAttributes.join(' | ');\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, { getLargestGridSettingViewportName, IGeneric } from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\nimport { isEqual as _isEqual } from 'lodash';\nimport {\n buildBackgroundImageStylesByViewport,\n getBackgroundImageAttributes,\n getBackgroundImageLazyloadAttributes\n} from './container-background-image-helper';\nimport {\n IBackgroundImageAttributes,\n IBackgroundImageProps,\n IBackgroundImageState,\n IBackgroundImageStyle\n} from './container-background-image-interfaces';\n\nconst BACKGROUND_IMAGE_CLASS_NAME = 'ms-container-background-image';\n\n/**\n * BackgroundImage component\n * @extends {React.PureComponent}\n */\nexport class BackgroundImage extends React.PureComponent {\n private stylesByViewport: IGeneric;\n private currentStyle: IBackgroundImageStyle | undefined;\n private mounted: boolean;\n\n constructor(props: IBackgroundImageProps, state: IBackgroundImageState) {\n super(props);\n this.stylesByViewport = buildBackgroundImageStylesByViewport(this.props);\n this.currentStyle = this._getCurrentStyle();\n this.mounted = false;\n this._componentResize = this._componentResize.bind(this);\n this._getCurrentStyle = this._getCurrentStyle.bind(this);\n this.state = { updateAttributes: false };\n }\n\n public componentDidMount(): void {\n if (msdyn365Commerce.isBrowser) {\n window.addEventListener('resize', this._componentResize);\n this.mounted = true;\n this._componentResize();\n }\n }\n\n public componentWillUnmount(): void {\n if (msdyn365Commerce.isBrowser) {\n window.removeEventListener('resize', this._componentResize);\n this.mounted = false;\n }\n }\n\n public shouldComponentUpdate(nextProps: IBackgroundImageProps, nextState: { updateAttributes: boolean }): boolean {\n if (\n this.state !== nextState ||\n this.props.request?.gridSettings !== nextProps.request?.gridSettings ||\n this.props.configs.repeat !== nextProps.configs.repeat ||\n this.props.configs.size !== nextProps.configs.size ||\n this.props.configs.layout !== nextProps.configs.layout ||\n this.props.image?.imageSettings !== nextProps.image?.imageSettings ||\n this.props.image?.src !== nextProps.image?.src\n ) {\n return true;\n }\n return false;\n }\n\n public render(): JSX.Element | null {\n const { children } = this.props;\n\n try {\n this.stylesByViewport = buildBackgroundImageStylesByViewport(this.props);\n this.currentStyle = this._getCurrentStyle();\n\n if (this.currentStyle) {\n const processedAtributes = this._processAttributes(\n BACKGROUND_IMAGE_CLASS_NAME,\n this.currentStyle,\n this.stylesByViewport,\n this._isLazyload()\n );\n const attributes = this._getAttributes(processedAtributes);\n if (this.state.updateAttributes) {\n // Update component with the latest attributes.\n return
{children}
;\n } else if (this._isLazyload()) {\n // On lazyload, only include the class name on the first render.\n return
{children}
;\n } else {\n // On lazyload disabled, render the default attributes from server side.\n return
{children}
;\n }\n } else {\n // in no style is found, return the container content.\n return <>{children};\n }\n } catch {\n // in case of any failure, return the container content.\n return <>{children};\n }\n }\n\n private _processAttributes(\n className: string,\n currentStyle: IBackgroundImageStyle,\n stylesByViewport: IGeneric,\n lazyLoad: boolean\n ) {\n if (lazyLoad) {\n return getBackgroundImageLazyloadAttributes(className, currentStyle, stylesByViewport);\n } else {\n return getBackgroundImageAttributes(className, currentStyle);\n }\n }\n\n private _getAttributes(processedAtributes: IBackgroundImageAttributes) {\n return { ...processedAtributes, style: { ...processedAtributes?.style } };\n }\n\n private _componentResize(): void {\n if (msdyn365Commerce.isBrowser) {\n const selectedStyle = this._getCurrentStyle();\n\n if (this.mounted || (selectedStyle && !_isEqual(this.currentStyle, selectedStyle))) {\n this.setState({ updateAttributes: true });\n }\n }\n }\n\n private _getCurrentStyle(): IBackgroundImageStyle | undefined {\n if (msdyn365Commerce.isBrowser) {\n const winInnerWidth: number = window.innerWidth;\n let selectedStyle: IBackgroundImageStyle | undefined;\n Object.keys(this.stylesByViewport).map(vp => {\n if (\n (this.stylesByViewport[vp]?.minWidth || this.stylesByViewport[vp]?.maxWidth) &&\n (this.stylesByViewport[vp]?.minWidth || 0) <= winInnerWidth &&\n winInnerWidth <= (this.stylesByViewport[vp]?.maxWidth || Number.MAX_SAFE_INTEGER)\n ) {\n selectedStyle = this.stylesByViewport[vp];\n }\n });\n return selectedStyle;\n } else {\n return this._getDefaultStyle();\n }\n }\n\n private _isLazyload(): boolean {\n // Lazyload by default if nothing is specified\n return !this.props.image?.imageSettings?.disableLazyLoad;\n }\n\n private _getDefaultStyle(): IBackgroundImageStyle | undefined {\n const { request } = this.props;\n const largestGridSettingViewportName = getLargestGridSettingViewportName(request.gridSettings ?? {});\n return this.stylesByViewport[largestGridSettingViewportName];\n }\n\n private _getDefaultAttributes(): IBackgroundImageAttributes {\n const style = this._getDefaultStyle();\n const processedAtributes = style\n ? this._processAttributes(BACKGROUND_IMAGE_CLASS_NAME, style, this.stylesByViewport, this._isLazyload())\n : {};\n return this._getAttributes(processedAtributes);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ContentEditableEvent, IImageData, IRequestContext, Text } from '@msdyn365-commerce/core';\nimport * as React from 'react';\nimport { BackgroundImage } from './container-background-image/container-backgroud-image';\n\n/**\n * Heading options\n */\nexport interface IHeadingComponentProps {\n /**\n * Heading text\n */\n headingText?: string;\n /**\n * Heading tag (h1, h2, h3, h4, h5, h6)\n */\n tag?: HeadingTag;\n /**\n * Heading text size (sm, md, lg, xl)\n */\n textSize?: TextSize;\n\n requestContext: IRequestContext;\n\n handleTextChange(event: ContentEditableEvent): string;\n}\n\nexport type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\nexport type TextSize = 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Container class options\n */\nexport interface IContainerProps {\n /**\n * CSS class name\n */\n className?: string;\n /**\n * Bootstrap supported container types\n */\n containerType?: string;\n /**\n * type name\n */\n typeName?: string;\n /**\n * id of container\n */\n id?: string;\n /**\n * React children\n */\n children: React.ReactNode;\n /**\n * Request context\n */\n request?: IRequestContext;\n /**\n * background image\n */\n backgroundImage?: IImageData;\n /**\n * background image repeat property\n */\n backgroundImageRepeat?: string;\n /**\n * background image size property\n */\n backgroundImageSize?: string;\n /**\n * module layout property\n */\n moduleLayout?: string;\n}\n\nconst getContainerType = (containerType: string | undefined) => {\n switch (containerType) {\n case 'container':\n return 'container';\n case 'fluid':\n default:\n return 'fluid';\n }\n};\n\n/**\n * HOC to create bootstrap container div. If no container type is specified children are rendered.\n * @param options IContainerClasses\n */\nexport const Container: React.SFC = (props: IContainerProps): JSX.Element => {\n const {\n containerType,\n className,\n typeName,\n id,\n children,\n backgroundImage,\n request,\n backgroundImageRepeat,\n backgroundImageSize,\n moduleLayout\n } = props;\n const customClassName = className ? ` ${className}` : '';\n\n let containerContent = children;\n if (containerType) {\n containerContent =
{containerContent}
;\n }\n\n if (backgroundImage && backgroundImage.src && backgroundImage.imageSettings && request) {\n containerContent = (\n \n {containerContent}\n \n );\n }\n\n return containerType ? (\n
{containerContent}
\n ) : (\n
{containerContent}
\n );\n};\n\nexport const HeadingComponent = (props: IHeadingComponentProps & { className: string }): JSX.Element | null => {\n const { tag, headingText, textSize, className } = props;\n const Tag = tag || 'h2';\n const classNameWithHeading = textSize ? `heading ${textSize} ${className}` : `heading ${className}`;\n return (\n (headingText && (\n \n )) ||\n null\n );\n};\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['default-container'] = {\n c: () => require('@msdyn365-commerce-modules/core-components/dist/lib/modules/default-container/default-container'),\n $type: 'containerModule',\n da: [],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'default-container',\n p: 'core-components',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/core-components/dist/lib/modules/default-container'\n });\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };","module.exports = React;","module.exports = ReactDOM;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ContentEditableEvent } from '@msdyn365-commerce/core';\nimport { LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport * as React from 'react';\nimport { Container, HeadingComponent, IHeadingComponentProps } from '../../components/base-components';\nimport { colWidths } from '../../utils/classnames';\nimport { IDefaultContainerData } from './default-container.data';\nimport { childrenWidth as childrenWidthEnum, IDefaultContainerProps, layout as layoutEnum } from './default-container.props.autogenerated';\n\n/**\n *\n * CoreComponent component\n * @extends {React.PureComponent>}\n */\nclass DefaultContainer extends React.PureComponent> {\n constructor(props: IDefaultContainerProps) {\n super(props);\n }\n\n public render(): JSX.Element {\n const { slots, telemetry, config, data } = this.props;\n telemetry.log(LogLevel.Debug, \"Default Container rendering for '{id}/{typeName}'\", {\n values: [this.props.id, this.props.typeName]\n });\n\n const heading = config.heading || data.heading;\n const headingProps: IHeadingComponentProps = {\n ...heading,\n handleTextChange: this.handleTextChange,\n requestContext: this.props.context.request\n };\n\n return (\n \n {heading && }\n {slots &&\n slots.content &&\n slots.content.map((children: React.ReactNode, index: number) => {\n return (\n
\n {children}\n
\n );\n })}\n \n );\n }\n\n public handleTextChange = (event: ContentEditableEvent) => (this.props.config.heading!.headingText = event.target.value);\n\n private _getChildColClassName(): string {\n const {\n config: { layout, childrenWidth }\n } = this.props;\n switch (layout) {\n case layoutEnum.flow:\n return childrenWidth === childrenWidthEnum.auto ? 'col-12 col-md' : this._getWidthClass(childrenWidth);\n case layoutEnum.stacked:\n default:\n return 'col-12';\n }\n }\n\n private _getWidthClass(s?: childrenWidthEnum): string {\n return colWidths.get(s || childrenWidthEnum.four) || 'col-12';\n }\n}\n\nexport default DefaultContainer;\n"],"sourceRoot":""}