@tanstack/table-core 9.0.0-alpha.42 → 9.0.0-alpha.43
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/dist/core/reactivity/coreReactivityFeature.types.d.cts +1 -0
- package/dist/core/reactivity/coreReactivityFeature.types.d.ts +1 -0
- package/dist/core/table/constructTable.cjs +24 -19
- package/dist/core/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.js +24 -19
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +5 -2
- package/dist/core/table/coreTablesFeature.types.d.ts +5 -2
- package/dist/core/table/coreTablesFeature.utils.cjs +16 -1
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +2 -1
- package/dist/core/table/coreTablesFeature.utils.d.ts +2 -1
- package/dist/core/table/coreTablesFeature.utils.js +16 -2
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/reactivity.cjs +1 -3
- package/dist/reactivity.d.cts +1 -2
- package/dist/reactivity.d.ts +1 -2
- package/dist/reactivity.js +1 -2
- package/dist/static-functions.cjs +1 -0
- package/dist/static-functions.d.cts +2 -2
- package/dist/static-functions.d.ts +2 -2
- package/dist/static-functions.js +2 -2
- package/dist/store-reactivity-bindings.cjs +36 -0
- package/dist/store-reactivity-bindings.cjs.map +1 -0
- package/dist/store-reactivity-bindings.d.cts +22 -0
- package/dist/store-reactivity-bindings.d.ts +22 -0
- package/dist/store-reactivity-bindings.js +35 -0
- package/dist/store-reactivity-bindings.js.map +1 -0
- package/package.json +5 -1
- package/src/core/reactivity/coreReactivityFeature.types.ts +1 -0
- package/src/core/table/constructTable.ts +27 -19
- package/src/core/table/coreTablesFeature.types.ts +5 -2
- package/src/core/table/coreTablesFeature.utils.ts +30 -1
- package/src/reactivity.ts +0 -1
- package/src/store-reactivity-bindings.ts +35 -0
- package/src/types/Table.ts +1 -1
- package/dist/core/reactivity/constructReactivityBindings.cjs +0 -19
- package/dist/core/reactivity/constructReactivityBindings.cjs.map +0 -1
- package/dist/core/reactivity/constructReactivityBindings.d.cts +0 -7
- package/dist/core/reactivity/constructReactivityBindings.d.ts +0 -7
- package/dist/core/reactivity/constructReactivityBindings.js +0 -19
- package/dist/core/reactivity/constructReactivityBindings.js.map +0 -1
- package/src/core/reactivity/constructReactivityBindings.ts +0 -19
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_utils = require('../../utils.cjs');
|
|
2
|
+
const require_coreTablesFeature_utils = require('./coreTablesFeature.utils.cjs');
|
|
2
3
|
const require_coreFeatures = require('../coreFeatures.cjs');
|
|
3
4
|
const require_coreReactivityFeature_utils = require('../reactivity/coreReactivityFeature.utils.cjs');
|
|
4
5
|
|
|
@@ -20,38 +21,42 @@ function constructTable(tableOptions) {
|
|
|
20
21
|
},
|
|
21
22
|
_rowModels: {},
|
|
22
23
|
_rowModelFns: {},
|
|
23
|
-
get options() {
|
|
24
|
-
return this.optionsStore.get();
|
|
25
|
-
},
|
|
26
|
-
set options(value) {
|
|
27
|
-
this.optionsStore.set(() => value);
|
|
28
|
-
},
|
|
29
24
|
baseAtoms: {},
|
|
30
25
|
atoms: {}
|
|
31
26
|
};
|
|
32
27
|
const featuresList = Object.values(table._features);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...defaultOptions,
|
|
28
|
+
const mergedOptions = {
|
|
29
|
+
...featuresList.reduce((obj, feature) => {
|
|
30
|
+
var _feature$getDefaultTa;
|
|
31
|
+
return Object.assign(obj, (_feature$getDefaultTa = feature.getDefaultTableOptions) === null || _feature$getDefaultTa === void 0 ? void 0 : _feature$getDefaultTa.call(feature, table));
|
|
32
|
+
}, {}),
|
|
39
33
|
...tableOptions
|
|
40
|
-
}
|
|
34
|
+
};
|
|
35
|
+
if (_reactivity.createOptionsStore) {
|
|
36
|
+
table.optionsStore = _reactivity.createWritableAtom(mergedOptions, { debugName: "table/optionsStore" });
|
|
37
|
+
Object.defineProperty(table, "options", {
|
|
38
|
+
configurable: true,
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get() {
|
|
41
|
+
return table.optionsStore.get();
|
|
42
|
+
},
|
|
43
|
+
set(value) {
|
|
44
|
+
table.optionsStore.set(() => value);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
} else table.options = mergedOptions;
|
|
41
48
|
table.initialState = getInitialTableState(table._features, table.options.initialState);
|
|
42
49
|
const stateKeys = Object.keys(table.initialState);
|
|
43
50
|
for (const key of stateKeys) {
|
|
44
51
|
table.baseAtoms[key] = _reactivity.createWritableAtom(table.initialState[key], { debugName: `table/baseAtoms/${key}` });
|
|
45
52
|
table.atoms[key] = _reactivity.createReadonlyAtom(() => {
|
|
46
|
-
var
|
|
47
|
-
const
|
|
48
|
-
const state = opts.state;
|
|
49
|
-
if (key in (state ?? {})) return state[key];
|
|
50
|
-
const externalAtom = (_opts$atoms = opts.atoms) === null || _opts$atoms === void 0 ? void 0 : _opts$atoms[key];
|
|
53
|
+
var _table$options$atoms;
|
|
54
|
+
const externalAtom = (_table$options$atoms = table.options.atoms) === null || _table$options$atoms === void 0 ? void 0 : _table$options$atoms[key];
|
|
51
55
|
if (externalAtom) return externalAtom.get();
|
|
52
56
|
return table.baseAtoms[key].get();
|
|
53
57
|
}, { debugName: `table/atoms/${key}` });
|
|
54
58
|
}
|
|
59
|
+
require_coreTablesFeature_utils.table_syncExternalStateToBaseAtoms(table);
|
|
55
60
|
table.store = require_coreReactivityFeature_utils.atomToStore(_reactivity.createReadonlyAtom(() => {
|
|
56
61
|
const snapshot = {};
|
|
57
62
|
for (const key of stateKeys) snapshot[key] = table.atoms[key].get();
|
|
@@ -67,7 +72,7 @@ function constructTable(tableOptions) {
|
|
|
67
72
|
|
|
68
73
|
Row Models: ${rowModels.length ? rowModels.join("\n ") : "(none)"}
|
|
69
74
|
|
|
70
|
-
States: ${states.join("\n ")}
|
|
75
|
+
States: ${states.join("\n ")}\n`, { table });
|
|
71
76
|
}
|
|
72
77
|
for (const feature of featuresList) {
|
|
73
78
|
var _feature$constructTab;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructTable.cjs","names":["cloneState","coreFeatures","atomToStore"],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions._features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions._features },\n _rowModels: {},\n _rowModelFns: {},\n
|
|
1
|
+
{"version":3,"file":"constructTable.cjs","names":["cloneState","coreFeatures","atomToStore"],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions._features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions._features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature<{}>> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState<TFeatures>\n >\n\n for (const key of stateKeys) {\n // create writable base atom\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtom = table.options.atoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key].get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures>\n for (const key of stateKeys) {\n snapshot[key] = table.atoms[key].get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.keys(table.options._rowModels || {})\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (const feature of featuresList) {\n feature.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":";;;;;;AAUA,SAAgB,qBACd,UACA,eAA2D,EAAE,EACtC;AACvB,QAAO,OAAO,SAAS,CAAC,SAAS,YAAY;;AAC3C,2CAAe,QAAQ,6GAAkB,aAAa,KAAI;GAC1D;AACF,QAAOA,yBAAW,aAAa;;AAGjC,SAAgB,eAGd,cAAuE;CACvE,MAAM,cAAc,aAAa,UAAU;CAE3C,MAAM,QAAQ;EACZ;EACA,WAAW;GAAE,GAAGC;GAAc,GAAG,aAAa;GAAW;EACzD,YAAY,EAAE;EACd,cAAc,EAAE;EAChB,WAAW,EAAE;EACb,OAAO,EAAE;EACV;CAED,MAAM,eAAwC,OAAO,OAAO,MAAM,UAAU;CAM5E,MAAM,gBAAgB;EAAE,GAJD,aAAa,QAAQ,KAAK,YAAY;;AAC3D,UAAO,OAAO,OAAO,8BAAK,QAAQ,oHAAyB,MAAM,CAAC;KACjE,EAAE,CAEoC;EAAE,GAAG;EAAc;AAE5D,KAAI,YAAY,oBAAoB;AAElC,QAAM,eAAe,YAAY,mBAE/B,eAAe,EAAE,WAAW,sBAAsB,CAAC;AACrD,SAAO,eAAe,OAAO,WAAW;GACtC,cAAc;GACd,YAAY;GACZ,MAAM;AACJ,WAAO,MAAM,aAAc,KAAK;;GAElC,IAAI,OAAO;AACT,UAAM,aAAc,UAAU,MAAM;;GAEvC,CAAC;OAEF,OAAM,UAAU;AAGlB,OAAM,eAAe,qBACnB,MAAM,WACN,MAAM,QAAQ,aACf;CAED,MAAM,YAAY,OAAO,KAAK,MAAM,aAAa;AAIjD,MAAK,MAAM,OAAO,WAAW;AAE3B,QAAM,UAAU,OAAO,YAAY,mBACjC,MAAM,aAAa,MACnB,EACE,WAAW,mBAAmB,OAC/B,CACF;AAGA,EAAC,MAAM,MAAc,OAAO,YAAY,yBACjC;;GACJ,MAAM,uCAAe,MAAM,QAAQ,mFAAQ;AAC3C,OAAI,aACF,QAAO,aAAa,KAAK;AAE3B,UAAO,MAAM,UAAU,KAAK,KAAK;KAEnC,EAAE,WAAW,eAAe,OAAO,CACpC;;AAGH,oEAAmC,MAAM;AAEzC,OAAM,QAAQC,gDACZ,YAAY,yBACJ;EACJ,MAAM,WAAW,EAAE;AACnB,OAAK,MAAM,OAAO,UAChB,UAAS,OAAO,MAAM,MAAM,KAAK,KAAK;AAExC,SAAO;IAET,EAAE,WAAW,eAAe,CAC7B,CACF;AAED,KACE,QAAQ,IAAI,aAAa,kBACxB,aAAa,YAAY,aAAa,aACvC;EACA,MAAM,WAAW,OAAO,KAAK,MAAM,UAAU;EAC7C,MAAM,YAAY,OAAO,KAAK,MAAM,QAAQ,cAAc,EAAE,CAAC;EAC7D,MAAM,SAAS,OAAO,KAAK,MAAM,aAAa;AAE9C,UAAQ,IACN;;gBAEU,SAAS,KAAK,mBAAmB,CAAC;;gBAElC,UAAU,SAAS,UAAU,KAAK,mBAAmB,GAAG,SAAS;;gBAEjE,OAAO,KAAK,mBAAmB,CAAC,KAC1C,EAAE,OAAO,CACV;;AAGH,MAAK,MAAM,WAAW,cAAc;;AAClC,mCAAQ,wGAAqB,MAAM;;AAGrC,QAAO"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cloneState } from "../../utils.js";
|
|
2
|
+
import { table_syncExternalStateToBaseAtoms } from "./coreTablesFeature.utils.js";
|
|
2
3
|
import { coreFeatures } from "../coreFeatures.js";
|
|
3
4
|
import { atomToStore } from "../reactivity/coreReactivityFeature.utils.js";
|
|
4
5
|
|
|
@@ -20,38 +21,42 @@ function constructTable(tableOptions) {
|
|
|
20
21
|
},
|
|
21
22
|
_rowModels: {},
|
|
22
23
|
_rowModelFns: {},
|
|
23
|
-
get options() {
|
|
24
|
-
return this.optionsStore.get();
|
|
25
|
-
},
|
|
26
|
-
set options(value) {
|
|
27
|
-
this.optionsStore.set(() => value);
|
|
28
|
-
},
|
|
29
24
|
baseAtoms: {},
|
|
30
25
|
atoms: {}
|
|
31
26
|
};
|
|
32
27
|
const featuresList = Object.values(table._features);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...defaultOptions,
|
|
28
|
+
const mergedOptions = {
|
|
29
|
+
...featuresList.reduce((obj, feature) => {
|
|
30
|
+
var _feature$getDefaultTa;
|
|
31
|
+
return Object.assign(obj, (_feature$getDefaultTa = feature.getDefaultTableOptions) === null || _feature$getDefaultTa === void 0 ? void 0 : _feature$getDefaultTa.call(feature, table));
|
|
32
|
+
}, {}),
|
|
39
33
|
...tableOptions
|
|
40
|
-
}
|
|
34
|
+
};
|
|
35
|
+
if (_reactivity.createOptionsStore) {
|
|
36
|
+
table.optionsStore = _reactivity.createWritableAtom(mergedOptions, { debugName: "table/optionsStore" });
|
|
37
|
+
Object.defineProperty(table, "options", {
|
|
38
|
+
configurable: true,
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get() {
|
|
41
|
+
return table.optionsStore.get();
|
|
42
|
+
},
|
|
43
|
+
set(value) {
|
|
44
|
+
table.optionsStore.set(() => value);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
} else table.options = mergedOptions;
|
|
41
48
|
table.initialState = getInitialTableState(table._features, table.options.initialState);
|
|
42
49
|
const stateKeys = Object.keys(table.initialState);
|
|
43
50
|
for (const key of stateKeys) {
|
|
44
51
|
table.baseAtoms[key] = _reactivity.createWritableAtom(table.initialState[key], { debugName: `table/baseAtoms/${key}` });
|
|
45
52
|
table.atoms[key] = _reactivity.createReadonlyAtom(() => {
|
|
46
|
-
var
|
|
47
|
-
const
|
|
48
|
-
const state = opts.state;
|
|
49
|
-
if (key in (state ?? {})) return state[key];
|
|
50
|
-
const externalAtom = (_opts$atoms = opts.atoms) === null || _opts$atoms === void 0 ? void 0 : _opts$atoms[key];
|
|
53
|
+
var _table$options$atoms;
|
|
54
|
+
const externalAtom = (_table$options$atoms = table.options.atoms) === null || _table$options$atoms === void 0 ? void 0 : _table$options$atoms[key];
|
|
51
55
|
if (externalAtom) return externalAtom.get();
|
|
52
56
|
return table.baseAtoms[key].get();
|
|
53
57
|
}, { debugName: `table/atoms/${key}` });
|
|
54
58
|
}
|
|
59
|
+
table_syncExternalStateToBaseAtoms(table);
|
|
55
60
|
table.store = atomToStore(_reactivity.createReadonlyAtom(() => {
|
|
56
61
|
const snapshot = {};
|
|
57
62
|
for (const key of stateKeys) snapshot[key] = table.atoms[key].get();
|
|
@@ -67,7 +72,7 @@ function constructTable(tableOptions) {
|
|
|
67
72
|
|
|
68
73
|
Row Models: ${rowModels.length ? rowModels.join("\n ") : "(none)"}
|
|
69
74
|
|
|
70
|
-
States: ${states.join("\n ")}
|
|
75
|
+
States: ${states.join("\n ")}\n`, { table });
|
|
71
76
|
}
|
|
72
77
|
for (const feature of featuresList) {
|
|
73
78
|
var _feature$constructTab;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructTable.js","names":[],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions._features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions._features },\n _rowModels: {},\n _rowModelFns: {},\n
|
|
1
|
+
{"version":3,"file":"constructTable.js","names":[],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions._features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions._features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature<{}>> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState<TFeatures>\n >\n\n for (const key of stateKeys) {\n // create writable base atom\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtom = table.options.atoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key].get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures>\n for (const key of stateKeys) {\n snapshot[key] = table.atoms[key].get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.keys(table.options._rowModels || {})\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (const feature of featuresList) {\n feature.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":";;;;;;AAUA,SAAgB,qBACd,UACA,eAA2D,EAAE,EACtC;AACvB,QAAO,OAAO,SAAS,CAAC,SAAS,YAAY;;AAC3C,2CAAe,QAAQ,6GAAkB,aAAa,KAAI;GAC1D;AACF,QAAO,WAAW,aAAa;;AAGjC,SAAgB,eAGd,cAAuE;CACvE,MAAM,cAAc,aAAa,UAAU;CAE3C,MAAM,QAAQ;EACZ;EACA,WAAW;GAAE,GAAG;GAAc,GAAG,aAAa;GAAW;EACzD,YAAY,EAAE;EACd,cAAc,EAAE;EAChB,WAAW,EAAE;EACb,OAAO,EAAE;EACV;CAED,MAAM,eAAwC,OAAO,OAAO,MAAM,UAAU;CAM5E,MAAM,gBAAgB;EAAE,GAJD,aAAa,QAAQ,KAAK,YAAY;;AAC3D,UAAO,OAAO,OAAO,8BAAK,QAAQ,oHAAyB,MAAM,CAAC;KACjE,EAAE,CAEoC;EAAE,GAAG;EAAc;AAE5D,KAAI,YAAY,oBAAoB;AAElC,QAAM,eAAe,YAAY,mBAE/B,eAAe,EAAE,WAAW,sBAAsB,CAAC;AACrD,SAAO,eAAe,OAAO,WAAW;GACtC,cAAc;GACd,YAAY;GACZ,MAAM;AACJ,WAAO,MAAM,aAAc,KAAK;;GAElC,IAAI,OAAO;AACT,UAAM,aAAc,UAAU,MAAM;;GAEvC,CAAC;OAEF,OAAM,UAAU;AAGlB,OAAM,eAAe,qBACnB,MAAM,WACN,MAAM,QAAQ,aACf;CAED,MAAM,YAAY,OAAO,KAAK,MAAM,aAAa;AAIjD,MAAK,MAAM,OAAO,WAAW;AAE3B,QAAM,UAAU,OAAO,YAAY,mBACjC,MAAM,aAAa,MACnB,EACE,WAAW,mBAAmB,OAC/B,CACF;AAGA,EAAC,MAAM,MAAc,OAAO,YAAY,yBACjC;;GACJ,MAAM,uCAAe,MAAM,QAAQ,mFAAQ;AAC3C,OAAI,aACF,QAAO,aAAa,KAAK;AAE3B,UAAO,MAAM,UAAU,KAAK,KAAK;KAEnC,EAAE,WAAW,eAAe,OAAO,CACpC;;AAGH,oCAAmC,MAAM;AAEzC,OAAM,QAAQ,YACZ,YAAY,yBACJ;EACJ,MAAM,WAAW,EAAE;AACnB,OAAK,MAAM,OAAO,UAChB,UAAS,OAAO,MAAM,MAAM,KAAK,KAAK;AAExC,SAAO;IAET,EAAE,WAAW,eAAe,CAC7B,CACF;AAED,KACE,QAAQ,IAAI,aAAa,kBACxB,aAAa,YAAY,aAAa,aACvC;EACA,MAAM,WAAW,OAAO,KAAK,MAAM,UAAU;EAC7C,MAAM,YAAY,OAAO,KAAK,MAAM,QAAQ,cAAc,EAAE,CAAC;EAC7D,MAAM,SAAS,OAAO,KAAK,MAAM,aAAa;AAE9C,UAAQ,IACN;;gBAEU,SAAS,KAAK,mBAAmB,CAAC;;gBAElC,UAAU,SAAS,UAAU,KAAK,mBAAmB,GAAG,SAAS;;gBAEjE,OAAO,KAAK,mBAAmB,CAAC,KAC1C,EAAE,OAAO,CACV;;AAGH,MAAK,MAAM,WAAW,cAAc;;AAClC,mCAAQ,wGAAqB,MAAM;;AAGrC,QAAO"}
|
|
@@ -138,9 +138,12 @@ interface Table_CoreProperties<TFeatures extends TableFeatures, TData extends Ro
|
|
|
138
138
|
*/
|
|
139
139
|
readonly options: TableOptions<TFeatures, TData>;
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
141
|
+
* Writable atom for table options. Only created when `createOptionsStore` is true
|
|
142
|
+
* on `coreReativityFeature` (e.g. Lit, Vue, Solid). React/Preact use `createOptionsStore: false`:
|
|
143
|
+
* options are held as plain data with a lightweight revision + subscribe source; there is
|
|
144
|
+
* no writable atom backing the full options object. Use {@link getTableOptionsStore} to subscribe.
|
|
142
145
|
*/
|
|
143
|
-
readonly optionsStore
|
|
146
|
+
readonly optionsStore?: Atom<TableOptions<TFeatures, TData>> | undefined;
|
|
144
147
|
/**
|
|
145
148
|
* The readonly flat store for the table state. Derives from `table.atoms`
|
|
146
149
|
* only; never reads external state directly.
|
|
@@ -138,9 +138,12 @@ interface Table_CoreProperties<TFeatures extends TableFeatures, TData extends Ro
|
|
|
138
138
|
*/
|
|
139
139
|
readonly options: TableOptions<TFeatures, TData>;
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
141
|
+
* Writable atom for table options. Only created when `createOptionsStore` is true
|
|
142
|
+
* on `coreReativityFeature` (e.g. Lit, Vue, Solid). React/Preact use `createOptionsStore: false`:
|
|
143
|
+
* options are held as plain data with a lightweight revision + subscribe source; there is
|
|
144
|
+
* no writable atom backing the full options object. Use {@link getTableOptionsStore} to subscribe.
|
|
142
145
|
*/
|
|
143
|
-
readonly optionsStore
|
|
146
|
+
readonly optionsStore?: Atom<TableOptions<TFeatures, TData>> | undefined;
|
|
144
147
|
/**
|
|
145
148
|
* The readonly flat store for the table state. Derives from `table.atoms`
|
|
146
149
|
* only; never reads external state directly.
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
const require_utils = require('../../utils.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/core/table/coreTablesFeature.utils.ts
|
|
4
|
+
function table_syncExternalStateToBaseAtoms(table) {
|
|
5
|
+
const state = table.options.state;
|
|
6
|
+
if (!state) return;
|
|
7
|
+
table._reactivity.batch(() => {
|
|
8
|
+
for (const key in state) {
|
|
9
|
+
const baseAtom = table.baseAtoms[key];
|
|
10
|
+
if (!baseAtom) continue;
|
|
11
|
+
const externalState = state[key];
|
|
12
|
+
if (externalState !== baseAtom.get()) baseAtom.set(() => externalState);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
4
16
|
function table_reset(table) {
|
|
5
17
|
const snap = require_utils.cloneState(table.initialState);
|
|
6
18
|
table._reactivity.batch(() => {
|
|
@@ -16,11 +28,14 @@ function table_mergeOptions(table, newOptions) {
|
|
|
16
28
|
}
|
|
17
29
|
function table_setOptions(table, updater) {
|
|
18
30
|
const mergedOptions = table_mergeOptions(table, require_utils.functionalUpdate(updater, table.options));
|
|
19
|
-
table.optionsStore.set(() => mergedOptions);
|
|
31
|
+
if (table.optionsStore) table.optionsStore.set(() => mergedOptions);
|
|
32
|
+
else table.options = mergedOptions;
|
|
33
|
+
table_syncExternalStateToBaseAtoms(table);
|
|
20
34
|
}
|
|
21
35
|
|
|
22
36
|
//#endregion
|
|
23
37
|
exports.table_mergeOptions = table_mergeOptions;
|
|
24
38
|
exports.table_reset = table_reset;
|
|
25
39
|
exports.table_setOptions = table_setOptions;
|
|
40
|
+
exports.table_syncExternalStateToBaseAtoms = table_syncExternalStateToBaseAtoms;
|
|
26
41
|
//# sourceMappingURL=coreTablesFeature.utils.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreTablesFeature.utils.cjs","names":["cloneState","functionalUpdate"],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\nexport function table_reset<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const snap = cloneState(table.initialState)\n table._reactivity.batch(() => {\n for (const key of Object.keys(snap) as Array<keyof typeof snap>) {\n ;(table.baseAtoms as any)[key].set(snap[key] as any)\n }\n })\n}\n\nexport function table_mergeOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n newOptions: TableOptions<TFeatures, TData>,\n) {\n if (table.options.mergeOptions) {\n return table.options.mergeOptions(table.options, newOptions)\n }\n\n return {\n ...table.options,\n ...newOptions,\n }\n}\n\nexport function table_setOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<TableOptions<TFeatures, TData>>,\n): void {\n const newOptions = functionalUpdate(updater, table.options)\n const mergedOptions = table_mergeOptions(table, newOptions)\n table.optionsStore.set(() => mergedOptions)\n}\n"],"mappings":";;;AAMA,SAAgB,YAGd,OAA+C;CAC/C,MAAM,OAAOA,yBAAW,MAAM,aAAa;AAC3C,OAAM,YAAY,YAAY;AAC5B,OAAK,MAAM,OAAO,OAAO,KAAK,KAAK,CAChC,CAAC,MAAM,UAAkB,KAAK,IAAI,KAAK,KAAY;GAEtD;;AAGJ,SAAgB,mBAId,OACA,YACA;AACA,KAAI,MAAM,QAAQ,aAChB,QAAO,MAAM,QAAQ,aAAa,MAAM,SAAS,WAAW;AAG9D,QAAO;EACL,GAAG,MAAM;EACT,GAAG;EACJ;;AAGH,SAAgB,iBAId,OACA,SACM;CAEN,MAAM,gBAAgB,mBAAmB,OADtBC,+BAAiB,SAAS,MAAM,QACO,CAAC;AAC3D,OAAM,aAAa,UAAU,cAAc"}
|
|
1
|
+
{"version":3,"file":"coreTablesFeature.utils.cjs","names":["cloneState","functionalUpdate"],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\nexport function table_syncExternalStateToBaseAtoms<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const state = table.options.state\n if (!state) {\n return\n }\n\n table._reactivity.batch(() => {\n for (const key in state) {\n const baseAtom = (table.baseAtoms as Record<string, any>)[key]\n if (!baseAtom) {\n continue\n }\n\n const externalState = state[key as keyof typeof state]\n if (externalState !== baseAtom.get()) {\n baseAtom.set(() => externalState)\n }\n }\n })\n}\n\nexport function table_reset<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const snap = cloneState(table.initialState)\n table._reactivity.batch(() => {\n for (const key of Object.keys(snap) as Array<keyof typeof snap>) {\n ;(table.baseAtoms as any)[key].set(snap[key] as any)\n }\n })\n}\n\nexport function table_mergeOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n newOptions: TableOptions<TFeatures, TData>,\n) {\n if (table.options.mergeOptions) {\n return table.options.mergeOptions(table.options, newOptions)\n }\n\n return {\n ...table.options,\n ...newOptions,\n }\n}\n\nexport function table_setOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<TableOptions<TFeatures, TData>>,\n): void {\n const newOptions = functionalUpdate(updater, table.options)\n const mergedOptions = table_mergeOptions(table, newOptions)\n if (table.optionsStore) {\n table.optionsStore.set(() => mergedOptions)\n } else {\n table.options = mergedOptions\n }\n table_syncExternalStateToBaseAtoms(table)\n}\n"],"mappings":";;;AAMA,SAAgB,mCAGd,OAA+C;CAC/C,MAAM,QAAQ,MAAM,QAAQ;AAC5B,KAAI,CAAC,MACH;AAGF,OAAM,YAAY,YAAY;AAC5B,OAAK,MAAM,OAAO,OAAO;GACvB,MAAM,WAAY,MAAM,UAAkC;AAC1D,OAAI,CAAC,SACH;GAGF,MAAM,gBAAgB,MAAM;AAC5B,OAAI,kBAAkB,SAAS,KAAK,CAClC,UAAS,UAAU,cAAc;;GAGrC;;AAGJ,SAAgB,YAGd,OAA+C;CAC/C,MAAM,OAAOA,yBAAW,MAAM,aAAa;AAC3C,OAAM,YAAY,YAAY;AAC5B,OAAK,MAAM,OAAO,OAAO,KAAK,KAAK,CAChC,CAAC,MAAM,UAAkB,KAAK,IAAI,KAAK,KAAY;GAEtD;;AAGJ,SAAgB,mBAId,OACA,YACA;AACA,KAAI,MAAM,QAAQ,aAChB,QAAO,MAAM,QAAQ,aAAa,MAAM,SAAS,WAAW;AAG9D,QAAO;EACL,GAAG,MAAM;EACT,GAAG;EACJ;;AAGH,SAAgB,iBAId,OACA,SACM;CAEN,MAAM,gBAAgB,mBAAmB,OADtBC,+BAAiB,SAAS,MAAM,QACO,CAAC;AAC3D,KAAI,MAAM,aACR,OAAM,aAAa,UAAU,cAAc;KAE3C,OAAM,UAAU;AAElB,oCAAmC,MAAM"}
|
|
@@ -4,9 +4,10 @@ import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
|
4
4
|
import { Table_Internal } from "../../types/Table.cjs";
|
|
5
5
|
|
|
6
6
|
//#region src/core/table/coreTablesFeature.utils.d.ts
|
|
7
|
+
declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
|
|
7
8
|
declare function table_reset<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
|
|
8
9
|
declare function table_mergeOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, newOptions: TableOptions<TFeatures, TData>): TableOptions<TFeatures, TData>;
|
|
9
10
|
declare function table_setOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: Updater<TableOptions<TFeatures, TData>>): void;
|
|
10
11
|
//#endregion
|
|
11
|
-
export { table_mergeOptions, table_reset, table_setOptions };
|
|
12
|
+
export { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms };
|
|
12
13
|
//# sourceMappingURL=coreTablesFeature.utils.d.cts.map
|
|
@@ -4,9 +4,10 @@ import { TableFeatures } from "../../types/TableFeatures.js";
|
|
|
4
4
|
import { Table_Internal } from "../../types/Table.js";
|
|
5
5
|
|
|
6
6
|
//#region src/core/table/coreTablesFeature.utils.d.ts
|
|
7
|
+
declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
|
|
7
8
|
declare function table_reset<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
|
|
8
9
|
declare function table_mergeOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, newOptions: TableOptions<TFeatures, TData>): TableOptions<TFeatures, TData>;
|
|
9
10
|
declare function table_setOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: Updater<TableOptions<TFeatures, TData>>): void;
|
|
10
11
|
//#endregion
|
|
11
|
-
export { table_mergeOptions, table_reset, table_setOptions };
|
|
12
|
+
export { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms };
|
|
12
13
|
//# sourceMappingURL=coreTablesFeature.utils.d.ts.map
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { cloneState, functionalUpdate } from "../../utils.js";
|
|
2
2
|
|
|
3
3
|
//#region src/core/table/coreTablesFeature.utils.ts
|
|
4
|
+
function table_syncExternalStateToBaseAtoms(table) {
|
|
5
|
+
const state = table.options.state;
|
|
6
|
+
if (!state) return;
|
|
7
|
+
table._reactivity.batch(() => {
|
|
8
|
+
for (const key in state) {
|
|
9
|
+
const baseAtom = table.baseAtoms[key];
|
|
10
|
+
if (!baseAtom) continue;
|
|
11
|
+
const externalState = state[key];
|
|
12
|
+
if (externalState !== baseAtom.get()) baseAtom.set(() => externalState);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
4
16
|
function table_reset(table) {
|
|
5
17
|
const snap = cloneState(table.initialState);
|
|
6
18
|
table._reactivity.batch(() => {
|
|
@@ -16,9 +28,11 @@ function table_mergeOptions(table, newOptions) {
|
|
|
16
28
|
}
|
|
17
29
|
function table_setOptions(table, updater) {
|
|
18
30
|
const mergedOptions = table_mergeOptions(table, functionalUpdate(updater, table.options));
|
|
19
|
-
table.optionsStore.set(() => mergedOptions);
|
|
31
|
+
if (table.optionsStore) table.optionsStore.set(() => mergedOptions);
|
|
32
|
+
else table.options = mergedOptions;
|
|
33
|
+
table_syncExternalStateToBaseAtoms(table);
|
|
20
34
|
}
|
|
21
35
|
|
|
22
36
|
//#endregion
|
|
23
|
-
export { table_mergeOptions, table_reset, table_setOptions };
|
|
37
|
+
export { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms };
|
|
24
38
|
//# sourceMappingURL=coreTablesFeature.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreTablesFeature.utils.js","names":[],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\nexport function table_reset<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const snap = cloneState(table.initialState)\n table._reactivity.batch(() => {\n for (const key of Object.keys(snap) as Array<keyof typeof snap>) {\n ;(table.baseAtoms as any)[key].set(snap[key] as any)\n }\n })\n}\n\nexport function table_mergeOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n newOptions: TableOptions<TFeatures, TData>,\n) {\n if (table.options.mergeOptions) {\n return table.options.mergeOptions(table.options, newOptions)\n }\n\n return {\n ...table.options,\n ...newOptions,\n }\n}\n\nexport function table_setOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<TableOptions<TFeatures, TData>>,\n): void {\n const newOptions = functionalUpdate(updater, table.options)\n const mergedOptions = table_mergeOptions(table, newOptions)\n table.optionsStore.set(() => mergedOptions)\n}\n"],"mappings":";;;AAMA,SAAgB,YAGd,OAA+C;CAC/C,MAAM,OAAO,WAAW,MAAM,aAAa;AAC3C,OAAM,YAAY,YAAY;AAC5B,OAAK,MAAM,OAAO,OAAO,KAAK,KAAK,CAChC,CAAC,MAAM,UAAkB,KAAK,IAAI,KAAK,KAAY;GAEtD;;AAGJ,SAAgB,mBAId,OACA,YACA;AACA,KAAI,MAAM,QAAQ,aAChB,QAAO,MAAM,QAAQ,aAAa,MAAM,SAAS,WAAW;AAG9D,QAAO;EACL,GAAG,MAAM;EACT,GAAG;EACJ;;AAGH,SAAgB,iBAId,OACA,SACM;CAEN,MAAM,gBAAgB,mBAAmB,OADtB,iBAAiB,SAAS,MAAM,QACO,CAAC;AAC3D,OAAM,aAAa,UAAU,cAAc"}
|
|
1
|
+
{"version":3,"file":"coreTablesFeature.utils.js","names":[],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\nexport function table_syncExternalStateToBaseAtoms<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const state = table.options.state\n if (!state) {\n return\n }\n\n table._reactivity.batch(() => {\n for (const key in state) {\n const baseAtom = (table.baseAtoms as Record<string, any>)[key]\n if (!baseAtom) {\n continue\n }\n\n const externalState = state[key as keyof typeof state]\n if (externalState !== baseAtom.get()) {\n baseAtom.set(() => externalState)\n }\n }\n })\n}\n\nexport function table_reset<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const snap = cloneState(table.initialState)\n table._reactivity.batch(() => {\n for (const key of Object.keys(snap) as Array<keyof typeof snap>) {\n ;(table.baseAtoms as any)[key].set(snap[key] as any)\n }\n })\n}\n\nexport function table_mergeOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n newOptions: TableOptions<TFeatures, TData>,\n) {\n if (table.options.mergeOptions) {\n return table.options.mergeOptions(table.options, newOptions)\n }\n\n return {\n ...table.options,\n ...newOptions,\n }\n}\n\nexport function table_setOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<TableOptions<TFeatures, TData>>,\n): void {\n const newOptions = functionalUpdate(updater, table.options)\n const mergedOptions = table_mergeOptions(table, newOptions)\n if (table.optionsStore) {\n table.optionsStore.set(() => mergedOptions)\n } else {\n table.options = mergedOptions\n }\n table_syncExternalStateToBaseAtoms(table)\n}\n"],"mappings":";;;AAMA,SAAgB,mCAGd,OAA+C;CAC/C,MAAM,QAAQ,MAAM,QAAQ;AAC5B,KAAI,CAAC,MACH;AAGF,OAAM,YAAY,YAAY;AAC5B,OAAK,MAAM,OAAO,OAAO;GACvB,MAAM,WAAY,MAAM,UAAkC;AAC1D,OAAI,CAAC,SACH;GAGF,MAAM,gBAAgB,MAAM;AAC5B,OAAI,kBAAkB,SAAS,KAAK,CAClC,UAAS,UAAU,cAAc;;GAGrC;;AAGJ,SAAgB,YAGd,OAA+C;CAC/C,MAAM,OAAO,WAAW,MAAM,aAAa;AAC3C,OAAM,YAAY,YAAY;AAC5B,OAAK,MAAM,OAAO,OAAO,KAAK,KAAK,CAChC,CAAC,MAAM,UAAkB,KAAK,IAAI,KAAK,KAAY;GAEtD;;AAGJ,SAAgB,mBAId,OACA,YACA;AACA,KAAI,MAAM,QAAQ,aAChB,QAAO,MAAM,QAAQ,aAAa,MAAM,SAAS,WAAW;AAG9D,QAAO;EACL,GAAG,MAAM;EACT,GAAG;EACJ;;AAGH,SAAgB,iBAId,OACA,SACM;CAEN,MAAM,gBAAgB,mBAAmB,OADtB,iBAAiB,SAAS,MAAM,QACO,CAAC;AAC3D,KAAI,MAAM,aACR,OAAM,aAAa,UAAU,cAAc;KAE3C,OAAM,UAAU;AAElB,oCAAmC,MAAM"}
|
package/dist/reactivity.cjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_coreReactivityFeature_utils = require('./core/reactivity/coreReactivityFeature.utils.cjs');
|
|
3
|
-
const require_constructReactivityBindings = require('./core/reactivity/constructReactivityBindings.cjs');
|
|
4
3
|
|
|
5
|
-
exports.atomToStore = require_coreReactivityFeature_utils.atomToStore;
|
|
6
|
-
exports.constructReactivityBindings = require_constructReactivityBindings.constructReactivityBindings;
|
|
4
|
+
exports.atomToStore = require_coreReactivityFeature_utils.atomToStore;
|
package/dist/reactivity.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { TableAtomOptions, TableReactivityBindings } from "./core/reactivity/coreReactivityFeature.types.cjs";
|
|
2
|
-
import { constructReactivityBindings } from "./core/reactivity/constructReactivityBindings.cjs";
|
|
3
2
|
import { atomToStore } from "./core/reactivity/coreReactivityFeature.utils.cjs";
|
|
4
|
-
export { TableAtomOptions, TableReactivityBindings, atomToStore
|
|
3
|
+
export { TableAtomOptions, TableReactivityBindings, atomToStore };
|
package/dist/reactivity.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { TableAtomOptions, TableReactivityBindings } from "./core/reactivity/coreReactivityFeature.types.js";
|
|
2
|
-
import { constructReactivityBindings } from "./core/reactivity/constructReactivityBindings.js";
|
|
3
2
|
import { atomToStore } from "./core/reactivity/coreReactivityFeature.utils.js";
|
|
4
|
-
export { TableAtomOptions, TableReactivityBindings, atomToStore
|
|
3
|
+
export { TableAtomOptions, TableReactivityBindings, atomToStore };
|
package/dist/reactivity.js
CHANGED
|
@@ -255,6 +255,7 @@ exports.table_setPagination = require_rowPaginationFeature_utils.table_setPagina
|
|
|
255
255
|
exports.table_setRowPinning = require_rowPinningFeature_utils.table_setRowPinning;
|
|
256
256
|
exports.table_setRowSelection = require_rowSelectionFeature_utils.table_setRowSelection;
|
|
257
257
|
exports.table_setSorting = require_rowSortingFeature_utils.table_setSorting;
|
|
258
|
+
exports.table_syncExternalStateToBaseAtoms = require_coreTablesFeature_utils.table_syncExternalStateToBaseAtoms;
|
|
258
259
|
exports.table_toggleAllColumnsVisible = require_columnVisibilityFeature_utils.table_toggleAllColumnsVisible;
|
|
259
260
|
exports.table_toggleAllPageRowsSelected = require_rowSelectionFeature_utils.table_toggleAllPageRowsSelected;
|
|
260
261
|
exports.table_toggleAllRowsExpanded = require_rowExpandingFeature_utils.table_toggleAllRowsExpanded;
|
|
@@ -3,7 +3,7 @@ import { column_getFlatColumns, column_getLeafColumns, table_getAllColumns, tabl
|
|
|
3
3
|
import { header_getContext, header_getLeafHeaders, table_getFlatHeaders, table_getFooterGroups, table_getHeaderGroups, table_getLeafHeaders } from "./core/headers/coreHeadersFeature.utils.cjs";
|
|
4
4
|
import { row_getAllCells, row_getAllCellsByColumnId, row_getLeafRows, row_getParentRow, row_getParentRows, row_getUniqueValues, row_getValue, row_renderValue, table_getRow, table_getRowId } from "./core/rows/coreRowsFeature.utils.cjs";
|
|
5
5
|
import { table_getCoreRowModel, table_getExpandedRowModel, table_getFilteredRowModel, table_getGroupedRowModel, table_getPaginatedRowModel, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSortedRowModel, table_getRowModel, table_getSortedRowModel } from "./core/row-models/coreRowModelsFeature.utils.cjs";
|
|
6
|
-
import { table_mergeOptions, table_reset, table_setOptions } from "./core/table/coreTablesFeature.utils.cjs";
|
|
6
|
+
import { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms } from "./core/table/coreTablesFeature.utils.cjs";
|
|
7
7
|
import { column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues } from "./features/column-faceting/columnFacetingFeature.utils.cjs";
|
|
8
8
|
import { column_getAutoFilterFn, column_getCanFilter, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getIsFiltered, column_setFilterValue, getDefaultColumnFiltersState, shouldAutoRemoveFilter, table_resetColumnFilters, table_setColumnFilters } from "./features/column-filtering/columnFilteringFeature.utils.cjs";
|
|
9
9
|
import { cell_getIsAggregated, cell_getIsGrouped, cell_getIsPlaceholder, column_getAggregationFn, column_getAutoAggregationFn, column_getCanGroup, column_getGroupedIndex, column_getIsGrouped, column_getToggleGroupingHandler, column_toggleGrouping, getDefaultGroupingState, row_getGroupingValue, row_getIsGrouped, table_resetGrouping, table_setGrouping } from "./features/column-grouping/columnGroupingFeature.utils.cjs";
|
|
@@ -18,4 +18,4 @@ import { getDefaultPaginationState, table_autoResetPageIndex, table_firstPage, t
|
|
|
18
18
|
import { getDefaultRowPinningState, row_getCanPin, row_getIsPinned, row_getPinnedIndex, row_pin, table_getBottomRows, table_getCenterRows, table_getIsSomeRowsPinned, table_getTopRows, table_resetRowPinning, table_setRowPinning } from "./features/row-pinning/rowPinningFeature.utils.cjs";
|
|
19
19
|
import { getDefaultRowSelectionState, isRowSelected, isSubRowSelected, row_getCanMultiSelect, row_getCanSelect, row_getCanSelectSubRows, row_getIsAllSubRowsSelected, row_getIsSelected, row_getIsSomeSelected, row_getToggleSelectedHandler, row_toggleSelected, selectRowsFn, table_getFilteredSelectedRowModel, table_getGroupedSelectedRowModel, table_getIsAllPageRowsSelected, table_getIsAllRowsSelected, table_getIsSomePageRowsSelected, table_getIsSomeRowsSelected, table_getPreSelectedRowModel, table_getSelectedRowModel, table_getToggleAllPageRowsSelectedHandler, table_getToggleAllRowsSelectedHandler, table_resetRowSelection, table_setRowSelection, table_toggleAllPageRowsSelected, table_toggleAllRowsSelected } from "./features/row-selection/rowSelectionFeature.utils.cjs";
|
|
20
20
|
import { column_clearSorting, column_getAutoSortDir, column_getAutoSortFn, column_getCanMultiSort, column_getCanSort, column_getFirstSortDir, column_getIsSorted, column_getNextSortingOrder, column_getSortFn, column_getSortIndex, column_getToggleSortingHandler, column_toggleSorting, getDefaultSortingState, table_resetSorting, table_setSorting } from "./features/row-sorting/rowSortingFeature.utils.cjs";
|
|
21
|
-
export { cell_getContext, cell_getIsAggregated, cell_getIsGrouped, cell_getIsPlaceholder, cell_getValue, cell_renderValue, column_clearSorting, column_getAfter, column_getAggregationFn, column_getAutoAggregationFn, column_getAutoFilterFn, column_getAutoSortDir, column_getAutoSortFn, column_getCanFilter, column_getCanGlobalFilter, column_getCanGroup, column_getCanHide, column_getCanMultiSort, column_getCanPin, column_getCanResize, column_getCanSort, column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getFirstSortDir, column_getFlatColumns, column_getGroupedIndex, column_getIndex, column_getIsFiltered, column_getIsFirstColumn, column_getIsGrouped, column_getIsLastColumn, column_getIsPinned, column_getIsResizing, column_getIsSorted, column_getIsVisible, column_getLeafColumns, column_getNextSortingOrder, column_getPinnedIndex, column_getSize, column_getSortFn, column_getSortIndex, column_getStart, column_getToggleGroupingHandler, column_getToggleSortingHandler, column_getToggleVisibilityHandler, column_pin, column_resetSize, column_setFilterValue, column_toggleGrouping, column_toggleSorting, column_toggleVisibility, getDefaultColumnFiltersState, getDefaultColumnOrderState, getDefaultColumnPinningState, getDefaultColumnResizingState, getDefaultColumnSizingColumnDef, getDefaultColumnSizingState, getDefaultColumnVisibilityState, getDefaultExpandedState, getDefaultGroupingState, getDefaultPaginationState, getDefaultRowPinningState, getDefaultRowSelectionState, getDefaultSortingState, header_getContext, header_getLeafHeaders, header_getResizeHandler, header_getSize, header_getStart, isRowSelected, isSubRowSelected, isTouchStartEvent, orderColumns, passiveEventSupported, row_getAllCells, row_getAllCellsByColumnId, row_getAllVisibleCells, row_getCanExpand, row_getCanMultiSelect, row_getCanPin, row_getCanSelect, row_getCanSelectSubRows, row_getCenterVisibleCells, row_getGroupingValue, row_getIsAllParentsExpanded, row_getIsAllSubRowsSelected, row_getIsExpanded, row_getIsGrouped, row_getIsPinned, row_getIsSelected, row_getIsSomeSelected, row_getLeafRows, row_getLeftVisibleCells, row_getParentRow, row_getParentRows, row_getPinnedIndex, row_getRightVisibleCells, row_getToggleExpandedHandler, row_getToggleSelectedHandler, row_getUniqueValues, row_getValue, row_getVisibleCells, row_pin, row_renderValue, row_toggleExpanded, row_toggleSelected, selectRowsFn, shouldAutoRemoveFilter, table_autoResetExpanded, table_autoResetPageIndex, table_firstPage, table_getAllColumns, table_getAllFlatColumns, table_getAllFlatColumnsById, table_getAllLeafColumns, table_getBottomRows, table_getCanNextPage, table_getCanPreviousPage, table_getCanSomeRowsExpand, table_getCenterFlatHeaders, table_getCenterFooterGroups, table_getCenterHeaderGroups, table_getCenterLeafColumns, table_getCenterLeafHeaders, table_getCenterRows, table_getCenterTotalSize, table_getCenterVisibleLeafColumns, table_getColumn, table_getCoreRowModel, table_getDefaultColumnDef, table_getExpandedDepth, table_getExpandedRowModel, table_getFilteredRowModel, table_getFilteredSelectedRowModel, table_getFlatHeaders, table_getFooterGroups, table_getGlobalAutoFilterFn, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues, table_getGlobalFilterFn, table_getGroupedRowModel, table_getGroupedSelectedRowModel, table_getHeaderGroups, table_getIsAllColumnsVisible, table_getIsAllPageRowsSelected, table_getIsAllRowsExpanded, table_getIsAllRowsSelected, table_getIsSomeColumnsPinned, table_getIsSomeColumnsVisible, table_getIsSomePageRowsSelected, table_getIsSomeRowsExpanded, table_getIsSomeRowsPinned, table_getIsSomeRowsSelected, table_getLeafHeaders, table_getLeftFlatHeaders, table_getLeftFooterGroups, table_getLeftHeaderGroups, table_getLeftLeafColumns, table_getLeftLeafHeaders, table_getLeftTotalSize, table_getLeftVisibleLeafColumns, table_getOrderColumnsFn, table_getPageCount, table_getPageOptions, table_getPaginatedRowModel, table_getPinnedLeafColumns, table_getPinnedVisibleLeafColumns, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSelectedRowModel, table_getPreSortedRowModel, table_getRightFlatHeaders, table_getRightFooterGroups, table_getRightHeaderGroups, table_getRightLeafColumns, table_getRightLeafHeaders, table_getRightTotalSize, table_getRightVisibleLeafColumns, table_getRow, table_getRowCount, table_getRowId, table_getRowModel, table_getSelectedRowModel, table_getSortedRowModel, table_getToggleAllColumnsVisibilityHandler, table_getToggleAllPageRowsSelectedHandler, table_getToggleAllRowsExpandedHandler, table_getToggleAllRowsSelectedHandler, table_getTopRows, table_getTotalSize, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_lastPage, table_mergeOptions, table_nextPage, table_previousPage, table_reset, table_resetColumnFilters, table_resetColumnOrder, table_resetColumnPinning, table_resetColumnSizing, table_resetColumnVisibility, table_resetExpanded, table_resetGlobalFilter, table_resetGrouping, table_resetHeaderSizeInfo, table_resetPageIndex, table_resetPageSize, table_resetPagination, table_resetRowPinning, table_resetRowSelection, table_resetSorting, table_setColumnFilters, table_setColumnOrder, table_setColumnPinning, table_setColumnResizing, table_setColumnSizing, table_setColumnVisibility, table_setExpanded, table_setGlobalFilter, table_setGrouping, table_setOptions, table_setPageIndex, table_setPageSize, table_setPagination, table_setRowPinning, table_setRowSelection, table_setSorting, table_toggleAllColumnsVisible, table_toggleAllPageRowsSelected, table_toggleAllRowsExpanded, table_toggleAllRowsSelected };
|
|
21
|
+
export { cell_getContext, cell_getIsAggregated, cell_getIsGrouped, cell_getIsPlaceholder, cell_getValue, cell_renderValue, column_clearSorting, column_getAfter, column_getAggregationFn, column_getAutoAggregationFn, column_getAutoFilterFn, column_getAutoSortDir, column_getAutoSortFn, column_getCanFilter, column_getCanGlobalFilter, column_getCanGroup, column_getCanHide, column_getCanMultiSort, column_getCanPin, column_getCanResize, column_getCanSort, column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getFirstSortDir, column_getFlatColumns, column_getGroupedIndex, column_getIndex, column_getIsFiltered, column_getIsFirstColumn, column_getIsGrouped, column_getIsLastColumn, column_getIsPinned, column_getIsResizing, column_getIsSorted, column_getIsVisible, column_getLeafColumns, column_getNextSortingOrder, column_getPinnedIndex, column_getSize, column_getSortFn, column_getSortIndex, column_getStart, column_getToggleGroupingHandler, column_getToggleSortingHandler, column_getToggleVisibilityHandler, column_pin, column_resetSize, column_setFilterValue, column_toggleGrouping, column_toggleSorting, column_toggleVisibility, getDefaultColumnFiltersState, getDefaultColumnOrderState, getDefaultColumnPinningState, getDefaultColumnResizingState, getDefaultColumnSizingColumnDef, getDefaultColumnSizingState, getDefaultColumnVisibilityState, getDefaultExpandedState, getDefaultGroupingState, getDefaultPaginationState, getDefaultRowPinningState, getDefaultRowSelectionState, getDefaultSortingState, header_getContext, header_getLeafHeaders, header_getResizeHandler, header_getSize, header_getStart, isRowSelected, isSubRowSelected, isTouchStartEvent, orderColumns, passiveEventSupported, row_getAllCells, row_getAllCellsByColumnId, row_getAllVisibleCells, row_getCanExpand, row_getCanMultiSelect, row_getCanPin, row_getCanSelect, row_getCanSelectSubRows, row_getCenterVisibleCells, row_getGroupingValue, row_getIsAllParentsExpanded, row_getIsAllSubRowsSelected, row_getIsExpanded, row_getIsGrouped, row_getIsPinned, row_getIsSelected, row_getIsSomeSelected, row_getLeafRows, row_getLeftVisibleCells, row_getParentRow, row_getParentRows, row_getPinnedIndex, row_getRightVisibleCells, row_getToggleExpandedHandler, row_getToggleSelectedHandler, row_getUniqueValues, row_getValue, row_getVisibleCells, row_pin, row_renderValue, row_toggleExpanded, row_toggleSelected, selectRowsFn, shouldAutoRemoveFilter, table_autoResetExpanded, table_autoResetPageIndex, table_firstPage, table_getAllColumns, table_getAllFlatColumns, table_getAllFlatColumnsById, table_getAllLeafColumns, table_getBottomRows, table_getCanNextPage, table_getCanPreviousPage, table_getCanSomeRowsExpand, table_getCenterFlatHeaders, table_getCenterFooterGroups, table_getCenterHeaderGroups, table_getCenterLeafColumns, table_getCenterLeafHeaders, table_getCenterRows, table_getCenterTotalSize, table_getCenterVisibleLeafColumns, table_getColumn, table_getCoreRowModel, table_getDefaultColumnDef, table_getExpandedDepth, table_getExpandedRowModel, table_getFilteredRowModel, table_getFilteredSelectedRowModel, table_getFlatHeaders, table_getFooterGroups, table_getGlobalAutoFilterFn, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues, table_getGlobalFilterFn, table_getGroupedRowModel, table_getGroupedSelectedRowModel, table_getHeaderGroups, table_getIsAllColumnsVisible, table_getIsAllPageRowsSelected, table_getIsAllRowsExpanded, table_getIsAllRowsSelected, table_getIsSomeColumnsPinned, table_getIsSomeColumnsVisible, table_getIsSomePageRowsSelected, table_getIsSomeRowsExpanded, table_getIsSomeRowsPinned, table_getIsSomeRowsSelected, table_getLeafHeaders, table_getLeftFlatHeaders, table_getLeftFooterGroups, table_getLeftHeaderGroups, table_getLeftLeafColumns, table_getLeftLeafHeaders, table_getLeftTotalSize, table_getLeftVisibleLeafColumns, table_getOrderColumnsFn, table_getPageCount, table_getPageOptions, table_getPaginatedRowModel, table_getPinnedLeafColumns, table_getPinnedVisibleLeafColumns, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSelectedRowModel, table_getPreSortedRowModel, table_getRightFlatHeaders, table_getRightFooterGroups, table_getRightHeaderGroups, table_getRightLeafColumns, table_getRightLeafHeaders, table_getRightTotalSize, table_getRightVisibleLeafColumns, table_getRow, table_getRowCount, table_getRowId, table_getRowModel, table_getSelectedRowModel, table_getSortedRowModel, table_getToggleAllColumnsVisibilityHandler, table_getToggleAllPageRowsSelectedHandler, table_getToggleAllRowsExpandedHandler, table_getToggleAllRowsSelectedHandler, table_getTopRows, table_getTotalSize, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_lastPage, table_mergeOptions, table_nextPage, table_previousPage, table_reset, table_resetColumnFilters, table_resetColumnOrder, table_resetColumnPinning, table_resetColumnSizing, table_resetColumnVisibility, table_resetExpanded, table_resetGlobalFilter, table_resetGrouping, table_resetHeaderSizeInfo, table_resetPageIndex, table_resetPageSize, table_resetPagination, table_resetRowPinning, table_resetRowSelection, table_resetSorting, table_setColumnFilters, table_setColumnOrder, table_setColumnPinning, table_setColumnResizing, table_setColumnSizing, table_setColumnVisibility, table_setExpanded, table_setGlobalFilter, table_setGrouping, table_setOptions, table_setPageIndex, table_setPageSize, table_setPagination, table_setRowPinning, table_setRowSelection, table_setSorting, table_syncExternalStateToBaseAtoms, table_toggleAllColumnsVisible, table_toggleAllPageRowsSelected, table_toggleAllRowsExpanded, table_toggleAllRowsSelected };
|
|
@@ -3,7 +3,7 @@ import { column_getFlatColumns, column_getLeafColumns, table_getAllColumns, tabl
|
|
|
3
3
|
import { header_getContext, header_getLeafHeaders, table_getFlatHeaders, table_getFooterGroups, table_getHeaderGroups, table_getLeafHeaders } from "./core/headers/coreHeadersFeature.utils.js";
|
|
4
4
|
import { row_getAllCells, row_getAllCellsByColumnId, row_getLeafRows, row_getParentRow, row_getParentRows, row_getUniqueValues, row_getValue, row_renderValue, table_getRow, table_getRowId } from "./core/rows/coreRowsFeature.utils.js";
|
|
5
5
|
import { table_getCoreRowModel, table_getExpandedRowModel, table_getFilteredRowModel, table_getGroupedRowModel, table_getPaginatedRowModel, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSortedRowModel, table_getRowModel, table_getSortedRowModel } from "./core/row-models/coreRowModelsFeature.utils.js";
|
|
6
|
-
import { table_mergeOptions, table_reset, table_setOptions } from "./core/table/coreTablesFeature.utils.js";
|
|
6
|
+
import { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms } from "./core/table/coreTablesFeature.utils.js";
|
|
7
7
|
import { column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues } from "./features/column-faceting/columnFacetingFeature.utils.js";
|
|
8
8
|
import { column_getAutoFilterFn, column_getCanFilter, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getIsFiltered, column_setFilterValue, getDefaultColumnFiltersState, shouldAutoRemoveFilter, table_resetColumnFilters, table_setColumnFilters } from "./features/column-filtering/columnFilteringFeature.utils.js";
|
|
9
9
|
import { cell_getIsAggregated, cell_getIsGrouped, cell_getIsPlaceholder, column_getAggregationFn, column_getAutoAggregationFn, column_getCanGroup, column_getGroupedIndex, column_getIsGrouped, column_getToggleGroupingHandler, column_toggleGrouping, getDefaultGroupingState, row_getGroupingValue, row_getIsGrouped, table_resetGrouping, table_setGrouping } from "./features/column-grouping/columnGroupingFeature.utils.js";
|
|
@@ -18,4 +18,4 @@ import { getDefaultPaginationState, table_autoResetPageIndex, table_firstPage, t
|
|
|
18
18
|
import { getDefaultRowPinningState, row_getCanPin, row_getIsPinned, row_getPinnedIndex, row_pin, table_getBottomRows, table_getCenterRows, table_getIsSomeRowsPinned, table_getTopRows, table_resetRowPinning, table_setRowPinning } from "./features/row-pinning/rowPinningFeature.utils.js";
|
|
19
19
|
import { getDefaultRowSelectionState, isRowSelected, isSubRowSelected, row_getCanMultiSelect, row_getCanSelect, row_getCanSelectSubRows, row_getIsAllSubRowsSelected, row_getIsSelected, row_getIsSomeSelected, row_getToggleSelectedHandler, row_toggleSelected, selectRowsFn, table_getFilteredSelectedRowModel, table_getGroupedSelectedRowModel, table_getIsAllPageRowsSelected, table_getIsAllRowsSelected, table_getIsSomePageRowsSelected, table_getIsSomeRowsSelected, table_getPreSelectedRowModel, table_getSelectedRowModel, table_getToggleAllPageRowsSelectedHandler, table_getToggleAllRowsSelectedHandler, table_resetRowSelection, table_setRowSelection, table_toggleAllPageRowsSelected, table_toggleAllRowsSelected } from "./features/row-selection/rowSelectionFeature.utils.js";
|
|
20
20
|
import { column_clearSorting, column_getAutoSortDir, column_getAutoSortFn, column_getCanMultiSort, column_getCanSort, column_getFirstSortDir, column_getIsSorted, column_getNextSortingOrder, column_getSortFn, column_getSortIndex, column_getToggleSortingHandler, column_toggleSorting, getDefaultSortingState, table_resetSorting, table_setSorting } from "./features/row-sorting/rowSortingFeature.utils.js";
|
|
21
|
-
export { cell_getContext, cell_getIsAggregated, cell_getIsGrouped, cell_getIsPlaceholder, cell_getValue, cell_renderValue, column_clearSorting, column_getAfter, column_getAggregationFn, column_getAutoAggregationFn, column_getAutoFilterFn, column_getAutoSortDir, column_getAutoSortFn, column_getCanFilter, column_getCanGlobalFilter, column_getCanGroup, column_getCanHide, column_getCanMultiSort, column_getCanPin, column_getCanResize, column_getCanSort, column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getFirstSortDir, column_getFlatColumns, column_getGroupedIndex, column_getIndex, column_getIsFiltered, column_getIsFirstColumn, column_getIsGrouped, column_getIsLastColumn, column_getIsPinned, column_getIsResizing, column_getIsSorted, column_getIsVisible, column_getLeafColumns, column_getNextSortingOrder, column_getPinnedIndex, column_getSize, column_getSortFn, column_getSortIndex, column_getStart, column_getToggleGroupingHandler, column_getToggleSortingHandler, column_getToggleVisibilityHandler, column_pin, column_resetSize, column_setFilterValue, column_toggleGrouping, column_toggleSorting, column_toggleVisibility, getDefaultColumnFiltersState, getDefaultColumnOrderState, getDefaultColumnPinningState, getDefaultColumnResizingState, getDefaultColumnSizingColumnDef, getDefaultColumnSizingState, getDefaultColumnVisibilityState, getDefaultExpandedState, getDefaultGroupingState, getDefaultPaginationState, getDefaultRowPinningState, getDefaultRowSelectionState, getDefaultSortingState, header_getContext, header_getLeafHeaders, header_getResizeHandler, header_getSize, header_getStart, isRowSelected, isSubRowSelected, isTouchStartEvent, orderColumns, passiveEventSupported, row_getAllCells, row_getAllCellsByColumnId, row_getAllVisibleCells, row_getCanExpand, row_getCanMultiSelect, row_getCanPin, row_getCanSelect, row_getCanSelectSubRows, row_getCenterVisibleCells, row_getGroupingValue, row_getIsAllParentsExpanded, row_getIsAllSubRowsSelected, row_getIsExpanded, row_getIsGrouped, row_getIsPinned, row_getIsSelected, row_getIsSomeSelected, row_getLeafRows, row_getLeftVisibleCells, row_getParentRow, row_getParentRows, row_getPinnedIndex, row_getRightVisibleCells, row_getToggleExpandedHandler, row_getToggleSelectedHandler, row_getUniqueValues, row_getValue, row_getVisibleCells, row_pin, row_renderValue, row_toggleExpanded, row_toggleSelected, selectRowsFn, shouldAutoRemoveFilter, table_autoResetExpanded, table_autoResetPageIndex, table_firstPage, table_getAllColumns, table_getAllFlatColumns, table_getAllFlatColumnsById, table_getAllLeafColumns, table_getBottomRows, table_getCanNextPage, table_getCanPreviousPage, table_getCanSomeRowsExpand, table_getCenterFlatHeaders, table_getCenterFooterGroups, table_getCenterHeaderGroups, table_getCenterLeafColumns, table_getCenterLeafHeaders, table_getCenterRows, table_getCenterTotalSize, table_getCenterVisibleLeafColumns, table_getColumn, table_getCoreRowModel, table_getDefaultColumnDef, table_getExpandedDepth, table_getExpandedRowModel, table_getFilteredRowModel, table_getFilteredSelectedRowModel, table_getFlatHeaders, table_getFooterGroups, table_getGlobalAutoFilterFn, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues, table_getGlobalFilterFn, table_getGroupedRowModel, table_getGroupedSelectedRowModel, table_getHeaderGroups, table_getIsAllColumnsVisible, table_getIsAllPageRowsSelected, table_getIsAllRowsExpanded, table_getIsAllRowsSelected, table_getIsSomeColumnsPinned, table_getIsSomeColumnsVisible, table_getIsSomePageRowsSelected, table_getIsSomeRowsExpanded, table_getIsSomeRowsPinned, table_getIsSomeRowsSelected, table_getLeafHeaders, table_getLeftFlatHeaders, table_getLeftFooterGroups, table_getLeftHeaderGroups, table_getLeftLeafColumns, table_getLeftLeafHeaders, table_getLeftTotalSize, table_getLeftVisibleLeafColumns, table_getOrderColumnsFn, table_getPageCount, table_getPageOptions, table_getPaginatedRowModel, table_getPinnedLeafColumns, table_getPinnedVisibleLeafColumns, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSelectedRowModel, table_getPreSortedRowModel, table_getRightFlatHeaders, table_getRightFooterGroups, table_getRightHeaderGroups, table_getRightLeafColumns, table_getRightLeafHeaders, table_getRightTotalSize, table_getRightVisibleLeafColumns, table_getRow, table_getRowCount, table_getRowId, table_getRowModel, table_getSelectedRowModel, table_getSortedRowModel, table_getToggleAllColumnsVisibilityHandler, table_getToggleAllPageRowsSelectedHandler, table_getToggleAllRowsExpandedHandler, table_getToggleAllRowsSelectedHandler, table_getTopRows, table_getTotalSize, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_lastPage, table_mergeOptions, table_nextPage, table_previousPage, table_reset, table_resetColumnFilters, table_resetColumnOrder, table_resetColumnPinning, table_resetColumnSizing, table_resetColumnVisibility, table_resetExpanded, table_resetGlobalFilter, table_resetGrouping, table_resetHeaderSizeInfo, table_resetPageIndex, table_resetPageSize, table_resetPagination, table_resetRowPinning, table_resetRowSelection, table_resetSorting, table_setColumnFilters, table_setColumnOrder, table_setColumnPinning, table_setColumnResizing, table_setColumnSizing, table_setColumnVisibility, table_setExpanded, table_setGlobalFilter, table_setGrouping, table_setOptions, table_setPageIndex, table_setPageSize, table_setPagination, table_setRowPinning, table_setRowSelection, table_setSorting, table_toggleAllColumnsVisible, table_toggleAllPageRowsSelected, table_toggleAllRowsExpanded, table_toggleAllRowsSelected };
|
|
21
|
+
export { cell_getContext, cell_getIsAggregated, cell_getIsGrouped, cell_getIsPlaceholder, cell_getValue, cell_renderValue, column_clearSorting, column_getAfter, column_getAggregationFn, column_getAutoAggregationFn, column_getAutoFilterFn, column_getAutoSortDir, column_getAutoSortFn, column_getCanFilter, column_getCanGlobalFilter, column_getCanGroup, column_getCanHide, column_getCanMultiSort, column_getCanPin, column_getCanResize, column_getCanSort, column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getFirstSortDir, column_getFlatColumns, column_getGroupedIndex, column_getIndex, column_getIsFiltered, column_getIsFirstColumn, column_getIsGrouped, column_getIsLastColumn, column_getIsPinned, column_getIsResizing, column_getIsSorted, column_getIsVisible, column_getLeafColumns, column_getNextSortingOrder, column_getPinnedIndex, column_getSize, column_getSortFn, column_getSortIndex, column_getStart, column_getToggleGroupingHandler, column_getToggleSortingHandler, column_getToggleVisibilityHandler, column_pin, column_resetSize, column_setFilterValue, column_toggleGrouping, column_toggleSorting, column_toggleVisibility, getDefaultColumnFiltersState, getDefaultColumnOrderState, getDefaultColumnPinningState, getDefaultColumnResizingState, getDefaultColumnSizingColumnDef, getDefaultColumnSizingState, getDefaultColumnVisibilityState, getDefaultExpandedState, getDefaultGroupingState, getDefaultPaginationState, getDefaultRowPinningState, getDefaultRowSelectionState, getDefaultSortingState, header_getContext, header_getLeafHeaders, header_getResizeHandler, header_getSize, header_getStart, isRowSelected, isSubRowSelected, isTouchStartEvent, orderColumns, passiveEventSupported, row_getAllCells, row_getAllCellsByColumnId, row_getAllVisibleCells, row_getCanExpand, row_getCanMultiSelect, row_getCanPin, row_getCanSelect, row_getCanSelectSubRows, row_getCenterVisibleCells, row_getGroupingValue, row_getIsAllParentsExpanded, row_getIsAllSubRowsSelected, row_getIsExpanded, row_getIsGrouped, row_getIsPinned, row_getIsSelected, row_getIsSomeSelected, row_getLeafRows, row_getLeftVisibleCells, row_getParentRow, row_getParentRows, row_getPinnedIndex, row_getRightVisibleCells, row_getToggleExpandedHandler, row_getToggleSelectedHandler, row_getUniqueValues, row_getValue, row_getVisibleCells, row_pin, row_renderValue, row_toggleExpanded, row_toggleSelected, selectRowsFn, shouldAutoRemoveFilter, table_autoResetExpanded, table_autoResetPageIndex, table_firstPage, table_getAllColumns, table_getAllFlatColumns, table_getAllFlatColumnsById, table_getAllLeafColumns, table_getBottomRows, table_getCanNextPage, table_getCanPreviousPage, table_getCanSomeRowsExpand, table_getCenterFlatHeaders, table_getCenterFooterGroups, table_getCenterHeaderGroups, table_getCenterLeafColumns, table_getCenterLeafHeaders, table_getCenterRows, table_getCenterTotalSize, table_getCenterVisibleLeafColumns, table_getColumn, table_getCoreRowModel, table_getDefaultColumnDef, table_getExpandedDepth, table_getExpandedRowModel, table_getFilteredRowModel, table_getFilteredSelectedRowModel, table_getFlatHeaders, table_getFooterGroups, table_getGlobalAutoFilterFn, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues, table_getGlobalFilterFn, table_getGroupedRowModel, table_getGroupedSelectedRowModel, table_getHeaderGroups, table_getIsAllColumnsVisible, table_getIsAllPageRowsSelected, table_getIsAllRowsExpanded, table_getIsAllRowsSelected, table_getIsSomeColumnsPinned, table_getIsSomeColumnsVisible, table_getIsSomePageRowsSelected, table_getIsSomeRowsExpanded, table_getIsSomeRowsPinned, table_getIsSomeRowsSelected, table_getLeafHeaders, table_getLeftFlatHeaders, table_getLeftFooterGroups, table_getLeftHeaderGroups, table_getLeftLeafColumns, table_getLeftLeafHeaders, table_getLeftTotalSize, table_getLeftVisibleLeafColumns, table_getOrderColumnsFn, table_getPageCount, table_getPageOptions, table_getPaginatedRowModel, table_getPinnedLeafColumns, table_getPinnedVisibleLeafColumns, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSelectedRowModel, table_getPreSortedRowModel, table_getRightFlatHeaders, table_getRightFooterGroups, table_getRightHeaderGroups, table_getRightLeafColumns, table_getRightLeafHeaders, table_getRightTotalSize, table_getRightVisibleLeafColumns, table_getRow, table_getRowCount, table_getRowId, table_getRowModel, table_getSelectedRowModel, table_getSortedRowModel, table_getToggleAllColumnsVisibilityHandler, table_getToggleAllPageRowsSelectedHandler, table_getToggleAllRowsExpandedHandler, table_getToggleAllRowsSelectedHandler, table_getTopRows, table_getTotalSize, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_lastPage, table_mergeOptions, table_nextPage, table_previousPage, table_reset, table_resetColumnFilters, table_resetColumnOrder, table_resetColumnPinning, table_resetColumnSizing, table_resetColumnVisibility, table_resetExpanded, table_resetGlobalFilter, table_resetGrouping, table_resetHeaderSizeInfo, table_resetPageIndex, table_resetPageSize, table_resetPagination, table_resetRowPinning, table_resetRowSelection, table_resetSorting, table_setColumnFilters, table_setColumnOrder, table_setColumnPinning, table_setColumnResizing, table_setColumnSizing, table_setColumnVisibility, table_setExpanded, table_setGlobalFilter, table_setGrouping, table_setOptions, table_setPageIndex, table_setPageSize, table_setPagination, table_setRowPinning, table_setRowSelection, table_setSorting, table_syncExternalStateToBaseAtoms, table_toggleAllColumnsVisible, table_toggleAllPageRowsSelected, table_toggleAllRowsExpanded, table_toggleAllRowsSelected };
|
package/dist/static-functions.js
CHANGED
|
@@ -7,7 +7,7 @@ import { header_getContext, header_getLeafHeaders, table_getFlatHeaders, table_g
|
|
|
7
7
|
import { getDefaultPaginationState, table_autoResetPageIndex, table_firstPage, table_getCanNextPage, table_getCanPreviousPage, table_getPageCount, table_getPageOptions, table_getRowCount, table_lastPage, table_nextPage, table_previousPage, table_resetPageIndex, table_resetPageSize, table_resetPagination, table_setPageIndex, table_setPageSize, table_setPagination } from "./features/row-pagination/rowPaginationFeature.utils.js";
|
|
8
8
|
import { table_getCoreRowModel, table_getExpandedRowModel, table_getFilteredRowModel, table_getGroupedRowModel, table_getPaginatedRowModel, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSortedRowModel, table_getRowModel, table_getSortedRowModel } from "./core/row-models/coreRowModelsFeature.utils.js";
|
|
9
9
|
import { row_getAllCells, row_getAllCellsByColumnId, row_getLeafRows, row_getParentRow, row_getParentRows, row_getUniqueValues, row_getValue, row_renderValue, table_getRow, table_getRowId } from "./core/rows/coreRowsFeature.utils.js";
|
|
10
|
-
import { table_mergeOptions, table_reset, table_setOptions } from "./core/table/coreTablesFeature.utils.js";
|
|
10
|
+
import { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms } from "./core/table/coreTablesFeature.utils.js";
|
|
11
11
|
import { column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues } from "./features/column-faceting/columnFacetingFeature.utils.js";
|
|
12
12
|
import { column_getAutoFilterFn, column_getCanFilter, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getIsFiltered, column_setFilterValue, getDefaultColumnFiltersState, shouldAutoRemoveFilter, table_resetColumnFilters, table_setColumnFilters } from "./features/column-filtering/columnFilteringFeature.utils.js";
|
|
13
13
|
import { cell_getIsAggregated, cell_getIsGrouped, cell_getIsPlaceholder, column_getAggregationFn, column_getAutoAggregationFn, column_getCanGroup, column_getGroupedIndex, column_getIsGrouped, column_getToggleGroupingHandler, column_toggleGrouping, getDefaultGroupingState, row_getGroupingValue, row_getIsGrouped, table_resetGrouping, table_setGrouping } from "./features/column-grouping/columnGroupingFeature.utils.js";
|
|
@@ -19,4 +19,4 @@ import { getDefaultRowPinningState, row_getCanPin, row_getIsPinned, row_getPinne
|
|
|
19
19
|
import { getDefaultRowSelectionState, isRowSelected, isSubRowSelected, row_getCanMultiSelect, row_getCanSelect, row_getCanSelectSubRows, row_getIsAllSubRowsSelected, row_getIsSelected, row_getIsSomeSelected, row_getToggleSelectedHandler, row_toggleSelected, selectRowsFn, table_getFilteredSelectedRowModel, table_getGroupedSelectedRowModel, table_getIsAllPageRowsSelected, table_getIsAllRowsSelected, table_getIsSomePageRowsSelected, table_getIsSomeRowsSelected, table_getPreSelectedRowModel, table_getSelectedRowModel, table_getToggleAllPageRowsSelectedHandler, table_getToggleAllRowsSelectedHandler, table_resetRowSelection, table_setRowSelection, table_toggleAllPageRowsSelected, table_toggleAllRowsSelected } from "./features/row-selection/rowSelectionFeature.utils.js";
|
|
20
20
|
import { column_clearSorting, column_getAutoSortDir, column_getAutoSortFn, column_getCanMultiSort, column_getCanSort, column_getFirstSortDir, column_getIsSorted, column_getNextSortingOrder, column_getSortFn, column_getSortIndex, column_getToggleSortingHandler, column_toggleSorting, getDefaultSortingState, table_resetSorting, table_setSorting } from "./features/row-sorting/rowSortingFeature.utils.js";
|
|
21
21
|
|
|
22
|
-
export { cell_getContext, cell_getIsAggregated, cell_getIsGrouped, cell_getIsPlaceholder, cell_getValue, cell_renderValue, column_clearSorting, column_getAfter, column_getAggregationFn, column_getAutoAggregationFn, column_getAutoFilterFn, column_getAutoSortDir, column_getAutoSortFn, column_getCanFilter, column_getCanGlobalFilter, column_getCanGroup, column_getCanHide, column_getCanMultiSort, column_getCanPin, column_getCanResize, column_getCanSort, column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getFirstSortDir, column_getFlatColumns, column_getGroupedIndex, column_getIndex, column_getIsFiltered, column_getIsFirstColumn, column_getIsGrouped, column_getIsLastColumn, column_getIsPinned, column_getIsResizing, column_getIsSorted, column_getIsVisible, column_getLeafColumns, column_getNextSortingOrder, column_getPinnedIndex, column_getSize, column_getSortFn, column_getSortIndex, column_getStart, column_getToggleGroupingHandler, column_getToggleSortingHandler, column_getToggleVisibilityHandler, column_pin, column_resetSize, column_setFilterValue, column_toggleGrouping, column_toggleSorting, column_toggleVisibility, getDefaultColumnFiltersState, getDefaultColumnOrderState, getDefaultColumnPinningState, getDefaultColumnResizingState, getDefaultColumnSizingColumnDef, getDefaultColumnSizingState, getDefaultColumnVisibilityState, getDefaultExpandedState, getDefaultGroupingState, getDefaultPaginationState, getDefaultRowPinningState, getDefaultRowSelectionState, getDefaultSortingState, header_getContext, header_getLeafHeaders, header_getResizeHandler, header_getSize, header_getStart, isRowSelected, isSubRowSelected, isTouchStartEvent, orderColumns, passiveEventSupported, row_getAllCells, row_getAllCellsByColumnId, row_getAllVisibleCells, row_getCanExpand, row_getCanMultiSelect, row_getCanPin, row_getCanSelect, row_getCanSelectSubRows, row_getCenterVisibleCells, row_getGroupingValue, row_getIsAllParentsExpanded, row_getIsAllSubRowsSelected, row_getIsExpanded, row_getIsGrouped, row_getIsPinned, row_getIsSelected, row_getIsSomeSelected, row_getLeafRows, row_getLeftVisibleCells, row_getParentRow, row_getParentRows, row_getPinnedIndex, row_getRightVisibleCells, row_getToggleExpandedHandler, row_getToggleSelectedHandler, row_getUniqueValues, row_getValue, row_getVisibleCells, row_pin, row_renderValue, row_toggleExpanded, row_toggleSelected, selectRowsFn, shouldAutoRemoveFilter, table_autoResetExpanded, table_autoResetPageIndex, table_firstPage, table_getAllColumns, table_getAllFlatColumns, table_getAllFlatColumnsById, table_getAllLeafColumns, table_getBottomRows, table_getCanNextPage, table_getCanPreviousPage, table_getCanSomeRowsExpand, table_getCenterFlatHeaders, table_getCenterFooterGroups, table_getCenterHeaderGroups, table_getCenterLeafColumns, table_getCenterLeafHeaders, table_getCenterRows, table_getCenterTotalSize, table_getCenterVisibleLeafColumns, table_getColumn, table_getCoreRowModel, table_getDefaultColumnDef, table_getExpandedDepth, table_getExpandedRowModel, table_getFilteredRowModel, table_getFilteredSelectedRowModel, table_getFlatHeaders, table_getFooterGroups, table_getGlobalAutoFilterFn, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues, table_getGlobalFilterFn, table_getGroupedRowModel, table_getGroupedSelectedRowModel, table_getHeaderGroups, table_getIsAllColumnsVisible, table_getIsAllPageRowsSelected, table_getIsAllRowsExpanded, table_getIsAllRowsSelected, table_getIsSomeColumnsPinned, table_getIsSomeColumnsVisible, table_getIsSomePageRowsSelected, table_getIsSomeRowsExpanded, table_getIsSomeRowsPinned, table_getIsSomeRowsSelected, table_getLeafHeaders, table_getLeftFlatHeaders, table_getLeftFooterGroups, table_getLeftHeaderGroups, table_getLeftLeafColumns, table_getLeftLeafHeaders, table_getLeftTotalSize, table_getLeftVisibleLeafColumns, table_getOrderColumnsFn, table_getPageCount, table_getPageOptions, table_getPaginatedRowModel, table_getPinnedLeafColumns, table_getPinnedVisibleLeafColumns, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSelectedRowModel, table_getPreSortedRowModel, table_getRightFlatHeaders, table_getRightFooterGroups, table_getRightHeaderGroups, table_getRightLeafColumns, table_getRightLeafHeaders, table_getRightTotalSize, table_getRightVisibleLeafColumns, table_getRow, table_getRowCount, table_getRowId, table_getRowModel, table_getSelectedRowModel, table_getSortedRowModel, table_getToggleAllColumnsVisibilityHandler, table_getToggleAllPageRowsSelectedHandler, table_getToggleAllRowsExpandedHandler, table_getToggleAllRowsSelectedHandler, table_getTopRows, table_getTotalSize, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_lastPage, table_mergeOptions, table_nextPage, table_previousPage, table_reset, table_resetColumnFilters, table_resetColumnOrder, table_resetColumnPinning, table_resetColumnSizing, table_resetColumnVisibility, table_resetExpanded, table_resetGlobalFilter, table_resetGrouping, table_resetHeaderSizeInfo, table_resetPageIndex, table_resetPageSize, table_resetPagination, table_resetRowPinning, table_resetRowSelection, table_resetSorting, table_setColumnFilters, table_setColumnOrder, table_setColumnPinning, table_setColumnResizing, table_setColumnSizing, table_setColumnVisibility, table_setExpanded, table_setGlobalFilter, table_setGrouping, table_setOptions, table_setPageIndex, table_setPageSize, table_setPagination, table_setRowPinning, table_setRowSelection, table_setSorting, table_toggleAllColumnsVisible, table_toggleAllPageRowsSelected, table_toggleAllRowsExpanded, table_toggleAllRowsSelected };
|
|
22
|
+
export { cell_getContext, cell_getIsAggregated, cell_getIsGrouped, cell_getIsPlaceholder, cell_getValue, cell_renderValue, column_clearSorting, column_getAfter, column_getAggregationFn, column_getAutoAggregationFn, column_getAutoFilterFn, column_getAutoSortDir, column_getAutoSortFn, column_getCanFilter, column_getCanGlobalFilter, column_getCanGroup, column_getCanHide, column_getCanMultiSort, column_getCanPin, column_getCanResize, column_getCanSort, column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getFirstSortDir, column_getFlatColumns, column_getGroupedIndex, column_getIndex, column_getIsFiltered, column_getIsFirstColumn, column_getIsGrouped, column_getIsLastColumn, column_getIsPinned, column_getIsResizing, column_getIsSorted, column_getIsVisible, column_getLeafColumns, column_getNextSortingOrder, column_getPinnedIndex, column_getSize, column_getSortFn, column_getSortIndex, column_getStart, column_getToggleGroupingHandler, column_getToggleSortingHandler, column_getToggleVisibilityHandler, column_pin, column_resetSize, column_setFilterValue, column_toggleGrouping, column_toggleSorting, column_toggleVisibility, getDefaultColumnFiltersState, getDefaultColumnOrderState, getDefaultColumnPinningState, getDefaultColumnResizingState, getDefaultColumnSizingColumnDef, getDefaultColumnSizingState, getDefaultColumnVisibilityState, getDefaultExpandedState, getDefaultGroupingState, getDefaultPaginationState, getDefaultRowPinningState, getDefaultRowSelectionState, getDefaultSortingState, header_getContext, header_getLeafHeaders, header_getResizeHandler, header_getSize, header_getStart, isRowSelected, isSubRowSelected, isTouchStartEvent, orderColumns, passiveEventSupported, row_getAllCells, row_getAllCellsByColumnId, row_getAllVisibleCells, row_getCanExpand, row_getCanMultiSelect, row_getCanPin, row_getCanSelect, row_getCanSelectSubRows, row_getCenterVisibleCells, row_getGroupingValue, row_getIsAllParentsExpanded, row_getIsAllSubRowsSelected, row_getIsExpanded, row_getIsGrouped, row_getIsPinned, row_getIsSelected, row_getIsSomeSelected, row_getLeafRows, row_getLeftVisibleCells, row_getParentRow, row_getParentRows, row_getPinnedIndex, row_getRightVisibleCells, row_getToggleExpandedHandler, row_getToggleSelectedHandler, row_getUniqueValues, row_getValue, row_getVisibleCells, row_pin, row_renderValue, row_toggleExpanded, row_toggleSelected, selectRowsFn, shouldAutoRemoveFilter, table_autoResetExpanded, table_autoResetPageIndex, table_firstPage, table_getAllColumns, table_getAllFlatColumns, table_getAllFlatColumnsById, table_getAllLeafColumns, table_getBottomRows, table_getCanNextPage, table_getCanPreviousPage, table_getCanSomeRowsExpand, table_getCenterFlatHeaders, table_getCenterFooterGroups, table_getCenterHeaderGroups, table_getCenterLeafColumns, table_getCenterLeafHeaders, table_getCenterRows, table_getCenterTotalSize, table_getCenterVisibleLeafColumns, table_getColumn, table_getCoreRowModel, table_getDefaultColumnDef, table_getExpandedDepth, table_getExpandedRowModel, table_getFilteredRowModel, table_getFilteredSelectedRowModel, table_getFlatHeaders, table_getFooterGroups, table_getGlobalAutoFilterFn, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues, table_getGlobalFilterFn, table_getGroupedRowModel, table_getGroupedSelectedRowModel, table_getHeaderGroups, table_getIsAllColumnsVisible, table_getIsAllPageRowsSelected, table_getIsAllRowsExpanded, table_getIsAllRowsSelected, table_getIsSomeColumnsPinned, table_getIsSomeColumnsVisible, table_getIsSomePageRowsSelected, table_getIsSomeRowsExpanded, table_getIsSomeRowsPinned, table_getIsSomeRowsSelected, table_getLeafHeaders, table_getLeftFlatHeaders, table_getLeftFooterGroups, table_getLeftHeaderGroups, table_getLeftLeafColumns, table_getLeftLeafHeaders, table_getLeftTotalSize, table_getLeftVisibleLeafColumns, table_getOrderColumnsFn, table_getPageCount, table_getPageOptions, table_getPaginatedRowModel, table_getPinnedLeafColumns, table_getPinnedVisibleLeafColumns, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSelectedRowModel, table_getPreSortedRowModel, table_getRightFlatHeaders, table_getRightFooterGroups, table_getRightHeaderGroups, table_getRightLeafColumns, table_getRightLeafHeaders, table_getRightTotalSize, table_getRightVisibleLeafColumns, table_getRow, table_getRowCount, table_getRowId, table_getRowModel, table_getSelectedRowModel, table_getSortedRowModel, table_getToggleAllColumnsVisibilityHandler, table_getToggleAllPageRowsSelectedHandler, table_getToggleAllRowsExpandedHandler, table_getToggleAllRowsSelectedHandler, table_getTopRows, table_getTotalSize, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_lastPage, table_mergeOptions, table_nextPage, table_previousPage, table_reset, table_resetColumnFilters, table_resetColumnOrder, table_resetColumnPinning, table_resetColumnSizing, table_resetColumnVisibility, table_resetExpanded, table_resetGlobalFilter, table_resetGrouping, table_resetHeaderSizeInfo, table_resetPageIndex, table_resetPageSize, table_resetPagination, table_resetRowPinning, table_resetRowSelection, table_resetSorting, table_setColumnFilters, table_setColumnOrder, table_setColumnPinning, table_setColumnResizing, table_setColumnSizing, table_setColumnVisibility, table_setExpanded, table_setGlobalFilter, table_setGrouping, table_setOptions, table_setPageIndex, table_setPageSize, table_setPagination, table_setRowPinning, table_setRowSelection, table_setSorting, table_syncExternalStateToBaseAtoms, table_toggleAllColumnsVisible, table_toggleAllPageRowsSelected, table_toggleAllRowsExpanded, table_toggleAllRowsSelected };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
let _tanstack_store = require("@tanstack/store");
|
|
3
|
+
|
|
4
|
+
//#region src/store-reactivity-bindings.ts
|
|
5
|
+
/**
|
|
6
|
+
* TanStack Store–based reactivity for vanilla / non-framework use of `constructTable`,
|
|
7
|
+
* with `createOptionsStore: true` so `table.optionsStore` is available for subscriptions.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { constructTable, tableFeatures } from '@tanstack/table-core'
|
|
12
|
+
* import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
|
|
13
|
+
*
|
|
14
|
+
* const table = constructTable({
|
|
15
|
+
* _features: tableFeatures({ coreReativityFeature: storeReactivityBindings() }),
|
|
16
|
+
* // ...
|
|
17
|
+
* })
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
function storeReactivityBindings() {
|
|
21
|
+
return {
|
|
22
|
+
createOptionsStore: true,
|
|
23
|
+
batch: _tanstack_store.batch,
|
|
24
|
+
untrack: (fn) => fn(),
|
|
25
|
+
createReadonlyAtom: (fn, options) => {
|
|
26
|
+
return (0, _tanstack_store.createAtom)(() => fn(), { compare: options === null || options === void 0 ? void 0 : options.compare });
|
|
27
|
+
},
|
|
28
|
+
createWritableAtom: (value, options) => {
|
|
29
|
+
return (0, _tanstack_store.createAtom)(value, { compare: options === null || options === void 0 ? void 0 : options.compare });
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.storeReactivityBindings = storeReactivityBindings;
|
|
36
|
+
//# sourceMappingURL=store-reactivity-bindings.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-reactivity-bindings.cjs","names":[],"sources":["../src/store-reactivity-bindings.ts"],"sourcesContent":["import { batch, createAtom } from '@tanstack/store'\nimport type { TableReactivityBindings } from './core/reactivity/coreReactivityFeature.types'\n\n/**\n * TanStack Store–based reactivity for vanilla / non-framework use of `constructTable`,\n * with `createOptionsStore: true` so `table.optionsStore` is available for subscriptions.\n *\n * @example\n * ```ts\n * import { constructTable, tableFeatures } from '@tanstack/table-core'\n * import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'\n *\n * const table = constructTable({\n * _features: tableFeatures({ coreReativityFeature: storeReactivityBindings() }),\n * // ...\n * })\n * ```\n */\nexport function storeReactivityBindings(): TableReactivityBindings {\n return {\n createOptionsStore: true,\n batch,\n untrack: (fn) => fn(),\n createReadonlyAtom: (fn, options) => {\n return createAtom(() => fn(), {\n compare: options?.compare,\n })\n },\n createWritableAtom: (value, options) => {\n return createAtom(value, {\n compare: options?.compare,\n })\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,0BAAmD;AACjE,QAAO;EACL,oBAAoB;EACpB;EACA,UAAU,OAAO,IAAI;EACrB,qBAAqB,IAAI,YAAY;AACnC,gDAAwB,IAAI,EAAE,EAC5B,2DAAS,QAAS,SACnB,CAAC;;EAEJ,qBAAqB,OAAO,YAAY;AACtC,0CAAkB,OAAO,EACvB,2DAAS,QAAS,SACnB,CAAC;;EAEL"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TableReactivityBindings } from "./core/reactivity/coreReactivityFeature.types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/store-reactivity-bindings.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* TanStack Store–based reactivity for vanilla / non-framework use of `constructTable`,
|
|
6
|
+
* with `createOptionsStore: true` so `table.optionsStore` is available for subscriptions.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { constructTable, tableFeatures } from '@tanstack/table-core'
|
|
11
|
+
* import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
|
|
12
|
+
*
|
|
13
|
+
* const table = constructTable({
|
|
14
|
+
* _features: tableFeatures({ coreReativityFeature: storeReactivityBindings() }),
|
|
15
|
+
* // ...
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function storeReactivityBindings(): TableReactivityBindings;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { storeReactivityBindings };
|
|
22
|
+
//# sourceMappingURL=store-reactivity-bindings.d.cts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TableReactivityBindings } from "./core/reactivity/coreReactivityFeature.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/store-reactivity-bindings.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* TanStack Store–based reactivity for vanilla / non-framework use of `constructTable`,
|
|
6
|
+
* with `createOptionsStore: true` so `table.optionsStore` is available for subscriptions.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { constructTable, tableFeatures } from '@tanstack/table-core'
|
|
11
|
+
* import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
|
|
12
|
+
*
|
|
13
|
+
* const table = constructTable({
|
|
14
|
+
* _features: tableFeatures({ coreReativityFeature: storeReactivityBindings() }),
|
|
15
|
+
* // ...
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function storeReactivityBindings(): TableReactivityBindings;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { storeReactivityBindings };
|
|
22
|
+
//# sourceMappingURL=store-reactivity-bindings.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { batch, createAtom } from "@tanstack/store";
|
|
2
|
+
|
|
3
|
+
//#region src/store-reactivity-bindings.ts
|
|
4
|
+
/**
|
|
5
|
+
* TanStack Store–based reactivity for vanilla / non-framework use of `constructTable`,
|
|
6
|
+
* with `createOptionsStore: true` so `table.optionsStore` is available for subscriptions.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { constructTable, tableFeatures } from '@tanstack/table-core'
|
|
11
|
+
* import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
|
|
12
|
+
*
|
|
13
|
+
* const table = constructTable({
|
|
14
|
+
* _features: tableFeatures({ coreReativityFeature: storeReactivityBindings() }),
|
|
15
|
+
* // ...
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
function storeReactivityBindings() {
|
|
20
|
+
return {
|
|
21
|
+
createOptionsStore: true,
|
|
22
|
+
batch,
|
|
23
|
+
untrack: (fn) => fn(),
|
|
24
|
+
createReadonlyAtom: (fn, options) => {
|
|
25
|
+
return createAtom(() => fn(), { compare: options === null || options === void 0 ? void 0 : options.compare });
|
|
26
|
+
},
|
|
27
|
+
createWritableAtom: (value, options) => {
|
|
28
|
+
return createAtom(value, { compare: options === null || options === void 0 ? void 0 : options.compare });
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { storeReactivityBindings };
|
|
35
|
+
//# sourceMappingURL=store-reactivity-bindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-reactivity-bindings.js","names":[],"sources":["../src/store-reactivity-bindings.ts"],"sourcesContent":["import { batch, createAtom } from '@tanstack/store'\nimport type { TableReactivityBindings } from './core/reactivity/coreReactivityFeature.types'\n\n/**\n * TanStack Store–based reactivity for vanilla / non-framework use of `constructTable`,\n * with `createOptionsStore: true` so `table.optionsStore` is available for subscriptions.\n *\n * @example\n * ```ts\n * import { constructTable, tableFeatures } from '@tanstack/table-core'\n * import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'\n *\n * const table = constructTable({\n * _features: tableFeatures({ coreReativityFeature: storeReactivityBindings() }),\n * // ...\n * })\n * ```\n */\nexport function storeReactivityBindings(): TableReactivityBindings {\n return {\n createOptionsStore: true,\n batch,\n untrack: (fn) => fn(),\n createReadonlyAtom: (fn, options) => {\n return createAtom(() => fn(), {\n compare: options?.compare,\n })\n },\n createWritableAtom: (value, options) => {\n return createAtom(value, {\n compare: options?.compare,\n })\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAgB,0BAAmD;AACjE,QAAO;EACL,oBAAoB;EACpB;EACA,UAAU,OAAO,IAAI;EACrB,qBAAqB,IAAI,YAAY;AACnC,UAAO,iBAAiB,IAAI,EAAE,EAC5B,2DAAS,QAAS,SACnB,CAAC;;EAEJ,qBAAqB,OAAO,YAAY;AACtC,UAAO,WAAW,OAAO,EACvB,2DAAS,QAAS,SACnB,CAAC;;EAEL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.43",
|
|
4
4
|
"description": "Headless UI for building powerful tables & datagrids for TS/JS.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"import": "./dist/static-functions.js",
|
|
47
47
|
"require": "./dist/static-functions.cjs"
|
|
48
48
|
},
|
|
49
|
+
"./store-reactivity-bindings": {
|
|
50
|
+
"import": "./dist/store-reactivity-bindings.js",
|
|
51
|
+
"require": "./dist/store-reactivity-bindings.cjs"
|
|
52
|
+
},
|
|
49
53
|
"./package.json": "./package.json"
|
|
50
54
|
},
|
|
51
55
|
"sideEffects": false,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { coreFeatures } from '../coreFeatures'
|
|
2
2
|
import { cloneState } from '../../utils'
|
|
3
3
|
import { atomToStore } from '../reactivity/coreReactivityFeature.utils'
|
|
4
|
+
import { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'
|
|
4
5
|
import type { RowData } from '../../types/type-utils'
|
|
5
6
|
import type { TableFeature, TableFeatures } from '../../types/TableFeatures'
|
|
6
7
|
import type { Table, Table_Internal } from '../../types/Table'
|
|
@@ -28,12 +29,6 @@ export function constructTable<
|
|
|
28
29
|
_features: { ...coreFeatures, ...tableOptions._features },
|
|
29
30
|
_rowModels: {},
|
|
30
31
|
_rowModelFns: {},
|
|
31
|
-
get options() {
|
|
32
|
-
return this.optionsStore.get()
|
|
33
|
-
},
|
|
34
|
-
set options(value) {
|
|
35
|
-
this.optionsStore.set(() => value)
|
|
36
|
-
},
|
|
37
32
|
baseAtoms: {},
|
|
38
33
|
atoms: {},
|
|
39
34
|
} as Table_Internal<TFeatures, TData>
|
|
@@ -44,10 +39,26 @@ export function constructTable<
|
|
|
44
39
|
return Object.assign(obj, feature.getDefaultTableOptions?.(table))
|
|
45
40
|
}, {}) as TableOptions<TFeatures, TData>
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
const mergedOptions = { ...defaultOptions, ...tableOptions }
|
|
43
|
+
|
|
44
|
+
if (_reactivity.createOptionsStore) {
|
|
45
|
+
// @ts-ignore - direct set
|
|
46
|
+
table.optionsStore = _reactivity.createWritableAtom<
|
|
47
|
+
TableOptions<TFeatures, TData>
|
|
48
|
+
>(mergedOptions, { debugName: 'table/optionsStore' })
|
|
49
|
+
Object.defineProperty(table, 'options', {
|
|
50
|
+
configurable: true,
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get() {
|
|
53
|
+
return table.optionsStore!.get()
|
|
54
|
+
},
|
|
55
|
+
set(value) {
|
|
56
|
+
table.optionsStore!.set(() => value) // or your real update shape
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
} else {
|
|
60
|
+
table.options = mergedOptions
|
|
61
|
+
}
|
|
51
62
|
|
|
52
63
|
table.initialState = getInitialTableState(
|
|
53
64
|
table._features,
|
|
@@ -67,16 +78,10 @@ export function constructTable<
|
|
|
67
78
|
},
|
|
68
79
|
) as any
|
|
69
80
|
|
|
70
|
-
// create readonly derived atom: on each get(), read
|
|
81
|
+
// create readonly derived atom: on each get(), read either external atom or base atom
|
|
71
82
|
;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(
|
|
72
83
|
() => {
|
|
73
|
-
|
|
74
|
-
const opts = table.optionsStore.get()
|
|
75
|
-
const state = opts.state
|
|
76
|
-
if (key in (state ?? {})) {
|
|
77
|
-
return state![key]
|
|
78
|
-
}
|
|
79
|
-
const externalAtom = opts.atoms?.[key]
|
|
84
|
+
const externalAtom = table.options.atoms?.[key]
|
|
80
85
|
if (externalAtom) {
|
|
81
86
|
return externalAtom.get()
|
|
82
87
|
}
|
|
@@ -86,6 +91,8 @@ export function constructTable<
|
|
|
86
91
|
)
|
|
87
92
|
}
|
|
88
93
|
|
|
94
|
+
table_syncExternalStateToBaseAtoms(table)
|
|
95
|
+
|
|
89
96
|
table.store = atomToStore(
|
|
90
97
|
_reactivity.createReadonlyAtom(
|
|
91
98
|
() => {
|
|
@@ -114,7 +121,8 @@ export function constructTable<
|
|
|
114
121
|
|
|
115
122
|
Row Models: ${rowModels.length ? rowModels.join('\n ') : '(none)'}
|
|
116
123
|
|
|
117
|
-
States: ${states.join('\n ')}`,
|
|
124
|
+
States: ${states.join('\n ')}\n`,
|
|
125
|
+
{ table },
|
|
118
126
|
)
|
|
119
127
|
}
|
|
120
128
|
|
|
@@ -167,9 +167,12 @@ export interface Table_CoreProperties<
|
|
|
167
167
|
*/
|
|
168
168
|
readonly options: TableOptions<TFeatures, TData>
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
170
|
+
* Writable atom for table options. Only created when `createOptionsStore` is true
|
|
171
|
+
* on `coreReativityFeature` (e.g. Lit, Vue, Solid). React/Preact use `createOptionsStore: false`:
|
|
172
|
+
* options are held as plain data with a lightweight revision + subscribe source; there is
|
|
173
|
+
* no writable atom backing the full options object. Use {@link getTableOptionsStore} to subscribe.
|
|
171
174
|
*/
|
|
172
|
-
readonly optionsStore
|
|
175
|
+
readonly optionsStore?: Atom<TableOptions<TFeatures, TData>> | undefined
|
|
173
176
|
/**
|
|
174
177
|
* The readonly flat store for the table state. Derives from `table.atoms`
|
|
175
178
|
* only; never reads external state directly.
|
|
@@ -4,6 +4,30 @@ import type { TableFeatures } from '../../types/TableFeatures'
|
|
|
4
4
|
import type { Table_Internal } from '../../types/Table'
|
|
5
5
|
import type { TableOptions } from '../../types/TableOptions'
|
|
6
6
|
|
|
7
|
+
export function table_syncExternalStateToBaseAtoms<
|
|
8
|
+
TFeatures extends TableFeatures,
|
|
9
|
+
TData extends RowData,
|
|
10
|
+
>(table: Table_Internal<TFeatures, TData>): void {
|
|
11
|
+
const state = table.options.state
|
|
12
|
+
if (!state) {
|
|
13
|
+
return
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
table._reactivity.batch(() => {
|
|
17
|
+
for (const key in state) {
|
|
18
|
+
const baseAtom = (table.baseAtoms as Record<string, any>)[key]
|
|
19
|
+
if (!baseAtom) {
|
|
20
|
+
continue
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const externalState = state[key as keyof typeof state]
|
|
24
|
+
if (externalState !== baseAtom.get()) {
|
|
25
|
+
baseAtom.set(() => externalState)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
7
31
|
export function table_reset<
|
|
8
32
|
TFeatures extends TableFeatures,
|
|
9
33
|
TData extends RowData,
|
|
@@ -42,5 +66,10 @@ export function table_setOptions<
|
|
|
42
66
|
): void {
|
|
43
67
|
const newOptions = functionalUpdate(updater, table.options)
|
|
44
68
|
const mergedOptions = table_mergeOptions(table, newOptions)
|
|
45
|
-
table.optionsStore
|
|
69
|
+
if (table.optionsStore) {
|
|
70
|
+
table.optionsStore.set(() => mergedOptions)
|
|
71
|
+
} else {
|
|
72
|
+
table.options = mergedOptions
|
|
73
|
+
}
|
|
74
|
+
table_syncExternalStateToBaseAtoms(table)
|
|
46
75
|
}
|
package/src/reactivity.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { batch, createAtom } from '@tanstack/store'
|
|
2
|
+
import type { TableReactivityBindings } from './core/reactivity/coreReactivityFeature.types'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* TanStack Store–based reactivity for vanilla / non-framework use of `constructTable`,
|
|
6
|
+
* with `createOptionsStore: true` so `table.optionsStore` is available for subscriptions.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { constructTable, tableFeatures } from '@tanstack/table-core'
|
|
11
|
+
* import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
|
|
12
|
+
*
|
|
13
|
+
* const table = constructTable({
|
|
14
|
+
* _features: tableFeatures({ coreReativityFeature: storeReactivityBindings() }),
|
|
15
|
+
* // ...
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export function storeReactivityBindings(): TableReactivityBindings {
|
|
20
|
+
return {
|
|
21
|
+
createOptionsStore: true,
|
|
22
|
+
batch,
|
|
23
|
+
untrack: (fn) => fn(),
|
|
24
|
+
createReadonlyAtom: (fn, options) => {
|
|
25
|
+
return createAtom(() => fn(), {
|
|
26
|
+
compare: options?.compare,
|
|
27
|
+
})
|
|
28
|
+
},
|
|
29
|
+
createWritableAtom: (value, options) => {
|
|
30
|
+
return createAtom(value, {
|
|
31
|
+
compare: options?.compare,
|
|
32
|
+
})
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/types/Table.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReadonlyStore } from '@tanstack/store'
|
|
2
2
|
import type { Table_ColumnFaceting } from '../features/column-faceting/columnFacetingFeature.types'
|
|
3
3
|
import type { Table_ColumnResizing } from '../features/column-resizing/columnResizingFeature.types'
|
|
4
4
|
import type { Table_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
let _tanstack_store = require("@tanstack/store");
|
|
2
|
-
|
|
3
|
-
//#region src/core/reactivity/constructReactivityBindings.ts
|
|
4
|
-
function constructReactivityBindings() {
|
|
5
|
-
return {
|
|
6
|
-
batch: _tanstack_store.batch,
|
|
7
|
-
untrack: (fn) => fn(),
|
|
8
|
-
createReadonlyAtom: (fn, options) => {
|
|
9
|
-
return (0, _tanstack_store.createAtom)(() => fn(), { compare: options === null || options === void 0 ? void 0 : options.compare });
|
|
10
|
-
},
|
|
11
|
-
createWritableAtom: (value, options) => {
|
|
12
|
-
return (0, _tanstack_store.createAtom)(value, { compare: options === null || options === void 0 ? void 0 : options.compare });
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
exports.constructReactivityBindings = constructReactivityBindings;
|
|
19
|
-
//# sourceMappingURL=constructReactivityBindings.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constructReactivityBindings.cjs","names":["batch"],"sources":["../../../src/core/reactivity/constructReactivityBindings.ts"],"sourcesContent":["import { batch, createAtom } from '@tanstack/store'\nimport type { TableReactivityBindings } from './coreReactivityFeature.types'\n\nexport function constructReactivityBindings(): TableReactivityBindings {\n return {\n batch: batch,\n untrack: (fn) => fn(),\n createReadonlyAtom: (fn, options) => {\n return createAtom(() => fn(), {\n compare: options?.compare,\n })\n },\n createWritableAtom: (value, options) => {\n return createAtom(value, {\n compare: options?.compare,\n })\n },\n }\n}\n"],"mappings":";;;AAGA,SAAgB,8BAAuD;AACrE,QAAO;EACL,OAAOA;EACP,UAAU,OAAO,IAAI;EACrB,qBAAqB,IAAI,YAAY;AACnC,gDAAwB,IAAI,EAAE,EAC5B,2DAAS,QAAS,SACnB,CAAC;;EAEJ,qBAAqB,OAAO,YAAY;AACtC,0CAAkB,OAAO,EACvB,2DAAS,QAAS,SACnB,CAAC;;EAEL"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TableReactivityBindings } from "./coreReactivityFeature.types.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/core/reactivity/constructReactivityBindings.d.ts
|
|
4
|
-
declare function constructReactivityBindings(): TableReactivityBindings;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { constructReactivityBindings };
|
|
7
|
-
//# sourceMappingURL=constructReactivityBindings.d.cts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TableReactivityBindings } from "./coreReactivityFeature.types.js";
|
|
2
|
-
|
|
3
|
-
//#region src/core/reactivity/constructReactivityBindings.d.ts
|
|
4
|
-
declare function constructReactivityBindings(): TableReactivityBindings;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { constructReactivityBindings };
|
|
7
|
-
//# sourceMappingURL=constructReactivityBindings.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { batch, createAtom } from "@tanstack/store";
|
|
2
|
-
|
|
3
|
-
//#region src/core/reactivity/constructReactivityBindings.ts
|
|
4
|
-
function constructReactivityBindings() {
|
|
5
|
-
return {
|
|
6
|
-
batch,
|
|
7
|
-
untrack: (fn) => fn(),
|
|
8
|
-
createReadonlyAtom: (fn, options) => {
|
|
9
|
-
return createAtom(() => fn(), { compare: options === null || options === void 0 ? void 0 : options.compare });
|
|
10
|
-
},
|
|
11
|
-
createWritableAtom: (value, options) => {
|
|
12
|
-
return createAtom(value, { compare: options === null || options === void 0 ? void 0 : options.compare });
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
export { constructReactivityBindings };
|
|
19
|
-
//# sourceMappingURL=constructReactivityBindings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constructReactivityBindings.js","names":[],"sources":["../../../src/core/reactivity/constructReactivityBindings.ts"],"sourcesContent":["import { batch, createAtom } from '@tanstack/store'\nimport type { TableReactivityBindings } from './coreReactivityFeature.types'\n\nexport function constructReactivityBindings(): TableReactivityBindings {\n return {\n batch: batch,\n untrack: (fn) => fn(),\n createReadonlyAtom: (fn, options) => {\n return createAtom(() => fn(), {\n compare: options?.compare,\n })\n },\n createWritableAtom: (value, options) => {\n return createAtom(value, {\n compare: options?.compare,\n })\n },\n }\n}\n"],"mappings":";;;AAGA,SAAgB,8BAAuD;AACrE,QAAO;EACE;EACP,UAAU,OAAO,IAAI;EACrB,qBAAqB,IAAI,YAAY;AACnC,UAAO,iBAAiB,IAAI,EAAE,EAC5B,2DAAS,QAAS,SACnB,CAAC;;EAEJ,qBAAqB,OAAO,YAAY;AACtC,UAAO,WAAW,OAAO,EACvB,2DAAS,QAAS,SACnB,CAAC;;EAEL"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { batch, createAtom } from '@tanstack/store'
|
|
2
|
-
import type { TableReactivityBindings } from './coreReactivityFeature.types'
|
|
3
|
-
|
|
4
|
-
export function constructReactivityBindings(): TableReactivityBindings {
|
|
5
|
-
return {
|
|
6
|
-
batch: batch,
|
|
7
|
-
untrack: (fn) => fn(),
|
|
8
|
-
createReadonlyAtom: (fn, options) => {
|
|
9
|
-
return createAtom(() => fn(), {
|
|
10
|
-
compare: options?.compare,
|
|
11
|
-
})
|
|
12
|
-
},
|
|
13
|
-
createWritableAtom: (value, options) => {
|
|
14
|
-
return createAtom(value, {
|
|
15
|
-
compare: options?.compare,
|
|
16
|
-
})
|
|
17
|
-
},
|
|
18
|
-
}
|
|
19
|
-
}
|