@github/auto-check-element
Advanced tools
Comparing version 5.1.3 to 5.2.0
@@ -13,2 +13,4 @@ export default class AutoCheckElement extends HTMLElement { | ||
set required(required: boolean); | ||
get csrfField(): string; | ||
set csrfField(value: string); | ||
} | ||
@@ -15,0 +17,0 @@ declare global { |
@@ -119,2 +119,8 @@ function throttle(callback, wait = 0, { | ||
} | ||
get csrfField() { | ||
return this.getAttribute('csrf-field') || 'authenticity_token'; | ||
} | ||
set csrfField(value) { | ||
this.setAttribute('csrf-field', value); | ||
} | ||
} | ||
@@ -174,2 +180,3 @@ function setLoadingState(event) { | ||
} | ||
const csrfField = autoCheckElement.csrfField; | ||
const src = autoCheckElement.src; | ||
@@ -191,3 +198,3 @@ const csrf = autoCheckElement.csrf; | ||
const body = new FormData(); | ||
body.append('authenticity_token', csrf); | ||
body.append(csrfField, csrf); | ||
body.append('value', input.value); | ||
@@ -194,0 +201,0 @@ input.dispatchEvent(new CustomEvent('auto-check-send', { |
{ | ||
"name": "@github/auto-check-element", | ||
"version": "5.1.3", | ||
"version": "5.2.0", | ||
"description": "An input element that validates its value with a server endpoint.", | ||
@@ -33,6 +33,7 @@ "repository": "github/auto-check-element", | ||
"@github/prettier-config": "0.0.4", | ||
"chai": "^4.2.0", | ||
"eslint": "^6.8.0", | ||
"eslint-plugin-github": "^4.0.0", | ||
"karma": "^5.0.9", | ||
"chai": "^4.3.4", | ||
"eslint": "^7.25.0", | ||
"eslint-plugin-custom-elements": "^0.0.2", | ||
"eslint-plugin-github": "^4.1.3", | ||
"karma": "^6.3.2", | ||
"karma-chai": "^0.1.0", | ||
@@ -42,6 +43,6 @@ "karma-chrome-launcher": "^3.1.0", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"mocha": "^6.2.3", | ||
"rollup": "^2.12.0", | ||
"mocha": "^8.3.2", | ||
"rollup": "^2.45.2", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"typescript": "^3.9.3" | ||
"typescript": "^4.2.4" | ||
}, | ||
@@ -48,0 +49,0 @@ "dependencies": { |
@@ -151,3 +151,3 @@ # <auto-check> element | ||
[support]: https://caniuse.com/#feat=custom-elementsv1 | ||
[polyfill]: https://github.com/webcomponents/custom-elements | ||
[polyfill]: https://github.com/webcomponents/polyfills/tree/master/packages/custom-elements | ||
@@ -154,0 +154,0 @@ ## Development |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15541
279
1
14