-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
port-changes - frozen columns #1
base: main
Are you sure you want to change the base?
Changes from 8 commits
75851b7
4244830
042ac99
6cef148
b431e54
249c111
72028d5
2ab2c16
a58c40f
6049589
b8ae53f
876a7e0
7867829
2220b8c
0a53eaf
1f41abc
209c687
af5477b
64a1ef2
f132378
ea384f7
d070667
bd3df0b
0383f88
ae3ee11
1c51267
3ed35c4
4140400
b98c6fc
790edb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,9 +45,11 @@ const root = css` | |
--rdg-selection-color: #66afe9; | ||
--rdg-font-size: 14px; | ||
--rdg-cell-frozen-box-shadow: 2px 0 5px -2px rgba(136, 136, 136, 0.3); | ||
--rdg-cell-right-frozen-box-shadow: -2px 0 5px -2px rgba(136, 136, 136, 0.3); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just check if we can override it in the frontend app, so we can apply theming if needed (needed for dark theme already) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've checked and we can, you can take a look at |
||
|
||
&:dir(rtl) { | ||
--rdg-cell-frozen-box-shadow: -2px 0 5px -2px rgba(136, 136, 136, 0.3); | ||
--rdg-cell-right-frozen-box-shadow: 2px 0 5px -2px rgba(136, 136, 136, 0.3); | ||
} | ||
|
||
display: grid; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,25 +13,19 @@ export interface Column<TRow, TSummaryRow = unknown> { | |
readonly name: string | ReactElement; | ||
/** A unique key to distinguish each column */ | ||
readonly key: string; | ||
/** | ||
* Column width. If not specified, it will be determined automatically based on grid width and specified widths of other columns | ||
* @default 'auto' | ||
*/ | ||
/** Column width. If not specified, it will be determined automatically based on grid width and specified widths of other columns */ | ||
readonly width?: Maybe<number | string>; | ||
/** | ||
* Minimum column width in px | ||
* @default '50px' | ||
*/ | ||
/** Minimum column width in px. */ | ||
readonly minWidth?: Maybe<number>; | ||
/** Maximum column width in px. */ | ||
readonly maxWidth?: Maybe<number>; | ||
readonly cellClass?: Maybe<string | ((row: TRow) => Maybe<string>)>; | ||
readonly headerCellClass?: Maybe<string>; | ||
readonly summaryCellClass?: Maybe<string | ((row: TSummaryRow) => Maybe<string>)>; | ||
/** Render function used to render the content of cells */ | ||
readonly renderCell?: Maybe<(props: RenderCellProps<TRow, TSummaryRow>) => ReactNode>; | ||
/** Render function used to render the content of the column's header cell */ | ||
readonly renderHeaderCell?: Maybe<(props: RenderHeaderCellProps<TRow, TSummaryRow>) => ReactNode>; | ||
/** Render function used to render the content of cells */ | ||
readonly renderCell?: Maybe<(props: RenderCellProps<TRow, TSummaryRow>) => ReactNode>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert |
||
/** Render function used to render the content of summary cells */ | ||
readonly renderSummaryCell?: Maybe< | ||
(props: RenderSummaryCellProps<TSummaryRow, TRow>) => ReactNode | ||
|
@@ -45,6 +39,8 @@ export interface Column<TRow, TSummaryRow = unknown> { | |
readonly colSpan?: Maybe<(args: ColSpanArgs<TRow, TSummaryRow>) => Maybe<number>>; | ||
/** Determines whether column is frozen or not */ | ||
readonly frozen?: Maybe<boolean>; | ||
/** Determines whether column is right frozen or not */ | ||
readonly rightFrozen?: Maybe<boolean>; | ||
/** Enable resizing of a column */ | ||
readonly resizable?: Maybe<boolean>; | ||
/** Enable sorting of a column */ | ||
|
@@ -149,10 +145,10 @@ export interface RenderHeaderCellProps<TRow, TSummaryRow = unknown> { | |
|
||
export interface CellRendererProps<TRow, TSummaryRow> | ||
extends Pick<RenderRowProps<TRow, TSummaryRow>, 'row' | 'rowIdx' | 'selectCell'>, | ||
Omit< | ||
React.HTMLAttributes<HTMLDivElement>, | ||
'children' | 'onClick' | 'onDoubleClick' | 'onContextMenu' | ||
> { | ||
Omit< | ||
React.HTMLAttributes<HTMLDivElement>, | ||
'children' | 'onClick' | 'onDoubleClick' | 'onContextMenu' | ||
> { | ||
column: CalculatedColumn<TRow, TSummaryRow>; | ||
colSpan: number | undefined; | ||
isCopied: boolean; | ||
|
@@ -209,10 +205,10 @@ export interface CellSelectArgs<TRow, TSummaryRow = unknown> { | |
|
||
export interface BaseRenderRowProps<TRow, TSummaryRow = unknown> | ||
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'children'>, | ||
Pick< | ||
DataGridProps<TRow, TSummaryRow>, | ||
'onCellClick' | 'onCellDoubleClick' | 'onCellContextMenu' | ||
> { | ||
Pick< | ||
DataGridProps<TRow, TSummaryRow>, | ||
'onCellClick' | 'onCellDoubleClick' | 'onCellContextMenu' | ||
> { | ||
viewportColumns: readonly CalculatedColumn<TRow, TSummaryRow>[]; | ||
rowIdx: number; | ||
selectedCellIdx: number | undefined; | ||
|
@@ -304,7 +300,7 @@ export interface RenderSortPriorityProps { | |
priority: number | undefined; | ||
} | ||
|
||
export interface RenderSortStatusProps extends RenderSortIconProps, RenderSortPriorityProps {} | ||
export interface RenderSortStatusProps extends RenderSortIconProps, RenderSortPriorityProps { } | ||
|
||
export interface RenderCheckboxProps | ||
extends Pick< | ||
|
@@ -316,11 +312,11 @@ export interface RenderCheckboxProps | |
} | ||
|
||
export interface Renderers<TRow, TSummaryRow> { | ||
renderCell?: Maybe<(key: Key, props: CellRendererProps<TRow, TSummaryRow>) => ReactNode>; | ||
renderCheckbox?: Maybe<(props: RenderCheckboxProps) => ReactNode>; | ||
renderRow?: Maybe<(key: Key, props: RenderRowProps<TRow, TSummaryRow>) => ReactNode>; | ||
renderSortStatus?: Maybe<(props: RenderSortStatusProps) => ReactNode>; | ||
renderCell?: Maybe<(key: Key, props: CellRendererProps<TRow, TSummaryRow>) => ReactNode>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert |
||
noRowsFallback?: Maybe<ReactNode>; | ||
} | ||
|
||
export type Direction = 'ltr' | 'rtl'; | ||
export type Direction = 'ltr' | 'rtl'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ export function stopPropagation(event: React.SyntheticEvent) { | |
|
||
export function scrollIntoView(element: Maybe<Element>) { | ||
element?.scrollIntoView({ inline: 'nearest', block: 'nearest' }); | ||
// element?.scrollIntoView({ inline: 'center', block: 'nearest' }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clean |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do duplication of 2/4 (so let's use 4px or 6px here)