intable 0.0.64 → 0.0.65

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/index.d.ts CHANGED
@@ -12,7 +12,7 @@ import './plugins/ResizePlugin';
12
12
  import './plugins/DragPlugin';
13
13
  import './plugins/RowGroupPlugin';
14
14
  import './plugins/ExpandPlugin';
15
- import './plugins/SortPlugin';
15
+ import { type SortKey } from './plugins/SortPlugin';
16
16
  import './plugins/CellMergePlugin';
17
17
  import './plugins/TreePlugin';
18
18
  import './plugins/HeaderGroup';
@@ -80,11 +80,11 @@ export interface TableProps {
80
80
  x?: number | string;
81
81
  };
82
82
  newRow?: (i: number) => any;
83
- request: (params: {
83
+ request?: (params: {
84
84
  page?: number;
85
85
  pageSize?: number;
86
86
  filters?: AndOrNode[];
87
- sort?: Record<string, 'asc' | 'desc'>;
87
+ sorts?: SortKey[];
88
88
  }) => Promise<{
89
89
  data: any[];
90
90
  total?: number;
package/dist/index.js CHANGED
@@ -451,7 +451,12 @@ const defaultsPlugins = [
451
451
  name: "request",
452
452
  priority: Infinity,
453
453
  store: (g) => ({}),
454
- rewriteProps: { data: ({ data: g = [] }, { store: G }) => G.props.request ? (G._req ??= runWithOwner(G.owner, () => createResource(() => G.props.request({ filters: G.props.filter?.value }), { initialValue: {
454
+ rewriteProps: { data: ({ data: g = [] }, { store: G }) => G.props.request ? (G._req ??= runWithOwner(G.owner, () => createResource(() => G.props.request({
455
+ filters: G.props.filter?.value,
456
+ sorts: G.props.sort?.value,
457
+ page: G.props.pagination?.value,
458
+ pageSize: G.props.pagination?.pageSize
459
+ }), { initialValue: {
455
460
  data: [],
456
461
  total: 0
457
462
  } })))[0]().data : g }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intable",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [