@azrico/reactgrid 1.3.38 → 1.3.39
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/dist/src/example.js +1 -2
- package/dist/src/func/func_grid.js +9 -8
- package/package.json +1 -1
- package/src/example.tsx +2 -3
- package/src/func/func_grid.ts +9 -8
- package/src/views/DataGrid.tsx +1 -1
package/dist/src/example.js
CHANGED
|
@@ -43,12 +43,11 @@ const columns = [{
|
|
|
43
43
|
const editableColumns = ['job', 'age'];
|
|
44
44
|
function getData(delta, max = 200) {
|
|
45
45
|
const fd = [];
|
|
46
|
-
console.log('Delta:', delta);
|
|
47
46
|
for (let index = 0; index < max; index++) {
|
|
48
47
|
const currentObject = {
|
|
49
48
|
__table_id: String(index),
|
|
50
49
|
name: 'user-' + index,
|
|
51
|
-
age:
|
|
50
|
+
age: 5 + index,
|
|
52
51
|
job: 'None'
|
|
53
52
|
};
|
|
54
53
|
if (delta[index] && typeof delta[index] === 'object') {
|
|
@@ -157,18 +157,20 @@ function ApplyColumnData(column_data) {
|
|
|
157
157
|
}
|
|
158
158
|
for (let index = 0; index < final_columns.length; index++) {
|
|
159
159
|
const col = final_columns[index];
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
const coltype = col.type;
|
|
161
|
+
delete col.type;
|
|
162
|
+
if (coltype) {
|
|
163
|
+
switch (coltype) {
|
|
162
164
|
case 'combo':
|
|
163
165
|
case 'select':
|
|
164
166
|
//@ts-ignore
|
|
165
167
|
col.editor = _SelectEditor.default;
|
|
166
168
|
break;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
case 'int':
|
|
170
|
+
case 'number':
|
|
171
|
+
case 'numberic':
|
|
172
|
+
col.type = 'number';
|
|
173
|
+
break;
|
|
172
174
|
case 'truefalse':
|
|
173
175
|
case 'bool':
|
|
174
176
|
case 'boolean':
|
|
@@ -177,7 +179,6 @@ function ApplyColumnData(column_data) {
|
|
|
177
179
|
break;
|
|
178
180
|
}
|
|
179
181
|
if (col.editable != false) col.editable = true;
|
|
180
|
-
delete col.type;
|
|
181
182
|
}
|
|
182
183
|
//@ts-ignore
|
|
183
184
|
if (!col.editorProps) col.editorProps = {};
|
package/package.json
CHANGED
package/src/example.tsx
CHANGED
|
@@ -30,13 +30,12 @@ const columns = [
|
|
|
30
30
|
const editableColumns = ['job', 'age'];
|
|
31
31
|
|
|
32
32
|
function getData(delta: any, max = 200) {
|
|
33
|
-
const fd: any[] = [];
|
|
34
|
-
console.log('Delta:', delta);
|
|
33
|
+
const fd: any[] = [];
|
|
35
34
|
for (let index = 0; index < max; index++) {
|
|
36
35
|
const currentObject = {
|
|
37
36
|
__table_id: String(index),
|
|
38
37
|
name: 'user-' + index,
|
|
39
|
-
age:
|
|
38
|
+
age: 5 + index,
|
|
40
39
|
job: 'None',
|
|
41
40
|
};
|
|
42
41
|
if (delta[index] && typeof delta[index] === 'object') {
|
package/src/func/func_grid.ts
CHANGED
|
@@ -154,18 +154,20 @@ export function ApplyColumnData(column_data: any): ColumnDefinition[] {
|
|
|
154
154
|
}
|
|
155
155
|
for (let index = 0; index < final_columns.length; index++) {
|
|
156
156
|
const col = final_columns[index];
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
const coltype = col.type;
|
|
158
|
+
delete col.type;
|
|
159
|
+
if (coltype) {
|
|
160
|
+
switch (coltype) {
|
|
159
161
|
case 'combo':
|
|
160
162
|
case 'select':
|
|
161
163
|
//@ts-ignore
|
|
162
164
|
col.editor = SelectEditor;
|
|
163
165
|
break;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
case 'int':
|
|
167
|
+
case 'number':
|
|
168
|
+
case 'numberic':
|
|
169
|
+
col.type = 'number';
|
|
170
|
+
break;
|
|
169
171
|
case 'truefalse':
|
|
170
172
|
case 'bool':
|
|
171
173
|
case 'boolean':
|
|
@@ -174,7 +176,6 @@ export function ApplyColumnData(column_data: any): ColumnDefinition[] {
|
|
|
174
176
|
break;
|
|
175
177
|
}
|
|
176
178
|
if (col.editable != false) col.editable = true;
|
|
177
|
-
delete col.type;
|
|
178
179
|
}
|
|
179
180
|
//@ts-ignore
|
|
180
181
|
if (!col.editorProps) col.editorProps = {};
|
package/src/views/DataGrid.tsx
CHANGED
|
@@ -177,7 +177,7 @@ export function AzGrid(props: AzGridProps) {
|
|
|
177
177
|
props.editableColumns,
|
|
178
178
|
props.columnExtensions,
|
|
179
179
|
props.customColumns,
|
|
180
|
-
]);
|
|
180
|
+
]);
|
|
181
181
|
/* -------------------------------------------------------------------------- */
|
|
182
182
|
/* Row changes */
|
|
183
183
|
/* -------------------------------------------------------------------------- */
|