-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
441 additions
and
16,995 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# sling-web-component-card | ||
|
||
Sling Card Basic Component. | ||
|
||
## Install | ||
|
||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
dev/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# sling-web-component-form | ||
|
||
## Install | ||
|
||
``` | ||
npm instal sling-web-component-form | ||
``` | ||
|
||
## Tag | ||
|
||
```HTML | ||
<sling-form></sling-form> | ||
``` | ||
|
||
## Dependencies | ||
|
||
### Required | ||
|
||
* **sling-framework** | ||
* **sling-helpers** | ||
|
||
### Recommended | ||
|
||
* **sling-web-component-button** | ||
* **sling-web-component-input** | ||
|
||
## Attributes and properties | ||
|
||
|Name|Type|Default Values|ReflectToAttribute|Observer|callSdk| | ||
|:--|:--|:--|:--:|:--|:--:| | ||
|formdata|Object|**false**|:x:|:heavy_check_mark:| | ||
|validation|Array|**[]**|:x:|:x:| | ||
|
||
### Description | ||
|
||
|Name|Description| | ||
|:---|:---| | ||
|formdata|Object that contains the data from the form| | ||
|validation|A list of `sling-helper` methods for validations| | ||
|
||
## Events | ||
* **formsubmit** | ||
**Description:** Event triggered every time that the form is submitted. | ||
|
||
* **formupdate** | ||
**Description:** Event triggered when any value of the form is changed. | ||
|
||
### Use | ||
|
||
Use it like you are using a `<form>` tag. You can put anything form-related inside of it. | ||
|
||
```HTML | ||
<sling-form> | ||
<sling-input name="name" type="text" label="Name"></sling-input> | ||
<!-- ... --> | ||
</sling-form> | ||
``` | ||
|
||
## Examples | ||
All component examples can be emulated using the `npm start sling-web-component-form` command. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "sling-web-component-form", | ||
"version": "1.4.0", | ||
"description": "Sling Form", | ||
"module": "src/index.js", | ||
"main": "dist/cjs/es6/index.js", | ||
"jsnext:main": "dist/es/es6/index.js", | ||
"browser": "dist/iife/es6/index.js", | ||
"author": "Stone Pagamentos", | ||
"dependencies": { | ||
"sling-web-component-button": "^1.4.0", | ||
"sling-web-component-input": "^1.4.0", | ||
"sling-framework": "^1.4.0", | ||
"sling-helpers": "^1.4.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import url('https://fonts.googleapis.com/css?family=Heebo:400,500'); | ||
|
||
body { | ||
font-family: 'Heebo', sans-serif; | ||
} | ||
|
||
body > * { | ||
margin: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<link rel="stylesheet" href="index.css"> | ||
<title>sling-form</title> | ||
</head> | ||
<body> | ||
<sling-form> | ||
<sling-input name="name" type="text" label="Nome"></sling-input> | ||
<sling-input name="email" type="email" label="E-mail"></sling-input> | ||
<sling-input name="phone" type="phone" label="Telefone com DDD" placeholder="(00) 0000-0000"></sling-input> | ||
<sling-input name="cpf" type="cpf" label="CPF"></sling-input> | ||
<sling-input name="cnpj" type="cnpj" label="CNPJ"></sling-input> | ||
<sling-button type="submit" layout="outline" color="success">Enviar</sling-button> | ||
</sling-form> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'sling-web-component-input'; | ||
import 'sling-web-component-button'; | ||
|
||
import { | ||
isNotEmpty, | ||
isValidEmail, | ||
isValidPhone, | ||
isValidCPF, | ||
isValidCNPJ, | ||
} from 'sling-helpers'; | ||
|
||
const $form = document.querySelector('sling-form'); | ||
|
||
$form.validation = [ | ||
isNotEmpty('name'), | ||
isNotEmpty('email'), | ||
isValidEmail('email'), | ||
isNotEmpty('phone'), | ||
isValidPhone('phone'), | ||
isNotEmpty('cpf'), | ||
isValidCPF('cpf'), | ||
isNotEmpty('cnpj'), | ||
isValidCNPJ('cnpj'), | ||
]; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
:host { | ||
display: grid; | ||
} | ||
|
||
/* for compatibility */ | ||
|
||
sling-form { | ||
display: grid; | ||
} |
Oops, something went wrong.