-
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
68 changed files
with
11,163 additions
and
14,573 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
10 changes: 5 additions & 5 deletions
10
packages/sling-framework/src/v1/src/basic/withEventDispatch.js
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 was deleted.
Oops, something went wrong.
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,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 @@ | ||
# sling-web-component-field-message |
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,13 @@ | ||
{ | ||
"name": "sling-web-component-field-message", | ||
"version": "1.0.0", | ||
"description": "Sling Field Message", | ||
"module": "src/index.js", | ||
"main": "dist/cjs/es5/index.js", | ||
"jsnext:main": "dist/es/es6/index.js", | ||
"author": "Stone Pagamentos", | ||
"dependencies": { | ||
"sling-framework": "^1.11.5", | ||
"sling-helpers": "^1.11.5" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/sling-web-component-field-message/public/index.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,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<script src="../../../scripts/helpers/injectDependencies.js"></script> | ||
<title>sling-field-message</title> | ||
</head> | ||
<body> | ||
<sling-field-message message="Enter message here"></sling-field-message> | ||
</body> | ||
</html> |
9 changes: 9 additions & 0 deletions
9
packages/sling-web-component-field-message/src/assets/host.css
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: block; | ||
} | ||
|
||
/* for compatibility */ | ||
|
||
sling-field-message { | ||
display: block; | ||
} |
45 changes: 45 additions & 0 deletions
45
packages/sling-web-component-field-message/src/component/FieldMessage.js
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,45 @@ | ||
import { setAttr } from 'sling-helpers'; | ||
|
||
export const FieldMessage = Base => class extends Base { | ||
constructor() { | ||
super(); | ||
this.attachShadow({ mode: 'open' }); | ||
|
||
this.shadowRoot.innerHTML = ` | ||
<style> | ||
@import url('sling-web-component-field-message/src/index.css'); | ||
</style> | ||
<div></div> | ||
`; | ||
} | ||
|
||
get textElement() { | ||
return this.shadowRoot.querySelector('div'); | ||
} | ||
|
||
get message() { | ||
return this.getAttribute('message'); | ||
} | ||
|
||
set message(value) { | ||
setAttr(this, 'message', value); | ||
} | ||
|
||
get name() { | ||
return this.getAttribute('name'); | ||
} | ||
|
||
set name(value) { | ||
setAttr(this, 'name', value); | ||
} | ||
|
||
static get observedAttributes() { | ||
return ['message']; | ||
} | ||
|
||
attributeChangedCallback(attrName, previousValue, nextValue) { | ||
if (attrName === 'message' && previousValue !== nextValue) { | ||
this.textElement.innerHTML = nextValue; | ||
} | ||
} | ||
}; |
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 @@ | ||
@import url('assets/host.css'); |
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,4 @@ | ||
import { registerComponent } from 'sling-helpers'; | ||
import { FieldMessage } from './component/FieldMessage.js'; | ||
|
||
registerComponent('sling-field-message', FieldMessage(HTMLElement)); |
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 @@ | ||
# sling-web-component-field |
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,15 @@ | ||
{ | ||
"name": "sling-web-component-field", | ||
"version": "1.0.0", | ||
"description": "Sling Field", | ||
"module": "src/index.js", | ||
"main": "dist/cjs/es5/index.js", | ||
"jsnext:main": "dist/es/es6/index.js", | ||
"author": "Stone Pagamentos", | ||
"dependencies": { | ||
"imask": "^4.1.3", | ||
"sling-framework": "^1.11.5", | ||
"sling-helpers": "^1.11.5", | ||
"sling-web-component-icon": "^1.11.7" | ||
} | ||
} |
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'); | ||
|
||
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,19 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<script src="../../../scripts/helpers/injectDependencies.js"></script> | ||
<title>Sling-Input</title> | ||
</head> | ||
<body> | ||
<sling-field | ||
required | ||
validationstatus="success" | ||
validation="function" | ||
value="" | ||
type="email" | ||
></sling-field> | ||
</body> | ||
</html> |
Oops, something went wrong.