@azrico/reactgrid 1.1.29 → 1.1.31
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.
|
@@ -224,7 +224,7 @@ function DataGridEventsWrapper(props) {
|
|
|
224
224
|
}), props.children);
|
|
225
225
|
}
|
|
226
226
|
function DataGridSizeWrapper(props) {
|
|
227
|
-
console.log(props);
|
|
227
|
+
// console.log(props);
|
|
228
228
|
if (props.delayedSize) {
|
|
229
229
|
return _react.default.createElement(DataGridDelayedSize, {
|
|
230
230
|
...props
|
|
@@ -421,13 +421,13 @@ function ApplyColumnData(props) {
|
|
|
421
421
|
//console.log(final_columns);
|
|
422
422
|
return final_columns;
|
|
423
423
|
}
|
|
424
|
-
function to_datasource(arr, idProperty) {
|
|
424
|
+
function to_datasource(arr, idProperty, valueAsID = true) {
|
|
425
425
|
const res = [];
|
|
426
426
|
let index = 0;
|
|
427
427
|
if (Array.isArray(arr)) {
|
|
428
428
|
arr.map(s => {
|
|
429
429
|
let elem = {};
|
|
430
|
-
elem[idProperty] = '_cid_' + index;
|
|
430
|
+
if (valueAsID) elem[idProperty] = String(s).toLowerCase();else elem[idProperty] = '_cid_' + index;
|
|
431
431
|
if (typeof s === 'object') elem = {
|
|
432
432
|
...elem,
|
|
433
433
|
...s
|
package/package.json
CHANGED
package/src/views/DataGrid.tsx
CHANGED
|
@@ -365,7 +365,7 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
|
|
|
365
365
|
);
|
|
366
366
|
}
|
|
367
367
|
function DataGridSizeWrapper(props: DataGridWrapperProps) {
|
|
368
|
-
console.log(props);
|
|
368
|
+
// console.log(props);
|
|
369
369
|
if (props.delayedSize) {
|
|
370
370
|
return <DataGridDelayedSize {...props} />;
|
|
371
371
|
} else {
|
|
@@ -572,13 +572,14 @@ function ApplyColumnData(props: any): ColumnDefinition[] {
|
|
|
572
572
|
return final_columns;
|
|
573
573
|
}
|
|
574
574
|
|
|
575
|
-
function to_datasource(arr: any[], idProperty: string) {
|
|
575
|
+
function to_datasource(arr: any[], idProperty: string, valueAsID = true) {
|
|
576
576
|
const res: any[] = [];
|
|
577
577
|
let index = 0;
|
|
578
578
|
if (Array.isArray(arr)) {
|
|
579
579
|
arr.map((s: any) => {
|
|
580
580
|
let elem = {};
|
|
581
|
-
elem[idProperty] =
|
|
581
|
+
if (valueAsID) elem[idProperty] = String(s).toLowerCase();
|
|
582
|
+
else elem[idProperty] = '_cid_' + index;
|
|
582
583
|
if (typeof s === 'object') elem = { ...elem, ...s };
|
|
583
584
|
else elem['label'] = s;
|
|
584
585
|
res.push(elem);
|