cradova 3.11.1 → 3.11.2
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/dist/index.js +1 -6
- package/dist/primitives/functions.d.ts +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,15 +7,10 @@ var makeElement = (element, ElementChildrenAndPropertyList) => {
|
|
|
7
7
|
let child = ElementChildrenAndPropertyList[i];
|
|
8
8
|
if (typeof child === "function") {
|
|
9
9
|
child = isArrowFunc(child) ? child() : toComp(child);
|
|
10
|
-
if (typeof child === "function") {
|
|
11
|
-
child = isArrowFunc(child) ? child() : toComp(child);
|
|
12
|
-
}
|
|
13
10
|
}
|
|
14
11
|
if (child instanceof HTMLElement || child instanceof DocumentFragment) {
|
|
15
12
|
element.appendChild(child);
|
|
16
13
|
continue;
|
|
17
|
-
} else {
|
|
18
|
-
console.error(" ✘ Cradova err: " + child + " is not a valid element received");
|
|
19
14
|
}
|
|
20
15
|
if (Array.isArray(child)) {
|
|
21
16
|
if (child[1] instanceof Signal) {
|
|
@@ -119,7 +114,7 @@ function $ifelse(condition, ifTrue, ifFalse) {
|
|
|
119
114
|
}
|
|
120
115
|
return ifFalse;
|
|
121
116
|
}
|
|
122
|
-
function $case(value,
|
|
117
|
+
function $case(value, elements) {
|
|
123
118
|
return (key) => {
|
|
124
119
|
if (key === value) {
|
|
125
120
|
return elements;
|
|
@@ -7,9 +7,9 @@ export declare const cra: <E extends HTMLElement>(tag: string) => (...Children_a
|
|
|
7
7
|
* @param {function} elements[]
|
|
8
8
|
*/
|
|
9
9
|
export declare function $if<E extends HTMLElement>(condition: any, ...elements: VJS_params_TYPE<E>): VJS_params_TYPE<E> | undefined;
|
|
10
|
-
export declare function $ifelse(condition: any, ifTrue: any
|
|
11
|
-
export declare function $case<E extends HTMLElement = HTMLElement>(value: any,
|
|
12
|
-
export declare function $switch(key:
|
|
10
|
+
export declare function $ifelse(condition: any, ifTrue: VJS_params_TYPE<any>, ifFalse?: VJS_params_TYPE<any>): VJS_params_TYPE<any> | undefined;
|
|
11
|
+
export declare function $case<E extends HTMLElement = HTMLElement>(value: any, elements: VJS_params_TYPE<E>): (key: any) => VJS_params_TYPE<E> | undefined;
|
|
12
|
+
export declare function $switch<K = unknown>(key: K, ...cases: ((key: K) => VJS_params_TYPE<any>)[]): VJS_params_TYPE<any> | undefined;
|
|
13
13
|
type LoopData<Type> = Type[];
|
|
14
14
|
export declare function loop<Type>(datalist: LoopData<Type>, component: (value: Type, index?: number, array?: LoopData<Type>) => HTMLElement | HTMLElement[] | DocumentFragment | DocumentFragment[] | undefined | undefined[]): HTMLElement[] | undefined;
|
|
15
15
|
/**
|