jsf.js_next_gen 4.0.0-beta-5 → 4.0.0-beta-6

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 (128) hide show
  1. package/dist/window/faces-development.js +1928 -2521
  2. package/dist/window/faces-development.js.br +0 -0
  3. package/dist/window/faces-development.js.gz +0 -0
  4. package/dist/window/faces-development.js.map +1 -1
  5. package/dist/window/faces.js +1 -1
  6. package/dist/window/faces.js.br +0 -0
  7. package/dist/window/faces.js.gz +0 -0
  8. package/dist/window/faces.js.map +1 -1
  9. package/dist/window/jsf-development.js +1890 -2511
  10. package/dist/window/jsf-development.js.br +0 -0
  11. package/dist/window/jsf-development.js.gz +0 -0
  12. package/dist/window/jsf-development.js.map +1 -1
  13. package/dist/window/jsf.js +1 -1
  14. package/dist/window/jsf.js.br +0 -0
  15. package/dist/window/jsf.js.gz +0 -0
  16. package/dist/window/jsf.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/main/typescript/api/_api.ts +258 -0
  19. package/src/main/typescript/api/faces.ts +17 -245
  20. package/src/main/typescript/api/jsf.ts +24 -8
  21. package/src/main/typescript/impl/core/Const.ts +4 -2
  22. package/src/main/typescript/impl/util/ExtDomQuery.ts +12 -13
  23. package/src/main/typescript/impl/xhrCore/Response.ts +2 -2
  24. package/src/main/typescript/myfaces/OamSubmit.ts +6 -5
  25. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +2 -0
  26. package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +14 -23
  27. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +20 -13
  28. package/src/main/typescript/tsconfig-typedoc.json +1 -1
  29. package/src/main/typescript/tsconfig.json +1 -2
  30. package/src/test/resources/jsf-development.js +1 -1
  31. package/target/api/Jsf.js +24 -11
  32. package/target/api/Jsf.js.map +1 -1
  33. package/target/api/_api.js +246 -0
  34. package/target/api/_api.js.map +1 -0
  35. package/target/api/_faces.js +251 -0
  36. package/target/api/_faces.js.map +1 -0
  37. package/target/api/faces.js +20 -247
  38. package/target/api/faces.js.map +1 -1
  39. package/target/impl/AjaxImpl.js +53 -61
  40. package/target/impl/AjaxImpl.js.map +1 -1
  41. package/target/impl/PushImpl.js +38 -41
  42. package/target/impl/PushImpl.js.map +1 -1
  43. package/target/impl/core/Const.js +4 -2
  44. package/target/impl/core/Const.js.map +1 -1
  45. package/target/impl/core/ImplTypes.js +9 -14
  46. package/target/impl/core/ImplTypes.js.map +1 -1
  47. package/target/impl/i18n/Messages.js +3 -4
  48. package/target/impl/i18n/Messages.js.map +1 -1
  49. package/target/impl/util/Assertions.js +9 -18
  50. package/target/impl/util/Assertions.js.map +1 -1
  51. package/target/impl/util/AsyncQueue.js +28 -36
  52. package/target/impl/util/AsyncQueue.js.map +1 -1
  53. package/target/impl/util/ExtDomQuery.js +137 -210
  54. package/target/impl/util/ExtDomQuery.js.map +1 -1
  55. package/target/impl/util/Lang.js +21 -28
  56. package/target/impl/util/Lang.js.map +1 -1
  57. package/target/impl/xhrCore/ErrorData.js +36 -61
  58. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  59. package/target/impl/xhrCore/EventData.js +10 -13
  60. package/target/impl/xhrCore/EventData.js.map +1 -1
  61. package/target/impl/xhrCore/RequestDataResolver.js +16 -19
  62. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  63. package/target/impl/xhrCore/ResonseDataResolver.js +16 -16
  64. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  65. package/target/impl/xhrCore/Response.js +18 -18
  66. package/target/impl/xhrCore/Response.js.map +1 -1
  67. package/target/impl/xhrCore/ResponseProcessor.js +116 -130
  68. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  69. package/target/impl/xhrCore/XhrFormData.js +68 -98
  70. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  71. package/target/impl/xhrCore/XhrRequest.js +81 -91
  72. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  73. package/target/myfaces/OamSubmit.js +20 -18
  74. package/target/myfaces/OamSubmit.js.map +1 -1
  75. package/target/test/frameworkBase/LangTest.spec.js +46 -32
  76. package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
  77. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +160 -82
  78. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  79. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +45 -31
  80. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
  81. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +24 -33
  82. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
  83. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +8 -8
  84. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
  85. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +31 -31
  86. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
  87. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +50 -48
  88. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
  89. package/target/test/frameworkBase/_ext/shared/StandardInits.js +235 -130
  90. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  91. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +162 -18
  92. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  93. package/target/test/impl/ImplTest.spec.js +34 -61
  94. package/target/test/impl/ImplTest.spec.js.map +1 -1
  95. package/target/test/impl/ImplTest_23.spec.js +35 -64
  96. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  97. package/target/test/impl/SeparatorCharsTest.spec.js +19 -19
  98. package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
  99. package/target/test/myfaces/OamSubmit.spec.js +34 -41
  100. package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
  101. package/target/test/queue/AsynchronousProbe.js +23 -29
  102. package/target/test/queue/AsynchronousProbe.js.map +1 -1
  103. package/target/test/queue/AsynchronousQueueTest.spec.js +39 -70
  104. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  105. package/target/test/xhrCore/EventTests.spec.js +47 -78
  106. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  107. package/target/test/xhrCore/FakeWebsocket.js +14 -16
  108. package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
  109. package/target/test/xhrCore/FileUploadTest.spec.js +49 -80
  110. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  111. package/target/test/xhrCore/RequestParamsTest.spec.js +39 -70
  112. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  113. package/target/test/xhrCore/RequestTest.spec.js +76 -113
  114. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  115. package/target/test/xhrCore/RequestTest_23.spec.js +100 -140
  116. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  117. package/target/test/xhrCore/ResponseTest.spec.js +118 -87
  118. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  119. package/target/test/xhrCore/ResponseTest23.spec.js +120 -89
  120. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  121. package/target/test/xhrCore/ShadowDomTest.spec.js +31 -62
  122. package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
  123. package/target/test/xhrCore/WebsocketTest.js +60 -93
  124. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
  125. package/target/test/xhrCore/XhrFormDataTest.spec.js +41 -15
  126. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  127. package/webpack.config.js +71 -0
  128. package/webpack.config.js.map +1 -0
@@ -16,16 +16,16 @@
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Response = void 0;
19
- var mona_dish_1 = require("mona-dish");
20
- var ResponseProcessor_1 = require("./ResponseProcessor");
21
- var Const_1 = require("../core/Const");
22
- var ResonseDataResolver_1 = require("./ResonseDataResolver");
23
- var ExtDomQuery_1 = require("../util/ExtDomQuery");
19
+ const mona_dish_1 = require("mona-dish");
20
+ const ResponseProcessor_1 = require("./ResponseProcessor");
21
+ const Const_1 = require("../core/Const");
22
+ const ResonseDataResolver_1 = require("./ResonseDataResolver");
23
+ const ExtDomQuery_1 = require("../util/ExtDomQuery");
24
24
  var Response;
25
25
  (function (Response) {
26
26
  /**
27
- * Standardized faces.js response
28
- * this one is called straight from faces.js.response
27
+ * Standardized faces.ts response
28
+ * this one is called straight from faces.ts.response
29
29
  *
30
30
  * The processing follows the spec by going for the responseXML
31
31
  * and processing its tags
@@ -35,14 +35,14 @@ var Response;
35
35
  *
36
36
  */
37
37
  function processResponse(request, context) {
38
- var req = ExtDomQuery_1.ExtConfig.fromNullable(request);
39
- var _a = (0, ResonseDataResolver_1.resolveContexts)(context), externalContext = _a.externalContext, internalContext = _a.internalContext;
40
- var responseXML = (0, ResonseDataResolver_1.resolveResponseXML)(req);
41
- var responseProcessor = new ResponseProcessor_1.ResponseProcessor(req, externalContext, internalContext);
38
+ let req = ExtDomQuery_1.ExtConfig.fromNullable(request);
39
+ let { externalContext, internalContext } = (0, ResonseDataResolver_1.resolveContexts)(context);
40
+ let responseXML = (0, ResonseDataResolver_1.resolveResponseXML)(req);
41
+ let responseProcessor = new ResponseProcessor_1.ResponseProcessor(req, externalContext, internalContext);
42
42
  internalContext.assign(Const_1.RESPONSE_XML).value = responseXML;
43
43
  //we now process the partial tags, or in none given raise an error
44
44
  responseXML.querySelectorAll(Const_1.RESP_PARTIAL)
45
- .each(function (item) { return processPartialTag(item, responseProcessor, internalContext); });
45
+ .each(item => processPartialTag(item, responseProcessor, internalContext));
46
46
  //we now process the viewstates, client windows and the evals deferred
47
47
  //the reason for this is that often it is better
48
48
  //to wait until the document has caught up before
@@ -60,9 +60,9 @@ var Response;
60
60
  */
61
61
  function processPartialTag(node, responseProcessor, internalContext) {
62
62
  internalContext.assign(Const_1.PARTIAL_ID).value = node.id;
63
- var SEL_SUB_TAGS = [Const_1.CMD_ERROR, Const_1.CMD_REDIRECT, Const_1.CMD_CHANGES].join(",");
63
+ const SEL_SUB_TAGS = [Const_1.CMD_ERROR, Const_1.CMD_REDIRECT, Const_1.CMD_CHANGES].join(",");
64
64
  //now we can process the main operations
65
- node.querySelectorAll(SEL_SUB_TAGS).each(function (node) {
65
+ node.querySelectorAll(SEL_SUB_TAGS).each((node) => {
66
66
  switch (node.tagName.value) {
67
67
  case Const_1.CMD_ERROR:
68
68
  responseProcessor.error(node);
@@ -76,7 +76,7 @@ var Response;
76
76
  }
77
77
  });
78
78
  }
79
- var processInsert = function (responseProcessor, node) {
79
+ let processInsert = function (responseProcessor, node) {
80
80
  //path1 insert after as child tags
81
81
  if (node.querySelectorAll([Const_1.TAG_BEFORE, Const_1.TAG_AFTER].join(",")).length) {
82
82
  responseProcessor.insertWithSubtags(node);
@@ -92,8 +92,8 @@ var Response;
92
92
  * @param responseProcessor
93
93
  */
94
94
  function processChangesTag(node, responseProcessor) {
95
- var ALLOWED_TAGS = [Const_1.CMD_UPDATE, Const_1.CMD_EVAL, Const_1.CMD_INSERT, Const_1.CMD_DELETE, Const_1.CMD_ATTRIBUTES, Const_1.CMD_EXTENSION].join(", ");
96
- node.querySelectorAll(ALLOWED_TAGS).each(function (node) {
95
+ const ALLOWED_TAGS = [Const_1.CMD_UPDATE, Const_1.CMD_EVAL, Const_1.CMD_INSERT, Const_1.CMD_DELETE, Const_1.CMD_ATTRIBUTES, Const_1.CMD_EXTENSION].join(", ");
96
+ node.querySelectorAll(ALLOWED_TAGS).each((node) => {
97
97
  switch (node.tagName.value) {
98
98
  case Const_1.CMD_UPDATE:
99
99
  processUpdateTag(node, responseProcessor);
@@ -148,7 +148,7 @@ var Response;
148
148
  * @param responseProcessor
149
149
  */
150
150
  function handleElementUpdate(node, responseProcessor) {
151
- var cdataBlock = node.cDATAAsString;
151
+ let cdataBlock = node.cDATAAsString;
152
152
  switch (node.id.value) {
153
153
  case (0, Const_1.$nsp)(Const_1.P_VIEWROOT):
154
154
  responseProcessor.replaceViewRoot(mona_dish_1.DQ.fromMarkup(cdataBlock.substring(cdataBlock.indexOf("<html"))));
@@ -1 +1 @@
1
- {"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/xhrCore/Response.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,uCAA+C;AAC/C,yDAAsD;AAGtD,uCAmBuB;AACvB,6DAA0E;AAC1E,mDAA8C;AAI9C,IAAc,QAAQ,CAuKrB;AAvKD,WAAc,QAAQ;IAGlB;;;;;;;;;;OAUG;IACH,SAAgB,eAAe,CAAC,OAAuB,EAAE,OAAgB;QAErE,IAAI,GAAG,GAAG,uBAAS,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtC,IAAA,KAAqC,IAAA,qCAAe,EAAC,OAAO,CAAC,EAA5D,eAAe,qBAAA,EAAE,eAAe,qBAA4B,CAAC;QAClE,IAAI,WAAW,GAAa,IAAA,wCAAkB,EAAC,GAAG,CAAC,CAAC;QACpD,IAAI,iBAAiB,GAAG,IAAI,qCAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;QAErF,eAAe,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC,KAAK,GAAG,WAAW,CAAC;QAEzD,kEAAkE;QAClE,WAAW,CAAC,gBAAgB,CAAC,oBAAY,CAAC;aACrC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,iBAAiB,CAAW,IAAI,EAAE,iBAAiB,EAAE,eAAe,CAAC,EAArE,CAAqE,CAAC,CAAC;QAEzF,sEAAsE;QACtE,gDAAgD;QAChD,iDAAiD;QACjD,0CAA0C;QAC1C,oFAAoF;QACpF,oFAAoF;QACpF,iBAAiB,CAAC,aAAa,EAAE,CAAC;QAClC,iBAAiB,CAAC,eAAe,EAAE,CAAC;QACpC,iBAAiB,CAAC,UAAU,EAAE,CAAC;Q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b;IACL,CAAC;AACL,CAAC,EAvKa,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAuKrB"}
@@ -14,26 +14,17 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
18
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
19
- if (ar || !(i in from)) {
20
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
21
- ar[i] = from[i];
22
- }
23
- }
24
- return to.concat(ar || Array.prototype.slice.call(from));
25
- };
26
17
  Object.defineProperty(exports, "__esModule", { value: true });
27
18
  exports.ResponseProcessor = void 0;
28
- var mona_dish_1 = require("mona-dish");
29
- var AjaxImpl_1 = require("../AjaxImpl");
30
- var Assertions_1 = require("../util/Assertions");
31
- var ErrorData_1 = require("./ErrorData");
32
- var ImplTypes_1 = require("../core/ImplTypes");
33
- var EventData_1 = require("./EventData");
34
- var Const_1 = require("../core/Const");
19
+ const mona_dish_1 = require("mona-dish");
20
+ const AjaxImpl_1 = require("../AjaxImpl");
21
+ const Assertions_1 = require("../util/Assertions");
22
+ const ErrorData_1 = require("./ErrorData");
23
+ const ImplTypes_1 = require("../core/ImplTypes");
24
+ const EventData_1 = require("./EventData");
25
+ const Const_1 = require("../core/Const");
35
26
  var trim = mona_dish_1.Lang.trim;
36
- var ExtDomQuery_1 = require("../util/ExtDomQuery");
27
+ const ExtDomQuery_1 = require("../util/ExtDomQuery");
37
28
  /**
38
29
  * Response processor
39
30
  *
@@ -47,8 +38,8 @@ var ExtDomQuery_1 = require("../util/ExtDomQuery");
47
38
  * Note the response processor is stateful hence we bundle it in a class
48
39
  * to reduce code we keep references tot contexts in place
49
40
  */
50
- var ResponseProcessor = /** @class */ (function () {
51
- function ResponseProcessor(request, externalContext, internalContext) {
41
+ class ResponseProcessor {
42
+ constructor(request, externalContext, internalContext) {
52
43
  this.request = request;
53
44
  this.externalContext = externalContext;
54
45
  this.internalContext = internalContext;
@@ -58,19 +49,19 @@ var ResponseProcessor = /** @class */ (function () {
58
49
  * @param shadowDocument incoming shadow head data (aka cdata as xml reference or dom element)
59
50
  * the data incoming must represent the html representation of the head itself one way or the other
60
51
  */
61
- ResponseProcessor.prototype.replaceHead = function (shadowDocument) {
62
- var shadowHead = shadowDocument.querySelectorAll(Const_1.TAG_HEAD);
52
+ replaceHead(shadowDocument) {
53
+ let shadowHead = shadowDocument.querySelectorAll(Const_1.TAG_HEAD);
63
54
  if (!shadowHead.isPresent()) {
64
55
  return;
65
56
  }
66
- var oldHead = mona_dish_1.DQ.querySelectorAll(Const_1.TAG_HEAD);
57
+ let oldHead = mona_dish_1.DQ.querySelectorAll(Const_1.TAG_HEAD);
67
58
  //delete all to avoid script and style overlays
68
59
  oldHead.querySelectorAll(Const_1.SEL_SCRIPTS_STYLES).delete();
69
60
  // we cannot replace new elements in the head, but we can eval the elements
70
61
  // eval means the scripts will get attached (eval script attach method)
71
62
  // but this is done by DomQuery not in this code
72
63
  this.storeForEval(shadowHead);
73
- };
64
+ }
74
65
  /**
75
66
  * replaces the body in the expected manner
76
67
  * which means the entire body content is refreshed
@@ -79,238 +70,234 @@ var ResponseProcessor = /** @class */ (function () {
79
70
  *
80
71
  * @param shadowDocument .. an incoming shadow document hosting the new nodes
81
72
  */
82
- ResponseProcessor.prototype.replaceBody = function (shadowDocument) {
83
- var shadowBody = shadowDocument.querySelectorAll(Const_1.TAG_BODY);
73
+ replaceBody(shadowDocument) {
74
+ let shadowBody = shadowDocument.querySelectorAll(Const_1.TAG_BODY);
84
75
  if (!shadowBody.isPresent()) {
85
76
  return;
86
77
  }
87
- var shadowInnerHTML = shadowBody.html().value;
88
- var resultingBody = mona_dish_1.DQ.querySelectorAll(Const_1.TAG_BODY).html(shadowInnerHTML);
89
- var updateForms = resultingBody.querySelectorAll(Const_1.TAG_FORM);
78
+ let shadowInnerHTML = shadowBody.html().value;
79
+ let resultingBody = mona_dish_1.DQ.querySelectorAll(Const_1.TAG_BODY).html(shadowInnerHTML);
80
+ let updateForms = resultingBody.querySelectorAll(Const_1.TAG_FORM);
90
81
  // main difference, we cannot replace the body itself, but only its content
91
82
  // we need a separate step for post processing the incoming attributes, like classes, styles etc...
92
83
  resultingBody.copyAttrs(shadowBody);
93
84
  this.storeForPostProcessing(updateForms, resultingBody);
94
- };
85
+ }
95
86
  /**
96
87
  * Leaf Tag eval... process whatever is in the evals cdata block
97
88
  *
98
89
  * @param node the node to eval
99
90
  */
100
- ResponseProcessor.prototype.eval = function (node) {
91
+ eval(node) {
101
92
  mona_dish_1.DQ.globalEval(node.cDATAAsString);
102
- };
93
+ }
103
94
  /**
104
95
  * processes an incoming error from the response
105
96
  * which is hosted under the &lt;error&gt; tag
106
97
  * @param node the node hosting the error in our response xml
107
98
  * @param node the node in the xml hosting the error message
108
99
  */
109
- ResponseProcessor.prototype.error = function (node) {
100
+ error(node) {
110
101
  /**
111
102
  * <error>
112
103
  * <error-name>String</error-name>
113
104
  * <error-message><![CDATA[message]]></error-message>
114
105
  * <error>
115
106
  */
116
- var mergedErrorData = new ExtDomQuery_1.ExtConfig({});
107
+ let mergedErrorData = new ExtDomQuery_1.ExtConfig({});
117
108
  mergedErrorData.assign(Const_1.SOURCE).value = this.externalContext.getIf(Const_1.P_PARTIAL_SOURCE).get(0).value;
118
109
  mergedErrorData.assign(Const_1.ERROR_NAME).value = node.querySelectorAll(Const_1.ERROR_NAME).textContent(Const_1.EMPTY_STR);
119
110
  mergedErrorData.assign(Const_1.ERROR_MESSAGE).value = node.querySelectorAll(Const_1.ERROR_MESSAGE).cDATAAsString;
120
- var hasResponseXML = this.internalContext.get(Const_1.RESPONSE_XML).isPresent();
111
+ let hasResponseXML = this.internalContext.get(Const_1.RESPONSE_XML).isPresent();
121
112
  //we now store the response xml also in the error data for further details
122
113
  mergedErrorData.assignIf(hasResponseXML, Const_1.RESPONSE_XML).value = this.internalContext.getIf(Const_1.RESPONSE_XML).value.get(0).value;
123
114
  // error post processing and enrichment (standard messages from keys)
124
- var errorData = ErrorData_1.ErrorData.fromServerError(mergedErrorData);
115
+ let errorData = ErrorData_1.ErrorData.fromServerError(mergedErrorData);
125
116
  // we now trigger an internally stored onError function which might be a attached to the context
126
117
  // either we haven an internal on error, or an on error has been bassed via params from the outside
127
118
  // in both cases they are attached to our contexts
128
119
  this.triggerOnError(errorData);
129
120
  AjaxImpl_1.Implementation.sendError(errorData);
130
- };
121
+ }
131
122
  /**
132
123
  * process the redirect operation
133
124
  *
134
125
  * @param node
135
126
  */
136
- ResponseProcessor.prototype.redirect = function (node) {
127
+ redirect(node) {
137
128
  Assertions_1.Assertions.assertUrlExists(node);
138
- var redirectUrl = trim(node.attr(Const_1.ATTR_URL).value);
129
+ let redirectUrl = trim(node.attr(Const_1.ATTR_URL).value);
139
130
  if (redirectUrl != Const_1.EMPTY_STR) {
140
131
  window.location.href = redirectUrl;
141
132
  }
142
- };
133
+ }
143
134
  /**
144
135
  * processes the update operation and updates the node with the cdata block
145
136
  * @param node the xml response node hosting the update info
146
137
  * @param cdataBlock the cdata block with the new html code
147
138
  */
148
- ResponseProcessor.prototype.update = function (node, cdataBlock) {
149
- var result = ExtDomQuery_1.ExtDomquery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
150
- var sourceForm = result === null || result === void 0 ? void 0 : result.parents(Const_1.TAG_FORM).orElseLazy(function () { return result.byTagName(Const_1.TAG_FORM, true); });
139
+ update(node, cdataBlock) {
140
+ let result = ExtDomQuery_1.ExtDomquery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
141
+ let sourceForm = result === null || result === void 0 ? void 0 : result.parents(Const_1.TAG_FORM).orElseLazy(() => result.byTagName(Const_1.TAG_FORM, true));
151
142
  if (sourceForm) {
152
143
  this.storeForPostProcessing(sourceForm, result);
153
144
  }
154
- };
145
+ }
155
146
  /**
156
147
  * Delete handler, simply deleetes the node referenced by the xml data
157
148
  * @param node
158
149
  */
159
- ResponseProcessor.prototype.delete = function (node) {
150
+ delete(node) {
160
151
  mona_dish_1.DQ.byId(node.id.value, true).delete();
161
- };
152
+ }
162
153
  /**
163
154
  * attributes leaf tag... process the attributes
164
155
  *
165
156
  * @param node
166
157
  */
167
- ResponseProcessor.prototype.attributes = function (node) {
168
- var elem = mona_dish_1.DQ.byId(node.id.value, true);
169
- node.byTagName(Const_1.TAG_ATTR).each(function (item) {
158
+ attributes(node) {
159
+ let elem = mona_dish_1.DQ.byId(node.id.value, true);
160
+ node.byTagName(Const_1.TAG_ATTR).each((item) => {
170
161
  elem.attr(item.attr(Const_1.ATTR_NAME).value).value = item.attr(Const_1.ATTR_VALUE).value;
171
162
  });
172
- };
163
+ }
173
164
  /**
174
165
  * @param shadowDocument a shadow document which is needed for further processing
175
166
  */
176
- ResponseProcessor.prototype.replaceViewRoot = function (shadowDocument) {
167
+ replaceViewRoot(shadowDocument) {
177
168
  this.replaceHead(shadowDocument);
178
169
  this.replaceBody(shadowDocument);
179
- };
170
+ }
180
171
  /**
181
172
  * Insert handling, either before or after
182
173
  *
183
174
  * @param node
184
175
  */
185
- ResponseProcessor.prototype.insert = function (node) {
176
+ insert(node) {
186
177
  //let insertId = node.id; //not used atm
187
- var before = node.attr(Const_1.TAG_BEFORE);
188
- var after = node.attr(Const_1.TAG_AFTER);
189
- var insertNodes = mona_dish_1.DQ.fromMarkup(node.cDATAAsString);
178
+ let before = node.attr(Const_1.TAG_BEFORE);
179
+ let after = node.attr(Const_1.TAG_AFTER);
180
+ let insertNodes = mona_dish_1.DQ.fromMarkup(node.cDATAAsString);
190
181
  if (before.isPresent()) {
191
182
  mona_dish_1.DQ.byId(before.value, true).insertBefore(insertNodes);
192
183
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
193
184
  }
194
185
  if (after.isPresent()) {
195
- var domQuery = mona_dish_1.DQ.byId(after.value, true);
186
+ let domQuery = mona_dish_1.DQ.byId(after.value, true);
196
187
  domQuery.insertAfter(insertNodes);
197
188
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
198
189
  }
199
- };
190
+ }
200
191
  /**
201
192
  * Handler for the case &lt;insert <&lt; before id="...
202
193
  *
203
194
  * @param node the node hosting the insert data
204
195
  */
205
- ResponseProcessor.prototype.insertWithSubtags = function (node) {
206
- var _this = this;
207
- var before = node.querySelectorAll(Const_1.TAG_BEFORE);
208
- var after = node.querySelectorAll(Const_1.TAG_AFTER);
209
- before.each(function (item) {
210
- var insertId = item.attr(Const_1.ATTR_ID);
211
- var insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
196
+ insertWithSubtags(node) {
197
+ let before = node.querySelectorAll(Const_1.TAG_BEFORE);
198
+ let after = node.querySelectorAll(Const_1.TAG_AFTER);
199
+ before.each(item => {
200
+ let insertId = item.attr(Const_1.ATTR_ID);
201
+ let insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
212
202
  if (insertId.isPresent()) {
213
203
  mona_dish_1.DQ.byId(insertId.value, true).insertBefore(insertNodes);
214
- _this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
204
+ this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
215
205
  }
216
206
  });
217
- after.each(function (item) {
218
- var insertId = item.attr(Const_1.ATTR_ID);
219
- var insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
207
+ after.each(item => {
208
+ let insertId = item.attr(Const_1.ATTR_ID);
209
+ let insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
220
210
  if (insertId.isPresent()) {
221
211
  mona_dish_1.DQ.byId(insertId.value, true).insertAfter(insertNodes);
222
- _this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
212
+ this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
223
213
  }
224
214
  });
225
- };
215
+ }
226
216
  /**
227
217
  * Process the viewState update, update the affected
228
218
  * forms with their respective new viewstate values
229
219
  *
230
220
  */
231
- ResponseProcessor.prototype.processViewState = function (node) {
221
+ processViewState(node) {
232
222
  if (ResponseProcessor.isViewStateNode(node)) {
233
- var state = node.cDATAAsString;
223
+ let state = node.cDATAAsString;
234
224
  this.internalContext.assign(Const_1.APPLIED_VST, node.id.value).value = new ImplTypes_1.StateHolder((0, Const_1.$nsp)(node.id.value), state);
235
225
  return true;
236
226
  }
237
227
  return false;
238
- };
239
- ResponseProcessor.prototype.processClientWindow = function (node) {
228
+ }
229
+ processClientWindow(node) {
240
230
  if (ResponseProcessor.isClientWindowNode(node)) {
241
- var state = node.cDATAAsString;
231
+ let state = node.cDATAAsString;
242
232
  this.internalContext.assign(Const_1.APPLIED_CLIENT_WINDOW, node.id.value).value = new ImplTypes_1.StateHolder((0, Const_1.$nsp)(node.id.value), state);
243
233
  return true;
244
234
  }
245
- };
235
+ }
246
236
  /**
247
237
  * generic global eval which runs the embedded css and scripts
248
238
  */
249
- ResponseProcessor.prototype.globalEval = function () {
250
- var updateElems = new (ExtDomQuery_1.ExtDomquery.bind.apply(ExtDomQuery_1.ExtDomquery, __spreadArray([void 0], this.internalContext.getIf(Const_1.UPDATE_ELEMS).value, false)))();
239
+ globalEval() {
240
+ let updateElems = new ExtDomQuery_1.ExtDomquery(...this.internalContext.getIf(Const_1.UPDATE_ELEMS).value);
251
241
  updateElems.runCss();
252
242
  updateElems.runScripts();
253
- };
243
+ }
254
244
  /**
255
245
  * Postprocessing view state fixing
256
246
  * this appends basically the incoming view states to the forms.
257
247
  * It is called from outside after all forms have been processed basically
258
248
  * as last lifecycle step, before going into the next request.
259
249
  */
260
- ResponseProcessor.prototype.fixViewStates = function () {
261
- var _this = this;
250
+ fixViewStates() {
262
251
  mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_VST).orElse({}).value)
263
- .each(function (item) {
264
- var value = item[1];
265
- var nameSpace = mona_dish_1.DQ.byId(value.nameSpace, true).orElse(document.body);
266
- var affectedForms = nameSpace.byTagName(Const_1.TAG_FORM);
267
- var affectedForms2 = nameSpace.filter(function (item) { return item.tagName.orElse(Const_1.EMPTY_STR).value.toLowerCase() == Const_1.TAG_FORM; });
268
- _this.appendViewStateToForms(new mona_dish_1.DomQuery(affectedForms, affectedForms2), value.value);
252
+ .each((item) => {
253
+ let value = item[1];
254
+ let nameSpace = mona_dish_1.DQ.byId(value.nameSpace, true).orElse(document.body);
255
+ let affectedForms = nameSpace.byTagName(Const_1.TAG_FORM);
256
+ let affectedForms2 = nameSpace.filter(item => item.tagName.orElse(Const_1.EMPTY_STR).value.toLowerCase() == Const_1.TAG_FORM);
257
+ this.appendViewStateToForms(new mona_dish_1.DomQuery(affectedForms, affectedForms2), value.value);
269
258
  });
270
- };
259
+ }
271
260
  /**
272
261
  * same as with view states before applies the incoming client windows as last step after the rest of the processing
273
262
  * is done.
274
263
  */
275
- ResponseProcessor.prototype.fixClientWindow = function () {
276
- var _this = this;
264
+ fixClientWindow() {
277
265
  mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
278
- .each(function (item) {
279
- var value = item[1];
280
- var nameSpace = mona_dish_1.DQ.byId(value.nameSpace, true).orElse(document.body);
281
- var affectedForms = nameSpace.byTagName(Const_1.TAG_FORM);
282
- var affectedForms2 = nameSpace.filter(function (item) { return item.tagName.orElse(Const_1.EMPTY_STR).value.toLowerCase() == Const_1.TAG_FORM; });
283
- _this.appendClientWindowToForms(new mona_dish_1.DomQuery(affectedForms, affectedForms2), value.value);
266
+ .each((item) => {
267
+ let value = item[1];
268
+ let nameSpace = mona_dish_1.DQ.byId(value.nameSpace, true).orElse(document.body);
269
+ let affectedForms = nameSpace.byTagName(Const_1.TAG_FORM);
270
+ let affectedForms2 = nameSpace.filter(item => item.tagName.orElse(Const_1.EMPTY_STR).value.toLowerCase() == Const_1.TAG_FORM);
271
+ this.appendClientWindowToForms(new mona_dish_1.DomQuery(affectedForms, affectedForms2), value.value);
284
272
  });
285
- };
273
+ }
286
274
  /**
287
275
  * all processing done we can close the request and send the appropriate events
288
276
  */
289
- ResponseProcessor.prototype.done = function () {
290
- var _this = this;
291
- var eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);
277
+ done() {
278
+ let eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);
292
279
  //because some frameworks might decorate them over the context in the response
293
- var eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(function () { return _this.internalContext.getIf(Const_1.ON_EVENT).value; }).orElse(Const_1.EMPTY_FUNC).value;
280
+ let eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;
294
281
  AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);
295
- };
282
+ }
296
283
  /**
297
284
  * proper viewstate -> form assignment
298
285
  *
299
286
  * @param forms the forms to append the viewstate to
300
287
  * @param viewState the final viewstate
301
288
  */
302
- ResponseProcessor.prototype.appendViewStateToForms = function (forms, viewState) {
289
+ appendViewStateToForms(forms, viewState) {
303
290
  this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState);
304
- };
291
+ }
305
292
  /**
306
293
  * proper clientwindow -> form assignment
307
294
  *
308
295
  * @param forms the forms to append the viewstate to
309
296
  * @param clientWindow the final viewstate
310
297
  */
311
- ResponseProcessor.prototype.appendClientWindowToForms = function (forms, clientWindow) {
298
+ appendClientWindowToForms(forms, clientWindow) {
312
299
  this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow);
313
- };
300
+ }
314
301
  /**
315
302
  * generic append state which appends a certain state as hidden element to an existing set of forms
316
303
  *
@@ -320,80 +307,79 @@ var ResponseProcessor = /** @class */ (function () {
320
307
  *
321
308
  * @private
322
309
  */
323
- ResponseProcessor.prototype.assignState = function (forms, selector, state) {
324
- forms.each(function (form) {
325
- var stateHolders = form.querySelectorAll(selector)
326
- .orElseLazy(function () { return ResponseProcessor.newViewStateElement(form); });
310
+ assignState(forms, selector, state) {
311
+ forms.each((form) => {
312
+ let stateHolders = form.querySelectorAll(selector)
313
+ .orElseLazy(() => ResponseProcessor.newViewStateElement(form));
327
314
  stateHolders.attr("value").value = state;
328
315
  });
329
- };
316
+ }
330
317
  /**
331
318
  * Helper to Create a new JSF ViewState Element
332
319
  *
333
320
  * @param parent, the parent node to attach the viewstate element to
334
321
  * (usually a form node)
335
322
  */
336
- ResponseProcessor.newViewStateElement = function (parent) {
337
- var newViewState = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(Const_1.HTML_VIEWSTATE));
323
+ static newViewStateElement(parent) {
324
+ let newViewState = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(Const_1.HTML_VIEWSTATE));
338
325
  newViewState.appendTo(parent);
339
326
  return newViewState;
340
- };
327
+ }
341
328
  /**
342
329
  * Stores certain aspects of the dom for later post processing
343
330
  *
344
331
  * @param updateForms the update forms which should receive standardized internal jsf data
345
332
  * @param toBeEvaled the resulting elements which should be evaled
346
333
  */
347
- ResponseProcessor.prototype.storeForPostProcessing = function (updateForms, toBeEvaled) {
334
+ storeForPostProcessing(updateForms, toBeEvaled) {
348
335
  this.storeForUpdate(updateForms);
349
336
  this.storeForEval(toBeEvaled);
350
- };
337
+ }
351
338
  /**
352
339
  * helper to store a given form for the update post processing (viewstate)
353
340
  *
354
341
  * @param updateForms the dom query object pointing to the forms which need to be updated
355
342
  */
356
- ResponseProcessor.prototype.storeForUpdate = function (updateForms) {
343
+ storeForUpdate(updateForms) {
357
344
  this.internalContext.assign(Const_1.UPDATE_FORMS).value.push(updateForms);
358
- };
345
+ }
359
346
  /**
360
347
  * same for eval (js and css)
361
348
  *
362
349
  * @param toBeEvaled
363
350
  */
364
- ResponseProcessor.prototype.storeForEval = function (toBeEvaled) {
351
+ storeForEval(toBeEvaled) {
365
352
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(toBeEvaled);
366
- };
353
+ }
367
354
  /**
368
355
  * check whether a given XMLQuery node is an explicit viewstate node
369
356
  *
370
357
  * @param node the node to check
371
358
  * @returns true of it ii
372
359
  */
373
- ResponseProcessor.isViewStateNode = function (node) {
360
+ static isViewStateNode(node) {
374
361
  var _a, _b, _c, _d, _e, _f, _g;
375
- var separatorChar = ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf).separatorchar;
362
+ let separatorChar = ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf).separatorchar;
376
363
  return "undefined" != typeof ((_b = node === null || node === void 0 ? void 0 : node.id) === null || _b === void 0 ? void 0 : _b.value) && (((_c = node === null || node === void 0 ? void 0 : node.id) === null || _c === void 0 ? void 0 : _c.value) == (0, Const_1.$nsp)(Const_1.P_VIEWSTATE) ||
377
364
  ((_e = (_d = node === null || node === void 0 ? void 0 : node.id) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.indexOf([separatorChar, (0, Const_1.$nsp)(Const_1.P_VIEWSTATE)].join(Const_1.EMPTY_STR))) != -1 ||
378
365
  ((_g = (_f = node === null || node === void 0 ? void 0 : node.id) === null || _f === void 0 ? void 0 : _f.value) === null || _g === void 0 ? void 0 : _g.indexOf([(0, Const_1.$nsp)(Const_1.P_VIEWSTATE), separatorChar].join(Const_1.EMPTY_STR))) != -1);
379
- };
366
+ }
380
367
  /**
381
368
  * incoming client window node also needs special processing
382
369
  *
383
370
  * @param node the node to check
384
371
  * @returns true of it ii
385
372
  */
386
- ResponseProcessor.isClientWindowNode = function (node) {
373
+ static isClientWindowNode(node) {
387
374
  var _a, _b, _c, _d, _e, _f, _g;
388
- var separatorChar = ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf).separatorchar;
375
+ let separatorChar = ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf).separatorchar;
389
376
  return "undefined" != typeof ((_b = node === null || node === void 0 ? void 0 : node.id) === null || _b === void 0 ? void 0 : _b.value) && (((_c = node === null || node === void 0 ? void 0 : node.id) === null || _c === void 0 ? void 0 : _c.value) == (0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW) ||
390
377
  ((_e = (_d = node === null || node === void 0 ? void 0 : node.id) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.indexOf([separatorChar, (0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW)].join(Const_1.EMPTY_STR))) != -1 ||
391
378
  ((_g = (_f = node === null || node === void 0 ? void 0 : node.id) === null || _f === void 0 ? void 0 : _f.value) === null || _g === void 0 ? void 0 : _g.indexOf([(0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW), separatorChar].join(Const_1.EMPTY_STR))) != -1);
392
- };
393
- ResponseProcessor.prototype.triggerOnError = function (errorData) {
379
+ }
380
+ triggerOnError(errorData) {
394
381
  this.externalContext.getIf(Const_1.ON_ERROR).orElse(this.internalContext.getIf(Const_1.ON_ERROR).value).orElse(Const_1.EMPTY_FUNC).value(errorData);
395
- };
396
- return ResponseProcessor;
397
- }());
382
+ }
383
+ }
398
384
  exports.ResponseProcessor = ResponseProcessor;
399
385
  //# sourceMappingURL=ResponseProcessor.js.map