@rxdi/lit-html 0.7.157 → 0.7.159

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/async.d.ts +3 -3
  2. package/dist/async.js +4 -4
  3. package/dist/decorators/component.decorator.d.ts +1 -2
  4. package/dist/decorators/component.decorator.js +3 -3
  5. package/dist/index.d.ts +28 -17
  6. package/dist/index.js +28 -17
  7. package/package.json +4 -2
  8. package/dist/lit-element/decorators.d.ts +0 -14
  9. package/dist/lit-element/decorators.js +0 -32
  10. package/dist/lit-element/experimental-hydrate-support.d.ts +0 -6
  11. package/dist/lit-element/experimental-hydrate-support.js +0 -65
  12. package/dist/lit-element/index.d.ts +0 -7
  13. package/dist/lit-element/index.js +0 -25
  14. package/dist/lit-element/lit-element.d.ts +0 -157
  15. package/dist/lit-element/lit-element.js +0 -258
  16. package/dist/lit-element/polyfill-support.d.ts +0 -24
  17. package/dist/lit-element/polyfill-support.js +0 -58
  18. package/dist/lit-element/private-ssr-support.d.ts +0 -21
  19. package/dist/lit-element/private-ssr-support.js +0 -25
  20. package/dist/lit-html/async-directive.d.ts +0 -170
  21. package/dist/lit-html/async-directive.js +0 -250
  22. package/dist/lit-html/directive-helpers.d.ts +0 -105
  23. package/dist/lit-html/directive-helpers.js +0 -192
  24. package/dist/lit-html/directive.d.ts +0 -65
  25. package/dist/lit-html/directive.js +0 -52
  26. package/dist/lit-html/directives/async-append.d.ts +0 -38
  27. package/dist/lit-html/directives/async-append.js +0 -55
  28. package/dist/lit-html/directives/async-replace.d.ts +0 -39
  29. package/dist/lit-html/directives/async-replace.js +0 -112
  30. package/dist/lit-html/directives/cache.d.ts +0 -34
  31. package/dist/lit-html/directives/cache.js +0 -80
  32. package/dist/lit-html/directives/class-map.d.ts +0 -44
  33. package/dist/lit-html/directives/class-map.js +0 -92
  34. package/dist/lit-html/directives/guard.d.ts +0 -59
  35. package/dist/lit-html/directives/guard.js +0 -82
  36. package/dist/lit-html/directives/if-defined.d.ts +0 -13
  37. package/dist/lit-html/directives/if-defined.js +0 -17
  38. package/dist/lit-html/directives/live.d.ts +0 -42
  39. package/dist/lit-html/directives/live.js +0 -79
  40. package/dist/lit-html/directives/private-async-helpers.d.ts +0 -57
  41. package/dist/lit-html/directives/private-async-helpers.js +0 -117
  42. package/dist/lit-html/directives/ref.d.ts +0 -65
  43. package/dist/lit-html/directives/ref.js +0 -113
  44. package/dist/lit-html/directives/repeat.d.ts +0 -63
  45. package/dist/lit-html/directives/repeat.js +0 -416
  46. package/dist/lit-html/directives/style-map.d.ts +0 -46
  47. package/dist/lit-html/directives/style-map.js +0 -102
  48. package/dist/lit-html/directives/template-content.d.ts +0 -25
  49. package/dist/lit-html/directives/template-content.js +0 -33
  50. package/dist/lit-html/directives/unsafe-html.d.ts +0 -26
  51. package/dist/lit-html/directives/unsafe-html.js +0 -64
  52. package/dist/lit-html/directives/unsafe-svg.d.ts +0 -26
  53. package/dist/lit-html/directives/unsafe-svg.js +0 -26
  54. package/dist/lit-html/directives/until.d.ts +0 -43
  55. package/dist/lit-html/directives/until.js +0 -137
  56. package/dist/lit-html/experimental-hydrate.d.ts +0 -50
  57. package/dist/lit-html/experimental-hydrate.js +0 -322
  58. package/dist/lit-html/lit-html.d.ts +0 -335
  59. package/dist/lit-html/lit-html.js +0 -1259
  60. package/dist/lit-html/polyfill-support.d.ts +0 -67
  61. package/dist/lit-html/polyfill-support.js +0 -185
  62. package/dist/lit-html/private-ssr-support.d.ts +0 -52
  63. package/dist/lit-html/private-ssr-support.js +0 -54
  64. package/dist/lit-html/static.d.ts +0 -58
  65. package/dist/lit-html/static.js +0 -114
  66. package/dist/reactive-element/css-tag.d.ts +0 -64
  67. package/dist/reactive-element/css-tag.js +0 -125
  68. package/dist/reactive-element/decorators/base.d.ts +0 -47
  69. package/dist/reactive-element/decorators/base.js +0 -70
  70. package/dist/reactive-element/decorators/custom-element.d.ts +0 -26
  71. package/dist/reactive-element/decorators/custom-element.js +0 -47
  72. package/dist/reactive-element/decorators/event-options.d.ts +0 -37
  73. package/dist/reactive-element/decorators/event-options.js +0 -47
  74. package/dist/reactive-element/decorators/index.d.ts +0 -14
  75. package/dist/reactive-element/decorators/index.js +0 -32
  76. package/dist/reactive-element/decorators/property.d.ts +0 -40
  77. package/dist/reactive-element/decorators/property.js +0 -92
  78. package/dist/reactive-element/decorators/query-all.d.ts +0 -31
  79. package/dist/reactive-element/decorators/query-all.js +0 -46
  80. package/dist/reactive-element/decorators/query-assigned-nodes.d.ts +0 -33
  81. package/dist/reactive-element/decorators/query-assigned-nodes.js +0 -55
  82. package/dist/reactive-element/decorators/query-async.d.ts +0 -39
  83. package/dist/reactive-element/decorators/query-async.js +0 -71
  84. package/dist/reactive-element/decorators/query.d.ts +0 -32
  85. package/dist/reactive-element/decorators/query.js +0 -60
  86. package/dist/reactive-element/decorators/state.d.ts +0 -24
  87. package/dist/reactive-element/decorators/state.js +0 -29
  88. package/dist/reactive-element/index.d.ts +0 -5
  89. package/dist/reactive-element/index.js +0 -17
  90. package/dist/reactive-element/polyfill-support.d.ts +0 -40
  91. package/dist/reactive-element/polyfill-support.js +0 -89
  92. package/dist/reactive-element/reactive-controller.d.ts +0 -76
  93. package/dist/reactive-element/reactive-controller.js +0 -7
  94. package/dist/reactive-element/reactive-element.d.ts +0 -653
  95. package/dist/reactive-element/reactive-element.js +0 -979
package/dist/async.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { noChange } from './lit-html/lit-html';
2
- import { AsyncDirective } from './lit-html/async-directive';
1
+ import { noChange } from 'lit';
2
+ import { AsyncDirective } from 'lit/async-directive';
3
3
  interface Unsubscribable {
4
4
  unsubscribe(): void;
5
5
  }
@@ -21,5 +21,5 @@ declare class ObserveDirective extends AsyncDirective {
21
21
  unsubscribe(): void;
22
22
  reconnected(): void;
23
23
  }
24
- export declare const async: (asyncResult: Subscribable<unknown>) => import("./lit-html/directive").DirectiveResult<typeof ObserveDirective>;
24
+ export declare const async: (asyncResult: Subscribable<unknown>) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
25
25
  export {};
package/dist/async.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.async = void 0;
4
- const lit_html_1 = require("./lit-html/lit-html");
5
- const directive_1 = require("./lit-html/directive");
6
- const async_directive_1 = require("./lit-html/async-directive");
4
+ const lit_1 = require("lit");
5
+ const directive_1 = require("lit/directive");
6
+ const async_directive_1 = require("lit/async-directive");
7
7
  class ObserveDirective extends async_directive_1.AsyncDirective {
8
8
  // When the observable changes, unsubscribe to the old one and
9
9
  // subscribe to the new one
@@ -19,7 +19,7 @@ class ObserveDirective extends async_directive_1.AsyncDirective {
19
19
  this.subscribe(asyncResult);
20
20
  }
21
21
  }
22
- return lit_html_1.noChange;
22
+ return lit_1.noChange;
23
23
  }
24
24
  // Subscribes to the observable, calling the directive's asynchronous
25
25
  // setValue API each time the value changes
@@ -1,5 +1,4 @@
1
- import { TemplateResult } from '../lit-html/lit-html';
2
- import { CSSResult } from '../reactive-element/css-tag';
1
+ import { TemplateResult, CSSResult } from 'lit';
3
2
  export interface CustomAttributeRegistry {
4
3
  define(name: string, modifier: Function | Modifier): void;
5
4
  get(element: HTMLElement, attrName: string): any;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Component = void 0;
4
- const lit_html_1 = require("../lit-html/lit-html");
4
+ const lit_1 = require("lit");
5
5
  const legacyCustomElement = (tagName, clazz, options) => {
6
6
  window.customElements.define(tagName, clazz, options);
7
7
  return clazz;
@@ -34,7 +34,7 @@ const customElement = (tag, config = {}) => (Base) => {
34
34
  const firstUpdated = Base.prototype.firstUpdated || function () { };
35
35
  let registry;
36
36
  if (!config.template) {
37
- config.template = Base.prototype.render || (() => (0, lit_html_1.html) ``);
37
+ config.template = Base.prototype.render || (() => (0, lit_1.html) ``);
38
38
  }
39
39
  if (config.style) {
40
40
  config.styles.push(config.style);
@@ -48,7 +48,7 @@ const customElement = (tag, config = {}) => (Base) => {
48
48
  }
49
49
  OnInit() {
50
50
  if (config.container) {
51
- (0, lit_html_1.render)(config.template.call(this), config.container);
51
+ (0, lit_1.render)(config.template.call(this), config.container);
52
52
  if (config.style) {
53
53
  const style = document.createElement('style');
54
54
  style.type = 'text/css';
package/dist/index.d.ts CHANGED
@@ -1,19 +1,30 @@
1
1
  export * from './decorators/index';
2
2
  export * from './async';
3
- export * from './reactive-element/index';
4
- export * from './lit-html/lit-html';
5
- export * from './lit-element/index';
6
- export * from './lit-html/directives/class-map';
7
- export * from './lit-html/directives/async-append';
8
- export * from './lit-html/directives/async-replace';
9
- export * from './lit-html/directives/cache';
10
- export * from './lit-html/directives/guard';
11
- export * from './lit-html/directives/if-defined';
12
- export * from './lit-html/directives/live';
13
- export * from './lit-html/directives/ref';
14
- export * from './lit-html/directives/repeat';
15
- export * from './lit-html/directives/style-map';
16
- export * from './lit-html/directives/template-content';
17
- export * from './lit-html/directives/unsafe-html';
18
- export * from './lit-html/directives/unsafe-svg';
19
- export * from './lit-html/directives/until';
3
+ export * from 'lit';
4
+ export * from 'lit/directive';
5
+ export * from 'lit/experimental-hydrate';
6
+ export * from 'lit/experimental-hydrate-support';
7
+ export * from 'lit/polyfill-support';
8
+ export * from 'lit/directive-helpers';
9
+ export * from 'lit/async-directive';
10
+ export * from 'lit-element';
11
+ export * from 'lit/directives/class-map';
12
+ export * from 'lit/directives/async-append';
13
+ export * from 'lit/directives/async-replace';
14
+ export * from 'lit/directives/cache';
15
+ export * from 'lit/directives/guard';
16
+ export * from 'lit/directives/if-defined';
17
+ export * from 'lit/directives/live';
18
+ export * from 'lit/directives/ref';
19
+ export * from 'lit/directives/repeat';
20
+ export * from 'lit/directives/style-map';
21
+ export * from 'lit/directives/template-content';
22
+ export * from 'lit/directives/unsafe-html';
23
+ export * from 'lit/directives/unsafe-svg';
24
+ export * from 'lit/directives/until';
25
+ export * from 'lit/directives/choose';
26
+ export * from 'lit/directives/join';
27
+ export * from 'lit/directives/keyed';
28
+ export * from 'lit/directives/map';
29
+ export * from 'lit/directives/range';
30
+ export * from 'lit/directives/when';
package/dist/index.js CHANGED
@@ -12,20 +12,31 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./decorators/index"), exports);
14
14
  __exportStar(require("./async"), exports);
15
- __exportStar(require("./reactive-element/index"), exports);
16
- __exportStar(require("./lit-html/lit-html"), exports);
17
- __exportStar(require("./lit-element/index"), exports);
18
- __exportStar(require("./lit-html/directives/class-map"), exports);
19
- __exportStar(require("./lit-html/directives/async-append"), exports);
20
- __exportStar(require("./lit-html/directives/async-replace"), exports);
21
- __exportStar(require("./lit-html/directives/cache"), exports);
22
- __exportStar(require("./lit-html/directives/guard"), exports);
23
- __exportStar(require("./lit-html/directives/if-defined"), exports);
24
- __exportStar(require("./lit-html/directives/live"), exports);
25
- __exportStar(require("./lit-html/directives/ref"), exports);
26
- __exportStar(require("./lit-html/directives/repeat"), exports);
27
- __exportStar(require("./lit-html/directives/style-map"), exports);
28
- __exportStar(require("./lit-html/directives/template-content"), exports);
29
- __exportStar(require("./lit-html/directives/unsafe-html"), exports);
30
- __exportStar(require("./lit-html/directives/unsafe-svg"), exports);
31
- __exportStar(require("./lit-html/directives/until"), exports);
15
+ __exportStar(require("lit"), exports);
16
+ __exportStar(require("lit/directive"), exports);
17
+ __exportStar(require("lit/experimental-hydrate"), exports);
18
+ __exportStar(require("lit/experimental-hydrate-support"), exports);
19
+ __exportStar(require("lit/polyfill-support"), exports);
20
+ __exportStar(require("lit/directive-helpers"), exports);
21
+ __exportStar(require("lit/async-directive"), exports);
22
+ __exportStar(require("lit-element"), exports);
23
+ __exportStar(require("lit/directives/class-map"), exports);
24
+ __exportStar(require("lit/directives/async-append"), exports);
25
+ __exportStar(require("lit/directives/async-replace"), exports);
26
+ __exportStar(require("lit/directives/cache"), exports);
27
+ __exportStar(require("lit/directives/guard"), exports);
28
+ __exportStar(require("lit/directives/if-defined"), exports);
29
+ __exportStar(require("lit/directives/live"), exports);
30
+ __exportStar(require("lit/directives/ref"), exports);
31
+ __exportStar(require("lit/directives/repeat"), exports);
32
+ __exportStar(require("lit/directives/style-map"), exports);
33
+ __exportStar(require("lit/directives/template-content"), exports);
34
+ __exportStar(require("lit/directives/unsafe-html"), exports);
35
+ __exportStar(require("lit/directives/unsafe-svg"), exports);
36
+ __exportStar(require("lit/directives/until"), exports);
37
+ __exportStar(require("lit/directives/choose"), exports);
38
+ __exportStar(require("lit/directives/join"), exports);
39
+ __exportStar(require("lit/directives/keyed"), exports);
40
+ __exportStar(require("lit/directives/map"), exports);
41
+ __exportStar(require("lit/directives/range"), exports);
42
+ __exportStar(require("lit/directives/when"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxdi/lit-html",
3
- "version": "0.7.157",
3
+ "version": "0.7.159",
4
4
  "main": "./dist/index.js",
5
5
  "author": "Kristiyan Tachev",
6
6
  "license": "MIT",
@@ -11,7 +11,9 @@
11
11
  "scripts": {
12
12
  "build": "npx tsc || true"
13
13
  },
14
- "dependencies": {},
14
+ "dependencies": {
15
+ "lit": "^2.5.0"
16
+ },
15
17
  "devDependencies": {
16
18
  "@types/node": "^12.0.10",
17
19
  "typescript": "^4.3.5"
@@ -1,14 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- export * from '../reactive-element/decorators/base';
7
- export * from '../reactive-element/decorators/custom-element';
8
- export * from '../reactive-element/decorators/property';
9
- export * from '../reactive-element/decorators/state';
10
- export * from '../reactive-element/decorators/event-options';
11
- export * from '../reactive-element/decorators/query';
12
- export * from '../reactive-element/decorators/query-all';
13
- export * from '../reactive-element/decorators/query-async';
14
- export * from '../reactive-element/decorators/query-assigned-nodes';
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright 2017 Google LLC
5
- * SPDX-License-Identifier: BSD-3-Clause
6
- */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
- };
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- /*
19
- * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all
20
- * property decorators (but not class decorators) in this file that have
21
- * an @ExportDecoratedItems annotation must be defined as a regular function,
22
- * not an arrow function.
23
- */
24
- __exportStar(require("../reactive-element/decorators/base"), exports);
25
- __exportStar(require("../reactive-element/decorators/custom-element"), exports);
26
- __exportStar(require("../reactive-element/decorators/property"), exports);
27
- __exportStar(require("../reactive-element/decorators/state"), exports);
28
- __exportStar(require("../reactive-element/decorators/event-options"), exports);
29
- __exportStar(require("../reactive-element/decorators/query"), exports);
30
- __exportStar(require("../reactive-element/decorators/query-all"), exports);
31
- __exportStar(require("../reactive-element/decorators/query-async"), exports);
32
- __exportStar(require("../reactive-element/decorators/query-assigned-nodes"), exports);
@@ -1,6 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- export {};
@@ -1,65 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright 2017 Google LLC
5
- * SPDX-License-Identifier: BSD-3-Clause
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const lit_html_1 = require("../lit-html/lit-html");
9
- const experimental_hydrate_1 = require("../lit-html/experimental-hydrate");
10
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
- globalThis.litElementHydrateSupport = ({ LitElement, }) => {
12
- const observedAttributes = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(LitElement), 'observedAttributes').get;
13
- // Add `defer-hydration` to observedAttributes
14
- Object.defineProperty(LitElement, 'observedAttributes', {
15
- get() {
16
- return [...observedAttributes.call(this), 'defer-hydration'];
17
- },
18
- });
19
- // Enable element when 'defer-hydration' attribute is removed by calling the
20
- // super.connectedCallback()
21
- const attributeChangedCallback = LitElement.prototype.attributeChangedCallback;
22
- LitElement.prototype.attributeChangedCallback = function (name, old, value) {
23
- if (name === 'defer-hydration' && value === null) {
24
- connectedCallback.call(this);
25
- }
26
- attributeChangedCallback.call(this, name, old, value);
27
- };
28
- // Override `connectedCallback` to capture whether we need hydration, and
29
- // defer `super.connectedCallback()` if the 'defer-hydration' attribute is set
30
- const connectedCallback = LitElement.prototype.connectedCallback;
31
- LitElement.prototype.connectedCallback = function () {
32
- // If the outer scope of this element has not yet been hydrated, wait until
33
- // 'defer-hydration' attribute has been removed to enable
34
- if (!this.hasAttribute('defer-hydration')) {
35
- connectedCallback.call(this);
36
- }
37
- };
38
- // If we've been server-side rendered, just return `this.shadowRoot`, don't
39
- // call the base implementation, which would also adopt styles (for now)
40
- const createRenderRoot = LitElement.prototype.createRenderRoot;
41
- LitElement.prototype.createRenderRoot = function () {
42
- if (this.shadowRoot) {
43
- this._$needsHydration = true;
44
- return this.shadowRoot;
45
- }
46
- else {
47
- return createRenderRoot.call(this);
48
- }
49
- };
50
- // Hydrate on first update when needed
51
- const update = Object.getPrototypeOf(LitElement.prototype).update;
52
- LitElement.prototype.update = function (changedProperties) {
53
- const value = this.render();
54
- // Since this is a patch, we can't call super.update(), so we capture
55
- // it off the proto chain and call it instead
56
- update.call(this, changedProperties);
57
- if (this._$needsHydration) {
58
- this._$needsHydration = false;
59
- (0, experimental_hydrate_1.hydrate)(value, this.renderRoot, this.renderOptions);
60
- }
61
- else {
62
- (0, lit_html_1.render)(value, this.renderRoot, this.renderOptions);
63
- }
64
- };
65
- };
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- export * from './lit-element';
7
- export * from './decorators';
@@ -1,25 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright 2017 Google LLC
5
- * SPDX-License-Identifier: BSD-3-Clause
6
- */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
- };
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- __exportStar(require("./lit-element"), exports);
19
- __exportStar(require("./decorators"), exports);
20
- // console.warn(
21
- // "The main 'lit-element' module entrypoint is deprecated. Please update " +
22
- // "your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' " +
23
- // "or import from 'lit-element/lit-element.ts'. See " +
24
- // 'https://lit.dev/msg/deprecated-import-path for more information.'
25
- // );
@@ -1,157 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- /**
7
- * The main LitElement module, which defines the [[`LitElement`]] base class and
8
- * related APIs.
9
- *
10
- * LitElement components can define a template and a set of observed
11
- * properties. Changing an observed property triggers a re-render of the
12
- * element.
13
- *
14
- * Import [[`LitElement`]] and [[`html`]] from this module to create a
15
- * component:
16
- *
17
- * ```js
18
- * import {LitElement, html} from 'lit-element';
19
- *
20
- * class MyElement extends LitElement {
21
- *
22
- * // Declare observed properties
23
- * static get properties() {
24
- * return {
25
- * adjective: {}
26
- * }
27
- * }
28
- *
29
- * constructor() {
30
- * this.adjective = 'awesome';
31
- * }
32
- *
33
- * // Define the element's template
34
- * render() {
35
- * return html`<p>your ${adjective} template here</p>`;
36
- * }
37
- * }
38
- *
39
- * customElements.define('my-element', MyElement);
40
- * ```
41
- *
42
- * `LitElement` extends [[`ReactiveElement`]] and adds lit-html templating.
43
- * The `ReactiveElement` class is provided for users that want to build
44
- * their own custom element base classes that don't use lit-html.
45
- *
46
- * @packageDocumentation
47
- */
48
- import { PropertyValues, ReactiveElement } from '../reactive-element';
49
- import { RenderOptions } from '../lit-html/lit-html';
50
- export declare const UpdatingElement: typeof ReactiveElement;
51
- /**
52
- * Base element class that manages element properties and attributes, and
53
- * renders a lit-html template.
54
- *
55
- * To define a component, subclass `LitElement` and implement a
56
- * `render` method to provide the component's template. Define properties
57
- * using the [[`properties`]] property or the [[`property`]] decorator.
58
- */
59
- export declare class LitElement extends ReactiveElement {
60
- /**
61
- * Ensure this class is marked as `finalized` as an optimization ensuring
62
- * it will not needlessly try to `finalize`.
63
- *
64
- * Note this property name is a string to prevent breaking Closure JS Compiler
65
- * optimizations. See @lit/reactive-element for more information.
66
- */
67
- protected static ['finalized']: boolean;
68
- static ['_$litElement$']: boolean;
69
- /**
70
- * @category rendering
71
- */
72
- readonly renderOptions: RenderOptions;
73
- private __childPart;
74
- /**
75
- * @category rendering
76
- */
77
- protected createRenderRoot(): Element | ShadowRoot;
78
- /**
79
- * Updates the element. This method reflects property values to attributes
80
- * and calls `render` to render DOM via lit-html. Setting properties inside
81
- * this method will *not* trigger another update.
82
- * @param changedProperties Map of changed properties with old values
83
- * @category updates
84
- */
85
- protected update(changedProperties: PropertyValues): void;
86
- /**
87
- * Invoked when the component is added to the document's DOM.
88
- *
89
- * In `connectedCallback()` you should setup tasks that should only occur when
90
- * the element is connected to the document. The most common of these is
91
- * adding event listeners to nodes external to the element, like a keydown
92
- * event handler added to the window.
93
- *
94
- * ```ts
95
- * connectedCallback() {
96
- * super.connectedCallback();
97
- * addEventListener('keydown', this._handleKeydown);
98
- * }
99
- * ```
100
- *
101
- * Typically, anything done in `connectedCallback()` should be undone when the
102
- * element is disconnected, in `disconnectedCallback()`.
103
- *
104
- * @category lifecycle
105
- */
106
- connectedCallback(): void;
107
- /**
108
- * Invoked when the component is removed from the document's DOM.
109
- *
110
- * This callback is the main signal to the element that it may no longer be
111
- * used. `disconnectedCallback()` should ensure that nothing is holding a
112
- * reference to the element (such as event listeners added to nodes external
113
- * to the element), so that it is free to be garbage collected.
114
- *
115
- * ```ts
116
- * disconnectedCallback() {
117
- * super.disconnectedCallback();
118
- * window.removeEventListener('keydown', this._handleKeydown);
119
- * }
120
- * ```
121
- *
122
- * An element may be re-connected after being disconnected.
123
- *
124
- * @category lifecycle
125
- */
126
- disconnectedCallback(): void;
127
- /**
128
- * Invoked on each update to perform rendering tasks. This method may return
129
- * any value renderable by lit-html's `ChildPart` - typically a
130
- * `TemplateResult`. Setting properties inside this method will *not* trigger
131
- * the element to update.
132
- * @category rendering
133
- */
134
- protected render(): unknown;
135
- }
136
- /**
137
- * END USERS SHOULD NOT RELY ON THIS OBJECT.
138
- *
139
- * Private exports for use by other Lit packages, not intended for use by
140
- * external users.
141
- *
142
- * We currently do not make a mangled rollup build of the lit-ssr code. In order
143
- * to keep a number of (otherwise private) top-level exports mangled in the
144
- * client side code, we export a _$LE object containing those members (or
145
- * helper methods for accessing private fields of those members), and then
146
- * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the
147
- * client-side code is being used in `dev` mode or `prod` mode.
148
- *
149
- * This has a unique name, to disambiguate it from private exports in
150
- * lit-html, since this module re-exports all of lit-html.
151
- *
152
- * @private
153
- */
154
- export declare const _$LE: {
155
- _$attributeToProperty: (el: LitElement, name: string, value: string | null) => void;
156
- _$changedProperties: (el: LitElement) => any;
157
- };