@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.
Files changed (84) hide show
  1. package/components/Base.svelte +6 -3
  2. package/components/Base.svelte.d.ts +8 -18
  3. package/components/block/Block.svelte +5 -3
  4. package/components/block/Block.svelte.d.ts +6 -15
  5. package/components/block/Controls.svelte +6 -5
  6. package/components/block/Controls.svelte.d.ts +7 -17
  7. package/components/block/Instance.svelte +48 -33
  8. package/components/block/Instance.svelte.d.ts +22 -19
  9. package/components/block/Params.svelte +22 -12
  10. package/components/block/Params.svelte.d.ts +6 -16
  11. package/components/block/Template.svelte +32 -15
  12. package/components/block/Template.svelte.d.ts +21 -18
  13. package/components/block/controls/Controls.svelte +15 -10
  14. package/components/block/controls/Controls.svelte.d.ts +6 -16
  15. package/components/block/controls/Styler.svelte +5 -2
  16. package/components/block/controls/Styler.svelte.d.ts +7 -17
  17. package/components/block/controls/events/Events.svelte +4 -2
  18. package/components/block/controls/events/Events.svelte.d.ts +10 -20
  19. package/components/block/controls/props/Button.svelte +7 -6
  20. package/components/block/controls/props/Button.svelte.d.ts +6 -16
  21. package/components/block/controls/props/Color.svelte +15 -12
  22. package/components/block/controls/props/Color.svelte.d.ts +9 -19
  23. package/components/block/controls/props/Component.svelte +13 -11
  24. package/components/block/controls/props/Component.svelte.d.ts +9 -19
  25. package/components/block/controls/props/Number.svelte +14 -10
  26. package/components/block/controls/props/Number.svelte.d.ts +9 -19
  27. package/components/block/controls/props/Props.svelte +12 -5
  28. package/components/block/controls/props/Props.svelte.d.ts +9 -18
  29. package/components/block/controls/props/Range.svelte +23 -20
  30. package/components/block/controls/props/Range.svelte.d.ts +9 -19
  31. package/components/block/controls/props/Select.svelte +14 -10
  32. package/components/block/controls/props/Select.svelte.d.ts +9 -19
  33. package/components/block/controls/props/{Object.svelte → Table.svelte} +15 -11
  34. package/components/block/controls/props/Table.svelte.d.ts +12 -0
  35. package/components/block/controls/props/Text.svelte +14 -10
  36. package/components/block/controls/props/Text.svelte.d.ts +9 -19
  37. package/components/block/controls/props/Toggle.svelte +14 -10
  38. package/components/block/controls/props/Toggle.svelte.d.ts +10 -19
  39. package/components/block/controls/props/Tuple.svelte +15 -11
  40. package/components/block/controls/props/Tuple.svelte.d.ts +9 -19
  41. package/components/block/controls/props/misc/GroupHeader.svelte +12 -11
  42. package/components/block/controls/props/misc/GroupHeader.svelte.d.ts +10 -20
  43. package/components/block/controls/props/misc/Name.svelte +5 -3
  44. package/components/block/controls/props/misc/Name.svelte.d.ts +7 -17
  45. package/components/block/controls/props/misc/Toggle.svelte +10 -6
  46. package/components/block/controls/props/misc/Toggle.svelte.d.ts +7 -18
  47. package/components/block/controls/props/misc/defaulter.d.ts +1 -1
  48. package/components/block/controls/props/misc/defaulter.js +1 -1
  49. package/components/block/controls/props/misc/utils.d.ts +3 -3
  50. package/components/block/controls/types.d.ts +6 -6
  51. package/components/block/icons/Button.svelte +9 -5
  52. package/components/block/icons/Button.svelte.d.ts +10 -34
  53. package/components/block/icons/ControlView.svelte +3 -1
  54. package/components/block/icons/ControlView.svelte.d.ts +5 -15
  55. package/components/block/icons/Position.svelte +8 -6
  56. package/components/block/icons/Position.svelte.d.ts +5 -15
  57. package/components/layout/Container.svelte +28 -25
  58. package/components/layout/Container.svelte.d.ts +11 -21
  59. package/components/layout/Content.svelte +4 -1
  60. package/components/layout/Content.svelte.d.ts +6 -26
  61. package/components/layout/DocLayout.svelte +15 -21
  62. package/components/layout/DocLayout.svelte.d.ts +11 -25
  63. package/components/layout/Layout.svelte +42 -32
  64. package/components/layout/Layout.svelte.d.ts +18 -27
  65. package/components/layout/Scrollable.svelte +4 -1
  66. package/components/layout/Scrollable.svelte.d.ts +6 -26
  67. package/components/layout/ThemeToggle.svelte +5 -3
  68. package/components/layout/ThemeToggle.svelte.d.ts +5 -15
  69. package/components/layout/VerticalPanel.svelte +4 -1
  70. package/components/layout/VerticalPanel.svelte.d.ts +6 -26
  71. package/components/layout/icons/Icon.svelte +8 -3
  72. package/components/layout/icons/Icon.svelte.d.ts +9 -20
  73. package/components/layout/icons/Nil.svelte +16 -13
  74. package/components/layout/icons/Nil.svelte.d.ts +3 -14
  75. package/components/layout/icons/Theme.svelte +2 -2
  76. package/components/layout/icons/Theme.svelte.d.ts +5 -15
  77. package/components/navigation/Nav.svelte +14 -12
  78. package/components/navigation/Nav.svelte.d.ts +11 -20
  79. package/components/navigation/Node.svelte +22 -22
  80. package/components/navigation/Node.svelte.d.ts +16 -24
  81. package/components/navigation/Tree.svelte +11 -8
  82. package/components/navigation/Tree.svelte.d.ts +13 -22
  83. package/package.json +3 -3
  84. package/components/block/controls/props/Object.svelte.d.ts +0 -22
@@ -1,21 +1,11 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- visible: boolean;
5
- events?: {
6
- name: string;
7
- detail: string;
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
- export type EventsProps = typeof __propDef.props;
17
- export type EventsEvents = typeof __propDef.events;
18
- export type EventsSlots = typeof __propDef.slots;
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
- export let info;
3
- export let visible = false;
4
- $:
5
- click = getClick(info)();
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 on:click={click}>{getName(info)}</button></div>
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
- declare const __propDef: {
4
- props: {
5
- info: Unionized<PropType<"button">>;
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
- export type ButtonProps = typeof __propDef.props;
14
- export type ButtonEvents = typeof __propDef.events;
15
- export type ButtonSlots = typeof __propDef.slots;
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 context="module">const colorSetter = (format, color) => {
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
- export let value;
25
- export let info;
26
- export let depth;
27
- export let disabled = false;
28
- export let visible = false;
29
- let ivalue = value ?? defaulter(info);
30
- let enabled = value !== void 0;
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 = enabled && !disabled ? ivalue : void 0;
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
- declare const __propDef: {
4
- props: {
5
- value: string | undefined;
6
- info: Unionized<PropType<"color">>;
7
- depth: number;
8
- disabled?: boolean | undefined;
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
- export type ColorProps = typeof __propDef.props;
17
- export type ColorEvents = typeof __propDef.events;
18
- export type ColorSlots = typeof __propDef.slots;
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 Object from "./Object.svelte";
7
+ import Table from "./Table.svelte";
8
8
  import Color from "./Color.svelte";
9
9
  import Button from "./Button.svelte";
10
- export let value;
11
- export let info;
12
- export let depth;
13
- export let disabled = false;
14
- export let visible = false;
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 "object" === info[1]}
19
- <Object {info} bind:value {depth} {disabled} {visible} />
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 "object" === info.type}
38
- <Object {info} bind:value {depth} {disabled} {visible} />
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
- declare const __propDef: {
4
- props: {
5
- value: any;
6
- info: Prop | SpecialProp;
7
- depth: number;
8
- disabled?: boolean | undefined;
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
- export type ComponentProps = typeof __propDef.props;
17
- export type ComponentEvents = typeof __propDef.events;
18
- export type ComponentSlots = typeof __propDef.slots;
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
- export let value;
6
- export let info;
7
- export let depth;
8
- export let disabled = false;
9
- export let visible = false;
10
- let ivalue = value ?? defaulter(info);
11
- let enabled = value !== void 0;
12
- $:
13
- value = enabled && !disabled ? ivalue : void 0;
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
- declare const __propDef: {
4
- props: {
5
- value: number | undefined;
6
- info: Unionized<PropType<"number">>;
7
- depth: number;
8
- disabled?: boolean | undefined;
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
- export type NumberProps = typeof __propDef.props;
17
- export type NumberEvents = typeof __propDef.events;
18
- export type NumberSlots = typeof __propDef.slots;
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
- export let infos;
4
- export let values;
5
- export let visible;
3
+ let {
4
+ infos,
5
+ values,
6
+ visible
7
+ } = $props();
6
8
  </script>
7
9
 
8
10
  {#each infos as info}
9
- <Component {info} bind:value={values[getName(info)]} depth={1} {visible} />
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
- declare const __propDef: {
5
- props: {
6
- infos: (SpecialProp | Prop)[];
7
- values: Record<string, ValueType>;
8
- visible: boolean;
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
- export type PropsProps = typeof __propDef.props;
16
- export type PropsEvents = typeof __propDef.events;
17
- export type PropsSlots = typeof __propDef.slots;
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
- export let value;
7
- export let info;
8
- export let depth;
9
- export let disabled = false;
10
- export let visible = false;
11
- let ivalue = value ?? defaulter(info);
12
- let enabled = value !== void 0;
13
- $:
14
- value = enabled && !disabled ? ivalue : void 0;
15
- $:
16
- i = info instanceof Array ? {
17
- min: info[2],
18
- max: info[3],
19
- step: info[4]
20
- } : {
21
- min: info.min,
22
- max: info.max,
23
- step: info.step
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
- declare const __propDef: {
4
- props: {
5
- value: number | undefined;
6
- info: Unionized<PropType<"range">>;
7
- depth: number;
8
- disabled?: boolean | undefined;
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
- export type RangeProps = typeof __propDef.props;
17
- export type RangeEvents = typeof __propDef.events;
18
- export type RangeSlots = typeof __propDef.slots;
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
- export let value;
6
- export let info;
7
- export let depth;
8
- export let disabled = false;
9
- export let visible = false;
10
- let ivalue = value ?? defaulter(info);
11
- let enabled = value !== void 0;
12
- $:
13
- value = enabled && !disabled ? ivalue : void 0;
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
- declare const __propDef: {
4
- props: {
5
- value: string | undefined;
6
- info: Unionized<PropType<"select">>;
7
- depth: number;
8
- disabled?: boolean | undefined;
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
- export type SelectProps = typeof __propDef.props;
17
- export type SelectEvents = typeof __propDef.events;
18
- export type SelectSlots = typeof __propDef.slots;
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
- export let value;
6
- export let info;
7
- export let depth;
8
- export let disabled = false;
9
- export let visible = false;
10
- const ivalue = value ?? defaulter(info);
11
- let enabled = value !== void 0;
12
- let expand = getValues(info).length > 0 ? true : void 0;
13
- $:
14
- value = !disabled && enabled ? ivalue : void 0;
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
- export let value;
6
- export let info;
7
- export let depth;
8
- export let disabled = false;
9
- export let visible = false;
10
- let ivalue = value ?? defaulter(info);
11
- let enabled = value !== void 0;
12
- $:
13
- value = enabled && !disabled ? ivalue : void 0;
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
- declare const __propDef: {
4
- props: {
5
- value: string | undefined;
6
- info: Unionized<PropType<"text">>;
7
- depth: number;
8
- disabled?: boolean | undefined;
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
- export type TextProps = typeof __propDef.props;
17
- export type TextEvents = typeof __propDef.events;
18
- export type TextSlots = typeof __propDef.slots;
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;