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

@ -1,85 +1,91 @@
CLASS z2ui5_cl_cc_driver_js DEFINITION CLASS z2ui5_cl_cc_driver_js DEFINITION
PUBLIC PUBLIC
FINAL FINAL
CREATE PUBLIC . CREATE PUBLIC .
PUBLIC SECTION. PUBLIC SECTION.
TYPES: TYPES showbuttons_array TYPE STANDARD TABLE OF int4 WITH NON-UNIQUE KEY table_line.
BEGIN OF ty_config_steps_popover, TYPES disablebuttons_array TYPE STANDARD TABLE OF int4 WITH NON-UNIQUE KEY table_line.
title TYPE string,
description TYPE string, TYPES:
side TYPE string, BEGIN OF ty_config_steps_popover,
align TYPE string, title TYPE string,
showbuttons TYPE string, description TYPE string,
disablebuttons TYPE string, side TYPE string,
nextbtntext TYPE string, align TYPE string,
prevbtntext TYPE string, show_buttons TYPE showbuttons_array,
donebtntext TYPE string, disable_buttons TYPE disablebuttons_array,
showprogress TYPE abap_bool, next_btn_text TYPE string,
progresstext TYPE string, prev_btn_text TYPE string,
popoverclass TYPE string, done_btn_text TYPE string,
END OF ty_config_steps_popover . show_progress TYPE abap_bool,
TYPES: progress_text TYPE string,
BEGIN OF ty_config_steps, popover_class TYPE string,
element TYPE string, END OF ty_config_steps_popover .
popover TYPE ty_config_steps_popover, TYPES:
END OF ty_config_steps . BEGIN OF ty_config_steps,
TYPES: element TYPE string,
BEGIN OF ty_config, elementview TYPE string,
steps TYPE ty_config_steps, popover TYPE ty_config_steps_popover,
animate TYPE abap_bool, END OF ty_config_steps .
overlaycolor TYPE string,
smoothscroll TYPE abap_bool, TYPES ty_config_steps_tt TYPE STANDARD TABLE OF ty_config_steps WITH DEFAULT KEY.
allowclose TYPE abap_bool,
overlayopacity TYPE i, TYPES:
stagepadding TYPE i, BEGIN OF ty_config,
stageradius TYPE i, steps TYPE ty_config_steps_tt,
allowkeyboardcontrol TYPE abap_bool, animate TYPE abap_bool,
disableactiveinteraction TYPE abap_bool, overlay_color TYPE string,
popoverclass TYPE string, smooths_croll TYPE abap_bool,
popoveroffset TYPE i, allow_close TYPE abap_bool,
showbuttons TYPE string, overlay_opacity TYPE i,
disablebuttons TYPE string, stage_padding TYPE i,
showprogress TYPE abap_bool, stage_radius TYPE i,
progresstext TYPE string, allow_keyboard_control TYPE abap_bool,
nextbtntext TYPE string, disable_active_interaction TYPE abap_bool,
prevbtntext TYPE string, popover_class TYPE string,
donebtntext TYPE string, popover_offset TYPE i,
END OF ty_config . 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 .
DATA mo_view TYPE REF TO z2ui5_cl_xml_view . DATA mo_view TYPE REF TO z2ui5_cl_xml_view .
METHODS constructor METHODS constructor
IMPORTING IMPORTING
!view TYPE REF TO z2ui5_cl_xml_view . !view TYPE REF TO z2ui5_cl_xml_view .
METHODS load_lib METHODS load_lib
IMPORTING IMPORTING
!js_url TYPE clike OPTIONAL !js_url TYPE clike OPTIONAL
!css_url TYPE clike OPTIONAL !css_url TYPE clike OPTIONAL
!local_css TYPE abap_bool OPTIONAL !local_css TYPE abap_bool OPTIONAL
!local_js TYPE abap_bool OPTIONAL !local_js TYPE abap_bool OPTIONAL
RETURNING RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view . VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
METHODS set_drive_config METHODS set_drive_config
IMPORTING IMPORTING
!config TYPE ty_config !config TYPE ty_config
RETURNING 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 CLASS-METHODS get_css_local
RETURNING RETURNING
VALUE(result) TYPE string . VALUE(result) TYPE string .
CLASS-METHODS get_js_local CLASS-METHODS get_js_local
RETURNING RETURNING
VALUE(result) TYPE string . VALUE(result) TYPE string .
PROTECTED SECTION.
PROTECTED SECTION. PRIVATE SECTION.
PRIVATE SECTION.
ENDCLASS. ENDCLASS.
@ -88,54 +94,54 @@ ENDCLASS.
CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION. CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
METHOD constructor. METHOD constructor.
me->mo_view = view. me->mo_view = view.
ENDMETHOD. ENDMETHOD.
METHOD get_css_local. METHOD get_css_local.
result = `` && |\n| && result = `` && |\n| &&
`.driver-active .driver-overlay,.driver-active *{pointer-events:none}.driver-active .driver-active-element,.driver-active .driver-active-element *,.driver-popover,.driver-popover *{pointer-events:auto}` && `.driver-active .driver-overlay,.driver-active *{pointer-events:none}.driver-active .driver-active-element,.driver-active .driver-active-element *,.driver-popover,.driver-popover *{pointer-events:auto}` &&
`@keyframes animate-fade-in{0%{opacity:0}to{opacity:1}}.driver-fade .driver-overlay{animation:animate-fade-in .2s ease-in-out}` && `@keyframes animate-fade-in{0%{opacity:0}to{opacity:1}}.driver-fade .driver-overlay{animation:animate-fade-in .2s ease-in-out}` &&
`.driver-fade .driver-popover{animation:animate-fade-in .2s}` && `.driver-fade .driver-popover{animation:animate-fade-in .2s}` &&
`.driver-popover{all:unset;box-sizing:border-box;color:#2d2d2d;margin:0;padding:15px;border-radius:5px;min-width:250px;max-width:300px;box-shadow:0 1px 10px #0006;z-index:1000000000;position:fixed;top:0;right:0;background-color:#fff}` && `.driver-popover{all:unset;box-sizing:border-box;color:#2d2d2d;margin:0;padding:15px;border-radius:5px;min-width:250px;max-width:300px;box-shadow:0 1px 10px #0006;z-index:1000000000;position:fixed;top:0;right:0;background-color:#fff}` &&
`.driver-popover *{font-family:Helvetica Neue,Inter,ui-sans-serif,"Apple Color Emoji",Helvetica,Arial,sans-serif}.driver-popover-title{font:19px/normal sans-serif;font-weight:700;display:block;position:relative;line-height:1.5;zoom:1;margin:0}` && `.driver-popover *{font-family:Helvetica Neue,Inter,ui-sans-serif,"Apple Color Emoji",Helvetica,Arial,sans-serif}.driver-popover-title{font:19px/normal sans-serif;font-weight:700;display:block;position:relative;line-height:1.5;zoom:1;margin:0}` &&
`.driver-popover-close-btn{all:unset;position:absolute;top:0;right:0;width:32px;height:28px;cursor:pointer;font-size:18px;font-weight:500;color:#d2d2d2;z-index:1;text-align:center;transition:color;transition-duration:.2s}` && `.driver-popover-close-btn{all:unset;position:absolute;top:0;right:0;width:32px;height:28px;cursor:pointer;font-size:18px;font-weight:500;color:#d2d2d2;z-index:1;text-align:center;transition:color;transition-duration:.2s}` &&
`.driver-popover-close-btn:hover,.driver-popover-close-btn:focus{color:#2d2d2d}` && `.driver-popover-close-btn:hover,.driver-popover-close-btn:focus{color:#2d2d2d}` &&
`.driver-popover-title[style*=block]+.driver-popover-description{margin-top:5px}.driver-popover-description{margin-bottom:0;font:14px/normal sans-serif;line-height:1.5;font-weight:400;zoom:1}` && `.driver-popover-title[style*=block]+.driver-popover-description{margin-top:5px}.driver-popover-description{margin-bottom:0;font:14px/normal sans-serif;line-height:1.5;font-weight:400;zoom:1}` &&
`.driver-popover-footer{margin-top:15px;text-align:right;zoom:1;display:flex;align-items:center;justify-content:space-between}.driver-popover-progress-text{font-size:13px;font-weight:400;color:#727272;zoom:1}` && `.driver-popover-footer{margin-top:15px;text-align:right;zoom:1;display:flex;align-items:center;justify-content:space-between}.driver-popover-progress-text{font-size:13px;font-weight:400;color:#727272;zoom:1}` &&
`.driver-popover-footer button{all:unset;display:inline-block;box-sizing:border-box;padding:3px 7px;text-decoration:none;text-shadow:1px 1px 0 #fff;background-color:#fff;color:#2d2d2d;font:12px/normal sans-serif;` && `.driver-popover-footer button{all:unset;display:inline-block;box-sizing:border-box;padding:3px 7px;text-decoration:none;text-shadow:1px 1px 0 #fff;background-color:#fff;color:#2d2d2d;font:12px/normal sans-serif;` &&
` cursor:pointer;outline:0;zoom:1;line-height:1.3;border:1px solid #ccc;border-radius:3px}` && ` cursor:pointer;outline:0;zoom:1;line-height:1.3;border:1px solid #ccc;border-radius:3px}` &&
`.driver-popover-footer .driver-popover-btn-disabled{opacity:.5;pointer-events:none}:not(body):has(>.driver-active-element){overflow:hidden!important}` && `.driver-popover-footer .driver-popover-btn-disabled{opacity:.5;pointer-events:none}:not(body):has(>.driver-active-element){overflow:hidden!important}` &&
`.driver-no-interaction,.driver-no-interaction *{pointer-events:none!important}.driver-popover-footer button:hover,` && `.driver-no-interaction,.driver-no-interaction *{pointer-events:none!important}.driver-popover-footer button:hover,` &&
`.driver-popover-footer button:focus{background-color:#f7f7f7}.driver-popover-navigation-btns{display:flex;flex-grow:1;justify-content:flex-end}.driver-popover-navigation-btns button+button{margin-left:4px}` && `.driver-popover-footer button:focus{background-color:#f7f7f7}.driver-popover-navigation-btns{display:flex;flex-grow:1;justify-content:flex-end}.driver-popover-navigation-btns button+button{margin-left:4px}` &&
`.driver-popover-arrow{content:"";position:absolute;border:5px solid #fff}.driver-popover-arrow-side-over{display:none}` && `.driver-popover-arrow{content:"";position:absolute;border:5px solid #fff}.driver-popover-arrow-side-over{display:none}` &&
`.driver-popover-arrow-side-left{left:100%;border-right-color:transparent;border-bottom-color:transparent;border-top-color:transparent}` && `.driver-popover-arrow-side-left{left:100%;border-right-color:transparent;border-bottom-color:transparent;border-top-color:transparent}` &&
`.driver-popover-arrow-side-right{right:100%;border-left-color:transparent;border-bottom-color:transparent;border-top-color:transparent}` && `.driver-popover-arrow-side-right{right:100%;border-left-color:transparent;border-bottom-color:transparent;border-top-color:transparent}` &&
`.driver-popover-arrow-side-top{top:100%;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}` && `.driver-popover-arrow-side-top{top:100%;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}` &&
`.driver-popover-arrow-side-bottom{bottom:100%;border-left-color:transparent;border-top-color:transparent;border-right-color:transparent}` && `.driver-popover-arrow-side-bottom{bottom:100%;border-left-color:transparent;border-top-color:transparent;border-right-color:transparent}` &&
`.driver-popover-arrow-side-center{display:none}.driver-popover-arrow-side-left.driver-popover-arrow-align-start,.driver-popover-arrow-side-right.driver-popover-arrow-align-start{top:15px}` && `.driver-popover-arrow-side-center{display:none}.driver-popover-arrow-side-left.driver-popover-arrow-align-start,.driver-popover-arrow-side-right.driver-popover-arrow-align-start{top:15px}` &&
`.driver-popover-arrow-side-top.driver-popover-arrow-align-start,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-start{left:15px}` && `.driver-popover-arrow-side-top.driver-popover-arrow-align-start,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-start{left:15px}` &&
`.driver-popover-arrow-align-end.driver-popover-arrow-side-left,.driver-popover-arrow-align-end.driver-popover-arrow-side-right{bottom:15px}` && `.driver-popover-arrow-align-end.driver-popover-arrow-side-left,.driver-popover-arrow-align-end.driver-popover-arrow-side-right{bottom:15px}` &&
`.driver-popover-arrow-side-top.driver-popover-arrow-align-end,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-end{right:15px}` && `.driver-popover-arrow-side-top.driver-popover-arrow-align-end,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-end{right:15px}` &&
`.driver-popover-arrow-side-left.driver-popover-arrow-align-center,.driver-popover-arrow-side-right.driver-popover-arrow-align-center{top:50%;margin-top:-5px}` && `.driver-popover-arrow-side-left.driver-popover-arrow-align-center,.driver-popover-arrow-side-right.driver-popover-arrow-align-center{top:50%;margin-top:-5px}` &&
`.driver-popover-arrow-side-top.driver-popover-arrow-align-center,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-center{left:50%;margin-left:-5px}.driver-popover-arrow-none{display:none}`. `.driver-popover-arrow-side-top.driver-popover-arrow-align-center,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-center{left:50%;margin-left:-5px}.driver-popover-arrow-none{display:none}`.
ENDMETHOD. ENDMETHOD.
METHOD get_js_local. METHOD get_js_local.
result = `debugger;` && |\n| && result = `debugger;` && |\n| &&
`this.driver=this.driver||{};this.driver.js=function(D){&quot;use strict&quot;;let F={};function z(e={}){F={animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,` && `this.driver=this.driver||{};this.driver.js=function(D){&quot;use strict&quot;;let F={};function z(e={}){F={animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,` &&
`popoverOffset:10,showButtons:[&quot;next&quot;,&quot;previous&quot;,&quot;close&quot;],disableButtons:[],overlayColor:&quot;#000&quot;,...e}}function a(e){return e?F[e]:F}function W(e,o,t,i){return(e/=i/2)&lt;1?t/2*e*e+o:-t/2*(--e*(e-2)-1)+o}` && `popoverOffset:10,showButtons:[&quot;next&quot;,&quot;previous&quot;,&quot;close&quot;],disableButtons:[],overlayColor:&quot;#000&quot;,...e}}function a(e){return e?F[e]:F}function W(e,o,t,i){return(e/=i/2)&lt;1?t/2*e*e+o:-t/2*(--e*(e-2)-1)+o}` &&
`function q(` && `function q(` &&
`e){const o=&#39;a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=&quot;text&quot;]:not([disabled]), input[type=&quot;radio&quot;]:not([disabled]), input[type=&quot;checkbox&quot;]:not([disabled]), select:not(` && `e){const o=&#39;a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=&quot;text&quot;]:not([disabled]), input[type=&quot;radio&quot;]:not([disabled]), input[type=&quot;checkbox&quot;]:not([disabled]), select:not(` &&
`[disabled])&#39;;return e.flatMap(t=&gt;{const i=t.matches(o),p=Array.from(t.querySelectorAll(o));return[...i?[t]:[],...p]}).filter(t=&gt;getComputedStyle(t).pointerEvents!==&quot;none&quot;&amp;&amp;ae(t))}function V(e){if(!e||se(e))return;` && `[disabled])&#39;;return e.flatMap(t=&gt;{const i=t.matches(o),p=Array.from(t.querySelectorAll(o));return[...i?[t]:[],...p]}).filter(t=&gt;getComputedStyle(t).pointerEvents!==&quot;none&quot;&amp;&amp;ae(t))}function V(e){if(!e||se(e))return;` &&
`const o=a(` && `const o=a(` &&
`&quot;smoothScroll&quot;);e.scrollIntoView({behavior:!o||re(e)?&quot;auto&quot;:&quot;smooth&quot;,inline:&quot;center&quot;,block:&quot;center&quot;})}function re(e){if(!e||!e.parentElement)return;const o=e.parentElement;return ` && `&quot;smoothScroll&quot;);e.scrollIntoView({behavior:!o||re(e)?&quot;auto&quot;:&quot;smooth&quot;,inline:&quot;center&quot;,block:&quot;center&quot;})}function re(e){if(!e||!e.parentElement)return;const o=e.parentElement;return ` &&
`o.scrollHeight&gt;o.clientHeight}function se(e){const o=e.getBoundingClientRect();return o.top&gt;=0&amp;&amp;o.left&gt;=0&amp;&amp;o.bottom&lt;=(window.innerHeight||document.documentElement.clientHeight)&amp;&amp;o.right&lt;=(` && `o.scrollHeight&gt;o.clientHeight}function se(e){const o=e.getBoundingClientRect();return o.top&gt;=0&amp;&amp;o.left&gt;=0&amp;&amp;o.bottom&lt;=(window.innerHeight||document.documentElement.clientHeight)&amp;&amp;o.right&lt;=(` &&
`window.innerWidth||document.documentElement.clientWidth)}function ae(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let N={};function b(e,o){N[e]=o}function l(e){return e?N[e]:N}function K(){N={}}let E={};function O(e,o)` && `window.innerWidth||document.documentElement.clientWidth)}function ae(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let N={};function b(e,o){N[e]=o}function l(e){return e?N[e]:N}function K(){N={}}let E={};function O(e,o)` &&
`{E[e]=o}function _(e){var o;(o=E[e])==null||o.call(E)}function ce(){E={}}function le(e,o,t,i){let p=l(&quot;__activeStagePosition&quot;);const n=p||t.getBoundingClientRect(),f=i.getBoundingClientRect(),w=W(e,n.x,f.x-n.x,o),r=W(e,n.y,f.y-n.y,o),v=W(e,` && `{E[e]=o}function _(e){var o;(o=E[e])==null||o.call(E)}function ce(){E={}}function le(e,o,t,i){let p=l(&quot;__activeStagePosition&quot;);const n=p||t.getBoundingClientRect(),f=i.getBoundingClientRect(),w=W(e,n.x,f.x-n.x,o),r=W(e,n.y,f.y-n.y,o),v=W(e,` &&
`n.width,f.width-n.width,o),s=W(e,n.height,f.height-n.height,o);p={x:w,y:r,width:v,height:s},Y(p),b(&quot;__activeStagePosition&quot;,p)}function X(e){if(!e)return;const o=e.getBoundingClientRect(),t={x:o.x,y:o.y,width:o.width,height:o.height};b(` && `n.width,f.width-n.width,o),s=W(e,n.height,f.height-n.height,o);p={x:w,y:r,width:v,height:s},Y(p),b(&quot;__activeStagePosition&quot;,p)}function X(e){if(!e)return;const o=e.getBoundingClientRect(),t={x:o.x,y:o.y,width:o.width,height:o.height};b(` &&
`&quot;__activeStagePosition&quot;,t),Y(t)}function de(){const e=l(&quot;__activeStagePosition&quot;),o=l(&quot;__overlaySvg&quot;);if(!e)return;if(!o){console.warn(&quot;No stage svg found.&quot;);return}const t=window.innerWidth,` && `&quot;__activeStagePosition&quot;,t),Y(t)}function de(){const e=l(&quot;__activeStagePosition&quot;),o=l(&quot;__overlaySvg&quot;);if(!e)return;if(!o){console.warn(&quot;No stage svg found.&quot;);return}const t=window.innerWidth,` &&
@ -257,55 +263,84 @@ CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
`D.driver=ke,Object.defineProperty(` && `D.driver=ke,Object.defineProperty(` &&
`D,Symbol.toStringTag,{value:&quot;Module&quot;}),D}({});`. `D,Symbol.toStringTag,{value:&quot;Module&quot;}),D}({});`.
ENDMETHOD. ENDMETHOD.
METHOD load_lib. METHOD load_lib.
DATA(js) = ``. DATA(js) = ``.
DATA(css) = ``. DATA(css) = ``.
IF css_url IS INITIAL. IF css_url IS INITIAL.
IF local_css = abap_true. IF local_css = abap_true.
css = css && `<html:style>` && get_css_local( ) && `</html:style>` && |\n|. css = css && `<html:style>` && get_css_local( ) && `</html:style>` && |\n|.
ENDIF.
ELSE.
css = css && `<html:style>` && css_url && `</html:style>` && |\n|.
ENDIF. ENDIF.
ELSE.
css = css && `<html:style>` && css_url && `</html:style>` && |\n|.
ENDIF.
IF js_url IS INITIAL. IF js_url IS INITIAL.
IF local_js = abap_true. IF local_js = abap_true.
js = js && `<html:script>` && get_js_local( ) && `</html:script>` && |\n|. js = js && `<html:script>` && get_js_local( ) && `</html:script>` && |\n|.
ENDIF.
ELSE.
js = js && `<html:script src="` && js_url && `" ></html:script>` && |\n|.
ENDIF. ENDIF.
ELSE.
js = js && `<html:script src="` && js_url && `" ></html:script>` && |\n|.
ENDIF.
DATA(final) = js && |\n| && css ##NEEDED. DATA(final) = js && |\n| && css ##NEEDED.
result = mo_view->_cc_plain_xml( js )->get_parent( )->_cc_plain_xml( css ). result = mo_view->_cc_plain_xml( js )->get_parent( )->_cc_plain_xml( css ).
ENDMETHOD. ENDMETHOD.
METHOD set_drive_config. 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;`. lt_config = config.
drive_js = drive_js && LOOP AT lt_config-steps ASSIGNING FIELD-SYMBOL(<fs_step>).
`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| &&
`});`.
result = mo_view->_cc_plain_xml( `<html:script>` && drive_js && `</html:script>` ). CASE <fs_step>-element(1).
* result = drive_js. WHEN `#`.
WHEN `.`.
ENDCASE.
ENDMETHOD. 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>` ).
ENDMETHOD.
ENDCLASS. ENDCLASS.

View File

@ -2961,6 +2961,19 @@ CLASS Z2UI5_CL_XML_VIEW IMPLEMENTATION.
ENDMETHOD. 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. METHOD bars.
result = _generic( name = `bars` result = _generic( name = `bars`
ns = `mchart` ). ns = `mchart` ).
@ -3507,18 +3520,6 @@ CLASS Z2UI5_CL_XML_VIEW IMPLEMENTATION.
ENDMETHOD. 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. METHOD end_column_pages.
" todo, implement method " todo, implement method
result = me. result = me.