jsf.js_next_gen 4.0.0-RC.14 → 4.0.0-RC.16
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 +77 -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 +77 -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/AjaxImpl.ts +50 -21
- package/src/main/typescript/impl/core/Const.ts +1 -0
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +27 -31
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +3 -0
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +10 -9
- package/target/impl/AjaxImpl.js +47 -17
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/core/Const.js +4 -3
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/xhrCore/RequestContext.js +11 -0
- package/target/impl/xhrCore/RequestContext.js.map +1 -0
- package/target/impl/xhrCore/RequestDataResolver.js +23 -23
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +2 -0
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +10 -9
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/src/main/typescript/impl/core/Context.ts +0 -19
|
@@ -4311,7 +4311,9 @@ var Implementation;
|
|
|
4311
4311
|
*/
|
|
4312
4312
|
function request(el, event, opts) {
|
|
4313
4313
|
var _a, _b, _c;
|
|
4314
|
-
const {
|
|
4314
|
+
const { options, elem, elementId, windowId, isResetValues } = (0, RequestDataResolver_1.resolveDefaults)(event, opts, el);
|
|
4315
|
+
const requestCtx = new ExtDomQuery_1.ExtConfig({});
|
|
4316
|
+
const internalCtx = new ExtDomQuery_1.ExtConfig({});
|
|
4315
4317
|
Assertions_1.Assertions.assertRequestIntegrity(options, elem);
|
|
4316
4318
|
/**
|
|
4317
4319
|
* fetch the parent form
|
|
@@ -4320,18 +4322,18 @@ var Implementation;
|
|
|
4320
4322
|
* so that people can use dummy forms and work
|
|
4321
4323
|
* with detached objects
|
|
4322
4324
|
*/
|
|
4323
|
-
const form = (0, RequestDataResolver_1.resolveForm)(
|
|
4325
|
+
const form = (0, RequestDataResolver_1.resolveForm)(elem, event);
|
|
4324
4326
|
const viewId = (0, RequestDataResolver_1.resolveViewId)(form);
|
|
4325
4327
|
const formId = form.id.value;
|
|
4326
4328
|
const delay = (0, RequestDataResolver_1.resolveDelay)(options);
|
|
4327
4329
|
const timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
|
|
4328
4330
|
requestCtx.assignIf(!!windowId, Const_1.P_WINDOW_ID).value = windowId;
|
|
4329
4331
|
// old non spec behavior will be removed after it is clear whether the removal breaks any code
|
|
4330
|
-
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR).value =
|
|
4332
|
+
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR).value = extractLegacyParams(options.value);
|
|
4331
4333
|
// spec conform behavior, all passthrough params must be under "passthrough
|
|
4332
4334
|
const params = remapArrayToAssocArr(options.getIf(Const_1.CTX_OPTIONS_PARAMS).orElse({}).value);
|
|
4333
4335
|
requestCtx.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).shallowMerge(new mona_dish_1.Config(params), true);
|
|
4334
|
-
requestCtx.assignIf(!!
|
|
4336
|
+
requestCtx.assignIf(!!event, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EVT).value = event === null || event === void 0 ? void 0 : event.type;
|
|
4335
4337
|
/**
|
|
4336
4338
|
* ajax pass through context with the source
|
|
4337
4339
|
* onresolved Event and onerror Event
|
|
@@ -4628,7 +4630,7 @@ var Implementation;
|
|
|
4628
4630
|
/**
|
|
4629
4631
|
* transforms the user values to the expected one
|
|
4630
4632
|
* with the proper none all form and this handling
|
|
4631
|
-
* (note we also could use a simple string replace but then
|
|
4633
|
+
* (note we also could use a simple string replace, but then
|
|
4632
4634
|
* we would have had double entries under some circumstances)
|
|
4633
4635
|
*
|
|
4634
4636
|
* there are several standardized constants which need a special treatment
|
|
@@ -4639,23 +4641,51 @@ var Implementation;
|
|
|
4639
4641
|
* @param userValues the passed user values (aka input string which needs to be transformed)
|
|
4640
4642
|
* @param issuingForm the form where the issuing element originates
|
|
4641
4643
|
* @param issuingElementId the issuing element
|
|
4642
|
-
* @param
|
|
4644
|
+
* @param rootNamingContainerId the naming container id ("" default if none is given)
|
|
4643
4645
|
*/
|
|
4644
|
-
function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId,
|
|
4646
|
+
function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId, rootNamingContainerId = "") {
|
|
4645
4647
|
//a cleaner implementation of the transform list method
|
|
4646
4648
|
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
4647
4649
|
let iterValues = (userValues) ? trim(userValues).split(/\s+/gi) : [];
|
|
4648
4650
|
let ret = [];
|
|
4649
4651
|
let processed = {};
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4652
|
+
/**
|
|
4653
|
+
* remaps the client ids for the portlet case so that the server
|
|
4654
|
+
* can deal with them either prefixed ir not
|
|
4655
|
+
* also resolves the absolute id case (it was assumed the server does this, but
|
|
4656
|
+
* apparently the RI does not, so we have to follow the RI behavior here)
|
|
4657
|
+
* @param componentIdToTransform the componentId which needs post processing
|
|
4658
|
+
*/
|
|
4659
|
+
const remapNamingContainer = componentIdToTransform => {
|
|
4660
|
+
// pattern :<anything> must be prepended by viewRoot if there is one,
|
|
4661
|
+
// otherwise we are in a not namespaced then only the id has to match
|
|
4662
|
+
const rootNamingContainerPrefix = (rootNamingContainerId.length) ? rootNamingContainerId + SEP : Const_1.EMPTY_STR;
|
|
4663
|
+
let formClientId = issuingForm.id.value;
|
|
4664
|
+
// nearest parent naming container relative to the form
|
|
4665
|
+
const nearestNamingContainer = formClientId.substring(0, formClientId.lastIndexOf(SEP));
|
|
4666
|
+
const nearestNamingContainerPrefix = (nearestNamingContainer.length) ? nearestNamingContainer + SEP : Const_1.EMPTY_STR;
|
|
4667
|
+
// Absolute search expressions, always start with SEP or the name of the root naming container
|
|
4668
|
+
const hasLeadingSep = componentIdToTransform.indexOf(SEP) === 0;
|
|
4669
|
+
const isAbsolutSearchExpr = hasLeadingSep || (rootNamingContainerId.length
|
|
4670
|
+
&& componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0);
|
|
4671
|
+
if (isAbsolutSearchExpr) {
|
|
4672
|
+
//we cut off the leading sep if there is one
|
|
4673
|
+
componentIdToTransform = hasLeadingSep ? componentIdToTransform.substring(1) : componentIdToTransform;
|
|
4674
|
+
componentIdToTransform = componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0 ? componentIdToTransform.substring(rootNamingContainerPrefix.length) : componentIdToTransform;
|
|
4675
|
+
//now we prepend either the prefix or "" from the cut-off string to get the final result
|
|
4676
|
+
return [rootNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR);
|
|
4677
|
+
}
|
|
4678
|
+
else { //relative search according to the javadoc
|
|
4679
|
+
//we cut off the root naming container id from the form
|
|
4680
|
+
if (formClientId.indexOf(rootNamingContainerPrefix) == 0) {
|
|
4681
|
+
formClientId = formClientId.substring(rootNamingContainerPrefix.length);
|
|
4682
|
+
}
|
|
4683
|
+
//If prependId = true, the outer form id must be present in the id if same form
|
|
4684
|
+
let hasPrependId = componentIdToTransform.indexOf(formClientId) == 0;
|
|
4685
|
+
return hasPrependId ?
|
|
4686
|
+
[rootNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR) :
|
|
4687
|
+
[nearestNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR);
|
|
4657
4688
|
}
|
|
4658
|
-
return item;
|
|
4659
4689
|
};
|
|
4660
4690
|
// in this case we do not use lazy stream because it wont bring any code reduction
|
|
4661
4691
|
// or speedup
|
|
@@ -4694,17 +4724,17 @@ var Implementation;
|
|
|
4694
4724
|
}
|
|
4695
4725
|
/**
|
|
4696
4726
|
* Filter the options given with a blacklist, so that only
|
|
4697
|
-
* the values required for
|
|
4727
|
+
* the values required for params-through are processed in the ajax request
|
|
4698
4728
|
*
|
|
4699
4729
|
* Note this is a bug carried over from the old implementation
|
|
4700
4730
|
* the spec conform behavior is to use params for passthrough values
|
|
4701
|
-
* this will be removed soon, after it is cleared up
|
|
4731
|
+
* this will be removed soon, after it is cleared up whether removing
|
|
4702
4732
|
* it breaks any legacy code
|
|
4703
4733
|
*
|
|
4704
4734
|
* @param {Context} mappedOpts the options to be filtered
|
|
4705
4735
|
* @deprecated
|
|
4706
4736
|
*/
|
|
4707
|
-
function
|
|
4737
|
+
function extractLegacyParams(mappedOpts) {
|
|
4708
4738
|
//we now can use the full code reduction given by our stream api
|
|
4709
4739
|
//to filter
|
|
4710
4740
|
return mona_dish_1.Stream.ofAssoc(mappedOpts)
|
|
@@ -5041,9 +5071,9 @@ var PushImpl;
|
|
|
5041
5071
|
* limitations under the License.
|
|
5042
5072
|
*/
|
|
5043
5073
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5044
|
-
exports.
|
|
5045
|
-
exports.
|
|
5046
|
-
exports.$nsp = exports.$faces = exports.UNKNOWN = exports.MAX_RECONNECT_ATTEMPTS = exports.RECONNECT_INTERVAL = exports.APPLIED_CLIENT_WINDOW = exports.APPLIED_VST = exports.REASON_EXPIRED = exports.MF_NONE = exports.MYFACES = exports.DEFERRED_HEAD_INSERTS = void 0;
|
|
5074
|
+
exports.DELAY_NONE = exports.CTX_OPTIONS_DELAY = exports.CTX_OPTIONS_PARAMS = exports.TIMEOUT_EVENT = exports.CLIENT_ERROR = exports.SERVER_ERROR = exports.MALFORMEDXML = exports.EMPTY_RESPONSE = exports.HTTPERROR = exports.RESPONSE_XML = exports.RESPONSE_TEXT = exports.ERROR_MESSAGE = exports.ERROR_NAME = exports.STATUS = exports.SOURCE = exports.SUCCESS = exports.COMPLETE = exports.BEGIN = exports.ON_EVENT = exports.ON_ERROR = exports.EVENT = exports.ERROR = exports.WINDOW_ID = exports.CTX_PARAM_RENDER = exports.P_BEHAVIOR_EVENT = exports.P_WINDOW_ID = exports.P_RESET_VALUES = exports.P_EVT = exports.P_RENDER_OVERRIDE = exports.P_RENDER = exports.P_EXECUTE = exports.P_AJAX = exports.IDENT_FORM = exports.IDENT_THIS = exports.IDENT_NONE = exports.IDENT_ALL = exports.HTML_CLIENT_WINDOW = exports.HTML_VIEWSTATE = exports.EMPTY_MAP = exports.EMPTY_STR = exports.EMPTY_FUNC = exports.P_RESOURCE = exports.P_VIEWBODY = exports.P_VIEWHEAD = exports.P_VIEWROOT = exports.P_CLIENT_WINDOW = exports.P_VIEWSTATE = exports.VIEW_ID = exports.PARTIAL_ID = exports.P_PARTIAL_SOURCE = void 0;
|
|
5075
|
+
exports.UPDATE_FORMS = exports.XML_TAG_ATTR = exports.XML_TAG_AFTER = exports.XML_TAG_BEFORE = exports.XML_TAG_REDIRECT = exports.XML_TAG_EXTENSION = exports.XML_TAG_ATTRIBUTES = exports.XML_TAG_ERROR = exports.XML_TAG_EVAL = exports.XML_TAG_INSERT = exports.XML_TAG_DELETE = exports.XML_TAG_UPDATE = exports.XML_TAG_CHANGES = exports.XML_TAG_PARTIAL_RESP = exports.ATTR_ID = exports.ATTR_VALUE = exports.ATTR_NAME = exports.ATTR_URL = exports.ERR_NO_PARTIAL_RESPONSE = exports.PHASE_PROCESS_RESPONSE = exports.SEL_RESPONSE_XML = exports.SEL_CLIENT_WINDOW_ELEM = exports.SEL_VIEWSTATE_ELEM = exports.HTML_TAG_STYLE = exports.HTML_TAG_SCRIPT = exports.HTML_TAG_LINK = exports.HTML_TAG_BODY = exports.HTML_TAG_FORM = exports.HTML_TAG_HEAD = exports.STD_ACCEPT = exports.NO_TIMEOUT = exports.MULTIPART = exports.URL_ENCODED = exports.STATE_EVT_COMPLETE = exports.STATE_EVT_TIMEOUT = exports.STATE_EVT_BEGIN = exports.REQ_TYPE_POST = exports.REQ_TYPE_GET = exports.ENCODED_URL = exports.VAL_AJAX = exports.REQ_ACCEPT = exports.HEAD_FACES_REQ = exports.CONTENT_TYPE = exports.CTX_PARAM_REQ_PASS_THR = exports.CTX_PARAM_SRC_CTL_ID = exports.CTX_PARAM_SRC_FRM_ID = exports.CTX_PARAM_MF_INTERNAL = exports.CTX_OPTIONS_EXECUTE = exports.CTX_OPTIONS_RESET = exports.CTX_OPTIONS_TIMEOUT = void 0;
|
|
5076
|
+
exports.$nsp = exports.$faces = exports.UNKNOWN = exports.MAX_RECONNECT_ATTEMPTS = exports.RECONNECT_INTERVAL = exports.APPLIED_CLIENT_WINDOW = exports.APPLIED_VST = exports.REASON_EXPIRED = exports.MF_NONE = exports.MYFACES = exports.DEFERRED_HEAD_INSERTS = exports.UPDATE_ELEMS = void 0;
|
|
5047
5077
|
/*
|
|
5048
5078
|
* [export const] constants
|
|
5049
5079
|
*/
|
|
@@ -5103,6 +5133,7 @@ exports.CLIENT_ERROR = "clientError";
|
|
|
5103
5133
|
exports.TIMEOUT_EVENT = "timeout";
|
|
5104
5134
|
exports.CTX_OPTIONS_PARAMS = "params";
|
|
5105
5135
|
exports.CTX_OPTIONS_DELAY = "delay";
|
|
5136
|
+
exports.DELAY_NONE = 'none';
|
|
5106
5137
|
exports.CTX_OPTIONS_TIMEOUT = "timeout";
|
|
5107
5138
|
exports.CTX_OPTIONS_RESET = "resetValues";
|
|
5108
5139
|
exports.CTX_OPTIONS_EXECUTE = "execute";
|
|
@@ -6385,26 +6416,21 @@ exports.resolveFinalUrl = resolveFinalUrl;
|
|
|
6385
6416
|
* it is either the id or the parent form of the element or an embedded form
|
|
6386
6417
|
* of the element
|
|
6387
6418
|
*
|
|
6388
|
-
* @param requestCtx
|
|
6389
6419
|
* @param elem
|
|
6390
6420
|
* @param event
|
|
6391
6421
|
*/
|
|
6392
|
-
function resolveForm(
|
|
6393
|
-
|
|
6394
|
-
const configId = (_c = (_b = (_a = requestCtx.value) === null || _a === void 0 ? void 0 : _a.myfaces) === null || _b === void 0 ? void 0 : _b.form) !== null && _c !== void 0 ? _c : Const_1.MF_NONE;
|
|
6395
|
-
return mona_dish_1.DQ
|
|
6396
|
-
.byId(configId, true)
|
|
6397
|
-
.orElseLazy(() => Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event));
|
|
6422
|
+
function resolveForm(elem, event) {
|
|
6423
|
+
return Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event);
|
|
6398
6424
|
}
|
|
6399
6425
|
exports.resolveForm = resolveForm;
|
|
6400
6426
|
function resolveViewId(form) {
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
return "";
|
|
6427
|
+
const viewState = form.querySelectorAll(`input[type='hidden'][name*='${(0, Const_1.$nsp)(Const_1.P_VIEWSTATE)}']`).id.orElse("").value;
|
|
6428
|
+
const divider = (0, Const_1.$faces)().separatorchar;
|
|
6429
|
+
const viewId = viewState.split(divider, 2)[0];
|
|
6430
|
+
const viewStateViewId = viewId.indexOf((0, Const_1.$nsp)(Const_1.P_VIEWSTATE)) === -1 ? viewId : "";
|
|
6431
|
+
// myfaces specific, we in non portlet environments prepend the viewId
|
|
6432
|
+
// even without being in a naming container, the other components ignore that
|
|
6433
|
+
return form.id.value.indexOf(viewStateViewId) === 0 ? viewStateViewId : "";
|
|
6408
6434
|
}
|
|
6409
6435
|
exports.resolveViewId = resolveViewId;
|
|
6410
6436
|
function resolveTimeout(options) {
|
|
@@ -6419,14 +6445,12 @@ exports.resolveTimeout = resolveTimeout;
|
|
|
6419
6445
|
* @param options ... the options object, in most cases it will host the delay value
|
|
6420
6446
|
*/
|
|
6421
6447
|
function resolveDelay(options) {
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
//
|
|
6425
|
-
let ret =
|
|
6448
|
+
// null, 'none', or undefined will automatically be mapped to 0 aka no delay
|
|
6449
|
+
// the config delay will be dropped not needed anymore, it does not really
|
|
6450
|
+
// make sense anymore now that it is part of a local spec
|
|
6451
|
+
let ret = options.getIf(Const_1.CTX_OPTIONS_DELAY).orElse(0).value;
|
|
6426
6452
|
// if delay === none, no delay must be used, aka delay 0
|
|
6427
|
-
|
|
6428
|
-
ret = 0;
|
|
6429
|
-
}
|
|
6453
|
+
ret = (Const_1.DELAY_NONE === ret) ? 0 : ret;
|
|
6430
6454
|
// negative, or invalid values will automatically get a js exception
|
|
6431
6455
|
Assertions_1.Assertions.assertDelay(ret);
|
|
6432
6456
|
return ret;
|
|
@@ -6481,8 +6505,15 @@ exports.getEventTarget = getEventTarget;
|
|
|
6481
6505
|
function resolveDefaults(event, opts, el = null) {
|
|
6482
6506
|
var _a;
|
|
6483
6507
|
//deep copy the options, so that further transformations to not backfire into the callers
|
|
6484
|
-
const
|
|
6485
|
-
|
|
6508
|
+
const elem = mona_dish_1.DQ.byId(el || event.target, true);
|
|
6509
|
+
const options = new ExtDomQuery_1.ExtConfig(opts).deepCopy;
|
|
6510
|
+
return {
|
|
6511
|
+
options: options,
|
|
6512
|
+
elem: elem,
|
|
6513
|
+
elementId: elem.id.value,
|
|
6514
|
+
windowId: resolveWindowId(options),
|
|
6515
|
+
isResetValues: true === ((_a = options.value) === null || _a === void 0 ? void 0 : _a.resetValues)
|
|
6516
|
+
};
|
|
6486
6517
|
}
|
|
6487
6518
|
exports.resolveDefaults = resolveDefaults;
|
|
6488
6519
|
|
|
@@ -6850,6 +6881,8 @@ class ResponseProcessor {
|
|
|
6850
6881
|
// full replace we delete everything
|
|
6851
6882
|
head.childNodes.delete();
|
|
6852
6883
|
this.addToHead(shadowHead);
|
|
6884
|
+
//we copy the attributes as well (just in case myfaces introduces the id in head)
|
|
6885
|
+
head.copyAttrs(shadowHead);
|
|
6853
6886
|
}
|
|
6854
6887
|
addToHead(shadowHead) {
|
|
6855
6888
|
const mappedHeadData = new ExtDomQuery_1.ExtDomQuery(shadowHead);
|
|
Binary file
|
|
Binary file
|