noph-ui 0.46.0 → 0.46.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/dist/dialog/Dialog.svelte +4 -2
- package/dist/dialog/types.d.ts +1 -0
- package/dist/list/index.d.ts +1 -0
- package/dist/list/index.js +1 -0
- package/dist/search/Search.svelte +14 -4
- package/dist/search/Search.svelte.d.ts +1 -1
- package/dist/sheet/Sheet.svelte +4 -1
- package/dist/sheet/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
quick = false,
|
|
10
10
|
children,
|
|
11
11
|
headline,
|
|
12
|
+
headlineLevel = 2,
|
|
12
13
|
icon,
|
|
13
14
|
supportingText,
|
|
14
15
|
actions,
|
|
@@ -61,13 +62,14 @@
|
|
|
61
62
|
</div>
|
|
62
63
|
{/if}
|
|
63
64
|
{#if headline}
|
|
64
|
-
<
|
|
65
|
+
<svelte:element
|
|
66
|
+
this={`h${headlineLevel}`}
|
|
65
67
|
id="{uid}-dialog-headline"
|
|
66
68
|
class="np-dialog-headline"
|
|
67
69
|
style={icon ? 'text-align: center' : ''}
|
|
68
70
|
>
|
|
69
71
|
{headline}
|
|
70
|
-
</
|
|
72
|
+
</svelte:element>
|
|
71
73
|
{/if}
|
|
72
74
|
{#if supportingText}
|
|
73
75
|
<p id="{uid}-dialog-supporting-text" class="np-dialog-supporting-text">{supportingText}</p>
|
package/dist/dialog/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { HTMLDialogAttributes } from 'svelte/elements';
|
|
|
3
3
|
export interface DialogProps extends Omit<HTMLDialogAttributes, 'open'> {
|
|
4
4
|
icon?: Snippet;
|
|
5
5
|
headline?: string;
|
|
6
|
+
headlineLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
7
|
supportingText?: string;
|
|
7
8
|
divider?: boolean;
|
|
8
9
|
actions?: Snippet;
|
package/dist/list/index.d.ts
CHANGED
package/dist/list/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { flushSync } from 'svelte'
|
|
3
3
|
import '../internal/focus-ring.css'
|
|
4
4
|
import IconButton from '../button/IconButton.svelte'
|
|
5
5
|
import ArrowBackIcon from '../icons/ArrowBackIcon.svelte'
|
|
@@ -35,11 +35,12 @@
|
|
|
35
35
|
|
|
36
36
|
let pointerFocus = false
|
|
37
37
|
let focusRing = $state(false)
|
|
38
|
+
let pointerInside = false
|
|
38
39
|
|
|
39
|
-
export const show =
|
|
40
|
+
export const show = () => {
|
|
40
41
|
expanded = true
|
|
41
42
|
pointerFocus = true
|
|
42
|
-
|
|
43
|
+
flushSync()
|
|
43
44
|
inputElement?.focus()
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -49,6 +50,14 @@
|
|
|
49
50
|
}
|
|
50
51
|
</script>
|
|
51
52
|
|
|
53
|
+
<svelte:window
|
|
54
|
+
onpointerdown={(event) => {
|
|
55
|
+
pointerInside = event.target instanceof Node && element?.contains(event.target) === true
|
|
56
|
+
}}
|
|
57
|
+
onpointercancel={() => (pointerInside = false)}
|
|
58
|
+
onclick={() => (pointerInside = false)}
|
|
59
|
+
/>
|
|
60
|
+
|
|
52
61
|
<div
|
|
53
62
|
{...attributes}
|
|
54
63
|
bind:this={element}
|
|
@@ -65,7 +74,8 @@
|
|
|
65
74
|
}}
|
|
66
75
|
onfocusout={(event) => {
|
|
67
76
|
const next = event.relatedTarget
|
|
68
|
-
if (expanded && !(next instanceof Node && element?.contains(next)))
|
|
77
|
+
if (expanded && !pointerInside && !(next instanceof Node && element?.contains(next)))
|
|
78
|
+
expanded = false
|
|
69
79
|
attributes.onfocusout?.(event)
|
|
70
80
|
}}
|
|
71
81
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../internal/focus-ring.css';
|
|
2
2
|
import type { SearchProps } from './types.ts';
|
|
3
3
|
declare const Search: import("svelte").Component<SearchProps, {
|
|
4
|
-
show: () =>
|
|
4
|
+
show: () => void;
|
|
5
5
|
close: () => void;
|
|
6
6
|
}, "element" | "value" | "inputElement" | "expanded">;
|
|
7
7
|
type Search = ReturnType<typeof Search>;
|
package/dist/sheet/Sheet.svelte
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
placement = 'bottom',
|
|
9
9
|
handle = true,
|
|
10
10
|
headline,
|
|
11
|
+
headlineLevel = 2,
|
|
11
12
|
action,
|
|
12
13
|
children,
|
|
13
14
|
element = $bindable(),
|
|
@@ -63,7 +64,9 @@
|
|
|
63
64
|
{#if headline || action}
|
|
64
65
|
<div class="np-sheet-header">
|
|
65
66
|
{#if headline}
|
|
66
|
-
<
|
|
67
|
+
<svelte:element this={`h${headlineLevel}`} id={headlineId} class="np-sheet-headline">
|
|
68
|
+
{headline}
|
|
69
|
+
</svelte:element>
|
|
67
70
|
{/if}
|
|
68
71
|
{#if action}
|
|
69
72
|
<div class="np-sheet-action">{@render action()}</div>
|
package/dist/sheet/types.d.ts
CHANGED