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
|
@@ -25,14 +25,13 @@ import {Es2019Array} from "mona-dish";
|
|
|
25
25
|
export namespace ExtLang {
|
|
26
26
|
|
|
27
27
|
let installedLocale: Messages;
|
|
28
|
-
|
|
28
|
+
const nameSpace = "impl/util/Lang/";
|
|
29
29
|
|
|
30
30
|
export function getLanguage(): string {
|
|
31
31
|
//TODO global config override
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return language;
|
|
33
|
+
const language: string = (navigator as any).languages?.[0] ?? navigator?.language ?? "en";
|
|
34
|
+
return language.split("-")[0];
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
//should be in lang, but for now here to avoid recursive imports, not sure if typescript still has a problem with those
|
|
@@ -53,7 +52,7 @@ export namespace ExtLang {
|
|
|
53
52
|
* @param defaultValue an optional default value if the producer fails to produce anything
|
|
54
53
|
* @returns an Optional of the produced value
|
|
55
54
|
*/
|
|
56
|
-
export function failSaveResolve<T>(resolverProducer: () => T, defaultValue: T = null): Optional<T> {
|
|
55
|
+
export function failSaveResolve<T>(resolverProducer: () => T, defaultValue: T | null = null): Optional<T | null> {
|
|
57
56
|
return LangBase.saveResolve(resolverProducer, defaultValue);
|
|
58
57
|
}
|
|
59
58
|
|
|
@@ -66,7 +65,7 @@ export namespace ExtLang {
|
|
|
66
65
|
* @param resolverProducer a producer function which produces a value in the non error case
|
|
67
66
|
* @param defaultValue the default value in case of a fail of the function
|
|
68
67
|
*/
|
|
69
|
-
export function failSaveExecute<T>(resolverProducer: () => any, defaultValue: T = null): void {
|
|
68
|
+
export function failSaveExecute<T>(resolverProducer: () => any, defaultValue: T | null = null): void {
|
|
70
69
|
LangBase.saveResolve(resolverProducer, defaultValue);
|
|
71
70
|
}
|
|
72
71
|
|
|
@@ -85,12 +84,10 @@ export namespace ExtLang {
|
|
|
85
84
|
export function getMessage(key: string, defaultMessage?: string, ...templateParams: Array<string>): string {
|
|
86
85
|
installedLocale = installedLocale ?? new Messages();
|
|
87
86
|
|
|
88
|
-
let msg = installedLocale[key] ?? defaultMessage ?? key;
|
|
87
|
+
let msg = (installedLocale as any)[key] ?? defaultMessage ?? key;
|
|
89
88
|
templateParams.forEach((param, cnt) => {
|
|
90
89
|
msg = msg.replace(new RegExp(["\\{", cnt, "\\}"].join(EMPTY_STR), "g"), param);
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
});
|
|
94
91
|
return msg;
|
|
95
92
|
}
|
|
96
93
|
|
|
@@ -100,7 +97,7 @@ export namespace ExtLang {
|
|
|
100
97
|
* @param val the value
|
|
101
98
|
* @param delimiter the delimiter
|
|
102
99
|
*/
|
|
103
|
-
export function keyValToStr(key: string, val: string, delimiter: string = "\n") {
|
|
100
|
+
export function keyValToStr(key: string, val: string, delimiter: string = "\n"): string {
|
|
104
101
|
return [key, val].join(delimiter);
|
|
105
102
|
}
|
|
106
103
|
|
|
@@ -158,8 +155,8 @@ export namespace ExtLang {
|
|
|
158
155
|
*/
|
|
159
156
|
export function getForm(elem: Element, event ?: Event): DQ | never {
|
|
160
157
|
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
const queryElem = new DQ(elem);
|
|
159
|
+
const eventTarget = (event) ? new DQ(getEventTarget(event)) : DomQuery.absent;
|
|
163
160
|
|
|
164
161
|
if (queryElem.isTag(HTML_TAG_FORM)) {
|
|
165
162
|
return queryElem;
|
|
@@ -167,8 +164,8 @@ export namespace ExtLang {
|
|
|
167
164
|
|
|
168
165
|
//html 5 for handling
|
|
169
166
|
if (queryElem.attr(HTML_TAG_FORM).isPresent()) {
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
const formId = queryElem.attr(HTML_TAG_FORM).value;
|
|
168
|
+
const foundForm = DQ.byId(formId as any, true);
|
|
172
169
|
if (foundForm.isPresent()) {
|
|
173
170
|
return foundForm;
|
|
174
171
|
}
|
|
@@ -214,12 +211,12 @@ export namespace ExtLang {
|
|
|
214
211
|
* expands an associative array into an array of key value tuples
|
|
215
212
|
* @param value
|
|
216
213
|
*/
|
|
217
|
-
export function ofAssoc(value: {[key: string]: any}) {
|
|
214
|
+
export function ofAssoc(value: {[key: string]: any}): Array<[string, any]> {
|
|
218
215
|
return new Es2019Array(...Object.keys(value))
|
|
219
|
-
.map(key => [key, value[key]]);
|
|
216
|
+
.map((key: string) => [key, value[key]]);
|
|
220
217
|
}
|
|
221
218
|
|
|
222
|
-
export function collectAssoc(target: any, item: any) {
|
|
219
|
+
export function collectAssoc(target: any, item: any): any {
|
|
223
220
|
target[item[0]] = item[1];
|
|
224
221
|
return target;
|
|
225
222
|
}
|
|
@@ -229,7 +226,7 @@ export namespace ExtLang {
|
|
|
229
226
|
* Since we only use it in the XhrController
|
|
230
227
|
* we can use a local module variable here
|
|
231
228
|
*/
|
|
232
|
-
let activeTimeouts = {};
|
|
229
|
+
let activeTimeouts: {[key: string]: ReturnType<typeof setTimeout>} = {};
|
|
233
230
|
|
|
234
231
|
|
|
235
232
|
|
|
@@ -242,7 +239,7 @@ export namespace ExtLang {
|
|
|
242
239
|
* @param runnable a runnable which should go under debounce control
|
|
243
240
|
* @param timeout a timeout for the debounce window
|
|
244
241
|
*/
|
|
245
|
-
export function debounce(key, runnable, timeout) {
|
|
242
|
+
export function debounce(key: string, runnable: Function, timeout: number): void {
|
|
246
243
|
function clearActiveTimeout() {
|
|
247
244
|
clearTimeout(activeTimeouts[key]);
|
|
248
245
|
delete activeTimeouts[key];
|
|
@@ -271,7 +268,7 @@ export namespace ExtLang {
|
|
|
271
268
|
*/
|
|
272
269
|
function assertOnlyOneFormExists(forms: DomQuery): void | never {
|
|
273
270
|
if (forms.isAbsent() || forms.length > 1) {
|
|
274
|
-
throw makeException(new Error(), null, null, "Impl", "getForm", getMessage("ERR_FORM"));
|
|
271
|
+
throw makeException(new Error(), null as any, null as any, "Impl", "getForm", getMessage("ERR_FORM"));
|
|
275
272
|
}
|
|
276
273
|
}
|
|
277
|
-
}
|
|
274
|
+
}
|
|
@@ -1,3 +1,19 @@
|
|
|
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
|
+
|
|
1
17
|
import {IAsyncRunnable} from "./AsyncRunnable";
|
|
2
18
|
import {ExtLang} from "./Lang";
|
|
3
19
|
const debounce = ExtLang.debounce;
|
|
@@ -8,10 +24,16 @@ const debounce = ExtLang.debounce;
|
|
|
8
24
|
* Faces enforces for the XHR handling
|
|
9
25
|
*/
|
|
10
26
|
export class XhrQueueController<T extends IAsyncRunnable<any>> {
|
|
11
|
-
queue = [];
|
|
27
|
+
queue: IAsyncRunnable<any>[] = [];
|
|
12
28
|
taskRunning = false;
|
|
13
29
|
|
|
30
|
+
// Each instance needs its own debounce key: a shared key would cause enqueues
|
|
31
|
+
// on separate instances to cancel each other's debounce window.
|
|
32
|
+
private static instanceCount = 0;
|
|
33
|
+
private readonly debounceKey: string;
|
|
34
|
+
|
|
14
35
|
constructor() {
|
|
36
|
+
this.debounceKey = `xhrQueue_${XhrQueueController.instanceCount++}`;
|
|
15
37
|
}
|
|
16
38
|
|
|
17
39
|
/**
|
|
@@ -21,7 +43,7 @@ export class XhrQueueController<T extends IAsyncRunnable<any>> {
|
|
|
21
43
|
* until the debounce window for the timeout is closed.
|
|
22
44
|
*/
|
|
23
45
|
enqueue(runnable: T, timeOut: number = 0) {
|
|
24
|
-
debounce(
|
|
46
|
+
debounce(this.debounceKey, () => {
|
|
25
47
|
const requestHandler = this.enrichRunnable(runnable);
|
|
26
48
|
if (!this.taskRunning) {
|
|
27
49
|
this.signalTaskRunning();
|
|
@@ -95,4 +117,4 @@ export class XhrQueueController<T extends IAsyncRunnable<any>> {
|
|
|
95
117
|
this.taskRunning = !this.isEmpty;
|
|
96
118
|
}
|
|
97
119
|
|
|
98
|
-
}
|
|
120
|
+
}
|
|
@@ -46,7 +46,7 @@ export enum ErrorType {
|
|
|
46
46
|
* everything into the same attributes,
|
|
47
47
|
* I will add deprecated myfaces backwards compatibility attributes as well
|
|
48
48
|
*/
|
|
49
|
-
export class ErrorData extends EventData
|
|
49
|
+
export class ErrorData extends EventData {
|
|
50
50
|
|
|
51
51
|
type: string = "error";
|
|
52
52
|
source: string | Element;
|
|
@@ -57,14 +57,15 @@ export class ErrorData extends EventData implements IErrorData {
|
|
|
57
57
|
responseText: string;
|
|
58
58
|
responseXML: any;
|
|
59
59
|
|
|
60
|
-
status: string;
|
|
60
|
+
status: string | null;
|
|
61
61
|
typeDetails: ErrorType;
|
|
62
62
|
|
|
63
|
-
serverErrorName
|
|
64
|
-
serverErrorMessage
|
|
63
|
+
serverErrorName!: string;
|
|
64
|
+
serverErrorMessage!: string;
|
|
65
65
|
description: string;
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
/** @internal */
|
|
68
|
+
constructor(source: string | Element, errorName: string, errorMessage: string, responseText: string | null = null, responseXML: Document | null = null, responseCode: number = -1, statusOverride: string | null = null, type = ErrorType.CLIENT_ERROR) {
|
|
68
69
|
super();
|
|
69
70
|
|
|
70
71
|
///MYFACES-4676 error payload expects an element if possible
|
|
@@ -76,7 +77,7 @@ export class ErrorData extends EventData implements IErrorData {
|
|
|
76
77
|
//tck requires that the type is prefixed to the message itself (jsdoc also) in case of a server error
|
|
77
78
|
this.errorMessage = (type == ErrorType.SERVER_ERROR) ? type + ": " + errorMessage : errorMessage;
|
|
78
79
|
this.responseCode = responseCode;
|
|
79
|
-
this.responseText = responseText;
|
|
80
|
+
this.responseText = responseText as any;
|
|
80
81
|
this.responseXML = responseXML;
|
|
81
82
|
|
|
82
83
|
this.status = statusOverride;
|
|
@@ -91,15 +92,18 @@ export class ErrorData extends EventData implements IErrorData {
|
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
|
|
95
|
+
/** @internal */
|
|
94
96
|
static fromClient(e: Error): ErrorData {
|
|
95
97
|
return new ErrorData((e as any)?.source ?? "client", e?.name ?? EMPTY_STR, e?.message ?? EMPTY_STR, e?.stack ?? EMPTY_STR);
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
|
|
100
|
+
/** @internal */
|
|
101
|
+
static fromHttpConnection(source: any, name: string, message: string, responseText: string, responseXML: Document | null, responseCode: number, status: string = EMPTY_STR): ErrorData {
|
|
99
102
|
return new ErrorData(source, name, message, responseText, responseXML, responseCode, status, ErrorType.HTTP_ERROR);
|
|
100
103
|
}
|
|
101
104
|
|
|
102
|
-
|
|
105
|
+
/** @internal */
|
|
106
|
+
static fromGeneric(context: any, errorCode: number, errorType: ErrorType = ErrorType.SERVER_ERROR): ErrorData {
|
|
103
107
|
|
|
104
108
|
let getMsg = this.getMsg;
|
|
105
109
|
|
|
@@ -108,18 +112,19 @@ export class ErrorData extends EventData implements IErrorData {
|
|
|
108
112
|
let errorMessage = getMsg(context, ERROR_MESSAGE);
|
|
109
113
|
let status = getMsg(context, STATUS);
|
|
110
114
|
let responseText = getMsg(context, RESPONSE_TEXT);
|
|
111
|
-
let responseXML: Document = context.getIf(RESPONSE_XML).value;
|
|
115
|
+
let responseXML: Document | null = context.getIf(RESPONSE_XML).value;
|
|
112
116
|
|
|
113
117
|
|
|
114
118
|
return new ErrorData(source, errorName, errorMessage, responseText, responseXML, errorCode, status, errorType);
|
|
115
119
|
}
|
|
116
120
|
|
|
117
|
-
private static getMsg(context, param) {
|
|
121
|
+
private static getMsg(context: any, param: string) {
|
|
118
122
|
return getMessage(context.getIf(param).orElse(EMPTY_STR).value);
|
|
119
123
|
}
|
|
120
124
|
|
|
121
|
-
|
|
125
|
+
/** @internal */
|
|
126
|
+
static fromServerError(context: any): ErrorData {
|
|
122
127
|
return this.fromGeneric(context, -1);
|
|
123
128
|
}
|
|
124
129
|
|
|
125
|
-
}
|
|
130
|
+
}
|
|
@@ -16,15 +16,16 @@
|
|
|
16
16
|
import {Config, DQ} from "mona-dish";
|
|
17
17
|
import {BEGIN, CTX_PARAM_REQ_PASS_THR, EVENT, P_AJAX_SOURCE, SOURCE} from "../core/Const";
|
|
18
18
|
|
|
19
|
-
export class EventData
|
|
20
|
-
type
|
|
21
|
-
status
|
|
19
|
+
export class EventData {
|
|
20
|
+
type!: string;
|
|
21
|
+
status!: string | null;
|
|
22
22
|
source: any;
|
|
23
|
-
responseCode
|
|
24
|
-
responseText
|
|
25
|
-
responseXML
|
|
23
|
+
responseCode!: number;
|
|
24
|
+
responseText!: string;
|
|
25
|
+
responseXML!: Document | null;
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
/** @internal */
|
|
28
|
+
static createFromRequest(request: XMLHttpRequest, internalContext: any, context: any, /*event name*/ name: string): EventData {
|
|
28
29
|
|
|
29
30
|
let eventData = new EventData();
|
|
30
31
|
let internalSource = "_internal._source";
|
|
@@ -116,7 +116,7 @@ export interface IResponseProcessor {
|
|
|
116
116
|
* insert with before, after sub-tags
|
|
117
117
|
* @param node
|
|
118
118
|
*/
|
|
119
|
-
insertWithSubTags(node: XMLQuery);
|
|
119
|
+
insertWithSubTags(node: XMLQuery): void;
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
122
|
* process the viewState update, update the affected
|
|
@@ -155,5 +155,5 @@ export interface IResponseProcessor {
|
|
|
155
155
|
* check whether we still are in a named view root
|
|
156
156
|
* (can change after a navigation)
|
|
157
157
|
*/
|
|
158
|
-
updateNamedViewRootState();
|
|
159
|
-
}
|
|
158
|
+
updateNamedViewRootState(): void;
|
|
159
|
+
}
|
|
@@ -57,9 +57,10 @@ export function resolveHandlerFunc(requestContext: Config, responseContext: Conf
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export function resolveTargetUrl(srcFormElement: HTMLFormElement) {
|
|
60
|
-
|
|
60
|
+
const formElements = srcFormElement.elements as HTMLFormControlsCollection & {[key: string]: HTMLInputElement};
|
|
61
|
+
return (typeof formElements[ENCODED_URL] == 'undefined') ?
|
|
61
62
|
srcFormElement.action :
|
|
62
|
-
|
|
63
|
+
formElements[ENCODED_URL].value;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
export function resolveFinalUrl(sourceForm: DomQuery, formData: XhrFormData, ajaxType = REQ_TYPE_POST) {
|
|
@@ -76,7 +77,7 @@ export function resolveFinalUrl(sourceForm: DomQuery, formData: XhrFormData, aja
|
|
|
76
77
|
* @param elem
|
|
77
78
|
* @param event
|
|
78
79
|
*/
|
|
79
|
-
export function resolveForm(elem: DQ, event
|
|
80
|
+
export function resolveForm(elem: DQ, event?: Event): DQ {
|
|
80
81
|
return ExtLang.getForm(elem.getAsElem(0).value, event);
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -182,9 +183,9 @@ export function getEventTarget(evt: Event): Element {
|
|
|
182
183
|
* @param opts
|
|
183
184
|
* @param el
|
|
184
185
|
*/
|
|
185
|
-
export function resolveDefaults(event
|
|
186
|
+
export function resolveDefaults(event?: Event, opts?: Options | [[string, any]] , el: Element | string | null = null): any {
|
|
186
187
|
//deep copy the options, so that further transformations to not backfire into the callers
|
|
187
|
-
const elem = DQ.byId(el ||
|
|
188
|
+
const elem = DQ.byId(el || (event as Event).target as Element, true);
|
|
188
189
|
const options = new ExtConfig(opts).deepCopy as ExtConfig;
|
|
189
190
|
return {
|
|
190
191
|
options: options,
|
|
@@ -193,4 +194,4 @@ export function resolveDefaults(event: Event, opts: Options | [[string, any]] ,
|
|
|
193
194
|
windowId: resolveWindowId(options),
|
|
194
195
|
isResetValues: true === options.value?.resetValues
|
|
195
196
|
};
|
|
196
|
-
}
|
|
197
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {DQ, XMLQuery} from "mona-dish";
|
|
17
|
+
import {Config, DQ, XMLQuery} from "mona-dish";
|
|
18
18
|
import {ResponseProcessor} from "./ResponseProcessor";
|
|
19
19
|
|
|
20
20
|
import {IResponseProcessor} from "./IResponseProcessor";
|
|
@@ -87,7 +87,7 @@ export namespace Response {
|
|
|
87
87
|
/**
|
|
88
88
|
* highest node partial-response from there the main operations are triggered
|
|
89
89
|
*/
|
|
90
|
-
function processPartialTag(node: XMLQuery, responseProcessor: IResponseProcessor, internalContext) {
|
|
90
|
+
function processPartialTag(node: XMLQuery, responseProcessor: IResponseProcessor, internalContext: Config) {
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
/*
|
|
@@ -231,4 +231,4 @@ export namespace Response {
|
|
|
231
231
|
break;
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
-
}
|
|
234
|
+
}
|
|
@@ -81,41 +81,3 @@ export function resolveContexts(context: { [p: string]: any }): any {
|
|
|
81
81
|
internalContext.assign(UPDATE_ELEMS).value = [];
|
|
82
82
|
return {externalContext, internalContext};
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* fetches the source element out of our contexts
|
|
87
|
-
*
|
|
88
|
-
* @param context the external context which should host the source id
|
|
89
|
-
* @param internalContext internal pass-through fall back
|
|
90
|
-
*
|
|
91
|
-
*/
|
|
92
|
-
export function resolveSourceElement(context: Config, internalContext: Config): DQ {
|
|
93
|
-
let elemId = resolveSourceElementId(context, internalContext);
|
|
94
|
-
return DQ.byId(elemId.value, true);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* fetches the source form if it still exists
|
|
99
|
-
* also embedded forms and parent forms are taken into consideration
|
|
100
|
-
* as fallbacks
|
|
101
|
-
*
|
|
102
|
-
* @param internalContext
|
|
103
|
-
* @param elem
|
|
104
|
-
*/
|
|
105
|
-
export function resolveSourceForm(internalContext: Config, elem: DQ): DQ {
|
|
106
|
-
let sourceFormId = internalContext.getIf(CTX_PARAM_SRC_FRM_ID);
|
|
107
|
-
let sourceForm = new DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);
|
|
108
|
-
|
|
109
|
-
sourceForm = sourceForm.orElseLazy(() => elem.firstParent(HTML_TAG_FORM))
|
|
110
|
-
.orElseLazy(() => elem.querySelectorAll(HTML_TAG_FORM))
|
|
111
|
-
.orElseLazy(() => DQ.querySelectorAll(HTML_TAG_FORM));
|
|
112
|
-
|
|
113
|
-
return sourceForm;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function resolveSourceElementId(context: Config, internalContext: Config): Optional<string> {
|
|
117
|
-
//?internal context?? used to be external one
|
|
118
|
-
return internalContext.getIf(CTX_PARAM_SRC_CTL_ID)
|
|
119
|
-
.orElseLazy(() => context.getIf(SOURCE, "id").value);
|
|
120
|
-
}
|
|
121
|
-
|
|
@@ -39,9 +39,8 @@ import {
|
|
|
39
39
|
HTML_TAG_BODY,
|
|
40
40
|
HTML_TAG_FORM,
|
|
41
41
|
HTML_TAG_HEAD,
|
|
42
|
-
HTML_TAG_LINK,
|
|
43
42
|
HTML_TAG_SCRIPT,
|
|
44
|
-
|
|
43
|
+
IDENT_ALL, IDENT_NONE, NAMED_VIEWROOT,
|
|
45
44
|
ON_ERROR,
|
|
46
45
|
ON_EVENT,
|
|
47
46
|
P_CLIENT_WINDOW,
|
|
@@ -204,7 +203,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
204
203
|
redirect(node: XMLQuery) {
|
|
205
204
|
Assertions.assertUrlExists(node);
|
|
206
205
|
|
|
207
|
-
const redirectUrl = trim(node.attr(ATTR_URL).value);
|
|
206
|
+
const redirectUrl = trim(node.attr(ATTR_URL).value as any);
|
|
208
207
|
if (redirectUrl != EMPTY_STR) {
|
|
209
208
|
window.location.href = redirectUrl;
|
|
210
209
|
}
|
|
@@ -240,7 +239,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
240
239
|
const elem = DQ.byId(node.id.value, true);
|
|
241
240
|
|
|
242
241
|
node.byTagName(XML_TAG_ATTR).each((item: XMLQuery) => {
|
|
243
|
-
elem.attr(item.attr(ATTR_NAME).value).value = item.attr(ATTR_VALUE).value;
|
|
242
|
+
elem.attr(item.attr(ATTR_NAME).value as any).value = item.attr(ATTR_VALUE).value as any;
|
|
244
243
|
});
|
|
245
244
|
}
|
|
246
245
|
|
|
@@ -265,11 +264,11 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
265
264
|
const insertNodes = DQ.fromMarkup(node.cDATAAsString as any);
|
|
266
265
|
|
|
267
266
|
if (before.isPresent()) {
|
|
268
|
-
DQ.byId(before.value, true).insertBefore(insertNodes);
|
|
267
|
+
DQ.byId(before.value as any, true).insertBefore(insertNodes);
|
|
269
268
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
270
269
|
}
|
|
271
270
|
if (after.isPresent()) {
|
|
272
|
-
const domQuery = DQ.byId(after.value, true);
|
|
271
|
+
const domQuery = DQ.byId(after.value as any, true);
|
|
273
272
|
domQuery.insertAfter(insertNodes);
|
|
274
273
|
|
|
275
274
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -289,7 +288,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
289
288
|
const insertId = item.attr(ATTR_ID);
|
|
290
289
|
const insertNodes = DQ.fromMarkup(item.cDATAAsString as any);
|
|
291
290
|
if (insertId.isPresent()) {
|
|
292
|
-
DQ.byId(insertId.value, true).insertBefore(insertNodes);
|
|
291
|
+
DQ.byId(insertId.value as any, true).insertBefore(insertNodes);
|
|
293
292
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
294
293
|
}
|
|
295
294
|
});
|
|
@@ -298,7 +297,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
298
297
|
const insertId = item.attr(ATTR_ID);
|
|
299
298
|
const insertNodes = DQ.fromMarkup(item.cDATAAsString as any);
|
|
300
299
|
if (insertId.isPresent()) {
|
|
301
|
-
DQ.byId(insertId.value, true).insertAfter(insertNodes);
|
|
300
|
+
DQ.byId(insertId.value as any, true).insertAfter(insertNodes);
|
|
302
301
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
303
302
|
}
|
|
304
303
|
});
|
|
@@ -324,6 +323,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
324
323
|
this.internalContext.assign(APPLIED_CLIENT_WINDOW, node.id.value).value = new StateHolder($nsp(node.id.value), state);
|
|
325
324
|
return true;
|
|
326
325
|
}
|
|
326
|
+
return false;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
/**
|
|
@@ -349,7 +349,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
349
349
|
*/
|
|
350
350
|
fixViewStates() {
|
|
351
351
|
ofAssoc(this.internalContext.getIf(APPLIED_VST).orElse({}).value)
|
|
352
|
-
.forEach(([, value]) => {
|
|
352
|
+
.forEach(([, value]: [string, Config]) => {
|
|
353
353
|
const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);
|
|
354
354
|
const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value
|
|
355
355
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
@@ -367,7 +367,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
367
367
|
*/
|
|
368
368
|
fixClientWindow() {
|
|
369
369
|
ofAssoc(this.internalContext.getIf(APPLIED_CLIENT_WINDOW).orElse({}).value)
|
|
370
|
-
.forEach(([, value]) => {
|
|
370
|
+
.forEach(([, value]: [string, Config]) => {
|
|
371
371
|
const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);
|
|
372
372
|
const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value;
|
|
373
373
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
@@ -385,7 +385,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
385
385
|
!namedViewRoot.value)) {
|
|
386
386
|
const SEP = $faces().separatorchar;
|
|
387
387
|
this.internalContext.assign(NAMED_VIEWROOT).value = (!!document.getElementById(partialId.value)) || DQ$(`input[name*='${$nsp(P_VIEWSTATE)}']`)
|
|
388
|
-
.filter(node => node.attr("name").value.indexOf(partialId.value + SEP) == 0).length > 0;
|
|
388
|
+
.filter(node => (node.attr("name").value as any).indexOf(partialId.value + SEP) == 0).length > 0;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
|
|
@@ -404,6 +404,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
404
404
|
* proper viewState -> form assignment
|
|
405
405
|
*
|
|
406
406
|
* @param forms the forms to append the viewState to
|
|
407
|
+
* @param namedViewRoot if set to true, the name is also prefixed
|
|
407
408
|
* @param viewState the final viewState
|
|
408
409
|
* @param namingContainerId
|
|
409
410
|
*/
|
|
@@ -416,6 +417,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
416
417
|
* proper clientWindow -> form assignment
|
|
417
418
|
*
|
|
418
419
|
* @param forms the forms to append the viewState to
|
|
420
|
+
* @param namedViewRoot if set to true, the name is also prefixed
|
|
419
421
|
* @param clientWindow the final viewState
|
|
420
422
|
* @param namingContainerId
|
|
421
423
|
*/
|
|
@@ -518,13 +520,13 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
518
520
|
* @param affectedForm
|
|
519
521
|
* @private
|
|
520
522
|
*/
|
|
521
|
-
private isInExecuteOrRender(affectedForm) {
|
|
523
|
+
private isInExecuteOrRender(affectedForm: DQ) {
|
|
522
524
|
const executes = this.externalContext.getIf($nsp(P_EXECUTE)).orElse("@none").value.split(/\s+/gi);
|
|
523
525
|
const renders = this.externalContext.getIf(P_RENDER_OVERRIDE)
|
|
524
526
|
.orElseLazy(() => this.externalContext.getIf($nsp(P_RENDER)).value)
|
|
525
527
|
.orElse(IDENT_NONE).value.split(/\s+/gi);
|
|
526
528
|
const executeAndRenders = executes.concat(...renders);
|
|
527
|
-
return [...executeAndRenders].filter(nameOrId => {
|
|
529
|
+
return [...executeAndRenders].filter((nameOrId: string) => {
|
|
528
530
|
if ([IDENT_ALL, IDENT_NONE].indexOf(nameOrId) != -1) {
|
|
529
531
|
return true;
|
|
530
532
|
}
|
|
@@ -555,7 +557,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
555
557
|
}
|
|
556
558
|
}
|
|
557
559
|
|
|
558
|
-
private getNameOrIdSelector(nameOrId) {
|
|
560
|
+
private getNameOrIdSelector(nameOrId: string) {
|
|
559
561
|
return `[id='${nameOrId}'], [name='${nameOrId}']`;
|
|
560
562
|
}
|
|
561
|
-
}
|
|
563
|
+
}
|