Browse Source

Merge pull request #396 from flowerField/master

设置文本格式默认选中为自动并替换多余的符号
master
文顶顶 5 years ago
committed by GitHub
parent
commit
caa6ccbc18
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      src/controllers/constant.js
  2. 3
      src/controllers/menuButton.js
  3. 2
      src/controllers/mobile.js
  4. 2
      src/controllers/pivotTable.js
  5. 2
      src/controllers/postil.js
  6. 2
      src/controllers/sheetBar.js
  7. 2
      src/controllers/sheetmanage.js
  8. 2
      src/css/luckysheet-core.css
  9. 10
      src/global/formula.js

20
src/controllers/constant.js

@ -349,7 +349,7 @@ function rightclickHTML(){
${rightclick.to} ${rightclick.to}
<span class="luckysheet-cols-rows-shift-right">${rightclick.right}</span> <span class="luckysheet-cols-rows-shift-right">${rightclick.right}</span>
${rightclick.add} ${rightclick.add}
<input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/> <input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;margin-left:5px;"/>
<span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">${rightclick.column}</span> <span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">${rightclick.column}</span>
</div> </div>
</div> </div>
@ -375,7 +375,7 @@ function rightclickHTML(){
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
<span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">${rightclick.column}</span> <span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">${rightclick.column}</span>
<span class="luckysheet-cols-rows-shift-size luckysheet-mousedown-cancel">${rightclick.width}</span> <span class="luckysheet-cols-rows-shift-size luckysheet-mousedown-cancel">${rightclick.width}</span>
<input type="number" class="luckysheet-mousedown-cancel rcsize" min="0" max="255" placeholder="${rightclick.number}" value="" style="width:50px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"> <input type="number" class="luckysheet-mousedown-cancel rcsize" min="0" max="255" placeholder="${rightclick.number}" value="" style="width:50px;height:20px;box-sizing:border-box;text-align: center;margin-left:5px;">
px px
</div> </div>
</div> </div>
@ -438,9 +438,9 @@ function rightclickHTML(){
<div id="luckysheet-copy-arraymore-confirm" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"> <div id="luckysheet-copy-arraymore-confirm" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
<span class="luckysheet-mousedown-cancel">${rightclick.array3}</span> <span class="luckysheet-mousedown-cancel">${rightclick.array3}</span>
<input type="number" id="luckysheet-copy-arraymore-row" min="1" class="luckysheet-mousedown-cancel" placeholder="${rightclick.row}" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;"/> <input type="number" id="luckysheet-copy-arraymore-row" min="1" class="luckysheet-mousedown-cancel" placeholder="${rightclick.row}" style="width:40px;height:20px;box-sizing:border-box;text-align: center;"/>
× ×
<input type="number" id="luckysheet-copy-arraymore-col" min="1" class="luckysheet-mousedown-cancel" placeholder="${rightclick.column}" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;"/> <input type="number" id="luckysheet-copy-arraymore-col" min="1" class="luckysheet-mousedown-cancel" placeholder="${rightclick.column}" style="width:40px;height:20px;box-sizing:border-box;text-align: center;"/>
</div> </div>
</div> </div>
<div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div> <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div>
@ -453,7 +453,7 @@ function rightclickHTML(){
<div id="luckysheet-copy-diagonaloffset" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"> <div id="luckysheet-copy-diagonaloffset" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
${rightclick.diagonalOffset} ${rightclick.diagonalOffset}
<input type="number" id="luckysheet-copy-diagonaloffset-value" class="luckysheet-mousedown-cancel" placeholder="${rightclick.offset}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/> <input type="number" id="luckysheet-copy-diagonaloffset-value" class="luckysheet-mousedown-cancel" placeholder="${rightclick.offset}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;margin-left:5px;"/>
${rightclick.column} ${rightclick.column}
</div> </div>
</div> </div>
@ -468,28 +468,28 @@ function rightclickHTML(){
<div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
${rightclick.to}${rightclick.top}${rightclick.add} ${rightclick.to}${rightclick.top}${rightclick.add}
<input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/> <input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;margin-left:5px;"/>
<span class="luckysheet-mousedown-cancel">${rightclick.row}</span> <span class="luckysheet-mousedown-cancel">${rightclick.row}</span>
</div> </div>
</div> </div>
<div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
${rightclick.to}${rightclick.bottom}${rightclick.add} ${rightclick.to}${rightclick.bottom}${rightclick.add}
<input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/> <input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;margin-left:5px;"/>
<span class="luckysheet-mousedown-cancel">${rightclick.row}</span> <span class="luckysheet-mousedown-cancel">${rightclick.row}</span>
</div> </div>
</div> </div>
<div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
${rightclick.to}${rightclick.left}${rightclick.add} ${rightclick.to}${rightclick.left}${rightclick.add}
<input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/> <input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;margin-left:5px;"/>
<span class="luckysheet-mousedown-cancel">${rightclick.column}</span> <span class="luckysheet-mousedown-cancel">${rightclick.column}</span>
</div> </div>
</div> </div>
<div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
${rightclick.to}${rightclick.right}${rightclick.add} ${rightclick.to}${rightclick.right}${rightclick.add}
<input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/> <input type="text" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;margin-left:5px;"/>
<span class="luckysheet-mousedown-cancel">${rightclick.column}</span> <span class="luckysheet-mousedown-cancel">${rightclick.column}</span>
</div> </div>
</div> </div>
@ -584,7 +584,7 @@ function rightclickHTML(){
<option value="root">${rightclick.root}</option> <option value="root">${rightclick.root}</option>
<option value="log">${rightclick.log}</option> <option value="log">${rightclick.log}</option>
</select> </select>
<input type="number" id="luckysheet-matrix-cal-value" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="2" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/> <input type="number" id="luckysheet-matrix-cal-value" class="luckysheet-mousedown-cancel" placeholder="${rightclick.number}" value="2" style="width:40px;height:20px;box-sizing:border-box;text-align: center;margin-left:5px;"/>
</div> </div>
</div> </div>
</div> </div>

3
src/controllers/menuButton.js

@ -431,12 +431,13 @@ const menuButton = {
//luckysheet-icon-fmt-other-menuButton_sub //luckysheet-icon-fmt-other-menuButton_sub
$("body").append(menu+submenu); $("body").append(menu+submenu);
$menuButton = $("#" + menuButtonId).width(250); $menuButton = $("#" + menuButtonId).width(250);
_this.focus($menuButton);
$menuButton.find(".luckysheet-cols-menuitem").click(function(){ $menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide(); $menuButton.hide();
luckysheetContainerFocus(); luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue"),itemname = $t.attr("itemname");; let $t = $(this), itemvalue = $t.attr("itemvalue"),itemname = $t.attr("itemname");
$("#luckysheet-icon-fmt-other").find(".luckysheet-toolbar-menu-button-caption").html(" "+ itemname +" "); $("#luckysheet-icon-fmt-other").find(".luckysheet-toolbar-menu-button-caption").html(" "+ itemname +" ");
if(itemvalue == "fmtOtherSelf"){ if(itemvalue == "fmtOtherSelf"){

2
src/controllers/mobile.js

@ -9,8 +9,6 @@ export default function mobileinit(){
//去除滚动条 //去除滚动条
Store.cellMainSrollBarSize = 0; Store.cellMainSrollBarSize = 0;
//滑动滚动表格 //滑动滚动表格
let luckysheet_touchmove_status = false, let luckysheet_touchmove_status = false,
luckysheet_touchmove_startPos = {}, luckysheet_touchmove_startPos = {},

2
src/controllers/pivotTable.js

@ -2729,7 +2729,7 @@ const pivotTable = {
let orderby = r == 0 ? "self" : ((row[r - 1].orderby == "self" || row[r - 1].orderby == null) ? item : (showType == "column" ? item + values[parseInt(row[r - 1].orderby)].fullname : item + locale_pivotTable.valueSum)); let orderby = r == 0 ? "self" : ((row[r - 1].orderby == "self" || row[r - 1].orderby == null) ? item : (showType == "column" ? item + values[parseInt(row[r - 1].orderby)].fullname : item + locale_pivotTable.valueSum));
if(name == null){ if(name == null){
name = locale_filter.valueBlank;; name = locale_filter.valueBlank;
} }
curentLevelarr_row.push({ "name": name, "fullname": item, "index": r, "orderby": orderby, "children": [] }); curentLevelarr_row.push({ "name": name, "fullname": item, "index": r, "orderby": orderby, "children": [] });

2
src/controllers/postil.js

@ -466,7 +466,7 @@ const luckysheetPostil = {
'<div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rb" data-type="rb"></div>' + '<div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rb" data-type="rb"></div>' +
'</div>' + '</div>' +
'<div style="width:100%;height:100%;overflow:hidden;">' + '<div style="width:100%;height:100%;overflow:hidden;">' +
'<div class="formulaInputFocus" style="width:132px;height:72px;line-height:20px;box-sizing:border-box;text-align: center;;word-break:break-all;" spellcheck="false" contenteditable="true">' + '<div class="formulaInputFocus" style="width:132px;height:72px;line-height:20px;box-sizing:border-box;text-align: center;word-break:break-all;" spellcheck="false" contenteditable="true">' +
'</div>' + '</div>' +
'</div>' + '</div>' +
'</div>' + '</div>' +

2
src/controllers/sheetBar.js

@ -20,7 +20,7 @@ import luckysheetConfigsetting from './luckysheetConfigsetting';
//表格底部名称栏区域 相关事件(增、删、改、隐藏显示、颜色等等) //表格底部名称栏区域 相关事件(增、删、改、隐藏显示、颜色等等)
let isInitialSheetConfig = false, luckysheetcurrentSheetitem = null, jfdbclicklagTimeout = null,oldSheetFileName = "";; let isInitialSheetConfig = false, luckysheetcurrentSheetitem = null, jfdbclicklagTimeout = null,oldSheetFileName = "";
function showsheetconfigmenu() { function showsheetconfigmenu() {
if (!isInitialSheetConfig) { if (!isInitialSheetConfig) {
isInitialSheetConfig = true; isInitialSheetConfig = true;

2
src/controllers/sheetmanage.js

@ -1793,7 +1793,7 @@ const sheetmanage = {
} }
else if(type == "cg"){ else if(type == "cg"){
let v = value, k = item.k; let v = value, k = item.k;
let config1 = _this.getSheetConfig(index);; let config1 = _this.getSheetConfig(index);
if(!(k in config1)){ if(!(k in config1)){
config1[k] = {}; config1[k] = {};

2
src/css/luckysheet-core.css

@ -139,7 +139,7 @@
position: relative; position: relative;
/* padding-left: 15px; */ /* padding-left: 15px; */
/* padding: 0px 0px 10px 15px; */ /* padding: 0px 0px 10px 15px; */
padding: 5px 0px 3px 15px;; padding: 5px 0px 3px 15px;
border-bottom: 1px solid #d4d4d4; border-bottom: 1px solid #d4d4d4;
white-space: nowrap; white-space: nowrap;
transition: all 0.2s; transition: all 0.2s;

10
src/global/formula.js

@ -1541,7 +1541,7 @@ const luckysheetformula = {
} }
if ((d[r][c].tb == "2" && d[r][c].v != null) || isInlineStringCell(d[r][c])) {//自动换行 if ((d[r][c].tb == "2" && d[r][c].v != null) || isInlineStringCell(d[r][c])) {//自动换行
let defaultrowlen = Store.defaultrowlen;; let defaultrowlen = Store.defaultrowlen;
let canvas = $("#luckysheetTableContent").get(0).getContext("2d"); let canvas = $("#luckysheetTableContent").get(0).getContext("2d");
// offlinecanvas.textBaseline = 'top'; //textBaseline以top计算 // offlinecanvas.textBaseline = 'top'; //textBaseline以top计算
@ -2176,7 +2176,7 @@ const luckysheetformula = {
} }
let p = i - 1, let p = i - 1,
s_pre = null;; s_pre = null;
if (p >= 0) { if (p >= 0) {
do { do {
@ -3501,7 +3501,7 @@ const luckysheetformula = {
} }
else if (s == '&' && matchConfig.squote == 0 && matchConfig.dquote == 0 && matchConfig.braces == 0) { else if (s == '&' && matchConfig.squote == 0 && matchConfig.dquote == 0 && matchConfig.braces == 0) {
if (str.length > 0) { if (str.length > 0) {
function_str += _this.functionHTML(str) + '<span dir="auto" class="luckysheet-formula-text-calc">' + '&' + '</span>';; function_str += _this.functionHTML(str) + '<span dir="auto" class="luckysheet-formula-text-calc">' + '&' + '</span>';
str = ""; str = "";
} }
else { else {
@ -3514,7 +3514,7 @@ const luckysheetformula = {
s_next = funcstack[i + 1]; s_next = funcstack[i + 1];
} }
let p = i - 1, s_pre = null;; let p = i - 1, s_pre = null;
if (p >= 0) { if (p >= 0) {
do { do {
s_pre = funcstack[p--]; s_pre = funcstack[p--];
@ -3679,7 +3679,7 @@ const luckysheetformula = {
s_next = funcstack[i + 1]; s_next = funcstack[i + 1];
} }
let p = i - 1, s_pre = null;; let p = i - 1, s_pre = null;
if (p >= 0) { if (p >= 0) {
do { do {
s_pre = funcstack[p--]; s_pre = funcstack[p--];

Loading…
Cancel
Save