Просмотр исходного кода

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/SCCommon

vian 5 лет назад
Родитель
Сommit
45db011312

+ 1 - 1
handsontable/handsontable.d.ts

@@ -38,7 +38,7 @@ declare namespace _Handsontable {
 
     destroy(): void;
 
-    destroyEditor(revertOriginal?: boolean, prepareEditorIfNeeded?: boolean, isOutClick? : boolean): void;
+    destroyEditor(revertOriginal?: boolean, prepareEditorIfNeeded?: boolean): void;
 
     emptySelectedCells(): void;
 

+ 1 - 1
handsontable/package.json

@@ -10,7 +10,7 @@
     "url": "https://github.com/handsontable/handsontable/issues"
   },
   "author": "Handsoncode <hello@handsontable.com>",
-  "version": "6.3.3",
+  "version": "6.3.4",
   "browser": "dist/handsontable.js",
   "main": "commonjs/index.js",
   "module": "es/index.js",

+ 20 - 20
handsontable/src/core.js

@@ -72,7 +72,8 @@ let activeGuid = null;
 export default function Core(rootElement, userSettings, rootInstanceSymbol = false) {
   let preventScrollingToCell = false;
   let instance = this;
-  let GridSettings = function() {};
+  let GridSettings = function() {
+  };
   const eventManager = new EventManager(instance);
   let priv;
   let datamap;
@@ -538,7 +539,7 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
         }
         // should I add empty cols to meet minSpareCols?
         if (priv.settings.minSpareCols && !priv.settings.columns && instance.dataType === 'array' &&
-            emptyCols < priv.settings.minSpareCols) {
+          emptyCols < priv.settings.minSpareCols) {
           for (; emptyCols < priv.settings.minSpareCols && instance.countCols() < priv.settings.maxCols; emptyCols++) {
             datamap.createCol(instance.countCols(), 1, 'auto');
           }
@@ -709,8 +710,8 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
           }
           for (r = 0; r < rlen; r++) {
             if ((end && current.row > end.row && rowSelectionLength > rowInputLength) ||
-                (!priv.settings.allowInsertRow && current.row > instance.countRows() - 1) ||
-                (current.row >= priv.settings.maxRows)) {
+              (!priv.settings.allowInsertRow && current.row > instance.countRows() - 1) ||
+              (current.row >= priv.settings.maxRows)) {
               break;
             }
             const visualRow = r - skippedRow;
@@ -736,8 +737,8 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
 
             for (c = 0; c < clen; c++) {
               if ((end && current.col > end.col && colSelectionLength > colInputLength) ||
-                  (!priv.settings.allowInsertColumn && current.col > instance.countCols() - 1) ||
-                  (current.col >= priv.settings.maxCols)) {
+                (!priv.settings.allowInsertColumn && current.col > instance.countCols() - 1) ||
+                (current.col >= priv.settings.maxCols)) {
                 break;
               }
               cellMeta = instance.getCellMeta(current.row, current.col);
@@ -862,7 +863,8 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
         this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1;
         this.checkIfQueueIsEmpty();
       },
-      onQueueEmpty() { },
+      onQueueEmpty() {
+      },
       checkIfQueueIsEmpty() {
         if (this.validatorsInQueue === 0 && resolved === false) {
           resolved = true;
@@ -1238,10 +1240,9 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
    * @function destroyEditor
    * @param {Boolean} [revertOriginal=false] If `true`, the previous value will be restored. Otherwise, the edited value will be saved.
    * @param {Boolean} [prepareEditorIfNeeded=true] If `true` the editor under the selected cell will be prepared to open.
-   * @param {Boolean} [prepareEditorIfNeeded=false] 解决outsideClickDeselects为False时,切换tab导致表头行号等渲染出错问题,点击表格外部,并不需要重新刷新表格
    */
-  this.destroyEditor = function(revertOriginal = false, prepareEditorIfNeeded = true,isOutClick = false) {
-    instance._refreshBorders(revertOriginal, prepareEditorIfNeeded, isOutClick);
+  this.destroyEditor = function(revertOriginal = false, prepareEditorIfNeeded = true) {
+    instance._refreshBorders(revertOriginal, prepareEditorIfNeeded);
   };
 
   /**
@@ -1357,12 +1358,12 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
   };
 
   /**
-  * Returns the last coordinates applied to the table as a CellRange object.
-  *
-  * @memberof Core#
-  * @function getSelectedRangeLast
-  * @since 0.36.0
-  * @returns {CellRange|undefined} Selected range object or undefined` if there is no selection.
+   * Returns the last coordinates applied to the table as a CellRange object.
+   *
+   * @memberof Core#
+   * @function getSelectedRangeLast
+   * @since 0.36.0
+   * @returns {CellRange|undefined} Selected range object or undefined` if there is no selection.
    */
   this.getSelectedRangeLast = function() {
     const selectedRange = this.getSelectedRange();
@@ -2200,7 +2201,7 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
   this.getDataType = function(rowFrom, columnFrom, rowTo, columnTo) {
     const coords = rowFrom === void 0 ? [0, 0, this.countRows(), this.countCols()] : [rowFrom, columnFrom, rowTo, columnTo];
     const [rowStart, columnStart] = coords;
-    let [,, rowEnd, columnEnd] = coords;
+    let [, , rowEnd, columnEnd] = coords;
     let previousType = null;
     let currentType = null;
 
@@ -3581,11 +3582,10 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
    * @private
    * @param {Boolean} [revertOriginal=false] If `true`, the previous value will be restored. Otherwise, the edited value will be saved.
    * @param {Boolean} [prepareEditorIfNeeded=true] If `true` the editor under the selected cell will be prepared to open.
-   * @param {Boolean} [isOutClick=false] If `false` 重新刷新表格. If ture 说明是点击表格外不需要重新刷新
    */
-  this._refreshBorders = function(revertOriginal = false, prepareEditorIfNeeded = true,isOutClick = false) {
+  this._refreshBorders = function(revertOriginal = false, prepareEditorIfNeeded = true) {
     editorManager.destroyEditor(revertOriginal);
-    if( isOutClick===false ) instance.view.render();
+    instance.view.render();
 
     if (prepareEditorIfNeeded && selection.isSelected()) {
       editorManager.prepareEditor();

+ 6 - 7
handsontable/src/plugins/contextMenu/menu.js

@@ -101,8 +101,6 @@ class Menu {
    */
   open() {
     this.runLocalHooks('beforeOpen');
-    // 2021-02-24  zhang createContainer里面先查找是否存在,有则返回。 如果不这样做的话,element-tabs 设置成lazzy后,后加载的页面会冲掉之前页面的右键菜单
-    this.container = this.createContainer(this.options.name);
     this.container.removeAttribute('style');
     this.container.style.display = 'block';
 
@@ -286,8 +284,8 @@ class Menu {
 
     // Don't close context menu if item is disabled or it has submenu
     if (selectedItem.disabled === true ||
-        (typeof selectedItem.disabled === 'function' && selectedItem.disabled.call(this.hot) === true) ||
-        selectedItem.submenu) {
+      (typeof selectedItem.disabled === 'function' && selectedItem.disabled.call(this.hot) === true) ||
+      selectedItem.submenu) {
       autoClose = false;
     }
 
@@ -564,7 +562,8 @@ class Menu {
    * @private
    */
   blockMainTableCallbacks() {
-    this._afterScrollCallback = function() {};
+    this._afterScrollCallback = function() {
+    };
     this.hot.addHook('afterScrollVertically', this._afterScrollCallback);
     this.hot.addHook('afterScrollHorizontally', this._afterScrollCallback);
   }
@@ -710,9 +709,9 @@ class Menu {
     if (this.options.standalone && this.hotMenu && !isChildOf(event.target, this.hotMenu.rootElement)) {
       this.close(true);
 
-    // Automatically close menu when clicked element is not belongs to menu or submenu (not necessarily to itself)
+      // Automatically close menu when clicked element is not belongs to menu or submenu (not necessarily to itself)
     } else if ((this.isAllSubMenusClosed() || this.isSubMenu()) &&
-        (!isChildOf(event.target, '.htMenu') && isChildOf(event.target, document))) {
+      (!isChildOf(event.target, '.htMenu') && isChildOf(event.target, document))) {
       this.close(true);
     }
   }

+ 1 - 1
handsontable/src/tableView.js

@@ -170,7 +170,7 @@ function TableView(instance) {
     if (outsideClickDeselects) {
       instance.deselectCell();
     } else {
-      instance.destroyEditor(false, false, true);
+      instance.destroyEditor(false, false);
       instance.unlisten();// 点击tab等其它handsontable外的元素时,handsontable要解除监听键盘等事件. handsontable只在mouseup事件通过isOutsideInput只针对input 等几个输入元素
     }
   });