@tanstack/vue-table 8.11.2 → 8.11.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Tanner Linsley
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -9,5 +9,5 @@ export declare const FlexRender: import("vue").DefineComponent<Readonly<{
9
9
  }>>>, {
10
10
  readonly props?: any;
11
11
  readonly render?: any;
12
- }, {}>;
12
+ }>;
13
13
  export declare function useVueTable<TData extends RowData>(options: TableOptions<TData>): import("@tanstack/table-core").Table<TData>;
@@ -1,13 +1,13 @@
1
1
  /**
2
- * vue-table
3
- *
4
- * Copyright (c) TanStack
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
2
+ * vue-table
3
+ *
4
+ * Copyright (c) TanStack
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
11
  import { createTable } from '@tanstack/table-core';
12
12
  export * from '@tanstack/table-core';
13
13
  import { defineComponent, h, ref, watchEffect } from 'vue';
@@ -1,17 +1,15 @@
1
1
  /**
2
- * vue-table
3
- *
4
- * Copyright (c) TanStack
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
2
+ * vue-table
3
+ *
4
+ * Copyright (c) TanStack
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
11
  'use strict';
12
12
 
13
- Object.defineProperty(exports, '__esModule', { value: true });
14
-
15
13
  var tableCore = require('@tanstack/table-core');
16
14
  var vue = require('vue');
17
15
  var mergeProxy = require('./merge-proxy.js');
@@ -71,7 +69,7 @@ function useVueTable(options) {
71
69
  exports.FlexRender = FlexRender;
72
70
  exports.useVueTable = useVueTable;
73
71
  Object.keys(tableCore).forEach(function (k) {
74
- if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
72
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
75
73
  enumerable: true,
76
74
  get: function () { return tableCore[k]; }
77
75
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n TableOptions,\n createTable,\n TableOptionsResolved,\n RowData,\n} from '@tanstack/table-core'\nimport { h, watchEffect, ref, defineComponent } from 'vue'\nimport { mergeProxy } from './merge-proxy'\n\nexport * from '@tanstack/table-core'\n\nexport const FlexRender = defineComponent({\n props: ['render', 'props'],\n setup: (props: { render: any; props: any }) => {\n return () => {\n if (\n typeof props.render === 'function' ||\n typeof props.render === 'object'\n ) {\n return h(props.render, props.props)\n }\n\n return props.render\n }\n },\n})\n\nexport function useVueTable<TData extends RowData>(\n options: TableOptions<TData>\n) {\n const resolvedOptions: TableOptionsResolved<TData> = mergeProxy(\n {\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n renderFallbackValue: null,\n mergeOptions(\n defaultOptions: TableOptions<TData>,\n options: TableOptions<TData>\n ) {\n return mergeProxy(defaultOptions, options)\n },\n },\n options\n )\n\n const table = createTable<TData>(resolvedOptions)\n // can't use `reactive` because update needs to be immutable\n const state = ref(table.initialState)\n\n watchEffect(() => {\n table.setOptions(prev => {\n const stateProxy = new Proxy({} as typeof state.value, {\n get: (_, prop) => state.value[prop as keyof typeof state.value],\n })\n\n return mergeProxy(prev, options, {\n // merge the initialState and `options.state`\n // create a new proxy on each `setOptions` call\n // and get the value from state on each property access\n state: mergeProxy(stateProxy, options.state ?? {}),\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: (updater: any) => {\n if (updater instanceof Function) {\n state.value = updater(state.value)\n } else {\n state.value = updater\n }\n\n options.onStateChange?.(updater)\n },\n })\n })\n })\n\n return table\n}\n"],"names":["FlexRender","defineComponent","props","setup","render","h","useVueTable","options","resolvedOptions","mergeProxy","state","onStateChange","renderFallbackValue","mergeOptions","defaultOptions","table","createTable","ref","initialState","watchEffect","setOptions","prev","_options$state","stateProxy","Proxy","get","_","prop","value","updater","Function"],"mappings":";;;;;;;;;;;;;;;;;;AAWaA,MAAAA,UAAU,GAAGC,mBAAe,CAAC;AACxCC,EAAAA,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;EAC1BC,KAAK,EAAGD,KAAkC,IAAK;AAC7C,IAAA,OAAO,MAAM;AACX,MAAA,IACE,OAAOA,KAAK,CAACE,MAAM,KAAK,UAAU,IAClC,OAAOF,KAAK,CAACE,MAAM,KAAK,QAAQ,EAChC;QACA,OAAOC,KAAC,CAACH,KAAK,CAACE,MAAM,EAAEF,KAAK,CAACA,KAAK,CAAC,CAAA;AACrC,OAAA;MAE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AACpC,WAAC,MAAM;YACLlB,KAAK,CAACkB,KAAK,GAAGC,OAAO,CAAA;AACvB,WAAA;UAEAtB,OAAO,CAACI,aAAa,IAArBJ,IAAAA,IAAAA,OAAO,CAACI,aAAa,CAAGkB,OAAO,CAAC,CAAA;AAClC,SAAA;AACF,OAAC,CAAC,CAAA;AACJ,KAAC,CAAC,CAAA;AACJ,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOd,KAAK,CAAA;AACd;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n TableOptions,\n createTable,\n TableOptionsResolved,\n RowData,\n} from '@tanstack/table-core'\nimport { h, watchEffect, ref, defineComponent } from 'vue'\nimport { mergeProxy } from './merge-proxy'\n\nexport * from '@tanstack/table-core'\n\nexport const FlexRender = defineComponent({\n props: ['render', 'props'],\n setup: (props: { render: any; props: any }) => {\n return () => {\n if (\n typeof props.render === 'function' ||\n typeof props.render === 'object'\n ) {\n return h(props.render, props.props)\n }\n\n return props.render\n }\n },\n})\n\nexport function useVueTable<TData extends RowData>(\n options: TableOptions<TData>\n) {\n const resolvedOptions: TableOptionsResolved<TData> = mergeProxy(\n {\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n renderFallbackValue: null,\n mergeOptions(\n defaultOptions: TableOptions<TData>,\n options: TableOptions<TData>\n ) {\n return mergeProxy(defaultOptions, options)\n },\n },\n options\n )\n\n const table = createTable<TData>(resolvedOptions)\n // can't use `reactive` because update needs to be immutable\n const state = ref(table.initialState)\n\n watchEffect(() => {\n table.setOptions(prev => {\n const stateProxy = new Proxy({} as typeof state.value, {\n get: (_, prop) => state.value[prop as keyof typeof state.value],\n })\n\n return mergeProxy(prev, options, {\n // merge the initialState and `options.state`\n // create a new proxy on each `setOptions` call\n // and get the value from state on each property access\n state: mergeProxy(stateProxy, options.state ?? {}),\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: (updater: any) => {\n if (updater instanceof Function) {\n state.value = updater(state.value)\n } else {\n state.value = updater\n }\n\n options.onStateChange?.(updater)\n },\n })\n })\n })\n\n return table\n}\n"],"names":["FlexRender","defineComponent","props","setup","render","h","useVueTable","options","resolvedOptions","mergeProxy","state","onStateChange","renderFallbackValue","mergeOptions","defaultOptions","table","createTable","ref","initialState","watchEffect","setOptions","prev","_options$state","stateProxy","Proxy","get","_","prop","value","updater","Function"],"mappings":";;;;;;;;;;;;;;;;AAWaA,MAAAA,UAAU,GAAGC,mBAAe,CAAC;AACxCC,EAAAA,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;EAC1BC,KAAK,EAAGD,KAAkC,IAAK;AAC7C,IAAA,OAAO,MAAM;AACX,MAAA,IACE,OAAOA,KAAK,CAACE,MAAM,KAAK,UAAU,IAClC,OAAOF,KAAK,CAACE,MAAM,KAAK,QAAQ,EAChC;QACA,OAAOC,KAAC,CAACH,KAAK,CAACE,MAAM,EAAEF,KAAK,CAACA,KAAK,CAAC,CAAA;AACrC,OAAA;MAEA,OAAOA,KAAK,CAACE,MAAM,CAAA;KACpB,CAAA;AACH,GAAA;AACF,CAAC,EAAC;AAEK,SAASE,WAAWA,CACzBC,OAA4B,EAC5B;EACA,MAAMC,eAA4C,GAAGC,qBAAU,CAC7D;IACEC,KAAK,EAAE,EAAE;AAAE;AACXC,IAAAA,aAAa,EAAEA,MAAM,EAAE;AAAE;AACzBC,IAAAA,mBAAmB,EAAE,IAAI;AACzBC,IAAAA,YAAYA,CACVC,cAAmC,EACnCP,OAA4B,EAC5B;AACA,MAAA,OAAOE,qBAAU,CAACK,cAAc,EAAEP,OAAO,CAAC,CAAA;AAC5C,KAAA;GACD,EACDA,OACF,CAAC,CAAA;AAED,EAAA,MAAMQ,KAAK,GAAGC,qBAAW,CAAQR,eAAe,CAAC,CAAA;AACjD;AACA,EAAA,MAAME,KAAK,GAAGO,OAAG,CAACF,KAAK,CAACG,YAAY,CAAC,CAAA;AAErCC,EAAAA,eAAW,CAAC,MAAM;AAChBJ,IAAAA,KAAK,CAACK,UAAU,CAACC,IAAI,IAAI;AAAA,MAAA,IAAAC,cAAA,CAAA;AACvB,MAAA,MAAMC,UAAU,GAAG,IAAIC,KAAK,CAAC,EAAE,EAAwB;QACrDC,GAAG,EAAEA,CAACC,CAAC,EAAEC,IAAI,KAAKjB,KAAK,CAACkB,KAAK,CAACD,IAAI,CAAA;AACpC,OAAC,CAAC,CAAA;AAEF,MAAA,OAAOlB,qBAAU,CAACY,IAAI,EAAEd,OAAO,EAAE;AAC/B;AACA;AACA;AACAG,QAAAA,KAAK,EAAED,qBAAU,CAACc,UAAU,GAAAD,cAAA,GAAEf,OAAO,CAACG,KAAK,KAAAY,IAAAA,GAAAA,cAAA,GAAI,EAAE,CAAC;AAClD;AACA;QACAX,aAAa,EAAGkB,OAAY,IAAK;UAC/B,IAAIA,OAAO,YAAYC,QAAQ,EAAE;YAC/BpB,KAAK,CAACkB,KAAK,GAAGC,OAAO,CAACnB,KAAK,CAACkB,KAAK,CAAC,CAAA;AACpC,WAAC,MAAM;YACLlB,KAAK,CAACkB,KAAK,GAAGC,OAAO,CAAA;AACvB,WAAA;UAEAtB,OAAO,CAACI,aAAa,IAArBJ,IAAAA,IAAAA,OAAO,CAACI,aAAa,CAAGkB,OAAO,CAAC,CAAA;AAClC,SAAA;AACF,OAAC,CAAC,CAAA;AACJ,KAAC,CAAC,CAAA;AACJ,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOd,KAAK,CAAA;AACd;;;;;;;;;;;"}
@@ -1,13 +1,13 @@
1
1
  /**
2
- * vue-table
3
- *
4
- * Copyright (c) TanStack
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
2
+ * vue-table
3
+ *
4
+ * Copyright (c) TanStack
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
11
  import { createTable } from '@tanstack/table-core';
12
12
  export * from '@tanstack/table-core';
13
13
  import { defineComponent, h, ref, watchEffect } from 'vue';
@@ -1,17 +1,15 @@
1
1
  /**
2
- * vue-table
3
- *
4
- * Copyright (c) TanStack
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
2
+ * vue-table
3
+ *
4
+ * Copyright (c) TanStack
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
11
  'use strict';
12
12
 
13
- Object.defineProperty(exports, '__esModule', { value: true });
14
-
15
13
  function trueFn() {
16
14
  return true;
17
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"merge-proxy.js","sources":["../../src/merge-proxy.ts"],"sourcesContent":["function trueFn() {\n return true\n}\n\nexport const $PROXY = Symbol('merge-proxy')\n\n// https://github.com/solidjs/solid/blob/c20ca4fd8c36bc0522fedb2c7f38a110b7ee2663/packages/solid/src/render/component.ts#L51-L118\nconst propTraps: ProxyHandler<{\n get: (k: string | number | symbol) => any\n has: (k: string | number | symbol) => boolean\n keys: () => string[]\n}> = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver\n return _.get(property)\n },\n has(_, property) {\n return _.has(property)\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property)\n },\n set: trueFn,\n deleteProperty: trueFn,\n }\n },\n ownKeys(_) {\n return _.keys()\n },\n}\n\ntype UnboxLazy<T> = T extends () => infer U ? U : T\ntype BoxedTupleTypes<T extends any[]> = {\n [P in keyof T]: [UnboxLazy<T[P]>]\n}[Exclude<keyof T, keyof any[]>]\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (\n k: infer I\n) => void\n ? I\n : never\ntype UnboxIntersection<T> = T extends { 0: infer U } ? U : never\ntype MergeProxy<T extends any[]> = UnboxIntersection<\n UnionToIntersection<BoxedTupleTypes<T>>\n>\n\nfunction resolveSource(s: any) {\n return 'value' in s ? s.value : s\n}\n\nexport function mergeProxy<T extends any[]>(...sources: T): MergeProxy<T>\nexport function mergeProxy(...sources: any): any {\n return new Proxy(\n {\n get(property: string | number | symbol) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property]\n if (v !== undefined) return v\n }\n },\n has(property: string | number | symbol) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true\n }\n return false\n },\n keys() {\n const keys = []\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])))\n return [...Array.from(new Set(keys))]\n },\n },\n propTraps\n )\n}\n"],"names":["trueFn","$PROXY","Symbol","propTraps","get","_","property","receiver","has","set","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","keys","resolveSource","s","value","mergeProxy","_len","arguments","length","sources","Array","_key","Proxy","i","v","undefined","push","Object","from","Set"],"mappings":";;;;;;;;;;;;;;AAAA,SAASA,MAAMA,GAAG;AAChB,EAAA,OAAO,IAAI,CAAA;AACb,CAAA;MAEaC,MAAM,GAAGC,MAAM,CAAC,aAAa,EAAC;;AAE3C;AACA,MAAMC,SAIJ,GAAG;AACHC,EAAAA,GAAGA,CAACC,CAAC,EAAEC,QAAQ,EAAEC,QAAQ,EAAE;AACzB,IAAA,IAAID,QAAQ,KAAKL,MAAM,EAAE,OAAOM,QAAQ,CAAA;AACxC,IAAA,OAAOF,CAAC,CAACD,GAAG,CAACE,QAAQ,CAAC,CAAA;GACvB;AACDE,EAAAA,GAAGA,CAACH,CAAC,EAAEC,QAAQ,EAAE;AACf,IAAA,OAAOD,CAAC,CAACG,GAAG,CAACF,QAAQ,CAAC,CAAA;GACvB;AACDG,EAAAA,GAAG,EAAET,MAAM;AACXU,EAAAA,cAAc,EAAEV,MAAM;AACtBW,EAAAA,wBAAwBA,CAACN,CAAC,EAAEC,QAA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AC,GAAGJ,OAAO,CAACD,MAAM,GAAG,CAAC,EAAEK,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;QAC5C,IAAIrB,QAAQ,IAAIU,aAAa,CAACO,OAAO,CAACI,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAA;AACxD,OAAA;AACA,MAAA,OAAO,KAAK,CAAA;KACb;AACDZ,IAAAA,IAAIA,GAAG;MACL,MAAMA,IAAI,GAAG,EAAE,CAAA;AACf,MAAA,KAAK,IAAIY,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,OAAO,CAACD,MAAM,EAAEK,CAAC,EAAE,EACrCZ,IAAI,CAACe,IAAI,CAAC,GAAGC,MAAM,CAAChB,IAAI,CAACC,aAAa,CAACO,OAAO,CAACI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACtD,MAAA,OAAO,CAAC,GAAGH,KAAK,CAACQ,IAAI,CAAC,IAAIC,GAAG,CAAClB,IAAI,CAAC,CAAC,CAAC,CAAA;AACvC,KAAA;GACD,EACDZ,SACF,CAAC,CAAA;AACH;;;;;"}
1
+ {"version":3,"file":"merge-proxy.js","sources":["../../src/merge-proxy.ts"],"sourcesContent":["function trueFn() {\n return true\n}\n\nexport const $PROXY = Symbol('merge-proxy')\n\n// https://github.com/solidjs/solid/blob/c20ca4fd8c36bc0522fedb2c7f38a110b7ee2663/packages/solid/src/render/component.ts#L51-L118\nconst propTraps: ProxyHandler<{\n get: (k: string | number | symbol) => any\n has: (k: string | number | symbol) => boolean\n keys: () => string[]\n}> = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver\n return _.get(property)\n },\n has(_, property) {\n return _.has(property)\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property)\n },\n set: trueFn,\n deleteProperty: trueFn,\n }\n },\n ownKeys(_) {\n return _.keys()\n },\n}\n\ntype UnboxLazy<T> = T extends () => infer U ? U : T\ntype BoxedTupleTypes<T extends any[]> = {\n [P in keyof T]: [UnboxLazy<T[P]>]\n}[Exclude<keyof T, keyof any[]>]\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (\n k: infer I\n) => void\n ? I\n : never\ntype UnboxIntersection<T> = T extends { 0: infer U } ? U : never\ntype MergeProxy<T extends any[]> = UnboxIntersection<\n UnionToIntersection<BoxedTupleTypes<T>>\n>\n\nfunction resolveSource(s: any) {\n return 'value' in s ? s.value : s\n}\n\nexport function mergeProxy<T extends any[]>(...sources: T): MergeProxy<T>\nexport function mergeProxy(...sources: any): any {\n return new Proxy(\n {\n get(property: string | number | symbol) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property]\n if (v !== undefined) return v\n }\n },\n has(property: string | number | symbol) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true\n }\n return false\n },\n keys() {\n const keys = []\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])))\n return [...Array.from(new Set(keys))]\n },\n },\n propTraps\n )\n}\n"],"names":["trueFn","$PROXY","Symbol","propTraps","get","_","property","receiver","has","set","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","keys","resolveSource","s","value","mergeProxy","_len","arguments","length","sources","Array","_key","Proxy","i","v","undefined","push","Object","from","Set"],"mappings":";;;;;;;;;;;;AAAA,SAASA,MAAMA,GAAG;AAChB,EAAA,OAAO,IAAI,CAAA;AACb,CAAA;MAEaC,MAAM,GAAGC,MAAM,CAAC,aAAa,EAAC;;AAE3C;AACA,MAAMC,SAIJ,GAAG;AACHC,EAAAA,GAAGA,CAACC,CAAC,EAAEC,QAAQ,EAAEC,QAAQ,EAAE;AACzB,IAAA,IAAID,QAAQ,KAAKL,MAAM,EAAE,OAAOM,QAAQ,CAAA;AACxC,IAAA,OAAOF,CAAC,CAACD,GAAG,CAACE,QAAQ,CAAC,CAAA;GACvB;AACDE,E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GAAGZ,aAAa,CAACO,OAAO,CAACI,CAAC,CAAC,CAAC,CAACrB,QAAQ,CAAC,CAAA;AAC7C,QAAA,IAAIsB,CAAC,KAAKC,SAAS,EAAE,OAAOD,CAAC,CAAA;AAC/B,OAAA;KACD;IACDpB,GAAGA,CAACF,QAAkC,EAAE;AACtC,MAAA,KAAK,IAAIqB,CAAC,GAAGJ,OAAO,CAACD,MAAM,GAAG,CAAC,EAAEK,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;QAC5C,IAAIrB,QAAQ,IAAIU,aAAa,CAACO,OAAO,CAACI,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAA;AACxD,OAAA;AACA,MAAA,OAAO,KAAK,CAAA;KACb;AACDZ,IAAAA,IAAIA,GAAG;MACL,MAAMA,IAAI,GAAG,EAAE,CAAA;AACf,MAAA,KAAK,IAAIY,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,OAAO,CAACD,MAAM,EAAEK,CAAC,EAAE,EACrCZ,IAAI,CAACe,IAAI,CAAC,GAAGC,MAAM,CAAChB,IAAI,CAACC,aAAa,CAACO,OAAO,CAACI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACtD,MAAA,OAAO,CAAC,GAAGH,KAAK,CAACQ,IAAI,CAAC,IAAIC,GAAG,CAAClB,IAAI,CAAC,CAAC,CAAC,CAAA;AACvC,KAAA;GACD,EACDZ,SACF,CAAC,CAAA;AACH;;;;;"}
@@ -1,21 +1,5 @@
1
1
  /**
2
- * vue-table
3
- *
4
- * Copyright (c) TanStack
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
- (function (global, factory) {
12
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
13
- typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
14
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.VueTable = {}, global.Vue));
15
- })(this, (function (exports, vue) { 'use strict';
16
-
17
- /**
18
- * table-core
2
+ * vue-table
19
3
  *
20
4
  * Copyright (c) TanStack
21
5
  *
@@ -24,6 +8,22 @@
24
8
  *
25
9
  * @license MIT
26
10
  */
11
+ (function (global, factory) {
12
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
13
+ typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
14
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.VueTable = {}, global.Vue));
15
+ })(this, (function (exports, vue) { 'use strict';
16
+
17
+ /**
18
+ * table-core
19
+ *
20
+ * Copyright (c) TanStack
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE.md file in the root directory of this source tree.
24
+ *
25
+ * @license MIT
26
+ */
27
27
  // Is this type a tuple?
28
28
 
29
29
  // If this type is a tuple, what indices are allowed?
@@ -616,7 +616,10 @@
616
616
  }
617
617
  return 0;
618
618
  };
619
- header.getResizeHandler = () => {
619
+ header.getResizeHandler = function (contextDocument) {
620
+ if (contextDocument === void 0) {
621
+ contextDocument = document;
622
+ }
620
623
  const column = table.getColumn(header.column.id);
621
624
  const canResize = column == null ? void 0 : column.getCanResize();
622
625
  return e => {
@@ -676,8 +679,8 @@
676
679
  const mouseEvents = {
677
680
  moveHandler: e => onMove(e.clientX),
678
681
  upHandler: e => {
679
- document.removeEventListener('mousemove', mouseEvents.moveHandler);
680
- document.removeEventListener('mouseup', mouseEvents.upHandler);
682
+ contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);
683
+ contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);
681
684
  onEnd(e.clientX);
682
685
  }
683
686
  };
@@ -692,8 +695,8 @@
692
695
  },
693
696
  upHandler: e => {
694
697
  var _e$touches$;
695
- document.removeEventListener('touchmove', touchEvents.moveHandler);
696
- document.removeEventListener('touchend', touchEvents.upHandler);
698
+ contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);
699
+ contextDocument.removeEventListener('touchend', touchEvents.upHandler);
697
700
  if (e.cancelable) {
698
701
  e.preventDefault();
699
702
  e.stopPropagation();
@@ -705,11 +708,11 @@
705
708
  passive: false
706
709
  } : false;
707
710
  if (isTouchStartEvent(e)) {
708
- document.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
709
- document.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
711
+ contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
712
+ contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
710
713
  } else {
711
- document.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
712
- document.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
714
+ contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
715
+ contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
713
716
  }
714
717
  table.setColumnSizingInfo(old => ({
715
718
  ...old,
@@ -2812,11 +2815,15 @@
2812
2815
  getRowModel: () => {
2813
2816
  return table.getPaginationRowModel();
2814
2817
  },
2818
+ //in next version, we should just pass in the row model as the optional 2nd arg
2815
2819
  getRow: (id, searchAll) => {
2816
- const row = (searchAll ? table.getCoreRowModel() : table.getRowModel()).rowsById[id];
2820
+ let row = (searchAll ? table.getPrePaginationRowModel() : table.getRowModel()).rowsById[id];
2817
2821
  if (!row) {
2818
- {
2819
- throw new Error(`getRow expected an ID, but got ${id}`);
2822
+ row = table.getCoreRowModel().rowsById[id];
2823
+ if (!row) {
2824
+ {
2825
+ throw new Error(`getRow could not find row with ID: ${id}`);
2826
+ }
2820
2827
  }
2821
2828
  }
2822
2829
  return row;
@@ -3912,7 +3919,5 @@
3912
3919
  exports.sortingFns = sortingFns;
3913
3920
  exports.useVueTable = useVueTable;
3914
3921
 
3915
- Object.defineProperty(exports, '__esModule', { value: true });
3916
-
3917
3922
  }));
3918
3923
  //# sourceMappingURL=index.development.js.map