dom-render
Advanced tools
Comparing version 1.0.51 to 1.0.52
{ | ||
"name": "dom-render", | ||
"version": "1.0.51", | ||
"version": "1.0.52", | ||
"main": "DomRender.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -42,2 +42,3 @@ var __read = (this && this.__read) || function (o, n) { | ||
import { Range } from './iterators/Range'; | ||
import { Validation } from './validations/Validation'; | ||
var RawSet = (function () { | ||
@@ -181,3 +182,10 @@ function RawSet(uuid, point, fragment, data) { | ||
var eventName = (_a = it.getAttribute('dr-form:event')) !== null && _a !== void 0 ? _a : 'change'; | ||
it.setAttribute(eventManager.attrPrefix + 'event-' + eventName, drAttr_1.drForm + '.' + it.getAttribute('name') + ' = $target.value'); | ||
var varpath = it.getAttribute('name'); | ||
if (varpath != null) { | ||
var data = ScriptUtils.evalReturn("" + drAttr_1.drForm + (varpath ? '.' + varpath : ''), obj); | ||
if (data instanceof Validation) { | ||
varpath += (varpath ? '.value' : 'value'); | ||
} | ||
it.setAttribute(eventManager.attrPrefix + 'event-' + eventName, drAttr_1.drForm + '.' + varpath + ' = $target.value'); | ||
} | ||
}); | ||
@@ -184,0 +192,0 @@ RawSet.drFormOtherMoveAttr(element_2, 'temp-name', 'name'); |
@@ -338,3 +338,25 @@ ![Single Page Application Framworks](assets/banner.png) | ||
``` | ||
## dr-form (validation) | ||
```typescript | ||
form = new class extends Validation { | ||
id = new class extends Validation { | ||
valid(): boolean { | ||
return false; | ||
} | ||
}() | ||
valid(): boolean { | ||
return false; | ||
} | ||
}(); | ||
console.log(form.id.value) | ||
``` | ||
```html | ||
<form dr-form="this.form" dr-event-submit="this.submit(); $event.preventDefault();"> | ||
<input name="id"> <!-- id value --> | ||
<input name=""> <!-- root value --> | ||
<button type="submit"> submit</button> | ||
</form> | ||
``` | ||
# Detect Get, Set | ||
@@ -341,0 +363,0 @@ OnBeforeReturnSet |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
226983
3847
442