{"bugs":{"url":"https://github.com/Polymer/lit-element/issues"},"dist":{"shasum":"d60d01061300c8059d9dde3a9c14e03777b6a35d","tarball":"https://registry.npmjs.org/@polymer/lit-element/-/lit-element-0.6.0-dev.6.tgz","fileCount":51,"integrity":"sha512-f0qPKjDzkcew36COMrNZqOstnCNuxiAontFdBSyWXcdMve5WenDj6dViMnraNXaYWWV/Vg7/18KroB/Lpix1AQ==","signatures":[{"sig":"MEUCIQCXGaGI9DwEebX/mL8NIruMw/J1QbA96aQikc455h3GJwIgQqmT2uxY/eqIaR1k9txOnMERnD9t35QvzDGFTtNGtF4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":523268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiHR8CRA9TVsSAnZWagAA+YwP/22v+NAwwUUvrUIf9WlG\n/3fxy9nxB/6vtWyDMNcYltNFGoaQVsMZHBXu1d8jOMcSatk/OoLX8W6yLX5B\n708SzCU0b50Kxds9l7a9+JtVmXaP/sLwCRWYQ0UanAXz7GUkfJAc2SUQMllM\nooDYyRsiyV+/09surr07iJHt2le2e/oHVQm90AdvKVD92De/1bVi/IHm+Jq3\nguY98HwBct+OGZgXNoYOiuw/gyON4bPcLjP8gUGnbKuASOM7vSh5IE1/xatP\nmeaJYuZ9KcfHlBNR3009pBlTZtw1fglTJ9Zs6cA3dNAJdGOW8mW+XAb6pW25\nhsYTn75n0hOS5afFi65J+WREpaPwqxgwfUSh060t/G+gAK9c3UQ5IHdeOleo\nUDcEN+2GEfsnQIwCJZlL4p1Z3n2UeGavKbPp6H/HQN+9FChg38gTbxDBQq44\nG21UBXfG6X3zsAG/rk0oVh6vNT+tAjMPMhwK+8uxJIzU+leCz/c8SjmLdk7r\ndKoOhB8jy5/8wdPR+VDZozQ8kpjhoHBvXu5ccKPIqzj+wc4hd6NW4DByAZZh\nxNvgpap2llCibrIQDdlHR2BtM6JWe3nBcddS3mkFXArYYOCy1YQ4L3nYM02s\n/hcyr4RinXmQdt4eqcBEmOCw1sVCUqQzlgZk6r4BP7DlF9BSX4Q7i+F6qTVu\nNsTc\r\n=TCaK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lit-element.js","name":"@polymer/lit-element","author":{"name":"The Polymer Authors"},"module":"lit-element.js","readme":"> ## 🛠 Status: In Development\n> LitElement is currently in development. It's on the fast track to a 1.0 release, so we encourage you to use it and give us your feedback, but there are things that haven't been finalized yet and you can expect some changes.\n\n# LitElement\n\n[![Published on npm](https://img.shields.io/npm/v/@polymer/lit-element.svg)](https://www.npmjs.com/package/@polymer/lit-element)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/@polymer/lit-element)\n\n## A simple base class for creating custom elements rendered with lit-html.\n\nLitElement uses [lit-html](https://github.com/Polymer/lit-html) to render into the\nelement's [Shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM)\nand adds API to help manage element properties and attributes. LitElement reacts to changes in properties\nand renders declaratively using `lit-html`.\n\n  * **Setup properties:** LitElement supports observable properties that cause the element to update.\n  These properties can be declared in a few ways:\n\n    * As class fields with the `@property()` [decorator](https://github.com/tc39/proposal-decorators#decorators),\n    if you're using a compiler that supports them, like [TypeScript](https://www.typescriptlang.org/) or [Babel](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n    * With a static `properties` getter.\n    * By manually writing getters and setters. This can be useful if tasks should\n    be performed when a property is set, for example validation. Call `requestUpdate(name, oldValue)`\n    in the setter to trigger an update and use any configured property options.\n\n    Properties can be given an options argument which is an object that describes how to\n    process the property. This can be done either in the `@property({...})` decorator or in the\n    object returned from the `properties` getter, e.g. `static get properties { return { foo: {...} }`.\n\n    Property options include:\n\n    * `attribute`: Indicates how and whether the property becomes an observed attribute.\n    If the value is `false`, the property is not added to `observedAttributes`.\n    If true or absent, the lowercased property name is observed (e.g. `fooBar` becomes `foobar`).\n    If a string, the string value is observed (e.g `attribute: 'foo-bar'`).\n    * `type`: Indicates how to serialize and deserialize the attribute to/from a property.\n    If this value is a function, it is used to deserialize the attribute value\n    a the property value. If it's an object, it can have keys for `fromAttribute` and\n    `toAttribute` where `fromAttribute` is the deserialize function and `toAttribute`\n    is a serialize function used to set the property to an attribute. If no `toAttribute`\n    function is provided and `reflect` is set to `true`, the property value is set\n    directly to the attribute.\n    * `reflect`: Indicates if the property should reflect to an attribute.\n    If `true`, when the property is set, the attribute is set using the\n    attribute name determined according to the rules for the `attribute`\n    propety option and the value of the property serialized using the rules from\n    the `type` property option.\n    * `hasChanged`: A function that indicates if a property should be considered\n    changed when it is set. The function should take the `newValue` and `oldValue`\n    and return `true` if an update should be requested.\n\n  * **React to changes:** LitElement reacts to changes in properties and attributes by\n  asynchronously rendering, ensuring changes are batched. This reduces overhead\n  and maintains consistent state.\n\n  * **Declarative rendering** LitElement uses `lit-html` to declaratively describe\n  how an element should render. Then `lit-html` ensures that updates\n  are fast by creating the static DOM once and smartly updating only the parts of\n  the DOM that change. Pass a JavaScript string to the `html` tag function,\n  describing dynamic parts with standard JavaScript template expressions:\n\n    * static elements: ``` html`<div>Hi</div>` ```\n    * expression: ``` html`<div>${disabled ? 'Off' : 'On'}</div>` ```\n    * property: ``` html`<x-foo .bar=\"${bar}\"></x-foo>` ```\n    * attribute: ``` html`<div class=\"${color} special\"></div>` ```\n    * event handler: ``` html`<button @click=\"${(e) => this._clickHandler(e)}\"></button>` ```\n\n## Getting started\n\n * The easiest way to try out LitElement is to use one of these online tools:\n\n    * Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/lit-element-example?file=index.js), [Glitch](https://glitch.com/edit/#!/hello-lit-element?path=index.html)\n\n    * Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSFiddle](https://jsfiddle.net/j6mf6gpo/), [JSBin](http://jsbin.com/zezilad/edit?html,output),\n [CodePen](https://codepen.io/sorvell/pen/BxZgPN).\n\n * You can also copy [this HTML file](https://gist.githubusercontent.com/sorvell/48f4b7be35c8748e8f6db5c66d36ee29/raw/2427328cf1ebae5077902a6bff5ddd8db45e83e4/index.html) into a local file and run it in any browser that supports [JavaScript Modules]((https://caniuse.com/#search=modules)).\n\n * When you're ready to use LitElement in a project, install it via [npm](https://www.npmjs.com/). To run the project in the browser, a module-compatible toolchain is required. We recommend installing the [Polymer CLI](https://github.com/Polymer/polymer-cli) and using its development server as follows.\n\n    1. Add LitElement to your project:\n\n        ```npm i @polymer/lit-element```\n\n    1. Install the webcomponents polyfill. If you're developing a reusable package, this should be a dev dependency which you load in your tests, demos, etc.\n\n        ```npm i -D @webcomponents/webcomponentsjs```\n\n\n    1. Create an element by extending LitElement and calling `customElements.define` with your class (see the examples below).\n\n    1. Install the Polymer CLI:\n\n        ```npm i -g polymer-cli```\n\n    1. Run the development server and open a browser pointing to its URL:\n\n        ```polymer serve```\n\n    > LitElement is published on [npm](https://www.npmjs.com/package/@polymer/lit-element) using JavaScript Modules.\n    This means it can take advantage of the standard native JavaScript module loader available in all current major browsers.\n    >\n    > However, since LitElement uses npm convention to reference dependencies by name, a light transform to rewrite specifiers to URLs is required to get it to run in the browser. The polymer-cli's development server `polymer serve` automatically handles this transform.\n\n    Tools like [WebPack](https://webpack.js.org/) and [Rollup](https://rollupjs.org/) can also be used to serve and/or bundle LitElement.\n\n\n## Minimal Example\n\n  1. Create a class that extends `LitElement`.\n  1. Use a `@property` decorator to create a property (or implement a static `properties`\n  getter that returns the element's properties). (which automatically become observed attributes).\n  1. Then implement a `render()` method and use the element's\ncurrent properties to return a `lit-html` template result to render\ninto the element. This is the only method that must be implemented by subclasses.\n\n```html\n  <script src=\"node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js\"></script>\n  <script type=\"module\">\n    import {LitElement, html, property} from '@polymer/lit-element';\n\n    class MyElement extends LitElement {\n\n      static get properties() {\n        return {\n          mood: {type: String}\n        };\n      }\n\n      constructor() {\n        super();\n        this.mood = 'happy';\n      }\n\n      render() {\n        return html`<style> .mood { color: green; } </style>\n          Web Components are <span class=\"mood\">${this.mood}</span>!`;\n      }\n\n    }\n\n    customElements.define('my-element', MyElement);\n  </script>\n\n  <my-element mood=\"happy\"></my-element>\n```\n\n## API Documentation\n\n  * `render()` (protected): Implement to describe the element's DOM using `lit-html`. Ideally,\n  the `render` implementation is a [pure function](https://en.wikipedia.org/wiki/Pure_function) using only the element's current properties\n  to describe the element template. This is the only method that must be implemented by subclasses.\n  Note, since `render()` is called by `update()`, setting properties does not trigger\n  an update, allowing property values to be computed and validated.\n\n  * `shouldUpdate(changedProperties)` (protected): Implement to control if updating and rendering\n  should occur when property values change or `requestUpdate()` is called. The `changedProperties`\n  argument is a Map with keys for the changed properties pointing to their previous values.\n  By default, this method always returns `true`, but this can be customized as\n  an optimization to avoid updating work when changes occur, which should not be rendered.\n\n  * `update(changedProperties)` (protected): This method calls `render()` and then uses `lit-html`\n  in order to render the template DOM. It also updates any reflected attributes based on\n  property values. Setting properties inside this method will *not* trigger another update..\n\n  * `firstUpdated(changedProperties)`: (protected) Called after the element's DOM has been\n  updated the first time, immediately before `updated()` is called.\n  This method can be useful for capturing references to rendered static nodes that\n  must be directly acted upon, for example in `updated()`.\n  Setting properties inside this method will trigger the element to update.\n\n  * `updated(changedProperties)`: (protected) Called whenever the element's DOM has been\n  updated and rendered. Implement to perform post updating tasks via DOM APIs, for example,\n  focusing an element. Setting properties inside this method will trigger the element to update.\n\n  * `updateComplete`: Returns a Promise that resolves when the element has completed\n  updating. The Promise value is a boolean that is `true` if the element completed the\n  update without triggering another update. This happens if a property is set inside\n  `updated()`. This getter can be implemented to await additional state.\n  For example, it is sometimes useful to await a rendered element before fulfilling\n  this Promise. To do this, first await `super.updateComplete` then any subsequent state.\n\n  * `requestUpdate(name?, oldValue?)`: Call to request the element to asynchronously\n  update regardless of whether or not any property changes are pending. This should\n  be called when an element should update based on some state not triggered\n  by setting a property. In this case, pass no arguments. It should also be called\n  when manually implementing a property setter. In this case, pass the property\n  `name` and `oldValue` to ensure that any configured property options are honored.\n  Returns the `updateComplete` Promise which is resolved when the update completes.\n\n  * `createRenderRoot()` (protected): Implement to customize where the\n  element's template is rendered by returning an element into which to\n  render. By default this creates a shadowRoot for the element.\n  To render into the element's childNodes, return `this`.\n\n## Advanced: Update Lifecycle\n\n* When the element is first connected or a property is set (e.g. `element.foo = 5`)\nand the property's `hasChanged(value, oldValue)` returns `true`.\n* `requestUpdate()`: Updates the element after awaiting a [microtask](https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/) (at the end\nof the event loop, before the next paint).\n* `shouldUpdate(changedProperties)`: The update proceeds if this returns `true`, which\nit does by default.\n* `update(changedProperties)`: Updates the element. Setting properties inside this\nmethod will *not* trigger the element to update.\n  * `render()`: Returns a `lit-html` TemplateResult (e.g. <code>html\\`Hello ${world}\\`</code>)\n  to render element DOM. Setting properties inside this method will *not* trigger\n  the element to update.\n* `firstUpdated(changedProperties)`: Called after the element is updated the first time,\nimmediately before `updated` is called. Setting properties inside this method will\ntrigger the element to update.\n* `updated(changedProperties)`: Called whenever the element is updated.\nSetting properties inside this method will trigger the element to update.\n* `updateComplete` Promise is resolved with a boolean that is `true` if the\nelement is not pending another update, and any code awaiting the element's\n`updateComplete` Promise runs and observes the element in the updated state.\n\n## Bigger Example\n\nNote, this example uses decorators to create properties. Decorators are a proposed\nstandard currently available in [TypeScript](https://www.typescriptlang.org/) or [Babel](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n```ts\nimport {LitElement, html, property} from '@polymer/lit-element';\n\nclass MyElement extends LitElement {\n\n  // Public property API that triggers re-render (synced with attributes)\n  @property()\n  foo = 'foo';\n\n  @property({type: Number})\n  whales = 5;\n\n  constructor() {\n    super();\n    this.addEventListener('click', async (e) => {\n      this.whales++;\n      await this.updateComplete;\n      this.dispatchEvent(new CustomEvent('whales', {detail: {whales: this.whales}}))\n    });\n  }\n\n  // Render method should return a `TemplateResult` using the provided lit-html `html` tag function\n  render() {\n    return html`\n      <style>\n        :host {\n          display: block;\n        }\n        :host([hidden]) {\n          display: none;\n        }\n      </style>\n      <h4>Foo: ${this.foo}</h4>\n      <div>whales: ${'🐳'.repeat(this.whales)}</div>\n      <slot></slot>\n    `;\n  }\n\n}\ncustomElements.define('my-element', MyElement);\n```\n\n```html\n  <my-element whales=\"5\">hi</my-element>\n```\n\n## Supported Browsers\n\nThe last 2 versions of all modern browsers are supported, including\nChrome, Safari, Opera, Firefox, Edge. In addition, Internet Explorer 11 is also supported.\n\n## Known Issues\n\n","gitHead":"62d378d2eaad22e617a03d039f78c80704359e94","license":"BSD-3-Clause","scripts":{"lint":"tslint --project ./","test":"npm run build && wct","build":"tsc","format":"find src test | grep '\\.js$\\|\\.ts$' | xargs clang-format --style=file -i","gen-docs":"typedoc --readme none --mode modules --excludeNotExported --excludePrivate --exclude **/*_test.ts --out ./docs/api .","checksize":"rollup -c ; rm lit-element.bundled.js","prepublishOnly":"npm run build","regen-package-lock":"rm -rf node_modules package-lock.json; npm install"},"typings":"lit-element.d.ts","_npmUser":{"name":"sorvell","email":"sorvell@google.com"},"homepage":"https://github.com/Polymer/lit-element#readme","repository":{"url":"git+https://github.com/Polymer/lit-element.git","type":"git"},"_npmVersion":"6.2.0","description":"Polymer based lit-html custom element","directories":{"test":"test"},"maintainers":[{"name":"aomarks","email":"aomarks@google.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"justinfagnani","email":"justin@fagnani.com"},{"name":"keanulee","email":"npm@keanulee.com"},{"name":"notwaldorf","email":"notwaldorf@gmail.com"},{"name":"polymer-devs","email":"admin@polymer-project.org"},{"name":"samli","email":"sam@sam.li"},{"name":"sorvell","email":"sorvell@google.com"},{"name":"usergenic","email":"brendan@usergenic.com"}],"_nodeVersion":"10.9.0","dependencies":{"lit-html":"^0.11.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.0.2","mocha":"^5.0.5","rollup":"^0.64.1","tslint":"^5.7.0","typedoc":"^0.8.0","uglify-es":"^3.3.9","typescript":"^3.0.1","@types/chai":"^4.0.1","@types/mocha":"^5.2.4","wct-browser-legacy":"^1.0.1","rollup-plugin-terser":"^1.0.1","web-component-tester":"^6.8.0","rollup-plugin-filesize":"^4.0.1","rollup-plugin-node-resolve":"^3.3.0","@webcomponents/webcomponentsjs":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/lit-element_0.6.0-dev.6_1535669371266_0.6673933744801688","host":"s3://npm-registry-packages"},"_id":"@polymer/lit-element@0.6.0-dev.6","version":"0.6.0-dev.6"}