typecomposer 0.0.46 → 0.0.47
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/README.md +26 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,46 +16,37 @@ TypeComposer is a frontend framework that allows you to create user interfaces d
|
|
|
16
16
|
You can install TypeComposer via npm:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npm
|
|
19
|
+
npm create typecomposer@latest
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Usage
|
|
23
23
|
|
|
24
24
|
To get started with TypeComposer, import the necessary elements from the package and start creating your user interface using classes.Here's a basic example of a login page:
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
import
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
vbox.append(passwordField);
|
|
48
|
-
vbox.append(loginButton);
|
|
49
|
-
|
|
50
|
-
this.center.setStyle({ display: 'flex', justifyContent: 'center', alignItems: 'center' });
|
|
51
|
-
this.center.append(vbox);
|
|
52
|
-
|
|
53
|
-
}
|
|
26
|
+
```js
|
|
27
|
+
import typescriptLogo from "/typescript.svg";
|
|
28
|
+
import logo from "/typecomposer.svg";
|
|
29
|
+
import { App, BorderPaneElement, ButtonElement, H1Element, HBoxElement, ImageElement, VBoxElement } from "typecomposer";
|
|
30
|
+
import "./style.css";
|
|
31
|
+
|
|
32
|
+
export class AppPage extends BorderPaneElement {
|
|
33
|
+
private count: number = 0;
|
|
34
|
+
|
|
35
|
+
onInit(): void {
|
|
36
|
+
const vbox = new VBoxElement({ justifyContent: "center" });
|
|
37
|
+
const images = new HBoxElement({ width: "100%", alignItems: "center", justifyContent: "center" });
|
|
38
|
+
images.append(new ImageElement({ src: logo, className: "logo" }));
|
|
39
|
+
images.append(new ImageElement({ src: typescriptLogo, className: "logo" }));
|
|
40
|
+
vbox.append(images);
|
|
41
|
+
vbox.append(new H1Element({ text: "TypeComposer", textAlign: "center", color: "#fcfffa" }));
|
|
42
|
+
const counter = new ButtonElement({ text: "0", width: "35%", height: "50px", alignSelf: "center" });
|
|
43
|
+
counter.onclick = () => (counter.innerHTML = (this.count++).toString());
|
|
44
|
+
vbox.append(counter);
|
|
45
|
+
this.center = vbox;
|
|
46
|
+
}
|
|
54
47
|
}
|
|
55
48
|
|
|
56
|
-
|
|
57
|
-
App.setPage(new LoginPage());
|
|
58
|
-
|
|
49
|
+
App.setPage(new AppPage());
|
|
59
50
|
```
|
|
60
51
|
|
|
61
52
|
## Contributing
|
|
@@ -65,4 +56,7 @@ Contributions are welcome! If you find any issues or have suggestions for improv
|
|
|
65
56
|
## License
|
|
66
57
|
|
|
67
58
|
This project is licensed under the[MIT License](LICENSE).
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
|
|
68
62
|
```
|