@axel669/zephyr 0.4.7 → 0.5.0-alpha.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 +41 -40
- 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 +7 -7
- 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/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 +24 -16
- package/src/data-display/tooltip.svelte +11 -9
- package/src/dialogs/alert.svelte +19 -12
- package/src/dialogs/confirm.svelte +22 -16
- package/src/{hash.js → hash.svelte.js} +9 -0
- package/src/{index.mjs → index.js} +12 -11
- 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 +47 -18
- package/src/layout/flex.svelte +13 -11
- package/src/layout/grid.svelte +17 -15
- package/src/layout/modal.svelte +36 -26
- package/src/layout/paper.svelte +42 -33
- package/src/layout/screen.svelte +13 -9
- package/src/props.js +24 -0
- package/src/routing/route.svelte +31 -15
- 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/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
- /package/src/{wsx.mjs → wsx.js} +0 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
5
|
-
import { handler$ } from "../handler$.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
|
+
import { handler$ } from "../handler$.js"
|
|
6
4
|
|
|
7
5
|
import Flex from "../layout/flex.svelte"
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
let {
|
|
8
|
+
layout = Flex,
|
|
9
|
+
options = [],
|
|
10
|
+
value = $bindable(),
|
|
11
|
+
...rest
|
|
12
|
+
} = $props()
|
|
13
|
+
|
|
14
|
+
const Layout = $derived(layout)
|
|
12
15
|
</script>
|
|
13
16
|
|
|
14
|
-
<
|
|
15
|
-
{#each options as {value: itemValue, label, disabled, ...wind}, index (
|
|
17
|
+
<Layout {...rest}>
|
|
18
|
+
{#each options as {value: itemValue, label, disabled, ...wind}, index (itemValue)}
|
|
16
19
|
<label use:wsx={{"@@toggle": true, ...wind}} {disabled}>
|
|
17
20
|
<span>{label}</span>
|
|
18
21
|
<input type="radio" value={itemValue} bind:group={value} />
|
|
19
22
|
</label>
|
|
20
23
|
{/each}
|
|
21
|
-
</
|
|
24
|
+
</Layout>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
<script context="module">
|
|
1
|
+
<script module>
|
|
4
2
|
const groupOptions = (options) => options.reduce(
|
|
5
3
|
({grouped, target = grouped}, item, pos) => {
|
|
6
4
|
const opt = { ... item, pos }
|
|
@@ -17,34 +15,41 @@
|
|
|
17
15
|
</script>
|
|
18
16
|
|
|
19
17
|
<script>
|
|
20
|
-
import wsx from "../wsx.
|
|
18
|
+
import wsx from "../wsx.js"
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
let {
|
|
21
|
+
disabled = false,
|
|
22
|
+
color = "@default",
|
|
23
|
+
flat = false,
|
|
24
|
+
label = null,
|
|
25
|
+
options = [],
|
|
26
|
+
value = $bindable(),
|
|
27
|
+
...rest
|
|
28
|
+
} = $props()
|
|
28
29
|
|
|
29
30
|
const update = (evt) => value = options[evt.target.value].value
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
const indexValue = $derived(
|
|
33
|
+
options.findIndex(item => item.value === value)
|
|
34
|
+
)
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
const grouped = $derived(
|
|
37
|
+
groupOptions(options)
|
|
38
|
+
)
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
const wind = $derived({
|
|
36
41
|
"@@control": true,
|
|
37
42
|
"$flat": flat,
|
|
38
43
|
"$color": color,
|
|
39
|
-
|
|
40
|
-
}
|
|
44
|
+
...rest,
|
|
45
|
+
})
|
|
41
46
|
</script>
|
|
42
47
|
|
|
43
48
|
<label use:wsx={wind}>
|
|
44
49
|
{#if label}
|
|
45
50
|
<span ws-x="[$label]">{label}</span>
|
|
46
51
|
{/if}
|
|
47
|
-
<select value={indexValue}
|
|
52
|
+
<select value={indexValue} oninput={update} {disabled}>
|
|
48
53
|
{#each grouped as item, index}
|
|
49
54
|
{#if Array.isArray(item) === false}
|
|
50
55
|
<option value={item.pos}>
|
package/src/control/tabs.svelte
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
2
|
import { writable } from "svelte/store"
|
|
5
3
|
|
|
6
|
-
import wsx from "../wsx.
|
|
7
|
-
import { handler$ } from "../handler$.
|
|
4
|
+
import wsx from "../wsx.js"
|
|
5
|
+
import { handler$ } from "../handler$.js"
|
|
6
|
+
import { splitProps } from "../props.js"
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
let {
|
|
9
|
+
color = "@default",
|
|
10
|
+
fill = false,
|
|
11
|
+
options = [],
|
|
12
|
+
value = $bindable(),
|
|
13
|
+
vertical = false,
|
|
14
|
+
...rest
|
|
15
|
+
} = $props()
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
const props = $derived(
|
|
18
|
+
splitProps(rest, "t!")
|
|
19
|
+
)
|
|
20
|
+
const wind = $derived({
|
|
16
21
|
"$fill": fill,
|
|
17
22
|
"$color": color,
|
|
18
23
|
$vert: vertical,
|
|
19
|
-
|
|
20
|
-
}
|
|
24
|
+
...props.rest,
|
|
25
|
+
})
|
|
21
26
|
</script>
|
|
22
27
|
|
|
23
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
24
28
|
<ws-tabs use:wsx={wind} role="tablist">
|
|
25
29
|
{#each options as tab, i}
|
|
26
30
|
<label>
|
|
27
31
|
<input type="radio" value={tab.value} bind:group={value} />
|
|
28
|
-
<ws-tab>{tab.label}</ws-tab>
|
|
32
|
+
<ws-tab use:wsx={props["t!"]}>{tab.label}</ws-tab>
|
|
29
33
|
</label>
|
|
30
34
|
{/each}
|
|
31
35
|
</ws-tabs>
|
|
@@ -1,49 +1,60 @@
|
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
let {
|
|
5
|
+
color = "@default",
|
|
6
|
+
checkbox = false,
|
|
7
|
+
checked = $bindable(),
|
|
8
|
+
flat = false,
|
|
9
|
+
group = $bindable(),
|
|
10
|
+
label = "",
|
|
11
|
+
reverse = false,
|
|
12
|
+
value,
|
|
13
|
+
children,
|
|
14
|
+
...rest
|
|
15
|
+
} = $props()
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
const container = $derived({
|
|
16
18
|
"@@toggle": true,
|
|
17
19
|
"$flat": flat,
|
|
18
20
|
"$color": color,
|
|
19
21
|
"fl.dir": reverse ? "row-reverse" : false,
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
22
|
+
...rest,
|
|
23
|
+
})
|
|
24
|
+
const input = $derived({
|
|
23
25
|
"@@switch": checkbox === false
|
|
24
|
-
}
|
|
26
|
+
})
|
|
25
27
|
|
|
26
28
|
const updateGroup = (checked) => {
|
|
29
|
+
if (Array.isArray(group) === false) {
|
|
30
|
+
return
|
|
31
|
+
}
|
|
27
32
|
if (checked === true) {
|
|
28
33
|
if (group.includes(value) === true) {
|
|
29
34
|
return
|
|
30
35
|
}
|
|
31
|
-
group
|
|
36
|
+
group.push(value)
|
|
32
37
|
return
|
|
33
38
|
}
|
|
34
39
|
if (group.includes(value) === false) {
|
|
35
40
|
return
|
|
36
41
|
}
|
|
37
|
-
group
|
|
42
|
+
group.splice(group.indexOf(value), 1)
|
|
43
|
+
}
|
|
44
|
+
const get = () => checked
|
|
45
|
+
const set = (next) => {
|
|
46
|
+
checked = next
|
|
47
|
+
updateGroup(next)
|
|
38
48
|
}
|
|
39
|
-
$: updateGroup(checked)
|
|
40
49
|
</script>
|
|
41
50
|
|
|
42
51
|
<label use:wsx={container}>
|
|
43
52
|
<div>
|
|
44
|
-
|
|
53
|
+
{#if children}
|
|
54
|
+
{@render children()}
|
|
55
|
+
{:else}
|
|
45
56
|
{label}
|
|
46
|
-
|
|
57
|
+
{/if}
|
|
47
58
|
</div>
|
|
48
|
-
<input type="checkbox" bind:checked use:wsx={input} />
|
|
59
|
+
<input type="checkbox" bind:checked={get,set} use:wsx={input} />
|
|
49
60
|
</label>
|
|
@@ -1,24 +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
|
-
|
|
4
|
+
let {
|
|
5
|
+
alt = "",
|
|
6
|
+
image = null,
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
text = "",
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
color = false,
|
|
11
|
+
...rest
|
|
12
|
+
} = $props()
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
const wind = $derived({
|
|
14
15
|
"$color": color,
|
|
15
|
-
|
|
16
|
-
}
|
|
16
|
+
...rest
|
|
17
|
+
})
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
20
|
<ws-avatar use:wsx={wind}>
|
|
20
21
|
{#if image !== null}
|
|
21
|
-
<!-- svelte-ignore
|
|
22
|
+
<!-- svelte-ignore a11y_missing_attribute -->
|
|
22
23
|
<object data={image} type="image/png">
|
|
23
24
|
{alt}
|
|
24
25
|
</object>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
let {
|
|
5
|
+
color = null,
|
|
6
|
+
text = "",
|
|
7
|
+
children,
|
|
8
|
+
...rest
|
|
9
|
+
} = $props()
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
const wind = $derived({ "$color": color, ...rest })
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
14
|
<ws-badge ws-text={text} use:wsx={wind}>
|
|
13
|
-
|
|
15
|
+
{@render children?.()}
|
|
14
16
|
</ws-badge>
|
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
5
|
-
import variant from "../variant.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
|
+
import variant from "../variant.js"
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let {
|
|
6
|
+
color = "@default",
|
|
7
|
+
clickable = false,
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
fill = false,
|
|
10
|
+
outline = false,
|
|
11
|
+
flat = false,
|
|
12
|
+
children,
|
|
13
|
+
onclick,
|
|
14
|
+
...rest
|
|
15
|
+
} = $props()
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
const type = $derived(
|
|
18
|
+
variant(
|
|
19
|
+
"$outline",
|
|
20
|
+
{ fill },
|
|
21
|
+
{ outline },
|
|
22
|
+
{ flat },
|
|
23
|
+
)
|
|
24
|
+
)
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
const wind = $derived({
|
|
17
27
|
[type]: true,
|
|
18
28
|
"$color": color,
|
|
19
29
|
"@@click": clickable,
|
|
20
|
-
|
|
21
|
-
}
|
|
30
|
+
...rest
|
|
31
|
+
})
|
|
22
32
|
</script>
|
|
23
33
|
|
|
24
|
-
<!-- svelte-ignore
|
|
25
|
-
<!-- svelte-ignore
|
|
26
|
-
<ws-chip use:wsx={wind}
|
|
27
|
-
|
|
34
|
+
<!-- svelte-ignore a11y_interactive_supports_focus -->
|
|
35
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
36
|
+
<ws-chip use:wsx={wind} {onclick} role="button">
|
|
37
|
+
{@render children?.()}
|
|
28
38
|
</ws-chip>
|
|
@@ -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,45 @@
|
|
|
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
|
+
header,
|
|
9
|
+
row,
|
|
10
|
+
emptyRow,
|
|
11
|
+
...rest
|
|
12
|
+
} = $props()
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
const wind = $derived({
|
|
11
15
|
"$color": color,
|
|
12
16
|
"$header-fill": fillHeader,
|
|
13
|
-
|
|
14
|
-
}
|
|
17
|
+
...rest,
|
|
18
|
+
})
|
|
15
19
|
</script>
|
|
16
20
|
|
|
17
21
|
<table use:wsx={wind}>
|
|
18
22
|
<thead>
|
|
19
|
-
|
|
23
|
+
{#if header}
|
|
24
|
+
{@render header()}
|
|
25
|
+
{:else}
|
|
20
26
|
<tr>
|
|
21
27
|
<th>No Header Template</th>
|
|
22
28
|
</tr>
|
|
23
|
-
|
|
29
|
+
{/if}
|
|
24
30
|
</thead>
|
|
25
31
|
<tbody>
|
|
26
|
-
{#each data as
|
|
27
|
-
{#if
|
|
28
|
-
|
|
32
|
+
{#each data as rowValue, rowNum}
|
|
33
|
+
{#if rowValue === undefined}
|
|
34
|
+
{@render emptyRow(rowNum)}
|
|
29
35
|
{:else}
|
|
30
|
-
|
|
36
|
+
{#if row}
|
|
37
|
+
{@render row(rowValue, rowNum)}
|
|
38
|
+
{:else}
|
|
31
39
|
<tr>
|
|
32
40
|
<td>No Row Template</td>
|
|
33
41
|
</tr>
|
|
34
|
-
|
|
42
|
+
{/if}
|
|
35
43
|
{/if}
|
|
36
44
|
{/each}
|
|
37
45
|
</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,37 @@
|
|
|
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
|
+
...rest
|
|
16
|
+
} = $props()
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
19
|
<Dialog card {color}>
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
{#snippet header()}
|
|
21
|
+
<Titlebar {color}>
|
|
22
|
+
{#snippet title()}
|
|
23
|
+
<Text title>
|
|
21
24
|
<Icon name={icon}>
|
|
22
|
-
{
|
|
25
|
+
{titleText}
|
|
23
26
|
</Icon>
|
|
24
27
|
</Text>
|
|
28
|
+
{/snippet}
|
|
25
29
|
</Titlebar>
|
|
30
|
+
{/snippet}
|
|
26
31
|
|
|
27
32
|
<Text>
|
|
28
33
|
{message}
|
|
29
34
|
</Text>
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
{#snippet footer()}
|
|
37
|
+
<Button onclick={close} {color} ground>
|
|
32
38
|
{okText}
|
|
33
39
|
</Button>
|
|
40
|
+
{/snippet}
|
|
34
41
|
</Dialog>
|