@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "24.10.62",
3
+ "version": "24.10.63",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -12,7 +12,4 @@ export const tableActionsOrder = [
12
12
  ];
13
13
 
14
14
  // TODO
15
- export const cardActionsOrder = [
16
- ...tableActionsOrder,
17
- IconAction.EDIT,
18
- ]
15
+ export const sectionActionsOrder = tableActionsOrder;
@@ -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, cardActionsOrder } from './WtActionBarActionsOrder.js';
38
+ import { tableActionsOrder, sectionActionsOrder } from './WtActionBarActionsOrder.js';
39
39
 
40
40
  const props = defineProps({
41
41
  /**
42
- * [`'table'`, `'card'`]
42
+ * [`'table'`, `'section'`]
43
43
  * */
44
44
  mode: {
45
45
  type: String,
46
46
  default: 'table',
47
- validator: (v) => ['table', 'card'].includes(v),
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 === 'card' ? cardActionsOrder : tableActionsOrder;
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
  });