@linzjs/step-ag-grid 30.4.2 → 30.4.3
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/package.json
CHANGED
package/src/components/Grid.tsx
CHANGED
|
@@ -771,8 +771,7 @@ export const Grid = <TData extends GridBaseRow = GridBaseRow>({
|
|
|
771
771
|
} else {
|
|
772
772
|
r = compareNaturalInsensitive(value1, value2);
|
|
773
773
|
}
|
|
774
|
-
|
|
775
|
-
return r === 0 ? compareNaturalInsensitive(node1.data?.id, node2.data?.id) : r;
|
|
774
|
+
return r;
|
|
776
775
|
};
|
|
777
776
|
}
|
|
778
777
|
const adjustedColDef = {
|
|
@@ -82,14 +82,14 @@ const GridReadOnlyTemplate: StoryFn<typeof Grid<ITestRow>> = (props: GridProps<I
|
|
|
82
82
|
colId: 'customComparatorText',
|
|
83
83
|
headerName: 'Cust. comp. id as text',
|
|
84
84
|
valueFormatter: ({ data }) => data?.text ?? '',
|
|
85
|
-
comparator: (_v1, _v2, n1, n2) => compareNaturalInsensitive(String(n1.data?.id), String(n2.data?.id))
|
|
85
|
+
comparator: (_v1, _v2, n1, n2) => compareNaturalInsensitive(String(n1.data?.id), String(n2.data?.id)),
|
|
86
86
|
}),
|
|
87
87
|
GridCell({
|
|
88
88
|
colId: 'customComparatorNumeric',
|
|
89
|
-
headerName: 'Cust. comp.
|
|
89
|
+
headerName: 'Cust. comp. number',
|
|
90
90
|
valueFormatter: ({ data }) => String(data?.numeric ?? ''),
|
|
91
91
|
comparator: (_v1, _v2, n1, n2) => {
|
|
92
|
-
return compareNaturalInsensitive(n1.data?.numeric, n2.data?.numeric)
|
|
92
|
+
return compareNaturalInsensitive(n1.data?.numeric, n2.data?.numeric);
|
|
93
93
|
},
|
|
94
94
|
}),
|
|
95
95
|
],
|
|
@@ -148,16 +148,8 @@ Sorting.play = async (context) => {
|
|
|
148
148
|
await test('numeric', ['–', '-1.1', '1', '2.01', '2.1', '2.21', '3', '3', '11', '21']);
|
|
149
149
|
await test('numeric', ['21', '11', '3', '3', '2.21', '2.1', '2.01', '1', '-1.1', '–']);
|
|
150
150
|
|
|
151
|
-
await test(
|
|
152
|
-
|
|
153
|
-
['–', '2', '10', 'ade', 'ade', 'b', 'b', 'cdc', 'e', 'e'],
|
|
154
|
-
['1006', '1002', '1003', '1000', '1009', '1004', '1005', '1001', '1007', '1008'],
|
|
155
|
-
);
|
|
156
|
-
await test(
|
|
157
|
-
'text',
|
|
158
|
-
['e', 'e', 'cdc', 'b', 'b', 'ade', 'ade', '10', '2', '–'],
|
|
159
|
-
['1008', '1007', '1001', '1005', '1004', '1009', '1000', '1003', '1002', '1006'],
|
|
160
|
-
);
|
|
151
|
+
await test('text', ['–', '2', '10', 'ade', 'ade', 'b', 'b', 'cdc', 'e', 'e']);
|
|
152
|
+
await test('text', ['e', 'e', 'cdc', 'b', 'b', 'ade', 'ade', '10', '2', '–']);
|
|
161
153
|
|
|
162
154
|
await test('customComparatorText', null, [
|
|
163
155
|
'1000',
|