@neovici/cosmoz-dropdown 1.5.1 → 1.6.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/package.json +1 -1
- package/src/cosmoz-dropdown.js +12 -3
package/package.json
CHANGED
package/src/cosmoz-dropdown.js
CHANGED
|
@@ -52,14 +52,20 @@ const preventDefault = e => e.preventDefault(),
|
|
|
52
52
|
button:hover {
|
|
53
53
|
background: var(--cosmoz-dropdown-button-hover-bg-color, var(--cosmoz-button-hover-bg-color, #3A3F44));
|
|
54
54
|
}
|
|
55
|
+
::slotted(svg) {
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
}
|
|
55
58
|
</style>
|
|
56
59
|
<div class="anchor" part="anchor">
|
|
57
|
-
<button @click=${ onToggle } @mousedown=${ preventDefault } part="button">
|
|
60
|
+
<button @click=${ onToggle } @mousedown=${ preventDefault } part="button" id="dropdownButton">
|
|
58
61
|
<slot name="button">...</slot>
|
|
59
62
|
</button>
|
|
60
63
|
</div>
|
|
61
64
|
${ active && html`
|
|
62
|
-
<cosmoz-dropdown-content
|
|
65
|
+
<cosmoz-dropdown-content
|
|
66
|
+
id="dropdown" part="dropdown" exportparts="content: dropdown-content"
|
|
67
|
+
.anchor=${ anchor } .placement=${ placement } .render=${ render }
|
|
68
|
+
>
|
|
63
69
|
<slot></slot>
|
|
64
70
|
</cosmoz-dropdown-content>` || [] }
|
|
65
71
|
`;
|
|
@@ -83,6 +89,7 @@ const preventDefault = e => e.preventDefault(),
|
|
|
83
89
|
margin: 0;
|
|
84
90
|
width: 100%;
|
|
85
91
|
}
|
|
92
|
+
|
|
86
93
|
::slotted(:not(slot):hover) {
|
|
87
94
|
background: var(--cosmoz-dropdown-menu-hover-color, var(--cosmoz-selection-color, rgba(58, 145, 226, 0.1)));
|
|
88
95
|
}
|
|
@@ -95,7 +102,9 @@ const preventDefault = e => e.preventDefault(),
|
|
|
95
102
|
<slot></slot>
|
|
96
103
|
`,
|
|
97
104
|
Menu = host => html`
|
|
98
|
-
<cosmoz-dropdown .placement=${ host.placement }
|
|
105
|
+
<cosmoz-dropdown .placement=${ host.placement }
|
|
106
|
+
part="dropdown"
|
|
107
|
+
exportparts=${ ['anchor', 'button', 'dropdown'].map(p => `${ p }: dropdown-${ p }`).concat(['dropdown-content']).join(', ') }>
|
|
99
108
|
<slot name="button" slot="button"></slot>
|
|
100
109
|
<cosmoz-dropdown-list><slot></slot></cosmoz-dropdown-list>
|
|
101
110
|
</cosmoz-dropdown>`;
|