jsf.js_next_gen 4.0.0-RC.18 → 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 (44) hide show
  1. package/dist/window/faces-development.js +29 -20
  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 +29 -20
  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/xhrCore/ErrorData.ts +11 -8
  20. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +5 -5
  21. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +3 -3
  22. package/src/main/typescript/myfaces/OamSubmit.ts +14 -3
  23. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +1 -1
  24. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +2 -2
  25. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +2 -2
  26. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +1 -1
  27. package/target/api/_api.js +4 -3
  28. package/target/api/_api.js.map +1 -1
  29. package/target/impl/xhrCore/ErrorData.js +7 -6
  30. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  31. package/target/impl/xhrCore/ResponseProcessor.js +5 -5
  32. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  33. package/target/impl/xhrCore/XhrRequest.js +3 -3
  34. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  35. package/target/myfaces/OamSubmit.js +10 -3
  36. package/target/myfaces/OamSubmit.js.map +1 -1
  37. package/target/test/xhrCore/EventTests.spec.js +1 -1
  38. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  39. package/target/test/xhrCore/RequestTest.spec.js +1 -1
  40. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  41. package/target/test/xhrCore/RequestTest_23.spec.js +1 -1
  42. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  43. package/target/test/xhrCore/ResponseTest.spec.js +1 -1
  44. 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
  /**
@@ -6262,14 +6263,15 @@ var ErrorType;
6262
6263
  * I will add deprecated myfaces backwards compatibility attributes as well
6263
6264
  */
6264
6265
  class ErrorData extends EventData_1.EventData {
6265
- 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) {
6266
6267
  super();
6267
6268
  this.type = "error";
6268
6269
  this.source = document.getElementById(source);
6269
6270
  this.sourceId = source;
6270
- this.type = "error";
6271
+ this.type = Const_1.ERROR;
6271
6272
  this.errorName = errorName;
6272
- 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;
6273
6275
  this.responseCode = responseCode;
6274
6276
  this.responseText = responseText;
6275
6277
  this.status = status;
@@ -6281,9 +6283,9 @@ class ErrorData extends EventData_1.EventData {
6281
6283
  }
6282
6284
  static fromClient(e) {
6283
6285
  var _a, _b, _c, _d;
6284
- 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);
6285
6287
  }
6286
- static fromHttpConnection(source, name, message, responseText, responseCode, status = 'UNKNOWN') {
6288
+ static fromHttpConnection(source, name, message, responseText, responseCode, status = Const_1.EMPTY_STR) {
6287
6289
  return new ErrorData(source, name, message, responseText, responseCode, `${responseCode}`, status, ErrorType.HTTP_ERROR);
6288
6290
  }
6289
6291
  static fromGeneric(context, errorCode, errorType = ErrorType.SERVER_ERROR) {
@@ -6297,7 +6299,7 @@ class ErrorData extends EventData_1.EventData {
6297
6299
  return new ErrorData(source, errorName, errorMessage, responseText, responseXML, errorCode + Const_1.EMPTY_STR, status, errorType);
6298
6300
  }
6299
6301
  static getMsg(context, param) {
6300
- return getMessage(context.getIf(param).orElse(Const_1.UNKNOWN).value);
6302
+ return getMessage(context.getIf(param).orElse(Const_1.EMPTY_STR).value);
6301
6303
  }
6302
6304
  static fromServerError(context) {
6303
6305
  return this.fromGeneric(context, -1);
@@ -6895,16 +6897,16 @@ class ResponseProcessor {
6895
6897
  }
6896
6898
  addToHead(shadowHead) {
6897
6899
  const mappedHeadData = new ExtDomQuery_1.ExtDomQuery(shadowHead);
6898
- const postProcessTags = [Const_1.HTML_TAG_STYLE, Const_1.HTML_TAG_LINK, Const_1.HTML_TAG_SCRIPT];
6899
- 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);
6900
6902
  nonExecutables.runHeadInserts(true);
6901
6903
  //incoming either the outer head tag or its children
6902
6904
  const nodesToAdd = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
6903
6905
  // this is stored for "post" processing
6904
6906
  // after the rest of the "physical build up", head before body
6905
- const evalElements = nodesToAdd.stream
6906
- .filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) != -1).collect(new mona_dish_1.DomQueryCollector());
6907
- 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);
6908
6910
  }
6909
6911
  addToHeadDeferred(newElements) {
6910
6912
  this.internalContext.assign(Const_1.DEFERRED_HEAD_INSERTS).value.push(newElements);
@@ -7787,9 +7789,9 @@ class XhrRequest {
7787
7789
  status: Const_1.MALFORMEDXML,
7788
7790
  responseCode: 200,
7789
7791
  responseText: (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseText,
7790
- source: {
7791
- id: this.source.id.value
7792
- }
7792
+ // we remap the element just in case it gets replaced
7793
+ // it will be unremapped
7794
+ source: this.source.id.value
7793
7795
  };
7794
7796
  try {
7795
7797
  this.handleError(errorData, true);
@@ -7955,8 +7957,10 @@ var oam;
7955
7957
  var _a;
7956
7958
  const ATTR_TARGET = "target";
7957
7959
  const formElement = form.getAsElem(0).value;
7958
- const oldTarget = form.attr(ATTR_TARGET).value;
7959
- 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
+ }
7960
7964
  const result = (_a = formElement === null || formElement === void 0 ? void 0 : formElement.onsubmit) === null || _a === void 0 ? void 0 : _a.call(formElement, null);
7961
7965
  try {
7962
7966
  if ((!!result) || 'undefined' == typeof result) {
@@ -7967,7 +7971,12 @@ var oam;
7967
7971
  window === null || window === void 0 ? void 0 : window.console.error(e);
7968
7972
  }
7969
7973
  finally {
7970
- 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
+ }
7971
7980
  // noinspection JSUnusedLocalSymbols
7972
7981
  paramsStream.each(([key, data]) => {
7973
7982
  myfaces.oam.clearHiddenInput(formName, key);
Binary file
Binary file