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

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 (99) hide show
  1. package/dist/window/faces-development.js +344 -231
  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 +344 -231
  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 +78 -38
  23. package/src/main/typescript/impl/core/Const.ts +42 -38
  24. package/src/main/typescript/impl/util/Assertions.ts +2 -2
  25. package/src/main/typescript/impl/util/ExtDomQuery.ts +2 -2
  26. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +63 -0
  27. package/src/main/typescript/impl/util/Lang.ts +8 -10
  28. package/src/main/typescript/impl/xhrCore/EventData.ts +2 -2
  29. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +35 -27
  30. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +4 -4
  31. package/src/main/typescript/impl/xhrCore/Response.ts +25 -25
  32. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +113 -121
  33. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +1 -1
  34. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +8 -7
  35. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +19 -0
  36. package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
  37. package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -3
  38. package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +195 -0
  39. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +2 -0
  40. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +20 -13
  41. package/target/api/_api.js +1 -1
  42. package/target/api/_api.js.map +1 -1
  43. package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
  44. package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
  45. package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
  46. package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
  47. package/target/impl/AjaxImpl.js +70 -29
  48. package/target/impl/AjaxImpl.js.map +1 -1
  49. package/target/impl/core/Const.js +43 -36
  50. package/target/impl/core/Const.js.map +1 -1
  51. package/target/impl/core/Context.js +10 -0
  52. package/target/impl/core/Context.js.map +1 -0
  53. package/target/impl/util/Assertions.js +1 -1
  54. package/target/impl/util/Assertions.js.map +1 -1
  55. package/target/impl/util/ExtDomQuery.js +2 -2
  56. package/target/impl/util/ExtDomQuery.js.map +1 -1
  57. package/target/impl/util/HiddenElementBuilder.js +7 -0
  58. package/target/impl/util/HiddenElementBuilder.js.map +1 -0
  59. package/target/impl/util/HiddenInputBuilder.js +58 -0
  60. package/target/impl/util/HiddenInputBuilder.js.map +1 -0
  61. package/target/impl/util/Lang.js +7 -9
  62. package/target/impl/util/Lang.js.map +1 -1
  63. package/target/impl/xhrCore/EventData.js +1 -1
  64. package/target/impl/xhrCore/EventData.js.map +1 -1
  65. package/target/impl/xhrCore/RequestContext.js +11 -0
  66. package/target/impl/xhrCore/RequestContext.js.map +1 -0
  67. package/target/impl/xhrCore/RequestDataResolver.js +28 -18
  68. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  69. package/target/impl/xhrCore/ResonseDataResolver.js +3 -3
  70. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  71. package/target/impl/xhrCore/Response.js +13 -13
  72. package/target/impl/xhrCore/Response.js.map +1 -1
  73. package/target/impl/xhrCore/ResponseProcessor.js +94 -109
  74. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  75. package/target/impl/xhrCore/XhrFormData.js +1 -1
  76. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  77. package/target/impl/xhrCore/XhrRequest.js +7 -8
  78. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  79. package/target/test/frameworkBase/_ext/shared/StandardInits.js +18 -0
  80. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  81. package/target/test/impl/ImplTest.spec.js +2 -2
  82. package/target/test/impl/ImplTest.spec.js.map +1 -1
  83. package/target/test/impl/ImplTest_23.spec.js +2 -2
  84. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  85. package/target/test/xhrCore/NamespacesRequestTest.spec.js +199 -0
  86. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
  87. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  88. package/target/test/xhrCore/ResponseTest.spec.js +17 -13
  89. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  90. package/target/test-classes/.gz +0 -0
  91. package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
  92. package/target/test-classes/fileuploadtest.html +24 -0
  93. package/target/test-classes/jsf-development.js +3559 -0
  94. package/target/test-classes/jsf-development.js.br +0 -0
  95. package/target/test-classes/jsf-development.js.gz +0 -0
  96. package/target/test-classes/jsf-development.js.map +1 -0
  97. package/target/test-classes/jsf.js +3 -0
  98. package/target/test-classes/jsf.js.br +0 -0
  99. 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;
@@ -4305,7 +4311,9 @@ var Implementation;
4305
4311
  */
4306
4312
  function request(el, event, opts) {
4307
4313
  var _a, _b, _c;
4308
- const { resolvedEvent, options, elem, elementId, requestCtx, internalCtx, windowId, isResetValues } = (0, RequestDataResolver_1.resolveDefaults)(event, opts, el);
4314
+ const { options, elem, elementId, windowId, isResetValues } = (0, RequestDataResolver_1.resolveDefaults)(event, opts, el);
4315
+ const requestCtx = new ExtDomQuery_1.ExtConfig({});
4316
+ const internalCtx = new ExtDomQuery_1.ExtConfig({});
4309
4317
  Assertions_1.Assertions.assertRequestIntegrity(options, elem);
4310
4318
  /**
4311
4319
  * fetch the parent form
@@ -4314,22 +4322,24 @@ var Implementation;
4314
4322
  * so that people can use dummy forms and work
4315
4323
  * with detached objects
4316
4324
  */
4317
- const form = (0, RequestDataResolver_1.resolveForm)(requestCtx, elem, resolvedEvent);
4325
+ const form = (0, RequestDataResolver_1.resolveForm)(elem, event);
4326
+ const viewId = (0, RequestDataResolver_1.resolveViewId)(form);
4318
4327
  const formId = form.id.value;
4319
4328
  const delay = (0, RequestDataResolver_1.resolveDelay)(options);
4320
4329
  const timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
4321
4330
  requestCtx.assignIf(!!windowId, Const_1.P_WINDOW_ID).value = windowId;
4322
4331
  // 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);
4332
+ requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR).value = extractLegacyParams(options.value);
4324
4333
  // 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;
4334
+ const params = remapArrayToAssocArr(options.getIf(Const_1.CTX_OPTIONS_PARAMS).orElse({}).value);
4335
+ requestCtx.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).shallowMerge(new mona_dish_1.Config(params), true);
4336
+ requestCtx.assignIf(!!event, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EVT).value = event === null || event === void 0 ? void 0 : event.type;
4328
4337
  /**
4329
4338
  * ajax pass through context with the source
4330
4339
  * onresolved Event and onerror Event
4331
4340
  */
4332
4341
  requestCtx.assign(Const_1.SOURCE).value = elementId;
4342
+ requestCtx.assign(Const_1.VIEW_ID).value = viewId;
4333
4343
  /**
4334
4344
  * on resolvedEvent and onError...
4335
4345
  * those values will be traversed later on
@@ -4344,11 +4354,11 @@ var Implementation;
4344
4354
  /**
4345
4355
  * binding contract the jakarta.faces.source must be set
4346
4356
  */
4347
- requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_PARTIAL_SOURCE).value = elementId;
4357
+ requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_PARTIAL_SOURCE).value = elementId;
4348
4358
  /**
4349
4359
  * jakarta.faces.partial.ajax must be set to true
4350
4360
  */
4351
- requestCtx.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_AJAX).value = true;
4361
+ requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX).value = true;
4352
4362
  /**
4353
4363
  * if resetValues is set to true
4354
4364
  * then we have to set jakarta.faces.resetValues as well
@@ -4356,7 +4366,7 @@ var Implementation;
4356
4366
  * the value has to be explicitly true, according to
4357
4367
  * the specs jsdoc
4358
4368
  */
4359
- requestCtx.assignIf(isResetValues, Const_1.CTX_PARAM_PASS_THR, Const_1.P_RESET_VALUES).value = true;
4369
+ requestCtx.assignIf(isResetValues, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_RESET_VALUES).value = true;
4360
4370
  // additional meta information to speed things up, note internal non jsf
4361
4371
  // pass through options are stored under _mfInternal in the context
4362
4372
  internalCtx.assign(Const_1.CTX_PARAM_SRC_FRM_ID).value = formId;
@@ -4365,9 +4375,8 @@ var Implementation;
4365
4375
  // mojarra under blackbox conditions.
4366
4376
  // I assume it does the same as our formId_submit=1 so leaving it out
4367
4377
  // 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;
4378
+ requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, formId).value = formId;
4369
4379
  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
4380
  assignClientWindowId(form, requestCtx);
4372
4381
  assignExecute(options, requestCtx, form, elementId);
4373
4382
  assignRender(options, requestCtx, form, elementId);
@@ -4540,7 +4549,7 @@ var Implementation;
4540
4549
  * because it makes it easier to detect bugs
4541
4550
  */
4542
4551
  let element = mona_dish_1.DQ.byId(form, true);
4543
- if (!element.isTag(Const_1.TAG_FORM)) {
4552
+ if (!element.isTag(Const_1.HTML_TAG_FORM)) {
4544
4553
  throw new Error(getMessage("ERR_VIEWSTATE"));
4545
4554
  }
4546
4555
  let formData = new XhrFormData_1.XhrFormData(element);
@@ -4578,7 +4587,7 @@ var Implementation;
4578
4587
  */
4579
4588
  function assignRender(requestOptions, targetContext, issuingForm, sourceElementId) {
4580
4589
  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);
4590
+ 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
4591
  }
4583
4592
  }
4584
4593
  /**
@@ -4594,16 +4603,16 @@ var Implementation;
4594
4603
  * @param sourceElementId the executing element triggering the faces.ajax.request (id of it)
4595
4604
  */
4596
4605
  function assignExecute(requestOptions, targetContext, issuingForm, sourceElementId) {
4597
- if (requestOptions.getIf(Const_1.CTX_PARAM_EXECUTE).isPresent()) {
4606
+ if (requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).isPresent()) {
4598
4607
  /*the options must be a blank delimited list of strings*/
4599
4608
  /*compliance with Mojarra which automatically adds @this to an execute
4600
4609
  * the spec rev 2.0a however states, if none is issued nothing at all should be sent down
4601
4610
  */
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);
4611
+ requestOptions.assign(Const_1.CTX_OPTIONS_EXECUTE).value = [requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).value, Const_1.IDENT_THIS].join(" ");
4612
+ 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
4613
  }
4605
4614
  else {
4606
- targetContext.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_EXECUTE).value = sourceElementId;
4615
+ targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).value = sourceElementId;
4607
4616
  }
4608
4617
  }
4609
4618
  /**
@@ -4613,16 +4622,15 @@ var Implementation;
4613
4622
  * @param targetContext the target context receiving the value
4614
4623
  */
4615
4624
  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);
4625
+ let clientWindow = (0, Const_1.$faces)().getClientWindow(form.getAsElem(0).value);
4618
4626
  if (clientWindow) {
4619
- targetContext.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_CLIENT_WINDOW).value = clientWindow;
4627
+ targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_CLIENT_WINDOW).value = clientWindow;
4620
4628
  }
4621
4629
  }
4622
4630
  /**
4623
4631
  * transforms the user values to the expected one
4624
4632
  * with the proper none all form and this handling
4625
- * (note we also could use a simple string replace but then
4633
+ * (note we also could use a simple string replace, but then
4626
4634
  * we would have had double entries under some circumstances)
4627
4635
  *
4628
4636
  * there are several standardized constants which need a special treatment
@@ -4633,12 +4641,52 @@ var Implementation;
4633
4641
  * @param userValues the passed user values (aka input string which needs to be transformed)
4634
4642
  * @param issuingForm the form where the issuing element originates
4635
4643
  * @param issuingElementId the issuing element
4644
+ * @param rootNamingContainerId the naming container id ("" default if none is given)
4636
4645
  */
4637
- function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId) {
4646
+ function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId, rootNamingContainerId = "") {
4638
4647
  //a cleaner implementation of the transform list method
4648
+ const SEP = (0, Const_1.$faces)().separatorchar;
4639
4649
  let iterValues = (userValues) ? trim(userValues).split(/\s+/gi) : [];
4640
4650
  let ret = [];
4641
4651
  let processed = {};
4652
+ /**
4653
+ * remaps the client ids for the portlet case so that the server
4654
+ * can deal with them either prefixed ir not
4655
+ * also resolves the absolute id case (it was assumed the server does this, but
4656
+ * apparently the RI does not, so we have to follow the RI behavior here)
4657
+ * @param componentIdToTransform the componentId which needs post processing
4658
+ */
4659
+ const remapNamingContainer = componentIdToTransform => {
4660
+ // pattern :<anything> must be prepended by viewRoot if there is one,
4661
+ // otherwise we are in a not namespaced then only the id has to match
4662
+ const rootNamingContainerPrefix = (rootNamingContainerId.length) ? rootNamingContainerId + SEP : Const_1.EMPTY_STR;
4663
+ let formClientId = issuingForm.id.value;
4664
+ // nearest parent naming container relative to the form
4665
+ const nearestNamingContainer = formClientId.substring(0, formClientId.lastIndexOf(SEP));
4666
+ const nearestNamingContainerPrefix = (nearestNamingContainer.length) ? nearestNamingContainer + SEP : Const_1.EMPTY_STR;
4667
+ // Absolute search expressions, always start with SEP or the name of the root naming container
4668
+ const hasLeadingSep = componentIdToTransform.indexOf(SEP) === 0;
4669
+ const isAbsolutSearchExpr = hasLeadingSep || (rootNamingContainerId.length
4670
+ && componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0);
4671
+ if (isAbsolutSearchExpr) {
4672
+ //we cut off the leading sep if there is one
4673
+ componentIdToTransform = hasLeadingSep ? componentIdToTransform.substring(1) : componentIdToTransform;
4674
+ componentIdToTransform = componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0 ? componentIdToTransform.substring(rootNamingContainerPrefix.length) : componentIdToTransform;
4675
+ //now we prepend either the prefix or "" from the cut-off string to get the final result
4676
+ return [rootNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR);
4677
+ }
4678
+ else { //relative search according to the javadoc
4679
+ //we cut off the root naming container id from the form
4680
+ if (formClientId.indexOf(rootNamingContainerPrefix) == 0) {
4681
+ formClientId = formClientId.substring(rootNamingContainerPrefix.length);
4682
+ }
4683
+ //If prependId = true, the outer form id must be present in the id if same form
4684
+ let hasPrependId = componentIdToTransform.indexOf(formClientId) == 0;
4685
+ return hasPrependId ?
4686
+ [rootNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR) :
4687
+ [nearestNamingContainerPrefix, componentIdToTransform.substring(componentIdToTransform.lastIndexOf(SEP) + 1)].join(Const_1.EMPTY_STR);
4688
+ }
4689
+ };
4642
4690
  // in this case we do not use lazy stream because it wont bring any code reduction
4643
4691
  // or speedup
4644
4692
  for (let cnt = 0; cnt < iterValues.length; cnt++) {
@@ -4656,38 +4704,37 @@ var Implementation;
4656
4704
  return targetConfig;
4657
4705
  //@form pushes the issuing form id into our list
4658
4706
  case Const_1.IDENT_FORM:
4659
- ret.push(issuingForm.id.value);
4707
+ ret.push(remapNamingContainer(issuingForm.id.value));
4660
4708
  processed[issuingForm.id.value] = true;
4661
4709
  break;
4662
4710
  //@this is replaced with the current issuing element id
4663
4711
  case Const_1.IDENT_THIS:
4664
4712
  if (!(issuingElementId in processed)) {
4665
- ret.push(issuingElementId);
4713
+ ret.push(remapNamingContainer(issuingElementId));
4666
4714
  processed[issuingElementId] = true;
4667
4715
  }
4668
4716
  break;
4669
4717
  default:
4670
- ret.push(iterValues[cnt]);
4718
+ ret.push(remapNamingContainer(iterValues[cnt]));
4671
4719
  processed[iterValues[cnt]] = true;
4672
4720
  }
4673
4721
  }
4674
- //We now add the target as joined list
4675
4722
  targetConfig.assign(targetKey).value = ret.join(" ");
4676
4723
  return targetConfig;
4677
4724
  }
4678
4725
  /**
4679
4726
  * Filter the options given with a blacklist, so that only
4680
- * the values required for pass-through are processed in the ajax request
4727
+ * the values required for params-through are processed in the ajax request
4681
4728
  *
4682
4729
  * Note this is a bug carried over from the old implementation
4683
4730
  * the spec conform behavior is to use params for passthrough values
4684
- * this will be removed soon, after it is cleared up wheter removing
4731
+ * this will be removed soon, after it is cleared up whether removing
4685
4732
  * it breaks any legacy code
4686
4733
  *
4687
4734
  * @param {Context} mappedOpts the options to be filtered
4688
4735
  * @deprecated
4689
4736
  */
4690
- function filterPassThroughValues(mappedOpts) {
4737
+ function extractLegacyParams(mappedOpts) {
4691
4738
  //we now can use the full code reduction given by our stream api
4692
4739
  //to filter
4693
4740
  return mona_dish_1.Stream.ofAssoc(mappedOpts)
@@ -5024,14 +5071,15 @@ var PushImpl;
5024
5071
  * limitations under the License.
5025
5072
  */
5026
5073
  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;
5074
+ exports.DELAY_NONE = 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;
5075
+ 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 = exports.CTX_OPTIONS_TIMEOUT = void 0;
5076
+ 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 = exports.UPDATE_ELEMS = void 0;
5030
5077
  /*
5031
5078
  * [export const] constants
5032
5079
  */
5033
5080
  exports.P_PARTIAL_SOURCE = "jakarta.faces.source";
5034
5081
  exports.PARTIAL_ID = "partialId";
5082
+ exports.VIEW_ID = "myfaves.viewId";
5035
5083
  exports.P_VIEWSTATE = "jakarta.faces.ViewState";
5036
5084
  exports.P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
5037
5085
  exports.P_VIEWROOT = "jakarta.faces.ViewRoot";
@@ -5083,17 +5131,16 @@ exports.MALFORMEDXML = "malformedXML";
5083
5131
  exports.SERVER_ERROR = "serverError";
5084
5132
  exports.CLIENT_ERROR = "clientError";
5085
5133
  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";
5134
+ exports.CTX_OPTIONS_PARAMS = "params";
5135
+ exports.CTX_OPTIONS_DELAY = "delay";
5136
+ exports.DELAY_NONE = 'none';
5137
+ exports.CTX_OPTIONS_TIMEOUT = "timeout";
5138
+ exports.CTX_OPTIONS_RESET = "resetValues";
5139
+ exports.CTX_OPTIONS_EXECUTE = "execute";
5140
+ exports.CTX_PARAM_MF_INTERNAL = "myfaces.internal";
5141
+ exports.CTX_PARAM_SRC_FRM_ID = "myfaces.source.formId";
5142
+ exports.CTX_PARAM_SRC_CTL_ID = "myfaces.source.controlId";
5143
+ exports.CTX_PARAM_REQ_PASS_THR = "myfaces.request.passThrough";
5097
5144
  exports.CONTENT_TYPE = "Content-Type";
5098
5145
  exports.HEAD_FACES_REQ = "Faces-Request";
5099
5146
  exports.REQ_ACCEPT = "Accept";
@@ -5108,12 +5155,12 @@ exports.URL_ENCODED = "application/x-www-form-urlencoded";
5108
5155
  exports.MULTIPART = "multipart/form-data";
5109
5156
  exports.NO_TIMEOUT = 0;
5110
5157
  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";
5158
+ exports.HTML_TAG_HEAD = "HEAD";
5159
+ exports.HTML_TAG_FORM = "FORM";
5160
+ exports.HTML_TAG_BODY = "BODY";
5161
+ exports.HTML_TAG_LINK = "LINK";
5162
+ exports.HTML_TAG_SCRIPT = "SCRIPT";
5163
+ exports.HTML_TAG_STYLE = "STYLE";
5117
5164
  exports.SEL_VIEWSTATE_ELEM = "[name='" + exports.P_VIEWSTATE + "']";
5118
5165
  exports.SEL_CLIENT_WINDOW_ELEM = "[name='" + exports.P_CLIENT_WINDOW + "']";
5119
5166
  exports.SEL_RESPONSE_XML = "responseXML";
@@ -5124,29 +5171,31 @@ exports.ATTR_NAME = "name";
5124
5171
  exports.ATTR_VALUE = "value";
5125
5172
  exports.ATTR_ID = "id";
5126
5173
  /*partial response types*/
5127
- exports.RESP_PARTIAL = "partial-response";
5174
+ exports.XML_TAG_PARTIAL_RESP = "partial-response";
5128
5175
  /*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";
5176
+ exports.XML_TAG_CHANGES = "changes";
5177
+ exports.XML_TAG_UPDATE = "update";
5178
+ exports.XML_TAG_DELETE = "delete";
5179
+ exports.XML_TAG_INSERT = "insert";
5180
+ exports.XML_TAG_EVAL = "eval";
5181
+ exports.XML_TAG_ERROR = "error";
5182
+ exports.XML_TAG_ATTRIBUTES = "attributes";
5183
+ exports.XML_TAG_EXTENSION = "extension";
5184
+ exports.XML_TAG_REDIRECT = "redirect";
5185
+ exports.XML_TAG_BEFORE = "before";
5186
+ exports.XML_TAG_AFTER = "after";
5187
+ exports.XML_TAG_ATTR = "attribute";
5138
5188
  /*other constants*/
5139
- exports.UPDATE_FORMS = "_updateForms";
5140
- exports.UPDATE_ELEMS = "_updateElems";
5189
+ exports.UPDATE_FORMS = "myfaces.updateForms";
5190
+ exports.UPDATE_ELEMS = "myfaces.updateElems";
5141
5191
  //we want the head elements to be processed before we process the body
5142
5192
  //but after the inner html is done
5143
- exports.DEFERRED_HEAD_INSERTS = "_headElems";
5193
+ exports.DEFERRED_HEAD_INSERTS = "myfaces.headElems";
5144
5194
  exports.MYFACES = "myfaces";
5145
- exports.SEL_SCRIPTS_STYLES = "script, style, link";
5146
5195
  exports.MF_NONE = "__mf_none__";
5147
5196
  exports.REASON_EXPIRED = "Expired";
5148
- exports.APPLIED_VST = "appliedViewState";
5149
- exports.APPLIED_CLIENT_WINDOW = "appliedClientWindow";
5197
+ exports.APPLIED_VST = "myfaces.appliedViewState";
5198
+ exports.APPLIED_CLIENT_WINDOW = "myfaces.appliedClientWindow";
5150
5199
  exports.RECONNECT_INTERVAL = 500;
5151
5200
  exports.MAX_RECONNECT_ATTEMPTS = 25;
5152
5201
  exports.UNKNOWN = "UNKNOWN";
@@ -5157,6 +5206,11 @@ exports.UNKNOWN = "UNKNOWN";
5157
5206
  * To take the compatibility layer out this method just has to be
5158
5207
  * changed to a simple value passthrough
5159
5208
  */
5209
+ function $faces() {
5210
+ var _a;
5211
+ 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);
5212
+ }
5213
+ exports.$faces = $faces;
5160
5214
  function $nsp(inputNamespace) {
5161
5215
  if ((!inputNamespace) || !(inputNamespace === null || inputNamespace === void 0 ? void 0 : inputNamespace.replace)) {
5162
5216
  return inputNamespace;
@@ -5394,7 +5448,7 @@ var Assertions;
5394
5448
  function assertValidXMLResponse(responseXML) {
5395
5449
  assert(!responseXML.isAbsent(), Const_1.EMPTY_RESPONSE, Const_1.PHASE_PROCESS_RESPONSE);
5396
5450
  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);
5451
+ assert(responseXML.querySelectorAll(Const_1.XML_TAG_PARTIAL_RESP).isPresent(), Const_1.ERR_NO_PARTIAL_RESPONSE, Const_1.PHASE_PROCESS_RESPONSE);
5398
5452
  }
5399
5453
  Assertions.assertValidXMLResponse = assertValidXMLResponse;
5400
5454
  /**
@@ -5757,8 +5811,8 @@ class ExtDomQuery extends mona_dish_1.DQ {
5757
5811
  return true;
5758
5812
  }
5759
5813
  let reference = element.attr("href")
5760
- .orElse(element.attr("src").value)
5761
- .orElse(element.attr("rel").value);
5814
+ .orElseLazy(() => element.attr("src").value)
5815
+ .orElseLazy(() => element.attr("rel").value);
5762
5816
  if (!reference.isPresent()) {
5763
5817
  return true;
5764
5818
  }
@@ -5871,6 +5925,73 @@ class ExtConfig extends mona_dish_1.Config {
5871
5925
  exports.ExtConfig = ExtConfig;
5872
5926
 
5873
5927
 
5928
+ /***/ }),
5929
+
5930
+ /***/ "./src/main/typescript/impl/util/HiddenInputBuilder.ts":
5931
+ /*!*************************************************************!*\
5932
+ !*** ./src/main/typescript/impl/util/HiddenInputBuilder.ts ***!
5933
+ \*************************************************************/
5934
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5935
+
5936
+
5937
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
5938
+ * contributor license agreements. See the NOTICE file distributed with
5939
+ * this work for additional information regarding copyright ownership.
5940
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5941
+ * (the "License"); you may not use this file except in compliance with
5942
+ * the License. You may obtain a copy of the License at
5943
+ *
5944
+ * http://www.apache.org/licenses/LICENSE-2.0
5945
+ *
5946
+ * Unless required by applicable law or agreed to in writing, software
5947
+ * distributed under the License is distributed on an "AS IS" BASIS,
5948
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5949
+ * See the License for the specific language governing permissions and
5950
+ * limitations under the License.
5951
+ *
5952
+ */
5953
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
5954
+ exports.HiddenInputBuilder = void 0;
5955
+ const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
5956
+ const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
5957
+ /**
5958
+ * Builder for hidden inputs.
5959
+ * ATM only ViewState and Client window
5960
+ * are supported (per spec)
5961
+ *
5962
+ * Improves readability in the response processor!
5963
+ */
5964
+ class HiddenInputBuilder {
5965
+ constructor(selector) {
5966
+ this.selector = selector;
5967
+ const isViewState = selector.indexOf((0, Const_1.$nsp)(Const_1.P_VIEWSTATE)) != -1;
5968
+ this.name = isViewState ? Const_1.P_VIEWSTATE : Const_1.P_CLIENT_WINDOW;
5969
+ this.template = isViewState ? Const_1.HTML_VIEWSTATE : Const_1.HTML_CLIENT_WINDOW;
5970
+ }
5971
+ withNamingContainerId(namingContainer) {
5972
+ this.namingContainerId = namingContainer;
5973
+ return this;
5974
+ }
5975
+ withParent(parent) {
5976
+ this.parent = parent;
5977
+ return this;
5978
+ }
5979
+ build() {
5980
+ var _a, _b;
5981
+ //TODO naming container id?
5982
+ const cnt = (0, mona_dish_1.DQ$)(`[name='${(0, Const_1.$nsp)(this.name)}']`).length;
5983
+ const SEP = (0, Const_1.$faces)().separatorchar;
5984
+ const newElement = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(this.template));
5985
+ newElement.id.value = (((_a = this.namingContainerId) === null || _a === void 0 ? void 0 : _a.length) ?
5986
+ [this.namingContainerId, (0, Const_1.$nsp)(this.name), cnt] :
5987
+ [(0, Const_1.$nsp)(this.name), cnt]).join(SEP);
5988
+ (_b = this === null || this === void 0 ? void 0 : this.parent) === null || _b === void 0 ? void 0 : _b.append(newElement);
5989
+ return newElement;
5990
+ }
5991
+ }
5992
+ exports.HiddenInputBuilder = HiddenInputBuilder;
5993
+
5994
+
5874
5995
  /***/ }),
5875
5996
 
5876
5997
  /***/ "./src/main/typescript/impl/util/Lang.ts":
@@ -5895,8 +6016,6 @@ exports.ExtConfig = ExtConfig;
5895
6016
  * See the License for the specific language governing permissions and
5896
6017
  * limitations under the License.
5897
6018
  *
5898
- * todo replace singleton with module definition
5899
- *
5900
6019
  */
5901
6020
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5902
6021
  exports.ExtLang = void 0;
@@ -6038,21 +6157,21 @@ var ExtLang;
6038
6157
  function getForm(elem, event) {
6039
6158
  let queryElem = new mona_dish_1.DQ(elem);
6040
6159
  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)) {
6160
+ if (queryElem.isTag(Const_1.HTML_TAG_FORM)) {
6042
6161
  return queryElem;
6043
6162
  }
6044
6163
  //html 5 for handling
6045
- if (queryElem.attr(Const_1.TAG_FORM).isPresent()) {
6046
- let formId = queryElem.attr(Const_1.TAG_FORM).value;
6164
+ if (queryElem.attr(Const_1.HTML_TAG_FORM).isPresent()) {
6165
+ let formId = queryElem.attr(Const_1.HTML_TAG_FORM).value;
6047
6166
  let foundForm = mona_dish_1.DQ.byId(formId, true);
6048
6167
  if (foundForm.isPresent()) {
6049
6168
  return foundForm;
6050
6169
  }
6051
6170
  }
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))
6171
+ let form = queryElem.firstParent(Const_1.HTML_TAG_FORM)
6172
+ .orElseLazy(() => queryElem.byTagName(Const_1.HTML_TAG_FORM, true))
6173
+ .orElseLazy(() => eventTarget.firstParent(Const_1.HTML_TAG_FORM))
6174
+ .orElseLazy(() => eventTarget.byTagName(Const_1.HTML_TAG_FORM))
6056
6175
  .first();
6057
6176
  assertFormExists(form);
6058
6177
  return form;
@@ -6214,7 +6333,7 @@ class EventData {
6214
6333
  eventData.status = name;
6215
6334
  let sourceId = context.getIf(Const_1.SOURCE)
6216
6335
  .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)
6336
+ .orElseLazy(() => context.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_PARTIAL_SOURCE).value)
6218
6337
  .value;
6219
6338
  if (sourceId) {
6220
6339
  eventData.source = mona_dish_1.DQ.byId(sourceId, true).first().value.value;
@@ -6255,7 +6374,7 @@ exports.EventData = EventData;
6255
6374
  * limitations under the License.
6256
6375
  */
6257
6376
  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;
6377
+ exports.resolveDefaults = exports.getEventTarget = exports.resolveWindowId = exports.resolveDelay = exports.resolveTimeout = exports.resolveViewId = exports.resolveForm = exports.resolveFinalUrl = exports.resolveTargetUrl = exports.resolveHandlerFunc = void 0;
6259
6378
  const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
6260
6379
  const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
6261
6380
  const Lang_1 = __webpack_require__(/*! ../util/Lang */ "./src/main/typescript/impl/util/Lang.ts");
@@ -6297,22 +6416,27 @@ exports.resolveFinalUrl = resolveFinalUrl;
6297
6416
  * it is either the id or the parent form of the element or an embedded form
6298
6417
  * of the element
6299
6418
  *
6300
- * @param requestCtx
6301
6419
  * @param elem
6302
6420
  * @param event
6303
6421
  */
6304
- function resolveForm(requestCtx, elem, event) {
6305
- var _a, _b, _c;
6306
- const 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;
6307
- return mona_dish_1.DQ
6308
- .byId(configId, true)
6309
- .orElseLazy(() => Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event));
6422
+ function resolveForm(elem, event) {
6423
+ return Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event);
6310
6424
  }
6311
6425
  exports.resolveForm = resolveForm;
6426
+ function resolveViewId(form) {
6427
+ const viewState = form.querySelectorAll(`input[type='hidden'][name*='${(0, Const_1.$nsp)(Const_1.P_VIEWSTATE)}']`).id.orElse("").value;
6428
+ const divider = (0, Const_1.$faces)().separatorchar;
6429
+ const viewId = viewState.split(divider, 2)[0];
6430
+ if (viewId.indexOf((0, Const_1.$nsp)(Const_1.P_VIEWSTATE)) === -1) {
6431
+ return viewId;
6432
+ }
6433
+ return "";
6434
+ }
6435
+ exports.resolveViewId = resolveViewId;
6312
6436
  function resolveTimeout(options) {
6313
6437
  var _a;
6314
6438
  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);
6439
+ 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
6440
  }
6317
6441
  exports.resolveTimeout = resolveTimeout;
6318
6442
  /**
@@ -6321,14 +6445,12 @@ exports.resolveTimeout = resolveTimeout;
6321
6445
  * @param options ... the options object, in most cases it will host the delay value
6322
6446
  */
6323
6447
  function resolveDelay(options) {
6324
- var _a;
6325
- let getCfg = Lang_1.ExtLang.getLocalOrGlobalConfig;
6326
- // 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);
6448
+ // null, 'none', or undefined will automatically be mapped to 0 aka no delay
6449
+ // the config delay will be dropped not needed anymore, it does not really
6450
+ // make sense anymore now that it is part of a local spec
6451
+ let ret = options.getIf(Const_1.CTX_OPTIONS_DELAY).orElse(0).value;
6328
6452
  // if delay === none, no delay must be used, aka delay 0
6329
- if ('none' === ret) {
6330
- ret = 0;
6331
- }
6453
+ ret = (Const_1.DELAY_NONE === ret) ? 0 : ret;
6332
6454
  // negative, or invalid values will automatically get a js exception
6333
6455
  Assertions_1.Assertions.assertDelay(ret);
6334
6456
  return ret;
@@ -6383,8 +6505,15 @@ exports.getEventTarget = getEventTarget;
6383
6505
  function resolveDefaults(event, opts, el = null) {
6384
6506
  var _a;
6385
6507
  //deep copy the options, so that further transformations to not backfire into the callers
6386
- const resolvedEvent = event, options = new ExtDomQuery_1.ExtConfig(opts).deepCopy, elem = mona_dish_1.DQ.byId(el || resolvedEvent.target, true), elementId = elem.id.value, requestCtx = new ExtDomQuery_1.ExtConfig({}), internalCtx = new ExtDomQuery_1.ExtConfig({}), windowId = resolveWindowId(options), isResetValues = true === ((_a = options.value) === null || _a === void 0 ? void 0 : _a.resetValues);
6387
- return { resolvedEvent, options, elem, elementId, requestCtx, internalCtx, windowId, isResetValues };
6508
+ const elem = mona_dish_1.DQ.byId(el || event.target, true);
6509
+ const options = new ExtDomQuery_1.ExtConfig(opts).deepCopy;
6510
+ return {
6511
+ options: options,
6512
+ elem: elem,
6513
+ elementId: elem.id.value,
6514
+ windowId: resolveWindowId(options),
6515
+ isResetValues: true === ((_a = options.value) === null || _a === void 0 ? void 0 : _a.resetValues)
6516
+ };
6388
6517
  }
6389
6518
  exports.resolveDefaults = resolveDefaults;
6390
6519
 
@@ -6490,9 +6619,9 @@ exports.resolveSourceElement = resolveSourceElement;
6490
6619
  function resolveSourceForm(internalContext, elem) {
6491
6620
  let sourceFormId = internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID);
6492
6621
  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));
6622
+ sourceForm = sourceForm.orElseLazy(() => elem.firstParent(Const_1.HTML_TAG_FORM))
6623
+ .orElseLazy(() => elem.querySelectorAll(Const_1.HTML_TAG_FORM))
6624
+ .orElseLazy(() => mona_dish_2.DQ.querySelectorAll(Const_1.HTML_TAG_FORM));
6496
6625
  return sourceForm;
6497
6626
  }
6498
6627
  exports.resolveSourceForm = resolveSourceForm;
@@ -6554,7 +6683,7 @@ var Response;
6554
6683
  let responseProcessor = new ResponseProcessor_1.ResponseProcessor(req, externalContext, internalContext);
6555
6684
  internalContext.assign(Const_1.RESPONSE_XML).value = responseXML;
6556
6685
  // we now process the partial tags, or in none given raise an error
6557
- responseXML.querySelectorAll(Const_1.RESP_PARTIAL)
6686
+ responseXML.querySelectorAll(Const_1.XML_TAG_PARTIAL_RESP)
6558
6687
  .each(item => processPartialTag(item, responseProcessor, internalContext));
6559
6688
  // We now process the viewStates, client windows and the elements to be evaluated are delayed.
6560
6689
  // The reason for this is that often it is better
@@ -6573,17 +6702,17 @@ var Response;
6573
6702
  */
6574
6703
  function processPartialTag(node, responseProcessor, internalContext) {
6575
6704
  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(",");
6705
+ const SEL_SUB_TAGS = [Const_1.XML_TAG_ERROR, Const_1.XML_TAG_REDIRECT, Const_1.XML_TAG_CHANGES].join(",");
6577
6706
  // now we can process the main operations
6578
6707
  node.querySelectorAll(SEL_SUB_TAGS).each((node) => {
6579
6708
  switch (node.tagName.value) {
6580
- case Const_1.CMD_ERROR:
6709
+ case Const_1.XML_TAG_ERROR:
6581
6710
  responseProcessor.error(node);
6582
6711
  break;
6583
- case Const_1.CMD_REDIRECT:
6712
+ case Const_1.XML_TAG_REDIRECT:
6584
6713
  responseProcessor.redirect(node);
6585
6714
  break;
6586
- case Const_1.CMD_CHANGES:
6715
+ case Const_1.XML_TAG_CHANGES:
6587
6716
  processChangesTag(node, responseProcessor);
6588
6717
  break;
6589
6718
  }
@@ -6591,7 +6720,7 @@ var Response;
6591
6720
  }
6592
6721
  let processInsert = function (responseProcessor, node) {
6593
6722
  // path1 insert after as child tags
6594
- if (node.querySelectorAll([Const_1.TAG_BEFORE, Const_1.TAG_AFTER].join(",")).length) {
6723
+ if (node.querySelectorAll([Const_1.XML_TAG_BEFORE, Const_1.XML_TAG_AFTER].join(",")).length) {
6595
6724
  responseProcessor.insertWithSubTags(node);
6596
6725
  }
6597
6726
  else { // insert before after with id
@@ -6605,25 +6734,25 @@ var Response;
6605
6734
  * @param responseProcessor
6606
6735
  */
6607
6736
  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(", ");
6737
+ 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
6738
  node.querySelectorAll(ALLOWED_TAGS).each((node) => {
6610
6739
  switch (node.tagName.value) {
6611
- case Const_1.CMD_UPDATE:
6740
+ case Const_1.XML_TAG_UPDATE:
6612
6741
  processUpdateTag(node, responseProcessor);
6613
6742
  break;
6614
- case Const_1.CMD_EVAL:
6743
+ case Const_1.XML_TAG_EVAL:
6615
6744
  responseProcessor.eval(node);
6616
6745
  break;
6617
- case Const_1.CMD_INSERT:
6746
+ case Const_1.XML_TAG_INSERT:
6618
6747
  processInsert(responseProcessor, node);
6619
6748
  break;
6620
- case Const_1.CMD_DELETE:
6749
+ case Const_1.XML_TAG_DELETE:
6621
6750
  responseProcessor.delete(node);
6622
6751
  break;
6623
- case Const_1.CMD_ATTRIBUTES:
6752
+ case Const_1.XML_TAG_ATTRIBUTES:
6624
6753
  responseProcessor.attributes(node);
6625
6754
  break;
6626
- case Const_1.CMD_EXTENSION:
6755
+ case Const_1.XML_TAG_EXTENSION:
6627
6756
  break;
6628
6757
  }
6629
6758
  });
@@ -6716,8 +6845,9 @@ const ErrorData_1 = __webpack_require__(/*! ./ErrorData */ "./src/main/typescrip
6716
6845
  const ImplTypes_1 = __webpack_require__(/*! ../core/ImplTypes */ "./src/main/typescript/impl/core/ImplTypes.ts");
6717
6846
  const EventData_1 = __webpack_require__(/*! ./EventData */ "./src/main/typescript/impl/xhrCore/EventData.ts");
6718
6847
  const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
6719
- var trim = mona_dish_1.Lang.trim;
6720
6848
  const ExtDomQuery_1 = __webpack_require__(/*! ../util/ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
6849
+ const HiddenInputBuilder_1 = __webpack_require__(/*! ../util/HiddenInputBuilder */ "./src/main/typescript/impl/util/HiddenInputBuilder.ts");
6850
+ var trim = mona_dish_1.Lang.trim;
6721
6851
  /**
6722
6852
  * Response processor
6723
6853
  *
@@ -6743,24 +6873,26 @@ class ResponseProcessor {
6743
6873
  * the data incoming must represent the html representation of the head itself one way or the other
6744
6874
  */
6745
6875
  replaceHead(shadowDocument) {
6746
- let shadowHead = shadowDocument.querySelectorAll(Const_1.TAG_HEAD);
6876
+ const shadowHead = shadowDocument.querySelectorAll(Const_1.HTML_TAG_HEAD);
6747
6877
  if (!shadowHead.isPresent()) {
6748
6878
  return;
6749
6879
  }
6750
- let head = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.TAG_HEAD);
6880
+ const head = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.HTML_TAG_HEAD);
6751
6881
  // full replace we delete everything
6752
6882
  head.childNodes.delete();
6753
6883
  this.addToHead(shadowHead);
6884
+ //we copy the attributes as well (just in case myfaces introduces the id in head)
6885
+ head.copyAttrs(shadowHead);
6754
6886
  }
6755
6887
  addToHead(shadowHead) {
6756
6888
  const mappedHeadData = new ExtDomQuery_1.ExtDomQuery(shadowHead);
6757
- const postProcessTags = ["STYLE", "LINK", "SCRIPT"];
6889
+ const postProcessTags = [Const_1.HTML_TAG_STYLE, Const_1.HTML_TAG_LINK, Const_1.HTML_TAG_SCRIPT];
6758
6890
  const nonExecutables = mappedHeadData.filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) == -1);
6759
6891
  nonExecutables.runHeadInserts(true);
6760
6892
  //incoming either the outer head tag or its children
6761
6893
  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
6894
+ // this is stored for "post" processing
6895
+ // after the rest of the "physical build up", head before body
6764
6896
  const evalElements = nodesToAdd.stream
6765
6897
  .filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) != -1).collect(new mona_dish_1.DomQueryCollector());
6766
6898
  this.addToHeadDeferred(evalElements);
@@ -6777,17 +6909,17 @@ class ResponseProcessor {
6777
6909
  * @param shadowDocument .. an incoming shadow document hosting the new nodes
6778
6910
  */
6779
6911
  replaceBody(shadowDocument) {
6780
- let shadowBody = shadowDocument.querySelectorAll(Const_1.TAG_BODY);
6912
+ const shadowBody = shadowDocument.querySelectorAll(Const_1.HTML_TAG_BODY);
6781
6913
  if (!shadowBody.isPresent()) {
6782
6914
  return;
6783
6915
  }
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);
6916
+ const shadowInnerHTML = shadowBody.innerHTML;
6917
+ const resultingBody = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.HTML_TAG_BODY);
6918
+ const updateForms = resultingBody.querySelectorAll(Const_1.HTML_TAG_FORM);
6787
6919
  // main difference, we cannot replace the body itself, but only its content
6788
6920
  // we need a separate step for post-processing the incoming
6789
6921
  // attributes, like classes, styles etc...
6790
- resultingBody.copyAttrs(shadowBody);
6922
+ resultingBody.html(shadowInnerHTML).copyAttrs(shadowBody);
6791
6923
  this.externalContext.assign((0, Const_1.$nsp)(Const_1.P_RENDER_OVERRIDE)).value = "@all";
6792
6924
  this.storeForPostProcessing(updateForms, resultingBody);
6793
6925
  }
@@ -6812,15 +6944,15 @@ class ResponseProcessor {
6812
6944
  * <error-message><![CDATA[message]]></error-message>
6813
6945
  * <error>
6814
6946
  */
6815
- let mergedErrorData = new ExtDomQuery_1.ExtConfig({});
6947
+ const mergedErrorData = new ExtDomQuery_1.ExtConfig({});
6816
6948
  mergedErrorData.assign(Const_1.SOURCE).value = this.externalContext.getIf(Const_1.P_PARTIAL_SOURCE).get(0).value;
6817
6949
  mergedErrorData.assign(Const_1.ERROR_NAME).value = node.querySelectorAll(Const_1.ERROR_NAME).textContent(Const_1.EMPTY_STR);
6818
6950
  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();
6951
+ const hasResponseXML = this.internalContext.get(Const_1.RESPONSE_XML).isPresent();
6820
6952
  //we now store the response xml also in the error data for further details
6821
6953
  mergedErrorData.assignIf(hasResponseXML, Const_1.RESPONSE_XML).value = this.internalContext.getIf(Const_1.RESPONSE_XML).value.get(0).value;
6822
6954
  // error post-processing and enrichment (standard messages from keys)
6823
- let errorData = ErrorData_1.ErrorData.fromServerError(mergedErrorData);
6955
+ const errorData = ErrorData_1.ErrorData.fromServerError(mergedErrorData);
6824
6956
  // we now trigger an internally stored onError function which might be an attached to the context
6825
6957
  // either we do not have an internal on error, or an on error has been based via params from the outside.
6826
6958
  // In both cases they are attached to our contexts
@@ -6834,7 +6966,7 @@ class ResponseProcessor {
6834
6966
  */
6835
6967
  redirect(node) {
6836
6968
  Assertions_1.Assertions.assertUrlExists(node);
6837
- let redirectUrl = trim(node.attr(Const_1.ATTR_URL).value);
6969
+ const redirectUrl = trim(node.attr(Const_1.ATTR_URL).value);
6838
6970
  if (redirectUrl != Const_1.EMPTY_STR) {
6839
6971
  window.location.href = redirectUrl;
6840
6972
  }
@@ -6845,8 +6977,8 @@ class ResponseProcessor {
6845
6977
  * @param cdataBlock the cdata block with the new html code
6846
6978
  */
6847
6979
  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));
6980
+ const result = ExtDomQuery_1.ExtDomQuery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
6981
+ 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
6982
  if (sourceForm) {
6851
6983
  this.storeForPostProcessing(sourceForm, result);
6852
6984
  }
@@ -6864,8 +6996,8 @@ class ResponseProcessor {
6864
6996
  * @param node
6865
6997
  */
6866
6998
  attributes(node) {
6867
- let elem = mona_dish_1.DQ.byId(node.id.value, true);
6868
- node.byTagName(Const_1.TAG_ATTR).each((item) => {
6999
+ const elem = mona_dish_1.DQ.byId(node.id.value, true);
7000
+ node.byTagName(Const_1.XML_TAG_ATTR).each((item) => {
6869
7001
  elem.attr(item.attr(Const_1.ATTR_NAME).value).value = item.attr(Const_1.ATTR_VALUE).value;
6870
7002
  });
6871
7003
  }
@@ -6883,15 +7015,15 @@ class ResponseProcessor {
6883
7015
  */
6884
7016
  insert(node) {
6885
7017
  //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);
7018
+ const before = node.attr(Const_1.XML_TAG_BEFORE);
7019
+ const after = node.attr(Const_1.XML_TAG_AFTER);
7020
+ const insertNodes = mona_dish_1.DQ.fromMarkup(node.cDATAAsString);
6889
7021
  if (before.isPresent()) {
6890
7022
  mona_dish_1.DQ.byId(before.value, true).insertBefore(insertNodes);
6891
7023
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
6892
7024
  }
6893
7025
  if (after.isPresent()) {
6894
- let domQuery = mona_dish_1.DQ.byId(after.value, true);
7026
+ const domQuery = mona_dish_1.DQ.byId(after.value, true);
6895
7027
  domQuery.insertAfter(insertNodes);
6896
7028
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
6897
7029
  }
@@ -6902,19 +7034,19 @@ class ResponseProcessor {
6902
7034
  * @param node the node hosting the insert data
6903
7035
  */
6904
7036
  insertWithSubTags(node) {
6905
- let before = node.querySelectorAll(Const_1.TAG_BEFORE);
6906
- let after = node.querySelectorAll(Const_1.TAG_AFTER);
7037
+ const before = node.querySelectorAll(Const_1.XML_TAG_BEFORE);
7038
+ const after = node.querySelectorAll(Const_1.XML_TAG_AFTER);
6907
7039
  before.each(item => {
6908
- let insertId = item.attr(Const_1.ATTR_ID);
6909
- let insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
7040
+ const insertId = item.attr(Const_1.ATTR_ID);
7041
+ const insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
6910
7042
  if (insertId.isPresent()) {
6911
7043
  mona_dish_1.DQ.byId(insertId.value, true).insertBefore(insertNodes);
6912
7044
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
6913
7045
  }
6914
7046
  });
6915
7047
  after.each(item => {
6916
- let insertId = item.attr(Const_1.ATTR_ID);
6917
- let insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
7048
+ const insertId = item.attr(Const_1.ATTR_ID);
7049
+ const insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
6918
7050
  if (insertId.isPresent()) {
6919
7051
  mona_dish_1.DQ.byId(insertId.value, true).insertAfter(insertNodes);
6920
7052
  this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
@@ -6928,7 +7060,7 @@ class ResponseProcessor {
6928
7060
  */
6929
7061
  processViewState(node) {
6930
7062
  if (ResponseProcessor.isViewStateNode(node)) {
6931
- let state = node.cDATAAsString;
7063
+ const state = node.cDATAAsString;
6932
7064
  this.internalContext.assign(Const_1.APPLIED_VST, node.id.value).value = new ImplTypes_1.StateHolder((0, Const_1.$nsp)(node.id.value), state);
6933
7065
  return true;
6934
7066
  }
@@ -6936,7 +7068,7 @@ class ResponseProcessor {
6936
7068
  }
6937
7069
  processClientWindow(node) {
6938
7070
  if (ResponseProcessor.isClientWindowNode(node)) {
6939
- let state = node.cDATAAsString;
7071
+ const state = node.cDATAAsString;
6940
7072
  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
7073
  return true;
6942
7074
  }
@@ -6962,13 +7094,11 @@ class ResponseProcessor {
6962
7094
  */
6963
7095
  fixViewStates() {
6964
7096
  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);
7097
+ .each(([, value]) => {
7098
+ const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
7099
+ const affectedForms = this.getContainerForms(namingContainerId)
7100
+ .filter(affectedForm => this.isInExecuteOrRender(affectedForm));
7101
+ this.appendViewStateToForms(affectedForms, value.value, namingContainerId.orElse("").value);
6972
7102
  });
6973
7103
  }
6974
7104
  /**
@@ -6977,22 +7107,20 @@ class ResponseProcessor {
6977
7107
  */
6978
7108
  fixClientWindow() {
6979
7109
  mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
6980
- .each((item) => {
6981
- const value = item[1];
7110
+ .each(([, value]) => {
6982
7111
  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);
7112
+ const affectedForms = this.getContainerForms(namingContainerId)
7113
+ .filter(affectedForm => this.isInExecuteOrRender(affectedForm));
7114
+ this.appendClientWindowToForms(affectedForms, value.value, namingContainerId.orElse("").value);
6987
7115
  });
6988
7116
  }
6989
7117
  /**
6990
7118
  * all processing done we can close the request and send the appropriate events
6991
7119
  */
6992
7120
  done() {
6993
- let eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);
7121
+ const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);
6994
7122
  //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;
7123
+ 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
7124
  AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);
6997
7125
  }
6998
7126
  /**
@@ -7000,18 +7128,20 @@ class ResponseProcessor {
7000
7128
  *
7001
7129
  * @param forms the forms to append the viewState to
7002
7130
  * @param viewState the final viewState
7131
+ * @param namingContainerId
7003
7132
  */
7004
- appendViewStateToForms(forms, viewState) {
7005
- this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState);
7133
+ appendViewStateToForms(forms, viewState, namingContainerId = "") {
7134
+ this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState, namingContainerId);
7006
7135
  }
7007
7136
  /**
7008
7137
  * proper clientWindow -> form assignment
7009
7138
  *
7010
7139
  * @param forms the forms to append the viewState to
7011
7140
  * @param clientWindow the final viewState
7141
+ * @param namingContainerId
7012
7142
  */
7013
- appendClientWindowToForms(forms, clientWindow) {
7014
- this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow);
7143
+ appendClientWindowToForms(forms, clientWindow, namingContainerId = "") {
7144
+ this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow, namingContainerId);
7015
7145
  }
7016
7146
  /**
7017
7147
  * generic append state which appends a certain state as hidden element to an existing set of forms
@@ -7020,41 +7150,26 @@ class ResponseProcessor {
7020
7150
  * @param selector the selector for the state
7021
7151
  * @param state the state itself which needs to be assigned
7022
7152
  *
7153
+ * @param namingContainerId
7023
7154
  * @private
7024
7155
  */
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;
7156
+ assignState(forms, selector, state, namingContainerId) {
7157
+ /**
7158
+ * creates the viewState or client window id element
7159
+ * @param form
7160
+ */
7161
+ const createAndAppendHiddenInput = (form) => {
7162
+ return new HiddenInputBuilder_1.HiddenInputBuilder(selector)
7163
+ .withNamingContainerId(namingContainerId)
7164
+ .withParent(form)
7165
+ .build();
7166
+ };
7167
+ forms.each(form => {
7168
+ const hiddenInput = form.querySelectorAll(selector)
7169
+ .orElseLazy(() => createAndAppendHiddenInput(form));
7170
+ hiddenInput.val = state;
7034
7171
  });
7035
7172
  }
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
7173
  /**
7059
7174
  * Stores certain aspects of the dom for later post-processing
7060
7175
  *
@@ -7088,11 +7203,11 @@ class ResponseProcessor {
7088
7203
  * @returns if it is a viewState node
7089
7204
  */
7090
7205
  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);
7206
+ var _a, _b, _c, _d, _e, _f;
7207
+ const SEP = (0, Const_1.$faces)().separatorchar;
7208
+ 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) ||
7209
+ ((_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 ||
7210
+ ((_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
7211
  }
7097
7212
  /**
7098
7213
  * incoming client window node also needs special processing
@@ -7101,11 +7216,11 @@ class ResponseProcessor {
7101
7216
  * @returns true of it ii
7102
7217
  */
7103
7218
  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);
7219
+ var _a, _b, _c, _d, _e, _f;
7220
+ const SEP = (0, Const_1.$faces)().separatorchar;
7221
+ 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) ||
7222
+ ((_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 ||
7223
+ ((_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
7224
  }
7110
7225
  triggerOnError(errorData) {
7111
7226
  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 +7230,21 @@ class ResponseProcessor {
7115
7230
  * @param affectedForm
7116
7231
  * @private
7117
7232
  */
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)
7233
+ isInExecuteOrRender(affectedForm) {
7234
+ const executes = this.externalContext.getIf((0, Const_1.$nsp)(Const_1.P_EXECUTE)).orElse("@none").value.split(/\s+/gi);
7235
+ const renders = this.externalContext.getIf(Const_1.P_RENDER_OVERRIDE)
7121
7236
  .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);
7237
+ .orElse(Const_1.IDENT_NONE).value.split(/\s+/gi);
7238
+ const executeAndRenders = executes.concat(...renders);
7124
7239
  return mona_dish_1.LazyStream.of(...executeAndRenders).filter(nameOrId => {
7125
- if (nameOrId == "@all") {
7126
- return true;
7127
- }
7128
- if (nameOrId == "@none") {
7240
+ if ([Const_1.IDENT_ALL, Const_1.IDENT_NONE].indexOf(nameOrId) != -1) {
7129
7241
  return true;
7130
7242
  }
7131
- const nameOrIdSelector = `[id='${nameOrId}'], [name='#${nameOrId}']`;
7243
+ const NAME_OR_ID = this.getNameOrIdSelector(nameOrId);
7132
7244
  //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();
7245
+ return affectedForm.matchesSelector(NAME_OR_ID) ||
7246
+ affectedForm.querySelectorAll(NAME_OR_ID).isPresent() ||
7247
+ affectedForm.firstParent(NAME_OR_ID).isPresent();
7136
7248
  }).first().isPresent();
7137
7249
  }
7138
7250
  /**
@@ -7143,17 +7255,19 @@ class ResponseProcessor {
7143
7255
  getContainerForms(namingContainerId) {
7144
7256
  if (namingContainerId.isPresent()) {
7145
7257
  //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}']`))
7258
+ return (0, mona_dish_1.DQ$)(this.getNameOrIdSelector(namingContainerId.value))
7148
7259
  // missing condition if the naming container is not present we have to
7149
7260
  // use the body as fallback
7150
- .orElse(mona_dish_1.DQ.byTagName(Const_1.TAG_BODY))
7151
- .byTagName(Const_1.TAG_FORM, true);
7261
+ .orElseLazy(() => mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_BODY))
7262
+ .byTagName(Const_1.HTML_TAG_FORM, true);
7152
7263
  }
7153
7264
  else {
7154
- return mona_dish_1.DQ.byTagName(Const_1.TAG_FORM);
7265
+ return mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_FORM);
7155
7266
  }
7156
7267
  }
7268
+ getNameOrIdSelector(nameOrId) {
7269
+ return `[id='${nameOrId}'], [name='${nameOrId}']`;
7270
+ }
7157
7271
  }
7158
7272
  exports.ResponseProcessor = ResponseProcessor;
7159
7273
 
@@ -7277,7 +7391,7 @@ class XhrFormData extends mona_dish_1.Config {
7277
7391
  * @param form the form holding the view state value
7278
7392
  */
7279
7393
  applyViewState(form) {
7280
- let viewState = form.byId(Const_1.P_VIEWSTATE, true).inputValue;
7394
+ let viewState = form.querySelectorAllDeep(`[name*='${Const_1.P_VIEWSTATE}'`).inputValue;
7281
7395
  this.appendIf(viewState.isPresent(), Const_1.P_VIEWSTATE).value = viewState.value;
7282
7396
  }
7283
7397
  /**
@@ -7502,15 +7616,14 @@ class XhrRequest {
7502
7616
  });
7503
7617
  }
7504
7618
  start() {
7505
- var _a;
7506
7619
  let ignoreErr = failSaveExecute;
7507
7620
  let xhrObject = this.xhrObject;
7508
7621
  let executesArr = () => {
7509
- return this.requestContext.getIf(Const_1.CTX_PARAM_PASS_THR, Const_1.P_EXECUTE).get("none").value.split(/\s+/gi);
7622
+ return this.requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).get("none").value.split(/\s+/gi);
7510
7623
  };
7511
7624
  try {
7512
7625
  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);
7626
+ let viewState = (0, Const_1.$faces)().getViewState(formElement);
7514
7627
  // encoded we need to decode
7515
7628
  // We generated a base representation of the current form
7516
7629
  // in case someone has overloaded the viewState with additional decorators we merge
@@ -7524,12 +7637,12 @@ class XhrRequest {
7524
7637
  this.contentType = formData.isMultipartRequest ? "undefined" : this.contentType;
7525
7638
  // next step the pass through parameters are merged in for post params
7526
7639
  let requestContext = this.requestContext;
7527
- let passThroughParams = requestContext.getIf(Const_1.CTX_PARAM_PASS_THR);
7640
+ let requestPassThroughParams = requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR);
7528
7641
  // this is an extension where we allow pass through parameters to be sent down additionally
7529
7642
  // this can be used and is used in the impl to enrich the post request parameters with additional
7530
7643
  // information
7531
- formData.shallowMerge(passThroughParams, true, true);
7532
- this.responseContext = passThroughParams.deepCopy;
7644
+ formData.shallowMerge(requestPassThroughParams, true, true);
7645
+ this.responseContext = requestPassThroughParams.deepCopy;
7533
7646
  // we have to shift the internal passthroughs around to build up our response context
7534
7647
  let responseContext = this.responseContext;
7535
7648
  responseContext.assign(Const_1.CTX_PARAM_MF_INTERNAL).value = this.internalContext.value;
@@ -7647,7 +7760,7 @@ class XhrRequest {
7647
7760
  reject();
7648
7761
  }
7649
7762
  onSuccess(resolve) {
7650
- var _a, _b, _c;
7763
+ var _a, _b;
7651
7764
  this.sendEvent(Const_1.COMPLETE);
7652
7765
  // malformed responses always result in empty response xml
7653
7766
  // per spec a valid response cannot be empty
@@ -7655,7 +7768,7 @@ class XhrRequest {
7655
7768
  this.handleMalFormedXML(resolve);
7656
7769
  return;
7657
7770
  }
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 : {});
7771
+ (0, Const_1.$faces)().ajax.response(this.xhrObject, (_b = this.responseContext.value) !== null && _b !== void 0 ? _b : {});
7659
7772
  }
7660
7773
  handleMalFormedXML(resolve) {
7661
7774
  var _a;