@tanstack/vue-table 9.0.0-alpha.9 → 9.0.0-beta.2
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 +127 -0
- package/dist/FlexRender.cjs +80 -0
- package/dist/FlexRender.cjs.map +1 -0
- package/dist/FlexRender.d.cts +45 -0
- package/dist/FlexRender.d.ts +45 -0
- package/dist/FlexRender.js +79 -0
- package/dist/FlexRender.js.map +1 -0
- package/dist/createTableHook.cjs +234 -0
- package/dist/createTableHook.cjs.map +1 -0
- package/dist/createTableHook.d.cts +138 -0
- package/dist/createTableHook.d.ts +138 -0
- package/dist/createTableHook.js +233 -0
- package/dist/createTableHook.js.map +1 -0
- package/dist/flex-render.cjs +5 -0
- package/dist/flex-render.d.cts +2 -0
- package/dist/flex-render.d.ts +2 -0
- package/dist/flex-render.js +3 -0
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -0
- package/dist/merge-proxy.cjs +77 -0
- package/dist/merge-proxy.cjs.map +1 -0
- package/dist/merge-proxy.js +75 -0
- package/dist/merge-proxy.js.map +1 -0
- package/dist/reactivity.cjs +73 -0
- package/dist/reactivity.cjs.map +1 -0
- package/dist/reactivity.js +73 -0
- package/dist/reactivity.js.map +1 -0
- package/dist/static-functions.cjs +9 -0
- package/dist/static-functions.d.cts +1 -0
- package/dist/static-functions.d.ts +1 -0
- package/dist/static-functions.js +3 -0
- package/dist/useTable.cjs +83 -0
- package/dist/useTable.cjs.map +1 -0
- package/dist/useTable.d.cts +76 -0
- package/dist/useTable.d.ts +76 -0
- package/dist/useTable.js +83 -0
- package/dist/useTable.js.map +1 -0
- package/package.json +31 -19
- package/skills/vue/client-to-server/SKILL.md +365 -0
- package/skills/vue/compose-with-tanstack-form/SKILL.md +369 -0
- package/skills/vue/compose-with-tanstack-pacer/SKILL.md +318 -0
- package/skills/vue/compose-with-tanstack-query/SKILL.md +385 -0
- package/skills/vue/compose-with-tanstack-store/SKILL.md +301 -0
- package/skills/vue/compose-with-tanstack-virtual/SKILL.md +340 -0
- package/skills/vue/getting-started/SKILL.md +409 -0
- package/skills/vue/migrate-v8-to-v9/SKILL.md +375 -0
- package/skills/vue/production-readiness/SKILL.md +271 -0
- package/skills/vue/table-state/SKILL.md +403 -0
- package/src/FlexRender.ts +123 -0
- package/src/createTableHook.ts +597 -0
- package/src/flex-render.ts +1 -0
- package/src/index.ts +3 -74
- package/src/merge-proxy.ts +66 -15
- package/src/reactivity.ts +115 -0
- package/src/static-functions.ts +1 -0
- package/src/useTable.ts +251 -0
- package/dist/cjs/index.cjs +0 -68
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/index.d.cts +0 -14
- package/dist/cjs/merge-proxy.cjs +0 -61
- package/dist/cjs/merge-proxy.cjs.map +0 -1
- package/dist/cjs/merge-proxy.d.cts +0 -11
- package/dist/esm/index.d.ts +0 -14
- package/dist/esm/index.js +0 -63
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/merge-proxy.d.ts +0 -11
- package/dist/esm/merge-proxy.js +0 -61
- package/dist/esm/merge-proxy.js.map +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_FlexRender = require('./FlexRender.cjs');
|
|
3
|
+
const require_useTable = require('./useTable.cjs');
|
|
4
|
+
const require_createTableHook = require('./createTableHook.cjs');
|
|
5
|
+
|
|
6
|
+
exports.AppFlexRender = require_createTableHook.AppFlexRender;
|
|
7
|
+
exports.FlexRender = require_FlexRender.FlexRender;
|
|
8
|
+
exports.createTableHook = require_createTableHook.createTableHook;
|
|
9
|
+
exports.flexRender = require_FlexRender.flexRender;
|
|
10
|
+
exports.useTable = require_useTable.useTable;
|
|
11
|
+
var _tanstack_table_core = require("@tanstack/table-core");
|
|
12
|
+
Object.keys(_tanstack_table_core).forEach(function (k) {
|
|
13
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return _tanstack_table_core[k]; }
|
|
16
|
+
});
|
|
17
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FlexRender, flexRender } from "./FlexRender.cjs";
|
|
2
|
+
import { SubscribeSource, TableOptionsWithReactiveData, VueTable, useTable } from "./useTable.cjs";
|
|
3
|
+
import { AppCellContext, AppCellProps, AppColumnDefBase, AppColumnDefTemplate, AppColumnHelper, AppDisplayColumnDef, AppFlexRender, AppGroupColumnDef, AppHeaderContext, AppHeaderProps, AppTableProps, AppVueTable, ComponentType, CreateTableHookOptions, createTableHook } from "./createTableHook.cjs";
|
|
4
|
+
export * from "@tanstack/table-core";
|
|
5
|
+
export { AppCellContext, AppCellProps, AppColumnDefBase, AppColumnDefTemplate, AppColumnHelper, AppDisplayColumnDef, AppFlexRender, AppGroupColumnDef, AppHeaderContext, AppHeaderProps, AppTableProps, AppVueTable, ComponentType, CreateTableHookOptions, FlexRender, SubscribeSource, TableOptionsWithReactiveData, VueTable, createTableHook, flexRender, useTable };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FlexRender, flexRender } from "./FlexRender.js";
|
|
2
|
+
import { SubscribeSource, TableOptionsWithReactiveData, VueTable, useTable } from "./useTable.js";
|
|
3
|
+
import { AppCellContext, AppCellProps, AppColumnDefBase, AppColumnDefTemplate, AppColumnHelper, AppDisplayColumnDef, AppFlexRender, AppGroupColumnDef, AppHeaderContext, AppHeaderProps, AppTableProps, AppVueTable, ComponentType, CreateTableHookOptions, createTableHook } from "./createTableHook.js";
|
|
4
|
+
export * from "@tanstack/table-core";
|
|
5
|
+
export { AppCellContext, AppCellProps, AppColumnDefBase, AppColumnDefTemplate, AppColumnHelper, AppDisplayColumnDef, AppFlexRender, AppGroupColumnDef, AppHeaderContext, AppHeaderProps, AppTableProps, AppVueTable, ComponentType, CreateTableHookOptions, FlexRender, SubscribeSource, TableOptionsWithReactiveData, VueTable, createTableHook, flexRender, useTable };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FlexRender, flexRender } from "./FlexRender.js";
|
|
2
|
+
import { useTable } from "./useTable.js";
|
|
3
|
+
import { AppFlexRender, createTableHook } from "./createTableHook.js";
|
|
4
|
+
|
|
5
|
+
export * from "@tanstack/table-core"
|
|
6
|
+
|
|
7
|
+
export { AppFlexRender, FlexRender, createTableHook, flexRender, useTable };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/merge-proxy.ts
|
|
3
|
+
function trueFn() {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
const $PROXY = Symbol("merge-proxy");
|
|
7
|
+
const $SOURCES = Symbol("merge-proxy-sources");
|
|
8
|
+
const propTraps = {
|
|
9
|
+
get(_, property, receiver) {
|
|
10
|
+
if (property === $PROXY) return receiver;
|
|
11
|
+
if (property === $SOURCES) return _.sources;
|
|
12
|
+
return _.get(property);
|
|
13
|
+
},
|
|
14
|
+
has(_, property) {
|
|
15
|
+
return _.has(property);
|
|
16
|
+
},
|
|
17
|
+
set: trueFn,
|
|
18
|
+
deleteProperty: trueFn,
|
|
19
|
+
getOwnPropertyDescriptor(_, property) {
|
|
20
|
+
return {
|
|
21
|
+
configurable: true,
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get() {
|
|
24
|
+
return _.get(property);
|
|
25
|
+
},
|
|
26
|
+
set: trueFn,
|
|
27
|
+
deleteProperty: trueFn
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
ownKeys(_) {
|
|
31
|
+
return _.keys();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function resolveSource(s) {
|
|
35
|
+
return s && typeof s === "object" && "value" in s ? s.value : s;
|
|
36
|
+
}
|
|
37
|
+
function mergeProxy(...sources) {
|
|
38
|
+
const flattenedSources = sources.flatMap((source) => {
|
|
39
|
+
if (typeof source === "object" && source !== null && $SOURCES in source && Array.isArray(source[$SOURCES])) return source[$SOURCES];
|
|
40
|
+
return [source];
|
|
41
|
+
});
|
|
42
|
+
return new Proxy({
|
|
43
|
+
sources: flattenedSources,
|
|
44
|
+
get(property) {
|
|
45
|
+
for (let i = flattenedSources.length - 1; i >= 0; i--) {
|
|
46
|
+
const v = resolveSource(flattenedSources[i])[property];
|
|
47
|
+
if (v !== void 0) return v;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
has(property) {
|
|
51
|
+
for (let i = flattenedSources.length - 1; i >= 0; i--) if (property in resolveSource(flattenedSources[i])) return true;
|
|
52
|
+
return false;
|
|
53
|
+
},
|
|
54
|
+
keys() {
|
|
55
|
+
const keys = [];
|
|
56
|
+
for (const source of flattenedSources) keys.push(...Object.keys(resolveSource(source)));
|
|
57
|
+
return [...Array.from(new Set(keys))];
|
|
58
|
+
}
|
|
59
|
+
}, propTraps);
|
|
60
|
+
}
|
|
61
|
+
function flatMerge(...sources) {
|
|
62
|
+
const result = {};
|
|
63
|
+
for (let source of sources) {
|
|
64
|
+
source = resolveSource(source);
|
|
65
|
+
if (!source) continue;
|
|
66
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
67
|
+
const value = source[key];
|
|
68
|
+
if (value !== void 0) result[key] = value;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
exports.flatMerge = flatMerge;
|
|
76
|
+
exports.mergeProxy = mergeProxy;
|
|
77
|
+
//# sourceMappingURL=merge-proxy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-proxy.cjs","names":[],"sources":["../src/merge-proxy.ts"],"sourcesContent":["function trueFn() {\n return true\n}\n\nconst $PROXY = Symbol('merge-proxy')\nconst $SOURCES = Symbol('merge-proxy-sources')\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: () => Array<string>\n sources: Array<any>\n}> = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver\n if (property === $SOURCES) return _.sources\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 Array<any>> = {\n [P in keyof T]: [UnboxLazy<T[P]>]\n}[Exclude<keyof T, keyof Array<any>>]\ntype UnionToIntersection<T> = (T extends any ? (k: T) => 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 Array<any>> = UnboxIntersection<\n UnionToIntersection<BoxedTupleTypes<T>>\n>\n\nfunction resolveSource(s: any) {\n return s && typeof s === 'object' && 'value' in s ? s.value : s\n}\n\nexport function mergeProxy<T extends Array<any>>(...sources: T): MergeProxy<T>\nexport function mergeProxy(...sources: any): any {\n const flattenedSources = sources.flatMap((source: any) => {\n if (\n typeof source === 'object' &&\n source !== null &&\n $SOURCES in source &&\n Array.isArray(source[$SOURCES])\n ) {\n return source[$SOURCES]\n }\n\n return [source]\n })\n\n return new Proxy(\n {\n sources: flattenedSources,\n get(property: string | number | symbol) {\n for (let i = flattenedSources.length - 1; i >= 0; i--) {\n const v = resolveSource(flattenedSources[i])[property]\n if (v !== undefined) return v\n }\n },\n has(property: string | number | symbol) {\n for (let i = flattenedSources.length - 1; i >= 0; i--) {\n if (property in resolveSource(flattenedSources[i])) return true\n }\n return false\n },\n keys() {\n const keys = []\n for (const source of flattenedSources)\n keys.push(...Object.keys(resolveSource(source)))\n return [...Array.from(new Set(keys))]\n },\n },\n propTraps,\n )\n}\n\n/**\n * Merges objects together by eagerly resolving all values into a flat object.\n *\n * Unlike `mergeProxy`, this does not preserve lazy proxy getters. Use this for\n * repeated option update paths so each merge produces a plain object instead\n * of accumulating a longer source list over time.\n */\nexport function flatMerge<T>(source: T): T\nexport function flatMerge<T, U>(source: T, source1: U): T & U\nexport function flatMerge<T, U, V>(source: T, source1: U, source2: V): T & U & V\nexport function flatMerge<T, U, V, W>(\n source: T,\n source1: U,\n source2: V,\n source3: W,\n): T & U & V & W\nexport function flatMerge(...sources: any): any {\n const result: Record<PropertyKey, unknown> = {}\n\n for (let source of sources) {\n source = resolveSource(source)\n if (!source) continue\n\n for (const key of Reflect.ownKeys(source)) {\n const value = (source as Record<PropertyKey, unknown>)[key]\n if (value !== undefined) {\n result[key] = value\n }\n }\n }\n\n return result\n}\n"],"mappings":";;AAAA,SAAS,SAAS;CAChB,OAAO;AACT;AAEA,MAAM,SAAS,OAAO,aAAa;AACnC,MAAM,WAAW,OAAO,qBAAqB;AAG7C,MAAM,YAKD;CACH,IAAI,GAAG,UAAU,UAAU;EACzB,IAAI,aAAa,QAAQ,OAAO;EAChC,IAAI,aAAa,UAAU,OAAO,EAAE;EACpC,OAAO,EAAE,IAAI,QAAQ;CACvB;CACA,IAAI,GAAG,UAAU;EACf,OAAO,EAAE,IAAI,QAAQ;CACvB;CACA,KAAK;CACL,gBAAgB;CAChB,yBAAyB,GAAG,UAAU;EACpC,OAAO;GACL,cAAc;GACd,YAAY;GACZ,MAAM;IACJ,OAAO,EAAE,IAAI,QAAQ;GACvB;GACA,KAAK;GACL,gBAAgB;EAClB;CACF;CACA,QAAQ,GAAG;EACT,OAAO,EAAE,KAAK;CAChB;AACF;AAgBA,SAAS,cAAc,GAAQ;CAC7B,OAAO,KAAK,OAAO,MAAM,YAAY,WAAW,IAAI,EAAE,QAAQ;AAChE;AAGA,SAAgB,WAAW,GAAG,SAAmB;CAC/C,MAAM,mBAAmB,QAAQ,SAAS,WAAgB;EACxD,IACE,OAAO,WAAW,YAClB,WAAW,QACX,YAAY,UACZ,MAAM,QAAQ,OAAO,SAAS,GAE9B,OAAO,OAAO;EAGhB,OAAO,CAAC,MAAM;CAChB,CAAC;CAED,OAAO,IAAI,MACT;EACE,SAAS;EACT,IAAI,UAAoC;GACtC,KAAK,IAAI,IAAI,iBAAiB,SAAS,GAAG,KAAK,GAAG,KAAK;IACrD,MAAM,IAAI,cAAc,iBAAiB,EAAE,CAAC,CAAC;IAC7C,IAAI,MAAM,QAAW,OAAO;GAC9B;EACF;EACA,IAAI,UAAoC;GACtC,KAAK,IAAI,IAAI,iBAAiB,SAAS,GAAG,KAAK,GAAG,KAChD,IAAI,YAAY,cAAc,iBAAiB,EAAE,GAAG,OAAO;GAE7D,OAAO;EACT;EACA,OAAO;GACL,MAAM,OAAO,CAAC;GACd,KAAK,MAAM,UAAU,kBACnB,KAAK,KAAK,GAAG,OAAO,KAAK,cAAc,MAAM,CAAC,CAAC;GACjD,OAAO,CAAC,GAAG,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC;EACtC;CACF,GACA,SACF;AACF;AAkBA,SAAgB,UAAU,GAAG,SAAmB;CAC9C,MAAM,SAAuC,CAAC;CAE9C,KAAK,IAAI,UAAU,SAAS;EAC1B,SAAS,cAAc,MAAM;EAC7B,IAAI,CAAC,QAAQ;EAEb,KAAK,MAAM,OAAO,QAAQ,QAAQ,MAAM,GAAG;GACzC,MAAM,QAAS,OAAwC;GACvD,IAAI,UAAU,QACZ,OAAO,OAAO;EAElB;CACF;CAEA,OAAO;AACT"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//#region src/merge-proxy.ts
|
|
2
|
+
function trueFn() {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
const $PROXY = Symbol("merge-proxy");
|
|
6
|
+
const $SOURCES = Symbol("merge-proxy-sources");
|
|
7
|
+
const propTraps = {
|
|
8
|
+
get(_, property, receiver) {
|
|
9
|
+
if (property === $PROXY) return receiver;
|
|
10
|
+
if (property === $SOURCES) return _.sources;
|
|
11
|
+
return _.get(property);
|
|
12
|
+
},
|
|
13
|
+
has(_, property) {
|
|
14
|
+
return _.has(property);
|
|
15
|
+
},
|
|
16
|
+
set: trueFn,
|
|
17
|
+
deleteProperty: trueFn,
|
|
18
|
+
getOwnPropertyDescriptor(_, property) {
|
|
19
|
+
return {
|
|
20
|
+
configurable: true,
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get() {
|
|
23
|
+
return _.get(property);
|
|
24
|
+
},
|
|
25
|
+
set: trueFn,
|
|
26
|
+
deleteProperty: trueFn
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
ownKeys(_) {
|
|
30
|
+
return _.keys();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
function resolveSource(s) {
|
|
34
|
+
return s && typeof s === "object" && "value" in s ? s.value : s;
|
|
35
|
+
}
|
|
36
|
+
function mergeProxy(...sources) {
|
|
37
|
+
const flattenedSources = sources.flatMap((source) => {
|
|
38
|
+
if (typeof source === "object" && source !== null && $SOURCES in source && Array.isArray(source[$SOURCES])) return source[$SOURCES];
|
|
39
|
+
return [source];
|
|
40
|
+
});
|
|
41
|
+
return new Proxy({
|
|
42
|
+
sources: flattenedSources,
|
|
43
|
+
get(property) {
|
|
44
|
+
for (let i = flattenedSources.length - 1; i >= 0; i--) {
|
|
45
|
+
const v = resolveSource(flattenedSources[i])[property];
|
|
46
|
+
if (v !== void 0) return v;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
has(property) {
|
|
50
|
+
for (let i = flattenedSources.length - 1; i >= 0; i--) if (property in resolveSource(flattenedSources[i])) return true;
|
|
51
|
+
return false;
|
|
52
|
+
},
|
|
53
|
+
keys() {
|
|
54
|
+
const keys = [];
|
|
55
|
+
for (const source of flattenedSources) keys.push(...Object.keys(resolveSource(source)));
|
|
56
|
+
return [...Array.from(new Set(keys))];
|
|
57
|
+
}
|
|
58
|
+
}, propTraps);
|
|
59
|
+
}
|
|
60
|
+
function flatMerge(...sources) {
|
|
61
|
+
const result = {};
|
|
62
|
+
for (let source of sources) {
|
|
63
|
+
source = resolveSource(source);
|
|
64
|
+
if (!source) continue;
|
|
65
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
66
|
+
const value = source[key];
|
|
67
|
+
if (value !== void 0) result[key] = value;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { flatMerge, mergeProxy };
|
|
75
|
+
//# sourceMappingURL=merge-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-proxy.js","names":[],"sources":["../src/merge-proxy.ts"],"sourcesContent":["function trueFn() {\n return true\n}\n\nconst $PROXY = Symbol('merge-proxy')\nconst $SOURCES = Symbol('merge-proxy-sources')\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: () => Array<string>\n sources: Array<any>\n}> = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver\n if (property === $SOURCES) return _.sources\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 Array<any>> = {\n [P in keyof T]: [UnboxLazy<T[P]>]\n}[Exclude<keyof T, keyof Array<any>>]\ntype UnionToIntersection<T> = (T extends any ? (k: T) => 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 Array<any>> = UnboxIntersection<\n UnionToIntersection<BoxedTupleTypes<T>>\n>\n\nfunction resolveSource(s: any) {\n return s && typeof s === 'object' && 'value' in s ? s.value : s\n}\n\nexport function mergeProxy<T extends Array<any>>(...sources: T): MergeProxy<T>\nexport function mergeProxy(...sources: any): any {\n const flattenedSources = sources.flatMap((source: any) => {\n if (\n typeof source === 'object' &&\n source !== null &&\n $SOURCES in source &&\n Array.isArray(source[$SOURCES])\n ) {\n return source[$SOURCES]\n }\n\n return [source]\n })\n\n return new Proxy(\n {\n sources: flattenedSources,\n get(property: string | number | symbol) {\n for (let i = flattenedSources.length - 1; i >= 0; i--) {\n const v = resolveSource(flattenedSources[i])[property]\n if (v !== undefined) return v\n }\n },\n has(property: string | number | symbol) {\n for (let i = flattenedSources.length - 1; i >= 0; i--) {\n if (property in resolveSource(flattenedSources[i])) return true\n }\n return false\n },\n keys() {\n const keys = []\n for (const source of flattenedSources)\n keys.push(...Object.keys(resolveSource(source)))\n return [...Array.from(new Set(keys))]\n },\n },\n propTraps,\n )\n}\n\n/**\n * Merges objects together by eagerly resolving all values into a flat object.\n *\n * Unlike `mergeProxy`, this does not preserve lazy proxy getters. Use this for\n * repeated option update paths so each merge produces a plain object instead\n * of accumulating a longer source list over time.\n */\nexport function flatMerge<T>(source: T): T\nexport function flatMerge<T, U>(source: T, source1: U): T & U\nexport function flatMerge<T, U, V>(source: T, source1: U, source2: V): T & U & V\nexport function flatMerge<T, U, V, W>(\n source: T,\n source1: U,\n source2: V,\n source3: W,\n): T & U & V & W\nexport function flatMerge(...sources: any): any {\n const result: Record<PropertyKey, unknown> = {}\n\n for (let source of sources) {\n source = resolveSource(source)\n if (!source) continue\n\n for (const key of Reflect.ownKeys(source)) {\n const value = (source as Record<PropertyKey, unknown>)[key]\n if (value !== undefined) {\n result[key] = value\n }\n }\n }\n\n return result\n}\n"],"mappings":";AAAA,SAAS,SAAS;CAChB,OAAO;AACT;AAEA,MAAM,SAAS,OAAO,aAAa;AACnC,MAAM,WAAW,OAAO,qBAAqB;AAG7C,MAAM,YAKD;CACH,IAAI,GAAG,UAAU,UAAU;EACzB,IAAI,aAAa,QAAQ,OAAO;EAChC,IAAI,aAAa,UAAU,OAAO,EAAE;EACpC,OAAO,EAAE,IAAI,QAAQ;CACvB;CACA,IAAI,GAAG,UAAU;EACf,OAAO,EAAE,IAAI,QAAQ;CACvB;CACA,KAAK;CACL,gBAAgB;CAChB,yBAAyB,GAAG,UAAU;EACpC,OAAO;GACL,cAAc;GACd,YAAY;GACZ,MAAM;IACJ,OAAO,EAAE,IAAI,QAAQ;GACvB;GACA,KAAK;GACL,gBAAgB;EAClB;CACF;CACA,QAAQ,GAAG;EACT,OAAO,EAAE,KAAK;CAChB;AACF;AAgBA,SAAS,cAAc,GAAQ;CAC7B,OAAO,KAAK,OAAO,MAAM,YAAY,WAAW,IAAI,EAAE,QAAQ;AAChE;AAGA,SAAgB,WAAW,GAAG,SAAmB;CAC/C,MAAM,mBAAmB,QAAQ,SAAS,WAAgB;EACxD,IACE,OAAO,WAAW,YAClB,WAAW,QACX,YAAY,UACZ,MAAM,QAAQ,OAAO,SAAS,GAE9B,OAAO,OAAO;EAGhB,OAAO,CAAC,MAAM;CAChB,CAAC;CAED,OAAO,IAAI,MACT;EACE,SAAS;EACT,IAAI,UAAoC;GACtC,KAAK,IAAI,IAAI,iBAAiB,SAAS,GAAG,KAAK,GAAG,KAAK;IACrD,MAAM,IAAI,cAAc,iBAAiB,EAAE,CAAC,CAAC;IAC7C,IAAI,MAAM,QAAW,OAAO;GAC9B;EACF;EACA,IAAI,UAAoC;GACtC,KAAK,IAAI,IAAI,iBAAiB,SAAS,GAAG,KAAK,GAAG,KAChD,IAAI,YAAY,cAAc,iBAAiB,EAAE,GAAG,OAAO;GAE7D,OAAO;EACT;EACA,OAAO;GACL,MAAM,OAAO,CAAC;GACd,KAAK,MAAM,UAAU,kBACnB,KAAK,KAAK,GAAG,OAAO,KAAK,cAAc,MAAM,CAAC,CAAC;GACjD,OAAO,CAAC,GAAG,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC;EACtC;CACF,GACA,SACF;AACF;AAkBA,SAAgB,UAAU,GAAG,SAAmB;CAC9C,MAAM,SAAuC,CAAC;CAE9C,KAAK,IAAI,UAAU,SAAS;EAC1B,SAAS,cAAc,MAAM;EAC7B,IAAI,CAAC,QAAQ;EAEb,KAAK,MAAM,OAAO,QAAQ,QAAQ,MAAM,GAAG;GACzC,MAAM,QAAS,OAAwC;GACvD,IAAI,UAAU,QACZ,OAAO,OAAO;EAElB;CACF;CAEA,OAAO;AACT"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
let vue = require("vue");
|
|
2
|
+
let _tanstack_vue_store = require("@tanstack/vue-store");
|
|
3
|
+
|
|
4
|
+
//#region src/reactivity.ts
|
|
5
|
+
const optionsStoreDebugName = "table/optionsStore";
|
|
6
|
+
function observerToCallback(observerOrNext) {
|
|
7
|
+
return typeof observerOrNext === "function" ? observerOrNext : (value) => {
|
|
8
|
+
var _observerOrNext$next;
|
|
9
|
+
return (_observerOrNext$next = observerOrNext.next) === null || _observerOrNext$next === void 0 ? void 0 : _observerOrNext$next.call(observerOrNext, value);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function refToReadonlyAtom(source) {
|
|
13
|
+
return Object.assign(source, {
|
|
14
|
+
get: () => source.value,
|
|
15
|
+
subscribe: ((observerOrNext) => {
|
|
16
|
+
return { unsubscribe: (0, vue.watch)(source, observerToCallback(observerOrNext), { flush: "sync" }) };
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function refToWritableAtom(source) {
|
|
21
|
+
return Object.assign(source, {
|
|
22
|
+
set: (updater) => {
|
|
23
|
+
source.value = typeof updater === "function" ? updater(source.value) : updater;
|
|
24
|
+
},
|
|
25
|
+
get: () => source.value,
|
|
26
|
+
subscribe: ((observerOrNext) => {
|
|
27
|
+
return { unsubscribe: (0, vue.watch)(source, observerToCallback(observerOrNext), { flush: "sync" }) };
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates the table-core reactivity bindings used by the Vue adapter.
|
|
33
|
+
*
|
|
34
|
+
* Table state atoms are backed by TanStack Store atoms. The options store stays
|
|
35
|
+
* framework-native because row-model APIs read `table.options` directly during
|
|
36
|
+
* render. Readonly table atoms bridge Store dependency tracking into Vue computed
|
|
37
|
+
* refs.
|
|
38
|
+
*/
|
|
39
|
+
function vueReactivity() {
|
|
40
|
+
return {
|
|
41
|
+
createOptionsStore: true,
|
|
42
|
+
wrapExternalAtoms: false,
|
|
43
|
+
addSubscription: () => {
|
|
44
|
+
throw new Error("Feature not supported in current reactivity implementation");
|
|
45
|
+
},
|
|
46
|
+
unmount: () => {
|
|
47
|
+
throw new Error("Feature not supported in current reactivity implementation");
|
|
48
|
+
},
|
|
49
|
+
schedule: (fn) => queueMicrotask(() => fn()),
|
|
50
|
+
createReadonlyAtom: (fn, _options) => {
|
|
51
|
+
const storeAtom = (0, _tanstack_vue_store.createAtom)(() => fn(), { compare: _options === null || _options === void 0 ? void 0 : _options.compare });
|
|
52
|
+
const version = (0, vue.shallowRef)(0);
|
|
53
|
+
const subscription = storeAtom.subscribe(() => {
|
|
54
|
+
version.value += 1;
|
|
55
|
+
});
|
|
56
|
+
if ((0, vue.getCurrentScope)()) (0, vue.onScopeDispose)(() => subscription.unsubscribe());
|
|
57
|
+
return refToReadonlyAtom((0, vue.computed)(() => {
|
|
58
|
+
version.value;
|
|
59
|
+
return storeAtom.get();
|
|
60
|
+
}));
|
|
61
|
+
},
|
|
62
|
+
createWritableAtom: (value, _options) => {
|
|
63
|
+
if ((_options === null || _options === void 0 ? void 0 : _options.debugName) === optionsStoreDebugName) return refToWritableAtom((0, vue.shallowRef)(value));
|
|
64
|
+
return (0, _tanstack_vue_store.createAtom)(value, { compare: _options === null || _options === void 0 ? void 0 : _options.compare });
|
|
65
|
+
},
|
|
66
|
+
untrack: (fn) => fn(),
|
|
67
|
+
batch: _tanstack_vue_store.batch
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
exports.vueReactivity = vueReactivity;
|
|
73
|
+
//# sourceMappingURL=reactivity.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactivity.cjs","names":[],"sources":["../src/reactivity.ts"],"sourcesContent":["import {\n computed,\n getCurrentScope,\n onScopeDispose,\n shallowRef,\n watch,\n} from 'vue'\nimport { batch, createAtom } from '@tanstack/vue-store'\nimport type {\n TableAtomOptions,\n TableReactivityBindings,\n} from '@tanstack/table-core/reactivity'\nimport type { Atom, Observer, ReadonlyAtom } from '@tanstack/vue-store'\nimport type { ComputedRef, ShallowRef } from 'vue'\n\nconst optionsStoreDebugName = 'table/optionsStore'\n\nfunction observerToCallback<T>(\n observerOrNext: Observer<T> | ((value: T) => void),\n): (value: T) => void {\n return typeof observerOrNext === 'function'\n ? observerOrNext\n : (value) => observerOrNext.next?.(value)\n}\n\nfunction refToReadonlyAtom<T>(\n source: ComputedRef<T> | ShallowRef<T>,\n): ReadonlyAtom<T> {\n return Object.assign(source, {\n get: () => source.value,\n subscribe: ((observerOrNext: Observer<T> | ((value: T) => void)) => {\n const stop = watch(source, observerToCallback(observerOrNext), {\n flush: 'sync',\n })\n return { unsubscribe: stop }\n }) as ReadonlyAtom<T>['subscribe'],\n })\n}\n\nfunction refToWritableAtom<T>(source: ShallowRef<T>): Atom<T> {\n return Object.assign(source, {\n set: (updater: T | ((prevVal: T) => T)) => {\n source.value =\n typeof updater === 'function'\n ? (updater as (prevVal: T) => T)(source.value)\n : updater\n },\n get: () => source.value,\n subscribe: ((observerOrNext: Observer<T> | ((value: T) => void)) => {\n const stop = watch(source, observerToCallback(observerOrNext), {\n flush: 'sync',\n })\n return { unsubscribe: stop }\n }) as Atom<T>['subscribe'],\n })\n}\n\n/**\n * Creates the table-core reactivity bindings used by the Vue adapter.\n *\n * Table state atoms are backed by TanStack Store atoms. The options store stays\n * framework-native because row-model APIs read `table.options` directly during\n * render. Readonly table atoms bridge Store dependency tracking into Vue computed\n * refs.\n */\nexport function vueReactivity(): TableReactivityBindings {\n return {\n createOptionsStore: true,\n wrapExternalAtoms: false,\n addSubscription: () => {\n throw new Error(\n 'Feature not supported in current reactivity implementation',\n )\n },\n unmount: () => {\n throw new Error(\n 'Feature not supported in current reactivity implementation',\n )\n },\n schedule: (fn) => queueMicrotask(() => fn()),\n createReadonlyAtom: <T>(fn: () => T, _options?: TableAtomOptions<T>) => {\n const storeAtom = createAtom(() => fn(), {\n compare: _options?.compare,\n })\n const version = shallowRef(0)\n const subscription = storeAtom.subscribe(() => {\n version.value += 1\n })\n if (getCurrentScope()) {\n onScopeDispose(() => subscription.unsubscribe())\n }\n\n return refToReadonlyAtom(\n computed(() => {\n version.value\n return storeAtom.get()\n }),\n )\n },\n createWritableAtom: <T>(\n value: T,\n _options?: TableAtomOptions<T>,\n ): Atom<T> => {\n if (_options?.debugName === optionsStoreDebugName) {\n return refToWritableAtom(shallowRef(value) as ShallowRef<T>)\n }\n\n return createAtom(value, {\n compare: _options?.compare,\n })\n },\n untrack: (fn) => fn(),\n batch,\n }\n}\n"],"mappings":";;;;AAeA,MAAM,wBAAwB;AAE9B,SAAS,mBACP,gBACoB;CACpB,OAAO,OAAO,mBAAmB,aAC7B,kBACC,UAAU;;gDAAe,uGAAO,KAAK;;AAC5C;AAEA,SAAS,kBACP,QACiB;CACjB,OAAO,OAAO,OAAO,QAAQ;EAC3B,WAAW,OAAO;EAClB,aAAa,mBAAuD;GAIlE,OAAO,EAAE,4BAHU,QAAQ,mBAAmB,cAAc,GAAG,EAC7D,OAAO,OACT,CACyB,EAAE;EAC7B;CACF,CAAC;AACH;AAEA,SAAS,kBAAqB,QAAgC;CAC5D,OAAO,OAAO,OAAO,QAAQ;EAC3B,MAAM,YAAqC;GACzC,OAAO,QACL,OAAO,YAAY,aACd,QAA8B,OAAO,KAAK,IAC3C;EACR;EACA,WAAW,OAAO;EAClB,aAAa,mBAAuD;GAIlE,OAAO,EAAE,4BAHU,QAAQ,mBAAmB,cAAc,GAAG,EAC7D,OAAO,OACT,CACyB,EAAE;EAC7B;CACF,CAAC;AACH;;;;;;;;;AAUA,SAAgB,gBAAyC;CACvD,OAAO;EACL,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;GACrB,MAAM,IAAI,MACR,4DACF;EACF;EACA,eAAe;GACb,MAAM,IAAI,MACR,4DACF;EACF;EACA,WAAW,OAAO,qBAAqB,GAAG,CAAC;EAC3C,qBAAwB,IAAa,aAAmC;GACtE,MAAM,sDAA6B,GAAG,GAAG,EACvC,6DAAS,SAAU,QACrB,CAAC;GACD,MAAM,8BAAqB,CAAC;GAC5B,MAAM,eAAe,UAAU,gBAAgB;IAC7C,QAAQ,SAAS;GACnB,CAAC;GACD,6BAAoB,GAClB,8BAAqB,aAAa,YAAY,CAAC;GAGjD,OAAO,0CACU;IACb,QAAQ;IACR,OAAO,UAAU,IAAI;GACvB,CAAC,CACH;EACF;EACA,qBACE,OACA,aACY;GACZ,yDAAI,SAAU,eAAc,uBAC1B,OAAO,sCAA6B,KAAK,CAAkB;GAG7D,2CAAkB,OAAO,EACvB,6DAAS,SAAU,QACrB,CAAC;EACH;EACA,UAAU,OAAO,GAAG;EACpB;CACF;AACF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { computed, getCurrentScope, onScopeDispose, shallowRef, watch } from "vue";
|
|
2
|
+
import { batch, createAtom } from "@tanstack/vue-store";
|
|
3
|
+
|
|
4
|
+
//#region src/reactivity.ts
|
|
5
|
+
const optionsStoreDebugName = "table/optionsStore";
|
|
6
|
+
function observerToCallback(observerOrNext) {
|
|
7
|
+
return typeof observerOrNext === "function" ? observerOrNext : (value) => {
|
|
8
|
+
var _observerOrNext$next;
|
|
9
|
+
return (_observerOrNext$next = observerOrNext.next) === null || _observerOrNext$next === void 0 ? void 0 : _observerOrNext$next.call(observerOrNext, value);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function refToReadonlyAtom(source) {
|
|
13
|
+
return Object.assign(source, {
|
|
14
|
+
get: () => source.value,
|
|
15
|
+
subscribe: ((observerOrNext) => {
|
|
16
|
+
return { unsubscribe: watch(source, observerToCallback(observerOrNext), { flush: "sync" }) };
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function refToWritableAtom(source) {
|
|
21
|
+
return Object.assign(source, {
|
|
22
|
+
set: (updater) => {
|
|
23
|
+
source.value = typeof updater === "function" ? updater(source.value) : updater;
|
|
24
|
+
},
|
|
25
|
+
get: () => source.value,
|
|
26
|
+
subscribe: ((observerOrNext) => {
|
|
27
|
+
return { unsubscribe: watch(source, observerToCallback(observerOrNext), { flush: "sync" }) };
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates the table-core reactivity bindings used by the Vue adapter.
|
|
33
|
+
*
|
|
34
|
+
* Table state atoms are backed by TanStack Store atoms. The options store stays
|
|
35
|
+
* framework-native because row-model APIs read `table.options` directly during
|
|
36
|
+
* render. Readonly table atoms bridge Store dependency tracking into Vue computed
|
|
37
|
+
* refs.
|
|
38
|
+
*/
|
|
39
|
+
function vueReactivity() {
|
|
40
|
+
return {
|
|
41
|
+
createOptionsStore: true,
|
|
42
|
+
wrapExternalAtoms: false,
|
|
43
|
+
addSubscription: () => {
|
|
44
|
+
throw new Error("Feature not supported in current reactivity implementation");
|
|
45
|
+
},
|
|
46
|
+
unmount: () => {
|
|
47
|
+
throw new Error("Feature not supported in current reactivity implementation");
|
|
48
|
+
},
|
|
49
|
+
schedule: (fn) => queueMicrotask(() => fn()),
|
|
50
|
+
createReadonlyAtom: (fn, _options) => {
|
|
51
|
+
const storeAtom = createAtom(() => fn(), { compare: _options === null || _options === void 0 ? void 0 : _options.compare });
|
|
52
|
+
const version = shallowRef(0);
|
|
53
|
+
const subscription = storeAtom.subscribe(() => {
|
|
54
|
+
version.value += 1;
|
|
55
|
+
});
|
|
56
|
+
if (getCurrentScope()) onScopeDispose(() => subscription.unsubscribe());
|
|
57
|
+
return refToReadonlyAtom(computed(() => {
|
|
58
|
+
version.value;
|
|
59
|
+
return storeAtom.get();
|
|
60
|
+
}));
|
|
61
|
+
},
|
|
62
|
+
createWritableAtom: (value, _options) => {
|
|
63
|
+
if ((_options === null || _options === void 0 ? void 0 : _options.debugName) === optionsStoreDebugName) return refToWritableAtom(shallowRef(value));
|
|
64
|
+
return createAtom(value, { compare: _options === null || _options === void 0 ? void 0 : _options.compare });
|
|
65
|
+
},
|
|
66
|
+
untrack: (fn) => fn(),
|
|
67
|
+
batch
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { vueReactivity };
|
|
73
|
+
//# sourceMappingURL=reactivity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactivity.js","names":[],"sources":["../src/reactivity.ts"],"sourcesContent":["import {\n computed,\n getCurrentScope,\n onScopeDispose,\n shallowRef,\n watch,\n} from 'vue'\nimport { batch, createAtom } from '@tanstack/vue-store'\nimport type {\n TableAtomOptions,\n TableReactivityBindings,\n} from '@tanstack/table-core/reactivity'\nimport type { Atom, Observer, ReadonlyAtom } from '@tanstack/vue-store'\nimport type { ComputedRef, ShallowRef } from 'vue'\n\nconst optionsStoreDebugName = 'table/optionsStore'\n\nfunction observerToCallback<T>(\n observerOrNext: Observer<T> | ((value: T) => void),\n): (value: T) => void {\n return typeof observerOrNext === 'function'\n ? observerOrNext\n : (value) => observerOrNext.next?.(value)\n}\n\nfunction refToReadonlyAtom<T>(\n source: ComputedRef<T> | ShallowRef<T>,\n): ReadonlyAtom<T> {\n return Object.assign(source, {\n get: () => source.value,\n subscribe: ((observerOrNext: Observer<T> | ((value: T) => void)) => {\n const stop = watch(source, observerToCallback(observerOrNext), {\n flush: 'sync',\n })\n return { unsubscribe: stop }\n }) as ReadonlyAtom<T>['subscribe'],\n })\n}\n\nfunction refToWritableAtom<T>(source: ShallowRef<T>): Atom<T> {\n return Object.assign(source, {\n set: (updater: T | ((prevVal: T) => T)) => {\n source.value =\n typeof updater === 'function'\n ? (updater as (prevVal: T) => T)(source.value)\n : updater\n },\n get: () => source.value,\n subscribe: ((observerOrNext: Observer<T> | ((value: T) => void)) => {\n const stop = watch(source, observerToCallback(observerOrNext), {\n flush: 'sync',\n })\n return { unsubscribe: stop }\n }) as Atom<T>['subscribe'],\n })\n}\n\n/**\n * Creates the table-core reactivity bindings used by the Vue adapter.\n *\n * Table state atoms are backed by TanStack Store atoms. The options store stays\n * framework-native because row-model APIs read `table.options` directly during\n * render. Readonly table atoms bridge Store dependency tracking into Vue computed\n * refs.\n */\nexport function vueReactivity(): TableReactivityBindings {\n return {\n createOptionsStore: true,\n wrapExternalAtoms: false,\n addSubscription: () => {\n throw new Error(\n 'Feature not supported in current reactivity implementation',\n )\n },\n unmount: () => {\n throw new Error(\n 'Feature not supported in current reactivity implementation',\n )\n },\n schedule: (fn) => queueMicrotask(() => fn()),\n createReadonlyAtom: <T>(fn: () => T, _options?: TableAtomOptions<T>) => {\n const storeAtom = createAtom(() => fn(), {\n compare: _options?.compare,\n })\n const version = shallowRef(0)\n const subscription = storeAtom.subscribe(() => {\n version.value += 1\n })\n if (getCurrentScope()) {\n onScopeDispose(() => subscription.unsubscribe())\n }\n\n return refToReadonlyAtom(\n computed(() => {\n version.value\n return storeAtom.get()\n }),\n )\n },\n createWritableAtom: <T>(\n value: T,\n _options?: TableAtomOptions<T>,\n ): Atom<T> => {\n if (_options?.debugName === optionsStoreDebugName) {\n return refToWritableAtom(shallowRef(value) as ShallowRef<T>)\n }\n\n return createAtom(value, {\n compare: _options?.compare,\n })\n },\n untrack: (fn) => fn(),\n batch,\n }\n}\n"],"mappings":";;;;AAeA,MAAM,wBAAwB;AAE9B,SAAS,mBACP,gBACoB;CACpB,OAAO,OAAO,mBAAmB,aAC7B,kBACC,UAAU;;gDAAe,uGAAO,KAAK;;AAC5C;AAEA,SAAS,kBACP,QACiB;CACjB,OAAO,OAAO,OAAO,QAAQ;EAC3B,WAAW,OAAO;EAClB,aAAa,mBAAuD;GAIlE,OAAO,EAAE,aAHI,MAAM,QAAQ,mBAAmB,cAAc,GAAG,EAC7D,OAAO,OACT,CACyB,EAAE;EAC7B;CACF,CAAC;AACH;AAEA,SAAS,kBAAqB,QAAgC;CAC5D,OAAO,OAAO,OAAO,QAAQ;EAC3B,MAAM,YAAqC;GACzC,OAAO,QACL,OAAO,YAAY,aACd,QAA8B,OAAO,KAAK,IAC3C;EACR;EACA,WAAW,OAAO;EAClB,aAAa,mBAAuD;GAIlE,OAAO,EAAE,aAHI,MAAM,QAAQ,mBAAmB,cAAc,GAAG,EAC7D,OAAO,OACT,CACyB,EAAE;EAC7B;CACF,CAAC;AACH;;;;;;;;;AAUA,SAAgB,gBAAyC;CACvD,OAAO;EACL,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;GACrB,MAAM,IAAI,MACR,4DACF;EACF;EACA,eAAe;GACb,MAAM,IAAI,MACR,4DACF;EACF;EACA,WAAW,OAAO,qBAAqB,GAAG,CAAC;EAC3C,qBAAwB,IAAa,aAAmC;GACtE,MAAM,YAAY,iBAAiB,GAAG,GAAG,EACvC,6DAAS,SAAU,QACrB,CAAC;GACD,MAAM,UAAU,WAAW,CAAC;GAC5B,MAAM,eAAe,UAAU,gBAAgB;IAC7C,QAAQ,SAAS;GACnB,CAAC;GACD,IAAI,gBAAgB,GAClB,qBAAqB,aAAa,YAAY,CAAC;GAGjD,OAAO,kBACL,eAAe;IACb,QAAQ;IACR,OAAO,UAAU,IAAI;GACvB,CAAC,CACH;EACF;EACA,qBACE,OACA,aACY;GACZ,yDAAI,SAAU,eAAc,uBAC1B,OAAO,kBAAkB,WAAW,KAAK,CAAkB;GAG7D,OAAO,WAAW,OAAO,EACvB,6DAAS,SAAU,QACrB,CAAC;EACH;EACA,UAAU,OAAO,GAAG;EACpB;CACF;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
var _tanstack_table_core_static_functions = require("@tanstack/table-core/static-functions");
|
|
4
|
+
Object.keys(_tanstack_table_core_static_functions).forEach(function (k) {
|
|
5
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () { return _tanstack_table_core_static_functions[k]; }
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@tanstack/table-core/static-functions";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@tanstack/table-core/static-functions";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const require_merge_proxy = require('./merge-proxy.cjs');
|
|
2
|
+
const require_reactivity = require('./reactivity.cjs');
|
|
3
|
+
let vue = require("vue");
|
|
4
|
+
let _tanstack_table_core = require("@tanstack/table-core");
|
|
5
|
+
let _tanstack_vue_store = require("@tanstack/vue-store");
|
|
6
|
+
|
|
7
|
+
//#region src/useTable.ts
|
|
8
|
+
function getOptionsWithReactiveValues(options) {
|
|
9
|
+
const resolvedOptions = {};
|
|
10
|
+
for (const key of Object.keys(options)) resolvedOptions[key] = (0, vue.unref)(options[key]);
|
|
11
|
+
return require_merge_proxy.mergeProxy(options, resolvedOptions);
|
|
12
|
+
}
|
|
13
|
+
function getReactiveOptionDeps(options) {
|
|
14
|
+
return Object.keys(options).map((key) => (0, vue.unref)(options[key]));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a Vue table instance backed by Vue-aware TanStack Store atoms.
|
|
18
|
+
*
|
|
19
|
+
* Table options may contain Vue refs or computed values. The adapter unwraps
|
|
20
|
+
* those reactive inputs, watches them with synchronous flushing, and keeps the
|
|
21
|
+
* table options in sync. The optional selector projects from `table.store` and
|
|
22
|
+
* exposes the selected value on `table.state`.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const table = useTable(
|
|
27
|
+
* {
|
|
28
|
+
* features,
|
|
29
|
+
* rowModels: {},
|
|
30
|
+
* columns,
|
|
31
|
+
* data,
|
|
32
|
+
* },
|
|
33
|
+
* (state) => ({ pagination: state.pagination }),
|
|
34
|
+
* )
|
|
35
|
+
*
|
|
36
|
+
* table.state.pagination
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function useTable(tableOptions, selector) {
|
|
40
|
+
const syncTableOptions = (table, options) => {
|
|
41
|
+
table.setOptions((prev) => require_merge_proxy.flatMerge(prev, getOptionsWithReactiveValues(options)));
|
|
42
|
+
};
|
|
43
|
+
const mergedOptions = require_merge_proxy.mergeProxy(tableOptions, { features: {
|
|
44
|
+
coreReativityFeature: require_reactivity.vueReactivity(),
|
|
45
|
+
...(0, vue.unref)(tableOptions.features) ?? {}
|
|
46
|
+
} });
|
|
47
|
+
const coreTable = (0, _tanstack_table_core.constructTable)(require_merge_proxy.mergeProxy(getOptionsWithReactiveValues(mergedOptions), { mergeOptions: (defaultOptions, newOptions) => {
|
|
48
|
+
return require_merge_proxy.flatMerge(defaultOptions, newOptions);
|
|
49
|
+
} }));
|
|
50
|
+
const table = coreTable;
|
|
51
|
+
(0, vue.watch)(() => getReactiveOptionDeps(mergedOptions), () => {
|
|
52
|
+
syncTableOptions(coreTable, mergedOptions);
|
|
53
|
+
}, { immediate: true });
|
|
54
|
+
(0, vue.watch)(() => {
|
|
55
|
+
const controlledState = (0, vue.unref)(tableOptions.state);
|
|
56
|
+
const controlledAtoms = (0, vue.unref)(tableOptions.atoms);
|
|
57
|
+
if (!controlledState) return [];
|
|
58
|
+
const controlledValues = [];
|
|
59
|
+
for (const key of Object.keys(table.initialState)) {
|
|
60
|
+
if (!(key in controlledState) || (controlledAtoms === null || controlledAtoms === void 0 ? void 0 : controlledAtoms[key]) !== void 0) continue;
|
|
61
|
+
controlledValues.push(controlledState[key]);
|
|
62
|
+
}
|
|
63
|
+
return controlledValues;
|
|
64
|
+
}, (controlledValues) => {
|
|
65
|
+
if (controlledValues.length > 0) syncTableOptions(coreTable, mergedOptions);
|
|
66
|
+
}, { immediate: true });
|
|
67
|
+
table.Subscribe = ((props) => {
|
|
68
|
+
const selected = (0, _tanstack_vue_store.useSelector)(props.source ?? table.store, props.selector, { compare: _tanstack_vue_store.shallow });
|
|
69
|
+
if (typeof props.children === "function") return props.children(selected.value);
|
|
70
|
+
return props.children;
|
|
71
|
+
});
|
|
72
|
+
const stateStore = (0, _tanstack_vue_store.useSelector)(table.store, selector);
|
|
73
|
+
return {
|
|
74
|
+
...table,
|
|
75
|
+
get state() {
|
|
76
|
+
return stateStore.value;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
exports.useTable = useTable;
|
|
83
|
+
//# sourceMappingURL=useTable.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTable.cjs","names":["mergeProxy","flatMerge","vueReactivity","shallow"],"sources":["../src/useTable.ts"],"sourcesContent":["import { unref, watch } from 'vue'\nimport { constructTable } from '@tanstack/table-core'\nimport { shallow, useSelector } from '@tanstack/vue-store'\nimport { flatMerge, mergeProxy } from './merge-proxy'\nimport { vueReactivity } from './reactivity'\nimport type {\n Atom,\n ReadonlyAtom,\n ReadonlyStore,\n Store,\n} from '@tanstack/vue-store'\nimport type {\n NoInfer,\n RowData,\n Table,\n TableFeatures,\n TableOptions,\n TableState,\n} from '@tanstack/table-core'\nimport type { MaybeRef, VNode } from 'vue'\n\nexport type SubscribeSource<TValue> =\n | Atom<TValue>\n | ReadonlyAtom<TValue>\n | Store<TValue>\n | ReadonlyStore<TValue>\n\nexport type TableOptionsWithReactiveData<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> = {\n [K in keyof TableOptions<TFeatures, TData>]: K extends 'data'\n ? MaybeRef<ReadonlyArray<TData>>\n : MaybeRef<TableOptions<TFeatures, TData>[K]>\n}\n\nfunction getOptionsWithReactiveValues<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(options: TableOptionsWithReactiveData<TFeatures, TData>) {\n const resolvedOptions: Record<string, unknown> = {}\n\n for (const key of Object.keys(options)) {\n resolvedOptions[key] = unref(\n options[key as keyof TableOptionsWithReactiveData<TFeatures, TData>],\n )\n }\n\n return mergeProxy(options, resolvedOptions)\n}\n\nfunction getReactiveOptionDeps<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(options: TableOptionsWithReactiveData<TFeatures, TData>) {\n return Object.keys(options).map((key) =>\n unref(options[key as keyof TableOptionsWithReactiveData<TFeatures, TData>]),\n )\n}\n\nexport type VueTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TSelected = TableState<TFeatures>,\n> = Omit<Table<TFeatures, TData>, 'store'> & {\n /**\n * @deprecated Prefer `table.state` for render reads,\n * `table.atoms.<slice>.get()` for slice snapshots, or\n * `table.Subscribe` / `useSelector(table.store, selector)` for explicit\n * subscriptions. `table.store.state` is a current-value snapshot and is easy\n * to misuse in render code.\n */\n readonly store: Table<TFeatures, TData>['store']\n /**\n * Store mode: `selector` required. Source mode: pass `source` (atom or store); omit\n * `selector` for the whole value (identity), or pass `selector` to project. Split\n * overloads so source-only infers `TSourceValue` for `children` (see React `Subscribe`).\n */\n Subscribe: {\n <TSourceValue>(props: {\n source: SubscribeSource<TSourceValue>\n selector?: undefined\n children:\n | ((state: Readonly<TSourceValue>) => VNode | Array<VNode>)\n | VNode\n | Array<VNode>\n }): VNode | Array<VNode>\n <TSourceValue, TSubSelected>(props: {\n source: SubscribeSource<TSourceValue>\n selector: (state: TSourceValue) => TSubSelected\n children:\n | ((state: Readonly<TSubSelected>) => VNode | Array<VNode>)\n | VNode\n | Array<VNode>\n }): VNode | Array<VNode>\n <TSubSelected>(props: {\n selector: (state: NoInfer<TableState<TFeatures>>) => TSubSelected\n children:\n | ((state: Readonly<TSubSelected>) => VNode | Array<VNode>)\n | VNode\n | Array<VNode>\n }): VNode | Array<VNode>\n }\n /**\n * The selected state of the table. This state may not match the structure of\n * the full table state because it is selected by the selector function that\n * you pass as the 2nd argument to `useTable`.\n *\n * @example\n * const table = useTable(options, (state) => ({ globalFilter: state.globalFilter })) // only globalFilter is part of the selected state\n *\n * console.log(table.state.globalFilter)\n */\n readonly state: Readonly<TSelected>\n}\n\n/**\n * Creates a Vue table instance backed by Vue-aware TanStack Store atoms.\n *\n * Table options may contain Vue refs or computed values. The adapter unwraps\n * those reactive inputs, watches them with synchronous flushing, and keeps the\n * table options in sync. The optional selector projects from `table.store` and\n * exposes the selected value on `table.state`.\n *\n * @example\n * ```ts\n * const table = useTable(\n * {\n * features,\n * rowModels: {},\n * columns,\n * data,\n * },\n * (state) => ({ pagination: state.pagination }),\n * )\n *\n * table.state.pagination\n * ```\n */\nexport function useTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TSelected = TableState<TFeatures>,\n>(\n tableOptions:\n | TableOptions<TFeatures, TData>\n | TableOptionsWithReactiveData<TFeatures, TData>,\n selector?: (state: TableState<TFeatures>) => TSelected,\n): VueTable<TFeatures, TData, TSelected> {\n const syncTableOptions = (\n table: Table<TFeatures, TData>,\n options: TableOptionsWithReactiveData<TFeatures, TData>,\n ) => {\n table.setOptions((prev) =>\n flatMerge(prev, getOptionsWithReactiveValues(options)),\n )\n }\n\n const mergedOptions = mergeProxy(tableOptions, {\n features: {\n coreReativityFeature: vueReactivity(),\n ...(unref(tableOptions.features) ?? {}),\n },\n }) as TableOptionsWithReactiveData<TFeatures, TData>\n\n const resolvedOptions = mergeProxy(\n getOptionsWithReactiveValues(mergedOptions),\n {\n // Remove state and onStateChange - store handles it internally\n mergeOptions: (\n defaultOptions: TableOptions<TFeatures, TData>,\n newOptions: Partial<TableOptions<TFeatures, TData>>,\n ) => {\n return flatMerge(defaultOptions, newOptions)\n },\n },\n ) as TableOptions<TFeatures, TData>\n\n const coreTable = constructTable(resolvedOptions)\n const table = coreTable as unknown as VueTable<TFeatures, TData, TSelected>\n\n watch(\n () => getReactiveOptionDeps(mergedOptions),\n () => {\n syncTableOptions(coreTable, mergedOptions)\n },\n { immediate: true },\n )\n\n watch(\n () => {\n const controlledState = unref(tableOptions.state) as\n | Record<string, unknown>\n | undefined\n const controlledAtoms = unref(tableOptions.atoms) as\n | Record<string, unknown>\n | undefined\n\n if (!controlledState) {\n return []\n }\n\n const controlledValues: Array<unknown> = []\n\n for (const key of Object.keys(table.initialState)) {\n if (!(key in controlledState) || controlledAtoms?.[key] !== undefined) {\n continue\n }\n\n // Reading only controlled state slices here lets Vue subscribe to\n // getters/computed values that are passed through `options.state`.\n controlledValues.push(controlledState[key])\n }\n\n return controlledValues\n },\n (controlledValues) => {\n if (controlledValues.length > 0) {\n syncTableOptions(coreTable, mergedOptions)\n }\n },\n { immediate: true },\n )\n\n table.Subscribe = ((props: {\n source?: SubscribeSource<unknown>\n selector?: ((state: unknown) => unknown) | undefined\n children:\n | ((state: Readonly<unknown>) => VNode | Array<VNode>)\n | VNode\n | Array<VNode>\n }) => {\n const source = props.source ?? table.store\n const selected = useSelector(source as never, props.selector as never, {\n compare: shallow,\n })\n if (typeof props.children === 'function') {\n return props.children(selected.value as Readonly<unknown>)\n }\n return props.children\n }) as VueTable<TFeatures, TData, TSelected>['Subscribe']\n\n const stateStore = useSelector(table.store, selector)\n\n return {\n ...table,\n get state() {\n return stateStore.value\n },\n }\n}\n"],"mappings":";;;;;;;AAoCA,SAAS,6BAGP,SAAyD;CACzD,MAAM,kBAA2C,CAAC;CAElD,KAAK,MAAM,OAAO,OAAO,KAAK,OAAO,GACnC,gBAAgB,sBACd,QAAQ,IACV;CAGF,OAAOA,+BAAW,SAAS,eAAe;AAC5C;AAEA,SAAS,sBAGP,SAAyD;CACzD,OAAO,OAAO,KAAK,OAAO,CAAC,CAAC,KAAK,uBACzB,QAAQ,IAA4D,CAC5E;AACF;;;;;;;;;;;;;;;;;;;;;;;;AAiFA,SAAgB,SAKd,cAGA,UACuC;CACvC,MAAM,oBACJ,OACA,YACG;EACH,MAAM,YAAY,SAChBC,8BAAU,MAAM,6BAA6B,OAAO,CAAC,CACvD;CACF;CAEA,MAAM,gBAAgBD,+BAAW,cAAc,EAC7C,UAAU;EACR,sBAAsBE,iCAAc;EACpC,kBAAU,aAAa,QAAQ,KAAK,CAAC;CACvC,EACF,CAAC;CAeD,MAAM,qDAbkBF,+BACtB,6BAA6B,aAAa,GAC1C,EAEE,eACE,gBACA,eACG;EACH,OAAOC,8BAAU,gBAAgB,UAAU;CAC7C,EACF,CAG6C,CAAC;CAChD,MAAM,QAAQ;CAEd,qBACQ,sBAAsB,aAAa,SACnC;EACJ,iBAAiB,WAAW,aAAa;CAC3C,GACA,EAAE,WAAW,KAAK,CACpB;CAEA,qBACQ;EACJ,MAAM,iCAAwB,aAAa,KAAK;EAGhD,MAAM,iCAAwB,aAAa,KAAK;EAIhD,IAAI,CAAC,iBACH,OAAO,CAAC;EAGV,MAAM,mBAAmC,CAAC;EAE1C,KAAK,MAAM,OAAO,OAAO,KAAK,MAAM,YAAY,GAAG;GACjD,IAAI,EAAE,OAAO,uFAAoB,gBAAkB,UAAS,QAC1D;GAKF,iBAAiB,KAAK,gBAAgB,IAAI;EAC5C;EAEA,OAAO;CACT,IACC,qBAAqB;EACpB,IAAI,iBAAiB,SAAS,GAC5B,iBAAiB,WAAW,aAAa;CAE7C,GACA,EAAE,WAAW,KAAK,CACpB;CAEA,MAAM,cAAc,UAOd;EAEJ,MAAM,gDADS,MAAM,UAAU,MAAM,OACS,MAAM,UAAmB,EACrE,SAASE,4BACX,CAAC;EACD,IAAI,OAAO,MAAM,aAAa,YAC5B,OAAO,MAAM,SAAS,SAAS,KAA0B;EAE3D,OAAO,MAAM;CACf;CAEA,MAAM,kDAAyB,MAAM,OAAO,QAAQ;CAEpD,OAAO;EACL,GAAG;EACH,IAAI,QAAQ;GACV,OAAO,WAAW;EACpB;CACF;AACF"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { NoInfer, RowData, Table, TableFeatures, TableOptions, TableState } from "@tanstack/table-core";
|
|
2
|
+
import { Atom, ReadonlyAtom, ReadonlyStore, Store } from "@tanstack/vue-store";
|
|
3
|
+
import { MaybeRef, VNode } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/useTable.d.ts
|
|
6
|
+
type SubscribeSource<TValue> = Atom<TValue> | ReadonlyAtom<TValue> | Store<TValue> | ReadonlyStore<TValue>;
|
|
7
|
+
type TableOptionsWithReactiveData<TFeatures extends TableFeatures, TData extends RowData> = { [K in keyof TableOptions<TFeatures, TData>]: K extends 'data' ? MaybeRef<ReadonlyArray<TData>> : MaybeRef<TableOptions<TFeatures, TData>[K]> };
|
|
8
|
+
type VueTable<TFeatures extends TableFeatures, TData extends RowData, TSelected = TableState<TFeatures>> = Omit<Table<TFeatures, TData>, 'store'> & {
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Prefer `table.state` for render reads,
|
|
11
|
+
* `table.atoms.<slice>.get()` for slice snapshots, or
|
|
12
|
+
* `table.Subscribe` / `useSelector(table.store, selector)` for explicit
|
|
13
|
+
* subscriptions. `table.store.state` is a current-value snapshot and is easy
|
|
14
|
+
* to misuse in render code.
|
|
15
|
+
*/
|
|
16
|
+
readonly store: Table<TFeatures, TData>['store'];
|
|
17
|
+
/**
|
|
18
|
+
* Store mode: `selector` required. Source mode: pass `source` (atom or store); omit
|
|
19
|
+
* `selector` for the whole value (identity), or pass `selector` to project. Split
|
|
20
|
+
* overloads so source-only infers `TSourceValue` for `children` (see React `Subscribe`).
|
|
21
|
+
*/
|
|
22
|
+
Subscribe: {
|
|
23
|
+
<TSourceValue>(props: {
|
|
24
|
+
source: SubscribeSource<TSourceValue>;
|
|
25
|
+
selector?: undefined;
|
|
26
|
+
children: ((state: Readonly<TSourceValue>) => VNode | Array<VNode>) | VNode | Array<VNode>;
|
|
27
|
+
}): VNode | Array<VNode>;
|
|
28
|
+
<TSourceValue, TSubSelected>(props: {
|
|
29
|
+
source: SubscribeSource<TSourceValue>;
|
|
30
|
+
selector: (state: TSourceValue) => TSubSelected;
|
|
31
|
+
children: ((state: Readonly<TSubSelected>) => VNode | Array<VNode>) | VNode | Array<VNode>;
|
|
32
|
+
}): VNode | Array<VNode>;
|
|
33
|
+
<TSubSelected>(props: {
|
|
34
|
+
selector: (state: NoInfer<TableState<TFeatures>>) => TSubSelected;
|
|
35
|
+
children: ((state: Readonly<TSubSelected>) => VNode | Array<VNode>) | VNode | Array<VNode>;
|
|
36
|
+
}): VNode | Array<VNode>;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The selected state of the table. This state may not match the structure of
|
|
40
|
+
* the full table state because it is selected by the selector function that
|
|
41
|
+
* you pass as the 2nd argument to `useTable`.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* const table = useTable(options, (state) => ({ globalFilter: state.globalFilter })) // only globalFilter is part of the selected state
|
|
45
|
+
*
|
|
46
|
+
* console.log(table.state.globalFilter)
|
|
47
|
+
*/
|
|
48
|
+
readonly state: Readonly<TSelected>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Creates a Vue table instance backed by Vue-aware TanStack Store atoms.
|
|
52
|
+
*
|
|
53
|
+
* Table options may contain Vue refs or computed values. The adapter unwraps
|
|
54
|
+
* those reactive inputs, watches them with synchronous flushing, and keeps the
|
|
55
|
+
* table options in sync. The optional selector projects from `table.store` and
|
|
56
|
+
* exposes the selected value on `table.state`.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const table = useTable(
|
|
61
|
+
* {
|
|
62
|
+
* features,
|
|
63
|
+
* rowModels: {},
|
|
64
|
+
* columns,
|
|
65
|
+
* data,
|
|
66
|
+
* },
|
|
67
|
+
* (state) => ({ pagination: state.pagination }),
|
|
68
|
+
* )
|
|
69
|
+
*
|
|
70
|
+
* table.state.pagination
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function useTable<TFeatures extends TableFeatures, TData extends RowData, TSelected = TableState<TFeatures>>(tableOptions: TableOptions<TFeatures, TData> | TableOptionsWithReactiveData<TFeatures, TData>, selector?: (state: TableState<TFeatures>) => TSelected): VueTable<TFeatures, TData, TSelected>;
|
|
74
|
+
//#endregion
|
|
75
|
+
export { SubscribeSource, TableOptionsWithReactiveData, VueTable, useTable };
|
|
76
|
+
//# sourceMappingURL=useTable.d.cts.map
|