From b6fcd95bb64fdc2bd05b4d296883c8d4ce0609e1 Mon Sep 17 00:00:00 2001 From: pofider Date: Tue, 25 Feb 2020 14:57:01 +0100 Subject: [PATCH] release 2.3.0 --- package-lock.json | 2 +- package.json | 2 +- studio/main.js.map | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8042e82..ca039bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsreport-xlsx", - "version": "2.2.1", + "version": "2.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3416cd1..f7dc13a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jsreport-xlsx", - "version": "2.2.1", + "version": "2.3.0", "description": "jsreport recipe rendering excels directly from open xml", "repository": { "type": "git", diff --git a/studio/main.js.map b/studio/main.js.map index 51f1e8b..7519399 100644 --- a/studio/main.js.map +++ b/studio/main.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"Studio.libraries['react']\"","webpack:///external \"Studio\"","webpack:///external \"Studio.libraries['filesaver.js-npm']\"","webpack:///./studio/b64toBlob.js","webpack:///./studio/XlsxUploadButton.js","webpack:///./studio/main_dev.js","webpack:///./studio/XlsxEditor.js","webpack:///./studio/XlsxTemplateProperties.js"],"names":["b64toBlob","b64Data","contentType","sliceSize","byteCharacters","atob","byteArrays","offset","length","slice","byteNumbers","Array","i","charCodeAt","byteArray","Uint8Array","push","blob","Blob","type","_xlsxTemplateUploadButton","ImageUploadButton","e","target","files","xlsxDefaults","uploadCallback","file","reader","FileReader","onloadend","refs","value","forNew","Studio","workspaces","save","xlsx","Object","assign","contentRaw","result","substring","indexOf","name","replace","api","post","data","response","__entitySet","addExistingEntity","openTab","updateEntity","_id","props","tab","entity","patch","loadEntity","onerror","errMsg","Error","alert","readAsDataURL","options","defaults","dispatchEvent","MouseEvent","view","window","bubbles","cancelable","display","upload","renderUpload","openFileDialog","Component","propTypes","React","PropTypes","object","onUpdate","func","isRequired","addEntitySet","faIcon","visibleName","onNew","XlsxUploadButton","OpenUpload","entityTreePosition","addEditorComponent","XlsxEditor","entityEditorComponentKeyResolvers","editorKey","editorProps","extensions","assets","icon","embeddingCode","displayName","onPreview","preview","showWarning","getSettingValueByKey","setSetting","openModal","onDownload","fileSaver","saveAs","onUpload","cb","getPreviewContent","previewLoadFinish","resolveUrl","emptyMessage","key","addToolbarComponent","addPropertiesComponent","XlsxTemplateProperties","title","recipe","previewListeners","request","entities","template","enabled","ImageEditor","download","EntityRefSelect","removeInvalidXlsxTemplateReferences","onChange","xlsxTemplate","updatedXlsxTemplates","keys","filter","k","shortid","updatedXlsxAssets","templateAssetShortid","oldXlsxTemplate","prop","newValue","selected","references","xlsxTemplates","map","foundItems","selectItems","foundAssets","selectAssets"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,2C;;;;;;ACAA,wB;;;;;;ACAA,sD;;;;;;;;;;;;;ACCA,IAAMA,YAAY,SAAZA,SAAY,CAACC,OAAD,EAAgD;AAAA,MAAtCC,WAAsC,uEAAxB,EAAwB;AAAA,MAApBC,SAAoB,uEAAR,G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AO4E,YAAP,IAAuB,IAAvB,IAA+B5E,OAAO4E,YAAP,CAAoBK,OAApB,KAAgCpH,EAAEoH,OAAxE;AAAA,OAApD,CAAnB;AACA,UAAMY,cAAc9B,uBAAuB+B,YAAvB,CAAoC1B,QAApC,EAA8CW,MAA9C,CAAqD,UAAClH,CAAD;AAAA,eAAOmC,OAAOpB,IAAP,IAAe,IAAf,IAAuBoB,OAAOpB,IAAP,CAAYuG,oBAAZ,KAAqCtH,EAAEoH,OAArE;AAAA,OAArD,CAApB;;AAEA,UAAI,CAACU,WAAW5I,MAAZ,IAAsB,CAAC8I,YAAY9I,MAAvC,EAA+C;AAC7C,eAAO,eAAP;AACD;;AAED,UAAIoC,aAAJ;;AAEA,UAAI0G,YAAY9I,MAAhB,EAAwB;AACtBoC,eAAO0G,YAAY,CAAZ,EAAe1G,IAAtB;AACD,OAFD,MAEO;AACLA,eAAOwG,WAAW,CAAX,EAAcxG,IAArB;AACD;;AAED,aAAO,oBAAoBA,IAA3B;AACD;;;;EAjCiDiC,gB;;kBAA/B2C,sB","file":"main.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = Studio.libraries['react'];","module.exports = Studio;","module.exports = Studio.libraries['filesaver.js-npm'];","\nconst b64toBlob = (b64Data, contentType = '', sliceSize = 512) => {\n const byteCharacters = atob(b64Data)\n const byteArrays = []\n\n for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {\n const slice = byteCharacters.slice(offset, offset + sliceSize)\n\n const byteNumbers = new Array(slice.length)\n for (let i = 0; i < slice.length; i++) {\n byteNumbers[i] = slice.charCodeAt(i)\n }\n\n const byteArray = new Uint8Array(byteNumbers)\n\n byteArrays.push(byteArray)\n }\n\n const blob = new Blob(byteArrays, { type: contentType })\n return blob\n}\n\nexport default b64toBlob\n","import React, { Component } from 'react'\r\nimport Studio from 'jsreport-studio'\r\n\r\nlet _xlsxTemplateUploadButton\r\n\r\nexport default class ImageUploadButton extends Component {\r\n static propTypes = {\r\n tab: React.PropTypes.object,\r\n onUpdate: React.PropTypes.func.isRequired\r\n }\r\n\r\n // we need to have global action in main_dev which is triggered when users clicks on + on images\r\n // this triggers invisible button in the toolbar\r\n static OpenUpload (forNew = true, options) {\r\n _xlsxTemplateUploadButton.openFileDialog(forNew, options)\r\n }\r\n\r\n componentDidMount () {\r\n _xlsxTemplateUploadButton = this\r\n }\r\n\r\n upload (e) {\r\n if (!e.target.files.length) {\r\n return\r\n }\r\n\r\n const xlsxDefaults = e.target.xlsxDefaults\r\n const uploadCallback = e.target.uploadCallback\r\n\r\n delete e.target.xlsxDefaults\r\n delete e.target.uploadCallback\r\n\r\n const file = e.target.files[0]\r\n const reader = new FileReader()\r\n\r\n reader.onloadend = async () => {\r\n this.refs.file.value = ''\r\n if (this.forNew) {\r\n if (Studio.workspaces) {\r\n await Studio.workspaces.save()\r\n }\r\n\r\n let xlsx = {}\r\n\r\n if (xlsxDefaults != null) {\r\n xlsx = Object.assign(xlsx, xlsxDefaults)\r\n }\r\n\r\n xlsx = Object.assign(xlsx, {\r\n contentRaw: reader.result.substring(reader.result.indexOf('base64,') + 'base64,'.length),\r\n name: file.name.replace(/.xlsx$/, '')\r\n })\r\n\r\n const response = await Studio.api.post('/odata/xlsxTemplates', {\r\n data: xlsx\r\n })\r\n\r\n response.__entitySet = 'xlsxTemplates'\r\n\r\n Studio.addExistingEntity(response)\r\n Studio.openTab(Object.assign({}, response))\r\n } else {\r\n if (Studio.workspaces) {\r\n Studio.updateEntity({\r\n _id: this.props.tab.entity._id,\r\n contentRaw: reader.result.substring(reader.result.indexOf('base64,') + 'base64,'.length)\r\n })\r\n\r\n await Studio.workspaces.save()\r\n } else {\r\n await Studio.api.patch(`/odata/xlsxTemplates(${this.props.tab.entity._id})`, {\r\n data: {\r\n contentRaw: reader.result.substring(reader.result.indexOf('base64,') + 'base64,'.length)\r\n }\r\n })\r\n Studio.loadEntity(this.props.tab.entity._id, true)\r\n }\r\n }\r\n\r\n if (uploadCallback) {\r\n uploadCallback()\r\n }\r\n }\r\n\r\n reader.onerror = function () {\r\n const errMsg = 'There was an error reading the file!'\r\n\r\n if (uploadCallback) {\r\n uploadCallback(new Error(errMsg))\r\n }\r\n\r\n alert(errMsg)\r\n }\r\n\r\n reader.readAsDataURL(file)\r\n }\r\n\r\n openFileDialog (forNew, options = {}) {\r\n this.forNew = forNew\r\n\r\n if (options.defaults) {\r\n this.refs.file.xlsxDefaults = options.defaults\r\n } else {\r\n delete this.refs.file.xlsxDefaults\r\n }\r\n\r\n if (options.uploadCallback) {\r\n this.refs.file.uploadCallback = options.uploadCallback\r\n } else {\r\n delete this.refs.file.uploadCallback\r\n }\r\n\r\n this.refs.file.dispatchEvent(new MouseEvent('click', {\r\n view: window,\r\n bubbles: false,\r\n cancelable: true\r\n }))\r\n }\r\n\r\n renderUpload () {\r\n return this.upload(e)} accept='.xlsx' />\r\n }\r\n\r\n render () {\r\n return this.renderUpload(true)\r\n }\r\n}\r\n","import fileSaver from 'filesaver.js-npm'\r\nimport XlsxEditor from './XlsxEditor.js'\r\nimport b64toBlob from './b64toBlob.js'\r\nimport XlsxUploadButton from './XlsxUploadButton.js'\r\nimport XlsxTemplateProperties from './XlsxTemplateProperties.js'\r\nimport Studio, { Preview } from 'jsreport-studio'\r\n\r\nStudio.addEntitySet({\r\n name: 'xlsxTemplates',\r\n faIcon: 'fa-file-excel-o',\r\n visibleName: 'xlsx template',\r\n onNew: (options = {}) => XlsxUploadButton.OpenUpload(true, options),\r\n entityTreePosition: 500\r\n})\r\n\r\nStudio.addEditorComponent('xlsxTemplates', XlsxEditor)\r\n\r\nStudio.entityEditorComponentKeyResolvers.push((entity) => {\r\n if (entity.__entitySet === 'xlsxTemplates') {\r\n let editorKey = 'xlsxTemplates'\r\n const editorProps = {}\r\n\r\n if (Studio.extensions.assets) {\r\n // use assets editor for xlsxTemplate when\r\n // asset extension exists\r\n editorKey = 'assets'\r\n\r\n editorProps.icon = 'fa-file-excel-o'\r\n editorProps.embeddingCode = ''\r\n editorProps.displayName = entity.name\r\n\r\n editorProps.onPreview = () => {\r\n if (\r\n Studio.extensions.xlsx.options.preview.showWarning !== false &&\r\n Studio.getSettingValueByKey('office-preview-informed', false) !== true\r\n ) {\r\n Studio.setSetting('office-preview-informed', true)\r\n\r\n Studio.openModal(() => (\r\n
\r\n We need to upload your xlsx to our publicly hosted server to be able to use\r\n Office Online Service for previewing here in the studio. You can disable it in the configuration, see the docs for details.\r\n
\r\n ))\r\n }\r\n }\r\n\r\n editorProps.onDownload = (entity) => {\r\n const blob = b64toBlob(entity.contentRaw, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')\r\n fileSaver.saveAs(blob, entity.name)\r\n }\r\n\r\n editorProps.onUpload = (entity, cb) => {\r\n XlsxUploadButton.OpenUpload(false, {\r\n uploadCallback: cb\r\n })\r\n }\r\n\r\n editorProps.getPreviewContent = (entity, { previewLoadFinish }) => {\r\n return (\r\n \r\n )\r\n }\r\n\r\n editorProps.emptyMessage = 'xlsxTemplate is empty'\r\n }\r\n\r\n return {\r\n key: editorKey,\r\n entity: editorKey === 'assets' ? {\r\n ...entity,\r\n name: `${entity.name}.xlsx`\r\n } : entity,\r\n props: editorProps\r\n }\r\n }\r\n})\r\n\r\nStudio.addToolbarComponent(XlsxUploadButton)\r\nStudio.addPropertiesComponent(XlsxTemplateProperties.title, XlsxTemplateProperties, (entity) => entity.__entitySet === 'templates' && entity.recipe === 'xlsx')\r\n\r\nStudio.previewListeners.push((request, entities) => {\r\n if (request.template.recipe !== 'xlsx') {\r\n return\r\n }\r\n\r\n if (Studio.extensions.xlsx.options.preview.enabled === false) {\r\n return\r\n }\r\n\r\n if (Studio.extensions.xlsx.options.preview.showWarning === false) {\r\n return\r\n }\r\n\r\n if (Studio.getSettingValueByKey('office-preview-informed', false) === true) {\r\n return\r\n }\r\n\r\n Studio.setSetting('office-preview-informed', true)\r\n\r\n Studio.openModal(() => (\r\n
\r\n We need to upload your office report to our publicly hosted server to be able to use\r\n Excel Online Service for previewing here in the studio. You can disable it in the configuration, see https://jsreport.net/learn/xlsx for details.\r\n
\r\n ))\r\n})\r\n","import React, { Component } from 'react'\r\nimport b64toBlob from './b64toBlob.js'\r\nimport XlsxUploadButton from './XlsxUploadButton.js'\r\nimport fileSaver from 'filesaver.js-npm'\r\n\r\nexport default class ImageEditor extends Component {\r\n static propTypes = {\r\n entity: React.PropTypes.object.isRequired\r\n }\r\n\r\n download () {\r\n const blob = b64toBlob(this.props.entity.contentRaw, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')\r\n fileSaver.saveAs(blob, this.props.entity.name)\r\n }\r\n\r\n render () {\r\n const { entity } = this.props\r\n\r\n return (\r\n
\r\n

{entity.name}

\r\n
\r\n \r\n \r\n
\r\n
\r\n )\r\n }\r\n}\r\n","import React, { Component } from 'react'\r\nimport Studio from 'jsreport-studio'\r\n\r\nconst EntityRefSelect = Studio.EntityRefSelect\r\n\r\nexport default class XlsxTemplateProperties extends Component {\r\n static selectItems (entities) {\r\n return Object.keys(entities).filter((k) => entities[k].__entitySet === 'xlsxTemplates').map((k) => entities[k])\r\n }\r\n\r\n static selectAssets (entities) {\r\n return Object.keys(entities).filter((k) => entities[k].__entitySet === 'assets').map((k) => entities[k])\r\n }\r\n\r\n static title (entity, entities) {\r\n if (\r\n (!entity.xlsxTemplate || !entity.xlsxTemplate.shortid) &&\r\n (!entity.xlsx || !entity.xlsx.templateAssetShortid)\r\n ) {\r\n return 'xlsx template'\r\n }\r\n\r\n const foundItems = XlsxTemplateProperties.selectItems(entities).filter((e) => entity.xlsxTemplate != null && entity.xlsxTemplate.shortid === e.shortid)\r\n const foundAssets = XlsxTemplateProperties.selectAssets(entities).filter((e) => entity.xlsx != null && entity.xlsx.templateAssetShortid === e.shortid)\r\n\r\n if (!foundItems.length && !foundAssets.length) {\r\n return 'xlsx template'\r\n }\r\n\r\n let name\r\n\r\n if (foundAssets.length) {\r\n name = foundAssets[0].name\r\n } else {\r\n name = foundItems[0].name\r\n }\r\n\r\n return 'xlsx template: ' + name\r\n }\r\n\r\n componentDidMount () {\r\n this.removeInvalidXlsxTemplateReferences()\r\n }\r\n\r\n componentDidUpdate () {\r\n this.removeInvalidXlsxTemplateReferences()\r\n }\r\n\r\n removeInvalidXlsxTemplateReferences () {\r\n const { entity, entities, onChange } = this.props\r\n\r\n if (!entity.xlsxTemplate && !entity.xlsx) {\r\n return\r\n }\r\n\r\n const updatedXlsxTemplates = Object.keys(entities).filter((k) => entities[k].__entitySet === 'xlsxTemplates' && entity.xlsxTemplate != null && entities[k].shortid === entity.xlsxTemplate.shortid)\r\n const updatedXlsxAssets = Object.keys(entities).filter((k) => entities[k].__entitySet === 'assets' && entity.xlsx != null && entities[k].shortid === entity.xlsx.templateAssetShortid)\r\n\r\n if (entity.xlsx && entity.xlsx.templateAssetShortid && updatedXlsxAssets.length === 0) {\r\n onChange({ _id: entity._id, xlsx: null })\r\n }\r\n\r\n if (entity.xlsxTemplate && entity.xlsxTemplate.shortid && updatedXlsxTemplates.length === 0) {\r\n onChange({ _id: entity._id, xlsxTemplate: null })\r\n }\r\n }\r\n\r\n changeXlsxTemplate (oldXlsxTemplate, prop, value) {\r\n let newValue\r\n\r\n if (value == null) {\r\n newValue = { ...oldXlsxTemplate }\r\n newValue[prop] = null\r\n } else {\r\n return { ...oldXlsxTemplate, [prop]: value }\r\n }\r\n\r\n newValue = Object.keys(newValue).length ? newValue : null\r\n\r\n return newValue\r\n }\r\n\r\n render () {\r\n const { entity, onChange } = this.props\r\n\r\n return (\r\n
\r\n
\r\n \r\n onChange({\r\n _id: entity._id,\r\n xlsx: selected != null && selected.length > 0 ? { templateAssetShortid: selected[0].shortid } : null\r\n })}\r\n filter={(references) => ({ assets: references.assets })}\r\n />\r\n
\r\n
\r\n \r\n ({ xlsxTemplates: references.xlsxTemplates })}\r\n value={entity.xlsxTemplate ? entity.xlsxTemplate.shortid : null}\r\n onChange={(selected) => onChange({\r\n _id: entity._id,\r\n xlsxTemplate: selected != null && selected.length > 0 ? { shortid: selected[0].shortid } : null\r\n })}\r\n />\r\n
\r\n
\r\n )\r\n }\r\n}\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"Studio.libraries['react']\"","webpack:///external \"Studio\"","webpack:///external \"Studio.libraries['filesaver.js-npm']\"","webpack:///./studio/b64toBlob.js","webpack:///./studio/XlsxUploadButton.js","webpack:///./studio/main_dev.js","webpack:///./studio/XlsxEditor.js","webpack:///./studio/XlsxTemplateProperties.js"],"names":["b64toBlob","b64Data","contentType","sliceSize","byteCharacters","atob","byteArrays","offset","length","slice","byteNumbers","Array","i","charCodeAt","byteArray","Uint8Array","push","blob","Blob","type","_xlsxTemplateUploadButton","ImageUploadButton","e","target","files","xlsxDefaults","uploadCallback","file","reader","FileReader","onloadend","refs","value","forNew","Studio","workspaces","save","xlsx","Object","assign","contentRaw","result","substring","indexOf","name","replace","api","post","data","response","__entitySet","addExistingEntity","openTab","updateEntity","_id","props","tab","entity","patch","loadEntity","onerror","errMsg","Error","alert","readAsDataURL","options","defaults","dispatchEvent","MouseEvent","view","window","bubbles","cancelable","display","upload","renderUpload","openFileDialog","Component","propTypes","React","PropTypes","object","onUpdate","func","isRequired","addEntitySet","faIcon","visibleName","onNew","XlsxUploadButton","OpenUpload","entityTreePosition","addEditorComponent","XlsxEditor","entityEditorComponentKeyResolvers","editorKey","editorProps","extensions","assets","icon","embeddingCode","displayName","onPreview","preview","showWarning","getSettingValueByKey","setSetting","openModal","onDownload","fileSaver","saveAs","onUpload","cb","getPreviewContent","previewLoadFinish","resolveUrl","emptyMessage","key","addToolbarComponent","addPropertiesComponent","XlsxTemplateProperties","title","recipe","previewListeners","request","entities","template","enabled","ImageEditor","download","EntityRefSelect","removeInvalidXlsxTemplateReferences","onChange","xlsxTemplate","updatedXlsxTemplates","keys","filter","k","shortid","updatedXlsxAssets","templateAssetShortid","oldXlsxTemplate","prop","newValue","selected","references","xlsxTemplates","map","foundItems","selectItems","foundAssets","selectAssets"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,2C;;;;;;ACAA,wB;;;;;;ACAA,sD;;;;;;;;;;;;;ACCA,IAAMA,YAAY,SAAZA,SAAY,CAACC,OAAD,EAAgD;AAAA,MAAtCC,WAAsC,uEAAxB,EAAwB;AAAA,MAApBC,SAAoB,uEAAR,GAAQ;;AAChE,MAAMC,iBAAiBC,KAAKJ,OAAL,CAAvB;AACA,MAAMK,aAAa,EAAnB;;AAEA,OAAK,IAAIC,SAAS,CAAlB,EAAqBA,SAASH,eAAeI,MAA7C,EAAqDD,UAAUJ,SAA/D,EAA0E;AACxE,QAAMM,QAA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AAClH,CAAD;AAAA,eAAOmC,OAAOpB,IAAP,IAAe,IAAf,IAAuBoB,OAAOpB,IAAP,CAAYuG,oBAAZ,KAAqCtH,EAAEoH,OAArE;AAAA,OAArD,CAApB;;AAEA,UAAI,CAACU,WAAW5I,MAAZ,IAAsB,CAAC8I,YAAY9I,MAAvC,EAA+C;AAC7C,eAAO,eAAP;AACD;;AAED,UAAIoC,aAAJ;;AAEA,UAAI0G,YAAY9I,MAAhB,EAAwB;AACtBoC,eAAO0G,YAAY,CAAZ,EAAe1G,IAAtB;AACD,OAFD,MAEO;AACLA,eAAOwG,WAAW,CAAX,EAAcxG,IAArB;AACD;;AAED,aAAO,oBAAoBA,IAA3B;AACD;;;;EAjCiDiC,gB;;kBAA/B2C,sB","file":"main.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = Studio.libraries['react'];","module.exports = Studio;","module.exports = Studio.libraries['filesaver.js-npm'];","\r\nconst b64toBlob = (b64Data, contentType = '', sliceSize = 512) => {\r\n const byteCharacters = atob(b64Data)\r\n const byteArrays = []\r\n\r\n for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {\r\n const slice = byteCharacters.slice(offset, offset + sliceSize)\r\n\r\n const byteNumbers = new Array(slice.length)\r\n for (let i = 0; i < slice.length; i++) {\r\n byteNumbers[i] = slice.charCodeAt(i)\r\n }\r\n\r\n const byteArray = new Uint8Array(byteNumbers)\r\n\r\n byteArrays.push(byteArray)\r\n }\r\n\r\n const blob = new Blob(byteArrays, { type: contentType })\r\n return blob\r\n}\r\n\r\nexport default b64toBlob\r\n","import React, { Component } from 'react'\r\nimport Studio from 'jsreport-studio'\r\n\r\nlet _xlsxTemplateUploadButton\r\n\r\nexport default class ImageUploadButton extends Component {\r\n static propTypes = {\r\n tab: React.PropTypes.object,\r\n onUpdate: React.PropTypes.func.isRequired\r\n }\r\n\r\n // we need to have global action in main_dev which is triggered when users clicks on + on images\r\n // this triggers invisible button in the toolbar\r\n static OpenUpload (forNew = true, options) {\r\n _xlsxTemplateUploadButton.openFileDialog(forNew, options)\r\n }\r\n\r\n componentDidMount () {\r\n _xlsxTemplateUploadButton = this\r\n }\r\n\r\n upload (e) {\r\n if (!e.target.files.length) {\r\n return\r\n }\r\n\r\n const xlsxDefaults = e.target.xlsxDefaults\r\n const uploadCallback = e.target.uploadCallback\r\n\r\n delete e.target.xlsxDefaults\r\n delete e.target.uploadCallback\r\n\r\n const file = e.target.files[0]\r\n const reader = new FileReader()\r\n\r\n reader.onloadend = async () => {\r\n this.refs.file.value = ''\r\n if (this.forNew) {\r\n if (Studio.workspaces) {\r\n await Studio.workspaces.save()\r\n }\r\n\r\n let xlsx = {}\r\n\r\n if (xlsxDefaults != null) {\r\n xlsx = Object.assign(xlsx, xlsxDefaults)\r\n }\r\n\r\n xlsx = Object.assign(xlsx, {\r\n contentRaw: reader.result.substring(reader.result.indexOf('base64,') + 'base64,'.length),\r\n name: file.name.replace(/.xlsx$/, '')\r\n })\r\n\r\n const response = await Studio.api.post('/odata/xlsxTemplates', {\r\n data: xlsx\r\n })\r\n\r\n response.__entitySet = 'xlsxTemplates'\r\n\r\n Studio.addExistingEntity(response)\r\n Studio.openTab(Object.assign({}, response))\r\n } else {\r\n if (Studio.workspaces) {\r\n Studio.updateEntity({\r\n _id: this.props.tab.entity._id,\r\n contentRaw: reader.result.substring(reader.result.indexOf('base64,') + 'base64,'.length)\r\n })\r\n\r\n await Studio.workspaces.save()\r\n } else {\r\n await Studio.api.patch(`/odata/xlsxTemplates(${this.props.tab.entity._id})`, {\r\n data: {\r\n contentRaw: reader.result.substring(reader.result.indexOf('base64,') + 'base64,'.length)\r\n }\r\n })\r\n Studio.loadEntity(this.props.tab.entity._id, true)\r\n }\r\n }\r\n\r\n if (uploadCallback) {\r\n uploadCallback()\r\n }\r\n }\r\n\r\n reader.onerror = function () {\r\n const errMsg = 'There was an error reading the file!'\r\n\r\n if (uploadCallback) {\r\n uploadCallback(new Error(errMsg))\r\n }\r\n\r\n alert(errMsg)\r\n }\r\n\r\n reader.readAsDataURL(file)\r\n }\r\n\r\n openFileDialog (forNew, options = {}) {\r\n this.forNew = forNew\r\n\r\n if (options.defaults) {\r\n this.refs.file.xlsxDefaults = options.defaults\r\n } else {\r\n delete this.refs.file.xlsxDefaults\r\n }\r\n\r\n if (options.uploadCallback) {\r\n this.refs.file.uploadCallback = options.uploadCallback\r\n } else {\r\n delete this.refs.file.uploadCallback\r\n }\r\n\r\n this.refs.file.dispatchEvent(new MouseEvent('click', {\r\n view: window,\r\n bubbles: false,\r\n cancelable: true\r\n }))\r\n }\r\n\r\n renderUpload () {\r\n return this.upload(e)} accept='.xlsx' />\r\n }\r\n\r\n render () {\r\n return this.renderUpload(true)\r\n }\r\n}\r\n","import fileSaver from 'filesaver.js-npm'\r\nimport XlsxEditor from './XlsxEditor.js'\r\nimport b64toBlob from './b64toBlob.js'\r\nimport XlsxUploadButton from './XlsxUploadButton.js'\r\nimport XlsxTemplateProperties from './XlsxTemplateProperties.js'\r\nimport Studio, { Preview } from 'jsreport-studio'\r\n\r\nStudio.addEntitySet({\r\n name: 'xlsxTemplates',\r\n faIcon: 'fa-file-excel-o',\r\n visibleName: 'xlsx template',\r\n onNew: (options = {}) => XlsxUploadButton.OpenUpload(true, options),\r\n entityTreePosition: 500\r\n})\r\n\r\nStudio.addEditorComponent('xlsxTemplates', XlsxEditor)\r\n\r\nStudio.entityEditorComponentKeyResolvers.push((entity) => {\r\n if (entity.__entitySet === 'xlsxTemplates') {\r\n let editorKey = 'xlsxTemplates'\r\n const editorProps = {}\r\n\r\n if (Studio.extensions.assets) {\r\n // use assets editor for xlsxTemplate when\r\n // asset extension exists\r\n editorKey = 'assets'\r\n\r\n editorProps.icon = 'fa-file-excel-o'\r\n editorProps.embeddingCode = ''\r\n editorProps.displayName = entity.name\r\n\r\n editorProps.onPreview = () => {\r\n if (\r\n Studio.extensions.xlsx.options.preview.showWarning !== false &&\r\n Studio.getSettingValueByKey('office-preview-informed', false) !== true\r\n ) {\r\n Studio.setSetting('office-preview-informed', true)\r\n\r\n Studio.openModal(() => (\r\n
\r\n We need to upload your xlsx to our publicly hosted server to be able to use\r\n Office Online Service for previewing here in the studio. You can disable it in the configuration, see the docs for details.\r\n
\r\n ))\r\n }\r\n }\r\n\r\n editorProps.onDownload = (entity) => {\r\n const blob = b64toBlob(entity.contentRaw, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')\r\n fileSaver.saveAs(blob, entity.name)\r\n }\r\n\r\n editorProps.onUpload = (entity, cb) => {\r\n XlsxUploadButton.OpenUpload(false, {\r\n uploadCallback: cb\r\n })\r\n }\r\n\r\n editorProps.getPreviewContent = (entity, { previewLoadFinish }) => {\r\n return (\r\n \r\n )\r\n }\r\n\r\n editorProps.emptyMessage = 'xlsxTemplate is empty'\r\n }\r\n\r\n return {\r\n key: editorKey,\r\n entity: editorKey === 'assets' ? {\r\n ...entity,\r\n name: `${entity.name}.xlsx`\r\n } : entity,\r\n props: editorProps\r\n }\r\n }\r\n})\r\n\r\nStudio.addToolbarComponent(XlsxUploadButton)\r\nStudio.addPropertiesComponent(XlsxTemplateProperties.title, XlsxTemplateProperties, (entity) => entity.__entitySet === 'templates' && entity.recipe === 'xlsx')\r\n\r\nStudio.previewListeners.push((request, entities) => {\r\n if (request.template.recipe !== 'xlsx') {\r\n return\r\n }\r\n\r\n if (Studio.extensions.xlsx.options.preview.enabled === false) {\r\n return\r\n }\r\n\r\n if (Studio.extensions.xlsx.options.preview.showWarning === false) {\r\n return\r\n }\r\n\r\n if (Studio.getSettingValueByKey('office-preview-informed', false) === true) {\r\n return\r\n }\r\n\r\n Studio.setSetting('office-preview-informed', true)\r\n\r\n Studio.openModal(() => (\r\n
\r\n We need to upload your office report to our publicly hosted server to be able to use\r\n Excel Online Service for previewing here in the studio. You can disable it in the configuration, see https://jsreport.net/learn/xlsx for details.\r\n
\r\n ))\r\n})\r\n","import React, { Component } from 'react'\r\nimport b64toBlob from './b64toBlob.js'\r\nimport XlsxUploadButton from './XlsxUploadButton.js'\r\nimport fileSaver from 'filesaver.js-npm'\r\n\r\nexport default class ImageEditor extends Component {\r\n static propTypes = {\r\n entity: React.PropTypes.object.isRequired\r\n }\r\n\r\n download () {\r\n const blob = b64toBlob(this.props.entity.contentRaw, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')\r\n fileSaver.saveAs(blob, this.props.entity.name)\r\n }\r\n\r\n render () {\r\n const { entity } = this.props\r\n\r\n return (\r\n
\r\n

{entity.name}

\r\n
\r\n \r\n \r\n
\r\n
\r\n )\r\n }\r\n}\r\n","import React, { Component } from 'react'\r\nimport Studio from 'jsreport-studio'\r\n\r\nconst EntityRefSelect = Studio.EntityRefSelect\r\n\r\nexport default class XlsxTemplateProperties extends Component {\r\n static selectItems (entities) {\r\n return Object.keys(entities).filter((k) => entities[k].__entitySet === 'xlsxTemplates').map((k) => entities[k])\r\n }\r\n\r\n static selectAssets (entities) {\r\n return Object.keys(entities).filter((k) => entities[k].__entitySet === 'assets').map((k) => entities[k])\r\n }\r\n\r\n static title (entity, entities) {\r\n if (\r\n (!entity.xlsxTemplate || !entity.xlsxTemplate.shortid) &&\r\n (!entity.xlsx || !entity.xlsx.templateAssetShortid)\r\n ) {\r\n return 'xlsx template'\r\n }\r\n\r\n const foundItems = XlsxTemplateProperties.selectItems(entities).filter((e) => entity.xlsxTemplate != null && entity.xlsxTemplate.shortid === e.shortid)\r\n const foundAssets = XlsxTemplateProperties.selectAssets(entities).filter((e) => entity.xlsx != null && entity.xlsx.templateAssetShortid === e.shortid)\r\n\r\n if (!foundItems.length && !foundAssets.length) {\r\n return 'xlsx template'\r\n }\r\n\r\n let name\r\n\r\n if (foundAssets.length) {\r\n name = foundAssets[0].name\r\n } else {\r\n name = foundItems[0].name\r\n }\r\n\r\n return 'xlsx template: ' + name\r\n }\r\n\r\n componentDidMount () {\r\n this.removeInvalidXlsxTemplateReferences()\r\n }\r\n\r\n componentDidUpdate () {\r\n this.removeInvalidXlsxTemplateReferences()\r\n }\r\n\r\n removeInvalidXlsxTemplateReferences () {\r\n const { entity, entities, onChange } = this.props\r\n\r\n if (!entity.xlsxTemplate && !entity.xlsx) {\r\n return\r\n }\r\n\r\n const updatedXlsxTemplates = Object.keys(entities).filter((k) => entities[k].__entitySet === 'xlsxTemplates' && entity.xlsxTemplate != null && entities[k].shortid === entity.xlsxTemplate.shortid)\r\n const updatedXlsxAssets = Object.keys(entities).filter((k) => entities[k].__entitySet === 'assets' && entity.xlsx != null && entities[k].shortid === entity.xlsx.templateAssetShortid)\r\n\r\n if (entity.xlsx && entity.xlsx.templateAssetShortid && updatedXlsxAssets.length === 0) {\r\n onChange({ _id: entity._id, xlsx: null })\r\n }\r\n\r\n if (entity.xlsxTemplate && entity.xlsxTemplate.shortid && updatedXlsxTemplates.length === 0) {\r\n onChange({ _id: entity._id, xlsxTemplate: null })\r\n }\r\n }\r\n\r\n changeXlsxTemplate (oldXlsxTemplate, prop, value) {\r\n let newValue\r\n\r\n if (value == null) {\r\n newValue = { ...oldXlsxTemplate }\r\n newValue[prop] = null\r\n } else {\r\n return { ...oldXlsxTemplate, [prop]: value }\r\n }\r\n\r\n newValue = Object.keys(newValue).length ? newValue : null\r\n\r\n return newValue\r\n }\r\n\r\n render () {\r\n const { entity, onChange } = this.props\r\n\r\n return (\r\n
\r\n
\r\n \r\n onChange({\r\n _id: entity._id,\r\n xlsx: selected != null && selected.length > 0 ? { templateAssetShortid: selected[0].shortid } : null\r\n })}\r\n filter={(references) => ({ assets: references.assets })}\r\n />\r\n
\r\n
\r\n \r\n ({ xlsxTemplates: references.xlsxTemplates })}\r\n value={entity.xlsxTemplate ? entity.xlsxTemplate.shortid : null}\r\n onChange={(selected) => onChange({\r\n _id: entity._id,\r\n xlsxTemplate: selected != null && selected.length > 0 ? { shortid: selected[0].shortid } : null\r\n })}\r\n />\r\n
\r\n
\r\n )\r\n }\r\n}\r\n"],"sourceRoot":""} \ No newline at end of file