@@ -9,19 +9,6 @@ export interface Props {
99
1010const { element_name = null , oop_only_methods, oop_compatible_functions } = Astro .props ;
1111
12- let oop_variables_by_var: Record <string , any []> = {};
13- for (const func of oop_compatible_functions ) {
14- if (func .oop .variable ) {
15- if (! oop_variables_by_var [func .oop .variable ]) {
16- oop_variables_by_var [func .oop .variable ] = [];
17- }
18- oop_variables_by_var [func .oop .variable ].push ({
19- functionName: func .name ,
20- functionLink: func .link ,
21- functionOop: func .oop ,
22- });
23- }
24- }
2512let oop_constructor = oop_compatible_functions .find (func => func .oop .constructorclass );
2613---
2714{ element_name && oop_constructor && (
@@ -33,21 +20,36 @@ let oop_constructor = oop_compatible_functions.find(func => func.oop.constructor
3320</section >
3421)}
3522
36- { Object . keys ( oop_variables_by_var ) .length > 0 && (
37- <section class = " oop-variables -section" >
38- <h4 ><a href = " /OOP_Introduction" >OOP</a > Variables and Methods </h4 >
23+ { oop_compatible_functions .length > 0 && (
24+ <section class = " oop-compatible-functions -section" >
25+ <h4 ><a href = " /OOP_Introduction" >OOP</a > Methods and Variables </h4 >
3926 <ul >
40- { Object .entries (oop_variables_by_var ).map (([variableName , functions ]) => (
41- <li >
42- <code >{ variableName } </code >:
43- { functions .map ((func : any , index : number ) => (
44- <Fragment >
45- <a href = { func .functionLink } >{ func .functionOop .method } </a >
46- { index < functions .length - 1 ? ' , ' : ' ' }
47- </Fragment >
48- ))}
49- </li >
50- ))}
27+ { oop_compatible_functions .map ((funcInfo : any ) => (
28+ <li >
29+ { funcInfo .oop .constructorclass ? (
30+ <span >
31+ <strong >Constructor</strong >:
32+ { funcInfo .oop .constructorclass } (...)
33+ </span >
34+ ) : (
35+ <>
36+ { funcInfo .oop .method && (
37+ <span style = " margin-right: 10px;" >
38+ <strong >Method</strong >:
39+ { funcInfo .oop .static ? funcInfo .oop .entity .charAt (0 ).toUpperCase () + funcInfo .oop .entity .slice (1 ) : funcInfo .oop .entity } { funcInfo .oop .static ? ' .' : ' :' } <a href = { funcInfo .link } title = { funcInfo .name } >{ funcInfo .oop .method } </a >(...)
40+ </span >
41+ )}
42+
43+ { funcInfo .oop .variable && (
44+ <span >
45+ <strong >Variable</strong >:
46+ .{ funcInfo .oop .variable }
47+ </span >
48+ )}
49+ </>
50+ )}
51+ </li >
52+ ))}
5153 </ul >
5254</section >
5355)}
0 commit comments