imm-element-ui 0.6.0 → 0.6.1
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/esm2022/lib/grid/grid/grid.component.mjs +4 -4
- package/esm2022/lib/grid/grid-utils.mjs +7 -1
- package/esm2022/lib/share/utils.mjs +5 -2
- package/fesm2022/imm-element-ui.mjs +13 -4
- package/fesm2022/imm-element-ui.mjs.map +1 -1
- package/lib/grid/grid/grid.component.d.ts +2 -1
- package/package.json +1 -1
|
@@ -3692,7 +3692,7 @@ const convertGrid = (thisArg, gridList, fiterPreloads) => {
|
|
|
3692
3692
|
fiterPreloads = [...fiterPreloads, ...item.fiterPreloads];
|
|
3693
3693
|
}
|
|
3694
3694
|
if (item.type == 'grid') {
|
|
3695
|
-
let { gridOptions: { columnDefs, ...restGridOptions }, subTableSource, subDataKey, title, selectDataCb, fk, mainField, uniqueField, addDataCb, showDelete = true, scrollHeight, dragSort } = item;
|
|
3695
|
+
let { gridOptions: { columnDefs, ...restGridOptions }, subTableSource, subDataKey, title, selectDataCb, fk, mainField, uniqueField, addDataCb, showDelete = true, scrollHeight, dragSort, selectionMode } = item;
|
|
3696
3696
|
grid = { subTableSource, subDataKey, title, showDelete, ...grid };
|
|
3697
3697
|
let gridOptions = {
|
|
3698
3698
|
...restGridOptions,
|
|
@@ -3708,6 +3708,9 @@ const convertGrid = (thisArg, gridList, fiterPreloads) => {
|
|
|
3708
3708
|
gridOptions.rowDragManaged = true;
|
|
3709
3709
|
gridOptions.dragSort = dragSort;
|
|
3710
3710
|
}
|
|
3711
|
+
if (selectionMode) {
|
|
3712
|
+
gridOptions.selectionMode = selectionMode;
|
|
3713
|
+
}
|
|
3711
3714
|
convertCol(columnDefs, thisArg.authLevel, gridOptions.modelName, dragSort);
|
|
3712
3715
|
gridOptions.columnDefs = columnDefs;
|
|
3713
3716
|
if (subTableSource === 'select') {
|
|
@@ -3872,6 +3875,12 @@ const _gridUtils = {
|
|
|
3872
3875
|
maxWidth: 80,
|
|
3873
3876
|
});
|
|
3874
3877
|
}
|
|
3878
|
+
if (gridOptions.selectionMode === 'none') {
|
|
3879
|
+
gridOptions.rowSelection = undefined;
|
|
3880
|
+
}
|
|
3881
|
+
else if (gridOptions.selectionMode === 'single') {
|
|
3882
|
+
gridOptions.rowSelection = { mode: 'singleRow' };
|
|
3883
|
+
}
|
|
3875
3884
|
return { ...gridOptions };
|
|
3876
3885
|
},
|
|
3877
3886
|
};
|
|
@@ -5010,8 +5019,8 @@ class GridComponent {
|
|
|
5010
5019
|
this.grid?.api.forEachNode((node, index) => {
|
|
5011
5020
|
let id = node.data.id;
|
|
5012
5021
|
let isMovingDown = event.overIndex > this.dragBeforeIndex;
|
|
5013
|
-
if ((isMovingDown && index >= this.dragBeforeIndex && index <= event.overIndex)
|
|
5014
|
-
|
|
5022
|
+
if ((isMovingDown && index >= this.dragBeforeIndex && index <= event.overIndex) ||
|
|
5023
|
+
(!isMovingDown && index <= this.dragBeforeIndex && index >= event.overIndex)) {
|
|
5015
5024
|
// console.log('node----',node.data,event.overIndex)
|
|
5016
5025
|
let oldValue;
|
|
5017
5026
|
if (index == event.overIndex) {
|
|
@@ -5023,7 +5032,7 @@ class GridComponent {
|
|
|
5023
5032
|
// console.log('oldIndex----',oldValue)
|
|
5024
5033
|
if (!id) {
|
|
5025
5034
|
this.upsert()?.subsert[this.subIndex]['maptmp'].set(index, Object.assign(node.data, {
|
|
5026
|
-
[this.gridOptions().dragSort]: index + 1
|
|
5035
|
+
[this.gridOptions().dragSort]: index + 1,
|
|
5027
5036
|
}));
|
|
5028
5037
|
}
|
|
5029
5038
|
else {
|