@webitel/ui-sdk 24.12.143 → 24.12.145

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.12.143",
3
+ "version": "24.12.145",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -98,6 +98,7 @@
98
98
  <wt-button
99
99
  v-if="primaryActionText"
100
100
  :size="buttonSize"
101
+ :disabled="disabledPrimaryAction"
101
102
  color="primary"
102
103
  @click="() => onPrimaryClick()"
103
104
  >
@@ -115,6 +116,7 @@
115
116
  <wt-button
116
117
  v-if="secondaryActionText"
117
118
  :size="buttonSize"
119
+ :disabled="disabledSecondaryAction"
118
120
  color="secondary"
119
121
  @click="() => onSecondaryClick()"
120
122
  >
@@ -183,6 +185,22 @@ const props = defineProps({
183
185
  type: [String, null],
184
186
  default: '',
185
187
  },
188
+
189
+ /**
190
+ * disable primary action button while still showing its text. useful for access control
191
+ */
192
+ disabledPrimaryAction: {
193
+ type: Boolean,
194
+ default: false,
195
+ },
196
+
197
+ /**
198
+ * disable primary action button while still showing its text. useful for access control
199
+ */
200
+ disabledSecondaryAction: {
201
+ type: Boolean,
202
+ default: false,
203
+ },
186
204
  });
187
205
 
188
206
  const emit = defineEmits([
@@ -12,10 +12,8 @@
12
12
  </template>
13
13
 
14
14
  <script lang="ts" setup>
15
- import { useVuelidate } from '@vuelidate/core';
16
- import { required } from '@vuelidate/validators';
17
15
  import deepCopy from 'deep-copy';
18
- import { computed, onMounted, ref, watch } from 'vue';
16
+ import { onMounted, ref } from 'vue';
19
17
 
20
18
  import WtTree from '../../../../../../../components/wt-tree/wt-tree.vue';
21
19
  import { searchMethod } from './config.js';
@@ -27,35 +25,6 @@ const model = defineModel<ModelValue>({
27
25
 
28
26
  const catalogData = ref([]);
29
27
 
30
- const v$ = useVuelidate(
31
- computed(() => ({
32
- model: {
33
- selection: {
34
- required,
35
- },
36
- conditions: {
37
- required,
38
- },
39
- },
40
- })),
41
- { model },
42
- { $autoDirty: true },
43
- );
44
-
45
- v$.value.$touch();
46
-
47
- const emit = defineEmits<{
48
- 'update:invalid': [boolean];
49
- }>();
50
-
51
- watch(
52
- () => v$.value.$invalid,
53
- (invalid) => {
54
- emit('update:invalid', invalid);
55
- },
56
- { immediate: true },
57
- );
58
-
59
28
  const loadCatalogs = async () => {
60
29
  const { items } = await searchMethod({
61
30
  size: -1, // To get all catalogs with services we need to pass size -1