wave-ui 2.32.0 → 2.32.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/package.json
CHANGED
|
@@ -48,7 +48,7 @@ export default {
|
|
|
48
48
|
ligature () {
|
|
49
49
|
if (!config.iconsLigature) return false
|
|
50
50
|
|
|
51
|
-
const [fontName, icon] = this
|
|
51
|
+
const [fontName, icon] = this.icon.split(' ')
|
|
52
52
|
return fontName === config.iconsLigature && { fontName, icon }
|
|
53
53
|
},
|
|
54
54
|
forcedSize () {
|
|
@@ -66,7 +66,7 @@ export default {
|
|
|
66
66
|
},
|
|
67
67
|
classes () {
|
|
68
68
|
return {
|
|
69
|
-
[this
|
|
69
|
+
[this.icon]: true,
|
|
70
70
|
[this.color]: this.color,
|
|
71
71
|
[`${this.bgColor}--bg`]: this.bgColor,
|
|
72
72
|
[`size--${this.presetSize}`]: this.presetSize && !this.forcedSize,
|
|
@@ -87,6 +87,16 @@ export default {
|
|
|
87
87
|
styles () {
|
|
88
88
|
return this.forcedSize && `font-size: ${this.forcedSize}`
|
|
89
89
|
}
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
created () {
|
|
93
|
+
this.icon = this.$slots.default && this.$slots.default()[0].children
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// Using the slot content directly in the classes computed is not always reacting to changes.
|
|
97
|
+
// https://github.com/antoniandre/wave-ui/issues/81
|
|
98
|
+
updated () {
|
|
99
|
+
this.icon = this.$slots.default && this.$slots.default()[0].children
|
|
90
100
|
}
|
|
91
101
|
}
|
|
92
102
|
</script>
|
|
@@ -19,92 +19,6 @@ ul.w-list(:class="classes")
|
|
|
19
19
|
:is="checklist ? 'w-checkbox' : (nav && !li.disabled && li.route ? (hasRouter ? 'router-link' : 'a') : 'div')"
|
|
20
20
|
v-bind="liLabelProps(li, i, li._selected)")
|
|
21
21
|
|
|
22
|
-
//- Vue 2.x only. Keep this comment to simplify the master branch merge into next.
|
|
23
|
-
//-----------------------------------------------------
|
|
24
|
-
//- When there are slots.
|
|
25
|
-
//- template(v-if="$slots[`item.${i + 1}`] || $slots.item || $slots.default")
|
|
26
|
-
//- Checklist items. (separated case cz it needs a @click.native, can't be in v-on)
|
|
27
|
-
w-checkbox.w-list__item-label(
|
|
28
|
-
v-if="checklist"
|
|
29
|
-
v-bind="liLabelProps(li, i, li._selected)"
|
|
30
|
-
v-on="liLabelEvents(li)"
|
|
31
|
-
@click.native="onCheckboxWrapperClick")
|
|
32
|
-
slot(
|
|
33
|
-
v-if="$slots[`item.${i + 1}`] && $slots[`item.${i + 1}`]()"
|
|
34
|
-
:name="`item.${i + 1}`"
|
|
35
|
-
:item="cleanLi(li)"
|
|
36
|
-
:index="i + 1"
|
|
37
|
-
:selected="li._selected")
|
|
38
|
-
slot(
|
|
39
|
-
v-else-if="$slots.item"
|
|
40
|
-
name="item"
|
|
41
|
-
:item="cleanLi(li)"
|
|
42
|
-
:index="i + 1"
|
|
43
|
-
:selected="li._selected")
|
|
44
|
-
slot(v-else :item="cleanLi(li)" :index="i + 1" :selected="li._selected") {{ li._label }}
|
|
45
|
-
//- Router link list items. (separated case cz it needs a @click.native, can't be in v-on)
|
|
46
|
-
router-link.w-list__item-label(
|
|
47
|
-
v-else-if="nav && !li.disabled && li[itemRouteKey] && hasRouter"
|
|
48
|
-
v-bind="liLabelProps(li, i, li._selected)"
|
|
49
|
-
v-on="liLabelEvents(li)"
|
|
50
|
-
@click.native="$emit('item-select', cleanLi(li))")
|
|
51
|
-
slot(
|
|
52
|
-
v-if="$slots[`item.${i + 1}`] && $slots[`item.${i + 1}`]()"
|
|
53
|
-
:name="`item.${i + 1}`"
|
|
54
|
-
:item="cleanLi(li)"
|
|
55
|
-
:index="i + 1"
|
|
56
|
-
:selected="li._selected")
|
|
57
|
-
slot(
|
|
58
|
-
v-else-if="$slots.item"
|
|
59
|
-
name="item"
|
|
60
|
-
:item="cleanLi(li)"
|
|
61
|
-
:index="i + 1"
|
|
62
|
-
:selected="li._selected")
|
|
63
|
-
slot(v-else :item="cleanLi(li)" :index="i + 1" :selected="li._selected") {{ li._label }}
|
|
64
|
-
//- Nav & simple list items.
|
|
65
|
-
component.w-list__item-label(
|
|
66
|
-
v-else
|
|
67
|
-
:is="nav && !li.disabled && li[itemRouteKey] ? 'a' : 'div'"
|
|
68
|
-
v-bind="liLabelProps(li, i, li._selected)"
|
|
69
|
-
v-on="liLabelEvents(li)")
|
|
70
|
-
slot(
|
|
71
|
-
v-if="$slots[`item.${i + 1}`] && $slots[`item.${i + 1}`]()"
|
|
72
|
-
:name="`item.${i + 1}`"
|
|
73
|
-
:item="cleanLi(li)"
|
|
74
|
-
:index="i + 1"
|
|
75
|
-
:selected="li._selected")
|
|
76
|
-
slot(
|
|
77
|
-
v-else-if="$slots.item"
|
|
78
|
-
name="item"
|
|
79
|
-
:item="cleanLi(li)"
|
|
80
|
-
:index="i + 1"
|
|
81
|
-
:selected="li._selected")
|
|
82
|
-
slot(v-else :item="cleanLi(li)" :index="i + 1" :selected="li._selected") {{ li._label }}
|
|
83
|
-
|
|
84
|
-
//- When there are no slots.
|
|
85
|
-
//- template(v-else)
|
|
86
|
-
//- Checklist items. (separated case cz it needs a @click.native, can't be in v-on)
|
|
87
|
-
w-checkbox.w-list__item-label(
|
|
88
|
-
v-if="checklist"
|
|
89
|
-
v-bind="liLabelProps(li, i, li._selected)"
|
|
90
|
-
v-on="liLabelEvents(li)"
|
|
91
|
-
@click.native="onCheckboxWrapperClick")
|
|
92
|
-
//- Router link list items. (separated case cz it needs a @click.native, can't be in v-on)
|
|
93
|
-
router-link.w-list__item-label(
|
|
94
|
-
v-else-if="nav && !li.disabled && li[itemRouteKey] && hasRouter"
|
|
95
|
-
v-bind="liLabelProps(li, i, li._selected)"
|
|
96
|
-
v-on="liLabelEvents(li)"
|
|
97
|
-
@click.native="$emit('item-select', cleanLi(li))"
|
|
98
|
-
v-html="li._label")
|
|
99
|
-
//- Nav & simple list items.
|
|
100
|
-
component.w-list__item-label(
|
|
101
|
-
v-else
|
|
102
|
-
:is="nav && !li.disabled && li[itemRouteKey] ? 'a' : 'div'"
|
|
103
|
-
v-bind="liLabelProps(li, i, li._selected)"
|
|
104
|
-
v-on="liLabelEvents(li)"
|
|
105
|
-
v-html="li._label")
|
|
106
|
-
//-----------------------------------------------------
|
|
107
|
-
|
|
108
22
|
//- Children lists.
|
|
109
23
|
w-list(
|
|
110
24
|
v-if="(li.children || []).length"
|