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

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mengshukeji committed Oct 30, 2020
2 parents c1ed417 + f860b49 commit e6c30a7
Show file tree
Hide file tree
Showing 10 changed files with 432 additions and 103 deletions.
19 changes: 13 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ const babelConfig = {
plugins: [
],
presets: [
'@babel/preset-env'
['@babel/preset-env', {
useBuiltIns: 'usage',
corejs: 3,
targets: {
chrome: 58,
ie: 11
}
}]
]
};

Expand All @@ -68,7 +75,7 @@ const paths = {
destStaticCssImages: ['dist/css'],

//core es module
core: ['src/**/*.js','!src/demoData/*.js','src/expendPlugins/**/plugin.js','!src/plugins/js/*.js'],
core: ['src/**/*.js','!src/demoData/*.js','src/expendPlugins/**/plugin.js','!src/plugins/js/*.js'],

//plugins src
pluginsCss: ['src/plugins/css/*.css'],
Expand Down Expand Up @@ -98,7 +105,7 @@ const paths = {
concatPlugins: 'plugins.css',
concatCss: 'luckysheet.css',
concatPluginsJs: 'plugin.js',

//plugins dest
destPluginsCss: ['dist/plugins/css'],
destPlugins: ['dist/plugins'],
Expand Down Expand Up @@ -187,7 +194,7 @@ async function core() {
inlineDynamicImports:true,
});
}

}

// According to the build tag in html, package js and css
Expand All @@ -196,7 +203,7 @@ function pluginsCss() {
.pipe(concat(paths.concatPluginsCss))
.pipe(gulpif(production, cleanCSS()))
.pipe(dest(paths.destPluginsCss))

}

function plugins() {
Expand Down Expand Up @@ -255,4 +262,4 @@ const build = series(clean, parallel(pluginsCss, plugins, css, pluginsJs, copySt

exports.dev = dev;
exports.build = build;
exports.default = dev;
exports.default = dev;
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"browser": "dist/luckysheet.umd.js",
"devDependencies": {
"@babel/preset-env": "^7.10.2",
"@babel/runtime-corejs3": "^7.12.1",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@rollup/plugin-babel": "^5.0.3",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"browser-sync": "^2.26.7",
Expand All @@ -21,12 +22,13 @@
"gulp-if": "^3.0.0",
"gulp-uglify": "^3.0.2",
"gulp-useref": "^4.0.1",
"rollup": "^2.16.1",
"rollup": "^2.32.1",
"rollup-plugin-terser": "^6.1.0",
"standard-version": "^8.0.2",
"vuepress": "^1.5.0"
},
"dependencies": {
"@babel/runtime": "^7.12.1",
"jspdf": "^2.1.1"
},
"scripts": {
Expand Down
168 changes: 96 additions & 72 deletions src/controllers/freezen.js
Original file line number Diff line number Diff line change
Expand Up @@ -1176,61 +1176,73 @@ const luckysheetFreezen = {
let show = true;
let show2 = true;

if(postil_top + postil_height < freezenTop){
$(e).show().find(".luckysheet-postil-show-main").css("top", postil_top + offTop);
$(e).show().find(".arrowCanvas").css("top", size[1] + offTop);
}
else{
if(postil_top < freezenTop + offTop){
if(postil_top + postil_height <= freezenTop + offTop){
show = false;
if(r >= _this.freezenhorizontaldata[1]){
if(postil_top + postil_height < freezenTop){
$(e).show().find(".luckysheet-postil-show-main").css("top", postil_top + offTop);
$(e).show().find(".arrowCanvas").css("top", size[1] + offTop);
}
else{
if(postil_top < freezenTop + offTop){
if(postil_top + postil_height <= freezenTop + offTop){
show = false;
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({ "top": freezenTop + offTop, "height": postil_height - (freezenTop + offTop - postil_top) });
$(e).show().find(".formulaInputFocus").css("margin-top", -(freezenTop + offTop - postil_top));
$(e).show().find(".arrowCanvas").hide();

show2 = false;
}
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({ "top": freezenTop + offTop, "height": postil_height - (freezenTop + offTop - postil_top) });
$(e).show().find(".formulaInputFocus").css("margin-top", -(freezenTop + offTop - postil_top));
$(e).show().find(".arrowCanvas").hide();

show2 = false;
$(e).show().find(".luckysheet-postil-show-main").css({
"top": postil_top,
"height": postil_height
});
$(e).show().find(".formulaInputFocus").css("margin-top", 0);
$(e).show().find(".arrowCanvas").css("top", size[1]);
// luckysheetPostil.buildPs(r, c, postil);
}
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({
"top": postil_top,
"height": postil_height
});
$(e).show().find(".formulaInputFocus").css("margin-top", 0);
$(e).show().find(".arrowCanvas").css("top", size[1]);
// luckysheetPostil.buildPs(r, c, postil);
}
}

if(postil_left + postil_width < freezenLeft){
$(e).show().find(".luckysheet-postil-show-main").css("left", postil_left + offLeft);
$(e).show().find(".arrowCanvas").css("left", size[0] + offLeft);
}
else{
if(postil_left < freezenLeft + offLeft){
if(postil_left + postil_width <= freezenLeft + offLeft){
show = false;
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({ "left": freezenLeft + offLeft, "width": postil_width - (freezenLeft + offLeft - postil_left) });
$(e).show().find(".formulaInputFocus").css("margin-left", -(freezenLeft + offLeft - postil_left));
$(e).show().find(".arrowCanvas").hide();
$(e).show().find(".luckysheet-postil-show-main").css("top", postil_top + offTop);
$(e).show().find(".arrowCanvas").css("top", size[1] + offTop);
}

show2 = false;
}
if(c >= _this.freezenverticaldata[1]){
if(postil_left + postil_width < freezenLeft){
$(e).show().find(".luckysheet-postil-show-main").css("left", postil_left + offLeft);
$(e).show().find(".arrowCanvas").css("left", size[0] + offLeft);
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({
"left": postil_left,
"width": postil_width
});
$(e).show().find(".formulaInputFocus").css("margin-left", 0);
$(e).show().find(".arrowCanvas").css("left", size[0]);
// luckysheetPostil.buildPs(r, c, postil);
if(postil_left < freezenLeft + offLeft){
if(postil_left + postil_width <= freezenLeft + offLeft){
show = false;
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({ "left": freezenLeft + offLeft, "width": postil_width - (freezenLeft + offLeft - postil_left) });
$(e).show().find(".formulaInputFocus").css("margin-left", -(freezenLeft + offLeft - postil_left));
$(e).show().find(".arrowCanvas").hide();

show2 = false;
}
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({
"left": postil_left,
"width": postil_width
});
$(e).show().find(".formulaInputFocus").css("margin-left", 0);
$(e).show().find(".arrowCanvas").css("left", size[0]);
// luckysheetPostil.buildPs(r, c, postil);
}
}
}
else{
$(e).show().find(".luckysheet-postil-show-main").css("left", postil_left + offLeft);
$(e).show().find(".arrowCanvas").css("left", size[0] + offLeft);
}

if(!show){
$(e).hide();
Expand Down Expand Up @@ -1281,24 +1293,30 @@ const luckysheetFreezen = {

let size = luckysheetPostil.getArrowCanvasSize(postil_left, postil_top, toX, toY);

if(postil_top + postil_height < freezenTop){
$(e).show().find(".luckysheet-postil-show-main").css("top", postil_top + offTop);
$(e).show().find(".arrowCanvas").css("top", size[1] + offTop);
}
else{
if(postil_top < freezenTop + offTop){
if(postil_top + postil_height <= freezenTop + offTop){
$(e).hide();
if(r >= _this.freezenhorizontaldata[1]){
if(postil_top + postil_height < freezenTop){
$(e).show().find(".luckysheet-postil-show-main").css("top", postil_top + offTop);
$(e).show().find(".arrowCanvas").css("top", size[1] + offTop);
}
else{
if(postil_top < freezenTop + offTop){
if(postil_top + postil_height <= freezenTop + offTop){
$(e).hide();
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({ "top": freezenTop + offTop, "height": postil_height - (freezenTop + offTop - postil_top) });
$(e).show().find(".formulaInputFocus").css("margin-top", -(freezenTop + offTop - postil_top));
$(e).show().find(".arrowCanvas").hide();
}
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({ "top": freezenTop + offTop, "height": postil_height - (freezenTop + offTop - postil_top) });
$(e).show().find(".formulaInputFocus").css("margin-top", -(freezenTop + offTop - postil_top));
$(e).show().find(".arrowCanvas").hide();
luckysheetPostil.buildPs(r, c, postil);
}
}
else{
luckysheetPostil.buildPs(r, c, postil);
}
}
else{
$(e).show().find(".luckysheet-postil-show-main").css("top", postil_top + offTop);
$(e).show().find(".arrowCanvas").css("top", size[1] + offTop);
}
})
}
Expand Down Expand Up @@ -1342,24 +1360,30 @@ const luckysheetFreezen = {

let size = luckysheetPostil.getArrowCanvasSize(postil_left, postil_top, toX, toY);

if(postil_left + postil_width < freezenLeft){
$(e).show().find(".luckysheet-postil-show-main").css("left", postil_left + offLeft);
$(e).show().find(".arrowCanvas").css("left", size[0] + offLeft);
}
else{
if(postil_left < freezenLeft + offLeft){
if(postil_left + postil_width <= freezenLeft + offLeft){
$(e).hide();
if(c >= _this.freezenverticaldata[1]){
if(postil_left + postil_width < freezenLeft){
$(e).show().find(".luckysheet-postil-show-main").css("left", postil_left + offLeft);
$(e).show().find(".arrowCanvas").css("left", size[0] + offLeft);
}
else{
if(postil_left < freezenLeft + offLeft){
if(postil_left + postil_width <= freezenLeft + offLeft){
$(e).hide();
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({ "left": freezenLeft + offLeft, "width": postil_width - (freezenLeft + offLeft - postil_left) });
$(e).show().find(".formulaInputFocus").css("margin-left", -(freezenLeft + offLeft - postil_left));
$(e).show().find(".arrowCanvas").hide();
}
}
else{
$(e).show().find(".luckysheet-postil-show-main").css({ "left": freezenLeft + offLeft, "width": postil_width - (freezenLeft + offLeft - postil_left) });
$(e).show().find(".formulaInputFocus").css("margin-left", -(freezenLeft + offLeft - postil_left));
$(e).show().find(".arrowCanvas").hide();
luckysheetPostil.buildPs(r, c, postil);
}
}
else{
luckysheetPostil.buildPs(r, c, postil);
}
}
else{
$(e).show().find(".luckysheet-postil-show-main").css("left", postil_left + offLeft);
$(e).show().find(".arrowCanvas").css("left", size[0] + offLeft);
}
})
}
Expand Down
Loading

0 comments on commit e6c30a7

Please sign in to comment.