@nil-/doc 1.0.0 → 2.0.1
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 +6 -3
- package/components/Base.svelte.d.ts +8 -18
- package/components/block/Block.svelte +5 -3
- package/components/block/Block.svelte.d.ts +6 -15
- package/components/block/Controls.svelte +6 -5
- package/components/block/Controls.svelte.d.ts +7 -17
- package/components/block/Instance.svelte +48 -33
- package/components/block/Instance.svelte.d.ts +22 -19
- package/components/block/Params.svelte +22 -12
- package/components/block/Params.svelte.d.ts +6 -16
- package/components/block/Template.svelte +32 -15
- package/components/block/Template.svelte.d.ts +21 -18
- package/components/block/controls/Controls.svelte +15 -10
- package/components/block/controls/Controls.svelte.d.ts +6 -16
- package/components/block/controls/Styler.svelte +5 -2
- package/components/block/controls/Styler.svelte.d.ts +7 -17
- package/components/block/controls/events/Events.svelte +4 -2
- package/components/block/controls/events/Events.svelte.d.ts +10 -20
- package/components/block/controls/props/Button.svelte +7 -6
- package/components/block/controls/props/Button.svelte.d.ts +6 -16
- package/components/block/controls/props/Color.svelte +15 -12
- package/components/block/controls/props/Color.svelte.d.ts +9 -19
- package/components/block/controls/props/Component.svelte +13 -11
- package/components/block/controls/props/Component.svelte.d.ts +9 -19
- package/components/block/controls/props/Number.svelte +14 -10
- package/components/block/controls/props/Number.svelte.d.ts +9 -19
- package/components/block/controls/props/Props.svelte +12 -5
- package/components/block/controls/props/Props.svelte.d.ts +9 -18
- package/components/block/controls/props/Range.svelte +23 -20
- package/components/block/controls/props/Range.svelte.d.ts +9 -19
- package/components/block/controls/props/Select.svelte +14 -10
- package/components/block/controls/props/Select.svelte.d.ts +9 -19
- package/components/block/controls/props/{Object.svelte → Table.svelte} +15 -11
- package/components/block/controls/props/Table.svelte.d.ts +12 -0
- package/components/block/controls/props/Text.svelte +14 -10
- package/components/block/controls/props/Text.svelte.d.ts +9 -19
- package/components/block/controls/props/Toggle.svelte +14 -10
- package/components/block/controls/props/Toggle.svelte.d.ts +10 -19
- package/components/block/controls/props/Tuple.svelte +15 -11
- package/components/block/controls/props/Tuple.svelte.d.ts +9 -19
- package/components/block/controls/props/misc/GroupHeader.svelte +12 -11
- package/components/block/controls/props/misc/GroupHeader.svelte.d.ts +10 -20
- package/components/block/controls/props/misc/Name.svelte +5 -3
- package/components/block/controls/props/misc/Name.svelte.d.ts +7 -17
- package/components/block/controls/props/misc/Toggle.svelte +10 -6
- package/components/block/controls/props/misc/Toggle.svelte.d.ts +7 -18
- package/components/block/controls/props/misc/defaulter.d.ts +1 -1
- package/components/block/controls/props/misc/defaulter.js +1 -1
- package/components/block/controls/props/misc/utils.d.ts +3 -3
- package/components/block/controls/types.d.ts +6 -6
- package/components/block/icons/Button.svelte +9 -5
- package/components/block/icons/Button.svelte.d.ts +10 -34
- package/components/block/icons/ControlView.svelte +3 -1
- package/components/block/icons/ControlView.svelte.d.ts +5 -15
- package/components/block/icons/Position.svelte +8 -6
- package/components/block/icons/Position.svelte.d.ts +5 -15
- package/components/layout/Container.svelte +28 -25
- package/components/layout/Container.svelte.d.ts +11 -21
- package/components/layout/Content.svelte +4 -1
- package/components/layout/Content.svelte.d.ts +6 -26
- package/components/layout/DocLayout.svelte +15 -21
- package/components/layout/DocLayout.svelte.d.ts +11 -25
- package/components/layout/Layout.svelte +42 -32
- package/components/layout/Layout.svelte.d.ts +18 -27
- package/components/layout/Scrollable.svelte +4 -1
- package/components/layout/Scrollable.svelte.d.ts +6 -26
- package/components/layout/ThemeToggle.svelte +5 -3
- package/components/layout/ThemeToggle.svelte.d.ts +5 -15
- package/components/layout/VerticalPanel.svelte +4 -1
- package/components/layout/VerticalPanel.svelte.d.ts +6 -26
- package/components/layout/icons/Icon.svelte +8 -3
- package/components/layout/icons/Icon.svelte.d.ts +9 -20
- package/components/layout/icons/Nil.svelte +16 -13
- package/components/layout/icons/Nil.svelte.d.ts +3 -14
- package/components/layout/icons/Theme.svelte +2 -2
- package/components/layout/icons/Theme.svelte.d.ts +5 -15
- package/components/navigation/Nav.svelte +14 -12
- package/components/navigation/Nav.svelte.d.ts +11 -20
- package/components/navigation/Node.svelte +22 -22
- package/components/navigation/Node.svelte.d.ts +16 -24
- package/components/navigation/Tree.svelte +11 -8
- package/components/navigation/Tree.svelte.d.ts +13 -22
- package/package.json +3 -3
- package/components/block/controls/props/Object.svelte.d.ts +0 -22
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
count: number;
|
|
9
|
-
}[] | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
events?: {
|
|
4
|
+
name: string;
|
|
5
|
+
detail: string;
|
|
6
|
+
count: number;
|
|
7
|
+
}[];
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export default class Events extends SvelteComponentTyped<EventsProps, EventsEvents, EventsSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
9
|
+
declare const Events: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type Events = ReturnType<typeof Events>;
|
|
11
|
+
export default Events;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
<script>import { getClick, getName } from "./misc/utils";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<script lang="ts">import { getClick, getName } from "./misc/utils";
|
|
2
|
+
let {
|
|
3
|
+
info,
|
|
4
|
+
visible = false
|
|
5
|
+
} = $props();
|
|
6
|
+
let click = $derived(getClick(info)());
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
{#if visible}
|
|
9
|
-
<div><button
|
|
10
|
+
<div><button onclick={click}>{getName(info)}</button></div>
|
|
10
11
|
{/if}
|
|
11
12
|
|
|
12
13
|
<style>
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import type { Unionized, PropType } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
visible?: boolean | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
info: Unionized<PropType<"button">>;
|
|
4
|
+
visible?: boolean;
|
|
12
5
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
export default class Button extends SvelteComponentTyped<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
6
|
+
declare const Button: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type Button = ReturnType<typeof Button>;
|
|
8
|
+
export default Button;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script lang="ts" module>const colorSetter = (format, color) => {
|
|
2
2
|
switch (format) {
|
|
3
3
|
case "hex":
|
|
4
4
|
return color.hex.substring(0, 7);
|
|
@@ -17,17 +17,19 @@
|
|
|
17
17
|
};
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<script>import { getName, getFormat } from "./misc/utils";
|
|
20
|
+
<script lang="ts">import { getName, getFormat } from "./misc/utils";
|
|
21
21
|
import { defaulter } from "./misc/defaulter";
|
|
22
22
|
import NameHeader from "./misc/Name.svelte";
|
|
23
23
|
import Toggle from "./misc/Toggle.svelte";
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
let {
|
|
25
|
+
value = $bindable(),
|
|
26
|
+
info,
|
|
27
|
+
depth,
|
|
28
|
+
disabled = false,
|
|
29
|
+
visible = false
|
|
30
|
+
} = $props();
|
|
31
|
+
let ivalue = $state(value ?? defaulter(info));
|
|
32
|
+
let enabled = $state(value !== void 0);
|
|
31
33
|
const action = (d, { format, P }) => {
|
|
32
34
|
d.style.borderColor = ivalue;
|
|
33
35
|
const picker = new P({
|
|
@@ -52,8 +54,10 @@ const action = (d, { format, P }) => {
|
|
|
52
54
|
destroy: () => picker.destroy()
|
|
53
55
|
};
|
|
54
56
|
};
|
|
55
|
-
|
|
56
|
-
value =
|
|
57
|
+
const set_value = (v) => {
|
|
58
|
+
value = v;
|
|
59
|
+
};
|
|
60
|
+
$effect(() => set_value(enabled && !disabled ? ivalue : void 0));
|
|
57
61
|
</script>
|
|
58
62
|
|
|
59
63
|
{#if visible}
|
|
@@ -81,7 +85,6 @@ $:
|
|
|
81
85
|
|
|
82
86
|
<style>
|
|
83
87
|
button {
|
|
84
|
-
position: absolute;
|
|
85
88
|
font-size: 0.7rem;
|
|
86
89
|
border-top-width: 1px;
|
|
87
90
|
border-bottom-width: 1px;
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import type { Unionized, PropType } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
visible?: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
value: string | undefined;
|
|
4
|
+
info: Unionized<PropType<"color">>;
|
|
5
|
+
depth: number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
visible?: boolean;
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export default class Color extends SvelteComponentTyped<ColorProps, ColorEvents, ColorSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
9
|
+
declare const Color: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
10
|
+
type Color = ReturnType<typeof Color>;
|
|
11
|
+
export default Color;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
<script>import Text from "./Text.svelte";
|
|
1
|
+
<script lang="ts">import Text from "./Text.svelte";
|
|
2
2
|
import Number from "./Number.svelte";
|
|
3
3
|
import Range from "./Range.svelte";
|
|
4
4
|
import Toggle from "./Toggle.svelte";
|
|
5
5
|
import Select from "./Select.svelte";
|
|
6
6
|
import Tuple from "./Tuple.svelte";
|
|
7
|
-
import
|
|
7
|
+
import Table from "./Table.svelte";
|
|
8
8
|
import Color from "./Color.svelte";
|
|
9
9
|
import Button from "./Button.svelte";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
let {
|
|
11
|
+
value = $bindable(),
|
|
12
|
+
info,
|
|
13
|
+
depth,
|
|
14
|
+
disabled = false,
|
|
15
|
+
visible = false
|
|
16
|
+
} = $props();
|
|
15
17
|
</script>
|
|
16
18
|
|
|
17
19
|
{#if info instanceof Array}
|
|
18
|
-
{#if "
|
|
19
|
-
<
|
|
20
|
+
{#if "table" === info[1]}
|
|
21
|
+
<Table {info} bind:value {depth} {disabled} {visible} />
|
|
20
22
|
{:else if "tuple" === info[1]}
|
|
21
23
|
<Tuple {info} bind:value {depth} {disabled} {visible} />
|
|
22
24
|
{:else if "text" === info[1]}
|
|
@@ -34,8 +36,8 @@ export let visible = false;
|
|
|
34
36
|
{:else if "button" === info[1]}
|
|
35
37
|
<Button {info} {visible} />
|
|
36
38
|
{/if}
|
|
37
|
-
{:else if "
|
|
38
|
-
<
|
|
39
|
+
{:else if "table" === info.type}
|
|
40
|
+
<Table {info} bind:value {depth} {disabled} {visible} />
|
|
39
41
|
{:else if "tuple" === info.type}
|
|
40
42
|
<Tuple {info} bind:value {depth} {disabled} {visible} />
|
|
41
43
|
{:else if "text" === info.type}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import type { SpecialProp, Prop } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
visible?: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
value: any;
|
|
4
|
+
info: Prop | SpecialProp;
|
|
5
|
+
depth: number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
visible?: boolean;
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export default class Component extends SvelteComponentTyped<ComponentProps, ComponentEvents, ComponentSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
9
|
+
declare const Component: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
10
|
+
type Component = ReturnType<typeof Component>;
|
|
11
|
+
export default Component;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
<script>import { getName } from "./misc/utils";
|
|
1
|
+
<script lang="ts">import { getName } from "./misc/utils";
|
|
2
2
|
import { defaulter } from "./misc/defaulter";
|
|
3
3
|
import NameHeader from "./misc/Name.svelte";
|
|
4
4
|
import Toggle from "./misc/Toggle.svelte";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
let {
|
|
6
|
+
value = $bindable(),
|
|
7
|
+
info,
|
|
8
|
+
depth,
|
|
9
|
+
disabled = false,
|
|
10
|
+
visible = false
|
|
11
|
+
} = $props();
|
|
12
|
+
let ivalue = $state(value ?? defaulter(info));
|
|
13
|
+
let enabled = $state(value !== void 0);
|
|
14
|
+
const set_value = (v) => {
|
|
15
|
+
value = v;
|
|
16
|
+
};
|
|
17
|
+
$effect(() => set_value(enabled && !disabled ? ivalue : void 0));
|
|
14
18
|
</script>
|
|
15
19
|
|
|
16
20
|
{#if visible}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import type { Unionized, PropType } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
visible?: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
value: number | undefined;
|
|
4
|
+
info: Unionized<PropType<"number">>;
|
|
5
|
+
depth: number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
visible?: boolean;
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export default class Number extends SvelteComponentTyped<NumberProps, NumberEvents, NumberSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
9
|
+
declare const Number: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
10
|
+
type Number = ReturnType<typeof Number>;
|
|
11
|
+
export default Number;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
<script>import Component from "./Component.svelte";
|
|
1
|
+
<script lang="ts">import Component from "./Component.svelte";
|
|
2
2
|
import { getName } from "./misc/utils";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
let {
|
|
4
|
+
infos,
|
|
5
|
+
values,
|
|
6
|
+
visible
|
|
7
|
+
} = $props();
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
10
|
{#each infos as info}
|
|
9
|
-
<Component
|
|
11
|
+
<Component
|
|
12
|
+
{info}
|
|
13
|
+
depth={1}
|
|
14
|
+
{visible}
|
|
15
|
+
bind:value={$values.props[getName(info)]}
|
|
16
|
+
/>
|
|
10
17
|
{/each}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { ValueType } from "../../types";
|
|
3
1
|
import type { SpecialProp, Prop } from "../types";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
events: {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {};
|
|
2
|
+
import type { ControlValue } from "../../context";
|
|
3
|
+
import type { Writable } from "svelte/store";
|
|
4
|
+
type $$ComponentProps = {
|
|
5
|
+
infos: (SpecialProp | Prop)[];
|
|
6
|
+
values: Writable<ControlValue>;
|
|
7
|
+
visible: boolean;
|
|
14
8
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
export default class Props extends SvelteComponentTyped<PropsProps, PropsEvents, PropsSlots> {
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
9
|
+
declare const Props: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type Props = ReturnType<typeof Props>;
|
|
11
|
+
export default Props;
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
<script>import { defaulter } from "./misc/defaulter";
|
|
1
|
+
<script lang="ts">import { defaulter } from "./misc/defaulter";
|
|
2
2
|
import NameHeader from "./misc/Name.svelte";
|
|
3
3
|
import { nformat } from "./misc/nformat";
|
|
4
4
|
import { getName } from "./misc/utils";
|
|
5
5
|
import Toggle from "./misc/Toggle.svelte";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
let {
|
|
7
|
+
value = $bindable(),
|
|
8
|
+
info,
|
|
9
|
+
depth,
|
|
10
|
+
disabled = false,
|
|
11
|
+
visible = false
|
|
12
|
+
} = $props();
|
|
13
|
+
let ivalue = $state(value ?? defaulter(info));
|
|
14
|
+
let enabled = $state(value !== void 0);
|
|
15
|
+
const set_value = (v) => {
|
|
16
|
+
value = v;
|
|
17
|
+
};
|
|
18
|
+
$effect(() => set_value(enabled && !disabled ? ivalue : void 0));
|
|
19
|
+
let i = $derived(info instanceof Array ? {
|
|
20
|
+
min: info[2],
|
|
21
|
+
max: info[3],
|
|
22
|
+
step: info[4]
|
|
23
|
+
} : {
|
|
24
|
+
min: info.min,
|
|
25
|
+
max: info.max,
|
|
26
|
+
step: info.step
|
|
27
|
+
});
|
|
25
28
|
</script>
|
|
26
29
|
|
|
27
30
|
{#if visible}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import type { Unionized, PropType } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
visible?: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
value: number | undefined;
|
|
4
|
+
info: Unionized<PropType<"range">>;
|
|
5
|
+
depth: number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
visible?: boolean;
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export default class Range extends SvelteComponentTyped<RangeProps, RangeEvents, RangeSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
9
|
+
declare const Range: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
10
|
+
type Range = ReturnType<typeof Range>;
|
|
11
|
+
export default Range;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
<script>import { defaulter } from "./misc/defaulter";
|
|
1
|
+
<script lang="ts">import { defaulter } from "./misc/defaulter";
|
|
2
2
|
import { getValues, getName } from "./misc/utils";
|
|
3
3
|
import NameHeader from "./misc/Name.svelte";
|
|
4
4
|
import Toggle from "./misc/Toggle.svelte";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
let {
|
|
6
|
+
value = $bindable(),
|
|
7
|
+
info,
|
|
8
|
+
depth,
|
|
9
|
+
disabled = false,
|
|
10
|
+
visible = false
|
|
11
|
+
} = $props();
|
|
12
|
+
let ivalue = $state(value ?? defaulter(info));
|
|
13
|
+
let enabled = $state(value !== void 0);
|
|
14
|
+
const set_value = (v) => {
|
|
15
|
+
value = v;
|
|
16
|
+
};
|
|
17
|
+
$effect(() => set_value(enabled && !disabled ? ivalue : void 0));
|
|
14
18
|
</script>
|
|
15
19
|
|
|
16
20
|
{#if visible}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import type { Unionized, PropType } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
visible?: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
value: string | undefined;
|
|
4
|
+
info: Unionized<PropType<"select">>;
|
|
5
|
+
depth: number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
visible?: boolean;
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export default class Select extends SvelteComponentTyped<SelectProps, SelectEvents, SelectSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
9
|
+
declare const Select: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
10
|
+
type Select = ReturnType<typeof Select>;
|
|
11
|
+
export default Select;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
<script>import Component from "./Component.svelte";
|
|
1
|
+
<script lang="ts">import Component from "./Component.svelte";
|
|
2
2
|
import Header from "./misc/GroupHeader.svelte";
|
|
3
3
|
import { defaulter } from "./misc/defaulter";
|
|
4
4
|
import { getValues, getName } from "./misc/utils";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
let {
|
|
6
|
+
value = $bindable(),
|
|
7
|
+
info,
|
|
8
|
+
depth,
|
|
9
|
+
disabled = false,
|
|
10
|
+
visible = false
|
|
11
|
+
} = $props();
|
|
12
|
+
let ivalue = $state(value ?? defaulter(info));
|
|
13
|
+
let enabled = $state(value !== void 0);
|
|
14
|
+
let expand = $state(getValues(info).length > 0 ? true : void 0);
|
|
15
|
+
const set_value = (v) => {
|
|
16
|
+
value = v;
|
|
17
|
+
};
|
|
18
|
+
$effect(() => set_value(enabled && !disabled ? ivalue : void 0));
|
|
15
19
|
</script>
|
|
16
20
|
|
|
17
21
|
<Header name={getName(info)} bind:expand bind:checked={enabled} {depth} {disabled} {visible} />
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ValueType } from "../../types";
|
|
2
|
+
import type { Unionized, PropType } from "../types";
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
value: Record<string, ValueType> | undefined;
|
|
5
|
+
info: Unionized<PropType<"table">>;
|
|
6
|
+
depth: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const Table: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
11
|
+
type Table = ReturnType<typeof Table>;
|
|
12
|
+
export default Table;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
<script>import { getName } from "./misc/utils";
|
|
1
|
+
<script lang="ts">import { getName } from "./misc/utils";
|
|
2
2
|
import { defaulter } from "./misc/defaulter";
|
|
3
3
|
import NameHeader from "./misc/Name.svelte";
|
|
4
4
|
import Toggle from "./misc/Toggle.svelte";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
let {
|
|
6
|
+
value = $bindable(),
|
|
7
|
+
info,
|
|
8
|
+
depth,
|
|
9
|
+
disabled = false,
|
|
10
|
+
visible = false
|
|
11
|
+
} = $props();
|
|
12
|
+
let ivalue = $state(value ?? defaulter(info));
|
|
13
|
+
let enabled = $state(value !== void 0);
|
|
14
|
+
const set_value = (v) => {
|
|
15
|
+
value = v;
|
|
16
|
+
};
|
|
17
|
+
$effect(() => set_value(enabled && !disabled ? ivalue : void 0));
|
|
14
18
|
</script>
|
|
15
19
|
|
|
16
20
|
{#if visible}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import type { Unionized, PropType } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
visible?: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
value: string | undefined;
|
|
4
|
+
info: Unionized<PropType<"text">>;
|
|
5
|
+
depth: number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
visible?: boolean;
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export default class Text extends SvelteComponentTyped<TextProps, TextEvents, TextSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
9
|
+
declare const Text: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
10
|
+
type Text = ReturnType<typeof Text>;
|
|
11
|
+
export default Text;
|