mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 23:06:30 +08:00
Custom control & view renderer logic (#682)
* custom control logic * project reorga * project orga * Delete src/21/z2ui5_cl_cc_factory.clas.abap * Delete src/21/z2ui5_cl_cc_factory.clas.xml * Update package.devc.xml * Update package.devc.xml * Update package.devc.xml * Update package.devc.xml * Update package.devc.xml * Update package.devc.xml * update custom controls * abaplint fixes * abaplint fix
This commit is contained in:
parent
387405dd8a
commit
77201b6aa2
|
@ -3,7 +3,7 @@
|
|||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<DEVC>
|
||||
<CTEXT>abap2UI5 - ui5 api (ui5)</CTEXT>
|
||||
<CTEXT>abap2UI5 - custom controls fw (cc)</CTEXT>
|
||||
</DEVC>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
|
|
|
@ -93,7 +93,7 @@ CLASS Z2UI5_CL_CC_FOCUS IMPLEMENTATION.
|
|||
` oFocus.selectionEnd = parseInt(oControl.getProperty("selectionEnd"));` && |\n| &&
|
||||
` oElement.applyFocusInfo(oFocus);` && |\n| &&
|
||||
|\n| &&
|
||||
` }, 10, oControl);` && |\n| &&
|
||||
` }, 100, oControl);` && |\n| &&
|
||||
|\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
|
@ -50,7 +50,7 @@ CLASS z2ui5_cl_cc_geolocation IMPLEMENTATION.
|
|||
METHOD control.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `CCGeolocation`
|
||||
mo_view->_generic( name = `Geolocation`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #(
|
||||
( n = `finished` v = finished )
|
||||
|
@ -77,13 +77,13 @@ CLASS z2ui5_cl_cc_geolocation IMPLEMENTATION.
|
|||
|
||||
METHOD get_js.
|
||||
|
||||
r_js = ` jQuery.sap.declare("z2ui5.CCGeolocation");` && |\n| &&
|
||||
r_js = ` jQuery.sap.declare("z2ui5.Geolocation");` && |\n| &&
|
||||
`sap.ui.require([` && |\n| &&
|
||||
` "sap/ui/core/Control"` && |\n| &&
|
||||
`], (Control) => {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` return Control.extend("z2ui5.CCGeolocation", {` && |\n| &&
|
||||
` return Control.extend("z2ui5.Geolocation", {` && |\n| &&
|
||||
` metadata : {` && |\n| &&
|
||||
` properties: {` && |\n| &&
|
||||
` longitude: {` && |\n| &&
|
|
@ -25,6 +25,7 @@ CLASS z2ui5_cl_cc_info DEFINITION
|
|||
METHODS load_cc
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
CLASS-METHODS get_js
|
||||
RETURNING
|
||||
VALUE(r_js) TYPE string.
|
||||
|
@ -48,7 +49,7 @@ CLASS z2ui5_cl_cc_info IMPLEMENTATION.
|
|||
method control.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `CCInfo`
|
||||
mo_view->_generic( name = `Info`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `ui5_version` v = ui5_version )
|
||||
( n = `ui5_gav` v = ui5_gav )
|
||||
|
@ -71,13 +72,13 @@ ENDMETHOD.
|
|||
|
||||
METHOD get_js.
|
||||
|
||||
r_js = ` jQuery.sap.declare("z2ui5.CCInfo");` && |\n| &&
|
||||
r_js = ` jQuery.sap.declare("z2ui5.Info");` && |\n| &&
|
||||
`sap.ui.require([` && |\n| &&
|
||||
` "sap/ui/core/Control"` && |\n| &&
|
||||
`], (Control) => {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` return Control.extend("z2ui5.CCInfo", {` && |\n| &&
|
||||
` return Control.extend("z2ui5.Info", {` && |\n| &&
|
||||
` metadata : {` && |\n| &&
|
||||
` properties: {` && |\n| &&
|
||||
` ui5_version: {` && |\n| &&
|
|
@ -44,7 +44,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS Z2UI5_CL_CC_MESSAGING IMPLEMENTATION.
|
||||
CLASS z2ui5_cl_cc_messaging IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD constructor.
|
||||
|
@ -67,7 +67,7 @@ CLASS Z2UI5_CL_CC_MESSAGING IMPLEMENTATION.
|
|||
|
||||
METHOD get_js.
|
||||
|
||||
result = `debugger; jQuery.sap.declare("z2ui5.Messaging");` && |\n| &&
|
||||
result = `try { jQuery.sap.require("sap.ui.core.Messaging"); jQuery.sap.declare("z2ui5.Messaging");` && |\n| &&
|
||||
`sap.ui.require([` && |\n| &&
|
||||
` "sap/ui/core/Control",` && |\n| &&
|
||||
` "sap/ui/core/Messaging",` && |\n| &&
|
||||
|
@ -147,7 +147,7 @@ CLASS Z2UI5_CL_CC_MESSAGING IMPLEMENTATION.
|
|||
` }, 50 , oControl );` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
`});`.
|
||||
`}); } catch (e) { }`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<DEVC>
|
||||
<CTEXT>abap2UI5 - custom controls (cc)</CTEXT>
|
||||
<CTEXT>abap2UI5 - custom controls add (cc)</CTEXT>
|
||||
</DEVC>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
|
|
|
@ -24,6 +24,10 @@ CLASS z2ui5_cl_cc_bwipjs DEFINITION
|
|||
RETURNING
|
||||
VALUE(result) TYPE ty_t_barcode.
|
||||
|
||||
CLASS-METHODS get_js
|
||||
RETURNING
|
||||
VALUE(r_js) TYPE string.
|
||||
|
||||
METHODS load_cc
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
@ -79,75 +83,7 @@ CLASS z2ui5_cl_cc_bwipjs IMPLEMENTATION.
|
|||
|
||||
METHOD load_cc.
|
||||
|
||||
DATA(js) = `debugger; jQuery.sap.declare("z2ui5.bwipjs");` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.ui.require([` && |\n| &&
|
||||
` "sap/ui/core/Control",` && |\n| &&
|
||||
` ], function (Control) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` return Control.extend("z2ui5.bwipjs", {` && |\n| &&
|
||||
|\n| &&
|
||||
` metadata: {` && |\n| &&
|
||||
` properties: {` && |\n| &&
|
||||
` bcid: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` text: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` scale: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` height: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` includetext: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` textalign: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
|\n| &&
|
||||
` aggregations: {` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` events: {` && |\n| &&
|
||||
` "upload": {` && |\n| &&
|
||||
` allowPreventDefault: true,` && |\n| &&
|
||||
` parameters: {}` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` renderer: null` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` onAfterRendering() { ` &&
|
||||
` let canvas = bwipjs.toCanvas('mycanvas', {` && |\n| &&
|
||||
` bcid: this.getProperty("bcid"), // Barcode type` && |\n| &&
|
||||
` text: this.getProperty("text"), // Text to encode` && |\n| &&
|
||||
` scale: this.getProperty("scale"), // 3x scaling factor` && |\n| &&
|
||||
` height: this.getProperty("height"), // Bar height, in millimeters` && |\n| &&
|
||||
` includetext: true, // Show human-readable text` && |\n| &&
|
||||
` textxalign: 'center', // Always good to set this` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` renderer: function (oRm, oControl) {` && |\n| &&
|
||||
` debugger; oRm.write( "<canvas id='mycanvas' />");` && |\n| && |\n| &&
|
||||
` // The return value is the canvas element` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` });`.
|
||||
|
||||
|
||||
* result = mo_view->_cc_plain_xml( `<html:script>` && js && `</html:script>` ).
|
||||
|
||||
data(js) = get_js( ).
|
||||
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( js ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
@ -165,4 +101,75 @@ CLASS z2ui5_cl_cc_bwipjs IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_js.
|
||||
|
||||
r_js = `debugger; jQuery.sap.declare("z2ui5.bwipjs");` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.ui.require([` && |\n| &&
|
||||
` "sap/ui/core/Control",` && |\n| &&
|
||||
` ], function (Control) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` return Control.extend("z2ui5.bwipjs", {` && |\n| &&
|
||||
|\n| &&
|
||||
` metadata: {` && |\n| &&
|
||||
` properties: {` && |\n| &&
|
||||
` bcid: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` text: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` scale: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` height: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` includetext: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` textalign: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
|\n| &&
|
||||
` aggregations: {` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` events: {` && |\n| &&
|
||||
` "upload": {` && |\n| &&
|
||||
` allowPreventDefault: true,` && |\n| &&
|
||||
` parameters: {}` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` renderer: null` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` onAfterRendering() { ` &&
|
||||
` let canvas = bwipjs.toCanvas('mycanvas', {` && |\n| &&
|
||||
` bcid: this.getProperty("bcid"), // Barcode type` && |\n| &&
|
||||
` text: this.getProperty("text"), // Text to encode` && |\n| &&
|
||||
` scale: this.getProperty("scale"), // 3x scaling factor` && |\n| &&
|
||||
` height: this.getProperty("height"), // Bar height, in millimeters` && |\n| &&
|
||||
` includetext: true, // Show human-readable text` && |\n| &&
|
||||
` textxalign: 'center', // Always good to set this` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` renderer: function (oRm, oControl) {` && |\n| &&
|
||||
` debugger; oRm.write( "<canvas id='mycanvas' />");` && |\n| && |\n| &&
|
||||
` // The return value is the canvas element` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` });`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
|
|
@ -8,12 +8,17 @@ CLASS z2ui5_cl_cc_demo_output DEFINITION
|
|||
METHODS constructor
|
||||
IMPORTING
|
||||
view TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS control
|
||||
IMPORTING
|
||||
val TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
class-methods get_style
|
||||
RETURNING
|
||||
VALUE(result) type string.
|
||||
|
||||
PROTECTED SECTION.
|
||||
DATA mo_view TYPE REF TO z2ui5_cl_xml_view.
|
||||
PRIVATE SECTION.
|
||||
|
@ -23,15 +28,8 @@ ENDCLASS.
|
|||
|
||||
CLASS z2ui5_cl_cc_demo_output IMPLEMENTATION.
|
||||
|
||||
METHOD constructor.
|
||||
|
||||
me->mo_view = view.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD control.
|
||||
|
||||
result = mo_view->_cc_plain_xml( `<html:style type="text/css">body {` && |\n| &&
|
||||
method get_style.
|
||||
result = `<html:style type="text/css">body {` && |\n| &&
|
||||
` font-family: Arial;` && |\n| &&
|
||||
` font-size: 90%;` && |\n| &&
|
||||
`}` && |\n| &&
|
||||
|
@ -92,8 +90,17 @@ CLASS z2ui5_cl_cc_demo_output IMPLEMENTATION.
|
|||
`tr.body {` && |\n| &&
|
||||
` background-color:#EFEFEF;` && |\n| &&
|
||||
`}` && |\n| &&
|
||||
`</html:style>`
|
||||
)->html( val ).
|
||||
`</html:style>`.
|
||||
endmethod.
|
||||
METHOD constructor.
|
||||
|
||||
me->mo_view = view.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD control.
|
||||
|
||||
result = mo_view->_cc_plain_xml( get_style( ) )->html( val ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
|
|
@ -160,6 +160,14 @@
|
|||
RETURNING
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS get_js_config
|
||||
IMPORTING
|
||||
i_steps_config TYPE ty_config
|
||||
i_highlight_config TYPE ty_config_steps
|
||||
i_highlight_driver_config TYPE ty_config
|
||||
RETURNING
|
||||
VALUE(r_drive_js) TYPE string.
|
||||
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
|
||||
|
@ -208,6 +216,48 @@ CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_js_cc.
|
||||
|
||||
result = `sap.z2ui5.DriverJS = { };` &&
|
||||
` debugger; sap.z2ui5.DriverJS.drive = function() {` && |\n| &&
|
||||
` if( driver !== undefined ) { if( config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(config);` && |\n| &&
|
||||
` driverObj.drive();` && |\n| &&
|
||||
` } };` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` sap.z2ui5.DriverJS.highlight = function() {` && |\n| &&
|
||||
` if( driver !== undefined ) { if ( highlight_driver_config !== undefined ) { if (highlight_config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(highlight_driver_config);` && |\n| &&
|
||||
` driverObj.highlight(highlight_config);` && |\n| &&
|
||||
` } }};` && |\n| &&
|
||||
` };`.
|
||||
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_js_cc_test.
|
||||
|
||||
result = `debugger; jQuery.sap.declare("z2ui5.DriverJS"); sap.ui.require([ ],` && |\n| &&
|
||||
` function() {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` var DriverJS = {};` && |\n| &&
|
||||
|\n| &&
|
||||
` DriverJS.highlight = function() {` && |\n| &&
|
||||
|\n| &&
|
||||
` if( driver !== undefined ) { if ( highlight_driver_config !== undefined ) { if (highlight_config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(highlight_driver_config);` && |\n| &&
|
||||
` driverObj.highlight(highlight_config);` && |\n| &&
|
||||
` } }};` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` return DriverJS;` && |\n| &&
|
||||
` }, /* bExport= */ true);`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_js_cc_test2.
|
||||
|
||||
result = `debugger; jQuery.sap.declare("z2ui5.DriverJS");` && |\n| &&
|
||||
|
@ -262,45 +312,148 @@ CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_js_cc_test.
|
||||
METHOD get_js_config.
|
||||
|
||||
result = `debugger; jQuery.sap.declare("z2ui5.DriverJS"); sap.ui.require([ ],` && |\n| &&
|
||||
` function() {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` var DriverJS = {};` && |\n| &&
|
||||
|\n| &&
|
||||
` DriverJS.highlight = function() {` && |\n| &&
|
||||
|\n| &&
|
||||
` if( driver !== undefined ) { if ( highlight_driver_config !== undefined ) { if (highlight_config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(highlight_driver_config);` && |\n| &&
|
||||
` driverObj.highlight(highlight_config);` && |\n| &&
|
||||
` } }};` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` return DriverJS;` && |\n| &&
|
||||
` }, /* bExport= */ true);`.
|
||||
DATA(ls_config) = i_steps_config.
|
||||
DATA(ls_highlight_config) = i_highlight_config.
|
||||
DATA(ls_highlight_driver_config) = i_highlight_driver_config.
|
||||
|
||||
ENDMETHOD.
|
||||
"load driver object from window object
|
||||
r_drive_js = `const driver = window.driver.js.driver;` && |\n| &&
|
||||
`let driverObj = new Object();` && |\n|.
|
||||
|
||||
METHOD get_js_cc.
|
||||
"handle tour
|
||||
IF i_steps_config IS NOT INITIAL.
|
||||
|
||||
result = `sap.z2ui5.DriverJS = { };` &&
|
||||
` debugger; sap.z2ui5.DriverJS.drive = function() {` && |\n| &&
|
||||
` if( driver !== undefined ) { if( config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(config);` && |\n| &&
|
||||
` driverObj.drive();` && |\n| &&
|
||||
` } };` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` sap.z2ui5.DriverJS.highlight = function() {` && |\n| &&
|
||||
` if( driver !== undefined ) { if ( highlight_driver_config !== undefined ) { if (highlight_config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(highlight_driver_config);` && |\n| &&
|
||||
` driverObj.highlight(highlight_config);` && |\n| &&
|
||||
` } }};` && |\n| &&
|
||||
` };`.
|
||||
LOOP AT ls_config-steps ASSIGNING FIELD-SYMBOL(<step>).
|
||||
IF <step>-popover-title IS NOT INITIAL.
|
||||
<step>-popover-title = escape( val = <step>-popover-title format = cl_abap_format=>e_html_js_html ).
|
||||
ENDIF.
|
||||
IF <step>-popover-description IS NOT INITIAL.
|
||||
<step>-popover-description = escape( val = <step>-popover-description format = cl_abap_format=>e_html_js_html ).
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
|
||||
"needed for transpilation to js
|
||||
DATA(lv_config_json) = ``.
|
||||
lv_config_json = /ui2/cl_json=>serialize(
|
||||
data = ls_config
|
||||
compress = abap_true
|
||||
pretty_name = 'X' ).
|
||||
|
||||
|
||||
ENDMETHOD.
|
||||
r_drive_js = r_drive_js && `var config = ` && lv_config_json && `;` && |\n| &&
|
||||
`var iLength = config.steps.length;` && |\n| &&
|
||||
`for (var i = 0; i < iLength; i++) {` && |\n| &&
|
||||
` switch ( config.steps[i].elementview ) {` && |\n| &&
|
||||
` case 'NEST':` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oViewNest.createId( config.steps[i].element );` && |\n| &&
|
||||
` case 'NEST2':` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oViewNest2.createId( config.steps[i].element );` && |\n| &&
|
||||
` case 'POPUP':` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oViewPopup.createId( config.steps[i].element );` && |\n| &&
|
||||
` case 'POPOVER':` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oViewPopover.createId( config.steps[i].element );` && |\n| &&
|
||||
` // MAIN view is default` && |\n| &&
|
||||
` default:` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oView.createId( config.steps[i].element );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};`.
|
||||
|
||||
r_drive_js = r_drive_js && |\n| && `debugger;` &&
|
||||
`for (var key of Object.keys(config)) {` && |\n| &&
|
||||
` if( key.startsWith('on') ) {` && |\n| &&
|
||||
` config[key] = new Function( config[key] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
r_drive_js = r_drive_js && |\n| &&
|
||||
`for (key of Object.keys(config.steps)) {` && |\n| &&
|
||||
` if( key.startsWith('on') ) {` && |\n| &&
|
||||
` config.steps[key] = new Function( config.steps[key] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
r_drive_js = r_drive_js && |\n| &&
|
||||
`for (var j = 0; j < config.steps.length; j++) {` && |\n| &&
|
||||
` for (key of Object.keys(config.steps[j].popover)) {` && |\n| &&
|
||||
` if( key.startsWith('on') ) {` && |\n| &&
|
||||
` config.steps[j].popover[key] = new Function( config.steps[kj].popover[key] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
|
||||
ENDIF.
|
||||
|
||||
"handle highlight
|
||||
IF i_highlight_config IS NOT INITIAL AND i_highlight_driver_config IS NOT INITIAL.
|
||||
|
||||
DATA(lv_highlight_driver_config_jn) = ``.
|
||||
lv_highlight_driver_config_jn = /ui2/cl_json=>serialize(
|
||||
data = ls_highlight_driver_config
|
||||
compress = abap_true
|
||||
pretty_name = 'X' ).
|
||||
|
||||
r_drive_js = r_drive_js && |\n| &&
|
||||
`var highlight_driver_config = ` && lv_highlight_driver_config_jn && `;` && |\n|.
|
||||
|
||||
|
||||
IF ls_highlight_config-popover-title IS NOT INITIAL.
|
||||
ls_highlight_config-popover-title = escape( val = ls_highlight_config-popover-title format = cl_abap_format=>e_html_js_html ).
|
||||
ENDIF.
|
||||
|
||||
IF ls_highlight_config-popover-description IS NOT INITIAL.
|
||||
ls_highlight_config-popover-description = escape( val = ls_highlight_config-popover-description format = cl_abap_format=>e_html_js_html ).
|
||||
ENDIF.
|
||||
|
||||
DATA(lv_highlight_config_json) = ``.
|
||||
lv_highlight_config_json = /ui2/cl_json=>serialize(
|
||||
data = ls_highlight_config
|
||||
compress = abap_true
|
||||
pretty_name = 'X' ).
|
||||
|
||||
r_drive_js = r_drive_js && |\n| &&
|
||||
`var highlight_config = ` && lv_highlight_config_json && `;` && |\n| &&
|
||||
`switch ( highlight_config.elementview ) {` && |\n| &&
|
||||
` case 'NEST':` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oViewNest.createId( highlight_config.element );` && |\n| &&
|
||||
` case 'NEST2':` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oViewNest2.createId( highlight_config.element );` && |\n| &&
|
||||
` case 'POPUP':` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oViewPopup.createId( highlight_config.element );` && |\n| &&
|
||||
` case 'POPOVER':` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oViewPopover.createId( highlight_config.element );` && |\n| &&
|
||||
` // MAIN view is default` && |\n| &&
|
||||
` default:` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oView.createId( highlight_config.element );` && |\n| &&
|
||||
`};`.
|
||||
|
||||
r_drive_js = r_drive_js && |\n| &&
|
||||
`for (var key1 of Object.keys(highlight_config)) {` && |\n| &&
|
||||
` if( key1.startsWith('on') ) {` && |\n| &&
|
||||
` highlight_config[key1] = new Function( highlight_config[key1] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
r_drive_js = r_drive_js && |\n| &&
|
||||
`for (var key1 of Object.keys(highlight_config.popover)) {` && |\n| &&
|
||||
` if( key1.startsWith('on') ) {` && |\n| &&
|
||||
` highlight_config.popover[key1] = new Function( highlight_config.popover[key1] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
r_drive_js = r_drive_js && |\n| &&
|
||||
`for (key1 of Object.keys(highlight_driver_config)) {` && |\n| &&
|
||||
` if( key.startsWith('on') ) {` && |\n| &&
|
||||
` highlight_driver_config[key] = new Function( highlight_driver_config[key] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};`.
|
||||
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_js_local.
|
||||
result = `` && |\n| &&
|
||||
|
@ -446,7 +599,7 @@ METHOD get_js_cc.
|
|||
|
||||
METHOD load_lib.
|
||||
|
||||
DATA(js) = ``.
|
||||
* DATA(js) = ``.
|
||||
DATA(css) = ``.
|
||||
|
||||
IF css_url IS INITIAL.
|
||||
|
@ -455,172 +608,29 @@ METHOD get_js_cc.
|
|||
css = css && get_css_local( ) && |\n|.
|
||||
ENDIF.
|
||||
ELSE.
|
||||
* css = css && `<html:style>` && css_url && `</html:style>` && |\n|.
|
||||
css = css && css_url && |\n|.
|
||||
ENDIF.
|
||||
|
||||
IF js_url IS INITIAL.
|
||||
IF local_js = abap_true.
|
||||
* js = js && `<html:script>` && get_js_local( ) && `</html:script>` && |\n|.
|
||||
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( get_js_local( ) )->get_parent( ).
|
||||
ENDIF.
|
||||
ELSE.
|
||||
* js = js && `<html:script src="` && js_url && `" ></html:script>` && |\n|.
|
||||
result = mo_view->_generic( ns = `html` name = `script` t_prop = VALUE #( ( n = `src` v = js_url ) ) )->get_parent( ).
|
||||
result = mo_view->_generic( ns = `html` name = `script` t_prop = VALUE #( ( n = `src` v = js_url ) ) )->get_parent( ).
|
||||
ENDIF.
|
||||
|
||||
DATA(final) = js && |\n| && css ##NEEDED.
|
||||
|
||||
* result = mo_view->_cc_plain_xml( js )->get_parent( )->_cc_plain_xml( css ).
|
||||
|
||||
|
||||
result = mo_view->_generic( ns = `html` name = `style` )->_cc_plain_xml( css ).
|
||||
"->get_parent( ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD set_driver_configs.
|
||||
|
||||
DATA(ls_config) = steps_config.
|
||||
DATA(ls_highlight_config) = highlight_config.
|
||||
DATA(ls_highlight_driver_config) = highlight_driver_config.
|
||||
data(drive_js) = get_js_config(
|
||||
i_steps_config = steps_config
|
||||
i_highlight_config = highlight_config
|
||||
i_highlight_driver_config = highlight_driver_config ).
|
||||
|
||||
"load driver object from window object
|
||||
DATA(drive_js) = `const driver = window.driver.js.driver;` && |\n| &&
|
||||
`let driverObj = new Object();` && |\n|.
|
||||
|
||||
"handle tour
|
||||
IF steps_config IS NOT INITIAL.
|
||||
|
||||
LOOP AT ls_config-steps ASSIGNING FIELD-SYMBOL(<step>).
|
||||
IF <step>-popover-title IS NOT INITIAL.
|
||||
<step>-popover-title = escape( val = <step>-popover-title format = cl_abap_format=>e_html_js_html ).
|
||||
ENDIF.
|
||||
IF <step>-popover-description IS NOT INITIAL.
|
||||
<step>-popover-description = escape( val = <step>-popover-description format = cl_abap_format=>e_html_js_html ).
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
|
||||
"needed for transpilation to js
|
||||
DATA(lv_config_json) = ``.
|
||||
lv_config_json = /ui2/cl_json=>serialize(
|
||||
data = ls_config
|
||||
compress = abap_true
|
||||
pretty_name = 'X' ).
|
||||
|
||||
|
||||
drive_js = drive_js && `var config = ` && lv_config_json && `;` && |\n| &&
|
||||
`var iLength = config.steps.length;` && |\n| &&
|
||||
`for (var i = 0; i < iLength; i++) {` && |\n| &&
|
||||
` switch ( config.steps[i].elementview ) {` && |\n| &&
|
||||
` case 'NEST':` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oViewNest.createId( config.steps[i].element );` && |\n| &&
|
||||
` case 'NEST2':` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oViewNest2.createId( config.steps[i].element );` && |\n| &&
|
||||
` case 'POPUP':` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oViewPopup.createId( config.steps[i].element );` && |\n| &&
|
||||
` case 'POPOVER':` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oViewPopover.createId( config.steps[i].element );` && |\n| &&
|
||||
` // MAIN view is default` && |\n| &&
|
||||
` default:` && |\n| &&
|
||||
` config.steps[i].element = '#' + sap.z2ui5.oView.createId( config.steps[i].element );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};`.
|
||||
|
||||
drive_js = drive_js && |\n| && `debugger;` &&
|
||||
`for (var key of Object.keys(config)) {` && |\n| &&
|
||||
` if( key.startsWith('on') ) {` && |\n| &&
|
||||
` config[key] = new Function( config[key] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
drive_js = drive_js && |\n| &&
|
||||
`for (key of Object.keys(config.steps)) {` && |\n| &&
|
||||
` if( key.startsWith('on') ) {` && |\n| &&
|
||||
` config.steps[key] = new Function( config.steps[key] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
drive_js = drive_js && |\n| &&
|
||||
`for (var j = 0; j < config.steps.length; j++) {` && |\n| &&
|
||||
` for (key of Object.keys(config.steps[j].popover)) {` && |\n| &&
|
||||
` if( key.startsWith('on') ) {` && |\n| &&
|
||||
` config.steps[j].popover[key] = new Function( config.steps[kj].popover[key] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
|
||||
ENDIF.
|
||||
|
||||
"handle highlight
|
||||
IF highlight_config IS NOT INITIAL AND highlight_driver_config IS NOT INITIAL.
|
||||
|
||||
DATA(lv_highlight_driver_config_jn) = ``.
|
||||
lv_highlight_driver_config_jn = /ui2/cl_json=>serialize(
|
||||
data = ls_highlight_driver_config
|
||||
compress = abap_true
|
||||
pretty_name = 'X' ).
|
||||
|
||||
drive_js = drive_js && |\n| &&
|
||||
`var highlight_driver_config = ` && lv_highlight_driver_config_jn && `;` && |\n|.
|
||||
|
||||
|
||||
IF ls_highlight_config-popover-title IS NOT INITIAL.
|
||||
ls_highlight_config-popover-title = escape( val = ls_highlight_config-popover-title format = cl_abap_format=>e_html_js_html ).
|
||||
ENDIF.
|
||||
|
||||
IF ls_highlight_config-popover-description IS NOT INITIAL.
|
||||
ls_highlight_config-popover-description = escape( val = ls_highlight_config-popover-description format = cl_abap_format=>e_html_js_html ).
|
||||
ENDIF.
|
||||
|
||||
DATA(lv_highlight_config_json) = ``.
|
||||
lv_highlight_config_json = /ui2/cl_json=>serialize(
|
||||
data = ls_highlight_config
|
||||
compress = abap_true
|
||||
pretty_name = 'X' ).
|
||||
|
||||
drive_js = drive_js && |\n| &&
|
||||
`var highlight_config = ` && lv_highlight_config_json && `;` && |\n| &&
|
||||
`switch ( highlight_config.elementview ) {` && |\n| &&
|
||||
` case 'NEST':` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oViewNest.createId( highlight_config.element );` && |\n| &&
|
||||
` case 'NEST2':` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oViewNest2.createId( highlight_config.element );` && |\n| &&
|
||||
` case 'POPUP':` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oViewPopup.createId( highlight_config.element );` && |\n| &&
|
||||
` case 'POPOVER':` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oViewPopover.createId( highlight_config.element );` && |\n| &&
|
||||
` // MAIN view is default` && |\n| &&
|
||||
` default:` && |\n| &&
|
||||
` highlight_config.element = '#' + sap.z2ui5.oView.createId( highlight_config.element );` && |\n| &&
|
||||
`};`.
|
||||
|
||||
drive_js = drive_js && |\n| &&
|
||||
`for (var key1 of Object.keys(highlight_config)) {` && |\n| &&
|
||||
` if( key1.startsWith('on') ) {` && |\n| &&
|
||||
` highlight_config[key1] = new Function( highlight_config[key1] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
drive_js = drive_js && |\n| &&
|
||||
`for (var key1 of Object.keys(highlight_config.popover)) {` && |\n| &&
|
||||
` if( key1.startsWith('on') ) {` && |\n| &&
|
||||
` highlight_config.popover[key1] = new Function( highlight_config.popover[key1] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};` && |\n|.
|
||||
|
||||
drive_js = drive_js && |\n| &&
|
||||
`for (key1 of Object.keys(highlight_driver_config)) {` && |\n| &&
|
||||
` if( key.startsWith('on') ) {` && |\n| &&
|
||||
` highlight_driver_config[key] = new Function( highlight_driver_config[key] );` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`};`.
|
||||
|
||||
ENDIF.
|
||||
|
||||
* result = mo_view->_cc_plain_xml( `<html:script>` && drive_js && `</html:script>` ).
|
||||
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( drive_js ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -1,132 +1,145 @@
|
|||
class Z2UI5_CL_CC_FONT_AWESOME_ICONS definition
|
||||
public
|
||||
final
|
||||
create public .
|
||||
CLASS z2ui5_cl_cc_font_awesome_icons DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
||||
public section.
|
||||
PUBLIC SECTION.
|
||||
|
||||
data MO_VIEW type ref to Z2UI5_CL_XML_VIEW .
|
||||
DATA mo_view TYPE REF TO z2ui5_cl_xml_view .
|
||||
|
||||
METHODS load_icons
|
||||
IMPORTING
|
||||
!font_uri TYPE clike
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS load_animation_js
|
||||
IMPORTING
|
||||
!faw_js_url TYPE clike
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS constructor
|
||||
IMPORTING
|
||||
!view TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
CLASS-METHODS get_js_icon
|
||||
IMPORTING
|
||||
i_font_uri TYPE clike
|
||||
RETURNING
|
||||
VALUE(r_js) TYPE string.
|
||||
|
||||
methods LOAD_ICONS
|
||||
importing
|
||||
!FONT_URI type CLIKE
|
||||
returning
|
||||
value(RESULT) type ref to Z2UI5_CL_XML_VIEW .
|
||||
methods LOAD_ANIMATION_JS
|
||||
importing
|
||||
!FAW_JS_URL type CLIKE
|
||||
returning
|
||||
value(RESULT) type ref to Z2UI5_CL_XML_VIEW .
|
||||
methods CONSTRUCTOR
|
||||
importing
|
||||
!VIEW type ref to Z2UI5_CL_XML_VIEW .
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
||||
CLASS Z2UI5_CL_CC_FONT_AWESOME_ICONS IMPLEMENTATION.
|
||||
CLASS z2ui5_cl_cc_font_awesome_icons IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD CONSTRUCTOR.
|
||||
METHOD constructor.
|
||||
|
||||
me->mo_view = view.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD LOAD_ANIMATION_JS.
|
||||
METHOD load_animation_js.
|
||||
|
||||
* result = mo_view->_cc_plain_xml( `<html:script src="` && faw_js_url && `" ></html:script>` ).
|
||||
result = mo_view->_generic( ns = `html` name = `script` t_prop = value #( ( n = `src` v = faw_js_url ) ) )->get_parent( ).
|
||||
result = mo_view->_generic( ns = `html` name = `script` t_prop = VALUE #( ( n = `src` v = faw_js_url ) ) )->get_parent( ).
|
||||
|
||||
enDMETHOD.
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD LOAD_ICONS.
|
||||
METHOD load_icons.
|
||||
|
||||
DATA(js) = `debugger;` && |\n| &&
|
||||
DATA(js) = get_js_icon( font_uri ).
|
||||
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( js )->get_parent( ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_js_icon.
|
||||
|
||||
r_js = `debugger;` && |\n| &&
|
||||
* `const metadataURI = "` && metadata_uri && `";` && |\n| &&
|
||||
* `const oFontMetadata = ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
|
||||
* `const oFontBrandsMetadata = ` && lcl_metadata=>get_brands_fonts_metadata( ) && |\n| &&
|
||||
`const oFonts = [{` && |\n| &&
|
||||
` fontFamily: 'fa-regular-400',` && |\n| &&
|
||||
` collectionName: 'fa-regular'` && |\n| &&
|
||||
`const oFonts = [{` && |\n| &&
|
||||
` fontFamily: 'fa-regular-400',` && |\n| &&
|
||||
` collectionName: 'fa-regular'` && |\n| &&
|
||||
* ` metadata: ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
|
||||
* ` metadata: oFontMetadata,` && |\n| &&
|
||||
* ` fontURI: "` && font_uri && `"` && |\n| &&
|
||||
* ` lazy: true` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-duotone-900',` && |\n| &&
|
||||
` collectionName: 'fa-duotone'` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-duotone-900',` && |\n| &&
|
||||
` collectionName: 'fa-duotone'` && |\n| &&
|
||||
* ` metadata: ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
|
||||
* ` metadata: oFontMetadata` && |\n| &&
|
||||
* ` fontURI: "` && font_uri && `"` && |\n| &&
|
||||
* ` lazy: true` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-light-300',` && |\n| &&
|
||||
` collectionName: 'fa-light'` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-light-300',` && |\n| &&
|
||||
` collectionName: 'fa-light'` && |\n| &&
|
||||
* ` metadata: ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
|
||||
* ` metadata: oFontMetadata` && |\n| &&
|
||||
* ` fontURI: "` && font_uri && `"` && |\n| &&
|
||||
* ` lazy: true` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-solid-900',` && |\n| &&
|
||||
` collectionName: 'fa-solid'` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-solid-900',` && |\n| &&
|
||||
` collectionName: 'fa-solid'` && |\n| &&
|
||||
* ` metadata: ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
|
||||
* ` metadata: oFontMetadata` && |\n| &&
|
||||
* ` fontURI: "` && font_uri && `"` && |\n| &&
|
||||
* ` lazy: true` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-thin-100',` && |\n| &&
|
||||
` collectionName: 'fa-thin'` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-thin-100',` && |\n| &&
|
||||
` collectionName: 'fa-thin'` && |\n| &&
|
||||
* ` metadata: ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
|
||||
* ` metadata: oFontMetadata` && |\n| &&
|
||||
* ` fontURI: "` && font_uri && `"` && |\n| &&
|
||||
* ` lazy: true` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-brands-400',` && |\n| &&
|
||||
` collectionName: 'fa-brands'` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-brands-400',` && |\n| &&
|
||||
` collectionName: 'fa-brands'` && |\n| &&
|
||||
* ` metadata: ` && lcl_metadata=>get_brands_fonts_metadata( ) && |\n| &&
|
||||
* ` metadata: oFontBrandsMetadata,` && |\n| &&
|
||||
* ` fontURI: "` && font_uri && `"` && |\n| &&
|
||||
* ` lazy: true` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-sharp-solid-900',` && |\n| &&
|
||||
` collectionName: 'fa-sharp-solid'` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-sharp-solid-900',` && |\n| &&
|
||||
` collectionName: 'fa-sharp-solid'` && |\n| &&
|
||||
* ` metadata: ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
|
||||
* ` metadata: oFontMetadata` && |\n| &&
|
||||
* ` fontURI: "` && font_uri && `"` && |\n| &&
|
||||
* ` lazy: true` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-sharp-regular-400',` && |\n| &&
|
||||
` collectionName: 'fa-sharp-regular'` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-sharp-regular-400',` && |\n| &&
|
||||
` collectionName: 'fa-sharp-regular'` && |\n| &&
|
||||
* ` metadata: ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
|
||||
* ` metadata: oFontMetadata` && |\n| &&
|
||||
* ` fontURI: "` && font_uri && `"` && |\n| &&
|
||||
* ` lazy: true` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-sharp-light-300',` && |\n| &&
|
||||
` collectionName: 'fa-sharp-light'` && |\n| &&
|
||||
` }, {` && |\n| &&
|
||||
` fontFamily: 'fa-sharp-light-300',` && |\n| &&
|
||||
` collectionName: 'fa-sharp-light'` && |\n| &&
|
||||
* ` metadata: ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
|
||||
* ` metadata: oFontMetadata` && |\n| &&
|
||||
* ` fontURI: "` && font_uri && `"` && |\n| &&
|
||||
* ` lazy: true` && |\n| &&
|
||||
`}]` && |\n| &&
|
||||
`}]` && |\n| &&
|
||||
* `oFonts.forEach(oFont => {` && |\n| &&
|
||||
* ` sap.ui.core.IconPool.registerFont(oFont);` && |\n| &&
|
||||
* `});`.
|
||||
`oFonts.forEach(function(font) {` && |\n| &&
|
||||
` sap.ui.core.IconPool.registerFont(jQuery.extend({}, font, {` && |\n| &&
|
||||
` fontURI: "` && font_uri && `",` && |\n| &&
|
||||
` lazy: true` && |\n| &&
|
||||
` }))` && |\n| &&
|
||||
`})`.
|
||||
|
||||
* result = mo_view->_cc_plain_xml( `<html:script>` && js && `</html:script>` )->get_parent( ).
|
||||
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( js )->get_parent( ).
|
||||
`oFonts.forEach(function(font) {` && |\n| &&
|
||||
` sap.ui.core.IconPool.registerFont(jQuery.extend({}, font, {` && |\n| &&
|
||||
` fontURI: "` && i_font_uri && `",` && |\n| &&
|
||||
` lazy: true` && |\n| &&
|
||||
` }))` && |\n| &&
|
||||
`})`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
ENDCLASS.
|
||||
|
|
|
@ -23,6 +23,11 @@ CLASS z2ui5_cl_cc_spreadsheet DEFINITION
|
|||
icon TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
|
||||
CLASS-METHODS get_js
|
||||
IMPORTING
|
||||
i_columnconfig TYPE clike
|
||||
RETURNING
|
||||
VALUE(r_js) TYPE string.
|
||||
|
||||
PROTECTED SECTION.
|
||||
DATA mo_view TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
@ -57,83 +62,93 @@ CLASS Z2UI5_CL_CC_SPREADSHEET IMPLEMENTATION.
|
|||
|
||||
METHOD load_cc.
|
||||
|
||||
DATA(js) = ` jQuery.sap.declare("z2ui5.ExportSpreadsheet");` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.ui.require([` && |\n| &&
|
||||
` "sap/ui/core/Control",` && |\n| &&
|
||||
` "sap/m/Button",` && |\n| &&
|
||||
` "sap/ui/export/Spreadsheet"` && |\n| &&
|
||||
` ], function (Control, Button, Spreadsheet) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` return Control.extend("z2ui5.ExportSpreadsheet", {` && |\n| &&
|
||||
|\n| &&
|
||||
` metadata: {` && |\n| &&
|
||||
` properties: {` && |\n| &&
|
||||
` tableId: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` type: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` icon: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` text: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
|\n| &&
|
||||
` aggregations: {` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` events: { },` && |\n| &&
|
||||
` renderer: null` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` renderer: function (oRm, oControl) {` && |\n| &&
|
||||
|\n| &&
|
||||
` oControl.oExportButton = new Button({` && |\n| &&
|
||||
` text: oControl.getProperty("text"),` && |\n| &&
|
||||
` icon: oControl.getProperty("icon"), ` && |\n| &&
|
||||
` type: oControl.getProperty("type"), ` && |\n| &&
|
||||
` press: function (oEvent) { ` && |\n| &&
|
||||
|\n| &&
|
||||
` var aCols =` && columnconfig && `;` && |\n| &&
|
||||
|\n| &&
|
||||
` var oBinding, oSettings, oSheet, oTable, vTableId, vViewPrefix,vPrefixTableId;` && |\n| &&
|
||||
` vTableId = oControl.getProperty("tableId")` && |\n| &&
|
||||
` // vViewPrefix = sap.z2ui5.oView.sId;` && |\n| &&
|
||||
` // vPrefixTableId = vViewPrefix + "--" + vTableId;` && |\n| &&
|
||||
` vPrefixTableId = sap.z2ui5.oView.createId( vTableId );` && |\n| &&
|
||||
` oTable = sap.ui.getCore().byId(vPrefixTableId);` && |\n| &&
|
||||
` oBinding = oTable.getBinding("rows");` && |\n| &&
|
||||
` if (oBinding == null) {` && |\n| &&
|
||||
` oBinding = oTable.getBinding("items");` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` oSettings = {` && |\n| &&
|
||||
` workbook: { columns: aCols },` && |\n| &&
|
||||
` dataSource: oBinding` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` oSheet = new Spreadsheet(oSettings);` && |\n| &&
|
||||
` oSheet.build()` && |\n| &&
|
||||
` .then(function() {` && |\n| &&
|
||||
` }).finally(function() {` && |\n| &&
|
||||
` oSheet.destroy();` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` }.bind(oControl)` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
|\n| &&
|
||||
` oRm.renderControl(oControl.oExportButton);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` });`.
|
||||
DATA js TYPE string.
|
||||
|
||||
|
||||
js = get_js( columnconfig ).
|
||||
|
||||
* result = mo_view->_cc_plain_xml( `<html:script>` && js && `</html:script>` ).
|
||||
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( js ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_js.
|
||||
|
||||
r_js = ` jQuery.sap.declare("z2ui5.ExportSpreadsheet");` && |\n| &&
|
||||
|\n| &&
|
||||
` sap.ui.require([` && |\n| &&
|
||||
` "sap/ui/core/Control",` && |\n| &&
|
||||
` "sap/m/Button",` && |\n| &&
|
||||
` "sap/ui/export/Spreadsheet"` && |\n| &&
|
||||
` ], function (Control, Button, Spreadsheet) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` return Control.extend("z2ui5.ExportSpreadsheet", {` && |\n| &&
|
||||
|\n| &&
|
||||
` metadata: {` && |\n| &&
|
||||
` properties: {` && |\n| &&
|
||||
` tableId: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` type: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` icon: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` text: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
|\n| &&
|
||||
` aggregations: {` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` events: { },` && |\n| &&
|
||||
` renderer: null` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` renderer: function (oRm, oControl) {` && |\n| &&
|
||||
|\n| &&
|
||||
` oControl.oExportButton = new Button({` && |\n| &&
|
||||
` text: oControl.getProperty("text"),` && |\n| &&
|
||||
` icon: oControl.getProperty("icon"), ` && |\n| &&
|
||||
` type: oControl.getProperty("type"), ` && |\n| &&
|
||||
` press: function (oEvent) { ` && |\n| &&
|
||||
|\n| &&
|
||||
` var aCols =` && i_columnconfig && `;` && |\n| &&
|
||||
|\n| &&
|
||||
` var oBinding, oSettings, oSheet, oTable, vTableId, vViewPrefix,vPrefixTableId;` && |\n| &&
|
||||
` vTableId = oControl.getProperty("tableId")` && |\n| &&
|
||||
` // vViewPrefix = sap.z2ui5.oView.sId;` && |\n| &&
|
||||
` // vPrefixTableId = vViewPrefix + "--" + vTableId;` && |\n| &&
|
||||
` vPrefixTableId = sap.z2ui5.oView.createId( vTableId );` && |\n| &&
|
||||
` oTable = sap.ui.getCore().byId(vPrefixTableId);` && |\n| &&
|
||||
` oBinding = oTable.getBinding("rows");` && |\n| &&
|
||||
` if (oBinding == null) {` && |\n| &&
|
||||
` oBinding = oTable.getBinding("items");` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` oSettings = {` && |\n| &&
|
||||
` workbook: { columns: aCols },` && |\n| &&
|
||||
` dataSource: oBinding` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` oSheet = new Spreadsheet(oSettings);` && |\n| &&
|
||||
` oSheet.build()` && |\n| &&
|
||||
` .then(function() {` && |\n| &&
|
||||
` }).finally(function() {` && |\n| &&
|
||||
` oSheet.destroy();` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` }.bind(oControl)` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
|\n| &&
|
||||
` oRm.renderControl(oControl.oExportButton);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` });`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
|
10
src/21/package.devc.xml
Normal file
10
src/21/package.devc.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DEVC" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<DEVC>
|
||||
<CTEXT>abap2UI5 - view renderer v1 (xml)</CTEXT>
|
||||
</DEVC>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
|
@ -1877,7 +1877,7 @@ CLASS z2ui5_cl_xml_view DEFINITION
|
|||
|
||||
METHODS _cc
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_cc_factory.
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view_cc_factory.
|
||||
|
||||
METHODS gantt_chart_container
|
||||
RETURNING
|
281
src/21/z2ui5_cl_xml_view_cc.clas.abap
Normal file
281
src/21/z2ui5_cl_xml_view_cc.clas.abap
Normal file
|
@ -0,0 +1,281 @@
|
|||
CLASS z2ui5_cl_xml_view_cc DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
||||
METHODS bwip_js
|
||||
IMPORTING
|
||||
bcid TYPE clike OPTIONAL
|
||||
text TYPE clike OPTIONAL
|
||||
scale TYPE clike OPTIONAL
|
||||
height TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS demo_output
|
||||
IMPORTING
|
||||
val TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS focus
|
||||
IMPORTING
|
||||
focusid TYPE clike OPTIONAL
|
||||
selectionstart TYPE clike OPTIONAL
|
||||
selectionend TYPE clike OPTIONAL
|
||||
setupdate TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS geolocation
|
||||
IMPORTING
|
||||
finished TYPE clike OPTIONAL
|
||||
longitude TYPE any OPTIONAL
|
||||
latitude TYPE any OPTIONAL
|
||||
altitude TYPE any OPTIONAL
|
||||
accuracy TYPE any OPTIONAL
|
||||
altitudeaccuracy TYPE any OPTIONAL
|
||||
speed TYPE any OPTIONAL
|
||||
heading TYPE any OPTIONAL
|
||||
enablehighaccuracy TYPE any OPTIONAL
|
||||
timeout TYPE any OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS info_frontend
|
||||
IMPORTING
|
||||
finished TYPE clike OPTIONAL
|
||||
ui5_version TYPE any OPTIONAL
|
||||
ui5_gav TYPE any OPTIONAL
|
||||
ui5_theme TYPE any OPTIONAL
|
||||
device_os TYPE any OPTIONAL
|
||||
device_systemtype TYPE any OPTIONAL
|
||||
device_browser TYPE any OPTIONAL
|
||||
PREFERRED PARAMETER finished
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS spreadsheet_export
|
||||
IMPORTING
|
||||
tableid TYPE clike
|
||||
type TYPE clike OPTIONAL
|
||||
text TYPE clike OPTIONAL
|
||||
icon TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
|
||||
|
||||
METHODS file_uploader
|
||||
IMPORTING
|
||||
!value TYPE clike OPTIONAL
|
||||
!path TYPE clike OPTIONAL
|
||||
!placeholder TYPE clike OPTIONAL
|
||||
!upload TYPE clike OPTIONAL
|
||||
!icononly TYPE clike OPTIONAL
|
||||
!buttononly TYPE clike OPTIONAL
|
||||
!buttontext TYPE clike OPTIONAL
|
||||
!uploadbuttontext TYPE clike OPTIONAL
|
||||
!checkdirectupload TYPE clike OPTIONAL
|
||||
!filetype TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS messaging
|
||||
IMPORTING
|
||||
items TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS title
|
||||
IMPORTING
|
||||
title TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS scroll
|
||||
IMPORTING
|
||||
setupdate TYPE clike OPTIONAL
|
||||
items TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS timer
|
||||
IMPORTING
|
||||
finished TYPE clike OPTIONAL
|
||||
delayms TYPE clike OPTIONAL
|
||||
checkrepeat TYPE clike OPTIONAL
|
||||
checkactive TYPE clike OPTIONAL
|
||||
PREFERRED PARAMETER finished
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS constructor
|
||||
IMPORTING
|
||||
view TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
PROTECTED SECTION.
|
||||
DATA mo_view TYPE REF TO z2ui5_cl_xml_view.
|
||||
PRIVATE SECTION.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
||||
CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
|
||||
|
||||
method bwip_js.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `bwipjs`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `bcid` v = bcid )
|
||||
( n = `text` v = text )
|
||||
( n = `scale` v = scale )
|
||||
( n = `height` v = height )
|
||||
) ).
|
||||
|
||||
endmethod.
|
||||
|
||||
METHOD spreadsheet_export.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `ExportSpreadsheet`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `tableId` v = tableid )
|
||||
( n = `text` v = text )
|
||||
( n = `icon` v = icon )
|
||||
( n = `type` v = type )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD constructor.
|
||||
|
||||
me->mo_view = view.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD file_uploader.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `FileUploader`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `placeholder` v = placeholder )
|
||||
( n = `upload` v = upload )
|
||||
( n = `path` v = path )
|
||||
( n = `value` v = value )
|
||||
( n = `iconOnly` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( icononly ) )
|
||||
( n = `buttonOnly` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( buttononly ) )
|
||||
( n = `buttonText` v = buttontext )
|
||||
( n = `uploadButtonText` v = uploadbuttontext )
|
||||
( n = `fileType` v = filetype )
|
||||
( n = `checkDirectUpload` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( checkdirectupload ) ) ) ).
|
||||
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD scroll.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Scroll`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #(
|
||||
( n = `setUpdate` v = setupdate )
|
||||
( n = `items` v = items )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD timer.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Timer`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `delayMS` v = delayms )
|
||||
( n = `finished` v = finished )
|
||||
( n = `checkActive` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( checkactive ) )
|
||||
( n = `checkRepeat` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( checkrepeat ) )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD title.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Title`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `title` v = title ) ) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD messaging.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Messaging`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `items` v = items )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD info_frontend.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Info`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `ui5_version` v = ui5_version )
|
||||
( n = `ui5_gav` v = ui5_gav )
|
||||
( n = `finished` v = finished )
|
||||
( n = `ui5_theme` v = ui5_theme )
|
||||
( n = `device_os` v = device_os )
|
||||
( n = `device_systemtype` v = device_systemtype )
|
||||
( n = `device_browser` v = device_browser )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD geolocation.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Geolocation`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #(
|
||||
( n = `finished` v = finished )
|
||||
( n = `longitude` v = longitude )
|
||||
( n = `latitude` v = latitude )
|
||||
( n = `altitude` v = altitude )
|
||||
( n = `accuracy` v = accuracy )
|
||||
( n = `altitudeAccuracy` v = altitudeaccuracy )
|
||||
( n = `speed` v = speed )
|
||||
( n = `heading` v = heading )
|
||||
( n = `enableHighAccuracy` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( enablehighaccuracy ) )
|
||||
( n = `timeout` v = timeout )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD focus.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Focus`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #(
|
||||
( n = `setUpdate` v = setupdate )
|
||||
( n = `selectionStart` v = selectionstart )
|
||||
( n = `selectionEnd` v = selectionend )
|
||||
( n = `focusId` v = focusid )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD demo_output.
|
||||
|
||||
result = mo_view->_cc_plain_xml( z2ui5_cl_cc_demo_output=>get_style( ) )->html( val ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
|
@ -1,4 +1,4 @@
|
|||
CLASS z2ui5_cl_cc_factory DEFINITION
|
||||
CLASS z2ui5_cl_xml_view_cc_factory DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
@ -69,7 +69,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS Z2UI5_CL_CC_FACTORY IMPLEMENTATION.
|
||||
CLASS Z2UI5_CL_XML_VIEW_CC_FACTORY IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD bwip_js.
|
|
@ -3,7 +3,7 @@
|
|||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_CC_FACTORY</CLSNAME>
|
||||
<CLSNAME>Z2UI5_CL_XML_VIEW_CC_FACTORY</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>cc - xml view factory</DESCRIPT>
|
||||
<STATE>1</STATE>
|
10
src/22/package.devc.xml
Normal file
10
src/22/package.devc.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DEVC" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<DEVC>
|
||||
<CTEXT>abap2UI5 - view renderer v2 (ui5)</CTEXT>
|
||||
</DEVC>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
|
@ -3,7 +3,7 @@
|
|||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<DEVC>
|
||||
<CTEXT>abap2UI5 - test (test)</CTEXT>
|
||||
<CTEXT>abap2UI5 - test</CTEXT>
|
||||
</DEVC>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
|
|
|
@ -51,7 +51,9 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
|
|||
z2ui5_cl_cc_focus=>get_js( ) &&
|
||||
z2ui5_cl_cc_title=>get_js( ) &&
|
||||
z2ui5_cl_cc_scroll=>get_js( ) &&
|
||||
z2ui5_cl_cc_info=>get_js( ) &&
|
||||
z2ui5_cl_cc_geolocation=>get_js( ) &&
|
||||
z2ui5_cl_cc_file_uploader=>get_js( ) &&
|
||||
z2ui5_cl_cc_messaging=>get_js( ) &&
|
||||
custom_js.
|
||||
|
||||
|
@ -130,7 +132,9 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
|
|||
` definition: sap.z2ui5.oResponse.PARAMS.S_POPUP.XML,` && |\n| &&
|
||||
` controller: sap.z2ui5.oController,` && |\n| &&
|
||||
` }).then(oFragment => {` && |\n| &&
|
||||
` oFragment.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL))` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oFragment.setModel(oview_model)` && |\n| &&
|
||||
` sap.z2ui5.oView.addDependent(oFragment);` && |\n| &&
|
||||
` oFragment.open();` && |\n| &&
|
||||
` sap.z2ui5.oViewPopup = oFragment;` && |\n| &&
|
||||
|
@ -144,7 +148,7 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
|
|||
` controller: sap.z2ui5.oControllerNest,` && |\n| &&
|
||||
` }).then(oView => {` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(` && json_model_limit && `);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` var oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.ID);` && |\n| &&
|
||||
` try { oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.METHOD_DESTROY](); } catch { }` && |\n| &&
|
||||
|
@ -164,7 +168,7 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
|
|||
` controller: sap.z2ui5.oControllerNest2,` && |\n| &&
|
||||
` }).then(oView => {` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(` && json_model_limit && `);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` var oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.ID);` && |\n| &&
|
||||
` try { oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.METHOD_DESTROY](); } catch { }` && |\n| &&
|
||||
|
@ -185,7 +189,9 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
|
|||
` definition: sap.z2ui5.oResponse.PARAMS.S_POPOVER.XML,` && |\n| &&
|
||||
` controller: sap.z2ui5.oController,` && |\n| &&
|
||||
` }).then(oFragment => {` && |\n| &&
|
||||
` oFragment.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL))` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oFragment.setModel(oview_model)` && |\n| &&
|
||||
` sap.z2ui5.oView.addDependent(oFragment);` && |\n| &&
|
||||
` var oControl = sap.ui.getCore().byId(sap.z2ui5.oResponse.PARAMS.S_POPOVER.OPEN_BY_ID);` && |\n| &&
|
||||
` if (oControl === undefined) {` && |\n| &&
|
||||
|
@ -451,7 +457,7 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
|
|||
` controller: sap.z2ui5.oController,` && |\n| &&
|
||||
` }).then(oView => {` && |\n| &&
|
||||
` var oview_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oview_model.setSizeLimit(` && json_model_limit && `);` && |\n| &&
|
||||
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` if (sap.z2ui5.oParent) {` && |\n| &&
|
||||
` sap.z2ui5.oParent.removeAllPages();` && |\n| &&
|
||||
|
@ -466,15 +472,15 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
|
|||
` } else {` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.CHECK_UPDATE_MODEL == true) {` && |\n| &&
|
||||
` var main_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` main_model.setSizeLimit(` && json_model_limit && `);` && |\n| &&
|
||||
` main_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` sap.z2ui5.oView.setModel(main_model); }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.CHECK_UPDATE_MODEL == true) {` && |\n| &&
|
||||
` var nest_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` nest_model.setSizeLimit(` && json_model_limit && `);` && |\n| &&
|
||||
` nest_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` sap.z2ui5.oViewNest.setModel(nest_model); }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.CHECK_UPDATE_MODEL == true) {` && |\n| &&
|
||||
` var nest2_model = new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` nest2_model.setSizeLimit(` && json_model_limit && `);` && |\n| &&
|
||||
` nest2_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` sap.z2ui5.oViewNest2.setModel(nest2_model); }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPUP.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oViewPopup.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPOVER.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oViewPopover.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
||||
|
@ -560,7 +566,6 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
|
|||
` var oViewNest2 = sap.ui.xmlview({ viewContent: xml });` && |\n| &&
|
||||
` sap.z2ui5.oControllerNest = oViewNest.getController();` && |\n| &&
|
||||
` sap.z2ui5.oControllerNest2 = oViewNest.getController();` && |\n| &&
|
||||
` sap.z2ui5.checkLogActive = ` && z2ui5_cl_fw_utility=>boolean_abap_2_json( check_logging ) && `;` && |\n| &&
|
||||
` sap.z2ui5.oBody = {};` && |\n| &&
|
||||
` sap.z2ui5.oBody.APP_START = sap.z2ui5.APP_START;` && |\n| &&
|
||||
` sap.z2ui5.oController.Roundtrip();` && |\n| &&
|
||||
|
@ -575,6 +580,8 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
|
|||
`sap.z2ui5.Helper.DateAbapTimestampToDate = (sTimestamp => new sap.gantt.misc.Format.abapTimestampToDate(sTimestamp));` && |\n| &&
|
||||
`sap.z2ui5.Helper.DateAbapDateToDateObject = (d => new Date(d.slice(0,4), (d[4]+d[5])-1, d[6]+d[7]));` && |\n| &&
|
||||
`sap.z2ui5.Helper.DateAbapDateTimeToDateObject = ((d,t = '000000') => new Date(d.slice(0,4), (d[4]+d[5])-1, d[6]+d[7],t.slice(0,2),t.slice(2,4),t.slice(4,6)));` && |\n| &&
|
||||
`sap.z2ui5.JSON_MODEL_LIMIT = ` && json_model_limit && `;` && |\n| &&
|
||||
`sap.z2ui5.checkLogActive = ` && z2ui5_cl_fw_utility=>boolean_abap_2_json( check_logging ) && `;` && |\n| &&
|
||||
lv_add_js && |\n| &&
|
||||
` });` && |\n| &&
|
||||
`</script>` && |\n| &&
|
||||
|
|
|
@ -1,122 +0,0 @@
|
|||
CLASS z2ui5_cl_xml_view_cc DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
||||
METHODS file_uploader
|
||||
IMPORTING
|
||||
!value TYPE clike OPTIONAL
|
||||
!path TYPE clike OPTIONAL
|
||||
!placeholder TYPE clike OPTIONAL
|
||||
!upload TYPE clike OPTIONAL
|
||||
!icononly TYPE clike OPTIONAL
|
||||
!buttononly TYPE clike OPTIONAL
|
||||
!buttontext TYPE clike OPTIONAL
|
||||
!uploadbuttontext TYPE clike OPTIONAL
|
||||
!checkdirectupload TYPE clike OPTIONAL
|
||||
!filetype TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS title
|
||||
IMPORTING
|
||||
title TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS scroll
|
||||
IMPORTING
|
||||
setupdate TYPE clike OPTIONAL
|
||||
items TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS timer
|
||||
IMPORTING
|
||||
finished TYPE clike OPTIONAL
|
||||
delayms TYPE clike OPTIONAL
|
||||
checkrepeat TYPE clike OPTIONAL
|
||||
checkActive TYPE clike OPTIONAL
|
||||
PREFERRED PARAMETER finished
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS constructor
|
||||
IMPORTING
|
||||
view TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
PROTECTED SECTION.
|
||||
DATA mo_view TYPE REF TO z2ui5_cl_xml_view.
|
||||
PRIVATE SECTION.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
||||
CLASS Z2UI5_CL_XML_VIEW_CC IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD constructor.
|
||||
|
||||
me->mo_view = view.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD file_uploader.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `FileUploader`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `placeholder` v = placeholder )
|
||||
( n = `upload` v = upload )
|
||||
( n = `path` v = path )
|
||||
( n = `value` v = value )
|
||||
( n = `iconOnly` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( icononly ) )
|
||||
( n = `buttonOnly` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( buttononly ) )
|
||||
( n = `buttonText` v = buttontext )
|
||||
( n = `uploadButtonText` v = uploadbuttontext )
|
||||
( n = `fileType` v = filetype )
|
||||
( n = `checkDirectUpload` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( checkdirectupload ) ) ) ).
|
||||
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD scroll.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Scroll`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #(
|
||||
( n = `setUpdate` v = setupdate )
|
||||
( n = `items` v = items )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD timer.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Timer`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `delayMS` v = delayms )
|
||||
( n = `finished` v = finished )
|
||||
( n = `checkActive` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( checkActive ) )
|
||||
( n = `checkRepeat` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( checkrepeat ) )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD title.
|
||||
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `Title`
|
||||
ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `title` v = title ) ) ).
|
||||
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
Loading…
Reference in New Issue
Block a user