@omegagrid/plugin-xlsx 0.8.4 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorPlugin.js +3 -3
- package/dist/editorPlugin.js.map +1 -1
- package/package.json +4 -4
package/dist/editorPlugin.js
CHANGED
|
@@ -5,10 +5,10 @@ import { SheetjsLoader } from './loader';
|
|
|
5
5
|
export class XlsxEditorPlugin extends Plugin {
|
|
6
6
|
init(editor) {
|
|
7
7
|
SheetjsLoader.get();
|
|
8
|
-
editor.commands.
|
|
9
|
-
|
|
8
|
+
editor.commands.add({
|
|
9
|
+
group: 'plugin',
|
|
10
10
|
name: 'export xlsx',
|
|
11
|
-
|
|
11
|
+
exec: async () => {
|
|
12
12
|
const models = editor.getGridContainer().model.models;
|
|
13
13
|
const wb = await createWorkbook(Array.from(models, item => item[1]));
|
|
14
14
|
exportXLSX(wb, 'export.xlsx');
|
package/dist/editorPlugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorPlugin.js","sourceRoot":"","sources":["../src/editorPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,OAAO,gBAAiB,SAAQ,MAAc;IAInD,IAAI,CAAC,MAAc;QAClB,aAAa,CAAC,GAAG,EAAE,CAAC;QAEpB,MAAM,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"editorPlugin.js","sourceRoot":"","sources":["../src/editorPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,OAAO,gBAAiB,SAAQ,MAAc;IAInD,IAAI,CAAC,MAAc;QAClB,aAAa,CAAC,GAAG,EAAE,CAAC;QAEpB,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;YACnB,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,KAAK,IAAI,EAAE;gBAChB,MAAM,MAAM,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;gBACtD,MAAM,EAAE,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrE,UAAU,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;YAC/B,CAAC;SACD,CAAC,CAAC;QAEH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,CAAY,EAAE,EAAE;YACtD,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBACjC,MAAM,IAAI,GAAG,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACrC,MAAM,CAAC,aAAa,CAAC,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/C,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;;AAtBM,2BAAU,GAAG,MAAM,CAAC","sourcesContent":["import { Plugin } from '@omegagrid/core';\nimport { Editor } from '@omegagrid/editor';\nimport { createModel } from './import';\nimport { createWorkbook, exportXLSX } from './export';\nimport { SheetjsLoader } from './loader';\n\nexport class XlsxEditorPlugin extends Plugin<Editor> {\n\n\tstatic pluginName = 'xlsx';\n\n\tinit(editor: Editor) {\n\t\tSheetjsLoader.get();\n\n\t\teditor.commands.add({\n\t\t\tgroup: 'plugin',\n\t\t\tname: 'export xlsx',\n\t\t\texec: async () => {\n\t\t\t\tconst models = editor.getGridContainer().model.models; \n\t\t\t\tconst wb = await createWorkbook(Array.from(models, item => item[1]));\n\t\t\t\texportXLSX(wb, 'export.xlsx');\n\t\t\t}\n\t\t});\n\n\t\teditor.addEventListener('drop', async (e: DragEvent) => {\n\t\t\te.preventDefault();\n\t\t\tif (e.dataTransfer.files.length) {\n\t\t\t\tconst file = e.dataTransfer.files[0];\n\t\t\t\teditor.setSourceData(await createModel(file));\n\t\t\t}\n\t\t});\n\t}\n\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/plugin-xlsx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Xlsx import/export plugin",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"_prepublish": "yarn test && yarn lint"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@omegagrid/core": "^0.
|
|
31
|
-
"@omegagrid/editor": "^0.
|
|
32
|
-
"@omegagrid/grid": "^0.
|
|
30
|
+
"@omegagrid/core": "^0.9.1",
|
|
31
|
+
"@omegagrid/editor": "^0.9.1",
|
|
32
|
+
"@omegagrid/grid": "^0.9.1",
|
|
33
33
|
"lit": "^3.1.1",
|
|
34
34
|
"lit-html": "^3.1.1",
|
|
35
35
|
"ts-debounce": "^4.0.0"
|