@h-ai/ui 0.1.0-alpha5 → 0.1.0-alpha8
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.
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
await onsubmit?.(formData)
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
function getInputType(fieldType: string):
|
|
83
|
+
function getInputType(fieldType: string): 'email' | 'url' | 'tel' | 'password' | 'number' | 'text' {
|
|
84
84
|
switch (fieldType) {
|
|
85
85
|
case 'email': return 'email'
|
|
86
86
|
case 'url': return 'url'
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
{#if field.type === 'textarea'}
|
|
128
128
|
<FormField label={resolveText(field.label)} required={isRequired}>
|
|
129
129
|
<Textarea
|
|
130
|
+
id={field.id}
|
|
130
131
|
value={String(fieldValue ?? '')}
|
|
131
132
|
{placeholder}
|
|
132
133
|
disabled={submitting || isReadonly}
|
|
@@ -139,9 +140,10 @@
|
|
|
139
140
|
{@const opts = resolveOptions(field.options)}
|
|
140
141
|
<FormField label={resolveText(field.label)} required={isRequired}>
|
|
141
142
|
<Select
|
|
143
|
+
id={field.id}
|
|
142
144
|
value={String(fieldValue ?? '')}
|
|
143
145
|
disabled={submitting || isReadonly}
|
|
144
|
-
onchange={
|
|
146
|
+
onchange={value => updateField(field.id, value)}
|
|
145
147
|
>
|
|
146
148
|
<option value="">{placeholder || uiM('crud_filter_all')}</option>
|
|
147
149
|
{#each opts as opt}
|
|
@@ -176,7 +178,7 @@
|
|
|
176
178
|
<FormField label={resolveText(field.label)}>
|
|
177
179
|
<Checkbox
|
|
178
180
|
checked={Boolean(fieldValue)}
|
|
179
|
-
onchange={checked => updateField(field.id, checked)}
|
|
181
|
+
onchange={(checked: boolean) => updateField(field.id, checked)}
|
|
180
182
|
disabled={submitting || isReadonly}
|
|
181
183
|
/>
|
|
182
184
|
</FormField>
|
|
@@ -184,6 +186,7 @@
|
|
|
184
186
|
{:else}
|
|
185
187
|
<FormField label={resolveText(field.label)} required={isRequired}>
|
|
186
188
|
<Input
|
|
189
|
+
id={field.id}
|
|
187
190
|
type={getInputType(field.type)}
|
|
188
191
|
value={String(fieldValue ?? '')}
|
|
189
192
|
{placeholder}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-ai/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-
|
|
4
|
+
"version": "0.1.0-alpha8",
|
|
5
5
|
"description": "Hai Framework UI component library for Svelte 5 Runes.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"svelte": "./dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"highlight.js": "^11.11.0",
|
|
42
42
|
"marked": "^17.0.4",
|
|
43
43
|
"tailwind-merge": "^3.5.0",
|
|
44
|
-
"@h-ai/core": "0.1.0-
|
|
44
|
+
"@h-ai/core": "0.1.0-alpha8"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@sveltejs/package": "^2.3.7",
|