@linzjs/step-ag-grid 30.4.3 → 30.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/GridTheme.scss
CHANGED
|
@@ -279,6 +279,10 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
279
279
|
|
|
280
280
|
.ag-theme-step-view-list-default.theme-specific {
|
|
281
281
|
|
|
282
|
+
.ag-header-hide-default-select .ag-labeled {
|
|
283
|
+
display: none;
|
|
284
|
+
}
|
|
285
|
+
|
|
282
286
|
.ag-header-cell {
|
|
283
287
|
font-size: 14px;
|
|
284
288
|
font-weight: 600;
|
|
@@ -295,4 +299,4 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
295
299
|
.ag-header-cell {
|
|
296
300
|
font-size: 14px;
|
|
297
301
|
}
|
|
298
|
-
}
|
|
302
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import '../../styles/GridTheme.scss';
|
|
2
|
+
import '../../styles/index.scss';
|
|
3
|
+
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
+
import '@linzjs/lui/dist/fonts';
|
|
5
|
+
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
7
|
+
import { useMemo, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ColDefT,
|
|
11
|
+
Grid,
|
|
12
|
+
GridCell,
|
|
13
|
+
GridContextProvider,
|
|
14
|
+
GridProps,
|
|
15
|
+
GridUpdatingContextProvider,
|
|
16
|
+
GridWrapper,
|
|
17
|
+
} from '../..';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
title: 'Components / Grids',
|
|
21
|
+
component: Grid,
|
|
22
|
+
// Storybook hangs otherwise
|
|
23
|
+
parameters: {
|
|
24
|
+
docs: {
|
|
25
|
+
source: {
|
|
26
|
+
type: 'code',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
decorators: [
|
|
31
|
+
(Story) => (
|
|
32
|
+
<div style={{ maxWidth: 1024, height: 400, display: 'flex', flexDirection: 'column' }}>
|
|
33
|
+
<GridUpdatingContextProvider>
|
|
34
|
+
<GridContextProvider>
|
|
35
|
+
<Story />
|
|
36
|
+
</GridContextProvider>
|
|
37
|
+
</GridUpdatingContextProvider>
|
|
38
|
+
</div>
|
|
39
|
+
),
|
|
40
|
+
],
|
|
41
|
+
} as Meta<typeof Grid>;
|
|
42
|
+
|
|
43
|
+
interface ITestRow {
|
|
44
|
+
id: number;
|
|
45
|
+
position: string;
|
|
46
|
+
age: number;
|
|
47
|
+
height: string;
|
|
48
|
+
desc: string;
|
|
49
|
+
dd: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const GridReadOnlyTemplate: StoryFn<typeof Grid<ITestRow>> = (props: GridProps<ITestRow>) => {
|
|
53
|
+
const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
|
|
54
|
+
const columnDefs: ColDefT<ITestRow>[] = useMemo(
|
|
55
|
+
() => [
|
|
56
|
+
GridCell<ITestRow, ITestRow['id']>({
|
|
57
|
+
field: 'id',
|
|
58
|
+
headerName: 'Id',
|
|
59
|
+
lockVisible: true,
|
|
60
|
+
resizable: false,
|
|
61
|
+
lockPosition: 'left',
|
|
62
|
+
cellRenderer: ({ value }) => <a href={'#'}>{value}</a>,
|
|
63
|
+
}),
|
|
64
|
+
GridCell<ITestRow, ITestRow['position']>({
|
|
65
|
+
field: 'position',
|
|
66
|
+
headerName: 'Position',
|
|
67
|
+
resizable: false,
|
|
68
|
+
lockPosition: 'left',
|
|
69
|
+
cellRendererParams: {
|
|
70
|
+
warning: ({ value }) => value === 'Tester' && 'Testers are testing',
|
|
71
|
+
info: ({ value }) => value === 'Developer' && 'Developers are awesome',
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
GridCell({
|
|
75
|
+
field: 'desc',
|
|
76
|
+
headerName: 'Description',
|
|
77
|
+
resizable: false,
|
|
78
|
+
lockPosition: 'left',
|
|
79
|
+
}),
|
|
80
|
+
GridCell({
|
|
81
|
+
field: 'age',
|
|
82
|
+
headerName: 'Age',
|
|
83
|
+
resizable: false,
|
|
84
|
+
lockPosition: 'left',
|
|
85
|
+
}),
|
|
86
|
+
GridCell({
|
|
87
|
+
field: 'height',
|
|
88
|
+
headerName: 'Height',
|
|
89
|
+
resizable: false,
|
|
90
|
+
lockPosition: 'left',
|
|
91
|
+
}),
|
|
92
|
+
],
|
|
93
|
+
[],
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const [rowData] = useState<ITestRow[]>([
|
|
97
|
+
{ id: 1000, position: 'Tester', age: 30, height: `6'4"`, desc: 'Tests application', dd: '1' },
|
|
98
|
+
{ id: 1001, position: 'Developer', age: 12, height: `5'3"`, desc: 'Develops application', dd: '2' },
|
|
99
|
+
{ id: 1002, position: 'Manager', age: 65, height: `5'9"`, desc: 'Manages', dd: '3' },
|
|
100
|
+
]);
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<GridWrapper maxHeight={400}>
|
|
104
|
+
<Grid
|
|
105
|
+
data-testid={'readonly'}
|
|
106
|
+
{...props}
|
|
107
|
+
selectable={true}
|
|
108
|
+
rowSelection={'multiple'}
|
|
109
|
+
externalSelectedItems={externalSelectedItems}
|
|
110
|
+
setExternalSelectedItems={setExternalSelectedItems}
|
|
111
|
+
columnDefs={columnDefs}
|
|
112
|
+
rowData={rowData}
|
|
113
|
+
sizeColumns={'fit'}
|
|
114
|
+
theme={'ag-theme-step-view-list-default'}
|
|
115
|
+
contextMenuSelectRow={false}
|
|
116
|
+
suppressCellFocus={true}
|
|
117
|
+
/>
|
|
118
|
+
</GridWrapper>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
export const SelectableListViewGrid = GridReadOnlyTemplate.bind({});
|
|
@@ -279,6 +279,10 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
279
279
|
|
|
280
280
|
.ag-theme-step-view-list-default.theme-specific {
|
|
281
281
|
|
|
282
|
+
.ag-header-hide-default-select .ag-labeled {
|
|
283
|
+
display: none;
|
|
284
|
+
}
|
|
285
|
+
|
|
282
286
|
.ag-header-cell {
|
|
283
287
|
font-size: 14px;
|
|
284
288
|
font-weight: 600;
|
|
@@ -295,4 +299,4 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
295
299
|
.ag-header-cell {
|
|
296
300
|
font-size: 14px;
|
|
297
301
|
}
|
|
298
|
-
}
|
|
302
|
+
}
|