@lavalogic/scoria 0.1.0 → 0.2.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/dist/Components/GridInput.svelte +11 -6
- package/dist/Components/GridInput.svelte.d.ts +2 -2
- package/dist/Components/GridInputSet.svelte +2 -2
- package/dist/Components/GridInputSet.svelte.d.ts +2 -2
- package/dist/Types/Internal/GridMultiSelectItemAsObject.d.ts +1 -0
- package/dist/Types/Internal/GridMultiSelectItemAsPrimitive.d.ts +1 -0
- package/dist/Types/Internal/GridNumberItem.d.ts +1 -0
- package/dist/Types/Internal/GridSingleSelectItemAsObject.d.ts +1 -0
- package/dist/Types/Internal/GridSingleSelectItemAsPrimitive.d.ts +1 -0
- package/dist/Types/Internal/GridTextItem.d.ts +1 -0
- package/package.json +1 -1
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
31
|
<script lang="ts" generics="V,VP">
|
|
32
|
-
const { item
|
|
32
|
+
const { item, first, last }: GridInputProps<V, VP> = $props();
|
|
33
|
+
|
|
34
|
+
let value = $state(isText(item) ? (item.value ?? '') : '');
|
|
33
35
|
|
|
34
36
|
function isSelect(
|
|
35
37
|
item: GridItem<V, VP>
|
|
@@ -81,7 +83,10 @@
|
|
|
81
83
|
{#if isText(item)}
|
|
82
84
|
<TextInput
|
|
83
85
|
disabled={item.disabled}
|
|
84
|
-
bind:value
|
|
86
|
+
bind:value
|
|
87
|
+
oninput={() => {
|
|
88
|
+
item.updater(value);
|
|
89
|
+
}}
|
|
85
90
|
required={item.required}
|
|
86
91
|
invalid={item.invalid}
|
|
87
92
|
/>
|
|
@@ -100,7 +105,7 @@
|
|
|
100
105
|
selectedValues={item.value}
|
|
101
106
|
invalid={item.invalid}
|
|
102
107
|
onchange={(v) => {
|
|
103
|
-
item.
|
|
108
|
+
item.updater(v || null);
|
|
104
109
|
}}
|
|
105
110
|
/>
|
|
106
111
|
{:else if isMultiSelectPrimitive(item)}
|
|
@@ -113,7 +118,7 @@
|
|
|
113
118
|
selectedValues={item.value}
|
|
114
119
|
invalid={item.invalid}
|
|
115
120
|
onchange={(v) => {
|
|
116
|
-
item.
|
|
121
|
+
item.updater(v.map((it) => it[item.valueProp]));
|
|
117
122
|
}}
|
|
118
123
|
/>
|
|
119
124
|
{/if}
|
|
@@ -135,7 +140,7 @@
|
|
|
135
140
|
disabled={item.disabled}
|
|
136
141
|
invalid={item.invalid}
|
|
137
142
|
onchange={(v) => {
|
|
138
|
-
item.
|
|
143
|
+
item.updater(v || null);
|
|
139
144
|
}}
|
|
140
145
|
/>
|
|
141
146
|
{:else if isSingleSelectPrimitive(item)}
|
|
@@ -151,7 +156,7 @@
|
|
|
151
156
|
disabled={item.disabled}
|
|
152
157
|
invalid={item.invalid}
|
|
153
158
|
onchange={(v) => {
|
|
154
|
-
item.
|
|
159
|
+
item.updater(v?.[item.valueProp] ?? null);
|
|
155
160
|
}}
|
|
156
161
|
/>
|
|
157
162
|
{/if}
|
|
@@ -7,7 +7,7 @@ export interface GridInputProps<V, VP> {
|
|
|
7
7
|
declare function $$render<V, VP>(): {
|
|
8
8
|
props: GridInputProps<V, VP>;
|
|
9
9
|
exports: {};
|
|
10
|
-
bindings: "
|
|
10
|
+
bindings: "";
|
|
11
11
|
slots: {};
|
|
12
12
|
events: {};
|
|
13
13
|
};
|
|
@@ -15,7 +15,7 @@ declare class __sveltets_Render<V, VP> {
|
|
|
15
15
|
props(): ReturnType<typeof $$render<V, VP>>['props'];
|
|
16
16
|
events(): ReturnType<typeof $$render<V, VP>>['events'];
|
|
17
17
|
slots(): ReturnType<typeof $$render<V, VP>>['slots'];
|
|
18
|
-
bindings(): "
|
|
18
|
+
bindings(): "";
|
|
19
19
|
exports(): {};
|
|
20
20
|
}
|
|
21
21
|
interface $$IsomorphicComponent {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import GridInput from './GridInput.svelte';
|
|
14
14
|
import type { GridItem } from '../Types/Internal/GridItem.js';
|
|
15
15
|
|
|
16
|
-
const { items
|
|
16
|
+
const { items, header }: GridInputSetProps<V, VP> = $props();
|
|
17
17
|
|
|
18
18
|
const lastIndex = $derived(items.length - 1);
|
|
19
19
|
</script>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
{@render header()}
|
|
24
24
|
{/if}
|
|
25
25
|
{#each items as item, index (item)}
|
|
26
|
-
<GridInput
|
|
26
|
+
<GridInput item={items[index]} first={index == 0} last={index == lastIndex} />
|
|
27
27
|
{/each}
|
|
28
28
|
</div>
|
|
29
29
|
|
|
@@ -7,7 +7,7 @@ import type { GridItem } from '../Types/Internal/GridItem.js';
|
|
|
7
7
|
declare function $$render<V, VP>(): {
|
|
8
8
|
props: GridInputSetProps<V, VP>;
|
|
9
9
|
exports: {};
|
|
10
|
-
bindings: "
|
|
10
|
+
bindings: "";
|
|
11
11
|
slots: {};
|
|
12
12
|
events: {};
|
|
13
13
|
};
|
|
@@ -15,7 +15,7 @@ declare class __sveltets_Render<V, VP> {
|
|
|
15
15
|
props(): ReturnType<typeof $$render<V, VP>>['props'];
|
|
16
16
|
events(): ReturnType<typeof $$render<V, VP>>['events'];
|
|
17
17
|
slots(): ReturnType<typeof $$render<V, VP>>['slots'];
|
|
18
|
-
bindings(): "
|
|
18
|
+
bindings(): "";
|
|
19
19
|
exports(): {};
|
|
20
20
|
}
|
|
21
21
|
interface $$IsomorphicComponent {
|
|
@@ -2,4 +2,5 @@ import type { GridMultiSelectItem } from './GridMultiSelectItem.js';
|
|
|
2
2
|
export interface GridMultiSelectItemAsPrimitive<V extends object, VP extends string & keyof V> extends GridMultiSelectItem<V, VP> {
|
|
3
3
|
valueAsObject: false;
|
|
4
4
|
value: Array<V[VP]>;
|
|
5
|
+
updater: (v: Array<V[VP]>) => void;
|
|
5
6
|
}
|
|
@@ -2,4 +2,5 @@ import type { GridSingleSelectItem } from './GridSingleSelectItem.js';
|
|
|
2
2
|
export interface GridSingleSelectItemAsObject<V extends object, VP extends keyof V> extends GridSingleSelectItem<V, VP> {
|
|
3
3
|
valueAsObject: true;
|
|
4
4
|
value: V | null;
|
|
5
|
+
updater: (v: V | null) => void;
|
|
5
6
|
}
|
|
@@ -2,4 +2,5 @@ import type { GridSingleSelectItem } from './GridSingleSelectItem.js';
|
|
|
2
2
|
export interface GridSingleSelectItemAsPrimitive<V extends object, VP extends keyof V> extends GridSingleSelectItem<V, VP> {
|
|
3
3
|
valueAsObject: false;
|
|
4
4
|
value: V[VP] | null;
|
|
5
|
+
updater: (v: V[VP] | null) => void;
|
|
5
6
|
}
|