Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

dom-render

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-render - npm Package Compare versions

Comparing version 1.0.49 to 1.0.50

dist/validations/Validation.d.ts

2

package.json
{
"name": "dom-render",
"version": "1.0.49",
"version": "1.0.50",
"main": "DomRender.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -208,2 +208,103 @@ ![Single Page Application Framworks](assets/banner.png)

# validation
```html
<div class="row mb-3">
<div class="col">
<span>์•„์ด๋””</span>
<input class="w-100" type="text" name="id" placeholder="์•„์ด๋””" dr-value-link="this.form.id.value" dr-event-blur="this.form.id.valid()" required/>
<span dr-on-init="this.form.id.msgElement" class="d-none"></span>
</div>
</div>
<div class="row mb-3">
<div class="col">
<span>๋น„๋ฐ€๋ฒˆํ˜ธ</span>
<input class="w-100" type="password" name="id" placeholder="์ˆซ์ž, ์˜๋ฌธ, ํŠน์ˆ˜๋ฌธ์ž ์กฐํ•ฉ ์ตœ์†Œ 8์ž~20์ž" dr-value-link="this.form.password.value" dr-event-blur="this.form.password.valid()" required/>
<span dr-on-init="this.form.password.msgElement" >password valid message section</span>
<input class="w-100" type="password" name="id" placeholder="๋น„๋ฐ€๋ฒˆํ˜ธ ์žฌ์ž…๋ ฅ" dr-value-link="this.form.confirmPassword" required/>
<span dr-class="{'d-block': this.form.password != this.form.confirmPassword, 'text-danger': this.form.password != this.form.confirmPassword}">2nd input password valid message section</span>
</div>
</div>
<div class="row mb-3">
<div class="col">
<span>์ด๋ฉ”์ผ</span>
<input class="w-100" type="email" name="id" placeholder="์ด๋ฉ”์ผ" dr-value-link="this.form.email" required/>
<span class="">2nd input password valid message section</span>
</div>
</div>
</div>
```
```typescript
class SignUp {
public form = new class extends Validation {
id = new class extends Validation {
public msgElement!: HTMLElement;
valid(): boolean {
let valid = false;
if (this.length == 0) {
this.msgElement.className = 'd-block text-danger';
this.msgElement.textContent = '์•„์ด๋””๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.';
} else if (this.length < 3 || this.length > 20) {
this.msgElement.className = 'd-block text-danger';
this.msgElement.textContent = '์•„์ด๋””๋Š” 4๊ธ€์ž ์ด์ƒ 20์ž ๋ฏธ๋งŒ ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.';
} else {
let isExist = false;
if (isExist) {
this.msgElement.className = 'd-block text-danger';
this.msgElement.textContent = '์ด๋ฏธ ์‚ฌ์šฉ์ค‘์ธ ์•„์ด๋””์ž…๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์•„์ด๋””๋ฅผ ์ด์šฉํ•ด์ฃผ์„ธ์š”.';
} else {
this.msgElement.className = 'd-block text-success';
this.msgElement.textContent = '์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์•„์ด๋””์ž…๋‹ˆ๋‹ค.';
valid = true;
}
}
return valid;
}
}();
password = new class extends Validation {
public msgElement!: HTMLElement;
valid(): boolean {
let valid = false;
let regExp = /^.*(?=.)(?=.*[0-9])(?=.*[a-zA-Z]).*$/;
const ERROR_REQUIRE_PW = '๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.';
const ERROR_PW_LENGTH = '๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” 8๊ธ€์ž~20๊ธ€์ž๋กœ ์ด๋ฃจ์–ด์ ธ์•ผ ํ•ฉ๋‹ˆ๋‹ค.';
const ERROR_PW_REGEXP = '๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” ์ˆซ์ž, ์˜๋ฌธ, ํŠน์ˆ˜๋ฌธ์ž ์กฐํ•ฉ์œผ๋กœ ์ด๋ฃจ์–ด์ ธ์•ผ ํ•ฉ๋‹ˆ๋‹ค.';
const SUCCESS_AVAILABLE_USER_PW = '์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋น„๋ฐ€๋ฒˆํ˜ธ์ž…๋‹ˆ๋‹ค.';
if (this.length == 0) {
this.msgElement.className = 'd-block text-danger';
this.msgElement.textContent = ERROR_REQUIRE_PW;
} else if (this.length < 8 || this.length > 20) {
this.msgElement.className = 'd-block text-danger';
this.msgElement.textContent = ERROR_PW_LENGTH;
} else {
if (regExp.test(this.value)) {
this.msgElement.className = 'd-block text-success';
this.msgElement.textContent = SUCCESS_AVAILABLE_USER_PW;
valid = true;
} else {
this.msgElement.className = 'd-block text-danger';
this.msgElement.textContent = ERROR_PW_REGEXP;
}
}
return valid;
}
}();
confirmPassword = new class extends Validation {
value = '';
valid(): boolean {
return true;
}
}();
email = new class extends Validation {
value = '';
valid(): boolean {
return true;
}
}();
valid() {
return this.childValid()
}
}();
}
```
# Detect Get, Set

@@ -210,0 +311,0 @@ OnBeforeReturnSet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc