jsf.js_next_gen 4.0.0-RC.17 → 4.0.0-RC.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/window/faces-development.js +33 -22
  2. package/dist/window/faces-development.js.br +0 -0
  3. package/dist/window/faces-development.js.gz +0 -0
  4. package/dist/window/faces-development.js.map +1 -1
  5. package/dist/window/faces.js +1 -1
  6. package/dist/window/faces.js.br +0 -0
  7. package/dist/window/faces.js.gz +0 -0
  8. package/dist/window/faces.js.map +1 -1
  9. package/dist/window/jsf-development.js +33 -22
  10. package/dist/window/jsf-development.js.br +0 -0
  11. package/dist/window/jsf-development.js.gz +0 -0
  12. package/dist/window/jsf-development.js.map +1 -1
  13. package/dist/window/jsf.js +1 -1
  14. package/dist/window/jsf.js.br +0 -0
  15. package/dist/window/jsf.js.gz +0 -0
  16. package/dist/window/jsf.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/main/typescript/api/_api.ts +3 -2
  19. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +4 -2
  20. package/src/main/typescript/impl/xhrCore/ErrorData.ts +11 -8
  21. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +5 -5
  22. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +3 -3
  23. package/src/main/typescript/myfaces/OamSubmit.ts +14 -3
  24. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +1 -1
  25. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +2 -2
  26. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +2 -2
  27. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +1 -1
  28. package/target/api/_api.js +4 -3
  29. package/target/api/_api.js.map +1 -1
  30. package/target/impl/util/HiddenInputBuilder.js +4 -2
  31. package/target/impl/util/HiddenInputBuilder.js.map +1 -1
  32. package/target/impl/xhrCore/ErrorData.js +7 -6
  33. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  34. package/target/impl/xhrCore/ResponseProcessor.js +5 -5
  35. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  36. package/target/impl/xhrCore/XhrRequest.js +3 -3
  37. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  38. package/target/myfaces/OamSubmit.js +10 -3
  39. package/target/myfaces/OamSubmit.js.map +1 -1
  40. package/target/test/xhrCore/EventTests.spec.js +1 -1
  41. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  42. package/target/test/xhrCore/RequestTest.spec.js +1 -1
  43. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  44. package/target/test/xhrCore/RequestTest_23.spec.js +1 -1
  45. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  46. package/target/test/xhrCore/ResponseTest.spec.js +1 -1
  47. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
@@ -4077,9 +4077,10 @@ var myfaces;
4077
4077
  * @param options
4078
4078
  */
4079
4079
  function ab(source, event, eventName, execute, render, options = {}) {
4080
- var _a;
4080
+ var _a, _b;
4081
4081
  if (eventName) {
4082
- options[(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
4082
+ options[Const_1.CTX_OPTIONS_PARAMS] = (_a = options === null || options === void 0 ? void 0 : options[Const_1.CTX_OPTIONS_PARAMS]) !== null && _a !== void 0 ? _a : {};
4083
+ options[Const_1.CTX_OPTIONS_PARAMS][(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
4083
4084
  }
4084
4085
  if (execute) {
4085
4086
  options[Const_1.CTX_OPTIONS_EXECUTE] = execute;
@@ -4087,7 +4088,7 @@ var myfaces;
4087
4088
  if (render) {
4088
4089
  options[Const_1.CTX_PARAM_RENDER] = render;
4089
4090
  }
4090
- ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window.jsf).ajax.request(source, event, options);
4091
+ ((_b = window === null || window === void 0 ? void 0 : window.faces) !== null && _b !== void 0 ? _b : window.jsf).ajax.request(source, event, options);
4091
4092
  }
4092
4093
  myfaces.ab = ab;
4093
4094
  /**
@@ -5983,8 +5984,10 @@ class HiddenInputBuilder {
5983
5984
  let cnt = existingStates.stream.map(state => {
5984
5985
  let ident = state.id.orElse("-1").value;
5985
5986
  ident = ident.substring(ident.lastIndexOf(SEP) + 1);
5986
- return parseInt(ident) || -1;
5987
- }).reduce((item1, item2) => Math.max(item1, item2), -1).value;
5987
+ return parseInt(ident);
5988
+ })
5989
+ .filter(item => !isNaN(item))
5990
+ .reduce((item1, item2) => Math.max(item1, item2), -1).value;
5988
5991
  //the maximum new ident is the current max + 1
5989
5992
  cnt++;
5990
5993
  const newElement = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(this.template));
@@ -6260,14 +6263,15 @@ var ErrorType;
6260
6263
  * I will add deprecated myfaces backwards compatibility attributes as well
6261
6264
  */
6262
6265
  class ErrorData extends EventData_1.EventData {
6263
- constructor(source, errorName, errorMessage, responseText = null, responseXML = null, responseCode = "200", status = "UNKNOWN", type = ErrorType.CLIENT_ERROR) {
6266
+ constructor(source, errorName, errorMessage, responseText = null, responseXML = null, responseCode = "200", status = "", type = ErrorType.CLIENT_ERROR) {
6264
6267
  super();
6265
6268
  this.type = "error";
6266
6269
  this.source = document.getElementById(source);
6267
6270
  this.sourceId = source;
6268
- this.type = "error";
6271
+ this.type = Const_1.ERROR;
6269
6272
  this.errorName = errorName;
6270
- this.message = this.errorMessage = errorMessage;
6273
+ //tck requires that the type is prefixed to the message itself (jsdoc also) in case of a server error
6274
+ this.message = this.errorMessage = (type == Const_1.SERVER_ERROR) ? type + ": " + errorMessage : errorMessage;
6271
6275
  this.responseCode = responseCode;
6272
6276
  this.responseText = responseText;
6273
6277
  this.status = status;
@@ -6279,9 +6283,9 @@ class ErrorData extends EventData_1.EventData {
6279
6283
  }
6280
6284
  static fromClient(e) {
6281
6285
  var _a, _b, _c, _d;
6282
- return new ErrorData((_a = e === null || e === void 0 ? void 0 : e.source) !== null && _a !== void 0 ? _a : "client", (_b = e === null || e === void 0 ? void 0 : e.name) !== null && _b !== void 0 ? _b : '', (_c = e === null || e === void 0 ? void 0 : e.message) !== null && _c !== void 0 ? _c : '', (_d = e === null || e === void 0 ? void 0 : e.stack) !== null && _d !== void 0 ? _d : '');
6286
+ return new ErrorData((_a = e === null || e === void 0 ? void 0 : e.source) !== null && _a !== void 0 ? _a : "client", (_b = e === null || e === void 0 ? void 0 : e.name) !== null && _b !== void 0 ? _b : Const_1.EMPTY_STR, (_c = e === null || e === void 0 ? void 0 : e.message) !== null && _c !== void 0 ? _c : Const_1.EMPTY_STR, (_d = e === null || e === void 0 ? void 0 : e.stack) !== null && _d !== void 0 ? _d : Const_1.EMPTY_STR);
6283
6287
  }
6284
- static fromHttpConnection(source, name, message, responseText, responseCode, status = 'UNKNOWN') {
6288
+ static fromHttpConnection(source, name, message, responseText, responseCode, status = Const_1.EMPTY_STR) {
6285
6289
  return new ErrorData(source, name, message, responseText, responseCode, `${responseCode}`, status, ErrorType.HTTP_ERROR);
6286
6290
  }
6287
6291
  static fromGeneric(context, errorCode, errorType = ErrorType.SERVER_ERROR) {
@@ -6295,7 +6299,7 @@ class ErrorData extends EventData_1.EventData {
6295
6299
  return new ErrorData(source, errorName, errorMessage, responseText, responseXML, errorCode + Const_1.EMPTY_STR, status, errorType);
6296
6300
  }
6297
6301
  static getMsg(context, param) {
6298
- return getMessage(context.getIf(param).orElse(Const_1.UNKNOWN).value);
6302
+ return getMessage(context.getIf(param).orElse(Const_1.EMPTY_STR).value);
6299
6303
  }
6300
6304
  static fromServerError(context) {
6301
6305
  return this.fromGeneric(context, -1);
@@ -6893,16 +6897,16 @@ class ResponseProcessor {
6893
6897
  }
6894
6898
  addToHead(shadowHead) {
6895
6899
  const mappedHeadData = new ExtDomQuery_1.ExtDomQuery(shadowHead);
6896
- const postProcessTags = [Const_1.HTML_TAG_STYLE, Const_1.HTML_TAG_LINK, Const_1.HTML_TAG_SCRIPT];
6897
- const nonExecutables = mappedHeadData.filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) == -1);
6900
+ const scriptTags = [Const_1.HTML_TAG_SCRIPT];
6901
+ const nonExecutables = mappedHeadData.filter(item => scriptTags.indexOf(item.tagName.orElse("").value) == -1);
6898
6902
  nonExecutables.runHeadInserts(true);
6899
6903
  //incoming either the outer head tag or its children
6900
6904
  const nodesToAdd = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
6901
6905
  // this is stored for "post" processing
6902
6906
  // after the rest of the "physical build up", head before body
6903
- const evalElements = nodesToAdd.stream
6904
- .filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) != -1).collect(new mona_dish_1.DomQueryCollector());
6905
- this.addToHeadDeferred(evalElements);
6907
+ const scriptElements = nodesToAdd.stream
6908
+ .filter(item => scriptTags.indexOf(item.tagName.orElse("").value) != -1).collect(new mona_dish_1.DomQueryCollector());
6909
+ this.addToHeadDeferred(scriptElements);
6906
6910
  }
6907
6911
  addToHeadDeferred(newElements) {
6908
6912
  this.internalContext.assign(Const_1.DEFERRED_HEAD_INSERTS).value.push(newElements);
@@ -7785,9 +7789,9 @@ class XhrRequest {
7785
7789
  status: Const_1.MALFORMEDXML,
7786
7790
  responseCode: 200,
7787
7791
  responseText: (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseText,
7788
- source: {
7789
- id: this.source.id.value
7790
- }
7792
+ // we remap the element just in case it gets replaced
7793
+ // it will be unremapped
7794
+ source: this.source.id.value
7791
7795
  };
7792
7796
  try {
7793
7797
  this.handleError(errorData, true);
@@ -7953,8 +7957,10 @@ var oam;
7953
7957
  var _a;
7954
7958
  const ATTR_TARGET = "target";
7955
7959
  const formElement = form.getAsElem(0).value;
7956
- const oldTarget = form.attr(ATTR_TARGET).value;
7957
- form.attr(ATTR_TARGET).value = target;
7960
+ const oldTarget = form.getAsElem(0).value.getAttribute("target");
7961
+ if (target != "null" && target) {
7962
+ form.getAsElem(0).value.setAttribute("target", target);
7963
+ }
7958
7964
  const result = (_a = formElement === null || formElement === void 0 ? void 0 : formElement.onsubmit) === null || _a === void 0 ? void 0 : _a.call(formElement, null);
7959
7965
  try {
7960
7966
  if ((!!result) || 'undefined' == typeof result) {
@@ -7965,7 +7971,12 @@ var oam;
7965
7971
  window === null || window === void 0 ? void 0 : window.console.error(e);
7966
7972
  }
7967
7973
  finally {
7968
- form.attr(ATTR_TARGET).value = oldTarget;
7974
+ if (oldTarget == null || oldTarget == "null") {
7975
+ form.getAsElem(0).value.removeAttribute("target");
7976
+ }
7977
+ else {
7978
+ form.getAsElem(0).value.setAttribute("target", oldTarget);
7979
+ }
7969
7980
  // noinspection JSUnusedLocalSymbols
7970
7981
  paramsStream.each(([key, data]) => {
7971
7982
  myfaces.oam.clearHiddenInput(formName, key);
Binary file
Binary file