Skip to content

Commit 48dadb9

Browse files
authored
Merge branch 'main' into freeze-right-columns
2 parents 2d7ae50 + f1a7c9b commit 48dadb9

7 files changed

Lines changed: 22 additions & 18 deletions

File tree

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "root",
3-
"version": "6.0.4-alpha23",
3+
"version": "6.0.4-alpha24",
44
"scripts": {
55
"start": "npm run storybook",
66
"version": "./update-version.sh",

packages/cells/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@glideapps/glide-data-grid-cells",
3-
"version": "6.0.4-alpha23",
3+
"version": "6.0.4-alpha24",
44
"description": "Extra cells for glide-data-grid",
55
"sideEffects": [
66
"**/*.css"
@@ -50,7 +50,7 @@
5050
"canvas"
5151
],
5252
"dependencies": {
53-
"@glideapps/glide-data-grid": "6.0.4-alpha23",
53+
"@glideapps/glide-data-grid": "6.0.4-alpha24",
5454
"@linaria/react": "^6.3.0",
5555
"@toast-ui/editor": "3.2.2",
5656
"@toast-ui/react-editor": "3.2.3",

packages/cells/src/cell.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ export const CustomCells: React.VFC = () => {
312312
step: 1,
313313
label: `${Math.round(v * 100)}%`,
314314
measureLabel: "100%",
315+
color: row % 2 === 0 ? "#77c4c4" : undefined,
315316
},
316317
};
317318
return d;

packages/cells/src/cells/range-cell.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ interface RangeCellProps {
3131
readonly step: number;
3232
readonly label?: string;
3333
readonly measureLabel?: string;
34+
/* The color of the range, fallback to theme.accentColor. */
35+
readonly color?: string;
3436
}
3537

3638
export type RangeCell = CustomCell<RangeCellProps>;
@@ -50,7 +52,7 @@ const renderer: CustomRenderer<RangeCell> = {
5052
isMatch: (c): c is RangeCell => (c.data as any).kind === "range-cell",
5153
draw: (args, cell) => {
5254
const { ctx, theme, rect } = args;
53-
const { min, max, value, label, measureLabel } = cell.data;
55+
const { min, max, value, label, measureLabel, color } = cell.data;
5456

5557
const x = rect.x + theme.cellHorizontalPadding;
5658
const yMid = rect.y + rect.height / 2;
@@ -75,8 +77,9 @@ const renderer: CustomRenderer<RangeCell> = {
7577
if (rangeWidth >= rangeHeight) {
7678
const gradient = ctx.createLinearGradient(x, yMid, x + rangeWidth, yMid);
7779

78-
gradient.addColorStop(0, theme.accentColor);
79-
gradient.addColorStop(fillRatio, theme.accentColor);
80+
const fillColor = color ?? theme.accentColor;
81+
gradient.addColorStop(0, fillColor);
82+
gradient.addColorStop(fillRatio, fillColor);
8083
gradient.addColorStop(fillRatio, theme.bgBubble);
8184
gradient.addColorStop(1, theme.bgBubble);
8285

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@glideapps/glide-data-grid",
3-
"version": "6.0.4-alpha23",
3+
"version": "6.0.4-alpha24",
44
"description": "React data grid for beautifully displaying and editing large amounts of data with amazing performance.",
55
"sideEffects": [
66
"**/*.css"

packages/source/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@glideapps/glide-data-grid-source",
3-
"version": "6.0.4-alpha23",
3+
"version": "6.0.4-alpha24",
44
"description": "Useful data source hooks for Glide Data Grid",
55
"sideEffects": false,
66
"type": "module",
@@ -42,7 +42,7 @@
4242
"canvas"
4343
],
4444
"dependencies": {
45-
"@glideapps/glide-data-grid": "6.0.4-alpha23"
45+
"@glideapps/glide-data-grid": "6.0.4-alpha24"
4646
},
4747
"peerDependencies": {
4848
"lodash": "^4.17.19",

0 commit comments

Comments
 (0)