@axel669/zephyr 0.3.6 → 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 +12 -5
- package/src/async/button.svelte +16 -8
- package/src/composed/data-table/th.svelte +5 -5
- package/src/composed/data-table.svelte +6 -5
- 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/icon.svelte +1 -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/package.json
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axel669/zephyr",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.4-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.mjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"site/start": "wrangler pages dev site --port 45067",
|
|
9
|
+
"site/build": "rollup -c docsite/rollup.config.mjs",
|
|
10
|
+
"site/watch": "rollup -c docsite/rollup.config.mjs --watch"
|
|
10
11
|
},
|
|
11
12
|
"keywords": [],
|
|
12
13
|
"author": "",
|
|
13
14
|
"license": "MIT",
|
|
14
15
|
"dependencies": {
|
|
15
|
-
"@axel669/windstorm": "0.
|
|
16
|
+
"@axel669/windstorm": "0.4.4"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
19
|
+
"@axel669/asuid": "^0.2.1",
|
|
18
20
|
"@axel669/ipsen": "0.4.0-beta.7",
|
|
21
|
+
"@axel669/rollup-copy-static": "^0.1.2",
|
|
19
22
|
"@axel669/rollup-html-input": "^0.1.2",
|
|
20
23
|
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
21
24
|
"@rollup/plugin-terser": "^0.4.0",
|
|
25
|
+
"marked": "^12.0.2",
|
|
22
26
|
"prism-svelte": "^0.5.0",
|
|
27
|
+
"prismjs": "^1.29.0",
|
|
23
28
|
"rollup": "^3.20.2",
|
|
29
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
24
30
|
"rollup-plugin-svelte": "^7.1.6",
|
|
25
31
|
"svelte": "^4.2.7"
|
|
26
32
|
},
|
|
@@ -28,6 +34,7 @@
|
|
|
28
34
|
"src/"
|
|
29
35
|
],
|
|
30
36
|
"imports": {
|
|
31
|
-
"#lib": "./src/index.mjs"
|
|
37
|
+
"#lib": "./src/index.mjs",
|
|
38
|
+
"#comp/*": "./docsite/comp/*.svelte"
|
|
32
39
|
}
|
|
33
40
|
}
|
package/src/async/button.svelte
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
export let handler = null
|
|
6
6
|
export let disabled
|
|
7
|
+
export let spincolor = "@primary"
|
|
7
8
|
|
|
8
9
|
let running = false
|
|
9
10
|
const asyncHandler = async (evt) => {
|
|
@@ -19,11 +20,18 @@
|
|
|
19
20
|
}
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
<async-button ws-x="[disp inline-grid] [gr.cols 1fr] [pos relative]">
|
|
24
|
+
<Button {...props} on:click={asyncHandler}>
|
|
25
|
+
<slot />
|
|
26
|
+
</Button>
|
|
27
|
+
{#if running === true}
|
|
28
|
+
<Spinner
|
|
29
|
+
size="unset"
|
|
30
|
+
pos="absolute"
|
|
31
|
+
x="50%" y="0px"
|
|
32
|
+
tf="translateX(-50%)"
|
|
33
|
+
h="100%"
|
|
34
|
+
color={spincolor}
|
|
35
|
+
/>
|
|
36
|
+
{/if}
|
|
37
|
+
</async-button>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
<script context="module">
|
|
4
4
|
const sortIcons = {
|
|
5
|
-
"asc": "arrow-
|
|
6
|
-
"desc": "arrow-
|
|
5
|
+
"asc": "arrow-up",
|
|
6
|
+
"desc": "arrow-down",
|
|
7
7
|
}
|
|
8
8
|
</script>
|
|
9
9
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
$: sortIcon =
|
|
36
36
|
($context.sorting.base === sort)
|
|
37
37
|
? sortIcons[$context.sorting.direction]
|
|
38
|
-
: "
|
|
38
|
+
: "arrow-down-up"
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
41
|
<th use:wsx={wind} style="vertical-align: top;">
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
<slot />
|
|
46
46
|
</div>
|
|
47
47
|
{:else}
|
|
48
|
-
<Button compact r="0px"
|
|
49
|
-
t.wt="inherit" on:click={setSort}>
|
|
48
|
+
<Button compact r="0px" fill={$context.fillHeader}
|
|
49
|
+
t.wt="inherit" on:click={setSort} color={$context.color}>
|
|
50
50
|
<slot />
|
|
51
51
|
<Icon name={sortIcon} m.l="4px" t.sz="16px" />
|
|
52
52
|
</Button>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
import wsx from "../wsx.mjs"
|
|
52
52
|
import { handler$, eventHandler$ } from "../handler$.mjs"
|
|
53
53
|
|
|
54
|
-
export let color =
|
|
54
|
+
export let color = "@primary"
|
|
55
55
|
export let fillHeader = true
|
|
56
56
|
export let data
|
|
57
57
|
export let pageSize = 10
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
let filterFunctions = []
|
|
66
66
|
let jumpTarget = "1"
|
|
67
67
|
|
|
68
|
-
$: filteredData = applyFilters(data, filterFunctions)
|
|
68
|
+
$: filteredData = applyFilters(data, filterFunctions, sorting.func)
|
|
69
69
|
$: rows = sliceData(filteredData, page, pageSize, sorting.func)
|
|
70
70
|
$: rowCount = filteredData?.length ?? 0
|
|
71
71
|
$: pageCount = Math.ceil(rowCount / pageSize)
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
fillHeader,
|
|
115
115
|
sorting,
|
|
116
116
|
updateFilter,
|
|
117
|
+
color,
|
|
117
118
|
}
|
|
118
119
|
setContext(dtContext, context)
|
|
119
120
|
|
|
@@ -156,7 +157,7 @@
|
|
|
156
157
|
}
|
|
157
158
|
</script>
|
|
158
159
|
|
|
159
|
-
<Paper {color} h={height}>
|
|
160
|
+
<Paper {color} h={height} card>
|
|
160
161
|
<ws-flex use:wsx={content} slot="content" bind:this={scroller}>
|
|
161
162
|
<Table data={rows} {color} {fillHeader} {...$$restProps} b.t.w="0px">
|
|
162
163
|
<tr use:wsx={header} slot="header">
|
|
@@ -176,10 +177,10 @@
|
|
|
176
177
|
rows="32px" b="1px solid @color" b.b.w="4px">
|
|
177
178
|
{#if pageCount > 0}
|
|
178
179
|
<Button on:click={prev} disabled={page === 0}>
|
|
179
|
-
<Icon name="
|
|
180
|
+
<Icon name="caret-left" />
|
|
180
181
|
</Button>
|
|
181
182
|
<Button on:click={next} disabled={page === maxPage}>
|
|
182
|
-
<Icon name="
|
|
183
|
+
<Icon name="caret-right" />
|
|
183
184
|
</Button>
|
|
184
185
|
<Text adorn t.ws="nowrap">
|
|
185
186
|
Page
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script context="module">
|
|
2
|
+
const identity = i => i
|
|
3
|
+
const alwaysGood = () => true
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<script>
|
|
7
|
+
import Input from "../control/input.svelte"
|
|
8
|
+
|
|
9
|
+
export let fields
|
|
10
|
+
export let values
|
|
11
|
+
export let valid = {}
|
|
12
|
+
|
|
13
|
+
const refs = fields.reduce(
|
|
14
|
+
(refs, field) => {
|
|
15
|
+
refs[field.name] = {
|
|
16
|
+
vt: field.value.transform ?? identity,
|
|
17
|
+
t: field.value.out ?? identity,
|
|
18
|
+
v: field.value.validate ?? alwaysGood,
|
|
19
|
+
e: (value) => {
|
|
20
|
+
if (valid[field.name] !== false) {
|
|
21
|
+
return null
|
|
22
|
+
}
|
|
23
|
+
return field.value.error?.(value) ?? null
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return refs
|
|
27
|
+
},
|
|
28
|
+
{}
|
|
29
|
+
)
|
|
30
|
+
let internal = fields.reduce(
|
|
31
|
+
(initial, field) => {
|
|
32
|
+
initial[field.name] = field.value.initial ?? ""
|
|
33
|
+
return initial
|
|
34
|
+
},
|
|
35
|
+
{}
|
|
36
|
+
)
|
|
37
|
+
let value = new Proxy(
|
|
38
|
+
{},
|
|
39
|
+
{
|
|
40
|
+
get(_, name) {
|
|
41
|
+
return internal[name]
|
|
42
|
+
},
|
|
43
|
+
set(_, name, value) {
|
|
44
|
+
const ref = refs[name]
|
|
45
|
+
internal[name] = ref.vt(value)
|
|
46
|
+
values = { ...values, [name]: ref.t(internal[name]) }
|
|
47
|
+
valid = { ...valid, [name]: ref.v(values[name]) }
|
|
48
|
+
return true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
{#each fields as field}
|
|
55
|
+
<Input
|
|
56
|
+
{...field.props}
|
|
57
|
+
bind:value={value[field.name]}
|
|
58
|
+
error={refs[field.name].e(value[field.name])}
|
|
59
|
+
/>
|
|
60
|
+
{/each}
|
|
@@ -1,43 +1,13 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
/*md
|
|
3
|
-
[@] Components/ToastMessage
|
|
4
|
-
|
|
5
|
-
# ToastMessage
|
|
6
|
-
|
|
7
|
-
The default component for Toast to show messages with
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
### actionText
|
|
12
|
-
`string`
|
|
13
|
-
|
|
14
|
-
If given, the message will have a button that can be clicked and will
|
|
15
|
-
use this text for the button text
|
|
16
|
-
|
|
17
|
-
### color
|
|
18
|
-
`string`
|
|
19
|
-
|
|
20
|
-
Sets `$color`
|
|
21
|
-
|
|
22
|
-
### icon
|
|
23
|
-
`string`
|
|
24
|
-
|
|
25
|
-
An icon to show with the message
|
|
26
|
-
|
|
27
|
-
### message
|
|
28
|
-
`string`
|
|
29
|
-
|
|
30
|
-
The message to show
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
2
|
import { createEventDispatcher } from "svelte"
|
|
34
3
|
|
|
35
4
|
import Button from "../../control/button.svelte"
|
|
36
5
|
import Icon from "../../info/icon.svelte"
|
|
37
6
|
import Notification from "../../info/notification.svelte"
|
|
7
|
+
import Text from "../../text.svelte"
|
|
38
8
|
|
|
39
9
|
export let message = ""
|
|
40
|
-
export let icon =
|
|
10
|
+
export let icon = false
|
|
41
11
|
export let color = false
|
|
42
12
|
export let actionText = null
|
|
43
13
|
|
|
@@ -47,10 +17,17 @@
|
|
|
47
17
|
</script>
|
|
48
18
|
|
|
49
19
|
<Notification {color} on:click={dismiss}>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{
|
|
20
|
+
<Text slot="start" -adorn>
|
|
21
|
+
{#if icon !== false}
|
|
22
|
+
<Icon name={icon} />
|
|
23
|
+
{/if}
|
|
24
|
+
</Text>
|
|
25
|
+
<span>{message}</span>
|
|
26
|
+
<div slot="end" ws-x="[grid]">
|
|
27
|
+
{#if actionText}
|
|
28
|
+
<Button on:click={respond} r.l="0px">
|
|
29
|
+
{actionText}
|
|
30
|
+
</Button>
|
|
31
|
+
{/if}
|
|
32
|
+
</div>
|
|
56
33
|
</Notification>
|
package/src/control/input.svelte
CHANGED
|
@@ -1,109 +1,89 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{disabled}
|
|
91
|
-
{type}
|
|
92
|
-
value={internalValue}
|
|
93
|
-
list={id}
|
|
94
|
-
on:focus
|
|
95
|
-
on:blur
|
|
96
|
-
on:input={update}
|
|
97
|
-
bind:this={input}
|
|
98
|
-
/>
|
|
99
|
-
|
|
100
|
-
<slot name="start" />
|
|
101
|
-
<slot name="end" />
|
|
102
|
-
{#if autocompleteOptions !== null}
|
|
103
|
-
<datalist {id}>
|
|
104
|
-
{#each autocompleteOptions as value}
|
|
105
|
-
<option {value} />
|
|
106
|
-
{/each}
|
|
107
|
-
</datalist>
|
|
108
|
-
{/if}
|
|
109
|
-
</label>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
|
|
6
|
+
export let type = "text"
|
|
7
|
+
|
|
8
|
+
export let flat = false
|
|
9
|
+
export let label
|
|
10
|
+
export let color = "@default"
|
|
11
|
+
export let disabled
|
|
12
|
+
|
|
13
|
+
export let value = ""
|
|
14
|
+
export let autocompleteOptions = null
|
|
15
|
+
|
|
16
|
+
let input = null
|
|
17
|
+
export const focus = () => input.focus()
|
|
18
|
+
|
|
19
|
+
const id =
|
|
20
|
+
(autocompleteOptions === null)
|
|
21
|
+
? null
|
|
22
|
+
: `${Math.random().toString(16)}_${Date.now()}`
|
|
23
|
+
|
|
24
|
+
const update = (evt) => value = evt.target.value
|
|
25
|
+
|
|
26
|
+
$: restKeys = Object.keys($$restProps)
|
|
27
|
+
$: props = restKeys.reduce(
|
|
28
|
+
(props, key) => {
|
|
29
|
+
const [target, name] =
|
|
30
|
+
(key.startsWith("i-") === true)
|
|
31
|
+
? [props.input, key.slice(2)]
|
|
32
|
+
: [props.wind, key]
|
|
33
|
+
target[name] = $$restProps[key]
|
|
34
|
+
return props
|
|
35
|
+
},
|
|
36
|
+
{wind: {}, input: {}}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
$: wind = {
|
|
40
|
+
"$flat": flat,
|
|
41
|
+
"@@control": true,
|
|
42
|
+
"$color": color,
|
|
43
|
+
...props.wind,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
$: tag = (type === "area") ? "textarea" : "input"
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<label use:wsx={wind}>
|
|
50
|
+
{#if label}
|
|
51
|
+
<span use:wsx={{ "$label": true }}>{label}</span>
|
|
52
|
+
{/if}
|
|
53
|
+
<svelte:element
|
|
54
|
+
this={tag}
|
|
55
|
+
{...props.input}
|
|
56
|
+
{disabled}
|
|
57
|
+
{type}
|
|
58
|
+
{value}
|
|
59
|
+
list={id}
|
|
60
|
+
on:focus
|
|
61
|
+
on:blur
|
|
62
|
+
on:input={update}
|
|
63
|
+
bind:this={input}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
{#if $$slots.start}
|
|
67
|
+
<span use:wsx={{ "$start": true }}>
|
|
68
|
+
<slot name="start" />
|
|
69
|
+
</span>
|
|
70
|
+
{/if}
|
|
71
|
+
{#if $$slots.end}
|
|
72
|
+
<span use:wsx={{ "$end": true }}>
|
|
73
|
+
<slot name="end" />
|
|
74
|
+
</span>
|
|
75
|
+
{/if}
|
|
76
|
+
{#if $$slots.extra}
|
|
77
|
+
<span use:wsx={{ "$extra": true }}>
|
|
78
|
+
<slot name="extra" />
|
|
79
|
+
</span>
|
|
80
|
+
{/if}
|
|
81
|
+
|
|
82
|
+
{#if autocompleteOptions !== null}
|
|
83
|
+
<datalist {id}>
|
|
84
|
+
{#each autocompleteOptions as value}
|
|
85
|
+
<option {value} />
|
|
86
|
+
{/each}
|
|
87
|
+
</datalist>
|
|
88
|
+
{/if}
|
|
89
|
+
</label>
|
package/src/control/label.svelte
CHANGED
package/src/control/link.svelte
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
import variant from "../variant.mjs"
|
|
6
|
-
|
|
7
|
-
export let button = false
|
|
8
|
-
export let color = false
|
|
9
|
-
|
|
10
|
-
export let href = ""
|
|
11
|
-
export let rel = "noreferrer"
|
|
12
|
-
export let target = null
|
|
13
|
-
|
|
14
|
-
export let fill = false
|
|
15
|
-
export let outline = false
|
|
16
|
-
export let flat = false
|
|
17
|
-
|
|
18
|
-
export let disabled = null
|
|
19
|
-
|
|
20
|
-
$: type = variant({ fill, outline, flat })
|
|
21
|
-
|
|
22
|
-
$: wind = {
|
|
23
|
-
"
|
|
24
|
-
[type]: true,
|
|
25
|
-
"$color": color,
|
|
26
|
-
...$$restProps
|
|
27
|
-
}
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<a {href} {target} {rel} disabled={disabled || null} use:wsx={wind} on:click>
|
|
31
|
-
<slot />
|
|
32
|
-
</a>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
import variant from "../variant.mjs"
|
|
6
|
+
|
|
7
|
+
export let button = false
|
|
8
|
+
export let color = false
|
|
9
|
+
|
|
10
|
+
export let href = ""
|
|
11
|
+
export let rel = "noreferrer"
|
|
12
|
+
export let target = null
|
|
13
|
+
|
|
14
|
+
export let fill = false
|
|
15
|
+
export let outline = false
|
|
16
|
+
export let flat = false
|
|
17
|
+
|
|
18
|
+
export let disabled = null
|
|
19
|
+
|
|
20
|
+
$: type = variant({ fill, outline, flat })
|
|
21
|
+
|
|
22
|
+
$: wind = {
|
|
23
|
+
"@@button": button,
|
|
24
|
+
[type]: true,
|
|
25
|
+
"$color": color,
|
|
26
|
+
...$$restProps
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<a {href} {target} {rel} disabled={disabled || null} use:wsx={wind} on:click>
|
|
31
|
+
<slot />
|
|
32
|
+
</a>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
import { handler$ } from "../handler$.mjs"
|
|
6
|
+
|
|
7
|
+
import Flex from "../layout/flex.svelte"
|
|
8
|
+
|
|
9
|
+
export let options = []
|
|
10
|
+
export let layout = Flex
|
|
11
|
+
export let value
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<svelte:component this={layout} {...$$restProps}>
|
|
15
|
+
{#each options as {value: itemValue, label, disabled, ...wind}, index (value)}
|
|
16
|
+
<label use:wsx={{"@@toggle": true, ...wind}} {disabled}>
|
|
17
|
+
<span>{label}</span>
|
|
18
|
+
<input type="radio" value={itemValue} bind:group={value} />
|
|
19
|
+
</label>
|
|
20
|
+
{/each}
|
|
21
|
+
</svelte:component>
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
|
|
22
22
|
export let options = []
|
|
23
23
|
export let value
|
|
24
|
-
export let color = "default"
|
|
25
|
-
export let
|
|
24
|
+
export let color = "@default"
|
|
25
|
+
export let flat = false
|
|
26
26
|
export let label = null
|
|
27
27
|
export let disabled = false
|
|
28
28
|
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
$: grouped = groupOptions(options)
|
|
34
34
|
|
|
35
35
|
$: wind = {
|
|
36
|
-
"
|
|
37
|
-
"$
|
|
36
|
+
"@@control": true,
|
|
37
|
+
"$flat": flat,
|
|
38
38
|
"$color": color,
|
|
39
39
|
...$$restProps,
|
|
40
40
|
}
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
<label use:wsx={wind}>
|
|
44
44
|
{#if label}
|
|
45
|
-
<span ws-x="[$label
|
|
45
|
+
<span ws-x="[$label]">{label}</span>
|
|
46
46
|
{/if}
|
|
47
47
|
<select value={indexValue} on:input={update} {disabled}>
|
|
48
48
|
{#each grouped as item, index}
|