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AAM,oBAAsBH,EAAsB,mCAEhEjB,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUC,eAAiBL,EACxEjB,EAAQE,YAAYe,GAAqBE,QAAQE,UAAU1C,KAC3DqB,EAAQE,YAAYF,EAAQE,YAAYe,GAAqBE,QAAQE,UAAU1C,IAAMsC,IA0BzFD,CAF4B,6EACXZ,EAAQ,MAMjCmB,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAavB,QAAOhC,EAAAA,EAAA,GACpBsD,OAAOC,aAAavB,SAAW,IAC/BD,EAAQC,SAGXsB,OAAOC,aAAatB,YAAWjC,EAAAA,EAAA,GAC5BsD,OAAOC,aAAatB,aAAe,IACnCF,EAAQE,aAEY,MAAMuB,EAAiB,GAC9BA,EAAe,yEAA2E,CAClGtB,EAAGA,IAAMC,EAAQ,MACjBsB,GAAI,4CAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaC,eAAcxD,EAAAA,EAAA,GACPsD,OAAOC,aAAaC,gBAAkB,IACtCA,6HCzEpB,SAASE,EAAoB9D,GAChC,OAAO,IAAI+D,EAAAA,aAA8B,iBAAkB/D,EAAQ,mBAGvE,MAIagE,GAA6BC,EAAAA,EAAAA,IAA2B,CACjEC,OAAkCC,EAAAA,iBAClCC,MANgCC,IACzBP,EAAoB,MAQ/B,WCvBAQ,EAAOC,QAAU9F,cCAjB6F,EAAOC,QAAUC","sources":["webpack://henrys-ecommerce/./src/modules/conditional-tab-item/conditional-tab-item.tsx?e3ee","webpack://henrys-ecommerce/./src/modules/conditional-tab-item/conditional-tab-item.view.tsx?2f00","webpack://henrys-ecommerce/./lib/conditional-tab-item/module-registration.js?cf0f","webpack://henrys-ecommerce/./src/data-actions/tab-state-data-action.ts?09b4","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { IModuleProps, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IConditionalTabItemData } from './conditional-tab-item.data';\r\nimport { IConditionalTabItemProps } from './conditional-tab-item.props.autogenerated';\r\n\r\nexport interface IConditionalTabItemContentProps {\r\n onVisibilityChange(visibilityState: VisibilityState): void;\r\n}\r\n\r\nexport interface ITabItemViewProps extends IConditionalTabItemContentProps {\r\n TabContentContainer: IModuleProps;\r\n TabHeaderContainer: IModuleProps;\r\n tabSlots: INodeProps;\r\n TabItemContent: INodeProps;\r\n tabItemType?: TabItemType;\r\n tabHeader: React.ReactNode;\r\n}\r\n\r\nexport interface ITabItemExtentedProps extends IConditionalTabItemProps {\r\n tabItemType?: TabItemType;\r\n isSelected?: boolean;\r\n itemIndex?: number;\r\n tabId?: string;\r\n onVisibilityChange?(itemIndex: number, visibilityState: VisibilityState): void;\r\n}\r\n\r\nexport enum TabItemType {\r\n TabHeader,\r\n TabContent\r\n}\r\n\r\n/**\r\n *\r\n * TabItem component.\r\n * @extends {React.Component}\r\n */\r\n@observer\r\nclass ConditionalTabItem extends React.Component {\r\n private readonly moduleContentClassName: string = 'ms-tab-item-content';\r\n\r\n private readonly moduleHeaderClassName: string = 'ms-tab-item-header';\r\n\r\n constructor(props: IConditionalTabItemProps) {\r\n super(props);\r\n this._renderTabHeader = this._renderTabHeader.bind(this);\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { slots, renderView, config, data, isSelected, itemIndex, onVisibilityChange } = this.props;\r\n const index = itemIndex || 0;\r\n const contentID = getContentID(index, this.props.tabId || '');\r\n const activeContentIDResult = data && data.activeTabState && data.activeTabState.result;\r\n const shown =\r\n activeContentIDResult &&\r\n activeContentIDResult.tabId === this.props.tabId &&\r\n activeContentIDResult.activeContentIndex !== undefined\r\n ? activeContentIDResult.activeContentIndex === index\r\n : isSelected || false;\r\n const viewProps = {\r\n ...this.props,\r\n TabContentContainer: {\r\n moduleProps: this.props,\r\n className: classnames(this.moduleContentClassName, config.className)\r\n },\r\n TabHeaderContainer: {\r\n moduleProps: this.props,\r\n className: classnames(this.moduleHeaderClassName, config.className)\r\n },\r\n TabItemContent: {\r\n className: 'ms-tab-item-content__content',\r\n tag: 'section' as NodeTag,\r\n 'aria-hidden': !shown,\r\n role: 'tabpanel',\r\n tabIndex: shown ? 0 : -1,\r\n id: contentID\r\n },\r\n tabHeader: this._renderTabHeader(),\r\n tabSlots: slots,\r\n onVisibilityChange: (visibilityState: VisibilityState) => onVisibilityChange && onVisibilityChange(index, visibilityState)\r\n };\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _renderTabHeader(): React.ReactNode {\r\n return <>{this.props.config.tabItemTitle};\r\n }\r\n}\r\n\r\nexport const getContentID = (index: number, id: string) => {\r\n return `tab-item-content-${id}-${index}`;\r\n};\r\n\r\nexport default ConditionalTabItem;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { ITabItemViewProps, TabItemType } from './conditional-tab-item';\r\n\r\nconst ConditionalTabItemView: React.FC = (props: ITabItemViewProps) => {\r\n const { tabItemType, tabSlots, TabContentContainer, TabHeaderContainer, TabItemContent, tabHeader, onVisibilityChange } = props;\r\n\r\n switch (tabItemType) {\r\n case TabItemType.TabContent:\r\n return (\r\n \r\n \r\n {tabSlots &&\r\n tabSlots.tabItemContent &&\r\n tabSlots.tabItemContent.length &&\r\n _renderTabItemContent(tabSlots.tabItemContent, onVisibilityChange)}\r\n \r\n \r\n );\r\n case TabItemType.TabHeader:\r\n return {tabHeader};\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nconst _renderTabItemContent = (\r\n items: React.ReactNode[],\r\n onVisibilityChange: (visibilityState: VisibilityState) => void\r\n): JSX.Element | null => {\r\n return (\r\n <>\r\n {items && items.length > 0\r\n ? items.map((item: React.ReactNode, index: number) => {\r\n return (\r\n \r\n {React.cloneElement(item as React.ReactElement, {\r\n onVisibilityChange\r\n })}\r\n \r\n );\r\n })\r\n : null}\r\n \r\n );\r\n};\r\nexport default ConditionalTabItemView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['conditional-tab-item'] = {\n c: () => require('partner/modules/conditional-tab-item/conditional-tab-item.tsx'),\n $type: 'containerModule',\n da: [{name:'activeTabState', path:'@msdyn365-commerce-modules/tab/dist/lib/data-actions/tab-state-data-action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'conditional-tab-item',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/conditional-tab-item'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/tab/dist/lib/data-actions/tab-state-data-action';\n let dataAction = require('@msdyn365-commerce-modules/tab/dist/lib/data-actions/tab-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\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 };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|conditional-tab-item|conditional-tab-item'] = {\n c: () => require('partner/modules/conditional-tab-item/conditional-tab-item.view.tsx'),\n cn: '__local__-__local__-conditional-tab-item'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IActiveTabState } from './tab-state';\n\nexport function createTabStateInput(result: IActiveTabState): GenericInput {\n return new GenericInput('activeTabState', result, 'IActiveTabState');\n}\n\nconst createTabStateInputInternal = (): IActionInput => {\n return createTabStateInput({});\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createTabStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["TabItemType","ConditionalTabItem","React","constructor","props","super","moduleContentClassName","moduleHeaderClassName","this","_renderTabHeader","bind","render","slots","renderView","config","data","isSelected","itemIndex","onVisibilityChange","index","contentID","getContentID","tabId","activeContentIDResult","activeTabState","result","shown","undefined","activeContentIndex","_objectSpread","TabContentContainer","moduleProps","className","classnames","TabHeaderContainer","TabItemContent","tag","role","tabIndex","id","tabHeader","tabSlots","visibilityState","tabItemTitle","__decorate","observer","_renderTabItemContent","items","length","map","item","key","tabItemType","TabContent","Module","Object","assign","Node","tabItemContent","TabHeader","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","window","__bindings__","viewDictionary","cn","createTabStateInput","GenericInput","getGenericActionDataAction","createObservableDataAction","action","getGenericAction","input","createTabStateInputInternal","module","exports","ReactDOM"],"sourceRoot":""}