@v1nt1248/3nclient-lib 0.2.21 → 0.2.23
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/dist/components/ui3n-tooltip/types.d.ts +1 -0
- package/dist/components/ui3n-tooltip/ui3n-tooltip.vue.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +1005 -1004
- package/package.json +1 -1
- package/src/components/ui3n-tooltip/types.ts +1 -0
- package/src/components/ui3n-tooltip/ui3n-tooltip.vue +9 -3
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
const baseOffset = 5;
|
|
9
9
|
|
|
10
10
|
const props = withDefaults(defineProps<Ui3nTooltipProps>(), {
|
|
11
|
+
maxContentWidth: 400,
|
|
11
12
|
color: 'var(--color-bg-block-tritery-default)',
|
|
12
13
|
textColor: 'var(--color-text-block-darkery-default)',
|
|
13
14
|
placement: 'top',
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
const floatingEl = ref<Nullable<HTMLElement>>(null);
|
|
25
26
|
const floatingArrowEl = ref<Nullable<HTMLElement>>(null);
|
|
26
27
|
|
|
28
|
+
const maxContentWidthCssValue = computed(() => `${props.maxContentWidth}px`);
|
|
27
29
|
const baseOffsetCssValue = computed(() => `${-baseOffset}px`);
|
|
28
30
|
const arrowSizeCssValue = computed(() => `${baseOffset}px`);
|
|
29
31
|
const mainPlacement = computed(() => {
|
|
@@ -66,18 +68,24 @@
|
|
|
66
68
|
});
|
|
67
69
|
|
|
68
70
|
function onMouseenter() {
|
|
71
|
+
if (props.disabled) return;
|
|
72
|
+
|
|
69
73
|
showTooltip.value = true;
|
|
70
74
|
emits('open');
|
|
71
75
|
emits('update:modelValue', true);
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
function onMouseleave() {
|
|
79
|
+
if (props.disabled) return;
|
|
80
|
+
|
|
75
81
|
showTooltip.value = false;
|
|
76
82
|
emits('close');
|
|
77
83
|
emits('update:modelValue', false);
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
function onClick() {
|
|
87
|
+
if (props.disabled) return;
|
|
88
|
+
|
|
81
89
|
if (showTooltip.value) {
|
|
82
90
|
onMouseleave();
|
|
83
91
|
} else {
|
|
@@ -86,8 +94,6 @@
|
|
|
86
94
|
}
|
|
87
95
|
|
|
88
96
|
onMounted(() => {
|
|
89
|
-
if (props.disabled) return;
|
|
90
|
-
|
|
91
97
|
const inst = getCurrentInstance();
|
|
92
98
|
const el = inst?.vnode?.el;
|
|
93
99
|
if (!el) {
|
|
@@ -204,7 +210,7 @@
|
|
|
204
210
|
|
|
205
211
|
.content {
|
|
206
212
|
position: relative;
|
|
207
|
-
max-width:
|
|
213
|
+
max-width: v-bind(maxContentWidthCssValue);
|
|
208
214
|
padding: 6px var(--spacing-s);
|
|
209
215
|
border-radius: 6px;
|
|
210
216
|
font-size: var(--font-11);
|