@xanui/core 1.1.24 → 1.1.25

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.
@@ -1,7 +1,7 @@
1
1
  import React__default from 'react';
2
2
 
3
3
  declare class Renderar {
4
- static render(component: React__default.FunctionComponent): {
4
+ static render(component: React__default.FunctionComponent, props?: any): {
5
5
  unrender: () => void;
6
6
  };
7
7
  static unrender(component: React__default.FunctionComponent): void;
@@ -1,8 +1,8 @@
1
1
  'use strict';Object.defineProperty(exports,'__esModule',{value:true});var jsxRuntime=require('react/jsx-runtime'),React=require('react');const Components = [];
2
- let dispatch;
2
+ let dispatch = null;
3
3
  class Renderar {
4
- static render(component) {
5
- Components.push(component);
4
+ static render(component, props) {
5
+ Components.push({ component, props });
6
6
  if (dispatch) {
7
7
  dispatch();
8
8
  }
@@ -13,23 +13,22 @@ class Renderar {
13
13
  };
14
14
  }
15
15
  static unrender(component) {
16
- const index = Components.indexOf(component);
16
+ const index = Components.findIndex((c) => c.component === component);
17
17
  if (index > -1) {
18
18
  Components.splice(index, 1);
19
- if (dispatch) {
19
+ if (dispatch)
20
20
  dispatch();
21
- }
22
21
  }
23
22
  }
24
23
  }
25
24
  const RenderRenderar = () => {
26
- const [_, setState] = React.useState(0);
25
+ const [, setState] = React.useState(0);
27
26
  if (!dispatch) {
28
27
  dispatch = () => {
29
- setState(prev => prev + 1);
28
+ setState((prev) => prev + 1);
30
29
  };
31
30
  }
32
- return Components.map((Component, index) => {
33
- return jsxRuntime.jsx(Component, {}, index);
31
+ return Components.map(({ component: Component, props }, index) => {
32
+ return jsxRuntime.jsx(Component, Object.assign({}, props), index);
34
33
  });
35
34
  };exports.RenderRenderar=RenderRenderar;exports.Renderar=Renderar;//# sourceMappingURL=Renderar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Renderar.js","sources":["../../src/AppRoot/Renderar.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\nconst Components: React.FunctionComponent[] = []\nlet dispatch: Function\n\nexport class Renderar {\n static render(component: React.FunctionComponent) {\n Components.push(component);\n if (dispatch) {\n dispatch();\n }\n\n return {\n unrender: () => {\n this.unrender(component);\n }\n }\n }\n\n static unrender(component: React.FunctionComponent) {\n const index = Components.indexOf(component);\n if (index > -1) {\n Components.splice(index, 1);\n if (dispatch) {\n dispatch();\n }\n }\n }\n}\n\nexport const RenderRenderar = () => {\n const [_, setState] = React.useState<number>(0);\n\n if (!dispatch) {\n dispatch = () => {\n setState(prev => prev + 1);\n }\n }\n\n return Components.map((Component, index): ReactElement => {\n return <Component key={index} />\n });\n}\n"],"names":["_jsx"],"mappings":"yIAEA,MAAM,UAAU,GAA8B,EAAE;AAChD,IAAI,QAAkB;MAET,QAAQ,CAAA;IAClB,OAAO,MAAM,CAAC,SAAkC,EAAA;AAC7C,QAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,IAAI,QAAQ,EAAE;AACX,YAAA,QAAQ,EAAE;QACb;QAEA,OAAO;YACJ,QAAQ,EAAE,MAAK;AACZ,gBAAA,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC3B;SACF;IACJ;IAEA,OAAO,QAAQ,CAAC,SAAkC,EAAA;QAC/C,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC;AAC3C,QAAA,IAAI,KAAK,GAAG,EAAE,EAAE;AACb,YAAA,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAC3B,IAAI,QAAQ,EAAE;AACX,gBAAA,QAAQ,EAAE;YACb;QACH;IACH;AACF;AAEM,MAAM,cAAc,GAAG,MAAK;AAChC,IAAA,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,CAAC,CAAC;IAE/C,IAAI,CAAC,QAAQ,EAAE;QACZ,QAAQ,GAAG,MAAK;YACb,QAAQ,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC;AAC7B,QAAA,CAAC;IACJ;IAEA,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,KAAkB;AACtD,QAAA,OAAOA,cAAA,CAAC,SAAS,EAAA,EAAA,EAAM,KAAK,CAAI;AACnC,IAAA,CAAC,CAAC;AACL"}
1
+ {"version":3,"file":"Renderar.js","sources":["../../src/AppRoot/Renderar.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\ntype StoredComponent = {\n component: React.FunctionComponent<any>;\n props: any;\n};\n\nconst Components: StoredComponent[] = [];\nlet dispatch: (() => void) | null = null;\n\nexport class Renderar {\n static render(component: React.FunctionComponent, props?: any) {\n Components.push({ component, props });\n\n if (dispatch) {\n dispatch();\n }\n\n return {\n unrender: () => {\n this.unrender(component);\n }\n };\n }\n\n static unrender(component: React.FunctionComponent) {\n const index = Components.findIndex((c) => c.component === component);\n if (index > -1) {\n Components.splice(index, 1);\n if (dispatch) dispatch();\n }\n }\n}\n\nexport const RenderRenderar = () => {\n const [, setState] = React.useState(0);\n\n if (!dispatch) {\n dispatch = () => {\n setState((prev) => prev + 1);\n };\n }\n\n return Components.map(({ component: Component, props }, index): ReactElement => {\n return <Component key={index} {...props} />;\n });\n};\n"],"names":["_jsx"],"mappings":"yIAOA,MAAM,UAAU,GAAsB,EAAE;AACxC,IAAI,QAAQ,GAAwB,IAAI;MAE3B,QAAQ,CAAA;AAClB,IAAA,OAAO,MAAM,CAAC,SAAkC,EAAE,KAAW,EAAA;QAC1D,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAErC,IAAI,QAAQ,EAAE;AACX,YAAA,QAAQ,EAAE;QACb;QAEA,OAAO;YACJ,QAAQ,EAAE,MAAK;AACZ,gBAAA,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC3B;SACF;IACJ;IAEA,OAAO,QAAQ,CAAC,SAAkC,EAAA;AAC/C,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;AACpE,QAAA,IAAI,KAAK,GAAG,EAAE,EAAE;AACb,YAAA,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAC3B,YAAA,IAAI,QAAQ;AAAE,gBAAA,QAAQ,EAAE;QAC3B;IACH;AACF;AAEM,MAAM,cAAc,GAAG,MAAK;IAChC,MAAM,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEtC,IAAI,CAAC,QAAQ,EAAE;QACZ,QAAQ,GAAG,MAAK;YACb,QAAQ,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC;AAC/B,QAAA,CAAC;IACJ;AAEA,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,KAAkB;AAC5E,QAAA,OAAOA,eAAC,SAAS,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAiB,KAAK,CAAA,EAAhB,KAAK,CAAe;AAC9C,IAAA,CAAC,CAAC;AACL"}
@@ -1,8 +1,8 @@
1
1
  import {jsx}from'react/jsx-runtime';import React__default from'react';const Components = [];
2
- let dispatch;
2
+ let dispatch = null;
3
3
  class Renderar {
4
- static render(component) {
5
- Components.push(component);
4
+ static render(component, props) {
5
+ Components.push({ component, props });
6
6
  if (dispatch) {
7
7
  dispatch();
8
8
  }
@@ -13,23 +13,22 @@ class Renderar {
13
13
  };
14
14
  }
15
15
  static unrender(component) {
16
- const index = Components.indexOf(component);
16
+ const index = Components.findIndex((c) => c.component === component);
17
17
  if (index > -1) {
18
18
  Components.splice(index, 1);
19
- if (dispatch) {
19
+ if (dispatch)
20
20
  dispatch();
21
- }
22
21
  }
23
22
  }
24
23
  }
25
24
  const RenderRenderar = () => {
26
- const [_, setState] = React__default.useState(0);
25
+ const [, setState] = React__default.useState(0);
27
26
  if (!dispatch) {
28
27
  dispatch = () => {
29
- setState(prev => prev + 1);
28
+ setState((prev) => prev + 1);
30
29
  };
31
30
  }
32
- return Components.map((Component, index) => {
33
- return jsx(Component, {}, index);
31
+ return Components.map(({ component: Component, props }, index) => {
32
+ return jsx(Component, Object.assign({}, props), index);
34
33
  });
35
34
  };export{RenderRenderar,Renderar};//# sourceMappingURL=Renderar.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Renderar.mjs","sources":["../../src/AppRoot/Renderar.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\nconst Components: React.FunctionComponent[] = []\nlet dispatch: Function\n\nexport class Renderar {\n static render(component: React.FunctionComponent) {\n Components.push(component);\n if (dispatch) {\n dispatch();\n }\n\n return {\n unrender: () => {\n this.unrender(component);\n }\n }\n }\n\n static unrender(component: React.FunctionComponent) {\n const index = Components.indexOf(component);\n if (index > -1) {\n Components.splice(index, 1);\n if (dispatch) {\n dispatch();\n }\n }\n }\n}\n\nexport const RenderRenderar = () => {\n const [_, setState] = React.useState<number>(0);\n\n if (!dispatch) {\n dispatch = () => {\n setState(prev => prev + 1);\n }\n }\n\n return Components.map((Component, index): ReactElement => {\n return <Component key={index} />\n });\n}\n"],"names":["React","_jsx"],"mappings":"sEAEA,MAAM,UAAU,GAA8B,EAAE;AAChD,IAAI,QAAkB;MAET,QAAQ,CAAA;IAClB,OAAO,MAAM,CAAC,SAAkC,EAAA;AAC7C,QAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,IAAI,QAAQ,EAAE;AACX,YAAA,QAAQ,EAAE;QACb;QAEA,OAAO;YACJ,QAAQ,EAAE,MAAK;AACZ,gBAAA,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC3B;SACF;IACJ;IAEA,OAAO,QAAQ,CAAC,SAAkC,EAAA;QAC/C,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC;AAC3C,QAAA,IAAI,KAAK,GAAG,EAAE,EAAE;AACb,YAAA,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAC3B,IAAI,QAAQ,EAAE;AACX,gBAAA,QAAQ,EAAE;YACb;QACH;IACH;AACF;AAEM,MAAM,cAAc,GAAG,MAAK;AAChC,IAAA,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAGA,cAAK,CAAC,QAAQ,CAAS,CAAC,CAAC;IAE/C,IAAI,CAAC,QAAQ,EAAE;QACZ,QAAQ,GAAG,MAAK;YACb,QAAQ,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC;AAC7B,QAAA,CAAC;IACJ;IAEA,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,KAAkB;AACtD,QAAA,OAAOC,GAAA,CAAC,SAAS,EAAA,EAAA,EAAM,KAAK,CAAI;AACnC,IAAA,CAAC,CAAC;AACL"}
1
+ {"version":3,"file":"Renderar.mjs","sources":["../../src/AppRoot/Renderar.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\ntype StoredComponent = {\n component: React.FunctionComponent<any>;\n props: any;\n};\n\nconst Components: StoredComponent[] = [];\nlet dispatch: (() => void) | null = null;\n\nexport class Renderar {\n static render(component: React.FunctionComponent, props?: any) {\n Components.push({ component, props });\n\n if (dispatch) {\n dispatch();\n }\n\n return {\n unrender: () => {\n this.unrender(component);\n }\n };\n }\n\n static unrender(component: React.FunctionComponent) {\n const index = Components.findIndex((c) => c.component === component);\n if (index > -1) {\n Components.splice(index, 1);\n if (dispatch) dispatch();\n }\n }\n}\n\nexport const RenderRenderar = () => {\n const [, setState] = React.useState(0);\n\n if (!dispatch) {\n dispatch = () => {\n setState((prev) => prev + 1);\n };\n }\n\n return Components.map(({ component: Component, props }, index): ReactElement => {\n return <Component key={index} {...props} />;\n });\n};\n"],"names":["React","_jsx"],"mappings":"sEAOA,MAAM,UAAU,GAAsB,EAAE;AACxC,IAAI,QAAQ,GAAwB,IAAI;MAE3B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