@teammodlr/ui-kit 2.1.13 → 2.1.15
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/modal/Modal.vue.d.ts +51 -20
- package/lib/components/modal/style/Modal.css.d.ts +5 -1
- package/lib/components/tooltip/Tooltip.vue.d.ts +2 -2
- package/lib/index.cjs.js +9 -9
- package/lib/index.es.js +2613 -2632
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/src/components/modal/Modal.vue +166 -92
- package/src/components/modal/examples/basic.vue +1 -8
- package/src/components/modal/examples/sidebar.vue +1 -1
- package/src/components/modal/style/Modal.css.ts +48 -9
- package/src/components/tooltip/Tooltip.vue +44 -30
- package/src/styles/transitions.css.ts +1 -1
|
@@ -50,17 +50,55 @@ export const size = styleVariants({
|
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
export const
|
|
54
|
-
zIndex: 100,
|
|
55
|
-
backgroundColor: 'hsla(0,0%,45.1%,0.7)',
|
|
53
|
+
export const wrapper = style({
|
|
56
54
|
position: 'fixed',
|
|
57
55
|
top: 0,
|
|
56
|
+
insetInlineEnd: 0,
|
|
58
57
|
bottom: 0,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
insetInlineStart: 0,
|
|
59
|
+
overflow: 'auto',
|
|
60
|
+
outline: 0
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const mask = style({
|
|
64
|
+
position: 'fixed',
|
|
65
|
+
top: 0,
|
|
66
|
+
insetInlineEnd: 0,
|
|
67
|
+
bottom: 0,
|
|
68
|
+
insetInlineStart: 0,
|
|
69
|
+
height: '100%',
|
|
70
|
+
backgroundColor: 'hsla(0,0%,45.1%,0.7)'
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const modal = style({
|
|
74
|
+
margin: `0 auto`,
|
|
75
|
+
padding: 0,
|
|
76
|
+
boxSizing: 'border-box',
|
|
77
|
+
position: 'relative',
|
|
78
|
+
width: 'auto',
|
|
79
|
+
top: 100,
|
|
80
|
+
paddingBottom: '24px',
|
|
81
|
+
maxWidth: `calc(100vw - 32px)`,
|
|
82
|
+
pointerEvents: 'none'
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const centeredWrapper = style({
|
|
86
|
+
textAlign: 'center',
|
|
87
|
+
'::before': {
|
|
88
|
+
display: 'inline-block',
|
|
89
|
+
width: 0,
|
|
90
|
+
height: '100%',
|
|
91
|
+
verticalAlign: 'middle',
|
|
92
|
+
content: '""'
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
export const centeredModal = style({
|
|
97
|
+
top: 0,
|
|
98
|
+
display: 'inline-block',
|
|
99
|
+
paddingBottom: 0,
|
|
100
|
+
textAlign: 'start',
|
|
101
|
+
verticalAlign: 'middle'
|
|
64
102
|
});
|
|
65
103
|
|
|
66
104
|
export const container = style({
|
|
@@ -74,7 +112,8 @@ export const container = style({
|
|
|
74
112
|
display: 'flex',
|
|
75
113
|
flexDirection: 'column',
|
|
76
114
|
position: 'relative',
|
|
77
|
-
gap: themeVars.space[2]
|
|
115
|
+
gap: themeVars.space[2],
|
|
116
|
+
pointerEvents: 'auto'
|
|
78
117
|
});
|
|
79
118
|
|
|
80
119
|
export const hasSidebar = style({
|
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
style="display: inline-flex"
|
|
5
5
|
@mouseenter="show"
|
|
6
6
|
@mouseleave="hide"
|
|
7
|
-
ref="wrapper"
|
|
8
|
-
>
|
|
7
|
+
ref="wrapper">
|
|
9
8
|
<span ref="reference">
|
|
10
9
|
<slot />
|
|
11
10
|
</span>
|
|
12
11
|
|
|
13
12
|
<Teleport :to="transferTo">
|
|
14
|
-
<Transition
|
|
13
|
+
<Transition
|
|
15
14
|
:enter-active-class="fade.enterActive"
|
|
16
15
|
:leave-active-class="fade.leaveActive"
|
|
17
16
|
:enter-from-class="fade.enterFrom"
|
|
18
|
-
:leave-to-class="fade.leaveTo"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
>
|
|
17
|
+
:leave-to-class="fade.leaveTo">
|
|
18
|
+
<div
|
|
19
|
+
role="tooltip"
|
|
20
|
+
:class="computedClasses"
|
|
21
|
+
ref="popper"
|
|
22
|
+
v-if="isOpen"
|
|
23
|
+
:style="{ zIndex: zIndex }">
|
|
24
|
+
<slot :text="text" name="content">
|
|
25
25
|
{{ text }}
|
|
26
26
|
</slot>
|
|
27
27
|
</div>
|
|
@@ -31,18 +31,30 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script lang="ts">
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
import {
|
|
35
|
+
defineComponent,
|
|
36
|
+
ref,
|
|
37
|
+
toRef,
|
|
38
|
+
type PropType,
|
|
39
|
+
computed,
|
|
40
|
+
watch,
|
|
41
|
+
onUnmounted
|
|
42
|
+
} from 'vue';
|
|
43
|
+
import {
|
|
44
|
+
type Placement,
|
|
45
|
+
placementWhileList,
|
|
46
|
+
usePopper
|
|
47
|
+
} from '../../composables/usePopper';
|
|
48
|
+
import { fade } from '../../styles/transitions.css';
|
|
49
|
+
import * as style from './style';
|
|
50
|
+
import { useZIndex } from '../../composables/useZIndex';
|
|
39
51
|
|
|
40
52
|
export default defineComponent({
|
|
41
|
-
name:
|
|
53
|
+
name: 'MTooltip',
|
|
42
54
|
props: {
|
|
43
55
|
text: {
|
|
44
56
|
type: String,
|
|
45
|
-
default:
|
|
57
|
+
default: ''
|
|
46
58
|
},
|
|
47
59
|
placement: {
|
|
48
60
|
type: String as PropType<Placement>,
|
|
@@ -70,7 +82,7 @@ export default defineComponent({
|
|
|
70
82
|
}
|
|
71
83
|
},
|
|
72
84
|
setup(props) {
|
|
73
|
-
const {nextZIndex} = useZIndex();
|
|
85
|
+
const { nextZIndex } = useZIndex();
|
|
74
86
|
const placement = toRef(props, 'placement');
|
|
75
87
|
// @ts-ignore
|
|
76
88
|
const transfer = toRef(props, 'transfer');
|
|
@@ -80,7 +92,7 @@ export default defineComponent({
|
|
|
80
92
|
const zIndex = ref(props.zIndex ?? nextZIndex());
|
|
81
93
|
const timeout = ref<ReturnType<typeof setTimeout> | null>(null);
|
|
82
94
|
const offset = computed(() => {
|
|
83
|
-
switch(placement.value) {
|
|
95
|
+
switch (placement.value) {
|
|
84
96
|
case 'top':
|
|
85
97
|
return [0, 8];
|
|
86
98
|
case 'bottom':
|
|
@@ -89,7 +101,7 @@ export default defineComponent({
|
|
|
89
101
|
return [8, 0];
|
|
90
102
|
case 'right':
|
|
91
103
|
return [-8, 0];
|
|
92
|
-
default:
|
|
104
|
+
default:
|
|
93
105
|
return [0, 0];
|
|
94
106
|
}
|
|
95
107
|
});
|
|
@@ -109,14 +121,17 @@ export default defineComponent({
|
|
|
109
121
|
{
|
|
110
122
|
[style.reverse]: props.reverse
|
|
111
123
|
}
|
|
112
|
-
]
|
|
124
|
+
];
|
|
113
125
|
});
|
|
114
126
|
|
|
115
|
-
watch(
|
|
116
|
-
|
|
117
|
-
|
|
127
|
+
watch(
|
|
128
|
+
() => isOpen.value,
|
|
129
|
+
(value: boolean) => {
|
|
130
|
+
if (value) {
|
|
131
|
+
updatePopper();
|
|
132
|
+
}
|
|
118
133
|
}
|
|
119
|
-
|
|
134
|
+
);
|
|
120
135
|
|
|
121
136
|
const toggle = () => {
|
|
122
137
|
if (timeout.value) {
|
|
@@ -130,7 +145,7 @@ export default defineComponent({
|
|
|
130
145
|
} else {
|
|
131
146
|
isOpen.value = !isOpen.value;
|
|
132
147
|
}
|
|
133
|
-
}
|
|
148
|
+
};
|
|
134
149
|
|
|
135
150
|
function show() {
|
|
136
151
|
if (timeout.value) {
|
|
@@ -161,7 +176,7 @@ export default defineComponent({
|
|
|
161
176
|
}
|
|
162
177
|
timeout.value = null;
|
|
163
178
|
});
|
|
164
|
-
|
|
179
|
+
|
|
165
180
|
return {
|
|
166
181
|
reference,
|
|
167
182
|
popper,
|
|
@@ -173,10 +188,9 @@ export default defineComponent({
|
|
|
173
188
|
zIndex,
|
|
174
189
|
style,
|
|
175
190
|
fade
|
|
176
|
-
}
|
|
191
|
+
};
|
|
177
192
|
}
|
|
178
|
-
})
|
|
193
|
+
});
|
|
179
194
|
</script>
|
|
180
195
|
|
|
181
|
-
|
|
182
196
|
<style scoped></style>
|