@wentools/overlay 0.1.5 → 0.1.6
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/dropdown_menu.svelte +6 -0
package/package.json
CHANGED
package/src/dropdown_menu.svelte
CHANGED
|
@@ -39,6 +39,10 @@ Perfect for: context menus, action menus, navigation dropdowns.
|
|
|
39
39
|
offset?: number
|
|
40
40
|
/** Maximum width of dropdown content */
|
|
41
41
|
maxWidth?: string
|
|
42
|
+
/** Minimum width of dropdown content. Unset by default, so the menu
|
|
43
|
+
* shrink-wraps to its widest item. Set this (e.g. '14rem') to floor the
|
|
44
|
+
* width on larger screens where a thin menu of short labels looks dinky. */
|
|
45
|
+
minWidth?: string
|
|
42
46
|
/** CSS class for styling the dropdown */
|
|
43
47
|
class?: string
|
|
44
48
|
/** Whether the dropdown is disabled */
|
|
@@ -57,6 +61,7 @@ Perfect for: context menus, action menus, navigation dropdowns.
|
|
|
57
61
|
position = 'bottom-start',
|
|
58
62
|
offset = 4,
|
|
59
63
|
maxWidth = '60ch',
|
|
64
|
+
minWidth,
|
|
60
65
|
class: className = '',
|
|
61
66
|
disabled = false,
|
|
62
67
|
initialFocusIndex = 0,
|
|
@@ -201,6 +206,7 @@ Perfect for: context menus, action menus, navigation dropdowns.
|
|
|
201
206
|
bind:this={menuElement}
|
|
202
207
|
class="dropdown-menu-content"
|
|
203
208
|
style:max-width={maxWidth}
|
|
209
|
+
style:min-width={minWidth}
|
|
204
210
|
role="menu"
|
|
205
211
|
onfocus={handleItemFocus}
|
|
206
212
|
>
|