@inertiajs/svelte 2.2.12 → 2.2.13
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.
|
@@ -36,10 +36,10 @@ let isDirty = false;
|
|
|
36
36
|
let defaultData = new FormData();
|
|
37
37
|
$: _method = isUrlMethodPair(action) ? action.method : (method ?? "get").toLowerCase();
|
|
38
38
|
$: _action = isUrlMethodPair(action) ? action.url : action;
|
|
39
|
-
function getFormData() {
|
|
39
|
+
export function getFormData() {
|
|
40
40
|
return new FormData(formElement);
|
|
41
41
|
}
|
|
42
|
-
function getData() {
|
|
42
|
+
export function getData() {
|
|
43
43
|
return formDataToObject(getFormData());
|
|
44
44
|
}
|
|
45
45
|
function updateDirtyState(event) {
|
|
@@ -157,5 +157,7 @@ $: slotErrors = $form.errors;
|
|
|
157
157
|
{isDirty}
|
|
158
158
|
{submit}
|
|
159
159
|
{defaults}
|
|
160
|
+
{getData}
|
|
161
|
+
{getFormData}
|
|
160
162
|
/>
|
|
161
163
|
</form>
|
|
@@ -25,6 +25,8 @@ declare const __propDef: {
|
|
|
25
25
|
resetOnError?: boolean | string[] | undefined;
|
|
26
26
|
resetOnSuccess?: boolean | string[] | undefined;
|
|
27
27
|
setDefaultsOnSuccess?: boolean | undefined;
|
|
28
|
+
getFormData?: (() => FormData) | undefined;
|
|
29
|
+
getData?: (() => Record<string, FormDataConvertible>) | undefined;
|
|
28
30
|
submit?: (() => void) | undefined;
|
|
29
31
|
reset?: ((...fields: string[]) => void) | undefined;
|
|
30
32
|
clearErrors?: ((...fields: string[]) => void) | undefined;
|
|
@@ -49,6 +51,8 @@ declare const __propDef: {
|
|
|
49
51
|
isDirty: boolean;
|
|
50
52
|
submit: () => void;
|
|
51
53
|
defaults: () => void;
|
|
54
|
+
getData: () => Record<string, FormDataConvertible>;
|
|
55
|
+
getFormData: () => FormData;
|
|
52
56
|
};
|
|
53
57
|
};
|
|
54
58
|
exports?: undefined;
|
|
@@ -58,6 +62,8 @@ export type FormProps = typeof __propDef.props;
|
|
|
58
62
|
export type FormEvents = typeof __propDef.events;
|
|
59
63
|
export type FormSlots = typeof __propDef.slots;
|
|
60
64
|
export default class Form extends SvelteComponent<FormProps, FormEvents, FormSlots> {
|
|
65
|
+
get getFormData(): () => FormData;
|
|
66
|
+
get getData(): () => Record<string, FormDataConvertible>;
|
|
61
67
|
get submit(): () => void;
|
|
62
68
|
get reset(): (...fields: string[]) => void;
|
|
63
69
|
get clearErrors(): (...fields: string[]) => void;
|
package/dist/link.js
CHANGED
|
@@ -53,7 +53,7 @@ function link(node, initialParams = {}) {
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
|
-
function update({ cacheFor = 0, prefetch = false, cacheTags: cacheTagValues = [], ...params }) {
|
|
56
|
+
function update({ cacheFor = 0, prefetch = false, cacheTags: cacheTagValues = [], viewTransition = false, ...params }) {
|
|
57
57
|
prefetchModes = (() => {
|
|
58
58
|
if (prefetch === true) {
|
|
59
59
|
return ['hover'];
|
|
@@ -92,6 +92,7 @@ function link(node, initialParams = {}) {
|
|
|
92
92
|
};
|
|
93
93
|
visitParams = {
|
|
94
94
|
...baseParams,
|
|
95
|
+
viewTransition,
|
|
95
96
|
onStart: (visit) => {
|
|
96
97
|
inFlightCount++;
|
|
97
98
|
updateNodeAttributes();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inertiajs/svelte",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Svelte adapter for Inertia.js",
|
|
6
6
|
"contributors": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@types/lodash-es": "^4.17.12",
|
|
56
56
|
"lodash-es": "^4.17.21",
|
|
57
|
-
"@inertiajs/core": "2.2.
|
|
57
|
+
"@inertiajs/core": "2.2.13"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "pnpm package && svelte-check --tsconfig ./tsconfig.json && publint",
|