@rxdi/lit-html 0.7.162 → 0.7.163

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.
@@ -44,7 +44,7 @@ export interface CustomElementConfig<T> {
44
44
  */
45
45
  container?: HTMLElement | DocumentFragment;
46
46
  }
47
- export declare const Component: <T>(config: CustomElementConfig<T>) => <K extends new (...args: any[]) => {}>(Base: K) => {
47
+ export declare const Component: <T>(config: CustomElementConfig<T>) => <K extends new (...args: any[]) => {}>(Base: K) => (() => any) | ({
48
48
  new (...args: any[]): {
49
49
  getTemplateResult(): any;
50
50
  OnInit(): any;
@@ -56,4 +56,9 @@ export declare const Component: <T>(config: CustomElementConfig<T>) => <K extend
56
56
  };
57
57
  styles: CSSResult[];
58
58
  is(): string;
59
- } & K;
59
+ } & K);
60
+ declare global {
61
+ interface Window {
62
+ _excluded_components: string[];
63
+ }
64
+ }
@@ -20,6 +20,11 @@ const standardCustomElement = (tagName, descriptor, options) => {
20
20
  const isFunction = (v) => typeof v === 'function';
21
21
  const customElement = (tag, config = {}) => (Base) => {
22
22
  var _a;
23
+ var _b;
24
+ /* Feature flag implementation where we don't define at all components when they are excluded */
25
+ if ((_a = window._excluded_components) === null || _a === void 0 ? void 0 : _a.includes(config.selector)) {
26
+ return () => null;
27
+ }
23
28
  if (!tag || (tag && tag.indexOf('-') <= 0)) {
24
29
  throw new Error(`You need at least 1 dash in the custom element name! ${Base}`);
25
30
  }
@@ -39,7 +44,7 @@ const customElement = (tag, config = {}) => (Base) => {
39
44
  if (config.style) {
40
45
  config.styles.push(config.style);
41
46
  }
42
- const ModifiedClass = (_a = class NoName extends Base {
47
+ const ModifiedClass = (_b = class NoName extends Base {
43
48
  static is() {
44
49
  return tag;
45
50
  }
@@ -110,8 +115,8 @@ const customElement = (tag, config = {}) => (Base) => {
110
115
  OnUpdateFirst.call(this);
111
116
  }
112
117
  },
113
- _a.styles = config.styles,
114
- _a);
118
+ _b.styles = config.styles,
119
+ _b);
115
120
  const registeredElement = window.customElements.get(tag);
116
121
  if (registeredElement) {
117
122
  console.error(`** IMPORTANT!!! **
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxdi/lit-html",
3
- "version": "0.7.162",
3
+ "version": "0.7.163",
4
4
  "main": "./dist/index.js",
5
5
  "author": "Kristiyan Tachev",
6
6
  "license": "MIT",