Initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
/node_modules/
|
||||
/.rts2_cache_umd/
|
||||
yarn.lock
|
||||
/dist/BOILERPLATE-card.js.map
|
||||
/dist/index.d.ts
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("lit-element")):"function"==typeof define&&define.amd?define(["lit-element"],t):t(e.litElement)}(this,function(e){function t(e,t,o,n){var r,i=arguments.length,c=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,o,n);else for(var f=e.length-1;f>=0;f--)(r=e[f])&&(c=(i<3?r(c):i>3?r(t,o,c):r(t,o))||c);return i>3&&c&&Object.defineProperty(t,o,c),c}var o=Object.freeze([""]),n=Object.freeze(["\n <div>BOILERPLATE</div>\n "]),r=function(t){function r(){t.apply(this,arguments)}t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.prototype)).constructor=r;var i={styles:{configurable:!0}};return r.prototype.setConfig=function(e){this._config=e},r.prototype.render=function(){return e.html(n)},i.styles.get=function(){return e.css(o)},Object.defineProperties(r,i),r}(e.LitElement);t([e.property()],r.prototype,"hass",void 0),t([e.property()],r.prototype,"_config",void 0),r=t([e.customElement("BOILERPLATE-card")],r)});
|
||||
//# sourceMappingURL=BOILERPLATE-card.js.map
|
||||
@@ -0,0 +1,43 @@
|
||||
import {
|
||||
LitElement,
|
||||
html,
|
||||
customElement,
|
||||
property,
|
||||
CSSResult,
|
||||
TemplateResult,
|
||||
css
|
||||
} from "lit-element";
|
||||
|
||||
interface BOILERPLATEConfig {
|
||||
type: string;
|
||||
}
|
||||
|
||||
@customElement("BOILERPLATE-card")
|
||||
class BOILERPLATECard extends LitElement {
|
||||
@property() public hass?: any;
|
||||
@property() private _config?: BOILERPLATEConfig;
|
||||
|
||||
public setConfig(config: BOILERPLATEConfig): void {
|
||||
if (!this._config) {
|
||||
// TODO Log error
|
||||
}
|
||||
|
||||
this._config = config;
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
<div>BOILERPLATE</div>
|
||||
`;
|
||||
}
|
||||
|
||||
static get styles(): CSSResult {
|
||||
return css``;
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"BOILERPLATE-card": BOILERPLATECard;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "BOILERPLATE-card",
|
||||
"version": "1.0.0",
|
||||
"description": "A templatable config pass-through",
|
||||
"keywords": [
|
||||
"home-assistant",
|
||||
"homeassistant",
|
||||
"hass",
|
||||
"automation",
|
||||
"lovelace",
|
||||
"custom-cards"
|
||||
],
|
||||
"umd:main": "BOILERPLATE-card.js",
|
||||
"repository": "git@github.com:custom_cards/BOILERPLATE-card.git",
|
||||
"author": "Ian Richardson <iantrich@gmail.com>",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lit-element": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"microbundle": "^0.10.1",
|
||||
"prettier": "^1.16.4",
|
||||
"tslib": "^1.9.3",
|
||||
"tslint": "^5.12.1",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-eslint-rules": "^5.4.0",
|
||||
"tslint-plugin-prettier": "^2.0.1",
|
||||
"typescript": "^3.3.3333"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "microbundle watch",
|
||||
"build": "npm run lint && microbundle --globals lit-element --target browser --format umd",
|
||||
"lint": "tslint index.ts"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"jsx": "react",
|
||||
"jsxFactory": "h",
|
||||
"target": "es2017",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"lib": ["es2017", "dom", "dom.iterable"],
|
||||
"noEmit": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"strict": true,
|
||||
"noImplicitAny": false,
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
"experimentalDecorators": true
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": ["tslint:latest", "tslint-eslint-rules", "tslint-config-prettier"],
|
||||
"rulesDirectory": ["tslint-plugin-prettier"],
|
||||
"rules": {
|
||||
"prettier": true,
|
||||
"interface-name": false,
|
||||
"no-submodule-imports": false,
|
||||
"ordered-imports": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"variable-name": [
|
||||
true,
|
||||
"ban-keywords",
|
||||
"check-format",
|
||||
"allow-leading-underscore"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user