Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twenty-papers-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: delete `RemoteFormAllIssue`, add `path` to `RemoteFormIssue`
7 changes: 2 additions & 5 deletions packages/kit/src/exports/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1911,12 +1911,12 @@ export type RemoteFormField<Value extends RemoteFormFieldValue> = RemoteFormFiel

type RemoteFormFieldContainer<Value> = RemoteFormFieldMethods<Value> & {
/** Validation issues belonging to this or any of the fields that belong to it, if any */
allIssues(): RemoteFormAllIssue[] | undefined;
allIssues(): RemoteFormIssue[] | undefined;
};

type UnknownField<Value> = RemoteFormFieldMethods<Value> & {
/** Validation issues belonging to this or any of the fields that belong to it, if any */
allIssues(): RemoteFormAllIssue[] | undefined;
allIssues(): RemoteFormIssue[] | undefined;
/**
* Returns an object that can be spread onto an input element with the correct type attribute,
* aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters.
Expand Down Expand Up @@ -1963,9 +1963,6 @@ export interface RemoteFormInput {

export interface RemoteFormIssue {
message: string;
}

export interface RemoteFormAllIssue extends RemoteFormIssue {
path: Array<string | number>;
}

Expand Down
1 change: 1 addition & 0 deletions packages/kit/src/runtime/form-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ export function create_field_proxy(target, get_input, set_input, get_issues, pat
return all_issues
?.filter((issue) => issue.name === key)
?.map((issue) => ({
path: issue.path,
message: issue.message
}));
};
Expand Down
7 changes: 2 additions & 5 deletions packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1887,12 +1887,12 @@ declare module '@sveltejs/kit' {

type RemoteFormFieldContainer<Value> = RemoteFormFieldMethods<Value> & {
/** Validation issues belonging to this or any of the fields that belong to it, if any */
allIssues(): RemoteFormAllIssue[] | undefined;
allIssues(): RemoteFormIssue[] | undefined;
};

type UnknownField<Value> = RemoteFormFieldMethods<Value> & {
/** Validation issues belonging to this or any of the fields that belong to it, if any */
allIssues(): RemoteFormAllIssue[] | undefined;
allIssues(): RemoteFormIssue[] | undefined;
/**
* Returns an object that can be spread onto an input element with the correct type attribute,
* aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters.
Expand Down Expand Up @@ -1939,9 +1939,6 @@ declare module '@sveltejs/kit' {

export interface RemoteFormIssue {
message: string;
}

export interface RemoteFormAllIssue extends RemoteFormIssue {
path: Array<string | number>;
}

Expand Down