jsf.js_next_gen 4.1.0-beta.2 → 4.1.0-beta.21
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/AI_CONTRIBUTIONS.md +71 -0
- package/README.md +254 -78
- package/api-extractor.faces.json +38 -0
- package/dist/docs/assets/hierarchy.js +1 -1
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/functions/faces.ajax.addOnError.html +2 -2
- package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -2
- package/dist/docs/functions/faces.ajax.request.html +2 -2
- package/dist/docs/functions/faces.ajax.response.html +2 -2
- package/dist/docs/functions/faces.getClientWindow.html +2 -2
- package/dist/docs/functions/faces.getProjectStage.html +2 -2
- package/dist/docs/functions/faces.getViewState.html +1 -1
- package/dist/docs/functions/faces.push.close.html +1 -1
- package/dist/docs/functions/faces.push.init.html +6 -6
- package/dist/docs/functions/faces.push.open.html +1 -1
- package/dist/docs/functions/faces.util.chain.html +2 -2
- package/dist/docs/functions/myfaces.ab.html +3 -3
- package/dist/docs/functions/myfaces.onDomReady.html +1 -1
- package/dist/docs/functions/myfaces.reserveNamespace.html +1 -1
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/index.html +292 -71
- package/dist/docs/interfaces/faces.AjaxData.html +6 -0
- package/dist/docs/interfaces/faces.AjaxError.html +18 -0
- package/dist/docs/interfaces/faces.AjaxEvent.html +8 -0
- package/dist/docs/interfaces/faces.ajax.RequestContext.html +6 -0
- package/dist/docs/interfaces/faces.ajax.RequestOptions.html +10 -0
- package/dist/docs/modules/faces.ajax.html +1 -1
- package/dist/docs/modules/faces.html +1 -1
- package/dist/docs/modules/faces.push.html +1 -1
- package/dist/docs/modules/faces.util.html +1 -1
- package/dist/docs/modules/myfaces.html +1 -1
- package/dist/docs/modules.html +1 -1
- package/dist/docs/types/faces.AjaxErrorStatus.html +2 -0
- package/dist/docs/types/faces.AjaxEventStatus.html +2 -0
- package/dist/docs/types/faces.ProjectStage.html +2 -0
- package/dist/docs/types/faces.ajax.OnErrorCallback.html +2 -0
- package/dist/docs/types/faces.ajax.OnEventCallback.html +2 -0
- package/dist/docs/types/faces.push.OnCloseHandler.html +2 -0
- package/dist/docs/types/faces.push.OnErrorHandler.html +2 -0
- package/dist/docs/types/faces.push.OnMessageHandler.html +2 -0
- package/dist/docs/types/faces.push.OnOpenHandler.html +2 -0
- package/dist/docs/variables/faces.contextpath.html +1 -1
- package/dist/docs/variables/faces.implversion.html +1 -1
- package/dist/docs/variables/faces.separatorchar.html +1 -1
- package/dist/docs/variables/faces.specversion.html +1 -1
- package/dist/docs/variables/myfaces.oam.html +1 -1
- package/dist/window/faces-development.js +1801 -499
- package/dist/window/faces-development.js.map +1 -1
- package/{target/api/_api.js → dist/window/faces.d.ts} +124 -151
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.LICENSE.txt +0 -17
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +1806 -513
- package/dist/window/jsf-development.js.map +1 -1
- package/{target/src/main/typescript/api/_api.js → dist/window/jsf.d.ts} +125 -153
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.LICENSE.txt +0 -17
- package/dist/window/jsf.js.map +1 -1
- package/package.json +22 -18
- package/scripts/build-dts.mjs +239 -0
- package/src/main/typescript/@types/definitions/index.d.ts +22 -122
- package/{target/test/frameworkBase/_ext/monadish/fixtures/test2.js → src/main/typescript/@types/definitions/modules.d.ts} +18 -2
- package/src/main/typescript/api/_api.ts +132 -29
- package/{target/test/frameworkBase/_ext/monadish/fixtures/test.js → src/main/typescript/api/_api_ae_stub.d.ts} +6 -2
- package/src/main/typescript/api/faces.ts +2 -2
- package/src/main/typescript/api/jsf.ts +15 -23
- package/src/main/typescript/impl/AjaxImpl.ts +15 -15
- package/src/main/typescript/impl/PushImpl.ts +139 -69
- package/src/main/typescript/impl/core/Const.ts +2 -2
- package/src/main/typescript/impl/i18n/Messages.ts +1 -1
- package/src/main/typescript/impl/util/Assertions.ts +1 -2
- package/src/main/typescript/impl/util/AsyncRunnable.ts +3 -4
- package/src/main/typescript/impl/util/ExtDomQuery.ts +19 -19
- package/src/main/typescript/impl/util/FileUtils.ts +30 -14
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +34 -34
- package/src/main/typescript/impl/util/Lang.ts +19 -22
- package/src/main/typescript/impl/util/XhrQueueController.ts +25 -3
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +17 -12
- package/src/main/typescript/impl/xhrCore/EventData.ts +8 -7
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +3 -3
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +7 -6
- package/src/main/typescript/impl/xhrCore/Response.ts +3 -3
- package/src/main/typescript/impl/xhrCore/ResponseDataResolver.ts +0 -38
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +17 -15
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +72 -63
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -134
- package/src/main/typescript/mona_dish_shim.ts +6 -2
- package/src/main/typescript/myfaces/OamSubmit.ts +10 -6
- package/src/main/typescript/test/api/JsfPushShimTest.spec.ts +126 -0
- package/src/main/typescript/test/api/MyFacesABTest.spec.ts +16 -0
- package/src/main/typescript/test/api/PushTypeCompatibility.ts +65 -0
- package/src/main/typescript/test/frameworkBase/LangTest.spec.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +55 -9
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +16 -0
- package/src/main/typescript/test/impl/AssertionsTest.spec.ts +168 -0
- package/src/main/typescript/test/impl/FileUtilsTest.spec.ts +126 -0
- package/src/main/typescript/test/impl/ImplTest.spec.ts +75 -1
- package/src/main/typescript/test/impl/ResponseDataResolverTest.spec.ts +62 -0
- package/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.ts +91 -1
- package/src/main/typescript/test/impl/util/ExtLangTest.spec.ts +110 -0
- package/src/main/typescript/test/impl/util/HiddenInputBuilderTest.spec.ts +74 -0
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +61 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +191 -2
- package/src/main/typescript/test/xhrCore/ClientWindow.spec.ts +16 -0
- package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +14 -0
- package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +21 -5
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +363 -4
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +218 -4
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/WebsocketTest.spec.ts +764 -0
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +265 -62
- package/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.ts +16 -0
- package/{target/src/main/typescript/test/xhrCore/FakeWebsocket.js → src/main/typescript/tsconfig.ae.json} +16 -23
- package/src/main/typescript/{tsconfig.json → tsconfig.dts.json} +11 -27
- package/src/main/typescript/tsconfig.test.json +17 -0
- package/tsconfig.api-extractor.json +17 -0
- package/.claude/settings.local.json +0 -16
- package/.github/workflows/codeql-analysis.yml +0 -83
- package/.github/workflows/nodejs.yml +0 -26
- package/.mocharc.json +0 -10
- package/.nyc_output/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
- package/.nyc_output/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
- package/.nyc_output/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
- package/.nyc_output/processinfo/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
- package/.nyc_output/processinfo/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
- package/.nyc_output/processinfo/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/.nycrc +0 -6
- package/build.cmd +0 -1
- package/build.sh +0 -3
- package/mvnw +0 -286
- package/mvnw.cmd +0 -161
- package/plans for 4.0.1.txt +0 -8
- package/remap.ts +0 -51
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +0 -221
- package/target/api/_api.js.map +0 -1
- package/target/api/faces.js +0 -45
- package/target/api/faces.js.map +0 -1
- package/target/api/jsf.js +0 -56
- package/target/api/jsf.js.map +0 -1
- package/target/impl/AjaxImpl.js +0 -748
- package/target/impl/AjaxImpl.js.map +0 -1
- package/target/impl/PushImpl.js +0 -265
- package/target/impl/PushImpl.js.map +0 -1
- package/target/impl/core/Const.js +0 -177
- package/target/impl/core/Const.js.map +0 -1
- package/target/impl/core/ImplTypes.js +0 -38
- package/target/impl/core/ImplTypes.js.map +0 -1
- package/target/impl/i18n/Messages.js +0 -113
- package/target/impl/i18n/Messages.js.map +0 -1
- package/target/impl/util/Assertions.js +0 -101
- package/target/impl/util/Assertions.js.map +0 -1
- package/target/impl/util/AsyncRunnable.js +0 -78
- package/target/impl/util/AsyncRunnable.js.map +0 -1
- package/target/impl/util/ExtDomQuery.js +0 -306
- package/target/impl/util/ExtDomQuery.js.map +0 -1
- package/target/impl/util/FileUtils.js +0 -98
- package/target/impl/util/FileUtils.js.map +0 -1
- package/target/impl/util/HiddenInputBuilder.js +0 -83
- package/target/impl/util/HiddenInputBuilder.js.map +0 -1
- package/target/impl/util/IListener.js +0 -3
- package/target/impl/util/IListener.js.map +0 -1
- package/target/impl/util/Lang.js +0 -263
- package/target/impl/util/Lang.js.map +0 -1
- package/target/impl/util/XhrQueueController.js +0 -92
- package/target/impl/util/XhrQueueController.js.map +0 -1
- package/target/impl/xhrCore/ErrorData.js +0 -87
- package/target/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/impl/xhrCore/EventData.js +0 -52
- package/target/impl/xhrCore/EventData.js.map +0 -1
- package/target/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/impl/xhrCore/RequestDataResolver.js +0 -186
- package/target/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +0 -104
- package/target/impl/xhrCore/ResonseDataResolver.js.map +0 -1
- package/target/impl/xhrCore/Response.js +0 -186
- package/target/impl/xhrCore/Response.js.map +0 -1
- package/target/impl/xhrCore/ResponseDataResolver.js +0 -104
- package/target/impl/xhrCore/ResponseDataResolver.js.map +0 -1
- package/target/impl/xhrCore/ResponseProcessor.js +0 -468
- package/target/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/impl/xhrCore/XhrFormData.js +0 -163
- package/target/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/impl/xhrCore/XhrRequest.js +0 -433
- package/target/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/mona_dish_shim.js +0 -70
- package/target/mona_dish_shim.js.map +0 -1
- package/target/myfaces/OamSubmit.js +0 -128
- package/target/myfaces/OamSubmit.js.map +0 -1
- package/target/src/main/typescript/api/_api.js.map +0 -1
- package/target/src/main/typescript/api/faces.js +0 -45
- package/target/src/main/typescript/api/faces.js.map +0 -1
- package/target/src/main/typescript/api/jsf.js +0 -56
- package/target/src/main/typescript/api/jsf.js.map +0 -1
- package/target/src/main/typescript/impl/AjaxImpl.js +0 -748
- package/target/src/main/typescript/impl/AjaxImpl.js.map +0 -1
- package/target/src/main/typescript/impl/PushImpl.js +0 -265
- package/target/src/main/typescript/impl/PushImpl.js.map +0 -1
- package/target/src/main/typescript/impl/core/Const.js +0 -177
- package/target/src/main/typescript/impl/core/Const.js.map +0 -1
- package/target/src/main/typescript/impl/core/ImplTypes.js +0 -38
- package/target/src/main/typescript/impl/core/ImplTypes.js.map +0 -1
- package/target/src/main/typescript/impl/i18n/Messages.js +0 -113
- package/target/src/main/typescript/impl/i18n/Messages.js.map +0 -1
- package/target/src/main/typescript/impl/util/Assertions.js +0 -101
- package/target/src/main/typescript/impl/util/Assertions.js.map +0 -1
- package/target/src/main/typescript/impl/util/AsyncRunnable.js +0 -78
- package/target/src/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
- package/target/src/main/typescript/impl/util/ExtDomQuery.js +0 -306
- package/target/src/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
- package/target/src/main/typescript/impl/util/FileUtils.js +0 -98
- package/target/src/main/typescript/impl/util/FileUtils.js.map +0 -1
- package/target/src/main/typescript/impl/util/HiddenInputBuilder.js +0 -83
- package/target/src/main/typescript/impl/util/HiddenInputBuilder.js.map +0 -1
- package/target/src/main/typescript/impl/util/IListener.js +0 -3
- package/target/src/main/typescript/impl/util/IListener.js.map +0 -1
- package/target/src/main/typescript/impl/util/Lang.js +0 -263
- package/target/src/main/typescript/impl/util/Lang.js.map +0 -1
- package/target/src/main/typescript/impl/util/XhrQueueController.js +0 -92
- package/target/src/main/typescript/impl/util/XhrQueueController.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/ErrorData.js +0 -87
- package/target/src/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/EventData.js +0 -52
- package/target/src/main/typescript/impl/xhrCore/EventData.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -186
- package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/Response.js +0 -186
- package/target/src/main/typescript/impl/xhrCore/Response.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js +0 -104
- package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -468
- package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/XhrFormData.js +0 -163
- package/target/src/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/XhrRequest.js +0 -433
- package/target/src/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/src/main/typescript/mona_dish_shim.js +0 -70
- package/target/src/main/typescript/mona_dish_shim.js.map +0 -1
- package/target/src/main/typescript/myfaces/OamSubmit.js +0 -128
- package/target/src/main/typescript/myfaces/OamSubmit.js.map +0 -1
- package/target/src/main/typescript/test/api/MyFacesABTest.spec.js +0 -117
- package/target/src/main/typescript/test/api/MyFacesABTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js +0 -123
- package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -2
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/src/main/typescript/test/impl/ImplTest.spec.js +0 -225
- package/target/src/main/typescript/test/impl/ImplTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/impl/ImplTest_23.spec.js +0 -143
- package/target/src/main/typescript/test/impl/ImplTest_23.spec.js.map +0 -1
- package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js +0 -106
- package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js +0 -77
- package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js +0 -118
- package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js.map +0 -1
- package/target/src/main/typescript/test/myfaces/OnLoad.spec.js +0 -57
- package/target/src/main/typescript/test/myfaces/OnLoad.spec.js.map +0 -1
- package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js +0 -60
- package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js.map +0 -1
- package/target/src/main/typescript/test/queue/AsynchronousProbe.js +0 -93
- package/target/src/main/typescript/test/queue/AsynchronousProbe.js.map +0 -1
- package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js +0 -133
- package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js +0 -101
- package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js +0 -175
- package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/EventTests.spec.js +0 -184
- package/target/src/main/typescript/test/xhrCore/EventTests.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js +0 -181
- package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
- package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js +0 -199
- package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js +0 -567
- package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js +0 -845
- package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js +0 -382
- package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js +0 -667
- package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js +0 -367
- package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js +0 -123
- package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
- package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/WebsocketTest.js +0 -207
- package/target/src/main/typescript/test/xhrCore/WebsocketTest.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js +0 -149
- package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js +0 -130
- package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
- package/target/test/api/MyFacesABTest.spec.js +0 -117
- package/target/test/api/MyFacesABTest.spec.js.map +0 -1
- package/target/test/frameworkBase/LangTest.spec.js +0 -123
- package/target/test/frameworkBase/LangTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/fixtures/test.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/fixtures/test2.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +0 -16
- package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js.map +0 -1
- package/target/test/impl/ImplTest.spec.js +0 -225
- package/target/test/impl/ImplTest.spec.js.map +0 -1
- package/target/test/impl/ImplTest_23.spec.js +0 -143
- package/target/test/impl/ImplTest_23.spec.js.map +0 -1
- package/target/test/impl/SeparatorCharsTest.spec.js +0 -106
- package/target/test/impl/SeparatorCharsTest.spec.js.map +0 -1
- package/target/test/impl/util/ExtDomQueryTest.spec.js +0 -77
- package/target/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
- package/target/test/myfaces/OamSubmit.spec.js +0 -118
- package/target/test/myfaces/OamSubmit.spec.js.map +0 -1
- package/target/test/myfaces/OnLoad.spec.js +0 -57
- package/target/test/myfaces/OnLoad.spec.js.map +0 -1
- package/target/test/myfaces/ReserveNamespace.spec.js +0 -60
- package/target/test/myfaces/ReserveNamespace.spec.js.map +0 -1
- package/target/test/queue/AsynchronousProbe.js +0 -93
- package/target/test/queue/AsynchronousProbe.js.map +0 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +0 -133
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
- package/target/test/xhrCore/ClientWindow.spec.js +0 -101
- package/target/test/xhrCore/ClientWindow.spec.js.map +0 -1
- package/target/test/xhrCore/ErrorChainTest.spec.js +0 -175
- package/target/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
- package/target/test/xhrCore/EventTests.spec.js +0 -184
- package/target/test/xhrCore/EventTests.spec.js.map +0 -1
- package/target/test/xhrCore/FakeWebsocket.js +0 -38
- package/target/test/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +0 -181
- package/target/test/xhrCore/FileUploadTest.spec.js.map +0 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
- package/target/test/xhrCore/OamSubmitTest.spec.js +0 -199
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +0 -567
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
- package/target/test/xhrCore/RequestTest.spec.js +0 -845
- package/target/test/xhrCore/RequestTest.spec.js.map +0 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +0 -382
- package/target/test/xhrCore/RequestTest_23.spec.js.map +0 -1
- package/target/test/xhrCore/ResponseTest.spec.js +0 -667
- package/target/test/xhrCore/ResponseTest.spec.js.map +0 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +0 -367
- package/target/test/xhrCore/ResponseTest23.spec.js.map +0 -1
- package/target/test/xhrCore/ShadowDomTest.spec.js +0 -123
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
- package/target/test/xhrCore/WebsocketTest.js +0 -207
- package/target/test/xhrCore/WebsocketTest.js.map +0 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +0 -149
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
- package/target/test/xhrCore/XhrRequestProgress.spec.js +0 -130
- package/target/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
- package/target/test/xhrCore/fixtures/addedViewHead1.js +0 -17
- package/target/test/xhrCore/fixtures/addedViewHead1.js.map +0 -1
- package/target/test/xhrCore/fixtures/addedViewHead2.js +0 -17
- package/target/test/xhrCore/fixtures/addedViewHead2.js.map +0 -1
- package/target/test/xhrCore/fixtures/addedViewHead3.js +0 -17
- package/target/test/xhrCore/fixtures/addedViewHead3.js.map +0 -1
- package/target/test/xhrCore/fixtures/nonce_script.js +0 -17
- package/target/test/xhrCore/fixtures/nonce_script.js.map +0 -1
- package/tsconfig.json +0 -9
- package/webpack.config.ts +0 -54
|
@@ -1,748 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
-
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
-
* this work for additional information regarding copyright ownership.
|
|
5
|
-
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
6
|
-
* (the "License"); you may not use this file except in compliance with
|
|
7
|
-
* the License. You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.Implementation = void 0;
|
|
19
|
-
const Response_1 = require("./xhrCore/Response");
|
|
20
|
-
const XhrRequest_1 = require("./xhrCore/XhrRequest");
|
|
21
|
-
const mona_dish_1 = require("mona-dish");
|
|
22
|
-
const Assertions_1 = require("./util/Assertions");
|
|
23
|
-
const ExtDomQuery_1 = require("./util/ExtDomQuery");
|
|
24
|
-
const ErrorData_1 = require("./xhrCore/ErrorData");
|
|
25
|
-
const Lang_1 = require("./util/Lang");
|
|
26
|
-
const Const_1 = require("./core/Const");
|
|
27
|
-
const RequestDataResolver_1 = require("./xhrCore/RequestDataResolver");
|
|
28
|
-
const FileUtils_1 = require("./util/FileUtils");
|
|
29
|
-
const XhrQueueController_1 = require("./util/XhrQueueController");
|
|
30
|
-
/*
|
|
31
|
-
* allowed project stages
|
|
32
|
-
*/
|
|
33
|
-
var ProjectStages;
|
|
34
|
-
(function (ProjectStages) {
|
|
35
|
-
ProjectStages["Production"] = "Production";
|
|
36
|
-
ProjectStages["Development"] = "Development";
|
|
37
|
-
ProjectStages["SystemTest"] = "SystemTest";
|
|
38
|
-
ProjectStages["UnitTest"] = "UnitTest";
|
|
39
|
-
})(ProjectStages || (ProjectStages = {}));
|
|
40
|
-
/*
|
|
41
|
-
* Block-filter for the pass-through filtering; the attributes given here
|
|
42
|
-
* will not be transmitted from the options into the pass-through
|
|
43
|
-
*/
|
|
44
|
-
var BlockFilter;
|
|
45
|
-
(function (BlockFilter) {
|
|
46
|
-
BlockFilter["onerror"] = "onerror";
|
|
47
|
-
BlockFilter["onevent"] = "onevent";
|
|
48
|
-
BlockFilter["render"] = "render";
|
|
49
|
-
BlockFilter["execute"] = "execute";
|
|
50
|
-
BlockFilter["myfaces"] = "myfaces";
|
|
51
|
-
BlockFilter["delay"] = "delay";
|
|
52
|
-
BlockFilter["timeout"] = "timeout";
|
|
53
|
-
BlockFilter["resetValues"] = "resetValues";
|
|
54
|
-
BlockFilter["windowId"] = "windowId";
|
|
55
|
-
BlockFilter["params"] = "params";
|
|
56
|
-
})(BlockFilter || (BlockFilter = {}));
|
|
57
|
-
/**
|
|
58
|
-
* Core Implementation
|
|
59
|
-
* to distinct between api and impl
|
|
60
|
-
*
|
|
61
|
-
* The original idea was to make the implementation pluggable
|
|
62
|
-
* but this is pointless, you always can overwrite the thin api layer
|
|
63
|
-
* however a dedicated api makes sense for readability reasons
|
|
64
|
-
*/
|
|
65
|
-
var Implementation;
|
|
66
|
-
(function (Implementation) {
|
|
67
|
-
/*
|
|
68
|
-
Small internal explanation, this code is optimized for readability
|
|
69
|
-
and cuts off a ton of old legacy code.
|
|
70
|
-
Aka older browsers are not supported anymore.
|
|
71
|
-
We use a self written helper library to keep the number of external
|
|
72
|
-
code dependencies down.
|
|
73
|
-
The library is called mona-dish and started as a small sideproject of mine
|
|
74
|
-
it provides following
|
|
75
|
-
|
|
76
|
-
a) Monad like structures for querying because this keeps the code denser and adds abstractions
|
|
77
|
-
that always was the strong point of jQuery, and it still is better in this regard than what ecmascript provides
|
|
78
|
-
|
|
79
|
-
c) A neutral json like configuration which allows assignments of arbitrary values with reduce code which then can be
|
|
80
|
-
transformed into different data representations
|
|
81
|
-
|
|
82
|
-
examples:
|
|
83
|
-
internalCtx.assign(MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;
|
|
84
|
-
passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID
|
|
85
|
-
|
|
86
|
-
basically an abbreviation for
|
|
87
|
-
|
|
88
|
-
internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};
|
|
89
|
-
internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};
|
|
90
|
-
internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
internalCtx.assign(condition, MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;
|
|
94
|
-
passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID if condition === true otherwise it is ignored
|
|
95
|
-
|
|
96
|
-
abbreviates:
|
|
97
|
-
if(condition) {
|
|
98
|
-
internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};
|
|
99
|
-
internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};
|
|
100
|
-
internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
d) Optional constructs, while under heavy debate we only use them lightly where the api requires it from mona-dish
|
|
105
|
-
|
|
106
|
-
Note the inclusion of this library uses a reduced build which only includes the part of it, which we really use
|
|
107
|
-
|
|
108
|
-
*/
|
|
109
|
-
const trim = mona_dish_1.Lang.trim;
|
|
110
|
-
const getMessage = Lang_1.ExtLang.getMessage;
|
|
111
|
-
const getGlobalConfig = Lang_1.ExtLang.getGlobalConfig;
|
|
112
|
-
var assert = Assertions_1.Assertions.assert;
|
|
113
|
-
const ofAssoc = Lang_1.ExtLang.ofAssoc;
|
|
114
|
-
const collectAssoc = Lang_1.ExtLang.collectAssoc;
|
|
115
|
-
let projectStage = null;
|
|
116
|
-
let separator = null;
|
|
117
|
-
let eventQueue = [];
|
|
118
|
-
let errorQueue = [];
|
|
119
|
-
Implementation.requestQueue = null;
|
|
120
|
-
/*error reporting threshold*/
|
|
121
|
-
let threshold = "ERROR";
|
|
122
|
-
/**
|
|
123
|
-
* fetches the separator char from the given script tags
|
|
124
|
-
*
|
|
125
|
-
* @return {string} the separator char for the given script tags
|
|
126
|
-
*/
|
|
127
|
-
function getSeparatorChar() {
|
|
128
|
-
var _a, _b;
|
|
129
|
-
return (_b = (_a = resolveGlobalConfig()) === null || _a === void 0 ? void 0 : _a.separator) !== null && _b !== void 0 ? _b : (separator !== null && separator !== void 0 ? separator : (separator = ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/separator=([^&;]*)/).orElse(":").value));
|
|
130
|
-
}
|
|
131
|
-
Implementation.getSeparatorChar = getSeparatorChar;
|
|
132
|
-
/**
|
|
133
|
-
* this is for testing purposes only, since AjaxImpl is a module
|
|
134
|
-
* we need to reset for every unit test its internal states
|
|
135
|
-
*/
|
|
136
|
-
function reset() {
|
|
137
|
-
projectStage = null;
|
|
138
|
-
separator = null;
|
|
139
|
-
eventQueue = [];
|
|
140
|
-
errorQueue = [];
|
|
141
|
-
Implementation.requestQueue = null;
|
|
142
|
-
}
|
|
143
|
-
Implementation.reset = reset;
|
|
144
|
-
/**
|
|
145
|
-
* @return the project stage also emitted by the server:
|
|
146
|
-
* it cannot be cached and must be delivered over the server
|
|
147
|
-
* The value for it comes from the requestInternal parameter of the faces.js script called "stage".
|
|
148
|
-
*/
|
|
149
|
-
function getProjectStage() {
|
|
150
|
-
var _a, _b;
|
|
151
|
-
return (_b = (_a = resolveGlobalConfig()) === null || _a === void 0 ? void 0 : _a.projectStage) !== null && _b !== void 0 ? _b : (projectStage !== null && projectStage !== void 0 ? projectStage : (projectStage = resolveProjectStateFromURL()));
|
|
152
|
-
}
|
|
153
|
-
Implementation.getProjectStage = getProjectStage;
|
|
154
|
-
/**
|
|
155
|
-
* resolves the project stage as url parameter
|
|
156
|
-
* @return the project stage or null
|
|
157
|
-
*/
|
|
158
|
-
function resolveProjectStateFromURL() {
|
|
159
|
-
/* run through all script tags and try to find the one that includes faces.js */
|
|
160
|
-
const foundStage = ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/stage=([^&;]*)/).value;
|
|
161
|
-
return (foundStage in ProjectStages) ? foundStage : ProjectStages.Production; // MYFACES-4572: default is production
|
|
162
|
-
}
|
|
163
|
-
Implementation.resolveProjectStateFromURL = resolveProjectStateFromURL;
|
|
164
|
-
/**
|
|
165
|
-
* implementation of the faces.util.chain functionality
|
|
166
|
-
*
|
|
167
|
-
* @param source
|
|
168
|
-
* @param event
|
|
169
|
-
* @param funcs
|
|
170
|
-
*/
|
|
171
|
-
function chain(source, event, ...funcs) {
|
|
172
|
-
// we can use our lazy stream each functionality to run our chain here.
|
|
173
|
-
// by passing a boolean as return value into the onElem call
|
|
174
|
-
// we can stop early at the first false, just like the spec requests
|
|
175
|
-
let ret = true;
|
|
176
|
-
funcs.every(func => {
|
|
177
|
-
let returnVal = resolveAndExecute(source, event, func);
|
|
178
|
-
if (returnVal === false) {
|
|
179
|
-
ret = false;
|
|
180
|
-
}
|
|
181
|
-
//we short circuit in case of false and break the every loop
|
|
182
|
-
return ret;
|
|
183
|
-
});
|
|
184
|
-
return ret;
|
|
185
|
-
}
|
|
186
|
-
Implementation.chain = chain;
|
|
187
|
-
/**
|
|
188
|
-
* this function has to send the ajax requests
|
|
189
|
-
*
|
|
190
|
-
* following request conditions must be met:
|
|
191
|
-
* <ul>
|
|
192
|
-
* <li> the request must be sent asynchronously! </li>
|
|
193
|
-
* <li> the request must be a POST!!! request </li>
|
|
194
|
-
* <li> the request url must be the form action attribute </li>
|
|
195
|
-
* <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>
|
|
196
|
-
* </ul>
|
|
197
|
-
*
|
|
198
|
-
* @param el any dom element no matter being it html or jsf, from which the event is emitted
|
|
199
|
-
* @param event any javascript event supported by that object
|
|
200
|
-
* @param opts map of options being pushed into the ajax cycle
|
|
201
|
-
*
|
|
202
|
-
* a) transformArguments out of the function
|
|
203
|
-
* b) passThrough handling with a map copy with a filter map block map
|
|
204
|
-
*/
|
|
205
|
-
function request(el, event, opts) {
|
|
206
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
|
207
|
-
const { options, elem, elementId, windowId, isResetValues } = (0, RequestDataResolver_1.resolveDefaults)(event, opts, el);
|
|
208
|
-
const requestCtx = new ExtDomQuery_1.ExtConfig({});
|
|
209
|
-
const internalCtx = new ExtDomQuery_1.ExtConfig({});
|
|
210
|
-
Assertions_1.Assertions.assertRequestIntegrity(options, elem);
|
|
211
|
-
/**
|
|
212
|
-
* fetch the parent form
|
|
213
|
-
*
|
|
214
|
-
* note we also add an override possibility here
|
|
215
|
-
* so that people can use dummy forms and work
|
|
216
|
-
* with detached objects
|
|
217
|
-
*/
|
|
218
|
-
const form = (0, RequestDataResolver_1.resolveForm)(elem, event);
|
|
219
|
-
const viewId = (0, RequestDataResolver_1.resolveViewId)(form);
|
|
220
|
-
const formId = form.id.value;
|
|
221
|
-
const delay = (0, RequestDataResolver_1.resolveDelay)(options);
|
|
222
|
-
const timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
|
|
223
|
-
requestCtx.assignIf(!!windowId, Const_1.P_WINDOW_ID).value = windowId;
|
|
224
|
-
// old non - spec behavior will be removed after it is clear whether the removal breaks any code
|
|
225
|
-
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR).value = extractLegacyParams(options.value);
|
|
226
|
-
// spec conform behavior, all passthrough params must be under "passthrough
|
|
227
|
-
const params = remapArrayToAssocArr(options.getIf(Const_1.CTX_OPTIONS_PARAMS).orElse({}).value);
|
|
228
|
-
//we turn off the remapping for the param merge, because we do not want to have
|
|
229
|
-
//any namespacing to be remapped
|
|
230
|
-
let ctxPassthrough = requestCtx.getIf(Const_1.CTX_PARAM_REQ_PASS_THR);
|
|
231
|
-
ctxPassthrough.$nspEnabled = false;
|
|
232
|
-
ctxPassthrough.shallowMerge(new mona_dish_1.Config(params), true);
|
|
233
|
-
//now we turn it on again
|
|
234
|
-
ctxPassthrough.$nspEnabled = true;
|
|
235
|
-
requestCtx.assignIf(!!event, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EVT).value = event === null || event === void 0 ? void 0 : event.type;
|
|
236
|
-
/**
|
|
237
|
-
* ajax pass through context with the source
|
|
238
|
-
* onresolved Event and onerror Event
|
|
239
|
-
*/
|
|
240
|
-
requestCtx.assign(Const_1.SOURCE).value = elementId;
|
|
241
|
-
requestCtx.assign(Const_1.VIEW_ID).value = viewId;
|
|
242
|
-
/**
|
|
243
|
-
* on resolvedEvent and onError...
|
|
244
|
-
* those values will be traversed later on
|
|
245
|
-
* also into the response context
|
|
246
|
-
*/
|
|
247
|
-
requestCtx.assign(Const_1.ON_EVENT).value = (_a = options.value) === null || _a === void 0 ? void 0 : _a.onevent;
|
|
248
|
-
requestCtx.assign(Const_1.ON_ERROR).value = (_b = options.value) === null || _b === void 0 ? void 0 : _b.onerror;
|
|
249
|
-
/**
|
|
250
|
-
* Fetch the myfaces config params
|
|
251
|
-
*/
|
|
252
|
-
requestCtx.assign(Const_1.MYFACES).value = (_c = options.value) === null || _c === void 0 ? void 0 : _c.myfaces;
|
|
253
|
-
/**
|
|
254
|
-
* binding contract the jakarta.faces.source must be set
|
|
255
|
-
*/
|
|
256
|
-
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX_SOURCE).value = elementId;
|
|
257
|
-
/**
|
|
258
|
-
* jakarta.faces.partial.ajax must be set to true
|
|
259
|
-
*/
|
|
260
|
-
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX).value = true;
|
|
261
|
-
/**
|
|
262
|
-
* if resetValues is set to true
|
|
263
|
-
* then we have to set jakarta.faces.resetValues as well
|
|
264
|
-
* as pass through parameter
|
|
265
|
-
* the value has to be explicitly true, according to
|
|
266
|
-
* the specs jsdoc
|
|
267
|
-
*/
|
|
268
|
-
requestCtx.assignIf(isResetValues, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_RESET_VALUES).value = true;
|
|
269
|
-
// additional meta information to speed things up, note internal non jsf
|
|
270
|
-
// pass through options are stored under _mfInternal in the context
|
|
271
|
-
internalCtx.assign(Const_1.CTX_PARAM_SRC_FRM_ID).value = formId;
|
|
272
|
-
/**
|
|
273
|
-
* special myfaces only internal parameter for onProgress until we have an official api
|
|
274
|
-
* that way we can track the progress of a xhr request (useful for file uploads)
|
|
275
|
-
*/
|
|
276
|
-
internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_PREINIT).value = (_f = (_e = (_d = options.value) === null || _d === void 0 ? void 0 : _d.myfaces) === null || _e === void 0 ? void 0 : _e.upload) === null || _f === void 0 ? void 0 : _f.preinit;
|
|
277
|
-
internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_LOADSTART).value = (_j = (_h = (_g = options.value) === null || _g === void 0 ? void 0 : _g.myfaces) === null || _h === void 0 ? void 0 : _h.upload) === null || _j === void 0 ? void 0 : _j.loadstart;
|
|
278
|
-
internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_ON_PROGRESS).value = (_m = (_l = (_k = options.value) === null || _k === void 0 ? void 0 : _k.myfaces) === null || _l === void 0 ? void 0 : _l.upload) === null || _m === void 0 ? void 0 : _m.progress;
|
|
279
|
-
internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_LOADEND).value = (_q = (_p = (_o = options.value) === null || _o === void 0 ? void 0 : _o.myfaces) === null || _p === void 0 ? void 0 : _p.upload) === null || _q === void 0 ? void 0 : _q.loadend;
|
|
280
|
-
internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_LOAD).value = (_t = (_s = (_r = options.value) === null || _r === void 0 ? void 0 : _r.myfaces) === null || _s === void 0 ? void 0 : _s.upload) === null || _t === void 0 ? void 0 : _t.load;
|
|
281
|
-
internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_ERROR).value = (_w = (_v = (_u = options.value) === null || _u === void 0 ? void 0 : _u.myfaces) === null || _v === void 0 ? void 0 : _v.upload) === null || _w === void 0 ? void 0 : _w.error;
|
|
282
|
-
internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_ABORT).value = (_z = (_y = (_x = options.value) === null || _x === void 0 ? void 0 : _x.myfaces) === null || _y === void 0 ? void 0 : _y.upload) === null || _z === void 0 ? void 0 : _z.abort;
|
|
283
|
-
internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_TIMEOUT).value = (_2 = (_1 = (_0 = options.value) === null || _0 === void 0 ? void 0 : _0.myfaces) === null || _1 === void 0 ? void 0 : _1.upload) === null || _2 === void 0 ? void 0 : _2.timeout;
|
|
284
|
-
// mojarra compatibility, mojarra is sending the form id as well
|
|
285
|
-
// this is not documented behavior but can be determined by running
|
|
286
|
-
// mojarra under blackbox conditions.
|
|
287
|
-
// I assume it does the same as our formId_submit=1 so leaving it out
|
|
288
|
-
// won't hurt but for the sake of compatibility we are going to add it
|
|
289
|
-
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, formId).value = formId;
|
|
290
|
-
internalCtx.assign(Const_1.CTX_PARAM_SRC_CTL_ID).value = elementId;
|
|
291
|
-
// reintroduction of PPS as per myfaces 2.3 (myfaces.pps = true, only the executes are submitted)
|
|
292
|
-
internalCtx.assign(Const_1.CTX_PARAM_PPS).value = (_4 = (_3 = extractMyFacesParams(options.value)) === null || _3 === void 0 ? void 0 : _3[Const_1.MYFACES_OPTION_PPS]) !== null && _4 !== void 0 ? _4 : false;
|
|
293
|
-
assignClientWindowId(form, requestCtx);
|
|
294
|
-
assignExecute(options, requestCtx, form, elementId);
|
|
295
|
-
assignRender(options, requestCtx, form, elementId);
|
|
296
|
-
assignNamingContainerData(internalCtx, form);
|
|
297
|
-
//now we enqueue the request as asynchronous runnable into our request
|
|
298
|
-
//queue and let the queue take over the rest
|
|
299
|
-
Implementation.queueHandler.addRequestToQueue(elem, form, requestCtx, internalCtx, delay, timeout);
|
|
300
|
-
}
|
|
301
|
-
Implementation.request = request;
|
|
302
|
-
/**
|
|
303
|
-
* Spec. 13.3.3
|
|
304
|
-
* Examining the response markup and updating the DOM tree
|
|
305
|
-
* @param {XMLHttpRequest} request - the ajax request
|
|
306
|
-
* @param {Object} context - the ajax context
|
|
307
|
-
*/
|
|
308
|
-
function response(request, context) {
|
|
309
|
-
Response_1.Response.processResponse(request, context);
|
|
310
|
-
}
|
|
311
|
-
Implementation.response = response;
|
|
312
|
-
/**
|
|
313
|
-
* adds an error handler to the error queue
|
|
314
|
-
*
|
|
315
|
-
* @param errorListener the error listener handler
|
|
316
|
-
*/
|
|
317
|
-
function addOnError(errorListener) {
|
|
318
|
-
errorQueue.push(errorListener);
|
|
319
|
-
}
|
|
320
|
-
Implementation.addOnError = addOnError;
|
|
321
|
-
/**
|
|
322
|
-
* adds an event handler to the event queue
|
|
323
|
-
*
|
|
324
|
-
* @param eventListener the event listener handler
|
|
325
|
-
*/
|
|
326
|
-
function addOnEvent(eventListener) {
|
|
327
|
-
eventQueue.push(eventListener);
|
|
328
|
-
}
|
|
329
|
-
Implementation.addOnEvent = addOnEvent;
|
|
330
|
-
// noinspection JSUnusedLocalSymbols
|
|
331
|
-
/**
|
|
332
|
-
* sends an event to the event handlers
|
|
333
|
-
*
|
|
334
|
-
* @param data the event data object hosting the event data according to the spec @see EventData for what is reachable
|
|
335
|
-
* @param localHandler an optional event handler, which is processed before the event handler chain
|
|
336
|
-
*/
|
|
337
|
-
function sendEvent(data, localHandler = function (data) {
|
|
338
|
-
}) {
|
|
339
|
-
/*now we serve the queue as well*/
|
|
340
|
-
localHandler(data);
|
|
341
|
-
eventQueue.forEach(fn => fn(data));
|
|
342
|
-
}
|
|
343
|
-
Implementation.sendEvent = sendEvent;
|
|
344
|
-
/**
|
|
345
|
-
* error handler behavior called internally
|
|
346
|
-
* and only into the impl it takes care of the
|
|
347
|
-
* internal message transformation to a myfaces internal error
|
|
348
|
-
* and then uses the standard send error mechanisms
|
|
349
|
-
* also a double error logging prevention is done as well
|
|
350
|
-
*
|
|
351
|
-
* @param request the request currently being processed
|
|
352
|
-
* @param context the context affected by this error
|
|
353
|
-
* @param exception the exception being thrown
|
|
354
|
-
* @param clearRequestQueue if set to true, clears the request queue of all pending requests
|
|
355
|
-
*/
|
|
356
|
-
function stdErrorHandler(request, context, exception, clearRequestQueue = false) {
|
|
357
|
-
//newer browsers do not allow to hold additional values on native objects like exceptions
|
|
358
|
-
//we hence capsule it into the request, which is gced automatically
|
|
359
|
-
//on ie as well, since the stdErrorHandler usually is called between requests
|
|
360
|
-
//this is a valid approach
|
|
361
|
-
try {
|
|
362
|
-
if (threshold == "ERROR") {
|
|
363
|
-
let errorData = ErrorData_1.ErrorData.fromClient(exception);
|
|
364
|
-
sendError(errorData);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
finally {
|
|
368
|
-
if (clearRequestQueue) {
|
|
369
|
-
Implementation.requestQueue.clear();
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
Implementation.stdErrorHandler = stdErrorHandler;
|
|
374
|
-
// noinspection JSUnusedLocalSymbols
|
|
375
|
-
/**
|
|
376
|
-
* implementation triggering the error chain
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
* handles the errors, in case of an onError exists within the context the onError is called as local error handler
|
|
381
|
-
* the registered error handlers in the queue received an error message to be dealt with
|
|
382
|
-
* and if the projectStage is at development an alert box is displayed
|
|
383
|
-
*
|
|
384
|
-
* note: we have additional functionality here, via the global config myfaces.config.defaultErrorOutput a function can be provided
|
|
385
|
-
* which changes the default output behavior from alert to something else
|
|
386
|
-
*
|
|
387
|
-
* @param errorData the error data to be displayed
|
|
388
|
-
* @param localHandler an optional local error handler which has to be processed before the error handler queue
|
|
389
|
-
*/
|
|
390
|
-
function sendError(errorData, localHandler = function (data) {
|
|
391
|
-
}) {
|
|
392
|
-
localHandler(errorData);
|
|
393
|
-
errorQueue.forEach((errorCallback) => {
|
|
394
|
-
errorCallback(errorData);
|
|
395
|
-
});
|
|
396
|
-
let displayError = getGlobalConfig("defaultErrorOutput", (console ? console.error : alert));
|
|
397
|
-
displayError(errorData);
|
|
398
|
-
}
|
|
399
|
-
Implementation.sendError = sendError;
|
|
400
|
-
/**
|
|
401
|
-
* @node optional element or id defining a rootnode where an element with the id "jakarta.faces.windowId" is hosted
|
|
402
|
-
* @return the client window id of the current window, if one is given if none is found, null is returned
|
|
403
|
-
*/
|
|
404
|
-
function getClientWindow(node) {
|
|
405
|
-
const ALTERED = "___mf_id_altered__";
|
|
406
|
-
const INIT = "___init____";
|
|
407
|
-
/*
|
|
408
|
-
* the search root for the dom element search
|
|
409
|
-
*/
|
|
410
|
-
let searchRoot = ((node) ? mona_dish_1.DQ.byId(node) : (0, mona_dish_1.DQ$)("form"));
|
|
411
|
-
let inputs = searchRoot
|
|
412
|
-
.filterSelector(`input[name='${(0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW)}']`)
|
|
413
|
-
.orElseLazy(() => searchRoot.querySelectorAll(`input[name='${(0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW)}']`));
|
|
414
|
-
/*
|
|
415
|
-
* lazy helper to fetch the window id from the included faces.js
|
|
416
|
-
*/
|
|
417
|
-
let fetchWindowIdFromJSFJS = () => ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null);
|
|
418
|
-
/*
|
|
419
|
-
* fetch window id from the url
|
|
420
|
-
*/
|
|
421
|
-
let fetchWindowIdFromURL = function () {
|
|
422
|
-
const href = window.location.href, windowId = "jfwid";
|
|
423
|
-
const regex = new RegExp("[\\?&]" + windowId + "=([^&#\\;]*)");
|
|
424
|
-
const results = regex.exec(href);
|
|
425
|
-
//initial trial over the url and a regexp
|
|
426
|
-
if (results != null)
|
|
427
|
-
return mona_dish_1.Optional.fromNullable(results[1]);
|
|
428
|
-
return mona_dish_1.Optional.fromNullable(null);
|
|
429
|
-
};
|
|
430
|
-
/*
|
|
431
|
-
* functional double check based on stream reduction
|
|
432
|
-
* the values should be identical or on INIT value which is a premise to
|
|
433
|
-
* skip the first check
|
|
434
|
-
*
|
|
435
|
-
* @param value1
|
|
436
|
-
* @param value2
|
|
437
|
-
*/
|
|
438
|
-
let differenceCheck = (value1, value2) => {
|
|
439
|
-
if (value1 == INIT) {
|
|
440
|
-
return value2;
|
|
441
|
-
}
|
|
442
|
-
else if (value1 == ALTERED || value1 != value2) {
|
|
443
|
-
return ALTERED;
|
|
444
|
-
}
|
|
445
|
-
return value2;
|
|
446
|
-
};
|
|
447
|
-
/*
|
|
448
|
-
* helper for cleaner code, maps the value from an item
|
|
449
|
-
*
|
|
450
|
-
* @param item
|
|
451
|
-
*/
|
|
452
|
-
let getValue = (item) => item.val;
|
|
453
|
-
/*
|
|
454
|
-
* fetch the window id from the forms
|
|
455
|
-
* window ids must be present in all forms
|
|
456
|
-
* or non-existent. If they exist all of them must be the same
|
|
457
|
-
*/
|
|
458
|
-
let formWindowId = inputs.asArray.map(getValue).reduce(differenceCheck, INIT);
|
|
459
|
-
//if the resulting window id is set on altered then we have an unresolvable problem
|
|
460
|
-
assert(ALTERED != formWindowId, "Multiple different windowIds found in document");
|
|
461
|
-
/*
|
|
462
|
-
* return the window id or null
|
|
463
|
-
*/
|
|
464
|
-
return formWindowId != INIT ? formWindowId : (fetchWindowIdFromURL() || fetchWindowIdFromJSFJS()).value;
|
|
465
|
-
}
|
|
466
|
-
Implementation.getClientWindow = getClientWindow;
|
|
467
|
-
/**
|
|
468
|
-
* collect and encode data for a given form element (must be of type form)
|
|
469
|
-
* find the jakarta.faces.ViewState element and encode its value as well!
|
|
470
|
-
* @return a concatenated string of the encoded values!
|
|
471
|
-
*
|
|
472
|
-
* @throws Error in case of the given element not being of type form!
|
|
473
|
-
* https://issues.apache.org/jira/browse/MYFACES-2110
|
|
474
|
-
*/
|
|
475
|
-
function getViewState(form) {
|
|
476
|
-
/**
|
|
477
|
-
* type-check assert!, we opt for strong typing here
|
|
478
|
-
* because it makes it easier to detect bugs
|
|
479
|
-
*/
|
|
480
|
-
let element = mona_dish_1.DQ.byId(form, true);
|
|
481
|
-
if (!element.isTag(Const_1.HTML_TAG_FORM)) {
|
|
482
|
-
throw new Error(getMessage("ERR_VIEWSTATE"));
|
|
483
|
-
}
|
|
484
|
-
// determine the naming container scenario
|
|
485
|
-
const dummyContext = new mona_dish_1.Config({});
|
|
486
|
-
assignNamingContainerData(dummyContext, mona_dish_1.DQ.byId(form));
|
|
487
|
-
// fetch all non file input form elements
|
|
488
|
-
let formElements = element.deepElements.encodeFormElement();
|
|
489
|
-
// encode them! (file inputs are handled differently and are not part of the viewstate)
|
|
490
|
-
return (0, FileUtils_1.encodeFormData)(new ExtDomQuery_1.ExtConfig(formElements), (0, RequestDataResolver_1.resoveNamingContainerMapper)(dummyContext));
|
|
491
|
-
}
|
|
492
|
-
Implementation.getViewState = getViewState;
|
|
493
|
-
/**
|
|
494
|
-
* this at the first sight looks like a weird construct, but we need to do it this way
|
|
495
|
-
* for testing, we cannot proxy addRequestToQueue from the testing frameworks directly,
|
|
496
|
-
* but we need to keep it under unit tests.
|
|
497
|
-
*/
|
|
498
|
-
Implementation.queueHandler = {
|
|
499
|
-
/**
|
|
500
|
-
* public to make it accessible for tests
|
|
501
|
-
*
|
|
502
|
-
* adds a new request to our queue for further processing
|
|
503
|
-
*/
|
|
504
|
-
addRequestToQueue: function (elem, form, reqCtx, respPassThr, delay = 0, timeout = 0) {
|
|
505
|
-
Implementation.requestQueue = Implementation.requestQueue !== null && Implementation.requestQueue !== void 0 ? Implementation.requestQueue : new XhrQueueController_1.XhrQueueController();
|
|
506
|
-
Implementation.requestQueue.enqueue(new XhrRequest_1.XhrRequest(reqCtx, respPassThr, timeout), delay);
|
|
507
|
-
}
|
|
508
|
-
};
|
|
509
|
-
//----------------------------------------------- Methods ---------------------------------------------------------------------
|
|
510
|
-
/**
|
|
511
|
-
* the idea is to replace some placeholder parameters with their respective values
|
|
512
|
-
* placeholder params like @all, @none, @form, @this need to be replaced by
|
|
513
|
-
* the values defined by the specification
|
|
514
|
-
*
|
|
515
|
-
* This function does it for the render parameters
|
|
516
|
-
*
|
|
517
|
-
* @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)
|
|
518
|
-
* @param targetContext the receiving target context
|
|
519
|
-
* @param issuingForm the issuing form
|
|
520
|
-
* @param sourceElementId the executing element triggering the faces.ajax.request (id of it)
|
|
521
|
-
*/
|
|
522
|
-
function assignRender(requestOptions, targetContext, issuingForm, sourceElementId) {
|
|
523
|
-
if (requestOptions.getIf(Const_1.CTX_PARAM_RENDER).isPresent()) {
|
|
524
|
-
remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).get({}), Const_1.P_RENDER, requestOptions.getIf(Const_1.CTX_PARAM_RENDER).value, issuingForm, sourceElementId, targetContext.getIf(Const_1.VIEW_ID).value);
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* the idea is to replace some placeholder parameters with their respective values
|
|
529
|
-
* placeholder params like @all, @none, @form, @this need to be replaced by
|
|
530
|
-
* the values defined by the specification
|
|
531
|
-
*
|
|
532
|
-
* This function does it for the execute parameters
|
|
533
|
-
*
|
|
534
|
-
* @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)
|
|
535
|
-
* @param targetContext the receiving target context
|
|
536
|
-
* @param issuingForm the issuing form
|
|
537
|
-
* @param sourceElementId the executing element triggering the faces.ajax.request (id of it)
|
|
538
|
-
*/
|
|
539
|
-
function assignExecute(requestOptions, targetContext, issuingForm, sourceElementId) {
|
|
540
|
-
if (requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).isPresent()) {
|
|
541
|
-
/*the options must be a blank delimited list of strings*/
|
|
542
|
-
/*compliance with Mojarra which automatically adds @this to an execute
|
|
543
|
-
* the spec rev 2.0a however states, if none is issued nothing at all should be sent down
|
|
544
|
-
*/
|
|
545
|
-
requestOptions.assign(Const_1.CTX_OPTIONS_EXECUTE).value = [requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).value, Const_1.IDENT_THIS].join(" ");
|
|
546
|
-
remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).get({}), Const_1.P_EXECUTE, requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).value, issuingForm, sourceElementId, targetContext.getIf(Const_1.VIEW_ID).value);
|
|
547
|
-
}
|
|
548
|
-
else {
|
|
549
|
-
targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).value = sourceElementId;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
553
|
-
* apply the browser tab where the request was originating from
|
|
554
|
-
*
|
|
555
|
-
* @param form the form hosting the client window id
|
|
556
|
-
* @param targetContext the target context receiving the value
|
|
557
|
-
*/
|
|
558
|
-
function assignClientWindowId(form, targetContext) {
|
|
559
|
-
let clientWindow = (0, Const_1.$faces)().getClientWindow(form.getAsElem(0).value);
|
|
560
|
-
if (clientWindow) {
|
|
561
|
-
targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_CLIENT_WINDOW).value = clientWindow;
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
/**
|
|
565
|
-
* determines the current naming container
|
|
566
|
-
* and assigns it internally
|
|
567
|
-
*
|
|
568
|
-
* @param internalContext
|
|
569
|
-
* @param formElement
|
|
570
|
-
* @private
|
|
571
|
-
*/
|
|
572
|
-
function assignNamingContainerData(internalContext, formElement) {
|
|
573
|
-
const viewRootId = (0, RequestDataResolver_1.resolveViewRootId)(formElement);
|
|
574
|
-
if (!!viewRootId) {
|
|
575
|
-
internalContext.assign(Const_1.NAMED_VIEWROOT).value = true;
|
|
576
|
-
internalContext.assign(Const_1.NAMING_CONTAINER_ID).value = viewRootId;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
/**
|
|
580
|
-
* transforms the user values to the expected values
|
|
581
|
-
* handling '@none', '@all', '@form', and '@this' appropriately.
|
|
582
|
-
* (Note: Although we could employ a simple string replacement method,
|
|
583
|
-
* it could result in duplicate entries under certain conditions.)
|
|
584
|
-
*
|
|
585
|
-
* Specific standardized constants such as
|
|
586
|
-
* '@all', '@none', '@form', and '@this'
|
|
587
|
-
* require special treatment.
|
|
588
|
-
*
|
|
589
|
-
* @param targetConfig the target configuration receiving the final values
|
|
590
|
-
* @param targetKey the target key
|
|
591
|
-
* @param userValues the passed user values (aka input string which needs to be transformed)
|
|
592
|
-
* @param issuingForm the form where the issuing element originates
|
|
593
|
-
* @param issuingElementId the issuing element
|
|
594
|
-
* @param rootNamingContainerId the naming container id ("" default if none is given)
|
|
595
|
-
*/
|
|
596
|
-
function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId, rootNamingContainerId = "") {
|
|
597
|
-
//a cleaner implementation of the transform list method
|
|
598
|
-
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
599
|
-
let iterValues = (userValues) ? trim(userValues).split(/\s+/gi) : [];
|
|
600
|
-
let ret = [];
|
|
601
|
-
let processed = {};
|
|
602
|
-
/**
|
|
603
|
-
* remaps the client ids for the portlet case so that the server
|
|
604
|
-
* can deal with them either prefixed ir not
|
|
605
|
-
* also resolves the absolute id case (it was assumed the server does this, but
|
|
606
|
-
* apparently the RI does not, so we have to follow the RI behavior here)
|
|
607
|
-
* @param componentIdToTransform the componentId which needs post-processing
|
|
608
|
-
*/
|
|
609
|
-
const remapNamingContainer = componentIdToTransform => {
|
|
610
|
-
// pattern :<anything> must be prepended by viewRoot if there is one,
|
|
611
|
-
// otherwise we are in a not namespaced then only the id has to match
|
|
612
|
-
const rootNamingContainerPrefix = (rootNamingContainerId.length) ? rootNamingContainerId + SEP : Const_1.EMPTY_STR;
|
|
613
|
-
let formClientId = issuingForm.id.value;
|
|
614
|
-
// nearest parent naming container relative to the form
|
|
615
|
-
const nearestNamingContainer = formClientId.substring(0, formClientId.lastIndexOf(SEP));
|
|
616
|
-
const nearestNamingContainerPrefix = (nearestNamingContainer.length) ? nearestNamingContainer + SEP : Const_1.EMPTY_STR;
|
|
617
|
-
// Absolute search expressions, always start with SEP or the name of the root naming container
|
|
618
|
-
const hasLeadingSep = componentIdToTransform.indexOf(SEP) === 0;
|
|
619
|
-
const isAbsolutSearchExpr = hasLeadingSep || (rootNamingContainerId.length
|
|
620
|
-
&& componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0);
|
|
621
|
-
let finalIdentifier;
|
|
622
|
-
if (isAbsolutSearchExpr) {
|
|
623
|
-
//we cut off the leading sep if there is one
|
|
624
|
-
componentIdToTransform = hasLeadingSep ? componentIdToTransform.substring(1) : componentIdToTransform;
|
|
625
|
-
componentIdToTransform = componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0 ? componentIdToTransform.substring(rootNamingContainerPrefix.length) : componentIdToTransform;
|
|
626
|
-
//now we prepend either the prefix or "" from the cut-off string to get the final result
|
|
627
|
-
finalIdentifier = [rootNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR);
|
|
628
|
-
}
|
|
629
|
-
else { //relative search according to the javadoc
|
|
630
|
-
//we cut off the root naming container id from the form
|
|
631
|
-
if (formClientId.indexOf(rootNamingContainerPrefix) == 0) {
|
|
632
|
-
formClientId = formClientId.substring(rootNamingContainerPrefix.length);
|
|
633
|
-
}
|
|
634
|
-
//If prependId = true, the outer form id must be present in the id if same form
|
|
635
|
-
let hasPrependId = componentIdToTransform.indexOf(formClientId) == 0;
|
|
636
|
-
finalIdentifier = hasPrependId ?
|
|
637
|
-
[rootNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR) :
|
|
638
|
-
[nearestNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR);
|
|
639
|
-
}
|
|
640
|
-
// We need to double-check because we have scenarios where we have a naming container
|
|
641
|
-
// and no prepend (aka tobago testcase "must handle ':' in IDs properly", scenario 3,
|
|
642
|
-
// in this case we return the component id, and be happy
|
|
643
|
-
// we can roll a dom check here
|
|
644
|
-
return mona_dish_1.DQ.byId(finalIdentifier).isPresent() ? finalIdentifier : componentIdToTransform;
|
|
645
|
-
};
|
|
646
|
-
// in this case we do not use lazy stream because it won´t bring any code reduction
|
|
647
|
-
// or speedup
|
|
648
|
-
for (let cnt = 0; cnt < iterValues.length; cnt++) {
|
|
649
|
-
//avoid doubles
|
|
650
|
-
if (iterValues[cnt] in processed) {
|
|
651
|
-
continue;
|
|
652
|
-
}
|
|
653
|
-
switch (iterValues[cnt]) {
|
|
654
|
-
//@none no values should be sent
|
|
655
|
-
case Const_1.IDENT_NONE:
|
|
656
|
-
return targetConfig.delete(targetKey);
|
|
657
|
-
//@all is a pass through case according to the spec
|
|
658
|
-
case Const_1.IDENT_ALL:
|
|
659
|
-
targetConfig.assign(targetKey).value = Const_1.IDENT_ALL;
|
|
660
|
-
return targetConfig;
|
|
661
|
-
//@form pushes the issuing form id into our list
|
|
662
|
-
case Const_1.IDENT_FORM:
|
|
663
|
-
ret.push(remapNamingContainer(issuingForm.id.value));
|
|
664
|
-
processed[issuingForm.id.value] = true;
|
|
665
|
-
break;
|
|
666
|
-
//@this is replaced with the current issuing element id
|
|
667
|
-
case Const_1.IDENT_THIS:
|
|
668
|
-
if (!(issuingElementId in processed)) {
|
|
669
|
-
ret.push(remapNamingContainer(issuingElementId));
|
|
670
|
-
processed[issuingElementId] = true;
|
|
671
|
-
}
|
|
672
|
-
break;
|
|
673
|
-
default:
|
|
674
|
-
ret.push(remapNamingContainer(iterValues[cnt]));
|
|
675
|
-
processed[iterValues[cnt]] = true;
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
targetConfig.assign(targetKey).value = ret.join(" ");
|
|
679
|
-
return targetConfig;
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* Filters the provided options using a blacklist to ensure
|
|
683
|
-
* only pass-through parameters are processed for the Ajax request.
|
|
684
|
-
*
|
|
685
|
-
* Note that this issue is leftover from a previous implementation.
|
|
686
|
-
* The specification-conforming behavior is to use parameters for pass-through values.
|
|
687
|
-
* This will be addressed soon, after confirming that removal won't break any legacy code.
|
|
688
|
-
*
|
|
689
|
-
* @param {Context} mappedOpts - The options to be filtered.
|
|
690
|
-
*/
|
|
691
|
-
function extractLegacyParams(mappedOpts) {
|
|
692
|
-
//we now can use the full code reduction given by our stream api
|
|
693
|
-
//to filter
|
|
694
|
-
return ofAssoc(mappedOpts)
|
|
695
|
-
.filter((item => !(item[0] in BlockFilter)))
|
|
696
|
-
.reduce(collectAssoc, {});
|
|
697
|
-
}
|
|
698
|
-
/**
|
|
699
|
-
* Extracts the MyFaces configuration parameters
|
|
700
|
-
* that augment JSF with additional functionality.
|
|
701
|
-
*
|
|
702
|
-
* @param mappedOpts
|
|
703
|
-
* @private
|
|
704
|
-
*/
|
|
705
|
-
function extractMyFacesParams(mappedOpts) {
|
|
706
|
-
var _a;
|
|
707
|
-
//we now can use the full code reduction given by our stream api
|
|
708
|
-
//to filter
|
|
709
|
-
return (_a = ofAssoc(mappedOpts)
|
|
710
|
-
.filter((item => (item[0] == "myfaces")))
|
|
711
|
-
.reduce(collectAssoc, {})) === null || _a === void 0 ? void 0 : _a[Const_1.MYFACES];
|
|
712
|
-
}
|
|
713
|
-
function remapArrayToAssocArr(arrayedParams) {
|
|
714
|
-
if (Array.isArray(arrayedParams)) {
|
|
715
|
-
return arrayedParams.reduce(collectAssoc, {});
|
|
716
|
-
}
|
|
717
|
-
return arrayedParams;
|
|
718
|
-
}
|
|
719
|
-
function resolveGlobalConfig() {
|
|
720
|
-
var _a, _b;
|
|
721
|
-
return (_b = (_a = window === null || window === void 0 ? void 0 : window[Const_1.MYFACES]) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : {};
|
|
722
|
-
}
|
|
723
|
-
/**
|
|
724
|
-
* Private helper to execute a function or code fragment
|
|
725
|
-
* @param source the source of the caller passed into the function as this
|
|
726
|
-
* @param event an event which needs to be passed down into the function
|
|
727
|
-
* @param func either a function or code fragment
|
|
728
|
-
* @return a boolean value, if the passed function returns false, then the
|
|
729
|
-
* caller is basically notified that the execution can now stop (JSF requirement for chain)
|
|
730
|
-
* @private
|
|
731
|
-
*/
|
|
732
|
-
function resolveAndExecute(source, event, func) {
|
|
733
|
-
if ("string" != typeof func) {
|
|
734
|
-
//function is passed down as chain parameter, can be executed as is
|
|
735
|
-
return func.call(source, event) !== false;
|
|
736
|
-
}
|
|
737
|
-
else {
|
|
738
|
-
//either a function or a string can be passed in case of a string we have to wrap it into another function
|
|
739
|
-
//it is not a plain executable code but a definition
|
|
740
|
-
let sourceCode = trim(func);
|
|
741
|
-
if (sourceCode.indexOf("function ") == 0) {
|
|
742
|
-
sourceCode = `return ${sourceCode} (event)`;
|
|
743
|
-
}
|
|
744
|
-
return new Function("event", sourceCode).call(source, event) !== false;
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
})(Implementation || (exports.Implementation = Implementation = {}));
|
|
748
|
-
//# sourceMappingURL=AjaxImpl.js.map
|