jsf.js_next_gen 4.0.0-beta-5 → 4.0.0-beta-6
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 +1928 -2521
- 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 +1890 -2511
- 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/api/_api.ts +258 -0
- package/src/main/typescript/api/faces.ts +17 -245
- package/src/main/typescript/api/jsf.ts +24 -8
- package/src/main/typescript/impl/core/Const.ts +4 -2
- package/src/main/typescript/impl/util/ExtDomQuery.ts +12 -13
- package/src/main/typescript/impl/xhrCore/Response.ts +2 -2
- package/src/main/typescript/myfaces/OamSubmit.ts +6 -5
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +2 -0
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +14 -23
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +20 -13
- package/src/main/typescript/tsconfig-typedoc.json +1 -1
- package/src/main/typescript/tsconfig.json +1 -2
- package/src/test/resources/jsf-development.js +1 -1
- package/target/api/Jsf.js +24 -11
- package/target/api/Jsf.js.map +1 -1
- package/target/api/_api.js +246 -0
- package/target/api/_api.js.map +1 -0
- package/target/api/_faces.js +251 -0
- package/target/api/_faces.js.map +1 -0
- package/target/api/faces.js +20 -247
- package/target/api/faces.js.map +1 -1
- package/target/impl/AjaxImpl.js +53 -61
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +38 -41
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +4 -2
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/ImplTypes.js +9 -14
- package/target/impl/core/ImplTypes.js.map +1 -1
- package/target/impl/i18n/Messages.js +3 -4
- package/target/impl/i18n/Messages.js.map +1 -1
- package/target/impl/util/Assertions.js +9 -18
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js +28 -36
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +137 -210
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/Lang.js +21 -28
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +36 -61
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +10 -13
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +16 -19
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +16 -16
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +18 -18
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +116 -130
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +68 -98
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +81 -91
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +20 -18
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/test/frameworkBase/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +160 -82
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +45 -31
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +24 -33
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +8 -8
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +31 -31
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +50 -48
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +235 -130
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +162 -18
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +34 -61
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +35 -64
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/impl/SeparatorCharsTest.spec.js +19 -19
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +34 -41
- package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
- package/target/test/queue/AsynchronousProbe.js +23 -29
- package/target/test/queue/AsynchronousProbe.js.map +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +39 -70
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +47 -78
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FakeWebsocket.js +14 -16
- package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +49 -80
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +39 -70
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +76 -113
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +100 -140
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +118 -87
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +120 -89
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/test/xhrCore/ShadowDomTest.spec.js +31 -62
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +60 -93
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +41 -15
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/webpack.config.js +71 -0
- package/webpack.config.js.map +1 -0
|
@@ -312,6 +312,7 @@ export module StandardInits {
|
|
|
312
312
|
(<any>global).faces = data.faces;
|
|
313
313
|
(<any>global).myfaces = data.myfaces;
|
|
314
314
|
(<any>global).window.faces = data.faces;
|
|
315
|
+
debugger;
|
|
315
316
|
(<any>global).window.myfaces = data.myfaces;
|
|
316
317
|
(<any>global).Implementation = Implementation.Implementation;
|
|
317
318
|
(<any>global).PushImpl = PushImpl.PushImpl;
|
|
@@ -324,6 +325,7 @@ export module StandardInits {
|
|
|
324
325
|
(<any>global).jsf = data.jsf;
|
|
325
326
|
(<any>global).myfaces = data.myfaces;
|
|
326
327
|
(<any>global).window.jsf = data.jsf;
|
|
328
|
+
debugger;
|
|
327
329
|
(<any>global).window.myfaces = data.myfaces;
|
|
328
330
|
(<any>global).Implementation = Implementation.Implementation;
|
|
329
331
|
(<any>global).window.Implementation = Implementation.Implementation;
|
|
@@ -62,9 +62,7 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
62
62
|
it('submit form must work', function() {
|
|
63
63
|
let FORM_ID = "blarg";
|
|
64
64
|
let form = DomQuery.byId(FORM_ID);
|
|
65
|
-
|
|
66
|
-
(form.value.value as any).submit = () => {
|
|
67
|
-
submitCalled = true;
|
|
65
|
+
const submit_spy = Sinon.spy(() => {
|
|
68
66
|
expect(form.querySelectorAll('input[name=\'booga1\']').isPresent()).to.eq(true);
|
|
69
67
|
expect(form.querySelectorAll('input[name=\'booga1\']').length == 1).to.eq(true);
|
|
70
68
|
expect(form.querySelectorAll('input[name=\'booga1\']').inputValue.value == 'val_booga1').to.eq(true);
|
|
@@ -75,7 +73,8 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
75
73
|
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).length == 1).to.eq(true);
|
|
76
74
|
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).inputValue.value == 'mylink').to.eq(true);
|
|
77
75
|
expect(form.attr("target").value).to.eq('target1');
|
|
78
|
-
}
|
|
76
|
+
});
|
|
77
|
+
(form.value.value as any).submit = submit_spy;
|
|
79
78
|
|
|
80
79
|
|
|
81
80
|
submitForm(FORM_ID, 'mylink', 'target1', {
|
|
@@ -83,27 +82,18 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
83
82
|
booga2: "val_booga2"
|
|
84
83
|
});
|
|
85
84
|
|
|
86
|
-
expect(
|
|
85
|
+
expect(submit_spy.called).to.eq(true);
|
|
87
86
|
form = DomQuery.byId(FORM_ID);
|
|
88
87
|
expect(form.querySelectorAll('input[name=\'booga1\']').isAbsent()).to.eq(true);
|
|
89
88
|
expect(form.querySelectorAll('input[name=\'booga2\']').isAbsent()).to.eq(true);
|
|
90
89
|
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).isAbsent()).to.eq(true);
|
|
91
90
|
|
|
92
|
-
//const os_spy = Sinon.spy(form.getAsElem(0).value, 'onsubmit' as keyof Element);
|
|
93
|
-
const submit_spy = Sinon.spy(form.getAsElem(0).value, 'submit' as keyof Element);
|
|
94
|
-
expect
|
|
95
|
-
|
|
96
|
-
//we also have to interceot onsbumit
|
|
97
|
-
// expect(os_spy.called).to.eq(true);
|
|
98
|
-
// expect(submit_spy.called).to.eq(true);
|
|
99
91
|
})
|
|
100
92
|
|
|
101
93
|
it('onsubmit form must work', function() {
|
|
102
94
|
let FORM_ID = "blarg";
|
|
103
95
|
let form = DomQuery.byId(FORM_ID);
|
|
104
|
-
|
|
105
|
-
(form.value.value as any).onsubmit = () => {
|
|
106
|
-
onSubmitCalled = true;
|
|
96
|
+
const onsumbit = () => {
|
|
107
97
|
expect(form.querySelectorAll('input[name=\'booga1\']').isPresent()).to.eq(true);
|
|
108
98
|
expect(form.querySelectorAll('input[name=\'booga1\']').length == 1).to.eq(true);
|
|
109
99
|
expect(form.querySelectorAll('input[name=\'booga1\']').inputValue.value == 'val_booga1').to.eq(true);
|
|
@@ -114,7 +104,12 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
114
104
|
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).length == 1).to.eq(true);
|
|
115
105
|
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).inputValue.value == 'mylink').to.eq(true);
|
|
116
106
|
expect(form.attr("target").value).to.eq('target1');
|
|
107
|
+
return false;
|
|
117
108
|
}
|
|
109
|
+
const os_spy = Sinon.spy(onsumbit);
|
|
110
|
+
const submit_spy = Sinon.spy(() => {});
|
|
111
|
+
(form.value.value as any).onsubmit = os_spy;
|
|
112
|
+
(form.value.value as any).submit = submit_spy;
|
|
118
113
|
|
|
119
114
|
|
|
120
115
|
submitForm(FORM_ID, 'mylink', 'target1', {
|
|
@@ -122,18 +117,14 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
122
117
|
booga2: "val_booga2"
|
|
123
118
|
});
|
|
124
119
|
|
|
125
|
-
|
|
120
|
+
//we also have to interceot onsbumit
|
|
121
|
+
expect(os_spy.called).to.eq(true);
|
|
122
|
+
expect(submit_spy.called).to.eq(false);
|
|
123
|
+
|
|
126
124
|
form = DomQuery.byId(FORM_ID);
|
|
127
125
|
expect(form.querySelectorAll('input[name=\'booga1\']').isAbsent()).to.eq(true);
|
|
128
126
|
expect(form.querySelectorAll('input[name=\'booga2\']').isAbsent()).to.eq(true);
|
|
129
127
|
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).isAbsent()).to.eq(true);
|
|
130
|
-
|
|
131
|
-
//const os_spy = Sinon.spy(form.getAsElem(0).value, 'onsubmit' as keyof Element);
|
|
132
|
-
const submit_spy = Sinon.spy(form.getAsElem(0).value, 'submit' as keyof Element);
|
|
133
|
-
expect
|
|
134
|
-
|
|
135
|
-
//we also have to interceot onsbumit
|
|
136
|
-
// expect(os_spy.called).to.eq(true);
|
|
137
128
|
// expect(submit_spy.called).to.eq(true);
|
|
138
129
|
})
|
|
139
130
|
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Request test, testing on the 2.3 namespace fallback code
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
17
21
|
import {describe, it} from "mocha";
|
|
18
22
|
import * as sinon from "sinon";
|
|
19
23
|
import {expect} from "chai";
|
|
@@ -25,20 +29,23 @@ import {
|
|
|
25
29
|
} from "../../impl/core/Const";
|
|
26
30
|
|
|
27
31
|
|
|
32
|
+
/**
|
|
33
|
+
* wherever we reference the namespaces they must be mapped to javax instead of jakarta
|
|
34
|
+
*/
|
|
28
35
|
function remapNamespacesFor23() {
|
|
29
|
-
P_PARTIAL_SOURCE = "javax.faces.source";
|
|
30
|
-
P_VIEWSTATE = "javax.faces.ViewState";
|
|
31
|
-
P_VIEWROOT = "javax.faces.ViewRoot";
|
|
32
|
-
P_VIEWHEAD = "javax.faces.ViewHead";
|
|
33
|
-
P_VIEWBODY = "javax.faces.ViewBody";
|
|
34
|
-
P_AJAX = "javax.faces.partial.ajax";
|
|
35
|
-
P_EXECUTE = "javax.faces.partial.execute";
|
|
36
|
-
P_RENDER = "javax.faces.partial.render";
|
|
37
|
-
P_EVT = "javax.faces.partial.event";
|
|
38
|
-
P_CLIENT_WINDOW = "javax.faces.ClientWindow";
|
|
39
|
-
P_RESET_VALUES = "javax.faces.partial.resetValues";
|
|
40
|
-
P_WINDOW_ID = "javax.faces.windowId";
|
|
41
|
-
ENCODED_URL = "javax.faces.encodedURL";
|
|
36
|
+
const P_PARTIAL_SOURCE = "javax.faces.source";
|
|
37
|
+
const P_VIEWSTATE = "javax.faces.ViewState";
|
|
38
|
+
const P_VIEWROOT = "javax.faces.ViewRoot";
|
|
39
|
+
const P_VIEWHEAD = "javax.faces.ViewHead";
|
|
40
|
+
const P_VIEWBODY = "javax.faces.ViewBody";
|
|
41
|
+
const P_AJAX = "javax.faces.partial.ajax";
|
|
42
|
+
const P_EXECUTE = "javax.faces.partial.execute";
|
|
43
|
+
const P_RENDER = "javax.faces.partial.render";
|
|
44
|
+
const P_EVT = "javax.faces.partial.event";
|
|
45
|
+
const P_CLIENT_WINDOW = "javax.faces.ClientWindow";
|
|
46
|
+
const P_RESET_VALUES = "javax.faces.partial.resetValues";
|
|
47
|
+
const P_WINDOW_ID = "javax.faces.windowId";
|
|
48
|
+
const ENCODED_URL = "javax.faces.encodedURL";
|
|
42
49
|
return {
|
|
43
50
|
P_PARTIAL_SOURCE, P_VIEWSTATE, P_VIEWROOT, P_VIEWHEAD, P_VIEWBODY,
|
|
44
51
|
P_AJAX, P_EXECUTE, P_RENDER, P_EVT, P_CLIENT_WINDOW, P_RESET_VALUES,
|
|
@@ -24,7 +24,7 @@ Special config to generate the tsdocs
|
|
|
24
24
|
|
|
25
25
|
},
|
|
26
26
|
"typedocOptions": {
|
|
27
|
-
"entryPoints": ["api/
|
|
27
|
+
"entryPoints": ["api/_api.ts"],
|
|
28
28
|
"out": "../../../dist/docs",
|
|
29
29
|
"externalPattern": "**/node_modules/**",
|
|
30
30
|
"exclude": "**/{node_modules,test,doc,impl,myfaces}/**/*",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
/***/ "./src/main/typescript/api/Jsf.ts":
|
|
16
16
|
/*!****************************************!*\
|
|
17
|
-
!*** ./src/main/typescript/api/
|
|
17
|
+
!*** ./src/main/typescript/api/_api.ts ***!
|
|
18
18
|
\****************************************/
|
|
19
19
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
20
20
|
|
package/target/api/Jsf.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.jsf = void 0;
|
|
5
1
|
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
6
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
7
3
|
* this work for additional information regarding copyright ownership.
|
|
@@ -17,17 +13,34 @@ exports.jsf = void 0;
|
|
|
17
13
|
* See the License for the specific language governing permissions and
|
|
18
14
|
* limitations under the License.
|
|
19
15
|
*/
|
|
20
|
-
|
|
16
|
+
///<reference types='../../types/typedefs'/>
|
|
17
|
+
"use strict";
|
|
18
|
+
var _a, _b, _c, _d, _e;
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.myfaces = exports.jsf = void 0;
|
|
21
21
|
/**
|
|
22
|
-
* jsf.js
|
|
23
|
-
*
|
|
22
|
+
* jsf.js init layer which provides as per spec the proper
|
|
23
|
+
* window namespace if it does not exist already
|
|
24
|
+
* if this file is included then the code falls back with its namespaces
|
|
25
|
+
* on jsf2.3 or earlier level, for 4.0+ please include faces.js
|
|
24
26
|
*/
|
|
25
27
|
if (!window.jsf) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : faces_1.faces;
|
|
28
|
+
const faces = require("./_api").faces;
|
|
29
|
+
window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : faces;
|
|
30
30
|
window.jsf.specversion = 230000;
|
|
31
31
|
}
|
|
32
|
+
if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
|
|
33
|
+
const myfaces = require("./_api").myfaces;
|
|
34
|
+
//namespace might be extended is not exclusively reserved so we merge
|
|
35
|
+
window["myfaces"] = (_c = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _c !== void 0 ? _c : {};
|
|
36
|
+
if (!((_d = window === null || window === void 0 ? void 0 : window.myfaces) === null || _d === void 0 ? void 0 : _d.ab)) {
|
|
37
|
+
const myfaces = require("./_api").myfaces;
|
|
38
|
+
//namespace might be extended is not exclusively reserved so we merge
|
|
39
|
+
window["myfaces"] = (_e = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _e !== void 0 ? _e : {};
|
|
40
|
+
Object.keys(myfaces).forEach(key => { var _a, _b; return window.myfaces[key] = (_b = (_a = window.myfaces) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : myfaces[key]; });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
alert("init");
|
|
32
44
|
exports.jsf = window.jsf;
|
|
45
|
+
exports.myfaces = window.myfaces;
|
|
33
46
|
//# sourceMappingURL=jsf.js.map
|
package/target/api/Jsf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsf.js","sourceRoot":"","sources":["../../src/main/typescript/api/jsf.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsf.js","sourceRoot":"","sources":["../../src/main/typescript/api/jsf.ts"],"names":[],"mappings":"AAAA;;;;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M,CAAC,GAAG,CAAC;AACjB,QAAA,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.myfaces = exports.faces = void 0;
|
|
4
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
5
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
6
|
+
* this work for additional information regarding copyright ownership.
|
|
7
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
8
|
+
* (the "License"); you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
const AjaxImpl_1 = require("../impl/AjaxImpl");
|
|
20
|
+
const PushImpl_1 = require("../impl/PushImpl");
|
|
21
|
+
const OamSubmit_1 = require("../myfaces/OamSubmit");
|
|
22
|
+
const Const_1 = require("../impl/core/Const");
|
|
23
|
+
//we use modules to get a proper jsdoc and static/map structure in the calls
|
|
24
|
+
//as per spec requirement
|
|
25
|
+
var faces;
|
|
26
|
+
(function (faces) {
|
|
27
|
+
/*
|
|
28
|
+
* Version of the implementation for the faces.ts.
|
|
29
|
+
* <p />
|
|
30
|
+
* as specified within the jsf specifications faces.html:
|
|
31
|
+
* <ul>
|
|
32
|
+
* <li>left two digits major release number</li>
|
|
33
|
+
* <li>middle two digits minor spec release number</li>
|
|
34
|
+
* <li>right two digits bug release number</li>
|
|
35
|
+
* </ul>
|
|
36
|
+
* @constant
|
|
37
|
+
*/
|
|
38
|
+
faces.specversion = 400000;
|
|
39
|
+
/**
|
|
40
|
+
* Implementation version as specified within the jsf specification.
|
|
41
|
+
* <p />
|
|
42
|
+
* A number increased with every implementation version
|
|
43
|
+
* and reset by moving to a new spec release number
|
|
44
|
+
*
|
|
45
|
+
* @constant
|
|
46
|
+
*/
|
|
47
|
+
faces.implversion = 0;
|
|
48
|
+
/**
|
|
49
|
+
* SeparatorChar as defined by UINamingContainer.getNamingContainerSeparatorChar()
|
|
50
|
+
* @type {Char}
|
|
51
|
+
*/
|
|
52
|
+
faces.separatorchar = getSeparatorChar();
|
|
53
|
+
/**
|
|
54
|
+
* This method is responsible for the return of a given project stage as defined
|
|
55
|
+
* by the jsf specification.
|
|
56
|
+
* <p/>
|
|
57
|
+
* Valid return values are:
|
|
58
|
+
* <ul>
|
|
59
|
+
* <li>"Production"</li>
|
|
60
|
+
* <li>"Development"</li>
|
|
61
|
+
* <li>"SystemTest"</li>
|
|
62
|
+
* <li>"UnitTest"</li>
|
|
63
|
+
* </li>
|
|
64
|
+
*
|
|
65
|
+
* @return {String} the current project state emitted by the server side method:
|
|
66
|
+
* <i>jakarta.faces.application.Application.getProjectStage()</i>
|
|
67
|
+
*/
|
|
68
|
+
function getProjectStage() {
|
|
69
|
+
return AjaxImpl_1.Implementation.getProjectStage();
|
|
70
|
+
}
|
|
71
|
+
faces.getProjectStage = getProjectStage;
|
|
72
|
+
/**
|
|
73
|
+
* collect and encode data for a given form element (must be of type form)
|
|
74
|
+
* find the jakarta.faces.ViewState element and encode its value as well!
|
|
75
|
+
* return a concatenated string of the encoded values!
|
|
76
|
+
*
|
|
77
|
+
* @throws an exception in case of the given element not being of type form!
|
|
78
|
+
* https://issues.apache.org/jira/browse/MYFACES-2110
|
|
79
|
+
*/
|
|
80
|
+
function getViewState(formElement) {
|
|
81
|
+
return AjaxImpl_1.Implementation.getViewState(formElement);
|
|
82
|
+
}
|
|
83
|
+
faces.getViewState = getViewState;
|
|
84
|
+
/**
|
|
85
|
+
* returns the window identifier for the given node / window
|
|
86
|
+
* @return the window identifier or null if none is found
|
|
87
|
+
* @param rootNode
|
|
88
|
+
*/
|
|
89
|
+
function getClientWindow(rootNode) {
|
|
90
|
+
return AjaxImpl_1.Implementation.getClientWindow(rootNode);
|
|
91
|
+
}
|
|
92
|
+
faces.getClientWindow = getClientWindow;
|
|
93
|
+
//private helper functions
|
|
94
|
+
function getSeparatorChar() {
|
|
95
|
+
return AjaxImpl_1.Implementation.getSeparatorChar();
|
|
96
|
+
}
|
|
97
|
+
let ajax;
|
|
98
|
+
(function (ajax) {
|
|
99
|
+
"use strict";
|
|
100
|
+
/**
|
|
101
|
+
* this function has to send the ajax requests
|
|
102
|
+
*
|
|
103
|
+
* following requestInternal conditions must be met:
|
|
104
|
+
* <ul>
|
|
105
|
+
* <li> the requestInternal must be sent asynchronously! </li>
|
|
106
|
+
* <li> the requestInternal must be a POST!!! requestInternal </li>
|
|
107
|
+
* <li> the requestInternal url must be the form action attribute </li>
|
|
108
|
+
* <li> all requests must be queued with a client side requestInternal queue to ensure the requestInternal ordering!</li>
|
|
109
|
+
* </ul>
|
|
110
|
+
*
|
|
111
|
+
* @param {String|Node} element: any dom element no matter being it html or jsf, from which the event is emitted
|
|
112
|
+
* @param {EVENT} event: any javascript event supported by that object
|
|
113
|
+
* @param {Map} options : map of options being pushed into the ajax cycle
|
|
114
|
+
*/
|
|
115
|
+
function request(element, event, options) {
|
|
116
|
+
AjaxImpl_1.Implementation.request(element, event, options);
|
|
117
|
+
//Implementation.getInstance().requestInternal(element, event, options);
|
|
118
|
+
}
|
|
119
|
+
ajax.request = request;
|
|
120
|
+
/**
|
|
121
|
+
* response handler
|
|
122
|
+
* @param request the request object having triggered this response
|
|
123
|
+
* @param context the request context
|
|
124
|
+
*
|
|
125
|
+
* TODO add info on what can be in the context
|
|
126
|
+
*/
|
|
127
|
+
function response(request, context) {
|
|
128
|
+
AjaxImpl_1.Implementation.response(request, context);
|
|
129
|
+
}
|
|
130
|
+
ajax.response = response;
|
|
131
|
+
/**
|
|
132
|
+
* Adds an error handler to our global error queue.
|
|
133
|
+
* the error handler must be of the format <i>function errorListener(<errorData>)</i>
|
|
134
|
+
* with errorData being of following format:
|
|
135
|
+
* <ul>
|
|
136
|
+
* <li> errorData.type : "error"</li>
|
|
137
|
+
* <li> errorData.status : the error status message</li>
|
|
138
|
+
* <li> errorData.serverErrorName : the server error name in case of a server error</li>
|
|
139
|
+
* <li> errorData.serverErrorMessage : the server error message in case of a server error</li>
|
|
140
|
+
* <li> errorData.source : the issuing source element which triggered the requestInternal </li>
|
|
141
|
+
* <li> eventData.responseCode: the response code (aka http requestInternal response code, 401 etc...) </li>
|
|
142
|
+
* <li> eventData.responseText: the requestInternal response text </li>
|
|
143
|
+
* <li> eventData.responseXML: the requestInternal response xml </li>
|
|
144
|
+
* </ul>
|
|
145
|
+
*
|
|
146
|
+
* @param {function} errorListener error handler must be of the format <i>function errorListener(<errorData>)</i>
|
|
147
|
+
*/
|
|
148
|
+
function addOnError(errorFunc) {
|
|
149
|
+
AjaxImpl_1.Implementation.addOnError(errorFunc);
|
|
150
|
+
}
|
|
151
|
+
ajax.addOnError = addOnError;
|
|
152
|
+
/**
|
|
153
|
+
* Adds a global event listener to the ajax event queue. The event listener must be a function
|
|
154
|
+
* of following format: <i>function eventListener(<eventData>)</i>
|
|
155
|
+
*
|
|
156
|
+
* @param {function} eventListener event must be of the format <i>function eventListener(<eventData>)</i>
|
|
157
|
+
*/
|
|
158
|
+
function addOnEvent(eventFunc) {
|
|
159
|
+
AjaxImpl_1.Implementation.addOnEvent(eventFunc);
|
|
160
|
+
}
|
|
161
|
+
ajax.addOnEvent = addOnEvent;
|
|
162
|
+
})(ajax = faces.ajax || (faces.ajax = {}));
|
|
163
|
+
let util;
|
|
164
|
+
(function (util) {
|
|
165
|
+
/**
|
|
166
|
+
* varargs function which executes a chain of code (functions or any other code)
|
|
167
|
+
*
|
|
168
|
+
* if any of the code returns false, the execution
|
|
169
|
+
* is terminated prematurely skipping the rest of the code!
|
|
170
|
+
*
|
|
171
|
+
* @param {DomNode} source, the callee object
|
|
172
|
+
* @param {Event} event, the event object of the callee event triggering this function
|
|
173
|
+
* @param funcs ... arbitrary array of functions or strings
|
|
174
|
+
* @returns true if the chain has succeeded false otherwise
|
|
175
|
+
*/
|
|
176
|
+
function chain(source, event, ...funcs) {
|
|
177
|
+
return AjaxImpl_1.Implementation.chain(source, event, ...funcs);
|
|
178
|
+
}
|
|
179
|
+
util.chain = chain;
|
|
180
|
+
})(util = faces.util || (faces.util = {}));
|
|
181
|
+
let push;
|
|
182
|
+
(function (push) {
|
|
183
|
+
/**
|
|
184
|
+
* @param {function} onopen The function to be invoked when the web socket is opened.
|
|
185
|
+
* @param {function} onmessage The function to be invoked when a message is received.
|
|
186
|
+
* @param {function} onclose The function to be invoked when the web socket is closed.
|
|
187
|
+
* @param {boolean} autoconnect Whether or not to immediately open the socket. Defaults to <code>false</code>.
|
|
188
|
+
*/
|
|
189
|
+
function init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect) {
|
|
190
|
+
PushImpl_1.PushImpl.init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect);
|
|
191
|
+
}
|
|
192
|
+
push.init = init;
|
|
193
|
+
/**
|
|
194
|
+
* Open the web socket on the given channel.
|
|
195
|
+
* @param {string} channel The name of the web socket channel.
|
|
196
|
+
* @throws {Error} When channel is unknown.
|
|
197
|
+
*/
|
|
198
|
+
function open(socketClientId) {
|
|
199
|
+
PushImpl_1.PushImpl.open(socketClientId);
|
|
200
|
+
}
|
|
201
|
+
push.open = open;
|
|
202
|
+
/**
|
|
203
|
+
* Close the web socket on the given channel.
|
|
204
|
+
* @param {string} channel The name of the web socket channel.
|
|
205
|
+
* @throws {Error} When channel is unknown.
|
|
206
|
+
*/
|
|
207
|
+
function close(socketClientId) {
|
|
208
|
+
PushImpl_1.PushImpl.close(socketClientId);
|
|
209
|
+
}
|
|
210
|
+
push.close = close;
|
|
211
|
+
})(push = faces.push || (faces.push = {}));
|
|
212
|
+
})(faces = exports.faces || (exports.faces = {}));
|
|
213
|
+
var myfaces;
|
|
214
|
+
(function (myfaces) {
|
|
215
|
+
/**
|
|
216
|
+
* AB function similar to mojarra and Primefaces
|
|
217
|
+
* not part of the spec but a convenience accessor method
|
|
218
|
+
* Code provided by Thomas Andraschko
|
|
219
|
+
*
|
|
220
|
+
* @param source the event source
|
|
221
|
+
* @param event the event
|
|
222
|
+
* @param eventName event name for java.jakarta.faces.behavior.evemnt
|
|
223
|
+
* @param execute execute list as passed down in faces.ajax.request
|
|
224
|
+
* @param render
|
|
225
|
+
* @param options
|
|
226
|
+
*/
|
|
227
|
+
function ab(source, event, eventName, execute, render, options = {}) {
|
|
228
|
+
var _a;
|
|
229
|
+
if (eventName) {
|
|
230
|
+
options[(0, Const_1.$nsp)("jakarta.faces.behavior.event")] = eventName;
|
|
231
|
+
}
|
|
232
|
+
if (execute) {
|
|
233
|
+
options["execute"] = execute;
|
|
234
|
+
}
|
|
235
|
+
if (render) {
|
|
236
|
+
options["render"] = render;
|
|
237
|
+
}
|
|
238
|
+
((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window.jsf).ajax.request(source, event, options);
|
|
239
|
+
}
|
|
240
|
+
myfaces.ab = ab;
|
|
241
|
+
/**
|
|
242
|
+
* legacy oam functions
|
|
243
|
+
*/
|
|
244
|
+
myfaces.oam = OamSubmit_1.oam;
|
|
245
|
+
})(myfaces = exports.myfaces || (exports.myfaces = {}));
|
|
246
|
+
//# sourceMappingURL=_api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_api.js","sourceRoot":"","sources":["../../src/main/typescript/api/_api.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,+CAAgD;AAChD,+CAA0C;AAC1C,oDAAiD;AACjD,8CAAwC;AAIxC,4EAA4E;AAC5E,yBAAyB;AACzB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