wave-ui 2.48.0 → 3.0.1
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 +1746 -1535
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +4 -3
- package/src/wave-ui/components/index.js +1 -0
- package/src/wave-ui/components/w-accordion.vue +8 -2
- package/src/wave-ui/components/w-alert.vue +10 -4
- package/src/wave-ui/components/w-app.vue +2 -107
- package/src/wave-ui/components/w-badge.vue +7 -3
- package/src/wave-ui/components/w-button/button.vue +6 -2
- package/src/wave-ui/components/w-card.vue +14 -4
- package/src/wave-ui/components/w-checkbox.vue +15 -8
- package/src/wave-ui/components/w-confirm.vue +5 -1
- package/src/wave-ui/components/w-date-picker.vue +6 -0
- package/src/wave-ui/components/w-dialog.vue +9 -3
- package/src/wave-ui/components/w-divider.vue +9 -3
- package/src/wave-ui/components/w-drawer.vue +9 -3
- package/src/wave-ui/components/w-input.vue +4 -2
- package/src/wave-ui/components/w-menu.vue +11 -4
- package/src/wave-ui/components/w-notification-manager.vue +18 -30
- package/src/wave-ui/components/w-notification.vue +7 -1
- package/src/wave-ui/components/w-progress.vue +2 -2
- package/src/wave-ui/components/w-radio.vue +8 -2
- package/src/wave-ui/components/w-rating.vue +11 -3
- package/src/wave-ui/components/w-scrollbar.vue +24 -0
- package/src/wave-ui/components/w-select.vue +9 -5
- package/src/wave-ui/components/w-slider.vue +13 -7
- package/src/wave-ui/components/w-steps.vue +14 -4
- package/src/wave-ui/components/w-switch.vue +14 -14
- package/src/wave-ui/components/w-table.vue +25 -11
- package/src/wave-ui/components/w-tabs/index.vue +8 -2
- package/src/wave-ui/components/w-tag.vue +15 -10
- package/src/wave-ui/components/w-textarea.vue +6 -2
- package/src/wave-ui/components/w-timeline.vue +18 -5
- package/src/wave-ui/components/w-toolbar.vue +8 -2
- package/src/wave-ui/components/w-tooltip.vue +10 -4
- package/src/wave-ui/components/w-tree.vue +47 -15
- package/src/wave-ui/core.js +120 -91
- package/src/wave-ui/scss/_base.scss +53 -2
- package/src/wave-ui/scss/_colors.scss +41 -17
- package/src/wave-ui/scss/_layout.scss +5 -12
- package/src/wave-ui/scss/_mixins.scss +24 -0
- package/src/wave-ui/scss/_variables.scss +100 -11
- package/src/wave-ui/utils/colors.js +60 -3
- package/src/wave-ui/utils/config.js +35 -11
- package/src/wave-ui/utils/dynamic-css.js +92 -30
- package/src/wave-ui/utils/notification-manager.js +39 -8
|
@@ -1,10 +1,61 @@
|
|
|
1
|
-
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
// The CSS variables are used in the dynamic-css.js file in order to reuse the same SCSS
|
|
4
|
+
// variable presets.
|
|
5
|
+
:root {
|
|
6
|
+
--w-base-increment: #{$base-increment};
|
|
7
|
+
--w-css-scope: #{$css-scope};
|
|
8
|
+
|
|
9
|
+
background-color: rgb(var(--w-base-bg-color-rgb));
|
|
10
|
+
color: rgb(var(--w-base-color-rgb));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:root[data-theme="light"] {
|
|
14
|
+
--w-base-bg-color-rgb: #{map.get($theme-light, 'base-bg-color-rgb')};
|
|
15
|
+
--w-base-color-rgb: #{map.get($theme-light, 'base-color-rgb')};
|
|
16
|
+
--w-contrast-bg-color-rgb: #{map.get($theme-light, 'contrast-bg-color-rgb')};
|
|
17
|
+
--w-contrast-color-rgb: #{map.get($theme-light, 'contrast-color-rgb')};
|
|
18
|
+
--w-disabled-color-rgb: #{map.get($theme-light, 'disabled-color-rgb')};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:root[data-theme="dark"] {
|
|
22
|
+
--w-base-bg-color-rgb: #{map.get($theme-dark, 'base-bg-color-rgb')};
|
|
23
|
+
--w-base-color-rgb: #{map.get($theme-dark, 'base-color-rgb')};
|
|
24
|
+
--w-contrast-bg-color-rgb: #{map.get($theme-dark, 'contrast-bg-color-rgb')};
|
|
25
|
+
--w-contrast-color-rgb: #{map.get($theme-dark, 'contrast-color-rgb')};
|
|
26
|
+
--w-disabled-color-rgb: #{map.get($theme-dark, 'disabled-color-rgb')};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
* {
|
|
30
|
+
outline: none;
|
|
31
|
+
margin: 0;
|
|
32
|
+
padding: 0;
|
|
33
|
+
}
|
|
2
34
|
|
|
3
35
|
body {overflow-x: hidden;}
|
|
4
36
|
|
|
5
37
|
a {text-decoration: none;}
|
|
6
38
|
|
|
7
|
-
.w-app
|
|
39
|
+
.w-app {
|
|
40
|
+
position: relative; // Make the .w-app a referential for tooltips / menus.
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
min-height: 100vh;
|
|
44
|
+
|
|
45
|
+
&, *, :before, :after {box-sizing: border-box;}
|
|
46
|
+
|
|
47
|
+
&.row {flex-direction: row;}
|
|
48
|
+
&.d-block {display: block;}
|
|
49
|
+
&.align-center {align-items: center;}
|
|
50
|
+
&.align-end {align-items: flex-end;}
|
|
51
|
+
&.justify-center {justify-content: center;}
|
|
52
|
+
&.justify-end {justify-content: flex-end;}
|
|
53
|
+
&.justify-space-between {justify-content: space-between;}
|
|
54
|
+
&.justify-space-around {justify-content: space-around;}
|
|
55
|
+
&.justify-space-evenly {justify-content: space-evenly;}
|
|
56
|
+
&.text-center {text-align: center;}
|
|
57
|
+
&.text-right {text-align: right;}
|
|
58
|
+
}
|
|
8
59
|
|
|
9
60
|
.w-main {
|
|
10
61
|
padding-left: 3 * $base-increment;
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
#{$css-scope} {
|
|
2
|
-
.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.primary-dark3--bg {color: #fff;}
|
|
6
|
-
.white--bg {background-color: #fff;}
|
|
7
|
-
.white {color: #fff;}
|
|
8
|
-
.grey--bg {background-color: #888;}
|
|
9
|
-
.grey {color: #888;}
|
|
10
|
-
.black--bg {background-color: #000;}
|
|
11
|
-
.black {color: #000;}
|
|
12
|
-
.transparent--bg {background-color: transparent;}
|
|
13
|
-
.transparent {color: transparent;}
|
|
14
|
-
.inherit--bg {background-color: inherit;}
|
|
15
|
-
.inherit {color: inherit;}
|
|
16
|
-
.success--bg, .error--bg, .warning--bg, .info--bg {color: #fff;}
|
|
17
|
-
|
|
18
|
-
$colors:(
|
|
2
|
+
// Color palette (immutable).
|
|
3
|
+
// ------------------------------------------------------
|
|
4
|
+
$colors: (
|
|
19
5
|
'pink': #e91e63,
|
|
20
6
|
'purple': #a741b9,
|
|
21
7
|
'deep-purple': #673ab7,
|
|
@@ -37,6 +23,8 @@
|
|
|
37
23
|
'grey': #848484
|
|
38
24
|
);
|
|
39
25
|
|
|
26
|
+
// For each color, create a [color] and a [color]--bg associated classes,
|
|
27
|
+
// + 6 shades lighter and 6 shades darker.
|
|
40
28
|
@each $label, $color in $colors {
|
|
41
29
|
.#{$label}--bg {background-color: $color;}
|
|
42
30
|
.#{$label} {color: $color;}
|
|
@@ -116,4 +104,40 @@
|
|
|
116
104
|
.#{$label}-dark#{$i} {color: darken($color, $dark-increment * $i);}
|
|
117
105
|
}
|
|
118
106
|
}
|
|
107
|
+
|
|
108
|
+
.primary--bg {color: rgb(var(--w-base-bg-color-rgb));}
|
|
109
|
+
.white--bg {background-color: #fff;}
|
|
110
|
+
.white {color: #fff;}
|
|
111
|
+
.black--bg {background-color: #000;}
|
|
112
|
+
.black {color: #000;}
|
|
113
|
+
.transparent--bg {background-color: transparent;}
|
|
114
|
+
.transparent {color: transparent;}
|
|
115
|
+
.inherit--bg {background-color: inherit;}
|
|
116
|
+
.inherit {color: inherit;}
|
|
117
|
+
// ------------------------------------------------------
|
|
118
|
+
|
|
119
|
+
// Theming colors.
|
|
120
|
+
// These classes carry colors which change automatically when switching theme.
|
|
121
|
+
// ------------------------------------------------------
|
|
122
|
+
.base-color {color: rgba(var(--w-base-color-rgb), 0.7);}
|
|
123
|
+
.base-color--bg {background-color: rgb(var(--w-base-bg-color-rgb));}
|
|
124
|
+
.contrast-color {color: rgba(var(--w-contrast-color-rgb), 0.7);}
|
|
125
|
+
.contrast-color--bg {background-color: rgb(var(--w-contrast-bg-color-rgb));}
|
|
126
|
+
// ------------------------------------------------------
|
|
127
|
+
|
|
128
|
+
// Status colors - must stay last and have highest priority.
|
|
129
|
+
// ------------------------------------------------------
|
|
130
|
+
.info {color: var(--w-info-color);}
|
|
131
|
+
.info--bg {background-color: var(--w-info-color);color: #fff;}
|
|
132
|
+
.warning {color: var(--w-warning-color);}
|
|
133
|
+
.warning--bg {background-color: var(--w-warning-color);color: #fff;}
|
|
134
|
+
.success {color: var(--w-success-color);}
|
|
135
|
+
.success--bg {background-color: var(--w-success-color);color: #fff;}
|
|
136
|
+
.error {color: var(--w-error-color);}
|
|
137
|
+
.error--bg {background-color: var(--w-error-color);color: #fff;}
|
|
138
|
+
// ------------------------------------------------------
|
|
139
|
+
|
|
140
|
+
// The only colors remaining to define are user custom colors and shades.
|
|
141
|
+
// The associated CSS will be generated from dynamic-css.js, and injected as a first stylesheet,
|
|
142
|
+
// before this one (so the rules in this file have more priority).
|
|
119
143
|
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
// The CSS variables are used in the dynamic-css.js file in order to reuse the same SCSS
|
|
2
|
-
// variable presets.
|
|
3
|
-
:root {
|
|
4
|
-
--base-increment: #{$base-increment};
|
|
5
|
-
--css-scope: #{$css-scope};
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
// All these CSS classes will not be generated if the $use-layout-classes is set to false.
|
|
9
2
|
@if $use-layout-classes {
|
|
10
3
|
#{$css-scope} {
|
|
@@ -170,7 +163,7 @@
|
|
|
170
163
|
|
|
171
164
|
// Sizes.
|
|
172
165
|
// ----------------------------------------------
|
|
173
|
-
// In all the sizes
|
|
166
|
+
// In all the sizes below, round(x / 2) * 2 to always have even numbers.
|
|
174
167
|
// Different heights with a mix of odd and even numbers will misalign
|
|
175
168
|
// when vertically centering (vertical-align or align-items center).
|
|
176
169
|
.size--xs {font-size: round(0.85 * $base-font-size);}
|
|
@@ -186,25 +179,25 @@
|
|
|
186
179
|
// (https://www.w3.org/TR/css-variables-1/#using-variables),
|
|
187
180
|
// the grid system is done dynamically in dynamic-css.js.
|
|
188
181
|
|
|
189
|
-
// @media screen and (min-width: var(--breakpoint-xs)) {
|
|
182
|
+
// @media screen and (min-width: var(--w-breakpoint-xs)) {
|
|
190
183
|
// @for $i from 0 through $grid-base {
|
|
191
184
|
// .sm#{$grid-base - $i} {width: ($grid-base - $i) * 100% / $grid-base;}
|
|
192
185
|
// }
|
|
193
186
|
// }
|
|
194
187
|
|
|
195
|
-
// @media screen and (min-width: var(--breakpoint-sm)) {
|
|
188
|
+
// @media screen and (min-width: var(--w-breakpoint-sm)) {
|
|
196
189
|
// @for $i from 0 through $grid-base {
|
|
197
190
|
// .md#{$grid-base - $i} {width: ($grid-base - $i) * 100% / $grid-base;}
|
|
198
191
|
// }
|
|
199
192
|
// }
|
|
200
193
|
|
|
201
|
-
// @media screen and (min-width: var(--breakpoint-md)) {
|
|
194
|
+
// @media screen and (min-width: var(--w-breakpoint-md)) {
|
|
202
195
|
// @for $i from 0 through $grid-base {
|
|
203
196
|
// .lg#{$grid-base - $i} {width: ($grid-base - $i) * 100% / $grid-base;}
|
|
204
197
|
// }
|
|
205
198
|
// }
|
|
206
199
|
|
|
207
|
-
// @media screen and (min-width: var(--breakpoint-lg)) {
|
|
200
|
+
// @media screen and (min-width: var(--w-breakpoint-lg)) {
|
|
208
201
|
// @for $i from 0 through $grid-base {
|
|
209
202
|
// .xl#{$grid-base - $i} {width: ($grid-base - $i) * 100% / $grid-base;}
|
|
210
203
|
// }
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
// This allows each UI component to be used in dark or light theme regardless of the global theme.
|
|
4
|
+
@mixin themeable {
|
|
5
|
+
// Will force the light style on this component.
|
|
6
|
+
&--light {
|
|
7
|
+
--w-base-bg-color-rgb: #{map.get($theme-light, 'base-bg-color-rgb')};
|
|
8
|
+
--w-base-color-rgb: #{map.get($theme-light, 'base-color-rgb')};
|
|
9
|
+
--w-contrast-bg-color-rgb: #{map.get($theme-light, 'contrast-bg-color-rgb')};
|
|
10
|
+
--w-contrast-color-rgb: #{map.get($theme-light, 'contrast-color-rgb')};
|
|
11
|
+
--w-disabled-color-rgb: #{map.get($theme-light, 'disabled-color-rgb')};
|
|
12
|
+
color: rgba(var(--w-base-color-rgb), 0.7);
|
|
13
|
+
}
|
|
14
|
+
// Will force the dark style on this component.
|
|
15
|
+
&--dark {
|
|
16
|
+
--w-base-bg-color-rgb: #{map.get($theme-dark, 'base-bg-color-rgb')};
|
|
17
|
+
--w-base-color-rgb: #{map.get($theme-dark, 'base-color-rgb')};
|
|
18
|
+
--w-contrast-bg-color-rgb: #{map.get($theme-dark, 'contrast-bg-color-rgb')};
|
|
19
|
+
--w-contrast-color-rgb: #{map.get($theme-dark, 'contrast-color-rgb')};
|
|
20
|
+
--w-disabled-color-rgb: #{map.get($theme-dark, 'disabled-color-rgb')};
|
|
21
|
+
color: rgba(var(--w-base-color-rgb), 0.7);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
1
25
|
@mixin default-transition($duration: $transition-duration, $delay: 0s) {
|
|
2
26
|
transition: $duration $delay ease-in-out;
|
|
3
27
|
}
|
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
@use "sass:math";
|
|
2
|
+
@use "sass:map";
|
|
2
3
|
|
|
3
4
|
@function divide($a, $b) {
|
|
4
5
|
@return math.div($a, $b); // Must use `sass` & not `node-sass`.
|
|
5
|
-
// @return $a / $b;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
// THEME COLORS.
|
|
9
|
+
// ========================================================
|
|
10
|
+
// These colors are defined by a list of RBG channels only, so you can later apply any alpha channel.
|
|
11
|
+
// If you don't need themes, you can leave this as is and override the global defaults.
|
|
12
|
+
$theme-light: (
|
|
13
|
+
base-bg-color-rgb: (255, 255, 255), // #fff.
|
|
14
|
+
base-color-rgb: (0, 0, 0), // #000.
|
|
15
|
+
contrast-bg-color-rgb: (0, 0, 0), // #000.
|
|
16
|
+
contrast-color-rgb: (255, 255, 255), // #fff.
|
|
17
|
+
disabled-color-rgb: (204, 204, 204), // #ccc.
|
|
18
|
+
) !default;
|
|
19
|
+
|
|
20
|
+
$theme-dark: (
|
|
21
|
+
base-bg-color-rgb: (34, 34, 34), // #222.
|
|
22
|
+
base-color-rgb: (255, 255, 255), // #fff.
|
|
23
|
+
contrast-bg-color-rgb: (255, 255, 255), // #fff.
|
|
24
|
+
contrast-color-rgb: (0, 0, 0), // #000.
|
|
25
|
+
disabled-color-rgb: (74, 74, 74), // #4a4a4a.
|
|
26
|
+
) !default;
|
|
27
|
+
|
|
28
|
+
// These variables are filled up with the current theme colors for you to use.
|
|
29
|
+
$primary: var(--w-primary-color);
|
|
30
|
+
$secondary: var(--w-secondary-color);
|
|
31
|
+
$base-bg-color: rgb(var(--w-base-bg-color-rgb));
|
|
32
|
+
$base-color: rgb(var(--w-base-color-rgb));
|
|
33
|
+
$contrast-bg-color: rgb(var(--w-contrast-bg-color-rgb));
|
|
34
|
+
$contrast-color: rgb(var(--w-contrast-color-rgb));
|
|
35
|
+
// When a form element is disabled (checkbox, radio, input, select list).
|
|
36
|
+
$disabled-color: rgb(var(--w-disabled-color-rgb));
|
|
37
|
+
|
|
8
38
|
// GLOBAL DEFAULTS.
|
|
9
39
|
// ========================================================
|
|
10
40
|
$css-scope: '.w-app' !default; // Allows control on CSS rules priority.
|
|
@@ -15,47 +45,106 @@ $base-font-size: 14px !default; // Must be a px unit.
|
|
|
15
45
|
$base-increment: round(divide($base-font-size, 4)) !default;
|
|
16
46
|
$layout-padding: $base-increment * 4 !default; // Applied on the .content-wrap tag.
|
|
17
47
|
$border-radius: 3px !default;
|
|
18
|
-
$border-color: rgba(
|
|
48
|
+
$border-color: rgba(var(--w-contrast-bg-color-rgb), 0.15) !default;
|
|
19
49
|
$border: 1px solid $border-color !default;
|
|
20
50
|
$transition-duration: 0.25s !default;
|
|
21
51
|
$fast-transition-duration: 0.15s !default;
|
|
22
52
|
$box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
|
|
23
53
|
0 2px 2px 0 rgba(0, 0, 0, 0.15),
|
|
24
54
|
0 1px 5px 0 rgba(0, 0, 0, 0.15) !default;
|
|
25
|
-
// When a form element is disabled (checkbox, radio, input, select list).
|
|
26
|
-
$disabled-color: #ccc;
|
|
27
55
|
$form-field-height: round(2 * $base-font-size) !default;
|
|
28
56
|
// Always an even number for better vertical alignment. (Used in checkbox, radio, switch)
|
|
29
57
|
$small-form-el-size: round(divide(1.3 * $base-font-size, 2)) * 2 !default;
|
|
30
58
|
|
|
59
|
+
// Detachable elements are: w-tooltip, w-menu, w-confirm.
|
|
60
|
+
$detachable-bg-color: $base-bg-color !default;
|
|
61
|
+
$detachable-color: $base-color !default;
|
|
62
|
+
|
|
31
63
|
// COMPONENTS DEFAULTS.
|
|
32
64
|
// ========================================================
|
|
65
|
+
// w-confirm.
|
|
66
|
+
// --------------------------------------------------------
|
|
67
|
+
$confirm-bg-color: $detachable-bg-color !default;
|
|
68
|
+
$confirm-color: $detachable-color !default;
|
|
69
|
+
// --------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
// w-dialog.
|
|
72
|
+
// --------------------------------------------------------
|
|
73
|
+
$dialog-bg-color: $base-bg-color !default;
|
|
74
|
+
// --------------------------------------------------------
|
|
75
|
+
|
|
76
|
+
// w-divider.
|
|
77
|
+
// --------------------------------------------------------
|
|
78
|
+
$divider-color: $border-color !default;
|
|
79
|
+
// --------------------------------------------------------
|
|
80
|
+
|
|
33
81
|
// w-drawer.
|
|
82
|
+
// --------------------------------------------------------
|
|
34
83
|
$drawer-max-size: 380px !default;
|
|
84
|
+
$drawer-bg-color: $base-bg-color !default;
|
|
85
|
+
// --------------------------------------------------------
|
|
86
|
+
|
|
87
|
+
// w-menu.
|
|
88
|
+
// --------------------------------------------------------
|
|
89
|
+
$menu-bg-color: $detachable-bg-color !default;
|
|
90
|
+
$menu-color: $detachable-color !default;
|
|
91
|
+
// --------------------------------------------------------
|
|
92
|
+
|
|
93
|
+
// w-progress.
|
|
94
|
+
// --------------------------------------------------------
|
|
95
|
+
$progress-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.15) !default;
|
|
96
|
+
// --------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
// w-rating.
|
|
99
|
+
// --------------------------------------------------------
|
|
100
|
+
$rating-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.25) !default;
|
|
35
101
|
// --------------------------------------------------------
|
|
36
102
|
|
|
37
103
|
// w-slider.
|
|
38
104
|
// --------------------------------------------------------
|
|
39
105
|
$slider-height: $base-increment !default;
|
|
40
|
-
$slider-track-color:
|
|
106
|
+
$slider-track-color: rgba(var(--w-contrast-bg-color-rgb), 0.15) !default;
|
|
107
|
+
$slider-thumb-button-bg-color: $base-bg-color !default;
|
|
108
|
+
$slider-thumb-label-bg-color: $base-bg-color !default;
|
|
109
|
+
$slider-thumb-label-color: rgba(var(--w-base-color-rgb), 0.75) !default;
|
|
110
|
+
$slider-step-label-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.2) !default;
|
|
111
|
+
$slider-step-label-color: rgba(var(--w-base-color-rgb), 0.5) !default;
|
|
112
|
+
|
|
113
|
+
// w-switch.
|
|
114
|
+
// --------------------------------------------------------
|
|
115
|
+
$switch-inactive-color: rgba(var(--w-contrast-bg-color-rgb), 0.25) !default;
|
|
116
|
+
$switch-thumb-color: #fff !default;
|
|
41
117
|
// --------------------------------------------------------
|
|
42
118
|
|
|
43
119
|
// w-table.
|
|
44
120
|
// --------------------------------------------------------
|
|
45
|
-
$table-tr-odd-color: rgba(0, 0, 0, 0.02);
|
|
46
|
-
$table-tr-hover-color: rgba(0, 0, 0, 0.05);
|
|
47
|
-
$table-color: rgba(
|
|
121
|
+
$table-tr-odd-color: rgba(0, 0, 0, 0.02) !default;
|
|
122
|
+
$table-tr-hover-color: rgba(0, 0, 0, 0.05) !default;
|
|
123
|
+
$table-color: rgba(var(--w-contrast-color-rgb), 0.7) !default;
|
|
48
124
|
// --------------------------------------------------------
|
|
49
125
|
|
|
50
126
|
// w-textarea.
|
|
51
127
|
// --------------------------------------------------------
|
|
52
|
-
$textarea-line-height: 1.2;
|
|
128
|
+
$textarea-line-height: 1.2 !default;
|
|
129
|
+
// --------------------------------------------------------
|
|
130
|
+
|
|
131
|
+
// w-timeline.
|
|
132
|
+
// --------------------------------------------------------
|
|
133
|
+
$timeline-bullet-color: $base-bg-color !default;
|
|
134
|
+
$timeline-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.25) !default;
|
|
135
|
+
// --------------------------------------------------------
|
|
136
|
+
|
|
137
|
+
// w-toolbar.
|
|
138
|
+
// --------------------------------------------------------
|
|
139
|
+
$toolbar-max-size: 380px !default;
|
|
140
|
+
$toolbar-bg-color: $base-bg-color !default;
|
|
53
141
|
// --------------------------------------------------------
|
|
54
142
|
|
|
55
143
|
// w-tooltip.
|
|
56
144
|
// --------------------------------------------------------
|
|
57
|
-
$tooltip-bg-color:
|
|
58
|
-
$tooltip-color:
|
|
145
|
+
$tooltip-bg-color: $detachable-bg-color !default;
|
|
146
|
+
$tooltip-color: $detachable-color !default;
|
|
147
|
+
$tooltip-border-color: $border-color !default;
|
|
59
148
|
// --------------------------------------------------------
|
|
60
149
|
|
|
61
150
|
// Mixins.
|
|
@@ -1,4 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
const shadeColor = (color, amount) => {
|
|
2
|
+
return '#' + color.slice(1).match(/../g)
|
|
3
|
+
.map(x => {
|
|
4
|
+
x = +`0x${x}` + amount
|
|
5
|
+
return (x < 0 ? 0 : (x > 255 ? 255 : x)).toString(16).padStart(2, 0)
|
|
6
|
+
})
|
|
7
|
+
.join('')
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Generates the color shades for each custom color and status colors for the current theme (only),
|
|
12
|
+
* and save it in the config object.
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} config
|
|
15
|
+
*/
|
|
16
|
+
export const generateColorShades = config => {
|
|
17
|
+
// Add color shades for each custom color and status color of each theme.
|
|
18
|
+
['light', 'dark'].forEach(theme => {
|
|
19
|
+
const themeOfColors = config.colors[theme]
|
|
20
|
+
themeOfColors.shades = {}
|
|
21
|
+
|
|
22
|
+
for (let color in themeOfColors) {
|
|
23
|
+
if (color === 'shades') continue // Skip if item is the `shades` container.
|
|
24
|
+
color = { label: color, color: themeOfColors[color].replace('#', '') }
|
|
25
|
+
const col = color.color
|
|
26
|
+
if (col.length === 3) color.color = col[0] + '' + col[0] + col[1] + col[1] + col[2] + col[2]
|
|
27
|
+
|
|
28
|
+
for (let i = 1; i <= 3; i++) {
|
|
29
|
+
const lighterColor = shadeColor(`#${color.color}`, i * 40)
|
|
30
|
+
const darkerColor = shadeColor(`#${color.color}`, -i * 40)
|
|
31
|
+
// Adding the shades to the config object to generate the CSS from w-app.
|
|
32
|
+
themeOfColors.shades[`${color.label}-light${i}`] = lighterColor
|
|
33
|
+
themeOfColors.shades[`${color.label}-dark${i}`] = darkerColor
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const flattenColors = (themeColors, colorPalette) => {
|
|
40
|
+
const colors = {
|
|
41
|
+
...colorPalette.reduce((obj, color) => {
|
|
42
|
+
obj[color.label] = color.color
|
|
43
|
+
const shades = (color.shades || []).reduce((obj, color) => {
|
|
44
|
+
obj[color.label] = color.color
|
|
45
|
+
return obj
|
|
46
|
+
}, {})
|
|
47
|
+
return { ...obj, ...shades }
|
|
48
|
+
}, { ...themeColors, ...themeColors.shades })
|
|
49
|
+
}
|
|
50
|
+
delete colors.shades
|
|
51
|
+
|
|
52
|
+
return colors
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const colorPalette = [
|
|
2
56
|
{
|
|
3
57
|
label: 'pink',
|
|
4
58
|
color: '#e91e63',
|
|
@@ -15,7 +69,6 @@ export default [
|
|
|
15
69
|
{ label: 'pink-dark4', color: '#7c0c32' },
|
|
16
70
|
{ label: 'pink-dark5', color: '#600927' },
|
|
17
71
|
{ label: 'pink-dark6', color: '#43071b' }
|
|
18
|
-
|
|
19
72
|
]
|
|
20
73
|
},
|
|
21
74
|
{
|
|
@@ -342,5 +395,9 @@ export default [
|
|
|
342
395
|
{ label: 'grey-dark5', color: '#353535' },
|
|
343
396
|
{ label: 'grey-dark6', color: '#252525' }
|
|
344
397
|
]
|
|
345
|
-
}
|
|
398
|
+
},
|
|
399
|
+
{ label: 'black', color: '#000' },
|
|
400
|
+
{ label: 'white', color: '#fff' },
|
|
401
|
+
{ label: 'transparent', color: 'transparent' },
|
|
402
|
+
{ label: 'inherit', color: 'inherit' }
|
|
346
403
|
]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { reactive } from 'vue'
|
|
2
2
|
|
|
3
3
|
const config = reactive({
|
|
4
|
+
on: '#app', // Sets the Wave UI root node. If not found, will default to `body`.
|
|
4
5
|
breakpoints: {
|
|
5
6
|
xs: 600,
|
|
6
7
|
sm: 900,
|
|
@@ -10,7 +11,7 @@ const config = reactive({
|
|
|
10
11
|
},
|
|
11
12
|
css: {
|
|
12
13
|
// Generate shades for custom colors and status colors.
|
|
13
|
-
//
|
|
14
|
+
// Note: the color palette shades are always generated separately from SCSS.
|
|
14
15
|
colorShades: true,
|
|
15
16
|
|
|
16
17
|
// Generate palette colors and palette color shades.
|
|
@@ -24,13 +25,27 @@ const config = reactive({
|
|
|
24
25
|
grid: 12
|
|
25
26
|
},
|
|
26
27
|
colors: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
// Default colors of Wave UI. Can be overridden from the Wave UI user config on init.
|
|
29
|
+
light: {
|
|
30
|
+
primary: '#234781',
|
|
31
|
+
secondary: '#d3ebff',
|
|
32
|
+
info: '#3d9ff5',
|
|
33
|
+
warning: '#f80',
|
|
34
|
+
success: '#54b946',
|
|
35
|
+
error: '#f65555'
|
|
36
|
+
},
|
|
37
|
+
dark: {
|
|
38
|
+
primary: '#89b6d2',
|
|
39
|
+
secondary: '#375b6a',
|
|
40
|
+
info: '#3d9ff5',
|
|
41
|
+
warning: '#f80',
|
|
42
|
+
success: '#54b946',
|
|
43
|
+
error: '#f65555'
|
|
44
|
+
}
|
|
33
45
|
},
|
|
46
|
+
// The initial theme to use.
|
|
47
|
+
// To switch theme while running, call the $waveui.switchTheme('light'|'dark') method.
|
|
48
|
+
theme: 'light', // One of 'light', 'dark', 'auto'.
|
|
34
49
|
icons: [],
|
|
35
50
|
iconsLigature: false,
|
|
36
51
|
notificationManager: {
|
|
@@ -43,9 +58,18 @@ const config = reactive({
|
|
|
43
58
|
export { config as default }
|
|
44
59
|
|
|
45
60
|
export const mergeConfig = (options, conf = config) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
// If the conf object is empty, populate with options (case of presets).
|
|
62
|
+
if (!Object.keys(conf).length) conf = Object.assign(conf, options)
|
|
63
|
+
|
|
64
|
+
else {
|
|
65
|
+
for (const key in options) {
|
|
66
|
+
const option = options[key]
|
|
67
|
+
if (typeof option === 'object') {
|
|
68
|
+
mergeConfig(options[key], conf[key])
|
|
69
|
+
}
|
|
70
|
+
else conf[key] = option
|
|
71
|
+
}
|
|
50
72
|
}
|
|
73
|
+
|
|
74
|
+
return conf
|
|
51
75
|
}
|