jsf.js_next_gen 4.0.0-RC.5 → 4.0.0-RC.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/window/faces-development.js +2036 -2717
- 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 +2041 -2722
- 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/@types/definitions/index.d.ts +1 -1
- package/src/main/typescript/myfaces/OamSubmit.ts +5 -1
- package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +62 -2
- package/src/main/typescript/tsconfig.json +1 -1
- package/target/api/_api.js +11 -25
- package/target/api/_api.js.map +1 -1
- package/target/api/faces.js +4 -4
- package/target/api/faces.js.map +1 -1
- package/target/api/jsf.js +9 -9
- package/target/api/jsf.js.map +1 -1
- package/target/impl/AjaxImpl.js +55 -63
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +45 -48
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +1 -1
- 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 +144 -219
- 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 -18
- 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 +16 -16
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +119 -133
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +72 -106
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +85 -95
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +19 -21
- 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 +238 -228
- 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 +247 -132
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +199 -22
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +32 -59
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +32 -59
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/impl/SeparatorCharsTest.spec.js +17 -17
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +25 -25
- 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 +42 -73
- 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 +46 -77
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/OamSubmitTest.spec.js +97 -71
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +37 -68
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +107 -147
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +93 -140
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +122 -91
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +114 -83
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/test/xhrCore/ShadowDomTest.spec.js +30 -61
- 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/package.json
CHANGED
|
@@ -121,7 +121,7 @@ declare global {
|
|
|
121
121
|
interface OAM {
|
|
122
122
|
clearHiddenInput(formName: string, name: string): void;
|
|
123
123
|
setHiddenInput(formName: string, name: string, value: string): void;
|
|
124
|
-
submitForm(formName: string, linkId
|
|
124
|
+
submitForm(formName: string, linkId?: string |null, target?: string | null, params?: AssocArr<any> |Tuples<string, any> | null): boolean;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
interface MyFacesAPI {
|
|
@@ -73,7 +73,11 @@ export module oam {
|
|
|
73
73
|
* @param target
|
|
74
74
|
* @param params
|
|
75
75
|
*/
|
|
76
|
-
export const submitForm = function (formName: string, linkId: string | null, target: string |null, params: AssocArr<any> | Tuples<string, any>): boolean {
|
|
76
|
+
export const submitForm = function (formName: string, linkId: string | null = null, target: string |null = null, params: AssocArr<any> | Tuples<string, any> | null = {} ): boolean {
|
|
77
|
+
|
|
78
|
+
//handle a possible incoming null, not sure if this is used that way anywhere, but we allow it
|
|
79
|
+
params = (!params) ? {} : params;
|
|
80
|
+
|
|
77
81
|
let clearFn = 'clearFormHiddenParams_' + formName.replace(/-/g, '\$:').replace(/:/g, '_');
|
|
78
82
|
window?.[clearFn]?.(formName);
|
|
79
83
|
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import {describe} from "mocha";
|
|
2
18
|
import * as sinon from "sinon";
|
|
3
19
|
import {Implementation} from "../../impl/AjaxImpl";
|
|
@@ -100,18 +116,62 @@ describe('Tests for the MyFaces specifig oam submit', function () {
|
|
|
100
116
|
myfaces.oam.submitForm("blarg", "bla", null, options);
|
|
101
117
|
|
|
102
118
|
});
|
|
119
|
+
|
|
103
120
|
it(("must handle target correctly, associative array"), (done) => {
|
|
104
121
|
|
|
105
122
|
let options = {"booga1": "value1", "booga2": "value2"};
|
|
106
|
-
|
|
107
123
|
(DQ.byId("blarg")
|
|
108
124
|
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
109
125
|
expect(DQ$(`#blarg`).attr("target").value).to.eq("target1");
|
|
110
126
|
done();
|
|
111
127
|
return false;
|
|
112
128
|
};
|
|
113
|
-
|
|
114
129
|
myfaces.oam.submitForm("blarg", "bla", "target1", options);
|
|
115
130
|
|
|
116
131
|
});
|
|
132
|
+
|
|
133
|
+
it(("must handle limited parameters"), (done) => {
|
|
134
|
+
|
|
135
|
+
(DQ.byId("blarg")
|
|
136
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
137
|
+
expect(DQ.byId(`blarg:_idcl`).inputValue.value).to.eq("bla");
|
|
138
|
+
done();
|
|
139
|
+
return false;
|
|
140
|
+
};
|
|
141
|
+
try {
|
|
142
|
+
myfaces.oam.submitForm("blarg", "bla");
|
|
143
|
+
} catch(e) {
|
|
144
|
+
done(e);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
});
|
|
148
|
+
it(("must handle limited parameters 2"), (done) => {
|
|
149
|
+
|
|
150
|
+
(DQ.byId("blarg")
|
|
151
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
152
|
+
expect(DQ.byId(`blarg:_idcl`).inputValue.value).to.eq("bla");
|
|
153
|
+
done();
|
|
154
|
+
return false;
|
|
155
|
+
};
|
|
156
|
+
try {
|
|
157
|
+
myfaces.oam.submitForm("blarg", "bla", null);
|
|
158
|
+
} catch(e) {
|
|
159
|
+
done(e);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
it(("must handle limited parameters 3"), (done) => {
|
|
163
|
+
|
|
164
|
+
(DQ.byId("blarg")
|
|
165
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
166
|
+
expect(DQ.byId(`blarg:_idcl`).inputValue.value).to.eq("bla");
|
|
167
|
+
done();
|
|
168
|
+
return false;
|
|
169
|
+
};
|
|
170
|
+
try {
|
|
171
|
+
myfaces.oam.submitForm("blarg", "bla", null, null);
|
|
172
|
+
} catch(e) {
|
|
173
|
+
done(e);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
117
177
|
});
|
package/target/api/_api.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.myfaces = exports.faces = void 0;
|
|
13
4
|
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@@ -25,10 +16,10 @@ exports.myfaces = exports.faces = void 0;
|
|
|
25
16
|
* See the License for the specific language governing permissions and
|
|
26
17
|
* limitations under the License.
|
|
27
18
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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");
|
|
32
23
|
//we use modules to get a proper jsdoc and static/map structure in the calls
|
|
33
24
|
//as per spec requirement
|
|
34
25
|
var faces;
|
|
@@ -106,13 +97,13 @@ var faces;
|
|
|
106
97
|
faces.getClientWindow = getClientWindow;
|
|
107
98
|
//private helper functions
|
|
108
99
|
function getSeparatorChar() {
|
|
109
|
-
|
|
100
|
+
const sep = '#{facesContext.namingContainerSeparatorChar}';
|
|
110
101
|
//We now enable standalone mode, the separator char was not mapped we make a fallback to 2.3 behavior
|
|
111
102
|
//the idea is that the separator char is provided from the underlying container, but if not then we
|
|
112
103
|
//will perform a fallback (aka 2.3 has the url fallback behavior)
|
|
113
104
|
return (sep.match(/\#\{facesContext.namingContainerSeparatorChar\}/gi)) ? AjaxImpl_1.Implementation.getSeparatorChar() : sep;
|
|
114
105
|
}
|
|
115
|
-
|
|
106
|
+
let ajax;
|
|
116
107
|
(function (ajax) {
|
|
117
108
|
"use strict";
|
|
118
109
|
/**
|
|
@@ -177,7 +168,7 @@ var faces;
|
|
|
177
168
|
}
|
|
178
169
|
ajax.addOnEvent = addOnEvent;
|
|
179
170
|
})(ajax = faces.ajax || (faces.ajax = {}));
|
|
180
|
-
|
|
171
|
+
let util;
|
|
181
172
|
(function (util) {
|
|
182
173
|
/**
|
|
183
174
|
* varargs function which executes a chain of code (functions or any other code)
|
|
@@ -190,16 +181,12 @@ var faces;
|
|
|
190
181
|
* @param funcs ... arbitrary array of functions or strings
|
|
191
182
|
* @returns true if the chain has succeeded false otherwise
|
|
192
183
|
*/
|
|
193
|
-
function chain(source, event) {
|
|
194
|
-
|
|
195
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
196
|
-
funcs[_i - 2] = arguments[_i];
|
|
197
|
-
}
|
|
198
|
-
return AjaxImpl_1.Implementation.chain.apply(AjaxImpl_1.Implementation, __spreadArray([source, event], funcs, false));
|
|
184
|
+
function chain(source, event, ...funcs) {
|
|
185
|
+
return AjaxImpl_1.Implementation.chain(source, event, ...funcs);
|
|
199
186
|
}
|
|
200
187
|
util.chain = chain;
|
|
201
188
|
})(util = faces.util || (faces.util = {}));
|
|
202
|
-
|
|
189
|
+
let push;
|
|
203
190
|
(function (push) {
|
|
204
191
|
/**
|
|
205
192
|
* @param socketClientId the sockets client identifier
|
|
@@ -250,9 +237,8 @@ var myfaces;
|
|
|
250
237
|
* @param render
|
|
251
238
|
* @param options
|
|
252
239
|
*/
|
|
253
|
-
function ab(source, event, eventName, execute, render, options) {
|
|
240
|
+
function ab(source, event, eventName, execute, render, options = {}) {
|
|
254
241
|
var _a;
|
|
255
|
-
if (options === void 0) { options = {}; }
|
|
256
242
|
if (eventName) {
|
|
257
243
|
options[(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
|
|
258
244
|
}
|
package/target/api/_api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_api.js","sourceRoot":"","sources":["../../src/main/typescript/api/_api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_api.js","sourceRoot":"","sources":["../../src/main/typescript/api/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target/api/faces.js
CHANGED
|
@@ -31,14 +31,14 @@ exports.myfaces = exports.faces = void 0;
|
|
|
31
31
|
*/
|
|
32
32
|
if (!window.faces) {
|
|
33
33
|
//we lazily load the code to prevent ram bloat
|
|
34
|
-
|
|
35
|
-
window['faces'] = (_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a :
|
|
34
|
+
const faces = require("./_api").faces;
|
|
35
|
+
window['faces'] = (_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : faces;
|
|
36
36
|
}
|
|
37
37
|
if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
|
|
38
|
-
|
|
38
|
+
const myfaces = require("./_api").myfaces;
|
|
39
39
|
//namespace might be extended is not exclusively reserved so we merge
|
|
40
40
|
window["myfaces"] = (_c = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _c !== void 0 ? _c : {};
|
|
41
|
-
Object.keys(
|
|
41
|
+
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]; });
|
|
42
42
|
}
|
|
43
43
|
exports.faces = window.faces;
|
|
44
44
|
exports.myfaces = window.myfaces;
|
package/target/api/faces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faces.js","sourceRoot":"","sources":["../../src/main/typescript/api/faces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AAEb;;;;;;;;;;;GAWG;AACH,IAAG,CAAC,MAAM,CAAC,KAAK,EAAE;IACd,8CAA8C;IAC9C,
|
|
1
|
+
{"version":3,"file":"faces.js","sourceRoot":"","sources":["../../src/main/typescript/api/faces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AAEb;;;;;;;;;;;GAWG;AACH,IAAG,CAAC,MAAM,CAAC,KAAK,EAAE;IACd,8CAA8C;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;IACtC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,KAAK,CAAC;CAC5C;AACD,IAAG,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,EAAE,CAAA,EAAE;IACrB,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;IAE1C,qEAAqE;IACpE,MAAc,CAAC,SAAS,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,eAAC,OAAA,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAG,GAAG,CAAC,mCAAI,OAAO,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC,CAAC;CACpG;AACU,QAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,QAAA,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC"}
|
package/target/api/jsf.js
CHANGED
|
@@ -24,31 +24,31 @@ exports.myfaces = exports.jsf = void 0;
|
|
|
24
24
|
* on jsf2.3 or earlier level, for 4.0+ please include faces.js
|
|
25
25
|
*/
|
|
26
26
|
if (!(window === null || window === void 0 ? void 0 : window.jsf)) {
|
|
27
|
-
|
|
28
|
-
window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a :
|
|
27
|
+
const faces = require("./_api").faces;
|
|
28
|
+
window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : faces;
|
|
29
29
|
window.jsf.specversion = 230000;
|
|
30
30
|
delete window.jsf.contextpath;
|
|
31
|
-
|
|
31
|
+
let faces4Init = faces.push.init;
|
|
32
32
|
/*
|
|
33
33
|
* we shim back the breaking api change from 3.0 to 4.0
|
|
34
34
|
* onerror is gone
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
faces.push.init = (socketClientId, url, channel, onopen, onmessage,
|
|
37
37
|
// no on error api change for 4.0
|
|
38
38
|
//onerror: Function,
|
|
39
|
-
onclose, behaviors, autoConnect) {
|
|
40
|
-
|
|
39
|
+
onclose, behaviors, autoConnect) => {
|
|
40
|
+
faces4Init(socketClientId, url, channel, onopen, onmessage, null, onclose, behaviors, autoConnect);
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
|
|
44
|
-
|
|
44
|
+
const myfaces = require("./_api").myfaces;
|
|
45
45
|
//namespace might be extended is not exclusively reserved so we merge
|
|
46
46
|
window["myfaces"] = (_c = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _c !== void 0 ? _c : {};
|
|
47
47
|
if (!((_d = window === null || window === void 0 ? void 0 : window.myfaces) === null || _d === void 0 ? void 0 : _d.ab)) {
|
|
48
|
-
|
|
48
|
+
const myfaces = require("./_api").myfaces;
|
|
49
49
|
//namespace might be extended is not exclusively reserved so we merge
|
|
50
50
|
window["myfaces"] = (_e = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _e !== void 0 ? _e : {};
|
|
51
|
-
Object.keys(
|
|
51
|
+
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]; });
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.jsf = window.jsf;
|
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":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AACb;;;;;GAKG;AACH,IAAG,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,EAAE;IACb,
|
|
1
|
+
{"version":3,"file":"jsf.js","sourceRoot":"","sources":["../../src/main/typescript/api/jsf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AACb;;;;;GAKG;AACH,IAAG,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,EAAE;IACb,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;IACrC,MAAc,CAAC,KAAK,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mCAAI,KAAK,CAAC;IAC9C,MAAM,CAAC,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC;IAChC,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC;IAE9B,IAAI,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,cAAsB,EACtB,GAAW,EACX,OAAe,EACf,MAAgB,EAChB,SAAmB;IACnB,iCAAiC;IACjC,oBAAoB;IACpB,OAAiB,EACjB,SAAc,EACd,WAAoB,EAAE,EAAE;QACvC,UAAU,CAAC,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IACvG,CAAC,CAAA;CACJ;AACD,IAAG,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,EAAE,CAAA,EAAE;IACrB,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;IAC1C,qEAAqE;IACpE,MAAc,CAAC,SAAS,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;IACnD,IAAG,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,EAAE,CAAA,EAAE;QACrB,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;QAC1C,qEAAqE;QACpE,MAAc,CAAC,SAAS,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;QACnD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,eAAC,OAAA,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAG,GAAG,CAAC,mCAAI,OAAO,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC,CAAC;KACpG;CACJ;AAEU,QAAA,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;AACjB,QAAA,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC"}
|
package/target/impl/AjaxImpl.js
CHANGED
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.Implementation = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
const Response_1 = require("./xhrCore/Response");
|
|
20
|
+
const XhrRequest_1 = require("./xhrCore/XhrRequest");
|
|
21
|
+
const AsyncQueue_1 = require("./util/AsyncQueue");
|
|
22
|
+
const mona_dish_1 = require("mona-dish");
|
|
23
|
+
const Assertions_1 = require("./util/Assertions");
|
|
24
|
+
const XhrFormData_1 = require("./xhrCore/XhrFormData");
|
|
25
|
+
const ExtDomQuery_1 = require("./util/ExtDomQuery");
|
|
26
|
+
const ErrorData_1 = require("./xhrCore/ErrorData");
|
|
27
|
+
const Lang_1 = require("./util/Lang");
|
|
28
|
+
const Const_1 = require("./core/Const");
|
|
29
|
+
const RequestDataResolver_1 = require("./xhrCore/RequestDataResolver");
|
|
30
30
|
/*
|
|
31
31
|
* allowed project stages
|
|
32
32
|
*/
|
|
@@ -116,13 +116,13 @@ var Implementation;
|
|
|
116
116
|
var getMessage = Lang_1.ExtLang.getMessage;
|
|
117
117
|
var getGlobalConfig = Lang_1.ExtLang.getGlobalConfig;
|
|
118
118
|
var assert = Assertions_1.Assertions.assert;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
let projectStage = null;
|
|
120
|
+
let separator = null;
|
|
121
|
+
let eventQueue = [];
|
|
122
|
+
let errorQueue = [];
|
|
123
123
|
Implementation.requestQueue = null;
|
|
124
124
|
/*error reporting threshold*/
|
|
125
|
-
|
|
125
|
+
let threshold = "ERROR";
|
|
126
126
|
/**
|
|
127
127
|
* fetches the separator char from the given script tags
|
|
128
128
|
*
|
|
@@ -161,7 +161,7 @@ var Implementation;
|
|
|
161
161
|
*/
|
|
162
162
|
function resolveProjectStateFromURL() {
|
|
163
163
|
/* run through all script tags and try to find the one that includes faces.js */
|
|
164
|
-
|
|
164
|
+
const foundStage = ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/stage=([^&;]*)/).value;
|
|
165
165
|
return (foundStage in ProjectStages) ? foundStage : null;
|
|
166
166
|
}
|
|
167
167
|
Implementation.resolveProjectStateFromURL = resolveProjectStateFromURL;
|
|
@@ -172,17 +172,14 @@ var Implementation;
|
|
|
172
172
|
* @param event
|
|
173
173
|
* @param funcs
|
|
174
174
|
*/
|
|
175
|
-
function chain(source, event) {
|
|
175
|
+
function chain(source, event, ...funcs) {
|
|
176
176
|
// we can use our lazy stream each functionality to run our chain here..
|
|
177
177
|
// by passing a boolean as return value into the onElem call
|
|
178
178
|
// we can stop early at the first false, just like the spec requests
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
funcs[_i - 2] = arguments[_i];
|
|
182
|
-
}
|
|
183
|
-
return mona_dish_1.LazyStream.of.apply(mona_dish_1.LazyStream, funcs).map(function (func) { return resolveAndExecute(source, event, func); })
|
|
179
|
+
return mona_dish_1.LazyStream.of(...funcs)
|
|
180
|
+
.map(func => resolveAndExecute(source, event, func))
|
|
184
181
|
// we use the return false == stop as an early stop, onElem stops at the first false
|
|
185
|
-
.onElem(
|
|
182
|
+
.onElem((opResult) => opResult)
|
|
186
183
|
//last ensures we run until the first false is returned
|
|
187
184
|
.last().value;
|
|
188
185
|
}
|
|
@@ -207,7 +204,7 @@ var Implementation;
|
|
|
207
204
|
*/
|
|
208
205
|
function request(el, event, opts) {
|
|
209
206
|
var _a, _b, _c;
|
|
210
|
-
|
|
207
|
+
const { resolvedEvent, options, elem, elementId, requestCtx, internalCtx, windowId, isResetValues } = (0, RequestDataResolver_1.resolveDefaults)(event, opts, el);
|
|
211
208
|
Assertions_1.Assertions.assertRequestIntegrity(options, elem);
|
|
212
209
|
/**
|
|
213
210
|
* fetch the parent form
|
|
@@ -216,15 +213,15 @@ var Implementation;
|
|
|
216
213
|
* so that people can use dummy forms and work
|
|
217
214
|
* with detached objects
|
|
218
215
|
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
216
|
+
const form = (0, RequestDataResolver_1.resolveForm)(requestCtx, elem, resolvedEvent);
|
|
217
|
+
const formId = form.id.value;
|
|
218
|
+
const delay = (0, RequestDataResolver_1.resolveDelay)(options);
|
|
219
|
+
const timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
|
|
223
220
|
requestCtx.assignIf(!!windowId, Const_1.P_WINDOW_ID).value = windowId;
|
|
224
221
|
// old non spec behavior will be removed after it is clear whether the removal breaks any code
|
|
225
222
|
requestCtx.assign(Const_1.CTX_PARAM_PASS_THR).value = filterPassThroughValues(options.value);
|
|
226
223
|
// spec conform behavior, all passthrough params must be under "passthrough
|
|
227
|
-
|
|
224
|
+
const params = remapArrayToAssocArr(options.getIf(Const_1.CTX_PARAM_SPEC_PARAMS).orElse({}).value);
|
|
228
225
|
requestCtx.getIf(Const_1.CTX_PARAM_PASS_THR).shallowMerge(new mona_dish_1.Config(params), true);
|
|
229
226
|
requestCtx.assignIf(!!resolvedEvent, Const_1.CTX_PARAM_PASS_THR, Const_1.P_EVT).value = resolvedEvent === null || resolvedEvent === void 0 ? void 0 : resolvedEvent.type;
|
|
230
227
|
/**
|
|
@@ -313,12 +310,11 @@ var Implementation;
|
|
|
313
310
|
* @param data the event data object hosting the event data according to the spec @see EventData for what is reachable
|
|
314
311
|
* @param localHandler an optional event handler, which is processed before the event handler chain
|
|
315
312
|
*/
|
|
316
|
-
function sendEvent(data, localHandler) {
|
|
317
|
-
|
|
318
|
-
}; }
|
|
313
|
+
function sendEvent(data, localHandler = function (data) {
|
|
314
|
+
}) {
|
|
319
315
|
/*now we serve the queue as well*/
|
|
320
316
|
localHandler(data);
|
|
321
|
-
eventQueue.forEach(
|
|
317
|
+
eventQueue.forEach(fn => fn(data));
|
|
322
318
|
}
|
|
323
319
|
Implementation.sendEvent = sendEvent;
|
|
324
320
|
/**
|
|
@@ -333,15 +329,14 @@ var Implementation;
|
|
|
333
329
|
* @param exception the exception being thrown
|
|
334
330
|
* @param clearRequestQueue if set to true, clears the request queue of all pending requests
|
|
335
331
|
*/
|
|
336
|
-
function stdErrorHandler(request, context, exception, clearRequestQueue) {
|
|
337
|
-
if (clearRequestQueue === void 0) { clearRequestQueue = false; }
|
|
332
|
+
function stdErrorHandler(request, context, exception, clearRequestQueue = false) {
|
|
338
333
|
//newer browsers do not allow to hold additional values on native objects like exceptions
|
|
339
334
|
//we hence capsule it into the request, which is gced automatically
|
|
340
335
|
//on ie as well, since the stdErrorHandler usually is called between requests
|
|
341
336
|
//this is a valid approach
|
|
342
337
|
try {
|
|
343
338
|
if (threshold == "ERROR") {
|
|
344
|
-
|
|
339
|
+
let errorData = ErrorData_1.ErrorData.fromClient(exception);
|
|
345
340
|
sendError(errorData);
|
|
346
341
|
}
|
|
347
342
|
}
|
|
@@ -368,14 +363,13 @@ var Implementation;
|
|
|
368
363
|
* @param errorData the error data to be displayed
|
|
369
364
|
* @param localHandler an optional local error handler which has to be processed before the error handler queue
|
|
370
365
|
*/
|
|
371
|
-
function sendError(errorData, localHandler) {
|
|
372
|
-
|
|
373
|
-
}; }
|
|
366
|
+
function sendError(errorData, localHandler = function (data) {
|
|
367
|
+
}) {
|
|
374
368
|
localHandler(errorData);
|
|
375
|
-
errorQueue.forEach(
|
|
369
|
+
errorQueue.forEach((errorCallback) => {
|
|
376
370
|
errorCallback(errorData);
|
|
377
371
|
});
|
|
378
|
-
|
|
372
|
+
let displayError = getGlobalConfig("defaultErrorOutput", (console ? console.error : alert));
|
|
379
373
|
displayError(errorData);
|
|
380
374
|
}
|
|
381
375
|
Implementation.sendError = sendError;
|
|
@@ -384,16 +378,16 @@ var Implementation;
|
|
|
384
378
|
* @return the client window id of the current window, if one is given if none is found, null is returned
|
|
385
379
|
*/
|
|
386
380
|
function getClientWindow(node) {
|
|
387
|
-
|
|
388
|
-
|
|
381
|
+
const ALTERED = "___mf_id_altered__";
|
|
382
|
+
const INIT = "___init____";
|
|
389
383
|
/*
|
|
390
384
|
* the search root for the dom element search
|
|
391
385
|
*/
|
|
392
|
-
|
|
386
|
+
let searchRoot = new mona_dish_1.DQ(node || document.body).querySelectorAll(`form input [name='${Const_1.P_CLIENT_WINDOW}']`);
|
|
393
387
|
/*
|
|
394
388
|
* lazy helper to fetch the window id from the window url
|
|
395
389
|
*/
|
|
396
|
-
|
|
390
|
+
let fetchWindowIdFromUrl = () => ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null).value;
|
|
397
391
|
/*
|
|
398
392
|
* functional double check based on stream reduction
|
|
399
393
|
* the values should be identical or on INIT value which is a premise to
|
|
@@ -402,7 +396,7 @@ var Implementation;
|
|
|
402
396
|
* @param value1
|
|
403
397
|
* @param value2
|
|
404
398
|
*/
|
|
405
|
-
|
|
399
|
+
let differenceCheck = (value1, value2) => {
|
|
406
400
|
if (value1 == INIT) {
|
|
407
401
|
return value2;
|
|
408
402
|
}
|
|
@@ -416,13 +410,13 @@ var Implementation;
|
|
|
416
410
|
*
|
|
417
411
|
* @param item
|
|
418
412
|
*/
|
|
419
|
-
|
|
413
|
+
let getValue = (item) => item.attr("value").value;
|
|
420
414
|
/*
|
|
421
415
|
* fetch the window id from the forms
|
|
422
416
|
* window ids must be present in all forms
|
|
423
417
|
* or non-existent. If they exist all of them must be the same
|
|
424
418
|
*/
|
|
425
|
-
|
|
419
|
+
let formWindowId = searchRoot.stream.map(getValue).reduce(differenceCheck, INIT);
|
|
426
420
|
//if the resulting window id is set on altered then we have an unresolvable problem
|
|
427
421
|
assert(ALTERED != formWindowId.value, "Multiple different windowIds found in document");
|
|
428
422
|
/*
|
|
@@ -444,11 +438,11 @@ var Implementation;
|
|
|
444
438
|
* type-check assert!, we opt for strong typing here
|
|
445
439
|
* because it makes it easier to detect bugs
|
|
446
440
|
*/
|
|
447
|
-
|
|
441
|
+
let element = mona_dish_1.DQ.byId(form, true);
|
|
448
442
|
if (!element.isTag(Const_1.TAG_FORM)) {
|
|
449
443
|
throw new Error(getMessage("ERR_VIEWSTATE"));
|
|
450
444
|
}
|
|
451
|
-
|
|
445
|
+
let formData = new XhrFormData_1.XhrFormData(element);
|
|
452
446
|
return formData.toString();
|
|
453
447
|
}
|
|
454
448
|
Implementation.getViewState = getViewState;
|
|
@@ -463,9 +457,7 @@ var Implementation;
|
|
|
463
457
|
*
|
|
464
458
|
* adds a new request to our queue for further processing
|
|
465
459
|
*/
|
|
466
|
-
addRequestToQueue: function (elem, form, reqCtx, respPassThr, delay, timeout) {
|
|
467
|
-
if (delay === void 0) { delay = 0; }
|
|
468
|
-
if (timeout === void 0) { timeout = 0; }
|
|
460
|
+
addRequestToQueue: function (elem, form, reqCtx, respPassThr, delay = 0, timeout = 0) {
|
|
469
461
|
Implementation.requestQueue = Implementation.requestQueue !== null && Implementation.requestQueue !== void 0 ? Implementation.requestQueue : new AsyncQueue_1.AsynchronousQueue();
|
|
470
462
|
Implementation.requestQueue.enqueue(new XhrRequest_1.XhrRequest(elem, form, reqCtx, respPassThr, [], timeout), delay);
|
|
471
463
|
}
|
|
@@ -521,7 +513,7 @@ var Implementation;
|
|
|
521
513
|
*/
|
|
522
514
|
function assignClientWindowId(form, targetContext) {
|
|
523
515
|
var _a;
|
|
524
|
-
|
|
516
|
+
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);
|
|
525
517
|
if (clientWindow) {
|
|
526
518
|
targetContext.assign(Const_1.CTX_PARAM_PASS_THR, Const_1.P_CLIENT_WINDOW).value = clientWindow;
|
|
527
519
|
}
|
|
@@ -543,12 +535,12 @@ var Implementation;
|
|
|
543
535
|
*/
|
|
544
536
|
function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId) {
|
|
545
537
|
//a cleaner implementation of the transform list method
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
538
|
+
let iterValues = (userValues) ? trim(userValues).split(/\s+/gi) : [];
|
|
539
|
+
let ret = [];
|
|
540
|
+
let processed = {};
|
|
549
541
|
// in this case we do not use lazy stream because it wont bring any code reduction
|
|
550
542
|
// or speedup
|
|
551
|
-
for (
|
|
543
|
+
for (let cnt = 0; cnt < iterValues.length; cnt++) {
|
|
552
544
|
//avoid doubles
|
|
553
545
|
if (iterValues[cnt] in processed) {
|
|
554
546
|
continue;
|
|
@@ -598,12 +590,12 @@ var Implementation;
|
|
|
598
590
|
//we now can use the full code reduction given by our stream api
|
|
599
591
|
//to filter
|
|
600
592
|
return mona_dish_1.Stream.ofAssoc(mappedOpts)
|
|
601
|
-
.filter(
|
|
593
|
+
.filter(item => !(item[0] in BlockFilter))
|
|
602
594
|
.collect(new mona_dish_1.AssocArrayCollector());
|
|
603
595
|
}
|
|
604
596
|
function remapArrayToAssocArr(arrayedParams) {
|
|
605
597
|
if (Array.isArray(arrayedParams)) {
|
|
606
|
-
return mona_dish_1.Stream.of
|
|
598
|
+
return mona_dish_1.Stream.of(...arrayedParams).collect(new mona_dish_1.AssocArrayCollector());
|
|
607
599
|
}
|
|
608
600
|
return arrayedParams;
|
|
609
601
|
}
|
|
@@ -628,9 +620,9 @@ var Implementation;
|
|
|
628
620
|
else {
|
|
629
621
|
//either a function or a string can be passed in case of a string we have to wrap it into another function
|
|
630
622
|
//it is not a plain executable code but a definition
|
|
631
|
-
|
|
623
|
+
let sourceCode = trim(func);
|
|
632
624
|
if (sourceCode.indexOf("function ") == 0) {
|
|
633
|
-
sourceCode =
|
|
625
|
+
sourceCode = `return ${sourceCode} (event)`;
|
|
634
626
|
}
|
|
635
627
|
return new Function("event", sourceCode).call(source, event) !== false;
|
|
636
628
|
}
|