Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
HubbeDev committed Jan 23, 2024
1 parent f80c70c commit e1c4357
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 45 deletions.
12 changes: 0 additions & 12 deletions apps/svelte-gravity-forms/src/lib/components/input/input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@
)}
{...attrs}
bind:value={$value}
on:blur
on:change
on:click
on:focus
on:keydown
on:keypress
on:keyup
on:mouseover
on:mouseenter
on:mouseleave
on:paste
on:input
use:actions.input
{...$$restProps}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
e.preventDefault();
}
}
let numericValue = writable<number | unknown>(undefined);
let inputValue = writable<string | number | unknown>($value);
$: {
if (!isNaN(Number($value)) && $value !== '') {
$numericValue = Number($value);
Expand Down
1 change: 0 additions & 1 deletion apps/svelte-gravity-forms/src/lib/components/root.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
// Reset the form upon a successful result
applyAction: true,
invalidateAll: true,
// Reset the form upon a successful result
resetForm: true,
taintedMessage: null,
// On ActionResult> error, render the nearest +error.svelte pages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
>
<slot />
</select>
<ChevronDown class="absolute right-3 top-2.5 h-4 w-4 opacity-50" />
<slot name="icon">
<ChevronDown class="absolute right-3 top-2.5 h-4 w-4 opacity-50" />
</slot>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
let className: $$Props['class'] = undefined;
const { attrStore, value } = getFormField() as TextareaGetFormField;
const { attrStore, value, actions } = getFormField() as TextareaGetFormField;
export { className as class };
</script>
Expand All @@ -22,17 +22,6 @@
)}
{...$attrStore}
bind:value={$value}
on:blur
on:change
on:click
on:focus
on:keydown
on:keypress
on:keyup
on:mouseover
on:mouseenter
on:mouseleave
on:paste
on:input
use:actions.textarea
{...$$restProps}
/>
18 changes: 0 additions & 18 deletions apps/svelte-gravity-forms/src/lib/internal/helpers/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,6 @@ export function generateFormSchema(formObject: GFFormObjectProps) {
fieldType = fieldType.max(Number(field.maxLength));
}

/* if (field.maxLength && Number(field.maxLength) > 0) {
fieldType = fieldType.max(
Number(field.maxLength),
`${field.label} is too long (max ${field.maxLength} characters)`
);
} */

/* if (field.rangeMin && Number(field.rangeMin) > 0) {
fieldType = fieldType.min(
Number(field.rangeMin),
`${field.label} is too low (min ${field.rangeMin})`
);
} */

/* if (field.rangeMax) {
fieldType = fieldType.max(10, `${field.label} is too high (max 10)`);
} */

return {
name,
fieldType: fieldType
Expand Down

0 comments on commit e1c4357

Please sign in to comment.