aloha-vue 1.0.294 → 1.0.295
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/package.json
CHANGED
|
@@ -12,7 +12,6 @@ import ColumnSearchAPI from "../compositionAPI/ColumnSearchAPI";
|
|
|
12
12
|
import DragAndDropParentAPI from "../compositionAPI/DragAndDropParentAPI";
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
|
-
getModelColumnsOrderingDefault,
|
|
16
15
|
getModelColumnsVisibleDefault,
|
|
17
16
|
} from "../utils/utils";
|
|
18
17
|
import {
|
|
@@ -92,7 +91,7 @@ export default {
|
|
|
92
91
|
|
|
93
92
|
resetColumns() {
|
|
94
93
|
this.changeModelColumnsVisible(getModelColumnsVisibleDefault(this.columnsOrdered));
|
|
95
|
-
this.changeColumnsOrdering({
|
|
94
|
+
this.changeColumnsOrdering({ reset: true });
|
|
96
95
|
},
|
|
97
96
|
},
|
|
98
97
|
render() {
|
|
@@ -17,24 +17,31 @@ export default function ColumnsOrderingAPI(props, { emit }, {
|
|
|
17
17
|
false: [],
|
|
18
18
|
trueObject: {},
|
|
19
19
|
falseObject: {},
|
|
20
|
+
trueColumns: [],
|
|
21
|
+
falseColumns: [],
|
|
20
22
|
})),
|
|
21
23
|
}) {
|
|
22
24
|
const columns = toRef(props, "columns");
|
|
23
25
|
const modelColumnsOrdering = toRef(props, "modelColumnsOrdering");
|
|
24
26
|
|
|
25
|
-
const changeColumnsOrdering = ({ columnIndexDraggable, columnIndexOver }) => {
|
|
26
|
-
if (columnIndexDraggable === columnIndexOver) {
|
|
27
|
+
const changeColumnsOrdering = ({ columnIndexDraggable, columnIndexOver, reset }) => {
|
|
28
|
+
if (columnIndexDraggable === columnIndexOver && !reset) {
|
|
27
29
|
return;
|
|
28
30
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
let modelColumnsOrderingLocal = [];
|
|
32
|
+
if (reset) {
|
|
33
|
+
modelColumnsOrderingLocal = [...columnIdsGroupByLocked.value.true, ...columnIdsGroupByLocked.value.false];
|
|
34
|
+
} else {
|
|
35
|
+
modelColumnsOrderingLocal = cloneDeep(modelColumnsOrdering.value);
|
|
36
|
+
const ID_DRAGGABLE = modelColumnsOrderingLocal[columnIndexDraggable];
|
|
37
|
+
modelColumnsOrderingLocal.splice(columnIndexDraggable, 1);
|
|
38
|
+
modelColumnsOrderingLocal.splice(columnIndexOver, 0, ID_DRAGGABLE);
|
|
39
|
+
}
|
|
33
40
|
|
|
34
41
|
emit("changeColumnsOrdering", {
|
|
35
42
|
columnIndexDraggable,
|
|
36
43
|
columnIndexOver,
|
|
37
|
-
modelColumnsOrdering:
|
|
44
|
+
modelColumnsOrdering: modelColumnsOrderingLocal,
|
|
38
45
|
});
|
|
39
46
|
checkVisibleColumns();
|
|
40
47
|
};
|