@webitel/ui-sdk 3.1.24 → 3.1.26
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/ui-sdk.common.js +27 -26
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +24 -23
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +1 -1
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/organisms/wt-table-column-select/wt-table-column-select.vue +11 -11
- package/src/modules/CardStoreModule/composables/useCardStore.js +5 -0
- package/src/modules/TableStoreModule/composables/useTableStore.js +16 -9
package/package.json
CHANGED
|
@@ -25,7 +25,10 @@
|
|
|
25
25
|
class="wt-table-column-select__popup__item"
|
|
26
26
|
@click.capture.prevent="col.show = !col.show"
|
|
27
27
|
>
|
|
28
|
-
<wt-checkbox
|
|
28
|
+
<wt-checkbox
|
|
29
|
+
v-model="col.show"
|
|
30
|
+
:label="shownColLabel(col)"
|
|
31
|
+
></wt-checkbox>
|
|
29
32
|
</li>
|
|
30
33
|
</ul>
|
|
31
34
|
</template>
|
|
@@ -81,19 +84,16 @@ export default {
|
|
|
81
84
|
},
|
|
82
85
|
computed: {
|
|
83
86
|
changeableDraft() {
|
|
84
|
-
return this.draft
|
|
85
|
-
.filter((header) => !this.staticHeaders.includes(header.value))
|
|
86
|
-
// we should modify original objects to that this.draft would change
|
|
87
|
-
.map((header) => {
|
|
88
|
-
if (!header.text && header.locale) {
|
|
89
|
-
// eslint-disable-next-line no-param-reassign
|
|
90
|
-
header.text = typeof header.locale === 'string' ? this.$t(header.locale) : this.$t(...header.locale);
|
|
91
|
-
}
|
|
92
|
-
return header;
|
|
93
|
-
});
|
|
87
|
+
return this.draft.filter((header) => !this.staticHeaders.includes(header.value));
|
|
94
88
|
},
|
|
95
89
|
},
|
|
96
90
|
methods: {
|
|
91
|
+
shownColLabel({ text, locale }) {
|
|
92
|
+
if (!text && locale) {
|
|
93
|
+
return typeof locale === 'string' ? this.$t(locale) : this.$t(...locale);
|
|
94
|
+
}
|
|
95
|
+
return text;
|
|
96
|
+
},
|
|
97
97
|
openPopup() {
|
|
98
98
|
this.isColumnSelectPopup = true;
|
|
99
99
|
},
|
|
@@ -31,6 +31,10 @@ export const useCardStore = (namespace) => {
|
|
|
31
31
|
return store.dispatch(`${cardNamespace}/RESET_ITEM_STATE`);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
function setItemProp(payload) {
|
|
35
|
+
return store.dispatch(`${cardNamespace}/SET_ITEM_PROPERTY`, payload);
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
return {
|
|
35
39
|
id,
|
|
36
40
|
itemInstance,
|
|
@@ -40,5 +44,6 @@ export const useCardStore = (namespace) => {
|
|
|
40
44
|
updateItem,
|
|
41
45
|
setId,
|
|
42
46
|
resetState,
|
|
47
|
+
setItemProp,
|
|
43
48
|
};
|
|
44
49
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { computed } from 'vue';
|
|
2
2
|
import { useStore } from 'vuex';
|
|
3
|
-
import getNamespacedState
|
|
4
|
-
from '@webitel/ui-sdk/src/store/helpers/getNamespacedState';
|
|
3
|
+
import getNamespacedState from '../../../store/helpers/getNamespacedState';
|
|
5
4
|
|
|
6
5
|
// eslint-disable-next-line import/prefer-default-export
|
|
7
6
|
export const useTableStore = (namespace) => {
|
|
@@ -22,31 +21,38 @@ export const useTableStore = (namespace) => {
|
|
|
22
21
|
const size = computed(() => getNamespacedState(store.state, tableNamespace).size);
|
|
23
22
|
|
|
24
23
|
async function loadData() {
|
|
25
|
-
|
|
24
|
+
return store.dispatch(`${tableNamespace}/LOAD_DATA_LIST`);
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
async function setSize(payload) {
|
|
29
|
-
|
|
28
|
+
return store.dispatch(`${tableNamespace}/SET_SIZE`, payload);
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
async function nextPage() {
|
|
33
|
-
|
|
32
|
+
return store.dispatch(`${tableNamespace}/SET_NEXT_PAGE`);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
async function prevPage() {
|
|
37
|
-
|
|
36
|
+
return store.dispatch(`${tableNamespace}/PREV_PAGE`);
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
async function patchProperty(payload) {
|
|
41
|
-
|
|
40
|
+
return store.dispatch(`${tableNamespace}/PATCH_ITEM_PROPERTY`, payload);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
async function deleteItem(payload) {
|
|
45
|
-
|
|
44
|
+
return store.dispatch(`${tableNamespace}/DELETE_ITEM`, payload);
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
async function sort(...params) {
|
|
49
|
-
|
|
48
|
+
return store.dispatch(`${tableNamespace}/SORT`, {
|
|
49
|
+
header: params[0],
|
|
50
|
+
nextSortOrder: params[1],
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function setHeaders(payload) {
|
|
55
|
+
return store.dispatch(`${tableNamespace}/SET_HEADERS`, payload);
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
return {
|
|
@@ -64,5 +70,6 @@ export const useTableStore = (namespace) => {
|
|
|
64
70
|
patchProperty,
|
|
65
71
|
deleteItem,
|
|
66
72
|
sort,
|
|
73
|
+
setHeaders,
|
|
67
74
|
};
|
|
68
75
|
};
|