@rxdi/lit-html 0.7.224 → 0.7.226

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.
@@ -51,6 +51,7 @@ export interface CustomElementConfig<T> {
51
51
  type Constructor<T> = new (...args: unknown[]) => T;
52
52
  export declare const Component: <T>(config: CustomElementConfig<T>) => <K extends new (...args: any[]) => {}>(Base: K) => {
53
53
  new (...args: any[]): {
54
+ _registry: CustomAttributeRegistry;
54
55
  getTemplateResult(): /*elided*/ any;
55
56
  OnInit(): any;
56
57
  disconnectedCallback(): void;
@@ -42,7 +42,6 @@ const customElement = (tag, config = {}) => (Base) => {
42
42
  const disconnectedCallback = Base.prototype.disconnectedCallback || function () { };
43
43
  const update = Base.prototype.update || function () { };
44
44
  const firstUpdated = Base.prototype.firstUpdated || function () { };
45
- let registry;
46
45
  if (!config.template) {
47
46
  config.template = Base.prototype.render || (() => (0, lit_html_1.html) ``);
48
47
  }
@@ -75,17 +74,18 @@ const customElement = (tag, config = {}) => (Base) => {
75
74
  return OnInit.call(this);
76
75
  }
77
76
  disconnectedCallback() {
77
+ var _a;
78
78
  OnDestroy.call(this);
79
79
  disconnectedCallback.call(this);
80
- registry === null || registry === void 0 ? void 0 : registry.unsubscribe();
81
- registry = null;
80
+ (_a = this._registry) === null || _a === void 0 ? void 0 : _a.unsubscribe();
81
+ this._registry = null;
82
82
  }
83
83
  connectedCallback() {
84
84
  var _a, _c;
85
85
  connectedCallback.call(this);
86
86
  OnInit.call(this);
87
87
  if (isFunction(config.registry)) {
88
- registry = config.registry.call(this);
88
+ this._registry = config.registry.call(this);
89
89
  }
90
90
  if ((_a = config.modifiers) === null || _a === void 0 ? void 0 : _a.length) {
91
91
  for (const modifier of config.modifiers) {
@@ -98,13 +98,13 @@ const customElement = (tag, config = {}) => (Base) => {
98
98
  if (!((_c = modifier.options) === null || _c === void 0 ? void 0 : _c.selector)) {
99
99
  throw new Error(`Missing attribute selector inside component "${config.selector}"`);
100
100
  }
101
- if (!registry && typeof modifier.options.registry === 'function') {
102
- registry = modifier.options.registry.call(this);
101
+ if (!this._registry && typeof modifier.options.registry === 'function') {
102
+ this._registry = modifier.options.registry.call(this);
103
103
  }
104
- if (!registry) {
104
+ if (!this._registry) {
105
105
  throw new Error(`Missing attribute registry for attribute "${modifier.options.selector}" and no default registry specified inside component "${config.selector}"`);
106
106
  }
107
- registry.define(modifier.options.selector, modifier);
107
+ this._registry.define(modifier.options.selector, modifier);
108
108
  }
109
109
  }
110
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxdi/lit-html",
3
- "version": "0.7.224",
3
+ "version": "0.7.226",
4
4
  "main": "./dist/index.js",
5
5
  "author": "Kristiyan Tachev",
6
6
  "license": "MIT",