@inertiajs/svelte 2.3.8 → 2.3.9
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.
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
} from "@inertiajs/core";
|
|
8
8
|
import {} from "laravel-precognition";
|
|
9
9
|
import { isEqual } from "lodash-es";
|
|
10
|
-
import { onMount } from "svelte";
|
|
10
|
+
import { onMount, setContext } from "svelte";
|
|
11
|
+
import { writable } from "svelte/store";
|
|
12
|
+
import { FormContextKey } from "./formContext";
|
|
11
13
|
import useForm from "../useForm";
|
|
12
14
|
const noop = () => void 0;
|
|
13
15
|
export let action = "";
|
|
@@ -181,6 +183,33 @@ $: {
|
|
|
181
183
|
}
|
|
182
184
|
}
|
|
183
185
|
$: slotErrors = $form.errors;
|
|
186
|
+
const formContextStore = writable(void 0);
|
|
187
|
+
$: formContextStore.set({
|
|
188
|
+
errors: $form.errors,
|
|
189
|
+
hasErrors: $form.hasErrors,
|
|
190
|
+
processing: $form.processing,
|
|
191
|
+
progress: $form.progress,
|
|
192
|
+
wasSuccessful: $form.wasSuccessful,
|
|
193
|
+
recentlySuccessful: $form.recentlySuccessful,
|
|
194
|
+
isDirty,
|
|
195
|
+
clearErrors,
|
|
196
|
+
resetAndClearErrors,
|
|
197
|
+
setError,
|
|
198
|
+
reset,
|
|
199
|
+
submit,
|
|
200
|
+
defaults,
|
|
201
|
+
getData,
|
|
202
|
+
getFormData,
|
|
203
|
+
// Precognition
|
|
204
|
+
validator,
|
|
205
|
+
validate,
|
|
206
|
+
touch,
|
|
207
|
+
validating: $form.validating,
|
|
208
|
+
valid,
|
|
209
|
+
invalid,
|
|
210
|
+
touched
|
|
211
|
+
});
|
|
212
|
+
setContext(FormContextKey, formContextStore);
|
|
184
213
|
</script>
|
|
185
214
|
|
|
186
215
|
<form
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { progress, router } from '@inertiajs/core';
|
|
|
2
2
|
export { default as App } from './components/App.svelte';
|
|
3
3
|
export { default as Deferred } from './components/Deferred.svelte';
|
|
4
4
|
export { default as Form } from './components/Form.svelte';
|
|
5
|
+
export { useFormContext } from './components/formContext';
|
|
5
6
|
export { default as InfiniteScroll } from './components/InfiniteScroll.svelte';
|
|
6
7
|
export { default as Link } from './components/Link.svelte';
|
|
7
8
|
export { default as WhenVisible } from './components/WhenVisible.svelte';
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { progress, router } from '@inertiajs/core';
|
|
|
3
3
|
export { default as App } from './components/App.svelte';
|
|
4
4
|
export { default as Deferred } from './components/Deferred.svelte';
|
|
5
5
|
export { default as Form } from './components/Form.svelte';
|
|
6
|
+
export { useFormContext } from './components/formContext';
|
|
6
7
|
export { default as InfiniteScroll } from './components/InfiniteScroll.svelte';
|
|
7
8
|
export { default as Link } from './components/Link.svelte';
|
|
8
9
|
export { default as WhenVisible } from './components/WhenVisible.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inertiajs/svelte",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Svelte adapter for Inertia.js",
|
|
6
6
|
"contributors": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/lodash-es": "^4.17.12",
|
|
56
56
|
"laravel-precognition": "^1.0.0",
|
|
57
57
|
"lodash-es": "^4.17.21",
|
|
58
|
-
"@inertiajs/core": "2.3.
|
|
58
|
+
"@inertiajs/core": "2.3.9"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "pnpm package && svelte-check --tsconfig ./tsconfig.json && publint",
|