Skip to content

Commit

Permalink
Merge branch 'release/0.34.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jansiegel committed Aug 2, 2017
2 parents 4a900a7 + 546a825 commit 4b290f9
Show file tree
Hide file tree
Showing 32 changed files with 4,222 additions and 906 deletions.
13 changes: 11 additions & 2 deletions .travis.yml
Expand Up @@ -3,7 +3,16 @@ language: node_js
sudo: false

node_js:
- "6"
- '6'

before_script:
- "export TZ=Europe/Warsaw"
- export TZ=Europe/Warsaw
- chmod ugo+x test/scripts/trigger-hot-builder-tests.sh

after_success:
- "./test/scripts/trigger-hot-builder-tests.sh"

notifications:
email: false
slack:
secure: LDlPC3IbXLbve4yq6kNznoIR5WgMhS2x+/KomgbVRDkUpySzyt27dUtRJqgkAqtkHhDhd0FbpROZNPriQVJI8nLLux0xdl9dngy6Lazl2qVzShrtdN01I3lVxysJlDM3phKHQCPmGhd/1v1qjfTAu45tM9pnYACSnDfdfh46b84=
4 changes: 2 additions & 2 deletions dist/handsontable.css

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

4 changes: 2 additions & 2 deletions dist/handsontable.full.css
Expand Up @@ -23,8 +23,8 @@
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Version: 0.33.0
* Date: Mon Jul 10 2017 10:08:33 GMT+0200 (CEST)
* Version: 0.34.0
* Date: Thu Jul 27 2017 13:34:25 GMT+0200 (CEST)
*/
/**
* Fix for bootstrap styles
Expand Down
159 changes: 99 additions & 60 deletions dist/handsontable.full.js
Expand Up @@ -23,8 +23,8 @@
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Version: 0.33.0
* Date: Mon Jul 10 2017 10:08:33 GMT+0200 (CEST)
* Version: 0.34.0
* Date: Thu Jul 27 2017 13:34:25 GMT+0200 (CEST)
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
Expand Down Expand Up @@ -2893,6 +2893,18 @@ var REGISTERED_HOOKS = [
*/
'afterSetCellMeta',

/**
* Called after cell meta is removed.
*
* @event Hooks#afterRemoveCellMeta
* @since 0.33.1
* @param {Number} row Visual row index.
* @param {Number} col Visual column index.
* @param {String} key The removed meta key.
* @param {*} value Value which was under removed key of cell meta.
*/
'afterRemoveCellMeta',

/**
* Called after cell data was changed.
*
Expand All @@ -2919,6 +2931,7 @@ var REGISTERED_HOOKS = [
* Fired after calling the `updateSettings` method.
*
* @event Hooks#afterUpdateSettings
* @param {Object} settings New settings object.
*/
'afterUpdateSettings',

Expand Down Expand Up @@ -3045,6 +3058,18 @@ var REGISTERED_HOOKS = [
*/
'beforeGetCellMeta',

/**
* Called before cell meta is removed.
*
* @event Hooks#beforeRemoveCellMeta
* @since 0.33.1
* @param {Number} row Visual row index.
* @param {Number} col Visual column index.
* @param {String} key The removed meta key.
* @param {*} value Value which is under removed key of cell meta.
*/
'beforeRemoveCellMeta',

/**
* @description
* Callback fired before Handsontable instance is initiated.
Expand Down Expand Up @@ -3922,6 +3947,7 @@ var Hooks = function () {
value: function createEmptyBucket() {
var bucket = Object.create(null);

// eslint-disable-next-line no-return-assign
(0, _array.arrayEach)(REGISTERED_HOOKS, function (hook) {
return bucket[hook] = [];
});
Expand Down Expand Up @@ -4203,6 +4229,7 @@ var Hooks = function () {
value: function destroy() {
var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

// eslint-disable-next-line no-return-assign
(0, _object.objectEach)(this.getBucket(context), function (value, key, bucket) {
return bucket[key].length = 0;
});
Expand Down Expand Up @@ -15674,7 +15701,7 @@ function Core(rootElement, userSettings) {
instance.view.wt.wtViewport.resetHasOversizedColumnHeadersMarked();
}

instance.runHooks('afterUpdateSettings');
instance.runHooks('afterUpdateSettings', settings);
}

grid.adjustRowsAndCols();
Expand Down Expand Up @@ -16142,16 +16169,29 @@ function Core(rootElement, userSettings) {
*
* @memberof Core#
* @function removeCellMeta
* @param {Number} row Visual/physical row index.
* @param {Number} col Visual/physical column index.
* @param {Number} row Visual row index.
* @param {Number} col Visual column index.
* @param {String} key Property name.
* @fires Hooks#beforeRemoveCellMeta
* @fires Hooks#afterRemoveCellMeta
*/
this.removeCellMeta = function (row, col, key) {
// TODO: First we use indexes as visual, after that, the same indexes are used as physical. This MUST be improved.
var cellMeta = instance.getCellMeta(row, col);
if (cellMeta[key] != undefined) {
delete priv.cellSettings[row][col][key];
var _recordTranslator$toP = recordTranslator.toPhysical(row, col),
_recordTranslator$toP2 = _slicedToArray(_recordTranslator$toP, 2),
physicalRow = _recordTranslator$toP2[0],
physicalColumn = _recordTranslator$toP2[1];

var cachedValue = priv.cellSettings[physicalRow][physicalColumn][key];

var hookResult = instance.runHooks('beforeRemoveCellMeta', row, col, key, cachedValue);

if (hookResult !== false) {
delete priv.cellSettings[physicalRow][physicalColumn][key];

instance.runHooks('afterRemoveCellMeta', row, col, key, cachedValue);
}

cachedValue = null;
};

/**
Expand Down Expand Up @@ -16206,25 +16246,22 @@ function Core(rootElement, userSettings) {
* @fires Hooks#afterSetCellMeta
*/
this.setCellMeta = function (row, col, key, val) {
var _recordTranslator$toP = recordTranslator.toPhysical(row, col);

var _recordTranslator$toP2 = _slicedToArray(_recordTranslator$toP, 2);

row = _recordTranslator$toP2[0];
col = _recordTranslator$toP2[1];
var _recordTranslator$toP3 = recordTranslator.toPhysical(row, col),
_recordTranslator$toP4 = _slicedToArray(_recordTranslator$toP3, 2),
physicalRow = _recordTranslator$toP4[0],
physicalColumn = _recordTranslator$toP4[1];


if (!priv.columnSettings[col]) {
priv.columnSettings[col] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);
if (!priv.columnSettings[physicalColumn]) {
priv.columnSettings[physicalColumn] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);
}

if (!priv.cellSettings[row]) {
priv.cellSettings[row] = [];
if (!priv.cellSettings[physicalRow]) {
priv.cellSettings[physicalRow] = [];
}
if (!priv.cellSettings[row][col]) {
priv.cellSettings[row][col] = new priv.columnSettings[col]();
if (!priv.cellSettings[physicalRow][physicalColumn]) {
priv.cellSettings[physicalRow][physicalColumn] = new priv.columnSettings[physicalColumn]();
}
priv.cellSettings[row][col][key] = val;
priv.cellSettings[physicalRow][physicalColumn][key] = val;
instance.runHooks('afterSetCellMeta', row, col, key, val);
};

Expand All @@ -16250,45 +16287,39 @@ function Core(rootElement, userSettings) {
* @fires Hooks#afterGetCellMeta
*/
this.getCellMeta = function (row, col) {
var prop = datamap.colToProp(col),
cellProperties;

var visualRow = row;
var visualCol = col;
var prop = datamap.colToProp(col);
var cellProperties = void 0;

var _recordTranslator$toP3 = recordTranslator.toPhysical(row, col);
var _recordTranslator$toP5 = recordTranslator.toPhysical(row, col),
_recordTranslator$toP6 = _slicedToArray(_recordTranslator$toP5, 2),
physicalRow = _recordTranslator$toP6[0],
physicalColumn = _recordTranslator$toP6[1];

var _recordTranslator$toP4 = _slicedToArray(_recordTranslator$toP3, 2);

row = _recordTranslator$toP4[0];
col = _recordTranslator$toP4[1];


if (!priv.columnSettings[col]) {
priv.columnSettings[col] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);
if (!priv.columnSettings[physicalColumn]) {
priv.columnSettings[physicalColumn] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);
}

if (!priv.cellSettings[row]) {
priv.cellSettings[row] = [];
if (!priv.cellSettings[physicalRow]) {
priv.cellSettings[physicalRow] = [];
}
if (!priv.cellSettings[row][col]) {
priv.cellSettings[row][col] = new priv.columnSettings[col]();
if (!priv.cellSettings[physicalRow][physicalColumn]) {
priv.cellSettings[physicalRow][physicalColumn] = new priv.columnSettings[physicalColumn]();
}

cellProperties = priv.cellSettings[row][col]; // retrieve cellProperties from cache
cellProperties = priv.cellSettings[physicalRow][physicalColumn]; // retrieve cellProperties from cache

cellProperties.row = row;
cellProperties.col = col;
cellProperties.visualRow = visualRow;
cellProperties.visualCol = visualCol;
cellProperties.row = physicalRow;
cellProperties.col = physicalColumn;
cellProperties.visualRow = row;
cellProperties.visualCol = col;
cellProperties.prop = prop;
cellProperties.instance = instance;

instance.runHooks('beforeGetCellMeta', row, col, cellProperties);
(0, _object.extend)(cellProperties, expandType(cellProperties)); // for `type` added in beforeGetCellMeta

if (cellProperties.cells) {
var settings = cellProperties.cells.call(cellProperties, row, col, prop);
var settings = cellProperties.cells.call(cellProperties, physicalRow, physicalColumn, prop);

if (settings) {
(0, _object.extend)(cellProperties, settings);
Expand Down Expand Up @@ -30035,7 +30066,7 @@ var arrayMapper = {
getValueByIndex: function getValueByIndex(index) {
var value = void 0;

/* eslint-disable no-cond-assign */
// eslint-disable-next-line no-cond-assign, no-return-assign
return (value = this._arrayMap[index]) === void 0 ? null : value;
},

Expand All @@ -30049,7 +30080,7 @@ var arrayMapper = {
getIndexByValue: function getIndexByValue(value) {
var index = void 0;

/* eslint-disable no-cond-assign */
// eslint-disable-next-line no-cond-assign, no-return-assign
return (index = this._arrayMap.indexOf(value)) === -1 ? null : index;
},

Expand Down Expand Up @@ -31909,14 +31940,14 @@ function autoResize() {
text = document.createTextNode(''),
span = document.createElement('SPAN'),
observe = function observe(element, event, handler) {
if (window.attachEvent) {
if (element.attachEvent) {
element.attachEvent('on' + event, handler);
} else {
element.addEventListener(event, handler, false);
}
},
_unObserve = function _unObserve(element, event, handler) {
if (window.removeEventListener) {
if (element.removeEventListener) {
element.removeEventListener(event, handler, false);
} else {
element.detachEvent('on' + event, handler);
Expand Down Expand Up @@ -33944,7 +33975,7 @@ DataMap.prototype.removeCol = function (index, amount, source) {
* @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed
* @returns {Array} Returns removed portion of columns
*/
DataMap.prototype.spliceCol = function (col, index, amount /* , elements...*/) {
DataMap.prototype.spliceCol = function (col, index, amount /* , elements... */) {
var elements = arguments.length >= 4 ? [].slice.call(arguments, 3) : [];

var colData = this.instance.getDataAtCol(col);
Expand All @@ -33971,7 +34002,7 @@ DataMap.prototype.spliceCol = function (col, index, amount /* , elements...*/) {
* @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.
* @returns {Array} Returns removed portion of rows
*/
DataMap.prototype.spliceRow = function (row, index, amount /* , elements...*/) {
DataMap.prototype.spliceRow = function (row, index, amount /* , elements... */) {
var elements = arguments.length >= 4 ? [].slice.call(arguments, 3) : [];

var rowData = this.instance.getSourceDataAtRow(row);
Expand Down Expand Up @@ -36497,9 +36528,9 @@ Handsontable.DefaultSettings = _defaultSettings2.default;
Handsontable.EventManager = _eventManager2.default;
Handsontable._getListenersCounter = _eventManager.getListenersCounter; // For MemoryLeak tests

Handsontable.buildDate = "2017-07-10T08:08:33.664Z";
Handsontable.buildDate = "2017-07-27T11:34:25.509Z";
Handsontable.packageName = "handsontable";
Handsontable.version = "0.33.0";
Handsontable.version = "0.34.0";

var baseVersion = undefined;

Expand Down Expand Up @@ -39975,7 +40006,7 @@ var META_READONLY = 'readOnly';
* var commentsPlugin = hot.getPlugin('comments');
*
* // Manage comments programmatically:
* commentsPlugin.editor.setCommentAtCell(1, 6, 'Comment contents');
* commentsPlugin.setCommentAtCell(1, 6, 'Comment contents');
* commentsPlugin.showAtCell(1, 6);
* commentsPlugin.removeCommentAtCell(1, 6);
*
Expand Down Expand Up @@ -43390,8 +43421,10 @@ function copyItem(copyPastePlugin) {
copyPastePlugin.setCopyableText();
copyPastePlugin.copy(true);
},
disabled: function disabled() {
return !copyPastePlugin.hot.getSelected();
},

disabled: false,
hidden: false
};
}
Expand All @@ -43413,8 +43446,10 @@ function cutItem(copyPastePlugin) {
copyPastePlugin.setCopyableText();
copyPastePlugin.cut(true);
},
disabled: function disabled() {
return !copyPastePlugin.hot.getSelected();
},

disabled: false,
hidden: false
};
}
Expand Down Expand Up @@ -43618,7 +43653,6 @@ var CopyPaste = function (_BasePlugin) {
this.addHook('beforeKeyDown', function (event) {
return _this2.onBeforeKeyDown(event);
});
// this.addHook('beforeOnCellMouseDown', () => this.onBeforeOnCellMouseDown());

this.registerEvents();

Expand Down Expand Up @@ -43652,7 +43686,7 @@ var CopyPaste = function (_BasePlugin) {
}

/**
* Prepares copyable text in the invisible textarea.
* Prepares copyable text from the cells selection in the invisible textarea.
*
* @function setCopyable
* @memberof CopyPaste#
Expand All @@ -43662,6 +43696,11 @@ var CopyPaste = function (_BasePlugin) {
key: 'setCopyableText',
value: function setCopyableText() {
var selRange = this.hot.getSelectedRange();

if (!selRange) {
return;
}

var topLeft = selRange.getTopLeftCorner();
var bottomRight = selRange.getBottomRightCorner();
var startRow = topLeft.row;
Expand Down

0 comments on commit 4b290f9

Please sign in to comment.