cradova 3.3.17 → 3.3.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/dist/index.js +2 -10
- package/dist/primitives/classes.d.ts +1 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -65,9 +65,8 @@ function loop(datalist, component) {
|
|
|
65
65
|
function useState(newState, Comp2) {
|
|
66
66
|
Comp2._state_index += 1;
|
|
67
67
|
const idx = Comp2._state_index;
|
|
68
|
-
if (
|
|
68
|
+
if (idx >= Comp2._state.length) {
|
|
69
69
|
Comp2._state[idx] = newState;
|
|
70
|
-
Comp2._state_track[idx] = true;
|
|
71
70
|
}
|
|
72
71
|
function setState(newState2) {
|
|
73
72
|
Comp2._state[idx] = newState2;
|
|
@@ -245,13 +244,12 @@ class Comp {
|
|
|
245
244
|
reference = new __raw_ref;
|
|
246
245
|
Signal;
|
|
247
246
|
_state = [];
|
|
248
|
-
_state_track = {};
|
|
249
247
|
_state_index = 0;
|
|
248
|
+
test;
|
|
250
249
|
constructor(component) {
|
|
251
250
|
this.component = component.bind(this);
|
|
252
251
|
CradovaEvent.addBeforeMountActive(() => {
|
|
253
252
|
this._state_index = 0;
|
|
254
|
-
this._state_track = {};
|
|
255
253
|
this._state = [];
|
|
256
254
|
});
|
|
257
255
|
}
|
|
@@ -560,7 +558,6 @@ class Page {
|
|
|
560
558
|
return this._dropped;
|
|
561
559
|
}
|
|
562
560
|
async _activate() {
|
|
563
|
-
console.log("boohoo 1");
|
|
564
561
|
if (this._dropped) {
|
|
565
562
|
history.go(-1);
|
|
566
563
|
return;
|
|
@@ -631,7 +628,6 @@ class RouterBoxClass {
|
|
|
631
628
|
} else {
|
|
632
629
|
[route, params] = this.checker(url);
|
|
633
630
|
}
|
|
634
|
-
console.log({ url, route });
|
|
635
631
|
if (typeof route !== "undefined") {
|
|
636
632
|
try {
|
|
637
633
|
if (typeof route === "function") {
|
|
@@ -674,11 +670,8 @@ class RouterBoxClass {
|
|
|
674
670
|
}
|
|
675
671
|
checker(url) {
|
|
676
672
|
if (url[0] !== "/") {
|
|
677
|
-
console.log(url, 1);
|
|
678
673
|
url = url.slice(url.indexOf("/", 8));
|
|
679
|
-
console.log(url, 2);
|
|
680
674
|
}
|
|
681
|
-
console.log(url);
|
|
682
675
|
if (this.routes[url]) {
|
|
683
676
|
return [this.routes[url], { path: url }];
|
|
684
677
|
}
|
|
@@ -748,7 +741,6 @@ class Router {
|
|
|
748
741
|
RouterBox.route(path, page);
|
|
749
742
|
}
|
|
750
743
|
}
|
|
751
|
-
console.log(RouterBox.routes);
|
|
752
744
|
Router._mount();
|
|
753
745
|
}
|
|
754
746
|
static back() {
|
|
@@ -42,10 +42,8 @@ export declare class Comp<Prop extends Record<string, any> = any> {
|
|
|
42
42
|
private reference;
|
|
43
43
|
Signal: createSignal<any> | undefined;
|
|
44
44
|
_state: Prop[];
|
|
45
|
-
_state_track: {
|
|
46
|
-
[x: number]: boolean;
|
|
47
|
-
};
|
|
48
45
|
_state_index: number;
|
|
46
|
+
test?: string;
|
|
49
47
|
constructor(component: (this: Comp<Prop>) => HTMLElement);
|
|
50
48
|
preRender(): void;
|
|
51
49
|
/**
|