From e7ddc397c8b1e421c63f3e9f661ced99a3d81556 Mon Sep 17 00:00:00 2001 From: renxxing <74659302+renxxing@users.noreply.github.com> Date: Thu, 19 Nov 2020 16:45:13 +0800 Subject: [PATCH] fix(demo): ie11 Compatible with ie11 fix #234 --- gulpfile.js | 5 ++++ package.json | 4 ++- src/demoData/demoFeature.js | 2 +- src/demoData/sheetCell.js | 4 +-- src/demoData/sheetChart.js | 4 +-- src/demoData/sheetComment.js | 4 +-- src/demoData/sheetConditionFormat.js | 4 +-- src/demoData/sheetDataVerification.js | 4 +-- src/demoData/sheetFormula.js | 4 +-- src/demoData/sheetPicture.js | 4 +-- src/demoData/sheetPivotTable.js | 4 +-- src/demoData/sheetPivotTableData.js | 4 +-- src/demoData/sheetSparkline.js | 4 +-- src/demoData/sheetTable.js | 4 +-- src/index.html | 37 +++++++++++++++++---------- 15 files changed, 55 insertions(+), 37 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 52fdb75..9906bbd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -26,6 +26,7 @@ const commonjs = require('@rollup/plugin-commonjs'); const terser = require('rollup-plugin-terser').terser; // rollup babel plugin, support the latest ES grammar const babel = require('@rollup/plugin-babel').default; +// const gulpBabel = require('gulp-babel'); // Distinguish development and production environments const production = process.env.NODE_ENV === 'production' ? true : false; @@ -247,6 +248,10 @@ function copyStaticExpendPlugins(){ function copyStaticDemoData(){ return src(paths.staticDemoData) .pipe(dest(paths.destStaticDemoData)); + // .pipe(gulpBabel({ + // presets: ['@babel/env'] + // })) + // .pipe(gulp.dest('dist')); } function copyStaticCssImages(){ return src(paths.staticCssImages) diff --git a/package.json b/package.json index 2854ada..a9385a7 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "module": "dist/luckysheet.esm.js", "browser": "dist/luckysheet.umd.js", "devDependencies": { - "@babel/preset-env": "^7.10.2", + "@babel/core": "^7.12.3", + "@babel/preset-env": "^7.12.1", "@babel/runtime-corejs3": "^7.12.1", "@commitlint/cli": "^9.1.1", "@commitlint/config-conventional": "^9.1.1", @@ -17,6 +18,7 @@ "cross-env": "^7.0.2", "delete": "^1.1.0", "gulp": "^4.0.2", + "gulp-babel": "^8.0.0", "gulp-clean-css": "^4.3.0", "gulp-concat": "^2.6.1", "gulp-if": "^3.0.0", diff --git a/src/demoData/demoFeature.js b/src/demoData/demoFeature.js index db3a8e5..a5746cb 100644 --- a/src/demoData/demoFeature.js +++ b/src/demoData/demoFeature.js @@ -17,7 +17,7 @@ const text = language() === 'zh' ? '反馈' : 'Forum'; const link = language() === 'zh' ? 'https://support.qq.com/product/288322' : 'https://groups.google.com/g/luckysheet'; - document.querySelector("body").insertAdjacentHTML('beforeend', `${text}`); + document.querySelector("body").insertAdjacentHTML('beforeend', ''+ text +''); } supportButton() diff --git a/src/demoData/sheetCell.js b/src/demoData/sheetCell.js index b20bd91..5adcea3 100644 --- a/src/demoData/sheetCell.js +++ b/src/demoData/sheetCell.js @@ -1,4 +1,4 @@ -const sheetCell = { +window.sheetCell = { "name": "Cell", "config": { "merge": { @@ -1575,4 +1575,4 @@ const sheetCell = { "scrollLeft": 0, "scrollTop": 0 } -export default sheetCell \ No newline at end of file +// export default sheetCell \ No newline at end of file diff --git a/src/demoData/sheetChart.js b/src/demoData/sheetChart.js index a95e636..4d10493 100644 --- a/src/demoData/sheetChart.js +++ b/src/demoData/sheetChart.js @@ -1,4 +1,4 @@ -const sheetChart = { +window.sheetChart = { "name": "Chart", "color": "", "status": 0, @@ -4915,4 +4915,4 @@ const sheetChart = { }] } -export default sheetChart \ No newline at end of file +// export default sheetChart \ No newline at end of file diff --git a/src/demoData/sheetComment.js b/src/demoData/sheetComment.js index 83f2c0c..326d9a9 100644 --- a/src/demoData/sheetComment.js +++ b/src/demoData/sheetComment.js @@ -1,4 +1,4 @@ -const sheetComment = { +window.sheetComment = { "name": "Comment", "color": "", "config": { @@ -64,4 +64,4 @@ const sheetComment = { "scrollTop": 0 } -export default sheetComment; \ No newline at end of file +// export default sheetComment; \ No newline at end of file diff --git a/src/demoData/sheetConditionFormat.js b/src/demoData/sheetConditionFormat.js index f4a1d02..e91f9b8 100644 --- a/src/demoData/sheetConditionFormat.js +++ b/src/demoData/sheetConditionFormat.js @@ -1,4 +1,4 @@ -const sheetConditionFormat = { +window.sheetConditionFormat = { "name": "Conditional Format", "color": "", "zoomRatio":1, @@ -6538,4 +6538,4 @@ const sheetConditionFormat = { }] } -export default sheetConditionFormat; \ No newline at end of file +// export default sheetConditionFormat; \ No newline at end of file diff --git a/src/demoData/sheetDataVerification.js b/src/demoData/sheetDataVerification.js index 903669f..ee93a91 100644 --- a/src/demoData/sheetDataVerification.js +++ b/src/demoData/sheetDataVerification.js @@ -1,4 +1,4 @@ -const sheetDataVerification = { +window.sheetDataVerification = { "name": "Data Verification", "index": "Sheet_pdolzzie5xwi_1600927444446", "celldata": [{"r":0,"c":0,"v":{"ct":{"fa":"General","t":"g"},"m":"Drop Down List","v":"Drop Down List","bl":1}},{"r":0,"c":1,"v":{"m":"Checkbox","ct":{"fa":"General","t":"g"},"v":"Checkbox","bl":1}},{"r":0,"c":2,"v":{"ct":{"fa":"General","t":"g"},"v":"Number between 1-10","bl":1,"m":"Number between 1-10"}},{"r":0,"c":3,"v":{"m":"Text content include Luckysheet","ct":{"fa":"General","t":"g"},"v":"Text content include Luckysheet","bl":1}},{"r":0,"c":4,"v":{"ct":{"fa":"General","t":"g"},"v":"Text length between 1-5","m":"Text length between 1-5","bl":1}},{"r":0,"c":5,"v":{"m":"Date","ct":{"fa":"General","t":"g"},"v":"Date","bl":1}},{"r":0,"c":6,"v":{"m":"Identification Number","ct":{"fa":"General","t":"g"},"v":"Identification Number","bl":1}},{"r":0,"c":7,"v":{"m":"Phone Number","ct":{"fa":"General","t":"g"},"v":"Phone Number","bl":1}},{"r":1,"c":0,"v":{"ct":{"fa":"General","t":"g"},"v":"Fix","m":"Fix"}},{"r":1,"c":1,"v":{"m":"Fail","ct":{"fa":"General","t":"g"},"v":"Fail"}},{"r":1,"c":2,"v":{"v":1,"ct":{"fa":"General","t":"n"},"m":"1"}},{"r":1,"c":3,"v":{"m":"Luckysheet is good","ct":{"fa":"General","t":"g"},"v":"Luckysheet is good"}},{"r":1,"c":4,"v":{"m":"Welcome","ct":{"fa":"General","t":"g"},"v":"Welcome"}},{"r":1,"c":5,"v":{"m":"2020-09-24","ct":{"fa":"yyyy-MM-dd","t":"d"},"v":44098}},{"r":1,"c":6,"v":{"v":"311414199009138910","ct":{"fa":"@","t":"s"},"m":"311414199009138910"}},{"r":1,"c":7,"v":{"v":13678765439,"ct":{"fa":"General","t":"n"},"m":"13678765439"}},{"r":2,"c":0,"v":{"ct":{"fa":"General","t":"g"},"v":"Done","m":"Done"}},{"r":2,"c":1,"v":{"m":"Pass","ct":{"fa":"General","t":"g"},"v":"Pass"}},{"r":2,"c":2,"v":{"v":2,"ct":{"fa":"General","t":"n"},"m":"2"}},{"r":2,"c":3,"v":{"m":"I am Luckysheet","ct":{"fa":"General","t":"g"},"v":"I am Luckysheet"}},{"r":2,"c":4,"v":{"m":"Good","ct":{"fa":"General","t":"g"},"v":"Good"}},{"r":2,"c":5,"v":{"ct":{"fa":"General","t":"g"},"v":"Time","m":"Time"}},{"r":2,"c":6,"v":{"v":"31141419900913891","ct":{"fa":"@","t":"s"},"m":"31141419900913891"}},{"r":2,"c":7,"v":{"v":1367876544,"ct":{"fa":"General","t":"n"},"m":"1367876544"}},{"r":3,"c":0,"v":{"ct":{"fa":"General","t":"g"},"v":"Develop","m":"Develop"}},{"r":3,"c":1,"v":{"m":"Fail","ct":{"fa":"General","t":"g"},"v":"Fail"}},{"r":3,"c":2,"v":{"v":5,"ct":{"fa":"General","t":"n"},"m":"5"}},{"r":3,"c":3,"v":{"ct":{"fa":"General","t":"g"},"v":"I am luckyDemo","m":"I am luckyDemo"}},{"r":3,"c":4,"v":{"m":"Nice","ct":{"fa":"General","t":"g"},"v":"Nice"}},{"r":3,"c":5,"v":{"m":"2020-09-26","ct":{"fa":"yyyy-MM-dd","t":"d"},"v":44100}},{"r":3,"c":6,"v":{"v":"3114141990091389102","ct":{"fa":"@","t":"s"},"m":"3114141990091389102"}},{"r":3,"c":7,"v":{"v":136787654412,"ct":{"fa":"##0","t":"n"},"m":"136787654412"}},{"r":4,"c":0,"v":{"ct":{"fa":"General","t":"g"},"v":"Doing","m":"Doing"}},{"r":4,"c":1,"v":{"m":"Fail","ct":{"fa":"General","t":"g"},"v":"Fail"}},{"r":4,"c":2,"v":{"v":11,"ct":{"fa":"General","t":"n"},"m":"11"}},{"r":4,"c":3,"v":{"ct":{"fa":"General","t":"g"},"v":"Luckysheet Documentation","m":"Luckysheet Documentation"}},{"r":4,"c":4,"v":{"ct":{"fa":"General","t":"g"},"v":"Morning","m":"Morning"}},{"r":4,"c":5,"v":{"m":"2020-09-27","ct":{"fa":"yyyy-MM-dd","t":"d"},"v":44101}},{"r":4,"c":6,"v":{"v":"31141419900913891X","ct":{"fa":"@","t":"s"},"m":"31141419900913891X"}},{"r":4,"c":7,"v":{"v":49865342456,"ct":{"fa":"General","t":"n"},"m":"49865342456"}},{"r":5,"c":0,"v":{"ct":{"fa":"General","t":"g"},"v":"Develop","m":"Develop"}},{"r":5,"c":1,"v":{"m":"Fail","ct":{"fa":"General","t":"g"},"v":"Fail"}},{"r":5,"c":2,"v":{"v":3,"ct":{"fa":"General","t":"n"},"m":"3"}},{"r":5,"c":3,"v":{"m":"Luckyexcel","ct":{"fa":"General","t":"g"},"v":"Luckyexcel"}},{"r":5,"c":4,"v":{"ct":{"fa":"General","t":"g"},"v":"Tomorrow","m":"Tomorrow"}},{"r":5,"c":5,"v":{"ct":{"fa":"yyyy-MM-dd","t":"d"},"v":44071,"m":"2020-08-28"}},{"r":5,"c":6,"v":{"v":"Number","ct":{"fa":"@","t":"s"},"m":"Number"}},{"r":5,"c":7,"v":{"v":"Number","ct":{"fa":"General","t":"g"},"m":"Number"}},{"r":6,"c":0,"v":{"ct":{"fa":"General","t":"g"},"v":"Done","m":"Done"}},{"r":6,"c":1,"v":{"m":"Pass","ct":{"fa":"General","t":"g"},"v":"Pass"}},{"r":6,"c":2,"v":{"v":0,"ct":{"fa":"General","t":"n"},"m":"0"}},{"r":6,"c":3,"v":{"m":"Luckysheet Online","ct":{"fa":"General","t":"g"},"v":"Luckysheet Online"}},{"r":6,"c":4,"v":{"m":"Three","ct":{"fa":"General","t":"g"},"v":"Three"}},{"r":6,"c":5,"v":{"m":"2020-09-29","ct":{"fa":"yyyy-MM-dd","t":"d"},"v":44103}},{"r":6,"c":6,"v":{"v":"311414199301118910","ct":{"fa":"@","t":"s"},"m":"311414199301118910"}},{"r":6,"c":7,"v":{"v":23309873564,"ct":{"fa":"General","t":"n"},"m":"23309873564"}},{"r":7,"c":8,"v":{"v":null,"ct":{"fa":"General","t":"g"},"bl":1}}], @@ -576,4 +576,4 @@ const sheetDataVerification = { } } } -export default sheetDataVerification; \ No newline at end of file +// export default sheetDataVerification; \ No newline at end of file diff --git a/src/demoData/sheetFormula.js b/src/demoData/sheetFormula.js index 4e85f6b..1f1ee36 100644 --- a/src/demoData/sheetFormula.js +++ b/src/demoData/sheetFormula.js @@ -1,4 +1,4 @@ -const sheetFormula = { + window.sheetFormula = { "name": "Formula", "color": "", "config": { @@ -6597,4 +6597,4 @@ const sheetFormula = { "frozen": {"type":"row"} } -export default sheetFormula \ No newline at end of file +// export default sheetFormula \ No newline at end of file diff --git a/src/demoData/sheetPicture.js b/src/demoData/sheetPicture.js index 5643a59..c328988 100644 --- a/src/demoData/sheetPicture.js +++ b/src/demoData/sheetPicture.js @@ -1,4 +1,4 @@ -const sheetPicture = { +window.sheetPicture = { "name": "Picture", "index": "Sheet_3e4oe25C757r_1600925108337", "celldata": [], @@ -156,4 +156,4 @@ const sheetPicture = { } } -export default sheetPicture; \ No newline at end of file +// export default sheetPicture; \ No newline at end of file diff --git a/src/demoData/sheetPivotTable.js b/src/demoData/sheetPivotTable.js index f3f7bd6..b938b41 100644 --- a/src/demoData/sheetPivotTable.js +++ b/src/demoData/sheetPivotTable.js @@ -1,4 +1,4 @@ -const sheetPivotTable = { +window.sheetPivotTable = { "name": "PivotTable", "color": "", "config": {}, @@ -186,4 +186,4 @@ const sheetPivotTable = { } } -export default sheetPivotTable; \ No newline at end of file +// export default sheetPivotTable; \ No newline at end of file diff --git a/src/demoData/sheetPivotTableData.js b/src/demoData/sheetPivotTableData.js index 3946ff9..3e3407c 100644 --- a/src/demoData/sheetPivotTableData.js +++ b/src/demoData/sheetPivotTableData.js @@ -1,4 +1,4 @@ -const sheetPivotTableData = { +window.sheetPivotTableData = { "name": "PivotTableData", "color": "", "config": { @@ -738,4 +738,4 @@ const sheetPivotTableData = { "scrollTop": 0 } -export default sheetPivotTableData; \ No newline at end of file +// export default sheetPivotTableData; \ No newline at end of file diff --git a/src/demoData/sheetSparkline.js b/src/demoData/sheetSparkline.js index aac8d65..031c445 100644 --- a/src/demoData/sheetSparkline.js +++ b/src/demoData/sheetSparkline.js @@ -1,4 +1,4 @@ -const sheetSparkline = { +window.sheetSparkline = { "name": "Sparkline", "color": "", "config": { @@ -7063,4 +7063,4 @@ const sheetSparkline = { "luckysheet_alternateformat_save": [] } -export default sheetSparkline; \ No newline at end of file +// export default sheetSparkline; \ No newline at end of file diff --git a/src/demoData/sheetTable.js b/src/demoData/sheetTable.js index 0623103..c3ba4ba 100644 --- a/src/demoData/sheetTable.js +++ b/src/demoData/sheetTable.js @@ -1,4 +1,4 @@ -const sheetTable = { +window.sheetTable = { "name": "Table", "color": "", "config": { @@ -1065,4 +1065,4 @@ const sheetTable = { }] } -export default sheetTable; \ No newline at end of file +// export default sheetTable; \ No newline at end of file diff --git a/src/index.html b/src/index.html index 3eadc5a..f013574 100644 --- a/src/index.html +++ b/src/index.html @@ -24,22 +24,33 @@ + + + + + + + + + + + -