jsf.js_next_gen 4.0.0-RC.27 → 4.0.0-RC.28
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.
- package/dist/window/faces-development.js +17 -44
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +17 -44
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +1 -1
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +1 -21
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +16 -13
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +3 -14
- package/target/impl/xhrCore/RequestDataResolver.js +1 -21
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +14 -12
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +2 -11
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
|
@@ -6531,7 +6531,7 @@ exports.EventData = EventData;
|
|
|
6531
6531
|
* limitations under the License.
|
|
6532
6532
|
*/
|
|
6533
6533
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6534
|
-
exports.resolveDefaults = exports.getEventTarget = exports.resolveWindowId = exports.resolveDelay = exports.resolveTimeout = exports.
|
|
6534
|
+
exports.resolveDefaults = exports.getEventTarget = exports.resolveWindowId = exports.resolveDelay = exports.resolveTimeout = exports.resoveNamingContainerMapper = exports.resolveViewRootId = exports.resolveViewId = exports.resolveForm = exports.resolveFinalUrl = exports.resolveTargetUrl = exports.resolveHandlerFunc = void 0;
|
|
6535
6535
|
const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
6536
6536
|
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
6537
6537
|
const Lang_1 = __webpack_require__(/*! ../util/Lang */ "./src/main/typescript/impl/util/Lang.ts");
|
|
@@ -6617,26 +6617,6 @@ function resoveNamingContainerMapper(internalContext) {
|
|
|
6617
6617
|
return (key, value) => (key.indexOf(prefix) == 0) ? [key, value] : [prefix + key, value];
|
|
6618
6618
|
}
|
|
6619
6619
|
exports.resoveNamingContainerMapper = resoveNamingContainerMapper;
|
|
6620
|
-
/**
|
|
6621
|
-
* we provide the same for configs
|
|
6622
|
-
* @param internalContext
|
|
6623
|
-
*/
|
|
6624
|
-
function resoveConfigNamingContainerMapper(internalContext) {
|
|
6625
|
-
const isNamedViewRoot = internalContext.getIf(Const_1.NAMED_VIEWROOT).isPresent();
|
|
6626
|
-
if (!isNamedViewRoot) {
|
|
6627
|
-
return;
|
|
6628
|
-
}
|
|
6629
|
-
const partialId = internalContext.getIf(Const_1.NAMING_CONTAINER_ID).value;
|
|
6630
|
-
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
6631
|
-
const prefix = partialId + SEP;
|
|
6632
|
-
return (config) => {
|
|
6633
|
-
let assoc = config.stream
|
|
6634
|
-
.map(([key, data]) => (key.indexOf(prefix) == 0) ? [key, data] : [prefix + key, data])
|
|
6635
|
-
.collect(new mona_dish_1.AssocArrayCollector());
|
|
6636
|
-
return new ExtDomQuery_1.ExtConfig(assoc);
|
|
6637
|
-
};
|
|
6638
|
-
}
|
|
6639
|
-
exports.resoveConfigNamingContainerMapper = resoveConfigNamingContainerMapper;
|
|
6640
6620
|
function resolveTimeout(options) {
|
|
6641
6621
|
var _a;
|
|
6642
6622
|
let getCfg = Lang_1.ExtLang.getLocalOrGlobalConfig;
|
|
@@ -7575,9 +7555,9 @@ class XhrFormData extends mona_dish_1.Config {
|
|
|
7575
7555
|
//a call from getViewState passes the form element as datasource,
|
|
7576
7556
|
//so we have two call points
|
|
7577
7557
|
// atm we basically encode twice, to keep the code leaner
|
|
7578
|
-
// this will be later
|
|
7579
|
-
// which are already covered by an external
|
|
7580
|
-
// the encoding a second time, because they are overwritten by the
|
|
7558
|
+
// this will be later optmized, practically elements
|
|
7559
|
+
// which are already covered by an external viewstate do not need
|
|
7560
|
+
// the encoding a second time, because they are overwritten by the viewstate again
|
|
7581
7561
|
if (isString(dataSource)) {
|
|
7582
7562
|
this.assignEncodedString(this.dataSource);
|
|
7583
7563
|
}
|
|
@@ -7629,15 +7609,15 @@ class XhrFormData extends mona_dish_1.Config {
|
|
|
7629
7609
|
applyViewState(form) {
|
|
7630
7610
|
let viewStateElement = form.querySelectorAllDeep(`[name*='${(0, Const_1.$nsp)(Const_1.P_VIEWSTATE)}'`);
|
|
7631
7611
|
let viewState = viewStateElement.inputValue;
|
|
7632
|
-
|
|
7633
|
-
this.
|
|
7612
|
+
// this.appendIf(viewState.isPresent(), P_VIEWSTATE).value = viewState.value;
|
|
7613
|
+
this.appendIf(viewState.isPresent(), this.remapKeyForNamingContainer(viewStateElement.name.value)).value = viewState.value;
|
|
7634
7614
|
}
|
|
7635
7615
|
/**
|
|
7636
7616
|
* assigns an url encoded string to this xhrFormData object
|
|
7637
7617
|
* as key value entry
|
|
7638
7618
|
* @param encoded
|
|
7639
7619
|
*/
|
|
7640
|
-
assignEncodedString(encoded
|
|
7620
|
+
assignEncodedString(encoded) {
|
|
7641
7621
|
// this code filters out empty strings as key value pairs
|
|
7642
7622
|
let keyValueEntries = decodeURIComponent(encoded).split(/&/gi)
|
|
7643
7623
|
.filter(item => !!(item || '')
|
|
@@ -7648,7 +7628,7 @@ class XhrFormData extends mona_dish_1.Config {
|
|
|
7648
7628
|
* assign a set of key value pairs passed as array ['key=val1', 'key2=val2']
|
|
7649
7629
|
* @param keyValueEntries
|
|
7650
7630
|
*/
|
|
7651
|
-
assignString(keyValueEntries
|
|
7631
|
+
assignString(keyValueEntries) {
|
|
7652
7632
|
let toMerge = new ExtDomQuery_1.ExtConfig({});
|
|
7653
7633
|
function splitToKeyVal(line) {
|
|
7654
7634
|
return line.split(/=(.*)/gi);
|
|
@@ -7667,7 +7647,7 @@ class XhrFormData extends mona_dish_1.Config {
|
|
|
7667
7647
|
toMerge.append(keyVal[0]).value = (_b = (_a = keyVal === null || keyVal === void 0 ? void 0 : keyVal.splice(1)) === null || _a === void 0 ? void 0 : _a.join("")) !== null && _b !== void 0 ? _b : "";
|
|
7668
7648
|
});
|
|
7669
7649
|
//merge with overwrite but no append! (aka no double entries are allowed)
|
|
7670
|
-
this.shallowMerge(toMerge
|
|
7650
|
+
this.shallowMerge(toMerge);
|
|
7671
7651
|
}
|
|
7672
7652
|
/**
|
|
7673
7653
|
* @param paramsMapper ... pre encode the params if needed, default is to map them 1:1
|
|
@@ -7759,18 +7739,20 @@ class XhrFormData extends mona_dish_1.Config {
|
|
|
7759
7739
|
}
|
|
7760
7740
|
//lets encode the form elements
|
|
7761
7741
|
let formElements = toEncode.deepElements.encodeFormElement();
|
|
7762
|
-
const mapped = this.
|
|
7742
|
+
const mapped = this.remapKeysForNamingCoontainer(formElements);
|
|
7763
7743
|
this.shallowMerge(mapped);
|
|
7764
7744
|
}
|
|
7765
|
-
|
|
7745
|
+
remapKeysForNamingCoontainer(formElements) {
|
|
7766
7746
|
let ret = new mona_dish_1.Config({});
|
|
7767
|
-
formElements.stream
|
|
7768
|
-
.map(([key, item]) => this.paramsMapper(key, item))
|
|
7747
|
+
formElements.stream.map(([key, item]) => this.paramsMapper(key, item))
|
|
7769
7748
|
.each(([key, item]) => {
|
|
7770
7749
|
ret.assign(key).value = item;
|
|
7771
7750
|
});
|
|
7772
7751
|
return ret;
|
|
7773
7752
|
}
|
|
7753
|
+
remapKeyForNamingContainer(key) {
|
|
7754
|
+
return this.paramsMapper(key, "")[0];
|
|
7755
|
+
}
|
|
7774
7756
|
appendInputs(ret) {
|
|
7775
7757
|
mona_dish_1.Stream.ofAssoc(this.value)
|
|
7776
7758
|
.flatMap(([key, item]) => mona_dish_1.Stream.of(...item).map(item => {
|
|
@@ -7876,8 +7858,6 @@ class XhrRequest {
|
|
|
7876
7858
|
};
|
|
7877
7859
|
try {
|
|
7878
7860
|
let formElement = this.sourceForm.getAsElem(0).value;
|
|
7879
|
-
// by spec the viewstate must be called to provide
|
|
7880
|
-
// decorated encoding capabilities
|
|
7881
7861
|
let viewState = (0, Const_1.$faces)().getViewState(formElement);
|
|
7882
7862
|
// encoded we need to decode
|
|
7883
7863
|
// We generated a base representation of the current form
|
|
@@ -7887,11 +7867,8 @@ class XhrRequest {
|
|
|
7887
7867
|
// whatever the formData object delivers
|
|
7888
7868
|
// the partialIdsArray arr is almost deprecated legacy code where we allowed to send a separate list of partial
|
|
7889
7869
|
// ids for reduced load and server processing, this will be removed soon, we can handle the same via execute
|
|
7890
|
-
// anyway
|
|
7891
|
-
|
|
7892
|
-
// prefixed
|
|
7893
|
-
const namingContainerMapper = (0, RequestDataResolver_1.resoveNamingContainerMapper)(this.internalContext);
|
|
7894
|
-
let formData = new XhrFormData_1.XhrFormData(this.sourceForm, namingContainerMapper, viewState, executesArr(), this.partialIdsArray);
|
|
7870
|
+
// anyway TODO remove the partial ids array
|
|
7871
|
+
let formData = new XhrFormData_1.XhrFormData(this.sourceForm, (0, RequestDataResolver_1.resoveNamingContainerMapper)(this.internalContext), viewState, executesArr(), this.partialIdsArray);
|
|
7895
7872
|
this.contentType = formData.isMultipartRequest ? "undefined" : this.contentType;
|
|
7896
7873
|
// next step the pass through parameters are merged in for post params
|
|
7897
7874
|
this.requestContext.$nspEnabled = false;
|
|
@@ -7902,10 +7879,6 @@ class XhrRequest {
|
|
|
7902
7879
|
// this can be used and is used in the impl to enrich the post request parameters with additional
|
|
7903
7880
|
// information
|
|
7904
7881
|
try {
|
|
7905
|
-
// per spec every param sent down needs to be remapped
|
|
7906
|
-
// and prefixed by the naming container id
|
|
7907
|
-
let configNamingContainerMapper = (0, RequestDataResolver_1.resoveConfigNamingContainerMapper)(this.internalContext);
|
|
7908
|
-
// requestPassThroughParams = configNamingContainerMapper(requestPassThroughParams);
|
|
7909
7882
|
formData.shallowMerge(requestPassThroughParams, true, true);
|
|
7910
7883
|
}
|
|
7911
7884
|
finally {
|
|
Binary file
|
|
Binary file
|