@azrico/reactgrid 1.1.30 → 1.1.32

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.
@@ -44,6 +44,7 @@ const defaultOptions = {
44
44
  editStartEvent: 'click',
45
45
  rowReorderColumn: false,
46
46
  resizable: true,
47
+ columnUserSelect: "text",
47
48
  rowIndexColumn: true,
48
49
  rowHeight: 35,
49
50
  maxRowHeight: 40,
@@ -421,13 +422,13 @@ function ApplyColumnData(props) {
421
422
  //console.log(final_columns);
422
423
  return final_columns;
423
424
  }
424
- function to_datasource(arr, idProperty) {
425
+ function to_datasource(arr, idProperty, valueAsID = true) {
425
426
  const res = [];
426
427
  let index = 0;
427
428
  if (Array.isArray(arr)) {
428
429
  arr.map(s => {
429
430
  let elem = {};
430
- elem[idProperty] = '_cid_' + index;
431
+ if (valueAsID) elem[idProperty] = String(s).toLowerCase();else elem[idProperty] = '_cid_' + index;
431
432
  if (typeof s === 'object') elem = {
432
433
  ...elem,
433
434
  ...s
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/reactgrid",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -144,7 +144,7 @@ const defaultOptions: GridOptions = {
144
144
  editStartEvent: 'click',
145
145
  rowReorderColumn: false,
146
146
  resizable: true,
147
-
147
+ columnUserSelect:"text",
148
148
  rowIndexColumn: true,
149
149
  rowHeight: 35,
150
150
  maxRowHeight: 40,
@@ -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] = '_cid_' + index;
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);