fix(ui): integrate number input to exports, ui page, benchmark
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m46s
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m46s
This commit is contained in:
@@ -5,11 +5,11 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Integer } from "@nodarium/ui";
|
|
||||||
import { writable } from "svelte/store";
|
|
||||||
import { humanizeDuration } from "$lib/helpers";
|
import { humanizeDuration } from "$lib/helpers";
|
||||||
import Monitor from "$lib/performance/Monitor.svelte";
|
|
||||||
import { localState } from "$lib/helpers/localState.svelte";
|
import { localState } from "$lib/helpers/localState.svelte";
|
||||||
|
import Monitor from "$lib/performance/Monitor.svelte";
|
||||||
|
import { Number } from "@nodarium/ui";
|
||||||
|
import { writable } from "svelte/store";
|
||||||
|
|
||||||
function calculateStandardDeviation(array: number[]) {
|
function calculateStandardDeviation(array: number[]) {
|
||||||
const n = array.length;
|
const n = array.length;
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
>
|
>
|
||||||
{:else}
|
{:else}
|
||||||
<label for="bench-samples">Samples</label>
|
<label for="bench-samples">Samples</label>
|
||||||
<Integer id="bench-sample" bind:value={amount.value} max={1000} />
|
<Number id="bench-sample" bind:value={amount.value} max={1000} />
|
||||||
<button onclick={benchmark} disabled={isRunning}> start </button>
|
<button onclick={benchmark} disabled={isRunning}> start </button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
export { default as Input } from "./Input.svelte"
|
export { default as Input } from './Input.svelte';
|
||||||
export { default as Float } from "./inputs/Float.svelte"
|
export { default as Checkbox } from './inputs/Checkbox.svelte';
|
||||||
export { default as Integer } from "./inputs/Integer.svelte"
|
export { default as Float } from './inputs/Float.svelte';
|
||||||
export { default as Select } from "./inputs/Select.svelte"
|
export { default as Integer } from './inputs/Integer.svelte';
|
||||||
export { default as Checkbox } from "./inputs/Checkbox.svelte"
|
export { default as Number } from './inputs/Number.svelte';
|
||||||
export { default as Vec3 } from "./inputs/Vec3.svelte";
|
export { default as Select } from './inputs/Select.svelte';
|
||||||
|
export { default as Vec3 } from './inputs/Vec3.svelte';
|
||||||
|
|
||||||
export { default as Details } from "./Details.svelte"
|
export { default as Details } from './Details.svelte';
|
||||||
export { default as ShortCut } from "./ShortCut.svelte";
|
export { default as ShortCut } from './ShortCut.svelte';
|
||||||
|
|
||||||
import Input from './Input.svelte';
|
import Input from './Input.svelte';
|
||||||
export default Input;
|
export default Input;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Float from './Float.svelte';
|
import Number from './Number.svelte';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
value?: any;
|
value?: any;
|
||||||
@@ -10,9 +10,9 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Float id={`${id}-x`} bind:value={value[0]} />
|
<Number id={`${id}-x`} bind:value={value[0]} step={0.01} />
|
||||||
<Float id={`${id}-y`} bind:value={value[1]} />
|
<Number id={`${id}-y`} bind:value={value[1]} step={0.01} />
|
||||||
<Float id={`${id}-z`} bind:value={value[2]} />
|
<Number id={`${id}-z`} bind:value={value[2]} step={0.01} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import '$lib/app.css';
|
import '$lib/app.css';
|
||||||
import { Checkbox, Details, Float, Integer, Select, ShortCut, Vec3 } from '$lib/index.js';
|
import { Checkbox, Details, Float, Integer, Number, Select, ShortCut, Vec3 } from '$lib/index.js';
|
||||||
import Section from './Section.svelte';
|
import Section from './Section.svelte';
|
||||||
|
|
||||||
let intValue = $state(0);
|
let intValue = $state(0);
|
||||||
@@ -38,6 +38,14 @@
|
|||||||
<Float bind:value={floatValue} />
|
<Float bind:value={floatValue} />
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
|
<Section title="Number" value={intValue}>
|
||||||
|
<Number bind:value={intValue} />
|
||||||
|
</Section>
|
||||||
|
|
||||||
|
<Section title="Number (float)" value={floatValue}>
|
||||||
|
<Number bind:value={floatValue} />
|
||||||
|
</Section>
|
||||||
|
|
||||||
<Section title="Vec3" value={JSON.stringify(vecValue)}>
|
<Section title="Vec3" value={JSON.stringify(vecValue)}>
|
||||||
<Vec3 bind:value={vecValue} />
|
<Vec3 bind:value={vecValue} />
|
||||||
</Section>
|
</Section>
|
||||||
|
|||||||
Reference in New Issue
Block a user