wave-ui 2.27.0 → 2.30.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/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +457 -456
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +10 -10
- package/src/wave-ui/components/w-accordion.vue +6 -4
- package/src/wave-ui/components/w-alert.vue +0 -1
- package/src/wave-ui/components/w-app.vue +1 -1
- package/src/wave-ui/components/w-confirm.vue +35 -10
- package/src/wave-ui/components/w-flex.vue +2 -0
- package/src/wave-ui/components/w-input.vue +21 -3
- package/src/wave-ui/components/w-menu.vue +75 -210
- package/src/wave-ui/components/w-select.vue +1 -1
- package/src/wave-ui/components/w-table.vue +17 -13
- package/src/wave-ui/components/w-tabs/index.vue +2 -1
- package/src/wave-ui/components/w-tag.vue +17 -6
- package/src/wave-ui/components/w-textarea.vue +1 -1
- package/src/wave-ui/components/w-tooltip.vue +136 -270
- package/src/wave-ui/mixins/detachable.js +189 -0
- package/src/wave-ui/scss/_base.scss +0 -21
- package/src/wave-ui/scss/_mixins.scss +18 -4
- package/src/wave-ui/scss/_variables.scss +5 -1
- package/src/wave-ui/scss/index.scss +0 -1
- package/src/wave-ui/utils/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.0",
|
|
4
4
|
"description": "An emerging UI framework for Vue.js & Vue 3 with only the bright side. :sunny:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"main": "./dist/wave-ui.umd.js",
|
|
@@ -43,26 +43,26 @@
|
|
|
43
43
|
"*.vue"
|
|
44
44
|
],
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@babel/core": "^7.16.
|
|
47
|
-
"@babel/eslint-parser": "^7.16.
|
|
48
|
-
"@babel/plugin-proposal-class-properties": "^7.16.
|
|
46
|
+
"@babel/core": "^7.16.5",
|
|
47
|
+
"@babel/eslint-parser": "^7.16.5",
|
|
48
|
+
"@babel/plugin-proposal-class-properties": "^7.16.5",
|
|
49
49
|
"@mdi/font": "^5.9.55",
|
|
50
|
-
"@vitejs/plugin-vue": "^1.
|
|
50
|
+
"@vitejs/plugin-vue": "^1.10.2",
|
|
51
51
|
"@vue/compiler-sfc": "3.1.5",
|
|
52
|
-
"autoprefixer": "^10.4.
|
|
52
|
+
"autoprefixer": "^10.4.1",
|
|
53
53
|
"axios": "^0.21.4",
|
|
54
54
|
"eslint": "^7.32.0",
|
|
55
55
|
"font-awesome": "^4.7.0",
|
|
56
|
-
"gsap": "^3.
|
|
56
|
+
"gsap": "^3.9.1",
|
|
57
57
|
"ionicons": "^4.6.3",
|
|
58
58
|
"material-design-icons": "^3.0.1",
|
|
59
59
|
"rollup-plugin-delete": "^2.0.0",
|
|
60
|
-
"sass": "^1.
|
|
60
|
+
"sass": "^1.45.1",
|
|
61
61
|
"simple-syntax-highlighter": "^2.2.0",
|
|
62
62
|
"splitpanes": "^3.0.6",
|
|
63
|
-
"vite": "^2.
|
|
63
|
+
"vite": "^2.7.9",
|
|
64
64
|
"vite-plugin-pug": "^0.3.0",
|
|
65
|
-
"vue": "^3.2.
|
|
65
|
+
"vue": "^3.2.26",
|
|
66
66
|
"vue-cal": "^4.2.0",
|
|
67
67
|
"vue-router": "^4.0.12",
|
|
68
68
|
"vueperslides": "^3.3.2",
|
|
@@ -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="$slots[`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")
|
|
@@ -148,8 +150,8 @@ export default {
|
|
|
148
150
|
margin-right: $base-increment;
|
|
149
151
|
|
|
150
152
|
.w-accordion--rotate-icon & {@include default-transition;}
|
|
151
|
-
|
|
152
|
-
.w-accordion--
|
|
153
|
+
&--expanded {transform: rotate(-180deg);}
|
|
154
|
+
.w-accordion--icon-right &--expanded {transform: rotate(180deg);}
|
|
153
155
|
|
|
154
156
|
.w-icon:before {font-size: 1.1em;}
|
|
155
157
|
}
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
.w-confirm
|
|
3
3
|
w-menu(v-model="showPopup" v-bind="wMenuProps")
|
|
4
4
|
template(#activator="{ on }")
|
|
5
|
-
w-button.w-confirm__button(v-on="on" v-bind="buttonProps")
|
|
5
|
+
w-button.w-confirm__button(v-on="{ ...$listeners, ...on }" v-bind="buttonProps")
|
|
6
6
|
slot
|
|
7
7
|
w-flex(:column="!inline" align-center)
|
|
8
8
|
div
|
|
9
|
-
slot(name="question")
|
|
9
|
+
slot(name="question") {{ question }}
|
|
10
10
|
.w-flex.justify-end(:class="inline ? 'ml2' : 'mt2'")
|
|
11
11
|
w-button.mr2(
|
|
12
|
-
v-if="
|
|
13
|
-
v-bind="
|
|
12
|
+
v-if="cancel !== false"
|
|
13
|
+
v-bind="cancelButtonProps"
|
|
14
14
|
:bg-color="(cancelButton || {}).bgColor || 'error'"
|
|
15
15
|
@click="onCancel")
|
|
16
|
-
slot(name="cancel")
|
|
16
|
+
slot(name="cancel") {{ cancelButton.label }}
|
|
17
17
|
w-button(
|
|
18
|
-
v-bind="
|
|
18
|
+
v-bind="confirmButtonProps"
|
|
19
19
|
:bg-color="(confirmButton || {}).bgColor || 'success'"
|
|
20
20
|
@click="onConfirm")
|
|
21
|
-
slot(name="confirm")
|
|
21
|
+
slot(name="confirm") {{ confirmButton.label }}
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script>
|
|
@@ -30,11 +30,16 @@ export default {
|
|
|
30
30
|
color: { type: String },
|
|
31
31
|
icon: { type: String },
|
|
32
32
|
mainButton: { type: Object }, // Allow passing down an object of props to the w-button component.
|
|
33
|
+
question: { type: String, default: 'Are you sure?' },
|
|
33
34
|
|
|
34
35
|
// Cancel & confirm buttons props.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
// Allow passing down an object of props to the w-button component.
|
|
37
|
+
// If a string is given, that will be the label of the button.
|
|
38
|
+
// If false, no cancel button.
|
|
39
|
+
cancel: { type: [Boolean, Object, String], default: undefined },
|
|
40
|
+
// Allow passing down an object of props to the w-button component.
|
|
41
|
+
// If a string is given, that will be the label of the button.
|
|
42
|
+
confirm: { type: [Object, String] },
|
|
38
43
|
|
|
39
44
|
// global menu props.
|
|
40
45
|
inline: { type: Boolean }, // The layout inside the menu.
|
|
@@ -63,6 +68,26 @@ export default {
|
|
|
63
68
|
}),
|
|
64
69
|
|
|
65
70
|
computed: {
|
|
71
|
+
cancelButton () {
|
|
72
|
+
let button = { label: typeof this.cancel === 'string' ? this.cancel : 'Cancel' }
|
|
73
|
+
if (typeof this.cancel === 'object') button = Object.assign({}, button, this.cancel)
|
|
74
|
+
return button
|
|
75
|
+
},
|
|
76
|
+
// Props to pass down to the w-button component.
|
|
77
|
+
cancelButtonProps () {
|
|
78
|
+
const { label, ...props } = this.cancelButton // Everything except label.
|
|
79
|
+
return props
|
|
80
|
+
},
|
|
81
|
+
confirmButton () {
|
|
82
|
+
let button = { label: typeof this.confirm === 'string' ? this.confirm : 'Confirm' }
|
|
83
|
+
if (typeof this.confirm === 'object') button = Object.assign({}, button, this.confirm)
|
|
84
|
+
return button
|
|
85
|
+
},
|
|
86
|
+
// Props to pass down to the w-button component.
|
|
87
|
+
confirmButtonProps () {
|
|
88
|
+
const { label, ...props } = this.confirmButton // Everything except label.
|
|
89
|
+
return props
|
|
90
|
+
},
|
|
66
91
|
wMenuProps () {
|
|
67
92
|
return {
|
|
68
93
|
top: this.top,
|
|
@@ -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
|
}
|
|
@@ -23,8 +23,10 @@ component(
|
|
|
23
23
|
tag="label"
|
|
24
24
|
:for="`w-input--${_.uid}`"
|
|
25
25
|
@click="$emit('click:inner-icon-left', $event)") {{ innerIconLeft }}
|
|
26
|
+
//- All types of input except file.
|
|
26
27
|
input.w-input__input(
|
|
27
28
|
v-if="type !== 'file'"
|
|
29
|
+
ref="input"
|
|
28
30
|
v-model="inputValue"
|
|
29
31
|
v-on="listeners"
|
|
30
32
|
@input="onInput"
|
|
@@ -45,8 +47,10 @@ component(
|
|
|
45
47
|
:required="required || null"
|
|
46
48
|
:tabindex="tabindex || null"
|
|
47
49
|
v-bind="attrs")
|
|
48
|
-
|
|
50
|
+
//- Input type file.
|
|
51
|
+
template(v-else)
|
|
49
52
|
input(
|
|
53
|
+
ref="input"
|
|
50
54
|
:id="`w-input--${_.uid}`"
|
|
51
55
|
type="file"
|
|
52
56
|
:name="name || null"
|
|
@@ -160,7 +164,8 @@ export default {
|
|
|
160
164
|
inputNumberError: false,
|
|
161
165
|
isFocused: false,
|
|
162
166
|
inputFiles: [], // For input type file.
|
|
163
|
-
fileReader: null // For input type file.
|
|
167
|
+
fileReader: null, // For input type file.
|
|
168
|
+
isAutofilled: false
|
|
164
169
|
}
|
|
165
170
|
},
|
|
166
171
|
|
|
@@ -186,6 +191,7 @@ export default {
|
|
|
186
191
|
hasValue () {
|
|
187
192
|
return (
|
|
188
193
|
this.inputValue ||
|
|
194
|
+
this.inputValue === 0 ||
|
|
189
195
|
['date', 'time'].includes(this.type) ||
|
|
190
196
|
(this.type === 'number' && this.inputNumberError) ||
|
|
191
197
|
(this.type === 'file' && this.inputFiles.length)
|
|
@@ -206,7 +212,7 @@ export default {
|
|
|
206
212
|
'w-input--file': this.type === 'file',
|
|
207
213
|
'w-input--disabled': this.isDisabled,
|
|
208
214
|
'w-input--readonly': this.isReadonly,
|
|
209
|
-
[`w-input--${this.hasValue ? 'filled' : 'empty'}`]: true,
|
|
215
|
+
[`w-input--${this.hasValue || this.isAutofilled ? 'filled' : 'empty'}`]: true,
|
|
210
216
|
'w-input--focused': this.isFocused && !this.isReadonly,
|
|
211
217
|
'w-input--dark': this.dark,
|
|
212
218
|
'w-input--floating-label': this.hasLabel && this.labelPosition === 'inside' && !this.staticLabel,
|
|
@@ -271,6 +277,8 @@ export default {
|
|
|
271
277
|
return file
|
|
272
278
|
})
|
|
273
279
|
this.$emit('update:modelValue', this.inputFiles)
|
|
280
|
+
this.$emit('input', this.inputFiles)
|
|
281
|
+
this.$emit('change', this.inputFiles)
|
|
274
282
|
},
|
|
275
283
|
|
|
276
284
|
// For file input.
|
|
@@ -293,9 +301,19 @@ export default {
|
|
|
293
301
|
}
|
|
294
302
|
},
|
|
295
303
|
|
|
304
|
+
mounted () {
|
|
305
|
+
// On page load, check if the field is autofilled by the browser.
|
|
306
|
+
// 20211229. Only a problem on Chrome. Firefox ok, Safari always prompts before filling up.
|
|
307
|
+
setTimeout(() => {
|
|
308
|
+
if (this.$refs.input && this.$refs.input.matches(':-webkit-autofill')) this.isAutofilled = true
|
|
309
|
+
}, 400) // Can't be less than 350: time for the browser to autofill.
|
|
310
|
+
},
|
|
311
|
+
|
|
296
312
|
watch: {
|
|
297
313
|
modelValue (value) {
|
|
298
314
|
this.inputValue = value
|
|
315
|
+
// When clearing the field value, also reset the isAutofilled var for the CSS class.
|
|
316
|
+
if (!value && value !== 0) this.isAutofilled = false
|
|
299
317
|
}
|
|
300
318
|
}
|
|
301
319
|
}
|