jsf.js_next_gen 4.0.0-RC.7 → 4.0.0-RC.9
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/docs/assets/main.js +1 -1
- package/dist/window/faces-development.js +108 -55
- 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 +108 -55
- 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 +7 -7
- package/src/main/typescript/impl/util/Assertions.ts +14 -6
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +11 -1
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +14 -8
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +65 -0
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +49 -2
- package/target/impl/util/Assertions.js +11 -6
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +11 -1
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +13 -8
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +37 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +63 -0
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +36 -1
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
|
@@ -42,7 +42,7 @@ const SourcesCollectors_1 = __webpack_require__(/*! ./SourcesCollectors */ "./no
|
|
|
42
42
|
const Lang_1 = __webpack_require__(/*! ./Lang */ "./node_modules/mona-dish/src/main/typescript/Lang.ts");
|
|
43
43
|
var trim = Lang_1.Lang.trim;
|
|
44
44
|
var isString = Lang_1.Lang.isString;
|
|
45
|
-
var
|
|
45
|
+
var eqi = Lang_1.Lang.equalsIgnoreCase;
|
|
46
46
|
const Global_1 = __webpack_require__(/*! ./Global */ "./node_modules/mona-dish/src/main/typescript/Global.ts");
|
|
47
47
|
var objToArray = Lang_1.Lang.objToArray;
|
|
48
48
|
/**
|
|
@@ -866,6 +866,30 @@ class DomQuery {
|
|
|
866
866
|
});
|
|
867
867
|
return this;
|
|
868
868
|
}
|
|
869
|
+
/**
|
|
870
|
+
* replace convenience function, replaces one or more elements with
|
|
871
|
+
* a set of elements passed as DomQuery
|
|
872
|
+
* @param toReplace the replaced nodes as reference (original node has been replaced)
|
|
873
|
+
*/
|
|
874
|
+
replace(toReplace) {
|
|
875
|
+
this.each(item => {
|
|
876
|
+
let asElem = item.getAsElem(0).value;
|
|
877
|
+
let parent = asElem.parentElement;
|
|
878
|
+
let nextElement = asElem.nextElementSibling;
|
|
879
|
+
let previousElement = asElem.previousElementSibling;
|
|
880
|
+
if (nextElement != null) {
|
|
881
|
+
new DomQuery(nextElement).insertBefore(toReplace);
|
|
882
|
+
}
|
|
883
|
+
else if (previousElement) {
|
|
884
|
+
new DomQuery(previousElement).insertAfter(toReplace);
|
|
885
|
+
}
|
|
886
|
+
else {
|
|
887
|
+
new DomQuery(parent).append(toReplace);
|
|
888
|
+
}
|
|
889
|
+
item.delete();
|
|
890
|
+
});
|
|
891
|
+
return toReplace;
|
|
892
|
+
}
|
|
869
893
|
/**
|
|
870
894
|
* returns a new dom query containing only the first element max
|
|
871
895
|
*
|
|
@@ -1184,7 +1208,7 @@ class DomQuery {
|
|
|
1184
1208
|
let tagName = item.tagName;
|
|
1185
1209
|
let itemType = ((_a = item === null || item === void 0 ? void 0 : item.type) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
1186
1210
|
if (tagName &&
|
|
1187
|
-
|
|
1211
|
+
eqi(tagName, "script") &&
|
|
1188
1212
|
allowedItemTypes.indexOf(itemType) != -1) {
|
|
1189
1213
|
let src = item.getAttribute('src');
|
|
1190
1214
|
if ('undefined' != typeof src
|
|
@@ -1270,36 +1294,30 @@ class DomQuery {
|
|
|
1270
1294
|
return this;
|
|
1271
1295
|
}
|
|
1272
1296
|
runCss() {
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
}, execCss = (item) => {
|
|
1287
|
-
const tagName = item.tagName;
|
|
1288
|
-
if (tagName && eIgnoreC(tagName, "link") && eIgnoreC(item.getAttribute("type"), "text/css")) {
|
|
1289
|
-
applyStyle(item, "@import url('" + item.getAttribute("href") + "');");
|
|
1290
|
-
}
|
|
1291
|
-
else if (tagName && eIgnoreC(tagName, "style") && eIgnoreC(item.getAttribute("type"), "text/css")) {
|
|
1292
|
-
let innerText = [];
|
|
1293
|
-
// compliant browsers know child nodes
|
|
1294
|
-
let childNodes = Array.prototype.slice.call(item.childNodes);
|
|
1295
|
-
if (childNodes) {
|
|
1296
|
-
childNodes.forEach(child => innerText.push(child.innerHTML || child.data));
|
|
1297
|
-
// non-compliant elements innerHTML
|
|
1297
|
+
const execCss = (toReplace) => {
|
|
1298
|
+
const _toReplace = DomQuery.byId(toReplace);
|
|
1299
|
+
const tagName = _toReplace.tagName.orElse("").value;
|
|
1300
|
+
const head = DomQuery.byTagName("head");
|
|
1301
|
+
if (tagName && eqi(tagName, "link") && eqi(toReplace.getAttribute("rel"), "stylesheet")) {
|
|
1302
|
+
const rel = toReplace.getAttribute("rel");
|
|
1303
|
+
//if possible we are now replacing the existing elements where we reference this stylesheet
|
|
1304
|
+
const matches = head.querySelectorAll(`link[rel='stylesheet'][href='${rel}']`);
|
|
1305
|
+
if (matches.length) {
|
|
1306
|
+
matches.replace(_toReplace);
|
|
1307
|
+
}
|
|
1308
|
+
else {
|
|
1309
|
+
head.append(_toReplace);
|
|
1298
1310
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1311
|
+
}
|
|
1312
|
+
else if (tagName && eqi(tagName, "style")) {
|
|
1313
|
+
let innerText = _toReplace.innerHTML.replace(/\s+/gi, "");
|
|
1314
|
+
let styles = head.querySelectorAll("style");
|
|
1315
|
+
styles = styles.stream.filter(style => {
|
|
1316
|
+
return style.innerHTML.replace(/\s+/gi, "") == innerText;
|
|
1317
|
+
}).collect(new DomQueryCollector());
|
|
1318
|
+
if (!styles.length) { //already present
|
|
1319
|
+
head.append(_toReplace);
|
|
1301
1320
|
}
|
|
1302
|
-
applyStyle(item, innerText.join(""));
|
|
1303
1321
|
}
|
|
1304
1322
|
};
|
|
1305
1323
|
const scriptElements = new DomQuery(this.filterSelector("link, style"), this.querySelectorAll("link, style"));
|
|
@@ -2719,7 +2737,7 @@ exports.Config = Config;
|
|
|
2719
2737
|
* limitations under the License.
|
|
2720
2738
|
*/
|
|
2721
2739
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2722
|
-
exports.QueryFormStringCollector = exports.QueryFormDataCollector = exports.FormDataCollector = exports.AssocArrayCollector = exports.Run = exports.ArrayAssocArrayCollector = exports.ArrayCollector = exports.FlatMapStreamDataSource = exports.MappedStreamDataSource = exports.FilteredStreamDatasource = exports.ArrayStreamDataSource = exports.SequenceDataSource = exports.ITERATION_STATUS = void 0;
|
|
2740
|
+
exports.QueryFormStringCollector = exports.QueryFormDataCollector = exports.FormDataCollector = exports.AssocArrayCollector = exports.Run = exports.ArrayAssocArrayCollector = exports.InverseArrayCollector = exports.ArrayCollector = exports.FlatMapStreamDataSource = exports.MappedStreamDataSource = exports.FilteredStreamDatasource = exports.ArrayStreamDataSource = exports.SequenceDataSource = exports.ITERATION_STATUS = void 0;
|
|
2723
2741
|
const Stream_1 = __webpack_require__(/*! ./Stream */ "./node_modules/mona-dish/src/main/typescript/Stream.ts");
|
|
2724
2742
|
/**
|
|
2725
2743
|
* special status of the datasource location pointer
|
|
@@ -3026,6 +3044,21 @@ class ArrayCollector {
|
|
|
3026
3044
|
}
|
|
3027
3045
|
}
|
|
3028
3046
|
exports.ArrayCollector = ArrayCollector;
|
|
3047
|
+
/**
|
|
3048
|
+
* collects the values as inverse array
|
|
3049
|
+
*/
|
|
3050
|
+
class InverseArrayCollector {
|
|
3051
|
+
constructor() {
|
|
3052
|
+
this.data = [];
|
|
3053
|
+
}
|
|
3054
|
+
collect(element) {
|
|
3055
|
+
this.data.unshift(element);
|
|
3056
|
+
}
|
|
3057
|
+
get finalValue() {
|
|
3058
|
+
return this.data;
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
exports.InverseArrayCollector = InverseArrayCollector;
|
|
3029
3062
|
/**
|
|
3030
3063
|
* collects an tuple array stream into an assoc array with elements being collected into arrays
|
|
3031
3064
|
*
|
|
@@ -3361,6 +3394,15 @@ exports.Stream = Stream;
|
|
|
3361
3394
|
*
|
|
3362
3395
|
*/
|
|
3363
3396
|
class LazyStream {
|
|
3397
|
+
static of(...values) {
|
|
3398
|
+
return new LazyStream(new SourcesCollectors_1.ArrayStreamDataSource(...values));
|
|
3399
|
+
}
|
|
3400
|
+
static ofAssoc(data) {
|
|
3401
|
+
return this.of(...Object.keys(data)).map(key => [key, data[key]]);
|
|
3402
|
+
}
|
|
3403
|
+
static ofStreamDataSource(value) {
|
|
3404
|
+
return new LazyStream(value);
|
|
3405
|
+
}
|
|
3364
3406
|
constructor(parent) {
|
|
3365
3407
|
this._limits = -1;
|
|
3366
3408
|
/*
|
|
@@ -3371,15 +3413,6 @@ class LazyStream {
|
|
|
3371
3413
|
this.pos = -1;
|
|
3372
3414
|
this.dataSource = parent;
|
|
3373
3415
|
}
|
|
3374
|
-
static of(...values) {
|
|
3375
|
-
return new LazyStream(new SourcesCollectors_1.ArrayStreamDataSource(...values));
|
|
3376
|
-
}
|
|
3377
|
-
static ofAssoc(data) {
|
|
3378
|
-
return this.of(...Object.keys(data)).map(key => [key, data[key]]);
|
|
3379
|
-
}
|
|
3380
|
-
static ofStreamDataSource(value) {
|
|
3381
|
-
return new LazyStream(value);
|
|
3382
|
-
}
|
|
3383
3416
|
hasNext() {
|
|
3384
3417
|
if (this.isOverLimits()) {
|
|
3385
3418
|
return false;
|
|
@@ -5247,10 +5280,8 @@ exports.Assertions = void 0;
|
|
|
5247
5280
|
* limitations under the License.
|
|
5248
5281
|
*/
|
|
5249
5282
|
const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
5250
|
-
const Lang_1 = __webpack_require__(/*! ./Lang */ "./src/main/typescript/impl/util/Lang.ts");
|
|
5251
|
-
var getMessage = Lang_1.ExtLang.getMessage;
|
|
5252
|
-
var makeException = Lang_1.ExtLang.makeException;
|
|
5253
5283
|
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
5284
|
+
const Lang_1 = __webpack_require__(/*! ./Lang */ "./src/main/typescript/impl/util/Lang.ts");
|
|
5254
5285
|
/**
|
|
5255
5286
|
* a set of internal code assertions
|
|
5256
5287
|
* which raise an error
|
|
@@ -5265,12 +5296,12 @@ var Assertions;
|
|
|
5265
5296
|
assertFunction(options.getIf(Const_1.ON_EVENT).value);
|
|
5266
5297
|
//improve the error messages if an empty elem is passed
|
|
5267
5298
|
//Assertions.assertElementExists(elem);
|
|
5268
|
-
assert(elem.isPresent(), getMessage("ERR_MUST_BE_PROVIDED1", "{0}: source must be provided or exist", "source element id"), "faces.ajax.request", "ArgNotSet");
|
|
5299
|
+
assert(elem.isPresent(), Lang_1.ExtLang.getMessage("ERR_MUST_BE_PROVIDED1", "{0}: source must be provided or exist", "source element id"), "faces.ajax.request", "ArgNotSet");
|
|
5269
5300
|
}
|
|
5270
5301
|
Assertions.assertRequestIntegrity = assertRequestIntegrity;
|
|
5271
5302
|
function assertUrlExists(node) {
|
|
5272
5303
|
if (node.attr(Const_1.ATTR_URL).isAbsent()) {
|
|
5273
|
-
throw Assertions.raiseError(new Error(), getMessage("ERR_RED_URL", null, "processRedirect"), "processRedirect");
|
|
5304
|
+
throw Assertions.raiseError(new Error(), Lang_1.ExtLang.getMessage("ERR_RED_URL", null, "processRedirect"), "processRedirect");
|
|
5274
5305
|
}
|
|
5275
5306
|
}
|
|
5276
5307
|
Assertions.assertUrlExists = assertUrlExists;
|
|
@@ -5299,7 +5330,7 @@ var Assertions;
|
|
|
5299
5330
|
let finalName = name !== null && name !== void 0 ? name : Const_1.MALFORMEDXML;
|
|
5300
5331
|
let finalMessage = message !== null && message !== void 0 ? message : Const_1.EMPTY_STR;
|
|
5301
5332
|
//TODO clean up the messy makeException, this is a perfect case for encapsulation and sane defaults
|
|
5302
|
-
return makeException(error, finalTitle, finalName, "Response", caller || ((arguments.caller) ? arguments.caller.toString() : "_raiseError"), finalMessage);
|
|
5333
|
+
return Lang_1.ExtLang.makeException(error, finalTitle, finalName, "Response", caller || ((arguments.caller) ? arguments.caller.toString() : "_raiseError"), finalMessage);
|
|
5303
5334
|
}
|
|
5304
5335
|
Assertions.raiseError = raiseError;
|
|
5305
5336
|
/*
|
|
@@ -5322,6 +5353,13 @@ var Assertions;
|
|
|
5322
5353
|
assertType(value, "function", msg, caller, title);
|
|
5323
5354
|
}
|
|
5324
5355
|
Assertions.assertFunction = assertFunction;
|
|
5356
|
+
function assertDelay(value) {
|
|
5357
|
+
if (!(value >= 0)) { // >= 0 abbreviation which covers all cases of non positive values,
|
|
5358
|
+
// including NaN and non numeric strings, no type equality is deliberate here,
|
|
5359
|
+
throw new Error("Invalid delay value: " + value);
|
|
5360
|
+
}
|
|
5361
|
+
}
|
|
5362
|
+
Assertions.assertDelay = assertDelay;
|
|
5325
5363
|
})(Assertions = exports.Assertions || (exports.Assertions = {}));
|
|
5326
5364
|
|
|
5327
5365
|
|
|
@@ -6137,6 +6175,8 @@ const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-di
|
|
|
6137
6175
|
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
6138
6176
|
const Lang_1 = __webpack_require__(/*! ../util/Lang */ "./src/main/typescript/impl/util/Lang.ts");
|
|
6139
6177
|
const ExtDomQuery_1 = __webpack_require__(/*! ../util/ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
|
|
6178
|
+
const Assertions_1 = __webpack_require__(/*! ../util/Assertions */ "./src/main/typescript/impl/util/Assertions.ts");
|
|
6179
|
+
var assertDelay = Assertions_1.Assertions.assertDelay;
|
|
6140
6180
|
/**
|
|
6141
6181
|
* Resolver functions for various aspects of the request data
|
|
6142
6182
|
*
|
|
@@ -6199,7 +6239,15 @@ exports.resolveTimeout = resolveTimeout;
|
|
|
6199
6239
|
function resolveDelay(options) {
|
|
6200
6240
|
var _a;
|
|
6201
6241
|
let getCfg = Lang_1.ExtLang.getLocalOrGlobalConfig;
|
|
6202
|
-
|
|
6242
|
+
// null or non undefined will automatically be mapped to 0 aka no delay
|
|
6243
|
+
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);
|
|
6244
|
+
// if delay === none, no delay must be used, aka delay 0
|
|
6245
|
+
if ('none' === ret) {
|
|
6246
|
+
ret = 0;
|
|
6247
|
+
}
|
|
6248
|
+
// negative, or invalid values will automatically get a js exception
|
|
6249
|
+
assertDelay(ret);
|
|
6250
|
+
return ret;
|
|
6203
6251
|
}
|
|
6204
6252
|
exports.resolveDelay = resolveDelay;
|
|
6205
6253
|
/**
|
|
@@ -6615,16 +6663,21 @@ class ResponseProcessor {
|
|
|
6615
6663
|
if (!shadowHead.isPresent()) {
|
|
6616
6664
|
return;
|
|
6617
6665
|
}
|
|
6618
|
-
let
|
|
6666
|
+
let head = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.TAG_HEAD);
|
|
6619
6667
|
//delete all to avoid script and style overlays
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6668
|
+
// we delete everything
|
|
6669
|
+
head.childNodes.delete();
|
|
6670
|
+
let postProcessTags = ["STYLE", "LINK", "SCRIPT"];
|
|
6671
|
+
shadowHead.stream
|
|
6672
|
+
.filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) == -1)
|
|
6673
|
+
.each(item => {
|
|
6674
|
+
head.append(item);
|
|
6675
|
+
});
|
|
6625
6676
|
//incoming either the outer head tag or its children
|
|
6626
|
-
|
|
6627
|
-
//this
|
|
6677
|
+
const nodesToAdd = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
|
|
6678
|
+
// this is stored for post processing
|
|
6679
|
+
// after the rest of the "pyhsical build up", head before body
|
|
6680
|
+
this.addToHead(nodesToAdd);
|
|
6628
6681
|
}
|
|
6629
6682
|
addToHead(newElements) {
|
|
6630
6683
|
this.internalContext.assign(Const_1.DEFERRED_HEAD_INSERTS).value.push(newElements);
|
|
Binary file
|
|
Binary file
|