wave-ui 3.25.6 → 3.26.0
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/types/{components → types/components}/WAccordion.d.ts +18 -0
- package/dist/types/{components → types/components}/WMenu.d.ts +6 -0
- package/dist/types/{components → types/components}/WTooltip.d.ts +6 -0
- package/dist/types/{plugin.d.ts → types/plugin.d.ts} +0 -1
- package/dist/wave-ui.cjs.js +4 -1
- package/dist/wave-ui.css +2 -1
- package/dist/wave-ui.esm.js +8964 -0
- package/dist/wave-ui.umd.js +4 -1
- package/package.json +19 -19
- package/src/wave-ui/components/w-accordion/accordion-content.vue +14 -0
- package/src/wave-ui/components/w-accordion/index.vue +3 -1
- package/src/wave-ui/components/w-accordion/item.vue +31 -2
- package/src/wave-ui/components/w-confirm.vue +17 -1
- package/src/wave-ui/components/w-menu.vue +20 -11
- package/src/wave-ui/components/w-tooltip.vue +23 -12
- package/src/wave-ui/core.js +1 -4
- package/src/wave-ui/index.d.ts +0 -2
- package/src/wave-ui/mixins/detachable.js +167 -86
- package/dist/wave-ui.es.js +0 -8429
- /package/dist/types/{$waveui.d.ts → types/$waveui.d.ts} +0 -0
- /package/dist/types/{$waveui.js → types/$waveui.js} +0 -0
- /package/dist/types/{colors.d.ts → types/colors.d.ts} +0 -0
- /package/dist/types/{colors.js → types/colors.js} +0 -0
- /package/dist/types/{components → types/components}/WAccordion.js +0 -0
- /package/dist/types/{components → types/components}/WAlert.d.ts +0 -0
- /package/dist/types/{components → types/components}/WAlert.js +0 -0
- /package/dist/types/{components → types/components}/WApp.d.ts +0 -0
- /package/dist/types/{components → types/components}/WApp.js +0 -0
- /package/dist/types/{components → types/components}/WBadge.d.ts +0 -0
- /package/dist/types/{components → types/components}/WBadge.js +0 -0
- /package/dist/types/{components → types/components}/WBreadcrumbs.d.ts +0 -0
- /package/dist/types/{components → types/components}/WBreadcrumbs.js +0 -0
- /package/dist/types/{components → types/components}/WButton.d.ts +0 -0
- /package/dist/types/{components → types/components}/WButton.js +0 -0
- /package/dist/types/{components → types/components}/WCard.d.ts +0 -0
- /package/dist/types/{components → types/components}/WCard.js +0 -0
- /package/dist/types/{components → types/components}/WCheckbox.d.ts +0 -0
- /package/dist/types/{components → types/components}/WCheckbox.js +0 -0
- /package/dist/types/{components → types/components}/WCheckboxes.d.ts +0 -0
- /package/dist/types/{components → types/components}/WCheckboxes.js +0 -0
- /package/dist/types/{components → types/components}/WConfirm.d.ts +0 -0
- /package/dist/types/{components → types/components}/WConfirm.js +0 -0
- /package/dist/types/{components → types/components}/WDialog.d.ts +0 -0
- /package/dist/types/{components → types/components}/WDialog.js +0 -0
- /package/dist/types/{components → types/components}/WDivider.d.ts +0 -0
- /package/dist/types/{components → types/components}/WDivider.js +0 -0
- /package/dist/types/{components → types/components}/WDrawer.d.ts +0 -0
- /package/dist/types/{components → types/components}/WDrawer.js +0 -0
- /package/dist/types/{components → types/components}/WFlex.d.ts +0 -0
- /package/dist/types/{components → types/components}/WFlex.js +0 -0
- /package/dist/types/{components → types/components}/WForm.d.ts +0 -0
- /package/dist/types/{components → types/components}/WForm.js +0 -0
- /package/dist/types/{components → types/components}/WFormElement.d.ts +0 -0
- /package/dist/types/{components → types/components}/WFormElement.js +0 -0
- /package/dist/types/{components → types/components}/WGrid.d.ts +0 -0
- /package/dist/types/{components → types/components}/WGrid.js +0 -0
- /package/dist/types/{components → types/components}/WIcon.d.ts +0 -0
- /package/dist/types/{components → types/components}/WIcon.js +0 -0
- /package/dist/types/{components → types/components}/WImage.d.ts +0 -0
- /package/dist/types/{components → types/components}/WImage.js +0 -0
- /package/dist/types/{components → types/components}/WInput.d.ts +0 -0
- /package/dist/types/{components → types/components}/WInput.js +0 -0
- /package/dist/types/{components → types/components}/WList.d.ts +0 -0
- /package/dist/types/{components → types/components}/WList.js +0 -0
- /package/dist/types/{components → types/components}/WMenu.js +0 -0
- /package/dist/types/{components → types/components}/WNotification.d.ts +0 -0
- /package/dist/types/{components → types/components}/WNotification.js +0 -0
- /package/dist/types/{components → types/components}/WNotificationManager.d.ts +0 -0
- /package/dist/types/{components → types/components}/WNotificationManager.js +0 -0
- /package/dist/types/{components → types/components}/WOverlay.d.ts +0 -0
- /package/dist/types/{components → types/components}/WOverlay.js +0 -0
- /package/dist/types/{components → types/components}/WProgress.d.ts +0 -0
- /package/dist/types/{components → types/components}/WProgress.js +0 -0
- /package/dist/types/{components → types/components}/WRadio.d.ts +0 -0
- /package/dist/types/{components → types/components}/WRadio.js +0 -0
- /package/dist/types/{components → types/components}/WRadios.d.ts +0 -0
- /package/dist/types/{components → types/components}/WRadios.js +0 -0
- /package/dist/types/{components → types/components}/WRating.d.ts +0 -0
- /package/dist/types/{components → types/components}/WRating.js +0 -0
- /package/dist/types/{components → types/components}/WSelect.d.ts +0 -0
- /package/dist/types/{components → types/components}/WSelect.js +0 -0
- /package/dist/types/{components → types/components}/WSlider.d.ts +0 -0
- /package/dist/types/{components → types/components}/WSlider.js +0 -0
- /package/dist/types/{components → types/components}/WSpinner.d.ts +0 -0
- /package/dist/types/{components → types/components}/WSpinner.js +0 -0
- /package/dist/types/{components → types/components}/WSteps.d.ts +0 -0
- /package/dist/types/{components → types/components}/WSteps.js +0 -0
- /package/dist/types/{components → types/components}/WSwitch.d.ts +0 -0
- /package/dist/types/{components → types/components}/WSwitch.js +0 -0
- /package/dist/types/{components → types/components}/WTable.d.ts +0 -0
- /package/dist/types/{components → types/components}/WTable.js +0 -0
- /package/dist/types/{components → types/components}/WTabs.d.ts +0 -0
- /package/dist/types/{components → types/components}/WTabs.js +0 -0
- /package/dist/types/{components → types/components}/WTag.d.ts +0 -0
- /package/dist/types/{components → types/components}/WTag.js +0 -0
- /package/dist/types/{components → types/components}/WTextarea.d.ts +0 -0
- /package/dist/types/{components → types/components}/WTextarea.js +0 -0
- /package/dist/types/{components → types/components}/WTimeline.d.ts +0 -0
- /package/dist/types/{components → types/components}/WTimeline.js +0 -0
- /package/dist/types/{components → types/components}/WToolbar.d.ts +0 -0
- /package/dist/types/{components → types/components}/WToolbar.js +0 -0
- /package/dist/types/{components → types/components}/WTooltip.js +0 -0
- /package/dist/types/{components → types/components}/WTree.d.ts +0 -0
- /package/dist/types/{components → types/components}/WTree.js +0 -0
- /package/dist/types/{components → types/components}/index.d.ts +0 -0
- /package/dist/types/{components → types/components}/index.js +0 -0
- /package/dist/types/{extra-vue-types.d.ts → types/extra-vue-types.d.ts} +0 -0
- /package/dist/types/{extra-vue-types.js → types/extra-vue-types.js} +0 -0
- /package/dist/types/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/types/{index.js → types/index.js} +0 -0
- /package/dist/types/{plugin.js → types/plugin.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.26.0",
|
|
4
4
|
"description": "A UI framework for Vue.js 3 (and 2) with only the bright side. :sunny:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"homepage": "https://antoniandre.github.io/wave-ui",
|
|
@@ -49,30 +49,30 @@
|
|
|
49
49
|
"ui"
|
|
50
50
|
],
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@babel/core": "^7.
|
|
53
|
-
"@biomejs/biome": "^
|
|
54
|
-
"@faker-js/faker": "^
|
|
52
|
+
"@babel/core": "^7.29.0",
|
|
53
|
+
"@biomejs/biome": "^2.4.12",
|
|
54
|
+
"@faker-js/faker": "^10.4.0",
|
|
55
55
|
"@mdi/font": "^7.4.47",
|
|
56
|
-
"@tsconfig/recommended": "^1.0.
|
|
57
|
-
"@vitejs/plugin-vue": "^
|
|
58
|
-
"autoprefixer": "^10.
|
|
59
|
-
"axios": "^1.
|
|
56
|
+
"@tsconfig/recommended": "^1.0.13",
|
|
57
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
58
|
+
"autoprefixer": "^10.5.0",
|
|
59
|
+
"axios": "^1.15.1",
|
|
60
60
|
"font-awesome": "^4.7.0",
|
|
61
|
-
"globals": "^
|
|
62
|
-
"gsap": "^3.
|
|
61
|
+
"globals": "^17.5.0",
|
|
62
|
+
"gsap": "^3.15.0",
|
|
63
63
|
"ionicons": "^4.6.3",
|
|
64
64
|
"material-design-icons": "^3.0.1",
|
|
65
|
-
"postcss": "^8.5.
|
|
66
|
-
"pug": "^3.0.
|
|
67
|
-
"rollup-plugin-delete": "^3.0.
|
|
68
|
-
"sass": "^1.
|
|
65
|
+
"postcss": "^8.5.10",
|
|
66
|
+
"pug": "^3.0.4",
|
|
67
|
+
"rollup-plugin-delete": "^3.0.2",
|
|
68
|
+
"sass": "^1.99.0",
|
|
69
69
|
"simple-syntax-highlighter": "^3.1.1",
|
|
70
70
|
"splitpanes": "^4.0.4",
|
|
71
|
-
"typescript": "^
|
|
72
|
-
"vite": "^
|
|
73
|
-
"vite-svg-loader": "^5.1.
|
|
74
|
-
"vue": "^3.5.
|
|
75
|
-
"vue-router": "^
|
|
71
|
+
"typescript": "^6.0.3",
|
|
72
|
+
"vite": "^8.0.9",
|
|
73
|
+
"vite-svg-loader": "^5.1.1",
|
|
74
|
+
"vue": "^3.5.32",
|
|
75
|
+
"vue-router": "^5.0.4",
|
|
76
76
|
"vueperslides": "^3.6.0",
|
|
77
77
|
"vuex": "^4.1.0"
|
|
78
78
|
},
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.w-accordion__item-content
|
|
3
|
+
slot
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script>
|
|
7
|
+
// Keep-alive only works with components, not with DOM nodes.
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'accordion-content', // Keep-alive include/exclude mechanism is component-name-based.
|
|
11
|
+
|
|
12
|
+
props: { item: { type: Object, default: () => ({}) } }
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
@@ -74,7 +74,9 @@ export default {
|
|
|
74
74
|
shadow: { type: Boolean },
|
|
75
75
|
duration: { type: Number, default: 250 },
|
|
76
76
|
dark: { type: Boolean },
|
|
77
|
-
light: { type: Boolean }
|
|
77
|
+
light: { type: Boolean },
|
|
78
|
+
keepAlive: { type: Boolean, default: true },
|
|
79
|
+
keepInDom: { type: Boolean, default: false }
|
|
78
80
|
},
|
|
79
81
|
|
|
80
82
|
components: { WAccordionItem },
|
|
@@ -33,20 +33,49 @@
|
|
|
33
33
|
@click.stop="!accordionItem._disabled && toggleItem(accordionItem, $event)"
|
|
34
34
|
:class="{ 'w-accordion__expand-icon--expanded': accordionItem._expanded, 'w-accordion__expand-icon--rotate90': options.expandIconRotate90 }")
|
|
35
35
|
//- Content.
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
//- keepInDom: content stays mounted; v-show toggles visibility (keep-alive is inactive, like w-tabs).
|
|
37
|
+
w-transition-expand(
|
|
38
|
+
v-if="options.keepInDom"
|
|
39
|
+
y
|
|
40
|
+
@after-leave="onEndOfCollapse(accordionItem)"
|
|
41
|
+
:duration="options.duration")
|
|
42
|
+
accordion-content(
|
|
43
|
+
v-show="accordionItem._expanded"
|
|
44
|
+
:item="accordionItem"
|
|
45
|
+
:class="contentClasses")
|
|
38
46
|
slot(
|
|
39
47
|
name="content"
|
|
40
48
|
:item="getOriginalItem(accordionItem)"
|
|
41
49
|
:expanded="accordionItem._expanded"
|
|
42
50
|
:index="accordionItem._index + 1")
|
|
43
51
|
div(v-html="accordionItem[options.itemContentKey]")
|
|
52
|
+
w-transition-expand(
|
|
53
|
+
v-else
|
|
54
|
+
y
|
|
55
|
+
@after-leave="onEndOfCollapse(accordionItem)"
|
|
56
|
+
:duration="options.duration")
|
|
57
|
+
keep-alive(:exclude="options.keepAlive ? '' : 'accordion-content'")
|
|
58
|
+
accordion-content(
|
|
59
|
+
v-if="accordionItem._expanded"
|
|
60
|
+
:key="accordionItem._cuid"
|
|
61
|
+
:item="accordionItem"
|
|
62
|
+
:class="contentClasses")
|
|
63
|
+
slot(
|
|
64
|
+
name="content"
|
|
65
|
+
:item="getOriginalItem(accordionItem)"
|
|
66
|
+
:expanded="accordionItem._expanded"
|
|
67
|
+
:index="accordionItem._index + 1")
|
|
68
|
+
div(v-html="accordionItem[options.itemContentKey]")
|
|
44
69
|
</template>
|
|
45
70
|
|
|
46
71
|
<script>
|
|
72
|
+
import AccordionContent from './accordion-content.vue'
|
|
73
|
+
|
|
47
74
|
export default {
|
|
48
75
|
name: 'w-accordion-item',
|
|
49
76
|
|
|
77
|
+
components: { AccordionContent },
|
|
78
|
+
|
|
50
79
|
props: {
|
|
51
80
|
title: { type: String },
|
|
52
81
|
content: { type: String },
|
|
@@ -67,7 +67,15 @@ export default {
|
|
|
67
67
|
persistent: { type: Boolean },
|
|
68
68
|
transition: { type: String },
|
|
69
69
|
dark: { type: Boolean },
|
|
70
|
-
light: { type: Boolean }
|
|
70
|
+
light: { type: Boolean },
|
|
71
|
+
loading: { type: Boolean },
|
|
72
|
+
outline: { type: Boolean },
|
|
73
|
+
text: { type: Boolean },
|
|
74
|
+
round: { type: Boolean },
|
|
75
|
+
shadow: { type: Boolean },
|
|
76
|
+
tile: { type: Boolean },
|
|
77
|
+
type: { type: String },
|
|
78
|
+
disabled: { type: Boolean }
|
|
71
79
|
},
|
|
72
80
|
|
|
73
81
|
emits: ['cancel', 'confirm'],
|
|
@@ -128,6 +136,14 @@ export default {
|
|
|
128
136
|
icon: this.icon,
|
|
129
137
|
dark: this.dark,
|
|
130
138
|
light: this.light,
|
|
139
|
+
loading: this.loading,
|
|
140
|
+
outline: this.outline,
|
|
141
|
+
text: this.text,
|
|
142
|
+
round: this.round,
|
|
143
|
+
shadow: this.shadow,
|
|
144
|
+
tile: this.tile,
|
|
145
|
+
type: this.type,
|
|
146
|
+
disabled: this.disabled,
|
|
131
147
|
tooltip: label,
|
|
132
148
|
tooltipProps,
|
|
133
149
|
...this.mainButton
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
slot(name="activator" :on="activatorEventHandlers")
|
|
3
|
-
transition(:name="transitionName" appear)
|
|
3
|
+
transition(:name="transitionName" appear @after-leave="onAfterLeave")
|
|
4
4
|
.w-menu(
|
|
5
5
|
v-if="custom && detachableVisible"
|
|
6
6
|
ref="detachable"
|
|
@@ -45,8 +45,6 @@ w-overlay(
|
|
|
45
45
|
import { objectifyClasses } from '../utils/index'
|
|
46
46
|
import DetachableMixin from '../mixins/detachable'
|
|
47
47
|
|
|
48
|
-
// const marginFromWindowSide = 4 // Amount of px from a window side, instead of overflowing.
|
|
49
|
-
|
|
50
48
|
export default {
|
|
51
49
|
name: 'w-menu',
|
|
52
50
|
mixins: [DetachableMixin],
|
|
@@ -96,10 +94,10 @@ export default {
|
|
|
96
94
|
detachableVisible: false,
|
|
97
95
|
hoveringActivator: false,
|
|
98
96
|
hoveringMenu: false,
|
|
99
|
-
//
|
|
97
|
+
// null until first computeDetachableCoords run, so no inline top/left is set before positioning.
|
|
100
98
|
detachableCoords: {
|
|
101
|
-
top:
|
|
102
|
-
left:
|
|
99
|
+
top: null,
|
|
100
|
+
left: null
|
|
103
101
|
},
|
|
104
102
|
activatorWidth: 0,
|
|
105
103
|
detachableEl: null,
|
|
@@ -113,6 +111,7 @@ export default {
|
|
|
113
111
|
* - `detachableParentEl`
|
|
114
112
|
* - `activatorEl`
|
|
115
113
|
* - `position`
|
|
114
|
+
* - `effectiveDetachablePosition`
|
|
116
115
|
* - `alignment`
|
|
117
116
|
**/
|
|
118
117
|
|
|
@@ -154,7 +153,7 @@ export default {
|
|
|
154
153
|
[this.color]: this.color,
|
|
155
154
|
[`${this.bgColor}--bg`]: this.bgColor,
|
|
156
155
|
...this.menuClasses,
|
|
157
|
-
[`w-menu--${this.
|
|
156
|
+
[`w-menu--${this.effectiveDetachablePosition}`]: !this.noPosition,
|
|
158
157
|
[`w-menu--align-${this.alignment}`]: !this.noPosition && this.alignment,
|
|
159
158
|
'w-menu--tile': this.tile,
|
|
160
159
|
'w-menu--card': !this.custom,
|
|
@@ -171,15 +170,18 @@ export default {
|
|
|
171
170
|
styles () {
|
|
172
171
|
return {
|
|
173
172
|
zIndex: this.zIndex || this.zIndex === 0 || (this.overlay && !this.zIndex && 200) || null,
|
|
174
|
-
top: (this.detachableCoords.top
|
|
175
|
-
left: (this.detachableCoords.left
|
|
173
|
+
top: Number.isFinite(this.detachableCoords.top) ? `${~~this.detachableCoords.top}px` : null,
|
|
174
|
+
left: Number.isFinite(this.detachableCoords.left) ? `${~~this.detachableCoords.left}px` : null,
|
|
176
175
|
minWidth: (this.minWidth && this.menuMinWidth) || null,
|
|
177
176
|
maxWidth: (this.maxWidth && this.menuMaxWidth) || null,
|
|
177
|
+
visibility: this.detachableReady ? null : 'hidden', // Hidden until coords are ready.
|
|
178
178
|
'--w-menu-bg-color': this.arrow && (this.$waveui.colors[this.bgColor] || 'var(--w-base-bg-color)')
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
181
|
|
|
182
182
|
activatorEventHandlers () {
|
|
183
|
+
if (this.disable) return {}
|
|
184
|
+
|
|
183
185
|
let handlers = {}
|
|
184
186
|
|
|
185
187
|
if (this.showOnHover) {
|
|
@@ -222,6 +224,8 @@ export default {
|
|
|
222
224
|
|
|
223
225
|
// ! \ This function uses the DOM - NO SSR (only trigger from beforeMount and later).
|
|
224
226
|
toggle (e) {
|
|
227
|
+
if (this.disable) return
|
|
228
|
+
|
|
225
229
|
let shouldShowMenu = this.detachableVisible
|
|
226
230
|
if (typeof window !== 'undefined' && 'ontouchstart' in window &&
|
|
227
231
|
this.showOnHover && e.type === 'click') {
|
|
@@ -271,9 +275,14 @@ export default {
|
|
|
271
275
|
this.$emit('update:modelValue', (this.detachableVisible = false))
|
|
272
276
|
this.$emit('input', false)
|
|
273
277
|
this.$emit('close')
|
|
278
|
+
this.viewportPlacementOverride = null
|
|
274
279
|
// Remove the mousedown listener if the menu got closed without a mousedown outside of the menu.
|
|
275
|
-
document
|
|
276
|
-
|
|
280
|
+
if (typeof document !== 'undefined') {
|
|
281
|
+
document.removeEventListener('mousedown', this.onOutsideMousedown)
|
|
282
|
+
}
|
|
283
|
+
if (typeof window !== 'undefined') {
|
|
284
|
+
window.removeEventListener('resize', this.onResize)
|
|
285
|
+
}
|
|
277
286
|
}
|
|
278
287
|
}
|
|
279
288
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
slot(name="activator" :on="activatorEventHandlers")
|
|
3
|
-
transition(:name="transitionName" appear)
|
|
3
|
+
transition(:name="transitionName" appear @after-leave="onAfterLeave")
|
|
4
4
|
.w-tooltip(
|
|
5
5
|
v-if="detachableVisible"
|
|
6
6
|
ref="detachable"
|
|
@@ -14,8 +14,6 @@ transition(:name="transitionName" appear)
|
|
|
14
14
|
import { objectifyClasses } from '../utils/index'
|
|
15
15
|
import DetachableMixin from '../mixins/detachable'
|
|
16
16
|
|
|
17
|
-
// const marginFromWindowSide = 4 // Amount of px from a window side, instead of overflowing.
|
|
18
|
-
|
|
19
17
|
export default {
|
|
20
18
|
name: 'w-tooltip',
|
|
21
19
|
mixins: [DetachableMixin],
|
|
@@ -52,10 +50,10 @@ export default {
|
|
|
52
50
|
data: () => ({
|
|
53
51
|
detachableVisible: false,
|
|
54
52
|
hoveringActivator: false,
|
|
55
|
-
//
|
|
53
|
+
// null until first computeDetachableCoords run, so no inline top/left is set before positioning.
|
|
56
54
|
detachableCoords: {
|
|
57
|
-
top:
|
|
58
|
-
left:
|
|
55
|
+
top: null,
|
|
56
|
+
left: null
|
|
59
57
|
},
|
|
60
58
|
detachableEl: null,
|
|
61
59
|
timeoutId: null
|
|
@@ -68,6 +66,7 @@ export default {
|
|
|
68
66
|
* - `detachableParentEl`
|
|
69
67
|
* - `activatorEl`
|
|
70
68
|
* - `position`
|
|
69
|
+
* - `effectiveDetachablePosition`
|
|
71
70
|
* - `alignment`
|
|
72
71
|
**/
|
|
73
72
|
|
|
@@ -76,7 +75,9 @@ export default {
|
|
|
76
75
|
},
|
|
77
76
|
|
|
78
77
|
transitionName () {
|
|
79
|
-
const direction = this.
|
|
78
|
+
const direction = this.effectiveDetachablePosition.replace(/top|bottom/, m => (
|
|
79
|
+
{ top: 'up', bottom: 'down' }[m]
|
|
80
|
+
))
|
|
80
81
|
return this.transition || `w-tooltip-slide-fade-${direction}`
|
|
81
82
|
},
|
|
82
83
|
|
|
@@ -96,7 +97,7 @@ export default {
|
|
|
96
97
|
[this.color]: this.color,
|
|
97
98
|
[`${this.bgColor}--bg`]: this.bgColor,
|
|
98
99
|
...this.tooltipClasses,
|
|
99
|
-
[`w-tooltip--${this.
|
|
100
|
+
[`w-tooltip--${this.effectiveDetachablePosition}`]: !this.noPosition,
|
|
100
101
|
[`w-tooltip--align-${this.alignment}`]: !this.noPosition && this.alignment,
|
|
101
102
|
'w-tooltip--dark': this.dark,
|
|
102
103
|
'w-tooltip--light': this.light,
|
|
@@ -115,13 +116,16 @@ export default {
|
|
|
115
116
|
styles () {
|
|
116
117
|
return {
|
|
117
118
|
zIndex: this.zIndex || this.zIndex === 0 || null,
|
|
118
|
-
top: (this.detachableCoords.top
|
|
119
|
-
left: (this.detachableCoords.left
|
|
119
|
+
top: Number.isFinite(this.detachableCoords.top) ? `${~~this.detachableCoords.top}px` : null,
|
|
120
|
+
left: Number.isFinite(this.detachableCoords.left) ? `${~~this.detachableCoords.left}px` : null,
|
|
121
|
+
visibility: this.detachableReady ? null : 'hidden', // Hidden until coords are ready.
|
|
120
122
|
'--w-tooltip-bg-color': this.$waveui.colors[this.bgColor] || 'var(--w-base-bg-color)'
|
|
121
123
|
}
|
|
122
124
|
},
|
|
123
125
|
|
|
124
126
|
activatorEventHandlers () {
|
|
127
|
+
if (this.disable) return {}
|
|
128
|
+
|
|
125
129
|
let handlers = {}
|
|
126
130
|
|
|
127
131
|
// Check the window exists: SSR-proof.
|
|
@@ -163,6 +167,8 @@ export default {
|
|
|
163
167
|
|
|
164
168
|
// ! \ This function uses the DOM - NO SSR (only trigger from beforeMount and later).
|
|
165
169
|
toggle (e) {
|
|
170
|
+
if (this.disable) return
|
|
171
|
+
|
|
166
172
|
let shouldShowTooltip = this.detachableVisible
|
|
167
173
|
|
|
168
174
|
// For touch devices.
|
|
@@ -204,9 +210,14 @@ export default {
|
|
|
204
210
|
this.$emit('update:modelValue', (this.detachableVisible = false))
|
|
205
211
|
this.$emit('input', false)
|
|
206
212
|
this.$emit('close')
|
|
213
|
+
this.viewportPlacementOverride = null
|
|
207
214
|
// Remove the mousedown listener if the tooltip got closed without a mousedown outside of the tooltip.
|
|
208
|
-
document
|
|
209
|
-
|
|
215
|
+
if (typeof document !== 'undefined') {
|
|
216
|
+
document.removeEventListener('mousedown', this.onOutsideMousedown)
|
|
217
|
+
}
|
|
218
|
+
if (typeof window !== 'undefined') {
|
|
219
|
+
window.removeEventListener('resize', this.onResize)
|
|
220
|
+
}
|
|
210
221
|
}
|
|
211
222
|
}
|
|
212
223
|
|
package/src/wave-ui/core.js
CHANGED
|
@@ -53,8 +53,6 @@ const injectPresets = (component, presets) => {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export default class WaveUI {
|
|
56
|
-
static #registered = false
|
|
57
|
-
|
|
58
56
|
// Exposed as a global object and also `app.provide`d.
|
|
59
57
|
// Accessible from this.$waveui, or inject('$waveui').
|
|
60
58
|
$waveui = {
|
|
@@ -161,11 +159,10 @@ export default class WaveUI {
|
|
|
161
159
|
|
|
162
160
|
// eslint-disable-next-line no-new
|
|
163
161
|
new WaveUI(app, options)
|
|
164
|
-
WaveUI.#registered = true
|
|
165
162
|
}
|
|
166
163
|
|
|
167
164
|
constructor (app, options = {}) {
|
|
168
|
-
if (
|
|
165
|
+
if (app.config.globalProperties.$waveui) return // Already installed for this app instance.
|
|
169
166
|
|
|
170
167
|
this.$waveui._notificationManager = new NotificationManager()
|
|
171
168
|
|
package/src/wave-ui/index.d.ts
CHANGED