@rxdi/lit-html 0.7.142 → 0.7.143
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.
|
@@ -6,11 +6,10 @@ export interface CustomAttributeRegistry {
|
|
|
6
6
|
unsubscribe(): void;
|
|
7
7
|
}
|
|
8
8
|
export interface ModifierOptions {
|
|
9
|
-
|
|
9
|
+
selector: string;
|
|
10
10
|
registry?: CustomAttributeRegistry;
|
|
11
11
|
}
|
|
12
12
|
export interface Modifier extends Function {
|
|
13
|
-
name: string;
|
|
14
13
|
options(): ModifierOptions;
|
|
15
14
|
}
|
|
16
15
|
export interface CustomElementConfig<T> {
|
|
@@ -86,7 +86,7 @@ const customElement = (tag, config = {}) => (Base) => {
|
|
|
86
86
|
throw new Error(`Modifier options is not a function ${modifier.name} and component "${config.selector}"`);
|
|
87
87
|
}
|
|
88
88
|
const options = modifier.options.call(this);
|
|
89
|
-
if (!(options === null || options === void 0 ? void 0 : options.
|
|
89
|
+
if (!(options === null || options === void 0 ? void 0 : options.selector)) {
|
|
90
90
|
throw new Error(`Missing attribute name for ${modifier.name} inside component "${config.selector}"`);
|
|
91
91
|
}
|
|
92
92
|
if (!registry) {
|
|
@@ -95,9 +95,9 @@ const customElement = (tag, config = {}) => (Base) => {
|
|
|
95
95
|
: options.registry);
|
|
96
96
|
}
|
|
97
97
|
if (!registry) {
|
|
98
|
-
throw new Error(`Missing attribute registry for attribute "${options.
|
|
98
|
+
throw new Error(`Missing attribute registry for attribute "${options.selector}" and no default registry specified inside component "${config.selector}"`);
|
|
99
99
|
}
|
|
100
|
-
registry.define(options.
|
|
100
|
+
registry.define(options.selector, modifier);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|