jsf.js_next_gen 1.0.0-beta-17 → 1.0.0-beta-19

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 (86) hide show
  1. package/dist/docs/assets/search.js +1 -1
  2. package/dist/docs/functions/myfaces.ab.html +1 -0
  3. package/dist/docs/modules/myfaces.html +5 -0
  4. package/dist/docs/variables/myfaces.oam.html +50 -0
  5. package/dist/window/jsf-development.js +500 -205
  6. package/dist/window/jsf-development.js.map +1 -1
  7. package/dist/window/jsf.js +2 -2
  8. package/dist/window/jsf.js.br +0 -0
  9. package/dist/window/jsf.js.gz +0 -0
  10. package/dist/window/jsf.js.map +1 -1
  11. package/package.json +1 -1
  12. package/remap.js +1 -1
  13. package/remap.js.map +1 -1
  14. package/remap.ts +1 -1
  15. package/src/main/typescript/api/Jsf.ts +8 -10
  16. package/src/main/typescript/impl/AjaxImpl.ts +85 -49
  17. package/src/main/typescript/impl/PushImpl.ts +16 -0
  18. package/src/main/typescript/impl/util/Assertions.ts +15 -0
  19. package/src/main/typescript/impl/util/AsyncQueue.ts +45 -17
  20. package/src/main/typescript/impl/util/AsyncRunnable.ts +5 -3
  21. package/src/main/typescript/impl/util/ExtDomQuery.ts +23 -8
  22. package/src/main/typescript/impl/util/IListener.ts +18 -0
  23. package/src/main/typescript/impl/xhrCore/ErrorData.ts +15 -0
  24. package/src/main/typescript/impl/xhrCore/EventData.ts +17 -2
  25. package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +15 -0
  26. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +3 -3
  27. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +3 -3
  28. package/src/main/typescript/impl/xhrCore/Response.ts +5 -6
  29. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +31 -11
  30. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +86 -90
  31. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +34 -28
  32. package/src/main/typescript/myfaces/OamSubmit.ts +151 -0
  33. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +4 -0
  34. package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +50 -0
  35. package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +15 -0
  36. package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +15 -0
  37. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +15 -0
  38. package/src/main/typescript/test/xhrCore/WebsocketTest.ts +15 -0
  39. package/target/api/Jsf.js +6 -5
  40. package/target/api/Jsf.js.map +1 -1
  41. package/target/impl/AjaxImpl.js +80 -39
  42. package/target/impl/AjaxImpl.js.map +1 -1
  43. package/target/impl/PushImpl.js +17 -2
  44. package/target/impl/PushImpl.js.map +1 -1
  45. package/target/impl/util/Assertions.js +15 -0
  46. package/target/impl/util/Assertions.js.map +1 -1
  47. package/target/impl/util/AsyncQueue.js +28 -15
  48. package/target/impl/util/AsyncQueue.js.map +1 -1
  49. package/target/impl/util/ExtDomQuery.js +22 -7
  50. package/target/impl/util/ExtDomQuery.js.map +1 -1
  51. package/target/impl/util/IListener.js +3 -0
  52. package/target/impl/util/IListener.js.map +1 -0
  53. package/target/impl/xhrCore/ErrorData.js +15 -0
  54. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  55. package/target/impl/xhrCore/EventData.js +17 -2
  56. package/target/impl/xhrCore/EventData.js.map +1 -1
  57. package/target/impl/xhrCore/RequestDataResolver.js +3 -3
  58. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  59. package/target/impl/xhrCore/ResonseDataResolver.js +3 -3
  60. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  61. package/target/impl/xhrCore/Response.js +5 -5
  62. package/target/impl/xhrCore/Response.js.map +1 -1
  63. package/target/impl/xhrCore/ResponseProcessor.js +31 -9
  64. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  65. package/target/impl/xhrCore/XhrFormData.js +86 -88
  66. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  67. package/target/impl/xhrCore/XhrRequest.js +32 -27
  68. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  69. package/target/myfaces/OamSubmit.js +128 -0
  70. package/target/myfaces/OamSubmit.js.map +1 -0
  71. package/target/test/frameworkBase/_ext/shared/StandardInits.js +3 -0
  72. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  73. package/target/test/myfaces/OamSubmit.spec.js +46 -0
  74. package/target/test/myfaces/OamSubmit.spec.js.map +1 -0
  75. package/target/test/xhrCore/FakeWebsocket.js +15 -0
  76. package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
  77. package/target/test/xhrCore/FileUploadTest.spec.js +15 -0
  78. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  79. package/target/test/xhrCore/RequestParamsTest.spec.js +15 -0
  80. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  81. package/target/test/xhrCore/WebsocketTest.js +15 -0
  82. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
  83. package/webpack.config.js +0 -7
  84. package/webpack.config.js.map +1 -1
  85. package/webpack.config.ts +0 -7
  86. package/src/main/typescript/impl/util/ListenerQueue.ts +0 -3
@@ -957,6 +957,7 @@ var DomQuery = /** @class */ (function () {
957
957
  for (var _i = 0; _i < arguments.length; _i++) {
958
958
  nodeSelector[_i] = arguments[_i];
959
959
  }
960
+ debugger;
960
961
  var selectorStage = this.childNodes;
961
962
  for (var cnt = 0; cnt < nodeSelector.length; cnt++) {
962
963
  selectorStage = selectorStage.filterSelector(nodeSelector[cnt]);
@@ -1575,6 +1576,8 @@ var DomQuery = /** @class */ (function () {
1575
1576
  if (files === null || files === void 0 ? void 0 : files.length) {
1576
1577
  //xhr level2
1577
1578
  target.append(name).value = files[0];
1579
+ //TODO we have to know that the entry is a file element, so that we can reuse
1580
+ //this information
1578
1581
  }
1579
1582
  else {
1580
1583
  target.append(name).value = element.inputValue.value;
@@ -3800,6 +3803,7 @@ exports.myfaces = exports.jsf = void 0;
3800
3803
  ///<reference types='../../types/typedefs'/>
3801
3804
  var AjaxImpl_1 = __webpack_require__(/*! ../impl/AjaxImpl */ "./src/main/typescript/impl/AjaxImpl.ts");
3802
3805
  var PushImpl_1 = __webpack_require__(/*! ../impl/PushImpl */ "./src/main/typescript/impl/PushImpl.ts");
3806
+ var OamSubmit_1 = __webpack_require__(/*! ../myfaces/OamSubmit */ "./src/main/typescript/myfaces/OamSubmit.ts");
3803
3807
  //declare const Implementation: any;
3804
3808
  var jsf;
3805
3809
  (function (jsf) {
@@ -3993,12 +3997,8 @@ var jsf;
3993
3997
  }
3994
3998
  push.close = close;
3995
3999
  })(push = jsf.push || (jsf.push = {}));
3996
- //We hook the old namespace system into our npm system
3997
- //if ("undefined" == window.jsf) {
3998
- // window.jsf = jsf;
3999
- //}
4000
4000
  })(jsf = exports.jsf || (exports.jsf = {}));
4001
- //fullfill the window contract
4001
+ //fullfill the window contract for the myfaces namespace
4002
4002
  var myfaces;
4003
4003
  (function (myfaces) {
4004
4004
  /**
@@ -4027,6 +4027,10 @@ var myfaces;
4027
4027
  jsf.ajax.request(source, event, options);
4028
4028
  }
4029
4029
  myfaces.ab = ab;
4030
+ /**
4031
+ * legacy oam functions
4032
+ */
4033
+ myfaces.oam = OamSubmit_1.oam;
4030
4034
  })(myfaces = exports.myfaces || (exports.myfaces = {}));
4031
4035
 
4032
4036
 
@@ -4102,6 +4106,54 @@ var BlockFilter;
4102
4106
  */
4103
4107
  var Implementation;
4104
4108
  (function (Implementation) {
4109
+ /*
4110
+ Small internal explanation, this code is optimized for readability
4111
+ and cuts off a ton of old legacy code.
4112
+ Aka older browsers are not supported anymore.
4113
+ We use a self written helper library to keep the number of exernal
4114
+ code dependencies down.
4115
+ The library is called mona-dish and started as a small sideproject of mine
4116
+ it provides following
4117
+
4118
+ a) Monad like structures for querying because this keeps the code denser and adds abstractions
4119
+ that always was the strong point of jquery and it still is better in this regard than what ecmascript provides
4120
+
4121
+ b) Streams and lazystreams like java has, a pull like construct, ecmascript does not have anything like Lazystreams.
4122
+ Another option would have been rxjs but that would have introduced a code dependency and probably more code. We might
4123
+ move to RXJS if the need arises however. But for now I would rather stick with my small self grown library which works
4124
+ quite well and where I can patch quickly (I have used it in several industrial projects, so it works well
4125
+ and is heavily fortified by unit tests (140 testcases as time of writing this))
4126
+
4127
+ c) A neutral json like configuration which allows assignments of arbitrary values with reduce code which then can be
4128
+ transformed into different data representations
4129
+
4130
+ examples:
4131
+ internalCtx.assign(MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;
4132
+ passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID
4133
+
4134
+ basically an abbreviation for
4135
+
4136
+ internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};
4137
+ internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};
4138
+ internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;
4139
+
4140
+
4141
+ internalCtx.assign(condition, MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;
4142
+ passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID if condition === true otherwise it is ignored
4143
+
4144
+ abbreviates:
4145
+ if(condition) {
4146
+ internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};
4147
+ internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};
4148
+ internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;
4149
+ }
4150
+
4151
+
4152
+ d) Optional constructs, while under heavy debate we only use them lightly where the api requires it from mona-dish
4153
+
4154
+ Note the inclusion of this library uses a reduced build which only includes the part of it, which we really use
4155
+
4156
+ */
4105
4157
  var trim = mona_dish_1.Lang.trim;
4106
4158
  var getMessage = Lang_1.ExtLang.getMessage;
4107
4159
  var getGlobalConfig = Lang_1.ExtLang.getGlobalConfig;
@@ -4171,8 +4223,9 @@ var Implementation;
4171
4223
  funcs[_i - 2] = arguments[_i];
4172
4224
  }
4173
4225
  return mona_dish_1.LazyStream.of.apply(mona_dish_1.LazyStream, funcs).map(function (func) { return resolveAndExecute(source, event, func); })
4174
- // we use the return false == stop as an early stop
4226
+ // we use the return false == stop as an early stop, onElem stops at the first false
4175
4227
  .onElem(function (opResult) { return opResult; })
4228
+ //last ensures we run until the first false is returned
4176
4229
  .last().value;
4177
4230
  }
4178
4231
  Implementation.chain = chain;
@@ -4198,14 +4251,25 @@ var Implementation;
4198
4251
  var _a, _b, _c;
4199
4252
  var _d = (0, RequestDataResolver_1.resolveDefaults)(event, opts, el), resolvedEvent = _d.resolvedEvent, options = _d.options, elem = _d.elem, elementId = _d.elementId, requestCtx = _d.requestCtx, internalCtx = _d.internalCtx, windowId = _d.windowId, isResetValues = _d.isResetValues;
4200
4253
  Assertions_1.Assertions.assertRequestIntegrity(options, elem);
4254
+ /**
4255
+ * fetch the parent form
4256
+ *
4257
+ * note we also add an override possibility here
4258
+ * so that people can use dummy forms and work
4259
+ * with detached objects
4260
+ */
4261
+ var form = (0, RequestDataResolver_1.resolveForm)(requestCtx, elem, resolvedEvent);
4262
+ var formId = form.id.value;
4263
+ var delay = (0, RequestDataResolver_1.resolveDelay)(options);
4264
+ var timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
4201
4265
  requestCtx.assignIf(!!windowId, Const_1.P_WINDOW_ID).value = windowId;
4202
4266
  requestCtx.assign(Const_1.CTX_PARAM_PASS_THR).value = filterPassthroughValues(options.value);
4203
4267
  requestCtx.assignIf(!!resolvedEvent, Const_1.CTX_PARAM_PASS_THR, Const_1.P_EVT).value = resolvedEvent === null || resolvedEvent === void 0 ? void 0 : resolvedEvent.type;
4204
4268
  /**
4205
4269
  * ajax pass through context with the source
4206
- * onresolvedEvent and onerror
4270
+ * onresolved Event and onerror Event
4207
4271
  */
4208
- requestCtx.assign(Const_1.SOURCE).value = elementId.value;
4272
+ requestCtx.assign(Const_1.SOURCE).value = elementId;
4209
4273
  /**
4210
4274
  * on resolvedEvent and onError...
4211
4275
  * those values will be traversed later on
@@ -4217,26 +4281,14 @@ var Implementation;
4217
4281
  * lets drag the myfaces config params also in
4218
4282
  */
4219
4283
  requestCtx.assign(Const_1.MYFACES).value = (_c = options.value) === null || _c === void 0 ? void 0 : _c.myfaces;
4220
- /**
4221
- * fetch the parent form
4222
- *
4223
- * note we also add an override possibility here
4224
- * so that people can use dummy forms and work
4225
- * with detached objects
4226
- */
4227
- var form = (0, RequestDataResolver_1.resolveForm)(requestCtx, elem, resolvedEvent);
4228
4284
  /**
4229
4285
  * binding contract the javax.faces.source must be set
4230
4286
  */
4231
- requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_PARTIAL_SOURCE).value = elementId.value;
4287
+ requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_PARTIAL_SOURCE).value = elementId;
4232
4288
  /**
4233
4289
  * javax.faces.partial.ajax must be set to true
4234
4290
  */
4235
4291
  requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_AJAX).value = true;
4236
- /**
4237
- * binding contract the javax.faces.source must be set
4238
- */
4239
- requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_PARTIAL_SOURCE).value = elementId.value;
4240
4292
  /**
4241
4293
  * if resetValues is set to true
4242
4294
  * then we have to set javax.faces.resetValues as well
@@ -4245,22 +4297,20 @@ var Implementation;
4245
4297
  * the specs jsdoc
4246
4298
  */
4247
4299
  requestCtx.assignIf(isResetValues, Const_1.CTX_PARAM_PASS_THR, Const_1.P_RESET_VALUES).value = true;
4248
- //additional meta information to speed things up, note internal non jsf
4249
- //pass through options are stored under _mfInternal in the context
4250
- internalCtx.assign(Const_1.CTX_PARAM_SRC_FRM_ID).value = form.id.value;
4251
- internalCtx.assign(Const_1.CTX_PARAM_SRC_CTL_ID).value = elementId.value;
4300
+ // additional meta information to speed things up, note internal non jsf
4301
+ // pass through options are stored under _mfInternal in the context
4302
+ internalCtx.assign(Const_1.CTX_PARAM_SRC_FRM_ID).value = formId;
4303
+ // mojarra compatibility, mojarra is sending the form id as well
4304
+ // this is not documented behavior but can be determined by running
4305
+ // mojarra under blackbox conditions.
4306
+ // I assume it does the same as our formId_submit=1 so leaving it out
4307
+ // won't hurt but for the sake of compatibility we are going to add it
4308
+ requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, formId).value = formId;
4309
+ internalCtx.assign(Const_1.CTX_PARAM_SRC_CTL_ID).value = elementId;
4252
4310
  internalCtx.assign(Const_1.CTX_PARAM_TR_TYPE).value = Const_1.REQ_TYPE_POST;
4253
- //mojarra compatibility, mojarra is sending the form id as well
4254
- //this is not documented behavior but can be determined by running
4255
- //mojarra under blackbox conditions
4256
- //i assume it does the same as our formId_submit=1 so leaving it out
4257
- //wont hurt but for the sake of compatibility we are going to add it
4258
- requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, form.id.value).value = form.id.value;
4259
4311
  assignClientWindowId(form, requestCtx);
4260
- assignExecute(options, requestCtx, form, elementId.value);
4261
- assignRender(options, requestCtx, form, elementId.value);
4262
- var delay = (0, RequestDataResolver_1.resolveDelay)(options);
4263
- var timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
4312
+ assignExecute(options, requestCtx, form, elementId);
4313
+ assignRender(options, requestCtx, form, elementId);
4264
4314
  //now we enqueue the request as asynchronous runnable into our request
4265
4315
  //queue and let the queue take over the rest
4266
4316
  Implementation.queueHandler.addRequestToQueue(elem, form, requestCtx, internalCtx, delay, timeout);
@@ -4282,7 +4332,6 @@ var Implementation;
4282
4332
  * @param errorListener the error listener handler
4283
4333
  */
4284
4334
  function addOnError(errorListener) {
4285
- /*error handling already done in the assert of the queue*/
4286
4335
  errorQueue.push(errorListener);
4287
4336
  }
4288
4337
  Implementation.addOnError = addOnError;
@@ -4292,7 +4341,6 @@ var Implementation;
4292
4341
  * @param eventListener the event listener handler
4293
4342
  */
4294
4343
  function addOnEvent(eventListener) {
4295
- /*error handling already done in the assert of the queue*/
4296
4344
  eventQueue.push(eventListener);
4297
4345
  }
4298
4346
  Implementation.addOnEvent = addOnEvent;
@@ -4445,7 +4493,7 @@ var Implementation;
4445
4493
  Implementation.getViewState = getViewState;
4446
4494
  /**
4447
4495
  * this at the first sight looks like a weird construct, but we need to do it this way
4448
- * for testing, we cannot proxy addRequestToQueue from the testing frameworks directly
4496
+ * for testing, we cannot proxy addRequestToQueue from the testing frameworks directly,
4449
4497
  * but we need to keep it under unit tests.
4450
4498
  */
4451
4499
  Implementation.queueHandler = {
@@ -4536,11 +4584,8 @@ var Implementation;
4536
4584
  var iterValues = (userValues) ? trim(userValues).split(/\s+/gi) : [];
4537
4585
  var ret = [];
4538
4586
  var processed = {};
4539
- //the idea is simply to loop over all values and then replace
4540
- //their generic values and filter out doubles
4541
- //this is more readable than the old indexed based solution
4542
- //and not really slower because we had to build up the index in our old solution
4543
- //anyway
4587
+ // in this case we do not use lazy stream because it wont bring any code reduction
4588
+ // or speedup
4544
4589
  for (var cnt = 0; cnt < iterValues.length; cnt++) {
4545
4590
  //avoid doubles
4546
4591
  if (iterValues[cnt] in processed) {
@@ -4608,7 +4653,7 @@ var Implementation;
4608
4653
  }
4609
4654
  else {
4610
4655
  //either a function or a string can be passed in case of a string we have to wrap it into another function
4611
- //it it is not a plain executable code but a definition
4656
+ //it is not a plain executable code but a definition
4612
4657
  var sourceCode = trim(func);
4613
4658
  if (sourceCode.indexOf("function ") == 0) {
4614
4659
  sourceCode = "return ".concat(sourceCode, " (event)");
@@ -4628,11 +4673,26 @@ var Implementation;
4628
4673
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4629
4674
 
4630
4675
 
4631
- /**
4632
- * Typescript port of the jsf.push part in the myfaces implementation
4676
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
4677
+ * contributor license agreements. See the NOTICE file distributed with
4678
+ * this work for additional information regarding copyright ownership.
4679
+ * The ASF licenses this file to you under the Apache License, Version 2.0
4680
+ * (the "License"); you may not use this file except in compliance with
4681
+ * the License. You may obtain a copy of the License at
4682
+ *
4683
+ * http://www.apache.org/licenses/LICENSE-2.0
4684
+ *
4685
+ * Unless required by applicable law or agreed to in writing, software
4686
+ * distributed under the License is distributed on an "AS IS" BASIS,
4687
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4688
+ * See the License for the specific language governing permissions and
4689
+ * limitations under the License.
4633
4690
  */
4634
4691
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4635
4692
  exports.PushImpl = void 0;
4693
+ /**
4694
+ * Typescript port of the jsf.push part in the myfaces implementation
4695
+ */
4636
4696
  //TODO still work in progress
4637
4697
  //this is a 1:1 port for the time being
4638
4698
  var Jsf_1 = __webpack_require__(/*! ../api/Jsf */ "./src/main/typescript/api/Jsf.ts");
@@ -5173,6 +5233,21 @@ exports.Messages = Messages;
5173
5233
 
5174
5234
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5175
5235
  exports.Assertions = void 0;
5236
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
5237
+ * contributor license agreements. See the NOTICE file distributed with
5238
+ * this work for additional information regarding copyright ownership.
5239
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5240
+ * (the "License"); you may not use this file except in compliance with
5241
+ * the License. You may obtain a copy of the License at
5242
+ *
5243
+ * http://www.apache.org/licenses/LICENSE-2.0
5244
+ *
5245
+ * Unless required by applicable law or agreed to in writing, software
5246
+ * distributed under the License is distributed on an "AS IS" BASIS,
5247
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5248
+ * See the License for the specific language governing permissions and
5249
+ * limitations under the License.
5250
+ */
5176
5251
  var mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
5177
5252
  var Lang_1 = __webpack_require__(/*! ./Lang */ "./src/main/typescript/impl/util/Lang.ts");
5178
5253
  var getMessage = Lang_1.ExtLang.getMessage;
@@ -5278,7 +5353,7 @@ exports.AsynchronousQueue = void 0;
5278
5353
  *
5279
5354
  * Every callback must be of async runnable
5280
5355
  * which is sort of an extended promise which has
5281
- * added a decicated cancel and start point
5356
+ * added a dedicated cancel and start point
5282
5357
  *
5283
5358
  * This interface can be used as wrapper contract
5284
5359
  * for normal promises if needed.
@@ -5288,6 +5363,9 @@ var AsynchronousQueue = /** @class */ (function () {
5288
5363
  this.runnableQueue = [];
5289
5364
  }
5290
5365
  Object.defineProperty(AsynchronousQueue.prototype, "isEmpty", {
5366
+ /**
5367
+ * simple is empty accessor, returns true if queue is empty atm
5368
+ */
5291
5369
  get: function () {
5292
5370
  return !this.runnableQueue.length;
5293
5371
  },
@@ -5295,7 +5373,7 @@ var AsynchronousQueue = /** @class */ (function () {
5295
5373
  configurable: true
5296
5374
  });
5297
5375
  /**
5298
- * enequeues an element and starts the
5376
+ * enqueues an element and starts the
5299
5377
  * asynchronous work loop if not already running
5300
5378
  *
5301
5379
  * @param element the element to be queued and processed
@@ -5317,13 +5395,36 @@ var AsynchronousQueue = /** @class */ (function () {
5317
5395
  this.appendElement(element);
5318
5396
  }
5319
5397
  };
5398
+ /**
5399
+ * fetches the next element from the queue (first in first out order)
5400
+ */
5320
5401
  AsynchronousQueue.prototype.dequeue = function () {
5321
5402
  return this.runnableQueue.shift();
5322
5403
  };
5404
+ /**
5405
+ * clears up all elements from the queue
5406
+ */
5323
5407
  AsynchronousQueue.prototype.cleanup = function () {
5324
5408
  this.currentlyRunning = null;
5325
5409
  this.runnableQueue.length = 0;
5326
5410
  };
5411
+ /**
5412
+ * cancels the currently running element and then cleans up the queue
5413
+ * aka cancel the queue entirely
5414
+ */
5415
+ AsynchronousQueue.prototype.cancel = function () {
5416
+ try {
5417
+ if (this.currentlyRunning) {
5418
+ this.currentlyRunning.cancel();
5419
+ }
5420
+ }
5421
+ finally {
5422
+ this.cleanup();
5423
+ }
5424
+ };
5425
+ AsynchronousQueue.prototype.callForNextElementToProcess = function () {
5426
+ this.runEntry();
5427
+ };
5327
5428
  AsynchronousQueue.prototype.appendElement = function (element) {
5328
5429
  //only if the first element is added we start with a trigger
5329
5430
  //otherwise a process already is running and not finished yet at that
@@ -5356,19 +5457,6 @@ var AsynchronousQueue = /** @class */ (function () {
5356
5457
  //(the browser engine will take care of that)
5357
5458
  function () { return _this.callForNextElementToProcess(); }).start();
5358
5459
  };
5359
- AsynchronousQueue.prototype.cancel = function () {
5360
- try {
5361
- if (this.currentlyRunning) {
5362
- this.currentlyRunning.cancel();
5363
- }
5364
- }
5365
- finally {
5366
- this.cleanup();
5367
- }
5368
- };
5369
- AsynchronousQueue.prototype.callForNextElementToProcess = function () {
5370
- this.runEntry();
5371
- };
5372
5460
  return AsynchronousQueue;
5373
5461
  }());
5374
5462
  exports.AsynchronousQueue = AsynchronousQueue;
@@ -5400,6 +5488,21 @@ var __extends = (this && this.__extends) || (function () {
5400
5488
  })();
5401
5489
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5402
5490
  exports.ExtDQ = exports.ExtDomquery = void 0;
5491
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
5492
+ * contributor license agreements. See the NOTICE file distributed with
5493
+ * this work for additional information regarding copyright ownership.
5494
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5495
+ * (the "License"); you may not use this file except in compliance with
5496
+ * the License. You may obtain a copy of the License at
5497
+ *
5498
+ * http://www.apache.org/licenses/LICENSE-2.0
5499
+ *
5500
+ * Unless required by applicable law or agreed to in writing, software
5501
+ * distributed under the License is distributed on an "AS IS" BASIS,
5502
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5503
+ * See the License for the specific language governing permissions and
5504
+ * limitations under the License.
5505
+ */
5403
5506
  var mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
5404
5507
  var Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
5405
5508
  /**
@@ -5411,9 +5514,9 @@ var Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/im
5411
5514
  */
5412
5515
  var IS_JSF_SOURCE = function (source) {
5413
5516
  return source && !!((source === null || source === void 0 ? void 0 : source.search(/\/javax\.faces\.resource.*\/jsf\.js.*/)) != -1 ||
5414
- (source === null || source === void 0 ? void 0 : source.search(/\/jsf\-development\.js.*/)) != -1 ||
5415
- (source === null || source === void 0 ? void 0 : source.search(/\/jsf\-uncompressed\.js.*/)) != -1 ||
5416
- (source === null || source === void 0 ? void 0 : source.search(/\/jsf[^\.]\.js.*ln\=javax.faces.*/gi)) != -1);
5517
+ (source === null || source === void 0 ? void 0 : source.search(/\/jsf-development\.js.*/)) != -1 ||
5518
+ (source === null || source === void 0 ? void 0 : source.search(/\/jsf-uncompressed\.js.*/)) != -1 ||
5519
+ (source === null || source === void 0 ? void 0 : source.search(/\/jsf[^.]*\.js.*ln=javax.faces.*/gi)) != -1);
5417
5520
  };
5418
5521
  /**
5419
5522
  * namespace myfaces.testscripts can be used as extension point for internal
@@ -5424,7 +5527,7 @@ var IS_JSF_SOURCE = function (source) {
5424
5527
  * @constructor
5425
5528
  */
5426
5529
  var IS_INTERNAL_SOURCE = function (source) {
5427
- return source.search(/\/jsf[^\.]\.js.*ln\=myfaces.testscripts.*/gi) != -1;
5530
+ return source.search(/\/jsf[^.]*\.js.*ln=myfaces.testscripts.*/gi) != -1;
5428
5531
  };
5429
5532
  var ATTR_SRC = 'src';
5430
5533
  /**
@@ -5535,7 +5638,7 @@ var ExtDomquery = /** @class */ (function (_super) {
5535
5638
  }).first();
5536
5639
  };
5537
5640
  ExtDomquery.prototype.globalEval = function (code, nonce) {
5538
- return _super.prototype.globalEval.call(this, code, nonce !== null && nonce !== void 0 ? nonce : this.nonce);
5641
+ return new ExtDomquery(_super.prototype.globalEval.call(this, code, nonce !== null && nonce !== void 0 ? nonce : this.nonce));
5539
5642
  };
5540
5643
  /**
5541
5644
  * decorated run scripts which takes our jsf extensions into consideration
@@ -5553,13 +5656,13 @@ var ExtDomquery = /** @class */ (function (_super) {
5553
5656
  * byId producer
5554
5657
  *
5555
5658
  * @param selector id
5659
+ * @param deep whether the search should go into embedded shadow dom elements
5556
5660
  * @return a DomQuery containing the found elements
5557
5661
  */
5558
5662
  ExtDomquery.byId = function (selector, deep) {
5559
5663
  if (deep === void 0) { deep = false; }
5560
5664
  var ret = mona_dish_1.DomQuery.byId(selector, deep);
5561
- //return new ExtDomquery(ret);
5562
- return ret;
5665
+ return new ExtDomquery(ret);
5563
5666
  };
5564
5667
  return ExtDomquery;
5565
5668
  }(mona_dish_1.DQ));
@@ -5817,6 +5920,21 @@ var __extends = (this && this.__extends) || (function () {
5817
5920
  })();
5818
5921
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5819
5922
  exports.ErrorData = exports.ErrorType = void 0;
5923
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
5924
+ * contributor license agreements. See the NOTICE file distributed with
5925
+ * this work for additional information regarding copyright ownership.
5926
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5927
+ * (the "License"); you may not use this file except in compliance with
5928
+ * the License. You may obtain a copy of the License at
5929
+ *
5930
+ * http://www.apache.org/licenses/LICENSE-2.0
5931
+ *
5932
+ * Unless required by applicable law or agreed to in writing, software
5933
+ * distributed under the License is distributed on an "AS IS" BASIS,
5934
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5935
+ * See the License for the specific language governing permissions and
5936
+ * limitations under the License.
5937
+ */
5820
5938
  var Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
5821
5939
  var EventData_1 = __webpack_require__(/*! ./EventData */ "./src/main/typescript/impl/xhrCore/EventData.ts");
5822
5940
  var Lang_1 = __webpack_require__(/*! ../util/Lang */ "./src/main/typescript/impl/util/Lang.ts");
@@ -5902,6 +6020,21 @@ exports.ErrorData = ErrorData;
5902
6020
 
5903
6021
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5904
6022
  exports.EventData = void 0;
6023
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
6024
+ * contributor license agreements. See the NOTICE file distributed with
6025
+ * this work for additional information regarding copyright ownership.
6026
+ * The ASF licenses this file to you under the Apache License, Version 2.0
6027
+ * (the "License"); you may not use this file except in compliance with
6028
+ * the License. You may obtain a copy of the License at
6029
+ *
6030
+ * http://www.apache.org/licenses/LICENSE-2.0
6031
+ *
6032
+ * Unless required by applicable law or agreed to in writing, software
6033
+ * distributed under the License is distributed on an "AS IS" BASIS,
6034
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6035
+ * See the License for the specific language governing permissions and
6036
+ * limitations under the License.
6037
+ */
5905
6038
  var mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
5906
6039
  var Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
5907
6040
  var EventData = /** @class */ (function () {
@@ -5913,8 +6046,8 @@ var EventData = /** @class */ (function () {
5913
6046
  eventData.type = Const_1.EVENT;
5914
6047
  eventData.status = name;
5915
6048
  var sourceId = context.getIf(Const_1.SOURCE)
5916
- .orElse(context.getIf(Const_1.P_PARTIAL_SOURCE).value)
5917
- .orElse(context.getIf(Const_1.CTX_PARAM_PASS_THR, Const_1.P_PARTIAL_SOURCE).value).value;
6049
+ .orElseLazy(function () { return context.getIf(Const_1.P_PARTIAL_SOURCE).value; })
6050
+ .orElseLazy(function () { return context.getIf(Const_1.CTX_PARAM_PASS_THR, Const_1.P_PARTIAL_SOURCE).value; }).value;
5918
6051
  if (sourceId) {
5919
6052
  eventData.source = mona_dish_1.DQ.byId(sourceId, true).first().value.value;
5920
6053
  }
@@ -5976,7 +6109,7 @@ var ExtDomQuery_1 = __webpack_require__(/*! ../util/ExtDomQuery */ "./src/main/t
5976
6109
  */
5977
6110
  function resolveHandlerFunc(requestContext, responseContext, funcName) {
5978
6111
  return responseContext.getIf(funcName)
5979
- .orElse(requestContext.getIf(funcName).value)
6112
+ .orElseLazy(function () { return requestContext.getIf(funcName).value; })
5980
6113
  .orElse(Const_1.EMPTY_FUNC).value;
5981
6114
  }
5982
6115
  exports.resolveHandlerFunc = resolveHandlerFunc;
@@ -6003,7 +6136,7 @@ exports.resolveFinalUrl = resolveFinalUrl;
6003
6136
  */
6004
6137
  function resolveForm(requestCtx, elem, event) {
6005
6138
  var _a, _b, _c;
6006
- var configId = (_c = (_b = (_a = requestCtx.value) === null || _a === void 0 ? void 0 : _a.myfaces) === null || _b === void 0 ? void 0 : _b.form) !== null && _c !== void 0 ? _c : Const_1.MF_NONE; //requestCtx.getIf(MYFACES, "form").orElse(MF_NONE).value;
6139
+ var configId = (_c = (_b = (_a = requestCtx.value) === null || _a === void 0 ? void 0 : _a.myfaces) === null || _b === void 0 ? void 0 : _b.form) !== null && _c !== void 0 ? _c : Const_1.MF_NONE;
6007
6140
  return mona_dish_1.DQ
6008
6141
  .byId(configId, true)
6009
6142
  .orElseLazy(function () { return Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event); });
@@ -6076,7 +6209,7 @@ function resolveDefaults(event, opts, el) {
6076
6209
  if (opts === void 0) { opts = {}; }
6077
6210
  if (el === void 0) { el = null; }
6078
6211
  //deep copy the options, so that further transformations to not backfire into the callers
6079
- var resolvedEvent = event, options = new mona_dish_1.Config(opts).deepCopy, elem = mona_dish_1.DQ.byId(el || resolvedEvent.target, true), elementId = elem.id, requestCtx = new mona_dish_1.Config({}), internalCtx = new mona_dish_1.Config({}), windowId = resolveWindowId(options), isResetValues = true === ((_a = options.value) === null || _a === void 0 ? void 0 : _a.resetValues);
6212
+ var resolvedEvent = event, options = new mona_dish_1.Config(opts).deepCopy, elem = mona_dish_1.DQ.byId(el || resolvedEvent.target, true), elementId = elem.id.value, requestCtx = new mona_dish_1.Config({}), internalCtx = new mona_dish_1.Config({}), windowId = resolveWindowId(options), isResetValues = true === ((_a = options.value) === null || _a === void 0 ? void 0 : _a.resetValues);
6080
6213
  return { resolvedEvent: resolvedEvent, options: options, elem: elem, elementId: elementId, requestCtx: requestCtx, internalCtx: internalCtx, windowId: windowId, isResetValues: isResetValues };
6081
6214
  }
6082
6215
  exports.resolveDefaults = resolveDefaults;
@@ -6181,9 +6314,9 @@ exports.resolveSourceElement = resolveSourceElement;
6181
6314
  function resolveSourceForm(internalContext, elem) {
6182
6315
  var sourceFormId = internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID);
6183
6316
  var sourceForm = new mona_dish_2.DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);
6184
- sourceForm = sourceForm.orElse(elem.parents(Const_1.TAG_FORM))
6185
- .orElse(elem.querySelectorAll(Const_1.TAG_FORM))
6186
- .orElse(mona_dish_2.DQ.querySelectorAll(Const_1.TAG_FORM));
6317
+ sourceForm = sourceForm.orElseLazy(function () { return elem.parents(Const_1.TAG_FORM); })
6318
+ .orElseLazy(function () { return elem.querySelectorAll(Const_1.TAG_FORM); })
6319
+ .orElseLazy(function () { return mona_dish_2.DQ.querySelectorAll(Const_1.TAG_FORM); });
6187
6320
  return sourceForm;
6188
6321
  }
6189
6322
  exports.resolveSourceForm = resolveSourceForm;
@@ -6234,7 +6367,7 @@ var Response;
6234
6367
  * and processing its tags
6235
6368
  *
6236
6369
  * @param {XMLHttpRequest} request (xhrRequest) - xhr request object
6237
- * @param ASSOC_ARR<any> context (Map) - AJAX context
6370
+ * @param context {Context} context (Map) - AJAX context
6238
6371
  *
6239
6372
  */
6240
6373
  function processResponse(request, context) {
@@ -6265,7 +6398,7 @@ var Response;
6265
6398
  internalContext.assign(Const_1.PARTIAL_ID).value = node.id;
6266
6399
  var SEL_SUB_TAGS = [Const_1.CMD_ERROR, Const_1.CMD_REDIRECT, Const_1.CMD_CHANGES].join(",");
6267
6400
  //now we can process the main operations
6268
- node.getIf(SEL_SUB_TAGS).each(function (node) {
6401
+ node.querySelectorAll(SEL_SUB_TAGS).each(function (node) {
6269
6402
  switch (node.tagName.value) {
6270
6403
  case Const_1.CMD_ERROR:
6271
6404
  responseProcessor.error(node);
@@ -6295,8 +6428,8 @@ var Response;
6295
6428
  * @param responseProcessor
6296
6429
  */
6297
6430
  function processChangesTag(node, responseProcessor) {
6298
- 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(",");
6299
- node.getIf(ALLOWED_TAGS).each(function (node) {
6431
+ 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(", ");
6432
+ node.querySelectorAll(ALLOWED_TAGS).each(function (node) {
6300
6433
  switch (node.tagName.value) {
6301
6434
  case Const_1.CMD_UPDATE:
6302
6435
  processUpdateTag(node, responseProcessor);
@@ -6331,7 +6464,7 @@ var Response;
6331
6464
  return responseProcessor.processViewState(node) || responseProcessor.processClientWindow(node);
6332
6465
  }
6333
6466
  /**
6334
- * branch tag update.. drill further down into the updates
6467
+ * branch tag update. drill further down into the updates
6335
6468
  * special case viewstate in that case it is a leaf
6336
6469
  * and the viewstate must be processed
6337
6470
  *
@@ -6433,6 +6566,11 @@ var ResponseProcessor = /** @class */ (function () {
6433
6566
  this.externalContext = externalContext;
6434
6567
  this.internalContext = internalContext;
6435
6568
  }
6569
+ /**
6570
+ * head replacement
6571
+ * @param shadowDocument incoming shadow head data (aka cdata as xml reference or dom element)
6572
+ * the data incoming must represent the html representation of the head itself one way or the other
6573
+ */
6436
6574
  ResponseProcessor.prototype.replaceHead = function (shadowDocument) {
6437
6575
  var shadowHead = shadowDocument.querySelectorAll(Const_1.TAG_HEAD);
6438
6576
  if (!shadowHead.isPresent()) {
@@ -6441,6 +6579,9 @@ var ResponseProcessor = /** @class */ (function () {
6441
6579
  var oldHead = mona_dish_1.DQ.querySelectorAll(Const_1.TAG_HEAD);
6442
6580
  //delete all to avoid script and style overlays
6443
6581
  oldHead.querySelectorAll(Const_1.SEL_SCRIPTS_STYLES).delete();
6582
+ // we cannot replace new elements in the head, but we can eval the elements
6583
+ // eval means the scripts will get attached (eval script attach method)
6584
+ // but this is done by DomQuery not in this code
6444
6585
  this.storeForEval(shadowHead);
6445
6586
  };
6446
6587
  /**
@@ -6459,6 +6600,8 @@ var ResponseProcessor = /** @class */ (function () {
6459
6600
  var shadowInnerHTML = shadowBody.html().value;
6460
6601
  var resultingBody = mona_dish_1.DQ.querySelectorAll(Const_1.TAG_BODY).html(shadowInnerHTML);
6461
6602
  var updateForms = resultingBody.querySelectorAll(Const_1.TAG_FORM);
6603
+ // main difference, we cannot replace the body itself, but only its content
6604
+ // we need a separate step for post processing the incoming attributes, like classes, styles etc...
6462
6605
  resultingBody.copyAttrs(shadowBody);
6463
6606
  this.storeForPostProcessing(updateForms, resultingBody);
6464
6607
  };
@@ -6498,9 +6641,6 @@ var ResponseProcessor = /** @class */ (function () {
6498
6641
  this.triggerOnError(errorData);
6499
6642
  AjaxImpl_1.Implementation.sendError(errorData);
6500
6643
  };
6501
- ResponseProcessor.prototype.triggerOnError = function (errorData) {
6502
- this.externalContext.getIf(Const_1.ON_ERROR).orElse(this.internalContext.getIf(Const_1.ON_ERROR).value).orElse(Const_1.EMPTY_FUNC).value(errorData);
6503
- };
6504
6644
  /**
6505
6645
  * process the redirect operation
6506
6646
  *
@@ -6520,11 +6660,15 @@ var ResponseProcessor = /** @class */ (function () {
6520
6660
  */
6521
6661
  ResponseProcessor.prototype.update = function (node, cdataBlock) {
6522
6662
  var result = ExtDomQuery_1.ExtDomquery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
6523
- var sourceForm = result === null || result === void 0 ? void 0 : result.parents(Const_1.TAG_FORM).orElse(result.byTagName(Const_1.TAG_FORM, true));
6663
+ 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); });
6524
6664
  if (sourceForm) {
6525
6665
  this.storeForPostProcessing(sourceForm, result);
6526
6666
  }
6527
6667
  };
6668
+ /**
6669
+ * Delete handler, simply deleetes the node referenced by the xml data
6670
+ * @param node
6671
+ */
6528
6672
  ResponseProcessor.prototype.delete = function (node) {
6529
6673
  mona_dish_1.DQ.byId(node.id.value, true).delete();
6530
6674
  };
@@ -6547,7 +6691,7 @@ var ResponseProcessor = /** @class */ (function () {
6547
6691
  this.replaceBody(shadowDocument);
6548
6692
  };
6549
6693
  /**
6550
- * insert handling, either before or after
6694
+ * Insert handling, either before or after
6551
6695
  *
6552
6696
  * @param node
6553
6697
  */
@@ -6567,7 +6711,7 @@ var ResponseProcessor = /** @class */ (function () {
6567
6711
  }
6568
6712
  };
6569
6713
  /**
6570
- * handler for the case &lt;insert <&lt; before id="...
6714
+ * Handler for the case &lt;insert <&lt; before id="...
6571
6715
  *
6572
6716
  * @param node the node hosting the insert data
6573
6717
  */
@@ -6593,7 +6737,7 @@ var ResponseProcessor = /** @class */ (function () {
6593
6737
  });
6594
6738
  };
6595
6739
  /**
6596
- * process the viewState update, update the affected
6740
+ * Process the viewState update, update the affected
6597
6741
  * forms with their respective new viewstate values
6598
6742
  *
6599
6743
  */
@@ -6621,7 +6765,10 @@ var ResponseProcessor = /** @class */ (function () {
6621
6765
  updateElems.runScripts();
6622
6766
  };
6623
6767
  /**
6624
- * post processing viewstate fixing
6768
+ * Postprocessing view state fixing
6769
+ * this appends basically the incoming view states to the forms.
6770
+ * It is called from outside after all forms have been processed basically
6771
+ * as last lifecycle step, before going into the next request.
6625
6772
  */
6626
6773
  ResponseProcessor.prototype.fixViewStates = function () {
6627
6774
  var _this = this;
@@ -6634,6 +6781,10 @@ var ResponseProcessor = /** @class */ (function () {
6634
6781
  _this.appendViewStateToForms(new mona_dish_1.DomQuery(affectedForms, affectedForms2), value.value);
6635
6782
  });
6636
6783
  };
6784
+ /**
6785
+ * same as with view states before applies the incoming client windows as last step after the rest of the processing
6786
+ * is done.
6787
+ */
6637
6788
  ResponseProcessor.prototype.fixClientWindow = function () {
6638
6789
  var _this = this;
6639
6790
  mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
@@ -6649,9 +6800,10 @@ var ResponseProcessor = /** @class */ (function () {
6649
6800
  * all processing done we can close the request and send the appropriate events
6650
6801
  */
6651
6802
  ResponseProcessor.prototype.done = function () {
6803
+ var _this = this;
6652
6804
  var eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);
6653
6805
  //because some frameworks might decorate them over the context in the response
6654
- var eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElse(this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;
6806
+ 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;
6655
6807
  AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);
6656
6808
  };
6657
6809
  /**
@@ -6751,6 +6903,9 @@ var ResponseProcessor = /** @class */ (function () {
6751
6903
  ((_d = (_c = node === null || node === void 0 ? void 0 : node.id) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.indexOf([separatorChar, Const_1.P_CLIENT_WINDOW].join(Const_1.EMPTY_STR))) != -1 ||
6752
6904
  ((_f = (_e = node === null || node === void 0 ? void 0 : node.id) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.indexOf([Const_1.P_CLIENT_WINDOW, separatorChar].join(Const_1.EMPTY_STR))) != -1);
6753
6905
  };
6906
+ ResponseProcessor.prototype.triggerOnError = function (errorData) {
6907
+ this.externalContext.getIf(Const_1.ON_ERROR).orElse(this.internalContext.getIf(Const_1.ON_ERROR).value).orElse(Const_1.EMPTY_FUNC).value(errorData);
6908
+ };
6754
6909
  return ResponseProcessor;
6755
6910
  }());
6756
6911
  exports.ResponseProcessor = ResponseProcessor;
@@ -6807,9 +6962,8 @@ exports.XhrFormData = void 0;
6807
6962
  * limitations under the License.
6808
6963
  */
6809
6964
  var mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
6810
- var mona_dish_2 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
6811
- var isString = mona_dish_1.Lang.isString;
6812
6965
  var Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
6966
+ var isString = mona_dish_1.Lang.isString;
6813
6967
  /**
6814
6968
  * A unified form data class
6815
6969
  * which builds upon our configuration.
@@ -6818,10 +6972,9 @@ var Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/im
6818
6972
  * due to api constraints on the HTML Form object in IE11
6819
6973
  * and due to the url encoding constraint given by the jsf.js spec
6820
6974
  *
6821
- * TODO not ideal. too many encoding calls
6822
6975
  * probably only one needed and one overlay!
6823
- * the entire fileinput storing probably is redundant now
6824
- * that domquery has been fixed
6976
+ * the entire file input storing probably is redundant now
6977
+ * that dom query has been fixed //TODO check this
6825
6978
  */
6826
6979
  var XhrFormData = /** @class */ (function (_super) {
6827
6980
  __extends(XhrFormData, _super);
@@ -6829,101 +6982,93 @@ var XhrFormData = /** @class */ (function (_super) {
6829
6982
  * data collector from a given form
6830
6983
  *
6831
6984
  * @param dataSource either a form as DomQuery object or an encoded url string
6832
- * @param partialIdsArray partial ids to collect, to reduce the data sent down
6985
+ * @param viewState the form view state or an external viewstate coming in as string
6986
+ * @param executes the executes id list for the elements to being processed
6987
+ * @param partialIds partial ids to collect, to reduce the data sent down
6833
6988
  */
6834
- function XhrFormData(dataSource, partialIdsArray) {
6989
+ function XhrFormData(dataSource, viewState, executes, partialIds) {
6835
6990
  var _this = _super.call(this, {}) || this;
6836
6991
  _this.dataSource = dataSource;
6837
- _this.partialIdsArray = partialIdsArray;
6838
- _this.fileInputs = {};
6992
+ _this.partialIds = partialIds;
6993
+ /**
6994
+ * Checks if the given datasource is a multipart request source
6995
+ * multipart is only needed if one of the executes is a file input
6996
+ * since file inputs are stateless, they fall out of the view state
6997
+ * and need special handling. With file submits we have to send a formData object
6998
+ * instead of an encoded string files cannot be sent that way
6999
+ */
7000
+ _this.isMultipartRequest = false;
6839
7001
  //a call to getViewState before must pass the encoded line
6840
- //a call from getViewState passes the form element as datasource
7002
+ //a call from getViewState passes the form element as datasource,
6841
7003
  //so we have two call points
6842
7004
  if (isString(dataSource)) {
6843
7005
  _this.assignEncodedString(_this.dataSource);
6844
7006
  }
6845
7007
  else {
6846
- _this.handleFormSource();
7008
+ _this.applyFormDataToConfig();
7009
+ }
7010
+ if ('undefined' != typeof viewState) {
7011
+ _this.assignEncodedString(viewState);
7012
+ }
7013
+ if (executes) {
7014
+ _this.postInit.apply(_this, executes);
6847
7015
  }
6848
7016
  return _this;
6849
7017
  }
6850
7018
  /**
6851
- * generic application of ids
7019
+ * generic post init code, for now, this peforms some post assign data post processing
6852
7020
  * @param executes
6853
7021
  */
6854
- XhrFormData.prototype.applyFileInputs = function () {
7022
+ XhrFormData.prototype.postInit = function () {
6855
7023
  var _this = this;
6856
7024
  var executes = [];
6857
7025
  for (var _i = 0; _i < arguments.length; _i++) {
6858
7026
  executes[_i] = arguments[_i];
6859
7027
  }
6860
7028
  var fetchInput = function (id) {
6861
- if (id == "@all") {
6862
- return mona_dish_2.DQ.querySelectorAllDeep("input[type='file']");
7029
+ if (id == Const_1.IDENT_ALL) {
7030
+ return mona_dish_1.DQ.querySelectorAllDeep("input[type='file']");
6863
7031
  }
6864
- else if (id == "@form") {
7032
+ else if (id == Const_1.IDENT_FORM) {
6865
7033
  return _this.dataSource.querySelectorAllDeep("input[type='file']");
6866
7034
  }
6867
7035
  else {
6868
- var element = mona_dish_2.DQ.byId(id, true);
7036
+ var element = mona_dish_1.DQ.byId(id, true);
6869
7037
  return _this.getFileInputs(element);
6870
7038
  }
6871
7039
  };
6872
7040
  var inputExists = function (item) {
6873
7041
  return item.isPresent();
6874
7042
  };
6875
- var applyInput = function (item) {
6876
- _this.fileInputs[_this.resolveSubmitIdentifier(item.getAsElem(0).value)] = true;
6877
- };
6878
- mona_dish_1.LazyStream.of.apply(mona_dish_1.LazyStream, executes).map(fetchInput)
7043
+ this.isMultipartRequest = mona_dish_1.LazyStream.of.apply(mona_dish_1.LazyStream, executes).map(fetchInput)
6879
7044
  .filter(inputExists)
6880
- .each(applyInput);
6881
- };
6882
- XhrFormData.prototype.getFileInputs = function (rootElment) {
6883
- var rootFileInputs = rootElment
6884
- .filter(function (elem) { return elem.matchesSelector("input[type='file']"); });
6885
- var childFileInputs = rootElment
6886
- .querySelectorAll("input[type='file']");
6887
- var ret = rootFileInputs.concat(childFileInputs);
6888
- return ret;
6889
- };
6890
- XhrFormData.prototype.handleFormSource = function () {
6891
- //encode and append the issuing item if not a partial ids array of ids is passed
6892
- /*
6893
- * Spec. 13.3.1
6894
- * Collect and encode input elements.
6895
- * Additionally the hidden element javax.faces.ViewState
6896
- * Enhancement partial page submit
6897
- *
6898
- */
6899
- this.encodeSubmittableFields(this, this.dataSource, this.partialIdsArray);
6900
- if (this.getIf(Const_1.P_VIEWSTATE).isPresent()) {
6901
- return;
6902
- }
6903
- this.applyViewState(this.dataSource);
7045
+ .first().isPresent();
6904
7046
  };
6905
7047
  /**
6906
- * special case viewstate handling
7048
+ * special case view state handling
6907
7049
  *
6908
- * @param form the form holding the viewstate value
7050
+ * @param form the form holding the view state value
6909
7051
  */
6910
7052
  XhrFormData.prototype.applyViewState = function (form) {
6911
7053
  var viewState = form.byId(Const_1.P_VIEWSTATE, true).inputValue;
6912
7054
  this.appendIf(viewState.isPresent(), Const_1.P_VIEWSTATE).value = viewState.value;
6913
7055
  };
6914
7056
  /**
6915
- * assignes a url encoded string to this xhrFormData object
7057
+ * assigns an url encoded string to this xhrFormData object
6916
7058
  * as key value entry
6917
7059
  * @param encoded
6918
7060
  */
6919
7061
  XhrFormData.prototype.assignEncodedString = function (encoded) {
6920
- //TODO reevaluate this method
6921
- //this code filters out empty strings as key value pairs
7062
+ // this code filters out empty strings as key value pairs
6922
7063
  var keyValueEntries = decodeURIComponent(encoded).split(/&/gi)
6923
7064
  .filter(function (item) { return !!(item || '')
6924
7065
  .replace(/\s+/g, ''); });
6925
7066
  this.assignString(keyValueEntries);
6926
7067
  };
7068
+ /**
7069
+ * assign a set of key value pairs passed as array ['key=val1', 'key2=val2']
7070
+ * @param keyValueEntries
7071
+ */
6927
7072
  XhrFormData.prototype.assignString = function (keyValueEntries) {
6928
7073
  var toMerge = new mona_dish_1.Config({});
6929
7074
  function splitToKeyVal(line) {
@@ -6933,7 +7078,7 @@ var XhrFormData = /** @class */ (function (_super) {
6933
7078
  var _a, _b;
6934
7079
  return keyVal.length < 3 ? [(_a = keyVal === null || keyVal === void 0 ? void 0 : keyVal[0]) !== null && _a !== void 0 ? _a : [], (_b = keyVal === null || keyVal === void 0 ? void 0 : keyVal[1]) !== null && _b !== void 0 ? _b : []] : keyVal;
6935
7080
  }
6936
- mona_dish_2.Stream.of.apply(mona_dish_2.Stream, keyValueEntries).map(function (line) { return splitToKeyVal(line); })
7081
+ mona_dish_1.Stream.of.apply(mona_dish_1.Stream, keyValueEntries).map(function (line) { return splitToKeyVal(line); })
6937
7082
  //special case of having keys without values
6938
7083
  .map(function (keyVal) { return fixKeyWithoutVal(keyVal); })
6939
7084
  .each(function (keyVal) {
@@ -6943,28 +7088,12 @@ var XhrFormData = /** @class */ (function (_super) {
6943
7088
  //merge with overwrite but no append! (aka no double entries are allowed)
6944
7089
  this.shallowMerge(toMerge);
6945
7090
  };
6946
- // noinspection JSUnusedGlobalSymbols
6947
7091
  /**
6948
- * @returns a Form data representation
7092
+ * @returns a Form data representation, this is needed for file submits
6949
7093
  */
6950
7094
  XhrFormData.prototype.toFormData = function () {
6951
- var _this = this;
6952
7095
  var ret = new FormData();
6953
- mona_dish_1.LazyStream.of.apply(mona_dish_1.LazyStream, Object.keys(this.value)).filter(function (key) { return !(key in _this.fileInputs); })
6954
- .each(function (key) {
6955
- mona_dish_2.Stream.of.apply(mona_dish_2.Stream, _this.value[key]).each(function (item) { return ret.append(key, item); });
6956
- });
6957
- mona_dish_2.Stream.of.apply(mona_dish_2.Stream, Object.keys(this.fileInputs)).each(function (key) {
6958
- mona_dish_2.DQ.querySelectorAllDeep("[name='".concat(key, "'], [id=\"").concat(key, "\"]")).eachElem(function (elem) {
6959
- var _a;
6960
- var identifier = _this.resolveSubmitIdentifier(elem);
6961
- if (!((_a = elem === null || elem === void 0 ? void 0 : elem.files) === null || _a === void 0 ? void 0 : _a.length)) {
6962
- ret.append(identifier, elem.value);
6963
- return;
6964
- }
6965
- ret.append(identifier, elem.files[0]);
6966
- });
6967
- });
7096
+ this.appendInputs(ret);
6968
7097
  return ret;
6969
7098
  };
6970
7099
  XhrFormData.prototype.resolveSubmitIdentifier = function (elem) {
@@ -6985,13 +7114,44 @@ var XhrFormData = /** @class */ (function (_super) {
6985
7114
  return defaultStr;
6986
7115
  }
6987
7116
  var entries = mona_dish_1.LazyStream.of.apply(mona_dish_1.LazyStream, Object.keys(this.value)).filter(function (key) { return _this.value.hasOwnProperty(key); })
6988
- .flatMap(function (key) { return mona_dish_2.Stream.of.apply(mona_dish_2.Stream, _this.value[key]).map(function (val) { return [key, val]; }).collect(new mona_dish_1.ArrayCollector()); })
7117
+ .flatMap(function (key) { return mona_dish_1.Stream.of.apply(mona_dish_1.Stream, _this.value[key]).map(function (val) { return [key, val]; }).collect(new mona_dish_1.ArrayCollector()); })
6989
7118
  .map(function (keyVal) {
6990
7119
  return "".concat(encodeURIComponent(keyVal[0]), "=").concat(encodeURIComponent(keyVal[1]));
6991
7120
  })
6992
7121
  .collect(new mona_dish_1.ArrayCollector());
6993
7122
  return entries.join("&");
6994
7123
  };
7124
+ /**
7125
+ * helper to fetch all file inputs from as given root element
7126
+ * @param rootElement
7127
+ * @private
7128
+ */
7129
+ XhrFormData.prototype.getFileInputs = function (rootElement) {
7130
+ var rootFileInputs = rootElement
7131
+ .filter(function (elem) { return elem.matchesSelector("input[type='file']"); });
7132
+ var childFileInputs = rootElement
7133
+ .querySelectorAll("input[type='file']");
7134
+ return rootFileInputs.concat(childFileInputs);
7135
+ };
7136
+ /**
7137
+ * encode the given fields and apply the view state
7138
+ * @private
7139
+ */
7140
+ XhrFormData.prototype.applyFormDataToConfig = function () {
7141
+ //encode and append the issuing item if not a partial ids array of ids is passed
7142
+ /*
7143
+ * Spec. 13.3.1
7144
+ * Collect and encode input elements.
7145
+ * Additionally the hidden element javax.faces.ViewState
7146
+ * Enhancement partial page submit
7147
+ *
7148
+ */
7149
+ this.encodeSubmittableFields(this, this.dataSource, this.partialIds);
7150
+ if (this.getIf(Const_1.P_VIEWSTATE).isPresent()) {
7151
+ return;
7152
+ }
7153
+ this.applyViewState(this.dataSource);
7154
+ };
6995
7155
  /**
6996
7156
  * determines fields to submit
6997
7157
  * @param {Object} targetBuf - the target form buffer receiving the data
@@ -7000,33 +7160,26 @@ var XhrFormData = /** @class */ (function (_super) {
7000
7160
  */
7001
7161
  XhrFormData.prototype.encodeSubmittableFields = function (targetBuf, parentItem, partialIds) {
7002
7162
  var toEncode = null;
7003
- if (this.partialIdsArray && this.partialIdsArray.length) {
7004
- //in case of our myfaces reduced ppr we only
7005
- //only submit the partials
7163
+ if (this.partialIds && this.partialIds.length) {
7164
+ // in case of our myfaces reduced ppr we
7165
+ // only submit the partials
7006
7166
  this._value = {};
7007
- toEncode = new (mona_dish_2.DQ.bind.apply(mona_dish_2.DQ, __spreadArray([void 0], this.partialIdsArray, false)))();
7167
+ toEncode = new (mona_dish_1.DQ.bind.apply(mona_dish_1.DQ, __spreadArray([void 0], this.partialIds, false)))();
7008
7168
  }
7009
7169
  else {
7010
7170
  if (parentItem.isAbsent())
7011
- throw "NO_PARITEM";
7171
+ throw 'NO_PAR_ITEM';
7012
7172
  toEncode = parentItem;
7013
7173
  }
7014
7174
  //lets encode the form elements
7015
7175
  this.shallowMerge(toEncode.deepElements.encodeFormElement());
7016
7176
  };
7017
- Object.defineProperty(XhrFormData.prototype, "isMultipartRequest", {
7018
- /**
7019
- * checks if the given datasource is a multipart request source
7020
- * multipart is only needed if one of the executes is a file input
7021
- * since file inputs are stateless, they fall out of the viewstate
7022
- * and need special handling
7023
- */
7024
- get: function () {
7025
- return !!Object.keys(this.fileInputs).length;
7026
- },
7027
- enumerable: false,
7028
- configurable: true
7029
- });
7177
+ XhrFormData.prototype.appendInputs = function (ret) {
7178
+ var _this = this;
7179
+ mona_dish_1.Stream.of.apply(mona_dish_1.Stream, Object.keys(this.value)).each(function (key) {
7180
+ mona_dish_1.Stream.of.apply(mona_dish_1.Stream, _this.value[key]).each(function (item) { return ret.append(key, item); });
7181
+ });
7182
+ };
7030
7183
  return XhrFormData;
7031
7184
  }(mona_dish_1.Config));
7032
7185
  exports.XhrFormData = XhrFormData;
@@ -7077,6 +7230,7 @@ var XhrRequest = /** @class */ (function () {
7077
7230
  *
7078
7231
  * Optional Parameters
7079
7232
  *
7233
+ * @param internalContext internal context with internal info which is passed through, not used by the user
7080
7234
  * @param partialIdsArray an optional restricting partial ids array for encoding
7081
7235
  * @param timeout optional xhr timeout
7082
7236
  * @param ajaxType optional request type, default "POST"
@@ -7127,17 +7281,21 @@ var XhrRequest = /** @class */ (function () {
7127
7281
  var viewState = jsf.getViewState(formElement);
7128
7282
  //encoded we need to decode
7129
7283
  //We generated a base representation of the current form
7130
- var formData = new XhrFormData_1.XhrFormData(this.sourceForm);
7131
7284
  //in case someone has overloaded the viewstate with addtional decorators we merge
7132
7285
  //that in, there is no way around it, the spec allows it and getViewState
7133
7286
  //must be called, so whatever getViewState delivers has higher priority then
7134
7287
  //whatever the formData object delivers
7135
- formData.assignEncodedString(viewState);
7136
- formData.applyFileInputs.apply(formData, executesArr());
7288
+ //the partialIdsArray arr is almost deprecated legacy code where we allowed to send a separate list of partial
7289
+ //ids for reduced load and server processing, this will be removed soon, we can handle the same via execute
7290
+ //anyway TODO remove the partial ids array
7291
+ var formData = new XhrFormData_1.XhrFormData(this.sourceForm, viewState, executesArr(), this.partialIdsArray);
7137
7292
  this.contentType = formData.isMultipartRequest ? "undefined" : this.contentType;
7138
7293
  //next step the pass through parameters are merged in for post params
7139
7294
  var requestContext = this.requestContext;
7140
7295
  var passThroughParams = requestContext.getIf(Const_1.CTX_PARAM_PASS_THR);
7296
+ // this is an extension where we allow pass through parameters to be sent down additionally
7297
+ // this can be used and is used in the impl to enrich the post request parameters with additional
7298
+ // information
7141
7299
  formData.shallowMerge(passThroughParams, true, true);
7142
7300
  this.responseContext = passThroughParams.deepCopy;
7143
7301
  //we have to shift the internal passthroughs around to build up our response context
@@ -7158,7 +7316,7 @@ var XhrRequest = /** @class */ (function () {
7158
7316
  ignoreErr(function () { return xhrObject.setRequestHeader(Const_1.HEAD_FACES_REQ, Const_1.VAL_AJAX); });
7159
7317
  //probably not needed anymore, will test this
7160
7318
  //some webkit based mobile browsers do not follow the w3c spec of
7161
- // setting the accept headers automatically
7319
+ // setting, they accept headers automatically
7162
7320
  ignoreErr(function () { return xhrObject.setRequestHeader(Const_1.REQ_ACCEPT, Const_1.STD_ACCEPT); });
7163
7321
  this.sendEvent(Const_1.BEGIN);
7164
7322
  this.sendRequest(formData);
@@ -7215,19 +7373,19 @@ var XhrRequest = /** @class */ (function () {
7215
7373
  var _this = this;
7216
7374
  var xhrObject = this.xhrObject;
7217
7375
  xhrObject.onabort = function () {
7218
- _this.onAbort(resolve, reject);
7376
+ _this.onAbort(reject);
7219
7377
  };
7220
7378
  xhrObject.ontimeout = function () {
7221
- _this.onTimeout(resolve, reject);
7379
+ _this.onTimeout(reject);
7222
7380
  };
7223
7381
  xhrObject.onload = function () {
7224
- _this.onSuccess(_this.xhrObject, resolve, reject);
7382
+ _this.onSuccess(resolve);
7225
7383
  };
7226
7384
  xhrObject.onloadend = function () {
7227
- _this.onDone(_this.xhrObject, resolve, reject);
7385
+ _this.onDone(_this.xhrObject, resolve);
7228
7386
  };
7229
7387
  xhrObject.onerror = function (errorData) {
7230
- _this.onError(errorData, resolve, reject);
7388
+ _this.onError(errorData, reject);
7231
7389
  };
7232
7390
  };
7233
7391
  /*
@@ -7236,24 +7394,24 @@ var XhrRequest = /** @class */ (function () {
7236
7394
  * Those methods are the callbacks called by
7237
7395
  * the xhr object depending on its own state
7238
7396
  */
7239
- XhrRequest.prototype.onAbort = function (resolve, reject) {
7397
+ XhrRequest.prototype.onAbort = function (reject) {
7240
7398
  reject();
7241
7399
  };
7242
- XhrRequest.prototype.onTimeout = function (resolve, reject) {
7400
+ XhrRequest.prototype.onTimeout = function (reject) {
7243
7401
  this.sendEvent(Const_1.STATE_EVT_TIMEOUT);
7244
7402
  reject();
7245
7403
  };
7246
- XhrRequest.prototype.onSuccess = function (data, resolve, reject) {
7404
+ XhrRequest.prototype.onSuccess = function (resolve) {
7247
7405
  var _a, _b;
7248
7406
  this.sendEvent(Const_1.COMPLETE);
7249
7407
  //malforms always result in empty response xml
7250
7408
  if (!((_a = this === null || this === void 0 ? void 0 : this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseXML)) {
7251
- this.handleMalFormedXML(resolve, reject);
7409
+ this.handleMalFormedXML(resolve);
7252
7410
  return;
7253
7411
  }
7254
7412
  jsf.ajax.response(this.xhrObject, (_b = this.responseContext.value) !== null && _b !== void 0 ? _b : {});
7255
7413
  };
7256
- XhrRequest.prototype.handleMalFormedXML = function (resolve, reject) {
7414
+ XhrRequest.prototype.handleMalFormedXML = function (resolve) {
7257
7415
  var _a;
7258
7416
  this.stopProgress = true;
7259
7417
  var errorData = {
@@ -7275,16 +7433,27 @@ var XhrRequest = /** @class */ (function () {
7275
7433
  }
7276
7434
  //non blocking non clearing
7277
7435
  };
7278
- XhrRequest.prototype.onDone = function (data, resolve, reject) {
7436
+ XhrRequest.prototype.onDone = function (data, resolve) {
7279
7437
  if (this.stopProgress) {
7280
7438
  return;
7281
7439
  }
7282
7440
  resolve(data);
7283
7441
  };
7284
- XhrRequest.prototype.onError = function (errorData, resolve, reject) {
7442
+ XhrRequest.prototype.onError = function (errorData, reject) {
7285
7443
  this.handleError(errorData);
7286
7444
  reject();
7287
7445
  };
7446
+ XhrRequest.prototype.sendRequest = function (formData) {
7447
+ var isPost = this.ajaxType != Const_1.REQ_TYPE_GET;
7448
+ if (formData.isMultipartRequest) {
7449
+ //in case of a multipart request we send in a formData object as body
7450
+ this.xhrObject.send((isPost) ? formData.toFormData() : null);
7451
+ }
7452
+ else {
7453
+ //in case of a normal request we send it normally
7454
+ this.xhrObject.send((isPost) ? formData.toString() : null);
7455
+ }
7456
+ };
7288
7457
  /*
7289
7458
  * other helpers
7290
7459
  */
@@ -7309,20 +7478,146 @@ var XhrRequest = /** @class */ (function () {
7309
7478
  var eventHandler = (0, RequestDataResolver_1.resolveHandlerFunc)(this.requestContext, this.responseContext, Const_1.ON_ERROR);
7310
7479
  AjaxImpl_1.Implementation.sendError(errorData, eventHandler);
7311
7480
  };
7312
- XhrRequest.prototype.sendRequest = function (formData) {
7313
- var isPost = this.ajaxType != Const_1.REQ_TYPE_GET;
7314
- if (formData.isMultipartRequest) {
7315
- //in case of a multipart request we send in a formData object as body
7316
- this.xhrObject.send((isPost) ? formData.toFormData() : null);
7481
+ return XhrRequest;
7482
+ }());
7483
+ exports.XhrRequest = XhrRequest;
7484
+
7485
+
7486
+ /***/ }),
7487
+
7488
+ /***/ "./src/main/typescript/myfaces/OamSubmit.ts":
7489
+ /*!**************************************************!*\
7490
+ !*** ./src/main/typescript/myfaces/OamSubmit.ts ***!
7491
+ \**************************************************/
7492
+ /***/ ((__unused_webpack_module, exports) => {
7493
+
7494
+
7495
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
7496
+ * contributor license agreements. See the NOTICE file distributed with
7497
+ * this work for additional information regarding copyright ownership.
7498
+ * The ASF licenses this file to you under the Apache License, Version 2.0
7499
+ * (the "License"); you may not use this file except in compliance with
7500
+ * the License. You may obtain a copy of the License at
7501
+ *
7502
+ * http://www.apache.org/licenses/LICENSE-2.0
7503
+ *
7504
+ * Unless required by applicable law or agreed to in writing, software
7505
+ * distributed under the License is distributed on an "AS IS" BASIS,
7506
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7507
+ * See the License for the specific language governing permissions and
7508
+ * limitations under the License.
7509
+ */
7510
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
7511
+ exports.oam = void 0;
7512
+ var oam;
7513
+ (function (oam) {
7514
+ /**
7515
+ * sets a hidden input field
7516
+ * @param formname the formName
7517
+ * @param name the hidden field
7518
+ * @param value the value to be rendered
7519
+ */
7520
+ oam.setHiddenInput = function (formname, name, value) {
7521
+ var form = document.forms[formname];
7522
+ if (typeof form == 'undefined') {
7523
+ form = document.getElementById(formname);
7524
+ }
7525
+ if (typeof form.elements[name] != 'undefined' && (form.elements[name].nodeName == 'INPUT' || form.elements[name].nodeName == 'input')) {
7526
+ form.elements[name].value = value;
7317
7527
  }
7318
7528
  else {
7319
- //in case of a normal request we send it normally
7320
- this.xhrObject.send((isPost) ? formData.toString() : null);
7529
+ var newInput = document.createElement('input');
7530
+ newInput.setAttribute('type', 'hidden');
7531
+ newInput.setAttribute('id', name);
7532
+ newInput.setAttribute('name', name);
7533
+ newInput.setAttribute('value', value);
7534
+ form.appendChild(newInput);
7321
7535
  }
7322
7536
  };
7323
- return XhrRequest;
7324
- }());
7325
- exports.XhrRequest = XhrRequest;
7537
+ /**
7538
+ * clears a hidden input field
7539
+ *
7540
+ * @param formname formName for the input
7541
+ * @param name the name of the input field
7542
+ */
7543
+ oam.clearHiddenInput = function (formname, name) {
7544
+ var form = document.forms[formname];
7545
+ if (typeof form == 'undefined') {
7546
+ form = document.getElementById(formname);
7547
+ }
7548
+ var hInput = form.elements[name];
7549
+ if (typeof hInput != 'undefined') {
7550
+ form.removeChild(hInput);
7551
+ }
7552
+ };
7553
+ // noinspection JSUnusedGlobalSymbols
7554
+ /**
7555
+ * does special form submit remapping
7556
+ * remaps the issuing command link into something
7557
+ * the decode of the command link on the server can understand
7558
+ *
7559
+ * @param formName
7560
+ * @param linkId
7561
+ * @param target
7562
+ * @param params
7563
+ */
7564
+ oam.submitForm = function (formName, linkId, target, params) {
7565
+ var _a, _b;
7566
+ var clearFn = 'clearFormHiddenParams_' + formName.replace(/-/g, '\$:').replace(/:/g, '_');
7567
+ if (typeof window[clearFn] == 'function') {
7568
+ window[clearFn](formName);
7569
+ }
7570
+ var form = document.forms[formName];
7571
+ if (typeof form == 'undefined') {
7572
+ form = document.getElementById(formName);
7573
+ }
7574
+ //autoscroll code
7575
+ if (((_b = (_a = window === null || window === void 0 ? void 0 : window.myfaces) === null || _a === void 0 ? void 0 : _a.core) === null || _b === void 0 ? void 0 : _b.config.autoScroll) && typeof (window === null || window === void 0 ? void 0 : window.getScrolling) != 'undefined') {
7576
+ myfaces.oam.setHiddenInput(formName, 'autoScroll', window === null || window === void 0 ? void 0 : window.getScrolling());
7577
+ }
7578
+ var oldTarget = form.target;
7579
+ if (target != null) {
7580
+ form.target = target;
7581
+ }
7582
+ if ((typeof params != 'undefined') && params != null) {
7583
+ for (var i = 0, param = void 0; (param = params[i]); i++) {
7584
+ myfaces.oam.setHiddenInput(formName, param[0], param[1]);
7585
+ }
7586
+ }
7587
+ myfaces.oam.setHiddenInput(formName, formName + ':' + '_idcl', linkId);
7588
+ if (form.onsubmit) {
7589
+ var result = form.onsubmit();
7590
+ if ((typeof result == 'undefined') || result) {
7591
+ try {
7592
+ form.submit();
7593
+ }
7594
+ catch (e) {
7595
+ if (window.console) {
7596
+ console.error(e);
7597
+ }
7598
+ }
7599
+ }
7600
+ }
7601
+ else {
7602
+ try {
7603
+ form.submit();
7604
+ }
7605
+ catch (e) {
7606
+ if (window.console) {
7607
+ console.error(e);
7608
+ }
7609
+ }
7610
+ }
7611
+ form.target = oldTarget;
7612
+ if ((typeof params != 'undefined') && params != null) {
7613
+ for (var i = 0, param = void 0; (param = params[i]); i++) {
7614
+ myfaces.oam.clearHiddenInput(formName, param[0], param[1]);
7615
+ }
7616
+ }
7617
+ myfaces.oam.clearHiddenInput(formName, formName + ':' + '_idcl', linkId);
7618
+ return false;
7619
+ };
7620
+ })(oam = exports.oam || (exports.oam = {}));
7326
7621
 
7327
7622
 
7328
7623
  /***/ })
@@ -7366,4 +7661,4 @@ exports.XhrRequest = XhrRequest;
7366
7661
  /******/ })()
7367
7662
  ;
7368
7663
  //# sourceMappingURL=jsf-development.js.map
7369
- //# sourceMappingURL=jsf-development.js.map.jsf?ln=scripts
7664
+ //# sourceMappingURL=jsf-development.js.map.jsf?ln=javax.faces