-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability for Panel components to auto parse attributes -> this.attrs (#39
) * Ability for Panel components to self reflect it's metadata and auto attrs -> state updates * initialized * newVal isn't needed * Add deprecated warning for controlled component * rename attr-reflection-app to attr-app * update attributes to this.attrs * Document $attrs * dashed cased in this.attrs * hasAttribute dom shim * tslint * attrs-reflection-app * attrs-reflection-app tests * add schema query test from customElements registry * remove extra whitespace * single line comment * attrsSchema doc * jsdoc doesn't show docs for statics. 🤷 Remove duplicated info with the .d.ts * move style-override out of attrsSchema * SPAAACE * some nit fixes * attrschema js dc * spaace * PR feedback * some malformed tests * jsdoc comment
- Loading branch information
Showing
11 changed files
with
267 additions
and
34 deletions.
There are no files selected for viewing
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
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,10 @@ | ||
/* global chai */ | ||
import 'babel-polyfill'; | ||
|
||
import '../fixtures'; // import fixtures | ||
|
||
// import tests | ||
import './component'; | ||
import './component-utils'; | ||
|
||
chai.config.truncateThreshold = 0; // nicer deep equal errors |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {Component, h} from '../../lib'; | ||
|
||
export class AttrsReflectionApp extends Component { | ||
static get attrsSchema() { | ||
return { | ||
'str-attr': {type: `string`}, | ||
'bool-attr': {type: `boolean`, default: true}, | ||
'number-attr': {type: `number`, default: 0}, | ||
'json-attr': {type: `json`}, | ||
}; | ||
} | ||
get config() { | ||
return { | ||
template: scope => h(`div`, {class: {'attrs-reflection-app': true}}, | ||
Object.entries(scope.$attrs).map(([attr, val]) => h(`p`, `${attr}: ${JSON.stringify(val)}`)), | ||
), | ||
}; | ||
} | ||
} |
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
Oops, something went wrong.