@nil-/doc 0.2.56 → 0.3.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/components/Base.svelte +1 -0
- package/components/block/Block.svelte +12 -67
- package/components/block/Controls.svelte +1 -6
- package/components/block/Controls.svelte.d.ts +0 -2
- package/components/block/Instance.svelte +72 -51
- package/components/block/context.d.ts +12 -8
- package/components/block/context.js +8 -8
- package/components/block/controls/Controls.svelte +43 -0
- package/components/block/controls/Controls.svelte.d.ts +14 -0
- package/components/block/controls/Styler.svelte +9 -12
- package/components/block/controls/events/Events.svelte +14 -55
- package/components/block/controls/events/Events.svelte.d.ts +6 -6
- package/components/block/controls/props/Button.svelte +4 -3
- package/components/block/controls/props/Button.svelte.d.ts +1 -0
- package/components/block/controls/props/Color.svelte +33 -13
- package/components/block/controls/props/Component.svelte +3 -2
- package/components/block/controls/props/Number.svelte +10 -3
- package/components/block/controls/props/Props.svelte +3 -8
- package/components/block/controls/props/Props.svelte.d.ts +1 -3
- package/components/block/controls/props/Range.svelte +16 -30
- package/components/block/controls/props/Select.svelte +3 -3
- package/components/block/controls/props/Text.svelte +10 -3
- package/components/block/controls/props/Toggle.svelte +3 -5
- package/components/block/controls/props/misc/GroupHeader.svelte +6 -14
- package/components/block/controls/props/misc/Toggle.svelte +85 -0
- package/components/block/controls/props/misc/Toggle.svelte.d.ts +19 -0
- package/components/block/controls/props/misc/utils.d.ts +1 -1
- package/components/block/controls/props/misc/utils.js +7 -28
- package/components/block/icons/ControlView.svelte +1 -6
- package/components/block/icons/Position.svelte +14 -14
- package/components/layout/Container.svelte +10 -8
- package/components/layout/Layout.svelte +18 -7
- package/components/layout/icons/Theme.svelte +6 -24
- package/package.json +11 -29
- package/CHANGELOG.md +0 -370
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<script>import { getName, getFormat } from "./misc/utils";
|
|
20
20
|
import { defaulter } from "./misc/defaulter";
|
|
21
21
|
import NameHeader from "./misc/Name.svelte";
|
|
22
|
-
import Toggle from "svelte
|
|
22
|
+
import Toggle from "./misc/Toggle.svelte";
|
|
23
23
|
export let value;
|
|
24
24
|
export let info;
|
|
25
25
|
export let depth;
|
|
@@ -31,7 +31,7 @@ const action = (d, { format, P }) => {
|
|
|
31
31
|
d.style.borderColor = ivalue;
|
|
32
32
|
const picker = new P({
|
|
33
33
|
parent: d,
|
|
34
|
-
popup: "
|
|
34
|
+
popup: "top",
|
|
35
35
|
editorFormat: format.substring(0, 3),
|
|
36
36
|
editor: true,
|
|
37
37
|
alpha: format.length === 4,
|
|
@@ -58,17 +58,29 @@ $:
|
|
|
58
58
|
{#if visible}
|
|
59
59
|
<div>
|
|
60
60
|
<NameHeader name={getName(info)} {depth} />
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
<div>
|
|
62
|
+
{#await import("vanilla-picker")}
|
|
63
|
+
<button>
|
|
64
|
+
{ivalue}
|
|
65
|
+
</button>
|
|
66
|
+
{:then { default: P }}
|
|
67
|
+
<button
|
|
68
|
+
style:height="1.5rem"
|
|
69
|
+
style:width="12.5rem"
|
|
70
|
+
use:action={{ format: getFormat(info), P }}
|
|
71
|
+
disabled={!enabled || disabled}
|
|
72
|
+
>
|
|
73
|
+
{ivalue}
|
|
74
|
+
</button>
|
|
75
|
+
{/await}
|
|
76
|
+
</div>
|
|
77
|
+
<div><Toggle bind:toggled={enabled} {disabled} /></div>
|
|
67
78
|
</div>
|
|
68
79
|
{/if}
|
|
69
80
|
|
|
70
81
|
<style>
|
|
71
82
|
button {
|
|
83
|
+
position: absolute;
|
|
72
84
|
font-size: 0.7rem;
|
|
73
85
|
border-top-width: 1px;
|
|
74
86
|
border-bottom-width: 1px;
|
|
@@ -76,9 +88,18 @@ $:
|
|
|
76
88
|
border-right-width: 10px;
|
|
77
89
|
border-style: solid;
|
|
78
90
|
background-color: var(--i-nil-doc-bg-color);
|
|
91
|
+
color: var(--i-nil-doc-color);
|
|
79
92
|
outline: 1px solid gray;
|
|
80
|
-
|
|
81
|
-
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
button[disabled] {
|
|
96
|
+
border-color: gray !important;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
button :global(.popup.popup_top) {
|
|
100
|
+
left: -1.3rem !important;
|
|
101
|
+
color: var(--i-nil-doc-color) !important;
|
|
102
|
+
box-shadow: currentColor 0px 0px 10px 0px !important;
|
|
82
103
|
}
|
|
83
104
|
|
|
84
105
|
button :global(.picker_wrapper),
|
|
@@ -89,8 +110,7 @@ $:
|
|
|
89
110
|
}
|
|
90
111
|
|
|
91
112
|
button :global(.picker_done > button) {
|
|
92
|
-
background
|
|
93
|
-
|
|
94
|
-
color: var(--i-nil-doc-color);
|
|
113
|
+
background: var(--i-nil-doc-bg-color) !important;
|
|
114
|
+
color: var(--i-nil-doc-color) !important;
|
|
95
115
|
}
|
|
96
116
|
</style>
|
|
@@ -6,6 +6,7 @@ import Select from "./Select.svelte";
|
|
|
6
6
|
import Tuple from "./Tuple.svelte";
|
|
7
7
|
import Object from "./Object.svelte";
|
|
8
8
|
import Color from "./Color.svelte";
|
|
9
|
+
import Button from "./Button.svelte";
|
|
9
10
|
export let value;
|
|
10
11
|
export let info;
|
|
11
12
|
export let depth;
|
|
@@ -32,7 +33,7 @@ export let visible = false;
|
|
|
32
33
|
{:else if "toggle" === type}
|
|
33
34
|
<Toggle {info} bind:value {depth} {disabled} {visible} />
|
|
34
35
|
{:else if "button" === type}
|
|
35
|
-
|
|
36
|
+
<Button {info} {visible} />
|
|
36
37
|
{/if}
|
|
37
38
|
{:else}
|
|
38
39
|
{@const type = info.type}
|
|
@@ -53,6 +54,6 @@ export let visible = false;
|
|
|
53
54
|
{:else if "toggle" === type}
|
|
54
55
|
<Toggle {info} bind:value {depth} {disabled} {visible} />
|
|
55
56
|
{:else if "button" === type}
|
|
56
|
-
|
|
57
|
+
<Button {info} {visible} />
|
|
57
58
|
{/if}
|
|
58
59
|
{/if}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { getName } from "./misc/utils";
|
|
2
2
|
import { defaulter } from "./misc/defaulter";
|
|
3
3
|
import NameHeader from "./misc/Name.svelte";
|
|
4
|
-
import Toggle from "svelte
|
|
4
|
+
import Toggle from "./misc/Toggle.svelte";
|
|
5
5
|
export let value;
|
|
6
6
|
export let info;
|
|
7
7
|
export let depth;
|
|
@@ -16,7 +16,14 @@ $:
|
|
|
16
16
|
{#if visible}
|
|
17
17
|
<div>
|
|
18
18
|
<NameHeader name={getName(info)} {depth} />
|
|
19
|
-
<div
|
|
20
|
-
|
|
19
|
+
<div>
|
|
20
|
+
<input
|
|
21
|
+
class="control"
|
|
22
|
+
type="number"
|
|
23
|
+
bind:value={ivalue}
|
|
24
|
+
disabled={!enabled || disabled}
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
<div><Toggle bind:toggled={enabled} {disabled} /></div>
|
|
21
28
|
</div>
|
|
22
29
|
{/if}
|
|
@@ -6,11 +6,6 @@ export let values;
|
|
|
6
6
|
export let visible;
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
{/if}
|
|
13
|
-
{#each infos as info}
|
|
14
|
-
<Component {info} bind:value={values[getName(info)]} depth={1} {visible} />
|
|
15
|
-
{/each}
|
|
16
|
-
</Styler>
|
|
9
|
+
{#each infos as info}
|
|
10
|
+
<Component {info} bind:value={values[getName(info)]} depth={1} {visible} />
|
|
11
|
+
{/each}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script>import { defaulter } from "./misc/defaulter";
|
|
2
2
|
import NameHeader from "./misc/Name.svelte";
|
|
3
3
|
import { nformat } from "./misc/nformat";
|
|
4
|
-
import
|
|
4
|
+
import { getName } from "./misc/utils";
|
|
5
|
+
import Toggle from "./misc/Toggle.svelte";
|
|
5
6
|
export let value;
|
|
6
7
|
export let info;
|
|
7
8
|
export let depth;
|
|
@@ -13,12 +14,10 @@ $:
|
|
|
13
14
|
value = enabled && !disabled ? ivalue : void 0;
|
|
14
15
|
$:
|
|
15
16
|
i = info instanceof Array ? {
|
|
16
|
-
name: info[0],
|
|
17
17
|
min: info[2],
|
|
18
18
|
max: info[3],
|
|
19
19
|
step: info[4]
|
|
20
20
|
} : {
|
|
21
|
-
name: info.name,
|
|
22
21
|
min: info.min,
|
|
23
22
|
max: info.max,
|
|
24
23
|
step: info.step
|
|
@@ -27,29 +26,18 @@ $:
|
|
|
27
26
|
|
|
28
27
|
{#if visible}
|
|
29
28
|
<div>
|
|
30
|
-
<NameHeader name={
|
|
29
|
+
<NameHeader name={getName(info)} {depth} />
|
|
31
30
|
<div class="input" class:disabled={!enabled || disabled}>
|
|
32
|
-
<div class="tooltip">
|
|
33
|
-
Value: {nformat(ivalue, 6, 11)}
|
|
34
|
-
</div>
|
|
31
|
+
<div class="tooltip">Value: {nformat(ivalue, 6, 11)}</div>
|
|
35
32
|
<div>{nformat(ivalue, 3, 5)}</div>
|
|
36
|
-
<input
|
|
37
|
-
type="range"
|
|
38
|
-
bind:value={ivalue}
|
|
39
|
-
min={i.min}
|
|
40
|
-
max={i.max}
|
|
41
|
-
step={i.step}
|
|
42
|
-
disabled={!enabled || disabled}
|
|
43
|
-
/>
|
|
33
|
+
<input type="range" bind:value={ivalue} {...i} disabled={!enabled || disabled} />
|
|
44
34
|
</div>
|
|
45
|
-
<div><Toggle bind:toggled={enabled} {disabled}
|
|
35
|
+
<div><Toggle bind:toggled={enabled} {disabled} /></div>
|
|
46
36
|
</div>
|
|
47
37
|
{/if}
|
|
48
38
|
|
|
49
39
|
<style>
|
|
50
40
|
.input {
|
|
51
|
-
/* TODO: align color schema for toggle */
|
|
52
|
-
color-scheme: light;
|
|
53
41
|
width: 100%;
|
|
54
42
|
display: grid;
|
|
55
43
|
grid-template-columns: 4rem 1fr;
|
|
@@ -60,30 +48,28 @@ $:
|
|
|
60
48
|
|
|
61
49
|
.input > div {
|
|
62
50
|
width: 100%;
|
|
63
|
-
height:
|
|
51
|
+
height: 80%;
|
|
64
52
|
display: grid;
|
|
65
|
-
text-align: left;
|
|
66
|
-
align-items: center;
|
|
67
53
|
font-size: 0.8rem;
|
|
68
|
-
|
|
69
|
-
margin: auto;
|
|
54
|
+
place-items: center;
|
|
70
55
|
}
|
|
71
56
|
|
|
72
57
|
.tooltip {
|
|
73
58
|
left: -110%;
|
|
74
|
-
width: 100%;
|
|
75
|
-
height: 100%;
|
|
76
|
-
display: grid;
|
|
77
59
|
visibility: hidden;
|
|
78
60
|
position: absolute;
|
|
79
|
-
place-items: center;
|
|
80
61
|
}
|
|
81
62
|
|
|
82
|
-
.input.disabled
|
|
83
|
-
|
|
63
|
+
.input.disabled {
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
filter: opacity(0.5);
|
|
84
66
|
}
|
|
85
67
|
|
|
86
|
-
.input:
|
|
68
|
+
.input:hover > .tooltip {
|
|
87
69
|
visibility: visible;
|
|
88
70
|
}
|
|
71
|
+
|
|
72
|
+
.input.disabled:hover > .tooltip {
|
|
73
|
+
visibility: hidden;
|
|
74
|
+
}
|
|
89
75
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { defaulter } from "./misc/defaulter";
|
|
2
2
|
import { getValues, getName } from "./misc/utils";
|
|
3
3
|
import NameHeader from "./misc/Name.svelte";
|
|
4
|
-
import Toggle from "svelte
|
|
4
|
+
import Toggle from "./misc/Toggle.svelte";
|
|
5
5
|
export let value;
|
|
6
6
|
export let info;
|
|
7
7
|
export let depth;
|
|
@@ -17,13 +17,13 @@ $:
|
|
|
17
17
|
<div>
|
|
18
18
|
<NameHeader name={getName(info)} {depth} />
|
|
19
19
|
<div>
|
|
20
|
-
<select bind:value={ivalue} disabled={!enabled || disabled}>
|
|
20
|
+
<select class="control" bind:value={ivalue} disabled={!enabled || disabled}>
|
|
21
21
|
{#each getValues(info) as v}
|
|
22
22
|
<option value={v}>{v}</option>
|
|
23
23
|
{/each}
|
|
24
24
|
</select>
|
|
25
25
|
</div>
|
|
26
|
-
<div><Toggle bind:toggled={enabled} {disabled}
|
|
26
|
+
<div><Toggle bind:toggled={enabled} {disabled} /></div>
|
|
27
27
|
</div>
|
|
28
28
|
{/if}
|
|
29
29
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { getName } from "./misc/utils";
|
|
2
2
|
import { defaulter } from "./misc/defaulter";
|
|
3
3
|
import NameHeader from "./misc/Name.svelte";
|
|
4
|
-
import Toggle from "svelte
|
|
4
|
+
import Toggle from "./misc/Toggle.svelte";
|
|
5
5
|
export let value;
|
|
6
6
|
export let info;
|
|
7
7
|
export let depth;
|
|
@@ -16,7 +16,14 @@ $:
|
|
|
16
16
|
{#if visible}
|
|
17
17
|
<div>
|
|
18
18
|
<NameHeader name={getName(info)} {depth} />
|
|
19
|
-
<div
|
|
20
|
-
|
|
19
|
+
<div>
|
|
20
|
+
<input
|
|
21
|
+
class="control"
|
|
22
|
+
type="text"
|
|
23
|
+
bind:value={ivalue}
|
|
24
|
+
disabled={!enabled || disabled}
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
<div><Toggle bind:toggled={enabled} {disabled} /></div>
|
|
21
28
|
</div>
|
|
22
29
|
{/if}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { getName } from "./misc/utils";
|
|
2
2
|
import { defaulter } from "./misc/defaulter";
|
|
3
3
|
import NameHeader from "./misc/Name.svelte";
|
|
4
|
-
import Toggle from "svelte
|
|
4
|
+
import Toggle from "./misc/Toggle.svelte";
|
|
5
5
|
export let value;
|
|
6
6
|
export let info;
|
|
7
7
|
export let depth;
|
|
@@ -16,9 +16,7 @@ $:
|
|
|
16
16
|
{#if visible}
|
|
17
17
|
<div>
|
|
18
18
|
<NameHeader name={getName(info)} {depth} />
|
|
19
|
-
<div
|
|
20
|
-
|
|
21
|
-
</div>
|
|
22
|
-
<div><Toggle bind:toggled={enabled} {disabled} hideLabel small /></div>
|
|
19
|
+
<div><Toggle bind:toggled={ivalue} disabled={!enabled || disabled} /></div>
|
|
20
|
+
<div><Toggle bind:toggled={enabled} {disabled} /></div>
|
|
23
21
|
</div>
|
|
24
22
|
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import Name from "./Name.svelte";
|
|
2
|
-
import Toggle from "svelte
|
|
2
|
+
import Toggle from "./Toggle.svelte";
|
|
3
3
|
export let name;
|
|
4
4
|
export let depth;
|
|
5
5
|
export let checked;
|
|
@@ -16,27 +16,19 @@ const flip = () => {
|
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
{#if visible}
|
|
19
|
-
<div
|
|
19
|
+
<div on:click={flip} on:keypress={null}>
|
|
20
20
|
<Name
|
|
21
21
|
expand={expand === undefined ? undefined : expand && checked && !disabled}
|
|
22
22
|
{name}
|
|
23
23
|
{depth}
|
|
24
24
|
/>
|
|
25
|
-
<div class=
|
|
26
|
-
<div>
|
|
27
|
-
<Toggle
|
|
28
|
-
bind:toggled={checked}
|
|
29
|
-
{disabled}
|
|
30
|
-
hideLabel
|
|
31
|
-
small
|
|
32
|
-
on:click={(e) => e.stopPropagation()}
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
25
|
+
<div class:disabled={!checked}>-</div>
|
|
26
|
+
<div><Toggle bind:toggled={checked} {disabled} /></div>
|
|
35
27
|
</div>
|
|
36
28
|
{/if}
|
|
37
29
|
|
|
38
30
|
<style>
|
|
39
|
-
.
|
|
40
|
-
|
|
31
|
+
.disabled {
|
|
32
|
+
color: hsl(0, 0%, 50%);
|
|
41
33
|
}
|
|
42
34
|
</style>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script>import { getTheme } from "../../../../context";
|
|
2
|
+
export let disabled = false;
|
|
3
|
+
export let toggled = false;
|
|
4
|
+
const click = () => {
|
|
5
|
+
if (!disabled) {
|
|
6
|
+
toggled = !toggled;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const dark = getTheme();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div>
|
|
13
|
+
<svg
|
|
14
|
+
viewBox="-30 -30 60 60"
|
|
15
|
+
on:click|stopPropagation={click}
|
|
16
|
+
on:keypress
|
|
17
|
+
class:disabled
|
|
18
|
+
class:dark={$dark}
|
|
19
|
+
>
|
|
20
|
+
<rect width="80" height="40" x="-40" y="-20" rx="20" ry="20" />
|
|
21
|
+
<circle r="16" cx={toggled ? 20 : -20} />
|
|
22
|
+
</svg>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
div {
|
|
27
|
+
width: 2.5rem;
|
|
28
|
+
height: 1.25rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
svg {
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
rect {
|
|
38
|
+
stroke-width: 2;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.disabled {
|
|
42
|
+
cursor: not-allowed;
|
|
43
|
+
filter: opacity(0.5);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
circle {
|
|
47
|
+
transition: cx 175ms;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
rect {
|
|
51
|
+
stroke: hsl(0, 0%, 70%);
|
|
52
|
+
fill: hsl(0, 0%, 90%);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.dark > rect {
|
|
56
|
+
stroke: hsl(0, 0%, 52%);
|
|
57
|
+
fill: hsl(0, 0%, 23%);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.disabled > rect {
|
|
61
|
+
stroke: hsl(210, 2%, 81%);
|
|
62
|
+
fill: hsl(220, 14%, 96%);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.dark.disabled > rect {
|
|
66
|
+
stroke: hsl(0, 0%, 38%);
|
|
67
|
+
fill: hsl(0, 0%, 21%);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
circle {
|
|
71
|
+
fill: hsl(212, 100%, 50%);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.dark > circle {
|
|
75
|
+
fill: hsl(212, 100%, 80%);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.disabled > circle {
|
|
79
|
+
fill: hsl(0, 0%, 80%);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.dark.disabled > circle {
|
|
83
|
+
fill: hsl(0, 0%, 46%);
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
toggled?: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
keypress: KeyboardEvent;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export type ToggleProps = typeof __propDef.props;
|
|
15
|
+
export type ToggleEvents = typeof __propDef.events;
|
|
16
|
+
export type ToggleSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Toggle extends SvelteComponentTyped<ToggleProps, ToggleEvents, ToggleSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export declare function getValues(info: Unionized<PropType<"select">>): Values<"
|
|
|
5
5
|
export declare function getValues(info: Unionized<PropType<"object">>): Values<"object">;
|
|
6
6
|
export declare function getValues(info: Unionized<PropType<"tuple">>): Values<"tuple">;
|
|
7
7
|
export declare const getMin: (info: Unionized<PropType<"range">>) => number;
|
|
8
|
-
export declare const getType: (info: Prop | SpecialProp) => "number" | "object" | "select" | "toggle" | "button" | "
|
|
8
|
+
export declare const getType: (info: Prop | SpecialProp) => "number" | "object" | "select" | "toggle" | "button" | "tuple" | "text" | "color" | "range";
|
|
9
9
|
export declare const getFormat: (info: Unionized<PropType<"color">>) => import("../../types").ColorFormat;
|
|
10
10
|
export declare const getName: (info: Prop | SpecialProp) => string;
|
|
11
11
|
export declare const getClick: (info: SpecialProp) => () => () => void;
|
|
@@ -1,43 +1,22 @@
|
|
|
1
1
|
// eslint-disable-next-line func-style
|
|
2
2
|
export function getValues(info) {
|
|
3
|
-
|
|
4
|
-
return info[2];
|
|
5
|
-
}
|
|
6
|
-
return info.values;
|
|
3
|
+
return info instanceof Array ? info[2] : info.values;
|
|
7
4
|
}
|
|
8
5
|
export const getMin = (info) => {
|
|
9
|
-
|
|
10
|
-
return info[2];
|
|
11
|
-
}
|
|
12
|
-
return info.min;
|
|
6
|
+
return info instanceof Array ? info[2] : info.min;
|
|
13
7
|
};
|
|
14
8
|
export const getType = (info) => {
|
|
15
|
-
|
|
16
|
-
return info[1];
|
|
17
|
-
}
|
|
18
|
-
return info.type;
|
|
9
|
+
return info instanceof Array ? info[1] : info.type;
|
|
19
10
|
};
|
|
20
11
|
export const getFormat = (info) => {
|
|
21
|
-
|
|
22
|
-
return info[2];
|
|
23
|
-
}
|
|
24
|
-
return info.format;
|
|
12
|
+
return info instanceof Array ? info[2] : info.format;
|
|
25
13
|
};
|
|
26
14
|
export const getName = (info) => {
|
|
27
|
-
|
|
28
|
-
return info[0];
|
|
29
|
-
}
|
|
30
|
-
return info.name;
|
|
15
|
+
return info instanceof Array ? info[0] : info.name;
|
|
31
16
|
};
|
|
32
17
|
export const getClick = (info) => {
|
|
33
|
-
|
|
34
|
-
return info[2];
|
|
35
|
-
}
|
|
36
|
-
return info.click;
|
|
18
|
+
return info instanceof Array ? info[2] : info.click;
|
|
37
19
|
};
|
|
38
20
|
export const addName = (name, info) => {
|
|
39
|
-
|
|
40
|
-
return [name, ...info];
|
|
41
|
-
}
|
|
42
|
-
return { ...info, name };
|
|
21
|
+
return info instanceof Array ? [name, ...info] : { name, ...info };
|
|
43
22
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<svg viewBox="-50 -50 100 100">
|
|
7
7
|
<rect width="60" height="60" x="-30" y="-30" fill="transparent" />
|
|
8
8
|
<rect
|
|
9
|
-
|
|
9
|
+
x={mode === "prop" ? 0 : -20}
|
|
10
10
|
class="mv"
|
|
11
11
|
height="40"
|
|
12
12
|
width="20"
|
|
@@ -21,10 +21,5 @@
|
|
|
21
21
|
<style>
|
|
22
22
|
.mv {
|
|
23
23
|
transition: x var(--i-nil-doc-transition-time);
|
|
24
|
-
x: -20px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.mv.right {
|
|
28
|
-
x: 0px;
|
|
29
24
|
}
|
|
30
25
|
</style>
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
<script>export let position = "hidden";
|
|
2
|
+
$:
|
|
3
|
+
bottom = position === "bottom";
|
|
4
|
+
$:
|
|
5
|
+
right = position === "right";
|
|
2
6
|
</script>
|
|
3
7
|
|
|
4
8
|
<svg viewBox="-50 -50 100 100">
|
|
5
|
-
<rect width="60"
|
|
6
|
-
<rect
|
|
7
|
-
<rect
|
|
9
|
+
<rect width="60" x="-30" height="60" y="-30" fill="transparent" />
|
|
10
|
+
<rect width="60" x="-30" height={bottom ? "20" : "0"} y={bottom ? "10" : "30"} />
|
|
11
|
+
<rect
|
|
12
|
+
width="60"
|
|
13
|
+
x="-30"
|
|
14
|
+
height={right ? "20" : "0"}
|
|
15
|
+
y={right ? "10" : "30"}
|
|
16
|
+
transform="rotate(-90)"
|
|
17
|
+
/>
|
|
8
18
|
</svg>
|
|
9
19
|
|
|
10
20
|
<style>
|
|
@@ -13,18 +23,8 @@
|
|
|
13
23
|
fill: currentColor;
|
|
14
24
|
}
|
|
15
25
|
|
|
16
|
-
rect:
|
|
26
|
+
rect:nth-child(n + 2) {
|
|
17
27
|
transition: height var(--i-nil-doc-transition-time), x var(--i-nil-doc-transition-time),
|
|
18
28
|
y var(--i-nil-doc-transition-time);
|
|
19
|
-
width: 60px;
|
|
20
|
-
height: 0px;
|
|
21
|
-
x: -30px;
|
|
22
|
-
y: 30px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
rect:not(:first-child).show {
|
|
26
|
-
height: 20px;
|
|
27
|
-
x: -30px;
|
|
28
|
-
y: 10px;
|
|
29
29
|
}
|
|
30
30
|
</style>
|
|
@@ -53,8 +53,10 @@ const check = (v, flag, s) => {
|
|
|
53
53
|
|
|
54
54
|
<div
|
|
55
55
|
class="container"
|
|
56
|
-
class:vertical
|
|
57
56
|
class:b
|
|
57
|
+
class:a={!b}
|
|
58
|
+
class:vertical
|
|
59
|
+
class:horizontal={!vertical}
|
|
58
60
|
class:moving={$moving}
|
|
59
61
|
bind:clientWidth={width}
|
|
60
62
|
bind:clientHeight={height}
|
|
@@ -143,7 +145,7 @@ const check = (v, flag, s) => {
|
|
|
143
145
|
--width: 0.0625rem;
|
|
144
146
|
}
|
|
145
147
|
|
|
146
|
-
.container
|
|
148
|
+
.container.horizontal > .divider {
|
|
147
149
|
border-bottom: var(--i-nil-doc-container-p) solid var(--width);
|
|
148
150
|
border-top: var(--i-nil-doc-container-p) solid var(--width);
|
|
149
151
|
background-color: var(--i-nil-doc-container-p);
|
|
@@ -155,18 +157,18 @@ const check = (v, flag, s) => {
|
|
|
155
157
|
background-color: var(--i-nil-doc-container-p);
|
|
156
158
|
}
|
|
157
159
|
|
|
158
|
-
.container
|
|
159
|
-
.container.moving
|
|
160
|
+
.container.a.horizontal > .divider:hover,
|
|
161
|
+
.container.moving.a.horizontal > .divider {
|
|
160
162
|
border-bottom: var(--i-nil-doc-container-s) solid var(--width);
|
|
161
163
|
}
|
|
162
164
|
|
|
163
|
-
.container.b
|
|
164
|
-
.container.moving.b
|
|
165
|
+
.container.b.horizontal > .divider:hover,
|
|
166
|
+
.container.moving.b.horizontal > .divider {
|
|
165
167
|
border-top: var(--i-nil-doc-container-s) solid var(--width);
|
|
166
168
|
}
|
|
167
169
|
|
|
168
|
-
.container
|
|
169
|
-
.container.moving
|
|
170
|
+
.container.a.vertical > .divider:hover,
|
|
171
|
+
.container.moving.a.vertical > .divider {
|
|
170
172
|
border-right: var(--i-nil-doc-container-s) solid var(--width);
|
|
171
173
|
}
|
|
172
174
|
|