jsf.js_next_gen 4.0.0-RC.3 → 4.0.0-RC.6

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.
@@ -8280,11 +8280,11 @@ var oam;
8280
8280
  }
8281
8281
  mona_dish_1.DQ.byId(element).delete();
8282
8282
  };
8283
- // noinspection JSUnusedGlobalSymbols
8283
+ // noinspection JSUnusedGlobalSymbols,JSUnusedLocalSymbols
8284
8284
  /**
8285
8285
  * does special form submit remapping
8286
8286
  * re-maps the issuing command link into something,
8287
- * a decode of the command link on the server can understand
8287
+ * the "decode" of the command link on the server can understand
8288
8288
  *
8289
8289
  * @param formName
8290
8290
  * @param linkId
@@ -8292,19 +8292,26 @@ var oam;
8292
8292
  * @param params
8293
8293
  */
8294
8294
  oam.submitForm = function (formName, linkId, target, params) {
8295
- var _a, _b, _c, _d;
8295
+ var _a, _b, _c, _d, _e, _f;
8296
+ if (linkId === void 0) { linkId = null; }
8297
+ if (target === void 0) { target = null; }
8298
+ if (params === void 0) { params = {}; }
8299
+ //handle a possible incoming null, not sure if this is used that way anywhere, but we allow it
8300
+ params = (!params) ? {} : params;
8296
8301
  var clearFn = 'clearFormHiddenParams_' + formName.replace(/-/g, '\$:').replace(/:/g, '_');
8297
8302
  (_a = window === null || window === void 0 ? void 0 : window[clearFn]) === null || _a === void 0 ? void 0 : _a.call(window, formName);
8298
8303
  //autoscroll code
8299
8304
  if (((_d = (_c = (_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.config) === null || _d === void 0 ? void 0 : _d.autoScroll) && (window === null || window === void 0 ? void 0 : window.getScrolling)) {
8300
8305
  myfaces.oam.setHiddenInput(formName, 'autoScroll', window === null || window === void 0 ? void 0 : window.getScrolling());
8301
8306
  }
8302
- mona_dish_1.Stream.ofAssoc(params).each(function (param) {
8303
- myfaces.oam.setHiddenInput(formName, param[0], param[1]);
8307
+ var paramsStream = Array.isArray(params) ? mona_dish_1.Stream.of.apply(mona_dish_1.Stream, params) : mona_dish_1.Stream.ofAssoc(params);
8308
+ paramsStream.each(function (_a) {
8309
+ var key = _a[0], data = _a[1];
8310
+ return myfaces.oam.setHiddenInput(formName, key, data);
8304
8311
  });
8305
8312
  //we call the namespaced function, to allow decoration, via a direct call we would
8306
- myfaces.oam.setHiddenInput(formName, "".concat(formName, ":_idcl"), linkId);
8307
- mona_dish_1.DQ.byId(document.forms[formName]).each(function (form) {
8313
+ myfaces.oam.setHiddenInput(formName, "".concat(formName, ":_idcl"), linkId !== null && linkId !== void 0 ? linkId : '');
8314
+ mona_dish_1.DQ.byId((_f = (_e = document.forms) === null || _e === void 0 ? void 0 : _e[formName]) !== null && _f !== void 0 ? _f : document.getElementById(formName)).each(function (form) {
8308
8315
  var _a;
8309
8316
  var ATTR_TARGET = "target";
8310
8317
  var formElement = form.getAsElem(0).value;
@@ -8321,8 +8328,10 @@ var oam;
8321
8328
  }
8322
8329
  finally {
8323
8330
  form.attr(ATTR_TARGET).value = oldTarget;
8324
- mona_dish_1.Stream.ofAssoc(params).each(function (param) {
8325
- myfaces.oam.clearHiddenInput(formName, param[0]);
8331
+ // noinspection JSUnusedLocalSymbols
8332
+ paramsStream.each(function (_a) {
8333
+ var key = _a[0], data = _a[1];
8334
+ myfaces.oam.clearHiddenInput(formName, key);
8326
8335
  });
8327
8336
  myfaces.oam.clearHiddenInput(formName, "".concat(formName, ":_idcl"));
8328
8337
  }
Binary file
Binary file