@handsontable/vue 0.0.0-next-9ec04ce-20221121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1492 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Handsontable = require('handsontable/base');
6
+ var Vue = require('vue');
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var Handsontable__default = /*#__PURE__*/_interopDefaultLegacy(Handsontable);
11
+ var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);
12
+
13
+ function ownKeys(object, enumerableOnly) {
14
+ var keys = Object.keys(object);
15
+ if (Object.getOwnPropertySymbols) {
16
+ var symbols = Object.getOwnPropertySymbols(object);
17
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
18
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
19
+ })), keys.push.apply(keys, symbols);
20
+ }
21
+ return keys;
22
+ }
23
+ function _objectSpread2(target) {
24
+ for (var i = 1; i < arguments.length; i++) {
25
+ var source = null != arguments[i] ? arguments[i] : {};
26
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
27
+ _defineProperty$1(target, key, source[key]);
28
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
29
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
30
+ });
31
+ }
32
+ return target;
33
+ }
34
+ function _typeof$1(obj) {
35
+ "@babel/helpers - typeof";
36
+
37
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
38
+ return typeof obj;
39
+ } : function (obj) {
40
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
41
+ }, _typeof$1(obj);
42
+ }
43
+ function _classCallCheck(instance, Constructor) {
44
+ if (!(instance instanceof Constructor)) {
45
+ throw new TypeError("Cannot call a class as a function");
46
+ }
47
+ }
48
+ function _defineProperties(target, props) {
49
+ for (var i = 0; i < props.length; i++) {
50
+ var descriptor = props[i];
51
+ descriptor.enumerable = descriptor.enumerable || false;
52
+ descriptor.configurable = true;
53
+ if ("value" in descriptor) descriptor.writable = true;
54
+ Object.defineProperty(target, descriptor.key, descriptor);
55
+ }
56
+ }
57
+ function _createClass(Constructor, protoProps, staticProps) {
58
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
59
+ if (staticProps) _defineProperties(Constructor, staticProps);
60
+ Object.defineProperty(Constructor, "prototype", {
61
+ writable: false
62
+ });
63
+ return Constructor;
64
+ }
65
+ function _defineProperty$1(obj, key, value) {
66
+ if (key in obj) {
67
+ Object.defineProperty(obj, key, {
68
+ value: value,
69
+ enumerable: true,
70
+ configurable: true,
71
+ writable: true
72
+ });
73
+ } else {
74
+ obj[key] = value;
75
+ }
76
+ return obj;
77
+ }
78
+ function _inherits(subClass, superClass) {
79
+ if (typeof superClass !== "function" && superClass !== null) {
80
+ throw new TypeError("Super expression must either be null or a function");
81
+ }
82
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
83
+ constructor: {
84
+ value: subClass,
85
+ writable: true,
86
+ configurable: true
87
+ }
88
+ });
89
+ Object.defineProperty(subClass, "prototype", {
90
+ writable: false
91
+ });
92
+ if (superClass) _setPrototypeOf(subClass, superClass);
93
+ }
94
+ function _getPrototypeOf(o) {
95
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
96
+ return o.__proto__ || Object.getPrototypeOf(o);
97
+ };
98
+ return _getPrototypeOf(o);
99
+ }
100
+ function _setPrototypeOf(o, p) {
101
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
102
+ o.__proto__ = p;
103
+ return o;
104
+ };
105
+ return _setPrototypeOf(o, p);
106
+ }
107
+ function _isNativeReflectConstruct() {
108
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
109
+ if (Reflect.construct.sham) return false;
110
+ if (typeof Proxy === "function") return true;
111
+ try {
112
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
113
+ return true;
114
+ } catch (e) {
115
+ return false;
116
+ }
117
+ }
118
+ function _assertThisInitialized(self) {
119
+ if (self === void 0) {
120
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
121
+ }
122
+ return self;
123
+ }
124
+ function _possibleConstructorReturn(self, call) {
125
+ if (call && (typeof call === "object" || typeof call === "function")) {
126
+ return call;
127
+ } else if (call !== void 0) {
128
+ throw new TypeError("Derived constructors may only return object or undefined");
129
+ }
130
+ return _assertThisInitialized(self);
131
+ }
132
+ function _createSuper(Derived) {
133
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
134
+ return function _createSuperInternal() {
135
+ var Super = _getPrototypeOf(Derived),
136
+ result;
137
+ if (hasNativeReflectConstruct) {
138
+ var NewTarget = _getPrototypeOf(this).constructor;
139
+ result = Reflect.construct(Super, arguments, NewTarget);
140
+ } else {
141
+ result = Super.apply(this, arguments);
142
+ }
143
+ return _possibleConstructorReturn(this, result);
144
+ };
145
+ }
146
+
147
+ var unassignedPropSymbol = Symbol('unassigned');
148
+ var bulkComponentContainer = null;
149
+ /**
150
+ * Message for the warning thrown if the Handsontable instance has been destroyed.
151
+ */
152
+ var HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' + ' used properly.';
153
+ /**
154
+ * Private method to ensure the table is not calling `updateSettings` after editing cells.
155
+ * @private
156
+ */
157
+ function preventInternalEditWatch(component) {
158
+ if (component.hotInstance) {
159
+ component.hotInstance.addHook('beforeChange', function () {
160
+ component.__internalEdit = true;
161
+ });
162
+ component.hotInstance.addHook('beforeCreateRow', function () {
163
+ component.__internalEdit = true;
164
+ });
165
+ component.hotInstance.addHook('beforeCreateCol', function () {
166
+ component.__internalEdit = true;
167
+ });
168
+ component.hotInstance.addHook('beforeRemoveRow', function () {
169
+ component.__internalEdit = true;
170
+ });
171
+ component.hotInstance.addHook('beforeRemoveCol', function () {
172
+ component.__internalEdit = true;
173
+ });
174
+ }
175
+ }
176
+ /**
177
+ * Generate an object containing all the available Handsontable properties and plugin hooks.
178
+ *
179
+ * @param {String} source Source for the factory (either 'HotTable' or 'HotColumn').
180
+ * @returns {Object}
181
+ */
182
+ function propFactory(source) {
183
+ var registeredHooks = Handsontable__default["default"].hooks.getRegistered();
184
+ var propSchema = {};
185
+ Object.assign(propSchema, Handsontable__default["default"].DefaultSettings);
186
+ for (var prop in propSchema) {
187
+ propSchema[prop] = {
188
+ "default": unassignedPropSymbol
189
+ };
190
+ }
191
+ for (var i = 0; i < registeredHooks.length; i++) {
192
+ propSchema[registeredHooks[i]] = {
193
+ "default": unassignedPropSymbol
194
+ };
195
+ }
196
+ propSchema.settings = {
197
+ "default": unassignedPropSymbol
198
+ };
199
+ if (source === 'HotTable') {
200
+ propSchema.id = {
201
+ type: String,
202
+ "default": 'hot-' + Math.random().toString(36).substring(5)
203
+ };
204
+ propSchema.wrapperRendererCacheSize = {
205
+ type: Number,
206
+ "default": 3000
207
+ };
208
+ }
209
+ return propSchema;
210
+ }
211
+ /**
212
+ * Filter out all of the unassigned props, and return only the one passed to the component.
213
+ *
214
+ * @param {Object} props Object containing all the possible props.
215
+ * @returns {Object} Object containing only used props.
216
+ */
217
+ function filterPassedProps(props) {
218
+ var filteredProps = {};
219
+ var columnSettingsProp = props['settings'];
220
+ if (columnSettingsProp !== unassignedPropSymbol) {
221
+ for (var propName in columnSettingsProp) {
222
+ if (columnSettingsProp.hasOwnProperty(propName) && columnSettingsProp[propName] !== unassignedPropSymbol) {
223
+ filteredProps[propName] = columnSettingsProp[propName];
224
+ }
225
+ }
226
+ }
227
+ for (var _propName in props) {
228
+ if (props.hasOwnProperty(_propName) && _propName !== 'settings' && props[_propName] !== unassignedPropSymbol) {
229
+ filteredProps[_propName] = props[_propName];
230
+ }
231
+ }
232
+ return filteredProps;
233
+ }
234
+ /**
235
+ * Prepare the settings object to be used as the settings for Handsontable, based on the props provided to the component.
236
+ *
237
+ * @param {HotTableProps} props The props passed to the component.
238
+ * @param {Handsontable.GridSettings} currentSettings The current Handsontable settings.
239
+ * @returns {Handsontable.GridSettings} An object containing the properties, ready to be used within Handsontable.
240
+ */
241
+ function prepareSettings(props, currentSettings) {
242
+ var assignedProps = filterPassedProps(props);
243
+ var hotSettingsInProps = props.settings ? props.settings : assignedProps;
244
+ var additionalHotSettingsInProps = props.settings ? assignedProps : null;
245
+ var newSettings = {};
246
+ for (var key in hotSettingsInProps) {
247
+ if (hotSettingsInProps.hasOwnProperty(key) && hotSettingsInProps[key] !== void 0 && (currentSettings && key !== 'data' ? !simpleEqual(currentSettings[key], hotSettingsInProps[key]) : true)) {
248
+ newSettings[key] = hotSettingsInProps[key];
249
+ }
250
+ }
251
+ for (var _key in additionalHotSettingsInProps) {
252
+ if (additionalHotSettingsInProps.hasOwnProperty(_key) && _key !== 'id' && _key !== 'settings' && _key !== 'wrapperRendererCacheSize' && additionalHotSettingsInProps[_key] !== void 0 && (currentSettings && _key !== 'data' ? !simpleEqual(currentSettings[_key], additionalHotSettingsInProps[_key]) : true)) {
253
+ newSettings[_key] = additionalHotSettingsInProps[_key];
254
+ }
255
+ }
256
+ return newSettings;
257
+ }
258
+ /**
259
+ * Get the VNode element with the provided type attribute from the component slots.
260
+ *
261
+ * @param {Array} componentSlots Array of slots from a component.
262
+ * @param {String} type Type of the child component. Either `hot-renderer` or `hot-editor`.
263
+ * @returns {Object|null} The VNode of the child component (or `null` when nothing's found).
264
+ */
265
+ function findVNodeByType(componentSlots, type) {
266
+ var componentVNode = null;
267
+ componentSlots.every(function (slot, index) {
268
+ if (slot.data && slot.data.attrs && slot.data.attrs[type] !== void 0) {
269
+ componentVNode = slot;
270
+ return false;
271
+ }
272
+ return true;
273
+ });
274
+ return componentVNode;
275
+ }
276
+ /**
277
+ * Get all `hot-column` component instances from the provided children array.
278
+ *
279
+ * @param {Array} children Array of children from a component.
280
+ * @returns {Array} Array of `hot-column` instances.
281
+ */
282
+ function getHotColumnComponents(children) {
283
+ return children.filter(function (child) {
284
+ return child.$options.name === 'HotColumn';
285
+ });
286
+ }
287
+ /**
288
+ * Create an instance of the Vue Component based on the provided VNode.
289
+ *
290
+ * @param {Object} vNode VNode element to be turned into a component instance.
291
+ * @param {Object} parent Instance of the component to be marked as a parent of the newly created instance.
292
+ * @param {Object} props Props to be passed to the new instance.
293
+ * @param {Object} data Data to be passed to the new instance.
294
+ */
295
+ function createVueComponent(vNode, parent, props, data) {
296
+ var ownerDocument = parent.$el ? parent.$el.ownerDocument : document;
297
+ var settings = {
298
+ propsData: props,
299
+ parent: parent,
300
+ data: data
301
+ };
302
+ if (!bulkComponentContainer) {
303
+ bulkComponentContainer = ownerDocument.createElement('DIV');
304
+ bulkComponentContainer.id = 'vueHotComponents';
305
+ ownerDocument.body.appendChild(bulkComponentContainer);
306
+ }
307
+ var componentContainer = ownerDocument.createElement('DIV');
308
+ bulkComponentContainer.appendChild(componentContainer);
309
+ return new vNode.componentOptions.Ctor(settings).$mount(componentContainer);
310
+ }
311
+ /**
312
+ * Compare two objects using `JSON.stringify`.
313
+ * *Note: * As it's using the stringify function to compare objects, the property order in both objects is
314
+ * important. It will return `false` for the same objects, if they're defined in a different order.
315
+ *
316
+ * @param {object} objectA First object to compare.
317
+ * @param {object} objectB Second object to compare.
318
+ * @returns {boolean} `true` if they're the same, `false` otherwise.
319
+ */
320
+ function simpleEqual(objectA, objectB) {
321
+ return JSON.stringify(objectA) === JSON.stringify(objectB);
322
+ }
323
+
324
+ var version="0.0.0-next-9ec04ce-20221121";
325
+
326
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
327
+
328
+ function createCommonjsModule(fn, module) {
329
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
330
+ }
331
+
332
+ var lru = createCommonjsModule(function (module, exports) {
333
+ /**
334
+ * A doubly linked list-based Least Recently Used (LRU) cache. Will keep most
335
+ * recently used items while discarding least recently used items when its limit
336
+ * is reached.
337
+ *
338
+ * Licensed under MIT. Copyright (c) 2010 Rasmus Andersson <http://hunch.se/>
339
+ * See README.md for details.
340
+ *
341
+ * Illustration of the design:
342
+ *
343
+ * entry entry entry entry
344
+ * ______ ______ ______ ______
345
+ * | head |.newer => | |.newer => | |.newer => | tail |
346
+ * | A | | B | | C | | D |
347
+ * |______| <= older.|______| <= older.|______| <= older.|______|
348
+ *
349
+ * removed <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- added
350
+ */
351
+ (function (g, f) {
352
+ var e = exports ;
353
+ f(e);
354
+ })(commonjsGlobal, function (exports) {
355
+ var NEWER = Symbol('newer');
356
+ var OLDER = Symbol('older');
357
+ function LRUMap(limit, entries) {
358
+ if (typeof limit !== 'number') {
359
+ // called as (entries)
360
+ entries = limit;
361
+ limit = 0;
362
+ }
363
+ this.size = 0;
364
+ this.limit = limit;
365
+ this.oldest = this.newest = undefined;
366
+ this._keymap = new Map();
367
+ if (entries) {
368
+ this.assign(entries);
369
+ if (limit < 1) {
370
+ this.limit = this.size;
371
+ }
372
+ }
373
+ }
374
+ exports.LRUMap = LRUMap;
375
+ function Entry(key, value) {
376
+ this.key = key;
377
+ this.value = value;
378
+ this[NEWER] = undefined;
379
+ this[OLDER] = undefined;
380
+ }
381
+ LRUMap.prototype._markEntryAsUsed = function (entry) {
382
+ if (entry === this.newest) {
383
+ // Already the most recenlty used entry, so no need to update the list
384
+ return;
385
+ }
386
+ // HEAD--------------TAIL
387
+ // <.older .newer>
388
+ // <--- add direction --
389
+ // A B C <D> E
390
+ if (entry[NEWER]) {
391
+ if (entry === this.oldest) {
392
+ this.oldest = entry[NEWER];
393
+ }
394
+ entry[NEWER][OLDER] = entry[OLDER]; // C <-- E.
395
+ }
396
+
397
+ if (entry[OLDER]) {
398
+ entry[OLDER][NEWER] = entry[NEWER]; // C. --> E
399
+ }
400
+
401
+ entry[NEWER] = undefined; // D --x
402
+ entry[OLDER] = this.newest; // D. --> E
403
+ if (this.newest) {
404
+ this.newest[NEWER] = entry; // E. <-- D
405
+ }
406
+
407
+ this.newest = entry;
408
+ };
409
+ LRUMap.prototype.assign = function (entries) {
410
+ var entry,
411
+ limit = this.limit || Number.MAX_VALUE;
412
+ this._keymap.clear();
413
+ var it = entries[Symbol.iterator]();
414
+ for (var itv = it.next(); !itv.done; itv = it.next()) {
415
+ var e = new Entry(itv.value[0], itv.value[1]);
416
+ this._keymap.set(e.key, e);
417
+ if (!entry) {
418
+ this.oldest = e;
419
+ } else {
420
+ entry[NEWER] = e;
421
+ e[OLDER] = entry;
422
+ }
423
+ entry = e;
424
+ if (limit-- == 0) {
425
+ throw new Error('overflow');
426
+ }
427
+ }
428
+ this.newest = entry;
429
+ this.size = this._keymap.size;
430
+ };
431
+ LRUMap.prototype.get = function (key) {
432
+ // First, find our cache entry
433
+ var entry = this._keymap.get(key);
434
+ if (!entry) return; // Not cached. Sorry.
435
+ // As <key> was found in the cache, register it as being requested recently
436
+ this._markEntryAsUsed(entry);
437
+ return entry.value;
438
+ };
439
+ LRUMap.prototype.set = function (key, value) {
440
+ var entry = this._keymap.get(key);
441
+ if (entry) {
442
+ // update existing
443
+ entry.value = value;
444
+ this._markEntryAsUsed(entry);
445
+ return this;
446
+ }
447
+
448
+ // new entry
449
+ this._keymap.set(key, entry = new Entry(key, value));
450
+ if (this.newest) {
451
+ // link previous tail to the new tail (entry)
452
+ this.newest[NEWER] = entry;
453
+ entry[OLDER] = this.newest;
454
+ } else {
455
+ // we're first in -- yay
456
+ this.oldest = entry;
457
+ }
458
+
459
+ // add new entry to the end of the linked list -- it's now the freshest entry.
460
+ this.newest = entry;
461
+ ++this.size;
462
+ if (this.size > this.limit) {
463
+ // we hit the limit -- remove the head
464
+ this.shift();
465
+ }
466
+ return this;
467
+ };
468
+ LRUMap.prototype.shift = function () {
469
+ // todo: handle special case when limit == 1
470
+ var entry = this.oldest;
471
+ if (entry) {
472
+ if (this.oldest[NEWER]) {
473
+ // advance the list
474
+ this.oldest = this.oldest[NEWER];
475
+ this.oldest[OLDER] = undefined;
476
+ } else {
477
+ // the cache is exhausted
478
+ this.oldest = undefined;
479
+ this.newest = undefined;
480
+ }
481
+ // Remove last strong reference to <entry> and remove links from the purged
482
+ // entry being returned:
483
+ entry[NEWER] = entry[OLDER] = undefined;
484
+ this._keymap["delete"](entry.key);
485
+ --this.size;
486
+ return [entry.key, entry.value];
487
+ }
488
+ };
489
+
490
+ // ----------------------------------------------------------------------------
491
+ // Following code is optional and can be removed without breaking the core
492
+ // functionality.
493
+ LRUMap.prototype.has = function (key) {
494
+ return this._keymap.has(key);
495
+ };
496
+ });
497
+ });
498
+ var lru_1 = lru.LRUMap;
499
+
500
+ var HotTable = {
501
+ name: 'HotTable',
502
+ props: propFactory('HotTable'),
503
+ watch: {
504
+ mergedHotSettings: function mergedHotSettings(value) {
505
+ if (!this.hotInstance || value === void 0) {
506
+ return;
507
+ }
508
+ if (value.data) {
509
+ if (this.hotInstance.isColumnModificationAllowed() || !this.hotInstance.isColumnModificationAllowed() && this.hotInstance.countSourceCols() === this.miscCache.currentSourceColumns) {
510
+ // If the dataset dimensions change, update the index mappers.
511
+ this.matchHotMappersSize();
512
+ // Data is automatically synchronized by reference.
513
+ delete value.data;
514
+ }
515
+ }
516
+ // If there are another options changed, update the HOT settings, render the table otherwise.
517
+ if (Object.keys(value).length) {
518
+ this.hotInstance.updateSettings(value);
519
+ } else {
520
+ this.hotInstance.render();
521
+ }
522
+ this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();
523
+ }
524
+ },
525
+ data: function data() {
526
+ var thisComponent = this;
527
+ var rendererCache = new lru_1(this.wrapperRendererCacheSize);
528
+ // Make the LRU cache destroy each removed component
529
+ rendererCache.shift = function () {
530
+ var entry = lru_1.prototype.shift.call(this);
531
+ entry[1].component.$destroy();
532
+ return entry;
533
+ };
534
+ return {
535
+ __internalEdit: false,
536
+ miscCache: {
537
+ currentSourceColumns: null
538
+ },
539
+ __hotInstance: null,
540
+ columnSettings: null,
541
+ rendererCache: rendererCache,
542
+ editorCache: new Map(),
543
+ get hotInstance() {
544
+ if (!thisComponent.__hotInstance || thisComponent.__hotInstance && !thisComponent.__hotInstance.isDestroyed) {
545
+ // Will return the Handsontable instance or `null` if it's not yet been created.
546
+ return thisComponent.__hotInstance;
547
+ } else {
548
+ console.warn(HOT_DESTROYED_WARNING);
549
+ return null;
550
+ }
551
+ },
552
+ set hotInstance(hotInstance) {
553
+ thisComponent.__hotInstance = hotInstance;
554
+ }
555
+ };
556
+ },
557
+ computed: {
558
+ mergedHotSettings: function mergedHotSettings() {
559
+ return prepareSettings(this.$props, this.hotInstance ? this.hotInstance.getSettings() : void 0);
560
+ }
561
+ },
562
+ methods: {
563
+ /**
564
+ * Initialize Handsontable.
565
+ */
566
+ hotInit: function hotInit() {
567
+ var globalRendererVNode = this.getGlobalRendererVNode();
568
+ var globalEditorVNode = this.getGlobalEditorVNode();
569
+ var newSettings = prepareSettings(this.$props);
570
+ newSettings.columns = this.columnSettings ? this.columnSettings : newSettings.columns;
571
+ if (globalEditorVNode) {
572
+ newSettings.editor = this.getEditorClass(globalEditorVNode, this);
573
+ globalEditorVNode.child.$destroy();
574
+ }
575
+ if (globalRendererVNode) {
576
+ newSettings.renderer = this.getRendererWrapper(globalRendererVNode, this);
577
+ globalRendererVNode.child.$destroy();
578
+ }
579
+ this.hotInstance = new Handsontable__default["default"].Core(this.$el, newSettings);
580
+ this.hotInstance.init();
581
+ preventInternalEditWatch(this);
582
+ this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();
583
+ },
584
+ matchHotMappersSize: function matchHotMappersSize() {
585
+ var _this = this;
586
+ if (!this.hotInstance) {
587
+ return;
588
+ }
589
+ var data = this.hotInstance.getSourceData();
590
+ var rowsToRemove = [];
591
+ var columnsToRemove = [];
592
+ var indexMapperRowCount = this.hotInstance.rowIndexMapper.getNumberOfIndexes();
593
+ var isColumnModificationAllowed = this.hotInstance.isColumnModificationAllowed();
594
+ var indexMapperColumnCount = 0;
595
+ if (data && data.length !== indexMapperRowCount) {
596
+ if (data.length < indexMapperRowCount) {
597
+ for (var r = data.length; r < indexMapperRowCount; r++) {
598
+ rowsToRemove.push(r);
599
+ }
600
+ }
601
+ }
602
+ if (isColumnModificationAllowed) {
603
+ var _data$;
604
+ indexMapperColumnCount = this.hotInstance.columnIndexMapper.getNumberOfIndexes();
605
+ if (data && data[0] && ((_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$.length) !== indexMapperColumnCount) {
606
+ if (data[0].length < indexMapperColumnCount) {
607
+ for (var c = data[0].length; c < indexMapperColumnCount; c++) {
608
+ columnsToRemove.push(c);
609
+ }
610
+ }
611
+ }
612
+ }
613
+ this.hotInstance.batch(function () {
614
+ if (rowsToRemove.length > 0) {
615
+ _this.hotInstance.rowIndexMapper.removeIndexes(rowsToRemove);
616
+ } else {
617
+ _this.hotInstance.rowIndexMapper.insertIndexes(indexMapperRowCount - 1, data.length - indexMapperRowCount);
618
+ }
619
+ if (isColumnModificationAllowed && data.length !== 0) {
620
+ if (columnsToRemove.length > 0) {
621
+ _this.hotInstance.columnIndexMapper.removeIndexes(columnsToRemove);
622
+ } else {
623
+ _this.hotInstance.columnIndexMapper.insertIndexes(indexMapperColumnCount - 1, data[0].length - indexMapperColumnCount);
624
+ }
625
+ }
626
+ });
627
+ },
628
+ getGlobalRendererVNode: function getGlobalRendererVNode() {
629
+ var hotTableSlots = this.$slots["default"] || [];
630
+ return findVNodeByType(hotTableSlots, 'hot-renderer');
631
+ },
632
+ getGlobalEditorVNode: function getGlobalEditorVNode() {
633
+ var hotTableSlots = this.$slots["default"] || [];
634
+ return findVNodeByType(hotTableSlots, 'hot-editor');
635
+ },
636
+ /**
637
+ * Get settings for the columns provided in the `hot-column` components.
638
+ */
639
+ getColumnSettings: function getColumnSettings() {
640
+ var hotColumns = getHotColumnComponents(this.$children);
641
+ var usesRendererComponent = false;
642
+ var columnSettings = hotColumns.map(function (elem) {
643
+ if (elem.usesRendererComponent) {
644
+ usesRendererComponent = true;
645
+ }
646
+ return _objectSpread2({}, elem.columnSettings);
647
+ });
648
+ if (usesRendererComponent && this.settings && (this.settings.autoColumnSize !== false || this.settings.autoRowSize) && (this.autoColumnSize !== false || this.autoRowSize)) {
649
+ console.warn('Your `hot-table` configuration includes both `hot-column` and `autoRowSize`/`autoColumnSize`, which are not compatible with each other ' + 'in this version of `@handsontable/vue`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.');
650
+ }
651
+ return columnSettings.length ? columnSettings : void 0;
652
+ },
653
+ /**
654
+ * Create the wrapper function for the provided renderer child component.
655
+ *
656
+ * @param {Object} vNode VNode of the renderer child component.
657
+ * @param {Boolean} containerComponent Instance of the component, which will be treated as a parent for the newly created renderer component.
658
+ * @returns {Function} The wrapper function used as the renderer.
659
+ */
660
+ getRendererWrapper: function getRendererWrapper(vNode, containerComponent) {
661
+ var $vm = this;
662
+ return function (instance, TD, row, col, prop, value, cellProperties) {
663
+ // Prevent caching and rendering of the GhostTable table cells
664
+ if (TD && !TD.getAttribute('ghost-table')) {
665
+ var rendererCache = $vm.rendererCache;
666
+ var rendererArgs = {
667
+ hotInstance: instance,
668
+ TD: TD,
669
+ row: row,
670
+ col: col,
671
+ prop: prop,
672
+ value: value,
673
+ cellProperties: cellProperties,
674
+ isRenderer: true
675
+ };
676
+ if (rendererCache && !rendererCache.has("".concat(row, "-").concat(col))) {
677
+ var mountedComponent = createVueComponent(vNode, containerComponent, vNode.componentOptions.propsData, rendererArgs);
678
+ rendererCache.set("".concat(row, "-").concat(col), {
679
+ component: mountedComponent,
680
+ lastUsedTD: null
681
+ });
682
+ }
683
+ var cachedEntry = rendererCache.get("".concat(row, "-").concat(col));
684
+ var cachedComponent = cachedEntry.component;
685
+ var cachedTD = cachedEntry.lastUsedTD;
686
+ Object.assign(cachedComponent.$data, rendererArgs);
687
+ if (!cachedComponent.$el.parentElement || cachedTD !== TD) {
688
+ // Clear the previous contents of a TD
689
+ while (TD.firstChild) {
690
+ TD.removeChild(TD.firstChild);
691
+ }
692
+ TD.appendChild(cachedComponent.$el);
693
+ cachedEntry.lastUsedTD = TD;
694
+ }
695
+ }
696
+ return TD;
697
+ };
698
+ },
699
+ /**
700
+ * Create a fresh class to be used as an editor, based on the editor component provided.
701
+ *
702
+ * @param {Object} vNode VNode for the editor child component.
703
+ * @param {Boolean} containerComponent Instance of the component, which will be treated as a parent for the newly created editor component.
704
+ * @returns {Class} The class used as an editor in Handsontable.
705
+ */
706
+ getEditorClass: function getEditorClass(vNode, containerComponent) {
707
+ var componentKey = vNode.key ? vNode.key.toString() : null;
708
+ var componentName = vNode.componentOptions.Ctor.options.name;
709
+ var componentCacheKey = componentKey ? "".concat(componentName, ":").concat(componentKey) : componentName;
710
+ var editorCache = this.editorCache;
711
+ var mountedComponent = null;
712
+ if (!editorCache.has(componentCacheKey)) {
713
+ mountedComponent = createVueComponent(vNode, containerComponent, vNode.componentOptions.propsData, {
714
+ isEditor: true
715
+ });
716
+ editorCache.set(componentCacheKey, mountedComponent);
717
+ } else {
718
+ mountedComponent = editorCache.get(componentCacheKey);
719
+ }
720
+ return mountedComponent.$data.hotCustomEditorClass;
721
+ }
722
+ },
723
+ mounted: function mounted() {
724
+ this.columnSettings = this.getColumnSettings();
725
+ return this.hotInit();
726
+ },
727
+ beforeDestroy: function beforeDestroy() {
728
+ if (this.hotInstance) {
729
+ this.hotInstance.destroy();
730
+ }
731
+ },
732
+ version: version
733
+ };
734
+
735
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
736
+ if (typeof shadowMode !== 'boolean') {
737
+ createInjectorSSR = createInjector;
738
+ createInjector = shadowMode;
739
+ shadowMode = false;
740
+ }
741
+ // Vue.extend constructor export interop.
742
+ const options = typeof script === 'function' ? script.options : script;
743
+ // render functions
744
+ if (template && template.render) {
745
+ options.render = template.render;
746
+ options.staticRenderFns = template.staticRenderFns;
747
+ options._compiled = true;
748
+ // functional template
749
+ if (isFunctionalTemplate) {
750
+ options.functional = true;
751
+ }
752
+ }
753
+ // scopedId
754
+ if (scopeId) {
755
+ options._scopeId = scopeId;
756
+ }
757
+ let hook;
758
+ if (moduleIdentifier) {
759
+ // server build
760
+ hook = function (context) {
761
+ // 2.3 injection
762
+ context =
763
+ context || // cached call
764
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
765
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
766
+ // 2.2 with runInNewContext: true
767
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
768
+ context = __VUE_SSR_CONTEXT__;
769
+ }
770
+ // inject component styles
771
+ if (style) {
772
+ style.call(this, createInjectorSSR(context));
773
+ }
774
+ // register component module identifier for async chunk inference
775
+ if (context && context._registeredComponents) {
776
+ context._registeredComponents.add(moduleIdentifier);
777
+ }
778
+ };
779
+ // used by ssr in case component is cached and beforeCreate
780
+ // never gets called
781
+ options._ssrRegister = hook;
782
+ }
783
+ else if (style) {
784
+ hook = shadowMode
785
+ ? function (context) {
786
+ style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
787
+ }
788
+ : function (context) {
789
+ style.call(this, createInjector(context));
790
+ };
791
+ }
792
+ if (hook) {
793
+ if (options.functional) {
794
+ // register for functional component in vue file
795
+ const originalRender = options.render;
796
+ options.render = function renderWithStyleInjection(h, context) {
797
+ hook.call(context);
798
+ return originalRender(h, context);
799
+ };
800
+ }
801
+ else {
802
+ // inject component registration as beforeCreate hook
803
+ const existing = options.beforeCreate;
804
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
805
+ }
806
+ }
807
+ return script;
808
+ }
809
+
810
+ /* script */
811
+ var __vue_script__$2 = HotTable;
812
+
813
+ /* template */
814
+ var __vue_render__ = function __vue_render__() {
815
+ var _vm = this;
816
+ var _h = _vm.$createElement;
817
+ var _c = _vm._self._c || _h;
818
+ return _c('div', {
819
+ attrs: {
820
+ "id": _vm.id
821
+ }
822
+ }, [_vm._t("default")], 2);
823
+ };
824
+ var __vue_staticRenderFns__ = [];
825
+
826
+ /* style */
827
+ var __vue_inject_styles__$2 = undefined;
828
+ /* scoped */
829
+ var __vue_scope_id__$2 = undefined;
830
+ /* module identifier */
831
+ var __vue_module_identifier__$2 = undefined;
832
+ /* functional template */
833
+ var __vue_is_functional_template__$2 = false;
834
+ /* style inject */
835
+
836
+ /* style inject SSR */
837
+
838
+ /* style inject shadow dom */
839
+
840
+ var __vue_component__$2 = /*#__PURE__*/normalizeComponent({
841
+ render: __vue_render__,
842
+ staticRenderFns: __vue_staticRenderFns__
843
+ }, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, false, undefined, undefined, undefined);
844
+
845
+ var HotColumn = {
846
+ name: 'HotColumn',
847
+ props: propFactory('HotColumn'),
848
+ methods: {
849
+ /**
850
+ * Create the column settings based on the data provided to the `hot-column` component and it's child components.
851
+ */
852
+ createColumnSettings: function createColumnSettings() {
853
+ var hotColumnSlots = this.$slots["default"] || [];
854
+ var rendererVNode = findVNodeByType(hotColumnSlots, 'hot-renderer');
855
+ var editorVNode = findVNodeByType(hotColumnSlots, 'hot-editor');
856
+ var assignedProps = filterPassedProps(this.$props);
857
+ if (rendererVNode && this.usesRendererComponent === void 0) {
858
+ this.usesRendererComponent = true;
859
+ }
860
+ this.columnSettings = _objectSpread2({}, assignedProps);
861
+ if (rendererVNode !== null) {
862
+ this.columnSettings.renderer = this.$parent.getRendererWrapper(rendererVNode, this);
863
+ } else if (assignedProps.renderer) {
864
+ this.columnSettings.renderer = assignedProps.renderer;
865
+ }
866
+ if (editorVNode !== null) {
867
+ this.columnSettings.editor = this.$parent.getEditorClass(editorVNode, this);
868
+ } else if (assignedProps.editor) {
869
+ this.columnSettings.editor = assignedProps.editor;
870
+ }
871
+ }
872
+ },
873
+ mounted: function mounted() {
874
+ this.createColumnSettings();
875
+ },
876
+ render: function render() {
877
+ return null;
878
+ }
879
+ };
880
+
881
+ /* script */
882
+ var __vue_script__$1 = HotColumn;
883
+
884
+ /* template */
885
+
886
+ /* style */
887
+ var __vue_inject_styles__$1 = undefined;
888
+ /* scoped */
889
+ var __vue_scope_id__$1 = undefined;
890
+ /* module identifier */
891
+ var __vue_module_identifier__$1 = undefined;
892
+ /* functional template */
893
+ var __vue_is_functional_template__$1 = undefined;
894
+ /* style inject */
895
+
896
+ /* style inject SSR */
897
+
898
+ /* style inject shadow dom */
899
+
900
+ var __vue_component__$1 = /*#__PURE__*/normalizeComponent({}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);
901
+
902
+ /*! *****************************************************************************
903
+ Copyright (c) Microsoft Corporation. All rights reserved.
904
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
905
+ this file except in compliance with the License. You may obtain a copy of the
906
+ License at http://www.apache.org/licenses/LICENSE-2.0
907
+
908
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
909
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
910
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
911
+ MERCHANTABLITY OR NON-INFRINGEMENT.
912
+
913
+ See the Apache Version 2.0 License for specific language governing permissions
914
+ and limitations under the License.
915
+ ***************************************************************************** */
916
+
917
+ function __decorate(decorators, target, key, desc) {
918
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
919
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
920
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
921
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
922
+ }
923
+
924
+ function _typeof(obj) {
925
+ if (typeof Symbol === "function" && _typeof$1(Symbol.iterator) === "symbol") {
926
+ _typeof = function _typeof(obj) {
927
+ return _typeof$1(obj);
928
+ };
929
+ } else {
930
+ _typeof = function _typeof(obj) {
931
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof$1(obj);
932
+ };
933
+ }
934
+ return _typeof(obj);
935
+ }
936
+ function _defineProperty(obj, key, value) {
937
+ if (key in obj) {
938
+ Object.defineProperty(obj, key, {
939
+ value: value,
940
+ enumerable: true,
941
+ configurable: true,
942
+ writable: true
943
+ });
944
+ } else {
945
+ obj[key] = value;
946
+ }
947
+ return obj;
948
+ }
949
+ function _toConsumableArray(arr) {
950
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
951
+ }
952
+ function _arrayWithoutHoles(arr) {
953
+ if (Array.isArray(arr)) {
954
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
955
+ arr2[i] = arr[i];
956
+ }
957
+ return arr2;
958
+ }
959
+ }
960
+ function _iterableToArray(iter) {
961
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
962
+ }
963
+ function _nonIterableSpread() {
964
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
965
+ }
966
+
967
+ // The rational behind the verbose Reflect-feature check below is the fact that there are polyfills
968
+ // which add an implementation for Reflect.defineMetadata but not for Reflect.getOwnMetadataKeys.
969
+ // Without this check consumers will encounter hard to track down runtime errors.
970
+ function reflectionIsSupported() {
971
+ return typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys;
972
+ }
973
+ function copyReflectionMetadata(to, from) {
974
+ forwardMetadata(to, from);
975
+ Object.getOwnPropertyNames(from.prototype).forEach(function (key) {
976
+ forwardMetadata(to.prototype, from.prototype, key);
977
+ });
978
+ Object.getOwnPropertyNames(from).forEach(function (key) {
979
+ forwardMetadata(to, from, key);
980
+ });
981
+ }
982
+ function forwardMetadata(to, from, propertyKey) {
983
+ var metaKeys = propertyKey ? Reflect.getOwnMetadataKeys(from, propertyKey) : Reflect.getOwnMetadataKeys(from);
984
+ metaKeys.forEach(function (metaKey) {
985
+ var metadata = propertyKey ? Reflect.getOwnMetadata(metaKey, from, propertyKey) : Reflect.getOwnMetadata(metaKey, from);
986
+ if (propertyKey) {
987
+ Reflect.defineMetadata(metaKey, metadata, to, propertyKey);
988
+ } else {
989
+ Reflect.defineMetadata(metaKey, metadata, to);
990
+ }
991
+ });
992
+ }
993
+ var fakeArray = {
994
+ __proto__: []
995
+ };
996
+ var hasProto = fakeArray instanceof Array;
997
+ function isPrimitive(value) {
998
+ var type = _typeof(value);
999
+ return value == null || type !== 'object' && type !== 'function';
1000
+ }
1001
+ function collectDataFromConstructor(vm, Component) {
1002
+ // override _init to prevent to init as Vue instance
1003
+ var originalInit = Component.prototype._init;
1004
+ Component.prototype._init = function () {
1005
+ var _this = this;
1006
+
1007
+ // proxy to actual vm
1008
+ var keys = Object.getOwnPropertyNames(vm); // 2.2.0 compat (props are no longer exposed as self properties)
1009
+
1010
+ if (vm.$options.props) {
1011
+ for (var key in vm.$options.props) {
1012
+ if (!vm.hasOwnProperty(key)) {
1013
+ keys.push(key);
1014
+ }
1015
+ }
1016
+ }
1017
+ keys.forEach(function (key) {
1018
+ Object.defineProperty(_this, key, {
1019
+ get: function get() {
1020
+ return vm[key];
1021
+ },
1022
+ set: function set(value) {
1023
+ vm[key] = value;
1024
+ },
1025
+ configurable: true
1026
+ });
1027
+ });
1028
+ }; // should be acquired class property values
1029
+
1030
+ var data = new Component(); // restore original _init to avoid memory leak (#209)
1031
+
1032
+ Component.prototype._init = originalInit; // create plain data object
1033
+
1034
+ var plainData = {};
1035
+ Object.keys(data).forEach(function (key) {
1036
+ if (data[key] !== undefined) {
1037
+ plainData[key] = data[key];
1038
+ }
1039
+ });
1040
+ return plainData;
1041
+ }
1042
+ var $internalHooks = ['data', 'beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeDestroy', 'destroyed', 'beforeUpdate', 'updated', 'activated', 'deactivated', 'render', 'errorCaptured', 'serverPrefetch' // 2.6
1043
+ ];
1044
+
1045
+ function componentFactory(Component) {
1046
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1047
+ options.name = options.name || Component._componentTag || Component.name; // prototype props.
1048
+
1049
+ var proto = Component.prototype;
1050
+ Object.getOwnPropertyNames(proto).forEach(function (key) {
1051
+ if (key === 'constructor') {
1052
+ return;
1053
+ } // hooks
1054
+
1055
+ if ($internalHooks.indexOf(key) > -1) {
1056
+ options[key] = proto[key];
1057
+ return;
1058
+ }
1059
+ var descriptor = Object.getOwnPropertyDescriptor(proto, key);
1060
+ if (descriptor.value !== void 0) {
1061
+ // methods
1062
+ if (typeof descriptor.value === 'function') {
1063
+ (options.methods || (options.methods = {}))[key] = descriptor.value;
1064
+ } else {
1065
+ // typescript decorated data
1066
+ (options.mixins || (options.mixins = [])).push({
1067
+ data: function data() {
1068
+ return _defineProperty({}, key, descriptor.value);
1069
+ }
1070
+ });
1071
+ }
1072
+ } else if (descriptor.get || descriptor.set) {
1073
+ // computed properties
1074
+ (options.computed || (options.computed = {}))[key] = {
1075
+ get: descriptor.get,
1076
+ set: descriptor.set
1077
+ };
1078
+ }
1079
+ });
1080
+ (options.mixins || (options.mixins = [])).push({
1081
+ data: function data() {
1082
+ return collectDataFromConstructor(this, Component);
1083
+ }
1084
+ }); // decorate options
1085
+
1086
+ var decorators = Component.__decorators__;
1087
+ if (decorators) {
1088
+ decorators.forEach(function (fn) {
1089
+ return fn(options);
1090
+ });
1091
+ delete Component.__decorators__;
1092
+ } // find super
1093
+
1094
+ var superProto = Object.getPrototypeOf(Component.prototype);
1095
+ var Super = superProto instanceof Vue__default["default"] ? superProto.constructor : Vue__default["default"];
1096
+ var Extended = Super.extend(options);
1097
+ forwardStaticMembers(Extended, Component, Super);
1098
+ if (reflectionIsSupported()) {
1099
+ copyReflectionMetadata(Extended, Component);
1100
+ }
1101
+ return Extended;
1102
+ }
1103
+ var shouldIgnore = {
1104
+ prototype: true,
1105
+ arguments: true,
1106
+ callee: true,
1107
+ caller: true
1108
+ };
1109
+ function forwardStaticMembers(Extended, Original, Super) {
1110
+ // We have to use getOwnPropertyNames since Babel registers methods as non-enumerable
1111
+ Object.getOwnPropertyNames(Original).forEach(function (key) {
1112
+ // Skip the properties that should not be overwritten
1113
+ if (shouldIgnore[key]) {
1114
+ return;
1115
+ } // Some browsers does not allow reconfigure built-in properties
1116
+
1117
+ var extendedDescriptor = Object.getOwnPropertyDescriptor(Extended, key);
1118
+ if (extendedDescriptor && !extendedDescriptor.configurable) {
1119
+ return;
1120
+ }
1121
+ var descriptor = Object.getOwnPropertyDescriptor(Original, key); // If the user agent does not support `__proto__` or its family (IE <= 10),
1122
+ // the sub class properties may be inherited properties from the super class in TypeScript.
1123
+ // We need to exclude such properties to prevent to overwrite
1124
+ // the component options object which stored on the extended constructor (See #192).
1125
+ // If the value is a referenced value (object or function),
1126
+ // we can check equality of them and exclude it if they have the same reference.
1127
+ // If it is a primitive value, it will be forwarded for safety.
1128
+
1129
+ if (!hasProto) {
1130
+ // Only `cid` is explicitly exluded from property forwarding
1131
+ // because we cannot detect whether it is a inherited property or not
1132
+ // on the no `__proto__` environment even though the property is reserved.
1133
+ if (key === 'cid') {
1134
+ return;
1135
+ }
1136
+ var superDescriptor = Object.getOwnPropertyDescriptor(Super, key);
1137
+ if (!isPrimitive(descriptor.value) && superDescriptor && superDescriptor.value === descriptor.value) {
1138
+ return;
1139
+ }
1140
+ } // Warn if the users manually declare reserved properties
1141
+ Object.defineProperty(Extended, key, descriptor);
1142
+ });
1143
+ }
1144
+ function Component(options) {
1145
+ if (typeof options === 'function') {
1146
+ return componentFactory(options);
1147
+ }
1148
+ return function (Component) {
1149
+ return componentFactory(Component, options);
1150
+ };
1151
+ }
1152
+ Component.registerHooks = function registerHooks(keys) {
1153
+ $internalHooks.push.apply($internalHooks, _toConsumableArray(keys));
1154
+ };
1155
+
1156
+ var BaseEditorComponent = /*#__PURE__*/function (_Vue) {
1157
+ _inherits(BaseEditorComponent, _Vue);
1158
+ var _super = _createSuper(BaseEditorComponent);
1159
+ function BaseEditorComponent() {
1160
+ var _this2;
1161
+ _classCallCheck(this, BaseEditorComponent);
1162
+ _this2 = _super.apply(this, arguments);
1163
+ _this2.name = 'BaseEditorComponent';
1164
+ _this2.instance = null;
1165
+ _this2.row = null;
1166
+ _this2.col = null;
1167
+ _this2.prop = null;
1168
+ _this2.TD = null;
1169
+ _this2.originalValue = null;
1170
+ _this2.cellProperties = null;
1171
+ _this2.state = null;
1172
+ _this2.hot = null;
1173
+ return _this2;
1174
+ }
1175
+ _createClass(BaseEditorComponent, [{
1176
+ key: "mounted",
1177
+ value: function mounted() {
1178
+ var _this = this;
1179
+ this.$data.hotCustomEditorClass = function () {
1180
+ var customEditorClass = /*#__PURE__*/function (_Handsontable$editors) {
1181
+ _inherits(CustomEditor, _Handsontable$editors);
1182
+ var _super2 = _createSuper(CustomEditor);
1183
+ function CustomEditor(hotInstance) {
1184
+ var _this3;
1185
+ _classCallCheck(this, CustomEditor);
1186
+ _this3 = _super2.call(this, hotInstance);
1187
+ _this.$data.hotCustomEditorInstance = _assertThisInitialized(_this3);
1188
+ return _this3;
1189
+ }
1190
+ _createClass(CustomEditor, [{
1191
+ key: "focus",
1192
+ value: function focus() {}
1193
+ }, {
1194
+ key: "getValue",
1195
+ value: function getValue() {}
1196
+ }, {
1197
+ key: "setValue",
1198
+ value: function setValue() {}
1199
+ }, {
1200
+ key: "open",
1201
+ value: function open() {}
1202
+ }, {
1203
+ key: "close",
1204
+ value: function close() {}
1205
+ }]);
1206
+ return CustomEditor;
1207
+ }(Handsontable__default["default"].editors.BaseEditor);
1208
+ // Fill with the rest of the BaseEditorComponent methods
1209
+ Object.getOwnPropertyNames(Handsontable__default["default"].editors.BaseEditor.prototype).forEach(function (propName) {
1210
+ if (propName === 'constructor') {
1211
+ return;
1212
+ }
1213
+ customEditorClass.prototype[propName] = function () {
1214
+ var _this$propName;
1215
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1216
+ args[_key] = arguments[_key];
1217
+ }
1218
+ return (_this$propName = _this[propName]).call.apply(_this$propName, [this].concat(args));
1219
+ };
1220
+ });
1221
+ return customEditorClass;
1222
+ }();
1223
+ }
1224
+ // BaseEditorComponent methods:
1225
+ }, {
1226
+ key: "_fireCallbacks",
1227
+ value: function _fireCallbacks() {
1228
+ var _Handsontable$editors2;
1229
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1230
+ args[_key2] = arguments[_key2];
1231
+ }
1232
+ (_Handsontable$editors2 = Handsontable__default["default"].editors.BaseEditor.prototype._fireCallbacks).call.apply(_Handsontable$editors2, [this.$data.hotCustomEditorInstance].concat(args));
1233
+ }
1234
+ }, {
1235
+ key: "beginEditing",
1236
+ value: function beginEditing() {
1237
+ var _Handsontable$editors3;
1238
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1239
+ args[_key3] = arguments[_key3];
1240
+ }
1241
+ return (_Handsontable$editors3 = Handsontable__default["default"].editors.BaseEditor.prototype.beginEditing).call.apply(_Handsontable$editors3, [this.$data.hotCustomEditorInstance].concat(args));
1242
+ }
1243
+ }, {
1244
+ key: "cancelChanges",
1245
+ value: function cancelChanges() {
1246
+ var _Handsontable$editors4;
1247
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1248
+ args[_key4] = arguments[_key4];
1249
+ }
1250
+ return (_Handsontable$editors4 = Handsontable__default["default"].editors.BaseEditor.prototype.cancelChanges).call.apply(_Handsontable$editors4, [this.$data.hotCustomEditorInstance].concat(args));
1251
+ }
1252
+ }, {
1253
+ key: "checkEditorSection",
1254
+ value: function checkEditorSection() {
1255
+ var _Handsontable$editors5;
1256
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
1257
+ args[_key5] = arguments[_key5];
1258
+ }
1259
+ return (_Handsontable$editors5 = Handsontable__default["default"].editors.BaseEditor.prototype.checkEditorSection).call.apply(_Handsontable$editors5, [this.$data.hotCustomEditorInstance].concat(args));
1260
+ }
1261
+ }, {
1262
+ key: "close",
1263
+ value: function close() {
1264
+ var _Handsontable$editors6;
1265
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
1266
+ args[_key6] = arguments[_key6];
1267
+ }
1268
+ return (_Handsontable$editors6 = Handsontable__default["default"].editors.BaseEditor.prototype.close).call.apply(_Handsontable$editors6, [this.$data.hotCustomEditorInstance].concat(args));
1269
+ }
1270
+ }, {
1271
+ key: "discardEditor",
1272
+ value: function discardEditor() {
1273
+ var _Handsontable$editors7;
1274
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
1275
+ args[_key7] = arguments[_key7];
1276
+ }
1277
+ return (_Handsontable$editors7 = Handsontable__default["default"].editors.BaseEditor.prototype.discardEditor).call.apply(_Handsontable$editors7, [this.$data.hotCustomEditorInstance].concat(args));
1278
+ }
1279
+ }, {
1280
+ key: "enableFullEditMode",
1281
+ value: function enableFullEditMode() {
1282
+ var _Handsontable$editors8;
1283
+ for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
1284
+ args[_key8] = arguments[_key8];
1285
+ }
1286
+ return (_Handsontable$editors8 = Handsontable__default["default"].editors.BaseEditor.prototype.enableFullEditMode).call.apply(_Handsontable$editors8, [this.$data.hotCustomEditorInstance].concat(args));
1287
+ }
1288
+ }, {
1289
+ key: "extend",
1290
+ value: function extend() {
1291
+ var _Handsontable$editors9;
1292
+ for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
1293
+ args[_key9] = arguments[_key9];
1294
+ }
1295
+ return (_Handsontable$editors9 = Handsontable__default["default"].editors.BaseEditor.prototype.extend).call.apply(_Handsontable$editors9, [this.$data.hotCustomEditorInstance].concat(args));
1296
+ }
1297
+ }, {
1298
+ key: "finishEditing",
1299
+ value: function finishEditing() {
1300
+ var _Handsontable$editors10;
1301
+ for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
1302
+ args[_key10] = arguments[_key10];
1303
+ }
1304
+ return (_Handsontable$editors10 = Handsontable__default["default"].editors.BaseEditor.prototype.finishEditing).call.apply(_Handsontable$editors10, [this.$data.hotCustomEditorInstance].concat(args));
1305
+ }
1306
+ }, {
1307
+ key: "focus",
1308
+ value: function focus() {
1309
+ var _Handsontable$editors11;
1310
+ for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
1311
+ args[_key11] = arguments[_key11];
1312
+ }
1313
+ return (_Handsontable$editors11 = Handsontable__default["default"].editors.BaseEditor.prototype.focus).call.apply(_Handsontable$editors11, [this.$data.hotCustomEditorInstance].concat(args));
1314
+ }
1315
+ }, {
1316
+ key: "getValue",
1317
+ value: function getValue() {
1318
+ var _Handsontable$editors12;
1319
+ for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
1320
+ args[_key12] = arguments[_key12];
1321
+ }
1322
+ return (_Handsontable$editors12 = Handsontable__default["default"].editors.BaseEditor.prototype.getValue).call.apply(_Handsontable$editors12, [this.$data.hotCustomEditorInstance].concat(args));
1323
+ }
1324
+ }, {
1325
+ key: "init",
1326
+ value: function init() {
1327
+ var _Handsontable$editors13;
1328
+ for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
1329
+ args[_key13] = arguments[_key13];
1330
+ }
1331
+ return (_Handsontable$editors13 = Handsontable__default["default"].editors.BaseEditor.prototype.init).call.apply(_Handsontable$editors13, [this.$data.hotCustomEditorInstance].concat(args));
1332
+ }
1333
+ }, {
1334
+ key: "isInFullEditMode",
1335
+ value: function isInFullEditMode() {
1336
+ var _Handsontable$editors14;
1337
+ for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
1338
+ args[_key14] = arguments[_key14];
1339
+ }
1340
+ return (_Handsontable$editors14 = Handsontable__default["default"].editors.BaseEditor.prototype.isInFullEditMode).call.apply(_Handsontable$editors14, [this.$data.hotCustomEditorInstance].concat(args));
1341
+ }
1342
+ }, {
1343
+ key: "isOpened",
1344
+ value: function isOpened() {
1345
+ var _Handsontable$editors15;
1346
+ for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
1347
+ args[_key15] = arguments[_key15];
1348
+ }
1349
+ return (_Handsontable$editors15 = Handsontable__default["default"].editors.BaseEditor.prototype.isOpened).call.apply(_Handsontable$editors15, [this.$data.hotCustomEditorInstance].concat(args));
1350
+ }
1351
+ }, {
1352
+ key: "isWaiting",
1353
+ value: function isWaiting() {
1354
+ var _Handsontable$editors16;
1355
+ for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
1356
+ args[_key16] = arguments[_key16];
1357
+ }
1358
+ return (_Handsontable$editors16 = Handsontable__default["default"].editors.BaseEditor.prototype.isWaiting).call.apply(_Handsontable$editors16, [this.$data.hotCustomEditorInstance].concat(args));
1359
+ }
1360
+ }, {
1361
+ key: "open",
1362
+ value: function open() {
1363
+ var _Handsontable$editors17;
1364
+ for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
1365
+ args[_key17] = arguments[_key17];
1366
+ }
1367
+ return (_Handsontable$editors17 = Handsontable__default["default"].editors.BaseEditor.prototype.open).call.apply(_Handsontable$editors17, [this.$data.hotCustomEditorInstance].concat(args));
1368
+ }
1369
+ }, {
1370
+ key: "prepare",
1371
+ value: function prepare(row, col, prop, TD, originalValue, cellProperties) {
1372
+ this.$data.hotInstance = cellProperties.instance;
1373
+ this.$data.row = row;
1374
+ this.$data.col = col;
1375
+ this.$data.prop = prop;
1376
+ this.$data.TD = TD;
1377
+ this.$data.originalValue = originalValue;
1378
+ this.$data.cellProperties = cellProperties;
1379
+ return Handsontable__default["default"].editors.BaseEditor.prototype.prepare.call(this.$data.hotCustomEditorInstance, row, col, prop, TD, originalValue, cellProperties);
1380
+ }
1381
+ }, {
1382
+ key: "saveValue",
1383
+ value: function saveValue() {
1384
+ var _Handsontable$editors18;
1385
+ for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
1386
+ args[_key18] = arguments[_key18];
1387
+ }
1388
+ return (_Handsontable$editors18 = Handsontable__default["default"].editors.BaseEditor.prototype.saveValue).call.apply(_Handsontable$editors18, [this.$data.hotCustomEditorInstance].concat(args));
1389
+ }
1390
+ }, {
1391
+ key: "setValue",
1392
+ value: function setValue() {
1393
+ var _Handsontable$editors19;
1394
+ for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
1395
+ args[_key19] = arguments[_key19];
1396
+ }
1397
+ return (_Handsontable$editors19 = Handsontable__default["default"].editors.BaseEditor.prototype.setValue).call.apply(_Handsontable$editors19, [this.$data.hotCustomEditorInstance].concat(args));
1398
+ }
1399
+ }, {
1400
+ key: "addHook",
1401
+ value: function addHook() {
1402
+ var _Handsontable$editors20;
1403
+ for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
1404
+ args[_key20] = arguments[_key20];
1405
+ }
1406
+ return (_Handsontable$editors20 = Handsontable__default["default"].editors.BaseEditor.prototype.addHook).call.apply(_Handsontable$editors20, [this.$data.hotCustomEditorInstance].concat(args));
1407
+ }
1408
+ }, {
1409
+ key: "removeHooksByKey",
1410
+ value: function removeHooksByKey() {
1411
+ var _Handsontable$editors21;
1412
+ for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
1413
+ args[_key21] = arguments[_key21];
1414
+ }
1415
+ return (_Handsontable$editors21 = Handsontable__default["default"].editors.BaseEditor.prototype.removeHooksByKey).call.apply(_Handsontable$editors21, [this.$data.hotCustomEditorInstance].concat(args));
1416
+ }
1417
+ }, {
1418
+ key: "clearHooks",
1419
+ value: function clearHooks() {
1420
+ var _Handsontable$editors22;
1421
+ for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
1422
+ args[_key22] = arguments[_key22];
1423
+ }
1424
+ return (_Handsontable$editors22 = Handsontable__default["default"].editors.BaseEditor.prototype.clearHooks).call.apply(_Handsontable$editors22, [this.$data.hotCustomEditorInstance].concat(args));
1425
+ }
1426
+ }, {
1427
+ key: "getEditedCell",
1428
+ value: function getEditedCell() {
1429
+ var _Handsontable$editors23;
1430
+ for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
1431
+ args[_key23] = arguments[_key23];
1432
+ }
1433
+ return (_Handsontable$editors23 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCell).call.apply(_Handsontable$editors23, [this.$data.hotCustomEditorInstance].concat(args));
1434
+ }
1435
+ }, {
1436
+ key: "getEditedCellRect",
1437
+ value: function getEditedCellRect() {
1438
+ var _Handsontable$editors24;
1439
+ for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
1440
+ args[_key24] = arguments[_key24];
1441
+ }
1442
+ return (_Handsontable$editors24 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCellRect).call.apply(_Handsontable$editors24, [this.$data.hotCustomEditorInstance].concat(args));
1443
+ }
1444
+ }, {
1445
+ key: "getEditedCellsZIndex",
1446
+ value: function getEditedCellsZIndex() {
1447
+ var _Handsontable$editors25;
1448
+ for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {
1449
+ args[_key25] = arguments[_key25];
1450
+ }
1451
+ return (_Handsontable$editors25 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCellsZIndex).call.apply(_Handsontable$editors25, [this.$data.hotCustomEditorInstance].concat(args));
1452
+ }
1453
+ }, {
1454
+ key: "getEditedCellsLayerClass",
1455
+ value: function getEditedCellsLayerClass() {
1456
+ var _Handsontable$editors26;
1457
+ for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {
1458
+ args[_key26] = arguments[_key26];
1459
+ }
1460
+ return (_Handsontable$editors26 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCellsLayerClass).call.apply(_Handsontable$editors26, [this.$data.hotCustomEditorInstance].concat(args));
1461
+ }
1462
+ }]);
1463
+ return BaseEditorComponent;
1464
+ }(Vue__default["default"]);
1465
+ BaseEditorComponent = __decorate([Component({})], BaseEditorComponent);
1466
+ var script = BaseEditorComponent;
1467
+
1468
+ /* script */
1469
+ var __vue_script__ = script;
1470
+
1471
+ /* template */
1472
+
1473
+ /* style */
1474
+ var __vue_inject_styles__ = undefined;
1475
+ /* scoped */
1476
+ var __vue_scope_id__ = undefined;
1477
+ /* module identifier */
1478
+ var __vue_module_identifier__ = undefined;
1479
+ /* functional template */
1480
+ var __vue_is_functional_template__ = undefined;
1481
+ /* style inject */
1482
+
1483
+ /* style inject SSR */
1484
+
1485
+ /* style inject shadow dom */
1486
+
1487
+ var __vue_component__ = /*#__PURE__*/normalizeComponent({}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
1488
+
1489
+ exports.BaseEditorComponent = __vue_component__;
1490
+ exports.HotColumn = __vue_component__$1;
1491
+ exports.HotTable = __vue_component__$2;
1492
+ exports["default"] = __vue_component__$2;