update driverjs (#612)

* update driverjs

* Update src/01/z2ui5_cl_cc_driver_js.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update src/01/z2ui5_cl_cc_driver_js.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update src/01/z2ui5_cl_cc_driver_js.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update src/01/z2ui5_cl_cc_driver_js.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update src/01/z2ui5_cl_cc_driver_js.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update src/01/z2ui5_cl_cc_driver_js.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* abaplint fixes

* fixes for open-abap transpiler

---------

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
Co-authored-by: oblomov <102328295+oblomov-dev@users.noreply.github.com>
This commit is contained in:
choper725 2023-11-01 12:00:54 +02:00 committed by GitHub
parent bd4aeae5d6
commit e4503bba9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 194 additions and 158 deletions

View File

@ -5,47 +5,54 @@ CLASS z2ui5_cl_cc_driver_js DEFINITION
PUBLIC SECTION.
TYPES showbuttons_array TYPE STANDARD TABLE OF int4 WITH NON-UNIQUE KEY table_line.
TYPES disablebuttons_array TYPE STANDARD TABLE OF int4 WITH NON-UNIQUE KEY table_line.
TYPES:
BEGIN OF ty_config_steps_popover,
title TYPE string,
description TYPE string,
side TYPE string,
align TYPE string,
showbuttons TYPE string,
disablebuttons TYPE string,
nextbtntext TYPE string,
prevbtntext TYPE string,
donebtntext TYPE string,
showprogress TYPE abap_bool,
progresstext TYPE string,
popoverclass TYPE string,
show_buttons TYPE showbuttons_array,
disable_buttons TYPE disablebuttons_array,
next_btn_text TYPE string,
prev_btn_text TYPE string,
done_btn_text TYPE string,
show_progress TYPE abap_bool,
progress_text TYPE string,
popover_class TYPE string,
END OF ty_config_steps_popover .
TYPES:
BEGIN OF ty_config_steps,
element TYPE string,
elementview TYPE string,
popover TYPE ty_config_steps_popover,
END OF ty_config_steps .
TYPES ty_config_steps_tt TYPE STANDARD TABLE OF ty_config_steps WITH DEFAULT KEY.
TYPES:
BEGIN OF ty_config,
steps TYPE ty_config_steps,
steps TYPE ty_config_steps_tt,
animate TYPE abap_bool,
overlaycolor TYPE string,
smoothscroll TYPE abap_bool,
allowclose TYPE abap_bool,
overlayopacity TYPE i,
stagepadding TYPE i,
stageradius TYPE i,
allowkeyboardcontrol TYPE abap_bool,
disableactiveinteraction TYPE abap_bool,
popoverclass TYPE string,
popoveroffset TYPE i,
showbuttons TYPE string,
disablebuttons TYPE string,
showprogress TYPE abap_bool,
progresstext TYPE string,
nextbtntext TYPE string,
prevbtntext TYPE string,
donebtntext TYPE string,
overlay_color TYPE string,
smooths_croll TYPE abap_bool,
allow_close TYPE abap_bool,
overlay_opacity TYPE i,
stage_padding TYPE i,
stage_radius TYPE i,
allow_keyboard_control TYPE abap_bool,
disable_active_interaction TYPE abap_bool,
popover_class TYPE string,
popover_offset TYPE i,
show_buttons TYPE string,
disable_buttons TYPE string,
show_progress TYPE abap_bool,
progress_text TYPE string,
next_btn_text TYPE string,
prev_btn_text TYPE string,
done_btn_text TYPE string,
END OF ty_config .
@ -68,7 +75,7 @@ CLASS z2ui5_cl_cc_driver_js DEFINITION
IMPORTING
!config TYPE ty_config
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view ##NEEDED.
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
CLASS-METHODS get_css_local
RETURNING
@ -77,7 +84,6 @@ CLASS z2ui5_cl_cc_driver_js DEFINITION
CLASS-METHODS get_js_local
RETURNING
VALUE(result) TYPE string .
PROTECTED SECTION.
PRIVATE SECTION.
@ -290,22 +296,51 @@ CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
METHOD set_drive_config.
DATA lt_config TYPE ty_config.
DATA(selector) = `` ##NEEDED.
DATA(view) = ``.
DATA(drive_js) = `debugger; const driver = window.driver.js.driver;`.
drive_js = drive_js &&
`const driverObj = driver({` && |\n| &&
* ` showProgress: ` && z2ui5_cl_fw_utility=>boolean_abap_2_json( config-showprogress ) && `,` && |\n| &&
` showProgress: true,` && |\n| &&
` steps: [` && |\n| &&
` { element: '#__xmlview5--choper725', popover: { title: 'Animated Tour Example', description: 'Here is the code example showing animated tour. Let\'s walk you through it.', side: "left", align: 'start' }},` && |\n| &&
` { element: '#__xmlview5--choper725-1', popover: { title: 'Animated Tour Example', description: 'Here is the code example showing animated tour. Let\'s walk you through it.', side: "left", align: 'start' }},` && |\n| &&
` { element: '#__xmlview5--choper725-2', popover: { title: 'Import the Library', description: 'It works the same in vanilla JavaScript as well as frameworks.', side: "bottom", align: 'start' }},` && |\n| &&
` ]` && |\n| &&
`});`.
lt_config = config.
LOOP AT lt_config-steps ASSIGNING FIELD-SYMBOL(<fs_step>).
CASE <fs_step>-element(1).
WHEN `#`.
WHEN `.`.
ENDCASE.
CASE to_upper( <fs_step>-elementview ).
WHEN `NEST`.
view = `oViewNest`.
WHEN `NEST2`.
view = `oViewNest2`.
WHEN `POPOVER`.
view = `oViewPopover`.
WHEN `POPUP`.
view = `oViewPopup`.
WHEN OTHERS.
* DEFAULT AS MAIN VIEW
view = `oView`.
ENDCASE.
CLEAR <fs_step>-elementview.
ENDLOOP.
DATA(lv_config_json) = ``.
lv_config_json = /ui2/cl_json=>serialize(
data = lt_config
compress = abap_true
pretty_name = 'X' ).
DATA(drive_js) = `const driver = window.driver.js.driver;` && |\n|.
drive_js = drive_js && `const driverObj = driver(` && |\n| && lv_config_json && |\n| && `);`.
result = mo_view->_cc_plain_xml( `<html:script>` && drive_js && `</html:script>` ).
* result = drive_js.
ENDMETHOD.
ENDCLASS.

View File

@ -2961,6 +2961,19 @@ CLASS Z2UI5_CL_XML_VIEW IMPLEMENTATION.
ENDMETHOD.
METHOD barcode_scanner_button.
result = _generic( name = `BarcodeScannerButton`
ns = 'ndc'
t_prop = VALUE #(
( n = `id` v = id )
( n = `scanSuccess` v = scanSuccess )
( n = `scanFail` v = scanFail )
( n = `inputLiveUpdate` v = inputLiveUpdate )
( n = `dialogTitle` v = dialogTitle ) ) ).
ENDMETHOD.
METHOD bars.
result = _generic( name = `bars`
ns = `mchart` ).
@ -3507,18 +3520,6 @@ CLASS Z2UI5_CL_XML_VIEW IMPLEMENTATION.
ENDMETHOD.
METHOD barcode_scanner_button.
result = _generic( name = `BarcodeScannerButton`
ns = 'ndc'
t_prop = VALUE #(
( n = `id` v = id )
( n = `scanSuccess` v = scanSuccess )
( n = `scanFail` v = scanFail )
( n = `inputLiveUpdate` v = inputLiveUpdate )
( n = `dialogTitle` v = dialogTitle ) ) ).
ENDMETHOD.
METHOD end_column_pages.
" todo, implement method
result = me.