jsf.js_next_gen 4.0.0-beta-23 → 4.0.0

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.
Files changed (200) hide show
  1. package/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
  2. package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
  3. package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
  4. package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
  5. package/.nyc_output/processinfo/index.json +1 -1
  6. package/README.md +7 -22
  7. package/dist/docs/assets/main.js +56 -52
  8. package/dist/docs/assets/search.js +1 -1
  9. package/dist/docs/assets/style.css +23 -0
  10. package/dist/docs/functions/faces.ajax.addOnError.html +6 -4
  11. package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -0
  12. package/dist/docs/functions/faces.ajax.request.html +7 -7
  13. package/dist/docs/functions/faces.ajax.response.html +0 -1
  14. package/dist/docs/functions/faces.push.close.html +4 -2
  15. package/dist/docs/functions/faces.push.init.html +19 -7
  16. package/dist/docs/functions/faces.push.open.html +4 -2
  17. package/dist/docs/functions/faces.util.chain.html +3 -3
  18. package/dist/docs/functions/myfaces.ab.html +9 -4
  19. package/dist/docs/functions/myfaces.onOnDomReady.html +72 -0
  20. package/dist/docs/index.html +7 -18
  21. package/dist/docs/modules/myfaces.html +3 -1
  22. package/dist/docs/variables/myfaces.oam.html +2 -1
  23. package/dist/window/faces-development.js +2147 -1779
  24. package/dist/window/faces-development.js.br +0 -0
  25. package/dist/window/faces-development.js.gz +0 -0
  26. package/dist/window/faces-development.js.map +1 -1
  27. package/dist/window/faces.js +1 -1
  28. package/dist/window/faces.js.LICENSE.txt +17 -2
  29. package/dist/window/faces.js.br +0 -0
  30. package/dist/window/faces.js.gz +0 -0
  31. package/dist/window/faces.js.map +1 -1
  32. package/dist/window/jsf-development.js +2156 -1777
  33. package/dist/window/jsf-development.js.br +0 -0
  34. package/dist/window/jsf-development.js.gz +0 -0
  35. package/dist/window/jsf-development.js.map +1 -1
  36. package/dist/window/jsf.js +1 -1
  37. package/dist/window/jsf.js.LICENSE.txt +17 -2
  38. package/dist/window/jsf.js.br +0 -0
  39. package/dist/window/jsf.js.gz +0 -0
  40. package/dist/window/jsf.js.map +1 -1
  41. package/package.json +19 -18
  42. package/pom.xml +1 -1
  43. package/src/main/test.xml +23 -0
  44. package/src/main/typescript/@types/definitions/index.d.ts +24 -7
  45. package/src/main/typescript/api/_api.ts +79 -37
  46. package/src/main/typescript/api/jsf.ts +18 -0
  47. package/src/main/typescript/impl/AjaxImpl.ts +168 -78
  48. package/src/main/typescript/impl/PushImpl.ts +63 -38
  49. package/src/main/typescript/impl/core/Const.ts +52 -39
  50. package/src/main/typescript/impl/util/Assertions.ts +16 -8
  51. package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
  52. package/src/main/typescript/impl/util/AsyncRunnable.ts +4 -4
  53. package/src/main/typescript/impl/util/ExtDomQuery.ts +58 -45
  54. package/src/main/typescript/impl/util/FileUtils.ts +104 -0
  55. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +89 -0
  56. package/src/main/typescript/impl/util/Lang.ts +30 -31
  57. package/src/main/typescript/impl/xhrCore/ErrorData.ts +15 -10
  58. package/src/main/typescript/impl/xhrCore/EventData.ts +2 -2
  59. package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +25 -11
  60. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +78 -32
  61. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +10 -10
  62. package/src/main/typescript/impl/xhrCore/Response.ts +66 -49
  63. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +202 -131
  64. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +79 -166
  65. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -68
  66. package/src/main/typescript/myfaces/OamSubmit.ts +29 -13
  67. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +19 -22
  68. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +108 -1
  69. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
  70. package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
  71. package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -7
  72. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +1 -1
  73. package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +5 -2
  74. package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +203 -0
  75. package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +177 -0
  76. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +158 -17
  77. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +242 -11
  78. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +39 -3
  79. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +373 -35
  80. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +43 -9
  81. package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +109 -0
  82. package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +67 -49
  83. package/src/main/typescript/test.xml +6 -0
  84. package/src/main/typescript/tsconfig.json +1 -1
  85. package/src/test/resources/jsf-development.js +1 -1
  86. package/src/tmp/test.html +12 -88
  87. package/target/api/_api.js +72 -31
  88. package/target/api/_api.js.map +1 -1
  89. package/target/api/jsf.js +11 -0
  90. package/target/api/jsf.js.map +1 -1
  91. package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
  92. package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
  93. package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
  94. package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
  95. package/target/impl/AjaxImpl.js +144 -59
  96. package/target/impl/AjaxImpl.js.map +1 -1
  97. package/target/impl/PushImpl.js +66 -35
  98. package/target/impl/PushImpl.js.map +1 -1
  99. package/target/impl/core/Const.js +51 -38
  100. package/target/impl/core/Const.js.map +1 -1
  101. package/target/impl/core/Context.js +10 -0
  102. package/target/impl/core/Context.js.map +1 -0
  103. package/target/impl/util/Assertions.js +12 -7
  104. package/target/impl/util/Assertions.js.map +1 -1
  105. package/target/impl/util/AsyncQueue.js.map +1 -1
  106. package/target/impl/util/ExtDomQuery.js +58 -40
  107. package/target/impl/util/ExtDomQuery.js.map +1 -1
  108. package/target/impl/util/FileUtils.js +96 -0
  109. package/target/impl/util/FileUtils.js.map +1 -0
  110. package/target/impl/util/HiddenElementBuilder.js +7 -0
  111. package/target/impl/util/HiddenElementBuilder.js.map +1 -0
  112. package/target/impl/util/HiddenInputBuilder.js +79 -0
  113. package/target/impl/util/HiddenInputBuilder.js.map +1 -0
  114. package/target/impl/util/Lang.js +29 -30
  115. package/target/impl/util/Lang.js.map +1 -1
  116. package/target/impl/util/URLCodec.js +77 -0
  117. package/target/impl/util/URLCodec.js.map +1 -0
  118. package/target/impl/util/XhrQueueController.js +82 -0
  119. package/target/impl/util/XhrQueueController.js.map +1 -0
  120. package/target/impl/xhrCore/ErrorData.js +10 -8
  121. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  122. package/target/impl/xhrCore/EventData.js +1 -1
  123. package/target/impl/xhrCore/EventData.js.map +1 -1
  124. package/target/impl/xhrCore/RequestContext.js +11 -0
  125. package/target/impl/xhrCore/RequestContext.js.map +1 -0
  126. package/target/impl/xhrCore/RequestDataResolver.js +70 -23
  127. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  128. package/target/impl/xhrCore/ResonseDataResolver.js +9 -9
  129. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  130. package/target/impl/xhrCore/Response.js +44 -29
  131. package/target/impl/xhrCore/Response.js.map +1 -1
  132. package/target/impl/xhrCore/ResponseProcessor.js +182 -116
  133. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  134. package/target/impl/xhrCore/XhrFormData.js +68 -156
  135. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  136. package/target/impl/xhrCore/XhrQueHandler.js +11 -0
  137. package/target/impl/xhrCore/XhrQueHandler.js.map +1 -0
  138. package/target/impl/xhrCore/XhrQueueController.js +62 -0
  139. package/target/impl/xhrCore/XhrQueueController.js.map +1 -0
  140. package/target/impl/xhrCore/XhrRequest.js +68 -59
  141. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  142. package/target/myfaces/OamSubmit.js +23 -14
  143. package/target/myfaces/OamSubmit.js.map +1 -1
  144. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +16 -16
  145. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  146. package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js +76 -0
  147. package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js.map +1 -0
  148. package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +925 -0
  149. package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +1 -0
  150. package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +112 -0
  151. package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +1 -0
  152. package/target/test/frameworkBase/_ext/shared/StandardInits.js +100 -1
  153. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  154. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +37 -1
  155. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  156. package/target/test/impl/ImplTest.spec.js +2 -2
  157. package/target/test/impl/ImplTest.spec.js.map +1 -1
  158. package/target/test/impl/ImplTest_23.spec.js +2 -2
  159. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  160. package/target/test/myfaces/OnLoadSpec.js +57 -0
  161. package/target/test/myfaces/OnLoadSpec.js.map +1 -0
  162. package/target/test/xhrCore/EventTests.spec.js +1 -1
  163. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  164. package/target/test/xhrCore/FileUploadTest.spec.js +2 -1
  165. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  166. package/target/test/xhrCore/NamespacesRequestTest.spec.js +204 -0
  167. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
  168. package/target/test/xhrCore/OamSubmitTest.spec.js +180 -0
  169. package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -0
  170. package/target/test/xhrCore/RequestParamsTest.spec.js +142 -10
  171. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  172. package/target/test/xhrCore/RequestTest.spec.js +217 -9
  173. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  174. package/target/test/xhrCore/RequestTest_23.spec.js +34 -2
  175. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  176. package/target/test/xhrCore/ResponseTest.spec.js +308 -24
  177. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  178. package/target/test/xhrCore/ResponseTest23.spec.js +38 -8
  179. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  180. package/target/test/xhrCore/TobagoFileUploadTest.spec.js +128 -0
  181. package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -0
  182. package/target/test/xhrCore/XhrFormDataTest.spec.js +57 -34
  183. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  184. package/target/test-classes/.gz +0 -0
  185. package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
  186. package/target/test-classes/fileuploadtest.html +24 -0
  187. package/target/test-classes/jsf-development.js +3559 -0
  188. package/target/test-classes/jsf-development.js.br +0 -0
  189. package/target/test-classes/jsf-development.js.gz +0 -0
  190. package/target/test-classes/jsf-development.js.map +1 -0
  191. package/target/test-classes/jsf.js +3 -0
  192. package/target/test-classes/jsf.js.br +0 -0
  193. package/target/test-classes/jsf.js.gz +0 -0
  194. package/tmp.xml +36 -0
  195. package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
  196. package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
  197. package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
  198. package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
  199. package/target/types/index.js +0 -18
  200. package/target/types/index.js.map +0 -1
@@ -0,0 +1,109 @@
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
+ import {describe, it} from "mocha";
17
+ import * as sinon from "sinon";
18
+ import {expect} from "chai";
19
+ import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
20
+ import {DomQuery} from "mona-dish";
21
+ import {Implementation} from "../../impl/AjaxImpl";
22
+ import defaultFileForm = StandardInits.tobagoFileForm;
23
+
24
+ declare var faces: any;
25
+
26
+ /**
27
+ * specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
28
+ */
29
+ describe('Tests on the xhr core when it starts to call the request', function () {
30
+ beforeEach(async function () {
31
+
32
+ let waitForResult = defaultFileForm();
33
+ return waitForResult.then((close) => {
34
+
35
+ this.xhr = sinon.useFakeXMLHttpRequest();
36
+ this.requests = [];
37
+
38
+ this.respond = (response: string): XMLHttpRequest => {
39
+ let xhrReq = this.requests.shift();
40
+ xhrReq.responsetype = "text/xml";
41
+ xhrReq.respond(200, {'Content-Type': 'text/xml'}, response);
42
+ return xhrReq;
43
+ };
44
+
45
+ this.xhr.onCreate = (xhr) => {
46
+ this.requests.push(xhr);
47
+ };
48
+ (<any>global).XMLHttpRequest = this.xhr;
49
+ window.XMLHttpRequest = this.xhr;
50
+
51
+ this.closeIt = () => {
52
+ (<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
53
+ Implementation.reset();
54
+ close();
55
+ }
56
+ });
57
+
58
+ });
59
+ afterEach(function () {
60
+ this.closeIt();
61
+ });
62
+
63
+ it('tobago file upload', function (done) {
64
+ let send = sinon.spy(XMLHttpRequest.prototype, "send");
65
+
66
+ const POST = "POST";
67
+
68
+ try {
69
+ let fileUploadField = DomQuery.byId("page:fileAjax::field");
70
+ let actionElement = DomQuery.byId("page:fileAjax");
71
+
72
+ fileUploadField.addEventListener("change", (event: Event) => {
73
+ faces.ajax.request(
74
+ actionElement,
75
+ event,
76
+ {
77
+ "javax.faces.behavior.event": "change",
78
+ execute: 'page:fileAjax',
79
+ render: null
80
+ });
81
+ }).dispatchEvent(new Event("change"));
82
+
83
+ expect(this.requests.length).to.eq(1);
84
+ let request = this.requests[0];
85
+ expect(request.method).to.eq(POST);
86
+ expect(request.async).to.be.true;
87
+ expect(send.called).to.be.true;
88
+ expect(send.callCount).to.eq(1);
89
+ expect(request.requestBody instanceof FormData).to.be.true;
90
+
91
+ let formData: FormData = request.requestBody;
92
+ expect(formData.get("page::lastFocusId")).to.eq("");
93
+ expect(formData.get("org.apache.myfaces.tobago.webapp.Secret")).to.eq("secretValue");
94
+ expect(formData.get("javax.faces.ViewState")).to.eq("viewStateValue");
95
+ expect(formData.get("javax.faces.RenderKitId")).to.eq("tobago");
96
+ expect(formData.get("javax.faces.ClientWindow")).to.eq("clientWindowValue");
97
+ expect(formData.get("javax.faces.behavior.event")).to.eq("change");
98
+ expect(formData.get("jakarta.faces.partial.event")).to.eq("change");
99
+ expect(formData.get("jakarta.faces.source")).to.eq("page:fileAjax");
100
+ expect(formData.get("jakarta.faces.partial.ajax")).to.eq("true");
101
+ expect(formData.get("page::form")).to.eq("page::form");
102
+ expect(formData.get("jakarta.faces.partial.execute")).to.eq("page:fileAjax");
103
+
104
+ } finally {
105
+ send.restore();
106
+ }
107
+ done();
108
+ });
109
+ });
@@ -19,58 +19,75 @@ import {DQ} from "mona-dish";
19
19
  import * as sinon from 'sinon';
20
20
  import {XhrFormData} from "../../impl/xhrCore/XhrFormData";
21
21
  import {expect} from "chai";
22
+ import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
23
+ import defaultMyFaces = StandardInits.defaultMyFaces;
24
+ import {Implementation} from "../../impl/AjaxImpl";
22
25
 
23
26
  const jsdom = require("jsdom");
24
27
  const {JSDOM} = jsdom;
25
28
 
26
29
  describe('XhrFormData tests', function () {
27
30
 
28
- beforeEach(function () {
29
-
30
- let dom = new JSDOM(`
31
- <!DOCTYPE html>
32
- <html lang="en">
33
- <head>
34
- <meta charset="UTF-8">
35
- <title>Title</title>
36
- </head>
37
- <body>
38
- <div id="id_1"></div>
39
- <div id="id_2" booga="blarg"></div>
40
- <div id="id_3"></div>
41
- <div id="id_4"></div>
42
- </body>
43
- </html>
44
-
45
- `, {
46
- contentType: "text/html",
47
- runScripts: "dangerously"
31
+ beforeEach(async function () {
32
+
33
+ let waitForResult = defaultMyFaces();
34
+
35
+ return waitForResult.then((close) => {
36
+
37
+ this.xhr = sinon.useFakeXMLHttpRequest();
38
+ this.requests = [];
39
+ this.xhr.onCreate = (xhr) => {
40
+ this.requests.push(xhr);
41
+ };
42
+ (<any>global).XMLHttpRequest = this.xhr;
43
+ window.XMLHttpRequest = this.xhr;
44
+
45
+ this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
46
+
47
+ this.closeIt = () => {
48
+ (<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
49
+ this.jsfAjaxResponse.restore();
50
+ Implementation.reset();
51
+ close();
52
+ }
53
+ });
48
54
  });
49
55
 
50
- let window = dom.window;
51
-
52
- (<any>global).window = window;
53
- (<any>global).body = window.document.body;
54
- (<any>global).document = window.document;
55
- (<any>global).navigator = {
56
- language: "en-En"
57
- };
58
-
59
- this.xhr = sinon.useFakeXMLHttpRequest();
60
- this.requests = [];
61
- this.xhr.onCreate = (xhr) => {
62
- this.requests.push(xhr);
63
- };
64
- (<any>global).XMLHttpRequest = this.xhr;
65
- window.XMLHttpRequest = this.xhr;
66
- });
67
-
68
- this.afterEach(function () {
69
- (<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
70
- });
71
-
72
- it("must have multiple values for a name", function () {
73
- window.document.body.innerHTML = `<form id="page::form">
56
+ beforeEach(function () {
57
+
58
+ let waitForResult = defaultMyFaces();
59
+
60
+ return waitForResult.then((close) => {
61
+ (<any>global).window = window;
62
+ (<any>global).body = window.document.body;
63
+ (<any>global).document = window.document;
64
+ global.body.innerHTML = `
65
+ <div id="id_1"></div>
66
+ <div id="id_2" booga="blarg"></div>
67
+ <div id="id_3"></div>
68
+ <div id="id_4"></div>
69
+ `;
70
+ (<any>global).navigator = {
71
+ language: "en-En"
72
+ };
73
+
74
+ this.xhr = sinon.useFakeXMLHttpRequest();
75
+ this.requests = [];
76
+ this.xhr.onCreate = (xhr) => {
77
+ this.requests.push(xhr);
78
+ };
79
+ (<any>global).XMLHttpRequest = this.xhr;
80
+ window.XMLHttpRequest = this.xhr;
81
+
82
+ });
83
+
84
+ this.afterEach(function () {
85
+ (<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
86
+ });
87
+ });
88
+
89
+ it("must have multiple values for a name", function () {
90
+ window.document.body.innerHTML = `<form id="page::form">
74
91
  <tobago-select-many-checkbox id="page:animals">
75
92
  <label for="page:animals">Checkbox Group</label>
76
93
  <label><input type="checkbox" name="page:animals" id="page:animals::0" value="Cat" checked="checked">Cat</label>
@@ -84,10 +101,11 @@ describe('XhrFormData tests', function () {
84
101
  </div>
85
102
  </form>`;
86
103
 
87
- const xhrFormData = new XhrFormData(DQ.byId("page::form"));
88
- const formData = xhrFormData.toString();
104
+ global.debugf2 = true;
105
+ const xhrFormData = new XhrFormData(DQ.byId("page::form"));
106
+ const formData = xhrFormData.toString();
89
107
 
90
- expect(formData).to.contain("animals=Cat");
91
- expect(formData).to.contain("animals=Fox");
92
- });
108
+ expect(formData).to.contain("animals=Cat");
109
+ expect(formData).to.contain("animals=Fox");
110
+ });
93
111
  });
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <partial-response id='viewroot_1'>
3
+ <changes>
4
+ <update id='viewroot_1:jakarta.faces.ViewState:1'><![[updatedVST]]></update>
5
+ </changes>
6
+ </partial-response>
@@ -29,7 +29,7 @@
29
29
  "module": "commonjs",
30
30
  "sourceMap": true,
31
31
  "typeRoots": [
32
- "../../build/npm/node_modules/@types",
32
+ "../../../node_modules/@types",
33
33
  "./@types/"
34
34
  ]
35
35
 
@@ -3121,7 +3121,7 @@ var XhrFormData = /** @class */ (function (_super) {
3121
3121
  */
3122
3122
  XhrFormData.prototype.assignEncodedString = function (encoded) {
3123
3123
  var keyValueEntries = decodeURIComponent(encoded).split(/&/gi);
3124
- this.assignString(keyValueEntries);
3124
+ this.assignKeyValueEntries(keyValueEntries);
3125
3125
  };
3126
3126
  XhrFormData.prototype.assignString = function (keyValueEntries) {
3127
3127
  var toMerge = new mona_dish_1.Config({});
package/src/tmp/test.html CHANGED
@@ -1,92 +1,16 @@
1
- <h2>protocol testcase1</h2>
2
-
3
- <div id="centerDiv">
4
-
5
- <h1>Selenium Testprobe for insert update delete and attribute change</h1>
6
-
7
- <h2>This test tests all aspects of the protocol, under xhr and iframe conditions</h2>
8
-
9
- <div id="testResults">
10
-
11
- <h3>Test Results</h3>
12
-
13
- <div id="evalarea1">booga</div>
14
-
15
- <div id="evalarea2">eval area 2 triggered by update</div>
16
-
17
- <div id="evalarea3">eval area 3 triggered by insert</div>
18
-
19
- <div id="evalarea4">eval area 4 triggered by a click on the changed attributes area</div>
20
-
21
- <div id="changesArea">update insert area</div>
22
-
23
- <div id="deleteable">delete area will be deleted once you press the delete button</div>
24
-
25
- <div id="attributeChange">attributes changes area</div>
26
-
27
- <div id="resource_area_1"></div>
28
- <div id="resource_area_2"></div>
29
- <div id="resource_area_3"></div>
30
- <script nonce="test12d3" type="text/javascript" src="../../../xhrCore/fixtures/nonce_script.js"></script>
31
-
32
- </div>
33
-
34
- <h2>Call actions via normal ppr</h2>
35
-
36
- <form id="form1" action="./test.mockup">
37
-
38
- <input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb">
39
-
40
- <input type="button" id="cmd_eval" value="eval"
41
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'eval1');">
42
-
43
- <input type="button" id="cmd_update_insert" value="update insert"
44
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'updateinsert1');">
45
-
46
- <input type="button" id="cmd_simple_resource" value="simple resource"
47
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'simpleresource');">
48
-
49
- <input type="button" id="cmd_complex_resource" value="complex resource"
50
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'complex_resource');">
51
-
52
- <input type="button" id="cmd_complex_resource2" value="complex resource2"
53
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'complex_resource2');">
54
-
55
- <input type="button" id="cmd_update_insert2" value="update insert second protocol path"
56
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'updateinsert2');">
57
-
58
- <input type="button" id="cmd_delete" value="delete"
59
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'delete1');">
60
-
61
- <input type="button" id="cmd_replace" value="Replace Body"
62
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'body_replace1');">
63
-
64
- <input type="button" id="cmd_attributeschange" value="change attributes"
65
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'attributes');">
66
-
67
- <input type="button" id="cmd_illegalresponse" value="illegal response, error trigger"
68
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'illegalResponse');">
69
-
70
- <input type="button" id="cmd_viewstate" value="Viewstate only update trigger"
71
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'viewstate');">
72
-
73
- <input type="button" id="cmd_error" value="Server error with error response"
74
- onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'errors');">
75
-
76
- <input type="button" id="cmd_error_component" value="Error: no component given"
77
- onclick="(window.faces || window.jsf).ajax.request(null, event, {}); return false">
78
1
 
2
+ <div id="viewroot_1">
3
+ <form id="viewroot_1:form1">
4
+ <button type="submit" id="viewroot_1:submit_1"></button>
5
+ <input type="hidden" id="viewroot_1:form1:jakarta.faces.ViewState:1" name="jakarta.faces.ViewState" value="updatedVST">
79
6
  </form>
7
+ <form id="viewroot_1:form2">
8
+ <button type="submit" id="viewroot_1:submit_2"></button>
9
+ </form>
10
+ </div>
80
11
 
81
- <script type="text/javascript">
82
- document.getElementById("evalarea1").innerHTML = "booga";
83
-
84
- var target = "./test.mockup";
85
-
86
- function emitPPR(source, event, action, useIframe, formName) {
87
- document.getElementById(formName || "form1").action = target;
88
-
89
- (window?.faces ?? window.jsf).ajax.request(/*String|Dom Node*/ source, /*|EVENT|*/ (window.event) ? window.event : event, /*{|OPTIONS|}*/ {op: action});
90
- }
91
- </script>
12
+ <div id="viewroot_2">
13
+ <form id="viewroot_2:form1">
14
+ <button type="submit" id="viewroot_1:submit_2"></button>
15
+ </form>
92
16
  </div>
@@ -47,9 +47,9 @@ var faces;
47
47
  faces.implversion = 0;
48
48
  /**
49
49
  * SeparatorChar as defined by facesContext.getNamingContainerSeparatorChar()
50
- * @type {Char}
51
50
  */
52
51
  faces.separatorchar = getSeparatorChar();
52
+ // noinspection JSUnusedGlobalSymbols
53
53
  /**
54
54
  * Context Path as defined externalContext.requestContextPath
55
55
  */
@@ -95,7 +95,7 @@ var faces;
95
95
  return AjaxImpl_1.Implementation.getClientWindow(rootNode);
96
96
  }
97
97
  faces.getClientWindow = getClientWindow;
98
- //private helper functions
98
+ // private helper functions
99
99
  function getSeparatorChar() {
100
100
  const sep = '#{facesContext.namingContainerSeparatorChar}';
101
101
  //We now enable standalone mode, the separator char was not mapped we make a fallback to 2.3 behavior
@@ -109,12 +109,12 @@ var faces;
109
109
  /**
110
110
  * this function has to send the ajax requests
111
111
  *
112
- * following requestInternal conditions must be met:
112
+ * following request conditions must be met:
113
113
  * <ul>
114
- * <li> the requestInternal must be sent asynchronously! </li>
115
- * <li> the requestInternal must be a POST!!! requestInternal </li>
116
- * <li> the requestInternal url must be the form action attribute </li>
117
- * <li> all requests must be queued with a client side requestInternal queue to ensure the requestInternal ordering!</li>
114
+ * <li> the request must be sent asynchronously! </li>
115
+ * <li> the request must be a POST!!! request </li>
116
+ * <li> the request url must be the form action attribute </li>
117
+ * <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>
118
118
  * </ul>
119
119
  *
120
120
  * @param {String|Node} element: any dom element no matter being it html or jsf, from which the event is emitted
@@ -130,7 +130,6 @@ var faces;
130
130
  * @param request the request object having triggered this response
131
131
  * @param context the request context
132
132
  *
133
- * TODO add info on what can be in the context
134
133
  */
135
134
  function response(request, context) {
136
135
  AjaxImpl_1.Implementation.response(request, context);
@@ -145,13 +144,13 @@ var faces;
145
144
  * <li> errorData.status : the error status message</li>
146
145
  * <li> errorData.serverErrorName : the server error name in case of a server error</li>
147
146
  * <li> errorData.serverErrorMessage : the server error message in case of a server error</li>
148
- * <li> errorData.source : the issuing source element which triggered the requestInternal </li>
149
- * <li> eventData.responseCode: the response code (aka http requestInternal response code, 401 etc...) </li>
150
- * <li> eventData.responseText: the requestInternal response text </li>
151
- * <li> eventData.responseXML: the requestInternal response xml </li>
147
+ * <li> errorData.source : the issuing source element which triggered the request </li>
148
+ * <li> eventData.responseCode: the response code (aka http request response code, 401 etc...) </li>
149
+ * <li> eventData.responseText: the request response text </li>
150
+ * <li> eventData.responseXML: the request response xml </li>
152
151
  * </ul>
153
152
  *
154
- * @param {function} errorListener error handler must be of the format <i>function errorListener(&lt;errorData&gt;)</i>
153
+ * @param errorFunc error handler must be of the format <i>function errorListener(&lt;errorData&gt;)</i>
155
154
  */
156
155
  function addOnError(errorFunc) {
157
156
  AjaxImpl_1.Implementation.addOnError(errorFunc);
@@ -161,7 +160,7 @@ var faces;
161
160
  * Adds a global event listener to the ajax event queue. The event listener must be a function
162
161
  * of following format: <i>function eventListener(&lt;eventData&gt;)</i>
163
162
  *
164
- * @param {function} eventListener event must be of the format <i>function eventListener(&lt;eventData&gt;)</i>
163
+ * @param eventFunc event must be of the format <i>function eventListener(&lt;eventData&gt;)</i>
165
164
  */
166
165
  function addOnEvent(eventFunc) {
167
166
  AjaxImpl_1.Implementation.addOnEvent(eventFunc);
@@ -176,7 +175,7 @@ var faces;
176
175
  * if any of the code returns false, the execution
177
176
  * is terminated prematurely skipping the rest of the code!
178
177
  *
179
- * @param {DomNode} source, the callee object
178
+ * @param {HTMLElement | String} source, the callee object
180
179
  * @param {Event} event, the event object of the callee event triggering this function
181
180
  * @param funcs ... arbitrary array of functions or strings
182
181
  * @returns true if the chain has succeeded false otherwise
@@ -189,19 +188,24 @@ var faces;
189
188
  let push;
190
189
  (function (push) {
191
190
  /**
192
- * @param {function} onopen The function to be invoked when the web socket is opened.
193
- * @param {function} onmessage The function to be invoked when a message is received.
194
- * @param {function} onclose The function to be invoked when the web socket is closed.
195
- * @param {boolean} autoconnect Whether or not to immediately open the socket. Defaults to <code>false</code>.
191
+ * @param socketClientId the sockets client identifier
192
+ * @param url the uri to reach the socket
193
+ * @param channel the channel name/id
194
+ * @param onopen The function to be invoked when the web socket is opened.
195
+ * @param onmessage The function to be invoked when a message is received.
196
+ * @param onerror The function to be invoked when an error occurs.
197
+ * @param onclose The function to be invoked when the web socket is closed.
198
+ * @param behaviors functions which are invoked whenever a message is received
199
+ * @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
196
200
  */
197
- function init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect) {
198
- PushImpl_1.PushImpl.init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect);
201
+ function init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect) {
202
+ PushImpl_1.PushImpl.init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect);
199
203
  }
200
204
  push.init = init;
201
205
  /**
202
206
  * Open the web socket on the given channel.
203
- * @param {string} channel The name of the web socket channel.
204
- * @throws {Error} When channel is unknown.
207
+ * @param socketClientId The name of the web socket channel.
208
+ * @throws Error is thrown, if the channel is unknown.
205
209
  */
206
210
  function open(socketClientId) {
207
211
  PushImpl_1.PushImpl.open(socketClientId);
@@ -209,8 +213,8 @@ var faces;
209
213
  push.open = open;
210
214
  /**
211
215
  * Close the web socket on the given channel.
212
- * @param {string} channel The name of the web socket channel.
213
- * @throws {Error} When channel is unknown.
216
+ * @param socketClientId The id of the web socket client.
217
+ * @throws Error is thrown, if the channel is unknown.
214
218
  */
215
219
  function close(socketClientId) {
216
220
  PushImpl_1.PushImpl.close(socketClientId);
@@ -229,23 +233,60 @@ var myfaces;
229
233
  * @param event the event
230
234
  * @param eventName event name for java.jakarta.faces.behavior.evemnt
231
235
  * @param execute execute list as passed down in faces.ajax.request
232
- * @param render
233
- * @param options
236
+ * @param render the render list as string
237
+ * @param options the options which need to be mered in
234
238
  */
235
239
  function ab(source, event, eventName, execute, render, options = {}) {
236
- var _a;
240
+ var _a, _b;
237
241
  if (eventName) {
238
- options[(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
242
+ options[Const_1.CTX_OPTIONS_PARAMS] = (_a = options === null || options === void 0 ? void 0 : options[Const_1.CTX_OPTIONS_PARAMS]) !== null && _a !== void 0 ? _a : {};
243
+ options[Const_1.CTX_OPTIONS_PARAMS][(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
239
244
  }
240
245
  if (execute) {
241
- options[Const_1.CTX_PARAM_EXECUTE] = execute;
246
+ options[Const_1.CTX_OPTIONS_EXECUTE] = execute;
242
247
  }
243
248
  if (render) {
244
249
  options[Const_1.CTX_PARAM_RENDER] = render;
245
250
  }
246
- ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window.jsf).ajax.request(source, event, options);
251
+ ((_b = window === null || window === void 0 ? void 0 : window.faces) !== null && _b !== void 0 ? _b : window.jsf).ajax.request(source, event, options);
247
252
  }
248
253
  myfaces.ab = ab;
254
+ const onReadyChain = [];
255
+ let readyStateListener = null;
256
+ // noinspection JSUnusedGlobalSymbols
257
+ /**
258
+ * Helper function in the myfaces namespace to handle document ready properly for the load case
259
+ * the ajax case, does not need proper treatment, since it is deferred anyway.
260
+ * Used by command script as helper function!
261
+ *
262
+ * @param executionFunc the function to be executed upon ready
263
+ */
264
+ function onOnDomReady(executionFunc) {
265
+ if (document.readyState !== "complete") {
266
+ onReadyChain.push(executionFunc);
267
+ if (!readyStateListener) {
268
+ readyStateListener = () => {
269
+ window.removeEventListener("DOMContentLoaded", readyStateListener);
270
+ readyStateListener = null;
271
+ try {
272
+ onReadyChain.forEach(func => func());
273
+ }
274
+ finally {
275
+ //done we clear now the ready chain
276
+ onReadyChain.length = 0;
277
+ }
278
+ };
279
+ window.addEventListener("DOMContentLoaded", readyStateListener);
280
+ }
281
+ }
282
+ else {
283
+ if (readyStateListener) {
284
+ readyStateListener();
285
+ }
286
+ executionFunc();
287
+ }
288
+ }
289
+ myfaces.onOnDomReady = onOnDomReady;
249
290
  /**
250
291
  * legacy oam functions
251
292
  */
@@ -1 +1 @@
1
- {"version":3,"file":"_api.js","sourceRoot":"","sources":["../../src/main/typescript/api/_api.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,+CAAgD;AAChD,+CAA0C;AAC1C,oDAAiD;AACjD,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C;IAC9B,qCAAqC;IACrC;;;;;;OAMG;IACH,SAAgB,YAAY,CAAC,aAAyB;QAClD,IAAG,QAAQ,CAAC,UAAU,KAAK,UAAU,EAAE;YACnC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACjC,IAAG,CAAC,kBAAkB,EAAE;gBACpB,kBAAkB,GAAG,GAAG,EAAE;oBACtB,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;oBACnE,kBAAkB,GAAG,IAAI,CAAC;oBAC1B,IAAI;wBACA,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;qBACxC;4BAAS;wBACN,mCAAmC;wBACnC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;qBAC3B;gBACL,CAAC,CAAC;gBACF,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;aACnE;SACJ;aAAM;YACH,IAAG,kBAAkB,EAAE;gBACnB,kBAAkB,EAAE,CAAC;aACxB;YACD,aAAa,EAAE,CAAC;SACnB;IAEL,CAAC;IAvBe,oBAAY,eAuB3B,CAAA;IAED;;OAEG;IACU,WAAG,GAAG,eAAI,CAAC;AAC5B,CAAC,EApEa,OAAO,GAAP,eAAO,KAAP,eAAO,QAoEpB"}
package/target/api/jsf.js CHANGED
@@ -28,6 +28,17 @@ if (!(window === null || window === void 0 ? void 0 : window.jsf)) {
28
28
  window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : faces;
29
29
  window.jsf.specversion = 230000;
30
30
  delete window.jsf.contextpath;
31
+ let faces4Init = faces.push.init;
32
+ /*
33
+ * we shim back the breaking api change from 3.0 to 4.0
34
+ * onerror is gone
35
+ */
36
+ faces.push.init = (socketClientId, url, channel, onopen, onmessage,
37
+ // no on error api change for 4.0
38
+ //onerror: Function,
39
+ onclose, behaviors, autoConnect) => {
40
+ faces4Init(socketClientId, url, channel, onopen, onmessage, null, onclose, behaviors, autoConnect);
41
+ };
31
42
  }
32
43
  if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
33
44
  const myfaces = require("./_api").myfaces;
@@ -1 +1 @@
1
- {"version":3,"file":"jsf.js","sourceRoot":"","sources":["../../src/main/typescript/api/jsf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AACb;;;;;GAKG;AACH,IAAG,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,EAAE;IACb,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;IACrC,MAAc,CAAC,KAAK,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mCAAI,KAAK,CAAC;IAC9C,MAAM,CAAC,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC;IAChC,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC;CACjC;AACD,IAAG,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,EAAE,CAAA,EAAE;IACrB,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;IAC1C,qEAAqE;IACpE,MAAc,CAAC,SAAS,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;IACnD,IAAG,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,EAAE,CAAA,EAAE;QACrB,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;QAC1C,qEAAqE;QACpE,MAAc,CAAC,SAAS,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,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