laravel-precognition-alpine
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -8,3 +8,2 @@ import { client, createValidator, resolveName, toSimpleValidationErrors, resolveUrl, resolveMethod } from 'laravel-precognition'; | ||
Alpine.magic('form', (el) => (method, url, inputs, config = {}) => { | ||
syncWithDom(el, resolveMethod(method), resolveUrl(url)); | ||
/** | ||
@@ -138,2 +137,3 @@ * The original data. | ||
const form = Alpine.reactive(createForm()); | ||
syncWithDom(el, resolveMethod(method), resolveUrl(url), form); | ||
return form; | ||
@@ -145,3 +145,3 @@ }); | ||
*/ | ||
const syncWithDom = (el, method, url) => { | ||
const syncWithDom = (el, method, url, form) => { | ||
if (!(el instanceof Element && el.nodeName === 'FORM')) { | ||
@@ -153,2 +153,3 @@ return; | ||
syncActionAttribute(el, url); | ||
addProcessingListener(el, form); | ||
}; | ||
@@ -190,1 +191,5 @@ /** | ||
}; | ||
/** | ||
* Add processing listener. | ||
*/ | ||
const addProcessingListener = (el, form) => el.addEventListener('submit', () => (form.processing = true)); |
{ | ||
"name": "laravel-precognition-alpine", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Laravel Precognition (Alpine).", | ||
@@ -34,3 +34,3 @@ "keywords": [ | ||
"dependencies": { | ||
"laravel-precognition": "0.5.0", | ||
"laravel-precognition": "0.5.1", | ||
"lodash.clonedeep": "^4.5.0", | ||
@@ -37,0 +37,0 @@ "lodash.get": "^4.4.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11390
214
+ Addedlaravel-precognition@0.5.1(transitive)
- Removedlaravel-precognition@0.5.0(transitive)
Updatedlaravel-precognition@0.5.1