@azrico/reactgrid 1.0.9 → 1.0.11
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.
|
@@ -27,7 +27,7 @@ type customColumnData = {
|
|
|
27
27
|
render: (cell: any, formatterParams: any, onRendered: any) => React.ReactNode;
|
|
28
28
|
};
|
|
29
29
|
type GridOptions = Partial<TypeDataGridProps>;
|
|
30
|
-
type AzGridProps = {
|
|
30
|
+
export type AzGridProps = {
|
|
31
31
|
columns?: columnOrString[];
|
|
32
32
|
rows?: any[];
|
|
33
33
|
licenseKey?: string;
|
|
@@ -46,6 +46,7 @@ function AzGrid(props) {
|
|
|
46
46
|
if (!Array.isArray(mcols)) return [];
|
|
47
47
|
/* ------------------------------- fix columns ------------------------------ */
|
|
48
48
|
mcols.map(r => {
|
|
49
|
+
if (r == null) return null;
|
|
49
50
|
if (typeof r === 'string') return {
|
|
50
51
|
field: r,
|
|
51
52
|
header: r
|
|
@@ -136,6 +137,7 @@ function AzGrid(props) {
|
|
|
136
137
|
} else new_rows = props.rows || [];
|
|
137
138
|
/* -------------------------------------------------------------------------- */
|
|
138
139
|
if (!Array.isArray(new_rows)) new_rows = [];
|
|
140
|
+
new_rows = new_rows.filter(s => s != null);
|
|
139
141
|
/* -------------------------- fix child parent rel -------------------------- */
|
|
140
142
|
if (props.allowChildRows) new_rows = (0, _helpers.fix_parent_child_relations)(new_rows);
|
|
141
143
|
set_cached_rows(new_rows);
|
package/package.json
CHANGED
package/src/views/DataGrid.tsx
CHANGED
|
@@ -45,7 +45,7 @@ type customColumnData = {
|
|
|
45
45
|
};
|
|
46
46
|
type GridOptions = Partial<TypeDataGridProps>;
|
|
47
47
|
/* -------------------------------------------------------------------------- */
|
|
48
|
-
type AzGridProps = {
|
|
48
|
+
export type AzGridProps = {
|
|
49
49
|
columns?: columnOrString[];
|
|
50
50
|
rows?: any[];
|
|
51
51
|
licenseKey?: string;
|
|
@@ -121,6 +121,7 @@ export function AzGrid(props: AzGridProps) {
|
|
|
121
121
|
|
|
122
122
|
mcols
|
|
123
123
|
.map((r) => {
|
|
124
|
+
if (r == null) return null;
|
|
124
125
|
if (typeof r === 'string') return { field: r, header: r };
|
|
125
126
|
if (typeof r === 'object') {
|
|
126
127
|
let final_cl: MakeWriteable<ColumnDefinition> = {
|
|
@@ -214,6 +215,7 @@ export function AzGrid(props: AzGridProps) {
|
|
|
214
215
|
} else new_rows = props.rows || [];
|
|
215
216
|
/* -------------------------------------------------------------------------- */
|
|
216
217
|
if (!Array.isArray(new_rows)) new_rows = [];
|
|
218
|
+
new_rows = new_rows.filter((s) => s != null);
|
|
217
219
|
/* -------------------------- fix child parent rel -------------------------- */
|
|
218
220
|
if (props.allowChildRows) new_rows = fix_parent_child_relations(new_rows);
|
|
219
221
|
|