split custom controls (#1330)

* split custom controls

* update

* Update package.json
This commit is contained in:
oblomov 2024-08-26 07:15:34 +02:00 committed by GitHub
parent 0e7ba63842
commit c70baa86f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
27 changed files with 3 additions and 10309 deletions

View File

@ -5,8 +5,7 @@
"description": "Developing UI5 Apps purely in ABAP.", "description": "Developing UI5 Apps purely in ABAP.",
"scripts": { "scripts": {
"syfixes": "find . -type f -name '*.abap' -exec sed -i -e 's/ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found/ ASSERT 1 = 0/g' {} + ", "syfixes": "find . -type f -name '*.abap' -exec sed -i -e 's/ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found/ ASSERT 1 = 0/g' {} + ",
"delete_mapster": "rm ./src/01/05/z2ui5_cl_cc_imagemapster.clas.abap && rm ./src/01/05/z2ui5_cl_cc_imagemapster.clas.xml", "downport": "rm -rf downport && cp -r src downport && abaplint --fix ./ci/abaplint-downport.jsonc && npm run syfixes",
"downport": "rm -rf downport && cp -r src downport && abaplint --fix ./ci/abaplint-downport.jsonc && npm run syfixes && npm run delete_mapster",
"unit": "echo RUNNING && node output/index.mjs", "unit": "echo RUNNING && node output/index.mjs",
"transpile": "rm -rf output && abap_transpile test/abap_transpile.json", "transpile": "rm -rf output && abap_transpile test/abap_transpile.json",
"test": "npm run downport && npm run transpile && npm run unit", "test": "npm run downport && npm run transpile && npm run unit",

View File

@ -1,10 +0,0 @@
<?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 - cc addons</CTEXT>
</DEVC>
</asx:values>
</asx:abap>
</abapGit>

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_ANIMATECSS</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>animate css</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,170 +0,0 @@
CLASS z2ui5_cl_cc_bwipjs DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES:
BEGIN OF ty_s_barcode,
sym TYPE string,
desc TYPE string,
text TYPE string,
opts TYPE string,
END OF ty_s_barcode.
TYPES ty_t_barcode TYPE STANDARD TABLE OF ty_s_barcode WITH EMPTY KEY.
CONSTANTS cv_src TYPE string VALUE `https://cdnjs.cloudflare.com/ajax/libs/bwip-js/4.1.1/bwip-js-min.js` ##NEEDED.
CLASS-METHODS get_t_barcode_types
RETURNING
VALUE(result) TYPE ty_t_barcode.
CLASS-METHODS get_js_lib_local
RETURNING VALUE(result) TYPE string.
CLASS-METHODS get_js
RETURNING
VALUE(r_js) TYPE string.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS Z2UI5_CL_CC_BWIPJS IMPLEMENTATION.
METHOD get_js.
r_js = ` sap.ui.define("z2ui5/bwipjs", [` && |\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| &&
` init() {` && |\n| &&
|\n| &&
|\n| &&
` },` &&
` onAfterRendering() { ` &&
` if(window.bwipjs == undefined) { const loadScript = (FILE_URL, async = true, type = "text/javascript") => {` && |\n| &&
` return new Promise((resolve, reject) => {` && |\n| &&
` try {` && |\n| &&
` const scriptEle = document.createElement("script");` && |\n| &&
` scriptEle.type = type;` && |\n| &&
` scriptEle.async = async;` && |\n| &&
` scriptEle.src =FILE_URL;` && |\n| &&
` scriptEle.addEventListener("load", (ev) => {` && |\n| &&
` resolve({ status: true });` && |\n| &&
` });` && |\n| &&
` scriptEle.addEventListener("error", (ev) => {` && |\n| &&
` reject({` && |\n| &&
` status: false,` && |\n| &&
` message: ``Failed to load the script ${FILE_URL}``` && |\n| &&
` });` && |\n| &&
` });` && |\n| &&
` document.body.appendChild(scriptEle);` && |\n| &&
` } catch (error) {` && |\n| &&
` reject(error);` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` };` && |\n| &&
` ` && |\n| &&
` this.BusyDialog = new sap.m.BusyDialog( { title : "Loading bwip-js", text : "... now loading the data from a far away server" });` && |\n| &&
` this.BusyDialog.open();` && |\n| &&
` loadScript("https://cdnjs.cloudflare.com/ajax/libs/bwip-js/4.1.1/bwip-js-min.js")` && |\n| &&
` .then( data => {` && |\n| &&
` this.BusyDialog.close();` && |\n| &&
` 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| &&
` .catch( err => {` && |\n| &&
` new sap.m.MessageBox.error('Error on load bwip-js library: ' + err);` && |\n| &&
` this.BusyDialog.close();` && |\n| &&
` }); } ) } else {` && |\n| &&
` 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| &&
` oRm.write( "&lt;canvas id='mycanvas' /&gt;");` && |\n| && |\n| &&
` // The return value is the canvas element` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` });`.
ENDMETHOD.
METHOD get_js_lib_local.
result = ``.
ENDMETHOD.
METHOD get_t_barcode_types.
result = VALUE #(
( sym = 'ean5' desc = 'EAN-5' text = '90200' opts = 'includetext guardwhitespace' )
( sym = 'ean2' desc = 'EAN-2' text = '05' opts = 'includetext guardwhitespace' )
( sym = 'ean13' desc = 'EAN-13' text = '9520123456788' opts = 'includetext guardwhitespace' )
( sym = 'upca' desc = 'UPC-A' text = '012345000058' opts = 'includetext' )
( sym = 'isbn' desc = 'ISBN' text = '978-1-56581-231-4 90000' opts = 'includetext guardwhitespace' )
( sym = 'qrcode' desc = 'QR Code' text = 'http://goo.gl/0bis' opts = 'eclevel=M' ) ).
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_BWIPJS</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>bwip-js - barcode writer in pure javascript</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,128 +0,0 @@
CLASS z2ui5_cl_cc_camera_pic DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS get_js
RETURNING
VALUE(r_js) TYPE string.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS Z2UI5_CL_CC_CAMERA_PIC IMPLEMENTATION.
METHOD get_js.
r_js = ` sap.ui.define("z2ui5/CameraPicture" , [` && |\n| &&
` "sap/ui/core/Control"` && |\n| &&
`], function (Control) {` && |\n| &&
` "use strict";` && |\n| &&
` return Control.extend("z2ui5.CameraPicture", {` && |\n| &&
` metadata: {` && |\n| &&
` properties: {` && |\n| &&
` id: { type: "string" },` && |\n| &&
` value: { type: "string" },` && |\n| &&
` press: { type: "string" },` && |\n| &&
` autoplay: { type: "boolean", defaultValue: true }` && |\n| &&
` },` && |\n| &&
` events: {` && |\n| &&
` "OnPhoto": {` && |\n| &&
` allowPreventDefault: true,` && |\n| &&
` parameters: {` && |\n| &&
` "photo": {` && |\n| &&
` type: "string"` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` },` && |\n| &&
` },` && |\n| &&
|\n| &&
` capture: function (oEvent) {` && |\n| &&
|\n| &&
` var video = document.querySelector("#zvideo");` && |\n| &&
` var canvas = document.getElementById('zcanvas');` && |\n| &&
` var resultb64 = "";` && |\n| &&
` canvas.width = 200;` && |\n| &&
` canvas.height = 200;` && |\n| &&
` canvas.getContext('2d').drawImage(video, 0, 0, 200, 200);` && |\n| &&
` resultb64 = canvas.toDataURL();` && |\n| &&
` this.setProperty("value", resultb64);` && |\n| &&
` this.fireOnPhoto({` && |\n| &&
` "photo": resultb64` && |\n| &&
` });` && |\n| &&
` },` && |\n| &&
|\n| &&
` onPicture: function (oEvent) {` && |\n| &&
|\n| &&
` if (!this._oScanDialog) {` && |\n| &&
` this._oScanDialog = new sap.m.Dialog({` && |\n| &&
` title: "Device Photo Function",` && |\n| &&
` contentWidth: "640px",` && |\n| &&
` contentHeight: "480px",` && |\n| &&
` horizontalScrolling: false,` && |\n| &&
` verticalScrolling: false,` && |\n| &&
` stretchOnPhone: true,` && |\n| &&
` content: [` && |\n| &&
` new sap.ui.core.HTML({` && |\n| &&
` id: this.getId() + 'PictureContainer',` && |\n| &&
` content: '&lt;video width="600px" height="400px" autoplay="true" id="zvideo"&gt;'` && |\n| &&
` }),` && |\n| &&
` new sap.m.Button({` && |\n| &&
` text: "Capture",` && |\n| &&
` press: function (oEvent) {` && |\n| &&
` this.capture();` && |\n| &&
` this._oScanDialog.close();` && |\n| &&
` }.bind(this)` && |\n| &&
` }),` && |\n| &&
` new sap.ui.core.HTML({` && |\n| &&
` content: '&lt;canvas hidden id="zcanvas" style="overflow:auto"&gt;&lt;/canvas&gt;'` && |\n| &&
` }),` && |\n| &&
` ],` && |\n| &&
` endButton: new sap.m.Button({` && |\n| &&
` text: "Cancel",` && |\n| &&
` press: function (oEvent) {` && |\n| &&
` this._oScanDialog.close();` && |\n| &&
` }.bind(this)` && |\n| &&
` }),` && |\n| &&
` });` && |\n| &&
` }` && |\n| &&
|\n| &&
` this._oScanDialog.open();` && |\n| &&
|\n| &&
` setTimeout(function () {` && |\n| &&
` var video = document.querySelector('#zvideo');` && |\n| &&
` if (navigator.mediaDevices.getUserMedia) {` && |\n| &&
` navigator.mediaDevices.getUserMedia({video: { facingMode: { exact: "environment" } } })` && |\n| &&
` .then(function (stream) {` && |\n| &&
` video.srcObject = stream;` && |\n| &&
` })` && |\n| &&
` .catch(function (error) {` && |\n| &&
` console.log("Something went wrong!");` && |\n| &&
` });` && |\n| &&
` }` && |\n| &&
` }.bind(this), 300);` && |\n| &&
|\n| &&
` },` && |\n| &&
|\n| &&
` renderer: function (oRM, oControl) {` && |\n| &&
|\n| &&
` var oButton = new sap.m.Button({` && |\n| &&
` icon: "sap-icon://camera",` && |\n| &&
` text: "Camera",` && |\n| &&
` press: oControl.onPicture.bind(oControl),` && |\n| &&
` });` && |\n| &&
` oRM.renderControl(oButton);` && |\n| &&
|\n| &&
` },` && |\n| &&
` });` && |\n| &&
`});`.
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_CAMERA_PIC</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>device capability - camera picture</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,867 +0,0 @@
CLASS z2ui5_cl_cc_chartjs DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES z2ui5_if_ajson_filter.
INTERFACES if_serializable_object.
" Data
TYPES:
BEGIN OF ty_x_y_r_data,
x TYPE string,
y TYPE string,
r TYPE string,
END OF ty_x_y_r_data.
TYPES ty_x_y_r_data_t TYPE STANDARD TABLE OF ty_x_y_r_data WITH EMPTY KEY.
TYPES ty_bg_color TYPE STANDARD TABLE OF string WITH EMPTY KEY.
TYPES:
BEGIN OF ty_padding,
bottom TYPE string,
top TYPE string,
left TYPE string,
right TYPE string,
END OF ty_padding .
TYPES:
BEGIN OF ty_font,
size TYPE i,
family TYPE string,
weight TYPE string,
style TYPE string,
line_height TYPE string,
END OF ty_font .
TYPES:
BEGIN OF ty_datalabels_lbl,
color TYPE string,
font TYPE ty_font,
END OF ty_datalabels_lbl .
TYPES:
BEGIN OF ty_datalabels_labels,
title TYPE ty_datalabels_lbl,
value TYPE ty_datalabels_lbl,
END OF ty_datalabels_labels .
TYPES:
BEGIN OF ty_datalabels,
align TYPE string,
anchor TYPE string,
background_color TYPE string,
border_color TYPE string,
border_radius TYPE i,
border_width TYPE i,
clamp TYPE abap_bool,
clip TYPE abap_bool,
color TYPE string,
display TYPE abap_bool,
font TYPE ty_font,
formatter TYPE string,
labels TYPE ty_datalabels_labels,
listeners TYPE string,
offset TYPE i,
opacity TYPE i,
padding TYPE ty_padding,
rotation TYPE i,
text_align TYPE string,
text_stroke_color TYPE string,
text_stroke_width TYPE i,
text_shadow_blur TYPE i,
text_shadow_color TYPE string,
END OF ty_datalabels .
TYPES:
BEGIN OF ty_data_venn,
sets TYPE string_table,
value TYPE string,
values TYPE string_table,
END OF ty_data_venn .
TYPES ty_data_venn_t TYPE STANDARD TABLE OF ty_data_venn WITH EMPTY KEY.
TYPES:
BEGIN OF ty_dataset,
label TYPE string,
type TYPE string,
data TYPE string_table,
data_venn TYPE ty_data_venn_t,
data_radial TYPE ty_x_y_r_data_t,
border_width TYPE i,
border_color TYPE string,
border_radius TYPE i,
border_skipped TYPE abap_bool,
show_line TYPE abap_bool,
background_color_t TYPE ty_bg_color,
background_color TYPE string,
hover_offset TYPE i,
order TYPE i,
fill TYPE string,
hidden TYPE abap_bool,
point_style TYPE string,
point_border_color TYPE string,
point_radius TYPE i,
point_hover_radius TYPE i,
rtl TYPE abap_bool,
datalabels TYPE ty_datalabels,
tension TYPE string,
END OF ty_dataset.
TYPES ty_datasets TYPE STANDARD TABLE OF ty_dataset WITH EMPTY KEY.
TYPES:
BEGIN OF ty_data,
labels TYPE string_table,
datasets TYPE ty_datasets,
END OF ty_data .
" Options
TYPES:
BEGIN OF ty_custom_canvas_bg_color,
color TYPE string,
END OF ty_custom_canvas_bg_color.
TYPES:
BEGIN OF ty_autocolors_plugin,
enabled TYPE abap_bool,
mode TYPE string,
offset TYPE i,
repeat TYPE i,
END OF ty_autocolors_plugin .
TYPES:
BEGIN OF ty_title,
text TYPE string,
display TYPE abap_bool,
align TYPE string,
color TYPE string,
full_size TYPE abap_bool,
position TYPE string,
font TYPE ty_font,
padding TYPE ty_padding,
END OF ty_title .
TYPES:
BEGIN OF ty_labels,
box_width TYPE i,
box_height TYPE i,
color TYPE abap_bool,
font TYPE ty_font,
padding TYPE i,
generate_labels TYPE string,
filter TYPE string,
sort TYPE string,
point_style TYPE string,
text_align TYPE string,
use_point_style TYPE abap_bool,
point_style_width TYPE i,
use_border_radius TYPE abap_bool,
border_radius TYPE i,
END OF ty_labels .
TYPES:
BEGIN OF ty_legend,
position TYPE string,
align TYPE string,
display TYPE abap_bool,
max_height TYPE i,
max_width TYPE i,
full_size TYPE i,
on_click TYPE string,
on_hover TYPE string,
on_leave TYPE string,
reverse TYPE abap_bool,
labels TYPE ty_labels,
rtl TYPE abap_bool,
text_direction TYPE string,
title TYPE ty_title,
END OF ty_legend .
TYPES:
BEGIN OF ty_subtitle,
text TYPE string,
display TYPE abap_bool,
color TYPE string,
font TYPE ty_font,
padding TYPE ty_padding,
END OF ty_subtitle .
TYPES:
BEGIN OF ty_callback,
label TYPE string,
footer TYPE string,
before_title TYPE string,
after_title TYPE string,
title TYPE string,
before_body TYPE string,
before_label TYPE string,
label_color TYPE string,
label_text_color TYPE string,
label_point_style TYPE string,
after_label TYPE string,
after_body TYPE string,
before_footer TYPE string,
after_footer TYPE string,
END OF ty_callback .
TYPES:
BEGIN OF ty_tooltip,
callbacks TYPE ty_callback,
mode TYPE string,
intersect TYPE abap_bool,
use_point_style TYPE abap_bool,
enabled TYPE abap_bool,
display_colors TYPE abap_bool,
rtl TYPE abap_bool,
external TYPE string,
position TYPE string,
item_sort TYPE string,
filter TYPE string,
background_color TYPE string,
title_color TYPE string,
title_align TYPE string,
border_color TYPE string,
text_direction TYPE string,
x_align TYPE string,
y_align TYPE string,
title_font TYPE ty_font,
body_font TYPE ty_font,
footer_font TYPE ty_font,
border_width TYPE i,
box_width TYPE i,
box_height TYPE i,
box_padding TYPE i,
title_spacing TYPE i,
title_margin_bottom TYPE i,
body_spacing TYPE i,
footer_spacing TYPE i,
footer_margin_top TYPE i,
caret_padding TYPE i,
caret_size TYPE i,
corner_radius TYPE i,
body_color TYPE string,
multikey_background TYPE string,
body_align TYPE string,
footer_color TYPE string,
footer_align TYPE string,
padding TYPE ty_padding,
END OF ty_tooltip .
TYPES:
BEGIN OF ty_filler,
propagate TYPE abap_bool,
END OF ty_filler .
TYPES:
BEGIN OF ty_deferred,
delay TYPE i,
x_offset TYPE string,
y_offset TYPE string,
END OF ty_deferred.
TYPES:
BEGIN OF ty_label,
background_color TYPE string,
content TYPE string,
display TYPE abap_bool,
font TYPE ty_font,
x_value TYPE string,
y_value TYPE string,
END OF ty_label.
TYPES:
BEGIN OF ty_annotations,
type TYPE string,
border_color TYPE string,
border_width TYPE string,
background_shadow_color TYPE string,
background_color TYPE string,
click TYPE string,
enter TYPE string,
leave TYPE string,
scaleid TYPE string,
value TYPE string,
draw_time TYPE string,
x_max TYPE string,
x_min TYPE string,
x_scaleid TYPE string,
y_scaleid TYPE string,
y_max TYPE string,
y_min TYPE string,
label TYPE ty_label,
sides TYPE string,
radius TYPE string,
font TYPE ty_font,
x_value TYPE string,
y_value TYPE string,
rotation TYPE string,
shadow_blur TYPE string,
shadow_offset_x TYPE string,
shadow_offset_y TYPE string,
END OF ty_annotations.
TYPES:
BEGIN OF ty_shapes,
shape1 TYPE ty_annotations,
shape2 TYPE ty_annotations,
shape3 TYPE ty_annotations,
shape4 TYPE ty_annotations,
shape5 TYPE ty_annotations,
END OF ty_shapes.
TYPES:
BEGIN OF ty_annotation,
annotations TYPE ty_shapes,
END OF ty_annotation.
TYPES:
BEGIN OF ty_plugins,
deferred TYPE ty_deferred,
datalabels TYPE ty_datalabels,
autocolors TYPE ty_autocolors_plugin,
custom_canvas_background_color TYPE ty_custom_canvas_bg_color,
legend TYPE ty_legend,
title TYPE ty_title,
tooltip TYPE ty_tooltip,
filler TYPE ty_filler,
subtitle TYPE ty_subtitle,
annotation TYPE ty_annotation,
END OF ty_plugins .
TYPES:
BEGIN OF ty_point_label,
display TYPE abap_bool,
center_point_labels TYPE abap_bool,
font TYPE ty_font,
backdrop_color TYPE string,
backdrop_padding TYPE ty_padding,
border_radius TYPE i,
callback TYPE string,
padding TYPE i,
END OF ty_point_label .
TYPES:
BEGIN OF ty_ticks,
step_size TYPE i,
count TYPE i,
color TYPE string,
align TYPE string,
cross_align TYPE string,
sample_size TYPE i,
auto_skip TYPE abap_bool,
include_bounds TYPE abap_bool,
mirror TYPE abap_bool,
auto_skip_padding TYPE i,
label_offset TYPE i,
max_rotation TYPE i,
min_rotation TYPE i,
padding TYPE i,
max_ticks_limit TYPE i,
backdrop_color TYPE string,
backdrop_padding TYPE ty_padding,
callback TYPE string,
display TYPE abap_bool,
show_label_backdrop TYPE abap_bool,
text_stroke_color TYPE string,
font TYPE ty_font,
text_stroke_width TYPE i,
z TYPE i,
precision TYPE i,
END OF ty_ticks .
TYPES:
BEGIN OF ty_border,
color TYPE string,
display TYPE abap_bool,
width TYPE i,
dash TYPE i,
dash_offset TYPE i,
z TYPE i,
END OF ty_border .
TYPES:
BEGIN OF ty_grid,
color TYPE string,
border_color TYPE string,
tick_color TYPE string,
border_dash TYPE string,
border_dash_offset TYPE p LENGTH 3 DECIMALS 2,
circular TYPE abap_bool,
line_width TYPE i,
draw_on_chart_area TYPE abap_bool,
draw_ticks TYPE abap_bool,
offset TYPE abap_bool,
tick_border_dash TYPE i,
tick_border_dash_offset TYPE i,
tick_length TYPE i,
tick_width TYPE i,
z TYPE i,
END OF ty_grid .
TYPES:
BEGIN OF ty_angle_lines,
color TYPE string,
border_color TYPE string,
display TYPE abap_bool,
line_width TYPE i,
border_dash TYPE i,
border_dash_offset TYPE i,
END OF ty_angle_lines .
TYPES:
BEGIN OF ty_scale,
begin_at_zero TYPE abap_bool,
min TYPE string,
max TYPE string,
point_labels TYPE ty_point_label,
stacked TYPE abap_bool,
reverse TYPE abap_bool,
align_to_pixels TYPE abap_bool,
clip TYPE abap_bool,
bounds TYPE string,
background_color TYPE string,
type TYPE string,
title TYPE ty_title,
weight TYPE i,
suggested_min TYPE i,
suggested_max TYPE i,
stack_weight TYPE i,
stack TYPE string,
position TYPE string,
ticks TYPE ty_ticks,
border TYPE ty_border,
grid TYPE ty_grid,
offset TYPE abap_bool,
axis TYPE string,
labels TYPE string_table,
angle_lines TYPE ty_angle_lines,
start_angle TYPE i,
END OF ty_scale .
TYPES:
BEGIN OF ty_scales,
y TYPE ty_scale,
x TYPE ty_scale,
r TYPE ty_scale,
END OF ty_scales .
TYPES:
BEGIN OF ty_interaction,
mode TYPE string,
intersect TYPE abap_bool,
include_invisible TYPE abap_bool,
axis TYPE string,
END OF ty_interaction .
TYPES:
BEGIN OF ty_tension,
duration TYPE i,
easing TYPE string,
from TYPE i,
to TYPE i,
loop TYPE abap_bool,
END OF ty_tension .
TYPES:
BEGIN OF ty_animations,
tension TYPE ty_tension,
END OF ty_animations .
TYPES:
BEGIN OF ty_hover,
mode TYPE string,
intersec TYPE abap_bool,
END OF ty_hover .
TYPES:
BEGIN OF ty_layout,
auto_padding TYPE abap_bool,
padding TYPE ty_padding,
END OF ty_layout .
TYPES:
BEGIN OF ty_point,
radius TYPE i,
rotation TYPE i,
border_width TYPE i,
hit_radius TYPE i,
hover_radius TYPE i,
hover_border_width TYPE i,
point_style TYPE string,
background_color TYPE string,
border_color TYPE string,
END OF ty_point .
TYPES:
BEGIN OF ty_line,
tension TYPE i,
border_cap_style TYPE string,
border_width TYPE i,
fill TYPE string,
border_dash TYPE i,
border_dash_offset TYPE i,
border_join_style TYPE string,
cubic_interpolation_mode TYPE string,
cap_bezier_points TYPE abap_bool,
stepped TYPE abap_bool,
background_color TYPE string,
border_color TYPE string,
END OF ty_line .
TYPES:
BEGIN OF ty_bar,
border_width TYPE i,
background_color TYPE string,
border_color TYPE string,
border_skipped TYPE string,
border_radius TYPE i,
inflate_amount TYPE i,
point_style TYPE string,
END OF ty_bar.
TYPES:
BEGIN OF ty_arc,
border_width TYPE i,
background_color TYPE string,
border_color TYPE string,
border_align TYPE string,
border_dash TYPE i,
border_dash_offset TYPE i,
border_join_style TYPE string,
circular TYPE abap_bool,
angle TYPE i,
END OF ty_arc.
TYPES:
BEGIN OF ty_elements,
point TYPE ty_point,
line TYPE ty_line,
bar TYPE ty_bar,
arc TYPE ty_arc,
END OF ty_elements .
TYPES:
BEGIN OF ty_options,
scales TYPE ty_scales,
responsive TYPE abap_bool,
plugins TYPE ty_plugins,
hover TYPE ty_hover,
interaction TYPE ty_interaction,
animations TYPE ty_animations,
layout TYPE ty_layout,
elements TYPE ty_elements,
index_axis TYPE string,
events TYPE string_table,
END OF ty_options .
"ChartJS Configuration
TYPES:
BEGIN OF ty_chart ##NEEDED,
type TYPE string,
data TYPE ty_data,
options TYPE ty_options,
END OF ty_chart.
CLASS-METHODS get_chartjs_local
RETURNING
VALUE(result) TYPE string .
CLASS-METHODS get_chartjs_url
RETURNING
VALUE(result) TYPE string .
CLASS-METHODS get_js_datalabels
RETURNING
VALUE(result) TYPE string .
CLASS-METHODS get_js_autocolors
RETURNING
VALUE(result) TYPE string .
CLASS-METHODS get_js_deferred
RETURNING
VALUE(result) TYPE string .
CLASS-METHODS get_js_venn
RETURNING
VALUE(result) TYPE string .
CLASS-METHODS get_js_wordcloud
RETURNING
VALUE(result) TYPE string .
CLASS-METHODS get_js_annotation
RETURNING
VALUE(result) TYPE string .
CLASS-METHODS load_js
IMPORTING
datalabels TYPE abap_bool DEFAULT abap_false
autocolors TYPE abap_bool DEFAULT abap_false
deferred TYPE abap_bool DEFAULT abap_false
venn TYPE abap_bool DEFAULT abap_false
wordcloud TYPE abap_bool DEFAULT abap_false
annotation TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(result) TYPE string .
CLASS-METHODS load_cc
RETURNING
VALUE(result) TYPE string .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS Z2UI5_CL_CC_CHARTJS IMPLEMENTATION.
METHOD get_chartjs_local.
result = ``.
ENDMETHOD.
METHOD get_chartjs_url.
result = `https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.js`.
ENDMETHOD.
METHOD get_js_annotation.
result = `https://cdn.jsdelivr.net/npm/chartjs-plugin-annotation@3.0.1/dist/chartjs-plugin-annotation.min.js`.
ENDMETHOD.
METHOD get_js_autocolors.
"chartjs-plugin-datalabels must be loaded after the Chart.js library!
result = `https://cdn.jsdelivr.net/npm/chartjs-plugin-autocolors`.
ENDMETHOD.
METHOD get_js_datalabels.
"chartjs-plugin-datalabels must be loaded after the Chart.js library!
result = `https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2`.
ENDMETHOD.
METHOD get_js_deferred.
"chartjs-plugin-datalabels must be loaded after the Chart.js library!
result = `https://cdn.jsdelivr.net/npm/chartjs-plugin-deferred@2.0.0/dist/chartjs-plugin-deferred.min.js`.
ENDMETHOD.
METHOD get_js_venn.
result = `https://cdn.jsdelivr.net/npm/chartjs-chart-venn@4.2.7/build/index.umd.min.js`.
ENDMETHOD.
METHOD get_js_wordcloud.
result = `https://cdn.jsdelivr.net/npm/chartjs-chart-wordcloud@4.3.2/build/index.umd.min.js`.
ENDMETHOD.
METHOD load_cc.
result = `debugger;` && |\n| &&
`sap.ui.define("z2ui5/chartjs", [` && |\n| &&
` "sap/ui/core/Control",` && |\n| &&
`], function (Control) {` && |\n| &&
` "use strict";` && |\n| &&
|\n| &&
` return Control.extend("z2ui5.chartjs", {` && |\n| &&
` metadata: {` && |\n| &&
` properties: {` && |\n| &&
` config: { ` && |\n| &&
` type: "Array" ` && |\n| &&
` },` && |\n| &&
` canvas_id: {` && |\n| &&
` type: "string",` && |\n| &&
` defaultValue: ""` && |\n| &&
` },` && |\n| &&
` width: {` && |\n| &&
` type: "string",` && |\n| &&
` defaultValue: ""` && |\n| &&
` },` && |\n| &&
` height: {` && |\n| &&
` type: "string",` && |\n| &&
` defaultValue: ""` && |\n| &&
` },` && |\n| &&
` style: {` && |\n| &&
` type: "string",` && |\n| &&
` defaultValue: ""` && |\n| &&
` },` && |\n| &&
` view: {` && |\n| &&
` type: "string",` && |\n| &&
` defaultValue: ""` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` },` && |\n| &&
` init() {` && |\n| &&
` },` && |\n| &&
|\n| &&
` setConfig: function(oConfig) { ` && |\n| &&
` var canvas_id = this.getProperty("canvas_id");` && |\n| &&
` var cVar = canvas_id+'_chartjs'; ` && |\n| &&
* ` var cType = oConfig.type;` && |\n| &&
* ` if(cType == 'venn') {` && |\n| &&
* ` var tConfig = JSON.stringify(oConfig);` && |\n| &&
* ` tConfig = tConfig.replace("dataVenn","data");` && |\n| &&
* ` oConfig = JSON.parse(tConfig);` && |\n| &&
* ` } else {` && |\n| &&
* ` this.setProperty("config", oConfig );` && |\n| &&
* ` };` && |\n| &&
` var tConfig = JSON.stringify(oConfig);` && |\n| &&
` tConfig = tConfig.replace("dataVenn","data");` && |\n| &&
` tConfig = tConfig.replace("scaleid","scaleID");` && |\n| &&
` tConfig = tConfig.replaceAll("xScaleid","xScaleID");` && |\n| &&
` tConfig = tConfig.replaceAll("yScaleid","yScaleID");` && |\n| &&
` tConfig = tConfig.replaceAll("dataRadial","data");` && |\n| &&
` oConfig = JSON.parse(tConfig);` && |\n| &&
` this.setProperty("config", oConfig, true );` && |\n| &&
` if(oConfig){ fixJsonLibs(oConfig); };` && |\n| &&
` if(window[cVar]?.data) { window[cVar].data = oConfig.data; }` && |\n| &&
` if(window[cVar]?.options) { window[cVar].options = oConfig.options; }` && |\n| &&
` if(window[cVar]?.config._config.type) { window[cVar].config._config.type = oConfig.type; }` && |\n| &&
` if(window[cVar]){ window[cVar].update(); }` && |\n| &&
` },` && |\n| &&
|\n| &&
` renderer(oRm, oControl) {` && |\n| &&
` var canvas_id = oControl.getProperty("canvas_id");` && |\n| &&
` var width = oControl.getProperty("width");` && |\n| &&
` var height = oControl.getProperty("height");` && |\n| &&
` var style = oControl.getProperty("style");` && |\n| &&
` oRm.write( "&lt;canvas id='" + canvas_id + "' width='" + width + "' height='" + height + "' style = '" + style + "' /&gt;");` && |\n| &&
|\n| &&
` var Model = oControl.getProperty("config");` && |\n| &&
` if(!Model ) { return; };` && |\n| &&
` var cVar = canvas_id+'_chartjs'; ` && |\n| &&
` setTimeout( (oControl) => { ` && |\n| &&
|\n| &&
` var ctx = document.getElementById(canvas_id); ` && |\n| &&
` sap.z2ui5.autocolors = {}; try { sap.z2ui5.autocolors = window['chartjs-plugin-autocolors']; } catch (err){};` && |\n| &&
` sap.z2ui5.ChartDeferred = {}; try { sap.z2ui5.ChartDeferred = window['chartjs-plugin-deferred']; } catch (err){};` && |\n| &&
` window[cVar] = new Chart( ctx, Model );` && |\n| &&
` ` && |\n| &&
` }, 150 , oControl );` && |\n| &&
` },` && |\n| &&
|\n| &&
` });` && |\n| &&
`});`.
ENDMETHOD.
METHOD load_js.
DATA lv_libs TYPE string VALUE ` `.
result = `` && |\n| &&
`var libs = ["` && get_chartjs_url( ) && `"];` && |\n|.
IF datalabels = abap_true.
result = result && `libs.push("` && get_js_datalabels( ) && `");` && |\n|.
IF lv_libs = ` `.
lv_libs = lv_libs && `ChartDataLabels`.
ELSE.
lv_libs = lv_libs && `,` && `ChartDataLabels`.
ENDIF.
ENDIF.
IF autocolors = abap_true.
result = result && `libs.push("` && get_js_autocolors( ) && `");` && |\n|.
IF lv_libs = ` `.
lv_libs = lv_libs && `sap.z2ui5.autocolors `.
ELSE.
lv_libs = lv_libs && `,` && `sap.z2ui5.autocolors `.
ENDIF.
ENDIF.
IF deferred = abap_true.
result = result && `libs.push("` && get_js_deferred( ) && `");` && |\n|.
IF lv_libs = ` `.
lv_libs = lv_libs && `sap.z2ui5.ChartDeferred`.
ELSE.
lv_libs = lv_libs && `,` && `sap.z2ui5.ChartDeferred`.
ENDIF.
ENDIF.
IF annotation = abap_true.
result = result && `libs.push("` && get_js_annotation( ) && `");` && |\n|.
ENDIF.
IF venn = abap_true.
result = result && `libs.push("` && get_js_venn( ) && `");` && |\n|.
ENDIF.
IF wordcloud = abap_true.
result = result && `libs.push("` && get_js_wordcloud( ) && `");` && |\n|.
ENDIF.
result = result && `` && |\n| &&
`var fixJsonLibs = function(data){` && |\n| &&
` if (!data.hasOwnProperty("plugins")) {` && |\n| &&
` data["plugins"] = [` && lv_libs && `];` && |\n| &&
` return;` && |\n| &&
` };` && |\n| &&
`` && |\n| &&
` Object.keys(data).forEach(function(key) {` && |\n| &&
` if(key=="plugins") {` && |\n| &&
` data[key] = [` && lv_libs && `];` && |\n| &&
` };` && |\n| &&
`})};` && |\n| &&
`var loadLibs = function(){` && |\n| &&
` if(libs.length > 0){` && |\n| &&
` var nextLib = libs.shift();` && |\n| &&
` var headTag = document.getElementsByTagName('head')[0];` && |\n| &&
`` && |\n| &&
` var scriptTag = document.createElement('script');` && |\n| &&
` scriptTag.src = nextLib;` && |\n| &&
`` && |\n| &&
` scriptTag.onload = function(e){` && |\n| &&
` loadLibs();` && |\n| &&
` };` && |\n| &&
`` && |\n| &&
` headTag.appendChild(scriptTag);` && |\n| &&
` }` && |\n| &&
`` && |\n| &&
` else return;` && |\n| &&
`` && |\n| &&
`};` && |\n| &&
`loadLibs();`.
ENDMETHOD.
METHOD z2ui5_if_ajson_filter~keep_node.
rv_keep = abap_true.
CASE iv_visit.
WHEN z2ui5_if_ajson_filter=>visit_type-open.
IF is_node-children = 0.
rv_keep = abap_false.
ENDIF.
WHEN z2ui5_if_ajson_filter=>visit_type-value.
CASE is_node-type.
WHEN z2ui5_if_ajson_types=>node_type-boolean.
IF is_node-value = `false`.
rv_keep = abap_false.
ENDIF.
WHEN z2ui5_if_ajson_types=>node_type-number.
IF is_node-value = `0` OR is_node-value = `0.00`.
rv_keep = abap_false.
ENDIF.
WHEN z2ui5_if_ajson_types=>node_type-string.
IF is_node-value = ``.
rv_keep = abap_false.
ENDIF.
ENDCASE.
WHEN z2ui5_if_ajson_filter=>visit_type-close.
IF is_node-children = 0.
rv_keep = abap_false.
ENDIF.
ENDCASE.
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_CHARTJS</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>CHARTJS</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,85 +0,0 @@
CLASS z2ui5_cl_cc_demo_out DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS get_style
RETURNING
VALUE(result) TYPE string.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_cc_demo_out IMPLEMENTATION.
METHOD get_style.
result = `<html:style type="text/css">body {` && |\n| &&
` font-family: Arial;` && |\n| &&
` font-size: 90%;` && |\n| &&
`}` && |\n| &&
`table {` && |\n| &&
` font-family: Arial;` && |\n| &&
` font-size: 90%;` && |\n| &&
`}` && |\n| &&
`caption {` && |\n| &&
` font-family: Arial;` && |\n| &&
` font-size: 90%;` && |\n| &&
` font-weight:bold;` && |\n| &&
` text-align:left;` && |\n| &&
`}` && |\n| &&
`span.heading1 {` && |\n| &&
` font-size: 150%;` && |\n| &&
` color:#000080;` && |\n| &&
` font-weight:bold;` && |\n| &&
`}` && |\n| &&
`span.heading2 {` && |\n| &&
` font-size: 135%;` && |\n| &&
` color:#000080;` && |\n| &&
` font-weight:bold;` && |\n| &&
`}` && |\n| &&
`span.heading3 {` && |\n| &&
` font-size: 120%;` && |\n| &&
` color:#000080;` && |\n| &&
` font-weight:bold;` && |\n| &&
`}` && |\n| &&
`span.heading4 {` && |\n| &&
` font-size: 105%;` && |\n| &&
` color:#000080;` && |\n| &&
` font-weight:bold;` && |\n| &&
`}` && |\n| &&
`span.normal {` && |\n| &&
` font-size: 100%;` && |\n| &&
` color:#000000;` && |\n| &&
` font-weight:normal;` && |\n| &&
`}` && |\n| &&
`span.nonprop {` && |\n| &&
` font-family: Courier New;` && |\n| &&
` font-size: 100%;` && |\n| &&
` color:#000000;` && |\n| &&
` font-weight:400;` && |\n| &&
`}` && |\n| &&
`span.nowrap {` && |\n| &&
` white-space:nowrap;` && |\n| &&
`}` && |\n| &&
`span.nprpnwrp {` && |\n| &&
` font-family: Courier New;` && |\n| &&
` font-size: 100%;` && |\n| &&
` color:#000000;` && |\n| &&
` font-weight:400;` && |\n| &&
` white-space:nowrap;` && |\n| &&
`}` && |\n| &&
`tr.header {` && |\n| &&
` background-color:#D3D3D3;` && |\n| &&
`}` && |\n| &&
`tr.body {` && |\n| &&
` background-color:#EFEFEF;` && |\n| &&
`}` && |\n| &&
`</html:style>`.
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_DEMO_OUT</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>cc for cl_demo_ouput</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,538 +0,0 @@
CLASS z2ui5_cl_cc_driver_js DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_ajson_filter.
CONSTANTS:
BEGIN OF buttons ##NEEDED,
all TYPE string VALUE `['next','previous','close']`,
next TYPE string VALUE `['next']`,
previous TYPE string VALUE `['previous']`,
close TYPE string VALUE `['close']`,
next_previous TYPE string VALUE `['next','previous']`,
next_close TYPE string VALUE `['next','close']`,
previous_close TYPE string VALUE `['previous','close']`,
END OF buttons.
CONSTANTS:
BEGIN OF side ##NEEDED,
top TYPE string VALUE `top`,
right TYPE string VALUE `right`,
bottom TYPE string VALUE `bottom`,
left TYPE string VALUE `left`,
end TYPE string VALUE `end`,
END OF side.
CONSTANTS:
BEGIN OF align ##NEEDED,
start TYPE string VALUE `start`,
center TYPE string VALUE `center`,
end TYPE string VALUE `end`,
END OF align.
TYPES:
BEGIN OF ty_config_steps_popover,
title TYPE string,
description TYPE string,
side TYPE string,
align TYPE string,
show_buttons TYPE string,
disable_buttons TYPE string,
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,
" onPopoverRender?: (popover: PopoverDOM, options: { config: Config; state: State }) => void;
on_popover_render TYPE string,
" onPrevClick?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_next_click TYPE string,
" onPrevClick?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_prev_click TYPE string,
" onCloseClick?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_close_click 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,
" onDeselected?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_deselected TYPE string,
" onHighlightStarted?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_highlight_started TYPE string,
" onHighlighted?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_highlighted TYPE string,
END OF ty_config_steps.
TYPES ty_config_steps_tt TYPE STANDARD TABLE OF ty_config_steps WITH EMPTY KEY.
TYPES:
BEGIN OF ty_config,
steps TYPE ty_config_steps_tt,
animate TYPE abap_bool,
overlay_color TYPE string,
smooth_scroll 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,
" onPopoverRender?: (popover: PopoverDOM, options: { config: Config; state: State }) => void;
on_popover_render TYPE string,
" onHighlightStarted?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_highlight_started TYPE string,
" onHighlighted?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_highlighted TYPE string,
" onDeselected?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_deselected TYPE string,
" onDestroyStarted?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_destroy_started TYPE string,
" onDestroyed?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_destroyed TYPE string,
" onNextClick?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_next_click TYPE string,
" onPrevClick?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_prev_click TYPE string,
" onCloseClick?: (element?: Element, step: DriveStep, options: { config: Config; state: State }) => void;;
on_close_click TYPE string,
END OF ty_config.
CLASS-METHODS get_css_local
RETURNING
VALUE(result) TYPE string.
CLASS-METHODS get_js_local
RETURNING
VALUE(result) TYPE string.
CLASS-METHODS get_js_cc
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.
ENDCLASS.
CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
METHOD get_css_local.
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}` &&
`@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-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-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-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 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}` &&
`.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-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-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-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-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-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-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}`.
ENDMETHOD.
METHOD get_js_cc.
result = `sap.z2ui5.DriverJS = { };` &&
`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_config.
DATA(ls_config) = i_steps_config.
DATA(ls_highlight_config) = i_highlight_config.
DATA(ls_highlight_driver_config) = i_highlight_driver_config.
"load driver object from window object
r_drive_js = `var driver = window.driver.js.driver;` && |\n| &&
`var driverObj = new Object();` && |\n|.
"handle tour
IF i_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' ).
TRY.
DATA(li_ajson) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( ) ).
li_ajson->set( iv_path = `/` iv_val = ls_config ).
* li_ajson = li_ajson->filter( z2ui5_cl_ajson_filter_lib=>create_empty_filter( ) ).
li_ajson = li_ajson->filter( NEW z2ui5_cl_cc_driver_js( ) ).
li_ajson = li_ajson->map( z2ui5_cl_ajson_mapping=>create_to_camel_case( ) ).
li_ajson = li_ajson->map( z2ui5_cl_ajson_mapping=>create_lower_case( ) ).
lv_config_json = li_ajson->stringify( ).
CATCH cx_root.
ENDTRY.
r_drive_js = r_drive_js && `var config = ` && lv_config_json && `;` && |\n| &&
`var iLength = config.steps.length;` && |\n| &&
`for (var i = 0; i &lt; 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| &&
`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 &lt; 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' ).
TRY.
li_ajson = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( ) ).
li_ajson->set( iv_path = `/` iv_val = ls_highlight_driver_config ).
* li_ajson = li_ajson->filter( z2ui5_cl_ajson_filter_lib=>create_empty_filter( ) ).
li_ajson = li_ajson->filter( NEW z2ui5_cl_cc_driver_js( ) ).
li_ajson = li_ajson->map( z2ui5_cl_ajson_mapping=>create_to_camel_case( ) ).
li_ajson = li_ajson->map( z2ui5_cl_ajson_mapping=>create_lower_case( ) ).
lv_highlight_driver_config_jn = li_ajson->stringify( ).
CATCH cx_root.
ENDTRY.
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' ).
TRY.
li_ajson = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( ) ).
li_ajson->set( iv_path = `/` iv_val = ls_highlight_config ).
* li_ajson = li_ajson->filter( z2ui5_cl_ajson_filter_lib=>create_empty_filter( ) ).
li_ajson = li_ajson->filter( NEW z2ui5_cl_cc_driver_js( ) ).
li_ajson = li_ajson->map( z2ui5_cl_ajson_mapping=>create_to_camel_case( ) ).
li_ajson = li_ajson->map( z2ui5_cl_ajson_mapping=>create_lower_case( ) ).
lv_highlight_config_json = li_ajson->stringify( ).
CATCH cx_root.
ENDTRY.
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| &&
`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}` &&
`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(` &&
`[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(` &&
`&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;=(` &&
`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,` &&
`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,` &&
'i=window.innerHeight;o.setAttribute(&quot;viewBox&quot;,`0 0 ${t} ${i}`)}function pe(e){const o=ue(e);document.body.appendChild(o),G(o,t=&gt;{t.target.tagName===&quot;path&quot;&amp;&amp;_(&quot;overlayClick&quot;)}),b(&quot;__overlaySvg&quot;,o)' &&
`}function Y(e){const o=l(&quot;__overlaySvg&quot;);if(!o){pe(e);return}const t=o.firstElementChild;if((t==null?void 0:t.tagName)!==&quot;path&quot;)throw new Error(&quot;no path element found in stage svg&quot;);t.setAttribute(&quot;d&quot;,j(e))` &&
`}function ue(e){const o=window.innerWidth,t=window.innerHeight,i=document.createElementNS(&quot;http://www.w3.org/2000/svg&quot;,&quot;svg&quot;);i.classList.add(&quot;driver-overlay&quot;,&quot;driver-overlay-animated&quot;),i.setAttribute(` &&
'&quot;viewBox&quot;,`0 0 ${o} ${t}`),i.setAttribute(&quot;xmlSpace&quot;,&quot;preserve&quot;),i.setAttribute(&quot;xmlnsXlink&quot;,&quot;http://www.w3.org/1999/xlink&quot;),i.setAttribute(&quot;version&quot;,&quot;1.1&quot;),i.setAttribute(' &&
`&quot;preserveAspectRatio&quot;,&quot;xMinYMin slice&quot;),i.style.fillRule=&quot;evenodd&quot;,i.style.clipRule=&quot;evenodd&quot;,i.style.strokeLinejoin=&quot;round&quot;,i.style.strokeMiterlimit=&quot;2&quot;,i.style.zIndex=&quot;10000&quot;,` &&
`i.style.position=&quot;fixed&quot;,i.style.top=&quot;0&quot;,i.style.left=&quot;0&quot;,i.style.width=&quot;100%&quot;,i.style.height=&quot;100%&quot;;const p=document.createElementNS(&quot;http://www.w3.org/2000/svg&quot;,&quot;path&quot;);return ` &&
'p.setAttribute(&quot;d&quot;,j(e)),p.style.fill=a(&quot;overlayColor&quot;)||&quot;rgb(0,0,0)&quot;,p.style.opacity=`${a(&quot;overlayOpacity&quot;)}`,p.style.pointerEvents=&quot;auto&quot;,p.style.cursor=&quot;auto&quot;,i.appendChild(p),i}' &&
`function j(e)` &&
'{const o=window.innerWidth,t=window.innerHeight,i=a(&quot;stagePadding&quot;)||0,p=a(&quot;stageRadius&quot;)||0,n=e.width+i*2,f=e.height+i*2,w=Math.min(p,n/2,f/2),r=Math.floor(Math.max(w,0)),v=e.x-i+r,s=e.y-i,c=n-r*2,d=f-r*2;return`M${o},0L0,0L0,' &&
'${t}L${o},${t}L${o},0ZM${v},${s} h${c} a${r},${r} 0 0 1 ${r},${r} v${d} a${r},${r} 0 0 1 -${r},${r} h-${c} a${r},${r} 0 0 1 -${r},-${r} v-${d} a${r},${r} 0 0 1 ${r},-${r} z`}function ve(){const e=l(&quot;__overlaySvg&quot;);e&amp;&amp;e.remove()' &&
`}function fe(){const e=document.getElementById(&quot;driver-dummy-element&quot;);if(e)return e;let o=document.createElement(&quot;div&quot;);return o.id=&quot;driver-dummy-element&quot;,o.style.width=&quot;0&quot;,o.style.height=&quot;0&quot;,` &&
`o.style.pointerEvents=&quot;none&quot;,o.style.opacity=&quot;0&quot;,o.style.position=&quot;fixed&quot;,o.style.top=&quot;50%&quot;,o.style.left=&quot;50%&quot;,document.body.appendChild(o),o}function Q(e){const{element:o}=e;let t=typeof ` &&
`o==&quot;string&quot;?document.querySelector(o):o;t||(t=fe()),ge(t,e)}function he(){const e=l(&quot;__activeElement&quot;),o=l(&quot;__activeStep&quot;);e&amp;&amp;(X(e),de(),oe(e,o))}function ge(e,o){const i=Date.now(),p=l(&quot;__activeStep&quot;),` &&
`n=l(` &&
`&quot;__activeElement&quot;)||e,f=!n||n===e,w=e.id===&quot;driver-dummy-element&quot;,r=n.id===&quot;driver-dummy-element&quot;,v=a(&quot;animate&quot;),s=o.onHighlightStarted||a(&quot;onHighlightStarted&quot;),c=(o==null?void 0:o.onHighlighted)||a(` &&
`&quot;onHighlighted&quot;),d=(p==null?void 0:p.onDeselected)||a(&quot;onDeselected&quot;),m=a(),g=l();!f&amp;&amp;d&amp;&amp;d(r?void 0:n,p,{config:m,state:g}),s&amp;&amp;s(w?void 0:e,o,{config:m,state:g});const u=!f&amp;&amp;v;let h=!1;xe(),b(` &&
`&quot;previousStep&quot;,p),b(&quot;previousElement&quot;,n),b(&quot;activeStep&quot;,o),b(&quot;activeElement&quot;,e);const P=()=&gt;{if(l(&quot;__transitionCallback&quot;)!==P)return;const x=Date.now()-i,` &&
`y=400-x&lt;=400/2;o.popover&amp;&amp;y&amp;&amp;!h&amp;&amp;u&amp;&amp;(J(e,o),h=!0),a(&quot;animate&quot;)&amp;&amp;x&lt;400?le(x,400,n,e):(X(e),c&amp;&amp;c(w?void 0:e,o,{config:a(),state:l()}),b(&quot;__transitionCallback&quot;,void 0),b(` &&
`&quot;__previousStep&quot;,p),b(&quot;__previousElement&quot;,n),b(&quot;__activeStep&quot;,o),b(&quot;__activeElement&quot;,e)),window.requestAnimationFrame(P)};b(&quot;__transitionCallback&quot;,P),window.requestAnimationFrame(P),V(e),` &&
`!u&amp;&amp;o.popover&amp;&amp;J(e,o),n.classList.remove(&quot;driver-active-element&quot;,&quot;driver-no-interaction&quot;),n.removeAttribute(&quot;aria-haspopup&quot;),n.removeAttribute(&quot;aria-expanded&quot;),n.removeAttribute(` &&
`&quot;aria-controls&quot;),a(&quot;disableActiveInteraction&quot;)&amp;&amp;e.classList.add(&quot;driver-no-interaction&quot;),e.classList.add(&quot;driver-active-element&quot;),e.setAttribute(&quot;aria-haspopup&quot;,&quot;dialog&quot;),` &&
`e.setAttribute(` &&
`&quot;aria-expanded&quot;,&quot;true&quot;),e.setAttribute(&quot;aria-controls&quot;,&quot;driver-popover-content&quot;)}function we(){var e;(e=document.getElementById(&quot;driver-dummy-element&quot;))==null||e.remove(),document.querySelectorAll(` &&
`&quot;.driver-active-element&quot;).forEach(o=&gt;{o.classList.remove(&quot;driver-active-element&quot;,&quot;driver-no-interaction&quot;),o.removeAttribute(&quot;aria-haspopup&quot;),o.removeAttribute(&quot;aria-expanded&quot;),o.removeAttribute(` &&
`&quot;aria-controls&quot;)})}function A(){const e=l(&quot;__resizeTimeout&quot;);e&amp;&amp;window.cancelAnimationFrame(e),b(&quot;__resizeTimeout&quot;,window.requestAnimationFrame(he))}function me(e){var r;if(!l(&quot;isInitialized&quot;)||!(` &&
`e.key===&quot;Tab&quot;||e.keyCode===9))return;const i=l(&quot;__activeElement&quot;),p=(r=l(&quot;popover&quot;))==null?void 0:r.wrapper,n=q([...p?[p]:[],...i?[i]:[]]),f=n[0],w=n[n.length-1];if(e.preventDefault(),e.shiftKey){const v=n[n.indexOf(` &&
`document.activeElement)-1]||w;v==null||v.focus()}else{const v=n[n.indexOf(document.activeElement)+1]||f;v==null||v.focus()}}function Z(e){var t;((t=a(&quot;allowKeyboardControl&quot;))==null||t)&amp;&amp;(e.key===&quot;Escape&quot;?_(` &&
`&quot;escapePress&quot;):e.key===&quot;ArrowRight&quot;?_(&quot;arrowRightPress&quot;):e.key===&quot;ArrowLeft&quot;&amp;&amp;_(&quot;arrowLeftPress&quot;))}function G(e,o,t){const i=(n,f)=&gt;{const w=n.target;e.contains(w)&amp;&amp;((!t||t(w))` &&
`&amp;&amp;(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation()),f==null||f(n))};document.addEventListener(&quot;pointerdown&quot;,i,!0),document.addEventListener(&quot;mousedown&quot;,i,!0),document.addEventListener(&quot;` &&
`pointerup&quot;,` &&
`i,!0),document.addEventListener(&quot;mouseup&quot;,i,!0),document.addEventListener(&quot;click&quot;,n=&gt;{i(n,o)},!0)}function ye(){window.addEventListener(&quot;keyup&quot;,Z,!1),window.addEventListener(&quot;keydown&quot;,me,!1),` &&
`window.addEventListener(&quot;resize&quot;,A),window.addEventListener(&quot;scroll&quot;,A)}function be(){window.removeEventListener(&quot;keyup&quot;,Z),window.removeEventListener(&quot;resize&quot;,A),window.removeEventListener(&quot;scroll&quot;,` &&
`A)` &&
`}function xe(){const e=l(&quot;popover&quot;);e&amp;&amp;(e.wrapper.style.display=&quot;none&quot;)}function J(e,o){var C,y;let t=l(&quot;popover&quot;);t&amp;&amp;document.body.removeChild(t.wrapper),t=Pe(),document.body.appendChild(t.wrapper)` &&
`;const{title:i,description:p,showButtons:n,disableButtons:f,showProgress:w,nextBtnText:r=a(&quot;nextBtnText&quot;)||&quot;Next &amp;rarr;&quot;,prevBtnText:v=a(&quot;prevBtnText&quot;)||&quot;&amp;larr; Previous&quot;,progressText:s=a(` &&
`&quot;progressText&quot;)||&quot;{current} of {total}&quot;}=o.popover||{};t.nextButton.innerHTML=r,t.previousButton.innerHTML=v,t.progress.innerHTML=s,i?(t.title.innerHTML=i,t.title.style.display=&quot;block&quot;)` &&
`:t.title.style.display=&quot;none&quot;,p?(t.description.innerHTML=p,t.description.style.display=&quot;block&quot;):t.description.style.display=&quot;none&quot;;const c=n||a(&quot;showButtons&quot;),` &&
`d=w||a(&quot;showProgress&quot;)||!1,m=(c==null?void ` &&
`0:c.includes(&quot;next&quot;))||(c==null?void 0:c.includes(&quot;previous&quot;))||d;t.closeButton.style.display=c.includes(&quot;close&quot;)?&quot;block&quot;:&quot;none&quot;,m?(t.footer.style.display=&quot;flex&quot;,` &&
`t.progress.style.display=d?&quot;block&quot;:&quot;none&quot;,t.nextButton.style.display=c.includes(&quot;next&quot;)?&quot;block&quot;:&quot;none&quot;` &&
`,t.previousButton.style.display=c.includes(&quot;previous&quot;)?&quot;block&quot;:&quot;none&quot;)` &&
`:t.footer.style.display=&quot;none&quot;;const g=f||a(&quot;disableButtons&quot;)||[];g!=null&amp;&amp;g.includes(&quot;next&quot;)&amp;&amp;(t.nextButton.disabled=!0,t.nextButton.classList.add(&quot;driver-popover-btn-disabled&quot;)),` &&
`g!=null&amp;&amp;g.includes(&quot;previous&quot;)&amp;&amp;(t.previousButton.disabled=!0,t.previousButton.classList.add(&quot;driver-popover-btn-disabled&quot;)),g!=null&amp;&amp;g.includes(&quot;close&quot;)&amp;&amp;(t.closeButton.disabled=!0,` &&
`t.closeButton.classList.add(&quot;driver-popover-btn-disabled&quot;));const u=t.wrapper;u.style.display=&quot;block&quot;,u.style.left=&quot;&quot;,u.style.top=&quot;&quot;,u.style.bottom=&quot;&quot;,u.style.right=&quot;&quot;,` &&
`u.id=&quot;driver-popover-content&quot;,u.setAttribute(&quot;role&quot;,&quot;dialog&quot;),u.setAttribute(&quot;aria-labelledby&quot;,&quot;driver-popover-title&quot;),u.setAttribute(&quot;aria-describedby&quot;` &&
`,&quot;driver-popover-description&quot;)` &&
';const h=t.arrow;h.className=&quot;driver-popover-arrow&quot;;const P=((C=o.popover)==null?void 0:C.popoverClass)||a(&quot;popoverClass&quot;)||&quot;&quot;;u.className=`driver-popover ${P}`.trim(),G(t.wrapper,k=&gt;{var M,R,I;const T=k.target,H=((' &&
`M=o.popover)==null?void 0:M.onNextClick)||a(&quot;onNextClick&quot;),$=((R=o.popover)==null?void 0:R.onPrevClick)||a(&quot;onPrevClick&quot;),B=((I=o.popover)==null?void 0:I.onCloseClick)||a(&quot;onCloseClick&quot;);if(T.classList.contains(` &&
`&quot;driver-popover-next-btn&quot;))return H?H(e,o,{config:a(),state:l()}):_(&quot;nextClick&quot;);if(T.classList.contains(&quot;driver-popover-prev-btn&quot;))return $?$(e,o,{config:a(),state:l()}):_(&quot;prevClick&quot;);if(T.classList.contains(` &&
`&quot;driver-popover-close-btn&quot;))return B?B(e,o,{config:a(),state:l()}):_(&quot;closeClick&quot;)},k=&gt;!(t!=null&amp;&amp;t.description.contains(k))&amp;&amp;!(t!=null&amp;&amp;t.title.contains(k))&amp;&amp;typeof ` &&
`k.className==&quot;string&quot;&amp;&amp;k.className.includes(&quot;driver-popover&quot;)),b(&quot;popover&quot;,t);const S=((y=o.popover)==null?void 0:y.onPopoverRender)||a(&quot;onPopoverRender&quot;);S&amp;&amp;` &&
`S(t,{config:a(),state:l()}),oe(e,o),V(u)` &&
`;const L=e.classList.contains(&quot;driver-dummy-element&quot;),x=q([u,...L?[]:[e]]);x.length&gt;0&amp;&amp;x[0].focus()}function U(){const e=l(&quot;popover&quot;);if(!(e!=null&amp;&amp;e.wrapper))return;const o=e.wrapper.getBoundingClientRect(),` &&
`t=a(` &&
`&quot;stagePadding&quot;)||0,i=a(&quot;popoverOffset&quot;)||0;return{width:o.width+t+i,height:o.height+t+i,realWidth:o.width,realHeight:o.height}}function ee(e,o){const{elementDimensions:t,popoverDimensions:i,popoverPadding:p,` &&
`popoverArrowDimensions:n}=o;return e===&quot;start&quot;?Math.max(Math.min(t.top-p,window.innerHeight-i.realHeight-n.width),n.width):e===&quot;end&quot;?Math.max(Math.min(t.top-(i==null?void 0:i.realHeight)+t.height+p,window.innerHeight-(i==null?void`
&&
`0:i.realHeight)-n.width),n.width):e===&quot;center&quot;?Math.max(Math.min(t.top+t.height/2-(i==null?void 0:i.realHeight)/2,window.innerHeight-(i==null?void 0:i.realHeight)-n.width),n.width):0}function te(e,o){const{elementDimensions:t,` &&
`popoverDimensions:i,popoverPadding:p,popoverArrowDimensions:n}=o;return e===&quot;start&quot;?Math.max(Math.min(t.left-p,window.innerWidth-i.realWidth-n.width),n.width):e===&quot;end&quot;` &&
`?Math.max(Math.min(t.left-(i==null?void 0:i.realWidth)+t.width+p,` &&
`window.innerWidth-(i==null?void 0:i.realWidth)-n.width),n.width):e===&quot;center&quot;?Math.max(Math.min(t.left+t.width/2-(i==null?void 0:i.realWidth)/2,window.innerWidth-(i==null?void 0:i.realWidth)-n.width),n.width):0}function oe(e,o){const t=l(` &&
`&quot;popover&quot;);if(!t)return;const{align:i=&quot;start&quot;,side:p=&quot;left&quot;}=(o==null?void 0:o.popover)||{},n=i,f=e.id===&quot;driver-dummy-element&quot;?&quot;over&quot;:p,w=a(&quot;stagePadding&quot;)||0,r=U(),` &&
`v=t.arrow.getBoundingClientRect(),s=e.getBoundingClientRect(),c=s.top-r.height;let d=c&gt;=0;const m=window.innerHeight-(s.bottom+r.height);let g=m&gt;=0;const u=s.left-r.width;let h=u&gt;=0;const P=window.innerWidth-(s.right+r.width);let ` &&
`S=P&gt;=0;const L=!d&amp;&amp;!g&amp;&amp;!h&amp;&amp;!S;let x=f;if(f===&quot;top&quot;&amp;&amp;d?S=h=g=!1:f===&quot;bottom&quot;&amp;&amp;g?S=h=d=!1:f===&quot;left&quot;&amp;&amp;h?S=d=g=!1:f===&quot;right&quot;&amp;&amp;S&amp;&amp;(h=d=g=!1),` &&
'f===&quot;over&quot;){const C=window.innerWidth/2-r.realWidth/2,y=window.innerHeight/2-r.realHeight/2;t.wrapper.style.left=`${C}px`,t.wrapper.style.right=&quot;auto&quot;,t.wrapper.style.top=`${y}px`,t.wrapper.style.bottom=&quot;auto&quot;}else if(L)' &&
'{const C=window.innerWidth/2-(r==null?void 0:r.realWidth)/2,y=10;t.wrapper.style.left=`${C}px`,t.wrapper.style.right=&quot;auto&quot;,t.wrapper.style.bottom=`${y}px`,t.wrapper.style.top=&quot;auto&quot;' &&
`}else if(h){const C=Math.min(u,window.innerWidth-(` &&
'r==null?void 0:r.realWidth)-v.width),y=ee(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:v});t.wrapper.style.left=`${C}px`,t.wrapper.style.top=`${y}px`,t.wrapper.style.bottom=&quot;auto&quot;,' &&
`t.wrapper.style.right=&quot;auto&quot;,x=&quot;left&quot;}else if(S){const C=Math.min(P,window.innerWidth-(r==null?void 0:r.realWidth)-v.width),y=ee(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:v})` &&
';t.wrapper.style.right=`${C}px`,t.wrapper.style.top=`${y}px`,t.wrapper.style.bottom=&quot;auto&quot;,t.wrapper.style.left=&quot;auto&quot;,x=&quot;right&quot;}else if(d){const C=Math.min(c,window.innerHeight-r.realHeight-v.width);let y=te(n,' &&
'{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:v});t.wrapper.style.top=`${C}px`,t.wrapper.style.left=`${y}px`,t.wrapper.style.bottom=&quot;auto&quot;,t.wrapper.style.right=&quot;auto&quot;,x=&quot;top&quot;' &&
`}else if(g)` &&
'{const C=Math.min(m,window.innerHeight-(r==null?void 0:r.realHeight)-v.width);let y=te(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:v});t.wrapper.style.left=`${y}px`,t.wrapper.style.bottom=`${C}px`,' &&
`t.wrapper.style.top=&quot;auto&quot;,t.wrapper.style.right=&quot;auto&quot;,x=&quot;bottom&quot;}L?t.arrow.classList.add(&quot;driver-popover-arrow-none&quot;):Ce(n,x,e)}function Ce(e,o,t){const i=l(&quot;popover&quot;);if(!i)return;const ` &&
`p=t.getBoundingClientRect(),n=U(),f=i.arrow,w=n.width,r=window.innerWidth,v=p.width,s=p.left,c=n.height,d=window.innerHeight,m=p.top,g=p.height;f.className=&quot;driver-popover-arrow&quot;;let u=o,h=e;o===&quot;top&quot;?(s+v&lt;=0?(u=&quot;` &&
`right&quot;,` &&
`h=&quot;end&quot;):s+v-w&lt;=0&amp;&amp;(u=&quot;top&quot;,h=&quot;start&quot;),s&gt;=r?(u=&quot;left&quot;,h=&quot;end&quot;):s+w&gt;=r&amp;&amp;(u=&quot;top&quot;,h=&quot;end&quot;)):o===&quot;bottom&quot;?(s+v&lt;=0?(u=&quot;right&quot;,` &&
`h=&quot;start&quot;):s+v-w&lt;=0&amp;&amp;(u=&quot;bottom&quot;,h=&quot;start&quot;),s&gt;=r?(u=&quot;left&quot;,h=&quot;start&quot;):s+w&gt;=r&amp;&amp;(u=&quot;bottom&quot;,h=&quot;end&quot;)):o===&quot;left&quot;?(m+g&lt;=0?(u=&quot;bottom&quot;,` &&
`h=&quot;end&quot;):m+g-c&lt;=0&amp;&amp;(u=&quot;left&quot;,h=&quot;start&quot;),m&gt;=d?(u=&quot;top&quot;,h=&quot;end&quot;):m+c&gt;=d&amp;&amp;(u=&quot;left&quot;,h=&quot;end&quot;)):o===&quot;right&quot;&amp;&amp;(m+g&lt;=0?(u=&quot;bottom&quot;,` &&
'h=&quot;start&quot;):m+g-c&lt;=0&amp;&amp;(u=&quot;right&quot;,h=&quot;start&quot;),m&gt;=d?(u=&quot;top&quot;,h=&quot;start&quot;):m+c&gt;=d&amp;&amp;(u=&quot;right&quot;,h=&quot;end&quot;)),u?(f.classList.add(`driver-popover-arrow-side-${u}`),' &&
'f.classList.add(`driver-popover-arrow-align-${h}`)):f.classList.add(&quot;driver-popover-arrow-none&quot;)}function Pe(){const e=document.createElement(&quot;div&quot;);e.classList.add(&quot;driver-popover&quot;);const o=document.createElement(' &&
`&quot;div&quot;);o.classList.add(&quot;driver-popover-arrow&quot;);const t=document.createElement(&quot;header&quot;);t.id=&quot;driver-popover-title&quot;,t.classList.add(&quot;driver-popover-title&quot;),t.style.display=&quot;none&quot;,` &&
`t.innerText=&quot;Popover Title&quot;;const i=document.createElement(&quot;div&quot;);i.id=&quot;driver-popover-description&quot;,i.classList.add(&quot;driver-popover-description&quot;),i.style.display=&quot;none&quot;,i.innerText=&quot;Popover ` &&
`description is here&quot;;const p=document.createElement(&quot;button&quot;);p.type=&quot;button&quot;,p.classList.add(&quot;driver-popover-close-btn&quot;),p.setAttribute(&quot;aria-label&quot;,&quot;Close&quot;),` &&
`p.innerHTML=&quot;&amp;times;&quot;;const n=document.createElement(&quot;footer&quot;);n.classList.add(&quot;driver-popover-footer&quot;);const f=document.createElement(&quot;span&quot;);f.classList.add(&quot;driver-popover-progress-text&quot;),` &&
`f.innerText=&quot;&quot;;const w=document.createElement(&quot;span&quot;);w.classList.add(&quot;driver-popover-navigation-btns&quot;);const r=document.createElement(&quot;button&quot;);r.type=&quot;button&quot;,r.classList.add(` &&
`&quot;driver-popover-prev-btn&quot;),r.innerHTML=&quot;&amp;larr; Previous&quot;;const v=document.createElement(&quot;button&quot;);return v.type=&quot;button&quot;,v.classList.add(&quot;driver-popover-next-btn&quot;),v.innerHTML=&quot;Next ` &&
`&amp;rarr;&quot;,w.appendChild(r),w.appendChild(v),n.appendChild(f),n.appendChild(w),e.appendChild(p),e.appendChild(o),e.appendChild(t),e.appendChild(i),e.appendChild(n),{wrapper:e,arrow:o,title:t,description:i,footer:n,previousButton:r,nextButton:v,` &&
`closeButton:p,footerButtons:w,progress:f}}function Se(){var o;const e=l(&quot;popover&quot;);e&amp;&amp;((o=e.wrapper.parentElement)==null||o.removeChild(e.wrapper))}const Le=&quot;&quot;;function ke(e={}){z(e);function o(){a(&quot;allowClose&quot;)` &&
`&amp;&amp;v()}function t(){const s=l(&quot;activeIndex&quot;),c=a(&quot;steps&quot;)||[];if(typeof s==&quot;undefined&quot;)return;const d=s+1;c[d]?r(d):v()}function i(){const s=l(&quot;activeIndex&quot;),c=a(&quot;steps&quot;)||[];if(typeof ` &&
`s==&quot;undefined&quot;)return;const d=s-1;c[d]?r(d):v()}function p(s){(a(&quot;steps&quot;)||[])[s]?r(s):v()}function n(){var h;if(l(&quot;__transitionCallback&quot;))return;const c=l(&quot;activeIndex&quot;),d=l(&quot;__activeStep&quot;),m=l(` &&
`&quot;__activeElement&quot;);if(typeof c==&quot;undefined&quot;||typeof d==&quot;undefined&quot;||typeof l(&quot;activeIndex&quot;)==&quot;undefined&quot;)return;const u=((h=d.popover)==null?void 0:h.onPrevClick)||a(&quot;onPrevClick&quot;);` &&
`if(u)return ` &&
`u(m,d,{config:a(),state:l()});i()}function f(){var u;if(l(&quot;__transitionCallback&quot;))return;const c=l(&quot;activeIndex&quot;),d=l(&quot;__activeStep&quot;),m=l(&quot;__activeElement&quot;);if(typeof c==&quot;undefined&quot;||typeof ` &&
`d==&quot;undefined&quot;)return;const g=((u=d.popover)==null?void 0:u.onNextClick)||a(&quot;onNextClick&quot;);if(g)return g(m,d,{config:a(),state:l()});t()}function w(){l(&quot;isInitialized&quot;)||(b(&quot;isInitialized&quot;,!0),` &&
`document.body.classList.add(&quot;driver-active&quot;,a(&quot;animate&quot;)?&quot;driver-fade&quot;:&quot;driver-simple&quot;),ye(),O(&quot;overlayClick&quot;,o),O(&quot;escapePress&quot;,o),O(&quot;arrowLeftPress&quot;,n),` &&
`O(&quot;arrowRightPress&quot;,` &&
`f))}function r(s=0){var H,$,B,M,R,I,ie,ne;const c=a(&quot;steps&quot;);if(!c){console.error(&quot;No steps to drive through&quot;),v();return}if(!c[s]){v();return}b(&quot;__activeOnDestroyed&quot;,document.activeElement),b(&quot;activeIndex&quot;,s)` &&
`;const d=c[s],m=c[s+1],g=c[s-1],u=((H=d.popover)==null?void 0:H.doneBtnText)||a(&quot;doneBtnText&quot;)||&quot;Done&quot;,h=a(&quot;allowClose&quot;),P=typeof(($=d.popover)==null?void 0:$.showProgress)!=&quot;undefined&quot;` &&
`?(B=d.popover)==null?void ` &&
'0:B.showProgress:a(&quot;showProgress&quot;),L=(((M=d.popover)==null?void 0:M.progressText)||a(&quot;progressText&quot;)||&quot;{{current}} of {{total}}&quot;).replace(&quot;{{current}}&quot;,`${s+1}`).replace(&quot;' &&
'{{total}}&quot;,`${c.length}`),x=((' &&
`R=d.popover)==null?void 0:R.showButtons)||a(&quot;showButtons&quot;),C=[&quot;next&quot;,&quot;previous&quot;,...h?[&quot;close&quot;]:[]].filter(_e=&gt;!(x!=null&amp;&amp;x.length)||x.includes(_e)),y=((I=d.popover)==null?void 0:I.onNextClick)||a(` &&
`&quot;onNextClick&quot;),k=((ie=d.popover)==null?void 0:ie.onPrevClick)||a(&quot;onPrevClick&quot;),T=((ne=d.popover)==null?void 0:ne.onCloseClick)||a(&quot;onCloseClick&quot;);Q({...d,popover:{showButtons:C,nextBtnText:m?void 0:u,` &&
`disableButtons:[...g?[]:[&quot;previous&quot;]],showProgress:P,progressText:L,onNextClick:y||(()=&gt;{m?r(s+1):v()}),onPrevClick:k||(()=&gt;{r(s-1)}),onCloseClick:T||(()=&gt;{v()}),...(d==null?void 0:d.popover)||{}}})}function v(s=!0){const c=l(` &&
`&quot;__activeElement&quot;),d=l(&quot;__activeStep&quot;),m=l(&quot;__activeOnDestroyed&quot;),g=a(&quot;onDestroyStarted&quot;);if(s&amp;&amp;g){const P=!c||(c==null?void 0:c.id)===&quot;driver-dummy-element&quot;;g(P?void 0:c,d,` &&
`{config:a(),state:l()})` &&
`;return}const u=(d==null?void 0:d.onDeselected)||a(&quot;onDeselected&quot;),h=a(&quot;onDestroyed&quot;);if(document.body.classList.remove(&quot;driver-active&quot;,&quot;driver-fade&quot;,&quot;driver-simple&quot;),be(),Se(),we(),ve(),ce(),K(),` &&
`c&amp;&amp;d){const P=c.id===&quot;driver-dummy-element&quot;;u&amp;&amp;u(P?void 0:c,d,{config:a(),state:l()}),h&amp;&amp;h(P?void 0:c,d,{config:a(),state:l()})}m&amp;&amp;m.focus()}return{isActive:()=&gt;l(&quot;isInitialized&quot;)||!1,refresh:A,` &&
`drive:(s=0)=&gt;{w(),r(s)},setConfig:z,setSteps:s=&gt;{K(),z({...a(),steps:s})},getConfig:a,getState:l,getActiveIndex:()=&gt;l(&quot;activeIndex&quot;),isFirstStep:()=&gt;l(&quot;activeIndex&quot;)===0,isLastStep:()=&gt;{` &&
`const s=a(&quot;steps&quot;)||[],` &&
`c=l(&quot;activeIndex&quot;);return c!==void 0&amp;&amp;c===s.length-1},getActiveStep:()=&gt;l(&quot;activeStep&quot;),getActiveElement:()=&gt;l(&quot;activeElement&quot;),getPreviousElement:()=&gt;l(&quot;previousElement&quot;),` &&
`getPreviousStep:()=&gt;l(` &&
`&quot;previousStep&quot;),moveNext:t,movePrevious:i,moveTo:p,hasNextStep:()=&gt;{const s=a(&quot;steps&quot;)||[],c=l(&quot;activeIndex&quot;);return c!==void 0&amp;&amp;s[c+1]},hasPreviousStep:()=&gt;{const s=a(&quot;steps&quot;)||[],c=l(` &&
`&quot;activeIndex&quot;);return c!==void 0&amp;&amp;s[c-1]},highlight:s=&gt;{w(),Q({...s,popover:s.popover?{showButtons:[],showProgress:!1,progressText:&quot;&quot;,...s.popover}:void 0})},destroy:()=&gt;{v(!1)}}}return ` &&
`D.driver=ke,Object.defineProperty(` &&
`D,Symbol.toStringTag,{value:&quot;Module&quot;}),D}({});`.
ENDMETHOD.
METHOD z2ui5_if_ajson_filter~keep_node.
rv_keep = abap_true.
CASE iv_visit.
WHEN z2ui5_if_ajson_filter=>visit_type-open.
IF is_node-children = 0.
rv_keep = abap_false.
ENDIF.
WHEN z2ui5_if_ajson_filter=>visit_type-value.
CASE is_node-type.
WHEN z2ui5_if_ajson_types=>node_type-boolean.
IF is_node-value = `false`.
rv_keep = abap_false.
ENDIF.
WHEN z2ui5_if_ajson_types=>node_type-number.
IF is_node-value = `0` OR is_node-value = `0.00`.
rv_keep = abap_false.
ENDIF.
WHEN z2ui5_if_ajson_types=>node_type-string.
IF is_node-value = ``.
rv_keep = abap_false.
ENDIF.
ENDCASE.
WHEN z2ui5_if_ajson_filter=>visit_type-close.
IF is_node-children = 0.
rv_keep = abap_false.
ENDIF.
ENDCASE.
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_DRIVER_JS</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>driverjs - product tours, highlights, contextual help &amp; more</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,104 +0,0 @@
CLASS z2ui5_cl_cc_font_awesome DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS get_js_icon
IMPORTING
!i_font_uri TYPE clike
RETURNING
VALUE(r_js) TYPE string .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_cc_font_awesome IMPLEMENTATION.
METHOD get_js_icon.
r_js = `` && |\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| &&
* ` 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| &&
* ` 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| &&
* ` 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| &&
* ` 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| &&
* ` 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| &&
* ` 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| &&
* ` 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| &&
* ` 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| &&
* ` metadata: ` && lcl_metadata=>get_fonts_metadata( ) && |\n| &&
* ` metadata: oFontMetadata` && |\n| &&
* ` fontURI: "` && font_uri && `"` && |\n| &&
* ` lazy: true` && |\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: "` && i_font_uri && `",` && |\n| &&
` lazy: true` && |\n| &&
` }))` && |\n| &&
`})`.
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_FONT_AWESOME</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>font awsome icons library</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_IMAGEMAPSTER</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>imagemapster</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,111 +0,0 @@
class Z2UI5_CL_CC_MESSAGE_M definition
public
final
create public .
public section.
types:
BEGIN OF ty_s_item,
message TYPE string,
description TYPE string,
type TYPE string,
target TYPE string,
additionaltext TYPE string,
date TYPE string,
descriptionurl TYPE string,
persistent TYPE string,
END OF ty_s_item .
types ty_t_items TYPE STANDARD TABLE OF ty_s_item WITH EMPTY KEY ##NEEDED.
class-methods GET_JS
returning
value(RESULT) type STRING .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS Z2UI5_CL_CC_MESSAGE_M IMPLEMENTATION.
METHOD GET_JS.
result = `` && |\n| &&
`sap.ui.define("z2ui5/MessageManager", [` && |\n| &&
` "sap/ui/core/Control",` && |\n| &&
`], function (Control) {` && |\n| &&
` "use strict";` && |\n| &&
|\n| &&
` return Control.extend("z2ui5.MessageManager", {` && |\n| &&
` metadata: {` && |\n| &&
` properties: {` && |\n| &&
` items: { type: "Array" }` && |\n| &&
` }` && |\n| &&
` },` && |\n| &&
` init() {` && |\n| &&
` if (!sap.z2ui5.oMessageManager){` && |\n| &&
` sap.z2ui5.oMessageManager = {};` && |\n| &&
` sap.z2ui5.oMessageManager = new sap.ui.core.message.MessageManager();` && |\n| &&
` }` && |\n| &&
` },` && |\n| &&
|\n| &&
` Messaging2Model( ){` && |\n| &&
` var oData = sap.z2ui5.oMessageManager.getMessageModel().getData();` && |\n| &&
` var Model = [];` && |\n| &&
` oData.forEach(element => {` && |\n| &&
` Model.push( { ` && |\n| &&
` MESSAGE : element.message , ` && |\n| &&
` DESCRIPTION : element.description , ` && |\n| &&
` TYPE : element.type, ` && |\n| &&
` TARGET : element.aTargets[0] , ` && |\n| &&
` ADDITIONALTEXT : element.additionalText , ` && |\n| &&
` DATE : element.date , ` && |\n| &&
` DESCRIPTIONURL : element.descriptionUrl, ` && |\n| &&
` PERSISTENT : element.persistent } );` && |\n| &&
` });` && |\n| &&
` this.setProperty("items", Model, true );` && |\n| &&
` },` && |\n| &&
|\n| &&
` Model2Messaging( ){` && |\n| &&
* ` debugger;` && |\n| &&
` var Model = this.getProperty("items");` && |\n| &&
` if(!Model) { return; }` && |\n| &&
|\n| &&
` Model.forEach(element => {` && |\n| &&
` var target = element.TARGET.split("--")[1];` && |\n| &&
` if ( target == undefined ) { target = element.TARGET }` && |\n| &&
` var oMessage = new sap.ui.core.message.Message({` && |\n| &&
` message: element.MESSAGE,` && |\n| &&
` description: element.DESCRIPTION,` && |\n| &&
` type: element.TYPE,` && |\n| &&
` target : sap.z2ui5.oView.getId( 'testINPUT' ) + '--' + target,` && |\n| &&
` additionalText : element.ADDITIONALTEXT , ` && |\n| &&
` date : element.DATE , ` && |\n| &&
` descriptionUrl : element.DESCRIPTIONURL, ` && |\n| &&
` persistent : element.PERSISTENT,` && |\n| &&
` processor : this.oMessageProcessor` && |\n| &&
` });` && |\n| &&
` sap.z2ui5.oMessageManager.addMessages(oMessage) ;` && |\n| &&
` });` && |\n| &&
` },` && |\n| &&
|\n| &&
` renderer(oRm, oControl) {` && |\n| &&
` if(oControl.isInitialized) { return; }` && |\n| &&
` debugger;` && |\n| &&
` var resBinding = new sap.ui.model.ListBinding(sap.z2ui5.oMessageManager.getMessageModel(), "/" );` && |\n| &&
` resBinding.attachChange(oControl.Messaging2Model.bind(oControl));` && |\n| &&
` sap.z2ui5.oMessageManager.registerObject(sap.z2ui5.oView, true);` && |\n| &&
` oControl.isInitialized = true;` && |\n| &&
* ` setTimeout( (oControl) => { ` && |\n| &&
* ` ` && |\n| &&
* ` ` && |\n| &&
* ` }, 50 , oControl );` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
`});`.
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_MESSAGE_M</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>UI5 Message Manager Control</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,116 +0,0 @@
CLASS z2ui5_cl_cc_messaging DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES:
BEGIN OF ty_s_item,
message TYPE string,
description TYPE string,
type TYPE string,
target TYPE string,
additionaltext TYPE string,
date TYPE string,
descriptionurl TYPE string,
persistent TYPE string,
END OF ty_s_item .
TYPES ty_t_items TYPE STANDARD TABLE OF ty_s_item WITH EMPTY KEY ##NEEDED.
CLASS-METHODS get_js
RETURNING
VALUE(result) TYPE string .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS Z2UI5_CL_CC_MESSAGING IMPLEMENTATION.
METHOD get_js.
result = `try { ` && |\n| &&
`sap.ui.define("z2ui5/Messaging",[` && |\n| &&
` "sap/ui/core/Control",` && |\n| &&
` "sap/ui/core/Messaging",` && |\n| &&
`], (Control, Messaging) => {` && |\n| &&
` "use strict";` && |\n| &&
|\n| &&
` return Control.extend("z2ui5.Messaging", {` && |\n| &&
` metadata: {` && |\n| &&
` properties: {` && |\n| &&
` items: { type: "Array" }` && |\n| &&
` }` && |\n| &&
` },` && |\n| &&
` init() {` && |\n| &&
` if (!sap.z2ui5.oMessaging){` && |\n| &&
` sap.z2ui5.oMessaging = {};` && |\n| &&
` sap.z2ui5.oMessaging.oMessageProcessor = new sap.ui.core.message.ControlMessageProcessor();` && |\n| &&
` sap.z2ui5.oMessaging.oMessageManager = sap.ui.getCore().getMessageManager();` && |\n| &&
` sap.z2ui5.oMessaging.oMessageManager = Messaging;` && |\n| &&
` sap.z2ui5.oMessaging.oMessageManager.registerMessageProcessor(sap.z2ui5.oMessaging.oMessageProcessor);` && |\n| &&
` }` && |\n| &&
` },` && |\n| &&
|\n| &&
` onModelChange(oEvent) {` && |\n| &&
` this.Messaging2Model();` && |\n| &&
` },` && |\n| &&
|\n| &&
` Messaging2Model( ){` && |\n| &&
` var oData = Messaging.getMessageModel().getData();` && |\n| &&
` var Model = [];` && |\n| &&
` oData.forEach(element => {` && |\n| &&
` Model.push( { ` && |\n| &&
` MESSAGE : element.message , ` && |\n| &&
` DESCRIPTION : element.description , ` && |\n| &&
` TYPE : element.type, ` && |\n| &&
` TARGET : element.aTargets[0] , ` && |\n| &&
` ADDITIONALTEXT : element.additionalText , ` && |\n| &&
` DATE : element.date , ` && |\n| &&
` DESCRIPTIONURL : element.descriptionUrl, ` && |\n| &&
` PERSISTENT : element.persistent } );` && |\n| &&
` });` && |\n| &&
` this.setProperty("items", Model, true );` && |\n| &&
` },` && |\n| &&
|\n| &&
` Model2Messaging( ){` && |\n| &&
` var Model = this.getProperty("items");` && |\n| &&
` if(!Model) { return; }` && |\n| &&
|\n| &&
` Model.forEach(element => {` && |\n| &&
` var target = element.TARGET.split("--")[1];` && |\n| &&
` if ( target == undefined ) { target = element.TARGET }` && |\n| &&
` var oMessage = new sap.ui.core.message.Message({` && |\n| &&
` message: element.MESSAGE,` && |\n| &&
` description: element.DESCRIPTION,` && |\n| &&
` type: element.TYPE,` && |\n| &&
` target : sap.z2ui5.oView.getId( 'testINPUT' ) + '--' + target,` && |\n| &&
` additionalText : element.ADDITIONALTEXT , ` && |\n| &&
` date : element.DATE , ` && |\n| &&
` descriptionUrl : element.DESCRIPTIONURL, ` && |\n| &&
` persistent : element.PERSISTENT,` && |\n| &&
` processor : this.oMessageProcessor` && |\n| &&
` });` && |\n| &&
` Messaging.addMessages(oMessage) ;` && |\n| &&
` });` && |\n| &&
` var resBinding = new sap.ui.model.ListBinding(Messaging.getMessageModel(), "/" );` && |\n| &&
` resBinding.attachChange(this.onModelChange.bind(this));` && |\n| &&
` },` && |\n| &&
|\n| &&
` renderer(oRm, oControl) {` && |\n| &&
` if(oControl.isInitialized) { return; }` && |\n| &&
` oControl.Model2Messaging();` && |\n| &&
` Messaging.registerObject(sap.z2ui5.oView, true);` && |\n| &&
` oControl.isInitialized = true;` && |\n| &&
` setTimeout( (oControl) => { ` && |\n| &&
` ` && |\n| &&
` ` && |\n| &&
` }, 50 , oControl );` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
`}); } catch (e) { debugger; }`.
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_MESSAGING</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>UI5 Messaging Control</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,167 +0,0 @@
CLASS z2ui5_cl_cc_spreadsheet DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES z2ui5_if_ajson_filter.
CLASS-METHODS get_js
IMPORTING
!i_columnconfig TYPE clike OPTIONAL
RETURNING
VALUE(r_js) TYPE string .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS Z2UI5_CL_CC_SPREADSHEET IMPLEMENTATION.
METHOD get_js.
DATA lv_column_config TYPE string.
lv_column_config = i_columnconfig.
IF lv_column_config IS INITIAL.
lv_column_config = `''`.
ENDIF.
r_js = ` sap.ui.define("z2ui5/ExportSpreadsheet" , [` && |\n| &&
` "sap/ui/core/Control",` && |\n| &&
` "sap/m/Button",` && |\n| &&
* ` "sap/ui/export/Spreadsheet"` && |\n| &&
* ` ], function (Control, Button, Spreadsheet) {` && |\n| &&
` ], function (Control, Button) {` && |\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| &&
` tooltip: {` && |\n| &&
` type: "string",` && |\n| &&
` defaultValue: ""` && |\n| &&
` },` && |\n| &&
` columnconfig: { ` && |\n| &&
` type: "Array" ` && |\n| &&
` },` && |\n| &&
` text: {` && |\n| &&
` type: "string",` && |\n| &&
` defaultValue: ""` && |\n| &&
` }` && |\n| &&
` },` && |\n| &&
|\n| &&
|\n| &&
` aggregations: {` && |\n| &&
` },` && |\n| &&
` events: { },` && |\n| &&
` renderer: null` && |\n| &&
` },` && |\n| &&
|\n| &&
` setColumnconfig: function(oConfig) { ` && |\n| &&
* ` oConfig = JSON.parse(oConfig);` && |\n| &&
` this.setProperty("columnconfig", oConfig, true );` && |\n| &&
` },` && |\n| &&
|\n| &&
` renderer: function (oRm, oControl) {` && |\n| &&
` var checkVersion = sap.ui.getVersionInfo().gav.includes('com.sap.ui5') ? true : false;` && |\n| &&
|\n| &&
` oControl.oExportButton = new Button({` && |\n| &&
` text: oControl.getProperty("text"),` && |\n| &&
` icon: oControl.getProperty("icon"), ` && |\n| &&
` type: oControl.getProperty("type"), ` && |\n| &&
` enabled: checkVersion,` && |\n| &&
` tooltip: !checkVersion ? 'Not Available on OpenUI5 SDK' : oControl.getProperty("tooltip") , ` && |\n| &&
` press: function (oEvent) { ` && |\n| &&
|\n| &&
` var aCols = oControl.getProperty("columnconfig");` && |\n| &&
` if( !aCols ) { aCols = ` && lv_column_config && `; }` && |\n| &&
|\n| &&
` var oBinding, oSettings, oSheet, vTableId, vViewPrefix,vPrefixTableId;` && |\n| &&
` vTableId = oControl.getProperty("tableId")` && |\n| &&
` vPrefixTableId = sap.z2ui5.oView.createId( vTableId );` && |\n| &&
` var oTable;` && |\n| &&
` if (!oTable) { oTable = sap.z2ui5.oView.byId(vTableId); };` && |\n| &&
` if (!oTable) { oTable = sap.z2ui5.oViewNest.byId(vTableId); };` && |\n| &&
` if (!oTable) { oTable = sap.z2ui5.oViewNest2.byId(vTableId); };` && |\n| &&
` if (!oTable) { oTable = sap.z2ui5.oViewPopup.Fragment.byId('popupId',vTableId); };` && |\n| &&
` if (!oTable) { oTable = sap.z2ui5.oViewPopover.byId(vTableId); };` && |\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| &&
` sap.ui.require(["sap/ui/export/Spreadsheet"], function(Spreadsheet) {` && |\n| &&
` oSheet = new Spreadsheet(oSettings);` && |\n| &&
` oSheet.build()` && |\n| &&
` .then(function() {` && |\n| &&
` }).finally(function() {` && |\n| &&
` oSheet.destroy();` && |\n| &&
` });` && |\n| &&
` });` && |\n| &&
` }.bind(oControl)` && |\n| &&
` });` && |\n| &&
|\n| &&
` oRm.renderControl(oControl.oExportButton);` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` });`.
ENDMETHOD.
METHOD z2ui5_if_ajson_filter~keep_node.
rv_keep = abap_true.
CASE iv_visit.
WHEN z2ui5_if_ajson_filter=>visit_type-open.
IF is_node-children = 0.
rv_keep = abap_false.
ENDIF.
WHEN z2ui5_if_ajson_filter=>visit_type-value.
CASE is_node-type.
WHEN z2ui5_if_ajson_types=>node_type-boolean.
IF is_node-value = `false`.
rv_keep = abap_false.
ENDIF.
WHEN z2ui5_if_ajson_types=>node_type-number.
IF is_node-value = `0` OR is_node-value = `0.00`.
rv_keep = abap_false.
ENDIF.
WHEN z2ui5_if_ajson_types=>node_type-string.
IF is_node-value = ``.
rv_keep = abap_false.
ENDIF.
ENDCASE.
WHEN z2ui5_if_ajson_filter=>visit_type-close.
IF is_node-children = 0.
rv_keep = abap_false.
ENDIF.
ENDCASE.
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_SPREADSHEET</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>UI5 Spreadheet Control</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,272 +0,0 @@
class Z2UI5_CL_CC_VALIDATOR definition
public
final
create public .
public section.
types:
BEGIN OF ty_constraints,
type TYPE string,
format TYPE string,
min_length TYPE int4,
max_length TYPE int4,
minimum TYPE int4,
maximum TYPE int4,
END OF ty_constraints .
types:
BEGIN OF ty_type,
email TYPE ty_constraints,
number TYPE ty_constraints,
date TYPE ty_constraints,
END OF ty_type .
types:
BEGIN OF ty_validation_schema,
properties TYPE ty_type,
END OF ty_validation_schema .
class-methods GET_JS
importing
!IS_VALIDATION type TY_VALIDATION_SCHEMA
!IV_VIEW type STRING
returning
value(RESULT) type STRING .
class-methods LOAD_AJV
returning
value(RESULT) type STRING .
class-methods VALIDATE_FIELDS
returning
value(RESULT) type STRING .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS Z2UI5_CL_CC_VALIDATOR IMPLEMENTATION.
METHOD GET_JS.
DATA(lv_schema_json) = ``.
* TRY.
* DATA(li_ajson) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( ) ).
* li_ajson->set( iv_path = `/` iv_val = is_validation ).
* li_ajson = li_ajson->map( z2ui5_cl_ajson_mapping=>create_to_camel_case( ) ).
* li_ajson = li_ajson->map( z2ui5_cl_ajson_mapping=>create_lower_case( ) ).
* lv_schema_json = li_ajson->stringify( ).
*
* CATCH cx_root.
* ENDTRY.
lv_schema_json = /ui2/cl_json=>serialize(
data = is_validation
compress = abap_true
* name =
pretty_name = 'X'
* type_descr =
* assoc_arrays =
* ts_as_iso8601 =
* expand_includes =
* assoc_arrays_opt =
* numc_as_string =
* name_mappings =
* conversion_exits =
).
CASE iv_view.
WHEN 'MAIN'.
DATA(lv_view) = `sap.z2ui5.oView`.
WHEN 'NEST'.
lv_view = `sap.z2ui5.oViewNest`.
WHEN 'NEST2'.
lv_view = `sap.z2ui5.oViewNest2`.
WHEN 'POPUP'.
lv_view = `sap.z2ui5.oViewPopup.Fragment`.
WHEN 'POPOVER'.
lv_view = `sap.z2ui5.oViewPopover.Fragment`.
ENDCASE.
result = result && |\n| && `debugger;if (!z2ui5.Validator) { sap.ui.define("z2ui5/Validator" , ["sap/ui/base/Object","sap/ui/core/library","sap/ui/core/Control"], ` && |\n| &&
` (UI5Object,coreLibrary,UI5Control)=>{` && |\n| &&
` "use strict";` && |\n| &&
` const VALID_UI5_CONTROL_PROPERTIES = ['dateValue', 'selectedKey', 'selected', 'value'];` && |\n| &&
` const DEFAULT_AJV_OPTIONS = {` && |\n| &&
` $data: true,` && |\n| &&
` allErrors: true,` && |\n| &&
` coerceTypes: true,` && |\n| &&
` errorDataPath: 'property'` && |\n| &&
` };` && |\n| &&
` const Validator = UI5Object.extend('z2ui5.Validator', {` && |\n| &&
` constructor: function(view, schema, opt) {` && |\n| &&
` var schema = ` && lv_schema_json && `;` && |\n| &&
` var view = ` && lv_view && `;` && |\n| &&
` if (!view || !schema) { ` && |\n| &&
` throw new Error('Missing parameters!');` && |\n| &&
` }` && |\n| &&
` UI5Object.apply(this, arguments);` && |\n| &&
` ` && |\n| &&
` const ajv = new Ajv(opt || DEFAULT_AJV_OPTIONS);` && |\n| &&
` this._validate = ajv.compile(schema);` && |\n| &&
` this._view = view;` && |\n| &&
` this._errors = null;` && |\n| &&
` this._payload = null;` && |\n| &&
` this._validProperties = [];` && |\n| &&
` this.addValidProperties(VALID_UI5_CONTROL_PROPERTIES);` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` Validator.prototype.destroy = function() {` && |\n| &&
` this._validate = null;` && |\n| &&
` this._view = null;` && |\n| &&
` this._errors = null;` && |\n| &&
` this._payload = null;` && |\n| &&
` this._validProperties = null;` && |\n| &&
` };` && |\n| &&
` Validator.prototype.validate = function() {` && |\n| &&
` const controls = this._getControls();` && |\n| &&
` this._payload = this._getPayloadToValidate(controls);` && |\n| &&
` this._clearControlStatus(controls);` && |\n| &&
` const isValid = this._validate(this._payload);` && |\n| &&
` if (isValid) {` && |\n| &&
` this._errors = null;` && |\n| &&
` } else {` && |\n| &&
` this._errors = this._processValidationErrors(this._validate.errors);` && |\n| &&
` }` && |\n| &&
` return isValid;` && |\n| &&
` };` && |\n| &&
` Validator.prototype.getErrors = function() {` && |\n| &&
` return this._errors;` && |\n| &&
` };` && |\n| &&
` Validator.prototype.getPayloadUsedInValidation = function() {` && |\n| &&
` return this._payload;` && |\n| &&
` };` && |\n| &&
` Validator.prototype.getValidProperties = function() {` && |\n| &&
` return this._validProperties.map(function _getValidProperties(validProperty) {` && |\n| &&
` return validProperty;` && |\n| &&
` });` && |\n| &&
` };` && |\n| &&
` Validator.prototype.addValidProperties = function(validProperties) {` && |\n| &&
` const that = this;` && |\n| &&
` validProperties.forEach(function _addValidProperty(property) {` && |\n| &&
` that._validProperties.push(property);` && |\n| &&
` });` && |\n| &&
` };` && |\n| &&
` Validator.prototype._getControls = function() {` && |\n| &&
` const that = this;` && |\n| &&
` if (this._validate.schema &amp;&amp; this._validate.schema.properties) {` && |\n| &&
` return Object.keys(this._validate.schema.properties)` && |\n| &&
` .map(function _mapSchemaProperties(key) {` && |\n| &&
` const control = that._view.byId(key);` && |\n| &&
` return (control instanceof UI5Control) ? control : null;` && |\n| &&
` })` && |\n| &&
` .filter(function _filterSchemaProperties(control) {` && |\n| &&
` return (control);` && |\n| &&
` });` && |\n| &&
` } else {` && |\n| &&
` return [];` && |\n| &&
` }` && |\n| &&
` };` && |\n| &&
` Validator.prototype._getPayloadToValidate = function(controls) {` && |\n| &&
` const that = this;` && |\n| &&
` const payload = {};` && |\n| &&
` controls.forEach(function _setPayloadProperty(control) {` && |\n| &&
` const viewIdIndex = control.getId().lastIndexOf('-') + 1;` && |\n| &&
` const controlId = control.getId().substring(viewIdIndex);` && |\n| &&
` payload[controlId] = that._getControlValue(control);` && |\n| &&
` });` && |\n| &&
` return payload;` && |\n| &&
` };` && |\n| &&
` Validator.prototype._getControlValue = function(control) {` && |\n| &&
` let value = '';` && |\n| &&
` const controlProperties = Object.keys(control.mProperties);` && |\n| &&
` this._validProperties.forEach(function _filterControlProperties(validProperty) {` && |\n| &&
` if (!value) {` && |\n| &&
` const isValidProperty = controlProperties.find(function _findValidProperty(controlProperty) {` && |\n| &&
` return (controlProperty === validProperty);` && |\n| &&
` });` && |\n| &&
` if (isValidProperty) {` && |\n| &&
` const getPropertyMethod = ['get', validProperty.substring(0, 1).toUpperCase(), validProperty.substring(1)].join('');` && |\n| &&
` if (control[getPropertyMethod]) {` && |\n| &&
` value = control[getPropertyMethod]();` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` return value;` && |\n| &&
` };` && |\n| &&
` Validator.prototype._clearControlStatus = function(controls) {` && |\n| &&
` controls.forEach(function _setValueState(control) {` && |\n| &&
` if (control &amp;&amp; control.setValueState) {` && |\n| &&
` control.setValueState(coreLibrary.ValueState.None);` && |\n| &&
` }` && |\n| &&
` if (control &amp;&amp; control.setValueStateText) {` && |\n| &&
` control.setValueStateText();` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` };` && |\n| &&
` Validator.prototype._setControlErrorStatus = function(control, message) {` && |\n| &&
` if (control &amp;&amp; control.setValueState) {` && |\n| &&
` control.setValueState(coreLibrary.ValueState.Error);` && |\n| &&
` }` && |\n| &&
` if (control &amp;&amp; control.setValueStateText) {` && |\n| &&
` control.setValueStateText(message);` && |\n| &&
` }` && |\n| &&
` };` && |\n| &&
` Validator.prototype._processValidationErrors = function(errors) {` && |\n| &&
` const that = this;` && |\n| &&
` const errorMessageObjects = [];` && |\n| &&
` errors.forEach(function _mapErrors(err) {` && |\n| &&
` const controlId = err.dataPath.substring(1);` && |\n| &&
` const control = that._view.byId(controlId);` && |\n| &&
` if (control) {` && |\n| &&
` that._setControlErrorStatus(control, err.message);` && |\n| &&
` // errorMessageObjects.push(that._createErrorMessageObject(control, err.message, ''));` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` return errorMessageObjects;` && |\n| &&
` };` && |\n| &&
` ` && |\n| &&
` return Validator;` && |\n| &&
` ` && |\n| &&
` }); }`.
* result = result && |\n| && `try { var _validator = new z2ui5.Validator)(); } catch(v_err) {};`.
result = result && |\n| && `var _validator = new z2ui5.Validator();`.
result = result && |\n| && `sap.z2ui5._validate = () => {` && |\n| &&
` if (_validator.validate()) {` && |\n| &&
` console.log('OK');` && |\n| &&
` } else {` && |\n| &&
` console.log(_validator.getErrors());` && |\n| &&
` };` && |\n| &&
`};`.
ENDMETHOD.
METHOD LOAD_AJV.
result = `var headTag = document.getElementsByTagName('head')[0];` && |\n| &&
`var loadLibs = function(){` && |\n| &&
` var scriptTag = document.createElement('script');` && |\n| &&
` scriptTag.src = 'https://cdn.jsdelivr.net/npm/ajv@6.12.6/dist/ajv.min.js';` && |\n| &&
`` && |\n| &&
* ` scriptTag.onload = function(e){` && |\n| &&
* ` var ajvv = new Ajv(); ` && |\n| &&
* ` };` && |\n| &&
`` && |\n| &&
` headTag.appendChild(scriptTag);` && |\n| &&
`}` && |\n| &&
`loadLibs();`.
ENDMETHOD.
METHOD VALIDATE_FIELDS.
result = `sap.z2ui5._validate()`.
ENDMETHOD.
ENDCLASS.

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CC_VALIDATOR</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>cc - fields validator</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -294,7 +294,8 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
mo_view->_generic( ns = `html` mo_view->_generic( ns = `html`
name = `style` ). name = `style` ).
CALL METHOD ('Z2UI5_CL_CC_DEMO_OUT')=>('GET_STYLE') data(lv_class) = 'Z2UI5_CL_CC_DEMO_OUT'.
CALL METHOD (lv_class)=>('GET_STYLE')
RECEIVING RECEIVING
result = lv_style. result = lv_style.
result = mo_view->_cc_plain_xml( lv_style )->html( val ). result = mo_view->_cc_plain_xml( lv_style )->html( val ).