Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(demo): ie11
Browse files Browse the repository at this point in the history
Compatible with ie11

fix #234
  • Loading branch information
renxxing committed Nov 19, 2020
1 parent e0d656f commit e7ddc39
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 37 deletions.
5 changes: 5 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/demoData/demoFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', `<a id="container" href="${link}" target="_blank" style="z-index:2;width:50px;height:50px;line-height:50px;position:fixed;right:40px;bottom:86px;border-radius:50px;cursor:pointer;background:rgb(71,133,249);color:#fff;text-align:center;text-decoration:none;">${text}</a>`);
document.querySelector("body").insertAdjacentHTML('beforeend', '<a id="container" href="'+ link +'" target="_blank" style="z-index:2;width:50px;height:50px;line-height:50px;position:fixed;right:40px;bottom:86px;border-radius:50px;cursor:pointer;background:rgb(71,133,249);color:#fff;text-align:center;text-decoration:none;">'+ text +'</a>');
}

supportButton()
Expand Down
4 changes: 2 additions & 2 deletions src/demoData/sheetCell.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sheetCell = {
window.sheetCell = {
"name": "Cell",
"config": {
"merge": {
Expand Down Expand Up @@ -1575,4 +1575,4 @@ const sheetCell = {
"scrollLeft": 0,
"scrollTop": 0
}
export default sheetCell
// export default sheetCell
4 changes: 2 additions & 2 deletions src/demoData/sheetChart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sheetChart = {
window.sheetChart = {
"name": "Chart",
"color": "",
"status": 0,
Expand Down Expand Up @@ -4915,4 +4915,4 @@ const sheetChart = {
}]
}

export default sheetChart
// export default sheetChart
4 changes: 2 additions & 2 deletions src/demoData/sheetComment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sheetComment = {
window.sheetComment = {
"name": "Comment",
"color": "",
"config": {
Expand Down Expand Up @@ -64,4 +64,4 @@ const sheetComment = {
"scrollTop": 0
}

export default sheetComment;
// export default sheetComment;
4 changes: 2 additions & 2 deletions src/demoData/sheetConditionFormat.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sheetConditionFormat = {
window.sheetConditionFormat = {
"name": "Conditional Format",
"color": "",
"zoomRatio":1,
Expand Down Expand Up @@ -6538,4 +6538,4 @@ const sheetConditionFormat = {
}]
}

export default sheetConditionFormat;
// export default sheetConditionFormat;
4 changes: 2 additions & 2 deletions src/demoData/sheetDataVerification.js
Original file line number Diff line number Diff line change
@@ -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}}],
Expand Down Expand Up @@ -576,4 +576,4 @@ const sheetDataVerification = {
}
}
}
export default sheetDataVerification;
// export default sheetDataVerification;
4 changes: 2 additions & 2 deletions src/demoData/sheetFormula.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sheetFormula = {
window.sheetFormula = {
"name": "Formula",
"color": "",
"config": {
Expand Down Expand Up @@ -6597,4 +6597,4 @@ const sheetFormula = {
"frozen": {"type":"row"}
}

export default sheetFormula
// export default sheetFormula
4 changes: 2 additions & 2 deletions src/demoData/sheetPicture.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/demoData/sheetPivotTable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sheetPivotTable = {
window.sheetPivotTable = {
"name": "PivotTable",
"color": "",
"config": {},
Expand Down Expand Up @@ -186,4 +186,4 @@ const sheetPivotTable = {
}
}

export default sheetPivotTable;
// export default sheetPivotTable;
4 changes: 2 additions & 2 deletions src/demoData/sheetPivotTableData.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sheetPivotTableData = {
window.sheetPivotTableData = {
"name": "PivotTableData",
"color": "",
"config": {
Expand Down Expand Up @@ -738,4 +738,4 @@ const sheetPivotTableData = {
"scrollTop": 0
}

export default sheetPivotTableData;
// export default sheetPivotTableData;
4 changes: 2 additions & 2 deletions src/demoData/sheetSparkline.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sheetSparkline = {
window.sheetSparkline = {
"name": "Sparkline",
"color": "",
"config": {
Expand Down Expand Up @@ -7063,4 +7063,4 @@ const sheetSparkline = {
"luckysheet_alternateformat_save": []
}

export default sheetSparkline;
// export default sheetSparkline;
4 changes: 2 additions & 2 deletions src/demoData/sheetTable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sheetTable = {
window.sheetTable = {
"name": "Table",
"color": "",
"config": {
Expand Down Expand Up @@ -1065,4 +1065,4 @@ const sheetTable = {
}]
}

export default sheetTable;
// export default sheetTable;
37 changes: 24 additions & 13 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,33 @@
<!-- 1 -->
<!-- demo feature, non-production use -->
<script src="./demoData/demoFeature.js"></script>
<script src="./demoData/sheetFormula.js"></script>
<script src="./demoData/sheetCell.js"></script>
<script src="./demoData/sheetConditionFormat.js"></script>
<script src="./demoData/sheetTable.js"></script>
<script src="./demoData/sheetComment.js"></script>
<script src="./demoData/sheetPivotTableData.js"></script>
<script src="./demoData/sheetPivotTable.js"></script>
<script src="./demoData/sheetSparkline.js"></script>
<script src="./demoData/sheetChart.js"></script>
<script src="./demoData/sheetPicture.js"></script>
<script src="./demoData/sheetDataVerification.js"></script>

<script type="module">
import sheetFormula from './demoData/sheetFormula.js'
import sheetCell from './demoData/sheetCell.js'
import sheetConditionFormat from './demoData/sheetConditionFormat.js'
import sheetTable from './demoData/sheetTable.js'
import sheetComment from './demoData/sheetComment.js'
import sheetPivotTableData from './demoData/sheetPivotTableData.js'
import sheetPivotTable from './demoData/sheetPivotTable.js'
import sheetSparkline from './demoData/sheetSparkline.js'
import sheetChart from './demoData/sheetChart.js'
import sheetPicture from './demoData/sheetPicture.js'
import sheetDataVerification from './demoData/sheetDataVerification.js'
<script>
// import sheetFormula from './demoData/sheetFormula.js'
// import sheetCell from './demoData/sheetCell.js'
// import sheetConditionFormat from './demoData/sheetConditionFormat.js'
// import sheetTable from './demoData/sheetTable.js'
// import sheetComment from './demoData/sheetComment.js'
// import sheetPivotTableData from './demoData/sheetPivotTableData.js'
// import sheetPivotTable from './demoData/sheetPivotTable.js'
// import sheetSparkline from './demoData/sheetSparkline.js'
// import sheetChart from './demoData/sheetChart.js'
// import sheetPicture from './demoData/sheetPicture.js'
// import sheetDataVerification from './demoData/sheetDataVerification.js'

// According to the browser language
let lang = luckysheetDemoUtil.language() === 'zh' ? 'zh' : 'en';
var lang = luckysheetDemoUtil.language() === 'zh' ? 'zh' : 'en';

$(function () {
luckysheet.create({
Expand Down

0 comments on commit e7ddc39

Please sign in to comment.