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AY,CAAC,CAAC;QAEtC,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE;YACpB,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE;YACxC,YAAY,EAAE,MAAM;SACrB,CAAC,CAAC,IAAI,CAAC,UAAA,QAAQ;YACd,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YACvC,MAAM,CAAC,IAAI,EAAE,cAAY,EAAE,SAAI,OAAO,CAAC,QAAU,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,qCAAM,GAAb;QACQ,IAAA,eAAmD,EAAjD,wBAAS,EAAE,kBAAM,EAAE,gBAAK,EAAE,sBAAuB,CAAC;QAClD,IAAA,8BAAQ,CAAgB;QAChC,IAAM,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,KAAM,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC;QAEvE,OAAO,CACL,oBAAC,MAAM,IAAC,SAAS,EAAE,aAAW,UAAU,CAAC,IAAM;YAC7C,oBAAC,UAAU,IAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,GAAI,CAC5C,CACV,CAAC;IACJ,CAAC;IAjFa,iCAAY,GAAG;QAC3B,QAAQ,EAAE,IAAI;KACf,CAAC;IAgFJ,2BAAC;CAAA,AAnFD,CAA0C,KAAK,CAAC,aAAa,GAmF5D;SAnFY,oBAAoB\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport * as React from 'react';\r\nimport { Fabric } from 'office-ui-fabric-react/lib/Fabric';\r\nimport Axios from 'axios';\r\nimport { classNamesFunction } from 'office-ui-fabric-react/lib/Utilities';\r\nimport { CommandBar } from 'office-ui-fabric-react/lib/CommandBar';\r\nimport { saveAs } from 'file-saver';\r\nimport './ExportCommandBar.css';\r\nvar getClassNames = classNamesFunction();\r\nvar ExportCommandBarBase = (function (_super) {\r\n    tslib_1.__extends(ExportCommandBarBase, _super);\r\n    function ExportCommandBarBase(props) {\r\n        var _this = _super.call(this, props) || this;\r\n        _this.state = {\r\n            cmdItems: [],\r\n            error: undefined\r\n        };\r\n        return _this;\r\n    }\r\n    ExportCommandBarBase.prototype.componentDidMount = function () {\r\n        var _this = this;\r\n        var _a = this.props, url = _a.url, id = _a.id, items = _a.items, iconOnly = _a.iconOnly;\r\n        var mainUrl = url + \"/export/\" + id;\r\n        Axios.get(mainUrl)\r\n            .then(function (response) {\r\n            var newItems = [];\r\n            response.data.items.forEach(function (item) {\r\n                var cmdBarItem = {\r\n                    key: item.key,\r\n                    name: item.label,\r\n                    iconProps: {\r\n                        iconName: item.icon\r\n                    },\r\n                    iconOnly: iconOnly,\r\n                    onClick: function () { return _this.executeCommand(item, id); }\r\n                };\r\n                newItems.push(cmdBarItem);\r\n            });\r\n            if (items) {\r\n                items.forEach(function (item) {\r\n                    item.iconOnly = iconOnly;\r\n                    item.key = item.key + id;\r\n                    newItems.push(item);\r\n                });\r\n            }\r\n            _this.setState({\r\n                cmdItems: newItems\r\n            });\r\n        })\r\n            .catch(function (error) { return _this.setState({ error: error }); });\r\n    };\r\n    ExportCommandBarBase.prototype.executeCommand = function (command, id) {\r\n        var url = this.props.url;\r\n        var idsUriValues = undefined;\r\n        var selection = this.props.selection.getSelection();\r\n        if (selection) {\r\n            selection.forEach(function (item) {\r\n                idsUriValues = idsUriValues ? idsUriValues + (\"&ids=\" + item.key) : \"?ids=\" + item.key;\r\n            });\r\n        }\r\n        var commandUrl = url + \"/\" + command.urlCommand + \"/\" + id + \"/\" + command.fileType + idsUriValues;\r\n        console.log(\"Invoking \" + commandUrl);\r\n        Axios.get(commandUrl, {\r\n            headers: { accept: command.contentType },\r\n            responseType: 'blob'\r\n        }).then(function (response) {\r\n            var blob = new Blob([response.data]);\r\n            saveAs(blob, \"Exported_\" + id + \".\" + command.fileType);\r\n        });\r\n    };\r\n    ExportCommandBarBase.prototype.render = function () {\r\n        var _a = this.props, className = _a.className, styles = _a.styles, theme = _a.theme, farItems = _a.farItems;\r\n        var cmdItems = this.state.cmdItems;\r\n        var classNames = getClassNames(styles, { theme: theme, className: className });\r\n        return (React.createElement(Fabric, { className: \"ms-Grid \" + classNames.root },\r\n            React.createElement(CommandBar, { farItems: farItems, items: cmdItems })));\r\n    };\r\n    ExportCommandBarBase.defaultProps = {\r\n        iconOnly: true\r\n    };\r\n    return ExportCommandBarBase;\r\n}(React.PureComponent));\r\nexport { ExportCommandBarBase };\r\n//# sourceMappingURL=ExportCommandBar.base.js.map","dts":{"name":"C:/WORK/ImageTag/Tests/react-ktx-3530/dist/types/lib/components/ExportCommandBar/ExportCommandBar.base.d.ts","writeByteOrderMark":false,"text":"import * as React from 'react';\r\nimport { ICommandBarItemProps } from 'office-ui-fabric-react/lib/CommandBar';\r\nimport { IExportCommandBarProps } from './ExportCommandBar.types';\r\nimport './ExportCommandBar.css';\r\nexport interface IExportCommandBarState {\r\n    cmdItems: ICommandBarItemProps[];\r\n    error: any;\r\n}\r\nexport declare class ExportCommandBarBase extends React.PureComponent<IExportCommandBarProps, IExportCommandBarState> {\r\n    static defaultProps: {\r\n        iconOnly: boolean;\r\n    };\r\n    constructor(props: IExportCommandBarProps);\r\n    componentDidMount(): void;\r\n    private executeCommand;\r\n    render(): JSX.Element;\r\n}\r\n"}}
