@sveltia/ui 0.25.12 → 0.25.14
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.
|
@@ -11,11 +11,21 @@
|
|
|
11
11
|
import Menu from './menu.svelte';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @import {
|
|
14
|
+
* @import {
|
|
15
|
+
* ButtonProps,
|
|
16
|
+
* CommonEventHandlers,
|
|
17
|
+
* MenuItemProps,
|
|
18
|
+
* PopupPosition,
|
|
19
|
+
* } from '../../typedefs';
|
|
15
20
|
*/
|
|
16
21
|
|
|
17
22
|
/**
|
|
18
|
-
* @
|
|
23
|
+
* @typedef {object} Props
|
|
24
|
+
* @property {PopupPosition} [popupPosition] Where to show the dropdown menu.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @type {ButtonProps & MenuItemProps & CommonEventHandlers & Props & Record<string, any>}
|
|
19
29
|
*/
|
|
20
30
|
let {
|
|
21
31
|
/* eslint-disable prefer-const */
|
|
@@ -24,6 +34,7 @@
|
|
|
24
34
|
hidden = false,
|
|
25
35
|
disabled = false,
|
|
26
36
|
label = '',
|
|
37
|
+
popupPosition = 'right-top', // @todo Make this auto detect
|
|
27
38
|
children: _children,
|
|
28
39
|
startIcon: _startIcon,
|
|
29
40
|
endIcon: _endIcon,
|
|
@@ -130,7 +141,7 @@
|
|
|
130
141
|
<Popup
|
|
131
142
|
anchor={buttonElement}
|
|
132
143
|
parentDialogElement={dialogElement}
|
|
133
|
-
position=
|
|
144
|
+
position={popupPosition}
|
|
134
145
|
bind:open={isPopupOpen}
|
|
135
146
|
bind:hovered={isPopupHovered}
|
|
136
147
|
>
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
export default MenuItem;
|
|
2
2
|
type MenuItem = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<ButtonProps & MenuItemProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Record<string, any>>): void;
|
|
4
|
+
$set?(props: Partial<ButtonProps & MenuItemProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Props & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* A menu item widget.
|
|
8
8
|
* @see https://w3c.github.io/aria/#menuitem
|
|
9
9
|
*/
|
|
10
|
-
declare const MenuItem: import("svelte").Component<ButtonProps & MenuItemProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers &
|
|
10
|
+
declare const MenuItem: import("svelte").Component<ButtonProps & MenuItemProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & {
|
|
11
|
+
/**
|
|
12
|
+
* Where to show the dropdown menu.
|
|
13
|
+
*/
|
|
14
|
+
popupPosition?: PopupPosition | undefined;
|
|
15
|
+
} & Record<string, any>, {}, "">;
|
|
16
|
+
type Props = {
|
|
17
|
+
/**
|
|
18
|
+
* Where to show the dropdown menu.
|
|
19
|
+
*/
|
|
20
|
+
popupPosition?: PopupPosition | undefined;
|
|
21
|
+
};
|
|
11
22
|
import type { ButtonProps } from '../../typedefs';
|
|
12
23
|
import type { MenuItemProps } from '../../typedefs';
|
|
24
|
+
import type { PopupPosition } from '../../typedefs';
|
|
@@ -190,6 +190,7 @@
|
|
|
190
190
|
class="combobox"
|
|
191
191
|
{anchor}
|
|
192
192
|
{position}
|
|
193
|
+
showBackdrop={true}
|
|
193
194
|
touchOptimized={true}
|
|
194
195
|
bind:open={isPopupOpen}
|
|
195
196
|
onOpen={() => {
|
|
@@ -296,11 +297,12 @@
|
|
|
296
297
|
border-color: var(--sui-error-border-color);
|
|
297
298
|
}
|
|
298
299
|
.combobox div[role=combobox] .label {
|
|
299
|
-
display:
|
|
300
|
+
display: -webkit-box;
|
|
301
|
+
-webkit-box-orient: vertical;
|
|
302
|
+
-webkit-line-clamp: 1;
|
|
303
|
+
line-clamp: 1;
|
|
300
304
|
overflow: hidden;
|
|
301
305
|
width: 100%;
|
|
302
|
-
white-space: nowrap;
|
|
303
|
-
text-overflow: ellipsis;
|
|
304
306
|
}
|
|
305
307
|
.combobox :global(.text-input) {
|
|
306
308
|
margin: 0 !important;
|
|
@@ -50,6 +50,12 @@
|
|
|
50
50
|
padding: 8px;
|
|
51
51
|
background-color: var(--sui-tertiary-background-color);
|
|
52
52
|
}
|
|
53
|
+
@media (width < 768px) {
|
|
54
|
+
.wrapper :global([role="toolbar"]) {
|
|
55
|
+
flex-wrap: wrap;
|
|
56
|
+
height: auto;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
53
59
|
.wrapper :global(.sui.menu-button) {
|
|
54
60
|
padding: 0 4px;
|
|
55
61
|
}
|