@webitel/ui-sdk 24.10.62 → 24.10.63
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
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
import { computed } from 'vue';
|
|
36
36
|
import IconAction from '../../enums/IconAction/IconAction.enum.js';
|
|
37
37
|
import WtIconAction from '../wt-icon-action/wt-icon-action.vue';
|
|
38
|
-
import { tableActionsOrder,
|
|
38
|
+
import { tableActionsOrder, sectionActionsOrder } from './WtActionBarActionsOrder.js';
|
|
39
39
|
|
|
40
40
|
const props = defineProps({
|
|
41
41
|
/**
|
|
42
|
-
* [`'table'`, `'
|
|
42
|
+
* [`'table'`, `'section'`]
|
|
43
43
|
* */
|
|
44
44
|
mode: {
|
|
45
45
|
type: String,
|
|
46
46
|
default: 'table',
|
|
47
|
-
validator: (v) => ['table', '
|
|
47
|
+
validator: (v) => ['table', 'section'].includes(v),
|
|
48
48
|
},
|
|
49
49
|
/**
|
|
50
50
|
* see `IconAction` enum
|
|
@@ -63,6 +63,24 @@ const props = defineProps({
|
|
|
63
63
|
// default: 'md',
|
|
64
64
|
// validator: (v) => ['sm', 'md', 'lg'].includes(v),
|
|
65
65
|
},
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Leave the default value for the mode only listed in includes prop
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
include: {
|
|
72
|
+
type: Array,
|
|
73
|
+
default: () => [],
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Leave the default values for the mode, except for those in exclude prop
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
exclude: {
|
|
81
|
+
type: Array,
|
|
82
|
+
default: () => [],
|
|
83
|
+
},
|
|
66
84
|
});
|
|
67
85
|
const emit = defineEmits([
|
|
68
86
|
/**
|
|
@@ -72,7 +90,11 @@ const emit = defineEmits([
|
|
|
72
90
|
]);
|
|
73
91
|
|
|
74
92
|
const shownActions = computed(() => {
|
|
75
|
-
const actionsOrder = props.mode === '
|
|
93
|
+
const actionsOrder = props.mode === 'section' ? sectionActionsOrder : tableActionsOrder;
|
|
94
|
+
|
|
95
|
+
if(props.include.length) return actionsOrder.filter((action) => props.include.includes(action));
|
|
96
|
+
|
|
97
|
+
if(props.exclude.length) return actionsOrder.filter((action) => !props.exclude.includes(action));
|
|
76
98
|
|
|
77
99
|
return actionsOrder.filter((action) => props.actions.includes(action));
|
|
78
100
|
});
|