@pathscale/ui 0.0.104 → 0.0.106
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TableProps } from "../table";
|
|
2
|
-
import type { StreamingColumnDef, StreamingConfig } from "./types";
|
|
2
|
+
import type { StreamingColumnDef, StreamingConfig, SortingState } from "./types";
|
|
3
3
|
export type StreamingTableProps<TData> = {
|
|
4
4
|
data: TData[];
|
|
5
5
|
columns: StreamingColumnDef<TData>[];
|
|
@@ -21,6 +21,8 @@ export type StreamingTableProps<TData> = {
|
|
|
21
21
|
initialPage?: number;
|
|
22
22
|
/** Enable sorting (default: false) */
|
|
23
23
|
enableSorting?: boolean;
|
|
24
|
+
/** Initial sorting state (default: null) */
|
|
25
|
+
initialSorting?: SortingState;
|
|
24
26
|
} & Omit<TableProps, "children">;
|
|
25
27
|
declare const StreamingTable: <TData>(props: StreamingTableProps<TData>) => import("solid-js").JSX.Element;
|
|
26
28
|
export default StreamingTable;
|
package/dist/index.js
CHANGED
|
@@ -12012,13 +12012,17 @@ const StreamingTable = (props)=>{
|
|
|
12012
12012
|
"enablePagination",
|
|
12013
12013
|
"pageSize",
|
|
12014
12014
|
"initialPage",
|
|
12015
|
-
"enableSorting"
|
|
12015
|
+
"enableSorting",
|
|
12016
|
+
"initialSorting"
|
|
12016
12017
|
]);
|
|
12017
12018
|
const store = createStreamingTableStore();
|
|
12018
|
-
const [sortingState, setSortingState] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)({
|
|
12019
|
+
const [sortingState, setSortingState] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(local.initialSorting ?? {
|
|
12019
12020
|
columnId: null,
|
|
12020
12021
|
direction: null
|
|
12021
12022
|
});
|
|
12023
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
12024
|
+
if (local.initialSorting) setSortingState(local.initialSorting);
|
|
12025
|
+
});
|
|
12022
12026
|
const config = {
|
|
12023
12027
|
maxBufferSize: local.streamingConfig?.maxBufferSize ?? 1000,
|
|
12024
12028
|
appendMode: local.streamingConfig?.appendMode ?? false
|