Skip to content

Commit 80e8f59

Browse files
committed
release version patch canary
1 parent 35679ed commit 80e8f59

8 files changed

Lines changed: 100 additions & 24 deletions

File tree

examples/src/pages/tests/table/full-demo.page.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ function getColumns(): Record<string, InfiniteTableColumn<Developer>> {
108108
renderValue: ({ value }) => value,
109109
},
110110
salary: {
111-
header: 'Compensation',
112111
field: 'salary',
113112
type: 'number',
114113
defaultWidth: 210,
@@ -123,7 +122,6 @@ function getColumns(): Record<string, InfiniteTableColumn<Developer>> {
123122
defaultWidth: 135,
124123
field: 'canDesign',
125124
header: 'Design Skills',
126-
renderMenuIcon: false,
127125
renderValue: ({ value }) => {
128126
return (
129127
<div style={{ display: 'flex', alignItems: 'center' }}>
@@ -240,10 +238,10 @@ const defaultFilterValue: DataSourcePropFilterValue<Developer> = [
240238

241239
const domProps = {
242240
style: {
243-
// minHeight: '50vh',
244-
width: 575,
245-
height: 390,
246-
margin: 5,
241+
minHeight: '50vh',
242+
width: '100vw',
243+
// width: 575,
244+
marginTop: 200,
247245
},
248246
};
249247

@@ -300,10 +298,6 @@ export default function App() {
300298
filterMode="local"
301299
useGroupKeysForMultiRowSelection
302300
defaultRowSelection={defaultRowSelection}
303-
defaultSortInfo={{
304-
dir: -1,
305-
field: 'country',
306-
}}
307301
onDataArrayChange={(data) => {
308302
const min = Math.min(...data.map((data) => data.salary ?? 0));
309303
const max = Math.max(...data.map((data) => data.salary ?? 0));
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import * as React from 'react';
2+
3+
import {
4+
InfiniteTable,
5+
DataSource,
6+
DataSourceData,
7+
} from '@infinite-table/infinite-react';
8+
9+
import type { InfiniteTablePropColumns } from '@infinite-table/infinite-react';
10+
11+
type Developer = {
12+
id: number;
13+
firstName: string;
14+
lastName: string;
15+
country: string;
16+
city: string;
17+
currency: string;
18+
};
19+
20+
const dataSource: DataSourceData<Developer> = ({}) => {
21+
return [
22+
{
23+
id: 1,
24+
firstName: 'John',
25+
lastName: 'Bobson',
26+
country: 'USA',
27+
city: 'LA',
28+
currency: 'USD',
29+
},
30+
{
31+
id: 2,
32+
firstName: 'Bill',
33+
lastName: 'Richardson',
34+
country: 'USA',
35+
city: 'NY',
36+
currency: 'USD',
37+
},
38+
{
39+
id: 3,
40+
firstName: 'Nat',
41+
lastName: 'Natson',
42+
country: 'Canada',
43+
city: 'Montreal',
44+
currency: 'CAD',
45+
},
46+
];
47+
};
48+
const columns: InfiniteTablePropColumns<Developer> = {
49+
id: { field: 'id', defaultWidth: 80 },
50+
country: {
51+
field: 'country',
52+
},
53+
firstName: {
54+
field: 'firstName',
55+
},
56+
lastName: {
57+
field: 'lastName',
58+
},
59+
preferredLanguage: {
60+
field: 'currency',
61+
},
62+
};
63+
64+
export default function ColumnValueGetterExample() {
65+
return (
66+
<>
67+
<DataSource<Developer> primaryKey="id" data={dataSource}>
68+
<InfiniteTable<Developer>
69+
columns={columns}
70+
columnDefaultWidth={500}
71+
domProps={{
72+
style: {
73+
height: 500,
74+
marginTop: 300,
75+
},
76+
}}
77+
/>
78+
</DataSource>
79+
</>
80+
);
81+
}

source/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ const headerCls = HeaderClsRecipe({
3131
overflow: false,
3232
});
3333

34-
const updatePosition = (_options: {
35-
id: string;
36-
node: HTMLElement;
37-
offset: null | { left: number; top: number };
38-
}) => {};
34+
const emptyFn = () => {};
35+
3936
function InfiniteTableInternalHeaderFn<T>(
4037
props: InfiniteTableInternalHeaderProps<T> &
4138
React.HTMLAttributes<HTMLDivElement>,
@@ -172,14 +169,12 @@ function InfiniteTableInternalHeaderFn<T>(
172169
],
173170
);
174171

175-
const onDrop = useCallback((_sortedIndexes: number[]) => {}, []);
176-
177172
return (
178173
<DragList
179174
orientation="horizontal"
180175
dragListId="header"
181-
onDrop={onDrop}
182-
updatePosition={updatePosition}
176+
onDrop={emptyFn}
177+
updatePosition={emptyFn}
183178
>
184179
{(dragListDomProps) => {
185180
return (

source/src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ export const HeaderMenuIconCls = recipe({
374374
'&:active': {
375375
top: '1px',
376376
},
377-
[`${HeaderCellRecipe({})}:hover &`]: menuVisibleStyle,
377+
[`${HeaderCellRecipe.classNames.variants.dragging.false}:hover &`]:
378+
menuVisibleStyle,
378379
},
379380
},
380381
],

source/src/components/InfiniteTable/hooks/useColumnPointerEvents.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,19 @@ export const useColumnPointerEvents = ({
292292
col.computedVisibleIndex,
293293
rootRef.current,
294294
);
295+
setInfiniteColumnVisibility(
296+
col.computedVisibleIndex,
297+
'',
298+
rootRef.current,
299+
);
295300
setInfiniteColumnOffsetWhileReordering(
296301
col.computedVisibleIndex,
297302
'',
298303
rootRef.current,
299304
);
300305
});
301306

302-
setInfiniteColumnVisibility(dragColumnIndex, '', rootRef.current);
307+
// setInfiniteColumnVisibility(dragColumnIndex, '', rootRef.current);
303308

304309
setInfiniteColumnZIndex(
305310
dragColumnIndex,

www/src/components/CSEmbed/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function CSEmbed({
6666
) : null;
6767

6868
return descriptionBlock || titleBlock ? (
69-
<div className="bg-csdark rounded-lg">
69+
<div className="bg-codesandboxdark rounded-lg">
7070
{titleBlock}
7171
{descriptionBlock}
7272
{frame}

www/src/styles/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
--color-border: #ebecf0; /* gray-10 */
5454
--color-border-dark: #343a46; /* gray-80 */
5555
--color-brand: #0b6fcb; /* gray-80 */
56-
--color-csdark: #191919;
56+
--color-codesandboxdark: #191919;
5757
--color-brand-dark: #133048; /* gray-80 */
5858
--color-brand-blue: #497aff;
5959
--color-secondary-button: #ebecf0; /* gray-10 */

www/src/styles/www-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const colorVariables = {
1616
brandDark: BRAND_COLOR_DARK,
1717
black: colors.black,
1818
darkCustom: colors['darkcustom'],
19-
csdark: colors['csdark'],
19+
codesandboxdark: colors['codesandboxdark'],
2020
blue: 'blue',
2121
blue700: '#1c4fd8',
2222
glow: colors.glow,

0 commit comments

Comments
 (0)