11import { Toaster , HotkeysProvider } from "@blueprintjs/core" ;
22import hyper from "@macrostrat/hyper" ;
33import styles from "./main.module.sass" ;
4- import { DataSheet , ColorCell , getRowsToDelete } from "../core" ; //getRowsToDelete
4+ import { DataSheet , getRowsToDelete } from "../core" ; //getRowsToDelete
55import { LithologyTag , Tag , TagSize } from "@macrostrat/data-components" ;
6- import { usePostgRESTLazyLoader } from "./data-loaders" ;
6+ import { PostgrestOrder , usePostgRESTLazyLoader } from "./data-loaders" ;
77import { Spinner } from "@blueprintjs/core" ;
88
99export * from "./data-loaders" ;
@@ -21,6 +21,7 @@ import type {
2121 GenericTable ,
2222 GenericView ,
2323} from "@supabase/postgrest-js/dist/cjs/types" ;
24+ import { ColorCell } from "../components" ;
2425
2526const h = hyper . styled ( styles ) ;
2627
@@ -35,9 +36,10 @@ interface PostgRESTTableViewProps<T extends object>
3536 endpoint : string ;
3637 table : string ;
3738 columnOptions ?: any ;
38- order ?: any ;
39+ order ?: PostgrestOrder < T > ;
3940 columns ?: string ;
4041 editable ?: boolean ;
42+ identityKey ?: string ;
4143 filter (
4244 query : PostgrestFilterBuilder < T , any , any > ,
4345 ) : PostgrestFilterBuilder < T , any , any > ;
@@ -67,7 +69,7 @@ function _PostgRESTTableView<T>({
6769 endpoint ,
6870 table ,
6971 {
70- order,
72+ order : order ?? { key : identityKey , ascending : true } ,
7173 columns,
7274 filter,
7375 } ,
@@ -216,11 +218,11 @@ export function ExpandedLithologies({ value, onChange }) {
216218 h (
217219 "td.basis-col" ,
218220 d . basis_col ?. map ( ( d ) => {
219- return h ( Tag , { size : TagSize . Small , key : d } , [
220- h ( "span.tag-header" , "Column" ) ,
221- " " ,
222- h ( " code", d ) ,
223- ] ) ;
221+ return h ( Tag , {
222+ size : TagSize . Small ,
223+ key : d ,
224+ name : h ( [ h ( "span.tag-header" , "Column" ) , " " , h ( " code", d ) ] ) ,
225+ } ) ;
224226 } ) ,
225227 ) ,
226228 ] ) ;
0 commit comments