Skip to content

Commit

Permalink
update webc renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
oblomov-dev committed Feb 29, 2024
1 parent db14306 commit 127cf90
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 246 deletions.
61 changes: 30 additions & 31 deletions src/z2ui5_cl_demo_app_013.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -26,89 +26,88 @@ CLASS z2ui5_cl_demo_app_013 IMPLEMENTATION.

METHOD render_tab_donut.

DATA(container) = z2ui5_cl_ui5=>_factory( )->_ns_m(
DATA(container) = z2ui5_cl_xml_view=>factory(
)->shell(
)->page(
title = 'abap2UI5 - Visualization'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = abap_true
)->headercontent(
)->header_content(
)->link( text = 'Demo' target = '_blank' href = `https://twitter.com/abap2UI5/status/1639191954285113344`
)->link( text = 'Source_Code' target = '_blank' href = z2ui5_cl_demo_utility=>factory( client )->app_get_url_source_code( )
)->_go_up( )->_ns_ui(
)->tabcontainer( ).
)->get_parent(
)->tab_container( ).

DATA(grid) = container->tab(
text = 'Donut Chart'
selected = client->_bind( mv_tab_donut_active )
)->grid( 'XL6 L6 M6 S12' ).

grid->_ns_m( )->link(
grid->link(
text = 'Go to the SAP Demos for Interactive Donut Charts here...' target = '_blank'
href = 'https://sapui5.hana.ondemand.com/#/entity/sap.suite.ui.microchart.InteractiveDonutChart/sample/sap.suite.ui.microchart.sample.InteractiveDonutChart'
)->text(
text = 'Three segments'
class = 'sapUiSmallMargin'
)->_go_new( )->_ns_m( )->layoutdata( )->_ns_ui(
)->griddata( 'XL12 L12 M12 S12' ).
)->get( )->layout_data(
)->grid_data( 'XL12 L12 M12 S12' ).


DATA(seg) = grid->_ns_m( )->flexbox(
DATA(seg) = grid->flex_box(
width = '22rem'
height = '13rem'
alignitems = 'Start'
justifycontent = 'SpaceBetween'
)->items(
)->_ns_suite( )->interactdonutchart(
)->items( )->interact_donut_chart(
selectionchanged = client->_event( 'DONUT_CHANGED' )
)->segments( ).
seg->interactdonutchartsegment( selected = client->_bind( mv_sel4 ) label = 'Impl. Phase' value = '40.0' displayedvalue = '40.0%' ).
seg->interactdonutchartsegment( selected = client->_bind( mv_sel5 ) label = 'Design Phase' value = '21.5' displayedvalue = '21.5%' ).
seg->interactdonutchartsegment( selected = client->_bind( mv_sel6 ) label = 'Test Phase' value = '38.5' displayedvalue = '38.5%' ).
seg->interact_donut_chart_segment( selected = client->_bind( mv_sel4 ) label = 'Impl. Phase' value = '40.0' displayedvalue = '40.0%' ).
seg->interact_donut_chart_segment( selected = client->_bind( mv_sel5 ) label = 'Design Phase' value = '21.5' displayedvalue = '21.5%' ).
seg->interact_donut_chart_segment( selected = client->_bind( mv_sel6 ) label = 'Test Phase' value = '38.5' displayedvalue = '38.5%' ).

grid->_ns_m( )->text(
grid->text(
text = 'Four segments'
class = 'sapUiSmallMargin'
)->_go_new( )->_ns_m( )->layoutdata( )->_ns_ui(
)->griddata( 'XL12 L12 M12 S12' ).
)->get( )->layout_data(
)->grid_data( 'XL12 L12 M12 S12' ).

seg = grid->_ns_m( )->flexbox(
seg = grid->flex_box(
width = '22rem'
height = '13rem'
alignitems = 'Start'
justifycontent = 'SpaceBetween'
)->items( )->_ns_suite( )->interactdonutchart(
)->items( )->interact_donut_chart(
selectionchanged = client->_event( 'DONUT_CHANGED' )
press = client->_event( 'DONUT_PRESS' )
displayedsegments = '4'
)->segments( ).
seg->interactdonutchartsegment( label = 'Design Phase' value = '32.0' displayedvalue = '32.0%' ).
seg->interactdonutchartsegment( label = 'Implementation Phase' value = '28' displayedvalue = '28%' ).
seg->interactdonutchartsegment( label = 'Test Phase' value = '25' displayedvalue = '25%' ).
seg->interactdonutchartsegment( label = 'Launch Phase' value = '15' displayedvalue = '15%' ).
seg->interact_donut_chart_segment( label = 'Design Phase' value = '32.0' displayedvalue = '32.0%' ).
seg->interact_donut_chart_segment( label = 'Implementation Phase' value = '28' displayedvalue = '28%' ).
seg->interact_donut_chart_segment( label = 'Test Phase' value = '25' displayedvalue = '25%' ).
seg->interact_donut_chart_segment( label = 'Launch Phase' value = '15' displayedvalue = '15%' ).

grid->_ns_m( )->text(
grid->text(
text = 'Error Messages'
class = 'sapUiSmallMargin'
)->_go_new( )->_ns_m( )->layoutdata( )->_ns_ui(
)->griddata( 'XL12 L12 M12 S12' ).
)->get( )->layout_data(
)->grid_data( 'XL12 L12 M12 S12' ).

seg = grid->_ns_m( )->flexbox(
seg = grid->flex_box(
width = '22rem'
height = '13rem'
alignitems = 'Start'
justifycontent = 'SpaceBetween'
)->items( )->_ns_suite( )->interactdonutchart(
)->items( )->interact_donut_chart(
selectionchanged = client->_event( 'DONUT_CHANGED' )
showerror = abap_true
errormessagetitle = 'No data'
errormessage = 'Currently no data is available'
)->segments( ).
seg->interactdonutchartsegment( label = 'Implementation Phase' value = '40.0' displayedvalue = '40.0%' ).
seg->interactdonutchartsegment( label = 'Design Phase' value = '21.5' displayedvalue = '21.5%' ).
seg->interactdonutchartsegment( label = 'Test Phase' value = '38.5' displayedvalue = '38.5%' ).
seg->interact_donut_chart_segment( label = 'Implementation Phase' value = '40.0' displayedvalue = '40.0%' ).
seg->interact_donut_chart_segment( label = 'Design Phase' value = '21.5' displayedvalue = '21.5%' ).
seg->interact_donut_chart_segment( label = 'Test Phase' value = '38.5' displayedvalue = '38.5%' ).

client->view_display( container->_stringify( ) ).
client->view_display( container->stringify( ) ).

ENDMETHOD.

Expand Down
12 changes: 6 additions & 6 deletions src/z2ui5_cl_demo_app_023.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,19 @@ CLASS z2ui5_cl_demo_app_023 IMPLEMENTATION.

WHEN 'NORMAL'.

DATA(lv_view_normal_xml) = z2ui5_cl_ui5=>_factory( )->_ns_m(
DATA(lv_view_normal_xml) = z2ui5_cl_xml_view=>factory(
)->page(
title = 'abap2UI5 - NORMAL NORMAL NORMAL'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->headercontent(
)->header_content(
)->link(
text = 'Source_Code'
href = z2ui5_cl_demo_utility=>factory( client )->app_get_url_source_code( )
target = '_blank'
)->_go_up( )->_ns_ui(
)->simpleform( 'Form Title'
)->content( )->_ns_m(
)->get_parent(
)->simple_form( 'Form Title'
)->content( `form`
)->title( 'Input'
)->label( 'quantity'
)->input( client->_bind( quantity )
Expand All @@ -142,7 +142,7 @@ CLASS z2ui5_cl_demo_app_023 IMPLEMENTATION.
)->button(
text = 'XML'
press = client->_event( 'XML' )
)->_stringify( ).
)->stringify( ).

client->view_display( lv_view_normal_xml ).

Expand Down
36 changes: 14 additions & 22 deletions src/z2ui5_cl_demo_app_035.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,14 @@ ENDCLASS.
CLASS z2ui5_cl_demo_app_035 IMPLEMENTATION.
METHOD view_display.

DATA(view) = z2ui5_cl_ui5=>_factory( )->_ns_m( ).
DATA(view) = z2ui5_cl_xml_view=>factory( ).

DATA(page) = view->shell( )->page( title = 'abap2UI5 - File Editor'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->headercontent(
)->link( text = 'Demo' target = '_blank' href = 'https://twitter.com/abap2UI5/status/1631562906570575875'
)->link( text = 'Source_Code' target = '_blank' href = z2ui5_cl_demo_utility=>factory( client )->app_get_url_source_code( )
)->_go_up( ).
).

DATA(grid) = page->_ns_ui( )->grid( 'L7 M12 S12' )->content( `sap.ui.layout` ).

data(temp) = grid->simpleform( title = 'File' editable = abap_true )->content( )->_ns_m(
data(temp) = page->simple_form( title = 'File' editable = abap_true )->content( `form`
)->label( 'path'
)->input( client->_bind_edit( mv_path )
)->label( 'Option' ).
Expand All @@ -45,28 +40,25 @@ CLASS z2ui5_cl_demo_app_035 IMPLEMENTATION.
v = shift_right( shift_left( row ) ) ) ).

data(temp3) = temp->input( value = client->_bind_edit( mv_type )
suggestionitems = client->_bind_local( lt_types ) ).
data(temp2) = temp3->_go_new( ).

temp2->_ns_m(
)->suggestionitems( )->_ns_ui(
)->listitem( text = '{NAME}' additionaltext = '{VALUE}'
)->_go_up( )->_go_up( )->_ns_m(
)->button( text = 'Download'
suggestionitems = client->_bind_local( lt_types )
)->get( ).

temp3->suggestion_items(
)->list_item( text = '{N}' additionaltext = '{V}' ).

temp->label( '' )->button( text = 'Download'
press = client->_event( 'DB_LOAD' )
icon = 'sap-icon://download-from-cloud' ).

grid = page->_ns_ui( )->grid( 'L12 M12 S12' )->content( `sap.ui.layout` ).

page->_ns_ui( )->codeeditor( type = mv_type
page->code_editor( type = mv_type
editable = mv_check_editable
value = client->_bind( mv_editor ) ).

page->_ns_m( )->footer( )->overflowtoolbar(
page->footer( )->overflow_toolbar(
)->button( text = 'Clear'
press = client->_event( 'CLEAR' )
icon = 'sap-icon://delete'
)->toolbarspacer(
)->toolbar_spacer(
)->button( text = 'Edit'
press = client->_event( 'EDIT' )
icon = 'sap-icon://edit'
Expand All @@ -76,7 +68,7 @@ CLASS z2ui5_cl_demo_app_035 IMPLEMENTATION.
icon = 'sap-icon://upload-to-cloud'
enabled = xsdbool( mv_editor IS NOT INITIAL ) ).

client->view_display( page->_stringify( ) ).
client->view_display( page->stringify( ) ).
ENDMETHOD.

METHOD Z2UI5_if_app~main.
Expand Down
16 changes: 8 additions & 8 deletions src/z2ui5_cl_demo_app_124.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,29 @@ CLASS z2ui5_cl_demo_app_124 IMPLEMENTATION.

ENDCASE.

client->view_display( z2ui5_cl_ui5=>_factory( )->_ns_m( )->shell(
client->view_display( z2ui5_cl_xml_view=>factory( )->shell(
)->page(
showheader = xsdbool( abap_false = client->get( )-check_launchpad_active )
title = 'abap2UI5'
navbuttonpress = client->_event( val = 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->headercontent(
)->header_content(
)->link(
text = 'Source_Code'
href = z2ui5_cl_demo_utility=>factory( client )->app_get_url_source_code( )
target = '_blank'
)->_go_up( )->_ns_ui(
)->simpleform( title = 'Information' editable = abap_true
)->content( )->_ns_m(
)->get_parent(
)->simple_form( title = 'Information' editable = abap_true
)->content( 'form'
)->label( 'mv_scan_input'
)->input( client->_bind_edit( mv_scan_input )
)->label( `mv_scan_type`
)->input( client->_bind_edit( mv_scan_type )
)->label( `scanner` )->_ns_ndc(
)->barcodescannerbutton(
)->label( `scanner`
)->barcode_scanner_button(
scansuccess = client->_event( val = 'ON_SCAN_SUCCESS' t_arg = VALUE #( ( `${$parameters>/text}` ) ( `${$parameters>/format}` ) ) )
dialogtitle = `Barcode Scanner`
)->_stringify( ) ).
)->stringify( ) ).

ENDMETHOD.
ENDCLASS.
94 changes: 0 additions & 94 deletions src/z2ui5_cl_demo_app_131.clas.abap

This file was deleted.

16 changes: 0 additions & 16 deletions src/z2ui5_cl_demo_app_131.clas.xml

This file was deleted.

Loading

0 comments on commit 127cf90

Please sign in to comment.