handsontable 0.0.0-next-2787440-20221201 → 0.0.0-next-c8630a2-20221202
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +32 -23
- package/core.mjs +28 -19
- package/dataMap/dataMap.js +1 -4
- package/dataMap/dataMap.mjs +2 -5
- package/dataMap/metaManager/metaLayers/cellMeta.js +4 -5
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +5 -6
- package/dataMap/metaManager/metaLayers/columnMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +2 -2
- package/dataMap/metaManager/metaLayers/globalMeta.js +14 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +15 -2
- package/dataMap/metaManager/metaLayers/tableMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +2 -2
- package/dataMap/metaManager/metaSchema.js +28 -35
- package/dataMap/metaManager/metaSchema.mjs +28 -35
- package/dataMap/metaManager/utils.js +44 -14
- package/dataMap/metaManager/utils.mjs +44 -14
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +1715 -1720
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +84 -84
- package/dist/handsontable.js +1370 -1375
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- package/editors/registry.js +3 -0
- package/editors/registry.mjs +3 -0
- package/helpers/data.d.ts +0 -1
- package/helpers/data.js +0 -49
- package/helpers/data.mjs +1 -49
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +1 -1
- package/helpers/object.mjs +1 -1
- package/package.json +1 -1
- package/plugins/columnSummary/columnSummary.js +5 -5
- package/plugins/columnSummary/columnSummary.mjs +5 -5
- package/plugins/formulas/formulas.js +6 -6
- package/plugins/formulas/formulas.mjs +6 -6
- package/shortcuts/manager.js +1 -1
- package/shortcuts/manager.mjs +1 -1
package/base.js
CHANGED
@@ -46,8 +46,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
|
|
46
46
|
Handsontable.CellCoords = _src.CellCoords;
|
47
47
|
Handsontable.CellRange = _src.CellRange;
|
48
48
|
Handsontable.packageName = 'handsontable';
|
49
|
-
Handsontable.buildDate = "
|
50
|
-
Handsontable.version = "0.0.0-next-
|
49
|
+
Handsontable.buildDate = "02/12/2022 13:36:14";
|
50
|
+
Handsontable.version = "0.0.0-next-c8630a2-20221202";
|
51
51
|
Handsontable.languages = {
|
52
52
|
dictionaryKeys: _registry.dictionaryKeys,
|
53
53
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
package/base.mjs
CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
|
|
35
35
|
Handsontable.CellCoords = CellCoords;
|
36
36
|
Handsontable.CellRange = CellRange;
|
37
37
|
Handsontable.packageName = 'handsontable';
|
38
|
-
Handsontable.buildDate = "
|
39
|
-
Handsontable.version = "0.0.0-next-
|
38
|
+
Handsontable.buildDate = "02/12/2022 13:36:29";
|
39
|
+
Handsontable.version = "0.0.0-next-c8630a2-20221202";
|
40
40
|
Handsontable.languages = {
|
41
41
|
dictionaryKeys: dictionaryKeys,
|
42
42
|
getLanguageDictionary: getLanguageDictionary,
|
package/core.js
CHANGED
@@ -43,7 +43,8 @@ var _array = require("./helpers/array");
|
|
43
43
|
var _parseTable = require("./utils/parseTable");
|
44
44
|
var _registry = require("./plugins/registry");
|
45
45
|
var _registry2 = require("./renderers/registry");
|
46
|
-
var _registry3 = require("./
|
46
|
+
var _registry3 = require("./editors/registry");
|
47
|
+
var _registry4 = require("./validators/registry");
|
47
48
|
var _string = require("./helpers/string");
|
48
49
|
var _number = require("./helpers/number");
|
49
50
|
var _tableView = _interopRequireDefault(require("./tableView"));
|
@@ -53,7 +54,7 @@ var _translations = require("./translations");
|
|
53
54
|
var _rootInstance = require("./utils/rootInstance");
|
54
55
|
var _src = require("./3rdparty/walkontable/src");
|
55
56
|
var _pluginHooks = _interopRequireDefault(require("./pluginHooks"));
|
56
|
-
var
|
57
|
+
var _registry5 = require("./i18n/registry");
|
57
58
|
var _utils = require("./i18n/utils");
|
58
59
|
var _selection = require("./selection");
|
59
60
|
var _dataMap = require("./dataMap");
|
@@ -89,7 +90,7 @@ var deprecationWarns = new Set();
|
|
89
90
|
*
|
90
91
|
* ::: only-for react
|
91
92
|
* To use these methods, associate a Handsontable instance with your instance
|
92
|
-
* of the [`HotTable` component](@/guides/getting-started/installation.md#hottable-component),
|
93
|
+
* of the [`HotTable` component](@/guides/getting-started/installation.md#use-the-hottable-component),
|
93
94
|
* by using React's `ref` feature (read more on the [Instance methods](@/guides/getting-started/react-methods.md) page).
|
94
95
|
* :::
|
95
96
|
*
|
@@ -233,7 +234,7 @@ function Core(rootElement, userSettings) {
|
|
233
234
|
this.getDirectionFactor = function () {
|
234
235
|
return instance.isLtr() ? 1 : -1;
|
235
236
|
};
|
236
|
-
userSettings.language = (0,
|
237
|
+
userSettings.language = (0, _registry5.getValidLanguageCode)(userSettings.language);
|
237
238
|
var metaManager = new _dataMap.MetaManager(instance, userSettings, [_dataMap.DynamicCellMetaMod, _dataMap.ExtendMetaPropertiesMod]);
|
238
239
|
var tableMeta = metaManager.getTableMeta();
|
239
240
|
var globalMeta = metaManager.getGlobalMeta();
|
@@ -1061,7 +1062,7 @@ function Core(rootElement, userSettings) {
|
|
1061
1062
|
*/
|
1062
1063
|
function setLanguage(languageCode) {
|
1063
1064
|
var normalizedLanguageCode = (0, _utils.normalizeLanguageCode)(languageCode);
|
1064
|
-
if ((0,
|
1065
|
+
if ((0, _registry5.hasLanguageDictionary)(normalizedLanguageCode)) {
|
1065
1066
|
instance.runHooks('beforeLanguageChange', normalizedLanguageCode);
|
1066
1067
|
globalMeta.language = normalizedLanguageCode;
|
1067
1068
|
instance.runHooks('afterLanguageChange', normalizedLanguageCode);
|
@@ -3138,16 +3139,15 @@ function Core(rootElement, userSettings) {
|
|
3138
3139
|
this.isColumnModificationAllowed = function () {
|
3139
3140
|
return !(instance.dataType === 'object' || tableMeta.columns);
|
3140
3141
|
};
|
3141
|
-
var rendererLookup = (0, _data.cellMethodLookupFactory)('renderer');
|
3142
3142
|
|
3143
3143
|
/**
|
3144
3144
|
* Returns the cell renderer function by given `row` and `column` arguments.
|
3145
3145
|
*
|
3146
3146
|
* @memberof Core#
|
3147
3147
|
* @function getCellRenderer
|
3148
|
-
* @param {number|object}
|
3148
|
+
* @param {number|object} rowOrMeta Visual row index or cell meta object (see {@link Core#getCellMeta}).
|
3149
3149
|
* @param {number} column Visual column index.
|
3150
|
-
* @returns {Function}
|
3150
|
+
* @returns {Function} Returns the renderer function.
|
3151
3151
|
* @example
|
3152
3152
|
* ```js
|
3153
3153
|
* // Get cell renderer using `row` and `column` coordinates.
|
@@ -3156,8 +3156,12 @@ function Core(rootElement, userSettings) {
|
|
3156
3156
|
* hot.getCellRenderer(hot.getCellMeta(1, 1));
|
3157
3157
|
* ```
|
3158
3158
|
*/
|
3159
|
-
this.getCellRenderer = function (
|
3160
|
-
|
3159
|
+
this.getCellRenderer = function (rowOrMeta, column) {
|
3160
|
+
var cellRenderer = typeof rowOrMeta === 'number' ? instance.getCellMeta(rowOrMeta, column).renderer : rowOrMeta.renderer;
|
3161
|
+
if (typeof cellRenderer === 'string') {
|
3162
|
+
return (0, _registry2.getRenderer)(cellRenderer);
|
3163
|
+
}
|
3164
|
+
return (0, _mixed.isUndefined)(cellRenderer) ? (0, _registry2.getRenderer)('text') : cellRenderer;
|
3161
3165
|
};
|
3162
3166
|
|
3163
3167
|
/**
|
@@ -3165,9 +3169,9 @@ function Core(rootElement, userSettings) {
|
|
3165
3169
|
*
|
3166
3170
|
* @memberof Core#
|
3167
3171
|
* @function getCellEditor
|
3168
|
-
* @param {number}
|
3172
|
+
* @param {number} rowOrMeta Visual row index or cell meta object (see {@link Core#getCellMeta}).
|
3169
3173
|
* @param {number} column Visual column index.
|
3170
|
-
* @returns {Function}
|
3174
|
+
* @returns {Function|boolean} Returns the editor class or `false` is cell editor is disabled.
|
3171
3175
|
* @example
|
3172
3176
|
* ```js
|
3173
3177
|
* // Get cell editor class using `row` and `column` coordinates.
|
@@ -3176,31 +3180,36 @@ function Core(rootElement, userSettings) {
|
|
3176
3180
|
* hot.getCellEditor(hot.getCellMeta(1, 1));
|
3177
3181
|
* ```
|
3178
3182
|
*/
|
3179
|
-
this.getCellEditor = (
|
3180
|
-
|
3183
|
+
this.getCellEditor = function (rowOrMeta, column) {
|
3184
|
+
var cellEditor = typeof rowOrMeta === 'number' ? instance.getCellMeta(rowOrMeta, column).editor : rowOrMeta.editor;
|
3185
|
+
if (typeof cellEditor === 'string') {
|
3186
|
+
return (0, _registry3.getEditor)(cellEditor);
|
3187
|
+
}
|
3188
|
+
return (0, _mixed.isUndefined)(cellEditor) ? (0, _registry3.getEditor)('text') : cellEditor;
|
3189
|
+
};
|
3181
3190
|
|
3182
3191
|
/**
|
3183
3192
|
* Returns the cell validator by `row` and `column`.
|
3184
3193
|
*
|
3185
3194
|
* @memberof Core#
|
3186
3195
|
* @function getCellValidator
|
3187
|
-
* @param {number|object}
|
3196
|
+
* @param {number|object} rowOrMeta Visual row index or cell meta object (see {@link Core#getCellMeta}).
|
3188
3197
|
* @param {number} column Visual column index.
|
3189
3198
|
* @returns {Function|RegExp|undefined} The validator function.
|
3190
3199
|
* @example
|
3191
3200
|
* ```js
|
3192
|
-
* // Get cell
|
3201
|
+
* // Get cell validator using `row` and `column` coordinates.
|
3193
3202
|
* hot.getCellValidator(1, 1);
|
3194
|
-
* // Get cell
|
3203
|
+
* // Get cell validator using cell meta object.
|
3195
3204
|
* hot.getCellValidator(hot.getCellMeta(1, 1));
|
3196
3205
|
* ```
|
3197
3206
|
*/
|
3198
|
-
this.getCellValidator = function (
|
3199
|
-
var
|
3200
|
-
if (typeof
|
3201
|
-
|
3207
|
+
this.getCellValidator = function (rowOrMeta, column) {
|
3208
|
+
var cellValidator = typeof rowOrMeta === 'number' ? instance.getCellMeta(rowOrMeta, column).validator : rowOrMeta.validator;
|
3209
|
+
if (typeof cellValidator === 'string') {
|
3210
|
+
return (0, _registry4.getValidator)(cellValidator);
|
3202
3211
|
}
|
3203
|
-
return
|
3212
|
+
return cellValidator;
|
3204
3213
|
};
|
3205
3214
|
|
3206
3215
|
/**
|
@@ -4275,7 +4284,7 @@ function Core(rootElement, userSettings) {
|
|
4275
4284
|
* @returns {string}
|
4276
4285
|
*/
|
4277
4286
|
this.getTranslatedPhrase = function (dictionaryKey, extraArguments) {
|
4278
|
-
return (0,
|
4287
|
+
return (0, _registry5.getTranslatedPhrase)(tableMeta.language, dictionaryKey, extraArguments);
|
4279
4288
|
};
|
4280
4289
|
|
4281
4290
|
/**
|
package/core.mjs
CHANGED
@@ -52,12 +52,13 @@ import { arrayMap, arrayEach, arrayReduce, getDifferenceOfArrays, stringToArray,
|
|
52
52
|
import { instanceToHTML } from "./utils/parseTable.mjs";
|
53
53
|
import { getPlugin, getPluginsNames } from "./plugins/registry.mjs";
|
54
54
|
import { getRenderer } from "./renderers/registry.mjs";
|
55
|
+
import { getEditor } from "./editors/registry.mjs";
|
55
56
|
import { getValidator } from "./validators/registry.mjs";
|
56
57
|
import { randomString, toUpperCaseFirst } from "./helpers/string.mjs";
|
57
58
|
import { rangeEach, rangeEachReverse, isNumericLike } from "./helpers/number.mjs";
|
58
59
|
import TableView from "./tableView.mjs";
|
59
60
|
import DataSource from "./dataMap/dataSource.mjs";
|
60
|
-
import {
|
61
|
+
import { spreadsheetColumnLabel } from "./helpers/data.mjs";
|
61
62
|
import { IndexMapper } from "./translations/index.mjs";
|
62
63
|
import { registerAsRootInstance, hasValidParameter, isRootInstance } from "./utils/rootInstance.mjs";
|
63
64
|
import { ViewportColumnsCalculator } from "./3rdparty/walkontable/src/index.mjs";
|
@@ -84,7 +85,7 @@ var deprecationWarns = new Set();
|
|
84
85
|
*
|
85
86
|
* ::: only-for react
|
86
87
|
* To use these methods, associate a Handsontable instance with your instance
|
87
|
-
* of the [`HotTable` component](@/guides/getting-started/installation.md#hottable-component),
|
88
|
+
* of the [`HotTable` component](@/guides/getting-started/installation.md#use-the-hottable-component),
|
88
89
|
* by using React's `ref` feature (read more on the [Instance methods](@/guides/getting-started/react-methods.md) page).
|
89
90
|
* :::
|
90
91
|
*
|
@@ -3133,16 +3134,15 @@ export default function Core(rootElement, userSettings) {
|
|
3133
3134
|
this.isColumnModificationAllowed = function () {
|
3134
3135
|
return !(instance.dataType === 'object' || tableMeta.columns);
|
3135
3136
|
};
|
3136
|
-
var rendererLookup = cellMethodLookupFactory('renderer');
|
3137
3137
|
|
3138
3138
|
/**
|
3139
3139
|
* Returns the cell renderer function by given `row` and `column` arguments.
|
3140
3140
|
*
|
3141
3141
|
* @memberof Core#
|
3142
3142
|
* @function getCellRenderer
|
3143
|
-
* @param {number|object}
|
3143
|
+
* @param {number|object} rowOrMeta Visual row index or cell meta object (see {@link Core#getCellMeta}).
|
3144
3144
|
* @param {number} column Visual column index.
|
3145
|
-
* @returns {Function}
|
3145
|
+
* @returns {Function} Returns the renderer function.
|
3146
3146
|
* @example
|
3147
3147
|
* ```js
|
3148
3148
|
* // Get cell renderer using `row` and `column` coordinates.
|
@@ -3151,8 +3151,12 @@ export default function Core(rootElement, userSettings) {
|
|
3151
3151
|
* hot.getCellRenderer(hot.getCellMeta(1, 1));
|
3152
3152
|
* ```
|
3153
3153
|
*/
|
3154
|
-
this.getCellRenderer = function (
|
3155
|
-
|
3154
|
+
this.getCellRenderer = function (rowOrMeta, column) {
|
3155
|
+
var cellRenderer = typeof rowOrMeta === 'number' ? instance.getCellMeta(rowOrMeta, column).renderer : rowOrMeta.renderer;
|
3156
|
+
if (typeof cellRenderer === 'string') {
|
3157
|
+
return getRenderer(cellRenderer);
|
3158
|
+
}
|
3159
|
+
return isUndefined(cellRenderer) ? getRenderer('text') : cellRenderer;
|
3156
3160
|
};
|
3157
3161
|
|
3158
3162
|
/**
|
@@ -3160,9 +3164,9 @@ export default function Core(rootElement, userSettings) {
|
|
3160
3164
|
*
|
3161
3165
|
* @memberof Core#
|
3162
3166
|
* @function getCellEditor
|
3163
|
-
* @param {number}
|
3167
|
+
* @param {number} rowOrMeta Visual row index or cell meta object (see {@link Core#getCellMeta}).
|
3164
3168
|
* @param {number} column Visual column index.
|
3165
|
-
* @returns {Function}
|
3169
|
+
* @returns {Function|boolean} Returns the editor class or `false` is cell editor is disabled.
|
3166
3170
|
* @example
|
3167
3171
|
* ```js
|
3168
3172
|
* // Get cell editor class using `row` and `column` coordinates.
|
@@ -3171,31 +3175,36 @@ export default function Core(rootElement, userSettings) {
|
|
3171
3175
|
* hot.getCellEditor(hot.getCellMeta(1, 1));
|
3172
3176
|
* ```
|
3173
3177
|
*/
|
3174
|
-
this.getCellEditor =
|
3175
|
-
|
3178
|
+
this.getCellEditor = function (rowOrMeta, column) {
|
3179
|
+
var cellEditor = typeof rowOrMeta === 'number' ? instance.getCellMeta(rowOrMeta, column).editor : rowOrMeta.editor;
|
3180
|
+
if (typeof cellEditor === 'string') {
|
3181
|
+
return getEditor(cellEditor);
|
3182
|
+
}
|
3183
|
+
return isUndefined(cellEditor) ? getEditor('text') : cellEditor;
|
3184
|
+
};
|
3176
3185
|
|
3177
3186
|
/**
|
3178
3187
|
* Returns the cell validator by `row` and `column`.
|
3179
3188
|
*
|
3180
3189
|
* @memberof Core#
|
3181
3190
|
* @function getCellValidator
|
3182
|
-
* @param {number|object}
|
3191
|
+
* @param {number|object} rowOrMeta Visual row index or cell meta object (see {@link Core#getCellMeta}).
|
3183
3192
|
* @param {number} column Visual column index.
|
3184
3193
|
* @returns {Function|RegExp|undefined} The validator function.
|
3185
3194
|
* @example
|
3186
3195
|
* ```js
|
3187
|
-
* // Get cell
|
3196
|
+
* // Get cell validator using `row` and `column` coordinates.
|
3188
3197
|
* hot.getCellValidator(1, 1);
|
3189
|
-
* // Get cell
|
3198
|
+
* // Get cell validator using cell meta object.
|
3190
3199
|
* hot.getCellValidator(hot.getCellMeta(1, 1));
|
3191
3200
|
* ```
|
3192
3201
|
*/
|
3193
|
-
this.getCellValidator = function (
|
3194
|
-
var
|
3195
|
-
if (typeof
|
3196
|
-
|
3202
|
+
this.getCellValidator = function (rowOrMeta, column) {
|
3203
|
+
var cellValidator = typeof rowOrMeta === 'number' ? instance.getCellMeta(rowOrMeta, column).validator : rowOrMeta.validator;
|
3204
|
+
if (typeof cellValidator === 'string') {
|
3205
|
+
return getValidator(cellValidator);
|
3197
3206
|
}
|
3198
|
-
return
|
3207
|
+
return cellValidator;
|
3199
3208
|
};
|
3200
3209
|
|
3201
3210
|
/**
|
package/dataMap/dataMap.js
CHANGED
@@ -38,8 +38,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
38
38
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39
39
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
40
40
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
41
|
-
var copyableLookup = (0, _data.cellMethodLookupFactory)('copyable', false);
|
42
|
-
|
43
41
|
/*
|
44
42
|
This class contains open-source contributions covered by the MIT license.
|
45
43
|
|
@@ -61,7 +59,6 @@ The above copyright notice and this permission notice shall be included in all c
|
|
61
59
|
|
62
60
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
63
61
|
*/
|
64
|
-
|
65
62
|
/**
|
66
63
|
* Utility class that gets and saves data from/to the data source using mapping of columns numbers to object property names.
|
67
64
|
*
|
@@ -731,7 +728,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
731
728
|
}, {
|
732
729
|
key: "getCopyable",
|
733
730
|
value: function getCopyable(row, prop) {
|
734
|
-
if (
|
731
|
+
if (this.instance.getCellMeta(row, this.propToCol(prop)).copyable) {
|
735
732
|
return this.get(row, prop);
|
736
733
|
}
|
737
734
|
return '';
|
package/dataMap/dataMap.mjs
CHANGED
@@ -29,13 +29,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
29
29
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
30
30
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
31
31
|
import { stringify } from "../3rdparty/SheetClip/index.mjs";
|
32
|
-
import {
|
32
|
+
import { countFirstRowKeys as _countFirstRowKeys } from "../helpers/data.mjs";
|
33
33
|
import { createObjectPropListener, deepClone, deepExtend, deepObjectSize, duckSchema, hasOwnProperty, isObject, objectEach } from "../helpers/object.mjs";
|
34
34
|
import { extendArray, to2dArray } from "../helpers/array.mjs";
|
35
35
|
import { rangeEach } from "../helpers/number.mjs";
|
36
36
|
import { isDefined } from "../helpers/mixed.mjs";
|
37
|
-
var copyableLookup = cellMethodLookupFactory('copyable', false);
|
38
|
-
|
39
37
|
/*
|
40
38
|
This class contains open-source contributions covered by the MIT license.
|
41
39
|
|
@@ -57,7 +55,6 @@ The above copyright notice and this permission notice shall be included in all c
|
|
57
55
|
|
58
56
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
59
57
|
*/
|
60
|
-
|
61
58
|
/**
|
62
59
|
* Utility class that gets and saves data from/to the data source using mapping of columns numbers to object property names.
|
63
60
|
*
|
@@ -727,7 +724,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
727
724
|
}, {
|
728
725
|
key: "getCopyable",
|
729
726
|
value: function getCopyable(row, prop) {
|
730
|
-
if (
|
727
|
+
if (this.instance.getCellMeta(row, this.propToCol(prop)).copyable) {
|
731
728
|
return this.get(row, prop);
|
732
729
|
}
|
733
730
|
return '';
|
@@ -92,7 +92,7 @@ var CellMeta = /*#__PURE__*/function () {
|
|
92
92
|
value: function updateMeta(physicalRow, physicalColumn, settings) {
|
93
93
|
var meta = this.getMeta(physicalRow, physicalColumn);
|
94
94
|
(0, _object.extend)(meta, settings);
|
95
|
-
(0,
|
95
|
+
(0, _utils.extendByMetaType)(meta, settings);
|
96
96
|
}
|
97
97
|
|
98
98
|
/**
|
@@ -176,11 +176,10 @@ var CellMeta = /*#__PURE__*/function () {
|
|
176
176
|
}, {
|
177
177
|
key: "setMeta",
|
178
178
|
value: function setMeta(physicalRow, physicalColumn, key, value) {
|
179
|
+
var _cellMeta$_automatica;
|
179
180
|
var cellMeta = this.metas.obtain(physicalRow).obtain(physicalColumn);
|
181
|
+
(_cellMeta$_automatica = cellMeta._automaticallyAssignedMetaProps) === null || _cellMeta$_automatica === void 0 ? void 0 : _cellMeta$_automatica.delete(key);
|
180
182
|
cellMeta[key] = value;
|
181
|
-
if (cellMeta._automaticallyAssignedMetaProps[key] === true) {
|
182
|
-
cellMeta._automaticallyAssignedMetaProps[key] = void 0;
|
183
|
-
}
|
184
183
|
}
|
185
184
|
|
186
185
|
/**
|
@@ -217,7 +216,7 @@ var CellMeta = /*#__PURE__*/function () {
|
|
217
216
|
|
218
217
|
/**
|
219
218
|
* Returns all cell meta objects that were created during the Handsontable operation but for
|
220
|
-
*
|
219
|
+
* specific row index.
|
221
220
|
*
|
222
221
|
* @param {number} physicalRow The physical row index.
|
223
222
|
* @returns {object[]}
|
@@ -20,7 +20,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
20
20
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
21
21
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
22
22
|
import { extend } from "../../../helpers/object.mjs";
|
23
|
-
import {
|
23
|
+
import { extendByMetaType, assert, isUnsignedNumber } from "../utils.mjs";
|
24
24
|
import LazyFactoryMap from "../lazyFactoryMap.mjs";
|
25
25
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
26
26
|
/**
|
@@ -87,7 +87,7 @@ var CellMeta = /*#__PURE__*/function () {
|
|
87
87
|
value: function updateMeta(physicalRow, physicalColumn, settings) {
|
88
88
|
var meta = this.getMeta(physicalRow, physicalColumn);
|
89
89
|
extend(meta, settings);
|
90
|
-
|
90
|
+
extendByMetaType(meta, settings);
|
91
91
|
}
|
92
92
|
|
93
93
|
/**
|
@@ -171,11 +171,10 @@ var CellMeta = /*#__PURE__*/function () {
|
|
171
171
|
}, {
|
172
172
|
key: "setMeta",
|
173
173
|
value: function setMeta(physicalRow, physicalColumn, key, value) {
|
174
|
+
var _cellMeta$_automatica;
|
174
175
|
var cellMeta = this.metas.obtain(physicalRow).obtain(physicalColumn);
|
176
|
+
(_cellMeta$_automatica = cellMeta._automaticallyAssignedMetaProps) === null || _cellMeta$_automatica === void 0 ? void 0 : _cellMeta$_automatica.delete(key);
|
175
177
|
cellMeta[key] = value;
|
176
|
-
if (cellMeta._automaticallyAssignedMetaProps[key] === true) {
|
177
|
-
cellMeta._automaticallyAssignedMetaProps[key] = void 0;
|
178
|
-
}
|
179
178
|
}
|
180
179
|
|
181
180
|
/**
|
@@ -212,7 +211,7 @@ var CellMeta = /*#__PURE__*/function () {
|
|
212
211
|
|
213
212
|
/**
|
214
213
|
* Returns all cell meta objects that were created during the Handsontable operation but for
|
215
|
-
*
|
214
|
+
* specific row index.
|
216
215
|
*
|
217
216
|
* @param {number} physicalRow The physical row index.
|
218
217
|
* @returns {object[]}
|
@@ -76,7 +76,7 @@ var ColumnMeta = /*#__PURE__*/function () {
|
|
76
76
|
value: function updateMeta(physicalColumn, settings) {
|
77
77
|
var meta = this.getMeta(physicalColumn);
|
78
78
|
(0, _object.extend)(meta, settings);
|
79
|
-
(0,
|
79
|
+
(0, _utils.extendByMetaType)(meta, settings);
|
80
80
|
}
|
81
81
|
|
82
82
|
/**
|
@@ -2,7 +2,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
2
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
4
4
|
import { extend } from "../../../helpers/object.mjs";
|
5
|
-
import { columnFactory,
|
5
|
+
import { columnFactory, extendByMetaType } from "../utils.mjs";
|
6
6
|
import LazyFactoryMap from "../lazyFactoryMap.mjs";
|
7
7
|
/**
|
8
8
|
* List of props which have to be cleared in the column meta-layer. That props have a
|
@@ -71,7 +71,7 @@ var ColumnMeta = /*#__PURE__*/function () {
|
|
71
71
|
value: function updateMeta(physicalColumn, settings) {
|
72
72
|
var meta = this.getMeta(physicalColumn);
|
73
73
|
extend(meta, settings);
|
74
|
-
|
74
|
+
extendByMetaType(meta, settings);
|
75
75
|
}
|
76
76
|
|
77
77
|
/**
|
@@ -1,11 +1,21 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
require("core-js/modules/es.object.keys.js");
|
4
|
+
require("core-js/modules/es.symbol.js");
|
5
|
+
require("core-js/modules/es.array.filter.js");
|
6
|
+
require("core-js/modules/es.object.to-string.js");
|
7
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
8
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
9
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
3
10
|
exports.__esModule = true;
|
4
11
|
exports.default = void 0;
|
5
12
|
var _object = require("../../../helpers/object");
|
6
13
|
var _utils = require("../utils");
|
7
14
|
var _metaSchema = _interopRequireDefault(require("../metaSchema"));
|
8
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
17
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
18
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
9
19
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
10
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
11
21
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -94,8 +104,11 @@ var GlobalMeta = /*#__PURE__*/function () {
|
|
94
104
|
}, {
|
95
105
|
key: "updateMeta",
|
96
106
|
value: function updateMeta(settings) {
|
107
|
+
var _settings$type;
|
97
108
|
(0, _object.extend)(this.meta, settings);
|
98
|
-
(0,
|
109
|
+
(0, _utils.extendByMetaType)(this.meta, _objectSpread(_objectSpread({}, settings), {}, {
|
110
|
+
type: (_settings$type = settings.type) !== null && _settings$type !== void 0 ? _settings$type : this.meta.type
|
111
|
+
}), settings);
|
99
112
|
}
|
100
113
|
}]);
|
101
114
|
return GlobalMeta;
|
@@ -1,8 +1,18 @@
|
|
1
|
+
import "core-js/modules/es.object.keys.js";
|
2
|
+
import "core-js/modules/es.symbol.js";
|
3
|
+
import "core-js/modules/es.array.filter.js";
|
4
|
+
import "core-js/modules/es.object.to-string.js";
|
5
|
+
import "core-js/modules/es.object.get-own-property-descriptor.js";
|
6
|
+
import "core-js/modules/web.dom-collections.for-each.js";
|
7
|
+
import "core-js/modules/es.object.get-own-property-descriptors.js";
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
1
11
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
2
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
3
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4
14
|
import { extend } from "../../../helpers/object.mjs";
|
5
|
-
import {
|
15
|
+
import { extendByMetaType } from "../utils.mjs";
|
6
16
|
import metaSchemaFactory from "../metaSchema.mjs";
|
7
17
|
/**
|
8
18
|
* @typedef {Options} TableMeta
|
@@ -89,8 +99,11 @@ var GlobalMeta = /*#__PURE__*/function () {
|
|
89
99
|
}, {
|
90
100
|
key: "updateMeta",
|
91
101
|
value: function updateMeta(settings) {
|
102
|
+
var _settings$type;
|
92
103
|
extend(this.meta, settings);
|
93
|
-
|
104
|
+
extendByMetaType(this.meta, _objectSpread(_objectSpread({}, settings), {}, {
|
105
|
+
type: (_settings$type = settings.type) !== null && _settings$type !== void 0 ? _settings$type : this.meta.type
|
106
|
+
}), settings);
|
94
107
|
}
|
95
108
|
}]);
|
96
109
|
return GlobalMeta;
|
@@ -65,7 +65,7 @@ var TableMeta = /*#__PURE__*/function () {
|
|
65
65
|
key: "updateMeta",
|
66
66
|
value: function updateMeta(settings) {
|
67
67
|
(0, _object.extend)(this.meta, settings);
|
68
|
-
(0,
|
68
|
+
(0, _utils.extendByMetaType)(this.meta, settings, settings);
|
69
69
|
}
|
70
70
|
}]);
|
71
71
|
return TableMeta;
|
@@ -2,7 +2,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
2
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
4
4
|
import { extend } from "../../../helpers/object.mjs";
|
5
|
-
import {
|
5
|
+
import { extendByMetaType } from "../utils.mjs";
|
6
6
|
/**
|
7
7
|
* The table meta object is a layer that keeps all settings of the Handsontable that was passed in
|
8
8
|
* the constructor. That layer contains all default settings inherited from the GlobalMeta layer
|
@@ -61,7 +61,7 @@ var TableMeta = /*#__PURE__*/function () {
|
|
61
61
|
key: "updateMeta",
|
62
62
|
value: function updateMeta(settings) {
|
63
63
|
extend(this.meta, settings);
|
64
|
-
|
64
|
+
extendByMetaType(this.meta, settings, settings);
|
65
65
|
}
|
66
66
|
}]);
|
67
67
|
return TableMeta;
|