@teammodlr/ui-kit 2.1.32 → 2.1.33
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/lib/index.cjs.js +4 -4
- package/lib/index.es.js +177 -177
- package/package.json +1 -1
- package/src/components/confirm/Confirm.vue +20 -15
package/package.json
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<MModal
|
|
3
|
+
<MModal
|
|
4
|
+
ref="modal"
|
|
5
|
+
:title="title"
|
|
6
|
+
:canClickOutside="false"
|
|
7
|
+
:onClose="onClose">
|
|
4
8
|
<template #body>
|
|
5
9
|
{{ content }}
|
|
6
10
|
</template>
|
|
7
11
|
|
|
8
12
|
<template #footer>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
<div style="display: flex; flex-grow: 1; justify-content: end">
|
|
14
|
+
<MButton :variant="okVariant" @click="handleOk">
|
|
15
|
+
{{ okText ?? 'Okay' }}
|
|
16
|
+
</MButton>
|
|
17
|
+
<MButton style="margin-left: 8px" @click="handleCancel">
|
|
18
|
+
{{ cancelText ?? 'Cancel' }}
|
|
19
|
+
</MButton>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
18
22
|
</MModal>
|
|
19
23
|
</div>
|
|
20
24
|
</template>
|
|
@@ -23,10 +27,11 @@
|
|
|
23
27
|
import { defineComponent, onMounted, ref } from 'vue';
|
|
24
28
|
import { useZIndex } from '../../composables/useZIndex';
|
|
25
29
|
import { confirmProps } from './props';
|
|
26
|
-
import
|
|
30
|
+
import MModal from '../modal/Modal.vue';
|
|
31
|
+
import MButton from '../button/Button.vue';
|
|
27
32
|
|
|
28
33
|
export default defineComponent({
|
|
29
|
-
name:
|
|
34
|
+
name: 'Confirm',
|
|
30
35
|
props: confirmProps,
|
|
31
36
|
setup(props, { slots }) {
|
|
32
37
|
const modal = ref();
|
|
@@ -36,14 +41,14 @@ export default defineComponent({
|
|
|
36
41
|
async function handleCancel(event: MouseEvent) {
|
|
37
42
|
modal.value?.close();
|
|
38
43
|
if (props.onCancel) {
|
|
39
|
-
await props.onCancel(event)
|
|
44
|
+
await props.onCancel(event);
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
async function handleOk(event: MouseEvent) {
|
|
44
49
|
modal.value?.close();
|
|
45
50
|
if (props.onOk) {
|
|
46
|
-
props.onOk(event)
|
|
51
|
+
props.onOk(event);
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
54
|
onMounted(() => {
|
|
@@ -55,6 +60,6 @@ export default defineComponent({
|
|
|
55
60
|
handleCancel
|
|
56
61
|
};
|
|
57
62
|
},
|
|
58
|
-
components: { MModal }
|
|
63
|
+
components: { MModal, MButton }
|
|
59
64
|
});
|
|
60
65
|
</script>
|