cradova 3.6.2 → 3.6.4

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -34
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34,21 +34,6 @@ var makeElement = (element, ElementChildrenAndPropertyList) => {
34
34
  Object.assign(element.style, value);
35
35
  continue;
36
36
  }
37
- if (prop === "href") {
38
- const href = value || "";
39
- if (!href.includes("://")) {
40
- element.addEventListener("click", (e) => {
41
- e.preventDefault();
42
- Router.navigate(element.href);
43
- if (href.includes("#")) {
44
- const l = href.split("#").at(-1);
45
- document.getElementById("#" + l)?.scrollIntoView();
46
- }
47
- });
48
- }
49
- element.setAttribute(prop, value);
50
- continue;
51
- }
52
37
  if (prop === "onmount") {
53
38
  CradovaEvent.after_comp_is_mounted.push(() => {
54
39
  typeof props["onmount"] === "function" && props["onmount"].apply(element);
@@ -417,30 +402,14 @@ class Signal {
417
402
  subscribe(eventName, comp) {
418
403
  if (typeof Function === "function") {
419
404
  if (Array.isArray(eventName)) {
420
- for (let i2 = 0;i2 < eventName.length; i2++) {
421
- const event = eventName[i2];
422
- if (this.pipe[event]) {
423
- comp.pipes.set(event, this.pipe[event]);
424
- comp.signals.set(event, this);
425
- } else {
426
- console.error(` ✘ Cradova err: ${event} is not a valid event for this Signal`);
427
- }
428
- if (this.subs[event]?.find((cmp) => cmp.id === comp.id)) {
429
- return;
430
- }
431
- if (!this.subs[event]) {
432
- this.subs[event] = [comp];
433
- } else {
434
- this.subs[event].push(comp);
435
- }
436
- }
405
+ eventName.forEach((en) => {
406
+ this.subscribe(en, comp);
407
+ });
437
408
  return;
438
409
  }
439
410
  if (this.pipe[eventName]) {
440
411
  comp.pipes.set(eventName, this.pipe[eventName]);
441
412
  comp.signals.set(eventName, this);
442
- } else {
443
- console.error(` ✘ Cradova err: ${eventName} is not a valid event for this Signal`);
444
413
  }
445
414
  if (this.subs[eventName]?.find((cmp) => cmp.id === comp.id)) {
446
415
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cradova",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "description": "Build Powerful ⚡ Web Apps with Ease",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",