jsf.js_next_gen 4.0.0-RC.20 → 4.0.0-RC.22
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 +49 -16
- 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 +49 -16
- 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 +15 -0
- package/src/main/typescript/impl/xhrCore/Response.ts +15 -2
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +12 -10
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +4 -2
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +11 -4
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +27 -27
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +6 -6
- package/target/impl/core/Const.js +6 -4
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/util/HiddenInputBuilder.js +15 -2
- package/target/impl/util/HiddenInputBuilder.js.map +1 -1
- package/target/impl/xhrCore/Response.js +13 -1
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +11 -7
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +4 -2
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +6 -3
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +27 -27
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +6 -6
- package/target/test/xhrCore/ResponseTest23.spec.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,8 +6087,12 @@ 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
|
-
var _a, _b;
|
|
6095
|
+
var _a, _b, _c;
|
|
6089
6096
|
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
6090
6097
|
let existingStates = (0, mona_dish_1.DQ$)(`[name*='${(0, Const_1.$nsp)(this.name)}']`);
|
|
6091
6098
|
let cnt = existingStates.stream.map(state => {
|
|
@@ -6101,7 +6108,15 @@ class HiddenInputBuilder {
|
|
|
6101
6108
|
newElement.id.value = (((_a = this.namingContainerId) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
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
|
|
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
|
+
}
|
|
6119
|
+
(_c = this === null || this === void 0 ? void 0 : this.parent) === null || _c === void 0 ? void 0 : _c.append(newElement);
|
|
6105
6120
|
return newElement;
|
|
6106
6121
|
}
|
|
6107
6122
|
}
|
|
@@ -6819,7 +6834,19 @@ var Response;
|
|
|
6819
6834
|
* highest node partial-response from there the main operations are triggered
|
|
6820
6835
|
*/
|
|
6821
6836
|
function processPartialTag(node, responseProcessor, internalContext) {
|
|
6822
|
-
|
|
6837
|
+
var _a, _b;
|
|
6838
|
+
let namedAttr = node.attr(Const_1.XML_ATTR_NAMED_VIEWROOT);
|
|
6839
|
+
// MyFaces.
|
|
6840
|
+
// there are two differences here on how we determine the naming container scenario
|
|
6841
|
+
// mojarra only partial reponse identifier, and if there is none we do not have any naming container
|
|
6842
|
+
// myfaces either uses the reponse identifier
|
|
6843
|
+
let namedViewRoot = namedAttr.isPresent() ? namedAttr.value === "true" : false;
|
|
6844
|
+
if (!namedAttr.isPresent() && node.id) { // defauts fallback if namedViewRoot is not set, if node id is set
|
|
6845
|
+
// it defaults to a naming container
|
|
6846
|
+
namedViewRoot = !((_a = document === null || document === void 0 ? void 0 : document.head) === null || _a === void 0 ? void 0 : _a.id);
|
|
6847
|
+
}
|
|
6848
|
+
internalContext.assignIf(Const_1.PARTIAL_ID).value = (_b = node.id) !== null && _b !== void 0 ? _b : document === null || document === void 0 ? void 0 : document.head.id; // second case mojarra
|
|
6849
|
+
internalContext.assignIf(Const_1.NAMED_VIEWROOT).value = namedViewRoot;
|
|
6823
6850
|
const SEL_SUB_TAGS = [Const_1.XML_TAG_ERROR, Const_1.XML_TAG_REDIRECT, Const_1.XML_TAG_CHANGES].join(",");
|
|
6824
6851
|
// now we can process the main operations
|
|
6825
6852
|
node.querySelectorAll(SEL_SUB_TAGS).each((node) => {
|
|
@@ -7214,9 +7241,10 @@ class ResponseProcessor {
|
|
|
7214
7241
|
mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_VST).orElse({}).value)
|
|
7215
7242
|
.each(([, value]) => {
|
|
7216
7243
|
const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
|
|
7244
|
+
const namedViewRoot = !!this.internalContext.getIf(Const_1.PARTIAL_ID).value;
|
|
7217
7245
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
7218
7246
|
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
7219
|
-
this.appendViewStateToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
7247
|
+
this.appendViewStateToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
7220
7248
|
});
|
|
7221
7249
|
}
|
|
7222
7250
|
/**
|
|
@@ -7227,9 +7255,10 @@ class ResponseProcessor {
|
|
|
7227
7255
|
mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
|
|
7228
7256
|
.each(([, value]) => {
|
|
7229
7257
|
const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
|
|
7258
|
+
const namedViewRoot = !!this.internalContext.getIf(Const_1.NAMED_VIEWROOT).value;
|
|
7230
7259
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
7231
7260
|
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
7232
|
-
this.appendClientWindowToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
7261
|
+
this.appendClientWindowToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
7233
7262
|
});
|
|
7234
7263
|
}
|
|
7235
7264
|
/**
|
|
@@ -7248,8 +7277,8 @@ class ResponseProcessor {
|
|
|
7248
7277
|
* @param viewState the final viewState
|
|
7249
7278
|
* @param namingContainerId
|
|
7250
7279
|
*/
|
|
7251
|
-
appendViewStateToForms(forms, viewState, namingContainerId = "") {
|
|
7252
|
-
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState, namingContainerId);
|
|
7280
|
+
appendViewStateToForms(forms, namedViewRoot, viewState, namingContainerId = "") {
|
|
7281
|
+
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), namedViewRoot, viewState, namingContainerId);
|
|
7253
7282
|
}
|
|
7254
7283
|
/**
|
|
7255
7284
|
* proper clientWindow -> form assignment
|
|
@@ -7258,20 +7287,21 @@ class ResponseProcessor {
|
|
|
7258
7287
|
* @param clientWindow the final viewState
|
|
7259
7288
|
* @param namingContainerId
|
|
7260
7289
|
*/
|
|
7261
|
-
appendClientWindowToForms(forms, clientWindow, namingContainerId = "") {
|
|
7262
|
-
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow, namingContainerId);
|
|
7290
|
+
appendClientWindowToForms(forms, namedViewRoot, clientWindow, namingContainerId = "") {
|
|
7291
|
+
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), namedViewRoot, clientWindow, namingContainerId);
|
|
7263
7292
|
}
|
|
7264
7293
|
/**
|
|
7265
7294
|
* generic append state which appends a certain state as hidden element to an existing set of forms
|
|
7266
7295
|
*
|
|
7267
7296
|
* @param forms the forms to append or change to
|
|
7268
7297
|
* @param selector the selector for the state
|
|
7298
|
+
* @param namedViewRoot if set to true, the name is also prefixed
|
|
7269
7299
|
* @param state the state itself which needs to be assigned
|
|
7270
7300
|
*
|
|
7271
7301
|
* @param namingContainerId
|
|
7272
7302
|
* @private
|
|
7273
7303
|
*/
|
|
7274
|
-
assignState(forms, selector, state, namingContainerId) {
|
|
7304
|
+
assignState(forms, selector, namedViewRoot, state, namingContainerId) {
|
|
7275
7305
|
/**
|
|
7276
7306
|
* creates the viewState or client window id element
|
|
7277
7307
|
* @param form
|
|
@@ -7280,6 +7310,7 @@ class ResponseProcessor {
|
|
|
7280
7310
|
return new HiddenInputBuilder_1.HiddenInputBuilder(selector)
|
|
7281
7311
|
.withNamingContainerId(namingContainerId)
|
|
7282
7312
|
.withParent(form)
|
|
7313
|
+
.withNamedViewRoot(namedViewRoot)
|
|
7283
7314
|
.build();
|
|
7284
7315
|
};
|
|
7285
7316
|
forms.each(form => {
|
|
@@ -7509,8 +7540,10 @@ class XhrFormData extends mona_dish_1.Config {
|
|
|
7509
7540
|
* @param form the form holding the view state value
|
|
7510
7541
|
*/
|
|
7511
7542
|
applyViewState(form) {
|
|
7512
|
-
let
|
|
7513
|
-
|
|
7543
|
+
let viewStateElement = form.querySelectorAllDeep(`[name*='${Const_1.P_VIEWSTATE}'`);
|
|
7544
|
+
let viewState = viewStateElement.inputValue;
|
|
7545
|
+
// this.appendIf(viewState.isPresent(), P_VIEWSTATE).value = viewState.value;
|
|
7546
|
+
this.appendIf(viewState.isPresent(), viewStateElement.name.value).value = viewState.value;
|
|
7514
7547
|
}
|
|
7515
7548
|
/**
|
|
7516
7549
|
* assigns an url encoded string to this xhrFormData object
|
|
Binary file
|
|
Binary file
|