Skip to content

Commit acf8104

Browse files
authored
add actions (#3)
1 parent 1398faa commit acf8104

File tree

5 files changed

+90
-2
lines changed

5 files changed

+90
-2
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
- run: |
17+
npm install
18+
npm run build

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</head>
99
<body>
1010
<div id="horizon" class="table">
11-
<div id="container1" class="container">Dropdown, Revert</div>
11+
<div id="container1" class="container">Todo: Dropdown, Revert</div>
1212

1313
<div id="gutter1" class="gutter"></div>
1414

src/abap.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// this is a temporary hack, it needs to update whenever the demos repo update
2+
3+
export const zif_excel_demo_output = `INTERFACE zif_excel_demo_output PUBLIC.
4+
CLASS-METHODS run
5+
RETURNING
6+
VALUE(ro_excel) TYPE REF TO zcl_excel
7+
RAISING
8+
zcx_excel.
9+
ENDINTERFACE.`;
10+
11+
export const zcl_excel_demo1 = `CLASS zcl_excel_demo1 DEFINITION PUBLIC.
12+
PUBLIC SECTION.
13+
INTERFACES zif_excel_demo_output.
14+
ENDCLASS.
15+
16+
CLASS zcl_excel_demo1 IMPLEMENTATION.
17+
18+
METHOD zif_excel_demo_output~run.
19+
20+
DATA: lo_worksheet TYPE REF TO zcl_excel_worksheet,
21+
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
22+
lo_column TYPE REF TO zcl_excel_column,
23+
lv_date TYPE d,
24+
lv_time TYPE t.
25+
26+
CREATE OBJECT ro_excel.
27+
28+
" Get active sheet
29+
lo_worksheet = ro_excel->get_active_worksheet( ).
30+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ).
31+
lv_date = '20211231'.
32+
lv_time = '055817'.
33+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = lv_date ).
34+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = lv_time ).
35+
lo_hyperlink = zcl_excel_hyperlink=>create_external_link( iv_url = 'https://abap2xlsx.github.io/abap2xlsx' ).
36+
lo_worksheet->set_cell( ip_columnrow = 'B4' ip_value = 'Click here to visit abap2xlsx homepage' ip_hyperlink = lo_hyperlink ).
37+
38+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 6 ip_value = '你好,世界' ).
39+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 6 ip_value = '(Chinese)' ).
40+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 7 ip_value = 'नमस्ते दुनिया' ).
41+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 7 ip_value = '(Hindi)' ).
42+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Hola Mundo' ).
43+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 8 ip_value = '(Spanish)' ).
44+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 9 ip_value = 'مرحبا بالعالم' ).
45+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 9 ip_value = '(Arabic)' ).
46+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 10 ip_value = 'ওহে বিশ্ব ' ).
47+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 10 ip_value = '(Bengali)' ).
48+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 11 ip_value = 'Bonjour le monde' ).
49+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 11 ip_value = '(French)' ).
50+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 12 ip_value = 'Olá Mundo' ).
51+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 12 ip_value = '(Portuguese)' ).
52+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 13 ip_value = 'Привет, мир' ).
53+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 13 ip_value = '(Russian)' ).
54+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 14 ip_value = 'ہیلو دنیا' ).
55+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 14 ip_value = '(Urdu)' ).
56+
lo_worksheet->set_cell( ip_column = 'B' ip_row = 15 ip_value = '👋🌎, 👋🌍, 👋🌏' ).
57+
lo_worksheet->set_cell( ip_column = 'C' ip_row = 15 ip_value = '(Emoji waving hand + 3 parts of the world)' ).
58+
59+
lo_column = lo_worksheet->get_column( ip_column = 'B' ).
60+
lo_column->set_width( ip_width = 11 ).
61+
ENDMETHOD.
62+
63+
ENDCLASS.`;

src/index.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,10 @@ body, html, .inner, .outer {
3737

3838
select {
3939
width: 100%;
40+
}
41+
42+
iframe {
43+
display: block;
44+
width: 100%;
45+
height: 100%;
4046
}

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ import {ABAP, MemoryConsole} from "@abaplint/runtime";
2121
import * as abaplint from "@abaplint/core";
2222
import * as abapMonaco from "@abaplint/monaco";
2323
import Split from "split-grid";
24+
import { zcl_excel_demo1 } from "./abap";
2425

2526
const reg = new abaplint.Registry(new abaplint.Config(JSON.stringify(config)));
2627
abapMonaco.registerABAP(reg);
2728

2829
const filename = "file:///zcl_demo.clas.abap";
2930
const model1 = monaco.editor.createModel(
30-
"WRITE 'hello'.",
31+
zcl_excel_demo1,
3132
"abap",
3233
monaco.Uri.parse(filename),
3334
);

0 commit comments

Comments
 (0)