wave-ui 3.28.0 → 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 +15 -1
- package/dist/types/types/colors.d.ts +2 -0
- package/dist/types/types/components/WAccordion.d.ts +92 -6
- package/dist/types/types/components/WAutocomplete.d.ts +437 -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/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/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/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 +2 -1
- package/dist/wave-ui.cjs.js +3 -3
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.esm.js +1711 -1338
- package/dist/wave-ui.umd.js +3 -3
- package/package.json +1 -1
- 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 +10 -5
- package/src/wave-ui/components/w-accordion/item.vue +29 -14
- 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 +7 -9
- package/src/wave-ui/components/w-button/button.vue +21 -23
- package/src/wave-ui/components/w-button/index.vue +4 -4
- 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 +11 -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 +4 -4
- 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 +21 -24
- package/src/wave-ui/components/w-tag.vue +35 -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 +9 -1
- package/src/wave-ui/mixins/detachable.js +98 -43
- package/src/wave-ui/mixins/ripple.js +2 -2
- 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 +2 -2
- package/src/wave-ui/scss/_transitions.scss +19 -19
- package/src/wave-ui/scss/_typography.scss +8 -9
- package/src/wave-ui/scss/variables/_mixins.scss +24 -25
- package/src/wave-ui/scss/variables/_variables.scss +4 -149
- package/src/wave-ui/utils/colors.js +7 -4
- package/src/wave-ui/utils/config.js +3 -4
- package/src/wave-ui/utils/dynamic-css.js +42 -20
- package/src/wave-ui/utils/ripple.js +3 -2
- 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
|
@@ -98,8 +98,6 @@ export default {
|
|
|
98
98
|
</script>
|
|
99
99
|
|
|
100
100
|
<style lang="scss">
|
|
101
|
-
@use "sass:math";
|
|
102
|
-
|
|
103
101
|
.w-icon {
|
|
104
102
|
position: relative;
|
|
105
103
|
display: inline-flex;
|
|
@@ -115,21 +113,21 @@ export default {
|
|
|
115
113
|
// The aspect ratio will not work if the content overflows (needs overflow hidden, but we don't want that in the library).
|
|
116
114
|
height: 1em;
|
|
117
115
|
|
|
118
|
-
&.size--xs {font-size:
|
|
119
|
-
&.size--sm {font-size:
|
|
120
|
-
&.size--md {font-size:
|
|
121
|
-
&.size--lg {font-size:
|
|
122
|
-
&.size--xl {font-size: 2 *
|
|
116
|
+
&.size--xs {font-size: round(nearest, calc(0.85 * var(--w-base-font-size)), 1px);}
|
|
117
|
+
&.size--sm {font-size: round(nearest, calc(1.15 * var(--w-base-font-size)), 1px);}
|
|
118
|
+
&.size--md {font-size: round(nearest, calc(1.4 * var(--w-base-font-size)), 1px);}
|
|
119
|
+
&.size--lg {font-size: round(nearest, calc(1.7 * var(--w-base-font-size)), 1px);}
|
|
120
|
+
&.size--xl {font-size: calc(2 * var(--w-base-font-size));}
|
|
123
121
|
|
|
124
122
|
// Always an even number to align well vertically in a button.
|
|
125
|
-
.w-button.size--xs & {font-size:
|
|
126
|
-
.w-alert.size--xs & {font-size:
|
|
127
|
-
.w-button.size--sm &, .w-alert.size--sm & {font-size:
|
|
128
|
-
// .w-button.size--md &, .w-alert.size--md & {font-size:
|
|
129
|
-
.w-button.size--lg &, .w-alert.size--lg & {font-size:
|
|
130
|
-
.w-button.size--xl &, .w-alert.size--xl & {font-size: 2 *
|
|
123
|
+
.w-button.size--xs & {font-size: calc(2 * round(nearest, calc(0.95 * var(--w-base-font-size) / 2), 1px));}
|
|
124
|
+
.w-alert.size--xs & {font-size: var(--w-base-font-size);}
|
|
125
|
+
.w-button.size--sm &, .w-alert.size--sm & {font-size: round(nearest, calc(1.15 * var(--w-base-font-size)), 1px);}
|
|
126
|
+
// .w-button.size--md &, .w-alert.size--md & {font-size: round(nearest, calc(1.4 * var(--w-base-font-size)), 1px);}
|
|
127
|
+
.w-button.size--lg &, .w-alert.size--lg & {font-size: round(nearest, calc(1.7 * var(--w-base-font-size)), 1px);}
|
|
128
|
+
.w-button.size--xl &, .w-alert.size--xl & {font-size: calc(2 * var(--w-base-font-size));}
|
|
131
129
|
|
|
132
|
-
&:before {transition: transform
|
|
130
|
+
&:before {transition: transform var(--w-transition-duration);}
|
|
133
131
|
&--spin:before {animation: w-icon--spin 2s infinite linear;}
|
|
134
132
|
&--spin-a:before {animation: w-icon--spin-a 2s infinite linear;}
|
|
135
133
|
&--rotate45:before {transform: rotate(45deg);}
|
|
@@ -162,6 +162,12 @@ export default {
|
|
|
162
162
|
round: { type: Boolean },
|
|
163
163
|
shadow: { type: Boolean },
|
|
164
164
|
tile: { type: Boolean },
|
|
165
|
+
// Sizes.
|
|
166
|
+
xs: { type: Boolean },
|
|
167
|
+
sm: { type: Boolean },
|
|
168
|
+
md: { type: Boolean },
|
|
169
|
+
lg: { type: Boolean },
|
|
170
|
+
xl: { type: Boolean },
|
|
165
171
|
multiple: { type: Boolean }, // Only for file uploads.
|
|
166
172
|
preview: { type: [Boolean, String], default: true }, // Only for file uploads.
|
|
167
173
|
loading: { type: [Boolean, Number], default: false }, // If a number is given, it will be the value of the progress.
|
|
@@ -251,6 +257,10 @@ export default {
|
|
|
251
257
|
return this.overallFilesProgress === 100
|
|
252
258
|
},
|
|
253
259
|
|
|
260
|
+
presetSize () {
|
|
261
|
+
return (this.xs && 'xs') || (this.sm && 'sm') || (this.md && 'md') || (this.lg && 'lg') || (this.xl && 'xl') || null
|
|
262
|
+
},
|
|
263
|
+
|
|
254
264
|
classes () {
|
|
255
265
|
return {
|
|
256
266
|
'w-input': true,
|
|
@@ -266,6 +276,7 @@ export default {
|
|
|
266
276
|
'w-input--has-placeholder': this.placeholder,
|
|
267
277
|
'w-input--inner-icon-left': this.innerIconLeft,
|
|
268
278
|
'w-input--inner-icon-right': this.innerIconRight,
|
|
279
|
+
[`size--${this.presetSize}`]: !!this.presetSize,
|
|
269
280
|
// With the inheritAttrs set to false any class on the component would be lost, so add it back.
|
|
270
281
|
[this.$attrs.class]: !!this.$attrs.class
|
|
271
282
|
}
|
|
@@ -391,7 +402,7 @@ $inactive-color: #777;
|
|
|
391
402
|
flex-grow: 1;
|
|
392
403
|
flex-wrap: wrap;
|
|
393
404
|
align-items: center;
|
|
394
|
-
font-size:
|
|
405
|
+
font-size: var(--w-base-font-size);
|
|
395
406
|
|
|
396
407
|
&--file {
|
|
397
408
|
flex-wrap: nowrap;
|
|
@@ -409,13 +420,13 @@ $inactive-color: #777;
|
|
|
409
420
|
display: inline-flex;
|
|
410
421
|
flex: 1 1 auto;
|
|
411
422
|
align-items: center;
|
|
412
|
-
height:
|
|
413
|
-
border-radius:
|
|
414
|
-
border:
|
|
415
|
-
transition: border
|
|
423
|
+
height: var(--w-size, var(--w-form-field-height));
|
|
424
|
+
border-radius: var(--w-border-radius);
|
|
425
|
+
border: var(--w-border);
|
|
426
|
+
transition: border var(--w-transition-duration);
|
|
416
427
|
|
|
417
428
|
.w-input.h-auto & {height: auto;}
|
|
418
|
-
.w-input--floating-label & {margin-top:
|
|
429
|
+
.w-input--floating-label & {margin-top: calc(var(--w-base-increment) * 3);}
|
|
419
430
|
.w-input[class^="bdrs"] &, .w-input[class*=" bdrs"] & {border-radius: inherit;}
|
|
420
431
|
|
|
421
432
|
// https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size
|
|
@@ -429,7 +440,7 @@ $inactive-color: #777;
|
|
|
429
440
|
|
|
430
441
|
&--round {border-radius: 99em;}
|
|
431
442
|
&--tile {border-radius: initial;}
|
|
432
|
-
&--shadow {box-shadow:
|
|
443
|
+
&--shadow {box-shadow: var(--w-box-shadow);}
|
|
433
444
|
&--loading, &--upload-complete {
|
|
434
445
|
border-bottom-color: transparent;
|
|
435
446
|
flex-wrap: wrap;
|
|
@@ -454,7 +465,7 @@ $inactive-color: #777;
|
|
|
454
465
|
width: 100%;
|
|
455
466
|
height: 0;
|
|
456
467
|
border-bottom: 2px solid currentColor;
|
|
457
|
-
transition:
|
|
468
|
+
transition: var(--w-transition-duration);
|
|
458
469
|
transform: scaleX(0);
|
|
459
470
|
pointer-events: none;
|
|
460
471
|
}
|
|
@@ -464,11 +475,11 @@ $inactive-color: #777;
|
|
|
464
475
|
.w-input--focused &--underline:after {transform: scaleX(1);}
|
|
465
476
|
&--round.w-input__input-wrap--underline:after {
|
|
466
477
|
border-radius: 99em;
|
|
467
|
-
transition:
|
|
478
|
+
transition: var(--w-transition-duration), height 0.035s;
|
|
468
479
|
}
|
|
469
480
|
.w-input--focused &--round.w-input__input-wrap--underline:after {
|
|
470
481
|
height: 100%;
|
|
471
|
-
transition:
|
|
482
|
+
transition: var(--w-transition-duration), height 0s calc(var(--w-transition-duration) - 0.035s);
|
|
472
483
|
}
|
|
473
484
|
}
|
|
474
485
|
|
|
@@ -486,8 +497,8 @@ $inactive-color: #777;
|
|
|
486
497
|
border: none;
|
|
487
498
|
border-radius: inherit; // Mostly for the browser-autofilled appearance.
|
|
488
499
|
outline: none;
|
|
489
|
-
padding-left:
|
|
490
|
-
padding-right:
|
|
500
|
+
padding-left: calc(var(--w-base-increment) * 2);
|
|
501
|
+
padding-right: calc(var(--w-base-increment) * 2);
|
|
491
502
|
|
|
492
503
|
// For type="search" on Safari.
|
|
493
504
|
-webkit-appearance: none;
|
|
@@ -500,15 +511,15 @@ $inactive-color: #777;
|
|
|
500
511
|
}
|
|
501
512
|
|
|
502
513
|
&__input-wrap--round &__input {
|
|
503
|
-
padding-left:
|
|
504
|
-
padding-right:
|
|
514
|
+
padding-left: calc(var(--w-base-increment) * 3);
|
|
515
|
+
padding-right: calc(var(--w-base-increment) * 3);
|
|
505
516
|
}
|
|
506
517
|
|
|
507
518
|
&--inner-icon-left &__input {padding-left: 27px;}
|
|
508
519
|
&--inner-icon-right &__input {padding-right: 27px;}
|
|
509
520
|
|
|
510
521
|
&--disabled &__input {
|
|
511
|
-
color:
|
|
522
|
+
color: var(--w-disabled-color);
|
|
512
523
|
cursor: not-allowed;
|
|
513
524
|
-webkit-tap-highlight-color: transparent;
|
|
514
525
|
}
|
|
@@ -548,7 +559,7 @@ $inactive-color: #777;
|
|
|
548
559
|
left: 0;
|
|
549
560
|
display: flex;
|
|
550
561
|
align-items: center;
|
|
551
|
-
color:
|
|
562
|
+
color: var(--w-disabled-color);
|
|
552
563
|
}
|
|
553
564
|
|
|
554
565
|
&__file-preview {
|
|
@@ -570,7 +581,7 @@ $inactive-color: #777;
|
|
|
570
581
|
.w-input--focused &__icon {color: currentColor;}
|
|
571
582
|
|
|
572
583
|
&--disabled &__icon {
|
|
573
|
-
color:
|
|
584
|
+
color: var(--w-disabled-color);
|
|
574
585
|
cursor: not-allowed;
|
|
575
586
|
-webkit-tap-highlight-color: transparent;
|
|
576
587
|
}
|
|
@@ -578,15 +589,15 @@ $inactive-color: #777;
|
|
|
578
589
|
// Label.
|
|
579
590
|
// ------------------------------------------------------
|
|
580
591
|
&__label {
|
|
581
|
-
transition: color
|
|
592
|
+
transition: color var(--w-transition-duration);
|
|
582
593
|
cursor: pointer;
|
|
583
594
|
user-select: none;
|
|
584
595
|
|
|
585
|
-
&--left {margin-right:
|
|
586
|
-
&--right {margin-left:
|
|
596
|
+
&--left {margin-right: calc(var(--w-base-increment) * 2);}
|
|
597
|
+
&--right {margin-left: calc(var(--w-base-increment) * 2);}
|
|
587
598
|
|
|
588
599
|
.w-input--disabled & {
|
|
589
|
-
color:
|
|
600
|
+
color: var(--w-disabled-color);
|
|
590
601
|
cursor: not-allowed;
|
|
591
602
|
-webkit-tap-highlight-color: transparent;
|
|
592
603
|
}
|
|
@@ -600,7 +611,7 @@ $inactive-color: #777;
|
|
|
600
611
|
position: absolute;
|
|
601
612
|
top: 50%;
|
|
602
613
|
left: 0;
|
|
603
|
-
padding-left:
|
|
614
|
+
padding-left: calc(var(--w-base-increment) * 2);
|
|
604
615
|
white-space: nowrap;
|
|
605
616
|
transform: translateY(-50%);
|
|
606
617
|
pointer-events: none;
|
|
@@ -611,15 +622,15 @@ $inactive-color: #777;
|
|
|
611
622
|
padding-right: 0;
|
|
612
623
|
}
|
|
613
624
|
.w-input__input-wrap--round & {
|
|
614
|
-
padding-left:
|
|
615
|
-
padding-right:
|
|
625
|
+
padding-left: calc(var(--w-base-increment) * 3);
|
|
626
|
+
padding-right: calc(var(--w-base-increment) * 3);
|
|
616
627
|
}
|
|
617
628
|
.w-input--inner-icon-left & {left: 18px;}
|
|
618
629
|
.w-input--no-padding.w-input--inner-icon-left & {left: 26px;}
|
|
619
630
|
|
|
620
631
|
.w-input--floating-label & {
|
|
621
632
|
transform-origin: 0 0;
|
|
622
|
-
transition:
|
|
633
|
+
transition: var(--w-transition-duration) ease;
|
|
623
634
|
will-change: transform;
|
|
624
635
|
}
|
|
625
636
|
|
|
@@ -644,5 +655,12 @@ $inactive-color: #777;
|
|
|
644
655
|
// Chrome & Safari - Must remain in a separated rule as Firefox discard the whole rule seeing -webkit-.
|
|
645
656
|
.w-input--floating-label.w-input--inner-icon-left .w-input__input:-webkit-autofill & {left: 0;}
|
|
646
657
|
}
|
|
658
|
+
|
|
659
|
+
// Sizes.
|
|
660
|
+
// ------------------------------------------------------
|
|
661
|
+
&.size--xs {--w-size: round(nearest, calc(1.43 * var(--w-base-font-size)), 1px);}
|
|
662
|
+
&.size--sm {--w-size: round(nearest, calc(1.71 * var(--w-base-font-size)), 1px);}
|
|
663
|
+
&.size--lg {--w-size: round(nearest, calc(2.29 * var(--w-base-font-size)), 1px);}
|
|
664
|
+
&.size--xl {--w-size: round(nearest, calc(2.71 * var(--w-base-font-size)), 1px);}
|
|
647
665
|
}
|
|
648
666
|
</style>
|
|
@@ -409,10 +409,10 @@ export default {
|
|
|
409
409
|
.w-list {
|
|
410
410
|
list-style-type: none;
|
|
411
411
|
margin-left: 0;
|
|
412
|
-
font-size:
|
|
412
|
+
font-size: var(--w-base-font-size);
|
|
413
413
|
|
|
414
|
-
&--child {margin-left:
|
|
415
|
-
&--icon {padding-left:
|
|
414
|
+
&--child {margin-left: calc(var(--w-base-increment) * 6);}
|
|
415
|
+
&--icon {padding-left: calc(var(--w-base-increment) * 8);}
|
|
416
416
|
|
|
417
417
|
&__item {margin-top: 1px;}
|
|
418
418
|
&__item:first-child {margin-top: 0;}
|
|
@@ -428,7 +428,7 @@ export default {
|
|
|
428
428
|
&__item-bullet {
|
|
429
429
|
position: absolute;
|
|
430
430
|
right: 100%;
|
|
431
|
-
margin-right:
|
|
431
|
+
margin-right: calc(var(--w-base-increment) * 3);
|
|
432
432
|
top: 0.1em;
|
|
433
433
|
|
|
434
434
|
@-moz-document url-prefix() {
|
|
@@ -437,7 +437,7 @@ export default {
|
|
|
437
437
|
|
|
438
438
|
.w-list--hoverable &,
|
|
439
439
|
.w-list--selectable &,
|
|
440
|
-
.w-list--checklist & {margin-top:
|
|
440
|
+
.w-list--checklist & {margin-top: calc(var(--w-base-increment) * 3);}
|
|
441
441
|
}
|
|
442
442
|
|
|
443
443
|
// List item Label.
|
|
@@ -463,15 +463,14 @@ export default {
|
|
|
463
463
|
|
|
464
464
|
&--hoverable,
|
|
465
465
|
&--selectable {
|
|
466
|
-
padding:
|
|
466
|
+
padding: calc(var(--w-base-increment) * 2);
|
|
467
467
|
|
|
468
468
|
&:before {
|
|
469
469
|
content: '';
|
|
470
470
|
position: absolute;
|
|
471
471
|
inset: 0;
|
|
472
|
-
background-color:
|
|
473
|
-
|
|
474
|
-
transition: 0.2s;
|
|
472
|
+
background-color: transparent;
|
|
473
|
+
transition: background-color 0.2s;
|
|
475
474
|
pointer-events: none;
|
|
476
475
|
}
|
|
477
476
|
}
|
|
@@ -480,17 +479,17 @@ export default {
|
|
|
480
479
|
&--hoverable:hover:before,
|
|
481
480
|
&--selectable:focus:before,
|
|
482
481
|
&--focused:before,
|
|
483
|
-
&--selectable:hover:before {
|
|
482
|
+
&--selectable:hover:before {background-color: color-mix(in srgb, currentColor 8%, transparent);}
|
|
484
483
|
|
|
485
484
|
// Active class (when item is selected).
|
|
486
485
|
&--active:before, &--active:focus:before, &--active:hover:before,
|
|
487
|
-
.w-list--navigation &.router-link-exact-active:before {
|
|
486
|
+
.w-list--navigation &.router-link-exact-active:before {background-color: color-mix(in srgb, currentColor 15%, transparent);}
|
|
488
487
|
|
|
489
488
|
// Active state (while pressing key or mouse).
|
|
490
489
|
&--active.w-list__item-label--hoverable:hover:before,
|
|
491
490
|
&--active.w-list__item-label--selectable:focus:before,
|
|
492
491
|
&--active.w-list__item-label--selectable:hover:before,
|
|
493
|
-
&--selectable:active:before {
|
|
492
|
+
&--selectable:active:before {background-color: color-mix(in srgb, currentColor 20%, transparent);}
|
|
494
493
|
|
|
495
494
|
// Disabled.
|
|
496
495
|
&--disabled:before {display: none;}
|
|
@@ -1,44 +1,48 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
slot(name="activator"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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-menu(
|
|
7
|
+
v-if="custom && detachableVisible"
|
|
8
|
+
ref="detachable"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
@click="hideOnMenuClick && close(true)"
|
|
11
|
+
@mouseenter="showOnHover && (hoveringMenu = true)"
|
|
12
|
+
@mouseleave="showOnHover && ((hoveringMenu = false), close())"
|
|
13
|
+
:class="classes"
|
|
14
|
+
:style="styles")
|
|
15
|
+
slot(v-if="$slots.activator")
|
|
16
|
+
slot(v-else name="content")
|
|
17
|
+
w-card.w-menu(
|
|
18
|
+
v-else-if="detachableVisible"
|
|
19
|
+
ref="detachable"
|
|
20
|
+
v-bind="$attrs"
|
|
21
|
+
@click.native="hideOnMenuClick && close(true)"
|
|
22
|
+
@mouseenter.native="showOnHover && (hoveringMenu = true)"
|
|
23
|
+
@mouseleave.native="showOnHover && ((hoveringMenu = false), close())"
|
|
24
|
+
:tile="tile"
|
|
25
|
+
:title-class="titleClasses"
|
|
26
|
+
:content-class="contentClasses"
|
|
27
|
+
:shadow="shadow"
|
|
28
|
+
:no-border="noBorder"
|
|
29
|
+
:class="classes"
|
|
30
|
+
:style="styles")
|
|
31
|
+
template(v-if="$slots.title" #title)
|
|
32
|
+
slot(name="title")
|
|
33
|
+
template(v-if="$slots.actions" #actions)
|
|
34
|
+
slot(name="actions")
|
|
35
|
+
slot(v-if="$slots.activator")
|
|
36
|
+
slot(v-else name="content")
|
|
37
|
+
w-overlay(
|
|
38
|
+
v-if="overlay"
|
|
39
|
+
ref="overlay"
|
|
40
|
+
:model-value="detachableVisible"
|
|
41
|
+
:persistent="persistent"
|
|
42
|
+
:class="overlayClasses"
|
|
43
|
+
v-bind="overlayProps"
|
|
44
|
+
:z-index="(zIndex || 200) - 1"
|
|
45
|
+
@update:model-value="detachableVisible = false")
|
|
42
46
|
</template>
|
|
43
47
|
|
|
44
48
|
<script>
|
|
@@ -175,7 +179,7 @@ export default {
|
|
|
175
179
|
minWidth: (this.minWidth && this.menuMinWidth) || null,
|
|
176
180
|
maxWidth: (this.maxWidth && this.menuMaxWidth) || null,
|
|
177
181
|
visibility: this.detachableReady ? null : 'hidden', // Hidden until coords are ready.
|
|
178
|
-
'--w-menu-bg-color': this.arrow
|
|
182
|
+
'--w-menu-bg-color': this.arrow ? (this.$waveui.colors[this.bgColor] || 'var(--w-base-bg-color)') : null
|
|
179
183
|
}
|
|
180
184
|
},
|
|
181
185
|
|
|
@@ -291,36 +295,34 @@ export default {
|
|
|
291
295
|
</script>
|
|
292
296
|
|
|
293
297
|
<style lang="scss">
|
|
294
|
-
@use "sass:math";
|
|
295
|
-
|
|
296
298
|
.w-menu-wrap {display: none;}
|
|
297
299
|
|
|
298
300
|
.w-menu {
|
|
299
301
|
position: absolute;
|
|
300
302
|
z-index: 100;
|
|
301
|
-
color:
|
|
303
|
+
color: var(--w-menu-color);
|
|
302
304
|
|
|
303
305
|
@include themeable;
|
|
304
306
|
|
|
305
307
|
&--fixed {position: fixed;z-index: 1000;}
|
|
306
|
-
&--card {background-color:
|
|
308
|
+
&--card {background-color: var(--w-menu-bg-color);}
|
|
307
309
|
&--tile {border-radius: 0;}
|
|
308
310
|
&--round {
|
|
309
311
|
border-radius: 99em;
|
|
310
|
-
padding:
|
|
312
|
+
padding: var(--w-base-increment) calc(var(--w-base-increment) * 2.5);
|
|
311
313
|
}
|
|
312
|
-
&--shadow {box-shadow:
|
|
314
|
+
&--shadow {box-shadow: var(--w-box-shadow);}
|
|
313
315
|
|
|
314
|
-
&--top {margin-top: -
|
|
315
|
-
&--bottom {margin-top:
|
|
316
|
-
&--left {margin-left: -
|
|
317
|
-
&--right {margin-left:
|
|
316
|
+
&--top {margin-top: calc(var(--w-base-increment) * -3);}
|
|
317
|
+
&--bottom {margin-top: calc(var(--w-base-increment) * 3);}
|
|
318
|
+
&--left {margin-left: calc(var(--w-base-increment) * -3);}
|
|
319
|
+
&--right {margin-left: calc(var(--w-base-increment) * 3);}
|
|
318
320
|
|
|
319
321
|
&--arrow {
|
|
320
|
-
&.w-menu--top {margin-top: -
|
|
321
|
-
&.w-menu--bottom {margin-top:
|
|
322
|
-
&.w-menu--left {margin-left: -
|
|
323
|
-
&.w-menu--right {margin-left:
|
|
322
|
+
&.w-menu--top {margin-top: calc(var(--w-base-increment) * -4);}
|
|
323
|
+
&.w-menu--bottom {margin-top: calc(var(--w-base-increment) * 4);}
|
|
324
|
+
&.w-menu--left {margin-left: calc(var(--w-base-increment) * -4);}
|
|
325
|
+
&.w-menu--right {margin-left: calc(var(--w-base-increment) * 4);}
|
|
324
326
|
|
|
325
327
|
// Menu without border.
|
|
326
328
|
&.w-menu--no-border {
|
|
@@ -168,8 +168,8 @@ export default {
|
|
|
168
168
|
.w-notification {
|
|
169
169
|
display: flex;
|
|
170
170
|
justify-content: center;
|
|
171
|
-
left:
|
|
172
|
-
right:
|
|
171
|
+
left: calc(var(--w-base-increment) * 2);
|
|
172
|
+
right: calc(var(--w-base-increment) * 2);
|
|
173
173
|
position: fixed;
|
|
174
174
|
z-index: 300;
|
|
175
175
|
pointer-events: none;
|
|
@@ -178,8 +178,8 @@ export default {
|
|
|
178
178
|
|
|
179
179
|
// Position.
|
|
180
180
|
&--absolute {position: absolute;z-index: 400;}
|
|
181
|
-
&--top {top: 0;padding-top:
|
|
182
|
-
&--bottom {bottom: 0;padding-bottom:
|
|
181
|
+
&--top {top: 0;padding-top: calc(var(--w-base-increment) * 2);}
|
|
182
|
+
&--bottom {bottom: 0;padding-bottom: calc(var(--w-base-increment) * 2);}
|
|
183
183
|
&--left {justify-content: flex-start;right: auto;}
|
|
184
184
|
&--right {justify-content: flex-end;left: auto;}
|
|
185
185
|
|
|
@@ -135,11 +135,11 @@ $circle-size: 40;
|
|
|
135
135
|
&--top {top: 0;}
|
|
136
136
|
&--bottom {bottom: 0;}
|
|
137
137
|
|
|
138
|
-
&--shadow {box-shadow:
|
|
138
|
+
&--shadow {box-shadow: var(--w-box-shadow);}
|
|
139
139
|
|
|
140
140
|
// Linear progress.
|
|
141
141
|
// ------------------------------------------------------
|
|
142
|
-
&--linear {border-radius:
|
|
142
|
+
&--linear {border-radius: var(--w-border-radius);}
|
|
143
143
|
// Tile, round and outline are only available on linear progress.
|
|
144
144
|
&--tile {border-radius: 0;}
|
|
145
145
|
&--round {border-radius: 99em;}
|
|
@@ -147,7 +147,7 @@ $circle-size: 40;
|
|
|
147
147
|
|
|
148
148
|
&--linear {
|
|
149
149
|
display: flex;
|
|
150
|
-
height:
|
|
150
|
+
height: var(--w-base-increment);
|
|
151
151
|
overflow: hidden;
|
|
152
152
|
|
|
153
153
|
// Background.
|
|
@@ -156,8 +156,7 @@ $circle-size: 40;
|
|
|
156
156
|
position: absolute;
|
|
157
157
|
inset: 0;
|
|
158
158
|
border-radius: inherit;
|
|
159
|
-
background-color: currentColor;
|
|
160
|
-
opacity: 0.15;
|
|
159
|
+
background-color: color-mix(in srgb, currentColor 15%, transparent);
|
|
161
160
|
}
|
|
162
161
|
&.w-progress--outline:after {display: none;}
|
|
163
162
|
|
|
@@ -242,11 +241,11 @@ $circle-size: 40;
|
|
|
242
241
|
display: inline-flex;
|
|
243
242
|
width: 3em;
|
|
244
243
|
aspect-ratio: 1;
|
|
245
|
-
font-size:
|
|
244
|
+
font-size: var(--w-base-font-size);
|
|
246
245
|
|
|
247
246
|
svg {display: block;width: 100%;}
|
|
248
247
|
circle.bg {stroke: currentColor;}
|
|
249
|
-
&.w-progress--default-bg circle.bg {stroke:
|
|
248
|
+
&.w-progress--default-bg circle.bg {stroke: var(--w-progress-bg-color);}
|
|
250
249
|
|
|
251
250
|
.w-progress__progress {
|
|
252
251
|
transform-origin: 100% 100%;
|
|
@@ -69,6 +69,12 @@ export default {
|
|
|
69
69
|
color: { type: String, default: 'primary' },
|
|
70
70
|
labelColor: { type: String, default: 'primary' },
|
|
71
71
|
noRipple: { type: Boolean },
|
|
72
|
+
// Sizes.
|
|
73
|
+
xs: { type: Boolean },
|
|
74
|
+
sm: { type: Boolean },
|
|
75
|
+
md: { type: Boolean },
|
|
76
|
+
lg: { type: Boolean },
|
|
77
|
+
xl: { type: Boolean },
|
|
72
78
|
dark: { type: Boolean },
|
|
73
79
|
light: { type: Boolean }
|
|
74
80
|
// Props from mixin: id, name, disabled, readonly, required, tabindex, validators.
|
|
@@ -90,6 +96,10 @@ export default {
|
|
|
90
96
|
hasLabel () {
|
|
91
97
|
return this.label || this.$slots.default
|
|
92
98
|
},
|
|
99
|
+
presetSize () {
|
|
100
|
+
return (this.xs && 'xs') || (this.sm && 'sm') || (this.md && 'md') || (this.lg && 'lg') || (this.xl && 'xl') || null
|
|
101
|
+
},
|
|
102
|
+
|
|
93
103
|
classes () {
|
|
94
104
|
return {
|
|
95
105
|
[`w-radio w-radio--${this.inputValue ? 'checked' : 'unchecked'}`]: true,
|
|
@@ -98,7 +108,8 @@ export default {
|
|
|
98
108
|
'w-radio--ripple': this.ripple.start,
|
|
99
109
|
'w-radio--rippled': this.ripple.end,
|
|
100
110
|
'w-radio--dark': this.ripple.dark,
|
|
101
|
-
'w-radio--light': this.ripple.light
|
|
111
|
+
'w-radio--light': this.ripple.light,
|
|
112
|
+
[`size--${this.presetSize}`]: !!this.presetSize
|
|
102
113
|
}
|
|
103
114
|
}
|
|
104
115
|
},
|
|
@@ -148,6 +159,8 @@ $outline-width: 2px;
|
|
|
148
159
|
$inactive-color: #666;
|
|
149
160
|
|
|
150
161
|
.w-radio {
|
|
162
|
+
// --_size resolves --w-size if set (e.g. via size class or inline style), otherwise the global default.
|
|
163
|
+
--_size: var(--w-size, var(--w-small-form-el-size));
|
|
151
164
|
display: inline-flex;
|
|
152
165
|
align-items: center;
|
|
153
166
|
vertical-align: middle;
|
|
@@ -175,7 +188,7 @@ $inactive-color: #666;
|
|
|
175
188
|
&__input {
|
|
176
189
|
position: relative;
|
|
177
190
|
border-radius: 100%;
|
|
178
|
-
width:
|
|
191
|
+
width: var(--_size);
|
|
179
192
|
aspect-ratio: 1;
|
|
180
193
|
display: flex;
|
|
181
194
|
flex: 0 0 auto; // Prevent stretching width or height.
|
|
@@ -185,11 +198,11 @@ $inactive-color: #666;
|
|
|
185
198
|
transition: 0.3s ease-in-out;
|
|
186
199
|
cursor: inherit;
|
|
187
200
|
|
|
188
|
-
.w-radio--disabled & {border-color:
|
|
201
|
+
.w-radio--disabled & {border-color: var(--w-disabled-color);}
|
|
189
202
|
|
|
190
203
|
// Checked state.
|
|
191
204
|
:checked ~ & {border-color: currentColor;}
|
|
192
|
-
.w-radio--disabled :checked ~ & {border-color:
|
|
205
|
+
.w-radio--disabled :checked ~ & {border-color: var(--w-disabled-color);}
|
|
193
206
|
}
|
|
194
207
|
|
|
195
208
|
// The inner bullet - visible when checked.
|
|
@@ -200,7 +213,7 @@ $inactive-color: #666;
|
|
|
200
213
|
border: 0 solid $inactive-color;
|
|
201
214
|
// Prevents a tiny hole while animating and in some browser zoom levels.
|
|
202
215
|
background-color: $inactive-color;
|
|
203
|
-
transition:
|
|
216
|
+
transition: var(--w-transition-duration);
|
|
204
217
|
|
|
205
218
|
:checked ~ & {
|
|
206
219
|
border-width: 4px;
|
|
@@ -209,9 +222,9 @@ $inactive-color: #666;
|
|
|
209
222
|
background-color: currentColor;
|
|
210
223
|
}
|
|
211
224
|
.w-radio--disabled & {
|
|
212
|
-
border-color:
|
|
225
|
+
border-color: var(--w-disabled-color);
|
|
213
226
|
// Prevents a tiny hole while animating and in some browser zoom levels.
|
|
214
|
-
background-color:
|
|
227
|
+
background-color: var(--w-disabled-color);
|
|
215
228
|
}
|
|
216
229
|
}
|
|
217
230
|
|
|
@@ -256,6 +269,18 @@ $inactive-color: #666;
|
|
|
256
269
|
|
|
257
270
|
.w-radio--disabled & {opacity: 0.7;}
|
|
258
271
|
}
|
|
272
|
+
|
|
273
|
+
// Sizes.
|
|
274
|
+
// ------------------------------------------------------
|
|
275
|
+
&.size--xs {--w-size: round(nearest, calc(0.86 * var(--w-base-font-size)), 2px);}
|
|
276
|
+
&.size--xs &__input {border-width: 1px;}
|
|
277
|
+
&.size--xs :checked ~ &__input:after {border-width: 3px;}
|
|
278
|
+
&.size--sm {--w-size: round(nearest, calc(1.14 * var(--w-base-font-size)), 2px);}
|
|
279
|
+
&.size--sm :checked ~ &__input:after {border-width: 3px;}
|
|
280
|
+
&.size--lg {--w-size: round(nearest, calc(1.43 * var(--w-base-font-size)), 2px);}
|
|
281
|
+
&.size--lg :checked ~ &__input:after {border-width: 5px;}
|
|
282
|
+
&.size--xl {--w-size: round(nearest, calc(1.71 * var(--w-base-font-size)), 2px);}
|
|
283
|
+
&.size--xl :checked ~ &__input:after {border-width: 6px;}
|
|
259
284
|
}
|
|
260
285
|
|
|
261
286
|
@keyframes w-radio-ripple {
|