Skip to content

Commit 44486bf

Browse files
committed
Merge branch 'edit-table-improvements'
* edit-table-improvements: (23 commits) Pass through transformRequest function Added the ability to run postgres aggregate functions Got PostgREST table to load Added column reordering Improved color management Infinite scrolling PostgREST sheet works Basic postgrest table Updated data sheet component Updated data fill values Major simplification to cell renderer Further decoupled cell renderer Greatly simplified rendering Adjusted values somewhat Successfully initialize props Started to bring different elements of data sheet together Updated column specs Updated table Made state provider handle basic state tracking Created a skeletal state provider Add a basic column reordering story ...
2 parents 3fcb546 + 06b2b66 commit 44486bf

File tree

24 files changed

+1645
-704
lines changed

24 files changed

+1645
-704
lines changed

.idea/misc.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

packages/data-sheet2/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
"@blueprintjs/core": "^5.10.2",
1313
"@blueprintjs/table": "^5.1.4",
1414
"@macrostrat/hyper": "^2.0.0",
15+
"@supabase/postgrest-js": "^1.17.7",
1516
"chroma-js": "^2.4.2",
1617
"classnames": "^2.3.1",
1718
"immutability-helper": "^3.1.1",
1819
"react": "^17.0.2||^18",
1920
"react-color": "^2.19.3",
20-
"react-colorful": "^5.6.1"
21+
"react-colorful": "^5.6.1",
22+
"underscore": "^1.13.7",
23+
"zustand": "^5.0.2"
2124
},
2225
"exports": {
2326
".": {
@@ -29,5 +32,8 @@
2932
"type": "git",
3033
"url": "https://github.com/UW-Macrostrat/web-components.git",
3134
"directory": "packages/data-sheet2"
35+
},
36+
"devDependencies": {
37+
"@types/underscore": "^1"
3238
}
3339
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.table-actions, .table-action
2+
display: flex
3+
flex-direction: row
4+
gap: 0.5em
5+
6+
.table-actions
7+
margin-bottom: 0.5em
8+
gap: 1em
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import hyper from "@macrostrat/hyper";
2+
import style from "./actions.module.sass";
3+
const h = hyper.styled(style);
4+
5+
export function DataSheetActionsRow(props) {
6+
return h("div.table-actions", props.children);
7+
}
8+
9+
export function DataSheetAction(props) {
10+
return h("div.table-action", props.children);
11+
}

packages/data-sheet2/src/components/colors.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import styles from "./main.module.sass";
55
import { asChromaColor } from "@macrostrat/color-utils";
66
import { HexColorPicker } from "react-colorful";
77
import { useEffect, useRef } from "react";
8+
import { memoize } from "underscore";
89

910
const h = hyper.styled(styles);
1011

@@ -17,13 +18,17 @@ export function ColorCell({ value, children, style, intent, ...rest }) {
1718
...rest,
1819
style: {
1920
...style,
20-
...pleasantCombination(value, { darkMode }),
21+
...colorCombo(value, darkMode),
2122
},
2223
},
2324
children
2425
);
2526
}
2627

28+
const colorCombo = memoize((color, darkMode) =>
29+
pleasantCombination(color, { darkMode })
30+
);
31+
2732
export function pleasantCombination(
2833
color,
2934
{ luminance = null, backgroundAlpha = 0.2, darkMode = false } = {}

0 commit comments

Comments
 (0)