jsf.js_next_gen 4.0.4-beta.5 → 4.0.4-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/functions/myfaces.ab.html +8 -3
- package/dist/main.js +14 -0
- package/dist/window/faces-development.js +37 -13
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +37 -13
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.map +1 -1
- package/package.json +1 -1
- package/remap.js +1 -0
- package/src/main/typescript/@types/definitions/index.d.ts +1 -1
- package/src/main/typescript/api/_api.ts +29 -13
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +1 -1
- package/src/main/typescript/impl/xhrCore/EventData.ts +17 -8
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +1 -1
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +1 -1
- package/src/main/typescript/test/api/MyFacesABTest.spec.ts +117 -0
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +25 -1
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +1 -1
- package/target/api/_api.js +17 -3
- package/target/api/_api.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +1 -1
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +17 -7
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +1 -1
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/test/api/MyFacesABTest.spec.js +117 -0
- package/target/test/api/MyFacesABTest.spec.js.map +1 -0
- package/target/test/xhrCore/EventTests.spec.js +20 -1
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/webpack.config.js +2 -2
- package/webpack.config.js.map +1 -1
- package/webpack.config.ts +2 -2
- package/faulty_response.html +0 -167
- package/pom.xml +0 -68
- package/target/classes/application.properties +0 -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/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +0 -4
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +0 -4
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +0 -1
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +0 -1
- package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +0 -76
- package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +0 -7
- 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 +0 -24
- package/target/test-classes/jsf-development.js +0 -3559
- 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 +0 -1
- package/target/test-classes/jsf.js +0 -3
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<h1>Function ab</h1></div>
|
|
19
19
|
<section class="tsd-panel">
|
|
20
20
|
<ul class="tsd-signatures">
|
|
21
|
-
<li class="tsd-signature tsd-anchor-link" id="ab"><span class="tsd-kind-call-signature">ab</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span>, <span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">execute</span>, <span class="tsd-kind-parameter">render</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#ab" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" id="icon-anchor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></svg></a></li>
|
|
21
|
+
<li class="tsd-signature tsd-anchor-link" id="ab"><span class="tsd-kind-call-signature">ab</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span>, <span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">execute</span>, <span class="tsd-kind-parameter">render</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">userParameters</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#ab" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" id="icon-anchor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></svg></a></li>
|
|
22
22
|
<li class="tsd-description">
|
|
23
23
|
<div class="tsd-comment tsd-typography"><p>AB function similar to mojarra and Primefaces
|
|
24
24
|
not part of the spec but a convenience accessor method
|
|
@@ -39,7 +39,7 @@ Code provided by Thomas Andraschko</p>
|
|
|
39
39
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
40
40
|
<li>
|
|
41
41
|
<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span></h5>
|
|
42
|
-
<div class="tsd-comment tsd-typography"><p>event name for java.jakarta.faces.behavior.
|
|
42
|
+
<div class="tsd-comment tsd-typography"><p>event name for java.jakarta.faces.behavior.event</p>
|
|
43
43
|
</div>
|
|
44
44
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
45
45
|
<li>
|
|
@@ -54,7 +54,12 @@ Code provided by Thomas Andraschko</p>
|
|
|
54
54
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
55
55
|
<li>
|
|
56
56
|
<h5><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">Options</span><span class="tsd-signature-symbol"> = {}</span></h5>
|
|
57
|
-
<div class="tsd-comment tsd-typography"><p>the options which need to be
|
|
57
|
+
<div class="tsd-comment tsd-typography"><p>the options which need to be merged in</p>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="tsd-comment tsd-typography"></div></li>
|
|
60
|
+
<li>
|
|
61
|
+
<h5><span class="tsd-kind-parameter">userParameters</span>: <span class="tsd-signature-type ">Options</span><span class="tsd-signature-symbol"> = {}</span></h5>
|
|
62
|
+
<div class="tsd-comment tsd-typography"><p>a set of user parameters which go into the final options under params, they can overide whatever is passed via options</p>
|
|
58
63
|
</div>
|
|
59
64
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
60
65
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
9
|
+
/******/ (() => { // webpackBootstrap
|
|
10
|
+
/******/ "use strict";
|
|
11
|
+
/******/
|
|
12
|
+
/******/
|
|
13
|
+
/******/ })()
|
|
14
|
+
;
|
|
@@ -4202,13 +4202,20 @@ var myfaces;
|
|
|
4202
4202
|
*
|
|
4203
4203
|
* @param source the event source
|
|
4204
4204
|
* @param event the event
|
|
4205
|
-
* @param eventName event name for java.jakarta.faces.behavior.
|
|
4205
|
+
* @param eventName event name for java.jakarta.faces.behavior.event
|
|
4206
4206
|
* @param execute execute list as passed down in faces.ajax.request
|
|
4207
4207
|
* @param render the render list as string
|
|
4208
|
-
* @param options the options which need to be
|
|
4208
|
+
* @param options the options which need to be merged in
|
|
4209
|
+
* @param userParameters a set of user parameters which go into the final options under params, they can overide whatever is passed via options
|
|
4209
4210
|
*/
|
|
4210
|
-
function ab(source, event, eventName, execute, render, options = {}) {
|
|
4211
|
+
function ab(source, event, eventName, execute, render, options = {}, userParameters = {}) {
|
|
4211
4212
|
var _a, _b;
|
|
4213
|
+
if (!options) {
|
|
4214
|
+
options = {};
|
|
4215
|
+
}
|
|
4216
|
+
if (!userParameters) {
|
|
4217
|
+
userParameters = {};
|
|
4218
|
+
}
|
|
4212
4219
|
if (eventName) {
|
|
4213
4220
|
options[Const_1.CTX_OPTIONS_PARAMS] = (_a = options === null || options === void 0 ? void 0 : options[Const_1.CTX_OPTIONS_PARAMS]) !== null && _a !== void 0 ? _a : {};
|
|
4214
4221
|
options[Const_1.CTX_OPTIONS_PARAMS][(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
|
|
@@ -4219,6 +4226,13 @@ var myfaces;
|
|
|
4219
4226
|
if (render) {
|
|
4220
4227
|
options[Const_1.CTX_PARAM_RENDER] = render;
|
|
4221
4228
|
}
|
|
4229
|
+
//we push the users parameters in
|
|
4230
|
+
if (!options["params"]) {
|
|
4231
|
+
options["params"] = {};
|
|
4232
|
+
}
|
|
4233
|
+
for (let key in userParameters) {
|
|
4234
|
+
options["params"][key] = userParameters[key];
|
|
4235
|
+
}
|
|
4222
4236
|
((_b = window === null || window === void 0 ? void 0 : window.faces) !== null && _b !== void 0 ? _b : window.jsf).ajax.request(source, event, options);
|
|
4223
4237
|
}
|
|
4224
4238
|
myfaces.ab = ab;
|
|
@@ -6788,7 +6802,7 @@ class ErrorData extends EventData_1.EventData {
|
|
|
6788
6802
|
this.type = Const_1.ERROR;
|
|
6789
6803
|
this.errorName = errorName;
|
|
6790
6804
|
//tck requires that the type is prefixed to the message itself (jsdoc also) in case of a server error
|
|
6791
|
-
this.errorMessage = errorMessage;
|
|
6805
|
+
this.errorMessage = (type == ErrorType.SERVER_ERROR) ? type + ": " + errorMessage : errorMessage;
|
|
6792
6806
|
this.responseCode = responseCode;
|
|
6793
6807
|
this.responseText = responseText;
|
|
6794
6808
|
this.responseXML = responseXML;
|
|
@@ -6856,16 +6870,26 @@ exports.EventData = void 0;
|
|
|
6856
6870
|
const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
6857
6871
|
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
6858
6872
|
class EventData {
|
|
6859
|
-
static createFromRequest(request, context, /*event name*/ name) {
|
|
6873
|
+
static createFromRequest(request, internalContext, context, /*event name*/ name) {
|
|
6860
6874
|
let eventData = new EventData();
|
|
6875
|
+
let internalSource = "_internal._source";
|
|
6861
6876
|
eventData.type = Const_1.EVENT;
|
|
6862
6877
|
eventData.status = name;
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6878
|
+
eventData.source = internalContext.getIf("_source", "_element").value;
|
|
6879
|
+
// this fixes the issue that the source element is not present anymore at done
|
|
6880
|
+
// at page transitions
|
|
6881
|
+
if (!eventData.source) {
|
|
6882
|
+
let sourceId = context.getIf(Const_1.SOURCE)
|
|
6883
|
+
.orElseLazy(() => context.getIf(Const_1.P_AJAX_SOURCE).value)
|
|
6884
|
+
.orElseLazy(() => context.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX_SOURCE).value)
|
|
6885
|
+
.value;
|
|
6886
|
+
if (sourceId) {
|
|
6887
|
+
eventData.source = mona_dish_1.DQ.byId(sourceId, true).first().value.value;
|
|
6888
|
+
}
|
|
6889
|
+
if (eventData.source) {
|
|
6890
|
+
//we store the event source for later references
|
|
6891
|
+
internalContext.assign("_source", "_element").value = eventData.source;
|
|
6892
|
+
}
|
|
6869
6893
|
}
|
|
6870
6894
|
if (name !== Const_1.BEGIN) {
|
|
6871
6895
|
eventData.responseCode = request === null || request === void 0 ? void 0 : request.status;
|
|
@@ -7704,7 +7728,7 @@ class ResponseProcessor {
|
|
|
7704
7728
|
* all processing done we can close the request and send the appropriate events
|
|
7705
7729
|
*/
|
|
7706
7730
|
done() {
|
|
7707
|
-
const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);
|
|
7731
|
+
const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.internalContext, this.externalContext, Const_1.SUCCESS);
|
|
7708
7732
|
//because some frameworks might decorate them over the context in the response
|
|
7709
7733
|
const eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;
|
|
7710
7734
|
AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);
|
|
@@ -8409,7 +8433,7 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
|
|
|
8409
8433
|
*/
|
|
8410
8434
|
sendEvent(evtType) {
|
|
8411
8435
|
var _a;
|
|
8412
|
-
const eventData = EventData_1.EventData.createFromRequest(this.xhrObject, this.requestContext, evtType);
|
|
8436
|
+
const eventData = EventData_1.EventData.createFromRequest(this.xhrObject, this.internalContext, this.requestContext, evtType);
|
|
8413
8437
|
try {
|
|
8414
8438
|
// User code error, we might cover
|
|
8415
8439
|
// this in onError, but also we cannot swallow it.
|