@zcomponent/core 0.0.17 → 0.0.18
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.
- package/lib/types.d.ts +7 -1
- package/lib/types.js +1 -0
- package/lib/zcomponent.d.ts +2 -1
- package/lib/zcomponent.js +12 -0
- package/package.json +1 -1
package/lib/types.d.ts
CHANGED
|
@@ -64,7 +64,8 @@ export declare enum ValuesType {
|
|
|
64
64
|
'morphTargets' = "morphTargets",
|
|
65
65
|
'events' = "events",
|
|
66
66
|
'parentNodes' = "parentNodes",
|
|
67
|
-
'nodelabels' = "nodelabels"
|
|
67
|
+
'nodelabels' = "nodelabels",
|
|
68
|
+
'nodeids' = "nodeids"
|
|
68
69
|
}
|
|
69
70
|
export interface Values {
|
|
70
71
|
type: ValuesType;
|
|
@@ -143,6 +144,11 @@ export interface TemplateInfo {
|
|
|
143
144
|
content: string;
|
|
144
145
|
extn?: string;
|
|
145
146
|
}
|
|
147
|
+
export interface FileGenerator {
|
|
148
|
+
name: string;
|
|
149
|
+
url: string;
|
|
150
|
+
icon?: string;
|
|
151
|
+
}
|
|
146
152
|
export declare function symbolPathFromFilename(f: string): string;
|
|
147
153
|
export declare function isValidValueForType(def: any, t: Type, allowUndefined?: boolean): boolean;
|
|
148
154
|
export declare function outputForType(t: Type, alwaysBasic?: boolean): string;
|
package/lib/types.js
CHANGED
|
@@ -16,6 +16,7 @@ export var ValuesType;
|
|
|
16
16
|
ValuesType["events"] = "events";
|
|
17
17
|
ValuesType["parentNodes"] = "parentNodes";
|
|
18
18
|
ValuesType["nodelabels"] = "nodelabels";
|
|
19
|
+
ValuesType["nodeids"] = "nodeids";
|
|
19
20
|
})(ValuesType || (ValuesType = {}));
|
|
20
21
|
function valuesCompatible(l, r) {
|
|
21
22
|
if (!l && !r)
|
package/lib/zcomponent.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentChildren, ConstructorProps } from './component';
|
|
1
|
+
import { Component, ComponentChildren, ConstructorForComponent, ConstructorProps } from './component';
|
|
2
2
|
import { ContextManager, Context } from './context';
|
|
3
3
|
import { Entity } from './entity';
|
|
4
4
|
import { ZComponentData } from './interfaces';
|
|
@@ -48,6 +48,7 @@ export declare class ZComponent<RootType = any> extends Component<RootType> {
|
|
|
48
48
|
constructor(contextManager: ContextManager, constructorProps: ConstructorProps, _opts: ZComponentOptions);
|
|
49
49
|
private _constructorForNode;
|
|
50
50
|
private _constructorForBehavior;
|
|
51
|
+
resolveNodeID<T extends Component = Component>(id: string, type?: ConstructorForComponent<T>): T | undefined;
|
|
51
52
|
private _inflateBehaviors;
|
|
52
53
|
private _wrapBehaviors;
|
|
53
54
|
notifyPropsChanged(entries: Map<string, Set<string>>): void;
|
package/lib/zcomponent.js
CHANGED
|
@@ -178,6 +178,18 @@ export class ZComponent extends Component {
|
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
+
resolveNodeID(id, type) {
|
|
182
|
+
const entity = this.entityByID.get(id);
|
|
183
|
+
if (!entity)
|
|
184
|
+
return this.getZComponentInstance()?.resolveNodeID(id, type);
|
|
185
|
+
if (!(entity instanceof Component))
|
|
186
|
+
return undefined;
|
|
187
|
+
if (!type)
|
|
188
|
+
return entity;
|
|
189
|
+
if (entity instanceof type)
|
|
190
|
+
return entity;
|
|
191
|
+
return undefined;
|
|
192
|
+
}
|
|
181
193
|
_inflateBehaviors() {
|
|
182
194
|
for (const [nodeID, impl, ctx] of this._behaviorsToInitialize) {
|
|
183
195
|
this._wrapBehaviors(nodeID, impl, ctx);
|