jsf.js_next_gen 4.0.0-RC.13 → 4.0.0-RC.14

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 (98) hide show
  1. package/dist/window/faces-development.js +290 -210
  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.LICENSE.txt +0 -2
  7. package/dist/window/faces.js.br +0 -0
  8. package/dist/window/faces.js.gz +0 -0
  9. package/dist/window/faces.js.map +1 -1
  10. package/dist/window/jsf-development.js +290 -210
  11. package/dist/window/jsf-development.js.br +0 -0
  12. package/dist/window/jsf-development.js.gz +0 -0
  13. package/dist/window/jsf-development.js.map +1 -1
  14. package/dist/window/jsf.js +1 -1
  15. package/dist/window/jsf.js.LICENSE.txt +0 -2
  16. package/dist/window/jsf.js.br +0 -0
  17. package/dist/window/jsf.js.gz +0 -0
  18. package/dist/window/jsf.js.map +1 -1
  19. package/package.json +4 -4
  20. package/src/main/typescript/@types/definitions/index.d.ts +2 -0
  21. package/src/main/typescript/api/_api.ts +2 -2
  22. package/src/main/typescript/impl/AjaxImpl.ts +40 -29
  23. package/src/main/typescript/impl/core/Const.ts +41 -38
  24. package/src/main/typescript/impl/core/Context.ts +19 -0
  25. package/src/main/typescript/impl/util/Assertions.ts +2 -2
  26. package/src/main/typescript/impl/util/ExtDomQuery.ts +2 -2
  27. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +63 -0
  28. package/src/main/typescript/impl/util/Lang.ts +8 -10
  29. package/src/main/typescript/impl/xhrCore/EventData.ts +2 -2
  30. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +17 -5
  31. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +4 -4
  32. package/src/main/typescript/impl/xhrCore/Response.ts +25 -25
  33. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +110 -121
  34. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +1 -1
  35. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +8 -7
  36. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +19 -0
  37. package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
  38. package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -3
  39. package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +195 -0
  40. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +2 -0
  41. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +10 -3
  42. package/target/api/_api.js +1 -1
  43. package/target/api/_api.js.map +1 -1
  44. package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
  45. package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
  46. package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
  47. package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
  48. package/target/impl/AjaxImpl.js +34 -23
  49. package/target/impl/AjaxImpl.js.map +1 -1
  50. package/target/impl/core/Const.js +42 -36
  51. package/target/impl/core/Const.js.map +1 -1
  52. package/target/impl/core/Context.js +10 -0
  53. package/target/impl/core/Context.js.map +1 -0
  54. package/target/impl/util/Assertions.js +1 -1
  55. package/target/impl/util/Assertions.js.map +1 -1
  56. package/target/impl/util/ExtDomQuery.js +2 -2
  57. package/target/impl/util/ExtDomQuery.js.map +1 -1
  58. package/target/impl/util/HiddenElementBuilder.js +7 -0
  59. package/target/impl/util/HiddenElementBuilder.js.map +1 -0
  60. package/target/impl/util/HiddenInputBuilder.js +58 -0
  61. package/target/impl/util/HiddenInputBuilder.js.map +1 -0
  62. package/target/impl/util/Lang.js +7 -9
  63. package/target/impl/util/Lang.js.map +1 -1
  64. package/target/impl/xhrCore/EventData.js +1 -1
  65. package/target/impl/xhrCore/EventData.js.map +1 -1
  66. package/target/impl/xhrCore/RequestDataResolver.js +13 -3
  67. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  68. package/target/impl/xhrCore/ResonseDataResolver.js +3 -3
  69. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  70. package/target/impl/xhrCore/Response.js +13 -13
  71. package/target/impl/xhrCore/Response.js.map +1 -1
  72. package/target/impl/xhrCore/ResponseProcessor.js +92 -109
  73. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  74. package/target/impl/xhrCore/XhrFormData.js +1 -1
  75. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  76. package/target/impl/xhrCore/XhrRequest.js +7 -8
  77. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  78. package/target/test/frameworkBase/_ext/shared/StandardInits.js +18 -0
  79. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  80. package/target/test/impl/ImplTest.spec.js +2 -2
  81. package/target/test/impl/ImplTest.spec.js.map +1 -1
  82. package/target/test/impl/ImplTest_23.spec.js +2 -2
  83. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  84. package/target/test/xhrCore/NamespacesRequestTest.spec.js +199 -0
  85. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
  86. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  87. package/target/test/xhrCore/ResponseTest.spec.js +7 -3
  88. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  89. package/target/test-classes/.gz +0 -0
  90. package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
  91. package/target/test-classes/fileuploadtest.html +24 -0
  92. package/target/test-classes/jsf-development.js +3559 -0
  93. package/target/test-classes/jsf-development.js.br +0 -0
  94. package/target/test-classes/jsf-development.js.gz +0 -0
  95. package/target/test-classes/jsf-development.js.map +1 -0
  96. package/target/test-classes/jsf.js +3 -0
  97. package/target/test-classes/jsf.js.br +0 -0
  98. package/target/test-classes/jsf.js.gz +0 -0
@@ -340,6 +340,12 @@ class DomQuery {
340
340
  set val(value) {
341
341
  this.inputValue.value = value;
342
342
  }
343
+ get nodeId() {
344
+ return this.id.value;
345
+ }
346
+ set nodeId(value) {
347
+ this.id.value = value;
348
+ }
343
349
  get checked() {
344
350
  return Stream_1.Stream.of(...this.values).allMatch(el => !!el.checked);
345
351
  }
@@ -4076,7 +4082,7 @@ var myfaces;
4076
4082
  options[(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
4077
4083
  }
4078
4084
  if (execute) {
4079
- options[Const_1.CTX_PARAM_EXECUTE] = execute;
4085
+ options[Const_1.CTX_OPTIONS_EXECUTE] = execute;
4080
4086
  }
4081
4087
  if (render) {
4082
4088
  options[Const_1.CTX_PARAM_RENDER] = render;
@@ -4315,21 +4321,23 @@ var Implementation;
4315
4321
  * with detached objects
4316
4322
  */
4317
4323
  const form = (0, RequestDataResolver_1.resolveForm)(requestCtx, elem, resolvedEvent);
4324
+ const viewId = (0, RequestDataResolver_1.resolveViewId)(form);
4318
4325
  const formId = form.id.value;
4319
4326
  const delay = (0, RequestDataResolver_1.resolveDelay)(options);
4320
4327
  const timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
4321
4328
  requestCtx.assignIf(!!windowId, Const_1.P_WINDOW_ID).value = windowId;
4322
4329
  // old non spec behavior will be removed after it is clear whether the removal breaks any code
4323
- requestCtx.assign(Const_1.CTX_PARAM_PASS_THR).value = filterPassThroughValues(options.value);
4330
+ requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR).value = filterPassThroughValues(options.value);
4324
4331
  // spec conform behavior, all passthrough params must be under "passthrough
4325
- const params = remapArrayToAssocArr(options.getIf(Const_1.CTX_PARAM_SPEC_PARAMS).orElse({}).value);
4326
- requestCtx.getIf(Const_1.CTX_PARAM_PASS_THR).shallowMerge(new mona_dish_1.Config(params), true);
4327
- requestCtx.assignIf(!!resolvedEvent, Const_1.CTX_PARAM_PASS_THR, Const_1.P_EVT).value = resolvedEvent === null || resolvedEvent === void 0 ? void 0 : resolvedEvent.type;
4332
+ const params = remapArrayToAssocArr(options.getIf(Const_1.CTX_OPTIONS_PARAMS).orElse({}).value);
4333
+ requestCtx.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).shallowMerge(new mona_dish_1.Config(params), true);
4334
+ requestCtx.assignIf(!!resolvedEvent, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EVT).value = resolvedEvent === null || resolvedEvent === void 0 ? void 0 : resolvedEvent.type;
4328
4335
  /**
4329
4336
  * ajax pass through context with the source
4330
4337
  * onresolved Event and onerror Event
4331
4338
  */
4332
4339
  requestCtx.assign(Const_1.SOURCE).value = elementId;
4340
+ requestCtx.assign(Const_1.VIEW_ID).value = viewId;
4333
4341
  /**
4334
4342
  * on resolvedEvent and onError...
4335
4343
  * those values will be traversed later on
@@ -4344,11 +4352,11 @@ var Implementation;
4344
4352
  /**
4345
4353
  * binding contract the jakarta.faces.source must be set
4346
4354
  */
4347
- requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_PARTIAL_SOURCE).value = elementId;
4355
+ requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_PARTIAL_SOURCE).value = elementId;
4348
4356
  /**
4349
4357
  * jakarta.faces.partial.ajax must be set to true
4350
4358
  */
4351
- requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_AJAX).value = true;
4359
+ requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX).value = true;
4352
4360
  /**
4353
4361
  * if resetValues is set to true
4354
4362
  * then we have to set jakarta.faces.resetValues as well
@@ -4356,7 +4364,7 @@ var Implementation;
4356
4364
  * the value has to be explicitly true, according to
4357
4365
  * the specs jsdoc
4358
4366
  */
4359
- requestCtx.assignIf(isResetValues, Const_1.CTX_PARAM_PASS_THR, Const_1.P_RESET_VALUES).value = true;
4367
+ requestCtx.assignIf(isResetValues, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_RESET_VALUES).value = true;
4360
4368
  // additional meta information to speed things up, note internal non jsf
4361
4369
  // pass through options are stored under _mfInternal in the context
4362
4370
  internalCtx.assign(Const_1.CTX_PARAM_SRC_FRM_ID).value = formId;
@@ -4365,9 +4373,8 @@ var Implementation;
4365
4373
  // mojarra under blackbox conditions.
4366
4374
  // I assume it does the same as our formId_submit=1 so leaving it out
4367
4375
  // won't hurt but for the sake of compatibility we are going to add it
4368
- requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, formId).value = formId;
4376
+ requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, formId).value = formId;
4369
4377
  internalCtx.assign(Const_1.CTX_PARAM_SRC_CTL_ID).value = elementId;
4370
- internalCtx.assign(Const_1.CTX_PARAM_TR_TYPE).value = Const_1.REQ_TYPE_POST;
4371
4378
  assignClientWindowId(form, requestCtx);
4372
4379
  assignExecute(options, requestCtx, form, elementId);
4373
4380
  assignRender(options, requestCtx, form, elementId);
@@ -4540,7 +4547,7 @@ var Implementation;
4540
4547
  * because it makes it easier to detect bugs
4541
4548
  */
4542
4549
  let element = mona_dish_1.DQ.byId(form, true);
4543
- if (!element.isTag(Const_1.TAG_FORM)) {
4550
+ if (!element.isTag(Const_1.HTML_TAG_FORM)) {
4544
4551
  throw new Error(getMessage("ERR_VIEWSTATE"));
4545
4552
  }
4546
4553
  let formData = new XhrFormData_1.XhrFormData(element);
@@ -4578,7 +4585,7 @@ var Implementation;
4578
4585
  */
4579
4586
  function assignRender(requestOptions, targetContext, issuingForm, sourceElementId) {
4580
4587
  if (requestOptions.getIf(Const_1.CTX_PARAM_RENDER).isPresent()) {
4581
- remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_PASS_THR).get({}), Const_1.P_RENDER, requestOptions.getIf(Const_1.CTX_PARAM_RENDER).value, issuingForm, sourceElementId);
4588
+ remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).get({}), Const_1.P_RENDER, requestOptions.getIf(Const_1.CTX_PARAM_RENDER).value, issuingForm, sourceElementId, targetContext.getIf(Const_1.VIEW_ID).value);
4582
4589
  }
4583
4590
  }
4584
4591
  /**
@@ -4594,16 +4601,16 @@ var Implementation;
4594
4601
  * @param sourceElementId the executing element triggering the faces.ajax.request (id of it)
4595
4602
  */
4596
4603
  function assignExecute(requestOptions, targetContext, issuingForm, sourceElementId) {
4597
- if (requestOptions.getIf(Const_1.CTX_PARAM_EXECUTE).isPresent()) {
4604
+ if (requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).isPresent()) {
4598
4605
  /*the options must be a blank delimited list of strings*/
4599
4606
  /*compliance with Mojarra which automatically adds @this to an execute
4600
4607
  * the spec rev 2.0a however states, if none is issued nothing at all should be sent down
4601
4608
  */
4602
- requestOptions.assign(Const_1.CTX_PARAM_EXECUTE).value = [requestOptions.getIf(Const_1.CTX_PARAM_EXECUTE).value, Const_1.IDENT_THIS].join(" ");
4603
- remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_PASS_THR).get({}), Const_1.P_EXECUTE, requestOptions.getIf(Const_1.CTX_PARAM_EXECUTE).value, issuingForm, sourceElementId);
4609
+ requestOptions.assign(Const_1.CTX_OPTIONS_EXECUTE).value = [requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).value, Const_1.IDENT_THIS].join(" ");
4610
+ remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).get({}), Const_1.P_EXECUTE, requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).value, issuingForm, sourceElementId, targetContext.getIf(Const_1.VIEW_ID).value);
4604
4611
  }
4605
4612
  else {
4606
- targetContext.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_EXECUTE).value = sourceElementId;
4613
+ targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).value = sourceElementId;
4607
4614
  }
4608
4615
  }
4609
4616
  /**
@@ -4613,10 +4620,9 @@ var Implementation;
4613
4620
  * @param targetContext the target context receiving the value
4614
4621
  */
4615
4622
  function assignClientWindowId(form, targetContext) {
4616
- var _a;
4617
- let clientWindow = ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf).getClientWindow(form.getAsElem(0).value);
4623
+ let clientWindow = (0, Const_1.$faces)().getClientWindow(form.getAsElem(0).value);
4618
4624
  if (clientWindow) {
4619
- targetContext.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_CLIENT_WINDOW).value = clientWindow;
4625
+ targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_CLIENT_WINDOW).value = clientWindow;
4620
4626
  }
4621
4627
  }
4622
4628
  /**
@@ -4633,12 +4639,24 @@ var Implementation;
4633
4639
  * @param userValues the passed user values (aka input string which needs to be transformed)
4634
4640
  * @param issuingForm the form where the issuing element originates
4635
4641
  * @param issuingElementId the issuing element
4642
+ * @param viewId the naming container id ("" default if none is given)
4636
4643
  */
4637
- function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId) {
4644
+ function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId, viewId = "") {
4638
4645
  //a cleaner implementation of the transform list method
4646
+ const SEP = (0, Const_1.$faces)().separatorchar;
4639
4647
  let iterValues = (userValues) ? trim(userValues).split(/\s+/gi) : [];
4640
4648
  let ret = [];
4641
4649
  let processed = {};
4650
+ //TODO check if this is right
4651
+ const remapNamingContainer = item => {
4652
+ if (item.indexOf(SEP) === 0 && viewId !== "") {
4653
+ item = [viewId, SEP, item.substring(1)].join("");
4654
+ }
4655
+ else if (item.indexOf(SEP) === 0) {
4656
+ item = item.substring(1);
4657
+ }
4658
+ return item;
4659
+ };
4642
4660
  // in this case we do not use lazy stream because it wont bring any code reduction
4643
4661
  // or speedup
4644
4662
  for (let cnt = 0; cnt < iterValues.length; cnt++) {
@@ -4656,22 +4674,21 @@ var Implementation;
4656
4674
  return targetConfig;
4657
4675
  //@form pushes the issuing form id into our list
4658
4676
  case Const_1.IDENT_FORM:
4659
- ret.push(issuingForm.id.value);
4677
+ ret.push(remapNamingContainer(issuingForm.id.value));
4660
4678
  processed[issuingForm.id.value] = true;
4661
4679
  break;
4662
4680
  //@this is replaced with the current issuing element id
4663
4681
  case Const_1.IDENT_THIS:
4664
4682
  if (!(issuingElementId in processed)) {
4665
- ret.push(issuingElementId);
4683
+ ret.push(remapNamingContainer(issuingElementId));
4666
4684
  processed[issuingElementId] = true;
4667
4685
  }
4668
4686
  break;
4669
4687
  default:
4670
- ret.push(iterValues[cnt]);
4688
+ ret.push(remapNamingContainer(iterValues[cnt]));
4671
4689
  processed[iterValues[cnt]] = true;
4672
4690
  }
4673
4691
  }
4674
- //We now add the target as joined list
4675
4692
  targetConfig.assign(targetKey).value = ret.join(" ");
4676
4693
  return targetConfig;
4677
4694
  }
@@ -5024,14 +5041,15 @@ var PushImpl;
5024
5041
  * limitations under the License.
5025
5042
  */
5026
5043
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5027
- exports.CTX_PARAM_TR_TYPE = exports.CTX_PARAM_SRC_CTL_ID = exports.CTX_PARAM_SRC_FRM_ID = exports.CTX_PARAM_MF_INTERNAL = exports.TIMEOUT_EVENT = exports.CLIENT_ERROR = exports.SERVER_ERROR = exports.MALFORMEDXML = exports.EMPTY_RESPONSE = exports.HTTPERROR = exports.RESPONSE_XML = exports.RESPONSE_TEXT = exports.ERROR_MESSAGE = exports.ERROR_NAME = exports.STATUS = exports.SOURCE = exports.SUCCESS = exports.COMPLETE = exports.BEGIN = exports.ON_EVENT = exports.ON_ERROR = exports.EVENT = exports.ERROR = exports.WINDOW_ID = exports.CTX_PARAM_RENDER = exports.P_BEHAVIOR_EVENT = exports.P_WINDOW_ID = exports.P_RESET_VALUES = exports.P_EVT = exports.P_RENDER_OVERRIDE = exports.P_RENDER = exports.P_EXECUTE = exports.P_AJAX = exports.IDENT_FORM = exports.IDENT_THIS = exports.IDENT_NONE = exports.IDENT_ALL = exports.HTML_CLIENT_WINDOW = exports.HTML_VIEWSTATE = exports.EMPTY_MAP = exports.EMPTY_STR = exports.EMPTY_FUNC = exports.P_RESOURCE = exports.P_VIEWBODY = exports.P_VIEWHEAD = exports.P_VIEWROOT = exports.P_CLIENT_WINDOW = exports.P_VIEWSTATE = exports.PARTIAL_ID = exports.P_PARTIAL_SOURCE = void 0;
5028
- exports.MYFACES = exports.DEFERRED_HEAD_INSERTS = exports.UPDATE_ELEMS = exports.UPDATE_FORMS = exports.CMD_REDIRECT = exports.CMD_EXTENSION = exports.CMD_ATTRIBUTES = exports.CMD_ERROR = exports.CMD_EVAL = exports.CMD_INSERT = exports.CMD_DELETE = exports.CMD_UPDATE = exports.CMD_CHANGES = exports.RESP_PARTIAL = exports.ATTR_ID = exports.ATTR_VALUE = exports.ATTR_NAME = exports.ATTR_URL = exports.ERR_NO_PARTIAL_RESPONSE = exports.PHASE_PROCESS_RESPONSE = exports.SEL_RESPONSE_XML = exports.SEL_CLIENT_WINDOW_ELEM = exports.SEL_VIEWSTATE_ELEM = exports.TAG_ATTR = exports.TAG_AFTER = exports.TAG_BEFORE = exports.TAG_BODY = exports.TAG_FORM = exports.TAG_HEAD = exports.STD_ACCEPT = exports.NO_TIMEOUT = exports.MULTIPART = exports.URL_ENCODED = exports.STATE_EVT_COMPLETE = exports.STATE_EVT_TIMEOUT = exports.STATE_EVT_BEGIN = exports.REQ_TYPE_POST = exports.REQ_TYPE_GET = exports.ENCODED_URL = exports.VAL_AJAX = exports.REQ_ACCEPT = exports.HEAD_FACES_REQ = exports.CONTENT_TYPE = exports.STAGE_DEVELOPMENT = exports.CTX_PARAM_EXECUTE = exports.CTX_PARAM_RST = exports.CTX_PARAM_TIMEOUT = exports.CTX_PARAM_DELAY = exports.CTX_PARAM_SPEC_PARAMS = exports.CTX_PARAM_PASS_THR = void 0;
5029
- exports.$nsp = exports.UNKNOWN = exports.MAX_RECONNECT_ATTEMPTS = exports.RECONNECT_INTERVAL = exports.APPLIED_CLIENT_WINDOW = exports.APPLIED_VST = exports.REASON_EXPIRED = exports.MF_NONE = exports.SEL_SCRIPTS_STYLES = void 0;
5044
+ exports.CTX_OPTIONS_TIMEOUT = exports.CTX_OPTIONS_DELAY = exports.CTX_OPTIONS_PARAMS = exports.TIMEOUT_EVENT = exports.CLIENT_ERROR = exports.SERVER_ERROR = exports.MALFORMEDXML = exports.EMPTY_RESPONSE = exports.HTTPERROR = exports.RESPONSE_XML = exports.RESPONSE_TEXT = exports.ERROR_MESSAGE = exports.ERROR_NAME = exports.STATUS = exports.SOURCE = exports.SUCCESS = exports.COMPLETE = exports.BEGIN = exports.ON_EVENT = exports.ON_ERROR = exports.EVENT = exports.ERROR = exports.WINDOW_ID = exports.CTX_PARAM_RENDER = exports.P_BEHAVIOR_EVENT = exports.P_WINDOW_ID = exports.P_RESET_VALUES = exports.P_EVT = exports.P_RENDER_OVERRIDE = exports.P_RENDER = exports.P_EXECUTE = exports.P_AJAX = exports.IDENT_FORM = exports.IDENT_THIS = exports.IDENT_NONE = exports.IDENT_ALL = exports.HTML_CLIENT_WINDOW = exports.HTML_VIEWSTATE = exports.EMPTY_MAP = exports.EMPTY_STR = exports.EMPTY_FUNC = exports.P_RESOURCE = exports.P_VIEWBODY = exports.P_VIEWHEAD = exports.P_VIEWROOT = exports.P_CLIENT_WINDOW = exports.P_VIEWSTATE = exports.VIEW_ID = exports.PARTIAL_ID = exports.P_PARTIAL_SOURCE = void 0;
5045
+ exports.UPDATE_ELEMS = exports.UPDATE_FORMS = exports.XML_TAG_ATTR = exports.XML_TAG_AFTER = exports.XML_TAG_BEFORE = exports.XML_TAG_REDIRECT = exports.XML_TAG_EXTENSION = exports.XML_TAG_ATTRIBUTES = exports.XML_TAG_ERROR = exports.XML_TAG_EVAL = exports.XML_TAG_INSERT = exports.XML_TAG_DELETE = exports.XML_TAG_UPDATE = exports.XML_TAG_CHANGES = exports.XML_TAG_PARTIAL_RESP = exports.ATTR_ID = exports.ATTR_VALUE = exports.ATTR_NAME = exports.ATTR_URL = exports.ERR_NO_PARTIAL_RESPONSE = exports.PHASE_PROCESS_RESPONSE = exports.SEL_RESPONSE_XML = exports.SEL_CLIENT_WINDOW_ELEM = exports.SEL_VIEWSTATE_ELEM = exports.HTML_TAG_STYLE = exports.HTML_TAG_SCRIPT = exports.HTML_TAG_LINK = exports.HTML_TAG_BODY = exports.HTML_TAG_FORM = exports.HTML_TAG_HEAD = exports.STD_ACCEPT = exports.NO_TIMEOUT = exports.MULTIPART = exports.URL_ENCODED = exports.STATE_EVT_COMPLETE = exports.STATE_EVT_TIMEOUT = exports.STATE_EVT_BEGIN = exports.REQ_TYPE_POST = exports.REQ_TYPE_GET = exports.ENCODED_URL = exports.VAL_AJAX = exports.REQ_ACCEPT = exports.HEAD_FACES_REQ = exports.CONTENT_TYPE = exports.CTX_PARAM_REQ_PASS_THR = exports.CTX_PARAM_SRC_CTL_ID = exports.CTX_PARAM_SRC_FRM_ID = exports.CTX_PARAM_MF_INTERNAL = exports.CTX_OPTIONS_EXECUTE = exports.CTX_OPTIONS_RESET = void 0;
5046
+ exports.$nsp = exports.$faces = exports.UNKNOWN = exports.MAX_RECONNECT_ATTEMPTS = exports.RECONNECT_INTERVAL = exports.APPLIED_CLIENT_WINDOW = exports.APPLIED_VST = exports.REASON_EXPIRED = exports.MF_NONE = exports.MYFACES = exports.DEFERRED_HEAD_INSERTS = void 0;
5030
5047
  /*
5031
5048
  * [export const] constants
5032
5049
  */
5033
5050
  exports.P_PARTIAL_SOURCE = "jakarta.faces.source";
5034
5051
  exports.PARTIAL_ID = "partialId";
5052
+ exports.VIEW_ID = "myfaves.viewId";
5035
5053
  exports.P_VIEWSTATE = "jakarta.faces.ViewState";
5036
5054
  exports.P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
5037
5055
  exports.P_VIEWROOT = "jakarta.faces.ViewRoot";
@@ -5083,17 +5101,15 @@ exports.MALFORMEDXML = "malformedXML";
5083
5101
  exports.SERVER_ERROR = "serverError";
5084
5102
  exports.CLIENT_ERROR = "clientError";
5085
5103
  exports.TIMEOUT_EVENT = "timeout";
5086
- exports.CTX_PARAM_MF_INTERNAL = "_mfInternal";
5087
- exports.CTX_PARAM_SRC_FRM_ID = "_mfSourceFormId";
5088
- exports.CTX_PARAM_SRC_CTL_ID = "_mfSourceControlId";
5089
- exports.CTX_PARAM_TR_TYPE = "_mfTransportType";
5090
- exports.CTX_PARAM_PASS_THR = "passThrgh";
5091
- exports.CTX_PARAM_SPEC_PARAMS = "params";
5092
- exports.CTX_PARAM_DELAY = "delay";
5093
- exports.CTX_PARAM_TIMEOUT = "timeout";
5094
- exports.CTX_PARAM_RST = "resetValues";
5095
- exports.CTX_PARAM_EXECUTE = "execute";
5096
- exports.STAGE_DEVELOPMENT = "Development";
5104
+ exports.CTX_OPTIONS_PARAMS = "params";
5105
+ exports.CTX_OPTIONS_DELAY = "delay";
5106
+ exports.CTX_OPTIONS_TIMEOUT = "timeout";
5107
+ exports.CTX_OPTIONS_RESET = "resetValues";
5108
+ exports.CTX_OPTIONS_EXECUTE = "execute";
5109
+ exports.CTX_PARAM_MF_INTERNAL = "myfaces.internal";
5110
+ exports.CTX_PARAM_SRC_FRM_ID = "myfaces.source.formId";
5111
+ exports.CTX_PARAM_SRC_CTL_ID = "myfaces.source.controlId";
5112
+ exports.CTX_PARAM_REQ_PASS_THR = "myfaces.request.passThrough";
5097
5113
  exports.CONTENT_TYPE = "Content-Type";
5098
5114
  exports.HEAD_FACES_REQ = "Faces-Request";
5099
5115
  exports.REQ_ACCEPT = "Accept";
@@ -5108,12 +5124,12 @@ exports.URL_ENCODED = "application/x-www-form-urlencoded";
5108
5124
  exports.MULTIPART = "multipart/form-data";
5109
5125
  exports.NO_TIMEOUT = 0;
5110
5126
  exports.STD_ACCEPT = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
5111
- exports.TAG_HEAD = "HEAD";
5112
- exports.TAG_FORM = "FORM";
5113
- exports.TAG_BODY = "BODY";
5114
- exports.TAG_BEFORE = "before";
5115
- exports.TAG_AFTER = "after";
5116
- exports.TAG_ATTR = "attribute";
5127
+ exports.HTML_TAG_HEAD = "HEAD";
5128
+ exports.HTML_TAG_FORM = "FORM";
5129
+ exports.HTML_TAG_BODY = "BODY";
5130
+ exports.HTML_TAG_LINK = "LINK";
5131
+ exports.HTML_TAG_SCRIPT = "SCRIPT";
5132
+ exports.HTML_TAG_STYLE = "STYLE";
5117
5133
  exports.SEL_VIEWSTATE_ELEM = "[name='" + exports.P_VIEWSTATE + "']";
5118
5134
  exports.SEL_CLIENT_WINDOW_ELEM = "[name='" + exports.P_CLIENT_WINDOW + "']";
5119
5135
  exports.SEL_RESPONSE_XML = "responseXML";
@@ -5124,29 +5140,31 @@ exports.ATTR_NAME = "name";
5124
5140
  exports.ATTR_VALUE = "value";
5125
5141
  exports.ATTR_ID = "id";
5126
5142
  /*partial response types*/
5127
- exports.RESP_PARTIAL = "partial-response";
5143
+ exports.XML_TAG_PARTIAL_RESP = "partial-response";
5128
5144
  /*partial commands*/
5129
- exports.CMD_CHANGES = "changes";
5130
- exports.CMD_UPDATE = "update";
5131
- exports.CMD_DELETE = "delete";
5132
- exports.CMD_INSERT = "insert";
5133
- exports.CMD_EVAL = "eval";
5134
- exports.CMD_ERROR = "error";
5135
- exports.CMD_ATTRIBUTES = "attributes";
5136
- exports.CMD_EXTENSION = "extension";
5137
- exports.CMD_REDIRECT = "redirect";
5145
+ exports.XML_TAG_CHANGES = "changes";
5146
+ exports.XML_TAG_UPDATE = "update";
5147
+ exports.XML_TAG_DELETE = "delete";
5148
+ exports.XML_TAG_INSERT = "insert";
5149
+ exports.XML_TAG_EVAL = "eval";
5150
+ exports.XML_TAG_ERROR = "error";
5151
+ exports.XML_TAG_ATTRIBUTES = "attributes";
5152
+ exports.XML_TAG_EXTENSION = "extension";
5153
+ exports.XML_TAG_REDIRECT = "redirect";
5154
+ exports.XML_TAG_BEFORE = "before";
5155
+ exports.XML_TAG_AFTER = "after";
5156
+ exports.XML_TAG_ATTR = "attribute";
5138
5157
  /*other constants*/
5139
- exports.UPDATE_FORMS = "_updateForms";
5140
- exports.UPDATE_ELEMS = "_updateElems";
5158
+ exports.UPDATE_FORMS = "myfaces.updateForms";
5159
+ exports.UPDATE_ELEMS = "myfaces.updateElems";
5141
5160
  //we want the head elements to be processed before we process the body
5142
5161
  //but after the inner html is done
5143
- exports.DEFERRED_HEAD_INSERTS = "_headElems";
5162
+ exports.DEFERRED_HEAD_INSERTS = "myfaces.headElems";
5144
5163
  exports.MYFACES = "myfaces";
5145
- exports.SEL_SCRIPTS_STYLES = "script, style, link";
5146
5164
  exports.MF_NONE = "__mf_none__";
5147
5165
  exports.REASON_EXPIRED = "Expired";
5148
- exports.APPLIED_VST = "appliedViewState";
5149
- exports.APPLIED_CLIENT_WINDOW = "appliedClientWindow";
5166
+ exports.APPLIED_VST = "myfaces.appliedViewState";
5167
+ exports.APPLIED_CLIENT_WINDOW = "myfaces.appliedClientWindow";
5150
5168
  exports.RECONNECT_INTERVAL = 500;
5151
5169
  exports.MAX_RECONNECT_ATTEMPTS = 25;
5152
5170
  exports.UNKNOWN = "UNKNOWN";
@@ -5157,6 +5175,11 @@ exports.UNKNOWN = "UNKNOWN";
5157
5175
  * To take the compatibility layer out this method just has to be
5158
5176
  * changed to a simple value passthrough
5159
5177
  */
5178
+ function $faces() {
5179
+ var _a;
5180
+ return ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf);
5181
+ }
5182
+ exports.$faces = $faces;
5160
5183
  function $nsp(inputNamespace) {
5161
5184
  if ((!inputNamespace) || !(inputNamespace === null || inputNamespace === void 0 ? void 0 : inputNamespace.replace)) {
5162
5185
  return inputNamespace;
@@ -5394,7 +5417,7 @@ var Assertions;
5394
5417
  function assertValidXMLResponse(responseXML) {
5395
5418
  assert(!responseXML.isAbsent(), Const_1.EMPTY_RESPONSE, Const_1.PHASE_PROCESS_RESPONSE);
5396
5419
  assert(!responseXML.isXMLParserError(), responseXML.parserErrorText(Const_1.EMPTY_STR), Const_1.PHASE_PROCESS_RESPONSE);
5397
- assert(responseXML.querySelectorAll(Const_1.RESP_PARTIAL).isPresent(), Const_1.ERR_NO_PARTIAL_RESPONSE, Const_1.PHASE_PROCESS_RESPONSE);
5420
+ assert(responseXML.querySelectorAll(Const_1.XML_TAG_PARTIAL_RESP).isPresent(), Const_1.ERR_NO_PARTIAL_RESPONSE, Const_1.PHASE_PROCESS_RESPONSE);
5398
5421
  }
5399
5422
  Assertions.assertValidXMLResponse = assertValidXMLResponse;
5400
5423
  /**
@@ -5757,8 +5780,8 @@ class ExtDomQuery extends mona_dish_1.DQ {
5757
5780
  return true;
5758
5781
  }
5759
5782
  let reference = element.attr("href")
5760
- .orElse(element.attr("src").value)
5761
- .orElse(element.attr("rel").value);
5783
+ .orElseLazy(() => element.attr("src").value)
5784
+ .orElseLazy(() => element.attr("rel").value);
5762
5785
  if (!reference.isPresent()) {
5763
5786
  return true;
5764
5787
  }
@@ -5871,6 +5894,73 @@ class ExtConfig extends mona_dish_1.Config {
5871
5894
  exports.ExtConfig = ExtConfig;
5872
5895
 
5873
5896
 
5897
+ /***/ }),
5898
+
5899
+ /***/ "./src/main/typescript/impl/util/HiddenInputBuilder.ts":
5900
+ /*!*************************************************************!*\
5901
+ !*** ./src/main/typescript/impl/util/HiddenInputBuilder.ts ***!
5902
+ \*************************************************************/
5903
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5904
+
5905
+
5906
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
5907
+ * contributor license agreements. See the NOTICE file distributed with
5908
+ * this work for additional information regarding copyright ownership.
5909
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5910
+ * (the "License"); you may not use this file except in compliance with
5911
+ * the License. You may obtain a copy of the License at
5912
+ *
5913
+ * http://www.apache.org/licenses/LICENSE-2.0
5914
+ *
5915
+ * Unless required by applicable law or agreed to in writing, software
5916
+ * distributed under the License is distributed on an "AS IS" BASIS,
5917
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5918
+ * See the License for the specific language governing permissions and
5919
+ * limitations under the License.
5920
+ *
5921
+ */
5922
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
5923
+ exports.HiddenInputBuilder = void 0;
5924
+ const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
5925
+ const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
5926
+ /**
5927
+ * Builder for hidden inputs.
5928
+ * ATM only ViewState and Client window
5929
+ * are supported (per spec)
5930
+ *
5931
+ * Improves readability in the response processor!
5932
+ */
5933
+ class HiddenInputBuilder {
5934
+ constructor(selector) {
5935
+ this.selector = selector;
5936
+ const isViewState = selector.indexOf((0, Const_1.$nsp)(Const_1.P_VIEWSTATE)) != -1;
5937
+ this.name = isViewState ? Const_1.P_VIEWSTATE : Const_1.P_CLIENT_WINDOW;
5938
+ this.template = isViewState ? Const_1.HTML_VIEWSTATE : Const_1.HTML_CLIENT_WINDOW;
5939
+ }
5940
+ withNamingContainerId(namingContainer) {
5941
+ this.namingContainerId = namingContainer;
5942
+ return this;
5943
+ }
5944
+ withParent(parent) {
5945
+ this.parent = parent;
5946
+ return this;
5947
+ }
5948
+ build() {
5949
+ var _a, _b;
5950
+ //TODO naming container id?
5951
+ const cnt = (0, mona_dish_1.DQ$)(`[name='${(0, Const_1.$nsp)(this.name)}']`).length;
5952
+ const SEP = (0, Const_1.$faces)().separatorchar;
5953
+ const newElement = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(this.template));
5954
+ newElement.id.value = (((_a = this.namingContainerId) === null || _a === void 0 ? void 0 : _a.length) ?
5955
+ [this.namingContainerId, (0, Const_1.$nsp)(this.name), cnt] :
5956
+ [(0, Const_1.$nsp)(this.name), cnt]).join(SEP);
5957
+ (_b = this === null || this === void 0 ? void 0 : this.parent) === null || _b === void 0 ? void 0 : _b.append(newElement);
5958
+ return newElement;
5959
+ }
5960
+ }
5961
+ exports.HiddenInputBuilder = HiddenInputBuilder;
5962
+
5963
+
5874
5964
  /***/ }),
5875
5965
 
5876
5966
  /***/ "./src/main/typescript/impl/util/Lang.ts":
@@ -5895,8 +5985,6 @@ exports.ExtConfig = ExtConfig;
5895
5985
  * See the License for the specific language governing permissions and
5896
5986
  * limitations under the License.
5897
5987
  *
5898
- * todo replace singleton with module definition
5899
- *
5900
5988
  */
5901
5989
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5902
5990
  exports.ExtLang = void 0;
@@ -6038,21 +6126,21 @@ var ExtLang;
6038
6126
  function getForm(elem, event) {
6039
6127
  let queryElem = new mona_dish_1.DQ(elem);
6040
6128
  let eventTarget = (event) ? new mona_dish_1.DQ((0, RequestDataResolver_1.getEventTarget)(event)) : mona_dish_1.DomQuery.absent;
6041
- if (queryElem.isTag(Const_1.TAG_FORM)) {
6129
+ if (queryElem.isTag(Const_1.HTML_TAG_FORM)) {
6042
6130
  return queryElem;
6043
6131
  }
6044
6132
  //html 5 for handling
6045
- if (queryElem.attr(Const_1.TAG_FORM).isPresent()) {
6046
- let formId = queryElem.attr(Const_1.TAG_FORM).value;
6133
+ if (queryElem.attr(Const_1.HTML_TAG_FORM).isPresent()) {
6134
+ let formId = queryElem.attr(Const_1.HTML_TAG_FORM).value;
6047
6135
  let foundForm = mona_dish_1.DQ.byId(formId, true);
6048
6136
  if (foundForm.isPresent()) {
6049
6137
  return foundForm;
6050
6138
  }
6051
6139
  }
6052
- let form = queryElem.firstParent(Const_1.TAG_FORM)
6053
- .orElseLazy(() => queryElem.byTagName(Const_1.TAG_FORM, true))
6054
- .orElseLazy(() => eventTarget.firstParent(Const_1.TAG_FORM))
6055
- .orElseLazy(() => eventTarget.byTagName(Const_1.TAG_FORM))
6140
+ let form = queryElem.firstParent(Const_1.HTML_TAG_FORM)
6141
+ .orElseLazy(() => queryElem.byTagName(Const_1.HTML_TAG_FORM, true))
6142
+ .orElseLazy(() => eventTarget.firstParent(Const_1.HTML_TAG_FORM))
6143
+ .orElseLazy(() => eventTarget.byTagName(Const_1.HTML_TAG_FORM))
6056
6144
  .first();
6057
6145
  assertFormExists(form);
6058
6146
  return form;
@@ -6214,7 +6302,7 @@ class EventData {
6214
6302
  eventData.status = name;
6215
6303
  let sourceId = context.getIf(Const_1.SOURCE)
6216
6304
  .orElseLazy(() => context.getIf(Const_1.P_PARTIAL_SOURCE).value)
6217
- .orElseLazy(() => context.getIf(Const_1.CTX_PARAM_PASS_THR, Const_1.P_PARTIAL_SOURCE).value)
6305
+ .orElseLazy(() => context.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_PARTIAL_SOURCE).value)
6218
6306
  .value;
6219
6307
  if (sourceId) {
6220
6308
  eventData.source = mona_dish_1.DQ.byId(sourceId, true).first().value.value;
@@ -6255,7 +6343,7 @@ exports.EventData = EventData;
6255
6343
  * limitations under the License.
6256
6344
  */
6257
6345
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6258
- exports.resolveDefaults = exports.getEventTarget = exports.resolveWindowId = exports.resolveDelay = exports.resolveTimeout = exports.resolveForm = exports.resolveFinalUrl = exports.resolveTargetUrl = exports.resolveHandlerFunc = void 0;
6346
+ exports.resolveDefaults = exports.getEventTarget = exports.resolveWindowId = exports.resolveDelay = exports.resolveTimeout = exports.resolveViewId = exports.resolveForm = exports.resolveFinalUrl = exports.resolveTargetUrl = exports.resolveHandlerFunc = void 0;
6259
6347
  const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
6260
6348
  const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
6261
6349
  const Lang_1 = __webpack_require__(/*! ../util/Lang */ "./src/main/typescript/impl/util/Lang.ts");
@@ -6309,10 +6397,20 @@ function resolveForm(requestCtx, elem, event) {
6309
6397
  .orElseLazy(() => Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event));
6310
6398
  }
6311
6399
  exports.resolveForm = resolveForm;
6400
+ function resolveViewId(form) {
6401
+ let viewState = form.querySelectorAll(`input[type='hidden'][name*='${(0, Const_1.$nsp)(Const_1.P_VIEWSTATE)}']`).id.orElse("").value;
6402
+ let divider = (0, Const_1.$faces)().separatorchar;
6403
+ let viewId = viewState.split(divider, 2)[0];
6404
+ if (viewId.indexOf((0, Const_1.$nsp)(Const_1.P_VIEWSTATE)) === -1) {
6405
+ return viewId;
6406
+ }
6407
+ return "";
6408
+ }
6409
+ exports.resolveViewId = resolveViewId;
6312
6410
  function resolveTimeout(options) {
6313
6411
  var _a;
6314
6412
  let getCfg = Lang_1.ExtLang.getLocalOrGlobalConfig;
6315
- return (_a = options.getIf(Const_1.CTX_PARAM_TIMEOUT).value) !== null && _a !== void 0 ? _a : getCfg(options.value, Const_1.CTX_PARAM_TIMEOUT, 0);
6413
+ return (_a = options.getIf(Const_1.CTX_OPTIONS_TIMEOUT).value) !== null && _a !== void 0 ? _a : getCfg(options.value, Const_1.CTX_OPTIONS_TIMEOUT, 0);
6316
6414
  }
6317
6415
  exports.resolveTimeout = resolveTimeout;
6318
6416
  /**
@@ -6324,7 +6422,7 @@ function resolveDelay(options) {
6324
6422
  var _a;
6325
6423
  let getCfg = Lang_1.ExtLang.getLocalOrGlobalConfig;
6326
6424
  // null or non undefined will automatically be mapped to 0 aka no delay
6327
- let ret = (_a = options.getIf(Const_1.CTX_PARAM_DELAY).value) !== null && _a !== void 0 ? _a : getCfg(options.value, Const_1.CTX_PARAM_DELAY, 0);
6425
+ let ret = (_a = options.getIf(Const_1.CTX_OPTIONS_DELAY).value) !== null && _a !== void 0 ? _a : getCfg(options.value, Const_1.CTX_OPTIONS_DELAY, 0);
6328
6426
  // if delay === none, no delay must be used, aka delay 0
6329
6427
  if ('none' === ret) {
6330
6428
  ret = 0;
@@ -6490,9 +6588,9 @@ exports.resolveSourceElement = resolveSourceElement;
6490
6588
  function resolveSourceForm(internalContext, elem) {
6491
6589
  let sourceFormId = internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID);
6492
6590
  let sourceForm = new mona_dish_2.DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);
6493
- sourceForm = sourceForm.orElseLazy(() => elem.firstParent(Const_1.TAG_FORM))
6494
- .orElseLazy(() => elem.querySelectorAll(Const_1.TAG_FORM))
6495
- .orElseLazy(() => mona_dish_2.DQ.querySelectorAll(Const_1.TAG_FORM));
6591
+ sourceForm = sourceForm.orElseLazy(() => elem.firstParent(Const_1.HTML_TAG_FORM))
6592
+ .orElseLazy(() => elem.querySelectorAll(Const_1.HTML_TAG_FORM))
6593
+ .orElseLazy(() => mona_dish_2.DQ.querySelectorAll(Const_1.HTML_TAG_FORM));
6496
6594
  return sourceForm;
6497
6595
  }
6498
6596
  exports.resolveSourceForm = resolveSourceForm;
@@ -6554,7 +6652,7 @@ var Response;
6554
6652
  let responseProcessor = new ResponseProcessor_1.ResponseProcessor(req, externalContext, internalContext);
6555
6653
  internalContext.assign(Const_1.RESPONSE_XML).value = responseXML;
6556
6654
  // we now process the partial tags, or in none given raise an error
6557
- responseXML.querySelectorAll(Const_1.RESP_PARTIAL)
6655
+ responseXML.querySelectorAll(Const_1.XML_TAG_PARTIAL_RESP)
6558
6656
  .each(item => processPartialTag(item, responseProcessor, internalContext));
6559
6657
  // We now process the viewStates, client windows and the elements to be evaluated are delayed.
6560
6658
  // The reason for this is that often it is better
@@ -6573,17 +6671,17 @@ var Response;
6573
6671
  */
6574
6672
  function processPartialTag(node, responseProcessor, internalContext) {
6575
6673
  internalContext.assign(Const_1.PARTIAL_ID).value = node.id;
6576
- const SEL_SUB_TAGS = [Const_1.CMD_ERROR, Const_1.CMD_REDIRECT, Const_1.CMD_CHANGES].join(",");
6674
+ const SEL_SUB_TAGS = [Const_1.XML_TAG_ERROR, Const_1.XML_TAG_REDIRECT, Const_1.XML_TAG_CHANGES].join(",");
6577
6675
  // now we can process the main operations
6578
6676
  node.querySelectorAll(SEL_SUB_TAGS).each((node) => {
6579
6677
  switch (node.tagName.value) {
6580
- case Const_1.CMD_ERROR:
6678
+ case Const_1.XML_TAG_ERROR:
6581
6679
  responseProcessor.error(node);
6582
6680
  break;
6583
- case Const_1.CMD_REDIRECT:
6681
+ case Const_1.XML_TAG_REDIRECT:
6584
6682
  responseProcessor.redirect(node);
6585
6683
  break;
6586
- case Const_1.CMD_CHANGES:
6684
+ case Const_1.XML_TAG_CHANGES:
6587
6685
  processChangesTag(node, responseProcessor);
6588
6686
  break;
6589
6687
  }
@@ -6591,7 +6689,7 @@ var Response;
6591
6689
  }
6592
6690
  let processInsert = function (responseProcessor, node) {
6593
6691
  // path1 insert after as child tags
6594
- if (node.querySelectorAll([Const_1.TAG_BEFORE, Const_1.TAG_AFTER].join(",")).length) {
6692
+ if (node.querySelectorAll([Const_1.XML_TAG_BEFORE, Const_1.XML_TAG_AFTER].join(",")).length) {
6595
6693
  responseProcessor.insertWithSubTags(node);
6596
6694
  }
6597
6695
  else { // insert before after with id
@@ -6605,25 +6703,25 @@ var Response;
6605
6703
  * @param responseProcessor
6606
6704
  */
6607
6705
  function processChangesTag(node, responseProcessor) {
6608
- 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(", ");
6706
+ const ALLOWED_TAGS = [Const_1.XML_TAG_UPDATE, Const_1.XML_TAG_EVAL, Const_1.XML_TAG_INSERT, Const_1.XML_TAG_DELETE, Const_1.XML_TAG_ATTRIBUTES, Const_1.XML_TAG_EXTENSION].join(", ");
6609
6707
  node.querySelectorAll(ALLOWED_TAGS).each((node) => {
6610
6708
  switch (node.tagName.value) {
6611
- case Const_1.CMD_UPDATE:
6709
+ case Const_1.XML_TAG_UPDATE:
6612
6710
  processUpdateTag(node, responseProcessor);
6613
6711
  break;
6614
- case Const_1.CMD_EVAL:
6712
+ case Const_1.XML_TAG_EVAL:
6615
6713
  responseProcessor.eval(node);
6616
6714
  break;
6617
- case Const_1.CMD_INSERT:
6715
+ case Const_1.XML_TAG_INSERT:
6618
6716
  processInsert(responseProcessor, node);
6619
6717
  break;
6620
- case Const_1.CMD_DELETE:
6718
+ case Const_1.XML_TAG_DELETE:
6621
6719
  responseProcessor.delete(node);
6622
6720
  break;
6623
- case Const_1.CMD_ATTRIBUTES:
6721
+ case Const_1.XML_TAG_ATTRIBUTES:
6624
6722
  responseProcessor.attributes(node);
6625
6723
  break;
6626
- case Const_1.CMD_EXTENSION:
6724
+ case Const_1.XML_TAG_EXTENSION:
6627
6725
  break;
6628
6726
  }
6629
6727
  });
@@ -6716,8 +6814,9 @@ const ErrorData_1 = __webpack_require__(/*! ./ErrorData */ "./src/main/typescrip
6716
6814
  const ImplTypes_1 = __webpack_require__(/*! ../core/ImplTypes */ "./src/main/typescript/impl/core/ImplTypes.ts");
6717
6815
  const EventData_1 = __webpack_require__(/*! ./EventData */ "./src/main/typescript/impl/xhrCore/EventData.ts");
6718
6816
  const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
6719
- var trim = mona_dish_1.Lang.trim;
6720
6817
  const ExtDomQuery_1 = __webpack_require__(/*! ../util/ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
6818
+ const HiddenInputBuilder_1 = __webpack_require__(/*! ../util/HiddenInputBuilder */ "./src/main/typescript/impl/util/HiddenInputBuilder.ts");
6819
+ var trim = mona_dish_1.Lang.trim;
6721
6820
  /**
6722
6821
  * Response processor
6723
6822
  *
@@ -6743,24 +6842,24 @@ class ResponseProcessor {
6743
6842
  * the data incoming must represent the html representation of the head itself one way or the other
6744
6843
  */
6745
6844
  replaceHead(shadowDocument) {
6746
- let shadowHead = shadowDocument.querySelectorAll(Const_1.TAG_HEAD);
6845
+ const shadowHead = shadowDocument.querySelectorAll(Const_1.HTML_TAG_HEAD);
6747
6846
  if (!shadowHead.isPresent()) {
6748
6847
  return;
6749
6848
  }
6750
- let head = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.TAG_HEAD);
6849
+ const head = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.HTML_TAG_HEAD);
6751
6850
  // full replace we delete everything
6752
6851
  head.childNodes.delete();
6753
6852
  this.addToHead(shadowHead);
6754
6853
  }
6755
6854
  addToHead(shadowHead) {
6756
6855
  const mappedHeadData = new ExtDomQuery_1.ExtDomQuery(shadowHead);
6757
- const postProcessTags = ["STYLE", "LINK", "SCRIPT"];
6856
+ const postProcessTags = [Const_1.HTML_TAG_STYLE, Const_1.HTML_TAG_LINK, Const_1.HTML_TAG_SCRIPT];
6758
6857
  const nonExecutables = mappedHeadData.filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) == -1);
6759
6858
  nonExecutables.runHeadInserts(true);
6760
6859
  //incoming either the outer head tag or its children
6761
6860
  const nodesToAdd = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
6762
- // this is stored for post processing
6763
- // after the rest of the "pyhsical build up", head before body
6861
+ // this is stored for "post" processing
6862
+ // after the rest of the "physical build up", head before body
6764
6863
  const evalElements = nodesToAdd.stream
6765
6864
  .filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) != -1).collect(new mona_dish_1.DomQueryCollector());
6766
6865
  this.addToHeadDeferred(evalElements);
@@ -6777,17 +6876,17 @@ class ResponseProcessor {
6777
6876
  * @param shadowDocument .. an incoming shadow document hosting the new nodes
6778
6877
  */
6779
6878
  replaceBody(shadowDocument) {
6780
- let shadowBody = shadowDocument.querySelectorAll(Const_1.TAG_BODY);
6879
+ const shadowBody = shadowDocument.querySelectorAll(Const_1.HTML_TAG_BODY);
6781
6880
  if (!shadowBody.isPresent()) {
6782
6881
  return;
6783
6882
  }
6784
- let shadowInnerHTML = shadowBody.html().value;
6785
- let resultingBody = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.TAG_BODY).html(shadowInnerHTML);
6786
- let updateForms = resultingBody.querySelectorAll(Const_1.TAG_FORM);
6883
+ const shadowInnerHTML = shadowBody.innerHTML;
6884
+ const resultingBody = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.HTML_TAG_BODY);
6885
+ const updateForms = resultingBody.querySelectorAll(Const_1.HTML_TAG_FORM);
6787
6886
  // main difference, we cannot replace the body itself, but only its content
6788
6887
  // we need a separate step for post-processing the incoming
6789
6888
  // attributes, like classes, styles etc...
6790
- resultingBody.copyAttrs(shadowBody);
6889
+ resultingBody.html(shadowInnerHTML).copyAttrs(shadowBody);
6791
6890
  this.externalContext.assign((0, Const_1.$nsp)(Const_1.P_RENDER_OVERRIDE)).value = "@all";
6792
6891
  this.storeForPostProcessing(updateForms, resultingBody);
6793
6892
  }
@@ -6812,15 +6911,15 @@ class ResponseProcessor {
6812
6911
  * <error-message><![CDATA[message]]></error-message>
6813
6912
  * <error>
6814
6913
  */
6815
- let mergedErrorData = new ExtDomQuery_1.ExtConfig({});
6914
+ const mergedErrorData = new ExtDomQuery_1.ExtConfig({});
6816
6915
  mergedErrorData.assign(Const_1.SOURCE).value = this.externalContext.getIf(Const_1.P_PARTIAL_SOURCE).get(0).value;
6817
6916
  mergedErrorData.assign(Const_1.ERROR_NAME).value = node.querySelectorAll(Const_1.ERROR_NAME).textContent(Const_1.EMPTY_STR);
6818
6917
  mergedErrorData.assign(Const_1.ERROR_MESSAGE).value = node.querySelectorAll(Const_1.ERROR_MESSAGE).cDATAAsString;
6819
- let hasResponseXML = this.internalContext.get(Const_1.RESPONSE_XML).isPresent();
6918
+ const hasResponseXML = this.internalContext.get(Const_1.RESPONSE_XML).isPresent();
6820
6919
  //we now store the response xml also in the error data for further details
6821
6920
  mergedErrorData.assignIf(hasResponseXML, Const_1.RESPONSE_XML).value = this.internalContext.getIf(Const_1.RESPONSE_XML).value.get(0).value;
6822
6921
  // error post-processing and enrichment (standard messages from keys)
6823
- let errorData = ErrorData_1.ErrorData.fromServerError(mergedErrorData);
6922
+ const errorData = ErrorData_1.ErrorData.fromServerError(mergedErrorData);
6824
6923
  // we now trigger an internally stored onError function which might be an attached to the context
6825
6924
  // either we do not have an internal on error, or an on error has been based via params from the outside.
6826
6925
  // In both cases they are attached to our contexts
@@ -6834,7 +6933,7 @@ class ResponseProcessor {
6834
6933
  */
6835
6934
  redirect(node) {
6836
6935
  Assertions_1.Assertions.assertUrlExists(node);
6837
- let redirectUrl = trim(node.attr(Const_1.ATTR_URL).value);
6936
+ const redirectUrl = trim(node.attr(Const_1.ATTR_URL).value);
6838
6937
  if (redirectUrl != Const_1.EMPTY_STR) {
6839
6938
  window.location.href = redirectUrl;
6840
6939
  }
@@ -6845,8 +6944,8 @@ class ResponseProcessor {
6845
6944
  * @param cdataBlock the cdata block with the new html code
6846
6945
  */
6847
6946
  update(node, cdataBlock) {
6848
- let result = ExtDomQuery_1.ExtDomQuery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
6849
- let sourceForm = result === null || result === void 0 ? void 0 : result.firstParent(Const_1.TAG_FORM).orElseLazy(() => result.byTagName(Const_1.TAG_FORM, true));
6947
+ const result = ExtDomQuery_1.ExtDomQuery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
6948
+ const sourceForm = result === null || result === void 0 ? void 0 : result.firstParent(Const_1.HTML_TAG_FORM).orElseLazy(() => result.byTagName(Const_1.HTML_TAG_FORM, true));
6850
6949
  if (sourceForm) {
6851
6950
  this.storeForPostProcessing(sourceForm, result);
6852
6951
  }
@@ -6864,8 +6963,8 @@ class ResponseProcessor {
6864
6963
  * @param node
6865
6964
  */
6866
6965
  attributes(node) {
6867
- let elem = mona_dish_1.DQ.byId(node.id.value, true);
6868
- node.byTagName(Const_1.TAG_ATTR).each((item) => {
6966
+ const elem = mona_dish_1.DQ.byId(node.id.value, true);
6967
+ node.byTagName(Const_1.XML_TAG_ATTR).each((item) => {
6869
6968
  elem.attr(item.attr(Const_1.ATTR_NAME).value).value = item.attr(Const_1.ATTR_VALUE).value;
6870
6969
  });
6871
6970
  }
@@ -6883,15 +6982,15 @@ class ResponseProcessor {
6883
6982
  */
6884
6983
  insert(node) {
6885
6984
  //let insertId = node.id; //not used atm
6886
- let before = node.attr(Const_1.TAG_BEFORE);
6887
- let after = node.attr(Const_1.TAG_AFTER);
6888
- let insertNodes = mona_dish_1.DQ.fromMarkup(node.cDATAAsString);
6985
+ const before = node.attr(Const_1.XML_TAG_BEFORE);
6986
+ const after = node.attr(Const_1.XML_TAG_AFTER);
6987
+ const insertNodes = mona_dish_1.DQ.fromMarkup(node.cDATAAsString);
6889
6988
  if (before.isPresent()) {
6890
6989
  mona_dish_1.DQ.byId(before.value, true).insertBefore(insertNodes);
6891
6990
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
6892
6991
  }
6893
6992
  if (after.isPresent()) {
6894
- let domQuery = mona_dish_1.DQ.byId(after.value, true);
6993
+ const domQuery = mona_dish_1.DQ.byId(after.value, true);
6895
6994
  domQuery.insertAfter(insertNodes);
6896
6995
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
6897
6996
  }
@@ -6902,19 +7001,19 @@ class ResponseProcessor {
6902
7001
  * @param node the node hosting the insert data
6903
7002
  */
6904
7003
  insertWithSubTags(node) {
6905
- let before = node.querySelectorAll(Const_1.TAG_BEFORE);
6906
- let after = node.querySelectorAll(Const_1.TAG_AFTER);
7004
+ const before = node.querySelectorAll(Const_1.XML_TAG_BEFORE);
7005
+ const after = node.querySelectorAll(Const_1.XML_TAG_AFTER);
6907
7006
  before.each(item => {
6908
- let insertId = item.attr(Const_1.ATTR_ID);
6909
- let insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
7007
+ const insertId = item.attr(Const_1.ATTR_ID);
7008
+ const insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
6910
7009
  if (insertId.isPresent()) {
6911
7010
  mona_dish_1.DQ.byId(insertId.value, true).insertBefore(insertNodes);
6912
7011
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
6913
7012
  }
6914
7013
  });
6915
7014
  after.each(item => {
6916
- let insertId = item.attr(Const_1.ATTR_ID);
6917
- let insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
7015
+ const insertId = item.attr(Const_1.ATTR_ID);
7016
+ const insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
6918
7017
  if (insertId.isPresent()) {
6919
7018
  mona_dish_1.DQ.byId(insertId.value, true).insertAfter(insertNodes);
6920
7019
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
@@ -6928,7 +7027,7 @@ class ResponseProcessor {
6928
7027
  */
6929
7028
  processViewState(node) {
6930
7029
  if (ResponseProcessor.isViewStateNode(node)) {
6931
- let state = node.cDATAAsString;
7030
+ const state = node.cDATAAsString;
6932
7031
  this.internalContext.assign(Const_1.APPLIED_VST, node.id.value).value = new ImplTypes_1.StateHolder((0, Const_1.$nsp)(node.id.value), state);
6933
7032
  return true;
6934
7033
  }
@@ -6936,7 +7035,7 @@ class ResponseProcessor {
6936
7035
  }
6937
7036
  processClientWindow(node) {
6938
7037
  if (ResponseProcessor.isClientWindowNode(node)) {
6939
- let state = node.cDATAAsString;
7038
+ const state = node.cDATAAsString;
6940
7039
  this.internalContext.assign(Const_1.APPLIED_CLIENT_WINDOW, node.id.value).value = new ImplTypes_1.StateHolder((0, Const_1.$nsp)(node.id.value), state);
6941
7040
  return true;
6942
7041
  }
@@ -6962,13 +7061,11 @@ class ResponseProcessor {
6962
7061
  */
6963
7062
  fixViewStates() {
6964
7063
  mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_VST).orElse({}).value)
6965
- .each((item) => {
6966
- let value = item[1];
6967
- let namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
6968
- let affectedForms;
6969
- affectedForms = this.getContainerForms(namingContainerId)
6970
- .filter(affectedForm => this.executeOrRenderFilter(affectedForm));
6971
- this.appendViewStateToForms(affectedForms, value.value);
7064
+ .each(([, value]) => {
7065
+ const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
7066
+ const affectedForms = this.getContainerForms(namingContainerId)
7067
+ .filter(affectedForm => this.isInExecuteOrRender(affectedForm));
7068
+ this.appendViewStateToForms(affectedForms, value.value, namingContainerId.orElse("").value);
6972
7069
  });
6973
7070
  }
6974
7071
  /**
@@ -6977,22 +7074,20 @@ class ResponseProcessor {
6977
7074
  */
6978
7075
  fixClientWindow() {
6979
7076
  mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
6980
- .each((item) => {
6981
- const value = item[1];
7077
+ .each(([, value]) => {
6982
7078
  const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
6983
- let affectedForms;
6984
- affectedForms = this.getContainerForms(namingContainerId)
6985
- .filter(affectedForm => this.executeOrRenderFilter(affectedForm));
6986
- this.appendClientWindowToForms(affectedForms, value.value);
7079
+ const affectedForms = this.getContainerForms(namingContainerId)
7080
+ .filter(affectedForm => this.isInExecuteOrRender(affectedForm));
7081
+ this.appendClientWindowToForms(affectedForms, value.value, namingContainerId.orElse("").value);
6987
7082
  });
6988
7083
  }
6989
7084
  /**
6990
7085
  * all processing done we can close the request and send the appropriate events
6991
7086
  */
6992
7087
  done() {
6993
- let eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);
7088
+ const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);
6994
7089
  //because some frameworks might decorate them over the context in the response
6995
- let eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;
7090
+ const eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;
6996
7091
  AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);
6997
7092
  }
6998
7093
  /**
@@ -7000,18 +7095,20 @@ class ResponseProcessor {
7000
7095
  *
7001
7096
  * @param forms the forms to append the viewState to
7002
7097
  * @param viewState the final viewState
7098
+ * @param namingContainerId
7003
7099
  */
7004
- appendViewStateToForms(forms, viewState) {
7005
- this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState);
7100
+ appendViewStateToForms(forms, viewState, namingContainerId = "") {
7101
+ this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState, namingContainerId);
7006
7102
  }
7007
7103
  /**
7008
7104
  * proper clientWindow -> form assignment
7009
7105
  *
7010
7106
  * @param forms the forms to append the viewState to
7011
7107
  * @param clientWindow the final viewState
7108
+ * @param namingContainerId
7012
7109
  */
7013
- appendClientWindowToForms(forms, clientWindow) {
7014
- this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow);
7110
+ appendClientWindowToForms(forms, clientWindow, namingContainerId = "") {
7111
+ this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow, namingContainerId);
7015
7112
  }
7016
7113
  /**
7017
7114
  * generic append state which appends a certain state as hidden element to an existing set of forms
@@ -7020,41 +7117,26 @@ class ResponseProcessor {
7020
7117
  * @param selector the selector for the state
7021
7118
  * @param state the state itself which needs to be assigned
7022
7119
  *
7120
+ * @param namingContainerId
7023
7121
  * @private
7024
7122
  */
7025
- assignState(forms, selector, state) {
7026
- forms.each((form) => {
7027
- let stateHolders = form.querySelectorAll(selector)
7028
- .orElseLazy(() => {
7029
- return selector.indexOf("ViewState") != -1 ?
7030
- ResponseProcessor.newViewStateElement(form) :
7031
- ResponseProcessor.newClientWindowElement(form);
7032
- });
7033
- stateHolders.attr("value").value = state;
7123
+ assignState(forms, selector, state, namingContainerId) {
7124
+ /**
7125
+ * creates the viewState or client window id element
7126
+ * @param form
7127
+ */
7128
+ const createAndAppendHiddenInput = (form) => {
7129
+ return new HiddenInputBuilder_1.HiddenInputBuilder(selector)
7130
+ .withNamingContainerId(namingContainerId)
7131
+ .withParent(form)
7132
+ .build();
7133
+ };
7134
+ forms.each(form => {
7135
+ const hiddenInput = form.querySelectorAll(selector)
7136
+ .orElseLazy(() => createAndAppendHiddenInput(form));
7137
+ hiddenInput.val = state;
7034
7138
  });
7035
7139
  }
7036
- /**
7037
- * Helper to Create a new JSF ViewState Element
7038
- *
7039
- * @param parent, the parent node to attach the viewState element to
7040
- * (usually a form node)
7041
- */
7042
- static newViewStateElement(parent) {
7043
- let newElement = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(Const_1.HTML_VIEWSTATE));
7044
- newElement.appendTo(parent);
7045
- return newElement;
7046
- }
7047
- /**
7048
- * Helper to Create a new JSF ViewState Element
7049
- *
7050
- * @param parent, the parent node to attach the viewState element to
7051
- * (usually a form node)
7052
- */
7053
- static newClientWindowElement(parent) {
7054
- let newElement = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(Const_1.HTML_CLIENT_WINDOW));
7055
- newElement.appendTo(parent);
7056
- return newElement;
7057
- }
7058
7140
  /**
7059
7141
  * Stores certain aspects of the dom for later post-processing
7060
7142
  *
@@ -7088,11 +7170,11 @@ class ResponseProcessor {
7088
7170
  * @returns if it is a viewState node
7089
7171
  */
7090
7172
  static isViewStateNode(node) {
7091
- var _a, _b, _c, _d, _e, _f, _g;
7092
- 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;
7093
- 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) ||
7094
- ((_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 ||
7095
- ((_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);
7173
+ var _a, _b, _c, _d, _e, _f;
7174
+ const SEP = (0, Const_1.$faces)().separatorchar;
7175
+ return "undefined" != typeof ((_a = node === null || node === void 0 ? void 0 : node.id) === null || _a === void 0 ? void 0 : _a.value) && (((_b = node === null || node === void 0 ? void 0 : node.id) === null || _b === void 0 ? void 0 : _b.value) == (0, Const_1.$nsp)(Const_1.P_VIEWSTATE) ||
7176
+ ((_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([SEP, (0, Const_1.$nsp)(Const_1.P_VIEWSTATE)].join(Const_1.EMPTY_STR))) != -1 ||
7177
+ ((_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([(0, Const_1.$nsp)(Const_1.P_VIEWSTATE), SEP].join(Const_1.EMPTY_STR))) != -1);
7096
7178
  }
7097
7179
  /**
7098
7180
  * incoming client window node also needs special processing
@@ -7101,11 +7183,11 @@ class ResponseProcessor {
7101
7183
  * @returns true of it ii
7102
7184
  */
7103
7185
  static isClientWindowNode(node) {
7104
- var _a, _b, _c, _d, _e, _f, _g;
7105
- 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;
7106
- 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) ||
7107
- ((_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 ||
7108
- ((_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);
7186
+ var _a, _b, _c, _d, _e, _f;
7187
+ const SEP = (0, Const_1.$faces)().separatorchar;
7188
+ return "undefined" != typeof ((_a = node === null || node === void 0 ? void 0 : node.id) === null || _a === void 0 ? void 0 : _a.value) && (((_b = node === null || node === void 0 ? void 0 : node.id) === null || _b === void 0 ? void 0 : _b.value) == (0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW) ||
7189
+ ((_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([SEP, (0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW)].join(Const_1.EMPTY_STR))) != -1 ||
7190
+ ((_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([(0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW), SEP].join(Const_1.EMPTY_STR))) != -1);
7109
7191
  }
7110
7192
  triggerOnError(errorData) {
7111
7193
  this.externalContext.getIf(Const_1.ON_ERROR).orElseLazy(() => this.internalContext.getIf(Const_1.ON_ERROR).value).orElse(Const_1.EMPTY_FUNC).value(errorData);
@@ -7115,24 +7197,21 @@ class ResponseProcessor {
7115
7197
  * @param affectedForm
7116
7198
  * @private
7117
7199
  */
7118
- executeOrRenderFilter(affectedForm) {
7119
- let executes = this.externalContext.getIf((0, Const_1.$nsp)(Const_1.P_EXECUTE)).orElse("@none").value.split(/\s+/gi);
7120
- let renders = this.externalContext.getIf(Const_1.P_RENDER_OVERRIDE)
7200
+ isInExecuteOrRender(affectedForm) {
7201
+ const executes = this.externalContext.getIf((0, Const_1.$nsp)(Const_1.P_EXECUTE)).orElse("@none").value.split(/\s+/gi);
7202
+ const renders = this.externalContext.getIf(Const_1.P_RENDER_OVERRIDE)
7121
7203
  .orElseLazy(() => this.externalContext.getIf((0, Const_1.$nsp)(Const_1.P_RENDER)).value)
7122
- .orElse("@none").value.split(/\s+/gi);
7123
- let executeAndRenders = executes.concat(...renders);
7204
+ .orElse(Const_1.IDENT_NONE).value.split(/\s+/gi);
7205
+ const executeAndRenders = executes.concat(...renders);
7124
7206
  return mona_dish_1.LazyStream.of(...executeAndRenders).filter(nameOrId => {
7125
- if (nameOrId == "@all") {
7126
- return true;
7127
- }
7128
- if (nameOrId == "@none") {
7207
+ if ([Const_1.IDENT_ALL, Const_1.IDENT_NONE].indexOf(nameOrId) != -1) {
7129
7208
  return true;
7130
7209
  }
7131
- const nameOrIdSelector = `[id='${nameOrId}'], [name='#${nameOrId}']`;
7210
+ const NAME_OR_ID = this.getNameOrIdSelector(nameOrId);
7132
7211
  //either the form directly is in execute or render or one of its children or one of its parents
7133
- return affectedForm.matchesSelector(nameOrIdSelector) ||
7134
- affectedForm.querySelectorAll(nameOrIdSelector).isPresent() ||
7135
- affectedForm.firstParent(nameOrIdSelector).isPresent();
7212
+ return affectedForm.matchesSelector(NAME_OR_ID) ||
7213
+ affectedForm.querySelectorAll(NAME_OR_ID).isPresent() ||
7214
+ affectedForm.firstParent(NAME_OR_ID).isPresent();
7136
7215
  }).first().isPresent();
7137
7216
  }
7138
7217
  /**
@@ -7143,17 +7222,19 @@ class ResponseProcessor {
7143
7222
  getContainerForms(namingContainerId) {
7144
7223
  if (namingContainerId.isPresent()) {
7145
7224
  //naming container mode, all forms under naming container id must be processed
7146
- return mona_dish_1.DQ.byId(namingContainerId.value)
7147
- .orElse((0, mona_dish_1.DQ$)(`form[id='${namingContainerId.value}'], form[name='${namingContainerId.value}']`))
7225
+ return (0, mona_dish_1.DQ$)(this.getNameOrIdSelector(namingContainerId.value))
7148
7226
  // missing condition if the naming container is not present we have to
7149
7227
  // use the body as fallback
7150
- .orElse(mona_dish_1.DQ.byTagName(Const_1.TAG_BODY))
7151
- .byTagName(Const_1.TAG_FORM, true);
7228
+ .orElseLazy(() => mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_BODY))
7229
+ .byTagName(Const_1.HTML_TAG_FORM, true);
7152
7230
  }
7153
7231
  else {
7154
- return mona_dish_1.DQ.byTagName(Const_1.TAG_FORM);
7232
+ return mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_FORM);
7155
7233
  }
7156
7234
  }
7235
+ getNameOrIdSelector(nameOrId) {
7236
+ return `[id='${nameOrId}'], [name='${nameOrId}']`;
7237
+ }
7157
7238
  }
7158
7239
  exports.ResponseProcessor = ResponseProcessor;
7159
7240
 
@@ -7277,7 +7358,7 @@ class XhrFormData extends mona_dish_1.Config {
7277
7358
  * @param form the form holding the view state value
7278
7359
  */
7279
7360
  applyViewState(form) {
7280
- let viewState = form.byId(Const_1.P_VIEWSTATE, true).inputValue;
7361
+ let viewState = form.querySelectorAllDeep(`[name*='${Const_1.P_VIEWSTATE}'`).inputValue;
7281
7362
  this.appendIf(viewState.isPresent(), Const_1.P_VIEWSTATE).value = viewState.value;
7282
7363
  }
7283
7364
  /**
@@ -7502,15 +7583,14 @@ class XhrRequest {
7502
7583
  });
7503
7584
  }
7504
7585
  start() {
7505
- var _a;
7506
7586
  let ignoreErr = failSaveExecute;
7507
7587
  let xhrObject = this.xhrObject;
7508
7588
  let executesArr = () => {
7509
- return this.requestContext.getIf(Const_1.CTX_PARAM_PASS_THR, Const_1.P_EXECUTE).get("none").value.split(/\s+/gi);
7589
+ return this.requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).get("none").value.split(/\s+/gi);
7510
7590
  };
7511
7591
  try {
7512
7592
  let formElement = this.sourceForm.getAsElem(0).value;
7513
- let viewState = ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf).getViewState(formElement);
7593
+ let viewState = (0, Const_1.$faces)().getViewState(formElement);
7514
7594
  // encoded we need to decode
7515
7595
  // We generated a base representation of the current form
7516
7596
  // in case someone has overloaded the viewState with additional decorators we merge
@@ -7524,12 +7604,12 @@ class XhrRequest {
7524
7604
  this.contentType = formData.isMultipartRequest ? "undefined" : this.contentType;
7525
7605
  // next step the pass through parameters are merged in for post params
7526
7606
  let requestContext = this.requestContext;
7527
- let passThroughParams = requestContext.getIf(Const_1.CTX_PARAM_PASS_THR);
7607
+ let requestPassThroughParams = requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR);
7528
7608
  // this is an extension where we allow pass through parameters to be sent down additionally
7529
7609
  // this can be used and is used in the impl to enrich the post request parameters with additional
7530
7610
  // information
7531
- formData.shallowMerge(passThroughParams, true, true);
7532
- this.responseContext = passThroughParams.deepCopy;
7611
+ formData.shallowMerge(requestPassThroughParams, true, true);
7612
+ this.responseContext = requestPassThroughParams.deepCopy;
7533
7613
  // we have to shift the internal passthroughs around to build up our response context
7534
7614
  let responseContext = this.responseContext;
7535
7615
  responseContext.assign(Const_1.CTX_PARAM_MF_INTERNAL).value = this.internalContext.value;
@@ -7647,7 +7727,7 @@ class XhrRequest {
7647
7727
  reject();
7648
7728
  }
7649
7729
  onSuccess(resolve) {
7650
- var _a, _b, _c;
7730
+ var _a, _b;
7651
7731
  this.sendEvent(Const_1.COMPLETE);
7652
7732
  // malformed responses always result in empty response xml
7653
7733
  // per spec a valid response cannot be empty
@@ -7655,7 +7735,7 @@ class XhrRequest {
7655
7735
  this.handleMalFormedXML(resolve);
7656
7736
  return;
7657
7737
  }
7658
- ((_b = window === null || window === void 0 ? void 0 : window.faces) !== null && _b !== void 0 ? _b : window.jsf).ajax.response(this.xhrObject, (_c = this.responseContext.value) !== null && _c !== void 0 ? _c : {});
7738
+ (0, Const_1.$faces)().ajax.response(this.xhrObject, (_b = this.responseContext.value) !== null && _b !== void 0 ? _b : {});
7659
7739
  }
7660
7740
  handleMalFormedXML(resolve) {
7661
7741
  var _a;