wave-ui 3.27.2 → 4.0.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/types/$waveui.d.ts +21 -1
- package/dist/types/types/colors.d.ts +2 -0
- package/dist/types/types/components/WAccordion.d.ts +99 -6
- package/dist/types/types/components/WAutocomplete.d.ts +437 -0
- package/dist/types/types/components/WBreadcrumbs.d.ts +7 -0
- package/dist/types/types/components/WButton.d.ts +7 -0
- package/dist/types/types/components/WCheckbox.d.ts +34 -0
- package/dist/types/types/components/WCheckboxes.d.ts +30 -0
- package/dist/types/types/components/WInput.d.ts +34 -0
- package/dist/types/types/components/WList.d.ts +7 -0
- package/dist/types/types/components/WMenu.d.ts +12 -6
- package/dist/types/types/components/WRadio.d.ts +34 -0
- package/dist/types/types/components/WRadios.d.ts +30 -0
- package/dist/types/types/components/WScrollable.d.ts +143 -0
- package/dist/types/types/components/WScrollable.js +2 -0
- package/dist/types/types/components/WSelect.d.ts +34 -0
- package/dist/types/types/components/WSwitch.d.ts +34 -0
- package/dist/types/types/components/WTable.d.ts +7 -0
- package/dist/types/types/components/WTabs.d.ts +7 -0
- package/dist/types/types/components/WTag.d.ts +7 -0
- package/dist/types/types/components/WTooltip.d.ts +20 -7
- package/dist/types/types/components/WTransitions.d.ts +104 -0
- package/dist/types/types/components/WTransitions.js +2 -0
- package/dist/types/types/components/WTree.d.ts +7 -0
- package/dist/types/types/components/index.d.ts +3 -1
- package/dist/wave-ui.cjs.js +3 -3
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.esm.js +2190 -1350
- package/dist/wave-ui.umd.js +3 -3
- package/package.json +6 -6
- package/src/wave-ui/components/index.js +0 -1
- package/src/wave-ui/components/transitions/w-transition-bounce.vue +2 -1
- package/src/wave-ui/components/transitions/w-transition-expand.vue +3 -2
- package/src/wave-ui/components/transitions/w-transition-fade.vue +2 -1
- package/src/wave-ui/components/transitions/w-transition-scale-fade.vue +2 -1
- package/src/wave-ui/components/transitions/w-transition-scale.vue +2 -1
- package/src/wave-ui/components/transitions/w-transition-slide-fade.vue +2 -1
- package/src/wave-ui/components/transitions/w-transition-slide.vue +2 -1
- package/src/wave-ui/components/transitions/w-transition-twist.vue +2 -1
- package/src/wave-ui/components/w-accordion/index.vue +15 -6
- package/src/wave-ui/components/w-accordion/item.vue +71 -26
- package/src/wave-ui/components/w-alert.vue +27 -29
- package/src/wave-ui/components/w-autocomplete.vue +626 -192
- package/src/wave-ui/components/w-badge.vue +54 -53
- package/src/wave-ui/components/w-breadcrumbs.vue +20 -11
- package/src/wave-ui/components/w-button/button.vue +36 -24
- package/src/wave-ui/components/w-button/index.vue +6 -5
- package/src/wave-ui/components/w-card.vue +8 -7
- package/src/wave-ui/components/w-checkbox.vue +31 -11
- package/src/wave-ui/components/w-checkboxes.vue +21 -3
- package/src/wave-ui/components/w-confirm.vue +22 -22
- package/src/wave-ui/components/w-dialog.vue +1 -1
- package/src/wave-ui/components/w-divider.vue +5 -5
- package/src/wave-ui/components/w-drawer.vue +3 -3
- package/src/wave-ui/components/w-form-element.vue +2 -2
- package/src/wave-ui/components/w-icon.vue +12 -14
- package/src/wave-ui/components/w-image.vue +1 -1
- package/src/wave-ui/components/w-input.vue +43 -25
- package/src/wave-ui/components/w-list.vue +23 -12
- package/src/wave-ui/components/w-menu.vue +57 -55
- package/src/wave-ui/components/w-notification.vue +4 -4
- package/src/wave-ui/components/w-progress.vue +6 -7
- package/src/wave-ui/components/w-radio.vue +32 -7
- package/src/wave-ui/components/w-radios.vue +28 -3
- package/src/wave-ui/components/w-rating.vue +7 -9
- package/src/wave-ui/components/w-scrollable.vue +670 -97
- package/src/wave-ui/components/w-select.vue +119 -101
- package/src/wave-ui/components/w-slider.vue +26 -26
- package/src/wave-ui/components/w-spinner.vue +5 -7
- package/src/wave-ui/components/w-switch.vue +71 -47
- package/src/wave-ui/components/w-table.vue +69 -36
- package/src/wave-ui/components/w-tabs/index.vue +31 -24
- package/src/wave-ui/components/w-tag.vue +49 -38
- package/src/wave-ui/components/w-textarea.vue +22 -22
- package/src/wave-ui/components/w-timeline.vue +6 -6
- package/src/wave-ui/components/w-toolbar.vue +8 -8
- package/src/wave-ui/components/w-tooltip.vue +30 -25
- package/src/wave-ui/components/w-tree.vue +35 -16
- package/src/wave-ui/core.js +11 -1
- package/src/wave-ui/mixins/detachable.js +98 -43
- package/src/wave-ui/mixins/ripple.js +39 -0
- package/src/wave-ui/scss/_base.scss +82 -17
- package/src/wave-ui/scss/_colors.scss +6 -75
- package/src/wave-ui/scss/_layout.scss +39 -47
- package/src/wave-ui/scss/_ripple.scss +37 -0
- package/src/wave-ui/scss/_transitions.scss +19 -19
- package/src/wave-ui/scss/_typography.scss +8 -9
- package/src/wave-ui/scss/index.scss +1 -0
- package/src/wave-ui/scss/variables/_mixins.scss +24 -25
- package/src/wave-ui/scss/variables/_variables.scss +4 -151
- package/src/wave-ui/utils/colors.js +7 -4
- package/src/wave-ui/utils/config.js +5 -4
- package/src/wave-ui/utils/dynamic-css.js +42 -20
- package/src/wave-ui/utils/ripple.js +72 -0
- package/src/wave-ui/utils/wave-ripple-directive.js +40 -0
- package/dist/types/types/components/WApp.d.ts +0 -83
- package/src/wave-ui/components/w-app.vue +0 -24
- /package/dist/types/types/components/{WApp.js → WAutocomplete.js} +0 -0
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
v-for="(item, i) in tabs"
|
|
6
6
|
:key="i"
|
|
7
7
|
:class="barItemClasses(item)"
|
|
8
|
+
@pointerdown="onTabsBarPointerDown($event, item)"
|
|
8
9
|
@click="!item._disabled && item._uid !== activeTabUid && openTab(item._uid)"
|
|
9
10
|
@focus="$emit('focus', getOriginalItem(item))"
|
|
10
11
|
:tabindex="!item._disabled && 0"
|
|
@@ -73,11 +74,14 @@
|
|
|
73
74
|
<script>
|
|
74
75
|
import { useId } from 'vue'
|
|
75
76
|
import { objectifyClasses } from '../../utils/index'
|
|
77
|
+
import RippleMixin from '../../mixins/ripple'
|
|
76
78
|
import TabContent from './tab-content.vue'
|
|
77
79
|
|
|
78
80
|
export default {
|
|
79
81
|
name: 'w-tabs',
|
|
80
82
|
|
|
83
|
+
mixins: [RippleMixin],
|
|
84
|
+
|
|
81
85
|
setup () {
|
|
82
86
|
return { tabsStableId: useId() }
|
|
83
87
|
},
|
|
@@ -235,6 +239,7 @@ export default {
|
|
|
235
239
|
const isActive = item._index === this.activeTabIndex
|
|
236
240
|
|
|
237
241
|
return {
|
|
242
|
+
'w-ripple': this.rippleActive,
|
|
238
243
|
[`${this.bgColor}--bg`]: this.bgColor,
|
|
239
244
|
[this.color]: this.color && !item._disabled && !(this.activeClass && isActive),
|
|
240
245
|
'w-tabs__bar-item--active': isActive,
|
|
@@ -244,6 +249,11 @@ export default {
|
|
|
244
249
|
}
|
|
245
250
|
},
|
|
246
251
|
|
|
252
|
+
onTabsBarPointerDown (e, item) {
|
|
253
|
+
if (item._disabled) return
|
|
254
|
+
this.onRipple(e)
|
|
255
|
+
},
|
|
256
|
+
|
|
247
257
|
// Switching tabs.
|
|
248
258
|
openTab (uid) {
|
|
249
259
|
this.prevTabIndex = this.activeTabIndex // To resolve the transition direction.
|
|
@@ -351,12 +361,10 @@ export default {
|
|
|
351
361
|
</script>
|
|
352
362
|
|
|
353
363
|
<style lang="scss">
|
|
354
|
-
@use "sass:math";
|
|
355
|
-
|
|
356
364
|
.w-tabs {
|
|
357
365
|
z-index: 1;
|
|
358
|
-
border-radius:
|
|
359
|
-
border:
|
|
366
|
+
border-radius: var(--w-border-radius);
|
|
367
|
+
border: var(--w-border);
|
|
360
368
|
overflow: hidden;
|
|
361
369
|
|
|
362
370
|
@include themeable;
|
|
@@ -372,13 +380,13 @@ export default {
|
|
|
372
380
|
|
|
373
381
|
&--center {justify-content: center;}
|
|
374
382
|
&--right {justify-content: flex-end;}
|
|
375
|
-
.w-tabs--pill-slider & {padding-left:
|
|
383
|
+
.w-tabs--pill-slider & {padding-left: var(--w-base-increment);}
|
|
376
384
|
|
|
377
385
|
.w-tabs--card &:after {
|
|
378
386
|
content: '';
|
|
379
387
|
display: flex;
|
|
380
388
|
flex-grow: 1;
|
|
381
|
-
border-bottom:
|
|
389
|
+
border-bottom: var(--w-border);
|
|
382
390
|
align-self: flex-end;
|
|
383
391
|
}
|
|
384
392
|
}
|
|
@@ -389,18 +397,18 @@ export default {
|
|
|
389
397
|
position: relative;
|
|
390
398
|
display: flex;
|
|
391
399
|
align-items: center;
|
|
392
|
-
padding: (
|
|
400
|
+
padding: calc(var(--w-base-increment) * 2) calc(var(--w-base-increment) * 3);
|
|
393
401
|
justify-content: center;
|
|
394
|
-
font-size:
|
|
395
|
-
transition:
|
|
402
|
+
font-size: round(nearest, calc(1.2 * var(--w-base-font-size)), 1px);
|
|
403
|
+
transition: var(--w-transition-duration) ease-in-out, flex-grow 0s, flex 0s; // `flex` for Safari.
|
|
396
404
|
user-select: none;
|
|
397
405
|
cursor: pointer;
|
|
398
406
|
-webkit-tap-highlight-color: transparent;
|
|
399
407
|
|
|
400
408
|
.w-tabs--fill-bar & {flex-grow: 1;flex-basis: 0;}
|
|
401
409
|
.w-tabs--card & {
|
|
402
|
-
border:
|
|
403
|
-
border-radius:
|
|
410
|
+
border: var(--w-border);
|
|
411
|
+
border-radius: var(--w-border-radius) var(--w-border-radius) 0 0;
|
|
404
412
|
margin-right: -1px;
|
|
405
413
|
}
|
|
406
414
|
.w-tabs--card &--active {border-bottom-color: transparent;}
|
|
@@ -415,13 +423,12 @@ export default {
|
|
|
415
423
|
content: '';
|
|
416
424
|
position: absolute;
|
|
417
425
|
inset: 0;
|
|
418
|
-
background-color:
|
|
419
|
-
|
|
420
|
-
transition: $fast-transition-duration;
|
|
426
|
+
background-color: transparent;
|
|
427
|
+
transition: background-color var(--w-transition-duration-fast);
|
|
421
428
|
}
|
|
422
429
|
|
|
423
|
-
&--active:before, &:focus:before, &:hover:before {
|
|
424
|
-
&:active:before {
|
|
430
|
+
&--active:before, &:focus:before, &:hover:before {background-color: color-mix(in srgb, currentColor 5%, transparent);}
|
|
431
|
+
&:active:before {background-color: color-mix(in srgb, currentColor 8%, transparent);}
|
|
425
432
|
&--disabled:before {display: none;}
|
|
426
433
|
}
|
|
427
434
|
&--pill-slider &__bar-item:before {display: none;}
|
|
@@ -445,7 +452,7 @@ export default {
|
|
|
445
452
|
bottom: 0;
|
|
446
453
|
height: 2px;
|
|
447
454
|
background-color: currentColor;
|
|
448
|
-
transition:
|
|
455
|
+
transition: var(--w-transition-duration) ease-in-out;
|
|
449
456
|
}
|
|
450
457
|
&--pill-slider &__slider {
|
|
451
458
|
opacity: 0.1;
|
|
@@ -463,12 +470,12 @@ export default {
|
|
|
463
470
|
flex-grow: 1;
|
|
464
471
|
|
|
465
472
|
.w-tabs--card & {
|
|
466
|
-
border:
|
|
473
|
+
border: var(--w-border);
|
|
467
474
|
border-top: none;
|
|
468
|
-
border-radius: 0 0
|
|
475
|
+
border-radius: 0 0 var(--w-border-radius) var(--w-border-radius);
|
|
469
476
|
}
|
|
470
477
|
}
|
|
471
|
-
&__content {padding:
|
|
478
|
+
&__content {padding: calc(var(--w-base-increment) * 3);}
|
|
472
479
|
}
|
|
473
480
|
|
|
474
481
|
.w-tabs-slide-left-leave-active,
|
|
@@ -480,8 +487,8 @@ export default {
|
|
|
480
487
|
overflow: hidden;
|
|
481
488
|
}
|
|
482
489
|
|
|
483
|
-
.w-tabs-slide-left-enter-active {animation: w-tabs-slide-left-enter
|
|
484
|
-
.w-tabs-slide-left-leave-active {animation: w-tabs-slide-left-leave
|
|
490
|
+
.w-tabs-slide-left-enter-active {animation: w-tabs-slide-left-enter calc(var(--w-transition-duration) + 0.15s);}
|
|
491
|
+
.w-tabs-slide-left-leave-active {animation: w-tabs-slide-left-leave calc(var(--w-transition-duration) + 0.15s);}
|
|
485
492
|
@keyframes w-tabs-slide-left-enter {
|
|
486
493
|
0% {transform: translateX(100%);}
|
|
487
494
|
100% {transform: translateX(0);}
|
|
@@ -491,8 +498,8 @@ export default {
|
|
|
491
498
|
100% {transform: translateX(-100%);}
|
|
492
499
|
}
|
|
493
500
|
|
|
494
|
-
.w-tabs-slide-right-enter-active {animation: w-tabs-slide-right-enter
|
|
495
|
-
.w-tabs-slide-right-leave-active {animation: w-tabs-slide-right-leave
|
|
501
|
+
.w-tabs-slide-right-enter-active {animation: w-tabs-slide-right-enter calc(var(--w-transition-duration) + 0.15s);}
|
|
502
|
+
.w-tabs-slide-right-leave-active {animation: w-tabs-slide-right-leave calc(var(--w-transition-duration) + 0.15s);}
|
|
496
503
|
@keyframes w-tabs-slide-right-enter {
|
|
497
504
|
0% {transform: translateX(-100%);}
|
|
498
505
|
100% {transform: translateX(0);}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
span.w-tag(
|
|
3
3
|
@click="$emit('update:modelValue', !modelValue);$emit('input', !modelValue)"
|
|
4
|
+
@pointerdown="onTagPointerDown"
|
|
4
5
|
@keypress.enter="$emit('update:modelValue', !modelValue);$emit('input', !modelValue)"
|
|
5
6
|
:class="classes"
|
|
6
7
|
:role="modelValue !== -1 && 'button'"
|
|
@@ -17,9 +18,13 @@ span.w-tag(
|
|
|
17
18
|
</template>
|
|
18
19
|
|
|
19
20
|
<script>
|
|
21
|
+
import RippleMixin from '../mixins/ripple'
|
|
22
|
+
|
|
20
23
|
export default {
|
|
21
24
|
name: 'w-tag',
|
|
22
25
|
|
|
26
|
+
mixins: [RippleMixin],
|
|
27
|
+
|
|
23
28
|
props: {
|
|
24
29
|
modelValue: { type: [Boolean, Number], default: -1 },
|
|
25
30
|
color: { type: String },
|
|
@@ -58,6 +63,7 @@ export default {
|
|
|
58
63
|
[this.color]: this.color,
|
|
59
64
|
[`${this.bgColor}--bg`]: this.bgColor,
|
|
60
65
|
[`size--${this.presetSize}`]: true,
|
|
66
|
+
'w-ripple': this.rippleActive && this.modelValue !== -1,
|
|
61
67
|
'w-tag--dark': this.dark,
|
|
62
68
|
'w-tag--light': this.light,
|
|
63
69
|
'w-tag--clickable': this.modelValue !== -1,
|
|
@@ -74,24 +80,30 @@ export default {
|
|
|
74
80
|
height: (!isNaN(this.height) ? `${this.height}px` : this.height) || null
|
|
75
81
|
}
|
|
76
82
|
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
methods: {
|
|
86
|
+
onTagPointerDown (e) {
|
|
87
|
+
if (this.modelValue === -1) return
|
|
88
|
+
if (e.target.closest?.('.w-tag__closable')) return
|
|
89
|
+
this.onRipple(e)
|
|
90
|
+
}
|
|
77
91
|
}
|
|
78
92
|
}
|
|
79
93
|
</script>
|
|
80
94
|
|
|
81
95
|
<style lang="scss">
|
|
82
|
-
@use "sass:math";
|
|
83
|
-
|
|
84
96
|
.w-tag {
|
|
85
97
|
position: relative;
|
|
86
98
|
display: inline-flex;
|
|
87
99
|
align-items: center;
|
|
88
100
|
justify-content: center;
|
|
89
101
|
vertical-align: middle;
|
|
90
|
-
border-radius:
|
|
102
|
+
border-radius: var(--w-border-radius);
|
|
91
103
|
border: 1px solid color-mix(in srgb, var(--w-contrast-bg-color) 8%, transparent);
|
|
92
104
|
background-color: color-mix(in srgb, var(--w-base-bg-color) 85%, transparent);
|
|
93
|
-
padding-left:
|
|
94
|
-
padding-right:
|
|
105
|
+
padding-left: calc(var(--w-base-increment) * 2);
|
|
106
|
+
padding-right: calc(var(--w-base-increment) * 2);
|
|
95
107
|
cursor: default;
|
|
96
108
|
user-select: none;
|
|
97
109
|
|
|
@@ -102,40 +114,40 @@ export default {
|
|
|
102
114
|
&--no-border {border-color: transparent;}
|
|
103
115
|
&--round {border-radius: 99em;}
|
|
104
116
|
&--tile {border-radius: initial;}
|
|
105
|
-
&--shadow {box-shadow:
|
|
117
|
+
&--shadow {box-shadow: var(--w-box-shadow);}
|
|
106
118
|
|
|
107
119
|
&.size--xs {
|
|
108
|
-
|
|
109
|
-
font-size:
|
|
110
|
-
line-height:
|
|
111
|
-
padding:
|
|
120
|
+
--w-tag-font-size: round(nearest, calc(0.7 * var(--w-base-font-size)), 1px);
|
|
121
|
+
font-size: var(--w-tag-font-size);
|
|
122
|
+
line-height: calc(var(--w-tag-font-size) + 2px);
|
|
123
|
+
padding: calc(var(--w-base-increment) * 0.25) var(--w-base-increment);
|
|
112
124
|
}
|
|
113
125
|
&.size--sm {
|
|
114
|
-
|
|
115
|
-
font-size:
|
|
116
|
-
line-height:
|
|
117
|
-
padding:
|
|
126
|
+
--w-tag-font-size: round(nearest, calc(0.82 * var(--w-base-font-size)), 1px);
|
|
127
|
+
font-size: var(--w-tag-font-size);
|
|
128
|
+
line-height: calc(var(--w-tag-font-size) + 2px);
|
|
129
|
+
padding: calc(var(--w-base-increment) * 0.25) var(--w-base-increment);
|
|
118
130
|
}
|
|
119
131
|
&.size--md {
|
|
120
|
-
|
|
121
|
-
font-size:
|
|
122
|
-
line-height:
|
|
123
|
-
padding-top:
|
|
124
|
-
padding-bottom:
|
|
132
|
+
--w-tag-font-size: round(nearest, calc(0.85 * var(--w-base-font-size)), 1px);
|
|
133
|
+
font-size: var(--w-tag-font-size);
|
|
134
|
+
line-height: calc(var(--w-tag-font-size) + 4px);
|
|
135
|
+
padding-top: calc(var(--w-base-increment) * 0.25);
|
|
136
|
+
padding-bottom: calc(var(--w-base-increment) * 0.25);
|
|
125
137
|
}
|
|
126
138
|
&.size--lg {
|
|
127
|
-
|
|
128
|
-
font-size:
|
|
129
|
-
line-height:
|
|
130
|
-
padding-top:
|
|
131
|
-
padding-bottom:
|
|
139
|
+
--w-tag-font-size: round(nearest, calc(1.1 * var(--w-base-font-size)), 1px);
|
|
140
|
+
font-size: var(--w-tag-font-size);
|
|
141
|
+
line-height: calc(var(--w-tag-font-size) + 4px);
|
|
142
|
+
padding-top: calc(var(--w-base-increment) * 0.5);
|
|
143
|
+
padding-bottom: calc(var(--w-base-increment) * 0.5);
|
|
132
144
|
}
|
|
133
145
|
&.size--xl {
|
|
134
|
-
|
|
135
|
-
font-size:
|
|
136
|
-
line-height:
|
|
137
|
-
padding-top:
|
|
138
|
-
padding-bottom:
|
|
146
|
+
--w-tag-font-size: round(nearest, calc(1.3 * var(--w-base-font-size)), 1px);
|
|
147
|
+
font-size: var(--w-tag-font-size);
|
|
148
|
+
line-height: calc(var(--w-tag-font-size) + 4px);
|
|
149
|
+
padding-top: var(--w-base-increment);
|
|
150
|
+
padding-bottom: var(--w-base-increment);
|
|
139
151
|
}
|
|
140
152
|
|
|
141
153
|
&--clickable {
|
|
@@ -147,7 +159,7 @@ export default {
|
|
|
147
159
|
margin-left: 3px;
|
|
148
160
|
margin-right: -3px;
|
|
149
161
|
padding: 1px;
|
|
150
|
-
transition:
|
|
162
|
+
transition: var(--w-transition-duration);
|
|
151
163
|
}
|
|
152
164
|
&.size--lg .w-tag__closable,
|
|
153
165
|
&.size--xl .w-tag__closable {
|
|
@@ -164,31 +176,30 @@ export default {
|
|
|
164
176
|
content: '';
|
|
165
177
|
position: absolute;
|
|
166
178
|
inset: 0;
|
|
167
|
-
opacity: 0;
|
|
168
179
|
background-color: transparent;
|
|
169
180
|
// As this overlay is a smaller rectangle, the radius must be smaller to cover perfectly.
|
|
170
|
-
border-radius:
|
|
181
|
+
border-radius: calc(var(--w-border-radius) - 1px);
|
|
171
182
|
transition: 0.2s;
|
|
172
183
|
}
|
|
173
184
|
&.w-tag--round:before {border-radius: inherit;}
|
|
174
185
|
|
|
175
186
|
// Hover state.
|
|
176
|
-
&:hover:before {background-color: currentColor
|
|
187
|
+
&:hover:before {background-color: color-mix(in srgb, currentColor 6%, transparent);}
|
|
177
188
|
&--dark:hover:before {background-color: color-mix(in srgb, var(--w-base-bg-color) 12%, transparent);opacity: 1;}
|
|
178
189
|
&--outline:hover:before,
|
|
179
|
-
&--text:hover:before {background-color: currentColor
|
|
190
|
+
&--text:hover:before {background-color: color-mix(in srgb, currentColor 12%, transparent);}
|
|
180
191
|
|
|
181
192
|
// Focus state.
|
|
182
|
-
&:focus:before {background-color: currentColor
|
|
193
|
+
&:focus:before {background-color: color-mix(in srgb, currentColor 20%, transparent);}
|
|
183
194
|
&--dark:focus:before {background-color: color-mix(in srgb, var(--w-base-bg-color) 12%, transparent);}
|
|
184
195
|
&--outline:focus:before,
|
|
185
|
-
&--text:focus:before {background-color: currentColor
|
|
196
|
+
&--text:focus:before {background-color: color-mix(in srgb, currentColor 12%, transparent);}
|
|
186
197
|
|
|
187
198
|
// Active state.
|
|
188
|
-
&:active:before {background-color: currentColor
|
|
199
|
+
&:active:before {background-color: color-mix(in srgb, currentColor 20%, transparent);}
|
|
189
200
|
&--dark:active:before {background-color: color-mix(in srgb, var(--w-base-bg-color) 20%, transparent);}
|
|
190
201
|
&--outline:active:before,
|
|
191
|
-
&--text:active:before {background-color: currentColor
|
|
202
|
+
&--text:active:before {background-color: color-mix(in srgb, currentColor 20%, transparent);}
|
|
192
203
|
}
|
|
193
204
|
}
|
|
194
205
|
</style>
|
|
@@ -237,7 +237,7 @@ $inactive-color: #777;
|
|
|
237
237
|
display: flex;
|
|
238
238
|
flex-grow: 1;
|
|
239
239
|
flex-wrap: wrap;
|
|
240
|
-
font-size:
|
|
240
|
+
font-size: var(--w-base-font-size);
|
|
241
241
|
|
|
242
242
|
@include themeable;
|
|
243
243
|
|
|
@@ -247,15 +247,15 @@ $inactive-color: #777;
|
|
|
247
247
|
position: relative;
|
|
248
248
|
display: inline-flex;
|
|
249
249
|
flex: 1 1 auto;
|
|
250
|
-
min-height:
|
|
251
|
-
border-radius:
|
|
252
|
-
border:
|
|
253
|
-
transition: border
|
|
250
|
+
min-height: var(--w-form-field-height);
|
|
251
|
+
border-radius: var(--w-border-radius);
|
|
252
|
+
border: var(--w-border);
|
|
253
|
+
transition: border var(--w-transition-duration);
|
|
254
254
|
|
|
255
255
|
.w-textarea[class^="bdrs"] &, .w-textarea[class*=" bdrs"] & {border-radius: inherit;}
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
&--floating-label &__textarea-wrap {margin-top:
|
|
258
|
+
&--floating-label &__textarea-wrap {margin-top: calc(var(--w-base-increment) * 4);}
|
|
259
259
|
|
|
260
260
|
&__textarea-wrap--underline {
|
|
261
261
|
border-bottom-left-radius: initial;
|
|
@@ -264,7 +264,7 @@ $inactive-color: #777;
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
&__textarea-wrap--tile {border-radius: initial;}
|
|
267
|
-
&__textarea-wrap--shadow {box-shadow:
|
|
267
|
+
&__textarea-wrap--shadow {box-shadow: var(--w-box-shadow);}
|
|
268
268
|
|
|
269
269
|
&--focused &__textarea-wrap {border-color: currentColor;}
|
|
270
270
|
|
|
@@ -277,7 +277,7 @@ $inactive-color: #777;
|
|
|
277
277
|
width: 100%;
|
|
278
278
|
height: 0;
|
|
279
279
|
border-bottom: 2px solid currentColor;
|
|
280
|
-
transition:
|
|
280
|
+
transition: var(--w-transition-duration);
|
|
281
281
|
transform: scaleX(0);
|
|
282
282
|
pointer-events: none;
|
|
283
283
|
}
|
|
@@ -290,12 +290,12 @@ $inactive-color: #777;
|
|
|
290
290
|
width: 100%;
|
|
291
291
|
height: 100%;
|
|
292
292
|
font: inherit;
|
|
293
|
-
line-height:
|
|
293
|
+
line-height: var(--w-textarea-line-height);
|
|
294
294
|
color: inherit;
|
|
295
295
|
background: none;
|
|
296
296
|
border: none;
|
|
297
297
|
outline: none;
|
|
298
|
-
padding:
|
|
298
|
+
padding: var(--w-base-increment) calc(var(--w-base-increment) * 2);
|
|
299
299
|
resize: none;
|
|
300
300
|
|
|
301
301
|
.w-textarea--resizable & {resize: vertical;}
|
|
@@ -309,7 +309,7 @@ $inactive-color: #777;
|
|
|
309
309
|
.w-textarea--inner-icon-right & {padding-right: 27px;}
|
|
310
310
|
|
|
311
311
|
.w-textarea--disabled & {
|
|
312
|
-
color:
|
|
312
|
+
color: var(--w-disabled-color);
|
|
313
313
|
cursor: not-allowed;
|
|
314
314
|
-webkit-tap-highlight-color: transparent;
|
|
315
315
|
}
|
|
@@ -319,7 +319,7 @@ $inactive-color: #777;
|
|
|
319
319
|
|
|
320
320
|
// Icons inside.
|
|
321
321
|
// ------------------------------------------------------
|
|
322
|
-
&__icon {position: absolute;margin-top:
|
|
322
|
+
&__icon {position: absolute;margin-top: var(--w-base-increment);}
|
|
323
323
|
&__icon--inner-left {left: 6px;}
|
|
324
324
|
&__icon--inner-right {right: 6px;}
|
|
325
325
|
&--no-padding &__icon--inner-left {left: 1px;}
|
|
@@ -328,7 +328,7 @@ $inactive-color: #777;
|
|
|
328
328
|
.w-textarea--focused &__icon {color: currentColor;}
|
|
329
329
|
|
|
330
330
|
&--disabled &__icon {
|
|
331
|
-
color:
|
|
331
|
+
color: var(--w-disabled-color);
|
|
332
332
|
cursor: not-allowed;
|
|
333
333
|
-webkit-tap-highlight-color: transparent;
|
|
334
334
|
}
|
|
@@ -336,21 +336,21 @@ $inactive-color: #777;
|
|
|
336
336
|
// Label.
|
|
337
337
|
// ------------------------------------------------------
|
|
338
338
|
&__label {
|
|
339
|
-
transition: color
|
|
339
|
+
transition: color var(--w-transition-duration);
|
|
340
340
|
cursor: pointer;
|
|
341
341
|
align-self: flex-start;
|
|
342
342
|
user-select: none;
|
|
343
343
|
|
|
344
344
|
&--left {
|
|
345
|
-
margin-top:
|
|
346
|
-
margin-right:
|
|
345
|
+
margin-top: var(--w-base-increment);
|
|
346
|
+
margin-right: calc(var(--w-base-increment) * 2);
|
|
347
347
|
}
|
|
348
348
|
&--right {
|
|
349
|
-
margin-top:
|
|
350
|
-
margin-left:
|
|
349
|
+
margin-top: var(--w-base-increment);
|
|
350
|
+
margin-left: calc(var(--w-base-increment) * 2);
|
|
351
351
|
}
|
|
352
352
|
.w-textarea--disabled & {
|
|
353
|
-
color:
|
|
353
|
+
color: var(--w-disabled-color);
|
|
354
354
|
cursor: not-allowed;
|
|
355
355
|
-webkit-tap-highlight-color: transparent;
|
|
356
356
|
}
|
|
@@ -362,9 +362,9 @@ $inactive-color: #777;
|
|
|
362
362
|
|
|
363
363
|
&__label--inside {
|
|
364
364
|
position: absolute;
|
|
365
|
-
top:
|
|
365
|
+
top: var(--w-base-increment);
|
|
366
366
|
left: 0;
|
|
367
|
-
padding-left:
|
|
367
|
+
padding-left: calc(var(--w-base-increment) * 2);
|
|
368
368
|
white-space: nowrap;
|
|
369
369
|
transform: translateY(0%);
|
|
370
370
|
pointer-events: none;
|
|
@@ -379,7 +379,7 @@ $inactive-color: #777;
|
|
|
379
379
|
|
|
380
380
|
.w-textarea--floating-label & {
|
|
381
381
|
transform-origin: 0 0;
|
|
382
|
-
transition:
|
|
382
|
+
transition: var(--w-transition-duration) ease;
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
// move label with underline style.
|
|
@@ -43,14 +43,14 @@ export default {
|
|
|
43
43
|
|
|
44
44
|
<style lang="scss">
|
|
45
45
|
.w-timeline {
|
|
46
|
-
margin-left:
|
|
46
|
+
margin-left: var(--w-base-increment);
|
|
47
47
|
|
|
48
48
|
@include themeable;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.w-timeline-item {
|
|
52
|
-
padding-left:
|
|
53
|
-
padding-bottom:
|
|
52
|
+
padding-left: calc(var(--w-base-increment) * 5);
|
|
53
|
+
padding-bottom: calc(var(--w-base-increment) * 3);
|
|
54
54
|
list-style-type: none;
|
|
55
55
|
position: relative;
|
|
56
56
|
|
|
@@ -61,10 +61,10 @@ export default {
|
|
|
61
61
|
position: absolute;
|
|
62
62
|
top: 2px;
|
|
63
63
|
left: 0;
|
|
64
|
-
background-color:
|
|
64
|
+
background-color: var(--w-timeline-bullet-color);
|
|
65
65
|
border-radius: 1em;
|
|
66
66
|
border: 1px solid currentColor;
|
|
67
|
-
width:
|
|
67
|
+
width: var(--w-base-font-size);
|
|
68
68
|
aspect-ratio: 1;
|
|
69
69
|
min-width: 0; // Safari ratio fix (e.g. losing ratio if height is set and side padding are added).
|
|
70
70
|
transform: translateX(-50%);
|
|
@@ -80,7 +80,7 @@ export default {
|
|
|
80
80
|
top: 2px;
|
|
81
81
|
bottom: -2px;
|
|
82
82
|
left: -1px;
|
|
83
|
-
border-left: 2px solid
|
|
83
|
+
border-left: 2px solid var(--w-timeline-bg-color);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
</style>
|
|
@@ -69,8 +69,8 @@ export default {
|
|
|
69
69
|
display: flex;
|
|
70
70
|
flex: 1 1 auto;
|
|
71
71
|
align-items: center;
|
|
72
|
-
padding: (
|
|
73
|
-
background-color:
|
|
72
|
+
padding: calc(var(--w-base-increment) * 2) calc(var(--w-base-increment) * 3);
|
|
73
|
+
background-color: var(--w-toolbar-bg-color);
|
|
74
74
|
z-index: 10;
|
|
75
75
|
|
|
76
76
|
@include themeable;
|
|
@@ -83,30 +83,30 @@ export default {
|
|
|
83
83
|
&--absolute.w-toolbar--right, &--fixed.w-toolbar--right {left: auto;right: 0;}
|
|
84
84
|
|
|
85
85
|
// Horizontal.
|
|
86
|
-
&--top {border-bottom:
|
|
86
|
+
&--top {border-bottom: var(--w-border);}
|
|
87
87
|
&--bottom {
|
|
88
88
|
bottom: 0;
|
|
89
89
|
top: auto;
|
|
90
|
-
border-top:
|
|
90
|
+
border-top: var(--w-border);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// Vertical.
|
|
94
94
|
&--vertical {
|
|
95
|
-
padding: (
|
|
95
|
+
padding: calc(var(--w-base-increment) * 2);
|
|
96
96
|
flex-direction: column;
|
|
97
97
|
flex-grow: 0;
|
|
98
98
|
flex-shrink: 0;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
&--left {border-right:
|
|
101
|
+
&--left {border-right: var(--w-border);}
|
|
102
102
|
&--right {
|
|
103
103
|
right: 0;
|
|
104
104
|
left: auto;
|
|
105
|
-
border-left:
|
|
105
|
+
border-left: var(--w-border);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
&--no-border, &--shadow {border-width: 0;}
|
|
109
|
-
&--shadow {box-shadow:
|
|
109
|
+
&--shadow {box-shadow: var(--w-box-shadow);}
|
|
110
110
|
|
|
111
111
|
.w-app > & {z-index: 200;}
|
|
112
112
|
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
slot(name="activator"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
slot(name="activator")
|
|
3
|
+
slot(v-if="!$slots.activator")
|
|
4
|
+
teleport(:to="teleportTarget" :disabled="!teleportTarget")
|
|
5
|
+
transition(:name="transitionName" appear @after-leave="onAfterLeave")
|
|
6
|
+
.w-tooltip(
|
|
7
|
+
v-if="detachableVisible"
|
|
8
|
+
ref="detachable"
|
|
9
|
+
:key="tooltipInstanceId"
|
|
10
|
+
:class="classes"
|
|
11
|
+
:style="styles")
|
|
12
|
+
template(v-if="tooltip") {{ tooltip }}
|
|
13
|
+
slot(v-else-if="$slots.tooltip" name="tooltip")
|
|
14
|
+
slot(v-else-if="$slots.activator")
|
|
11
15
|
</template>
|
|
12
16
|
|
|
13
17
|
<script>
|
|
@@ -26,6 +30,7 @@ export default {
|
|
|
26
30
|
|
|
27
31
|
props: {
|
|
28
32
|
modelValue: {},
|
|
33
|
+
tooltip: { type: String }, // Simple string content shorthand; use the #tooltip slot for rich content.
|
|
29
34
|
showOnClick: { type: Boolean },
|
|
30
35
|
color: { type: String },
|
|
31
36
|
bgColor: { type: String },
|
|
@@ -239,12 +244,12 @@ export default {
|
|
|
239
244
|
display: table;
|
|
240
245
|
|
|
241
246
|
position: absolute;
|
|
242
|
-
padding:
|
|
243
|
-
border-radius:
|
|
244
|
-
border: 1px solid
|
|
245
|
-
background-color:
|
|
247
|
+
padding: var(--w-base-increment) calc(var(--w-base-increment) * 1.5);
|
|
248
|
+
border-radius: var(--w-border-radius);
|
|
249
|
+
border: 1px solid var(--w-tooltip-border-color);
|
|
250
|
+
background-color: var(--w-tooltip-bg-color);
|
|
246
251
|
pointer-events: none;
|
|
247
|
-
color:
|
|
252
|
+
color: var(--w-tooltip-color);
|
|
248
253
|
align-items: center;
|
|
249
254
|
max-width: 300px;
|
|
250
255
|
width: max-content; // Not supported in IE11. :/
|
|
@@ -257,15 +262,15 @@ export default {
|
|
|
257
262
|
&--tile {border-radius: 0;}
|
|
258
263
|
&--round {
|
|
259
264
|
border-radius: 99em;
|
|
260
|
-
padding:
|
|
265
|
+
padding: var(--w-base-increment) calc(var(--w-base-increment) * 2.5);
|
|
261
266
|
}
|
|
262
|
-
&--shadow {box-shadow:
|
|
267
|
+
&--shadow {box-shadow: var(--w-box-shadow);}
|
|
263
268
|
&--no-border {border: none;}
|
|
264
269
|
|
|
265
|
-
&--top {margin-top: -
|
|
266
|
-
&--bottom {margin-top:
|
|
267
|
-
&--left {margin-left: -
|
|
268
|
-
&--right {margin-left:
|
|
270
|
+
&--top {margin-top: calc(var(--w-base-increment) * -3);}
|
|
271
|
+
&--bottom {margin-top: calc(var(--w-base-increment) * 3);}
|
|
272
|
+
&--left {margin-left: calc(var(--w-base-increment) * -3);}
|
|
273
|
+
&--right {margin-left: calc(var(--w-base-increment) * 3);}
|
|
269
274
|
|
|
270
275
|
&.size--xs {font-size: 0.75rem;}
|
|
271
276
|
&.size--sm {font-size: 0.83rem;}
|
|
@@ -292,30 +297,30 @@ export default {
|
|
|
292
297
|
.w-tooltip-slide-fade-down-enter-active, .w-tooltip-slide-fade-down-leave-active,
|
|
293
298
|
.w-tooltip-slide-fade-left-enter-active, .w-tooltip-slide-fade-left-leave-active,
|
|
294
299
|
.w-tooltip-slide-fade-right-enter-active, .w-tooltip-slide-fade-right-leave-active {
|
|
295
|
-
transition: margin
|
|
300
|
+
transition: margin var(--w-transition-duration) ease-in-out, opacity var(--w-transition-duration) ease-in-out;
|
|
296
301
|
}
|
|
297
302
|
|
|
298
303
|
// slide-fade-up.
|
|
299
304
|
.w-tooltip-slide-fade-up-enter-from, .w-tooltip-slide-fade-up-leave-to {
|
|
300
|
-
margin-top: -
|
|
305
|
+
margin-top: calc(var(--w-base-increment) * -2);
|
|
301
306
|
opacity: 0;
|
|
302
307
|
}
|
|
303
308
|
|
|
304
309
|
// slide-fade-down.
|
|
305
310
|
.w-tooltip-slide-fade-down-enter-from, .w-tooltip-slide-fade-down-leave-to {
|
|
306
|
-
margin-top:
|
|
311
|
+
margin-top: calc(var(--w-base-increment) * 2);
|
|
307
312
|
opacity: 0;
|
|
308
313
|
}
|
|
309
314
|
|
|
310
315
|
// Slide-fade-left.
|
|
311
316
|
.w-tooltip-slide-fade-left-enter-from, .w-tooltip-slide-fade-left-leave-to {
|
|
312
|
-
margin-left: -
|
|
317
|
+
margin-left: calc(var(--w-base-increment) * -2);
|
|
313
318
|
opacity: 0;
|
|
314
319
|
}
|
|
315
320
|
|
|
316
321
|
// Slide-fade-right.
|
|
317
322
|
.w-tooltip-slide-fade-right-enter-from, .w-tooltip-slide-fade-right-leave-to {
|
|
318
|
-
margin-left:
|
|
323
|
+
margin-left: calc(var(--w-base-increment) * 2);
|
|
319
324
|
opacity: 0;
|
|
320
325
|
}
|
|
321
326
|
// --------------------------------------------------------
|