@teammodlr/ui-kit 2.1.10 → 2.1.12

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.
@@ -22,28 +22,33 @@
22
22
  :class="containerClasses"
23
23
  @click.stop
24
24
  ref="target">
25
- <div :class="style.sidebar" v-if="hasSidebar">
26
- <slot name="sidebar"></slot>
27
- </div>
28
- <div :class="style.content">
29
- <div :class="style.header">
30
- <div :class="style.title" v-if="title">
31
- <div>
32
- {{ title }}
25
+ <template v-if="loading">
26
+ <slot name="loading"> Loading... </slot>
27
+ </template>
28
+ <template v-else>
29
+ <div :class="style.sidebar" v-if="hasSidebar">
30
+ <slot name="sidebar"></slot>
31
+ </div>
32
+ <div :class="style.content">
33
+ <div :class="style.header">
34
+ <div :class="style.title" v-if="title">
35
+ <div>
36
+ {{ title }}
37
+ </div>
33
38
  </div>
34
39
  </div>
40
+ <button
41
+ :class="style.close"
42
+ @click="close"></button>
43
+ <div :class="style.body">
44
+ <slot name="body"></slot>
45
+ <slot></slot>
46
+ </div>
47
+ <div :class="style.footer">
48
+ <slot name="footer"></slot>
49
+ </div>
35
50
  </div>
36
- <button
37
- :class="style.close"
38
- @click="close"></button>
39
- <div :class="style.body">
40
- <slot name="body"></slot>
41
- <slot></slot>
42
- </div>
43
- <div :class="style.footer">
44
- <slot name="footer"></slot>
45
- </div>
46
- </div>
51
+ </template>
47
52
  </div>
48
53
  </Transition>
49
54
  </div>
@@ -71,6 +76,10 @@ export default defineComponent({
71
76
  type: String,
72
77
  default: ''
73
78
  },
79
+ loading: {
80
+ type: Boolean,
81
+ default: false
82
+ },
74
83
  canClickOutside: {
75
84
  type: Boolean,
76
85
  default: true
@@ -1,40 +1,83 @@
1
1
  <template>
2
- <MModal ref="modal" title="I am a modal" size="md" :canClickOutside="true" :canBounceOnOpen="false" :canSlideIn="true">
2
+ <MModal
3
+ ref="modal"
4
+ :loading="true"
5
+ title="I am a modal"
6
+ size="md"
7
+ :canClickOutside="true"
8
+ :canBounceOnOpen="false"
9
+ :canSlideIn="true">
3
10
  <template #body>
4
11
  <div>
5
- <MInput
6
- />
12
+ <MInput />
7
13
  </div>
8
14
  </template>
9
15
  <template #footer>
10
- <div style="display: flex; flex-grow: 1; justify-content: end;">
16
+ <div style="display: flex; flex-grow: 1; justify-content: end">
11
17
  <MButton variant="primary" @click="modal?.close()">
12
18
  Okay
13
19
  </MButton>
14
- <MButton style="margin-left: 8px;" @click="modal?.close()">
20
+ <MButton style="margin-left: 8px" @click="modal?.close()">
15
21
  Cancel
16
22
  </MButton>
17
23
  </div>
18
24
  </template>
19
25
  </MModal>
20
26
 
21
- <div style="position: relative; width: 100%; height: 1000px;">
22
- <button @click="open" style="position: absolute; width: 100px; height: 50px; top: 0; left: 0;">Top Left</button>
23
- <button @click="open" style="position: absolute; width: 100px; height: 50px; top: 0; right: 0;">Top Right</button>
24
- <button @click="open" style="position: absolute; width: 100px; height: 50px; bottom: 0; left: 0;">Bottom
25
- Left</button>
26
- <button @click="open" style="position: absolute; width: 100px; height: 50px; bottom: 0; right: 0;">Bottom
27
- Right</button>
27
+ <div style="position: relative; width: 100%; height: 1000px">
28
+ <button
29
+ @click="open"
30
+ style="
31
+ position: absolute;
32
+ width: 100px;
33
+ height: 50px;
34
+ top: 0;
35
+ left: 0;
36
+ ">
37
+ Top Left
38
+ </button>
39
+ <button
40
+ @click="open"
41
+ style="
42
+ position: absolute;
43
+ width: 100px;
44
+ height: 50px;
45
+ top: 0;
46
+ right: 0;
47
+ ">
48
+ Top Right
49
+ </button>
50
+ <button
51
+ @click="open"
52
+ style="
53
+ position: absolute;
54
+ width: 100px;
55
+ height: 50px;
56
+ bottom: 0;
57
+ left: 0;
58
+ ">
59
+ Bottom Left
60
+ </button>
61
+ <button
62
+ @click="open"
63
+ style="
64
+ position: absolute;
65
+ width: 100px;
66
+ height: 50px;
67
+ bottom: 0;
68
+ right: 0;
69
+ ">
70
+ Bottom Right
71
+ </button>
28
72
  </div>
29
73
  </template>
30
74
 
31
75
  <script lang="ts" setup>
32
- import { ref } from 'vue'
76
+ import { ref } from 'vue';
33
77
 
34
78
  const modal = ref<any>(null);
35
79
 
36
80
  const open = (event: MouseEvent) => {
37
81
  modal.value.open(event.target);
38
82
  };
39
-
40
83
  </script>
@@ -1,6 +1,10 @@
1
1
  <template>
2
2
  <MModal ref="modal" size="md">
3
- <template #sidebar> I AM SIDEBAR </template>
3
+ <template #sidebar>
4
+ <template v-for="i in 20">
5
+ <div style="margin-bottom: 8px">hi</div>
6
+ </template>
7
+ </template>
4
8
  <div>
5
9
  <MInput />
6
10
  </div>
@@ -273,5 +273,7 @@ export const sidebar = style({
273
273
 
274
274
  export const content = style({
275
275
  flex: 1,
276
- width: '100%'
276
+ width: '100%',
277
+ display: 'flex',
278
+ flexDirection: 'column'
277
279
  });
@@ -67,6 +67,7 @@ export const base = style({
67
67
  resize: 'none',
68
68
  cursor: 'pointer',
69
69
  boxShadow: 'none',
70
+ backgroundColor: vars.backgroundColor,
70
71
  transition: `color .3s ${themeVars.transition.default},
71
72
  background-color .3s ${themeVars.transition.default},
72
73
  box-shadow .3s ${themeVars.transition.default},