@teammodlr/ui-kit 2.1.11 → 2.1.13

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.
@@ -11,7 +11,8 @@ export const menu = style({
11
11
  minWidth: '200px',
12
12
  maxWidth: '350px',
13
13
  border: `1px solid ${themeVars.color.gray[300]}`,
14
- boxShadow: themeVars.shadow.md
14
+ boxShadow: themeVars.shadow.md,
15
+ overflow: 'auto'
15
16
  });
16
17
 
17
18
  export const menuItems = style({
@@ -53,3 +54,10 @@ export const menuSeperator = style({
53
54
  backgroundColor: themeVars.color.gray[200],
54
55
  marginBlock: themeVars.space[1]
55
56
  });
57
+
58
+ export const heading = style({
59
+ padding: `${themeVars.space[2]} ${themeVars.space[2.5]}`,
60
+ fontWeight: 500,
61
+ fontSize: themeVars.fontSize.small,
62
+ color: themeVars.color.gray[600]
63
+ });
@@ -12,6 +12,7 @@ export { default as MDropdown } from './dropdown/Dropdown.vue';
12
12
  export { default as MDropdownItem } from './dropdown/DropdownItem.vue';
13
13
  export { default as MDropdownList } from './dropdown/DropdownList.vue';
14
14
  export { default as MDropdownSeperator } from './dropdown/DropdownSeperator.vue';
15
+ export { default as MDropdownHeading } from './dropdown/DropdownHeading.vue';
15
16
  export { default as MDropdownWrapper } from './dropdown/DropdownWrapper.vue';
16
17
  export { default as MForm } from './form/Form.vue';
17
18
  export { default as MImage } from './image/Image.vue';
@@ -22,28 +22,34 @@
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
+ v-if="showClose"
42
+ :class="style.close"
43
+ @click="close"></button>
44
+ <div :class="style.body">
45
+ <slot name="body"></slot>
46
+ <slot></slot>
47
+ </div>
48
+ <div :class="style.footer">
49
+ <slot name="footer"></slot>
50
+ </div>
35
51
  </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>
52
+ </template>
47
53
  </div>
48
54
  </Transition>
49
55
  </div>
@@ -71,6 +77,10 @@ export default defineComponent({
71
77
  type: String,
72
78
  default: ''
73
79
  },
80
+ loading: {
81
+ type: Boolean,
82
+ default: false
83
+ },
74
84
  canClickOutside: {
75
85
  type: Boolean,
76
86
  default: true
@@ -81,6 +91,10 @@ export default defineComponent({
81
91
  },
82
92
  zIndex: {
83
93
  type: Number
94
+ },
95
+ showClose: {
96
+ type: Boolean,
97
+ default: true
84
98
  }
85
99
  },
86
100
  emits: ['open'],
@@ -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>