@teammodlr/ui-kit 2.1.25 → 2.1.26
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/components/button/Button.vue.d.ts +1 -1
- package/lib/components/dialog/Dialog.vue.d.ts +1 -1
- package/lib/components/input/Input.vue.d.ts +1 -1
- package/lib/components/messageprovider/MessageProvider.vue.d.ts +0 -10
- package/lib/components/radio/Radio.vue.d.ts +1 -1
- package/lib/components/select/Select.vue.d.ts +1 -1
- package/lib/components/tag/Tag.vue.d.ts +1 -1
- package/lib/components/textarea/Textarea.vue.d.ts +2 -2
- package/lib/index.cjs.js +8 -12
- package/lib/index.es.js +2385 -2492
- package/package.json +1 -1
- package/src/components/messageprovider/MessageProvider.vue +25 -30
package/package.json
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<slot />
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
<template v-if="messageList.length > 0">
|
|
4
|
+
<Teleport to="body">
|
|
5
|
+
<transition
|
|
6
|
+
type="animation"
|
|
7
|
+
:enter-active-class="modalScale.enterActive"
|
|
8
|
+
:leave-active-class="modalScale.leaveActive"
|
|
9
|
+
:enter-from-class="modalScale.enterFrom"
|
|
10
|
+
:leave-to-class="modalScale.leaveTo">
|
|
11
|
+
<div :class="classes">
|
|
12
|
+
<MMessage
|
|
13
|
+
v-for="message in messageList"
|
|
14
|
+
:key="message.key"
|
|
15
|
+
:internalKey="message.key"
|
|
16
|
+
:variant="message.type"
|
|
17
|
+
:content="message.content"
|
|
18
|
+
:timeout="message.timeout ?? timeout"
|
|
19
|
+
ref="messageRefs"
|
|
20
|
+
:on-internal-after-leave="onInternalAfterLeave" />
|
|
21
|
+
</div>
|
|
22
|
+
</transition>
|
|
23
|
+
</Teleport>
|
|
24
|
+
</template>
|
|
24
25
|
</template>
|
|
25
26
|
|
|
26
27
|
<script lang="ts">
|
|
@@ -63,10 +64,6 @@ export default defineComponent({
|
|
|
63
64
|
MMessage
|
|
64
65
|
},
|
|
65
66
|
props: {
|
|
66
|
-
teleportTo: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: 'body'
|
|
69
|
-
},
|
|
70
67
|
placement: {
|
|
71
68
|
type: String as PropType<MessagePlacement>,
|
|
72
69
|
default: 'top'
|
|
@@ -77,7 +74,6 @@ export default defineComponent({
|
|
|
77
74
|
}
|
|
78
75
|
},
|
|
79
76
|
setup(props, { slots }) {
|
|
80
|
-
const isServer = useIsServer();
|
|
81
77
|
const messageListRef = ref<PrivateMessageReactive[]>([]);
|
|
82
78
|
const messageRefs = ref<Record<string, PrivateMessageRef>>({});
|
|
83
79
|
const api: MessageApiInjection = {
|
|
@@ -103,13 +99,13 @@ export default defineComponent({
|
|
|
103
99
|
};
|
|
104
100
|
|
|
105
101
|
provide('m-message', api);
|
|
106
|
-
|
|
107
102
|
function create(
|
|
108
103
|
content: ContentType,
|
|
109
104
|
options: MessageOptions & { type: MessageType }
|
|
110
105
|
): MessageReactive {
|
|
111
|
-
const
|
|
112
|
-
|
|
106
|
+
const key = Math.random()
|
|
107
|
+
.toString(16)
|
|
108
|
+
.slice(2, 2 + 12);
|
|
113
109
|
const messageReactive = reactive({
|
|
114
110
|
...options,
|
|
115
111
|
content,
|
|
@@ -149,7 +145,6 @@ export default defineComponent({
|
|
|
149
145
|
{
|
|
150
146
|
messageRefs,
|
|
151
147
|
messageList: messageListRef,
|
|
152
|
-
isServer,
|
|
153
148
|
onInternalAfterLeave,
|
|
154
149
|
classes,
|
|
155
150
|
modalScale
|