File tree Expand file tree Collapse file tree 4 files changed +79
-14
lines changed Expand file tree Collapse file tree 4 files changed +79
-14
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -219,8 +219,8 @@ ${fixAssetPaths(js)}`,
219
219
?
220
220
< div style = { { width : "100%" } } >
221
221
< Splitter >
222
- { editor }
223
222
{ preview }
223
+ { editor }
224
224
</ Splitter >
225
225
</ div >
226
226
:
Original file line number Diff line number Diff line change 24
24
25
25
.copy-status {
26
26
position : relative;
27
- top : -2 rem ;
28
- left : -1 rem ;
27
+ top : -0.3 rem ;
28
+ left : -4 rem ;
29
29
font-size : 0.75rem ;
30
30
font-weight : 700 ;
31
31
font-family : Arial;
32
32
color : var (--ifm-color-primary );
33
+ z-index : 1 ;
33
34
}
34
35
35
36
.container-standalone {
36
37
display : flex;
37
38
flex-direction : row-reverse;
38
39
width : 100% ;
40
+ height : 100vh ;
41
+ }
42
+
43
+ .container-standalone playground-file-editor {
39
44
height : 100% ;
40
45
}
41
46
Original file line number Diff line number Diff line change
1
+ import Editor from "../components/Editor" ;
2
+ import Layout from '@theme/Layout' ;
3
+
4
+ const html = `<!-- playground-fold -->
5
+ <!DOCTYPE html>
6
+ <head>
7
+ </head>
8
+
9
+ <body style="background-color: var(--sapBackgroundColor)">
10
+ <!-- playground-fold-end -->
11
+
12
+ <my-element>
13
+ <h1>UI5 Web Components</h1>
14
+ </my-element>
15
+ <!-- playground-fold -->
16
+ <script type="module" src="main.js"></script>
17
+ </body>
18
+
19
+ <!-- playground-fold-end -->
20
+ `
21
+
22
+ const ts = `
23
+ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
24
+ import litRender, { html } from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
25
+ import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
26
+ import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
27
+ import property from "@ui5/webcomponents-base/dist/decorators/property.js";
28
+
29
+ @customElement({
30
+ tag: "my-element",
31
+ renderer: litRender,
32
+ })
33
+ export class MyElement extends UI5Element {
34
+ @property({ type: Integer, defaultValue: 0})
35
+ count!: number;
36
+
37
+ render() {
38
+ return html \`
39
+ <slot></slot>
40
+ <div class="card">
41
+ <button @click=\${this._onClick} part="button">
42
+ Count is \${this.count}
43
+ </button>
44
+ </div>\`
45
+ }
46
+
47
+ _onClick() {
48
+ this.count += 2;
49
+ }
50
+ }
51
+
52
+ MyElement.define();
53
+ ` ;
54
+ export default function ( ) {
55
+ return (
56
+ < >
57
+ < Layout >
58
+
59
+ < Editor
60
+ html = { html }
61
+ js = { ts }
62
+ css = { '' }
63
+ mainFile = { "main.ts" }
64
+ canShare = { true }
65
+ mainFileSelected = { true }
66
+ standalone = { true }
67
+ />
68
+ </ Layout >
69
+ </ >
70
+ )
71
+ }
You can’t perform that action at this time.
0 commit comments