@acanto/core-forms
Advanced tools
Comparing version 0.0.39 to 0.0.40
import ajax from "@acanto/core-ajax"; | ||
import ajaxLaravel from "@acanto/core-ajax/laravel"; | ||
import { getPostData, getFormData } from "@acanto/core-fillform/helpers"; | ||
import { $, getDataAttr } from "@acanto/core-dom"; | ||
import { $, addClass, removeClass, getDataAttr } from "@acanto/core-dom"; | ||
import Validation, { ValidationError, ValidationOptions } from "./validation"; | ||
@@ -137,3 +137,3 @@ // import scrollTo from "@acanto/core-scroll/scrollTo"; | ||
$submit.disabled = true; | ||
$root.classList.add("is-loading"); | ||
addClass($root, "is-loading"); | ||
} | ||
@@ -146,3 +146,3 @@ | ||
$submit.disabled = false; | ||
$root.classList.remove("is-loading"); | ||
removeClass($root, "is-loading"); | ||
} | ||
@@ -149,0 +149,0 @@ |
import "@acanto/core-polyfills/closest"; | ||
import { $, $each, getDataAttr } from "@acanto/core-dom"; | ||
import { $, $each, addClass, removeClass, getDataAttr } from "@acanto/core-dom"; | ||
@@ -112,5 +112,5 @@ type FormsElementType = | ||
if (this.value) { | ||
this.classList.add("notempty"); | ||
addClass(this, "notempty"); | ||
} else { | ||
this.classList.remove("notempty"); | ||
removeClass(this, "notempty"); | ||
} | ||
@@ -117,0 +117,0 @@ } |
{ | ||
"name": "@acanto/core-forms", | ||
"version": "0.0.39", | ||
"version": "0.0.40", | ||
"author": "Acanto <info@acanto.net> (https://acanto.agency/)", | ||
@@ -15,4 +15,4 @@ "license": "ISC", | ||
"dependencies": { | ||
"@acanto/core-dom": "^0.0.17", | ||
"@acanto/core-polyfills": "^0.0.17" | ||
"@acanto/core-dom": "^0.0.18", | ||
"@acanto/core-polyfills": "^0.0.18" | ||
}, | ||
@@ -32,3 +32,3 @@ "sideEffects": [ | ||
], | ||
"gitHead": "f31e5fb27fe94c35b5543531363ae25aa437b718" | ||
"gitHead": "4a535ee9ef1c6303220803d4a9e04c1ef1a18080" | ||
} |
import "@acanto/core-polyfills/closest"; | ||
import { $, on, off, throttle, createElement } from "@acanto/core-dom"; | ||
import { | ||
$, | ||
on, | ||
off, | ||
addClass, | ||
removeClass, | ||
throttle, | ||
createElement, | ||
} from "@acanto/core-dom"; | ||
import "./common.scss"; | ||
@@ -166,3 +174,3 @@ | ||
container.classList.add(c.multiple); | ||
addClass(container, c.multiple); | ||
} else { | ||
@@ -185,3 +193,3 @@ progress.appendChild(handle); | ||
if (o.vertical) { | ||
container.classList.add(c.vertical); | ||
addClass(container, c.vertical); | ||
} | ||
@@ -196,6 +204,6 @@ | ||
if (o.tips) { | ||
container.classList.add(c.tips); | ||
addClass(container, c.tips); | ||
if (typeof o.tips === "string" && o.tips === "always") { | ||
container.classList.add(c.visible); | ||
addClass(container, c.visible); | ||
} | ||
@@ -260,3 +268,3 @@ } | ||
this.input.classList.add(c.input); | ||
addClass(this.input, c.input); | ||
@@ -349,3 +357,3 @@ this.bind(); | ||
// show the tip now so we can get the dimensions later | ||
this.nodes.container.classList.add("dragging"); | ||
addClass(this.nodes.container, "dragging"); | ||
@@ -360,3 +368,3 @@ this.recalculate(); | ||
this.activeHandle.classList.add("is-active"); | ||
addClass(this.activeHandle, "is-active"); | ||
@@ -395,7 +403,7 @@ this.setValueFromPosition(e); | ||
this.nodes.container.classList.remove("dragging"); | ||
removeClass(this.nodes.container, "dragging"); | ||
this.onEnd(); | ||
this.activeHandle.classList.remove("is-active"); | ||
removeClass(this.activeHandle, "is-active"); | ||
this.activeHandle = false; | ||
@@ -839,3 +847,3 @@ | ||
this.nodes.container.classList.remove(this.config.classes.disabled); | ||
removeClass(this.nodes.container, this.config.classes.disabled); | ||
@@ -862,3 +870,3 @@ this.input.disabled = false; | ||
this.nodes.container.classList.add(this.config.classes.disabled); | ||
this.nodes.addClass(container, this.config.classes.disabled); | ||
@@ -957,3 +965,3 @@ this.input.disabled = true; | ||
// remove the className from the input | ||
this.input.classList.remove(this.config.classes.input); | ||
removeClass(this.input, this.config.classes.input); | ||
@@ -960,0 +968,0 @@ // kill all nodes |
@@ -1,2 +0,2 @@ | ||
import { toArray, on, off } from "@acanto/core-dom"; | ||
import { toArray, addClass, removeClass, on, off } from "@acanto/core-dom"; | ||
import { isRequired, isEmail } from "../validators"; | ||
@@ -64,4 +64,4 @@ import { getElementWrapper, getElementRules } from "../helpers"; | ||
const wrapper = getElementWrapper($element); | ||
wrapper.classList.remove(CLASSNAME_INVALID); | ||
wrapper.classList.add(CLASSNAME_VALID); | ||
removeClass(wrapper, CLASSNAME_INVALID); | ||
addClass(wrapper, CLASSNAME_VALID); | ||
} | ||
@@ -74,4 +74,4 @@ | ||
const wrapper = getElementWrapper($element); | ||
wrapper.classList.add(CLASSNAME_INVALID); | ||
wrapper.classList.remove(CLASSNAME_VALID); | ||
addClass(wrapper, CLASSNAME_INVALID); | ||
removeClass(wrapper, CLASSNAME_VALID); | ||
} | ||
@@ -145,3 +145,3 @@ | ||
const wrapper = getElementWrapper(this); | ||
wrapper.classList.add(CLASSNAME_TOUCHED); | ||
addClass(wrapper, CLASSNAME_TOUCHED); | ||
off(this, "keyup", setTouchState); | ||
@@ -176,4 +176,4 @@ } | ||
if (!this.disabled && !validator.validate(this)) { | ||
wrapper.classList.add(CLASSNAME_INVALID); | ||
wrapper.classList.remove(CLASSNAME_VALID); | ||
addClass(wrapper, CLASSNAME_INVALID); | ||
removeClass(wrapper, CLASSNAME_VALID); | ||
errors.push({ element: this, name: rule, msg: validator.msg }); | ||
@@ -187,4 +187,4 @@ | ||
wrapper.classList.remove(CLASSNAME_INVALID); | ||
wrapper.classList.add(CLASSNAME_VALID); | ||
removeClass(wrapper, CLASSNAME_INVALID); | ||
addClass(wrapper, CLASSNAME_VALID); | ||
@@ -191,0 +191,0 @@ i++; |
@@ -1,2 +0,2 @@ | ||
import { $, $$, forEach, on, off } from "@acanto/core-dom"; | ||
import { $, $$, forEach, addClass, on, off } from "@acanto/core-dom"; | ||
import { getLabelInput, setEmptyStatus } from "../helpers"; | ||
@@ -16,3 +16,3 @@ | ||
if (!label) { | ||
root.classList.add("nolabel"); | ||
addClass(root, "nolabel"); | ||
return; | ||
@@ -19,0 +19,0 @@ } |
110904
1666
+ Added@acanto/core-dom@0.0.18(transitive)
+ Added@acanto/core-polyfills@0.0.18(transitive)
- Removed@acanto/core-dom@0.0.17(transitive)
- Removed@acanto/core-polyfills@0.0.17(transitive)
Updated@acanto/core-dom@^0.0.18