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
|
|
@@ -13,23 +13,22 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
///<reference types='../../types/typedefs'/>
|
|
18
|
-
|
|
19
16
|
import {Implementation} from "../impl/AjaxImpl";
|
|
20
17
|
import {PushImpl} from "../impl/PushImpl";
|
|
21
18
|
import {oam as _oam} from "../myfaces/OamSubmit";
|
|
19
|
+
import {$nsp, CTX_PARAM_EXECUTE, CTX_PARAM_RENDER, P_BEHAVIOR_EVENT} from "../impl/core/Const";
|
|
20
|
+
import {ErrorData} from "../impl/xhrCore/ErrorData";
|
|
21
|
+
import {EventData} from "../impl/xhrCore/EventData";
|
|
22
22
|
|
|
23
|
+
//we use modules to get a proper jsdoc and static/map structure in the calls
|
|
24
|
+
//as per spec requirement
|
|
25
|
+
export module faces {
|
|
23
26
|
|
|
24
|
-
//declare const Implementation: any;
|
|
25
|
-
|
|
26
|
-
export module jsf {
|
|
27
|
-
"use strict";
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
* Version of the implementation for the
|
|
28
|
+
/**
|
|
29
|
+
* Version of the implementation for the faces.ts.
|
|
31
30
|
* <p />
|
|
32
|
-
* as specified within the jsf specifications
|
|
31
|
+
* as specified within the jsf specifications faces.html:
|
|
33
32
|
* <ul>
|
|
34
33
|
* <li>left two digits major release number</li>
|
|
35
34
|
* <li>middle two digits minor spec release number</li>
|
|
@@ -37,7 +36,7 @@ export module jsf {
|
|
|
37
36
|
* </ul>
|
|
38
37
|
* @constant
|
|
39
38
|
*/
|
|
40
|
-
export var specversion =
|
|
39
|
+
export var specversion = 400000;
|
|
41
40
|
/**
|
|
42
41
|
* Implementation version as specified within the jsf specification.
|
|
43
42
|
* <p />
|
|
@@ -49,10 +48,16 @@ export module jsf {
|
|
|
49
48
|
export var implversion = 0;
|
|
50
49
|
|
|
51
50
|
/**
|
|
52
|
-
* SeparatorChar as defined by
|
|
53
|
-
|
|
51
|
+
* SeparatorChar as defined by facesContext.getNamingContainerSeparatorChar()
|
|
52
|
+
*/
|
|
53
|
+
export var separatorchar: string = getSeparatorChar();
|
|
54
|
+
|
|
55
|
+
// noinspection JSUnusedGlobalSymbols
|
|
56
|
+
/**
|
|
57
|
+
* Context Path as defined externalContext.requestContextPath
|
|
54
58
|
*/
|
|
55
|
-
export var
|
|
59
|
+
export var contextpath: string = '#{facesContext.externalContext.requestContextPath}';
|
|
60
|
+
// we do not have a fallback here, for now
|
|
56
61
|
|
|
57
62
|
/**
|
|
58
63
|
* This method is responsible for the return of a given project stage as defined
|
|
@@ -67,7 +72,7 @@ export module jsf {
|
|
|
67
72
|
* </li>
|
|
68
73
|
*
|
|
69
74
|
* @return {String} the current project state emitted by the server side method:
|
|
70
|
-
* <i>
|
|
75
|
+
* <i>jakarta.faces.application.Application.getProjectStage()</i>
|
|
71
76
|
*/
|
|
72
77
|
export function getProjectStage(): string {
|
|
73
78
|
return Implementation.getProjectStage();
|
|
@@ -75,7 +80,7 @@ export module jsf {
|
|
|
75
80
|
|
|
76
81
|
/**
|
|
77
82
|
* collect and encode data for a given form element (must be of type form)
|
|
78
|
-
* find the
|
|
83
|
+
* find the jakarta.faces.ViewState element and encode its value as well!
|
|
79
84
|
* return a concatenated string of the encoded values!
|
|
80
85
|
*
|
|
81
86
|
* @throws an exception in case of the given element not being of type form!
|
|
@@ -95,11 +100,17 @@ export module jsf {
|
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
//private helper functions
|
|
98
|
-
function getSeparatorChar() {
|
|
99
|
-
|
|
103
|
+
function getSeparatorChar(): string {
|
|
104
|
+
const sep = '#{facesContext.namingContainerSeparatorChar}';
|
|
105
|
+
//We now enable standalone mode, the separator char was not mapped we make a fallback to 2.3 behavior
|
|
106
|
+
//the idea is that the separator char is provided from the underlying container, but if not then we
|
|
107
|
+
//will perform a fallback (aka 2.3 has the url fallback behavior)
|
|
108
|
+
return (sep.match(/\#\{facesContext.namingContainerSeparatorChar\}/gi)) ? Implementation.getSeparatorChar() : sep;
|
|
100
109
|
}
|
|
101
110
|
|
|
102
111
|
|
|
112
|
+
|
|
113
|
+
|
|
103
114
|
export module ajax {
|
|
104
115
|
"use strict";
|
|
105
116
|
|
|
@@ -118,9 +129,8 @@ export module jsf {
|
|
|
118
129
|
* @param {EVENT} event: any javascript event supported by that object
|
|
119
130
|
* @param {Map} options : map of options being pushed into the ajax cycle
|
|
120
131
|
*/
|
|
121
|
-
export function request(element: Element, event?: Event, options?: Context) {
|
|
132
|
+
export function request(element: Element, event?: Event, options?: Context): void {
|
|
122
133
|
Implementation.request(element, event, options)
|
|
123
|
-
//Implementation.getInstance().requestInternal(element, event, options);
|
|
124
134
|
}
|
|
125
135
|
|
|
126
136
|
/**
|
|
@@ -130,7 +140,7 @@ export module jsf {
|
|
|
130
140
|
*
|
|
131
141
|
* TODO add info on what can be in the context
|
|
132
142
|
*/
|
|
133
|
-
export function response(request: XMLHttpRequest, context?: Context) {
|
|
143
|
+
export function response(request: XMLHttpRequest, context?: Context): void {
|
|
134
144
|
Implementation.response(request, context);
|
|
135
145
|
}
|
|
136
146
|
|
|
@@ -149,9 +159,9 @@ export module jsf {
|
|
|
149
159
|
* <li> eventData.responseXML: the requestInternal response xml </li>
|
|
150
160
|
* </ul>
|
|
151
161
|
*
|
|
152
|
-
* @param
|
|
162
|
+
* @param errorListener error handler must be of the format <i>function errorListener(<errorData>)</i>
|
|
153
163
|
*/
|
|
154
|
-
export function addOnError(errorFunc: (data: ErrorData) => void) {
|
|
164
|
+
export function addOnError(errorFunc: (data: ErrorData) => void): void {
|
|
155
165
|
Implementation.addOnError(<any>errorFunc);
|
|
156
166
|
}
|
|
157
167
|
|
|
@@ -159,9 +169,9 @@ export module jsf {
|
|
|
159
169
|
* Adds a global event listener to the ajax event queue. The event listener must be a function
|
|
160
170
|
* of following format: <i>function eventListener(<eventData>)</i>
|
|
161
171
|
*
|
|
162
|
-
* @param
|
|
172
|
+
* @param eventListener event must be of the format <i>function eventListener(<eventData>)</i>
|
|
163
173
|
*/
|
|
164
|
-
export function addOnEvent(eventFunc: (data: EventData) => void) {
|
|
174
|
+
export function addOnEvent(eventFunc: (data: EventData) => void): void {
|
|
165
175
|
Implementation.addOnEvent(<any>eventFunc);
|
|
166
176
|
}
|
|
167
177
|
}
|
|
@@ -186,46 +196,48 @@ export module jsf {
|
|
|
186
196
|
|
|
187
197
|
export module push {
|
|
188
198
|
/**
|
|
189
|
-
* @param
|
|
190
|
-
* @param
|
|
191
|
-
* @param
|
|
192
|
-
* @param
|
|
199
|
+
* @param socketClientId the sockets client identifier
|
|
200
|
+
* @param url the uri to reach the socket
|
|
201
|
+
* @param channel the channel name/id
|
|
202
|
+
* @param onopen The function to be invoked when the web socket is opened.
|
|
203
|
+
* @param onmessage The function to be invoked when a message is received.
|
|
204
|
+
* @param onclose The function to be invoked when the web socket is closed.
|
|
205
|
+
* @param behaviors functions which are invoked whenever a message is received
|
|
206
|
+
* @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
|
|
193
207
|
*/
|
|
194
208
|
export function init(socketClientId: string,
|
|
195
|
-
|
|
209
|
+
url: string,
|
|
196
210
|
channel: string,
|
|
197
211
|
onopen: Function,
|
|
198
212
|
onmessage: Function,
|
|
199
213
|
onclose: Function,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
PushImpl.init(socketClientId,
|
|
214
|
+
behaviors: any,
|
|
215
|
+
autoConnect: boolean): void {
|
|
216
|
+
PushImpl.init(socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect);
|
|
203
217
|
}
|
|
204
218
|
|
|
205
219
|
/**
|
|
206
220
|
* Open the web socket on the given channel.
|
|
207
|
-
* @param
|
|
208
|
-
* @throws
|
|
221
|
+
* @param channel The name of the web socket channel.
|
|
222
|
+
* @throws Error is thrown, if the channel is unknown.
|
|
209
223
|
*/
|
|
210
|
-
export function open(socketClientId: string) {
|
|
224
|
+
export function open(socketClientId: string): void {
|
|
211
225
|
PushImpl.open(socketClientId);
|
|
212
226
|
}
|
|
213
227
|
|
|
214
228
|
/**
|
|
215
229
|
* Close the web socket on the given channel.
|
|
216
|
-
* @param
|
|
217
|
-
* @throws
|
|
230
|
+
* @param channel The name of the web socket channel.
|
|
231
|
+
* @throws Error is thrown, if the channel is unknown.
|
|
218
232
|
*/
|
|
219
|
-
export function close(socketClientId: string) {
|
|
233
|
+
export function close(socketClientId: string): void {
|
|
220
234
|
PushImpl.close(socketClientId);
|
|
221
235
|
}
|
|
222
236
|
|
|
223
237
|
}
|
|
224
238
|
}
|
|
225
239
|
|
|
226
|
-
//fullfill the window contract for the myfaces namespace
|
|
227
240
|
export module myfaces {
|
|
228
|
-
|
|
229
241
|
/**
|
|
230
242
|
* AB function similar to mojarra and Primefaces
|
|
231
243
|
* not part of the spec but a convenience accessor method
|
|
@@ -233,23 +245,23 @@ export module myfaces {
|
|
|
233
245
|
*
|
|
234
246
|
* @param source the event source
|
|
235
247
|
* @param event the event
|
|
236
|
-
* @param eventName event name for java.
|
|
237
|
-
* @param execute execute list as passed down in
|
|
248
|
+
* @param eventName event name for java.jakarta.faces.behavior.evemnt
|
|
249
|
+
* @param execute execute list as passed down in faces.ajax.request
|
|
238
250
|
* @param render
|
|
239
251
|
* @param options
|
|
240
252
|
*/
|
|
241
|
-
export function ab(source: Element, event: Event, eventName: string, execute: string, render: string, options: Context = {}) {
|
|
253
|
+
export function ab(source: Element, event: Event, eventName: string, execute: string, render: string, options: Context = {}): void {
|
|
242
254
|
if (eventName) {
|
|
243
|
-
|
|
255
|
+
options[$nsp(P_BEHAVIOR_EVENT)] = eventName;
|
|
244
256
|
}
|
|
245
257
|
if (execute) {
|
|
246
|
-
options[
|
|
258
|
+
options[CTX_PARAM_EXECUTE] = execute;
|
|
247
259
|
}
|
|
248
260
|
if (render) {
|
|
249
|
-
options[
|
|
261
|
+
options[CTX_PARAM_RENDER] = render;
|
|
250
262
|
}
|
|
251
263
|
|
|
252
|
-
jsf.ajax.request(source, event, options);
|
|
264
|
+
(window?.faces ?? window.jsf).ajax.request(source, event, options);
|
|
253
265
|
}
|
|
254
266
|
|
|
255
267
|
/**
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* faces.js init layer which provides as per spec the proper
|
|
21
|
+
* window namespace if it does not exist already
|
|
22
|
+
*
|
|
23
|
+
* The idea is that we use a small shim on top of
|
|
24
|
+
* the implementation to provide the window namespace.
|
|
25
|
+
* The implementation itself is in a protected namespace
|
|
26
|
+
* which will be bound by the build system
|
|
27
|
+
*
|
|
28
|
+
* The documentation nevertheless targets the _api file, which
|
|
29
|
+
* hosts the full api
|
|
30
|
+
*/
|
|
31
|
+
if(!window.faces) {
|
|
32
|
+
//we lazily load the code to prevent ram bloat
|
|
33
|
+
const faces = require("./_api").faces;
|
|
34
|
+
window['faces'] = window?.faces ?? faces;
|
|
35
|
+
}
|
|
36
|
+
if(!window?.myfaces?.ab) {
|
|
37
|
+
const myfaces = require("./_api").myfaces;
|
|
38
|
+
|
|
39
|
+
//namespace might be extended is not exclusively reserved so we merge
|
|
40
|
+
(window as any)["myfaces"] = window?.myfaces ?? {};
|
|
41
|
+
Object.keys(myfaces).forEach(key => window.myfaces[key] = window.myfaces?.[key] ?? myfaces[key]);
|
|
42
|
+
}
|
|
43
|
+
export var faces = window.faces;
|
|
44
|
+
export var myfaces = window.myfaces;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
"use strict";
|
|
18
|
+
/**
|
|
19
|
+
* jsf.js init layer which provides as per spec the proper
|
|
20
|
+
* window namespace if it does not exist already
|
|
21
|
+
* if this file is included then the code falls back with its namespaces
|
|
22
|
+
* on jsf2.3 or earlier level, for 4.0+ please include faces.js
|
|
23
|
+
*/
|
|
24
|
+
if(!window?.jsf) {
|
|
25
|
+
const faces = require("./_api").faces;
|
|
26
|
+
(window as any)['jsf'] = window?.jsf ?? faces;
|
|
27
|
+
window.jsf.specversion = 230000;
|
|
28
|
+
delete window.jsf.contextpath;
|
|
29
|
+
}
|
|
30
|
+
if(!window?.myfaces?.ab) {
|
|
31
|
+
const myfaces = require("./_api").myfaces;
|
|
32
|
+
//namespace might be extended is not exclusively reserved so we merge
|
|
33
|
+
(window as any)["myfaces"] = window?.myfaces ?? {};
|
|
34
|
+
if(!window?.myfaces?.ab) {
|
|
35
|
+
const myfaces = require("./_api").myfaces;
|
|
36
|
+
//namespace might be extended is not exclusively reserved so we merge
|
|
37
|
+
(window as any)["myfaces"] = window?.myfaces ?? {};
|
|
38
|
+
Object.keys(myfaces).forEach(key => window.myfaces[key] = window.myfaces?.[key] ?? myfaces[key]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export var jsf = window.jsf;
|
|
43
|
+
export var myfaces = window.myfaces;
|
|
@@ -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
|
|
@@ -21,10 +21,11 @@ import {AsynchronousQueue} from "./util/AsyncQueue";
|
|
|
21
21
|
import {AssocArrayCollector, Config, DQ, Lang, LazyStream, Optional, Stream} from "mona-dish";
|
|
22
22
|
import {Assertions} from "./util/Assertions";
|
|
23
23
|
import {XhrFormData} from "./xhrCore/XhrFormData";
|
|
24
|
-
import {
|
|
24
|
+
import {ExtDomQuery} from "./util/ExtDomQuery";
|
|
25
25
|
import {ErrorData} from "./xhrCore/ErrorData";
|
|
26
26
|
import {EventData} from "./xhrCore/EventData";
|
|
27
27
|
import {ExtLang} from "./util/Lang";
|
|
28
|
+
|
|
28
29
|
import {
|
|
29
30
|
CTX_PARAM_EXECUTE,
|
|
30
31
|
CTX_PARAM_PASS_THR,
|
|
@@ -46,7 +47,7 @@ import {
|
|
|
46
47
|
P_RENDER,
|
|
47
48
|
P_RESET_VALUES,
|
|
48
49
|
P_WINDOW_ID,
|
|
49
|
-
|
|
50
|
+
CTX_PARAM_RENDER,
|
|
50
51
|
REQ_TYPE_POST,
|
|
51
52
|
SOURCE,
|
|
52
53
|
TAG_FORM
|
|
@@ -58,9 +59,6 @@ import {
|
|
|
58
59
|
resolveTimeout
|
|
59
60
|
} from "./xhrCore/RequestDataResolver";
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
declare var jsf: any;
|
|
63
|
-
|
|
64
62
|
/*
|
|
65
63
|
* allowed project stages
|
|
66
64
|
*/
|
|
@@ -72,8 +70,8 @@ enum ProjectStages {
|
|
|
72
70
|
}
|
|
73
71
|
|
|
74
72
|
/*
|
|
75
|
-
*
|
|
76
|
-
* will not be transmitted from the options into the
|
|
73
|
+
* Block-filter for the pass-through filtering; the attributes given here
|
|
74
|
+
* will not be transmitted from the options into the pass-through
|
|
77
75
|
*/
|
|
78
76
|
enum BlockFilter {
|
|
79
77
|
onerror = "onerror",
|
|
@@ -149,8 +147,6 @@ export module Implementation {
|
|
|
149
147
|
import getGlobalConfig = ExtLang.getGlobalConfig;
|
|
150
148
|
import assert = Assertions.assert;
|
|
151
149
|
|
|
152
|
-
|
|
153
|
-
|
|
154
150
|
let projectStage: string = null;
|
|
155
151
|
let separator: string = null;
|
|
156
152
|
let eventQueue = [];
|
|
@@ -167,7 +163,7 @@ export module Implementation {
|
|
|
167
163
|
export function getSeparatorChar(): string {
|
|
168
164
|
return resolveGlobalConfig()?.separator ??
|
|
169
165
|
this?.separator ??
|
|
170
|
-
(separator =
|
|
166
|
+
(separator = ExtDomQuery.searchJsfJsFor(/separator=([^&;]*)/).orElse(":").value);
|
|
171
167
|
}
|
|
172
168
|
|
|
173
169
|
/**
|
|
@@ -185,7 +181,7 @@ export module Implementation {
|
|
|
185
181
|
/**
|
|
186
182
|
* @return the project stage also emitted by the server:
|
|
187
183
|
* it cannot be cached and must be delivered over the server
|
|
188
|
-
* The value for it comes from the requestInternal parameter of the
|
|
184
|
+
* The value for it comes from the requestInternal parameter of the faces.js script called "stage".
|
|
189
185
|
*/
|
|
190
186
|
export function getProjectStage(): string | null {
|
|
191
187
|
return resolveGlobalConfig()?.projectStage ??
|
|
@@ -199,13 +195,13 @@ export module Implementation {
|
|
|
199
195
|
*/
|
|
200
196
|
export function resolveProjectStateFromURL(): string | null {
|
|
201
197
|
|
|
202
|
-
/* run through all script tags and try to find the one that includes
|
|
203
|
-
const foundStage =
|
|
198
|
+
/* run through all script tags and try to find the one that includes faces.js */
|
|
199
|
+
const foundStage = ExtDomQuery.searchJsfJsFor(/stage=([^&;]*)/).value as string;
|
|
204
200
|
return (foundStage in ProjectStages) ? foundStage : null;
|
|
205
201
|
}
|
|
206
202
|
|
|
207
203
|
/**
|
|
208
|
-
* implementation of the
|
|
204
|
+
* implementation of the faces.util.chain functionality
|
|
209
205
|
*
|
|
210
206
|
* @param source
|
|
211
207
|
* @param event
|
|
@@ -270,7 +266,8 @@ export module Implementation {
|
|
|
270
266
|
const timeout: number = resolveTimeout(options);
|
|
271
267
|
|
|
272
268
|
requestCtx.assignIf(!!windowId, P_WINDOW_ID).value = windowId;
|
|
273
|
-
|
|
269
|
+
|
|
270
|
+
requestCtx.assign(CTX_PARAM_PASS_THR).value = filterPassThroughValues(options.value);
|
|
274
271
|
requestCtx.assignIf(!!resolvedEvent, CTX_PARAM_PASS_THR, P_EVT).value = resolvedEvent?.type;
|
|
275
272
|
|
|
276
273
|
/**
|
|
@@ -293,18 +290,18 @@ export module Implementation {
|
|
|
293
290
|
requestCtx.assign(MYFACES).value = options.value?.myfaces;
|
|
294
291
|
|
|
295
292
|
/**
|
|
296
|
-
* binding contract the
|
|
293
|
+
* binding contract the jakarta.faces.source must be set
|
|
297
294
|
*/
|
|
298
295
|
requestCtx.assign(CTX_PARAM_PASS_THR, P_PARTIAL_SOURCE).value = elementId;
|
|
299
296
|
|
|
300
297
|
/**
|
|
301
|
-
*
|
|
298
|
+
* jakarta.faces.partial.ajax must be set to true
|
|
302
299
|
*/
|
|
303
300
|
requestCtx.assign(CTX_PARAM_PASS_THR, P_AJAX).value = true;
|
|
304
301
|
|
|
305
302
|
/**
|
|
306
303
|
* if resetValues is set to true
|
|
307
|
-
* then we have to set
|
|
304
|
+
* then we have to set jakarta.faces.resetValues as well
|
|
308
305
|
* as pass through parameter
|
|
309
306
|
* the value has to be explicitly true, according to
|
|
310
307
|
* the specs jsdoc
|
|
@@ -435,24 +432,24 @@ export module Implementation {
|
|
|
435
432
|
}
|
|
436
433
|
|
|
437
434
|
/**
|
|
438
|
-
* @node optional element or id defining a rootnode where an element with the id "
|
|
435
|
+
* @node optional element or id defining a rootnode where an element with the id "jakarta.faces.windowId" is hosted
|
|
439
436
|
* @return the client window id of the current window, if one is given if none is found, null is returned
|
|
440
437
|
*/
|
|
441
438
|
export function getClientWindow(node ?: Element | string): string | null {
|
|
442
439
|
const ALTERED = "___mf_id_altered__";
|
|
443
440
|
const INIT = "___init____";
|
|
444
441
|
|
|
445
|
-
|
|
442
|
+
/*
|
|
446
443
|
* the search root for the dom element search
|
|
447
444
|
*/
|
|
448
445
|
let searchRoot = new DQ(node || document.body).querySelectorAll(`form input [name='${P_CLIENT_WINDOW}']`);
|
|
449
446
|
|
|
450
|
-
|
|
447
|
+
/*
|
|
451
448
|
* lazy helper to fetch the window id from the window url
|
|
452
449
|
*/
|
|
453
|
-
let fetchWindowIdFromUrl = () =>
|
|
450
|
+
let fetchWindowIdFromUrl = () => ExtDomQuery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null).value;
|
|
454
451
|
|
|
455
|
-
|
|
452
|
+
/*
|
|
456
453
|
* functional double check based on stream reduction
|
|
457
454
|
* the values should be identical or on INIT value which is a premise to
|
|
458
455
|
* skip the first check
|
|
@@ -469,16 +466,16 @@ export module Implementation {
|
|
|
469
466
|
return value2;
|
|
470
467
|
};
|
|
471
468
|
|
|
472
|
-
|
|
469
|
+
/*
|
|
473
470
|
* helper for cleaner code, maps the value from an item
|
|
474
471
|
*
|
|
475
472
|
* @param item
|
|
476
473
|
*/
|
|
477
474
|
let getValue = (item: DQ) => item.attr("value").value;
|
|
478
|
-
|
|
475
|
+
/*
|
|
479
476
|
* fetch the window id from the forms
|
|
480
477
|
* window ids must be present in all forms
|
|
481
|
-
* or non
|
|
478
|
+
* or non-existent. If they exist all of them must be the same
|
|
482
479
|
*/
|
|
483
480
|
|
|
484
481
|
let formWindowId: Optional<string> = searchRoot.stream.map<string>(getValue).reduce(differenceCheck, INIT);
|
|
@@ -487,16 +484,15 @@ export module Implementation {
|
|
|
487
484
|
//if the resulting window id is set on altered then we have an unresolvable problem
|
|
488
485
|
assert(ALTERED != formWindowId.value, "Multiple different windowIds found in document");
|
|
489
486
|
|
|
490
|
-
|
|
487
|
+
/*
|
|
491
488
|
* return the window id or null
|
|
492
|
-
* prio, forms under node/document and if not given then from the url
|
|
493
489
|
*/
|
|
494
490
|
return formWindowId.value != INIT ? formWindowId.value : fetchWindowIdFromUrl();
|
|
495
491
|
}
|
|
496
492
|
|
|
497
493
|
/**
|
|
498
494
|
* collect and encode data for a given form element (must be of type form)
|
|
499
|
-
* find the
|
|
495
|
+
* find the jakarta.faces.ViewState element and encode its value as well!
|
|
500
496
|
* @return a concatenated string of the encoded values!
|
|
501
497
|
*
|
|
502
498
|
* @throws Error in case of the given element not being of type form!
|
|
@@ -504,7 +500,7 @@ export module Implementation {
|
|
|
504
500
|
*/
|
|
505
501
|
export function getViewState(form: Element | string): string {
|
|
506
502
|
/**
|
|
507
|
-
*
|
|
503
|
+
* type-check assert!, we opt for strong typing here
|
|
508
504
|
* because it makes it easier to detect bugs
|
|
509
505
|
*/
|
|
510
506
|
|
|
@@ -524,7 +520,7 @@ export module Implementation {
|
|
|
524
520
|
*/
|
|
525
521
|
export let queueHandler = {
|
|
526
522
|
/**
|
|
527
|
-
* public to make it
|
|
523
|
+
* public to make it accessible for tests
|
|
528
524
|
*
|
|
529
525
|
* adds a new request to our queue for further processing
|
|
530
526
|
*/
|
|
@@ -543,14 +539,14 @@ export module Implementation {
|
|
|
543
539
|
*
|
|
544
540
|
* This function does it for the render parameters
|
|
545
541
|
*
|
|
546
|
-
* @param requestOptions the source options coming in as options object from
|
|
542
|
+
* @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)
|
|
547
543
|
* @param targetContext the receiving target context
|
|
548
544
|
* @param issuingForm the issuing form
|
|
549
|
-
* @param sourceElementId the executing element triggering the
|
|
545
|
+
* @param sourceElementId the executing element triggering the faces.ajax.request (id of it)
|
|
550
546
|
*/
|
|
551
547
|
function assignRender(requestOptions: Config, targetContext: Config, issuingForm: DQ, sourceElementId: string) {
|
|
552
|
-
if (requestOptions.getIf(
|
|
553
|
-
remapDefaultConstants(targetContext.getIf(CTX_PARAM_PASS_THR).get({}), P_RENDER, <string>requestOptions.getIf(
|
|
548
|
+
if (requestOptions.getIf(CTX_PARAM_RENDER).isPresent()) {
|
|
549
|
+
remapDefaultConstants(targetContext.getIf(CTX_PARAM_PASS_THR).get({}), P_RENDER, <string>requestOptions.getIf(CTX_PARAM_RENDER).value, issuingForm, <any>sourceElementId);
|
|
554
550
|
}
|
|
555
551
|
}
|
|
556
552
|
|
|
@@ -561,10 +557,10 @@ export module Implementation {
|
|
|
561
557
|
*
|
|
562
558
|
* This function does it for the execute parameters
|
|
563
559
|
*
|
|
564
|
-
* @param requestOptions the source options coming in as options object from
|
|
560
|
+
* @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)
|
|
565
561
|
* @param targetContext the receiving target context
|
|
566
562
|
* @param issuingForm the issuing form
|
|
567
|
-
* @param sourceElementId the executing element triggering the
|
|
563
|
+
* @param sourceElementId the executing element triggering the faces.ajax.request (id of it)
|
|
568
564
|
*/
|
|
569
565
|
function assignExecute(requestOptions: Config, targetContext: Config, issuingForm: DQ, sourceElementId: string) {
|
|
570
566
|
|
|
@@ -587,7 +583,8 @@ export module Implementation {
|
|
|
587
583
|
* @param targetContext the target context receiving the value
|
|
588
584
|
*/
|
|
589
585
|
function assignClientWindowId(form: DQ, targetContext: Config) {
|
|
590
|
-
|
|
586
|
+
|
|
587
|
+
let clientWindow = (window?.faces ?? window?.jsf).getClientWindow(form.getAsElem(0).value);
|
|
591
588
|
if (clientWindow) {
|
|
592
589
|
targetContext.assign(CTX_PARAM_PASS_THR, P_CLIENT_WINDOW).value = clientWindow;
|
|
593
590
|
}
|
|
@@ -653,12 +650,12 @@ export module Implementation {
|
|
|
653
650
|
}
|
|
654
651
|
|
|
655
652
|
/**
|
|
656
|
-
*
|
|
657
|
-
* the values required for
|
|
653
|
+
* Filter the options given with a blacklist, so that only
|
|
654
|
+
* the values required for pass-through are processed in the ajax request
|
|
658
655
|
*
|
|
659
656
|
* @param {Context} mappedOpts the options to be filtered
|
|
660
657
|
*/
|
|
661
|
-
function
|
|
658
|
+
function filterPassThroughValues(mappedOpts: Context): Context {
|
|
662
659
|
//we now can use the full code reduction given by our stream api
|
|
663
660
|
//to filter
|
|
664
661
|
return Stream.ofAssoc(mappedOpts)
|