jsf.js_next_gen 1.0.0-beta-20 → 4.0.0-RC.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.json +2 -1
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.nycrc +2 -1
- package/README.md +78 -24
- package/dist/docs/assets/highlight.css +21 -0
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +34 -2
- package/dist/docs/functions/{jsf.ajax.addOnError.html → faces.ajax.addOnError.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.addOnEvent.html → faces.ajax.addOnEvent.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.request.html → faces.ajax.request.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.response.html → faces.ajax.response.html} +15 -13
- package/dist/docs/functions/{jsf.getClientWindow.html → faces.getClientWindow.html} +17 -14
- package/dist/docs/functions/{jsf.getProjectStage.html → faces.getProjectStage.html} +18 -15
- package/dist/docs/functions/{jsf.getViewState.html → faces.getViewState.html} +18 -15
- package/dist/docs/functions/{jsf.push.close.html → faces.push.close.html} +15 -13
- package/dist/docs/functions/{jsf.push.init.html → faces.push.init.html} +29 -19
- package/dist/docs/functions/{jsf.push.open.html → faces.push.open.html} +15 -13
- package/dist/docs/functions/{jsf.util.chain.html → faces.util.chain.html} +12 -10
- package/dist/docs/functions/myfaces.ab.html +10 -8
- package/dist/docs/index.html +71 -29
- package/dist/docs/modules/{jsf.ajax.html → faces.ajax.html} +18 -16
- package/dist/docs/modules/faces.html +75 -0
- package/dist/docs/modules/{jsf.push.html → faces.push.html} +16 -14
- package/dist/docs/modules/{jsf.util.html → faces.util.html} +12 -10
- package/dist/docs/modules/myfaces.html +8 -6
- package/dist/docs/modules.html +9 -7
- package/dist/docs/variables/faces.contextpath.html +57 -0
- package/dist/docs/variables/{jsf.implversion.html → faces.implversion.html} +17 -14
- package/dist/docs/variables/{jsf.separatorchar.html → faces.separatorchar.html} +18 -15
- package/dist/docs/variables/faces.specversion.html +64 -0
- package/dist/docs/variables/myfaces.oam.html +8 -6
- package/dist/window/faces-development.js +7688 -0
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -0
- package/dist/window/faces.js +3 -0
- package/dist/window/faces.js.LICENSE.txt +87 -0
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -0
- package/dist/window/jsf-development.js +3011 -2963
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +2 -1
- package/dist/window/jsf.js.LICENSE.txt +87 -0
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +12 -12
- package/pom.xml +14 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratedFacesJS.java +94 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.java +54 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.java +57 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMappingDecorator.java +138 -0
- package/src/main/typescript/@types/definitions/index.d.ts +147 -0
- package/src/main/typescript/api/{Jsf.ts → _api.ts} +61 -49
- package/src/main/typescript/api/faces.ts +44 -0
- package/src/main/typescript/api/jsf.ts +43 -0
- package/src/main/typescript/impl/AjaxImpl.ts +39 -42
- package/src/main/typescript/impl/PushImpl.ts +27 -30
- package/src/main/typescript/impl/core/Const.ts +38 -16
- package/src/main/typescript/impl/core/ImplTypes.ts +1 -1
- package/src/main/typescript/impl/i18n/Messages.ts +2 -2
- package/src/main/typescript/impl/util/Assertions.ts +3 -3
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +5 -5
- package/src/main/typescript/impl/util/ExtDomQuery.ts +200 -48
- package/src/main/typescript/impl/util/IListener.ts +1 -1
- package/src/main/typescript/impl/util/Lang.ts +25 -25
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +2 -3
- package/src/main/typescript/impl/xhrCore/EventData.ts +4 -3
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +19 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +15 -14
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +15 -11
- package/src/main/typescript/impl/xhrCore/Response.ts +30 -24
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +69 -49
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +9 -7
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +76 -60
- package/src/main/typescript/myfaces/OamSubmit.ts +12 -15
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +277 -65
- package/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test2.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +75 -30
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +44 -4
- package/src/main/typescript/test/impl/ImplTest.spec.ts +18 -22
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +129 -0
- package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +7 -6
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +15 -24
- package/src/main/typescript/test/queue/AsynchronousProbe.ts +1 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -4
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +15 -23
- package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +3 -3
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +7 -32
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +16 -37
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +17 -16
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +364 -0
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +102 -47
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +362 -0
- package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +6 -9
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +15 -15
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +3 -3
- package/{target/main/typescript/impl/util/AsyncRunnable.js → src/main/typescript/test/xhrCore/fixtures/addedViewHead1.js} +4 -6
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.css +18 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead3.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/nonce_script.js +16 -0
- package/src/main/typescript/tsconfig-typedoc.json +17 -1
- package/src/main/typescript/tsconfig.json +23 -5
- package/src/test/resources/jsf-development.js +1 -1
- package/src/test.html +75 -0
- package/src/tmp/test.html +92 -0
- package/target/api/{Jsf.js → _api.js} +68 -70
- package/target/api/_api.js.map +1 -0
- package/target/api/faces.js +45 -0
- package/target/api/faces.js.map +1 -0
- package/target/api/jsf.js +45 -0
- package/target/api/jsf.js.map +1 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
- package/target/impl/AjaxImpl.js +85 -93
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +63 -64
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +38 -19
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/ImplTypes.js +10 -15
- package/target/impl/core/ImplTypes.js.map +1 -1
- package/target/impl/i18n/Messages.js +5 -6
- package/target/impl/i18n/Messages.js.map +1 -1
- package/target/impl/util/Assertions.js +12 -21
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js +28 -36
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/AsyncRunnable.js +1 -1
- package/target/impl/util/ExtDomQuery.js +235 -138
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/Lang.js +43 -50
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +37 -62
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +12 -14
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +27 -29
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +25 -23
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +40 -36
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +165 -167
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +75 -103
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +160 -145
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +1 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +1 -0
- package/target/myfaces/OamSubmit.js +32 -20
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +78 -0
- package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +7 -0
- package/target/test/frameworkBase/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +372 -134
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +25 -34
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +9 -9
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +32 -32
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +51 -49
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +277 -124
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +199 -18
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +45 -33
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +133 -0
- package/target/test/impl/ImplTest_23.spec.js.map +1 -0
- package/target/test/impl/SeparatorCharsTest.spec.js +22 -20
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +35 -42
- package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
- package/target/test/queue/AsynchronousProbe.js +24 -30
- package/target/test/queue/AsynchronousProbe.js.map +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +40 -71
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +47 -83
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FakeWebsocket.js +15 -17
- package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +50 -91
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +49 -98
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +84 -120
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/{typescript/xhrCore/RequestTest.js → xhrCore/RequestTest_23.spec.js} +142 -127
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -0
- package/target/test/xhrCore/ResponseTest.spec.js +183 -105
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +312 -0
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -0
- package/target/test/xhrCore/ShadowDomTest.spec.js +33 -66
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +64 -97
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +42 -16
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test-classes/jsf-development.js +452 -3674
- package/target/test-classes/jsf.js +1 -1
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/webpack.config.js +7 -4
- package/webpack.config.js.map +1 -1
- package/webpack.config.ts +23 -4
- package/dist/docs/modules/jsf.html +0 -71
- package/dist/docs/variables/jsf.specversion.html +0 -52
- package/integrationdeploy.cmd +0 -4
- package/integrationsdeploy.sh +0 -5
- package/remap.js +0 -44
- package/remap.js.map +0 -1
- package/src/main/java/com/example/jsfs_js_ts/JsfsJsTsApplication.java +0 -12
- package/src/main/types/typedefs.d.ts +0 -66
- package/target/api/Jsf.js.map +0 -1
- package/target/classes/com/example/jsfs_js_ts/JsfsJsTsApplication.class +0 -0
- package/target/impl/util/ListenerQueue.js +0 -3
- package/target/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/api/Jsf.js +0 -258
- package/target/main/typescript/api/Jsf.js.map +0 -1
- package/target/main/typescript/impl/AjaxImpl.js +0 -569
- package/target/main/typescript/impl/AjaxImpl.js.map +0 -1
- package/target/main/typescript/impl/PushImpl.js +0 -215
- package/target/main/typescript/impl/PushImpl.js.map +0 -1
- package/target/main/typescript/impl/core/Const.js +0 -135
- package/target/main/typescript/impl/core/Const.js.map +0 -1
- package/target/main/typescript/impl/core/ImplTypes.js +0 -43
- package/target/main/typescript/impl/core/ImplTypes.js.map +0 -1
- package/target/main/typescript/impl/i18n/Messages.js +0 -114
- package/target/main/typescript/impl/i18n/Messages.js.map +0 -1
- package/target/main/typescript/impl/util/Assertions.js +0 -90
- package/target/main/typescript/impl/util/Assertions.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncQueue.js +0 -104
- package/target/main/typescript/impl/util/AsyncQueue.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
- package/target/main/typescript/impl/util/ExtDomQuery.js +0 -129
- package/target/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
- package/target/main/typescript/impl/util/Lang.js +0 -215
- package/target/main/typescript/impl/util/Lang.js.map +0 -1
- package/target/main/typescript/impl/util/ListenerQueue.js +0 -3
- package/target/main/typescript/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ErrorData.js +0 -89
- package/target/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/EventData.js +0 -30
- package/target/main/typescript/impl/xhrCore/EventData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -143
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js +0 -103
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/Response.js +0 -167
- package/target/main/typescript/impl/xhrCore/Response.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -368
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrFormData.js +0 -272
- package/target/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrRequest.js +0 -281
- package/target/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/LangTest.js +0 -112
- package/target/test/typescript/frameworkBase/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js +0 -115
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js +0 -264
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js +0 -23
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/test/typescript/impl/ImplTest.js +0 -98
- package/target/test/typescript/impl/ImplTest.js.map +0 -1
- package/target/test/typescript/impl/SeparatorCharsTest.js +0 -72
- package/target/test/typescript/impl/SeparatorCharsTest.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousProbe.js +0 -99
- package/target/test/typescript/queue/AsynchronousProbe.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousQueueTest.js +0 -130
- package/target/test/typescript/queue/AsynchronousQueueTest.js.map +0 -1
- package/target/test/typescript/xhrCore/EventTests.js +0 -155
- package/target/test/typescript/xhrCore/EventTests.js.map +0 -1
- package/target/test/typescript/xhrCore/FakeWebsocket.js +0 -25
- package/target/test/typescript/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/test/typescript/xhrCore/FileUploadTest.js +0 -166
- package/target/test/typescript/xhrCore/FileUploadTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestParamsTest.js +0 -151
- package/target/test/typescript/xhrCore/RequestParamsTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ResponseTest.js +0 -257
- package/target/test/typescript/xhrCore/ResponseTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ShadowDomTest.js +0 -122
- package/target/test/typescript/xhrCore/ShadowDomTest.js.map +0 -1
- package/target/test/typescript/xhrCore/WebsocketTest.js +0 -182
- package/target/test/typescript/xhrCore/WebsocketTest.js.map +0 -1
- package/target/test/typescript/xhrCore/XhrFormDataTest.js +0 -58
- package/target/test/typescript/xhrCore/XhrFormDataTest.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import {ArrayCollector, Config, DQ, Lang, LazyStream, Stream} from "mona-dish";
|
|
17
17
|
import {EMPTY_STR, IDENT_ALL, IDENT_FORM, P_VIEWSTATE} from "../core/Const";
|
|
18
18
|
import isString = Lang.isString;
|
|
19
|
+
import {ExtConfig} from "../util/ExtDomQuery";
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -24,7 +25,7 @@ import isString = Lang.isString;
|
|
|
24
25
|
*
|
|
25
26
|
* We cannot use standard html5 forms everywhere
|
|
26
27
|
* due to api constraints on the HTML Form object in IE11
|
|
27
|
-
* and due to the url encoding constraint given by the
|
|
28
|
+
* and due to the url encoding constraint given by the faces.js spec
|
|
28
29
|
*
|
|
29
30
|
* probably only one needed and one overlay!
|
|
30
31
|
* the entire file input storing probably is redundant now
|
|
@@ -44,7 +45,7 @@ export class XhrFormData extends Config {
|
|
|
44
45
|
* data collector from a given form
|
|
45
46
|
*
|
|
46
47
|
* @param dataSource either a form as DomQuery object or an encoded url string
|
|
47
|
-
* @param viewState the form view state or an external
|
|
48
|
+
* @param viewState the form view state or an external viewState coming in as string
|
|
48
49
|
* @param executes the executes id list for the elements to being processed
|
|
49
50
|
* @param partialIds partial ids to collect, to reduce the data sent down
|
|
50
51
|
*/
|
|
@@ -67,8 +68,9 @@ export class XhrFormData extends Config {
|
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
/**
|
|
70
|
-
* generic post init code, for now, this
|
|
71
|
-
* @param executes
|
|
71
|
+
* generic post init code, for now, this performs some post assign data post-processing
|
|
72
|
+
* @param executes the executable dom nodes which need to be processed into the form data, which we can send
|
|
73
|
+
* in our ajax request
|
|
72
74
|
*/
|
|
73
75
|
postInit(...executes: Array<string>) {
|
|
74
76
|
let fetchInput = (id: string): DQ => {
|
|
@@ -121,7 +123,7 @@ export class XhrFormData extends Config {
|
|
|
121
123
|
* @param keyValueEntries
|
|
122
124
|
*/
|
|
123
125
|
assignString(keyValueEntries: string[]) {
|
|
124
|
-
let toMerge = new
|
|
126
|
+
let toMerge = new ExtConfig({});
|
|
125
127
|
|
|
126
128
|
function splitToKeyVal(line: string) {
|
|
127
129
|
return line.split(/=(.*)/gi);
|
|
@@ -201,7 +203,7 @@ export class XhrFormData extends Config {
|
|
|
201
203
|
/*
|
|
202
204
|
* Spec. 13.3.1
|
|
203
205
|
* Collect and encode input elements.
|
|
204
|
-
* Additionally the hidden element
|
|
206
|
+
* Additionally the hidden element jakarta.faces.ViewState
|
|
205
207
|
* Enhancement partial page submit
|
|
206
208
|
*
|
|
207
209
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -46,8 +46,8 @@ import {resolveFinalUrl, resolveHandlerFunc} from "./RequestDataResolver";
|
|
|
46
46
|
import failSaveExecute = ExtLang.failSaveExecute;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
* as
|
|
49
|
+
* Faces XHR Request Wrapper
|
|
50
|
+
* as AsyncRunnable for our Asynchronous queue
|
|
51
51
|
*
|
|
52
52
|
* The idea is that we basically just enqueue
|
|
53
53
|
* a single ajax request into our queue
|
|
@@ -55,8 +55,6 @@ import failSaveExecute = ExtLang.failSaveExecute;
|
|
|
55
55
|
*
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
|
-
declare let jsf: any;
|
|
59
|
-
|
|
60
58
|
export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
61
59
|
|
|
62
60
|
private responseContext: Config;
|
|
@@ -66,15 +64,15 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
66
64
|
/**
|
|
67
65
|
* helper support so that we do not have to drag in Promise shims
|
|
68
66
|
*/
|
|
69
|
-
private
|
|
70
|
-
private
|
|
67
|
+
private catchFunctions: Array<Function> = [];
|
|
68
|
+
private thenFunctions: Array<Function> = [];
|
|
71
69
|
|
|
72
70
|
/**
|
|
73
|
-
*
|
|
71
|
+
* Required Parameters
|
|
74
72
|
*
|
|
75
73
|
* @param source the issuing element
|
|
76
74
|
* @param sourceForm the form which is related to the issuing element
|
|
77
|
-
* @param requestContext the request context with
|
|
75
|
+
* @param requestContext the request context with all pass through values
|
|
78
76
|
*
|
|
79
77
|
* Optional Parameters
|
|
80
78
|
*
|
|
@@ -83,7 +81,7 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
83
81
|
* @param timeout optional xhr timeout
|
|
84
82
|
* @param ajaxType optional request type, default "POST"
|
|
85
83
|
* @param contentType optional content type, default "application/x-www-form-urlencoded"
|
|
86
|
-
* @param xhrObject optional xhr object which must
|
|
84
|
+
* @param xhrObject optional xhr object which must fulfill the XMLHTTPRequest api, default XMLHttpRequest
|
|
87
85
|
*/
|
|
88
86
|
constructor(
|
|
89
87
|
private source: DQ,
|
|
@@ -96,10 +94,10 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
96
94
|
private contentType = URL_ENCODED,
|
|
97
95
|
private xhrObject = new XMLHttpRequest()
|
|
98
96
|
) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
|
|
98
|
+
// we omit promises here because we have to deal with cancel functionality,
|
|
99
|
+
// and promises to not provide that (yet) instead we have our async queue
|
|
100
|
+
// which uses an api internally, which is very close to promises
|
|
103
101
|
this.registerXhrCallbacks((data: any) => {
|
|
104
102
|
this.resolve(data)
|
|
105
103
|
}, (data: any) => {
|
|
@@ -118,21 +116,21 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
118
116
|
try {
|
|
119
117
|
|
|
120
118
|
let formElement = this.sourceForm.getAsElem(0).value;
|
|
121
|
-
let viewState = jsf.getViewState(formElement);
|
|
122
|
-
//encoded we need to decode
|
|
123
|
-
//We generated a base representation of the current form
|
|
124
|
-
//in case someone has overloaded the
|
|
125
|
-
//that in, there is no way around it, the spec allows it and getViewState
|
|
126
|
-
//must be called, so whatever getViewState delivers has higher priority then
|
|
127
|
-
//whatever the formData object delivers
|
|
128
|
-
//the partialIdsArray arr is almost deprecated legacy code where we allowed to send a separate list of partial
|
|
129
|
-
//ids for reduced load and server processing, this will be removed soon, we can handle the same via execute
|
|
130
|
-
//anyway TODO remove the partial ids array
|
|
119
|
+
let viewState = (window?.faces ?? window?.jsf).getViewState(formElement);
|
|
120
|
+
// encoded we need to decode
|
|
121
|
+
// We generated a base representation of the current form
|
|
122
|
+
// in case someone has overloaded the viewState with additional decorators we merge
|
|
123
|
+
// that in, there is no way around it, the spec allows it and getViewState
|
|
124
|
+
// must be called, so whatever getViewState delivers has higher priority then
|
|
125
|
+
// whatever the formData object delivers
|
|
126
|
+
// the partialIdsArray arr is almost deprecated legacy code where we allowed to send a separate list of partial
|
|
127
|
+
// ids for reduced load and server processing, this will be removed soon, we can handle the same via execute
|
|
128
|
+
// anyway TODO remove the partial ids array
|
|
131
129
|
let formData: XhrFormData = new XhrFormData(this.sourceForm, viewState, executesArr(), this.partialIdsArray);
|
|
132
130
|
|
|
133
131
|
this.contentType = formData.isMultipartRequest ? "undefined" : this.contentType;
|
|
134
132
|
|
|
135
|
-
//next step the pass through parameters are merged in for post params
|
|
133
|
+
// next step the pass through parameters are merged in for post params
|
|
136
134
|
let requestContext = this.requestContext;
|
|
137
135
|
let passThroughParams = requestContext.getIf(CTX_PARAM_PASS_THR);
|
|
138
136
|
|
|
@@ -143,31 +141,31 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
143
141
|
|
|
144
142
|
this.responseContext = passThroughParams.deepCopy;
|
|
145
143
|
|
|
146
|
-
//we have to shift the internal passthroughs around to build up our response context
|
|
144
|
+
// we have to shift the internal passthroughs around to build up our response context
|
|
147
145
|
let responseContext = this.responseContext;
|
|
148
146
|
|
|
149
147
|
responseContext.assign(CTX_PARAM_MF_INTERNAL).value = this.internalContext.value;
|
|
150
148
|
|
|
151
|
-
//per spec the onevent and
|
|
149
|
+
// per spec the onevent and onerror handlers must be passed through to the response
|
|
152
150
|
responseContext.assign(ON_EVENT).value = requestContext.getIf(ON_EVENT).value;
|
|
153
151
|
responseContext.assign(ON_ERROR).value = requestContext.getIf(ON_ERROR).value;
|
|
154
152
|
|
|
155
153
|
xhrObject.open(this.ajaxType, resolveFinalUrl(this.sourceForm, formData, this.ajaxType), true);
|
|
156
154
|
|
|
157
|
-
//adding timeout
|
|
155
|
+
// adding timeout
|
|
158
156
|
this.timeout ? xhrObject.timeout = this.timeout : null;
|
|
159
157
|
|
|
160
|
-
//a bug in the xhr stub library prevents the setRequestHeader to be properly executed on fake xhr objects
|
|
161
|
-
//normal browsers should resolve this
|
|
162
|
-
//tests can quietly fail on this one
|
|
158
|
+
// a bug in the xhr stub library prevents the setRequestHeader to be properly executed on fake xhr objects
|
|
159
|
+
// normal browsers should resolve this
|
|
160
|
+
// tests can quietly fail on this one
|
|
163
161
|
if(this.contentType != "undefined") {
|
|
164
162
|
ignoreErr(() => xhrObject.setRequestHeader(CONTENT_TYPE, `${this.contentType}; charset=utf-8`));
|
|
165
163
|
}
|
|
166
164
|
|
|
167
165
|
ignoreErr(() => xhrObject.setRequestHeader(HEAD_FACES_REQ, VAL_AJAX));
|
|
168
166
|
|
|
169
|
-
//probably not needed anymore, will test this
|
|
170
|
-
//some webkit based mobile browsers do not follow the w3c spec of
|
|
167
|
+
// probably not needed anymore, will test this
|
|
168
|
+
// some webkit based mobile browsers do not follow the w3c spec of
|
|
171
169
|
// setting, they accept headers automatically
|
|
172
170
|
ignoreErr(() => xhrObject.setRequestHeader(REQ_ACCEPT, STD_ACCEPT));
|
|
173
171
|
|
|
@@ -176,7 +174,7 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
176
174
|
this.sendRequest(formData);
|
|
177
175
|
|
|
178
176
|
} catch (e) {
|
|
179
|
-
//_onError
|
|
177
|
+
// _onError
|
|
180
178
|
this.handleError(e);
|
|
181
179
|
}
|
|
182
180
|
return this;
|
|
@@ -191,34 +189,31 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
191
189
|
}
|
|
192
190
|
|
|
193
191
|
resolve(data: any) {
|
|
194
|
-
Stream.of(...this.
|
|
192
|
+
Stream.of(...this.thenFunctions).reduce((inputVal: any, thenFunc: any) => {
|
|
195
193
|
return thenFunc(inputVal);
|
|
196
194
|
}, data);
|
|
197
195
|
}
|
|
198
196
|
|
|
199
197
|
reject(data: any) {
|
|
200
|
-
Stream.of(...this.
|
|
198
|
+
Stream.of(...this.catchFunctions).reduce((inputVal: any, catchFunc: any) => {
|
|
201
199
|
return catchFunc(inputVal);
|
|
202
200
|
}, data);
|
|
203
201
|
}
|
|
204
202
|
|
|
205
203
|
catch(func: (data: any) => any): AsyncRunnable<XMLHttpRequest> {
|
|
206
|
-
|
|
207
|
-
this.catchFuncs.push(func);
|
|
204
|
+
this.catchFunctions.push(func);
|
|
208
205
|
return this;
|
|
209
206
|
}
|
|
210
207
|
|
|
211
208
|
finally(func: () => void): AsyncRunnable<XMLHttpRequest> {
|
|
212
|
-
//no ie11 support we probably are going to revert to shims for that one
|
|
213
|
-
|
|
214
|
-
this.
|
|
215
|
-
this.thenFunc.push(func);
|
|
209
|
+
// no ie11 support we probably are going to revert to shims for that one
|
|
210
|
+
this.catchFunctions.push(func);
|
|
211
|
+
this.thenFunctions.push(func);
|
|
216
212
|
return this;
|
|
217
213
|
}
|
|
218
214
|
|
|
219
215
|
then(func: (data: any) => any): AsyncRunnable<XMLHttpRequest> {
|
|
220
|
-
|
|
221
|
-
this.thenFunc.push(func);
|
|
216
|
+
this.thenFunctions.push(func);
|
|
222
217
|
return this;
|
|
223
218
|
}
|
|
224
219
|
|
|
@@ -245,16 +240,35 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
245
240
|
this.onDone(this.xhrObject, resolve);
|
|
246
241
|
};
|
|
247
242
|
xhrObject.onerror = (errorData: any) => {
|
|
243
|
+
|
|
244
|
+
// some browsers trigger an error when cancelling a request internally
|
|
245
|
+
// in this case we simply ignore the request and clear up the queue, because
|
|
246
|
+
// it is not safe anymore to proceed with the current queue
|
|
247
|
+
// This bypasses a Safari issue where it keeps requests hanging after page unload
|
|
248
|
+
// and then triggers a cancel error on then instead of just stopping
|
|
249
|
+
// and clearing the code
|
|
250
|
+
if(this.isCancelledResponse(this.xhrObject)) {
|
|
251
|
+
reject();
|
|
252
|
+
this.stopProgress = true;
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
248
255
|
this.onError(errorData, reject);
|
|
249
256
|
};
|
|
250
257
|
}
|
|
251
258
|
|
|
259
|
+
private isCancelledResponse(currentTarget: XMLHttpRequest): boolean {
|
|
260
|
+
return currentTarget?.status === 0 && // cancelled by browser
|
|
261
|
+
currentTarget?.readyState === 4 &&
|
|
262
|
+
currentTarget?.responseText === '' &&
|
|
263
|
+
currentTarget?.responseXML === null;
|
|
264
|
+
}
|
|
265
|
+
|
|
252
266
|
/*
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
267
|
+
* xhr processing callbacks
|
|
268
|
+
*
|
|
269
|
+
* Those methods are the callbacks called by
|
|
270
|
+
* the xhr object depending on its own state
|
|
271
|
+
*/
|
|
258
272
|
|
|
259
273
|
private onAbort(reject: Consumer<any>) {
|
|
260
274
|
reject();
|
|
@@ -269,13 +283,14 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
269
283
|
|
|
270
284
|
this.sendEvent(COMPLETE);
|
|
271
285
|
|
|
272
|
-
//
|
|
286
|
+
// malformed responses always result in empty response xml
|
|
287
|
+
// per spec a valid response cannot be empty
|
|
273
288
|
if (!this?.xhrObject?.responseXML) {
|
|
274
289
|
this.handleMalFormedXML(resolve);
|
|
275
290
|
return;
|
|
276
291
|
}
|
|
277
292
|
|
|
278
|
-
jsf.ajax.response(this.xhrObject, this.responseContext.value ?? {});
|
|
293
|
+
(window?.faces ?? window.jsf).ajax.response(this.xhrObject, this.responseContext.value ?? {});
|
|
279
294
|
}
|
|
280
295
|
|
|
281
296
|
private handleMalFormedXML(resolve: Function) {
|
|
@@ -292,14 +307,15 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
292
307
|
try {
|
|
293
308
|
this.handleError(errorData, true);
|
|
294
309
|
} finally {
|
|
295
|
-
//we issue a resolve in this case to allow the system to recover
|
|
310
|
+
// we issue a resolve in this case to allow the system to recover
|
|
311
|
+
// reject would clean up the queue
|
|
296
312
|
resolve(errorData);
|
|
297
|
-
//reject();
|
|
298
313
|
}
|
|
299
|
-
//non blocking non clearing
|
|
314
|
+
// non blocking non clearing
|
|
300
315
|
}
|
|
301
316
|
|
|
302
317
|
private onDone(data: any, resolve: Consumer<any>) {
|
|
318
|
+
// if stop progress a special handling including resolve is already performed
|
|
303
319
|
if (this.stopProgress) {
|
|
304
320
|
return;
|
|
305
321
|
}
|
|
@@ -314,10 +330,10 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
314
330
|
private sendRequest(formData: XhrFormData) {
|
|
315
331
|
let isPost = this.ajaxType != REQ_TYPE_GET;
|
|
316
332
|
if (formData.isMultipartRequest) {
|
|
317
|
-
//in case of a multipart request we send in a formData object as body
|
|
333
|
+
// in case of a multipart request we send in a formData object as body
|
|
318
334
|
this.xhrObject.send((isPost) ? formData.toFormData() : null);
|
|
319
335
|
} else {
|
|
320
|
-
//in case of a normal request we send it normally
|
|
336
|
+
// in case of a normal request we send it normally
|
|
321
337
|
this.xhrObject.send((isPost) ? formData.toString() : null);
|
|
322
338
|
}
|
|
323
339
|
}
|
|
@@ -328,10 +344,10 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
328
344
|
private sendEvent(evtType: string) {
|
|
329
345
|
let eventData = EventData.createFromRequest(this.xhrObject, this.requestContext, evtType);
|
|
330
346
|
try {
|
|
331
|
-
//
|
|
332
|
-
//this in onError but also we cannot swallow it
|
|
333
|
-
//
|
|
334
|
-
//because some frameworks might decorate them over the context in the response
|
|
347
|
+
// User code error, we might cover
|
|
348
|
+
// this in onError, but also we cannot swallow it.
|
|
349
|
+
// We need to resolve the local handlers lazily,
|
|
350
|
+
// because some frameworks might decorate them over the context in the response
|
|
335
351
|
let eventHandler = resolveHandlerFunc(this.requestContext, this.responseContext, ON_EVENT);
|
|
336
352
|
|
|
337
353
|
Implementation.sendEvent(eventData, eventHandler);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -27,10 +27,6 @@ import {DQ, Stream} from "mona-dish";
|
|
|
27
27
|
*
|
|
28
28
|
* we might move the code over in the future, but for now a straight 1:1 port suffices
|
|
29
29
|
*/
|
|
30
|
-
declare const window: any;
|
|
31
|
-
declare const myfaces: any;
|
|
32
|
-
|
|
33
|
-
//TODO add unit tests to check all this here that it works just as before
|
|
34
30
|
export module oam {
|
|
35
31
|
/**
|
|
36
32
|
* sets a hidden input field
|
|
@@ -38,7 +34,7 @@ export module oam {
|
|
|
38
34
|
* @param name the hidden field
|
|
39
35
|
* @param value the value to be rendered
|
|
40
36
|
*/
|
|
41
|
-
export const setHiddenInput = function (formName: string, name: string, value: string) {
|
|
37
|
+
export const setHiddenInput = function (formName: string, name: string, value: string): void {
|
|
42
38
|
DQ.byId(document.forms[formName])
|
|
43
39
|
.each(form => {
|
|
44
40
|
const input = form.querySelectorAll(`input[type='hidden'][name='${name}']`);
|
|
@@ -58,7 +54,7 @@ export module oam {
|
|
|
58
54
|
* @param formName formName for the input
|
|
59
55
|
* @param name the name of the input field
|
|
60
56
|
*/
|
|
61
|
-
export const clearHiddenInput = function (formName: string, name: string) {
|
|
57
|
+
export const clearHiddenInput = function (formName: string, name: string): void {
|
|
62
58
|
let element = document.forms?.[formName]?.elements?.[name];
|
|
63
59
|
if(!element) {
|
|
64
60
|
return;
|
|
@@ -77,13 +73,13 @@ export module oam {
|
|
|
77
73
|
* @param target
|
|
78
74
|
* @param params
|
|
79
75
|
*/
|
|
80
|
-
export const submitForm = function (formName: string, linkId: string, target: string, params: { [key: string]: any }) {
|
|
76
|
+
export const submitForm = function (formName: string, linkId: string, target: string, params: { [key: string]: any }): boolean {
|
|
81
77
|
let clearFn = 'clearFormHiddenParams_' + formName.replace(/-/g, '\$:').replace(/:/g, '_');
|
|
82
78
|
window?.[clearFn]?.(formName);
|
|
83
79
|
|
|
84
80
|
//autoscroll code
|
|
85
|
-
if (window?.myfaces?.core?.config?.autoScroll && window?.getScrolling) {
|
|
86
|
-
myfaces.oam.setHiddenInput(formName, 'autoScroll', window?.getScrolling());
|
|
81
|
+
if (window?.myfaces?.core?.config?.autoScroll && (window as any)?.getScrolling) {
|
|
82
|
+
myfaces.oam.setHiddenInput(formName, 'autoScroll', (window as any)?.getScrolling());
|
|
87
83
|
}
|
|
88
84
|
Stream.ofAssoc(params).each((param: [string, any]) => {
|
|
89
85
|
myfaces.oam.setHiddenInput(formName, param[0], param[1]);
|
|
@@ -106,13 +102,14 @@ export module oam {
|
|
|
106
102
|
}
|
|
107
103
|
} catch (e) {
|
|
108
104
|
window?.console.error(e);
|
|
105
|
+
} finally {
|
|
106
|
+
form.attr(ATTR_TARGET).value = oldTarget;
|
|
107
|
+
Stream.ofAssoc(params).each((param: [string, any]) => {
|
|
108
|
+
myfaces.oam.clearHiddenInput(formName, param[0]);
|
|
109
|
+
});
|
|
110
|
+
myfaces.oam.clearHiddenInput(formName, `${formName}:_idcl`);
|
|
109
111
|
}
|
|
110
112
|
|
|
111
|
-
form.attr(ATTR_TARGET).value = oldTarget;
|
|
112
|
-
Stream.ofAssoc(params).each((param: [string, any]) => {
|
|
113
|
-
myfaces.oam.clearHiddenInput(formName, param[0]);
|
|
114
|
-
});
|
|
115
|
-
myfaces.oam.clearHiddenInput(formName, `${formName}:_idcl`);
|
|
116
113
|
});
|
|
117
114
|
return false;
|
|
118
115
|
};
|