{"bugs":{"url":"https://github.com/Polymer/lit-element/issues"},"dist":{"shasum":"98c4171091a20072bed2cd2357a7506262b650f6","tarball":"https://registry.npmjs.org/@polymer/lit-element/-/lit-element-0.6.0-dev.4.tgz","fileCount":51,"integrity":"sha512-BrUH2vO/h5I2He0w5HrBqwcBoCsBhNqrZxVHkFTVJ6EclleNEcDVJfaumaDgvAAVX+/ht54Www+P6fGRuO34Rw==","signatures":[{"sig":"MEQCIEa8ix+PQsX8D7lE3s3RLr62NwugfmmG0tDAKDYqz0XRAiAiA9Rawca3iY18feeQdL0H1Ne00w+JjQ8jFUFUQty/zQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbf2SlCRA9TVsSAnZWagAAMHgP/1gEUbHspo8qikuS15A2\nguWilalemxUNOf/2xONb08wbD8Gs4wP6MHU+ZPlUtlODSPrl6hM7i7Z1iCqe\nVXylFwunikw8410UgRc17A1lr05ajPInQlej1PRZbDGrFofjnyP1MetSvcTA\nsud4DQTzIY0P3oHu20/y9xV7uPe4vVdLpkyqAyyu+towD2xo0f1zTkcNuHs2\nN/Uck+wLaJ9SbP4pjBTKYgI3Yo0HuEixqquTzEgfxTuqoDrbvrySW2OXmilh\n8ClwYlriaqUrC/1YFhyCVXn+s5Qn8zlYXXyiwvPFbObTMcmX21onpa2dI9pG\n107dl3BjxIoFRHixX8kAcxx/HTHWrqaEr+NwAAxZB4lxYIuh/3YC+k8VQH0Q\nSM+3SetyYnvey5Mn/uBnhfUD+crIxZFszx2alrOF23aYTcYX66G7txIECptw\ncOpXQ1lWJ3kjcaKMK6oBsNVIzo3bhXOWN4TmlnRlgHt/tnswlxPSQDKx+GBA\nPih097hWZxhUbeC9x3eGlFpoBeBA3QRjYSNl6wuAjqr8RW/mmjdRpl/9KXzr\nlMEiuYIOH2Zsk0LADMUp0D0Lf8nQFpo9gzg1S5EiUNxkg7jj3iWVdfFcjxC1\nKFgWdM+73WBP2BF63wWBXCQf0Xyt4ZCPIzAInbPiQb0Ei5GNvPpFrwDiMG9o\nQMHA\r\n=e5jY\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 or Babel.\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 `invalidateProperty(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`: Describes 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`: Describes 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`: Describes 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    * `shouldInvalidate`: Describes if setting a property should trigger\n    invalidation and updating. This function takes the `newValue` and `oldValue` and\n    returns `true` if invalidation should occur. If not present, a strict identity\n    check is used. This is useful if a property should be considered dirty only\n    if some condition is met, like if a key of an object value changes.\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 toolctain is required. We recommend installing the [Polymer CLI](https://github.com/Polymer/polymer-cli) to 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. 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@next```\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/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      @property({type: String})\n      mood = 'happy';\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  `invalidate()`, 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 `invalidate` is called. The `changedProperties`\n  argument is an object 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()` (protected): This method calls `render()` and then uses `lit-html` in order to\n  render the template DOM. Implement to directly control rendered DOM.\n  Typically this is not needed as `lit-html` can be used in the `render` method\n  to set properties, attributes, and event listeners. However, it is sometimes useful\n  for calling methods on rendered elements, for example focusing an input:\n  `this.shadowRoot.querySelector('input').focus()`. The `changedProperties` argument is a Map\n  with keys for the changed properties pointing to their previous values.\n  Note, calling `super.update()` is required. Before calling `super.update()`,\n  changes made to properties do not trigger `invalidate()`, after calling `super.update()`,\n  changes do trigger `invalidate()`.\n\n  * `firstRendered()`: (protected) Called after the element's DOM has been\n  updated the first time. This method can be useful for capturing references to rendered static\n  nodes that must be directly acted upon, for example in `update()`.\n\n  * `updateComplete`:  Returns a Promise that resolves when the element has completed\n  updating that resolves to a boolean value that is `true` if the element completed the\n  update without triggering another update. This can happen if a property is set in\n  `update()` after the call to `super.update()` for example. This getter can be\n  implemented to await additional state. For example, it is sometimes useful to\n  await a rendered element before fulfilling this promise. To do this, first\n  await `super.updateComplete` then any subsequent state.\n\n  * `invalidate`: Call to request the element to asynchronously update regardless\n  of whether or not any property changes are pending. This should only be called\n  when an element should update based on some state not stored in properties,\n  since setting properties automically calls `invalidate`.\n\n  * `invalidateProperty(name, oldValue)` (protected): Triggers an invalidation for\n  a specific property. This is useful when manually implementing a property setter.\n  Call `invalidateProperty` instead of `invalidate` to ensure that any configured\n  property options are honored.\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 `shouldInvalidate(value, oldValue)` returns true.\n* `invalidate()`: Updates the element after waiting 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\nupdate is handled specially. Before calling `super.update()`, setting properties\nwill *not* trigger an update. After calling `super.update()` setting properties will\ntrigger an update.\n  * `render()`: Returns a `lit-html` TemplateResult (e.g. <code>html\\`Hello ${world}\\`</code>)\n  to render element DOM. Setting properties in `render()` does not trigger an update.\n  * `firstRendered()`: Called after the DOM is rendered the first time.\n  Setting properties in `firstRendered()` does trigger an 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\n```JavaScript\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":"bb6d73d16ca8103234a74df505eb0a75ce9111fc","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":"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":"sorvell","email":"sorvell@google.com"},{"name":"usergenic","email":"brendan@usergenic.com"}],"_nodeVersion":"10.9.0","dependencies":{"lit-html":"dev"},"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","@webcomponents/webcomponentsjs":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/lit-element_0.6.0-dev.4_1535075492531_0.7544693917466956","host":"s3://npm-registry-packages"},"_id":"@polymer/lit-element@0.6.0-dev.4","version":"0.6.0-dev.4"}