wave-ui 1.45.2 → 1.45.7
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/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +17 -15
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/wave-ui/components/w-accordion.vue +7 -4
- package/src/wave-ui/components/w-app.vue +1 -1
- package/src/wave-ui/components/w-flex.vue +2 -0
- package/src/wave-ui/components/w-input.vue +1 -1
- package/src/wave-ui/components/w-menu.vue +1 -1
- package/src/wave-ui/components/w-tabs/index.vue +1 -0
- package/src/wave-ui/components/w-textarea.vue +1 -1
- package/src/wave-ui/components/w-tooltip.vue +94 -94
- package/src/wave-ui/utils/index.js +1 -1
package/package.json
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
:tabindex="-1"
|
|
20
20
|
text
|
|
21
21
|
@keypress.stop
|
|
22
|
-
@click.stop="!item._disabled && toggleItem(item, $event)"
|
|
22
|
+
@click.stop="!item._disabled && toggleItem(item, $event)"
|
|
23
|
+
:class="{ 'w-accordion__expand-icon--expanded': item._expanded }")
|
|
23
24
|
//- Title.
|
|
24
25
|
slot(
|
|
25
26
|
v-if="$scopedSlots[`item-title.${item.id || i + 1}`]"
|
|
@@ -34,7 +35,8 @@
|
|
|
34
35
|
:icon="(item._expanded && collapseIcon) || expandIcon"
|
|
35
36
|
text
|
|
36
37
|
@keypress.stop
|
|
37
|
-
@click.stop="!item._disabled && toggleItem(item, $event)"
|
|
38
|
+
@click.stop="!item._disabled && toggleItem(item, $event)"
|
|
39
|
+
:class="{ 'w-accordion__expand-icon--expanded': item._expanded }")
|
|
38
40
|
//- Content.
|
|
39
41
|
w-transition-expand(y)
|
|
40
42
|
.w-accordion__item-content(v-if="item._expanded" :class="contentClass")
|
|
@@ -76,6 +78,7 @@ export default {
|
|
|
76
78
|
computed: {
|
|
77
79
|
accordionItems () {
|
|
78
80
|
const items = typeof this.items === 'number' ? Array(this.items).fill({}) : this.items || []
|
|
81
|
+
// eslint-disable-next-line new-cap
|
|
79
82
|
return items.map((item, _index) => new Vue.observable({
|
|
80
83
|
...item,
|
|
81
84
|
_index,
|
|
@@ -148,8 +151,8 @@ export default {
|
|
|
148
151
|
margin-right: $base-increment;
|
|
149
152
|
|
|
150
153
|
.w-accordion--rotate-icon & {@include default-transition;}
|
|
151
|
-
|
|
152
|
-
.w-accordion--
|
|
154
|
+
&--expanded {transform: rotate(-180deg);}
|
|
155
|
+
.w-accordion--icon-right &--expanded {transform: rotate(180deg);}
|
|
153
156
|
|
|
154
157
|
.w-icon:before {font-size: 1.1em;}
|
|
155
158
|
}
|
|
@@ -26,6 +26,7 @@ export default {
|
|
|
26
26
|
justifyEnd: { type: Boolean },
|
|
27
27
|
justifySpaceBetween: { type: Boolean },
|
|
28
28
|
justifySpaceAround: { type: Boolean },
|
|
29
|
+
justifySpaceEvenly: { type: Boolean },
|
|
29
30
|
basisZero: { type: Boolean },
|
|
30
31
|
gap: { type: Number, default: 0 }
|
|
31
32
|
},
|
|
@@ -48,6 +49,7 @@ export default {
|
|
|
48
49
|
'justify-end': this.justifyEnd,
|
|
49
50
|
'justify-space-between': this.justifySpaceBetween,
|
|
50
51
|
'justify-space-around': this.justifySpaceAround,
|
|
52
|
+
'justify-space-evenly': this.justifySpaceEvenly,
|
|
51
53
|
'basis-zero': this.basisZero,
|
|
52
54
|
[`w-flex--gap${this.gap}`]: this.gap
|
|
53
55
|
}
|
|
@@ -170,6 +170,7 @@ export default {
|
|
|
170
170
|
hasValue () {
|
|
171
171
|
return (
|
|
172
172
|
this.inputValue ||
|
|
173
|
+
this.inputValue === 0 ||
|
|
173
174
|
['date', 'time'].includes(this.type) ||
|
|
174
175
|
(this.type === 'number' && this.inputNumberError) ||
|
|
175
176
|
(this.type === 'file' && this.inputFiles.length)
|
|
@@ -272,7 +273,6 @@ export default {
|
|
|
272
273
|
reader.addEventListener('progress', event => {
|
|
273
274
|
if (event.loaded && event.total) {
|
|
274
275
|
this.$set(file, 'progress', event.loaded * 100 / event.total)
|
|
275
|
-
console.log(`Progress: ${Math.round(file.progress)}`)
|
|
276
276
|
}
|
|
277
277
|
})
|
|
278
278
|
|
|
@@ -106,6 +106,7 @@ export default {
|
|
|
106
106
|
tabsItems () {
|
|
107
107
|
const items = typeof this.items === 'number' ? Array(this.items).fill({}) : this.items
|
|
108
108
|
|
|
109
|
+
// eslint-disable-next-line new-cap
|
|
109
110
|
return items.map((item, _index) => new Vue.observable({
|
|
110
111
|
...item,
|
|
111
112
|
_index,
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.w-tooltip-wrap(
|
|
2
|
+
.w-tooltip-wrap(:class="{ 'w-tooltip-wrap--attached': !detachTo }")
|
|
3
3
|
slot(name="activator" :on="eventHandlers")
|
|
4
4
|
transition(:name="transitionName" appear)
|
|
5
5
|
.w-tooltip(ref="tooltip" v-show="showTooltip" :class="classes" :style="styles")
|
|
6
|
-
|
|
7
|
-
//- to inherit the current color.
|
|
8
|
-
div(v-if="bgColor" :class="color")
|
|
9
|
-
slot
|
|
10
|
-
slot(v-else)
|
|
6
|
+
slot
|
|
11
7
|
</template>
|
|
12
8
|
|
|
13
9
|
<script>
|
|
@@ -95,7 +91,7 @@ export default {
|
|
|
95
91
|
|
|
96
92
|
// DOM element that will receive the tooltip.
|
|
97
93
|
tooltipParentEl () {
|
|
98
|
-
return this.detachTo ? this.detachToTarget : this.$
|
|
94
|
+
return this.detachTo ? this.detachToTarget : this.$el
|
|
99
95
|
},
|
|
100
96
|
|
|
101
97
|
position () {
|
|
@@ -140,8 +136,8 @@ export default {
|
|
|
140
136
|
|
|
141
137
|
classes () {
|
|
142
138
|
return {
|
|
143
|
-
[this.color]:
|
|
144
|
-
[`${this.bgColor}
|
|
139
|
+
[this.color]: this.color,
|
|
140
|
+
[`${this.bgColor}--bg`]: this.bgColor,
|
|
145
141
|
...this.tooltipClasses,
|
|
146
142
|
[`w-tooltip--${this.position}`]: true,
|
|
147
143
|
'w-tooltip--tile': this.tile,
|
|
@@ -154,11 +150,13 @@ export default {
|
|
|
154
150
|
}
|
|
155
151
|
},
|
|
156
152
|
|
|
153
|
+
// The tooltip styles.
|
|
157
154
|
styles () {
|
|
158
155
|
return {
|
|
159
156
|
zIndex: this.zIndex || this.zIndex === 0 || null,
|
|
160
|
-
top: `${~~this.tooltipCoordinates.top}px
|
|
161
|
-
left: `${~~this.tooltipCoordinates.left}px`
|
|
157
|
+
top: (this.tooltipCoordinates.top && `${~~this.tooltipCoordinates.top}px`) || null,
|
|
158
|
+
left: (this.tooltipCoordinates.left && `${~~this.tooltipCoordinates.left}px`) || null,
|
|
159
|
+
'--w-tooltip-bg-color': this.$waveui.colors[this.bgColor || 'white']
|
|
162
160
|
}
|
|
163
161
|
},
|
|
164
162
|
|
|
@@ -267,7 +265,7 @@ export default {
|
|
|
267
265
|
},
|
|
268
266
|
|
|
269
267
|
insertTooltip () {
|
|
270
|
-
const wrapper = this.$
|
|
268
|
+
const wrapper = this.$el
|
|
271
269
|
this.tooltipEl = this.$refs.tooltip.$el || this.$refs.tooltip
|
|
272
270
|
|
|
273
271
|
// Unwrap the activator element.
|
|
@@ -285,7 +283,7 @@ export default {
|
|
|
285
283
|
},
|
|
286
284
|
|
|
287
285
|
mounted () {
|
|
288
|
-
this.activatorEl = this.$
|
|
286
|
+
this.activatorEl = this.$el.firstElementChild
|
|
289
287
|
if (this.detachTo) this.insertTooltip()
|
|
290
288
|
|
|
291
289
|
if (this.value) this.toggle({ type: 'click', target: this.activatorEl })
|
|
@@ -361,93 +359,95 @@ export default {
|
|
|
361
359
|
|
|
362
360
|
&--custom-transition {transform: none;}
|
|
363
361
|
|
|
364
|
-
&:after {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
&--top:after {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
&--bottom:after {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
&--left:after {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
}
|
|
392
|
-
&--right:after {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
362
|
+
// &:after {
|
|
363
|
+
// content: '';
|
|
364
|
+
// position: absolute;
|
|
365
|
+
// width: 0;
|
|
366
|
+
// height: 0;
|
|
367
|
+
// border: 6px solid transparent;
|
|
368
|
+
// }
|
|
369
|
+
// &--top:after {
|
|
370
|
+
// top: 100%;
|
|
371
|
+
// left: 50%;
|
|
372
|
+
// border-top-color: $tooltip-bg-color;
|
|
373
|
+
// transform: translateX(-50%);
|
|
374
|
+
// margin-top: 1px;
|
|
375
|
+
// }
|
|
376
|
+
// &--bottom:after {
|
|
377
|
+
// bottom: 100%;
|
|
378
|
+
// left: 50%;
|
|
379
|
+
// border-bottom-color: $tooltip-bg-color;
|
|
380
|
+
// transform: translateX(-50%);
|
|
381
|
+
// margin-bottom: 1px;
|
|
382
|
+
// }
|
|
383
|
+
// &--left:after {
|
|
384
|
+
// left: 100%;
|
|
385
|
+
// top: 50%;
|
|
386
|
+
// border-left-color: $tooltip-bg-color;
|
|
387
|
+
// transform: translateY(-50%);
|
|
388
|
+
// margin-left: 1px;
|
|
389
|
+
// }
|
|
390
|
+
// &--right:after {
|
|
391
|
+
// right: 100%;
|
|
392
|
+
// top: 50%;
|
|
393
|
+
// border-right-color: $tooltip-bg-color;
|
|
394
|
+
// transform: translateY(-50%);
|
|
395
|
+
// margin-right: 1px;
|
|
396
|
+
// }
|
|
399
397
|
|
|
400
398
|
// Tooltip without border.
|
|
401
399
|
// --------------------------------------------------------
|
|
402
|
-
&--no-border
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
&--no-border
|
|
400
|
+
&--no-border {
|
|
401
|
+
@include triangle(var(--w-tooltip-bg-color), '.w-tooltip', 7px, 0);
|
|
402
|
+
}
|
|
403
|
+
&:not(&--no-border) {
|
|
404
|
+
@include triangle(var(--w-tooltip-bg-color), '.w-tooltip', 7px);
|
|
405
|
+
}
|
|
406
406
|
|
|
407
407
|
// Tooltip with border.
|
|
408
408
|
// --------------------------------------------------------
|
|
409
|
-
&:not(&--no-border).w-tooltip--top:after {margin-top: -1px;}
|
|
410
|
-
&:not(&--no-border).w-tooltip--bottom:after {margin-bottom: -1px;}
|
|
411
|
-
&:not(&--no-border).w-tooltip--left:after {margin-left: -1px;}
|
|
412
|
-
&:not(&--no-border).w-tooltip--right:after {margin-right: -1px;}
|
|
413
|
-
|
|
414
|
-
&:not(&--no-border) {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
409
|
+
// &:not(&--no-border).w-tooltip--top:after {margin-top: -1px;}
|
|
410
|
+
// &:not(&--no-border).w-tooltip--bottom:after {margin-bottom: -1px;}
|
|
411
|
+
// &:not(&--no-border).w-tooltip--left:after {margin-left: -1px;}
|
|
412
|
+
// &:not(&--no-border).w-tooltip--right:after {margin-right: -1px;}
|
|
413
|
+
|
|
414
|
+
// &:not(&--no-border) {
|
|
415
|
+
// &:before {
|
|
416
|
+
// content: '';
|
|
417
|
+
// position: absolute;
|
|
418
|
+
// width: 0;
|
|
419
|
+
// height: 0;
|
|
420
|
+
// border: 7px solid transparent;
|
|
421
|
+
// }
|
|
422
|
+
// &.w-tooltip--top:before {
|
|
423
|
+
// top: 100%;
|
|
424
|
+
// left: 50%;
|
|
425
|
+
// border-top-color: inherit;
|
|
426
|
+
// transform: translateX(-50%);
|
|
427
|
+
// margin-top: 0;
|
|
428
|
+
// }
|
|
429
|
+
// &.w-tooltip--bottom:before {
|
|
430
|
+
// bottom: 100%;
|
|
431
|
+
// left: 50%;
|
|
432
|
+
// border-bottom-color: inherit;
|
|
433
|
+
// transform: translateX(-50%);
|
|
434
|
+
// margin-bottom: 0;
|
|
435
|
+
// }
|
|
436
|
+
// &.w-tooltip--left:before {
|
|
437
|
+
// left: 100%;
|
|
438
|
+
// top: 50%;
|
|
439
|
+
// border-left-color: inherit;
|
|
440
|
+
// transform: translateY(-50%);
|
|
441
|
+
// margin-left: 0;
|
|
442
|
+
// }
|
|
443
|
+
// &.w-tooltip--right:before {
|
|
444
|
+
// right: 100%;
|
|
445
|
+
// top: 50%;
|
|
446
|
+
// border-right-color: inherit;
|
|
447
|
+
// transform: translateY(-50%);
|
|
448
|
+
// margin-right: 0;
|
|
449
|
+
// }
|
|
450
|
+
// }
|
|
451
451
|
// --------------------------------------------------------
|
|
452
452
|
}
|
|
453
453
|
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export const objectifyClasses = (classes = {}) => {
|
|
8
8
|
if (typeof classes === 'string') classes = { [classes]: true }
|
|
9
|
-
else if (
|
|
9
|
+
else if (Array.isArray(classes)) classes = { [classes.join(' ')]: true }
|
|
10
10
|
return classes
|
|
11
11
|
}
|