@webitel/ui-sdk 24.10.69 → 24.10.71
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.css +1 -1
- package/dist/ui-sdk.js +3189 -3107
- package/dist/ui-sdk.umd.cjs +11 -11
- package/package.json +1 -1
- package/src/components/index.js +2 -0
- package/src/components/wt-confirm-dialog/wt-confirm-dialog.vue +97 -0
- package/src/locale/en/en.js +2 -0
- package/src/locale/ru/ru.js +2 -0
- package/src/locale/ua/ua.js +2 -0
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +9 -28
package/package.json
CHANGED
package/src/components/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import WtButtonSelect from './wt-button-select/wt-button-select.vue';
|
|
|
8
8
|
import WtButton from './wt-button/wt-button.vue';
|
|
9
9
|
import WtCheckbox from './wt-checkbox/wt-checkbox.vue';
|
|
10
10
|
import WtChip from './wt-chip/wt-chip.vue';
|
|
11
|
+
import WtConfirmDialog from './wt-confirm-dialog/wt-confirm-dialog.vue';
|
|
11
12
|
import WtContextMenu from './wt-context-menu/wt-context-menu.vue';
|
|
12
13
|
import WtCopyAction from './wt-copy-action/wt-copy-action.vue';
|
|
13
14
|
import WtDatepicker from './wt-datepicker/wt-datepicker.vue';
|
|
@@ -76,6 +77,7 @@ const Components = {
|
|
|
76
77
|
WtInputInfo,
|
|
77
78
|
WtButton,
|
|
78
79
|
WtChip,
|
|
80
|
+
WtConfirmDialog,
|
|
79
81
|
WtDivider,
|
|
80
82
|
WtTooltip,
|
|
81
83
|
WtLabel,
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-popup
|
|
3
|
+
class="wt-confirm-dialog"
|
|
4
|
+
size="sm"
|
|
5
|
+
v-bind="attrs"
|
|
6
|
+
@close="close"
|
|
7
|
+
>
|
|
8
|
+
<template #title>
|
|
9
|
+
{{ title }}
|
|
10
|
+
</template>
|
|
11
|
+
<template #main>
|
|
12
|
+
<slot name="main">
|
|
13
|
+
<div class="wt-confirm-dialog__content">
|
|
14
|
+
<p class="wt-confirm-dialog__message">
|
|
15
|
+
{{ deleteMessage ? deleteMessage : $t('webitelUI.deleteConfirmationPopup.askingAlert', { subject }) }}
|
|
16
|
+
</p>
|
|
17
|
+
</div>
|
|
18
|
+
</slot>
|
|
19
|
+
</template>
|
|
20
|
+
<template #actions>
|
|
21
|
+
<slot name="actions" :isDeleting="isDeleting" :confirm="confirm" :close="close">
|
|
22
|
+
<wt-button
|
|
23
|
+
:disabled="isDeleting"
|
|
24
|
+
color="secondary"
|
|
25
|
+
@click="close"
|
|
26
|
+
>
|
|
27
|
+
{{ $t('reusable.cancel') }}
|
|
28
|
+
</wt-button>
|
|
29
|
+
<wt-button
|
|
30
|
+
:loading="isDeleting"
|
|
31
|
+
color="error"
|
|
32
|
+
@click="confirm"
|
|
33
|
+
>
|
|
34
|
+
{{ $t('reusable.delete') }}
|
|
35
|
+
</wt-button>
|
|
36
|
+
</slot>
|
|
37
|
+
</template>
|
|
38
|
+
</wt-popup>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script setup>
|
|
42
|
+
import { ref, useAttrs } from 'vue';
|
|
43
|
+
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
title: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
deleteMessage: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: '',
|
|
52
|
+
},
|
|
53
|
+
subject: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: '',
|
|
56
|
+
},
|
|
57
|
+
callback: {
|
|
58
|
+
type: Function,
|
|
59
|
+
required: true,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const emit = defineEmits(['close', 'confirm']);
|
|
64
|
+
|
|
65
|
+
const attrs = useAttrs();
|
|
66
|
+
|
|
67
|
+
const isDeleting = ref(false);
|
|
68
|
+
|
|
69
|
+
function close() {
|
|
70
|
+
emit('close');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function confirm() {
|
|
74
|
+
try {
|
|
75
|
+
isDeleting.value = true;
|
|
76
|
+
|
|
77
|
+
await props.callback()
|
|
78
|
+
close();
|
|
79
|
+
} finally {
|
|
80
|
+
isDeleting.value = false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
.wt-confirm-dialog__content {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
gap: var(--spacing-sm);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.wt-confirm-dialog__message {
|
|
94
|
+
text-align: center;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
</style>
|
package/src/locale/en/en.js
CHANGED
|
@@ -385,6 +385,8 @@ export default {
|
|
|
385
385
|
deleteConfirmationPopup: {
|
|
386
386
|
title: 'Confirm deletion',
|
|
387
387
|
askingAlert:
|
|
388
|
+
'Are you sure you want to delete {subject}? This action cannot be undone.',
|
|
389
|
+
tableAskingAlert:
|
|
388
390
|
'Are you sure you want\n to delete {count} record? | Are you sure you want\n to delete {count} records?',
|
|
389
391
|
deleteAll: 'ALL',
|
|
390
392
|
},
|
package/src/locale/ru/ru.js
CHANGED
|
@@ -383,6 +383,8 @@ export default {
|
|
|
383
383
|
deleteConfirmationPopup: {
|
|
384
384
|
title: 'Подтвердите удаление',
|
|
385
385
|
askingAlert:
|
|
386
|
+
'Вы уверены, что хотите удалить {subject}? Это действие не может быть отменено.',
|
|
387
|
+
tableAskingAlert:
|
|
386
388
|
'Вы уверенны, что хотите\n удалить {count} запись? | Вы уверенны, что хотите\n удалить {count} записей?',
|
|
387
389
|
deleteAll: 'ВСЕ',
|
|
388
390
|
},
|
package/src/locale/ua/ua.js
CHANGED
|
@@ -383,6 +383,8 @@ export default {
|
|
|
383
383
|
deleteConfirmationPopup: {
|
|
384
384
|
title: 'Підтвердіть видалення',
|
|
385
385
|
askingAlert:
|
|
386
|
+
'Ви впевнені, що хочете видалити {subject}? Ця дія не може бути скасована.',
|
|
387
|
+
tableAskingAlert:
|
|
386
388
|
'Ви впевнені, що хочете\n видалити {count} запис? | Ви впевнені, що хочете\n видалити {count} записів?',
|
|
387
389
|
deleteAll: 'ВСІ',
|
|
388
390
|
},
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<wt-
|
|
3
|
-
class="delete-confirmation-popup"
|
|
4
|
-
size="sm"
|
|
2
|
+
<wt-confirm-dialog
|
|
5
3
|
v-bind="attrs"
|
|
6
|
-
|
|
4
|
+
class="delete-confirmation-popup"
|
|
5
|
+
:title="$t('webitelUI.deleteConfirmationPopup.title')"
|
|
6
|
+
:callback="callback"
|
|
7
7
|
>
|
|
8
|
-
<template #title>
|
|
9
|
-
{{ $t('webitelUI.deleteConfirmationPopup.title') }}
|
|
10
|
-
</template>
|
|
11
8
|
<template #main>
|
|
12
9
|
<div class="delete-confirmation-popup__content">
|
|
13
10
|
<wt-icon
|
|
@@ -19,7 +16,7 @@
|
|
|
19
16
|
</p>
|
|
20
17
|
</div>
|
|
21
18
|
</template>
|
|
22
|
-
<template #actions>
|
|
19
|
+
<template #actions="{ isDeleting, close, confirm}">
|
|
23
20
|
<wt-button
|
|
24
21
|
:loading="isDeleting"
|
|
25
22
|
@click="confirm"
|
|
@@ -34,11 +31,11 @@
|
|
|
34
31
|
{{ $t('vocabulary.no') }}
|
|
35
32
|
</wt-button>
|
|
36
33
|
</template>
|
|
37
|
-
</wt-
|
|
34
|
+
</wt-confirm-dialog>
|
|
38
35
|
</template>
|
|
39
36
|
|
|
40
37
|
<script setup>
|
|
41
|
-
import { computed,
|
|
38
|
+
import { computed, useAttrs } from 'vue';
|
|
42
39
|
import { useI18n } from 'vue-i18n';
|
|
43
40
|
|
|
44
41
|
const props = defineProps({
|
|
@@ -58,30 +55,14 @@ const attrs = useAttrs();
|
|
|
58
55
|
|
|
59
56
|
const { t } = useI18n();
|
|
60
57
|
|
|
61
|
-
const isDeleting = ref(false);
|
|
62
|
-
|
|
63
58
|
const deleteMessage = computed(() => {
|
|
64
59
|
if (props.deleteCount === 0) {
|
|
65
|
-
return t('webitelUI.deleteConfirmationPopup.
|
|
60
|
+
return t('webitelUI.deleteConfirmationPopup.tableAskingAlert', 2, null, {
|
|
66
61
|
count: t('webitelUI.deleteConfirmationPopup.deleteAll'),
|
|
67
62
|
});
|
|
68
63
|
}
|
|
69
|
-
return t('webitelUI.deleteConfirmationPopup.
|
|
64
|
+
return t('webitelUI.deleteConfirmationPopup.tableAskingAlert', { count: props.deleteCount }, null);
|
|
70
65
|
});
|
|
71
|
-
|
|
72
|
-
function close() {
|
|
73
|
-
emit('close');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async function confirm() {
|
|
77
|
-
try {
|
|
78
|
-
isDeleting.value = true;
|
|
79
|
-
await props.callback();
|
|
80
|
-
close();
|
|
81
|
-
} finally {
|
|
82
|
-
isDeleting.value = false;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
66
|
</script>
|
|
86
67
|
|
|
87
68
|
<style scoped>
|