jsf.js_next_gen 4.0.0-RC.11 → 4.0.0-RC.14
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 +298 -208
- 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.LICENSE.txt +0 -2
- 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 +298 -208
- 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.LICENSE.txt +0 -2
- 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 +4 -4
- package/src/main/test.xml +23 -0
- package/src/main/typescript/@types/definitions/index.d.ts +2 -0
- package/src/main/typescript/api/_api.ts +2 -2
- package/src/main/typescript/impl/AjaxImpl.ts +40 -29
- package/src/main/typescript/impl/core/Const.ts +43 -38
- package/src/main/typescript/impl/core/Context.ts +19 -0
- package/src/main/typescript/impl/util/Assertions.ts +2 -2
- package/src/main/typescript/impl/util/ExtDomQuery.ts +2 -2
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +63 -0
- package/src/main/typescript/impl/util/Lang.ts +8 -10
- package/src/main/typescript/impl/xhrCore/EventData.ts +2 -2
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +17 -5
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +4 -4
- package/src/main/typescript/impl/xhrCore/Response.ts +25 -25
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +116 -120
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +1 -1
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +8 -7
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +19 -0
- package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -3
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +195 -0
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +2 -0
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +142 -2
- package/target/api/_api.js +1 -1
- package/target/api/_api.js.map +1 -1
- package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
- package/target/impl/AjaxImpl.js +34 -23
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/core/Const.js +44 -36
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/Context.js +10 -0
- package/target/impl/core/Context.js.map +1 -0
- package/target/impl/util/Assertions.js +1 -1
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +2 -2
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/HiddenElementBuilder.js +7 -0
- package/target/impl/util/HiddenElementBuilder.js.map +1 -0
- package/target/impl/util/HiddenInputBuilder.js +58 -0
- package/target/impl/util/HiddenInputBuilder.js.map +1 -0
- package/target/impl/util/Lang.js +7 -9
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +1 -1
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +13 -3
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +3 -3
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +13 -13
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +98 -107
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +1 -1
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +7 -8
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +18 -0
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +2 -2
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +2 -2
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +199 -0
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +127 -2
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test-classes/.gz +0 -0
- package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
- package/target/test-classes/fileuploadtest.html +24 -0
- package/target/test-classes/jsf-development.js +3559 -0
- package/target/test-classes/jsf-development.js.br +0 -0
- package/target/test-classes/jsf-development.js.gz +0 -0
- package/target/test-classes/jsf-development.js.map +1 -0
- package/target/test-classes/jsf.js +3 -0
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/tmp.xml +36 -0
|
@@ -340,6 +340,12 @@ class DomQuery {
|
|
|
340
340
|
set val(value) {
|
|
341
341
|
this.inputValue.value = value;
|
|
342
342
|
}
|
|
343
|
+
get nodeId() {
|
|
344
|
+
return this.id.value;
|
|
345
|
+
}
|
|
346
|
+
set nodeId(value) {
|
|
347
|
+
this.id.value = value;
|
|
348
|
+
}
|
|
343
349
|
get checked() {
|
|
344
350
|
return Stream_1.Stream.of(...this.values).allMatch(el => !!el.checked);
|
|
345
351
|
}
|
|
@@ -4076,7 +4082,7 @@ var myfaces;
|
|
|
4076
4082
|
options[(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
|
|
4077
4083
|
}
|
|
4078
4084
|
if (execute) {
|
|
4079
|
-
options[Const_1.
|
|
4085
|
+
options[Const_1.CTX_OPTIONS_EXECUTE] = execute;
|
|
4080
4086
|
}
|
|
4081
4087
|
if (render) {
|
|
4082
4088
|
options[Const_1.CTX_PARAM_RENDER] = render;
|
|
@@ -4315,21 +4321,23 @@ var Implementation;
|
|
|
4315
4321
|
* with detached objects
|
|
4316
4322
|
*/
|
|
4317
4323
|
const form = (0, RequestDataResolver_1.resolveForm)(requestCtx, elem, resolvedEvent);
|
|
4324
|
+
const viewId = (0, RequestDataResolver_1.resolveViewId)(form);
|
|
4318
4325
|
const formId = form.id.value;
|
|
4319
4326
|
const delay = (0, RequestDataResolver_1.resolveDelay)(options);
|
|
4320
4327
|
const timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
|
|
4321
4328
|
requestCtx.assignIf(!!windowId, Const_1.P_WINDOW_ID).value = windowId;
|
|
4322
4329
|
// old non spec behavior will be removed after it is clear whether the removal breaks any code
|
|
4323
|
-
requestCtx.assign(Const_1.
|
|
4330
|
+
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR).value = filterPassThroughValues(options.value);
|
|
4324
4331
|
// spec conform behavior, all passthrough params must be under "passthrough
|
|
4325
|
-
const params = remapArrayToAssocArr(options.getIf(Const_1.
|
|
4326
|
-
requestCtx.getIf(Const_1.
|
|
4327
|
-
requestCtx.assignIf(!!resolvedEvent, Const_1.
|
|
4332
|
+
const params = remapArrayToAssocArr(options.getIf(Const_1.CTX_OPTIONS_PARAMS).orElse({}).value);
|
|
4333
|
+
requestCtx.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).shallowMerge(new mona_dish_1.Config(params), true);
|
|
4334
|
+
requestCtx.assignIf(!!resolvedEvent, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EVT).value = resolvedEvent === null || resolvedEvent === void 0 ? void 0 : resolvedEvent.type;
|
|
4328
4335
|
/**
|
|
4329
4336
|
* ajax pass through context with the source
|
|
4330
4337
|
* onresolved Event and onerror Event
|
|
4331
4338
|
*/
|
|
4332
4339
|
requestCtx.assign(Const_1.SOURCE).value = elementId;
|
|
4340
|
+
requestCtx.assign(Const_1.VIEW_ID).value = viewId;
|
|
4333
4341
|
/**
|
|
4334
4342
|
* on resolvedEvent and onError...
|
|
4335
4343
|
* those values will be traversed later on
|
|
@@ -4344,11 +4352,11 @@ var Implementation;
|
|
|
4344
4352
|
/**
|
|
4345
4353
|
* binding contract the jakarta.faces.source must be set
|
|
4346
4354
|
*/
|
|
4347
|
-
requestCtx.assign(Const_1.
|
|
4355
|
+
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_PARTIAL_SOURCE).value = elementId;
|
|
4348
4356
|
/**
|
|
4349
4357
|
* jakarta.faces.partial.ajax must be set to true
|
|
4350
4358
|
*/
|
|
4351
|
-
requestCtx.assign(Const_1.
|
|
4359
|
+
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX).value = true;
|
|
4352
4360
|
/**
|
|
4353
4361
|
* if resetValues is set to true
|
|
4354
4362
|
* then we have to set jakarta.faces.resetValues as well
|
|
@@ -4356,7 +4364,7 @@ var Implementation;
|
|
|
4356
4364
|
* the value has to be explicitly true, according to
|
|
4357
4365
|
* the specs jsdoc
|
|
4358
4366
|
*/
|
|
4359
|
-
requestCtx.assignIf(isResetValues, Const_1.
|
|
4367
|
+
requestCtx.assignIf(isResetValues, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_RESET_VALUES).value = true;
|
|
4360
4368
|
// additional meta information to speed things up, note internal non jsf
|
|
4361
4369
|
// pass through options are stored under _mfInternal in the context
|
|
4362
4370
|
internalCtx.assign(Const_1.CTX_PARAM_SRC_FRM_ID).value = formId;
|
|
@@ -4365,9 +4373,8 @@ var Implementation;
|
|
|
4365
4373
|
// mojarra under blackbox conditions.
|
|
4366
4374
|
// I assume it does the same as our formId_submit=1 so leaving it out
|
|
4367
4375
|
// won't hurt but for the sake of compatibility we are going to add it
|
|
4368
|
-
requestCtx.assign(Const_1.
|
|
4376
|
+
requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, formId).value = formId;
|
|
4369
4377
|
internalCtx.assign(Const_1.CTX_PARAM_SRC_CTL_ID).value = elementId;
|
|
4370
|
-
internalCtx.assign(Const_1.CTX_PARAM_TR_TYPE).value = Const_1.REQ_TYPE_POST;
|
|
4371
4378
|
assignClientWindowId(form, requestCtx);
|
|
4372
4379
|
assignExecute(options, requestCtx, form, elementId);
|
|
4373
4380
|
assignRender(options, requestCtx, form, elementId);
|
|
@@ -4540,7 +4547,7 @@ var Implementation;
|
|
|
4540
4547
|
* because it makes it easier to detect bugs
|
|
4541
4548
|
*/
|
|
4542
4549
|
let element = mona_dish_1.DQ.byId(form, true);
|
|
4543
|
-
if (!element.isTag(Const_1.
|
|
4550
|
+
if (!element.isTag(Const_1.HTML_TAG_FORM)) {
|
|
4544
4551
|
throw new Error(getMessage("ERR_VIEWSTATE"));
|
|
4545
4552
|
}
|
|
4546
4553
|
let formData = new XhrFormData_1.XhrFormData(element);
|
|
@@ -4578,7 +4585,7 @@ var Implementation;
|
|
|
4578
4585
|
*/
|
|
4579
4586
|
function assignRender(requestOptions, targetContext, issuingForm, sourceElementId) {
|
|
4580
4587
|
if (requestOptions.getIf(Const_1.CTX_PARAM_RENDER).isPresent()) {
|
|
4581
|
-
remapDefaultConstants(targetContext.getIf(Const_1.
|
|
4588
|
+
remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).get({}), Const_1.P_RENDER, requestOptions.getIf(Const_1.CTX_PARAM_RENDER).value, issuingForm, sourceElementId, targetContext.getIf(Const_1.VIEW_ID).value);
|
|
4582
4589
|
}
|
|
4583
4590
|
}
|
|
4584
4591
|
/**
|
|
@@ -4594,16 +4601,16 @@ var Implementation;
|
|
|
4594
4601
|
* @param sourceElementId the executing element triggering the faces.ajax.request (id of it)
|
|
4595
4602
|
*/
|
|
4596
4603
|
function assignExecute(requestOptions, targetContext, issuingForm, sourceElementId) {
|
|
4597
|
-
if (requestOptions.getIf(Const_1.
|
|
4604
|
+
if (requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).isPresent()) {
|
|
4598
4605
|
/*the options must be a blank delimited list of strings*/
|
|
4599
4606
|
/*compliance with Mojarra which automatically adds @this to an execute
|
|
4600
4607
|
* the spec rev 2.0a however states, if none is issued nothing at all should be sent down
|
|
4601
4608
|
*/
|
|
4602
|
-
requestOptions.assign(Const_1.
|
|
4603
|
-
remapDefaultConstants(targetContext.getIf(Const_1.
|
|
4609
|
+
requestOptions.assign(Const_1.CTX_OPTIONS_EXECUTE).value = [requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).value, Const_1.IDENT_THIS].join(" ");
|
|
4610
|
+
remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).get({}), Const_1.P_EXECUTE, requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).value, issuingForm, sourceElementId, targetContext.getIf(Const_1.VIEW_ID).value);
|
|
4604
4611
|
}
|
|
4605
4612
|
else {
|
|
4606
|
-
targetContext.assign(Const_1.
|
|
4613
|
+
targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).value = sourceElementId;
|
|
4607
4614
|
}
|
|
4608
4615
|
}
|
|
4609
4616
|
/**
|
|
@@ -4613,10 +4620,9 @@ var Implementation;
|
|
|
4613
4620
|
* @param targetContext the target context receiving the value
|
|
4614
4621
|
*/
|
|
4615
4622
|
function assignClientWindowId(form, targetContext) {
|
|
4616
|
-
|
|
4617
|
-
let clientWindow = ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf).getClientWindow(form.getAsElem(0).value);
|
|
4623
|
+
let clientWindow = (0, Const_1.$faces)().getClientWindow(form.getAsElem(0).value);
|
|
4618
4624
|
if (clientWindow) {
|
|
4619
|
-
targetContext.assign(Const_1.
|
|
4625
|
+
targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_CLIENT_WINDOW).value = clientWindow;
|
|
4620
4626
|
}
|
|
4621
4627
|
}
|
|
4622
4628
|
/**
|
|
@@ -4633,12 +4639,24 @@ var Implementation;
|
|
|
4633
4639
|
* @param userValues the passed user values (aka input string which needs to be transformed)
|
|
4634
4640
|
* @param issuingForm the form where the issuing element originates
|
|
4635
4641
|
* @param issuingElementId the issuing element
|
|
4642
|
+
* @param viewId the naming container id ("" default if none is given)
|
|
4636
4643
|
*/
|
|
4637
|
-
function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId) {
|
|
4644
|
+
function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId, viewId = "") {
|
|
4638
4645
|
//a cleaner implementation of the transform list method
|
|
4646
|
+
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
4639
4647
|
let iterValues = (userValues) ? trim(userValues).split(/\s+/gi) : [];
|
|
4640
4648
|
let ret = [];
|
|
4641
4649
|
let processed = {};
|
|
4650
|
+
//TODO check if this is right
|
|
4651
|
+
const remapNamingContainer = item => {
|
|
4652
|
+
if (item.indexOf(SEP) === 0 && viewId !== "") {
|
|
4653
|
+
item = [viewId, SEP, item.substring(1)].join("");
|
|
4654
|
+
}
|
|
4655
|
+
else if (item.indexOf(SEP) === 0) {
|
|
4656
|
+
item = item.substring(1);
|
|
4657
|
+
}
|
|
4658
|
+
return item;
|
|
4659
|
+
};
|
|
4642
4660
|
// in this case we do not use lazy stream because it wont bring any code reduction
|
|
4643
4661
|
// or speedup
|
|
4644
4662
|
for (let cnt = 0; cnt < iterValues.length; cnt++) {
|
|
@@ -4656,22 +4674,21 @@ var Implementation;
|
|
|
4656
4674
|
return targetConfig;
|
|
4657
4675
|
//@form pushes the issuing form id into our list
|
|
4658
4676
|
case Const_1.IDENT_FORM:
|
|
4659
|
-
ret.push(issuingForm.id.value);
|
|
4677
|
+
ret.push(remapNamingContainer(issuingForm.id.value));
|
|
4660
4678
|
processed[issuingForm.id.value] = true;
|
|
4661
4679
|
break;
|
|
4662
4680
|
//@this is replaced with the current issuing element id
|
|
4663
4681
|
case Const_1.IDENT_THIS:
|
|
4664
4682
|
if (!(issuingElementId in processed)) {
|
|
4665
|
-
ret.push(issuingElementId);
|
|
4683
|
+
ret.push(remapNamingContainer(issuingElementId));
|
|
4666
4684
|
processed[issuingElementId] = true;
|
|
4667
4685
|
}
|
|
4668
4686
|
break;
|
|
4669
4687
|
default:
|
|
4670
|
-
ret.push(iterValues[cnt]);
|
|
4688
|
+
ret.push(remapNamingContainer(iterValues[cnt]));
|
|
4671
4689
|
processed[iterValues[cnt]] = true;
|
|
4672
4690
|
}
|
|
4673
4691
|
}
|
|
4674
|
-
//We now add the target as joined list
|
|
4675
4692
|
targetConfig.assign(targetKey).value = ret.join(" ");
|
|
4676
4693
|
return targetConfig;
|
|
4677
4694
|
}
|
|
@@ -5024,14 +5041,15 @@ var PushImpl;
|
|
|
5024
5041
|
* limitations under the License.
|
|
5025
5042
|
*/
|
|
5026
5043
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5027
|
-
exports.
|
|
5028
|
-
exports.
|
|
5029
|
-
exports.$nsp = exports.UNKNOWN = exports.MAX_RECONNECT_ATTEMPTS = exports.RECONNECT_INTERVAL = exports.APPLIED_CLIENT_WINDOW = exports.APPLIED_VST = exports.REASON_EXPIRED = exports.MF_NONE = void 0;
|
|
5044
|
+
exports.CTX_OPTIONS_TIMEOUT = 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;
|
|
5045
|
+
exports.UPDATE_ELEMS = 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 = void 0;
|
|
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;
|
|
5030
5047
|
/*
|
|
5031
5048
|
* [export const] constants
|
|
5032
5049
|
*/
|
|
5033
5050
|
exports.P_PARTIAL_SOURCE = "jakarta.faces.source";
|
|
5034
5051
|
exports.PARTIAL_ID = "partialId";
|
|
5052
|
+
exports.VIEW_ID = "myfaves.viewId";
|
|
5035
5053
|
exports.P_VIEWSTATE = "jakarta.faces.ViewState";
|
|
5036
5054
|
exports.P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
|
|
5037
5055
|
exports.P_VIEWROOT = "jakarta.faces.ViewRoot";
|
|
@@ -5053,6 +5071,8 @@ exports.IDENT_FORM = "@form";
|
|
|
5053
5071
|
exports.P_AJAX = "jakarta.faces.partial.ajax";
|
|
5054
5072
|
exports.P_EXECUTE = "jakarta.faces.partial.execute";
|
|
5055
5073
|
exports.P_RENDER = "jakarta.faces.partial.render";
|
|
5074
|
+
/*render override for viewbody or viewroot, in both cases an all is performed*/
|
|
5075
|
+
exports.P_RENDER_OVERRIDE = "_myfaces.rendeOverride";
|
|
5056
5076
|
exports.P_EVT = "jakarta.faces.partial.event";
|
|
5057
5077
|
exports.P_RESET_VALUES = "jakarta.faces.partial.resetValues";
|
|
5058
5078
|
exports.P_WINDOW_ID = "jakarta.faces.windowId";
|
|
@@ -5081,17 +5101,15 @@ exports.MALFORMEDXML = "malformedXML";
|
|
|
5081
5101
|
exports.SERVER_ERROR = "serverError";
|
|
5082
5102
|
exports.CLIENT_ERROR = "clientError";
|
|
5083
5103
|
exports.TIMEOUT_EVENT = "timeout";
|
|
5084
|
-
exports.
|
|
5085
|
-
exports.
|
|
5086
|
-
exports.
|
|
5087
|
-
exports.
|
|
5088
|
-
exports.
|
|
5089
|
-
exports.
|
|
5090
|
-
exports.
|
|
5091
|
-
exports.
|
|
5092
|
-
exports.
|
|
5093
|
-
exports.CTX_PARAM_EXECUTE = "execute";
|
|
5094
|
-
exports.STAGE_DEVELOPMENT = "Development";
|
|
5104
|
+
exports.CTX_OPTIONS_PARAMS = "params";
|
|
5105
|
+
exports.CTX_OPTIONS_DELAY = "delay";
|
|
5106
|
+
exports.CTX_OPTIONS_TIMEOUT = "timeout";
|
|
5107
|
+
exports.CTX_OPTIONS_RESET = "resetValues";
|
|
5108
|
+
exports.CTX_OPTIONS_EXECUTE = "execute";
|
|
5109
|
+
exports.CTX_PARAM_MF_INTERNAL = "myfaces.internal";
|
|
5110
|
+
exports.CTX_PARAM_SRC_FRM_ID = "myfaces.source.formId";
|
|
5111
|
+
exports.CTX_PARAM_SRC_CTL_ID = "myfaces.source.controlId";
|
|
5112
|
+
exports.CTX_PARAM_REQ_PASS_THR = "myfaces.request.passThrough";
|
|
5095
5113
|
exports.CONTENT_TYPE = "Content-Type";
|
|
5096
5114
|
exports.HEAD_FACES_REQ = "Faces-Request";
|
|
5097
5115
|
exports.REQ_ACCEPT = "Accept";
|
|
@@ -5106,12 +5124,12 @@ exports.URL_ENCODED = "application/x-www-form-urlencoded";
|
|
|
5106
5124
|
exports.MULTIPART = "multipart/form-data";
|
|
5107
5125
|
exports.NO_TIMEOUT = 0;
|
|
5108
5126
|
exports.STD_ACCEPT = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
|
|
5109
|
-
exports.
|
|
5110
|
-
exports.
|
|
5111
|
-
exports.
|
|
5112
|
-
exports.
|
|
5113
|
-
exports.
|
|
5114
|
-
exports.
|
|
5127
|
+
exports.HTML_TAG_HEAD = "HEAD";
|
|
5128
|
+
exports.HTML_TAG_FORM = "FORM";
|
|
5129
|
+
exports.HTML_TAG_BODY = "BODY";
|
|
5130
|
+
exports.HTML_TAG_LINK = "LINK";
|
|
5131
|
+
exports.HTML_TAG_SCRIPT = "SCRIPT";
|
|
5132
|
+
exports.HTML_TAG_STYLE = "STYLE";
|
|
5115
5133
|
exports.SEL_VIEWSTATE_ELEM = "[name='" + exports.P_VIEWSTATE + "']";
|
|
5116
5134
|
exports.SEL_CLIENT_WINDOW_ELEM = "[name='" + exports.P_CLIENT_WINDOW + "']";
|
|
5117
5135
|
exports.SEL_RESPONSE_XML = "responseXML";
|
|
@@ -5122,29 +5140,31 @@ exports.ATTR_NAME = "name";
|
|
|
5122
5140
|
exports.ATTR_VALUE = "value";
|
|
5123
5141
|
exports.ATTR_ID = "id";
|
|
5124
5142
|
/*partial response types*/
|
|
5125
|
-
exports.
|
|
5143
|
+
exports.XML_TAG_PARTIAL_RESP = "partial-response";
|
|
5126
5144
|
/*partial commands*/
|
|
5127
|
-
exports.
|
|
5128
|
-
exports.
|
|
5129
|
-
exports.
|
|
5130
|
-
exports.
|
|
5131
|
-
exports.
|
|
5132
|
-
exports.
|
|
5133
|
-
exports.
|
|
5134
|
-
exports.
|
|
5135
|
-
exports.
|
|
5145
|
+
exports.XML_TAG_CHANGES = "changes";
|
|
5146
|
+
exports.XML_TAG_UPDATE = "update";
|
|
5147
|
+
exports.XML_TAG_DELETE = "delete";
|
|
5148
|
+
exports.XML_TAG_INSERT = "insert";
|
|
5149
|
+
exports.XML_TAG_EVAL = "eval";
|
|
5150
|
+
exports.XML_TAG_ERROR = "error";
|
|
5151
|
+
exports.XML_TAG_ATTRIBUTES = "attributes";
|
|
5152
|
+
exports.XML_TAG_EXTENSION = "extension";
|
|
5153
|
+
exports.XML_TAG_REDIRECT = "redirect";
|
|
5154
|
+
exports.XML_TAG_BEFORE = "before";
|
|
5155
|
+
exports.XML_TAG_AFTER = "after";
|
|
5156
|
+
exports.XML_TAG_ATTR = "attribute";
|
|
5136
5157
|
/*other constants*/
|
|
5137
|
-
exports.UPDATE_FORMS = "
|
|
5138
|
-
exports.UPDATE_ELEMS = "
|
|
5158
|
+
exports.UPDATE_FORMS = "myfaces.updateForms";
|
|
5159
|
+
exports.UPDATE_ELEMS = "myfaces.updateElems";
|
|
5139
5160
|
//we want the head elements to be processed before we process the body
|
|
5140
5161
|
//but after the inner html is done
|
|
5141
|
-
exports.DEFERRED_HEAD_INSERTS = "
|
|
5162
|
+
exports.DEFERRED_HEAD_INSERTS = "myfaces.headElems";
|
|
5142
5163
|
exports.MYFACES = "myfaces";
|
|
5143
|
-
exports.SEL_SCRIPTS_STYLES = "script, style, link";
|
|
5144
5164
|
exports.MF_NONE = "__mf_none__";
|
|
5145
5165
|
exports.REASON_EXPIRED = "Expired";
|
|
5146
|
-
exports.APPLIED_VST = "appliedViewState";
|
|
5147
|
-
exports.APPLIED_CLIENT_WINDOW = "appliedClientWindow";
|
|
5166
|
+
exports.APPLIED_VST = "myfaces.appliedViewState";
|
|
5167
|
+
exports.APPLIED_CLIENT_WINDOW = "myfaces.appliedClientWindow";
|
|
5148
5168
|
exports.RECONNECT_INTERVAL = 500;
|
|
5149
5169
|
exports.MAX_RECONNECT_ATTEMPTS = 25;
|
|
5150
5170
|
exports.UNKNOWN = "UNKNOWN";
|
|
@@ -5155,6 +5175,11 @@ exports.UNKNOWN = "UNKNOWN";
|
|
|
5155
5175
|
* To take the compatibility layer out this method just has to be
|
|
5156
5176
|
* changed to a simple value passthrough
|
|
5157
5177
|
*/
|
|
5178
|
+
function $faces() {
|
|
5179
|
+
var _a;
|
|
5180
|
+
return ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf);
|
|
5181
|
+
}
|
|
5182
|
+
exports.$faces = $faces;
|
|
5158
5183
|
function $nsp(inputNamespace) {
|
|
5159
5184
|
if ((!inputNamespace) || !(inputNamespace === null || inputNamespace === void 0 ? void 0 : inputNamespace.replace)) {
|
|
5160
5185
|
return inputNamespace;
|
|
@@ -5392,7 +5417,7 @@ var Assertions;
|
|
|
5392
5417
|
function assertValidXMLResponse(responseXML) {
|
|
5393
5418
|
assert(!responseXML.isAbsent(), Const_1.EMPTY_RESPONSE, Const_1.PHASE_PROCESS_RESPONSE);
|
|
5394
5419
|
assert(!responseXML.isXMLParserError(), responseXML.parserErrorText(Const_1.EMPTY_STR), Const_1.PHASE_PROCESS_RESPONSE);
|
|
5395
|
-
assert(responseXML.querySelectorAll(Const_1.
|
|
5420
|
+
assert(responseXML.querySelectorAll(Const_1.XML_TAG_PARTIAL_RESP).isPresent(), Const_1.ERR_NO_PARTIAL_RESPONSE, Const_1.PHASE_PROCESS_RESPONSE);
|
|
5396
5421
|
}
|
|
5397
5422
|
Assertions.assertValidXMLResponse = assertValidXMLResponse;
|
|
5398
5423
|
/**
|
|
@@ -5755,8 +5780,8 @@ class ExtDomQuery extends mona_dish_1.DQ {
|
|
|
5755
5780
|
return true;
|
|
5756
5781
|
}
|
|
5757
5782
|
let reference = element.attr("href")
|
|
5758
|
-
.
|
|
5759
|
-
.
|
|
5783
|
+
.orElseLazy(() => element.attr("src").value)
|
|
5784
|
+
.orElseLazy(() => element.attr("rel").value);
|
|
5760
5785
|
if (!reference.isPresent()) {
|
|
5761
5786
|
return true;
|
|
5762
5787
|
}
|
|
@@ -5869,6 +5894,73 @@ class ExtConfig extends mona_dish_1.Config {
|
|
|
5869
5894
|
exports.ExtConfig = ExtConfig;
|
|
5870
5895
|
|
|
5871
5896
|
|
|
5897
|
+
/***/ }),
|
|
5898
|
+
|
|
5899
|
+
/***/ "./src/main/typescript/impl/util/HiddenInputBuilder.ts":
|
|
5900
|
+
/*!*************************************************************!*\
|
|
5901
|
+
!*** ./src/main/typescript/impl/util/HiddenInputBuilder.ts ***!
|
|
5902
|
+
\*************************************************************/
|
|
5903
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5904
|
+
|
|
5905
|
+
|
|
5906
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
5907
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
5908
|
+
* this work for additional information regarding copyright ownership.
|
|
5909
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5910
|
+
* (the "License"); you may not use this file except in compliance with
|
|
5911
|
+
* the License. You may obtain a copy of the License at
|
|
5912
|
+
*
|
|
5913
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5914
|
+
*
|
|
5915
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5916
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5917
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5918
|
+
* See the License for the specific language governing permissions and
|
|
5919
|
+
* limitations under the License.
|
|
5920
|
+
*
|
|
5921
|
+
*/
|
|
5922
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5923
|
+
exports.HiddenInputBuilder = void 0;
|
|
5924
|
+
const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
5925
|
+
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
5926
|
+
/**
|
|
5927
|
+
* Builder for hidden inputs.
|
|
5928
|
+
* ATM only ViewState and Client window
|
|
5929
|
+
* are supported (per spec)
|
|
5930
|
+
*
|
|
5931
|
+
* Improves readability in the response processor!
|
|
5932
|
+
*/
|
|
5933
|
+
class HiddenInputBuilder {
|
|
5934
|
+
constructor(selector) {
|
|
5935
|
+
this.selector = selector;
|
|
5936
|
+
const isViewState = selector.indexOf((0, Const_1.$nsp)(Const_1.P_VIEWSTATE)) != -1;
|
|
5937
|
+
this.name = isViewState ? Const_1.P_VIEWSTATE : Const_1.P_CLIENT_WINDOW;
|
|
5938
|
+
this.template = isViewState ? Const_1.HTML_VIEWSTATE : Const_1.HTML_CLIENT_WINDOW;
|
|
5939
|
+
}
|
|
5940
|
+
withNamingContainerId(namingContainer) {
|
|
5941
|
+
this.namingContainerId = namingContainer;
|
|
5942
|
+
return this;
|
|
5943
|
+
}
|
|
5944
|
+
withParent(parent) {
|
|
5945
|
+
this.parent = parent;
|
|
5946
|
+
return this;
|
|
5947
|
+
}
|
|
5948
|
+
build() {
|
|
5949
|
+
var _a, _b;
|
|
5950
|
+
//TODO naming container id?
|
|
5951
|
+
const cnt = (0, mona_dish_1.DQ$)(`[name='${(0, Const_1.$nsp)(this.name)}']`).length;
|
|
5952
|
+
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
5953
|
+
const newElement = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(this.template));
|
|
5954
|
+
newElement.id.value = (((_a = this.namingContainerId) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
5955
|
+
[this.namingContainerId, (0, Const_1.$nsp)(this.name), cnt] :
|
|
5956
|
+
[(0, Const_1.$nsp)(this.name), cnt]).join(SEP);
|
|
5957
|
+
(_b = this === null || this === void 0 ? void 0 : this.parent) === null || _b === void 0 ? void 0 : _b.append(newElement);
|
|
5958
|
+
return newElement;
|
|
5959
|
+
}
|
|
5960
|
+
}
|
|
5961
|
+
exports.HiddenInputBuilder = HiddenInputBuilder;
|
|
5962
|
+
|
|
5963
|
+
|
|
5872
5964
|
/***/ }),
|
|
5873
5965
|
|
|
5874
5966
|
/***/ "./src/main/typescript/impl/util/Lang.ts":
|
|
@@ -5893,8 +5985,6 @@ exports.ExtConfig = ExtConfig;
|
|
|
5893
5985
|
* See the License for the specific language governing permissions and
|
|
5894
5986
|
* limitations under the License.
|
|
5895
5987
|
*
|
|
5896
|
-
* todo replace singleton with module definition
|
|
5897
|
-
*
|
|
5898
5988
|
*/
|
|
5899
5989
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5900
5990
|
exports.ExtLang = void 0;
|
|
@@ -6036,21 +6126,21 @@ var ExtLang;
|
|
|
6036
6126
|
function getForm(elem, event) {
|
|
6037
6127
|
let queryElem = new mona_dish_1.DQ(elem);
|
|
6038
6128
|
let eventTarget = (event) ? new mona_dish_1.DQ((0, RequestDataResolver_1.getEventTarget)(event)) : mona_dish_1.DomQuery.absent;
|
|
6039
|
-
if (queryElem.isTag(Const_1.
|
|
6129
|
+
if (queryElem.isTag(Const_1.HTML_TAG_FORM)) {
|
|
6040
6130
|
return queryElem;
|
|
6041
6131
|
}
|
|
6042
6132
|
//html 5 for handling
|
|
6043
|
-
if (queryElem.attr(Const_1.
|
|
6044
|
-
let formId = queryElem.attr(Const_1.
|
|
6133
|
+
if (queryElem.attr(Const_1.HTML_TAG_FORM).isPresent()) {
|
|
6134
|
+
let formId = queryElem.attr(Const_1.HTML_TAG_FORM).value;
|
|
6045
6135
|
let foundForm = mona_dish_1.DQ.byId(formId, true);
|
|
6046
6136
|
if (foundForm.isPresent()) {
|
|
6047
6137
|
return foundForm;
|
|
6048
6138
|
}
|
|
6049
6139
|
}
|
|
6050
|
-
let form = queryElem.firstParent(Const_1.
|
|
6051
|
-
.orElseLazy(() => queryElem.byTagName(Const_1.
|
|
6052
|
-
.orElseLazy(() => eventTarget.firstParent(Const_1.
|
|
6053
|
-
.orElseLazy(() => eventTarget.byTagName(Const_1.
|
|
6140
|
+
let form = queryElem.firstParent(Const_1.HTML_TAG_FORM)
|
|
6141
|
+
.orElseLazy(() => queryElem.byTagName(Const_1.HTML_TAG_FORM, true))
|
|
6142
|
+
.orElseLazy(() => eventTarget.firstParent(Const_1.HTML_TAG_FORM))
|
|
6143
|
+
.orElseLazy(() => eventTarget.byTagName(Const_1.HTML_TAG_FORM))
|
|
6054
6144
|
.first();
|
|
6055
6145
|
assertFormExists(form);
|
|
6056
6146
|
return form;
|
|
@@ -6212,7 +6302,7 @@ class EventData {
|
|
|
6212
6302
|
eventData.status = name;
|
|
6213
6303
|
let sourceId = context.getIf(Const_1.SOURCE)
|
|
6214
6304
|
.orElseLazy(() => context.getIf(Const_1.P_PARTIAL_SOURCE).value)
|
|
6215
|
-
.orElseLazy(() => context.getIf(Const_1.
|
|
6305
|
+
.orElseLazy(() => context.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_PARTIAL_SOURCE).value)
|
|
6216
6306
|
.value;
|
|
6217
6307
|
if (sourceId) {
|
|
6218
6308
|
eventData.source = mona_dish_1.DQ.byId(sourceId, true).first().value.value;
|
|
@@ -6253,7 +6343,7 @@ exports.EventData = EventData;
|
|
|
6253
6343
|
* limitations under the License.
|
|
6254
6344
|
*/
|
|
6255
6345
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6256
|
-
exports.resolveDefaults = exports.getEventTarget = exports.resolveWindowId = exports.resolveDelay = exports.resolveTimeout = exports.resolveForm = exports.resolveFinalUrl = exports.resolveTargetUrl = exports.resolveHandlerFunc = void 0;
|
|
6346
|
+
exports.resolveDefaults = exports.getEventTarget = exports.resolveWindowId = exports.resolveDelay = exports.resolveTimeout = exports.resolveViewId = exports.resolveForm = exports.resolveFinalUrl = exports.resolveTargetUrl = exports.resolveHandlerFunc = void 0;
|
|
6257
6347
|
const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
6258
6348
|
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
6259
6349
|
const Lang_1 = __webpack_require__(/*! ../util/Lang */ "./src/main/typescript/impl/util/Lang.ts");
|
|
@@ -6307,10 +6397,20 @@ function resolveForm(requestCtx, elem, event) {
|
|
|
6307
6397
|
.orElseLazy(() => Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event));
|
|
6308
6398
|
}
|
|
6309
6399
|
exports.resolveForm = resolveForm;
|
|
6400
|
+
function resolveViewId(form) {
|
|
6401
|
+
let viewState = form.querySelectorAll(`input[type='hidden'][name*='${(0, Const_1.$nsp)(Const_1.P_VIEWSTATE)}']`).id.orElse("").value;
|
|
6402
|
+
let divider = (0, Const_1.$faces)().separatorchar;
|
|
6403
|
+
let viewId = viewState.split(divider, 2)[0];
|
|
6404
|
+
if (viewId.indexOf((0, Const_1.$nsp)(Const_1.P_VIEWSTATE)) === -1) {
|
|
6405
|
+
return viewId;
|
|
6406
|
+
}
|
|
6407
|
+
return "";
|
|
6408
|
+
}
|
|
6409
|
+
exports.resolveViewId = resolveViewId;
|
|
6310
6410
|
function resolveTimeout(options) {
|
|
6311
6411
|
var _a;
|
|
6312
6412
|
let getCfg = Lang_1.ExtLang.getLocalOrGlobalConfig;
|
|
6313
|
-
return (_a = options.getIf(Const_1.
|
|
6413
|
+
return (_a = options.getIf(Const_1.CTX_OPTIONS_TIMEOUT).value) !== null && _a !== void 0 ? _a : getCfg(options.value, Const_1.CTX_OPTIONS_TIMEOUT, 0);
|
|
6314
6414
|
}
|
|
6315
6415
|
exports.resolveTimeout = resolveTimeout;
|
|
6316
6416
|
/**
|
|
@@ -6322,7 +6422,7 @@ function resolveDelay(options) {
|
|
|
6322
6422
|
var _a;
|
|
6323
6423
|
let getCfg = Lang_1.ExtLang.getLocalOrGlobalConfig;
|
|
6324
6424
|
// null or non undefined will automatically be mapped to 0 aka no delay
|
|
6325
|
-
let ret = (_a = options.getIf(Const_1.
|
|
6425
|
+
let ret = (_a = options.getIf(Const_1.CTX_OPTIONS_DELAY).value) !== null && _a !== void 0 ? _a : getCfg(options.value, Const_1.CTX_OPTIONS_DELAY, 0);
|
|
6326
6426
|
// if delay === none, no delay must be used, aka delay 0
|
|
6327
6427
|
if ('none' === ret) {
|
|
6328
6428
|
ret = 0;
|
|
@@ -6488,9 +6588,9 @@ exports.resolveSourceElement = resolveSourceElement;
|
|
|
6488
6588
|
function resolveSourceForm(internalContext, elem) {
|
|
6489
6589
|
let sourceFormId = internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID);
|
|
6490
6590
|
let sourceForm = new mona_dish_2.DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);
|
|
6491
|
-
sourceForm = sourceForm.orElseLazy(() => elem.firstParent(Const_1.
|
|
6492
|
-
.orElseLazy(() => elem.querySelectorAll(Const_1.
|
|
6493
|
-
.orElseLazy(() => mona_dish_2.DQ.querySelectorAll(Const_1.
|
|
6591
|
+
sourceForm = sourceForm.orElseLazy(() => elem.firstParent(Const_1.HTML_TAG_FORM))
|
|
6592
|
+
.orElseLazy(() => elem.querySelectorAll(Const_1.HTML_TAG_FORM))
|
|
6593
|
+
.orElseLazy(() => mona_dish_2.DQ.querySelectorAll(Const_1.HTML_TAG_FORM));
|
|
6494
6594
|
return sourceForm;
|
|
6495
6595
|
}
|
|
6496
6596
|
exports.resolveSourceForm = resolveSourceForm;
|
|
@@ -6552,7 +6652,7 @@ var Response;
|
|
|
6552
6652
|
let responseProcessor = new ResponseProcessor_1.ResponseProcessor(req, externalContext, internalContext);
|
|
6553
6653
|
internalContext.assign(Const_1.RESPONSE_XML).value = responseXML;
|
|
6554
6654
|
// we now process the partial tags, or in none given raise an error
|
|
6555
|
-
responseXML.querySelectorAll(Const_1.
|
|
6655
|
+
responseXML.querySelectorAll(Const_1.XML_TAG_PARTIAL_RESP)
|
|
6556
6656
|
.each(item => processPartialTag(item, responseProcessor, internalContext));
|
|
6557
6657
|
// We now process the viewStates, client windows and the elements to be evaluated are delayed.
|
|
6558
6658
|
// The reason for this is that often it is better
|
|
@@ -6571,17 +6671,17 @@ var Response;
|
|
|
6571
6671
|
*/
|
|
6572
6672
|
function processPartialTag(node, responseProcessor, internalContext) {
|
|
6573
6673
|
internalContext.assign(Const_1.PARTIAL_ID).value = node.id;
|
|
6574
|
-
const SEL_SUB_TAGS = [Const_1.
|
|
6674
|
+
const SEL_SUB_TAGS = [Const_1.XML_TAG_ERROR, Const_1.XML_TAG_REDIRECT, Const_1.XML_TAG_CHANGES].join(",");
|
|
6575
6675
|
// now we can process the main operations
|
|
6576
6676
|
node.querySelectorAll(SEL_SUB_TAGS).each((node) => {
|
|
6577
6677
|
switch (node.tagName.value) {
|
|
6578
|
-
case Const_1.
|
|
6678
|
+
case Const_1.XML_TAG_ERROR:
|
|
6579
6679
|
responseProcessor.error(node);
|
|
6580
6680
|
break;
|
|
6581
|
-
case Const_1.
|
|
6681
|
+
case Const_1.XML_TAG_REDIRECT:
|
|
6582
6682
|
responseProcessor.redirect(node);
|
|
6583
6683
|
break;
|
|
6584
|
-
case Const_1.
|
|
6684
|
+
case Const_1.XML_TAG_CHANGES:
|
|
6585
6685
|
processChangesTag(node, responseProcessor);
|
|
6586
6686
|
break;
|
|
6587
6687
|
}
|
|
@@ -6589,7 +6689,7 @@ var Response;
|
|
|
6589
6689
|
}
|
|
6590
6690
|
let processInsert = function (responseProcessor, node) {
|
|
6591
6691
|
// path1 insert after as child tags
|
|
6592
|
-
if (node.querySelectorAll([Const_1.
|
|
6692
|
+
if (node.querySelectorAll([Const_1.XML_TAG_BEFORE, Const_1.XML_TAG_AFTER].join(",")).length) {
|
|
6593
6693
|
responseProcessor.insertWithSubTags(node);
|
|
6594
6694
|
}
|
|
6595
6695
|
else { // insert before after with id
|
|
@@ -6603,25 +6703,25 @@ var Response;
|
|
|
6603
6703
|
* @param responseProcessor
|
|
6604
6704
|
*/
|
|
6605
6705
|
function processChangesTag(node, responseProcessor) {
|
|
6606
|
-
const ALLOWED_TAGS = [Const_1.
|
|
6706
|
+
const ALLOWED_TAGS = [Const_1.XML_TAG_UPDATE, Const_1.XML_TAG_EVAL, Const_1.XML_TAG_INSERT, Const_1.XML_TAG_DELETE, Const_1.XML_TAG_ATTRIBUTES, Const_1.XML_TAG_EXTENSION].join(", ");
|
|
6607
6707
|
node.querySelectorAll(ALLOWED_TAGS).each((node) => {
|
|
6608
6708
|
switch (node.tagName.value) {
|
|
6609
|
-
case Const_1.
|
|
6709
|
+
case Const_1.XML_TAG_UPDATE:
|
|
6610
6710
|
processUpdateTag(node, responseProcessor);
|
|
6611
6711
|
break;
|
|
6612
|
-
case Const_1.
|
|
6712
|
+
case Const_1.XML_TAG_EVAL:
|
|
6613
6713
|
responseProcessor.eval(node);
|
|
6614
6714
|
break;
|
|
6615
|
-
case Const_1.
|
|
6715
|
+
case Const_1.XML_TAG_INSERT:
|
|
6616
6716
|
processInsert(responseProcessor, node);
|
|
6617
6717
|
break;
|
|
6618
|
-
case Const_1.
|
|
6718
|
+
case Const_1.XML_TAG_DELETE:
|
|
6619
6719
|
responseProcessor.delete(node);
|
|
6620
6720
|
break;
|
|
6621
|
-
case Const_1.
|
|
6721
|
+
case Const_1.XML_TAG_ATTRIBUTES:
|
|
6622
6722
|
responseProcessor.attributes(node);
|
|
6623
6723
|
break;
|
|
6624
|
-
case Const_1.
|
|
6724
|
+
case Const_1.XML_TAG_EXTENSION:
|
|
6625
6725
|
break;
|
|
6626
6726
|
}
|
|
6627
6727
|
});
|
|
@@ -6714,8 +6814,9 @@ const ErrorData_1 = __webpack_require__(/*! ./ErrorData */ "./src/main/typescrip
|
|
|
6714
6814
|
const ImplTypes_1 = __webpack_require__(/*! ../core/ImplTypes */ "./src/main/typescript/impl/core/ImplTypes.ts");
|
|
6715
6815
|
const EventData_1 = __webpack_require__(/*! ./EventData */ "./src/main/typescript/impl/xhrCore/EventData.ts");
|
|
6716
6816
|
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
6717
|
-
var trim = mona_dish_1.Lang.trim;
|
|
6718
6817
|
const ExtDomQuery_1 = __webpack_require__(/*! ../util/ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
|
|
6818
|
+
const HiddenInputBuilder_1 = __webpack_require__(/*! ../util/HiddenInputBuilder */ "./src/main/typescript/impl/util/HiddenInputBuilder.ts");
|
|
6819
|
+
var trim = mona_dish_1.Lang.trim;
|
|
6719
6820
|
/**
|
|
6720
6821
|
* Response processor
|
|
6721
6822
|
*
|
|
@@ -6741,24 +6842,24 @@ class ResponseProcessor {
|
|
|
6741
6842
|
* the data incoming must represent the html representation of the head itself one way or the other
|
|
6742
6843
|
*/
|
|
6743
6844
|
replaceHead(shadowDocument) {
|
|
6744
|
-
|
|
6845
|
+
const shadowHead = shadowDocument.querySelectorAll(Const_1.HTML_TAG_HEAD);
|
|
6745
6846
|
if (!shadowHead.isPresent()) {
|
|
6746
6847
|
return;
|
|
6747
6848
|
}
|
|
6748
|
-
|
|
6849
|
+
const head = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.HTML_TAG_HEAD);
|
|
6749
6850
|
// full replace we delete everything
|
|
6750
6851
|
head.childNodes.delete();
|
|
6751
6852
|
this.addToHead(shadowHead);
|
|
6752
6853
|
}
|
|
6753
6854
|
addToHead(shadowHead) {
|
|
6754
6855
|
const mappedHeadData = new ExtDomQuery_1.ExtDomQuery(shadowHead);
|
|
6755
|
-
const postProcessTags = [
|
|
6856
|
+
const postProcessTags = [Const_1.HTML_TAG_STYLE, Const_1.HTML_TAG_LINK, Const_1.HTML_TAG_SCRIPT];
|
|
6756
6857
|
const nonExecutables = mappedHeadData.filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) == -1);
|
|
6757
6858
|
nonExecutables.runHeadInserts(true);
|
|
6758
6859
|
//incoming either the outer head tag or its children
|
|
6759
6860
|
const nodesToAdd = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
|
|
6760
|
-
// this is stored for post processing
|
|
6761
|
-
// after the rest of the "
|
|
6861
|
+
// this is stored for "post" processing
|
|
6862
|
+
// after the rest of the "physical build up", head before body
|
|
6762
6863
|
const evalElements = nodesToAdd.stream
|
|
6763
6864
|
.filter(item => postProcessTags.indexOf(item.tagName.orElse("").value) != -1).collect(new mona_dish_1.DomQueryCollector());
|
|
6764
6865
|
this.addToHeadDeferred(evalElements);
|
|
@@ -6775,17 +6876,18 @@ class ResponseProcessor {
|
|
|
6775
6876
|
* @param shadowDocument .. an incoming shadow document hosting the new nodes
|
|
6776
6877
|
*/
|
|
6777
6878
|
replaceBody(shadowDocument) {
|
|
6778
|
-
|
|
6879
|
+
const shadowBody = shadowDocument.querySelectorAll(Const_1.HTML_TAG_BODY);
|
|
6779
6880
|
if (!shadowBody.isPresent()) {
|
|
6780
6881
|
return;
|
|
6781
6882
|
}
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6883
|
+
const shadowInnerHTML = shadowBody.innerHTML;
|
|
6884
|
+
const resultingBody = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.HTML_TAG_BODY);
|
|
6885
|
+
const updateForms = resultingBody.querySelectorAll(Const_1.HTML_TAG_FORM);
|
|
6785
6886
|
// main difference, we cannot replace the body itself, but only its content
|
|
6786
6887
|
// we need a separate step for post-processing the incoming
|
|
6787
6888
|
// attributes, like classes, styles etc...
|
|
6788
|
-
resultingBody.copyAttrs(shadowBody);
|
|
6889
|
+
resultingBody.html(shadowInnerHTML).copyAttrs(shadowBody);
|
|
6890
|
+
this.externalContext.assign((0, Const_1.$nsp)(Const_1.P_RENDER_OVERRIDE)).value = "@all";
|
|
6789
6891
|
this.storeForPostProcessing(updateForms, resultingBody);
|
|
6790
6892
|
}
|
|
6791
6893
|
/**
|
|
@@ -6809,15 +6911,15 @@ class ResponseProcessor {
|
|
|
6809
6911
|
* <error-message><![CDATA[message]]></error-message>
|
|
6810
6912
|
* <error>
|
|
6811
6913
|
*/
|
|
6812
|
-
|
|
6914
|
+
const mergedErrorData = new ExtDomQuery_1.ExtConfig({});
|
|
6813
6915
|
mergedErrorData.assign(Const_1.SOURCE).value = this.externalContext.getIf(Const_1.P_PARTIAL_SOURCE).get(0).value;
|
|
6814
6916
|
mergedErrorData.assign(Const_1.ERROR_NAME).value = node.querySelectorAll(Const_1.ERROR_NAME).textContent(Const_1.EMPTY_STR);
|
|
6815
6917
|
mergedErrorData.assign(Const_1.ERROR_MESSAGE).value = node.querySelectorAll(Const_1.ERROR_MESSAGE).cDATAAsString;
|
|
6816
|
-
|
|
6918
|
+
const hasResponseXML = this.internalContext.get(Const_1.RESPONSE_XML).isPresent();
|
|
6817
6919
|
//we now store the response xml also in the error data for further details
|
|
6818
6920
|
mergedErrorData.assignIf(hasResponseXML, Const_1.RESPONSE_XML).value = this.internalContext.getIf(Const_1.RESPONSE_XML).value.get(0).value;
|
|
6819
6921
|
// error post-processing and enrichment (standard messages from keys)
|
|
6820
|
-
|
|
6922
|
+
const errorData = ErrorData_1.ErrorData.fromServerError(mergedErrorData);
|
|
6821
6923
|
// we now trigger an internally stored onError function which might be an attached to the context
|
|
6822
6924
|
// either we do not have an internal on error, or an on error has been based via params from the outside.
|
|
6823
6925
|
// In both cases they are attached to our contexts
|
|
@@ -6831,7 +6933,7 @@ class ResponseProcessor {
|
|
|
6831
6933
|
*/
|
|
6832
6934
|
redirect(node) {
|
|
6833
6935
|
Assertions_1.Assertions.assertUrlExists(node);
|
|
6834
|
-
|
|
6936
|
+
const redirectUrl = trim(node.attr(Const_1.ATTR_URL).value);
|
|
6835
6937
|
if (redirectUrl != Const_1.EMPTY_STR) {
|
|
6836
6938
|
window.location.href = redirectUrl;
|
|
6837
6939
|
}
|
|
@@ -6842,8 +6944,8 @@ class ResponseProcessor {
|
|
|
6842
6944
|
* @param cdataBlock the cdata block with the new html code
|
|
6843
6945
|
*/
|
|
6844
6946
|
update(node, cdataBlock) {
|
|
6845
|
-
|
|
6846
|
-
|
|
6947
|
+
const result = ExtDomQuery_1.ExtDomQuery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
|
|
6948
|
+
const sourceForm = result === null || result === void 0 ? void 0 : result.firstParent(Const_1.HTML_TAG_FORM).orElseLazy(() => result.byTagName(Const_1.HTML_TAG_FORM, true));
|
|
6847
6949
|
if (sourceForm) {
|
|
6848
6950
|
this.storeForPostProcessing(sourceForm, result);
|
|
6849
6951
|
}
|
|
@@ -6861,8 +6963,8 @@ class ResponseProcessor {
|
|
|
6861
6963
|
* @param node
|
|
6862
6964
|
*/
|
|
6863
6965
|
attributes(node) {
|
|
6864
|
-
|
|
6865
|
-
node.byTagName(Const_1.
|
|
6966
|
+
const elem = mona_dish_1.DQ.byId(node.id.value, true);
|
|
6967
|
+
node.byTagName(Const_1.XML_TAG_ATTR).each((item) => {
|
|
6866
6968
|
elem.attr(item.attr(Const_1.ATTR_NAME).value).value = item.attr(Const_1.ATTR_VALUE).value;
|
|
6867
6969
|
});
|
|
6868
6970
|
}
|
|
@@ -6880,15 +6982,15 @@ class ResponseProcessor {
|
|
|
6880
6982
|
*/
|
|
6881
6983
|
insert(node) {
|
|
6882
6984
|
//let insertId = node.id; //not used atm
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6985
|
+
const before = node.attr(Const_1.XML_TAG_BEFORE);
|
|
6986
|
+
const after = node.attr(Const_1.XML_TAG_AFTER);
|
|
6987
|
+
const insertNodes = mona_dish_1.DQ.fromMarkup(node.cDATAAsString);
|
|
6886
6988
|
if (before.isPresent()) {
|
|
6887
6989
|
mona_dish_1.DQ.byId(before.value, true).insertBefore(insertNodes);
|
|
6888
6990
|
this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
|
|
6889
6991
|
}
|
|
6890
6992
|
if (after.isPresent()) {
|
|
6891
|
-
|
|
6993
|
+
const domQuery = mona_dish_1.DQ.byId(after.value, true);
|
|
6892
6994
|
domQuery.insertAfter(insertNodes);
|
|
6893
6995
|
this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
|
|
6894
6996
|
}
|
|
@@ -6899,19 +7001,19 @@ class ResponseProcessor {
|
|
|
6899
7001
|
* @param node the node hosting the insert data
|
|
6900
7002
|
*/
|
|
6901
7003
|
insertWithSubTags(node) {
|
|
6902
|
-
|
|
6903
|
-
|
|
7004
|
+
const before = node.querySelectorAll(Const_1.XML_TAG_BEFORE);
|
|
7005
|
+
const after = node.querySelectorAll(Const_1.XML_TAG_AFTER);
|
|
6904
7006
|
before.each(item => {
|
|
6905
|
-
|
|
6906
|
-
|
|
7007
|
+
const insertId = item.attr(Const_1.ATTR_ID);
|
|
7008
|
+
const insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
|
|
6907
7009
|
if (insertId.isPresent()) {
|
|
6908
7010
|
mona_dish_1.DQ.byId(insertId.value, true).insertBefore(insertNodes);
|
|
6909
7011
|
this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
|
|
6910
7012
|
}
|
|
6911
7013
|
});
|
|
6912
7014
|
after.each(item => {
|
|
6913
|
-
|
|
6914
|
-
|
|
7015
|
+
const insertId = item.attr(Const_1.ATTR_ID);
|
|
7016
|
+
const insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);
|
|
6915
7017
|
if (insertId.isPresent()) {
|
|
6916
7018
|
mona_dish_1.DQ.byId(insertId.value, true).insertAfter(insertNodes);
|
|
6917
7019
|
this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -6925,7 +7027,7 @@ class ResponseProcessor {
|
|
|
6925
7027
|
*/
|
|
6926
7028
|
processViewState(node) {
|
|
6927
7029
|
if (ResponseProcessor.isViewStateNode(node)) {
|
|
6928
|
-
|
|
7030
|
+
const state = node.cDATAAsString;
|
|
6929
7031
|
this.internalContext.assign(Const_1.APPLIED_VST, node.id.value).value = new ImplTypes_1.StateHolder((0, Const_1.$nsp)(node.id.value), state);
|
|
6930
7032
|
return true;
|
|
6931
7033
|
}
|
|
@@ -6933,7 +7035,7 @@ class ResponseProcessor {
|
|
|
6933
7035
|
}
|
|
6934
7036
|
processClientWindow(node) {
|
|
6935
7037
|
if (ResponseProcessor.isClientWindowNode(node)) {
|
|
6936
|
-
|
|
7038
|
+
const state = node.cDATAAsString;
|
|
6937
7039
|
this.internalContext.assign(Const_1.APPLIED_CLIENT_WINDOW, node.id.value).value = new ImplTypes_1.StateHolder((0, Const_1.$nsp)(node.id.value), state);
|
|
6938
7040
|
return true;
|
|
6939
7041
|
}
|
|
@@ -6959,13 +7061,11 @@ class ResponseProcessor {
|
|
|
6959
7061
|
*/
|
|
6960
7062
|
fixViewStates() {
|
|
6961
7063
|
mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_VST).orElse({}).value)
|
|
6962
|
-
.each((
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
affectedForms
|
|
6967
|
-
.filter(affectedForm => this.executeOrRenderFilter(affectedForm));
|
|
6968
|
-
this.appendViewStateToForms(affectedForms, value.value);
|
|
7064
|
+
.each(([, value]) => {
|
|
7065
|
+
const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
|
|
7066
|
+
const affectedForms = this.getContainerForms(namingContainerId)
|
|
7067
|
+
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
7068
|
+
this.appendViewStateToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
6969
7069
|
});
|
|
6970
7070
|
}
|
|
6971
7071
|
/**
|
|
@@ -6974,22 +7074,20 @@ class ResponseProcessor {
|
|
|
6974
7074
|
*/
|
|
6975
7075
|
fixClientWindow() {
|
|
6976
7076
|
mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
|
|
6977
|
-
.each((
|
|
6978
|
-
const value = item[1];
|
|
7077
|
+
.each(([, value]) => {
|
|
6979
7078
|
const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
this.appendClientWindowToForms(affectedForms, value.value);
|
|
7079
|
+
const affectedForms = this.getContainerForms(namingContainerId)
|
|
7080
|
+
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
7081
|
+
this.appendClientWindowToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
6984
7082
|
});
|
|
6985
7083
|
}
|
|
6986
7084
|
/**
|
|
6987
7085
|
* all processing done we can close the request and send the appropriate events
|
|
6988
7086
|
*/
|
|
6989
7087
|
done() {
|
|
6990
|
-
|
|
7088
|
+
const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);
|
|
6991
7089
|
//because some frameworks might decorate them over the context in the response
|
|
6992
|
-
|
|
7090
|
+
const eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;
|
|
6993
7091
|
AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);
|
|
6994
7092
|
}
|
|
6995
7093
|
/**
|
|
@@ -6997,18 +7095,20 @@ class ResponseProcessor {
|
|
|
6997
7095
|
*
|
|
6998
7096
|
* @param forms the forms to append the viewState to
|
|
6999
7097
|
* @param viewState the final viewState
|
|
7098
|
+
* @param namingContainerId
|
|
7000
7099
|
*/
|
|
7001
|
-
appendViewStateToForms(forms, viewState) {
|
|
7002
|
-
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState);
|
|
7100
|
+
appendViewStateToForms(forms, viewState, namingContainerId = "") {
|
|
7101
|
+
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState, namingContainerId);
|
|
7003
7102
|
}
|
|
7004
7103
|
/**
|
|
7005
7104
|
* proper clientWindow -> form assignment
|
|
7006
7105
|
*
|
|
7007
7106
|
* @param forms the forms to append the viewState to
|
|
7008
7107
|
* @param clientWindow the final viewState
|
|
7108
|
+
* @param namingContainerId
|
|
7009
7109
|
*/
|
|
7010
|
-
appendClientWindowToForms(forms, clientWindow) {
|
|
7011
|
-
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow);
|
|
7110
|
+
appendClientWindowToForms(forms, clientWindow, namingContainerId = "") {
|
|
7111
|
+
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow, namingContainerId);
|
|
7012
7112
|
}
|
|
7013
7113
|
/**
|
|
7014
7114
|
* generic append state which appends a certain state as hidden element to an existing set of forms
|
|
@@ -7017,41 +7117,26 @@ class ResponseProcessor {
|
|
|
7017
7117
|
* @param selector the selector for the state
|
|
7018
7118
|
* @param state the state itself which needs to be assigned
|
|
7019
7119
|
*
|
|
7120
|
+
* @param namingContainerId
|
|
7020
7121
|
* @private
|
|
7021
7122
|
*/
|
|
7022
|
-
assignState(forms, selector, state) {
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7123
|
+
assignState(forms, selector, state, namingContainerId) {
|
|
7124
|
+
/**
|
|
7125
|
+
* creates the viewState or client window id element
|
|
7126
|
+
* @param form
|
|
7127
|
+
*/
|
|
7128
|
+
const createAndAppendHiddenInput = (form) => {
|
|
7129
|
+
return new HiddenInputBuilder_1.HiddenInputBuilder(selector)
|
|
7130
|
+
.withNamingContainerId(namingContainerId)
|
|
7131
|
+
.withParent(form)
|
|
7132
|
+
.build();
|
|
7133
|
+
};
|
|
7134
|
+
forms.each(form => {
|
|
7135
|
+
const hiddenInput = form.querySelectorAll(selector)
|
|
7136
|
+
.orElseLazy(() => createAndAppendHiddenInput(form));
|
|
7137
|
+
hiddenInput.val = state;
|
|
7031
7138
|
});
|
|
7032
7139
|
}
|
|
7033
|
-
/**
|
|
7034
|
-
* Helper to Create a new JSF ViewState Element
|
|
7035
|
-
*
|
|
7036
|
-
* @param parent, the parent node to attach the viewState element to
|
|
7037
|
-
* (usually a form node)
|
|
7038
|
-
*/
|
|
7039
|
-
static newViewStateElement(parent) {
|
|
7040
|
-
let newElement = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(Const_1.HTML_VIEWSTATE));
|
|
7041
|
-
newElement.appendTo(parent);
|
|
7042
|
-
return newElement;
|
|
7043
|
-
}
|
|
7044
|
-
/**
|
|
7045
|
-
* Helper to Create a new JSF ViewState Element
|
|
7046
|
-
*
|
|
7047
|
-
* @param parent, the parent node to attach the viewState element to
|
|
7048
|
-
* (usually a form node)
|
|
7049
|
-
*/
|
|
7050
|
-
static newClientWindowElement(parent) {
|
|
7051
|
-
let newElement = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(Const_1.HTML_CLIENT_WINDOW));
|
|
7052
|
-
newElement.appendTo(parent);
|
|
7053
|
-
return newElement;
|
|
7054
|
-
}
|
|
7055
7140
|
/**
|
|
7056
7141
|
* Stores certain aspects of the dom for later post-processing
|
|
7057
7142
|
*
|
|
@@ -7085,11 +7170,11 @@ class ResponseProcessor {
|
|
|
7085
7170
|
* @returns if it is a viewState node
|
|
7086
7171
|
*/
|
|
7087
7172
|
static isViewStateNode(node) {
|
|
7088
|
-
var _a, _b, _c, _d, _e, _f
|
|
7089
|
-
|
|
7090
|
-
return "undefined" != typeof ((
|
|
7091
|
-
((
|
|
7092
|
-
((
|
|
7173
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7174
|
+
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
7175
|
+
return "undefined" != typeof ((_a = node === null || node === void 0 ? void 0 : node.id) === null || _a === void 0 ? void 0 : _a.value) && (((_b = node === null || node === void 0 ? void 0 : node.id) === null || _b === void 0 ? void 0 : _b.value) == (0, Const_1.$nsp)(Const_1.P_VIEWSTATE) ||
|
|
7176
|
+
((_d = (_c = node === null || node === void 0 ? void 0 : node.id) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.indexOf([SEP, (0, Const_1.$nsp)(Const_1.P_VIEWSTATE)].join(Const_1.EMPTY_STR))) != -1 ||
|
|
7177
|
+
((_f = (_e = node === null || node === void 0 ? void 0 : node.id) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.indexOf([(0, Const_1.$nsp)(Const_1.P_VIEWSTATE), SEP].join(Const_1.EMPTY_STR))) != -1);
|
|
7093
7178
|
}
|
|
7094
7179
|
/**
|
|
7095
7180
|
* incoming client window node also needs special processing
|
|
@@ -7098,36 +7183,35 @@ class ResponseProcessor {
|
|
|
7098
7183
|
* @returns true of it ii
|
|
7099
7184
|
*/
|
|
7100
7185
|
static isClientWindowNode(node) {
|
|
7101
|
-
var _a, _b, _c, _d, _e, _f
|
|
7102
|
-
|
|
7103
|
-
return "undefined" != typeof ((
|
|
7104
|
-
((
|
|
7105
|
-
((
|
|
7186
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7187
|
+
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
7188
|
+
return "undefined" != typeof ((_a = node === null || node === void 0 ? void 0 : node.id) === null || _a === void 0 ? void 0 : _a.value) && (((_b = node === null || node === void 0 ? void 0 : node.id) === null || _b === void 0 ? void 0 : _b.value) == (0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW) ||
|
|
7189
|
+
((_d = (_c = node === null || node === void 0 ? void 0 : node.id) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.indexOf([SEP, (0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW)].join(Const_1.EMPTY_STR))) != -1 ||
|
|
7190
|
+
((_f = (_e = node === null || node === void 0 ? void 0 : node.id) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.indexOf([(0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW), SEP].join(Const_1.EMPTY_STR))) != -1);
|
|
7106
7191
|
}
|
|
7107
7192
|
triggerOnError(errorData) {
|
|
7108
|
-
this.externalContext.getIf(Const_1.ON_ERROR).
|
|
7193
|
+
this.externalContext.getIf(Const_1.ON_ERROR).orElseLazy(() => this.internalContext.getIf(Const_1.ON_ERROR).value).orElse(Const_1.EMPTY_FUNC).value(errorData);
|
|
7109
7194
|
}
|
|
7110
7195
|
/**
|
|
7111
|
-
* filters the forms according to being
|
|
7196
|
+
* filters the forms according to being member of the "execute" or "render" cycle
|
|
7112
7197
|
* @param affectedForm
|
|
7113
7198
|
* @private
|
|
7114
7199
|
*/
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7200
|
+
isInExecuteOrRender(affectedForm) {
|
|
7201
|
+
const executes = this.externalContext.getIf((0, Const_1.$nsp)(Const_1.P_EXECUTE)).orElse("@none").value.split(/\s+/gi);
|
|
7202
|
+
const renders = this.externalContext.getIf(Const_1.P_RENDER_OVERRIDE)
|
|
7203
|
+
.orElseLazy(() => this.externalContext.getIf((0, Const_1.$nsp)(Const_1.P_RENDER)).value)
|
|
7204
|
+
.orElse(Const_1.IDENT_NONE).value.split(/\s+/gi);
|
|
7205
|
+
const executeAndRenders = executes.concat(...renders);
|
|
7119
7206
|
return mona_dish_1.LazyStream.of(...executeAndRenders).filter(nameOrId => {
|
|
7120
|
-
if (nameOrId
|
|
7121
|
-
return true;
|
|
7122
|
-
}
|
|
7123
|
-
if (nameOrId == "@none") {
|
|
7207
|
+
if ([Const_1.IDENT_ALL, Const_1.IDENT_NONE].indexOf(nameOrId) != -1) {
|
|
7124
7208
|
return true;
|
|
7125
7209
|
}
|
|
7126
|
-
const
|
|
7210
|
+
const NAME_OR_ID = this.getNameOrIdSelector(nameOrId);
|
|
7127
7211
|
//either the form directly is in execute or render or one of its children or one of its parents
|
|
7128
|
-
return affectedForm.matchesSelector(
|
|
7129
|
-
affectedForm.querySelectorAll(
|
|
7130
|
-
affectedForm.firstParent(
|
|
7212
|
+
return affectedForm.matchesSelector(NAME_OR_ID) ||
|
|
7213
|
+
affectedForm.querySelectorAll(NAME_OR_ID).isPresent() ||
|
|
7214
|
+
affectedForm.firstParent(NAME_OR_ID).isPresent();
|
|
7131
7215
|
}).first().isPresent();
|
|
7132
7216
|
}
|
|
7133
7217
|
/**
|
|
@@ -7138,12 +7222,19 @@ class ResponseProcessor {
|
|
|
7138
7222
|
getContainerForms(namingContainerId) {
|
|
7139
7223
|
if (namingContainerId.isPresent()) {
|
|
7140
7224
|
//naming container mode, all forms under naming container id must be processed
|
|
7141
|
-
return
|
|
7225
|
+
return (0, mona_dish_1.DQ$)(this.getNameOrIdSelector(namingContainerId.value))
|
|
7226
|
+
// missing condition if the naming container is not present we have to
|
|
7227
|
+
// use the body as fallback
|
|
7228
|
+
.orElseLazy(() => mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_BODY))
|
|
7229
|
+
.byTagName(Const_1.HTML_TAG_FORM, true);
|
|
7142
7230
|
}
|
|
7143
7231
|
else {
|
|
7144
|
-
return mona_dish_1.DQ.byTagName(Const_1.
|
|
7232
|
+
return mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_FORM);
|
|
7145
7233
|
}
|
|
7146
7234
|
}
|
|
7235
|
+
getNameOrIdSelector(nameOrId) {
|
|
7236
|
+
return `[id='${nameOrId}'], [name='${nameOrId}']`;
|
|
7237
|
+
}
|
|
7147
7238
|
}
|
|
7148
7239
|
exports.ResponseProcessor = ResponseProcessor;
|
|
7149
7240
|
|
|
@@ -7267,7 +7358,7 @@ class XhrFormData extends mona_dish_1.Config {
|
|
|
7267
7358
|
* @param form the form holding the view state value
|
|
7268
7359
|
*/
|
|
7269
7360
|
applyViewState(form) {
|
|
7270
|
-
let viewState = form.
|
|
7361
|
+
let viewState = form.querySelectorAllDeep(`[name*='${Const_1.P_VIEWSTATE}'`).inputValue;
|
|
7271
7362
|
this.appendIf(viewState.isPresent(), Const_1.P_VIEWSTATE).value = viewState.value;
|
|
7272
7363
|
}
|
|
7273
7364
|
/**
|
|
@@ -7492,15 +7583,14 @@ class XhrRequest {
|
|
|
7492
7583
|
});
|
|
7493
7584
|
}
|
|
7494
7585
|
start() {
|
|
7495
|
-
var _a;
|
|
7496
7586
|
let ignoreErr = failSaveExecute;
|
|
7497
7587
|
let xhrObject = this.xhrObject;
|
|
7498
7588
|
let executesArr = () => {
|
|
7499
|
-
return this.requestContext.getIf(Const_1.
|
|
7589
|
+
return this.requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).get("none").value.split(/\s+/gi);
|
|
7500
7590
|
};
|
|
7501
7591
|
try {
|
|
7502
7592
|
let formElement = this.sourceForm.getAsElem(0).value;
|
|
7503
|
-
let viewState = (
|
|
7593
|
+
let viewState = (0, Const_1.$faces)().getViewState(formElement);
|
|
7504
7594
|
// encoded we need to decode
|
|
7505
7595
|
// We generated a base representation of the current form
|
|
7506
7596
|
// in case someone has overloaded the viewState with additional decorators we merge
|
|
@@ -7514,12 +7604,12 @@ class XhrRequest {
|
|
|
7514
7604
|
this.contentType = formData.isMultipartRequest ? "undefined" : this.contentType;
|
|
7515
7605
|
// next step the pass through parameters are merged in for post params
|
|
7516
7606
|
let requestContext = this.requestContext;
|
|
7517
|
-
let
|
|
7607
|
+
let requestPassThroughParams = requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR);
|
|
7518
7608
|
// this is an extension where we allow pass through parameters to be sent down additionally
|
|
7519
7609
|
// this can be used and is used in the impl to enrich the post request parameters with additional
|
|
7520
7610
|
// information
|
|
7521
|
-
formData.shallowMerge(
|
|
7522
|
-
this.responseContext =
|
|
7611
|
+
formData.shallowMerge(requestPassThroughParams, true, true);
|
|
7612
|
+
this.responseContext = requestPassThroughParams.deepCopy;
|
|
7523
7613
|
// we have to shift the internal passthroughs around to build up our response context
|
|
7524
7614
|
let responseContext = this.responseContext;
|
|
7525
7615
|
responseContext.assign(Const_1.CTX_PARAM_MF_INTERNAL).value = this.internalContext.value;
|
|
@@ -7637,7 +7727,7 @@ class XhrRequest {
|
|
|
7637
7727
|
reject();
|
|
7638
7728
|
}
|
|
7639
7729
|
onSuccess(resolve) {
|
|
7640
|
-
var _a, _b
|
|
7730
|
+
var _a, _b;
|
|
7641
7731
|
this.sendEvent(Const_1.COMPLETE);
|
|
7642
7732
|
// malformed responses always result in empty response xml
|
|
7643
7733
|
// per spec a valid response cannot be empty
|
|
@@ -7645,7 +7735,7 @@ class XhrRequest {
|
|
|
7645
7735
|
this.handleMalFormedXML(resolve);
|
|
7646
7736
|
return;
|
|
7647
7737
|
}
|
|
7648
|
-
(
|
|
7738
|
+
(0, Const_1.$faces)().ajax.response(this.xhrObject, (_b = this.responseContext.value) !== null && _b !== void 0 ? _b : {});
|
|
7649
7739
|
}
|
|
7650
7740
|
handleMalFormedXML(resolve) {
|
|
7651
7741
|
var _a;
|