element-vir 4.1.0 → 4.1.3
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.
|
@@ -12,6 +12,7 @@ export function defineFunctionalElement(functionalElementInit) {
|
|
|
12
12
|
createRenderParams() {
|
|
13
13
|
return createRenderParams(this, eventsMap);
|
|
14
14
|
}
|
|
15
|
+
static initInput = functionalElementInit;
|
|
15
16
|
static events = eventsMap;
|
|
16
17
|
static renderCallback = functionalElementInit.renderCallback;
|
|
17
18
|
static props = createPropertyDescriptorMap(functionalElementInit.props);
|
|
@@ -19,8 +20,8 @@ export function defineFunctionalElement(functionalElementInit) {
|
|
|
19
20
|
render() {
|
|
20
21
|
const renderParams = this.createRenderParams();
|
|
21
22
|
if (!this.initCalled && functionalElementInit.initCallback) {
|
|
22
|
-
functionalElementInit.initCallback(renderParams);
|
|
23
23
|
this.initCalled = true;
|
|
24
|
+
functionalElementInit.initCallback(renderParams);
|
|
24
25
|
}
|
|
25
26
|
return functionalElementInit.renderCallback(renderParams);
|
|
26
27
|
}
|
|
@@ -32,6 +32,7 @@ export declare type ExtraStaticFunctionalElementProperties<PropertyInitGeneric e
|
|
|
32
32
|
renderCallback: RenderCallback<PropertyInitGeneric, EventsInitGeneric>;
|
|
33
33
|
events: EventDescriptorMap<EventsInitGeneric>;
|
|
34
34
|
props: ElementPropertyDescriptorMap<PropertyInitGeneric>;
|
|
35
|
+
initInput: FunctionalElementInit<PropertyInitGeneric, EventsInitGeneric>;
|
|
35
36
|
/**
|
|
36
37
|
* Static properties have to be copied here cause they get nuked in the "new () =>
|
|
37
38
|
* FunctionalElementInstance<PropertyInitGeneric>" type.
|
|
@@ -3,7 +3,7 @@ import { TypedEvent } from '../typed-event/typed-event';
|
|
|
3
3
|
import { EventDescriptorMap, EventInitMapEventDetailExtractor, EventsInitMap } from './element-events';
|
|
4
4
|
import { PropertyInitMapBase } from './element-properties';
|
|
5
5
|
import { FunctionalElementInstance } from './functional-element';
|
|
6
|
-
export declare type RenderCallback<PropertyInitGeneric extends PropertyInitMapBase, EventsInitGeneric extends EventsInitMap> = (params: RenderParams<PropertyInitGeneric, EventsInitGeneric>) => TemplateResult
|
|
6
|
+
export declare type RenderCallback<PropertyInitGeneric extends PropertyInitMapBase, EventsInitGeneric extends EventsInitMap> = (params: RenderParams<PropertyInitGeneric, EventsInitGeneric>) => TemplateResult;
|
|
7
7
|
export declare type InitCallback<PropertyInitGeneric extends PropertyInitMapBase, EventsInitGeneric extends EventsInitMap> = (params: RenderParams<PropertyInitGeneric, EventsInitGeneric>) => void;
|
|
8
8
|
export declare type RenderParams<PropertyInitGeneric extends PropertyInitMapBase, EventsInitGeneric extends EventsInitMap> = {
|
|
9
9
|
props: PropertyInitGeneric;
|