aloha-vue 1.2.39 → 1.2.41
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
package/src/ATable/ATable.js
CHANGED
|
@@ -332,6 +332,10 @@ export default {
|
|
|
332
332
|
required: false,
|
|
333
333
|
default: 0,
|
|
334
334
|
},
|
|
335
|
+
useViewSlot: {
|
|
336
|
+
type: Boolean,
|
|
337
|
+
required: false,
|
|
338
|
+
},
|
|
335
339
|
valuesForColumnDefault: {
|
|
336
340
|
type: Array,
|
|
337
341
|
required: false,
|
|
@@ -721,6 +725,7 @@ export default {
|
|
|
721
725
|
modelView: this.modelView,
|
|
722
726
|
tableActionsIndexFirstDropdownAction: this.tableActionsIndexFirstDropdownAction,
|
|
723
727
|
tableActionsIndexFirstDropdownActionMobile: this.tableActionsIndexFirstDropdownActionMobile,
|
|
728
|
+
useViewSlot: this.useViewSlot,
|
|
724
729
|
onUpdateViewCurrent: this.updateViewCurrent,
|
|
725
730
|
onUpdateModelQuickSearch: this.updateModelQuickSearch,
|
|
726
731
|
onToggleMultipleActionsActive: this.toggleMultipleActionsActive,
|
|
@@ -105,6 +105,10 @@ export default {
|
|
|
105
105
|
required: false,
|
|
106
106
|
default: 0,
|
|
107
107
|
},
|
|
108
|
+
useViewSlot: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
required: false,
|
|
111
|
+
},
|
|
108
112
|
viewCurrent: {
|
|
109
113
|
type: Object,
|
|
110
114
|
required: false,
|
|
@@ -150,6 +154,7 @@ export default {
|
|
|
150
154
|
|
|
151
155
|
const {
|
|
152
156
|
updateViewCurrentLocal,
|
|
157
|
+
viewSlotLocal,
|
|
153
158
|
} = ViewsAPI(props, context);
|
|
154
159
|
|
|
155
160
|
return {
|
|
@@ -166,6 +171,7 @@ export default {
|
|
|
166
171
|
textMultipleSelectedTranslateExtra,
|
|
167
172
|
toggleBtnAllRows,
|
|
168
173
|
updateViewCurrentLocal,
|
|
174
|
+
viewSlotLocal,
|
|
169
175
|
};
|
|
170
176
|
},
|
|
171
177
|
computed: {
|
|
@@ -251,7 +257,7 @@ export default {
|
|
|
251
257
|
class: "a_d_inline_block",
|
|
252
258
|
isButtonGroup: true,
|
|
253
259
|
disabled: this.disabledViews,
|
|
254
|
-
slotName:
|
|
260
|
+
slotName: this.viewSlotLocal,
|
|
255
261
|
data: this.views,
|
|
256
262
|
keyId: "id",
|
|
257
263
|
keyLabel: "label",
|
|
@@ -259,9 +265,9 @@ export default {
|
|
|
259
265
|
classFieldset: "a_p_0",
|
|
260
266
|
"onUpdate:modelValue": this.updateViewCurrentLocal,
|
|
261
267
|
}, {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
268
|
+
viewSlot: arg => this.$slots.viewSlot && this.$slots.viewSlot({
|
|
269
|
+
...arg,
|
|
270
|
+
}),
|
|
265
271
|
}),
|
|
266
272
|
this.$slots.tableActionsAppend && this.$slots.tableActionsAppend({
|
|
267
273
|
isMultipleActionsActive: this.isMultipleActionsActive,
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
1
6
|
export default function ViewsAPI(props, { emit }) {
|
|
7
|
+
const useViewSlot = toRef(props, "useViewSlot");
|
|
8
|
+
|
|
2
9
|
const updateViewCurrentLocal = model => {
|
|
3
10
|
emit("updateViewCurrent", model);
|
|
4
11
|
};
|
|
5
12
|
|
|
13
|
+
const viewSlotLocal = computed(() => {
|
|
14
|
+
return useViewSlot.value ? "viewSlot" : undefined;
|
|
15
|
+
});
|
|
16
|
+
|
|
6
17
|
return {
|
|
7
18
|
updateViewCurrentLocal,
|
|
19
|
+
viewSlotLocal,
|
|
8
20
|
};
|
|
9
21
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
} from "vue";
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
+
find,
|
|
7
8
|
keyBy,
|
|
8
9
|
} from "lodash-es";
|
|
9
10
|
|
|
@@ -26,10 +27,14 @@ export default function ViewsAPI(props, { emit }) {
|
|
|
26
27
|
|
|
27
28
|
const initViewCurrent = () => {
|
|
28
29
|
if (hasViews.value) {
|
|
29
|
-
const
|
|
30
|
+
const VIEW_ACTIVE = find(views.value, ["active", true]);
|
|
31
|
+
let modelViewLocal = views.value[0].id;
|
|
32
|
+
if (VIEW_ACTIVE) {
|
|
33
|
+
modelViewLocal = VIEW_ACTIVE.id;
|
|
34
|
+
}
|
|
30
35
|
emit("updateView", {
|
|
31
|
-
_modelView:
|
|
32
|
-
view: viewKeyById.value[
|
|
36
|
+
_modelView: modelViewLocal,
|
|
37
|
+
view: viewKeyById.value[modelViewLocal],
|
|
33
38
|
modelFilters: modelFilters.value,
|
|
34
39
|
init: true,
|
|
35
40
|
});
|