@linzjs/step-ag-grid 2.0.1 → 2.1.1
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/README.md +28 -10
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/src/components/Grid.d.ts +0 -1
- package/dist/step-ag-grid.esm.js +1 -2
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +10 -1
- package/src/components/Grid.tsx +1 -3
- package/src/stories/components/GridPopoutBearing.stories.tsx +2 -3
- package/src/stories/components/GridPopoutEditDropDown.stories.tsx +2 -4
- package/src/stories/components/GridPopoutEditGeneric.stories.tsx +2 -3
- package/src/stories/components/GridPopoutEditGenericTextArea.stories.tsx +2 -3
- package/src/stories/components/GridPopoutEditMultiSelect.stories.tsx +2 -3
- package/src/stories/components/GridReadOnly.stories.tsx +4 -5
package/README.md
CHANGED
|
@@ -49,16 +49,20 @@ import "@linzjs/step-ag-grid/dist/index.css"
|
|
|
49
49
|
import "@linzjs/step-ag-grid/dist/GridTheme.scss";
|
|
50
50
|
|
|
51
51
|
import { useMemo } from "react";
|
|
52
|
-
import {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
import {
|
|
53
|
+
GridUpdatingContextProvider,
|
|
54
|
+
GridContextProvider,
|
|
55
|
+
ColDefT,
|
|
56
|
+
GridCell,
|
|
57
|
+
GridPopoverMessage,
|
|
58
|
+
GridPopoverEditDropDown
|
|
59
|
+
} from "@linzjs/step-ag-grid";
|
|
56
60
|
|
|
57
61
|
const GridDemo = () => {
|
|
58
62
|
interface ITestRow {
|
|
59
63
|
id: number;
|
|
64
|
+
name: number;
|
|
60
65
|
position: string;
|
|
61
|
-
age: number;
|
|
62
66
|
};
|
|
63
67
|
|
|
64
68
|
const columnDefs: ColDefT<ITestRow>[] = useMemo(() => [
|
|
@@ -69,8 +73,8 @@ const GridDemo = () => {
|
|
|
69
73
|
maxWidth: 85,
|
|
70
74
|
}),
|
|
71
75
|
GridCell({
|
|
72
|
-
field: "
|
|
73
|
-
headerName: "
|
|
76
|
+
field: "name",
|
|
77
|
+
headerName: "Name",
|
|
74
78
|
initialWidth: 65,
|
|
75
79
|
maxWidth: 150,
|
|
76
80
|
cellRendererParams: {
|
|
@@ -78,6 +82,20 @@ const GridDemo = () => {
|
|
|
78
82
|
info: (props) => props.value === "Developer" && "Developers are awesome",
|
|
79
83
|
},
|
|
80
84
|
}),
|
|
85
|
+
GridPopoverEditDropDown(
|
|
86
|
+
{
|
|
87
|
+
field: "position",
|
|
88
|
+
initialWidth: 65,
|
|
89
|
+
maxWidth: 150,
|
|
90
|
+
headerName: "Position",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
multiEdit: false,
|
|
94
|
+
editorParams: {
|
|
95
|
+
options: ["Architect", "Developer", "Product Owner", "Scrum Master", "Tester", MenuSeparator, "(other)"],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
),
|
|
81
99
|
GridPopoverMessage(
|
|
82
100
|
{
|
|
83
101
|
headerName: "Popout message",
|
|
@@ -86,7 +104,7 @@ const GridDemo = () => {
|
|
|
86
104
|
{
|
|
87
105
|
multiEdit: true,
|
|
88
106
|
editorParams: {
|
|
89
|
-
message: async (formParams)
|
|
107
|
+
message: async (formParams) => {
|
|
90
108
|
return `There are ${formParams.selectedRows.length} row(s) selected`;
|
|
91
109
|
},
|
|
92
110
|
},
|
|
@@ -98,8 +116,8 @@ const GridDemo = () => {
|
|
|
98
116
|
|
|
99
117
|
const rowData: ITestRow[] = useMemo(
|
|
100
118
|
() => [
|
|
101
|
-
{ id: 1000,
|
|
102
|
-
{ id: 1001,
|
|
119
|
+
{ id: 1000, name: "Tom", position: "Tester" },
|
|
120
|
+
{ id: 1001, name: "Sue", position: "Developer" },
|
|
103
121
|
],
|
|
104
122
|
[],
|
|
105
123
|
);
|
package/dist/index.js
CHANGED
|
@@ -2415,10 +2415,9 @@ var Grid = function (params) {
|
|
|
2415
2415
|
}, [clickSelectorCheckboxWhenContainingCellClicked, params.columnDefs, params.selectable]);
|
|
2416
2416
|
var onGridReady = react.useCallback(function (event) {
|
|
2417
2417
|
setGridApi(event.api);
|
|
2418
|
-
params.onGridReady && params.onGridReady(event);
|
|
2419
2418
|
synchroniseExternallySelectedItemsToGrid();
|
|
2420
2419
|
updateQuickFilter();
|
|
2421
|
-
}, [
|
|
2420
|
+
}, [setGridApi, synchroniseExternallySelectedItemsToGrid, updateQuickFilter]);
|
|
2422
2421
|
var noRowsOverlayComponent = react.useCallback(function () { var _a; return jsxRuntime.jsx("span", { children: (_a = params.noRowsOverlayText) !== null && _a !== void 0 ? _a : "There are currently no rows" }); }, [params.noRowsOverlayText]);
|
|
2423
2422
|
var refreshSelectedRows = react.useCallback(function (event) {
|
|
2424
2423
|
// Force-refresh all selected rows to re-run class function, to update selection highlighting
|