@redseed/redseed-ui-vue3 8.10.0 → 8.11.1

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": "@redseed/redseed-ui-vue3",
3
- "version": "8.10.0",
3
+ "version": "8.11.1",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/redseedtraining/redseed-ui",
@@ -8,6 +8,10 @@ const props = defineProps({
8
8
  type: Boolean,
9
9
  default: false,
10
10
  },
11
+ closeable: {
12
+ type: Boolean,
13
+ default: false,
14
+ },
11
15
  variant: {
12
16
  type: String,
13
17
  default: 'default',
@@ -31,22 +35,29 @@ function close() {
31
35
  `rsui-message-box--${variant}`
32
36
  ]"
33
37
  >
34
- <div class="rsui-message-box__head">
38
+ <div v-if="$slots.title" class="rsui-message-box__head">
35
39
  <div class="rsui-message-box__title">
36
40
  <slot name="title"></slot>
37
41
  </div>
38
- <div class="rsui-message-box__close">
42
+ <div v-if="closeable" class="rsui-message-box__close">
39
43
  <div class="rsui-message-box__close-icon">
40
44
  <Icon disabled>
41
- <XMarkIcon
42
- @click="close"
43
- ></XMarkIcon>
45
+ <XMarkIcon @click="close"></XMarkIcon>
44
46
  </Icon>
45
47
  </div>
46
48
  </div>
47
49
  </div>
48
- <div class="rsui-message-box__body">
49
- <slot></slot>
50
+ <div class="rsui-message-box__content">
51
+ <div class="rsui-message-box__body">
52
+ <slot></slot>
53
+ </div>
54
+ <div v-if="closeable && !$slots.title" class="rsui-message-box__close">
55
+ <div class="rsui-message-box__close-icon">
56
+ <Icon disabled>
57
+ <XMarkIcon @click="close"></XMarkIcon>
58
+ </Icon>
59
+ </div>
60
+ </div>
50
61
  </div>
51
62
  </div>
52
63
  </template>
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { ref, watch } from 'vue'
2
+ import { ref, watch, onBeforeUnmount } from 'vue'
3
3
  import { useEventListener, useElementVisibility } from '@vueuse/core'
4
4
 
5
5
  const props = defineProps({
@@ -28,6 +28,10 @@ watch(isVisible, (newVal) => {
28
28
  if (!newVal) emit('hidden', props.id)
29
29
  })
30
30
 
31
+ onBeforeUnmount(() => {
32
+ emit('hidden', props.id)
33
+ })
34
+
31
35
  /**
32
36
  * Listener for keyboard events on the item
33
37
  */