jsf.js_next_gen 4.0.0-RC.21 → 4.0.0-RC.24
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 +56 -14
- 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 +56 -14
- 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/core/Const.ts +4 -1
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +13 -2
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +7 -0
- package/src/main/typescript/impl/xhrCore/Response.ts +30 -13
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +24 -8
- package/target/impl/core/Const.js +6 -4
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/util/HiddenInputBuilder.js +12 -2
- package/target/impl/util/HiddenInputBuilder.js.map +1 -1
- package/target/impl/xhrCore/Response.js +16 -1
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +22 -7
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
|
@@ -5175,15 +5175,17 @@ var PushImpl;
|
|
|
5175
5175
|
* limitations under the License.
|
|
5176
5176
|
*/
|
|
5177
5177
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5178
|
-
exports.
|
|
5179
|
-
exports.
|
|
5180
|
-
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;
|
|
5178
|
+
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 = exports.NAMED_VIEWROOT = exports.XML_ATTR_NAMED_VIEWROOT = void 0;
|
|
5179
|
+
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 = exports.DELAY_NONE = exports.CTX_OPTIONS_DELAY = void 0;
|
|
5180
|
+
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 = exports.UPDATE_FORMS = exports.XML_TAG_ATTR = void 0;
|
|
5181
5181
|
/*
|
|
5182
5182
|
* [export const] constants
|
|
5183
5183
|
*/
|
|
5184
|
+
exports.XML_ATTR_NAMED_VIEWROOT = "namedViewRoot";
|
|
5185
|
+
exports.NAMED_VIEWROOT = "namedViewRoot";
|
|
5184
5186
|
exports.P_PARTIAL_SOURCE = "jakarta.faces.source";
|
|
5185
5187
|
exports.PARTIAL_ID = "partialId";
|
|
5186
|
-
exports.VIEW_ID = "
|
|
5188
|
+
exports.VIEW_ID = "myfaces.viewId";
|
|
5187
5189
|
exports.P_VIEWSTATE = "jakarta.faces.ViewState";
|
|
5188
5190
|
exports.P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
|
|
5189
5191
|
exports.P_VIEWROOT = "jakarta.faces.ViewRoot";
|
|
@@ -6072,6 +6074,7 @@ const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/
|
|
|
6072
6074
|
class HiddenInputBuilder {
|
|
6073
6075
|
constructor(selector) {
|
|
6074
6076
|
this.selector = selector;
|
|
6077
|
+
this.namedViewRoot = false;
|
|
6075
6078
|
const isViewState = selector.indexOf((0, Const_1.$nsp)(Const_1.P_VIEWSTATE)) != -1;
|
|
6076
6079
|
this.name = isViewState ? Const_1.P_VIEWSTATE : Const_1.P_CLIENT_WINDOW;
|
|
6077
6080
|
this.template = isViewState ? Const_1.HTML_VIEWSTATE : Const_1.HTML_CLIENT_WINDOW;
|
|
@@ -6084,6 +6087,10 @@ class HiddenInputBuilder {
|
|
|
6084
6087
|
this.parent = parent;
|
|
6085
6088
|
return this;
|
|
6086
6089
|
}
|
|
6090
|
+
withNamedViewRoot(namedViewRoot) {
|
|
6091
|
+
this.namedViewRoot = namedViewRoot;
|
|
6092
|
+
return this;
|
|
6093
|
+
}
|
|
6087
6094
|
build() {
|
|
6088
6095
|
var _a, _b, _c;
|
|
6089
6096
|
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
@@ -6102,8 +6109,13 @@ class HiddenInputBuilder {
|
|
|
6102
6109
|
[this.namingContainerId, (0, Const_1.$nsp)(this.name), cnt] :
|
|
6103
6110
|
[(0, Const_1.$nsp)(this.name), cnt]).join(SEP);
|
|
6104
6111
|
//name must be prefixed with the naming container id as well according to the jsdocs
|
|
6105
|
-
|
|
6106
|
-
|
|
6112
|
+
if (this.namedViewRoot) {
|
|
6113
|
+
newElement.name.value = ((_b = this.namingContainerId) === null || _b === void 0 ? void 0 : _b.length) ?
|
|
6114
|
+
[this.namingContainerId, (0, Const_1.$nsp)(this.name)].join(SEP) : (0, Const_1.$nsp)(this.name);
|
|
6115
|
+
}
|
|
6116
|
+
else {
|
|
6117
|
+
newElement.name.value = (0, Const_1.$nsp)(this.name);
|
|
6118
|
+
}
|
|
6107
6119
|
(_c = this === null || this === void 0 ? void 0 : this.parent) === null || _c === void 0 ? void 0 : _c.append(newElement);
|
|
6108
6120
|
return newElement;
|
|
6109
6121
|
}
|
|
@@ -6812,6 +6824,7 @@ var Response;
|
|
|
6812
6824
|
// doing any evaluations even on embedded scripts.
|
|
6813
6825
|
// Usually this does not matter, the client window comes in almost last always anyway
|
|
6814
6826
|
// we maybe drop this deferred assignment in the future, but myfaces did it until now.
|
|
6827
|
+
responseProcessor.updateNamedViewRootState();
|
|
6815
6828
|
responseProcessor.fixViewStates();
|
|
6816
6829
|
responseProcessor.fixClientWindow();
|
|
6817
6830
|
responseProcessor.globalEval();
|
|
@@ -6822,7 +6835,21 @@ var Response;
|
|
|
6822
6835
|
* highest node partial-response from there the main operations are triggered
|
|
6823
6836
|
*/
|
|
6824
6837
|
function processPartialTag(node, responseProcessor, internalContext) {
|
|
6825
|
-
|
|
6838
|
+
/*
|
|
6839
|
+
https://javaee.github.io/javaserverfaces/docs/2.2/javadocs/web-partialresponse.html#ns_xsd
|
|
6840
|
+
The "partial-response" element is the root of the partial response information hierarchy,
|
|
6841
|
+
and contains nested elements for all possible elements that can exist in the response.
|
|
6842
|
+
This element must have an "id" attribute whose value is the return from calling getContainerClientId()
|
|
6843
|
+
on the UIViewRoot to which this response pertains.
|
|
6844
|
+
*/
|
|
6845
|
+
// we can determine whether we are in a naming container scenario by checking whether the passed view id is present in the page
|
|
6846
|
+
// under or in body as identifier
|
|
6847
|
+
var _a;
|
|
6848
|
+
let partialId = (_a = node === null || node === void 0 ? void 0 : node.id) === null || _a === void 0 ? void 0 : _a.value;
|
|
6849
|
+
internalContext.assignIf(!!partialId, Const_1.PARTIAL_ID).value = partialId; // second case mojarra
|
|
6850
|
+
// there must be at least one container viewstate element resembling the viewroot that we know
|
|
6851
|
+
// this is named
|
|
6852
|
+
responseProcessor.updateNamedViewRootState();
|
|
6826
6853
|
const SEL_SUB_TAGS = [Const_1.XML_TAG_ERROR, Const_1.XML_TAG_REDIRECT, Const_1.XML_TAG_CHANGES].join(",");
|
|
6827
6854
|
// now we can process the main operations
|
|
6828
6855
|
node.querySelectorAll(SEL_SUB_TAGS).each((node) => {
|
|
@@ -7217,9 +7244,10 @@ class ResponseProcessor {
|
|
|
7217
7244
|
mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_VST).orElse({}).value)
|
|
7218
7245
|
.each(([, value]) => {
|
|
7219
7246
|
const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
|
|
7247
|
+
const namedViewRoot = !!this.internalContext.getIf(Const_1.NAMED_VIEWROOT).value;
|
|
7220
7248
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
7221
7249
|
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
7222
|
-
this.appendViewStateToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
7250
|
+
this.appendViewStateToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
7223
7251
|
});
|
|
7224
7252
|
}
|
|
7225
7253
|
/**
|
|
@@ -7230,11 +7258,23 @@ class ResponseProcessor {
|
|
|
7230
7258
|
mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
|
|
7231
7259
|
.each(([, value]) => {
|
|
7232
7260
|
const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
|
|
7261
|
+
const namedViewRoot = !!this.internalContext.getIf(Const_1.NAMED_VIEWROOT).value;
|
|
7233
7262
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
7234
7263
|
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
7235
|
-
this.appendClientWindowToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
7264
|
+
this.appendClientWindowToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
7236
7265
|
});
|
|
7237
7266
|
}
|
|
7267
|
+
updateNamedViewRootState() {
|
|
7268
|
+
let partialId = this.internalContext.getIf(Const_1.PARTIAL_ID);
|
|
7269
|
+
let namedViewRoot = this.internalContext.getIf(Const_1.NAMED_VIEWROOT);
|
|
7270
|
+
if (partialId.isPresent() &&
|
|
7271
|
+
(namedViewRoot.isAbsent() ||
|
|
7272
|
+
!namedViewRoot.value)) {
|
|
7273
|
+
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
7274
|
+
this.internalContext.assign(Const_1.NAMED_VIEWROOT).value = (!!document.getElementById(partialId.value)) || (0, mona_dish_1.DQ$)(`input[name*='${(0, Const_1.$nsp)(Const_1.P_VIEWSTATE)}']`)
|
|
7275
|
+
.filter(node => node.attr("name").value.indexOf(partialId.value + SEP) == 0).length > 0;
|
|
7276
|
+
}
|
|
7277
|
+
}
|
|
7238
7278
|
/**
|
|
7239
7279
|
* all processing done we can close the request and send the appropriate events
|
|
7240
7280
|
*/
|
|
@@ -7251,8 +7291,8 @@ class ResponseProcessor {
|
|
|
7251
7291
|
* @param viewState the final viewState
|
|
7252
7292
|
* @param namingContainerId
|
|
7253
7293
|
*/
|
|
7254
|
-
appendViewStateToForms(forms, viewState, namingContainerId = "") {
|
|
7255
|
-
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState, namingContainerId);
|
|
7294
|
+
appendViewStateToForms(forms, namedViewRoot, viewState, namingContainerId = "") {
|
|
7295
|
+
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), namedViewRoot, viewState, namingContainerId);
|
|
7256
7296
|
}
|
|
7257
7297
|
/**
|
|
7258
7298
|
* proper clientWindow -> form assignment
|
|
@@ -7261,20 +7301,21 @@ class ResponseProcessor {
|
|
|
7261
7301
|
* @param clientWindow the final viewState
|
|
7262
7302
|
* @param namingContainerId
|
|
7263
7303
|
*/
|
|
7264
|
-
appendClientWindowToForms(forms, clientWindow, namingContainerId = "") {
|
|
7265
|
-
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow, namingContainerId);
|
|
7304
|
+
appendClientWindowToForms(forms, namedViewRoot, clientWindow, namingContainerId = "") {
|
|
7305
|
+
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), namedViewRoot, clientWindow, namingContainerId);
|
|
7266
7306
|
}
|
|
7267
7307
|
/**
|
|
7268
7308
|
* generic append state which appends a certain state as hidden element to an existing set of forms
|
|
7269
7309
|
*
|
|
7270
7310
|
* @param forms the forms to append or change to
|
|
7271
7311
|
* @param selector the selector for the state
|
|
7312
|
+
* @param namedViewRoot if set to true, the name is also prefixed
|
|
7272
7313
|
* @param state the state itself which needs to be assigned
|
|
7273
7314
|
*
|
|
7274
7315
|
* @param namingContainerId
|
|
7275
7316
|
* @private
|
|
7276
7317
|
*/
|
|
7277
|
-
assignState(forms, selector, state, namingContainerId) {
|
|
7318
|
+
assignState(forms, selector, namedViewRoot, state, namingContainerId) {
|
|
7278
7319
|
/**
|
|
7279
7320
|
* creates the viewState or client window id element
|
|
7280
7321
|
* @param form
|
|
@@ -7283,6 +7324,7 @@ class ResponseProcessor {
|
|
|
7283
7324
|
return new HiddenInputBuilder_1.HiddenInputBuilder(selector)
|
|
7284
7325
|
.withNamingContainerId(namingContainerId)
|
|
7285
7326
|
.withParent(form)
|
|
7327
|
+
.withNamedViewRoot(namedViewRoot)
|
|
7286
7328
|
.build();
|
|
7287
7329
|
};
|
|
7288
7330
|
forms.each(form => {
|
|
Binary file
|
|
Binary file
|