@axel669/zephyr 0.4.7 → 0.5.4
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 +12 -10
- package/readme.md +8 -1
- package/src/async/button.svelte +17 -13
- package/src/async/suspend.svelte +38 -0
- package/src/changed.js +10 -0
- package/src/composed/data-table/th.svelte +2 -2
- package/src/composed/data-table.svelte +154 -180
- package/src/composed/entry-button.svelte +13 -16
- package/src/control/button.svelte +26 -22
- package/src/control/input.svelte +52 -50
- package/src/control/label.svelte +28 -24
- package/src/control/link.svelte +36 -30
- package/src/control/radio-group.svelte +13 -10
- package/src/control/select.svelte +21 -16
- package/src/control/tabs.svelte +18 -14
- package/src/control/toggle.svelte +33 -22
- package/src/custom-macros.js +9 -0
- package/src/data-display/avatar.svelte +12 -11
- package/src/data-display/badge.svelte +9 -7
- package/src/data-display/chip.svelte +27 -17
- package/src/data-display/details.svelte +22 -14
- package/src/data-display/popover.svelte +12 -9
- package/src/data-display/progress.svelte +17 -13
- package/src/data-display/table.svelte +29 -17
- package/src/data-display/tooltip.svelte +11 -9
- package/src/dialogs/alert.svelte +18 -12
- package/src/dialogs/confirm.svelte +22 -16
- package/src/{hash.js → hash.svelte.js} +9 -0
- package/src/{index.mjs → index.js} +10 -10
- package/src/{composed/element-toast.svelte → info/element-toaster.svelte} +41 -27
- package/src/info/icon.svelte +4 -4
- package/src/info/titlebar.svelte +20 -14
- package/src/info/toast.svelte +35 -0
- package/src/info/toaster/message.svelte +42 -0
- package/src/info/toaster.svelte +64 -6
- package/src/layout/dialog.svelte +10 -12
- package/src/layout/drawer.svelte +45 -18
- package/src/layout/flex.svelte +13 -11
- package/src/layout/grid.svelte +17 -15
- package/src/layout/modal.svelte +34 -26
- package/src/layout/paper.svelte +31 -33
- package/src/layout/screen.svelte +13 -9
- package/src/props.js +24 -0
- package/src/routing/route.svelte +29 -16
- package/src/routing/{routing.js → routing.svelte.js} +10 -1
- package/src/routing/title.svelte +8 -6
- package/src/spinner/circle-spinner.svelte +10 -8
- package/src/spinner/hexagon-spinner.svelte +10 -8
- package/src/text.svelte +6 -10
- package/src/wind.js +4 -0
- package/src/{wsx.mjs → wsx.js} +1 -1
- package/src/async/load-zone.svelte +0 -22
- package/src/composed/toast/message.svelte +0 -33
- package/src/composed/toast.svelte +0 -70
- package/src/info/notification.svelte +0 -28
- package/src/inline-dialog.svelte +0 -23
- /package/src/{handler$.mjs → handler$.js} +0 -0
- /package/src/{variant.mjs → variant.js} +0 -0
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
|
+
import { splitProps } from "../props.js"
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
let {
|
|
6
|
+
label,
|
|
7
|
+
outline,
|
|
8
|
+
color = "@default",
|
|
9
|
+
open = false,
|
|
10
|
+
children,
|
|
11
|
+
...rest
|
|
12
|
+
} = $props()
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
const props = $derived(
|
|
15
|
+
splitProps(rest, "s!")
|
|
16
|
+
)
|
|
17
|
+
const wind = $derived({
|
|
12
18
|
"$color": color,
|
|
13
19
|
"$outline": outline,
|
|
14
|
-
|
|
15
|
-
}
|
|
20
|
+
...props.rest,
|
|
21
|
+
})
|
|
16
22
|
</script>
|
|
17
23
|
|
|
18
24
|
<details use:wsx={wind} bind:open>
|
|
19
|
-
<summary>
|
|
20
|
-
|
|
25
|
+
<summary use:wsx={props["s!"]}>
|
|
26
|
+
{#if typeof label === "string"}
|
|
21
27
|
{label}
|
|
22
|
-
|
|
28
|
+
{:else}
|
|
29
|
+
{@render label?.()}
|
|
30
|
+
{/if}
|
|
23
31
|
</summary>
|
|
24
|
-
|
|
32
|
+
{@render children?.()}
|
|
25
33
|
</details>
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
2
|
import { fade } from "svelte/transition"
|
|
5
|
-
import wsx from "../wsx.
|
|
3
|
+
import wsx from "../wsx.js"
|
|
6
4
|
|
|
7
|
-
let
|
|
5
|
+
let {
|
|
6
|
+
visible = $bindable(false),
|
|
7
|
+
content,
|
|
8
|
+
popover,
|
|
9
|
+
...rest
|
|
10
|
+
} = $props()
|
|
8
11
|
const show = () => visible = true
|
|
9
12
|
const hide = () => visible = false
|
|
10
13
|
const anim = { duration: 250 }
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
const wind = $derived({
|
|
13
16
|
$show: true,
|
|
14
|
-
|
|
15
|
-
}
|
|
17
|
+
...rest,
|
|
18
|
+
})
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
21
|
<ws-popover use:wsx={wind}>
|
|
19
|
-
|
|
22
|
+
{@render content?.(show)}
|
|
20
23
|
{#if visible}
|
|
21
24
|
<wind-content ws-x="[$content] [inset 0px]" transition:fade={anim}>
|
|
22
|
-
|
|
25
|
+
{@render popover?.(hide)}
|
|
23
26
|
</wind-content>
|
|
24
27
|
{/if}
|
|
25
28
|
</ws-popover>
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
const {
|
|
5
|
+
buffer = 0,
|
|
6
|
+
busy = false,
|
|
7
|
+
color = "@default",
|
|
8
|
+
max = 1,
|
|
9
|
+
min = 0,
|
|
10
|
+
value = 0,
|
|
11
|
+
...rest
|
|
12
|
+
} = $props()
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
const wind = $derived({
|
|
14
15
|
"$color": color,
|
|
15
|
-
|
|
16
|
-
}
|
|
16
|
+
...rest,
|
|
17
|
+
})
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
const busyStatus = $derived(
|
|
20
|
+
(busy === true) ? { busy: true } : {}
|
|
21
|
+
)
|
|
19
22
|
</script>
|
|
20
23
|
|
|
24
|
+
<!-- svelte-ignore element_invalid_self_closing_tag -->
|
|
21
25
|
<ws-progress use:wsx={wind} {...busyStatus} {min} {max} {value} {buffer} />
|
|
@@ -1,37 +1,49 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const {
|
|
5
|
+
color = "@default",
|
|
6
|
+
data = [],
|
|
7
|
+
fillHeader = false,
|
|
8
|
+
stickyHeader = false,
|
|
9
|
+
cols = "1fr",
|
|
10
|
+
header,
|
|
11
|
+
row,
|
|
12
|
+
emptyRow,
|
|
13
|
+
...rest
|
|
14
|
+
} = $props()
|
|
9
15
|
|
|
10
|
-
|
|
16
|
+
const wind = $derived({
|
|
11
17
|
"$color": color,
|
|
12
|
-
"$header
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
"$fill-header": fillHeader,
|
|
19
|
+
"$sticky-header": stickyHeader,
|
|
20
|
+
"gr.cols": cols,
|
|
21
|
+
...rest,
|
|
22
|
+
})
|
|
15
23
|
</script>
|
|
16
24
|
|
|
17
25
|
<table use:wsx={wind}>
|
|
18
26
|
<thead>
|
|
19
|
-
|
|
27
|
+
{#if header}
|
|
28
|
+
{@render header()}
|
|
29
|
+
{:else}
|
|
20
30
|
<tr>
|
|
21
31
|
<th>No Header Template</th>
|
|
22
32
|
</tr>
|
|
23
|
-
|
|
33
|
+
{/if}
|
|
24
34
|
</thead>
|
|
25
35
|
<tbody>
|
|
26
|
-
{#each data as
|
|
27
|
-
{#if
|
|
28
|
-
|
|
36
|
+
{#each data as rowValue, rowNum}
|
|
37
|
+
{#if rowValue === undefined}
|
|
38
|
+
{@render emptyRow(rowNum)}
|
|
29
39
|
{:else}
|
|
30
|
-
|
|
40
|
+
{#if row}
|
|
41
|
+
{@render row(rowValue, rowNum)}
|
|
42
|
+
{:else}
|
|
31
43
|
<tr>
|
|
32
44
|
<td>No Row Template</td>
|
|
33
45
|
</tr>
|
|
34
|
-
|
|
46
|
+
{/if}
|
|
35
47
|
{/if}
|
|
36
48
|
{/each}
|
|
37
49
|
</tbody>
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const {
|
|
5
|
+
text = "",
|
|
6
|
+
bottom = false,
|
|
7
|
+
children,
|
|
8
|
+
...rest
|
|
9
|
+
} = $props()
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
const wind = $derived({
|
|
10
12
|
$bottom: bottom,
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
+
...rest,
|
|
14
|
+
})
|
|
13
15
|
</script>
|
|
14
16
|
|
|
15
17
|
<ws-tooltip ws-text={text} use:wsx={wind}>
|
|
16
|
-
|
|
18
|
+
{@render children?.()}
|
|
17
19
|
</ws-tooltip>
|
package/src/dialogs/alert.svelte
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
2
|
import Button from "../control/button.svelte"
|
|
5
3
|
import Dialog from "../layout/dialog.svelte"
|
|
@@ -7,28 +5,36 @@
|
|
|
7
5
|
import Text from "../text.svelte"
|
|
8
6
|
import Titlebar from "../info/titlebar.svelte"
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
const {
|
|
9
|
+
close,
|
|
10
|
+
color = "@primary",
|
|
11
|
+
icon,
|
|
12
|
+
message,
|
|
13
|
+
okText = "OK",
|
|
14
|
+
titleText = "Alert",
|
|
15
|
+
} = $props()
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<Dialog card {color}>
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
{#snippet header()}
|
|
20
|
+
<Titlebar {color}>
|
|
21
|
+
{#snippet title()}
|
|
22
|
+
<Text title>
|
|
21
23
|
<Icon name={icon}>
|
|
22
|
-
{
|
|
24
|
+
{titleText}
|
|
23
25
|
</Icon>
|
|
24
26
|
</Text>
|
|
27
|
+
{/snippet}
|
|
25
28
|
</Titlebar>
|
|
29
|
+
{/snippet}
|
|
26
30
|
|
|
27
31
|
<Text>
|
|
28
32
|
{message}
|
|
29
33
|
</Text>
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
{#snippet footer()}
|
|
36
|
+
<Button onclick={close} {color} ground>
|
|
32
37
|
{okText}
|
|
33
38
|
</Button>
|
|
39
|
+
{/snippet}
|
|
34
40
|
</Dialog>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
2
|
import Button from "../control/button.svelte"
|
|
5
3
|
import Dialog from "../layout/dialog.svelte"
|
|
@@ -8,38 +6,46 @@
|
|
|
8
6
|
import Text from "../text.svelte"
|
|
9
7
|
import Titlebar from "../info/titlebar.svelte"
|
|
10
8
|
|
|
11
|
-
import { handler$ } from "../handler$.
|
|
9
|
+
import { handler$ } from "../handler$.js"
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const {
|
|
12
|
+
close,
|
|
13
|
+
titleText = "Confirm",
|
|
14
|
+
icon,
|
|
15
|
+
message,
|
|
16
|
+
okText = "OK",
|
|
17
|
+
cancelText = "Cancel",
|
|
18
|
+
color = "@primary",
|
|
19
|
+
} = $props()
|
|
20
20
|
|
|
21
21
|
const cls = handler$(close)
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
24
|
<Dialog card {color}>
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
{#snippet header()}
|
|
26
|
+
<Titlebar {color}>
|
|
27
|
+
{#snippet title()}
|
|
28
|
+
<Text title>
|
|
27
29
|
<Icon name={icon}>
|
|
28
|
-
{
|
|
30
|
+
{titleText}
|
|
29
31
|
</Icon>
|
|
30
32
|
</Text>
|
|
33
|
+
{/snippet}
|
|
31
34
|
</Titlebar>
|
|
35
|
+
{/snippet}
|
|
32
36
|
|
|
33
37
|
<Text>
|
|
34
38
|
{message}
|
|
35
39
|
</Text>
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
{#snippet footer()}
|
|
42
|
+
<Grid cols="1fr 1fr" p="0px">
|
|
43
|
+
<Button onclick={cls(false)} color="@danger" ground>
|
|
39
44
|
{cancelText}
|
|
40
45
|
</Button>
|
|
41
|
-
<Button
|
|
46
|
+
<Button onclick={cls(true)} color="@secondary" ground>
|
|
42
47
|
{okText}
|
|
43
48
|
</Button>
|
|
44
49
|
</Grid>
|
|
50
|
+
{/snippet}
|
|
45
51
|
</Dialog>
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { readable } from "svelte/store"
|
|
2
2
|
|
|
3
|
+
// export const hash = $state(location.hash.slice(1))
|
|
4
|
+
// window.addEventListener(
|
|
5
|
+
// "popstate",
|
|
6
|
+
// () => hashValue = location.hash.slice(1)
|
|
7
|
+
// )
|
|
8
|
+
// $effect(
|
|
9
|
+
// () => location.hash = hash
|
|
10
|
+
// )
|
|
11
|
+
|
|
3
12
|
export const hash = readable(
|
|
4
13
|
location.hash.slice(1),
|
|
5
14
|
(set) => {
|
|
@@ -17,9 +17,10 @@ export { default as Progress } from "./data-display/progress.svelte"
|
|
|
17
17
|
export { default as Table } from "./data-display/table.svelte"
|
|
18
18
|
export { default as Tooltip } from "./data-display/tooltip.svelte"
|
|
19
19
|
|
|
20
|
+
export { default as ElementToaster } from "./info/element-toaster.svelte"
|
|
20
21
|
export { default as Icon } from "./info/icon.svelte"
|
|
21
|
-
export { default as Notification } from "./info/notification.svelte"
|
|
22
22
|
export { default as Titlebar } from "./info/titlebar.svelte"
|
|
23
|
+
export { default as Toast } from "./info/toast.svelte"
|
|
23
24
|
export { default as Toaster } from "./info/toaster.svelte"
|
|
24
25
|
|
|
25
26
|
export { default as Dialog } from "./layout/dialog.svelte"
|
|
@@ -39,26 +40,25 @@ export { default as Alert } from "./dialogs/alert.svelte"
|
|
|
39
40
|
export { default as Confirm } from "./dialogs/confirm.svelte"
|
|
40
41
|
|
|
41
42
|
export { default as DataTable } from "./composed/data-table.svelte"
|
|
42
|
-
export { default as TH } from "./composed/data-table/th.svelte"
|
|
43
|
-
export { default as ElementToast } from "./composed/element-toast.svelte"
|
|
43
|
+
// export { default as TH } from "./composed/data-table/th.svelte"
|
|
44
44
|
export { default as EntryButton } from "./composed/entry-button.svelte"
|
|
45
|
-
export { default as Form } from "./composed/form.svelte"
|
|
46
|
-
export { default as Toast } from "./composed/toast.svelte"
|
|
45
|
+
// export { default as Form } from "./composed/form.svelte"
|
|
47
46
|
|
|
48
47
|
export { default as AsyncButton } from "./async/button.svelte"
|
|
49
|
-
export { default as
|
|
48
|
+
export { default as Suspend } from "./async/suspend.svelte"
|
|
50
49
|
|
|
51
50
|
export { default as Route } from "./routing/route.svelte"
|
|
52
51
|
export { default as Title } from "./routing/title.svelte"
|
|
53
52
|
|
|
54
|
-
export { default as wsx } from "./wsx.
|
|
53
|
+
export { default as wsx } from "./wsx.js"
|
|
55
54
|
|
|
56
|
-
export { hash } from "./hash.js"
|
|
55
|
+
export { hash } from "./hash.svelte.js"
|
|
57
56
|
|
|
58
57
|
export {
|
|
59
58
|
route,
|
|
60
59
|
stackStore,
|
|
61
60
|
relpath,
|
|
62
|
-
} from "./routing/routing.js"
|
|
63
|
-
export * from "./handler$.
|
|
61
|
+
} from "./routing/routing.svelte.js"
|
|
62
|
+
export * from "./handler$.js"
|
|
64
63
|
export * from "./composed/table-functions.js"
|
|
64
|
+
export * from "./changed.js"
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
<script context="module">
|
|
1
|
+
<script module>
|
|
4
2
|
const genID = () => `${Date.now()}:${Math.random().toString(16)}`
|
|
5
3
|
|
|
6
4
|
const delays = {}
|
|
@@ -18,40 +16,59 @@
|
|
|
18
16
|
|
|
19
17
|
const macros = {
|
|
20
18
|
top: {
|
|
19
|
+
x: "50%",
|
|
20
|
+
tf: "translateX(-50%)",
|
|
21
21
|
"-y": "100%",
|
|
22
22
|
flex: "column-reverse",
|
|
23
23
|
},
|
|
24
24
|
bottom: {
|
|
25
|
+
x: "50%",
|
|
26
|
+
tf: "translateX(-50%)",
|
|
25
27
|
"y": "100%",
|
|
26
28
|
flex: "column"
|
|
27
29
|
},
|
|
30
|
+
left: {
|
|
31
|
+
y: "50%",
|
|
32
|
+
tf: "translateY(-50%)",
|
|
33
|
+
"-x": "100%",
|
|
34
|
+
flex: "row-reverse"
|
|
35
|
+
},
|
|
36
|
+
right: {
|
|
37
|
+
y: "50%",
|
|
38
|
+
tf: "translateY(-50%)",
|
|
39
|
+
"x": "100%",
|
|
40
|
+
flex: "row"
|
|
41
|
+
},
|
|
28
42
|
}
|
|
29
43
|
</script>
|
|
30
44
|
|
|
31
45
|
<script>
|
|
32
|
-
import { createEventDispatcher } from "svelte"
|
|
33
46
|
import { fade } from "svelte/transition"
|
|
34
47
|
|
|
35
|
-
import { eventHandler$ } from "../handler$.
|
|
36
|
-
import wsx from "../wsx.
|
|
48
|
+
import { eventHandler$ } from "../handler$.js"
|
|
49
|
+
import wsx from "../wsx.js"
|
|
37
50
|
|
|
38
|
-
import
|
|
51
|
+
import ToastMessage from "./toaster/message.svelte"
|
|
39
52
|
|
|
40
|
-
|
|
53
|
+
const {
|
|
54
|
+
component = ToastMessage,
|
|
55
|
+
position = "top",
|
|
56
|
+
content,
|
|
57
|
+
onaction,
|
|
58
|
+
...rest
|
|
59
|
+
} = $props()
|
|
41
60
|
|
|
42
|
-
|
|
43
|
-
export let position = "top"
|
|
61
|
+
let items = $state([])
|
|
44
62
|
|
|
45
|
-
let items = []
|
|
46
|
-
|
|
47
|
-
const dispatch = createEventDispatcher()
|
|
48
63
|
const act = eventHandler$(
|
|
49
64
|
(evt, id, props) => {
|
|
50
65
|
delay.trigger(id)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
66
|
+
evt.props = props
|
|
67
|
+
onaction?.(evt)
|
|
68
|
+
// dispatch(
|
|
69
|
+
// "action",
|
|
70
|
+
// { value: evt.detail, props }
|
|
71
|
+
// )
|
|
55
72
|
}
|
|
56
73
|
)
|
|
57
74
|
|
|
@@ -68,27 +85,24 @@
|
|
|
68
85
|
}
|
|
69
86
|
export const clear = () => items = []
|
|
70
87
|
|
|
71
|
-
|
|
72
|
-
$: wind = {
|
|
88
|
+
const wind = $derived({
|
|
73
89
|
gap: "8px",
|
|
74
90
|
pos: "absolute",
|
|
75
|
-
x: "50%",
|
|
76
91
|
z: "50",
|
|
77
|
-
tf: "translateX(-50%)",
|
|
78
92
|
...macros[position],
|
|
79
|
-
|
|
80
|
-
}
|
|
93
|
+
...rest,
|
|
94
|
+
})
|
|
95
|
+
const Message = $derived(component)
|
|
81
96
|
</script>
|
|
82
97
|
|
|
83
98
|
<zephyr-element-toaster ws-x="[disp inline-grid] [pos relative]">
|
|
84
|
-
|
|
99
|
+
{@render content?.(show)}
|
|
85
100
|
<zephyr-element-toast-messages use:wsx={wind}>
|
|
86
101
|
{#each items as {props, id} (id)}
|
|
87
102
|
<zephyr-toast-wrapper ws-x="[grid]" transition:fade={{duration: 200}}>
|
|
88
|
-
<
|
|
89
|
-
this={component}
|
|
103
|
+
<Message
|
|
90
104
|
{...props}
|
|
91
|
-
|
|
105
|
+
onaction={act(id, props)}
|
|
92
106
|
/>
|
|
93
107
|
</zephyr-toast-wrapper>
|
|
94
108
|
{/each}
|
package/src/info/icon.svelte
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const { name, children, ...rest } = $props()
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
<ws-icon
|
|
8
|
-
|
|
7
|
+
<ws-icon data-icon={name} use:wsx={rest}>
|
|
8
|
+
{@render children?.()}
|
|
9
9
|
</ws-icon>
|
package/src/info/titlebar.svelte
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const {
|
|
5
|
+
color,
|
|
6
|
+
fill = false,
|
|
7
|
+
title,
|
|
8
|
+
menu,
|
|
9
|
+
action,
|
|
10
|
+
...rest
|
|
11
|
+
} = $props()
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
const titleProps = $derived({
|
|
8
14
|
"$color": color,
|
|
9
15
|
"$fill": fill,
|
|
10
16
|
$title: true,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
17
|
+
})
|
|
18
|
+
const wind = $derived({
|
|
19
|
+
...rest,
|
|
20
|
+
})
|
|
15
21
|
</script>
|
|
16
22
|
|
|
17
23
|
<ws-titlebar use:wsx={wind}>
|
|
18
|
-
{#if
|
|
24
|
+
{#if title}
|
|
19
25
|
<div use:wsx={titleProps}>
|
|
20
|
-
|
|
26
|
+
{@render title()}
|
|
21
27
|
</div>
|
|
22
28
|
{/if}
|
|
23
29
|
|
|
24
|
-
{#if
|
|
30
|
+
{#if menu}
|
|
25
31
|
<div ws-x="[$menu] [grid] [p 0px]">
|
|
26
|
-
|
|
32
|
+
{@render menu()}
|
|
27
33
|
</div>
|
|
28
34
|
{/if}
|
|
29
|
-
{#if
|
|
35
|
+
{#if action}
|
|
30
36
|
<div ws-x="[$action] [grid] [p 0px]">
|
|
31
|
-
|
|
37
|
+
{@render action()}
|
|
32
38
|
</div>
|
|
33
39
|
{/if}
|
|
34
40
|
</ws-titlebar>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
color,
|
|
6
|
+
children,
|
|
7
|
+
start,
|
|
8
|
+
end,
|
|
9
|
+
onclick,
|
|
10
|
+
...rest
|
|
11
|
+
} = $props()
|
|
12
|
+
|
|
13
|
+
const wind = $derived({
|
|
14
|
+
"$color": color,
|
|
15
|
+
...rest,
|
|
16
|
+
})
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<!-- svelte-ignore a11y_interactive_supports_focus -->
|
|
20
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
21
|
+
<ws-toast use:wsx={wind} {onclick} role="button">
|
|
22
|
+
{#if start}
|
|
23
|
+
<div ws-x="[$start] [grid]">
|
|
24
|
+
{@render start()}
|
|
25
|
+
</div>
|
|
26
|
+
{/if}
|
|
27
|
+
<div ws-x="[$notif-text]">
|
|
28
|
+
{@render children?.()}
|
|
29
|
+
</div>
|
|
30
|
+
{#if end}
|
|
31
|
+
<div ws-x="[$end] [grid]">
|
|
32
|
+
{@render end()}
|
|
33
|
+
</div>
|
|
34
|
+
{/if}
|
|
35
|
+
</ws-toast>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Button from "../../control/button.svelte"
|
|
3
|
+
import Icon from "../icon.svelte"
|
|
4
|
+
import Toast from "../toast.svelte"
|
|
5
|
+
import Text from "../../text.svelte"
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
message = "",
|
|
9
|
+
icon = false,
|
|
10
|
+
color = false,
|
|
11
|
+
actionText = null,
|
|
12
|
+
onaction,
|
|
13
|
+
} = $props()
|
|
14
|
+
|
|
15
|
+
const dismiss = () => onaction({ value: null })
|
|
16
|
+
const respond = (evt) => {
|
|
17
|
+
evt.stopPropagation()
|
|
18
|
+
onaction({ value: true })
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Toast {color} onclick={dismiss}>
|
|
23
|
+
{#snippet start()}
|
|
24
|
+
<Text adorn>
|
|
25
|
+
{#if icon !== false}
|
|
26
|
+
<Icon name={icon} />
|
|
27
|
+
{/if}
|
|
28
|
+
</Text>
|
|
29
|
+
{/snippet}
|
|
30
|
+
|
|
31
|
+
<span>{message}</span>
|
|
32
|
+
|
|
33
|
+
{#snippet end()}
|
|
34
|
+
<div ws-x="[grid]">
|
|
35
|
+
{#if actionText}
|
|
36
|
+
<Button onclick={respond} r.l="0px" ground>
|
|
37
|
+
{actionText}
|
|
38
|
+
</Button>
|
|
39
|
+
{/if}
|
|
40
|
+
</div>
|
|
41
|
+
{/snippet}
|
|
42
|
+
</Toast>
|