@axel669/zephyr 0.3.8 → 0.4.4-beta.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 +40 -33
- package/src/async/button.svelte +16 -8
- package/src/composed/data-table/th.svelte +2 -2
- package/src/composed/data-table.svelte +4 -3
- package/src/composed/form.svelte +60 -0
- package/src/composed/table-functions.js +3 -1
- package/src/composed/toast/message.svelte +15 -38
- package/src/control/button.svelte +1 -1
- package/src/control/input.svelte +89 -109
- package/src/control/label.svelte +1 -1
- package/src/control/link.svelte +32 -32
- package/src/control/radio-group.svelte +21 -0
- package/src/control/select.svelte +5 -5
- package/src/control/tabs.svelte +9 -21
- package/src/control/toggle.svelte +2 -2
- package/src/data-display/avatar.svelte +4 -1
- package/src/data-display/badge.svelte +1 -1
- package/src/data-display/chip.svelte +1 -1
- package/src/data-display/popover.svelte +25 -25
- package/src/data-display/progress.svelte +27 -27
- package/src/data-display/table.svelte +1 -1
- package/src/dialogs/confirm.svelte +3 -3
- package/src/hash.js +14 -14
- package/src/index.mjs +11 -1
- package/src/info/notification.svelte +28 -16
- package/src/info/titlebar.svelte +22 -5
- package/src/layout/dialog.svelte +1 -1
- package/src/layout/drawer.svelte +49 -49
- package/src/layout/flex.svelte +0 -4
- package/src/layout/grid.svelte +4 -4
- package/src/layout/paper.svelte +56 -47
- package/src/routing/route.svelte +48 -0
- package/src/routing/routing.js +62 -0
- package/src/routing/title.svelte +26 -0
- package/src/spinner/circle-spinner.svelte +2 -1
- package/src/spinner/hexagon-spinner.svelte +2 -1
- package/src/text.svelte +2 -4
- package/src/wsx.mjs +25 -24
- package/src/async/button.md +0 -27
- package/src/async/load-zone.md +0 -42
- package/src/composed/data-table/th.md +0 -21
- package/src/composed/data-table.md +0 -86
- package/src/composed/entry-button.md +0 -44
- package/src/composed/toast.md +0 -45
- package/src/control/button.md +0 -41
- package/src/control/input.md +0 -87
- package/src/control/label.md +0 -48
- package/src/control/link.md +0 -50
- package/src/control/radio.md +0 -58
- package/src/control/radio.svelte +0 -28
- package/src/control/select.md +0 -70
- package/src/control/tabs.md +0 -47
- package/src/control/toggle.md +0 -61
- package/src/data-display/avatar.md +0 -36
- package/src/data-display/badge.md +0 -30
- package/src/data-display/chip.md +0 -36
- package/src/data-display/details.md +0 -42
- package/src/data-display/popover.md +0 -32
- package/src/data-display/progress.md +0 -46
- package/src/data-display/table.md +0 -59
- package/src/data-display/tooltip.md +0 -29
- package/src/dialogs/alert.md +0 -42
- package/src/dialogs/confirm.md +0 -56
- package/src/functions.md +0 -108
- package/src/info/icon.md +0 -21
- package/src/info/notification.md +0 -36
- package/src/info/titlebar.md +0 -75
- package/src/info/toaster.md +0 -26
- package/src/layout/dialog.md +0 -43
- package/src/layout/drawer.md +0 -70
- package/src/layout/flex.md +0 -43
- package/src/layout/grid.md +0 -61
- package/src/layout/modal.md +0 -50
- package/src/layout/paper.md +0 -94
- package/src/layout/screen.md +0 -33
- package/src/spinner/spinners.md +0 -22
- package/src/text.md +0 -34
package/src/control/tabs.svelte
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
<svelte:options immutable />
|
|
2
2
|
|
|
3
3
|
<script>
|
|
4
|
+
import { writable } from "svelte/store"
|
|
5
|
+
|
|
4
6
|
import wsx from "../wsx.mjs"
|
|
5
7
|
import { handler$ } from "../handler$.mjs"
|
|
6
8
|
|
|
7
|
-
export let color = "@
|
|
9
|
+
export let color = "@default"
|
|
8
10
|
export let options = []
|
|
9
11
|
export let vertical = false
|
|
10
|
-
export let
|
|
12
|
+
export let fill = false
|
|
11
13
|
export let value
|
|
12
14
|
|
|
13
|
-
$: index = options.findIndex(item => item.value === value)
|
|
14
|
-
|
|
15
|
-
const set = handler$(
|
|
16
|
-
(next) => {
|
|
17
|
-
if (value === next) {
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
value = next
|
|
21
|
-
}
|
|
22
|
-
)
|
|
23
|
-
|
|
24
15
|
$: wind = {
|
|
25
|
-
"$
|
|
16
|
+
"$fill": fill,
|
|
26
17
|
"$color": color,
|
|
27
18
|
$vert: vertical,
|
|
28
19
|
...$$restProps,
|
|
@@ -32,12 +23,9 @@
|
|
|
32
23
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
33
24
|
<ws-tabs use:wsx={wind} role="tablist">
|
|
34
25
|
{#each options as tab, i}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{tab.label}
|
|
40
|
-
</slot>
|
|
41
|
-
</ws-tab>
|
|
26
|
+
<label>
|
|
27
|
+
<input type="radio" value={tab.value} bind:group={value} />
|
|
28
|
+
<ws-tab>{tab.label}</ws-tab>
|
|
29
|
+
</label>
|
|
42
30
|
{/each}
|
|
43
31
|
</ws-tabs>
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
export let reverse = false
|
|
14
14
|
|
|
15
15
|
$: container = {
|
|
16
|
-
"
|
|
16
|
+
"@@toggle": true,
|
|
17
17
|
"$flat": flat,
|
|
18
18
|
"$color": color,
|
|
19
19
|
"fl.dir": reverse ? "row-reverse" : false,
|
|
20
20
|
...$$restProps,
|
|
21
21
|
}
|
|
22
22
|
$: input = {
|
|
23
|
-
"
|
|
23
|
+
"@@switch": checkbox === false
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const updateGroup = (checked) => {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import { fade } from "svelte/transition"
|
|
5
|
-
import wsx from "../wsx.mjs"
|
|
6
|
-
|
|
7
|
-
let visible = false
|
|
8
|
-
const show = () => visible = true
|
|
9
|
-
const hide = () => visible = false
|
|
10
|
-
const anim = { duration: 250 }
|
|
11
|
-
|
|
12
|
-
$: wind = {
|
|
13
|
-
$show: true,
|
|
14
|
-
...$$restProps,
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<ws-popover use:wsx={wind}>
|
|
19
|
-
<slot {show} />
|
|
20
|
-
{#if visible}
|
|
21
|
-
<wind-content
|
|
22
|
-
<slot name="content" {hide} />
|
|
23
|
-
</wind-content>
|
|
24
|
-
{/if}
|
|
25
|
-
</ws-popover>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import { fade } from "svelte/transition"
|
|
5
|
+
import wsx from "../wsx.mjs"
|
|
6
|
+
|
|
7
|
+
let visible = false
|
|
8
|
+
const show = () => visible = true
|
|
9
|
+
const hide = () => visible = false
|
|
10
|
+
const anim = { duration: 250 }
|
|
11
|
+
|
|
12
|
+
$: wind = {
|
|
13
|
+
$show: true,
|
|
14
|
+
...$$restProps,
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<ws-popover use:wsx={wind}>
|
|
19
|
+
<slot {show} />
|
|
20
|
+
{#if visible}
|
|
21
|
+
<wind-content ws-x="[$content] [inset 0px]" transition:fade={anim}>
|
|
22
|
+
<slot name="content" {hide} />
|
|
23
|
+
</wind-content>
|
|
24
|
+
{/if}
|
|
25
|
+
</ws-popover>
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
|
|
6
|
-
export let value = 0
|
|
7
|
-
export let max = 1
|
|
8
|
-
export let color = "default"
|
|
9
|
-
export let outline = false
|
|
10
|
-
export let row = false
|
|
11
|
-
export let label = null
|
|
12
|
-
|
|
13
|
-
$: wind = {
|
|
14
|
-
"
|
|
15
|
-
"$outline": outline,
|
|
16
|
-
"$color": color,
|
|
17
|
-
$row: row,
|
|
18
|
-
...$$restProps,
|
|
19
|
-
}
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<label use:wsx={wind}>
|
|
23
|
-
{#if label}
|
|
24
|
-
<span ws-x="[$progress-label] [t
|
|
25
|
-
{/if}
|
|
26
|
-
<progress {value} {max} />
|
|
27
|
-
</label>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
|
|
6
|
+
export let value = 0
|
|
7
|
+
export let max = 1
|
|
8
|
+
export let color = "default"
|
|
9
|
+
export let outline = false
|
|
10
|
+
export let row = false
|
|
11
|
+
export let label = null
|
|
12
|
+
|
|
13
|
+
$: wind = {
|
|
14
|
+
"@@progress": true,
|
|
15
|
+
"$outline": outline,
|
|
16
|
+
"$color": color,
|
|
17
|
+
$row: row,
|
|
18
|
+
...$$restProps,
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<label use:wsx={wind}>
|
|
23
|
+
{#if label}
|
|
24
|
+
<span ws-x="[$progress-label] [t.ws nowrap]">{label}</span>
|
|
25
|
+
{/if}
|
|
26
|
+
<progress {value} {max} />
|
|
27
|
+
</label>
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
{message}
|
|
35
35
|
</Text>
|
|
36
36
|
|
|
37
|
-
<Grid cols="1fr 1fr" slot="footer"
|
|
38
|
-
<Button on:click={cls(false)} color="danger">
|
|
37
|
+
<Grid cols="1fr 1fr" slot="footer" p="0px">
|
|
38
|
+
<Button on:click={cls(false)} color="@danger">
|
|
39
39
|
{cancelText}
|
|
40
40
|
</Button>
|
|
41
|
-
<Button on:click={cls(true)} color="secondary">
|
|
41
|
+
<Button on:click={cls(true)} color="@secondary">
|
|
42
42
|
{okText}
|
|
43
43
|
</Button>
|
|
44
44
|
</Grid>
|
package/src/hash.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { readable } from "svelte/store"
|
|
2
|
-
|
|
3
|
-
export const hash = readable(
|
|
4
|
-
location.hash.slice(1),
|
|
5
|
-
(set) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
)
|
|
10
|
-
}
|
|
11
|
-
)
|
|
12
|
-
hash.set = (value) => {
|
|
13
|
-
location.hash = value
|
|
14
|
-
}
|
|
1
|
+
import { readable } from "svelte/store"
|
|
2
|
+
|
|
3
|
+
export const hash = readable(
|
|
4
|
+
location.hash.slice(1),
|
|
5
|
+
(set) => {
|
|
6
|
+
window.addEventListener(
|
|
7
|
+
"popstate",
|
|
8
|
+
() => set(location.hash.slice(1))
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
)
|
|
12
|
+
hash.set = (value) => {
|
|
13
|
+
location.hash = value
|
|
14
|
+
}
|
package/src/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { default as Button } from "./control/button.svelte"
|
|
2
2
|
export { default as Input } from "./control/input.svelte"
|
|
3
|
+
export { default as Label } from "./control/label.svelte"
|
|
3
4
|
export { default as Link } from "./control/link.svelte"
|
|
4
|
-
export { default as
|
|
5
|
+
export { default as RadioGroup } from "./control/radio-group.svelte"
|
|
5
6
|
export { default as Select } from "./control/select.svelte"
|
|
6
7
|
export { default as Tabs } from "./control/tabs.svelte"
|
|
7
8
|
export { default as Toggle } from "./control/toggle.svelte"
|
|
@@ -40,14 +41,23 @@ export { default as Confirm } from "./dialogs/confirm.svelte"
|
|
|
40
41
|
export { default as DataTable } from "./composed/data-table.svelte"
|
|
41
42
|
export { default as TH } from "./composed/data-table/th.svelte"
|
|
42
43
|
export { default as EntryButton } from "./composed/entry-button.svelte"
|
|
44
|
+
export { default as Form } from "./composed/form.svelte"
|
|
43
45
|
export { default as Toast } from "./composed/toast.svelte"
|
|
44
46
|
|
|
45
47
|
export { default as AsyncButton } from "./async/button.svelte"
|
|
46
48
|
export { default as LoadZone } from "./async/load-zone.svelte"
|
|
47
49
|
|
|
50
|
+
export { default as Route } from "./routing/route.svelte"
|
|
51
|
+
export { default as Title } from "./routing/title.svelte"
|
|
52
|
+
|
|
48
53
|
export { default as wsx } from "./wsx.mjs"
|
|
49
54
|
|
|
50
55
|
export { hash } from "./hash.js"
|
|
51
56
|
|
|
57
|
+
export {
|
|
58
|
+
route,
|
|
59
|
+
stackStore,
|
|
60
|
+
relpath,
|
|
61
|
+
} from "./routing/routing.js"
|
|
52
62
|
export * from "./handler$.mjs"
|
|
53
63
|
export * from "./composed/table-functions.js"
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import wsx from "../wsx.mjs"
|
|
3
|
-
|
|
4
|
-
export let color = false
|
|
5
|
-
|
|
6
|
-
$: wind = {
|
|
7
|
-
"$color": color,
|
|
8
|
-
...$$restProps,
|
|
9
|
-
}
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
13
|
-
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
14
|
-
<ws-notification use:wsx={wind} on:click role="button">
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import wsx from "../wsx.mjs"
|
|
3
|
+
|
|
4
|
+
export let color = false
|
|
5
|
+
|
|
6
|
+
$: wind = {
|
|
7
|
+
"$color": color,
|
|
8
|
+
...$$restProps,
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
13
|
+
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
14
|
+
<ws-notification use:wsx={wind} on:click role="button">
|
|
15
|
+
{#if $$slots.start}
|
|
16
|
+
<div ws-x="[$start] [grid]">
|
|
17
|
+
<slot name="start" />
|
|
18
|
+
</div>
|
|
19
|
+
{/if}
|
|
20
|
+
<div ws-x="[$notif-text]">
|
|
21
|
+
<slot />
|
|
22
|
+
</div>
|
|
23
|
+
{#if $$slots.end}
|
|
24
|
+
<div ws-x="[$end] [grid]">
|
|
25
|
+
<slot name="end" />
|
|
26
|
+
</div>
|
|
27
|
+
{/if}
|
|
28
|
+
</ws-notification>
|
package/src/info/titlebar.svelte
CHANGED
|
@@ -4,15 +4,32 @@
|
|
|
4
4
|
export let color
|
|
5
5
|
export let fill = false
|
|
6
6
|
|
|
7
|
-
$:
|
|
7
|
+
$: titleProps = {
|
|
8
8
|
"$color": color,
|
|
9
9
|
"$fill": fill,
|
|
10
|
-
|
|
10
|
+
$title: true,
|
|
11
|
+
}
|
|
12
|
+
$: wind = {
|
|
13
|
+
...$$restProps,
|
|
14
|
+
"gr.cols": "auto 1fr auto"
|
|
11
15
|
}
|
|
12
16
|
</script>
|
|
13
17
|
|
|
14
18
|
<ws-titlebar use:wsx={wind}>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
{#if $$slots.title}
|
|
20
|
+
<div use:wsx={titleProps}>
|
|
21
|
+
<slot name="title" />
|
|
22
|
+
</div>
|
|
23
|
+
{/if}
|
|
24
|
+
|
|
25
|
+
{#if $$slots.menu}
|
|
26
|
+
<div ws-x="[$menu] [grid] [p 0px]">
|
|
27
|
+
<slot name="menu" />
|
|
28
|
+
</div>
|
|
29
|
+
{/if}
|
|
30
|
+
{#if $$slots.action}
|
|
31
|
+
<div ws-x="[$action] [grid] [p 0px]">
|
|
32
|
+
<slot name="action" />
|
|
33
|
+
</div>
|
|
34
|
+
{/if}
|
|
18
35
|
</ws-titlebar>
|
package/src/layout/dialog.svelte
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
18
18
|
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
19
|
-
<wind-wrapper transition:trick ws-x="
|
|
19
|
+
<wind-wrapper transition:trick ws-x="@@dialog [grid]" on:click|stopPropagation
|
|
20
20
|
role="dialog">
|
|
21
21
|
<Paper {...$$props}>
|
|
22
22
|
<slot name="header" slot="header" />
|
package/src/layout/drawer.svelte
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script context="module">
|
|
4
|
-
const defs = {
|
|
5
|
-
select: {
|
|
6
|
-
"
|
|
7
|
-
"w.min": "35vw",
|
|
8
|
-
grid: true,
|
|
9
|
-
over: "hidden"
|
|
10
|
-
},
|
|
11
|
-
menu: {
|
|
12
|
-
"
|
|
13
|
-
},
|
|
14
|
-
action: {
|
|
15
|
-
"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
import wsx from "../wsx.mjs"
|
|
22
|
-
|
|
23
|
-
import Paper from "./paper.svelte"
|
|
24
|
-
|
|
25
|
-
export let height
|
|
26
|
-
export let type = "menu"
|
|
27
|
-
|
|
28
|
-
const trick = (node, options) => ({
|
|
29
|
-
delay: 0,
|
|
30
|
-
duration: 250,
|
|
31
|
-
css: () => "",
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
$: container = {
|
|
35
|
-
...defs[type],
|
|
36
|
-
h: (type === "select") ? height : "100%",
|
|
37
|
-
grid: true,
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
40
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
41
|
-
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
42
|
-
<wind-drawer-container use:wsx={container} on:click|stopPropagation
|
|
43
|
-
role="menubar" transition:trick>
|
|
44
|
-
<Paper {...$$restProps}>
|
|
45
|
-
<slot name="header" slot="header" />
|
|
46
|
-
<slot />
|
|
47
|
-
<slot name="footer" slot="footer" />
|
|
48
|
-
</Paper>
|
|
49
|
-
</wind-drawer-container>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script context="module">
|
|
4
|
+
const defs = {
|
|
5
|
+
select: {
|
|
6
|
+
"@@select": true,
|
|
7
|
+
"w.min": "35vw",
|
|
8
|
+
grid: true,
|
|
9
|
+
over: "hidden"
|
|
10
|
+
},
|
|
11
|
+
menu: {
|
|
12
|
+
"@@menu": true,
|
|
13
|
+
},
|
|
14
|
+
action: {
|
|
15
|
+
"@@action": true,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import wsx from "../wsx.mjs"
|
|
22
|
+
|
|
23
|
+
import Paper from "./paper.svelte"
|
|
24
|
+
|
|
25
|
+
export let height
|
|
26
|
+
export let type = "menu"
|
|
27
|
+
|
|
28
|
+
const trick = (node, options) => ({
|
|
29
|
+
delay: 0,
|
|
30
|
+
duration: 250,
|
|
31
|
+
css: () => "",
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
$: container = {
|
|
35
|
+
...defs[type],
|
|
36
|
+
h: (type === "select") ? height : "100%",
|
|
37
|
+
grid: true,
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
41
|
+
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
42
|
+
<wind-drawer-container use:wsx={container} on:click|stopPropagation
|
|
43
|
+
role="menubar" transition:trick>
|
|
44
|
+
<Paper r="0px" {...$$restProps}>
|
|
45
|
+
<slot name="header" slot="header" />
|
|
46
|
+
<slot />
|
|
47
|
+
<slot name="footer" slot="footer" />
|
|
48
|
+
</Paper>
|
|
49
|
+
</wind-drawer-container>
|
package/src/layout/flex.svelte
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
import wsx from "../wsx.mjs"
|
|
5
5
|
|
|
6
6
|
export let direction = false
|
|
7
|
-
export let pad = false
|
|
8
|
-
export let gap = false
|
|
9
7
|
export let cross = "stretch"
|
|
10
8
|
export let main = "start"
|
|
11
9
|
export let scrollable = false
|
|
@@ -14,8 +12,6 @@
|
|
|
14
12
|
"fl.dir": direction,
|
|
15
13
|
"fl.cross": cross,
|
|
16
14
|
"fl.main": main,
|
|
17
|
-
p: pad,
|
|
18
|
-
gap: gap,
|
|
19
15
|
over: (scrollable === true) ? "auto" : null,
|
|
20
16
|
...$$restProps
|
|
21
17
|
}
|
package/src/layout/grid.svelte
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
import wsx from "../wsx.mjs"
|
|
5
5
|
|
|
6
6
|
export let direction = false
|
|
7
|
-
export let pad = false
|
|
8
|
-
export let gap = false
|
|
9
7
|
export let cols = null
|
|
10
8
|
export let rows = null
|
|
11
9
|
export let autoCol = false
|
|
12
10
|
export let autoRow = false
|
|
11
|
+
export let colsFit = false
|
|
12
|
+
export let colsFill = false
|
|
13
13
|
export let scrollable = false
|
|
14
14
|
|
|
15
15
|
$: wind = {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"gr.rows": rows?.join?.(" ") ?? rows ?? false,
|
|
19
19
|
"gr.cols.a": autoCol,
|
|
20
20
|
"gr.rows.a": autoRow,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
"gr.cols-fit": colsFit,
|
|
22
|
+
"gr.cols-fill": colsFill,
|
|
23
23
|
over: (scrollable === true) ? "auto" : null,
|
|
24
24
|
...$$restProps
|
|
25
25
|
}
|
package/src/layout/paper.svelte
CHANGED
|
@@ -1,47 +1,56 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import Flex from "./flex.svelte"
|
|
5
|
-
import wsx from "../wsx.mjs"
|
|
6
|
-
|
|
7
|
-
export let color
|
|
8
|
-
export let card = false
|
|
9
|
-
export let square = false
|
|
10
|
-
export let layout = Flex
|
|
11
|
-
export let scrollable = true
|
|
12
|
-
|
|
13
|
-
$: props = Object.entries($$restProps).reduce(
|
|
14
|
-
(p, [key, value]) => {
|
|
15
|
-
const [target, name] =
|
|
16
|
-
(key.startsWith("l-") === true)
|
|
17
|
-
? [ p.layout, key.slice(2) ]
|
|
18
|
-
: [ p.paper, key ]
|
|
19
|
-
target[name] = value
|
|
20
|
-
return p
|
|
21
|
-
},
|
|
22
|
-
{ layout: {}, paper: {} }
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
$: layoutProps = {
|
|
26
|
-
over: scrollable ? "auto" : false,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"$
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{#if $$slots.
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import Flex from "./flex.svelte"
|
|
5
|
+
import wsx from "../wsx.mjs"
|
|
6
|
+
|
|
7
|
+
export let color
|
|
8
|
+
export let card = false
|
|
9
|
+
export let square = false
|
|
10
|
+
export let layout = Flex
|
|
11
|
+
export let scrollable = true
|
|
12
|
+
|
|
13
|
+
$: props = Object.entries($$restProps).reduce(
|
|
14
|
+
(p, [key, value]) => {
|
|
15
|
+
const [target, name] =
|
|
16
|
+
(key.startsWith("l-") === true)
|
|
17
|
+
? [ p.layout, key.slice(2) ]
|
|
18
|
+
: [ p.paper, key ]
|
|
19
|
+
target[name] = value
|
|
20
|
+
return p
|
|
21
|
+
},
|
|
22
|
+
{ layout: {}, paper: {} }
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
$: layoutProps = {
|
|
26
|
+
over: scrollable ? "auto" : false,
|
|
27
|
+
$content: true,
|
|
28
|
+
...props.layout,
|
|
29
|
+
}
|
|
30
|
+
$: wind = {
|
|
31
|
+
"$color": color,
|
|
32
|
+
"$outline": card,
|
|
33
|
+
r: square && "0px",
|
|
34
|
+
...props.paper,
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<ws-paper use:wsx={wind}>
|
|
39
|
+
{#if $$slots.header}
|
|
40
|
+
<div ws-x="[$header] [grid] [p 0px]">
|
|
41
|
+
<slot name="header" />
|
|
42
|
+
</div>
|
|
43
|
+
{/if}
|
|
44
|
+
{#if $$slots.content}
|
|
45
|
+
<slot name="content" />
|
|
46
|
+
{:else}
|
|
47
|
+
<svelte:component this={layout} {...layoutProps}>
|
|
48
|
+
<slot />
|
|
49
|
+
</svelte:component>
|
|
50
|
+
{/if}
|
|
51
|
+
{#if $$slots.footer}
|
|
52
|
+
<div ws-x="[$footer] [grid] [p 0px]">
|
|
53
|
+
<slot name="footer" />
|
|
54
|
+
</div>
|
|
55
|
+
{/if}
|
|
56
|
+
</ws-paper>
|