@handsontable/vue3 19.0.0-rc1 → 19.0.0-rc10
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.
package/README.md
CHANGED
|
@@ -240,7 +240,7 @@ Non-commercial projects, such as teaching or academic research, may qualify for
|
|
|
240
240
|
|
|
241
241
|
Pass your license key in the `licenseKey` option. The examples above leave that line commented out: uncomment it and add your key.
|
|
242
242
|
|
|
243
|
-
To evaluate Handsontable, [get a trial key](https://handsontable.com/pricing/). During the trial, the grid shows the Handsontable badge
|
|
243
|
+
To evaluate Handsontable, [get a trial key](https://handsontable.com/pricing/). During the trial, the grid shows the Handsontable badge, plus a "Powered by Handsontable DataGrid" bar below the table when the key's terms ask for it, and the console warns how many days remain. After the trial expires, the grid shows an expiration message and the console reports an error. When the grace period stored in the key also passes, a blocking screen replaces the grid. See [Trial keys](https://handsontable.com/docs/vue-data-grid/license-key/#trial-keys) for details.
|
|
244
244
|
|
|
245
245
|
For non-commercial use, [contact our sales team](https://handsontable.com/contact/) to apply for a free license.
|
|
246
246
|
|
package/dist/vue-handsontable.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
|
27
27
|
*
|
|
28
|
-
* Version: 19.0.0-
|
|
28
|
+
* Version: 19.0.0-rc10 (built at Wed Nov 25 2026 16:47:55 GMT+0000 (Coordinated Universal Time))
|
|
29
29
|
*/
|
|
30
30
|
(function (global, factory) {
|
|
31
31
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('handsontable/base')) :
|
|
@@ -651,7 +651,7 @@ function simpleEqual(objectA, objectB) {
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
-
var version="19.0.0-
|
|
654
|
+
var version="19.0.0-rc10";
|
|
655
655
|
|
|
656
656
|
var HotTable = vue.defineComponent({
|
|
657
657
|
name: 'HotTable',
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
|
27
27
|
*
|
|
28
|
-
* Version: 19.0.0-
|
|
28
|
+
* Version: 19.0.0-rc10 (built at Wed Nov 25 2026 16:47:57 GMT+0000 (Coordinated Universal Time))
|
|
29
29
|
*/
|
|
30
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("handsontable/base")):"function"==typeof define&&define.amd?define(["exports","vue","handsontable/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Handsontable=e.Handsontable||{},e.Handsontable.vue={}),e.Vue,e.Handsontable)}(this,function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(n);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}var l=Symbol("unassigned");function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function f(e){var t=o.default.hooks.getRegistered(),n={};for(var r in Object.assign(n,o.default.DefaultSettings),n)n[r]={default:l};for(var i=0;t.length>i;i++)n[t[i]]={default:l};return n.handsontable={default:l},n.settings={default:l},"HotTable"===e&&(n.getValue={default:l},n.id={type:String}),n}function d(e){var t={},n=e.settings;if(n!==l)for(var r in n)h(n,r)&&n[r]!==l&&(t[r]=n[r]);for(var o in e)h(e,o)&&"settings"!==o&&e[o]!==l&&(t[o]=e[o]);return t}function m(e){var t=d(e);return Object.keys(t).filter(function(e){return("function"==typeof t[e]||Array.isArray(t[e]))&&(o.default.hooks.isRegistered(e)||o.default.hooks.isDeprecated(e))})}function p(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function g(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap,r=t.toRaw(e);if(!Array.isArray(r)&&!p(r))return r;if(n.has(r))return n.get(r);if(Array.isArray(r)){var o=[];return n.set(r,o),r.forEach(function(e){o.push(g(e,n))}),o}var i={};return n.set(r,i),Object.keys(r).forEach(function(e){i[e]=g(r[e],n)}),i}function v(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakMap,o=t.toRaw(n);if(e===o)return!0;if(e instanceof RegExp||o instanceof RegExp)return e instanceof RegExp&&o instanceof RegExp&&e.source===o.source&&e.flags===o.flags;if(!(Array.isArray(e)&&Array.isArray(o)||p(e)&&p(o)))return!1;var i=e,s=o,a=r.get(i);if(null!=a&&a.has(s))return!0;a?a.add(s):r.set(i,new WeakSet([s]));var c=Object.keys(i);return c.length===Object.keys(s).length&&c.every(function(e){return h(s,e)&&v(i[e],s[e],r)})}var y=["data","colWidths","rowHeights","minRowHeights","themeName"],b=["sheetsBar"];function I(e,t,n,r){var o=null==r?void 0:r[e];return!!n&&!!o&&!y.includes(e)&&!Object.is(n[e],o.live)&&(j(o.prop,t)||!b.includes(e)&&v(o.copy,t))}function C(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=d(n);Object.keys(e).forEach(function(t){h(i,t)||delete e[t]}),Object.keys(i).forEach(function(n){o.includes(n)||y.includes(n)||(e[n]={prop:t.toRaw(i[n]),copy:b.includes(n)?void 0:g(i[n]),live:r[n]})})}function S(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=d(e),s=e.settings?e.settings:i,a=e.settings?i:null,c=(null==t?void 0:t._initOnlySettings)||[],u={},l=function(e,n){var s=I(e,h(i,e)?i[e]:n,t,r);return s&&!o.includes(e)&&o.push(e),s};for(var f in s)!h(s,f)||void 0===s[f]||c.includes(f)||l(f,s[f])||t&&"data"!==f&&O(f,t[f],s[f],t)||(u[f]=s[f]);for(var p in a)!h(a,p)||"id"===p||"settings"===p||void 0===a[p]||c.includes(p)||l(p,a[p])||t&&"data"!==p&&O(p,t[p],a[p],t)||(u[p]=a[p]);if(n.length>0){var g=m(e);n.forEach(function(e){g.includes(e)||(u[e]=null)})}return u}function O(e,t,n,r){return"sheetsBar"===e?w(t,n,function(e,t,n){return"sheets"===e?j(t,n):function(e,t){return w(e,t,function(e,t,n){return j(t,n)})}(t,n)}):"themeName"===e&&void 0===t?"string"==typeof n&&r.theme===n:function(e,t){var n=new WeakMap,r=0,o=function(e){var t=new WeakSet;return JSON.stringify(e,function(e,o){if("object"===u(o)&&null!==o){if(t.has(o))return;if(t.add(o),"undefined"!=typeof Node&&o instanceof Node){var i=n.get(o);return void 0===i&&n.set(o,i="__hot_node_".concat(r+=1,"__")),i}}return o})};if("function"==typeof e&&"function"==typeof t)return""+e==""+t;if(u(e)!==u(t))return!1;try{return o(e)===o(t)}catch(e){return!1}}(t,n)}function w(e,n,r){var o=t.toRaw(e),i=t.toRaw(n);if(o===i)return!0;if(!_(o)||!_(i))return!1;var s=Object.keys(o),a=Object.keys(i);return s.length===a.length&&s.every(function(e){return h(i,e)&&r(e,o[e],i[e])})}function j(e,n){return t.toRaw(e)===t.toRaw(n)}function _(e){return"[object Object]"===Object.prototype.toString.call(e)}var k=t.defineComponent({name:"HotTable",props:f("HotTable"),provide:function(){return{columnsCache:this.columnsCache,refreshColumns:this.refreshColumns}},watch:{id:{handler:function(e){e||(this.$el.id=this.getGeneratedId())},flush:"post"},$props:{handler:function(e){var n=[],r=S(e,this.hotInstance?this.hotInstance.getSettings():void 0,this.miscCache.hookKeys,this.miscCache.baselines,n);if(this.hotInstance&&void 0!==r){this.miscCache.hookKeys=m(e);var o=void 0!==r.data,i=o?t.toRaw(r.data):void 0,s=o&&i!==this.miscCache.lastData.value;o&&!s&&null===i?delete r.data:r.data&&!s&&(this.hotInstance.isColumnModificationAllowed()||!this.hotInstance.isColumnModificationAllowed()&&this.hotInstance.countSourceCols()===this.miscCache.currentSourceColumns)&&(this.matchHotMappersSize(),delete r.data),o&&(this.miscCache.lastData.value=i),Object.keys(r).length?this.hotInstance.updateSettings(r):this.hotInstance.render(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols(),C(this.miscCache.baselines,e,this.hotInstance.getSettings(),n)}},deep:!0,immediate:!0}},data:function(){return{__hotInstance:null,miscCache:{currentSourceColumns:null,generatedId:"",hookKeys:[],baselines:t.markRaw({}),lastData:t.markRaw({value:void 0})},columnSettings:null,columnsCache:new Map,columnsRefreshScheduled:!1,get hotInstance(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn("The Handsontable instance bound to this component was destroyed and cannot be used properly."),null)},set hotInstance(e){this.__hotInstance=e}}},methods:{getGeneratedId:function(){var e;return this.miscCache.generatedId||(this.miscCache.generatedId=(e=new Uint16Array(3),globalThis.crypto.getRandomValues(e),"hot-".concat(Array.from(e,function(e){return e.toString(16).padStart(4,"0")}).join("")))),this.miscCache.generatedId},hotInit:function(){var e=S(this.$props);e.columns=this.columnSettings?this.columnSettings:e.columns,this.hotInstance=t.markRaw(new o.default.Core(this.$el,e)),C(this.miscCache.baselines,this.$props,this.hotInstance.getSettings()),this.hotInstance.init(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols(),this.miscCache.hookKeys=m(this.$props),this.miscCache.lastData.value=t.toRaw(e.data)},matchHotMappersSize:function(){var e=this;if(this.hotInstance){var t,n=this.hotInstance.getSourceData(),r=[],o=[],i=this.hotInstance.rowIndexMapper.getNumberOfIndexes(),s=this.hotInstance.isColumnModificationAllowed(),a=0;if(n&&n.length!==i&&i>n.length)for(var c=n.length;i>c;c++)r.push(c);if(s)if(a=this.hotInstance.columnIndexMapper.getNumberOfIndexes(),n&&n[0]&&(null===(t=n[0])||void 0===t?void 0:t.length)!==a&&a>n[0].length)for(var u=n[0].length;a>u;u++)o.push(u);this.hotInstance.batch(function(){r.length>0?e.hotInstance.rowIndexMapper.removeIndexes(r):e.hotInstance.rowIndexMapper.insertIndexes(i-1,n.length-i),s&&0!==n.length&&(o.length>0?e.hotInstance.columnIndexMapper.removeIndexes(o):e.hotInstance.columnIndexMapper.insertIndexes(a-1,n[0].length-a))})}},getColumnSettings:function(){var e=Array.from(this.columnsCache.entries()).sort(function(e,t){var n=c(e,1)[0],r=c(t,1),o=n.$el,i=r[0].$el;if(!o||!i)return 0;var s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0}).map(function(e){return c(e,2)[1]});return e.length?e:void 0},refreshColumns:function(){var e=this;this.columnsRefreshScheduled||(this.columnsRefreshScheduled=!0,this.$nextTick(function(){if(e.columnsRefreshScheduled=!1,e.hotInstance){var t=e.getColumnSettings(),n=e.columnSettings;!n&&!t||!!n&&!!t&&n.length===t.length&&n.every(function(e,n){return e===t[n]})||(e.columnSettings=t||null,e.hotInstance.updateSettings({columns:t||void 0}))}}))}},mounted:function(){this.id||(this.$el.id=this.getGeneratedId()),this.columnSettings=this.getColumnSettings(),this.hotInit()},updated:function(){this.refreshColumns()},beforeUnmount:function(){this.hotInstance&&this.hotInstance.destroy()},version:"19.0.0-rc1"}),R=["id"];k.render=function(e,n,r,o,i,s){return t.openBlock(),t.createElementBlock("div",{id:e.id,style:{height:"100%"}},[t.createCommentVNode(" `hot-column` children render invisible comment anchors in source order.\n Handsontable appends its own DOM to this container without clearing\n pre-existing nodes, so the anchors survive; the parent reads their\n document position to order the columns. "),t.renderSlot(e.$slots,"default")],8,R)},k.__file="src/HotTable.vue";var x=t.defineComponent({name:"HotColumn",props:f("HotColumn"),inject:["columnsCache","refreshColumns"],methods:{createColumnSettings:function(){var e=d(this.$props),t=function(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);e.renderer&&(t.renderer=e.renderer),e.editor&&(t.editor=e.editor),this.columnsCache.set(this,t)}},watch:{$props:{handler:function(){this.createColumnSettings(),this.refreshColumns()},deep:!0}},mounted:function(){this.createColumnSettings(),this.refreshColumns()},unmounted:function(){this.columnsCache.delete(this),this.refreshColumns()},render:function(){return t.createCommentVNode("hot-column")}});x.__file="src/HotColumn.vue",e.HotColumn=x,e.HotTable=k,e.default=k,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
30
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("handsontable/base")):"function"==typeof define&&define.amd?define(["exports","vue","handsontable/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Handsontable=e.Handsontable||{},e.Handsontable.vue={}),e.Vue,e.Handsontable)}(this,function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(n);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}var l=Symbol("unassigned");function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function f(e){var t=o.default.hooks.getRegistered(),n={};for(var r in Object.assign(n,o.default.DefaultSettings),n)n[r]={default:l};for(var i=0;t.length>i;i++)n[t[i]]={default:l};return n.handsontable={default:l},n.settings={default:l},"HotTable"===e&&(n.getValue={default:l},n.id={type:String}),n}function d(e){var t={},n=e.settings;if(n!==l)for(var r in n)h(n,r)&&n[r]!==l&&(t[r]=n[r]);for(var o in e)h(e,o)&&"settings"!==o&&e[o]!==l&&(t[o]=e[o]);return t}function m(e){var t=d(e);return Object.keys(t).filter(function(e){return("function"==typeof t[e]||Array.isArray(t[e]))&&(o.default.hooks.isRegistered(e)||o.default.hooks.isDeprecated(e))})}function p(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function g(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap,r=t.toRaw(e);if(!Array.isArray(r)&&!p(r))return r;if(n.has(r))return n.get(r);if(Array.isArray(r)){var o=[];return n.set(r,o),r.forEach(function(e){o.push(g(e,n))}),o}var i={};return n.set(r,i),Object.keys(r).forEach(function(e){i[e]=g(r[e],n)}),i}function v(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakMap,o=t.toRaw(n);if(e===o)return!0;if(e instanceof RegExp||o instanceof RegExp)return e instanceof RegExp&&o instanceof RegExp&&e.source===o.source&&e.flags===o.flags;if(!(Array.isArray(e)&&Array.isArray(o)||p(e)&&p(o)))return!1;var i=e,s=o,a=r.get(i);if(null!=a&&a.has(s))return!0;a?a.add(s):r.set(i,new WeakSet([s]));var c=Object.keys(i);return c.length===Object.keys(s).length&&c.every(function(e){return h(s,e)&&v(i[e],s[e],r)})}var y=["data","colWidths","rowHeights","minRowHeights","themeName"],b=["sheetsBar"];function I(e,t,n,r){var o=null==r?void 0:r[e];return!!n&&!!o&&!y.includes(e)&&!Object.is(n[e],o.live)&&(j(o.prop,t)||!b.includes(e)&&v(o.copy,t))}function C(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=d(n);Object.keys(e).forEach(function(t){h(i,t)||delete e[t]}),Object.keys(i).forEach(function(n){o.includes(n)||y.includes(n)||(e[n]={prop:t.toRaw(i[n]),copy:b.includes(n)?void 0:g(i[n]),live:r[n]})})}function S(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=d(e),s=e.settings?e.settings:i,a=e.settings?i:null,c=(null==t?void 0:t._initOnlySettings)||[],u={},l=function(e,n){var s=I(e,h(i,e)?i[e]:n,t,r);return s&&!o.includes(e)&&o.push(e),s};for(var f in s)!h(s,f)||void 0===s[f]||c.includes(f)||l(f,s[f])||t&&"data"!==f&&O(f,t[f],s[f],t)||(u[f]=s[f]);for(var p in a)!h(a,p)||"id"===p||"settings"===p||void 0===a[p]||c.includes(p)||l(p,a[p])||t&&"data"!==p&&O(p,t[p],a[p],t)||(u[p]=a[p]);if(n.length>0){var g=m(e);n.forEach(function(e){g.includes(e)||(u[e]=null)})}return u}function O(e,t,n,r){return"sheetsBar"===e?w(t,n,function(e,t,n){return"sheets"===e?j(t,n):function(e,t){return w(e,t,function(e,t,n){return j(t,n)})}(t,n)}):"themeName"===e&&void 0===t?"string"==typeof n&&r.theme===n:function(e,t){var n=new WeakMap,r=0,o=function(e){var t=new WeakSet;return JSON.stringify(e,function(e,o){if("object"===u(o)&&null!==o){if(t.has(o))return;if(t.add(o),"undefined"!=typeof Node&&o instanceof Node){var i=n.get(o);return void 0===i&&n.set(o,i="__hot_node_".concat(r+=1,"__")),i}}return o})};if("function"==typeof e&&"function"==typeof t)return""+e==""+t;if(u(e)!==u(t))return!1;try{return o(e)===o(t)}catch(e){return!1}}(t,n)}function w(e,n,r){var o=t.toRaw(e),i=t.toRaw(n);if(o===i)return!0;if(!_(o)||!_(i))return!1;var s=Object.keys(o),a=Object.keys(i);return s.length===a.length&&s.every(function(e){return h(i,e)&&r(e,o[e],i[e])})}function j(e,n){return t.toRaw(e)===t.toRaw(n)}function _(e){return"[object Object]"===Object.prototype.toString.call(e)}var k=t.defineComponent({name:"HotTable",props:f("HotTable"),provide:function(){return{columnsCache:this.columnsCache,refreshColumns:this.refreshColumns}},watch:{id:{handler:function(e){e||(this.$el.id=this.getGeneratedId())},flush:"post"},$props:{handler:function(e){var n=[],r=S(e,this.hotInstance?this.hotInstance.getSettings():void 0,this.miscCache.hookKeys,this.miscCache.baselines,n);if(this.hotInstance&&void 0!==r){this.miscCache.hookKeys=m(e);var o=void 0!==r.data,i=o?t.toRaw(r.data):void 0,s=o&&i!==this.miscCache.lastData.value;o&&!s&&null===i?delete r.data:r.data&&!s&&(this.hotInstance.isColumnModificationAllowed()||!this.hotInstance.isColumnModificationAllowed()&&this.hotInstance.countSourceCols()===this.miscCache.currentSourceColumns)&&(this.matchHotMappersSize(),delete r.data),o&&(this.miscCache.lastData.value=i),Object.keys(r).length?this.hotInstance.updateSettings(r):this.hotInstance.render(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols(),C(this.miscCache.baselines,e,this.hotInstance.getSettings(),n)}},deep:!0,immediate:!0}},data:function(){return{__hotInstance:null,miscCache:{currentSourceColumns:null,generatedId:"",hookKeys:[],baselines:t.markRaw({}),lastData:t.markRaw({value:void 0})},columnSettings:null,columnsCache:new Map,columnsRefreshScheduled:!1,get hotInstance(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn("The Handsontable instance bound to this component was destroyed and cannot be used properly."),null)},set hotInstance(e){this.__hotInstance=e}}},methods:{getGeneratedId:function(){var e;return this.miscCache.generatedId||(this.miscCache.generatedId=(e=new Uint16Array(3),globalThis.crypto.getRandomValues(e),"hot-".concat(Array.from(e,function(e){return e.toString(16).padStart(4,"0")}).join("")))),this.miscCache.generatedId},hotInit:function(){var e=S(this.$props);e.columns=this.columnSettings?this.columnSettings:e.columns,this.hotInstance=t.markRaw(new o.default.Core(this.$el,e)),C(this.miscCache.baselines,this.$props,this.hotInstance.getSettings()),this.hotInstance.init(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols(),this.miscCache.hookKeys=m(this.$props),this.miscCache.lastData.value=t.toRaw(e.data)},matchHotMappersSize:function(){var e=this;if(this.hotInstance){var t,n=this.hotInstance.getSourceData(),r=[],o=[],i=this.hotInstance.rowIndexMapper.getNumberOfIndexes(),s=this.hotInstance.isColumnModificationAllowed(),a=0;if(n&&n.length!==i&&i>n.length)for(var c=n.length;i>c;c++)r.push(c);if(s)if(a=this.hotInstance.columnIndexMapper.getNumberOfIndexes(),n&&n[0]&&(null===(t=n[0])||void 0===t?void 0:t.length)!==a&&a>n[0].length)for(var u=n[0].length;a>u;u++)o.push(u);this.hotInstance.batch(function(){r.length>0?e.hotInstance.rowIndexMapper.removeIndexes(r):e.hotInstance.rowIndexMapper.insertIndexes(i-1,n.length-i),s&&0!==n.length&&(o.length>0?e.hotInstance.columnIndexMapper.removeIndexes(o):e.hotInstance.columnIndexMapper.insertIndexes(a-1,n[0].length-a))})}},getColumnSettings:function(){var e=Array.from(this.columnsCache.entries()).sort(function(e,t){var n=c(e,1)[0],r=c(t,1),o=n.$el,i=r[0].$el;if(!o||!i)return 0;var s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0}).map(function(e){return c(e,2)[1]});return e.length?e:void 0},refreshColumns:function(){var e=this;this.columnsRefreshScheduled||(this.columnsRefreshScheduled=!0,this.$nextTick(function(){if(e.columnsRefreshScheduled=!1,e.hotInstance){var t=e.getColumnSettings(),n=e.columnSettings;!n&&!t||!!n&&!!t&&n.length===t.length&&n.every(function(e,n){return e===t[n]})||(e.columnSettings=t||null,e.hotInstance.updateSettings({columns:t||void 0}))}}))}},mounted:function(){this.id||(this.$el.id=this.getGeneratedId()),this.columnSettings=this.getColumnSettings(),this.hotInit()},updated:function(){this.refreshColumns()},beforeUnmount:function(){this.hotInstance&&this.hotInstance.destroy()},version:"19.0.0-rc10"}),R=["id"];k.render=function(e,n,r,o,i,s){return t.openBlock(),t.createElementBlock("div",{id:e.id,style:{height:"100%"}},[t.createCommentVNode(" `hot-column` children render invisible comment anchors in source order.\n Handsontable appends its own DOM to this container without clearing\n pre-existing nodes, so the anchors survive; the parent reads their\n document position to order the columns. "),t.renderSlot(e.$slots,"default")],8,R)},k.__file="src/HotTable.vue";var x=t.defineComponent({name:"HotColumn",props:f("HotColumn"),inject:["columnsCache","refreshColumns"],methods:{createColumnSettings:function(){var e=d(this.$props),t=function(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);e.renderer&&(t.renderer=e.renderer),e.editor&&(t.editor=e.editor),this.columnsCache.set(this,t)}},watch:{$props:{handler:function(){this.createColumnSettings(),this.refreshColumns()},deep:!0}},mounted:function(){this.createColumnSettings(),this.refreshColumns()},unmounted:function(){this.columnsCache.delete(this),this.refreshColumns()},render:function(){return t.createCommentVNode("hot-column")}});x.__file="src/HotColumn.vue",e.HotColumn=x,e.HotTable=k,e.default=k,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
31
31
|
//# sourceMappingURL=vue-handsontable.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-handsontable.min.js","sources":["../src/helpers.ts","../src/HotTable.vue","../src/HotTable.vue?vue&type=template&id=54bcc3fa&lang.js","../src/HotColumn.vue"],"sourcesContent":["import { toRaw, PropType } from 'vue';\nimport Handsontable, { OmitHooks, RemoveIndexSignature } from 'handsontable/base';\nimport { HotTableProps, VueProps } from './types';\n\nconst unassignedPropSymbol = Symbol('unassigned');\n\n/**\n * The shape `defineComponent()` reads the prop types from, with one entry per option of `Settings`. `type`\n * exists only for the type checker: the runtime schema built by `propFactory()` carries none, so Vue\n * neither validates nor casts a prop.\n *\n * `RemoveIndexSignature` drops the index signature of `Settings`. Left in, it becomes an index signature of\n * the props, and Vue types every prop as `any` again. The mapping also drops `afterChangesObserved`: the\n * settings types list that hook, but core neither registers nor fires it, so a prop for it could never work.\n * `SettingsProp` is what the `settings` prop takes.\n */\ntype PropSchema<Settings, SettingsProp = Settings> = {\n [P in keyof RemoveIndexSignature<Settings> as P extends 'afterChangesObserved' ? never : P]-?: {\n type: PropType<RemoveIndexSignature<Settings>[P]>,\n default: unknown,\n };\n} & {\n settings: {\n type: PropType<SettingsProp>,\n default: unknown,\n },\n};\n\n/**\n * `HotColumn` takes column settings, not grid settings: its `data` is a property name or a getter, where the\n * grid's `data` is an array of rows. Hooks run from the grid-level settings only, and core reads `getValue`\n * from the table meta only, so neither is a prop of a column. The `settings` prop also takes a grid settings\n * object, as it did when every prop was `any`: such an object has no `data` that would clash.\n */\ntype HotColumnPropSchema = PropSchema<\n Omit<OmitHooks<RemoveIndexSignature<Handsontable.ColumnSettings>>, 'getValue'>,\n Handsontable.ColumnSettings | Handsontable.GridSettings\n>;\n\n/**\n * `HotTable` takes the settings `updateSettings()` takes: a hook prop may be `null`, which removes the\n * callback the earlier props passed for it.\n */\ntype HotTablePropSchema = PropSchema<Handsontable.SettingsUpdate> & {\n id: {\n type: PropType<string>,\n },\n};\n\n/**\n * Message for the warning thrown if the Handsontable instance has been destroyed.\n */\nexport const HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' +\n ' used properly.';\n\n/**\n * Check if at specified `key` there is any value for `object`.\n *\n * @param {object} object Object to search value at specyfic key.\n * @param {string} key String key to check.\n * @returns {boolean}\n */\nexport function hasOwnProperty(object: unknown, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\n/**\n * Generate an object containing all the available Handsontable properties and plugin hooks.\n *\n * @param {string} source Source for the factory (either 'HotTable' or 'HotColumn').\n * @returns {object}\n */\nexport function propFactory(source: 'HotTable'): HotTablePropSchema;\nexport function propFactory(source: 'HotColumn'): HotColumnPropSchema;\n/**\n * Implementation of the overloads above.\n *\n * @param {string} source Source for the factory (either 'HotTable' or 'HotColumn').\n * @returns {object}\n */\nexport function propFactory(source: 'HotTable' | 'HotColumn'): HotTablePropSchema | HotColumnPropSchema {\n const registeredHooks = Handsontable.hooks.getRegistered();\n const propSchema: VueProps<HotTableProps> = {};\n\n Object.assign(propSchema, Handsontable.DefaultSettings);\n\n // eslint-disable-next-line no-restricted-syntax, guard-for-in\n for (const prop in propSchema) {\n propSchema[prop] = {\n default: unassignedPropSymbol\n };\n }\n\n for (let i = 0; i < registeredHooks.length; i++) {\n propSchema[registeredHooks[i]] = {\n default: unassignedPropSymbol\n };\n }\n\n // Documented options that have no entry in `DefaultSettings`, so the loops above never reach them.\n propSchema.handsontable = {\n default: unassignedPropSymbol\n };\n\n propSchema.settings = {\n default: unassignedPropSymbol\n };\n\n if (source === 'HotTable') {\n // Core reads `getValue` from the table meta only, so a column has no use for it.\n propSchema.getValue = {\n default: unassignedPropSymbol\n };\n\n propSchema.id = {\n type: String,\n };\n }\n\n // The schema is filled at runtime from `DefaultSettings`, the registered hooks, and the options named\n // above, which is why it is built loosely and typed here, from `SettingsUpdate` and `ColumnSettings`, for the template type checker.\n return propSchema as unknown as HotTablePropSchema | HotColumnPropSchema;\n}\n\n/**\n * Generate a random id for the `HotTable` container. It has to be created on the client only: an id\n * generated on the server never matches the one the browser generates while hydrating.\n *\n * @returns {string} The container id.\n */\nexport function generateContainerId(): string {\n const buffer = new Uint16Array(3);\n\n globalThis.crypto.getRandomValues(buffer);\n\n return `hot-${Array.from(buffer, value => value.toString(16).padStart(4, '0')).join('')}`;\n}\n\n/**\n * Filter out all of the unassigned props, and return only the one passed to the component.\n *\n * @param {object} props Object containing all the possible props.\n * @returns {object} Object containing only used props.\n */\nexport function filterPassedProps(props) {\n const filteredProps: VueProps<HotTableProps> = {};\n const columnSettingsProp = props.settings;\n\n if (columnSettingsProp !== unassignedPropSymbol) {\n // eslint-disable-next-line no-restricted-syntax\n for (const propName in columnSettingsProp) {\n if (hasOwnProperty(columnSettingsProp, propName) && columnSettingsProp[propName] !== unassignedPropSymbol) {\n filteredProps[propName] = columnSettingsProp[propName];\n }\n }\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const propName in props) {\n if (hasOwnProperty(props, propName) && propName !== 'settings' && props[propName] !== unassignedPropSymbol) {\n filteredProps[propName] = props[propName];\n }\n }\n\n return filteredProps;\n}\n\n/**\n * List the hooks the props pass a callback for, directly or through the `settings` prop. A key counts as\n * a hook by the rule core's `updateSettings()` uses in `core.ts`: a registered or a deprecated hook name.\n * Only a function or an array of them counts as a callback: core ignores any other value, so a hook prop\n * that holds `false` (`:afterChange=\"on && logChange\"`) is treated as removed.\n *\n * @param {HotTableProps} props The props passed to the component.\n * @returns {string[]} The hook names.\n */\nexport function getPassedHookKeys(props: HotTableProps): string[] {\n const passedProps: VueProps<HotTableProps> = filterPassedProps(props);\n\n return Object.keys(passedProps).filter(key => (\n (typeof passedProps[key] === 'function' || Array.isArray(passedProps[key])) &&\n (Handsontable.hooks.isRegistered(key) || Handsontable.hooks.isDeprecated(key))\n ));\n}\n\n/**\n * What the wrapper last knew about a setting: the prop value it synced, a copy of its content, and the value the\n * grid held right after. The copy is needed because core edits an array it was given in place (`alter()` splices\n * `colHeaders`), so the prop itself no longer shows what was synced.\n */\nexport type SettingBaseline = { prop: unknown, copy: unknown, live: unknown };\n\n/**\n * Check if a value is a plain object, one made by an object literal or with no prototype. A class instance is not.\n *\n * @param {unknown} value The value to check.\n * @returns {boolean}\n */\nfunction isLiteralObject(value: unknown): value is Record<string, unknown> {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === Object.prototype || prototype === null;\n}\n\n/**\n * Copy the plain objects and arrays of a settings value, and keep every other value (functions, class instances)\n * by reference. The copy is what the next change is compared with, so a value the app edits in place reads as\n * changed. Reactive proxies are unwrapped, and a value with a cycle is copied with the same cycle.\n *\n * @param {unknown} value The value to copy.\n * @param {WeakMap<object, unknown>} [copies] The copies made so far, by original.\n * @returns {unknown} The copy.\n */\nfunction copySettingsValue(value: unknown, copies: WeakMap<object, unknown> = new WeakMap()): unknown {\n const raw = toRaw(value);\n\n if (!Array.isArray(raw) && !isLiteralObject(raw)) {\n return raw;\n }\n\n if (copies.has(raw)) {\n return copies.get(raw);\n }\n\n if (Array.isArray(raw)) {\n const arrayCopy: unknown[] = [];\n\n copies.set(raw, arrayCopy);\n raw.forEach((item) => {\n arrayCopy.push(copySettingsValue(item, copies));\n });\n\n return arrayCopy;\n }\n\n const objectCopy: Record<string, unknown> = {};\n\n copies.set(raw, objectCopy);\n Object.keys(raw).forEach((key) => {\n objectCopy[key] = copySettingsValue(raw[key], copies);\n });\n\n return objectCopy;\n}\n\n/**\n * Compare a copy made by `copySettingsValue()` with a value: plain objects and arrays by content, a `RegExp` by\n * its source and flags, anything else by reference. A pair already being compared higher up reads as equal,\n * so a value with a cycle ends.\n *\n * @param {unknown} copied The copy.\n * @param {unknown} value The value to compare it with.\n * @param {WeakMap<object, WeakSet<object>>} [visited] The object pairs on the current comparison path.\n * @returns {boolean} `true` if they hold the same content.\n */\nfunction isSameAsCopy(\n copied: unknown,\n value: unknown,\n visited: WeakMap<object, WeakSet<object>> = new WeakMap()\n): boolean {\n const raw = toRaw(value);\n\n if (copied === raw) {\n return true;\n }\n\n if (copied instanceof RegExp || raw instanceof RegExp) {\n return copied instanceof RegExp && raw instanceof RegExp &&\n copied.source === raw.source && copied.flags === raw.flags;\n }\n\n const bothArrays = Array.isArray(copied) && Array.isArray(raw);\n\n if (!bothArrays && !(isLiteralObject(copied) && isLiteralObject(raw))) {\n return false;\n }\n\n const copiedObject = copied as Record<string, unknown>;\n const rawObject = raw as Record<string, unknown>;\n const comparedWith = visited.get(copiedObject);\n\n if (comparedWith?.has(rawObject)) {\n return true;\n }\n\n if (comparedWith) {\n comparedWith.add(rawObject);\n } else {\n visited.set(copiedObject, new WeakSet([rawObject]));\n }\n\n const keys = Object.keys(copiedObject);\n\n return keys.length === Object.keys(rawObject).length &&\n keys.every(key => hasOwnProperty(rawObject, key) && isSameAsCopy(copiedObject[key], rawObject[key], visited));\n}\n\n/**\n * The settings by name, as `SettingBaseline`s. `HotTable` keeps one per instance.\n */\nexport type SettingBaselines = Record<string, SettingBaseline>;\n\n/**\n * Settings the baseline rule leaves alone. The sizes are re-sent whenever they differ from the grid's value,\n * because the user can change them by dragging and the prop re-declares them (the React wrapper does the\n * same). `data` has its own path in `HotTable`, and a baseline would keep the previous array alive.\n */\nconst BASELINE_EXEMPT_KEYS = ['data', 'colWidths', 'rowHeights', 'minRowHeights', 'themeName'];\n\n/**\n * Settings whose baseline holds the reference only, with no copy of the content. `sheetsBar` carries every sheet's\n * `data`, which a copy on each reactive change would walk again (`isEqualSetting()` avoids the same walk).\n */\nconst REFERENCE_ONLY_KEYS = ['sheetsBar'];\n\n/**\n * Check if the app replaced the value of a setting through the instance (`hot.updateSettings()`) since the\n * wrapper last synced the prop, while the prop itself stayed the same. Such a prop is not sent again: it did\n * not change, and sending it would take back what the app set.\n *\n * @param {string} key The setting name.\n * @param {unknown} propValue The value passed through the props.\n * @param {Handsontable.GridSettings} currentSettings The grid's current settings.\n * @param {SettingBaselines} [baselines] What the wrapper last synced.\n * @returns {boolean} `true` if the app overrode the setting.\n */\nfunction isOverriddenByApp(\n key: string,\n propValue: unknown,\n currentSettings?: Handsontable.GridSettings,\n baselines?: SettingBaselines\n): boolean {\n const baseline = baselines?.[key];\n\n // The cheap check goes first: the content compare runs only for a setting the app replaced.\n return !!currentSettings && !!baseline && !BASELINE_EXEMPT_KEYS.includes(key) &&\n !Object.is(currentSettings[key], baseline.live) &&\n (isSameReference(baseline.prop, propValue) ||\n (!REFERENCE_ONLY_KEYS.includes(key) && isSameAsCopy(baseline.copy, propValue)));\n}\n\n/**\n * Record the props the wrapper has just synced with the grid, for the next change to compare with. A setting the\n * app overrode (`overriddenKeys`) keeps its previous baseline, so the override outlives the next changes and\n * is given up only when the prop itself changes.\n *\n * @param {SettingBaselines} baselines What the wrapper last synced. It is updated in place.\n * @param {HotTableProps} props The props passed to the component.\n * @param {Handsontable.GridSettings} currentSettings The grid's current settings.\n * @param {string[]} [overriddenKeys] The settings `prepareSettings()` left out because the app overrode them.\n */\nexport function recordSettingBaselines(\n baselines: SettingBaselines,\n props: HotTableProps,\n currentSettings: Handsontable.GridSettings,\n overriddenKeys: string[] = []\n): void {\n const passedProps: VueProps<HotTableProps> = filterPassedProps(props);\n\n Object.keys(baselines).forEach((key) => {\n if (!hasOwnProperty(passedProps, key)) {\n delete baselines[key];\n }\n });\n\n Object.keys(passedProps).forEach((key) => {\n if (!overriddenKeys.includes(key) && !BASELINE_EXEMPT_KEYS.includes(key)) {\n baselines[key] = {\n prop: toRaw(passedProps[key]),\n copy: REFERENCE_ONLY_KEYS.includes(key) ? undefined : copySettingsValue(passedProps[key]),\n live: currentSettings[key],\n };\n }\n });\n}\n\n/**\n * Prepare the settings object to be used as the settings for Handsontable, based on the props provided to the component.\n *\n * A hook listed in `previousHookKeys` that the props no longer pass a callback for (the prop is removed or\n * `undefined`) is sent as `null`, which removes the callback the props registered.\n *\n * A prop that is the same value the wrapper last synced (`baselines`) is left out when the grid's value for it\n * was replaced since, through `hot.updateSettings()`: the app's value stays until the prop changes.\n *\n * @param {HotTableProps} props The props passed to the component.\n * @param {Handsontable.GridSettings} currentSettings The current Handsontable settings.\n * @param {string[]} previousHookKeys The hooks the previous props passed a callback for.\n * @param {SettingBaselines} [baselines] What the wrapper last synced.\n * @param {string[]} [overriddenKeys] Receives the names of the props left out because the app overrode them.\n * @returns {Handsontable.GridSettings} An object containing the properties, ready to be used within Handsontable.\n */\nexport function prepareSettings(\n props: HotTableProps,\n currentSettings?: Handsontable.GridSettings,\n previousHookKeys: string[] = [],\n baselines?: SettingBaselines,\n overriddenKeys: string[] = []\n): HotTableProps {\n const assignedProps: VueProps<HotTableProps> = filterPassedProps(props);\n const hotSettingsInProps: Handsontable.GridSettings = props.settings ? props.settings : assignedProps;\n const additionalHotSettingsInProps: Handsontable.GridSettings | null = props.settings ? assignedProps : null;\n const initOnlySettingKeys: string[] =\n (currentSettings as any)?._initOnlySettings || [];\n const newSettings: Handsontable.GridSettings = {};\n const isOverridden = (key: string, value: unknown): boolean => {\n // A direct prop wins over the same key in the `settings` prop, and the baseline holds the winner.\n const effectiveValue = hasOwnProperty(assignedProps, key) ? assignedProps[key] : value;\n const overridden = isOverriddenByApp(key, effectiveValue, currentSettings, baselines);\n\n if (overridden && !overriddenKeys.includes(key)) {\n overriddenKeys.push(key);\n }\n\n return overridden;\n };\n\n // eslint-disable-next-line no-restricted-syntax\n for (const key in hotSettingsInProps) {\n if (\n hasOwnProperty(hotSettingsInProps, key) &&\n hotSettingsInProps[key] !== undefined &&\n !initOnlySettingKeys.includes(key) &&\n !isOverridden(key, hotSettingsInProps[key]) &&\n ((currentSettings && key !== 'data')\n ? !isEqualSetting(key, currentSettings[key], hotSettingsInProps[key], currentSettings) : true)\n ) {\n newSettings[key] = hotSettingsInProps[key];\n }\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const key in additionalHotSettingsInProps) {\n if (\n hasOwnProperty(additionalHotSettingsInProps, key) &&\n key !== 'id' &&\n key !== 'settings' &&\n additionalHotSettingsInProps[key] !== undefined &&\n !initOnlySettingKeys.includes(key) &&\n !isOverridden(key, additionalHotSettingsInProps[key]) &&\n ((currentSettings && key !== 'data')\n ? !isEqualSetting(key, currentSettings[key], additionalHotSettingsInProps[key], currentSettings) : true)\n ) {\n newSettings[key] = additionalHotSettingsInProps[key];\n }\n }\n\n if (previousHookKeys.length > 0) {\n const passedHookKeys = getPassedHookKeys(props);\n\n previousHookKeys.forEach((key) => {\n if (!passedHookKeys.includes(key)) {\n newSettings[key] = null;\n }\n });\n }\n\n return newSettings;\n}\n\n/**\n * Compare the grid's current value of a setting with the value passed through the props.\n *\n * `sheetsBar` is compared key by key: a template writes it as an object literal\n * (`:sheetsBar=\"{ sheets }\"`), which is a new object on every render, while the sheets it holds keep\n * every sheet's data, which must not be serialized on each change. The `sheets` array is compared by\n * reference, and an option given as an object literal (`animation: { switch: false }`) by the\n * references of its own keys. A new `sheets` array or a changed option in a new `sheetsBar` object is\n * therefore sent, even when it differs only by a function. A change made inside the same `sheetsBar`\n * object or the same `sheets` array is not sent, and neither are the plugin's own writes into that\n * array. `themeName` is compared with the grid's `theme`, because core moves the name there and\n * `getSettings().themeName` stays `undefined`. Every other setting is compared with `simpleEqual()`.\n *\n * @param {string} key The setting name.\n * @param {unknown} currentValue The grid's current value.\n * @param {unknown} newValue The value passed through the props.\n * @param {Handsontable.GridSettings} currentSettings The grid's current settings.\n * @returns {boolean} `true` if the value does not need to be sent.\n */\nfunction isEqualSetting(\n key: string,\n currentValue: unknown,\n newValue: unknown,\n currentSettings: Handsontable.GridSettings\n): boolean {\n if (key === 'sheetsBar') {\n return haveEqualOwnKeys(currentValue, newValue, (propName, valueA, valueB) => (\n propName === 'sheets' ? isSameReference(valueA, valueB) : isShallowEqualByReference(valueA, valueB)\n ));\n }\n\n if (key === 'themeName' && currentValue === undefined) {\n return typeof newValue === 'string' && currentSettings.theme === newValue;\n }\n\n return simpleEqual(currentValue, newValue);\n}\n\n/**\n * Compare two values by reference, and two plain objects by the references of their own keys.\n *\n * @param {unknown} valueA First value to compare.\n * @param {unknown} valueB Second value to compare.\n * @returns {boolean} `true` if they're the same, `false` otherwise.\n */\nfunction isShallowEqualByReference(valueA: unknown, valueB: unknown): boolean {\n return haveEqualOwnKeys(valueA, valueB, (propName, keyValueA, keyValueB) => isSameReference(keyValueA, keyValueB));\n}\n\n/**\n * Compare two values by reference, or, when both are plain objects, compare their own keys with the\n * given function. Reactive proxies are compared by their raw objects.\n *\n * @param {unknown} valueA First value to compare.\n * @param {unknown} valueB Second value to compare.\n * @param {Function} isEqualValue Compares the values both objects hold under one key.\n * @returns {boolean} `true` if they're the same, `false` otherwise.\n */\nfunction haveEqualOwnKeys(\n valueA: unknown,\n valueB: unknown,\n isEqualValue: (propName: string, keyValueA: unknown, keyValueB: unknown) => boolean,\n): boolean {\n const rawA = toRaw(valueA);\n const rawB = toRaw(valueB);\n\n if (rawA === rawB) {\n return true;\n }\n\n if (!isPlainObject(rawA) || !isPlainObject(rawB)) {\n return false;\n }\n\n const keysA = Object.keys(rawA);\n const keysB = Object.keys(rawB);\n\n return keysA.length === keysB.length &&\n keysA.every(propName => hasOwnProperty(rawB, propName) && isEqualValue(propName, rawA[propName], rawB[propName]));\n}\n\n/**\n * Compare two values by reference, with reactive proxies compared by their raw objects.\n *\n * @param {unknown} valueA First value to compare.\n * @param {unknown} valueB Second value to compare.\n * @returns {boolean} `true` if they're the same, `false` otherwise.\n */\nfunction isSameReference(valueA: unknown, valueB: unknown): boolean {\n return toRaw(valueA) === toRaw(valueB);\n}\n\n/**\n * Check if a value is a plain object.\n *\n * @param {unknown} value The value to check.\n * @returns {boolean}\n */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Compare two objects using `JSON.stringify`.\n * *Note: * As it's using the stringify function to compare objects, the property order in both objects is\n * important. It will return `false` for the same objects, if they're defined in a different order.\n *\n * @param {object} objectA First object to compare.\n * @param {object} objectB Second object to compare.\n * @returns {boolean} `true` if they're the same, `false` otherwise.\n */\nfunction simpleEqual(objectA, objectB) {\n // Shared across both stringify calls so the same Node/function instance maps\n // to the same identity token in objectA's string and objectB's string.\n const identityMap = new WeakMap<object, string>();\n let nextIdentityId = 0;\n\n const stringifyToJSON = (val) => {\n const seen = new WeakSet();\n\n return JSON.stringify(val, (key, value) => {\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return undefined;\n }\n\n seen.add(value);\n\n // DOM nodes carry framework metadata as enumerable own properties\n // (e.g., Vue 3 attaches `_vnode` to the mount root). Recursing into them\n // can reach getters that throw - see GH #11220 - and produces noise that\n // is irrelevant to settings equality. Replace each Node with an identity\n // token so reference equality is still detected.\n if (typeof Node !== 'undefined' && value instanceof Node) {\n let id = identityMap.get(value);\n\n if (id === undefined) {\n nextIdentityId += 1;\n id = `__hot_node_${nextIdentityId}__`;\n identityMap.set(value, id);\n }\n\n return id;\n }\n }\n\n return value;\n });\n };\n\n if (typeof objectA === 'function' && typeof objectB === 'function') {\n return objectA.toString() === objectB.toString();\n\n } else if (typeof objectA !== typeof objectB) {\n return false;\n\n } else {\n try {\n return stringifyToJSON(objectA) === stringifyToJSON(objectB);\n } catch (e) {\n // If either side cannot be serialized (e.g., contains a throwing getter),\n // assume the values are not equal so the wrapper still updates settings.\n return false;\n }\n }\n}\n","<template>\n <div :id=\"id\" style=\"height: 100%\">\n <!-- `hot-column` children render invisible comment anchors in source order.\n Handsontable appends its own DOM to this container without clearing\n pre-existing nodes, so the anchors survive; the parent reads their\n document position to order the columns. -->\n <slot></slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { defineComponent, VNode, markRaw, toRaw } from 'vue';\n// TODO: The line above is ts-ignored because rollup-plugin-typescript2 throws an error otherwise.\n// It's most probably caused by outdated rollup-plugin-vue which is no longer maintained.\n\nimport Handsontable from 'handsontable/base';\nimport {\n HOT_DESTROYED_WARNING,\n generateContainerId,\n getPassedHookKeys,\n prepareSettings,\n propFactory,\n recordSettingBaselines,\n SettingBaselines,\n} from './helpers';\nimport {\n HotTableProps,\n} from './types';\nimport * as packageJson from '../package.json';\n\nconst HotTable = defineComponent({\n name: 'HotTable',\n props: propFactory('HotTable'),\n provide() {\n return {\n columnsCache: this.columnsCache,\n refreshColumns: this.refreshColumns,\n };\n },\n watch: {\n // Vue removes the attribute when `id` is cleared, so put the generated one back after the patch.\n id: {\n handler(id) {\n if (!id) {\n this.$el.id = this.getGeneratedId();\n }\n },\n flush: 'post',\n },\n $props: {\n handler(props) {\n const overriddenKeys: string[] = [];\n const settings = prepareSettings(\n props,\n this.hotInstance ? this.hotInstance.getSettings() : undefined,\n this.miscCache.hookKeys,\n this.miscCache.baselines,\n overriddenKeys\n );\n\n if (!this.hotInstance || settings === undefined) {\n return;\n }\n\n this.miscCache.hookKeys = getPassedHookKeys(props);\n\n const hasData = settings.data !== undefined;\n const incomingData = hasData ? toRaw(settings.data) : undefined;\n const isNewData = hasData && incomingData !== this.miscCache.lastData.value;\n\n // A new array replaces the grid's data: `updateSettings()` runs core's `updateData()`, which fits the\n // index mappers to the new length and keeps their state, unless the same payload changes the column layout.\n if (hasData && !isNewData && incomingData === null) {\n // The prop was already cleared: sending `null` again would reset the grid on every later change.\n delete settings.data;\n\n } else if (settings.data && !isNewData) {\n if (\n this.hotInstance.isColumnModificationAllowed() ||\n (\n !this.hotInstance.isColumnModificationAllowed() &&\n this.hotInstance.countSourceCols() === this.miscCache.currentSourceColumns\n )\n ) {\n // If the dataset dimensions change, update the index mappers.\n this.matchHotMappersSize();\n\n // Data is automatically synchronized by reference.\n delete settings.data;\n }\n }\n\n // Recorded before the update: core holds the array as soon as `updateSettings()` starts, so a hook that\n // throws must not leave the old one here, or every later in-place edit would reload the data.\n if (hasData) {\n this.miscCache.lastData.value = incomingData;\n }\n\n // If there are another options changed, update the HOT settings, render the table otherwise.\n if (Object.keys(settings).length) {\n this.hotInstance.updateSettings(settings);\n\n } else {\n this.hotInstance.render();\n }\n\n this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();\n\n recordSettingBaselines(this.miscCache.baselines, props, this.hotInstance.getSettings(), overriddenKeys);\n },\n deep: true,\n immediate: true,\n },\n },\n data() {\n return {\n /* eslint-disable vue/no-reserved-keys */\n __hotInstance: null as Handsontable | null,\n /* eslint-enable vue/no-reserved-keys */\n miscCache: {\n currentSourceColumns: null,\n generatedId: '',\n hookKeys: [] as string[],\n // Holds the grid's own values, so it must not be wrapped in a proxy: the compare is by identity.\n baselines: markRaw({}) as SettingBaselines,\n // The `data` array the grid was last given by the props, compared by identity to tell a new array\n // from an in-place edit. Wrapped in a raw holder so Vue does not proxy the app's array.\n lastData: markRaw({ value: undefined as unknown }),\n },\n columnSettings: null as HotTableProps[] | null,\n columnsCache: new Map<VNode, HotTableProps>(),\n columnsRefreshScheduled: false,\n get hotInstance(): Handsontable | null {\n if (!this.__hotInstance || (this.__hotInstance && !this.__hotInstance.isDestroyed)) {\n\n // Will return the Handsontable instance or `null` if it's not yet been created.\n return this.__hotInstance;\n\n } else {\n /* eslint-disable-next-line no-console */\n console.warn(HOT_DESTROYED_WARNING);\n\n return null;\n }\n },\n set hotInstance(hotInstance: Handsontable | null) {\n this.__hotInstance = hotInstance;\n },\n };\n },\n methods: {\n /**\n * Get the id used when the `id` prop is not passed. It is created once per instance.\n *\n * @returns {string} The generated container id.\n */\n getGeneratedId(): string {\n if (!this.miscCache.generatedId) {\n this.miscCache.generatedId = generateContainerId();\n }\n\n return this.miscCache.generatedId;\n },\n\n /**\n * Initialize Handsontable.\n */\n hotInit() {\n const newSettings = prepareSettings(this.$props);\n\n newSettings.columns = this.columnSettings ? this.columnSettings : newSettings.columns;\n\n this.hotInstance = markRaw<Handsontable>(new Handsontable.Core(this.$el, newSettings));\n\n // Recorded before `init()`, so a value the app sets in `afterInit` counts as an override of the prop.\n recordSettingBaselines(this.miscCache.baselines, this.$props, this.hotInstance.getSettings());\n\n this.hotInstance.init();\n\n this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();\n this.miscCache.hookKeys = getPassedHookKeys(this.$props);\n this.miscCache.lastData.value = toRaw(newSettings.data);\n },\n\n matchHotMappersSize(): void {\n if (!this.hotInstance) {\n return;\n }\n\n const data: Handsontable.CellValue[][] = this.hotInstance.getSourceData();\n const rowsToRemove: number[] = [];\n const columnsToRemove: number[] = [];\n const indexMapperRowCount = this.hotInstance.rowIndexMapper.getNumberOfIndexes();\n const isColumnModificationAllowed = this.hotInstance.isColumnModificationAllowed();\n let indexMapperColumnCount = 0;\n\n if (data && data.length !== indexMapperRowCount) {\n if (data.length < indexMapperRowCount) {\n for (let r = data.length; r < indexMapperRowCount; r++) {\n rowsToRemove.push(r);\n }\n }\n }\n\n if (isColumnModificationAllowed) {\n indexMapperColumnCount = this.hotInstance.columnIndexMapper.getNumberOfIndexes();\n\n if (data && data[0] && data[0]?.length !== indexMapperColumnCount) {\n if (data[0].length < indexMapperColumnCount) {\n for (let c = data[0].length; c < indexMapperColumnCount; c++) {\n columnsToRemove.push(c);\n }\n }\n }\n }\n\n this.hotInstance.batch(() => {\n if (rowsToRemove.length > 0) {\n this.hotInstance.rowIndexMapper.removeIndexes(rowsToRemove);\n\n } else {\n this.hotInstance.rowIndexMapper\n .insertIndexes(indexMapperRowCount - 1, data.length - indexMapperRowCount);\n }\n\n if (isColumnModificationAllowed && data.length !== 0) {\n if (columnsToRemove.length > 0) {\n this.hotInstance.columnIndexMapper.removeIndexes(columnsToRemove);\n\n } else {\n this.hotInstance.columnIndexMapper\n .insertIndexes(indexMapperColumnCount - 1, data[0].length - indexMapperColumnCount);\n }\n }\n });\n },\n\n /**\n * Get settings for the columns provided in the `hot-column` components.\n *\n * The columns are ordered by the document position of each `hot-column`'s\n * anchor node, not by the `columnsCache` insertion order. This keeps the\n * order correct when columns are inserted in the middle, removed, or\n * reordered, and when a `hot-column` is nested inside a wrapper component.\n *\n * @returns {HotTableProps[] | undefined}\n */\n getColumnSettings(): HotTableProps[] | void {\n const orderedColumns = Array.from(this.columnsCache.entries())\n .sort(([columnA], [columnB]) => {\n const anchorA = (columnA as { $el?: Node }).$el;\n const anchorB = (columnB as { $el?: Node }).$el;\n\n if (!anchorA || !anchorB) {\n return 0;\n }\n\n const position = anchorA.compareDocumentPosition(anchorB);\n\n // eslint-disable-next-line no-bitwise\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n\n // eslint-disable-next-line no-bitwise\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n\n return 0;\n })\n .map(([, columnSettings]) => columnSettings);\n\n return orderedColumns.length ? orderedColumns : undefined;\n },\n\n /**\n * Re-read the column settings declared by `hot-column` children and push them\n * to the Handsontable instance. Called by children on mount, prop change, and\n * unmount, and by the parent on reorder. Multiple notifications in the same\n * tick are coalesced into a single `updateSettings` call.\n */\n refreshColumns(): void {\n if (this.columnsRefreshScheduled) {\n return;\n }\n\n this.columnsRefreshScheduled = true;\n\n this.$nextTick(() => {\n this.columnsRefreshScheduled = false;\n\n if (!this.hotInstance) {\n return;\n }\n\n const newColumnSettings = this.getColumnSettings();\n const previousColumnSettings = this.columnSettings;\n\n // Each `hot-column` rebuilds its settings object whenever its props change,\n // so an unchanged column keeps the same object reference. Comparing the\n // arrays by reference and order is cheaper than a deep compare and avoids\n // an `updateSettings` call on unrelated re-renders (e.g. data-only updates).\n const isUnchanged =\n (!previousColumnSettings && !newColumnSettings) ||\n (!!previousColumnSettings && !!newColumnSettings &&\n previousColumnSettings.length === newColumnSettings.length &&\n previousColumnSettings.every((settings, index) => settings === newColumnSettings[index]));\n\n if (isUnchanged) {\n return;\n }\n\n this.columnSettings = newColumnSettings || null;\n this.hotInstance.updateSettings({ columns: newColumnSettings || undefined });\n });\n },\n },\n mounted() {\n // The auto-generated id is set here, on the client only, and not through a prop default or reactive\n // data: an id created on the server never matches the browser's, which breaks hydration, and a\n // reactive id would re-render every `HotTable` right after mounting.\n if (!this.id) {\n this.$el.id = this.getGeneratedId();\n }\n\n this.columnSettings = this.getColumnSettings();\n this.hotInit();\n },\n updated() {\n // Reordering keyed `hot-column` children reuses their instances and fires no\n // child lifecycle hook, so the children cannot notify on their own. The slot\n // vnodes do change, which re-renders `HotTable` - refresh from here to cover\n // reorders (coalesced with any child-triggered refresh).\n this.refreshColumns();\n },\n beforeUnmount() {\n if (this.hotInstance) {\n this.hotInstance.destroy();\n }\n },\n version: (packageJson as unknown as { version: string }).version,\n});\n\nexport default HotTable;\nexport { HotTable };\n</script>\n","<template>\n <div :id=\"id\" style=\"height: 100%\">\n <!-- `hot-column` children render invisible comment anchors in source order.\n Handsontable appends its own DOM to this container without clearing\n pre-existing nodes, so the anchors survive; the parent reads their\n document position to order the columns. -->\n <slot></slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { defineComponent, VNode, markRaw, toRaw } from 'vue';\n// TODO: The line above is ts-ignored because rollup-plugin-typescript2 throws an error otherwise.\n// It's most probably caused by outdated rollup-plugin-vue which is no longer maintained.\n\nimport Handsontable from 'handsontable/base';\nimport {\n HOT_DESTROYED_WARNING,\n generateContainerId,\n getPassedHookKeys,\n prepareSettings,\n propFactory,\n recordSettingBaselines,\n SettingBaselines,\n} from './helpers';\nimport {\n HotTableProps,\n} from './types';\nimport * as packageJson from '../package.json';\n\nconst HotTable = defineComponent({\n name: 'HotTable',\n props: propFactory('HotTable'),\n provide() {\n return {\n columnsCache: this.columnsCache,\n refreshColumns: this.refreshColumns,\n };\n },\n watch: {\n // Vue removes the attribute when `id` is cleared, so put the generated one back after the patch.\n id: {\n handler(id) {\n if (!id) {\n this.$el.id = this.getGeneratedId();\n }\n },\n flush: 'post',\n },\n $props: {\n handler(props) {\n const overriddenKeys: string[] = [];\n const settings = prepareSettings(\n props,\n this.hotInstance ? this.hotInstance.getSettings() : undefined,\n this.miscCache.hookKeys,\n this.miscCache.baselines,\n overriddenKeys\n );\n\n if (!this.hotInstance || settings === undefined) {\n return;\n }\n\n this.miscCache.hookKeys = getPassedHookKeys(props);\n\n const hasData = settings.data !== undefined;\n const incomingData = hasData ? toRaw(settings.data) : undefined;\n const isNewData = hasData && incomingData !== this.miscCache.lastData.value;\n\n // A new array replaces the grid's data: `updateSettings()` runs core's `updateData()`, which fits the\n // index mappers to the new length and keeps their state, unless the same payload changes the column layout.\n if (hasData && !isNewData && incomingData === null) {\n // The prop was already cleared: sending `null` again would reset the grid on every later change.\n delete settings.data;\n\n } else if (settings.data && !isNewData) {\n if (\n this.hotInstance.isColumnModificationAllowed() ||\n (\n !this.hotInstance.isColumnModificationAllowed() &&\n this.hotInstance.countSourceCols() === this.miscCache.currentSourceColumns\n )\n ) {\n // If the dataset dimensions change, update the index mappers.\n this.matchHotMappersSize();\n\n // Data is automatically synchronized by reference.\n delete settings.data;\n }\n }\n\n // Recorded before the update: core holds the array as soon as `updateSettings()` starts, so a hook that\n // throws must not leave the old one here, or every later in-place edit would reload the data.\n if (hasData) {\n this.miscCache.lastData.value = incomingData;\n }\n\n // If there are another options changed, update the HOT settings, render the table otherwise.\n if (Object.keys(settings).length) {\n this.hotInstance.updateSettings(settings);\n\n } else {\n this.hotInstance.render();\n }\n\n this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();\n\n recordSettingBaselines(this.miscCache.baselines, props, this.hotInstance.getSettings(), overriddenKeys);\n },\n deep: true,\n immediate: true,\n },\n },\n data() {\n return {\n /* eslint-disable vue/no-reserved-keys */\n __hotInstance: null as Handsontable | null,\n /* eslint-enable vue/no-reserved-keys */\n miscCache: {\n currentSourceColumns: null,\n generatedId: '',\n hookKeys: [] as string[],\n // Holds the grid's own values, so it must not be wrapped in a proxy: the compare is by identity.\n baselines: markRaw({}) as SettingBaselines,\n // The `data` array the grid was last given by the props, compared by identity to tell a new array\n // from an in-place edit. Wrapped in a raw holder so Vue does not proxy the app's array.\n lastData: markRaw({ value: undefined as unknown }),\n },\n columnSettings: null as HotTableProps[] | null,\n columnsCache: new Map<VNode, HotTableProps>(),\n columnsRefreshScheduled: false,\n get hotInstance(): Handsontable | null {\n if (!this.__hotInstance || (this.__hotInstance && !this.__hotInstance.isDestroyed)) {\n\n // Will return the Handsontable instance or `null` if it's not yet been created.\n return this.__hotInstance;\n\n } else {\n /* eslint-disable-next-line no-console */\n console.warn(HOT_DESTROYED_WARNING);\n\n return null;\n }\n },\n set hotInstance(hotInstance: Handsontable | null) {\n this.__hotInstance = hotInstance;\n },\n };\n },\n methods: {\n /**\n * Get the id used when the `id` prop is not passed. It is created once per instance.\n *\n * @returns {string} The generated container id.\n */\n getGeneratedId(): string {\n if (!this.miscCache.generatedId) {\n this.miscCache.generatedId = generateContainerId();\n }\n\n return this.miscCache.generatedId;\n },\n\n /**\n * Initialize Handsontable.\n */\n hotInit() {\n const newSettings = prepareSettings(this.$props);\n\n newSettings.columns = this.columnSettings ? this.columnSettings : newSettings.columns;\n\n this.hotInstance = markRaw<Handsontable>(new Handsontable.Core(this.$el, newSettings));\n\n // Recorded before `init()`, so a value the app sets in `afterInit` counts as an override of the prop.\n recordSettingBaselines(this.miscCache.baselines, this.$props, this.hotInstance.getSettings());\n\n this.hotInstance.init();\n\n this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();\n this.miscCache.hookKeys = getPassedHookKeys(this.$props);\n this.miscCache.lastData.value = toRaw(newSettings.data);\n },\n\n matchHotMappersSize(): void {\n if (!this.hotInstance) {\n return;\n }\n\n const data: Handsontable.CellValue[][] = this.hotInstance.getSourceData();\n const rowsToRemove: number[] = [];\n const columnsToRemove: number[] = [];\n const indexMapperRowCount = this.hotInstance.rowIndexMapper.getNumberOfIndexes();\n const isColumnModificationAllowed = this.hotInstance.isColumnModificationAllowed();\n let indexMapperColumnCount = 0;\n\n if (data && data.length !== indexMapperRowCount) {\n if (data.length < indexMapperRowCount) {\n for (let r = data.length; r < indexMapperRowCount; r++) {\n rowsToRemove.push(r);\n }\n }\n }\n\n if (isColumnModificationAllowed) {\n indexMapperColumnCount = this.hotInstance.columnIndexMapper.getNumberOfIndexes();\n\n if (data && data[0] && data[0]?.length !== indexMapperColumnCount) {\n if (data[0].length < indexMapperColumnCount) {\n for (let c = data[0].length; c < indexMapperColumnCount; c++) {\n columnsToRemove.push(c);\n }\n }\n }\n }\n\n this.hotInstance.batch(() => {\n if (rowsToRemove.length > 0) {\n this.hotInstance.rowIndexMapper.removeIndexes(rowsToRemove);\n\n } else {\n this.hotInstance.rowIndexMapper\n .insertIndexes(indexMapperRowCount - 1, data.length - indexMapperRowCount);\n }\n\n if (isColumnModificationAllowed && data.length !== 0) {\n if (columnsToRemove.length > 0) {\n this.hotInstance.columnIndexMapper.removeIndexes(columnsToRemove);\n\n } else {\n this.hotInstance.columnIndexMapper\n .insertIndexes(indexMapperColumnCount - 1, data[0].length - indexMapperColumnCount);\n }\n }\n });\n },\n\n /**\n * Get settings for the columns provided in the `hot-column` components.\n *\n * The columns are ordered by the document position of each `hot-column`'s\n * anchor node, not by the `columnsCache` insertion order. This keeps the\n * order correct when columns are inserted in the middle, removed, or\n * reordered, and when a `hot-column` is nested inside a wrapper component.\n *\n * @returns {HotTableProps[] | undefined}\n */\n getColumnSettings(): HotTableProps[] | void {\n const orderedColumns = Array.from(this.columnsCache.entries())\n .sort(([columnA], [columnB]) => {\n const anchorA = (columnA as { $el?: Node }).$el;\n const anchorB = (columnB as { $el?: Node }).$el;\n\n if (!anchorA || !anchorB) {\n return 0;\n }\n\n const position = anchorA.compareDocumentPosition(anchorB);\n\n // eslint-disable-next-line no-bitwise\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n\n // eslint-disable-next-line no-bitwise\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n\n return 0;\n })\n .map(([, columnSettings]) => columnSettings);\n\n return orderedColumns.length ? orderedColumns : undefined;\n },\n\n /**\n * Re-read the column settings declared by `hot-column` children and push them\n * to the Handsontable instance. Called by children on mount, prop change, and\n * unmount, and by the parent on reorder. Multiple notifications in the same\n * tick are coalesced into a single `updateSettings` call.\n */\n refreshColumns(): void {\n if (this.columnsRefreshScheduled) {\n return;\n }\n\n this.columnsRefreshScheduled = true;\n\n this.$nextTick(() => {\n this.columnsRefreshScheduled = false;\n\n if (!this.hotInstance) {\n return;\n }\n\n const newColumnSettings = this.getColumnSettings();\n const previousColumnSettings = this.columnSettings;\n\n // Each `hot-column` rebuilds its settings object whenever its props change,\n // so an unchanged column keeps the same object reference. Comparing the\n // arrays by reference and order is cheaper than a deep compare and avoids\n // an `updateSettings` call on unrelated re-renders (e.g. data-only updates).\n const isUnchanged =\n (!previousColumnSettings && !newColumnSettings) ||\n (!!previousColumnSettings && !!newColumnSettings &&\n previousColumnSettings.length === newColumnSettings.length &&\n previousColumnSettings.every((settings, index) => settings === newColumnSettings[index]));\n\n if (isUnchanged) {\n return;\n }\n\n this.columnSettings = newColumnSettings || null;\n this.hotInstance.updateSettings({ columns: newColumnSettings || undefined });\n });\n },\n },\n mounted() {\n // The auto-generated id is set here, on the client only, and not through a prop default or reactive\n // data: an id created on the server never matches the browser's, which breaks hydration, and a\n // reactive id would re-render every `HotTable` right after mounting.\n if (!this.id) {\n this.$el.id = this.getGeneratedId();\n }\n\n this.columnSettings = this.getColumnSettings();\n this.hotInit();\n },\n updated() {\n // Reordering keyed `hot-column` children reuses their instances and fires no\n // child lifecycle hook, so the children cannot notify on their own. The slot\n // vnodes do change, which re-renders `HotTable` - refresh from here to cover\n // reorders (coalesced with any child-triggered refresh).\n this.refreshColumns();\n },\n beforeUnmount() {\n if (this.hotInstance) {\n this.hotInstance.destroy();\n }\n },\n version: (packageJson as unknown as { version: string }).version,\n});\n\nexport default HotTable;\nexport { HotTable };\n</script>\n","<script lang=\"ts\">\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { defineComponent, createCommentVNode } from 'vue';\n// TODO: The line above is ts-ignored because rollup-plugin-typescript2 throws an error otherwise.\n// It's most probably caused by outdated rollup-plugin-vue which is no longer maintained.\n\nimport {\n propFactory,\n filterPassedProps\n} from './helpers';\n\nconst HotColumn = defineComponent({\n name: 'HotColumn',\n props: propFactory('HotColumn'),\n inject: ['columnsCache', 'refreshColumns'],\n methods: {\n /**\n * Create the column settings based on the data provided to the `hot-column`\n * component and it's child components.\n */\n createColumnSettings(): void {\n const assignedProps = filterPassedProps(this.$props);\n const columnSettings = { ...assignedProps };\n\n if (assignedProps.renderer) {\n columnSettings.renderer = assignedProps.renderer;\n }\n\n if (assignedProps.editor) {\n columnSettings.editor = assignedProps.editor;\n }\n\n this.columnsCache.set(this, columnSettings);\n }\n },\n watch: {\n $props: {\n handler() {\n this.createColumnSettings();\n this.refreshColumns();\n },\n deep: true,\n },\n },\n mounted() {\n this.createColumnSettings();\n this.refreshColumns();\n },\n unmounted() {\n this.columnsCache.delete(this);\n this.refreshColumns();\n },\n render() {\n // Render an (invisible) comment anchor instead of nothing, so the parent\n // `HotTable` can order columns by the anchors' document position. This keeps\n // ordering correct for dynamic inserts, removals, and reorders - and works\n // regardless of how deeply the `hot-column` is nested inside wrapper\n // components - because `provide`/`inject` and the anchor both cross nesting.\n return createCommentVNode('hot-column');\n }\n});\n\nexport default HotColumn;\nexport { HotColumn };\n</script>\n"],"names":["unassignedPropSymbol","Symbol","hasOwnProperty","object","key","Object","prototype","call","propFactory","source","registeredHooks","Handsontable","hooks","getRegistered","propSchema","prop","assign","DefaultSettings","default","i","length","handsontable","settings","getValue","id","type","String","filterPassedProps","props","filteredProps","columnSettingsProp","propName","getPassedHookKeys","passedProps","keys","filter","Array","isArray","isRegistered","isDeprecated","isLiteralObject","value","toString","getPrototypeOf","copySettingsValue","copies","arguments","undefined","WeakMap","raw","toRaw","has","get","arrayCopy","set","forEach","item","push","objectCopy","isSameAsCopy","copied","visited","RegExp","flags","copiedObject","rawObject","comparedWith","add","WeakSet","every","BASELINE_EXEMPT_KEYS","REFERENCE_ONLY_KEYS","isOverriddenByApp","propValue","currentSettings","baselines","baseline","includes","is","live","isSameReference","copy","recordSettingBaselines","overriddenKeys","prepareSettings","previousHookKeys","assignedProps","hotSettingsInProps","additionalHotSettingsInProps","initOnlySettingKeys","_initOnlySettings","newSettings","isOverridden","overridden","isEqualSetting","passedHookKeys","currentValue","newValue","haveEqualOwnKeys","valueA","valueB","keyValueA","keyValueB","isShallowEqualByReference","theme","objectA","objectB","identityMap","nextIdentityId","stringifyToJSON","val","seen","JSON","stringify","_typeof","Node","concat","e","simpleEqual","isEqualValue","rawA","rawB","isPlainObject","keysA","keysB","HotTable","defineComponent","name","provide","columnsCache","this","refreshColumns","watch","handler","$el","getGeneratedId","flush","$props","hotInstance","getSettings","miscCache","hookKeys","hasData","data","incomingData","isNewData","lastData","isColumnModificationAllowed","countSourceCols","currentSourceColumns","matchHotMappersSize","updateSettings","render","deep","immediate","__hotInstance","generatedId","markRaw","columnSettings","Map","columnsRefreshScheduled","isDestroyed","console","warn","methods","buffer","Uint16Array","globalThis","crypto","getRandomValues","from","padStart","join","hotInit","columns","Core","init","_this","_data$","getSourceData","rowsToRemove","columnsToRemove","indexMapperRowCount","rowIndexMapper","getNumberOfIndexes","indexMapperColumnCount","r","columnIndexMapper","c","batch","removeIndexes","insertIndexes","getColumnSettings","orderedColumns","entries","sort","_ref","_ref2","columnA","_slicedToArray","_ref4","anchorA","anchorB","position","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_PRECEDING","map","_ref5","_this2","$nextTick","newColumnSettings","previousColumnSettings","index","mounted","updated","beforeUnmount","destroy","version","_createElementBlock","_ctx","style","height","_createCommentVNode","_renderSlot","$slots","HotColumn","inject","createColumnSettings","_objectSpread","renderer","editor","unmounted","createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;i0EAIA,IAAMA,EAAuBC,OAAO,cA0D7B,SAASC,EAAeC,EAAiBC,GAC9C,OAAOC,OAAOC,UAAUJ,eAAeK,KAAKJ,EAAQC,EACtD,CAgBO,SAASI,EAAYC,GAC1B,IAAMC,EAAkBC,EAAAA,QAAaC,MAAMC,gBACrCC,EAAsC,CAAA,EAK5C,IAAK,IAAMC,KAHXV,OAAOW,OAAOF,EAAYH,EAAAA,QAAaM,iBAGpBH,EACjBA,EAAWC,GAAQ,CACjBG,QAASlB,GAIb,IAAK,IAAImB,EAAI,EAAOT,EAAgBU,OAApBD,EAA4BA,IAC1CL,EAAWJ,EAAgBS,IAAM,CAC/BD,QAASlB,GA0Bb,OArBAc,EAAWO,aAAe,CACxBH,QAASlB,GAGXc,EAAWQ,SAAW,CACpBJ,QAASlB,GAGI,aAAXS,IAEFK,EAAWS,SAAW,CACpBL,QAASlB,GAGXc,EAAWU,GAAK,CACdC,KAAMC,SAMHZ,CACT,CAsBO,SAASa,EAAkBC,GAChC,IAAMC,EAAyC,CAAA,EACzCC,EAAqBF,EAAMN,SAEjC,GAAIQ,IAAuB9B,EAEzB,IAAK,IAAM+B,KAAYD,EACjB5B,EAAe4B,EAAoBC,IAAaD,EAAmBC,KAAc/B,IACnF6B,EAAcE,GAAYD,EAAmBC,IAMnD,IAAK,IAAMA,KAAYH,EACjB1B,EAAe0B,EAAOG,IAA0B,aAAbA,GAA2BH,EAAMG,KAAc/B,IACpF6B,EAAcE,GAAYH,EAAMG,IAIpC,OAAOF,CACT,CAWO,SAASG,EAAkBJ,GAChC,IAAMK,EAAuCN,EAAkBC,GAE/D,OAAOvB,OAAO6B,KAAKD,GAAaE,OAAO,SAAA/B,GAAG,OACX,mBAArB6B,EAAY7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3FJ,EAAKnD,eAAiBqD,GAAqB,KAC3CF,EAAKvE,YAAYa,eAAe,CAAEuB,QAASqC,QAAqBpK,IApBhE,CAqBF,GACF,GAEFuK,QAAO,WAIApF,KAAK1G,KACR0G,KAAKI,IAAI9G,GAAK0G,KAAKK,kBAGrBL,KAAK4B,eAAiB5B,KAAK8D,oBAC3B9D,KAAK2C,SACP,EACA0C,QAAO,WAKLrF,KAAKC,gBACP,EACAqF,cAAa,WACPtF,KAAKQ,aACPR,KAAKQ,YAAY+E,SAErB,EACAC,oFCtVAC,EAAAA,mBAMK,MAAA,CANCnM,GAAIoM,EAAApM,GAAIqM,MAAA,CAAAC,OAAA,UACZC,EAAAA,mBAAA,0RAIAC,aAAYJ,EAAAK,OAAA,8CCMhB,IAAMC,EAAYpG,EAAAA,gBAAgB,CAChCC,KAAM,YACNnG,MAAOpB,EAAY,aACnB2N,OAAQ,CAAC,eAAgB,kBACzB/D,QAAS,CAKPgE,qBAAoB,WAClB,IAAM9I,EAAgB3D,EAAkBuG,KAAKO,QACvCqB,6VAAauE,CAAA,CAAA,EAAS/I,GAExBA,EAAcgJ,WAChBxE,EAAewE,SAAWhJ,EAAcgJ,UAGtChJ,EAAciJ,SAChBzE,EAAeyE,OAASjJ,EAAciJ,QAGxCrG,KAAKD,aAAa3E,IAAI4E,KAAM4B,EAC9B,GAEF1B,MAAO,CACLK,OAAQ,CACNJ,QAAO,WACLH,KAAKkG,uBACLlG,KAAKC,gBACP,EACAsB,MAAM,IAGV6D,QAAO,WACLpF,KAAKkG,uBACLlG,KAAKC,gBACP,EACAqG,UAAS,WACPtG,KAAKD,aAAY,OAAQC,MACzBA,KAAKC,gBACP,EACAqB,OAAM,WAMJ,OAAOiF,EAAAA,mBAAmB,aAC5B"}
|
|
1
|
+
{"version":3,"file":"vue-handsontable.min.js","sources":["../src/helpers.ts","../src/HotTable.vue","../src/HotTable.vue?vue&type=template&id=54bcc3fa&lang.js","../src/HotColumn.vue"],"sourcesContent":["import { toRaw, PropType } from 'vue';\nimport Handsontable, { OmitHooks, RemoveIndexSignature } from 'handsontable/base';\nimport { HotTableProps, VueProps } from './types';\n\nconst unassignedPropSymbol = Symbol('unassigned');\n\n/**\n * The shape `defineComponent()` reads the prop types from, with one entry per option of `Settings`. `type`\n * exists only for the type checker: the runtime schema built by `propFactory()` carries none, so Vue\n * neither validates nor casts a prop.\n *\n * `RemoveIndexSignature` drops the index signature of `Settings`. Left in, it becomes an index signature of\n * the props, and Vue types every prop as `any` again. The mapping also drops `afterChangesObserved`: the\n * settings types list that hook, but core neither registers nor fires it, so a prop for it could never work.\n * `SettingsProp` is what the `settings` prop takes.\n */\ntype PropSchema<Settings, SettingsProp = Settings> = {\n [P in keyof RemoveIndexSignature<Settings> as P extends 'afterChangesObserved' ? never : P]-?: {\n type: PropType<RemoveIndexSignature<Settings>[P]>,\n default: unknown,\n };\n} & {\n settings: {\n type: PropType<SettingsProp>,\n default: unknown,\n },\n};\n\n/**\n * `HotColumn` takes column settings, not grid settings: its `data` is a property name or a getter, where the\n * grid's `data` is an array of rows. Hooks run from the grid-level settings only, and core reads `getValue`\n * from the table meta only, so neither is a prop of a column. The `settings` prop also takes a grid settings\n * object, as it did when every prop was `any`: such an object has no `data` that would clash.\n */\ntype HotColumnPropSchema = PropSchema<\n Omit<OmitHooks<RemoveIndexSignature<Handsontable.ColumnSettings>>, 'getValue'>,\n Handsontable.ColumnSettings | Handsontable.GridSettings\n>;\n\n/**\n * `HotTable` takes the settings `updateSettings()` takes: a hook prop may be `null`, which removes the\n * callback the earlier props passed for it.\n */\ntype HotTablePropSchema = PropSchema<Handsontable.SettingsUpdate> & {\n id: {\n type: PropType<string>,\n },\n};\n\n/**\n * Message for the warning thrown if the Handsontable instance has been destroyed.\n */\nexport const HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' +\n ' used properly.';\n\n/**\n * Check if at specified `key` there is any value for `object`.\n *\n * @param {object} object Object to search value at specyfic key.\n * @param {string} key String key to check.\n * @returns {boolean}\n */\nexport function hasOwnProperty(object: unknown, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\n/**\n * Generate an object containing all the available Handsontable properties and plugin hooks.\n *\n * @param {string} source Source for the factory (either 'HotTable' or 'HotColumn').\n * @returns {object}\n */\nexport function propFactory(source: 'HotTable'): HotTablePropSchema;\nexport function propFactory(source: 'HotColumn'): HotColumnPropSchema;\n/**\n * Implementation of the overloads above.\n *\n * @param {string} source Source for the factory (either 'HotTable' or 'HotColumn').\n * @returns {object}\n */\nexport function propFactory(source: 'HotTable' | 'HotColumn'): HotTablePropSchema | HotColumnPropSchema {\n const registeredHooks = Handsontable.hooks.getRegistered();\n const propSchema: VueProps<HotTableProps> = {};\n\n Object.assign(propSchema, Handsontable.DefaultSettings);\n\n // eslint-disable-next-line no-restricted-syntax, guard-for-in\n for (const prop in propSchema) {\n propSchema[prop] = {\n default: unassignedPropSymbol\n };\n }\n\n for (let i = 0; i < registeredHooks.length; i++) {\n propSchema[registeredHooks[i]] = {\n default: unassignedPropSymbol\n };\n }\n\n // Documented options that have no entry in `DefaultSettings`, so the loops above never reach them.\n propSchema.handsontable = {\n default: unassignedPropSymbol\n };\n\n propSchema.settings = {\n default: unassignedPropSymbol\n };\n\n if (source === 'HotTable') {\n // Core reads `getValue` from the table meta only, so a column has no use for it.\n propSchema.getValue = {\n default: unassignedPropSymbol\n };\n\n propSchema.id = {\n type: String,\n };\n }\n\n // The schema is filled at runtime from `DefaultSettings`, the registered hooks, and the options named\n // above, which is why it is built loosely and typed here, from `SettingsUpdate` and `ColumnSettings`, for the template type checker.\n return propSchema as unknown as HotTablePropSchema | HotColumnPropSchema;\n}\n\n/**\n * Generate a random id for the `HotTable` container. It has to be created on the client only: an id\n * generated on the server never matches the one the browser generates while hydrating.\n *\n * @returns {string} The container id.\n */\nexport function generateContainerId(): string {\n const buffer = new Uint16Array(3);\n\n globalThis.crypto.getRandomValues(buffer);\n\n return `hot-${Array.from(buffer, value => value.toString(16).padStart(4, '0')).join('')}`;\n}\n\n/**\n * Filter out all of the unassigned props, and return only the one passed to the component.\n *\n * @param {object} props Object containing all the possible props.\n * @returns {object} Object containing only used props.\n */\nexport function filterPassedProps(props) {\n const filteredProps: VueProps<HotTableProps> = {};\n const columnSettingsProp = props.settings;\n\n if (columnSettingsProp !== unassignedPropSymbol) {\n // eslint-disable-next-line no-restricted-syntax\n for (const propName in columnSettingsProp) {\n if (hasOwnProperty(columnSettingsProp, propName) && columnSettingsProp[propName] !== unassignedPropSymbol) {\n filteredProps[propName] = columnSettingsProp[propName];\n }\n }\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const propName in props) {\n if (hasOwnProperty(props, propName) && propName !== 'settings' && props[propName] !== unassignedPropSymbol) {\n filteredProps[propName] = props[propName];\n }\n }\n\n return filteredProps;\n}\n\n/**\n * List the hooks the props pass a callback for, directly or through the `settings` prop. A key counts as\n * a hook by the rule core's `updateSettings()` uses in `core.ts`: a registered or a deprecated hook name.\n * Only a function or an array of them counts as a callback: core ignores any other value, so a hook prop\n * that holds `false` (`:afterChange=\"on && logChange\"`) is treated as removed.\n *\n * @param {HotTableProps} props The props passed to the component.\n * @returns {string[]} The hook names.\n */\nexport function getPassedHookKeys(props: HotTableProps): string[] {\n const passedProps: VueProps<HotTableProps> = filterPassedProps(props);\n\n return Object.keys(passedProps).filter(key => (\n (typeof passedProps[key] === 'function' || Array.isArray(passedProps[key])) &&\n (Handsontable.hooks.isRegistered(key) || Handsontable.hooks.isDeprecated(key))\n ));\n}\n\n/**\n * What the wrapper last knew about a setting: the prop value it synced, a copy of its content, and the value the\n * grid held right after. The copy is needed because core edits an array it was given in place (`alter()` splices\n * `colHeaders`), so the prop itself no longer shows what was synced.\n */\nexport type SettingBaseline = { prop: unknown, copy: unknown, live: unknown };\n\n/**\n * Check if a value is a plain object, one made by an object literal or with no prototype. A class instance is not.\n *\n * @param {unknown} value The value to check.\n * @returns {boolean}\n */\nfunction isLiteralObject(value: unknown): value is Record<string, unknown> {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === Object.prototype || prototype === null;\n}\n\n/**\n * Copy the plain objects and arrays of a settings value, and keep every other value (functions, class instances)\n * by reference. The copy is what the next change is compared with, so a value the app edits in place reads as\n * changed. Reactive proxies are unwrapped, and a value with a cycle is copied with the same cycle.\n *\n * @param {unknown} value The value to copy.\n * @param {WeakMap<object, unknown>} [copies] The copies made so far, by original.\n * @returns {unknown} The copy.\n */\nfunction copySettingsValue(value: unknown, copies: WeakMap<object, unknown> = new WeakMap()): unknown {\n const raw = toRaw(value);\n\n if (!Array.isArray(raw) && !isLiteralObject(raw)) {\n return raw;\n }\n\n if (copies.has(raw)) {\n return copies.get(raw);\n }\n\n if (Array.isArray(raw)) {\n const arrayCopy: unknown[] = [];\n\n copies.set(raw, arrayCopy);\n raw.forEach((item) => {\n arrayCopy.push(copySettingsValue(item, copies));\n });\n\n return arrayCopy;\n }\n\n const objectCopy: Record<string, unknown> = {};\n\n copies.set(raw, objectCopy);\n Object.keys(raw).forEach((key) => {\n objectCopy[key] = copySettingsValue(raw[key], copies);\n });\n\n return objectCopy;\n}\n\n/**\n * Compare a copy made by `copySettingsValue()` with a value: plain objects and arrays by content, a `RegExp` by\n * its source and flags, anything else by reference. A pair already being compared higher up reads as equal,\n * so a value with a cycle ends.\n *\n * @param {unknown} copied The copy.\n * @param {unknown} value The value to compare it with.\n * @param {WeakMap<object, WeakSet<object>>} [visited] The object pairs on the current comparison path.\n * @returns {boolean} `true` if they hold the same content.\n */\nfunction isSameAsCopy(\n copied: unknown,\n value: unknown,\n visited: WeakMap<object, WeakSet<object>> = new WeakMap()\n): boolean {\n const raw = toRaw(value);\n\n if (copied === raw) {\n return true;\n }\n\n if (copied instanceof RegExp || raw instanceof RegExp) {\n return copied instanceof RegExp && raw instanceof RegExp &&\n copied.source === raw.source && copied.flags === raw.flags;\n }\n\n const bothArrays = Array.isArray(copied) && Array.isArray(raw);\n\n if (!bothArrays && !(isLiteralObject(copied) && isLiteralObject(raw))) {\n return false;\n }\n\n const copiedObject = copied as Record<string, unknown>;\n const rawObject = raw as Record<string, unknown>;\n const comparedWith = visited.get(copiedObject);\n\n if (comparedWith?.has(rawObject)) {\n return true;\n }\n\n if (comparedWith) {\n comparedWith.add(rawObject);\n } else {\n visited.set(copiedObject, new WeakSet([rawObject]));\n }\n\n const keys = Object.keys(copiedObject);\n\n return keys.length === Object.keys(rawObject).length &&\n keys.every(key => hasOwnProperty(rawObject, key) && isSameAsCopy(copiedObject[key], rawObject[key], visited));\n}\n\n/**\n * The settings by name, as `SettingBaseline`s. `HotTable` keeps one per instance.\n */\nexport type SettingBaselines = Record<string, SettingBaseline>;\n\n/**\n * Settings the baseline rule leaves alone. The sizes are re-sent whenever they differ from the grid's value,\n * because the user can change them by dragging and the prop re-declares them (the React wrapper does the\n * same). `data` has its own path in `HotTable`, and a baseline would keep the previous array alive.\n */\nconst BASELINE_EXEMPT_KEYS = ['data', 'colWidths', 'rowHeights', 'minRowHeights', 'themeName'];\n\n/**\n * Settings whose baseline holds the reference only, with no copy of the content. `sheetsBar` carries every sheet's\n * `data`, which a copy on each reactive change would walk again (`isEqualSetting()` avoids the same walk).\n */\nconst REFERENCE_ONLY_KEYS = ['sheetsBar'];\n\n/**\n * Check if the app replaced the value of a setting through the instance (`hot.updateSettings()`) since the\n * wrapper last synced the prop, while the prop itself stayed the same. Such a prop is not sent again: it did\n * not change, and sending it would take back what the app set.\n *\n * @param {string} key The setting name.\n * @param {unknown} propValue The value passed through the props.\n * @param {Handsontable.GridSettings} currentSettings The grid's current settings.\n * @param {SettingBaselines} [baselines] What the wrapper last synced.\n * @returns {boolean} `true` if the app overrode the setting.\n */\nfunction isOverriddenByApp(\n key: string,\n propValue: unknown,\n currentSettings?: Handsontable.GridSettings,\n baselines?: SettingBaselines\n): boolean {\n const baseline = baselines?.[key];\n\n // The cheap check goes first: the content compare runs only for a setting the app replaced.\n return !!currentSettings && !!baseline && !BASELINE_EXEMPT_KEYS.includes(key) &&\n !Object.is(currentSettings[key], baseline.live) &&\n (isSameReference(baseline.prop, propValue) ||\n (!REFERENCE_ONLY_KEYS.includes(key) && isSameAsCopy(baseline.copy, propValue)));\n}\n\n/**\n * Record the props the wrapper has just synced with the grid, for the next change to compare with. A setting the\n * app overrode (`overriddenKeys`) keeps its previous baseline, so the override outlives the next changes and\n * is given up only when the prop itself changes.\n *\n * @param {SettingBaselines} baselines What the wrapper last synced. It is updated in place.\n * @param {HotTableProps} props The props passed to the component.\n * @param {Handsontable.GridSettings} currentSettings The grid's current settings.\n * @param {string[]} [overriddenKeys] The settings `prepareSettings()` left out because the app overrode them.\n */\nexport function recordSettingBaselines(\n baselines: SettingBaselines,\n props: HotTableProps,\n currentSettings: Handsontable.GridSettings,\n overriddenKeys: string[] = []\n): void {\n const passedProps: VueProps<HotTableProps> = filterPassedProps(props);\n\n Object.keys(baselines).forEach((key) => {\n if (!hasOwnProperty(passedProps, key)) {\n delete baselines[key];\n }\n });\n\n Object.keys(passedProps).forEach((key) => {\n if (!overriddenKeys.includes(key) && !BASELINE_EXEMPT_KEYS.includes(key)) {\n baselines[key] = {\n prop: toRaw(passedProps[key]),\n copy: REFERENCE_ONLY_KEYS.includes(key) ? undefined : copySettingsValue(passedProps[key]),\n live: currentSettings[key],\n };\n }\n });\n}\n\n/**\n * Prepare the settings object to be used as the settings for Handsontable, based on the props provided to the component.\n *\n * A hook listed in `previousHookKeys` that the props no longer pass a callback for (the prop is removed or\n * `undefined`) is sent as `null`, which removes the callback the props registered.\n *\n * A prop that is the same value the wrapper last synced (`baselines`) is left out when the grid's value for it\n * was replaced since, through `hot.updateSettings()`: the app's value stays until the prop changes.\n *\n * @param {HotTableProps} props The props passed to the component.\n * @param {Handsontable.GridSettings} currentSettings The current Handsontable settings.\n * @param {string[]} previousHookKeys The hooks the previous props passed a callback for.\n * @param {SettingBaselines} [baselines] What the wrapper last synced.\n * @param {string[]} [overriddenKeys] Receives the names of the props left out because the app overrode them.\n * @returns {Handsontable.GridSettings} An object containing the properties, ready to be used within Handsontable.\n */\nexport function prepareSettings(\n props: HotTableProps,\n currentSettings?: Handsontable.GridSettings,\n previousHookKeys: string[] = [],\n baselines?: SettingBaselines,\n overriddenKeys: string[] = []\n): HotTableProps {\n const assignedProps: VueProps<HotTableProps> = filterPassedProps(props);\n const hotSettingsInProps: Handsontable.GridSettings = props.settings ? props.settings : assignedProps;\n const additionalHotSettingsInProps: Handsontable.GridSettings | null = props.settings ? assignedProps : null;\n const initOnlySettingKeys: string[] =\n (currentSettings as any)?._initOnlySettings || [];\n const newSettings: Handsontable.GridSettings = {};\n const isOverridden = (key: string, value: unknown): boolean => {\n // A direct prop wins over the same key in the `settings` prop, and the baseline holds the winner.\n const effectiveValue = hasOwnProperty(assignedProps, key) ? assignedProps[key] : value;\n const overridden = isOverriddenByApp(key, effectiveValue, currentSettings, baselines);\n\n if (overridden && !overriddenKeys.includes(key)) {\n overriddenKeys.push(key);\n }\n\n return overridden;\n };\n\n // eslint-disable-next-line no-restricted-syntax\n for (const key in hotSettingsInProps) {\n if (\n hasOwnProperty(hotSettingsInProps, key) &&\n hotSettingsInProps[key] !== undefined &&\n !initOnlySettingKeys.includes(key) &&\n !isOverridden(key, hotSettingsInProps[key]) &&\n ((currentSettings && key !== 'data')\n ? !isEqualSetting(key, currentSettings[key], hotSettingsInProps[key], currentSettings) : true)\n ) {\n newSettings[key] = hotSettingsInProps[key];\n }\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const key in additionalHotSettingsInProps) {\n if (\n hasOwnProperty(additionalHotSettingsInProps, key) &&\n key !== 'id' &&\n key !== 'settings' &&\n additionalHotSettingsInProps[key] !== undefined &&\n !initOnlySettingKeys.includes(key) &&\n !isOverridden(key, additionalHotSettingsInProps[key]) &&\n ((currentSettings && key !== 'data')\n ? !isEqualSetting(key, currentSettings[key], additionalHotSettingsInProps[key], currentSettings) : true)\n ) {\n newSettings[key] = additionalHotSettingsInProps[key];\n }\n }\n\n if (previousHookKeys.length > 0) {\n const passedHookKeys = getPassedHookKeys(props);\n\n previousHookKeys.forEach((key) => {\n if (!passedHookKeys.includes(key)) {\n newSettings[key] = null;\n }\n });\n }\n\n return newSettings;\n}\n\n/**\n * Compare the grid's current value of a setting with the value passed through the props.\n *\n * `sheetsBar` is compared key by key: a template writes it as an object literal\n * (`:sheetsBar=\"{ sheets }\"`), which is a new object on every render, while the sheets it holds keep\n * every sheet's data, which must not be serialized on each change. The `sheets` array is compared by\n * reference, and an option given as an object literal (`animation: { switch: false }`) by the\n * references of its own keys. A new `sheets` array or a changed option in a new `sheetsBar` object is\n * therefore sent, even when it differs only by a function. A change made inside the same `sheetsBar`\n * object or the same `sheets` array is not sent, and neither are the plugin's own writes into that\n * array. `themeName` is compared with the grid's `theme`, because core moves the name there and\n * `getSettings().themeName` stays `undefined`. Every other setting is compared with `simpleEqual()`.\n *\n * @param {string} key The setting name.\n * @param {unknown} currentValue The grid's current value.\n * @param {unknown} newValue The value passed through the props.\n * @param {Handsontable.GridSettings} currentSettings The grid's current settings.\n * @returns {boolean} `true` if the value does not need to be sent.\n */\nfunction isEqualSetting(\n key: string,\n currentValue: unknown,\n newValue: unknown,\n currentSettings: Handsontable.GridSettings\n): boolean {\n if (key === 'sheetsBar') {\n return haveEqualOwnKeys(currentValue, newValue, (propName, valueA, valueB) => (\n propName === 'sheets' ? isSameReference(valueA, valueB) : isShallowEqualByReference(valueA, valueB)\n ));\n }\n\n if (key === 'themeName' && currentValue === undefined) {\n return typeof newValue === 'string' && currentSettings.theme === newValue;\n }\n\n return simpleEqual(currentValue, newValue);\n}\n\n/**\n * Compare two values by reference, and two plain objects by the references of their own keys.\n *\n * @param {unknown} valueA First value to compare.\n * @param {unknown} valueB Second value to compare.\n * @returns {boolean} `true` if they're the same, `false` otherwise.\n */\nfunction isShallowEqualByReference(valueA: unknown, valueB: unknown): boolean {\n return haveEqualOwnKeys(valueA, valueB, (propName, keyValueA, keyValueB) => isSameReference(keyValueA, keyValueB));\n}\n\n/**\n * Compare two values by reference, or, when both are plain objects, compare their own keys with the\n * given function. Reactive proxies are compared by their raw objects.\n *\n * @param {unknown} valueA First value to compare.\n * @param {unknown} valueB Second value to compare.\n * @param {Function} isEqualValue Compares the values both objects hold under one key.\n * @returns {boolean} `true` if they're the same, `false` otherwise.\n */\nfunction haveEqualOwnKeys(\n valueA: unknown,\n valueB: unknown,\n isEqualValue: (propName: string, keyValueA: unknown, keyValueB: unknown) => boolean,\n): boolean {\n const rawA = toRaw(valueA);\n const rawB = toRaw(valueB);\n\n if (rawA === rawB) {\n return true;\n }\n\n if (!isPlainObject(rawA) || !isPlainObject(rawB)) {\n return false;\n }\n\n const keysA = Object.keys(rawA);\n const keysB = Object.keys(rawB);\n\n return keysA.length === keysB.length &&\n keysA.every(propName => hasOwnProperty(rawB, propName) && isEqualValue(propName, rawA[propName], rawB[propName]));\n}\n\n/**\n * Compare two values by reference, with reactive proxies compared by their raw objects.\n *\n * @param {unknown} valueA First value to compare.\n * @param {unknown} valueB Second value to compare.\n * @returns {boolean} `true` if they're the same, `false` otherwise.\n */\nfunction isSameReference(valueA: unknown, valueB: unknown): boolean {\n return toRaw(valueA) === toRaw(valueB);\n}\n\n/**\n * Check if a value is a plain object.\n *\n * @param {unknown} value The value to check.\n * @returns {boolean}\n */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Compare two objects using `JSON.stringify`.\n * *Note: * As it's using the stringify function to compare objects, the property order in both objects is\n * important. It will return `false` for the same objects, if they're defined in a different order.\n *\n * @param {object} objectA First object to compare.\n * @param {object} objectB Second object to compare.\n * @returns {boolean} `true` if they're the same, `false` otherwise.\n */\nfunction simpleEqual(objectA, objectB) {\n // Shared across both stringify calls so the same Node/function instance maps\n // to the same identity token in objectA's string and objectB's string.\n const identityMap = new WeakMap<object, string>();\n let nextIdentityId = 0;\n\n const stringifyToJSON = (val) => {\n const seen = new WeakSet();\n\n return JSON.stringify(val, (key, value) => {\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return undefined;\n }\n\n seen.add(value);\n\n // DOM nodes carry framework metadata as enumerable own properties\n // (e.g., Vue 3 attaches `_vnode` to the mount root). Recursing into them\n // can reach getters that throw - see GH #11220 - and produces noise that\n // is irrelevant to settings equality. Replace each Node with an identity\n // token so reference equality is still detected.\n if (typeof Node !== 'undefined' && value instanceof Node) {\n let id = identityMap.get(value);\n\n if (id === undefined) {\n nextIdentityId += 1;\n id = `__hot_node_${nextIdentityId}__`;\n identityMap.set(value, id);\n }\n\n return id;\n }\n }\n\n return value;\n });\n };\n\n if (typeof objectA === 'function' && typeof objectB === 'function') {\n return objectA.toString() === objectB.toString();\n\n } else if (typeof objectA !== typeof objectB) {\n return false;\n\n } else {\n try {\n return stringifyToJSON(objectA) === stringifyToJSON(objectB);\n } catch (e) {\n // If either side cannot be serialized (e.g., contains a throwing getter),\n // assume the values are not equal so the wrapper still updates settings.\n return false;\n }\n }\n}\n","<template>\n <div :id=\"id\" style=\"height: 100%\">\n <!-- `hot-column` children render invisible comment anchors in source order.\n Handsontable appends its own DOM to this container without clearing\n pre-existing nodes, so the anchors survive; the parent reads their\n document position to order the columns. -->\n <slot></slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { defineComponent, VNode, markRaw, toRaw } from 'vue';\n// TODO: The line above is ts-ignored because rollup-plugin-typescript2 throws an error otherwise.\n// It's most probably caused by outdated rollup-plugin-vue which is no longer maintained.\n\nimport Handsontable from 'handsontable/base';\nimport {\n HOT_DESTROYED_WARNING,\n generateContainerId,\n getPassedHookKeys,\n prepareSettings,\n propFactory,\n recordSettingBaselines,\n SettingBaselines,\n} from './helpers';\nimport {\n HotTableProps,\n} from './types';\nimport * as packageJson from '../package.json';\n\nconst HotTable = defineComponent({\n name: 'HotTable',\n props: propFactory('HotTable'),\n provide() {\n return {\n columnsCache: this.columnsCache,\n refreshColumns: this.refreshColumns,\n };\n },\n watch: {\n // Vue removes the attribute when `id` is cleared, so put the generated one back after the patch.\n id: {\n handler(id) {\n if (!id) {\n this.$el.id = this.getGeneratedId();\n }\n },\n flush: 'post',\n },\n $props: {\n handler(props) {\n const overriddenKeys: string[] = [];\n const settings = prepareSettings(\n props,\n this.hotInstance ? this.hotInstance.getSettings() : undefined,\n this.miscCache.hookKeys,\n this.miscCache.baselines,\n overriddenKeys\n );\n\n if (!this.hotInstance || settings === undefined) {\n return;\n }\n\n this.miscCache.hookKeys = getPassedHookKeys(props);\n\n const hasData = settings.data !== undefined;\n const incomingData = hasData ? toRaw(settings.data) : undefined;\n const isNewData = hasData && incomingData !== this.miscCache.lastData.value;\n\n // A new array replaces the grid's data: `updateSettings()` runs core's `updateData()`, which fits the\n // index mappers to the new length and keeps their state, unless the same payload changes the column layout.\n if (hasData && !isNewData && incomingData === null) {\n // The prop was already cleared: sending `null` again would reset the grid on every later change.\n delete settings.data;\n\n } else if (settings.data && !isNewData) {\n if (\n this.hotInstance.isColumnModificationAllowed() ||\n (\n !this.hotInstance.isColumnModificationAllowed() &&\n this.hotInstance.countSourceCols() === this.miscCache.currentSourceColumns\n )\n ) {\n // If the dataset dimensions change, update the index mappers.\n this.matchHotMappersSize();\n\n // Data is automatically synchronized by reference.\n delete settings.data;\n }\n }\n\n // Recorded before the update: core holds the array as soon as `updateSettings()` starts, so a hook that\n // throws must not leave the old one here, or every later in-place edit would reload the data.\n if (hasData) {\n this.miscCache.lastData.value = incomingData;\n }\n\n // If there are another options changed, update the HOT settings, render the table otherwise.\n if (Object.keys(settings).length) {\n this.hotInstance.updateSettings(settings);\n\n } else {\n this.hotInstance.render();\n }\n\n this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();\n\n recordSettingBaselines(this.miscCache.baselines, props, this.hotInstance.getSettings(), overriddenKeys);\n },\n deep: true,\n immediate: true,\n },\n },\n data() {\n return {\n /* eslint-disable vue/no-reserved-keys */\n __hotInstance: null as Handsontable | null,\n /* eslint-enable vue/no-reserved-keys */\n miscCache: {\n currentSourceColumns: null,\n generatedId: '',\n hookKeys: [] as string[],\n // Holds the grid's own values, so it must not be wrapped in a proxy: the compare is by identity.\n baselines: markRaw({}) as SettingBaselines,\n // The `data` array the grid was last given by the props, compared by identity to tell a new array\n // from an in-place edit. Wrapped in a raw holder so Vue does not proxy the app's array.\n lastData: markRaw({ value: undefined as unknown }),\n },\n columnSettings: null as HotTableProps[] | null,\n columnsCache: new Map<VNode, HotTableProps>(),\n columnsRefreshScheduled: false,\n get hotInstance(): Handsontable | null {\n if (!this.__hotInstance || (this.__hotInstance && !this.__hotInstance.isDestroyed)) {\n\n // Will return the Handsontable instance or `null` if it's not yet been created.\n return this.__hotInstance;\n\n } else {\n /* eslint-disable-next-line no-console */\n console.warn(HOT_DESTROYED_WARNING);\n\n return null;\n }\n },\n set hotInstance(hotInstance: Handsontable | null) {\n this.__hotInstance = hotInstance;\n },\n };\n },\n methods: {\n /**\n * Get the id used when the `id` prop is not passed. It is created once per instance.\n *\n * @returns {string} The generated container id.\n */\n getGeneratedId(): string {\n if (!this.miscCache.generatedId) {\n this.miscCache.generatedId = generateContainerId();\n }\n\n return this.miscCache.generatedId;\n },\n\n /**\n * Initialize Handsontable.\n */\n hotInit() {\n const newSettings = prepareSettings(this.$props);\n\n newSettings.columns = this.columnSettings ? this.columnSettings : newSettings.columns;\n\n this.hotInstance = markRaw<Handsontable>(new Handsontable.Core(this.$el, newSettings));\n\n // Recorded before `init()`, so a value the app sets in `afterInit` counts as an override of the prop.\n recordSettingBaselines(this.miscCache.baselines, this.$props, this.hotInstance.getSettings());\n\n this.hotInstance.init();\n\n this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();\n this.miscCache.hookKeys = getPassedHookKeys(this.$props);\n this.miscCache.lastData.value = toRaw(newSettings.data);\n },\n\n matchHotMappersSize(): void {\n if (!this.hotInstance) {\n return;\n }\n\n const data: Handsontable.CellValue[][] = this.hotInstance.getSourceData();\n const rowsToRemove: number[] = [];\n const columnsToRemove: number[] = [];\n const indexMapperRowCount = this.hotInstance.rowIndexMapper.getNumberOfIndexes();\n const isColumnModificationAllowed = this.hotInstance.isColumnModificationAllowed();\n let indexMapperColumnCount = 0;\n\n if (data && data.length !== indexMapperRowCount) {\n if (data.length < indexMapperRowCount) {\n for (let r = data.length; r < indexMapperRowCount; r++) {\n rowsToRemove.push(r);\n }\n }\n }\n\n if (isColumnModificationAllowed) {\n indexMapperColumnCount = this.hotInstance.columnIndexMapper.getNumberOfIndexes();\n\n if (data && data[0] && data[0]?.length !== indexMapperColumnCount) {\n if (data[0].length < indexMapperColumnCount) {\n for (let c = data[0].length; c < indexMapperColumnCount; c++) {\n columnsToRemove.push(c);\n }\n }\n }\n }\n\n this.hotInstance.batch(() => {\n if (rowsToRemove.length > 0) {\n this.hotInstance.rowIndexMapper.removeIndexes(rowsToRemove);\n\n } else {\n this.hotInstance.rowIndexMapper\n .insertIndexes(indexMapperRowCount - 1, data.length - indexMapperRowCount);\n }\n\n if (isColumnModificationAllowed && data.length !== 0) {\n if (columnsToRemove.length > 0) {\n this.hotInstance.columnIndexMapper.removeIndexes(columnsToRemove);\n\n } else {\n this.hotInstance.columnIndexMapper\n .insertIndexes(indexMapperColumnCount - 1, data[0].length - indexMapperColumnCount);\n }\n }\n });\n },\n\n /**\n * Get settings for the columns provided in the `hot-column` components.\n *\n * The columns are ordered by the document position of each `hot-column`'s\n * anchor node, not by the `columnsCache` insertion order. This keeps the\n * order correct when columns are inserted in the middle, removed, or\n * reordered, and when a `hot-column` is nested inside a wrapper component.\n *\n * @returns {HotTableProps[] | undefined}\n */\n getColumnSettings(): HotTableProps[] | void {\n const orderedColumns = Array.from(this.columnsCache.entries())\n .sort(([columnA], [columnB]) => {\n const anchorA = (columnA as { $el?: Node }).$el;\n const anchorB = (columnB as { $el?: Node }).$el;\n\n if (!anchorA || !anchorB) {\n return 0;\n }\n\n const position = anchorA.compareDocumentPosition(anchorB);\n\n // eslint-disable-next-line no-bitwise\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n\n // eslint-disable-next-line no-bitwise\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n\n return 0;\n })\n .map(([, columnSettings]) => columnSettings);\n\n return orderedColumns.length ? orderedColumns : undefined;\n },\n\n /**\n * Re-read the column settings declared by `hot-column` children and push them\n * to the Handsontable instance. Called by children on mount, prop change, and\n * unmount, and by the parent on reorder. Multiple notifications in the same\n * tick are coalesced into a single `updateSettings` call.\n */\n refreshColumns(): void {\n if (this.columnsRefreshScheduled) {\n return;\n }\n\n this.columnsRefreshScheduled = true;\n\n this.$nextTick(() => {\n this.columnsRefreshScheduled = false;\n\n if (!this.hotInstance) {\n return;\n }\n\n const newColumnSettings = this.getColumnSettings();\n const previousColumnSettings = this.columnSettings;\n\n // Each `hot-column` rebuilds its settings object whenever its props change,\n // so an unchanged column keeps the same object reference. Comparing the\n // arrays by reference and order is cheaper than a deep compare and avoids\n // an `updateSettings` call on unrelated re-renders (e.g. data-only updates).\n const isUnchanged =\n (!previousColumnSettings && !newColumnSettings) ||\n (!!previousColumnSettings && !!newColumnSettings &&\n previousColumnSettings.length === newColumnSettings.length &&\n previousColumnSettings.every((settings, index) => settings === newColumnSettings[index]));\n\n if (isUnchanged) {\n return;\n }\n\n this.columnSettings = newColumnSettings || null;\n this.hotInstance.updateSettings({ columns: newColumnSettings || undefined });\n });\n },\n },\n mounted() {\n // The auto-generated id is set here, on the client only, and not through a prop default or reactive\n // data: an id created on the server never matches the browser's, which breaks hydration, and a\n // reactive id would re-render every `HotTable` right after mounting.\n if (!this.id) {\n this.$el.id = this.getGeneratedId();\n }\n\n this.columnSettings = this.getColumnSettings();\n this.hotInit();\n },\n updated() {\n // Reordering keyed `hot-column` children reuses their instances and fires no\n // child lifecycle hook, so the children cannot notify on their own. The slot\n // vnodes do change, which re-renders `HotTable` - refresh from here to cover\n // reorders (coalesced with any child-triggered refresh).\n this.refreshColumns();\n },\n beforeUnmount() {\n if (this.hotInstance) {\n this.hotInstance.destroy();\n }\n },\n version: (packageJson as unknown as { version: string }).version,\n});\n\nexport default HotTable;\nexport { HotTable };\n</script>\n","<template>\n <div :id=\"id\" style=\"height: 100%\">\n <!-- `hot-column` children render invisible comment anchors in source order.\n Handsontable appends its own DOM to this container without clearing\n pre-existing nodes, so the anchors survive; the parent reads their\n document position to order the columns. -->\n <slot></slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { defineComponent, VNode, markRaw, toRaw } from 'vue';\n// TODO: The line above is ts-ignored because rollup-plugin-typescript2 throws an error otherwise.\n// It's most probably caused by outdated rollup-plugin-vue which is no longer maintained.\n\nimport Handsontable from 'handsontable/base';\nimport {\n HOT_DESTROYED_WARNING,\n generateContainerId,\n getPassedHookKeys,\n prepareSettings,\n propFactory,\n recordSettingBaselines,\n SettingBaselines,\n} from './helpers';\nimport {\n HotTableProps,\n} from './types';\nimport * as packageJson from '../package.json';\n\nconst HotTable = defineComponent({\n name: 'HotTable',\n props: propFactory('HotTable'),\n provide() {\n return {\n columnsCache: this.columnsCache,\n refreshColumns: this.refreshColumns,\n };\n },\n watch: {\n // Vue removes the attribute when `id` is cleared, so put the generated one back after the patch.\n id: {\n handler(id) {\n if (!id) {\n this.$el.id = this.getGeneratedId();\n }\n },\n flush: 'post',\n },\n $props: {\n handler(props) {\n const overriddenKeys: string[] = [];\n const settings = prepareSettings(\n props,\n this.hotInstance ? this.hotInstance.getSettings() : undefined,\n this.miscCache.hookKeys,\n this.miscCache.baselines,\n overriddenKeys\n );\n\n if (!this.hotInstance || settings === undefined) {\n return;\n }\n\n this.miscCache.hookKeys = getPassedHookKeys(props);\n\n const hasData = settings.data !== undefined;\n const incomingData = hasData ? toRaw(settings.data) : undefined;\n const isNewData = hasData && incomingData !== this.miscCache.lastData.value;\n\n // A new array replaces the grid's data: `updateSettings()` runs core's `updateData()`, which fits the\n // index mappers to the new length and keeps their state, unless the same payload changes the column layout.\n if (hasData && !isNewData && incomingData === null) {\n // The prop was already cleared: sending `null` again would reset the grid on every later change.\n delete settings.data;\n\n } else if (settings.data && !isNewData) {\n if (\n this.hotInstance.isColumnModificationAllowed() ||\n (\n !this.hotInstance.isColumnModificationAllowed() &&\n this.hotInstance.countSourceCols() === this.miscCache.currentSourceColumns\n )\n ) {\n // If the dataset dimensions change, update the index mappers.\n this.matchHotMappersSize();\n\n // Data is automatically synchronized by reference.\n delete settings.data;\n }\n }\n\n // Recorded before the update: core holds the array as soon as `updateSettings()` starts, so a hook that\n // throws must not leave the old one here, or every later in-place edit would reload the data.\n if (hasData) {\n this.miscCache.lastData.value = incomingData;\n }\n\n // If there are another options changed, update the HOT settings, render the table otherwise.\n if (Object.keys(settings).length) {\n this.hotInstance.updateSettings(settings);\n\n } else {\n this.hotInstance.render();\n }\n\n this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();\n\n recordSettingBaselines(this.miscCache.baselines, props, this.hotInstance.getSettings(), overriddenKeys);\n },\n deep: true,\n immediate: true,\n },\n },\n data() {\n return {\n /* eslint-disable vue/no-reserved-keys */\n __hotInstance: null as Handsontable | null,\n /* eslint-enable vue/no-reserved-keys */\n miscCache: {\n currentSourceColumns: null,\n generatedId: '',\n hookKeys: [] as string[],\n // Holds the grid's own values, so it must not be wrapped in a proxy: the compare is by identity.\n baselines: markRaw({}) as SettingBaselines,\n // The `data` array the grid was last given by the props, compared by identity to tell a new array\n // from an in-place edit. Wrapped in a raw holder so Vue does not proxy the app's array.\n lastData: markRaw({ value: undefined as unknown }),\n },\n columnSettings: null as HotTableProps[] | null,\n columnsCache: new Map<VNode, HotTableProps>(),\n columnsRefreshScheduled: false,\n get hotInstance(): Handsontable | null {\n if (!this.__hotInstance || (this.__hotInstance && !this.__hotInstance.isDestroyed)) {\n\n // Will return the Handsontable instance or `null` if it's not yet been created.\n return this.__hotInstance;\n\n } else {\n /* eslint-disable-next-line no-console */\n console.warn(HOT_DESTROYED_WARNING);\n\n return null;\n }\n },\n set hotInstance(hotInstance: Handsontable | null) {\n this.__hotInstance = hotInstance;\n },\n };\n },\n methods: {\n /**\n * Get the id used when the `id` prop is not passed. It is created once per instance.\n *\n * @returns {string} The generated container id.\n */\n getGeneratedId(): string {\n if (!this.miscCache.generatedId) {\n this.miscCache.generatedId = generateContainerId();\n }\n\n return this.miscCache.generatedId;\n },\n\n /**\n * Initialize Handsontable.\n */\n hotInit() {\n const newSettings = prepareSettings(this.$props);\n\n newSettings.columns = this.columnSettings ? this.columnSettings : newSettings.columns;\n\n this.hotInstance = markRaw<Handsontable>(new Handsontable.Core(this.$el, newSettings));\n\n // Recorded before `init()`, so a value the app sets in `afterInit` counts as an override of the prop.\n recordSettingBaselines(this.miscCache.baselines, this.$props, this.hotInstance.getSettings());\n\n this.hotInstance.init();\n\n this.miscCache.currentSourceColumns = this.hotInstance.countSourceCols();\n this.miscCache.hookKeys = getPassedHookKeys(this.$props);\n this.miscCache.lastData.value = toRaw(newSettings.data);\n },\n\n matchHotMappersSize(): void {\n if (!this.hotInstance) {\n return;\n }\n\n const data: Handsontable.CellValue[][] = this.hotInstance.getSourceData();\n const rowsToRemove: number[] = [];\n const columnsToRemove: number[] = [];\n const indexMapperRowCount = this.hotInstance.rowIndexMapper.getNumberOfIndexes();\n const isColumnModificationAllowed = this.hotInstance.isColumnModificationAllowed();\n let indexMapperColumnCount = 0;\n\n if (data && data.length !== indexMapperRowCount) {\n if (data.length < indexMapperRowCount) {\n for (let r = data.length; r < indexMapperRowCount; r++) {\n rowsToRemove.push(r);\n }\n }\n }\n\n if (isColumnModificationAllowed) {\n indexMapperColumnCount = this.hotInstance.columnIndexMapper.getNumberOfIndexes();\n\n if (data && data[0] && data[0]?.length !== indexMapperColumnCount) {\n if (data[0].length < indexMapperColumnCount) {\n for (let c = data[0].length; c < indexMapperColumnCount; c++) {\n columnsToRemove.push(c);\n }\n }\n }\n }\n\n this.hotInstance.batch(() => {\n if (rowsToRemove.length > 0) {\n this.hotInstance.rowIndexMapper.removeIndexes(rowsToRemove);\n\n } else {\n this.hotInstance.rowIndexMapper\n .insertIndexes(indexMapperRowCount - 1, data.length - indexMapperRowCount);\n }\n\n if (isColumnModificationAllowed && data.length !== 0) {\n if (columnsToRemove.length > 0) {\n this.hotInstance.columnIndexMapper.removeIndexes(columnsToRemove);\n\n } else {\n this.hotInstance.columnIndexMapper\n .insertIndexes(indexMapperColumnCount - 1, data[0].length - indexMapperColumnCount);\n }\n }\n });\n },\n\n /**\n * Get settings for the columns provided in the `hot-column` components.\n *\n * The columns are ordered by the document position of each `hot-column`'s\n * anchor node, not by the `columnsCache` insertion order. This keeps the\n * order correct when columns are inserted in the middle, removed, or\n * reordered, and when a `hot-column` is nested inside a wrapper component.\n *\n * @returns {HotTableProps[] | undefined}\n */\n getColumnSettings(): HotTableProps[] | void {\n const orderedColumns = Array.from(this.columnsCache.entries())\n .sort(([columnA], [columnB]) => {\n const anchorA = (columnA as { $el?: Node }).$el;\n const anchorB = (columnB as { $el?: Node }).$el;\n\n if (!anchorA || !anchorB) {\n return 0;\n }\n\n const position = anchorA.compareDocumentPosition(anchorB);\n\n // eslint-disable-next-line no-bitwise\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n\n // eslint-disable-next-line no-bitwise\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n\n return 0;\n })\n .map(([, columnSettings]) => columnSettings);\n\n return orderedColumns.length ? orderedColumns : undefined;\n },\n\n /**\n * Re-read the column settings declared by `hot-column` children and push them\n * to the Handsontable instance. Called by children on mount, prop change, and\n * unmount, and by the parent on reorder. Multiple notifications in the same\n * tick are coalesced into a single `updateSettings` call.\n */\n refreshColumns(): void {\n if (this.columnsRefreshScheduled) {\n return;\n }\n\n this.columnsRefreshScheduled = true;\n\n this.$nextTick(() => {\n this.columnsRefreshScheduled = false;\n\n if (!this.hotInstance) {\n return;\n }\n\n const newColumnSettings = this.getColumnSettings();\n const previousColumnSettings = this.columnSettings;\n\n // Each `hot-column` rebuilds its settings object whenever its props change,\n // so an unchanged column keeps the same object reference. Comparing the\n // arrays by reference and order is cheaper than a deep compare and avoids\n // an `updateSettings` call on unrelated re-renders (e.g. data-only updates).\n const isUnchanged =\n (!previousColumnSettings && !newColumnSettings) ||\n (!!previousColumnSettings && !!newColumnSettings &&\n previousColumnSettings.length === newColumnSettings.length &&\n previousColumnSettings.every((settings, index) => settings === newColumnSettings[index]));\n\n if (isUnchanged) {\n return;\n }\n\n this.columnSettings = newColumnSettings || null;\n this.hotInstance.updateSettings({ columns: newColumnSettings || undefined });\n });\n },\n },\n mounted() {\n // The auto-generated id is set here, on the client only, and not through a prop default or reactive\n // data: an id created on the server never matches the browser's, which breaks hydration, and a\n // reactive id would re-render every `HotTable` right after mounting.\n if (!this.id) {\n this.$el.id = this.getGeneratedId();\n }\n\n this.columnSettings = this.getColumnSettings();\n this.hotInit();\n },\n updated() {\n // Reordering keyed `hot-column` children reuses their instances and fires no\n // child lifecycle hook, so the children cannot notify on their own. The slot\n // vnodes do change, which re-renders `HotTable` - refresh from here to cover\n // reorders (coalesced with any child-triggered refresh).\n this.refreshColumns();\n },\n beforeUnmount() {\n if (this.hotInstance) {\n this.hotInstance.destroy();\n }\n },\n version: (packageJson as unknown as { version: string }).version,\n});\n\nexport default HotTable;\nexport { HotTable };\n</script>\n","<script lang=\"ts\">\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { defineComponent, createCommentVNode } from 'vue';\n// TODO: The line above is ts-ignored because rollup-plugin-typescript2 throws an error otherwise.\n// It's most probably caused by outdated rollup-plugin-vue which is no longer maintained.\n\nimport {\n propFactory,\n filterPassedProps\n} from './helpers';\n\nconst HotColumn = defineComponent({\n name: 'HotColumn',\n props: propFactory('HotColumn'),\n inject: ['columnsCache', 'refreshColumns'],\n methods: {\n /**\n * Create the column settings based on the data provided to the `hot-column`\n * component and it's child components.\n */\n createColumnSettings(): void {\n const assignedProps = filterPassedProps(this.$props);\n const columnSettings = { ...assignedProps };\n\n if (assignedProps.renderer) {\n columnSettings.renderer = assignedProps.renderer;\n }\n\n if (assignedProps.editor) {\n columnSettings.editor = assignedProps.editor;\n }\n\n this.columnsCache.set(this, columnSettings);\n }\n },\n watch: {\n $props: {\n handler() {\n this.createColumnSettings();\n this.refreshColumns();\n },\n deep: true,\n },\n },\n mounted() {\n this.createColumnSettings();\n this.refreshColumns();\n },\n unmounted() {\n this.columnsCache.delete(this);\n this.refreshColumns();\n },\n render() {\n // Render an (invisible) comment anchor instead of nothing, so the parent\n // `HotTable` can order columns by the anchors' document position. This keeps\n // ordering correct for dynamic inserts, removals, and reorders - and works\n // regardless of how deeply the `hot-column` is nested inside wrapper\n // components - because `provide`/`inject` and the anchor both cross nesting.\n return createCommentVNode('hot-column');\n }\n});\n\nexport default HotColumn;\nexport { HotColumn };\n</script>\n"],"names":["unassignedPropSymbol","Symbol","hasOwnProperty","object","key","Object","prototype","call","propFactory","source","registeredHooks","Handsontable","hooks","getRegistered","propSchema","prop","assign","DefaultSettings","default","i","length","handsontable","settings","getValue","id","type","String","filterPassedProps","props","filteredProps","columnSettingsProp","propName","getPassedHookKeys","passedProps","keys","filter","Array","isArray","isRegistered","isDeprecated","isLiteralObject","value","toString","getPrototypeOf","copySettingsValue","copies","arguments","undefined","WeakMap","raw","toRaw","has","get","arrayCopy","set","forEach","item","push","objectCopy","isSameAsCopy","copied","visited","RegExp","flags","copiedObject","rawObject","comparedWith","add","WeakSet","every","BASELINE_EXEMPT_KEYS","REFERENCE_ONLY_KEYS","isOverriddenByApp","propValue","currentSettings","baselines","baseline","includes","is","live","isSameReference","copy","recordSettingBaselines","overriddenKeys","prepareSettings","previousHookKeys","assignedProps","hotSettingsInProps","additionalHotSettingsInProps","initOnlySettingKeys","_initOnlySettings","newSettings","isOverridden","overridden","isEqualSetting","passedHookKeys","currentValue","newValue","haveEqualOwnKeys","valueA","valueB","keyValueA","keyValueB","isShallowEqualByReference","theme","objectA","objectB","identityMap","nextIdentityId","stringifyToJSON","val","seen","JSON","stringify","_typeof","Node","concat","e","simpleEqual","isEqualValue","rawA","rawB","isPlainObject","keysA","keysB","HotTable","defineComponent","name","provide","columnsCache","this","refreshColumns","watch","handler","$el","getGeneratedId","flush","$props","hotInstance","getSettings","miscCache","hookKeys","hasData","data","incomingData","isNewData","lastData","isColumnModificationAllowed","countSourceCols","currentSourceColumns","matchHotMappersSize","updateSettings","render","deep","immediate","__hotInstance","generatedId","markRaw","columnSettings","Map","columnsRefreshScheduled","isDestroyed","console","warn","methods","buffer","Uint16Array","globalThis","crypto","getRandomValues","from","padStart","join","hotInit","columns","Core","init","_this","_data$","getSourceData","rowsToRemove","columnsToRemove","indexMapperRowCount","rowIndexMapper","getNumberOfIndexes","indexMapperColumnCount","r","columnIndexMapper","c","batch","removeIndexes","insertIndexes","getColumnSettings","orderedColumns","entries","sort","_ref","_ref2","columnA","_slicedToArray","_ref4","anchorA","anchorB","position","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_PRECEDING","map","_ref5","_this2","$nextTick","newColumnSettings","previousColumnSettings","index","mounted","updated","beforeUnmount","destroy","version","_createElementBlock","_ctx","style","height","_createCommentVNode","_renderSlot","$slots","HotColumn","inject","createColumnSettings","_objectSpread","renderer","editor","unmounted","createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;i0EAIA,IAAMA,EAAuBC,OAAO,cA0D7B,SAASC,EAAeC,EAAiBC,GAC9C,OAAOC,OAAOC,UAAUJ,eAAeK,KAAKJ,EAAQC,EACtD,CAgBO,SAASI,EAAYC,GAC1B,IAAMC,EAAkBC,EAAAA,QAAaC,MAAMC,gBACrCC,EAAsC,CAAA,EAK5C,IAAK,IAAMC,KAHXV,OAAOW,OAAOF,EAAYH,EAAAA,QAAaM,iBAGpBH,EACjBA,EAAWC,GAAQ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AA,8CCMhB,IAAMC,EAAYpG,EAAAA,gBAAgB,CAChCC,KAAM,YACNnG,MAAOpB,EAAY,aACnB2N,OAAQ,CAAC,eAAgB,kBACzB/D,QAAS,CAKPgE,qBAAoB,WAClB,IAAM9I,EAAgB3D,EAAkBuG,KAAKO,QACvCqB,6VAAauE,CAAA,CAAA,EAAS/I,GAExBA,EAAcgJ,WAChBxE,EAAewE,SAAWhJ,EAAcgJ,UAGtChJ,EAAciJ,SAChBzE,EAAeyE,OAASjJ,EAAciJ,QAGxCrG,KAAKD,aAAa3E,IAAI4E,KAAM4B,EAC9B,GAEF1B,MAAO,CACLK,OAAQ,CACNJ,QAAO,WACLH,KAAKkG,uBACLlG,KAAKC,gBACP,EACAsB,MAAM,IAGV6D,QAAO,WACLpF,KAAKkG,uBACLlG,KAAKC,gBACP,EACAqG,UAAS,WACPtG,KAAKD,aAAY,OAAQC,MACzBA,KAAKC,gBACP,EACAqB,OAAM,WAMJ,OAAOiF,EAAAA,mBAAmB,aAC5B"}
|
package/es/vue-handsontable.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@handsontable/vue3",
|
|
3
|
-
"version": "19.0.0-
|
|
3
|
+
"version": "19.0.0-rc10",
|
|
4
4
|
"description": "Handsontable DataGrid for Vue with a spreadsheet look and feel.",
|
|
5
5
|
"author": "Handsoncode <hello@handsoncode.net> (https://handsoncode.net)",
|
|
6
6
|
"homepage": "https://handsontable.com",
|