mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-30 11:00:25 +08:00
map container and xml view updates (#624)
* test view * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * update
This commit is contained in:
parent
80c4550d70
commit
18b915b0c3
26
README.md
26
README.md
|
@ -10,11 +10,11 @@
|
|||
<a href="https://twitter.com/abap2UI5"><img src="https://img.shields.io/twitter/follow/abap2UI5"></a>
|
||||
</p>
|
||||
|
||||
*...offers a pure ABAP approach for developing UI5 apps, entirely without JavaScript, OData and RAP — similar to the past, when only a few lines of ABAP sufficed to display inputs and tables using Selection Screens & ALVs. Designed with a minimal system footprint, it works in both on-premise and cloud environments.*
|
||||
*...offers a pure ABAP approach for developing UI5 apps, entirely without JavaScript, OData and RAP — similar to the past, when only a few lines of ABAP sufficed to display input forms and tables using Selection Screens & ALVs. Designed with a minimal system footprint, it works in both on-premise and cloud environments.*
|
||||
|
||||
#### Key Features
|
||||
* **User-Friendly:** Implement just one interface for a standalone UI5 application
|
||||
* **100% ABAP:** Developing using pure ABAP (no JavaScript, DDL, EML or Customizing)
|
||||
* **User-Friendly:** Implement just a single interface for a standalone UI5 application
|
||||
* **100% ABAP:** Developing in pure ABAP (no JavaScript, DDL, EML or Customizing)
|
||||
* **Minimal System Footprint:** Based on a plain HTTP handler (no BSP, OData, CDS, BOPF or RAP)
|
||||
* **Cloud and On-Premise Ready:** Works with both language versions (ABAP for Cloud, Standard ABAP)
|
||||
* **Broad System Compatibility:** Runs on all ABAP releases (from NW 7.02 to ABAP 2311)
|
||||
|
@ -39,28 +39,28 @@
|
|||
9. Community Feedback & New Features I [(SCN - 11.09.2023)](https://blogs.sap.com/2023/09/11/abap2ui5-a2-community-feedback-new-features/)<br>
|
||||
|
||||
#### References
|
||||
* Find abap2UI5 in the ABAP Open Source Projects [(dotabap.org)](https://dotabap.org/)
|
||||
* Featured in the SAP Developer News [(youtube - 26.01.2023)](https://www.youtube.com/watch?v=6BDK55xYttM)
|
||||
* Featured in the Boring Enterprise Nerdletter [(newsletter - 08.03.2023)](https://boringenterprisenerds.substack.com/p/34-abap2ui5-sap-cva-burnout-c2c-shortwave)
|
||||
* Find abap2UI5 on ABAP Open Source Projects [(dotabap.org)](https://dotabap.org/)
|
||||
* Featured on SAP Developer News [(youtube - 26.01.2023)](https://www.youtube.com/watch?v=6BDK55xYttM)
|
||||
* Highlighted in the Boring Enterprise Nerdletter [(newsletter - 08.03.2023)](https://boringenterprisenerds.substack.com/p/34-abap2ui5-sap-cva-burnout-c2c-shortwave)
|
||||
* Part of the SAP Developer Code Challenge [(SCN - 17.05.2023)](https://groups.community.sap.com/t5/application-development/sap-developer-code-challenge-open-source-abap-week-2/m-p/260727#M1372)
|
||||
* Showcased at SAP TechEd 2023 [(youtube - 02.11.2023)](https://www.youtube.com/watch?v=kLbF0ooStZs&t=3052s)
|
||||
|
||||
#### Apps & Extensions
|
||||
* Add your apps to SAP Fiori On-Premise Launchpad [(ext-fiori_launchpad)](https://github.com/abap2UI5/ext-service_integration)
|
||||
* Integrate your apps with the SAP Business Technology Platform [(ext-btp)](https://github.com/abap2UI5/ext-business_technology_platform)
|
||||
* Integrate your apps to SAP Fiori On-Premise Launchpad [(ext-fiori_launchpad)](https://github.com/abap2UI5/ext-service_integration)
|
||||
* Connect with the SAP Business Technology Platform [(ext-btp)](https://github.com/abap2UI5/ext-business_technology_platform)
|
||||
* Explore abap2UI5-tools, a collection of tools & utility functions [(abap2UI5-tools)](https://github.com/abap2UI5/abap2ui5-tools)
|
||||
* Add more functions with Custom Controls & External Libraries [(custom controls)](https://github.com/abap2UI5/abap2UI5-documentation/blob/main/docs/custom_controls.md)
|
||||
* Enhance functionality with Custom Controls & External Libraries [(custom controls)](https://github.com/abap2UI5/abap2UI5-documentation/blob/main/docs/custom_controls.md)
|
||||
* Discover other projects using abap2UI5 [(abap2UI5/links)](https://github.com/abap2UI5/abap2UI5-documentation/blob/main/docs/links.md)
|
||||
|
||||
#### More
|
||||
* Try out abap2UI5 compiled to JS on open-abap under Node.js [(abap2UI5-web)](https://twitter.com/LarsHvam/status/1648575595897405446)
|
||||
* Experiment with abap2UI5 compiled to JS on open-abap under Node.js [(abap2UI5-web)](https://twitter.com/LarsHvam/status/1648575595897405446)
|
||||
* Install S-RTTI to create apps with dynamically typed tables [(github/s-rtti)](https://github.com/sandraros/S-RTTI)
|
||||
* Import & Export Excel files in pure ABAP with abap2xslt [(twitter/xslt)](https://twitter.com/abap2UI5/status/1703787345588162907)
|
||||
* Analyse your Views & Models with this Codesandbox [(abap2UI5-debug-tools)](https://codesandbox.io/p/sandbox/abap2ui5-debug-tool-ppyfcs)
|
||||
* And finally, don't forget to explore the [Samples Repository](https://github.com/abap2UI5/abap2UI5-samples) 🧭
|
||||
|
||||
#### Installation
|
||||
Install with [abapGit](https://abapgit.org)  and create a new HTTP service with the following handler:
|
||||
Install with [abapGit](https://abapgit.org)  and set up a new HTTP service with the following handler:
|
||||
##### Standard ABAP 🏠
|
||||
```abap
|
||||
METHOD if_http_extension~handle_request.
|
||||
|
@ -90,7 +90,7 @@ METHOD if_http_service_extension~handle_request.
|
|||
ENDMETHOD.
|
||||
```
|
||||
#### Usage
|
||||
Develop UI5 Apps by implementing the abap2UI5 interface:
|
||||
Implement the abap2UI5 interface as shown in the following example:
|
||||
```abap
|
||||
CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC.
|
||||
|
||||
|
@ -122,7 +122,7 @@ CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
|
|||
ENDCLASS.
|
||||
```
|
||||
#### FAQ
|
||||
* Check out the [documentation](https://github.com/abap2UI5/abap2UI5-documentation/) for installation & configuration guidelines
|
||||
* Check out the [documentation](https://github.com/abap2UI5/abap2UI5-documentation/) for more installation & configuration guidelines
|
||||
* Still have open questions? Find an answer in the [FAQ](https://github.com/abap2UI5/abap2UI5-documentation/blob/main/docs/faq.md)
|
||||
* Want to help out? Check out the contribution [guidelines](https://github.com/abap2UI5/abap2UI5-documentation/blob/main/CONTRIBUTING.md)
|
||||
* As always - your comments, questions, wishes and bug reports are welcome, please create an [issue](https://github.com/abap2UI5/abap2UI5/issues)
|
||||
|
|
10
src/01/00/package.devc.xml
Normal file
10
src/01/00/package.devc.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DEVC" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<DEVC>
|
||||
<CTEXT>test</CTEXT>
|
||||
</DEVC>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
130
src/01/00/z2ui5_cl_view.clas.abap
Normal file
130
src/01/00/z2ui5_cl_view.clas.abap
Normal file
|
@ -0,0 +1,130 @@
|
|||
CLASS z2ui5_cl_view DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
||||
CLASS-DATA mt_prop TYPE z2ui5_if_client=>ty_t_name_value.
|
||||
|
||||
CLASS-METHODS class_constructor.
|
||||
|
||||
CLASS-METHODS factory
|
||||
IMPORTING
|
||||
t_ns TYPE z2ui5_if_client=>ty_t_name_value DEFAULT mt_prop
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_view.
|
||||
|
||||
METHODS add
|
||||
IMPORTING
|
||||
!name TYPE clike
|
||||
!ns TYPE clike OPTIONAL
|
||||
!t_prop TYPE z2ui5_if_client=>ty_t_name_value OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_view.
|
||||
|
||||
METHODS add_property
|
||||
IMPORTING
|
||||
!val TYPE z2ui5_if_client=>ty_s_name_value OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_view.
|
||||
|
||||
METHODS _cc_plain_xml
|
||||
IMPORTING
|
||||
!val TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_view.
|
||||
|
||||
METHODS get_m
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_view_m.
|
||||
|
||||
METHODS get_ui
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_view_ui.
|
||||
|
||||
PROTECTED SECTION.
|
||||
|
||||
DATA mv_name TYPE string.
|
||||
DATA mv_ns TYPE string.
|
||||
DATA mo_root TYPE REF TO z2ui5_cl_view.
|
||||
DATA mo_previous TYPE REF TO z2ui5_cl_view.
|
||||
DATA mo_parent TYPE REF TO z2ui5_cl_view.
|
||||
DATA mt_child TYPE STANDARD TABLE OF REF TO z2ui5_cl_view WITH EMPTY KEY.
|
||||
|
||||
PRIVATE SECTION.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
||||
CLASS z2ui5_cl_view IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD class_constructor.
|
||||
|
||||
mt_prop = VALUE #( BASE mt_prop
|
||||
( n = 'displayBlock' v = 'true' )
|
||||
( n = 'height' v = '100%' ) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD add_property.
|
||||
|
||||
INSERT val INTO TABLE mt_prop.
|
||||
result = me.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD _cc_plain_xml.
|
||||
|
||||
result = me.
|
||||
add( name = `ZZPLAIN`
|
||||
t_prop = VALUE #( ( n = `VALUE` v = val ) ) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD factory.
|
||||
|
||||
result = NEW #( ).
|
||||
|
||||
IF t_ns IS NOT INITIAL.
|
||||
result->mt_prop = t_ns.
|
||||
ENDIF.
|
||||
|
||||
result->mv_name = `View`.
|
||||
result->mv_ns = `mvc`.
|
||||
result->mo_root = result.
|
||||
result->mo_parent = result.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD add.
|
||||
|
||||
DATA(result2) = NEW z2ui5_cl_view( ).
|
||||
result2->mv_name = name.
|
||||
result2->mv_ns = ns.
|
||||
result2->mt_prop = t_prop.
|
||||
result2->mo_parent = me.
|
||||
result2->mo_root = mo_root.
|
||||
INSERT result2 INTO TABLE mt_child.
|
||||
|
||||
mo_root->mo_previous = result2.
|
||||
result = result2.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_m.
|
||||
|
||||
result = new #( ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_ui.
|
||||
|
||||
result = new #( ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
16
src/01/00/z2ui5_cl_view.clas.xml
Normal file
16
src/01/00/z2ui5_cl_view.clas.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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_VIEW</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>test - view</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
<UNICODE>X</UNICODE>
|
||||
</VSEOCLASS>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
137
src/01/00/z2ui5_cl_view_m.clas.abap
Normal file
137
src/01/00/z2ui5_cl_view_m.clas.abap
Normal file
|
@ -0,0 +1,137 @@
|
|||
CLASS z2ui5_cl_view_m DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
||||
METHODS input
|
||||
IMPORTING
|
||||
!id TYPE clike OPTIONAL
|
||||
!value TYPE clike OPTIONAL
|
||||
!placeholder TYPE clike OPTIONAL
|
||||
!type TYPE clike OPTIONAL
|
||||
!showclearicon TYPE clike OPTIONAL
|
||||
!valuestate TYPE clike OPTIONAL
|
||||
!valuestatetext TYPE clike OPTIONAL
|
||||
!showtablesuggestionvaluehelp TYPE clike OPTIONAL
|
||||
!description TYPE clike OPTIONAL
|
||||
!editable TYPE clike OPTIONAL
|
||||
!enabled TYPE clike OPTIONAL
|
||||
!suggestionitems TYPE clike OPTIONAL
|
||||
!suggestionrows TYPE clike OPTIONAL
|
||||
!showsuggestion TYPE clike OPTIONAL
|
||||
!showvaluehelp TYPE clike OPTIONAL
|
||||
!valuehelprequest TYPE clike OPTIONAL
|
||||
!required TYPE clike OPTIONAL
|
||||
!suggest TYPE clike OPTIONAL
|
||||
!class TYPE clike OPTIONAL
|
||||
!visible TYPE clike OPTIONAL
|
||||
!submit TYPE clike OPTIONAL
|
||||
!valueliveupdate TYPE clike OPTIONAL
|
||||
!autocomplete TYPE clike OPTIONAL
|
||||
!maxsuggestionwidth TYPE clike OPTIONAL
|
||||
!fieldwidth TYPE clike OPTIONAL
|
||||
!valuehelponly TYPE clike OPTIONAL
|
||||
!width TYPE clike OPTIONAL
|
||||
!change TYPE clike OPTIONAL
|
||||
!valuehelpiconsrc TYPE clike OPTIONAL
|
||||
!textformatter TYPE clike OPTIONAL
|
||||
!textformatmode TYPE clike OPTIONAL
|
||||
!maxlength TYPE clike OPTIONAL
|
||||
!startsuggestion TYPE clike OPTIONAL
|
||||
!enablesuggestionshighlighting TYPE clike OPTIONAL
|
||||
!enabletableautopopinmode TYPE clike OPTIONAL
|
||||
PREFERRED PARAMETER value
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_view .
|
||||
|
||||
PROTECTED SECTION.
|
||||
|
||||
DATA mo_view TYPE REF TO z2ui5_cl_view.
|
||||
|
||||
PRIVATE SECTION.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
||||
CLASS z2ui5_cl_view_m IMPLEMENTATION.
|
||||
|
||||
METHOD input.
|
||||
|
||||
result = mo_view.
|
||||
|
||||
mo_view->add( name = `Input`
|
||||
t_prop = VALUE #( ( n = `id` v = id )
|
||||
( n = `placeholder` v = placeholder )
|
||||
( n = `type` v = type )
|
||||
( n = `maxLength` v = maxlength )
|
||||
( n = `showClearIcon` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( showclearicon ) )
|
||||
( n = `description` v = description )
|
||||
( n = `editable` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( editable ) )
|
||||
( n = `enabled` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( enabled ) )
|
||||
( n = `visible` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( visible ) )
|
||||
( n = `enableTableAutoPopinMode` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( enabletableautopopinmode ) )
|
||||
( n = `enableSuggestionsHighlighting` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( enablesuggestionshighlighting ) )
|
||||
( n = `showTableSuggestionValueHelp` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( showtablesuggestionvaluehelp ) )
|
||||
( n = `valueState` v = valuestate )
|
||||
( n = `valueStateText` v = valuestatetext )
|
||||
( n = `value` v = value )
|
||||
( n = `required` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( required ) )
|
||||
( n = `suggest` v = suggest )
|
||||
( n = `suggestionItems` v = suggestionitems )
|
||||
( n = `suggestionRows` v = suggestionrows )
|
||||
( n = `showSuggestion` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( showsuggestion ) )
|
||||
( n = `valueHelpRequest` v = valuehelprequest )
|
||||
( n = `autocomplete` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( autocomplete ) )
|
||||
( n = `valueLiveUpdate` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( valueliveupdate ) )
|
||||
( n = `submit` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( submit ) )
|
||||
( n = `showValueHelp` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( showvaluehelp ) )
|
||||
( n = `valueHelpOnly` v = z2ui5_cl_fw_utility=>boolean_abap_2_json( valuehelponly ) )
|
||||
( n = `class` v = class )
|
||||
( n = `change` v = change )
|
||||
( n = `maxSuggestionWidth` v = maxsuggestionwidth )
|
||||
( n = `width` v = width )
|
||||
( n = `textFormatter` v = textformatter )
|
||||
( n = `startSuggestion` v = startsuggestion )
|
||||
( n = `valueHelpIconSrc` v = valuehelpiconsrc )
|
||||
( n = `textFormatMode` v = textformatmode )
|
||||
( n = `fieldWidth` v = fieldwidth ) ) ).
|
||||
|
||||
|
||||
* DATA(test) = `!function(){"use strict";const t="undefined"!=typeof window?window:Function("return this;")(),e=(e,o)=>((e,o)=>{let n=null!=o?o:t;for(let t=0;t<e.length&&null!=n;++t)n=n[e[t]];return n})(e.split("."),o),o=O` &&
|
||||
*`bject.keys,n=Object.hasOwnProperty,s=(t,e)=>n.call(t,e);let i=0;const r=t=>{const e=(new Date).getTime(),o=Math.floor(1e9*Math.random());return i++,t+"_"+o+i+String(e)},a=()=>({listeners:[],scriptId:r("tiny-script"),scriptLoaded:!1}),l=(()=>{let t=` &&
|
||||
*`a();return{load:(e,o,n)=>{t.scriptLoaded?n():(t.listeners.push(n),e.getElementById(t.scriptId)||((t,e,o,n)=>{const s=e.createElement("script");s.referrerPolicy="origin",s.type="application/javascript",s.id=t,s.src=o;const i=()=>{s.removeEventListen` &&
|
||||
*`er("load",i),n()};s.addEventListener("load",i),e.head&&e.head.appendChild(s)})(t.scriptId,e,o,(()=>{t.listeners.forEach((t=>t())),t.scriptLoaded=!0})))},reinitialize:()=>{t=a()}}})();var d;!function(t){t[t.Raw=0]="Raw",t[t.Initializing=1]="Initiali` &&
|
||||
*`zing",t[t.Ready=2]="Ready"}(d||(d={}));const u=(t,e)=>{const o=e.closest(t);if(null!==o)return o;const n=e.getRootNode().host;return null!=n?u(t,n):null},h=t=>e=>((t,e)=>s(t,e))(t,e)?t[e]:e,c=e,m=t=>t,_=h({false:!1}),p=h({true:!0,false:!1}),f=t=>/^` &&
|
||||
*`\d+$/.test(t)?Number.parseInt(t,10):t,g={setup:c,toolbar:_,menubar:_,plugins:m,content_css:m,content_style:m,width:f,height:f,toolbar_mode:m,contextmenu:_,quickbars_insert_toolbar:_,quickbars_selection_toolbar:_,powerpaste_word_import:m,powerpaste_` &&
|
||||
*`html_import:m,powerpaste_allow_local_images:p,resize:p,skin:m,skin_url:m,images_upload_url:m,images_upload_handler:c,images_upload_base_path:m,images_upload_credentials:p,images_reuse_filename:p,icons:m,icons_url:m,promotion:p},v={};class b extends` &&
|
||||
*` HTMLElement{static get formAssociated(){return!0}static get observedAttributes(){return["form","readonly","autofocus","placeholder"].concat(["on-BeforePaste","on-Blur","on-Click","on-ContextMenu","on-Copy","on-Cut","on-Dblclick","on-Drag","on-Drag` &&
|
||||
*`Drop","on-DragEnd","on-DragGesture","on-DragOver","on-Drop","on-Focus","on-FocusIn","on-FocusOut","on-KeyDown","on-KeyPress","on-KeyUp","on-MouseDown","on-MouseEnter","on-MouseLeave","on-MouseMove","on-MouseOut","on-MouseOver","on-MouseUp","on-Past` &&
|
||||
*`e","on-SelectionChange"]).concat(["on-Activate","on-AddUndo","on-BeforeAddUndo","on-BeforeExecCommand","on-BeforeGetContent","on-BeforeRenderUI","on-BeforeSetContent","on-Change","on-ClearUndos","on-Deactivate","on-Dirty","on-ExecCommand","on-GetCo` &&
|
||||
*`ntent","on-Hide","on-Init","on-LoadContent","on-NodeChange","on-PostProcess","on-PostRender","on-PreProcess","on-ProgressState","on-Redo","on-Remove","on-Reset","on-SaveContent","on-SetAttrib","on-ObjectResizeStart","on-ObjectResized","on-ObjectSel` &&
|
||||
*`ected","on-SetContent","on-Show","on-Submit","on-Undo","on-VisualAid"])}constructor(){super(),this._eventAttrHandler=t=>{t.forEach((t=>{var e;"attributes"===t.type&&t.target===this&&(null===(e=t.attributeName)||void 0===e?void 0:e.toLowerCase().sta` &&
|
||||
*`rtsWith("on-"))&&this._updateEventAttr(t.attributeName,this.getAttribute(t.attributeName))}))},this._formDataHandler=t=>{const e=this.name;if(null!=e){const o=this.value;if(null!=o){t.formData.append(e,o)}}},this._status=d.Raw,this._shadowDom=this.` &&
|
||||
*`attachShadow({mode:"open"}),this._form=null,this._eventHandlers={},this._mutationObserver=new MutationObserver(this._eventAttrHandler)}_updateEventAttr(t,o){const n=t.substring("on-".length).toLowerCase(),s=null!==o?e(o):void 0,i="function"==typeof` &&
|
||||
*` s?s:void 0;this._eventHandlers[n]!==i&&(this._editor&&this._eventHandlers[n]&&this._editor.off(n,this._eventHandlers[n]),i?(this._editor&&this._editor.on(n,i),this._eventHandlers[n]=i):delete this._eventHandlers[n])}_updateForm(){if(this.isConnect` &&
|
||||
*`ed){const t=this.getAttribute("form"),e=null!==t?this.ownerDocument.querySelector("form#"+t):u("form",this);this._form!==e&&(null!==this._form&&this._form.removeEventListener("formdata",this._formDataHandler),this._form=e,null!==this._form&&this._f` &&
|
||||
*`orm.addEventListener("formdata",this._formDataHandler))}else null!==this._form&&(this._form.removeEventListener("formdata",this._formDataHandler),this._form=null)}_getTinymce(){return t.tinymce}_getConfig(){var t,e;const o=null!==(e=c(null!==(t=thi` &&
|
||||
*`s.getAttribute("config"))&&void 0!==t?t:""))&&void 0!==e?e:{};for(let t=0;t<this.attributes.length;t++){const e=this.attributes.item(t);if(null!==e&&s(g,e.name)){o[s(v,e.name)?v[e.name]:e.name]=g[e.name](e.value)}}return this.readonly&&(o.readonly=` &&
|
||||
*`!0),this.autofocus&&(o.auto_focus=!0),delete o.target,delete o.selector,o}_getEventHandlers(){const t={};for(let o=0;o<this.attributes.length;o++){const n=this.attributes.item(o);if(null!==n&&n.name.toLowerCase().startsWith("on-")){const o=n.name.t` &&
|
||||
*`oLowerCase().substring("on-".length),s=e(n.value);"function"==typeof s&&(t[o]=s)}}return t}_doInit(){var t;this._status=d.Initializing;const e=document.createElement("textarea");e.value=null!==(t=this.textContent)&&void 0!==t?t:"",null!==this.place` &&
|
||||
*`holder&&(e.placeholder=this.placeholder),this._shadowDom.appendChild(e);const n=this._getConfig(),s=Object.assign(Object.assign({},n),{target:e,setup:t=>{this._editor=t,t.on("init",(t=>{this._status=d.Ready})),t.on("SwitchMode",(t=>{this.readonly=t` &&
|
||||
*`his.readonly})),((t,e)=>{const n=o(t);for(let o=0,s=n.length;o<s;o++){const s=n[o];e(t[s],s)}})(this._eventHandlers,((e,o)=>{void 0!==e&&t.on(o,e)})),"function"==typeof n.setup&&n.setup(t)}});this._getTinymce().init(s)}_getTinymceSrc(){var t;const ` &&
|
||||
*`e=this.getAttribute("src");if(e)return e;const o=null!==(t=this.getAttribute("channel"))&&void 0!==t?t:"6";return``https://cdn.tiny.cloud/1/${this.hasAttribute("api-key")?this.getAttribute("api-key"):"no-api-key"}/tinymce/${o}/tinymce.min.js``}_loa` &&
|
||||
*`dTinyDoInit(){this._getTinymce()?this._doInit():l.load(this.ownerDocument,this._getTinymceSrc(),(()=>this._doInit()))}attributeChangedCallback(t,e,o){e!==o&&("form"===t?this._updateForm():"readonly"===t?this.readonly=null!==o:"autofocus"===t?this.a` &&
|
||||
*`utofocus=null!==o:"placeholder"===t?this.placeholder=o:t.toLowerCase().startsWith("on-")&&this._updateEventAttr(t,o))}connectedCallback(){this._eventHandlers=this._getEventHandlers(),this._mutationObserver.observe(this,{attributes:!0,childList:!1,s` &&
|
||||
*`ubtree:!1}),this._updateForm(),this._status===d.Raw&&this._loadTinyDoInit()}disconnectedCallback(){this._mutationObserver.disconnect(),this._updateForm()}get value(){var t,e;return null!==(e=this._status===d.Ready?null===(t=this._editor)||void 0===` &&
|
||||
*`t?void 0:t.getContent():void 0)&&void 0!==e?e:null}set value(t){var e;this._status===d.Ready&&null!=t&&(null===(e=this._editor)||void 0===e||e.setContent(t))}get readonly(){return this._editor?"readonly"===this._editor.mode.get():this.hasAttribute(` &&
|
||||
*`"readonly")}set readonly(t){t?(this._editor&&"readonly"!==this._editor.mode.get()&&this._editor.mode.set("readonly"),this.hasAttribute("readonly")||this.setAttribute("readonly","")):(this._editor&&"readonly"===this._editor.mode.get()&&this._editor.` &&
|
||||
*`mode.set("design"),this.hasAttribute("readonly")&&this.removeAttribute("readonly"))}get placeholder(){return this.getAttribute("placeholder")}set placeholder(t){if(this._editor){const e=this._editor.getElement();null!==e&&(null!==t?e.setAttribute("` &&
|
||||
*`placeholder",t):e.removeAttribute("placeholder"))}null!==t?this.getAttribute("placeholder")!==t&&this.setAttribute("placeholder",t):this.hasAttribute("placeholder")&&this.removeAttribute("placeholder")}get autofocus(){return this.hasAttribute("auto` &&
|
||||
*`focus")}set autofocus(t){t?this.hasAttribute("autofocus")||this.setAttribute("autofocus",""):this.hasAttribute("autofocus")&&this.removeAttribute("autofocus")}get form(){return this._form}get name(){return this.getAttribute("name")}get type(){retur` &&
|
||||
*`n this.localName}}window.customElements.define("tinymce-editor",b)}();`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
16
src/01/00/z2ui5_cl_view_m.clas.xml
Normal file
16
src/01/00/z2ui5_cl_view_m.clas.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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_VIEW_M</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>test - view m</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
<UNICODE>X</UNICODE>
|
||||
</VSEOCLASS>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
57
src/01/00/z2ui5_cl_view_ui.clas.abap
Normal file
57
src/01/00/z2ui5_cl_view_ui.clas.abap
Normal file
|
@ -0,0 +1,57 @@
|
|||
CLASS z2ui5_cl_view_ui DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
||||
CLASS-DATA mt_prop TYPE z2ui5_if_client=>ty_t_name_value.
|
||||
|
||||
CLASS-METHODS class_constructor.
|
||||
|
||||
CLASS-METHODS factory
|
||||
IMPORTING
|
||||
t_ns TYPE z2ui5_if_client=>ty_t_name_value DEFAULT mt_prop
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_view_ui.
|
||||
|
||||
PROTECTED SECTION.
|
||||
|
||||
DATA mv_name TYPE string.
|
||||
DATA mv_ns TYPE string.
|
||||
|
||||
|
||||
DATA mo_root TYPE REF TO z2ui5_cl_view_ui.
|
||||
DATA mo_parent TYPE REF TO z2ui5_cl_view_ui.
|
||||
|
||||
PRIVATE SECTION.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
||||
CLASS z2ui5_cl_view_ui IMPLEMENTATION.
|
||||
|
||||
METHOD class_constructor.
|
||||
|
||||
mt_prop = VALUE #( BASE mt_prop
|
||||
( n = 'displayBlock' v = 'true' )
|
||||
( n = 'height' v = '100%' ) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD factory.
|
||||
|
||||
result = NEW #( ).
|
||||
|
||||
IF t_ns IS NOT INITIAL.
|
||||
result->mt_prop = t_ns.
|
||||
ENDIF.
|
||||
|
||||
result->mv_name = `View`.
|
||||
result->mv_ns = `mvc`.
|
||||
result->mo_root = result.
|
||||
result->mo_parent = result.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
16
src/01/00/z2ui5_cl_view_ui.clas.xml
Normal file
16
src/01/00/z2ui5_cl_view_ui.clas.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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_VIEW_UI</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>test - view ui</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
<UNICODE>X</UNICODE>
|
||||
</VSEOCLASS>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
|
@ -2859,6 +2859,7 @@ CLASS z2ui5_cl_xml_view DEFINITION
|
|||
IMPORTING
|
||||
!id TYPE clike OPTIONAL
|
||||
!items TYPE clike OPTIONAL
|
||||
PREFERRED PARAMETER items
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user