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
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.myfaces = exports.faces = void 0;
|
|
19
|
+
///<reference types='../../types/typedefs'/>
|
|
20
|
+
const AjaxImpl_1 = require("../impl/AjaxImpl");
|
|
21
|
+
const PushImpl_1 = require("../impl/PushImpl");
|
|
22
|
+
const OamSubmit_1 = require("../myfaces/OamSubmit");
|
|
23
|
+
var faces;
|
|
24
|
+
(function (faces) {
|
|
25
|
+
"use strict";
|
|
26
|
+
/*
|
|
27
|
+
* Version of the implementation for the faces.ts.
|
|
28
|
+
* <p />
|
|
29
|
+
* as specified within the jsf specifications faces.html:
|
|
30
|
+
* <ul>
|
|
31
|
+
* <li>left two digits major release number</li>
|
|
32
|
+
* <li>middle two digits minor spec release number</li>
|
|
33
|
+
* <li>right two digits bug release number</li>
|
|
34
|
+
* </ul>
|
|
35
|
+
* @constant
|
|
36
|
+
*/
|
|
37
|
+
faces.specversion = 400000;
|
|
38
|
+
/**
|
|
39
|
+
* Implementation version as specified within the jsf specification.
|
|
40
|
+
* <p />
|
|
41
|
+
* A number increased with every implementation version
|
|
42
|
+
* and reset by moving to a new spec release number
|
|
43
|
+
*
|
|
44
|
+
* @constant
|
|
45
|
+
*/
|
|
46
|
+
faces.implversion = 0;
|
|
47
|
+
/**
|
|
48
|
+
* SeparatorChar as defined by UINamingContainer.getNamingContainerSeparatorChar()
|
|
49
|
+
* @type {Char}
|
|
50
|
+
*/
|
|
51
|
+
faces.separatorchar = getSeparatorChar();
|
|
52
|
+
/**
|
|
53
|
+
* This method is responsible for the return of a given project stage as defined
|
|
54
|
+
* by the jsf specification.
|
|
55
|
+
* <p/>
|
|
56
|
+
* Valid return values are:
|
|
57
|
+
* <ul>
|
|
58
|
+
* <li>"Production"</li>
|
|
59
|
+
* <li>"Development"</li>
|
|
60
|
+
* <li>"SystemTest"</li>
|
|
61
|
+
* <li>"UnitTest"</li>
|
|
62
|
+
* </li>
|
|
63
|
+
*
|
|
64
|
+
* @return {String} the current project state emitted by the server side method:
|
|
65
|
+
* <i>jakarta.faces.application.Application.getProjectStage()</i>
|
|
66
|
+
*/
|
|
67
|
+
function getProjectStage() {
|
|
68
|
+
return AjaxImpl_1.Implementation.getProjectStage();
|
|
69
|
+
}
|
|
70
|
+
faces.getProjectStage = getProjectStage;
|
|
71
|
+
/**
|
|
72
|
+
* collect and encode data for a given form element (must be of type form)
|
|
73
|
+
* find the jakarta.faces.ViewState element and encode its value as well!
|
|
74
|
+
* return a concatenated string of the encoded values!
|
|
75
|
+
*
|
|
76
|
+
* @throws an exception in case of the given element not being of type form!
|
|
77
|
+
* https://issues.apache.org/jira/browse/MYFACES-2110
|
|
78
|
+
*/
|
|
79
|
+
function getViewState(formElement) {
|
|
80
|
+
return AjaxImpl_1.Implementation.getViewState(formElement);
|
|
81
|
+
}
|
|
82
|
+
faces.getViewState = getViewState;
|
|
83
|
+
/**
|
|
84
|
+
* returns the window identifier for the given node / window
|
|
85
|
+
* @return the window identifier or null if none is found
|
|
86
|
+
* @param rootNode
|
|
87
|
+
*/
|
|
88
|
+
function getClientWindow(rootNode) {
|
|
89
|
+
return AjaxImpl_1.Implementation.getClientWindow(rootNode);
|
|
90
|
+
}
|
|
91
|
+
faces.getClientWindow = getClientWindow;
|
|
92
|
+
//private helper functions
|
|
93
|
+
function getSeparatorChar() {
|
|
94
|
+
return AjaxImpl_1.Implementation.getSeparatorChar();
|
|
95
|
+
}
|
|
96
|
+
let ajax;
|
|
97
|
+
(function (ajax) {
|
|
98
|
+
"use strict";
|
|
99
|
+
/**
|
|
100
|
+
* this function has to send the ajax requests
|
|
101
|
+
*
|
|
102
|
+
* following requestInternal conditions must be met:
|
|
103
|
+
* <ul>
|
|
104
|
+
* <li> the requestInternal must be sent asynchronously! </li>
|
|
105
|
+
* <li> the requestInternal must be a POST!!! requestInternal </li>
|
|
106
|
+
* <li> the requestInternal url must be the form action attribute </li>
|
|
107
|
+
* <li> all requests must be queued with a client side requestInternal queue to ensure the requestInternal ordering!</li>
|
|
108
|
+
* </ul>
|
|
109
|
+
*
|
|
110
|
+
* @param {String|Node} element: any dom element no matter being it html or jsf, from which the event is emitted
|
|
111
|
+
* @param {EVENT} event: any javascript event supported by that object
|
|
112
|
+
* @param {Map} options : map of options being pushed into the ajax cycle
|
|
113
|
+
*/
|
|
114
|
+
function request(element, event, options) {
|
|
115
|
+
AjaxImpl_1.Implementation.request(element, event, options);
|
|
116
|
+
//Implementation.getInstance().requestInternal(element, event, options);
|
|
117
|
+
}
|
|
118
|
+
ajax.request = request;
|
|
119
|
+
/**
|
|
120
|
+
* response handler
|
|
121
|
+
* @param request the request object having triggered this response
|
|
122
|
+
* @param context the request context
|
|
123
|
+
*
|
|
124
|
+
* TODO add info on what can be in the context
|
|
125
|
+
*/
|
|
126
|
+
function response(request, context) {
|
|
127
|
+
AjaxImpl_1.Implementation.response(request, context);
|
|
128
|
+
}
|
|
129
|
+
ajax.response = response;
|
|
130
|
+
/**
|
|
131
|
+
* Adds an error handler to our global error queue.
|
|
132
|
+
* the error handler must be of the format <i>function errorListener(<errorData>)</i>
|
|
133
|
+
* with errorData being of following format:
|
|
134
|
+
* <ul>
|
|
135
|
+
* <li> errorData.type : "error"</li>
|
|
136
|
+
* <li> errorData.status : the error status message</li>
|
|
137
|
+
* <li> errorData.serverErrorName : the server error name in case of a server error</li>
|
|
138
|
+
* <li> errorData.serverErrorMessage : the server error message in case of a server error</li>
|
|
139
|
+
* <li> errorData.source : the issuing source element which triggered the requestInternal </li>
|
|
140
|
+
* <li> eventData.responseCode: the response code (aka http requestInternal response code, 401 etc...) </li>
|
|
141
|
+
* <li> eventData.responseText: the requestInternal response text </li>
|
|
142
|
+
* <li> eventData.responseXML: the requestInternal response xml </li>
|
|
143
|
+
* </ul>
|
|
144
|
+
*
|
|
145
|
+
* @param {function} errorListener error handler must be of the format <i>function errorListener(<errorData>)</i>
|
|
146
|
+
*/
|
|
147
|
+
function addOnError(errorFunc) {
|
|
148
|
+
AjaxImpl_1.Implementation.addOnError(errorFunc);
|
|
149
|
+
}
|
|
150
|
+
ajax.addOnError = addOnError;
|
|
151
|
+
/**
|
|
152
|
+
* Adds a global event listener to the ajax event queue. The event listener must be a function
|
|
153
|
+
* of following format: <i>function eventListener(<eventData>)</i>
|
|
154
|
+
*
|
|
155
|
+
* @param {function} eventListener event must be of the format <i>function eventListener(<eventData>)</i>
|
|
156
|
+
*/
|
|
157
|
+
function addOnEvent(eventFunc) {
|
|
158
|
+
AjaxImpl_1.Implementation.addOnEvent(eventFunc);
|
|
159
|
+
}
|
|
160
|
+
ajax.addOnEvent = addOnEvent;
|
|
161
|
+
})(ajax = faces.ajax || (faces.ajax = {}));
|
|
162
|
+
let util;
|
|
163
|
+
(function (util) {
|
|
164
|
+
/**
|
|
165
|
+
* varargs function which executes a chain of code (functions or any other code)
|
|
166
|
+
*
|
|
167
|
+
* if any of the code returns false, the execution
|
|
168
|
+
* is terminated prematurely skipping the rest of the code!
|
|
169
|
+
*
|
|
170
|
+
* @param {DomNode} source, the callee object
|
|
171
|
+
* @param {Event} event, the event object of the callee event triggering this function
|
|
172
|
+
* @param funcs ... arbitrary array of functions or strings
|
|
173
|
+
* @returns true if the chain has succeeded false otherwise
|
|
174
|
+
*/
|
|
175
|
+
function chain(source, event, ...funcs) {
|
|
176
|
+
return AjaxImpl_1.Implementation.chain(source, event, ...funcs);
|
|
177
|
+
}
|
|
178
|
+
util.chain = chain;
|
|
179
|
+
})(util = faces.util || (faces.util = {}));
|
|
180
|
+
let push;
|
|
181
|
+
(function (push) {
|
|
182
|
+
/**
|
|
183
|
+
* @param {function} onopen The function to be invoked when the web socket is opened.
|
|
184
|
+
* @param {function} onmessage The function to be invoked when a message is received.
|
|
185
|
+
* @param {function} onclose The function to be invoked when the web socket is closed.
|
|
186
|
+
* @param {boolean} autoconnect Whether or not to immediately open the socket. Defaults to <code>false</code>.
|
|
187
|
+
*/
|
|
188
|
+
function init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect) {
|
|
189
|
+
PushImpl_1.PushImpl.init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect);
|
|
190
|
+
}
|
|
191
|
+
push.init = init;
|
|
192
|
+
/**
|
|
193
|
+
* Open the web socket on the given channel.
|
|
194
|
+
* @param {string} channel The name of the web socket channel.
|
|
195
|
+
* @throws {Error} When channel is unknown.
|
|
196
|
+
*/
|
|
197
|
+
function open(socketClientId) {
|
|
198
|
+
PushImpl_1.PushImpl.open(socketClientId);
|
|
199
|
+
}
|
|
200
|
+
push.open = open;
|
|
201
|
+
/**
|
|
202
|
+
* Close the web socket on the given channel.
|
|
203
|
+
* @param {string} channel The name of the web socket channel.
|
|
204
|
+
* @throws {Error} When channel is unknown.
|
|
205
|
+
*/
|
|
206
|
+
function close(socketClientId) {
|
|
207
|
+
PushImpl_1.PushImpl.close(socketClientId);
|
|
208
|
+
}
|
|
209
|
+
push.close = close;
|
|
210
|
+
})(push = faces.push || (faces.push = {}));
|
|
211
|
+
})(faces = exports.faces || (exports.faces = {}));
|
|
212
|
+
//fullfill the window contract for the myfaces namespace
|
|
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
|
+
if (!(window === null || window === void 0 ? void 0 : window.jsf)) {
|
|
231
|
+
options["jakarta.faces.behavior.event"] = eventName;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
options["javax.faces.behavior.event"] = eventName;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (execute) {
|
|
238
|
+
options["execute"] = execute;
|
|
239
|
+
}
|
|
240
|
+
if (render) {
|
|
241
|
+
options["render"] = render;
|
|
242
|
+
}
|
|
243
|
+
((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window.jsf).ajax.request(source, event, options);
|
|
244
|
+
}
|
|
245
|
+
myfaces.ab = ab;
|
|
246
|
+
/**
|
|
247
|
+
* legacy oam functions
|
|
248
|
+
*/
|
|
249
|
+
myfaces.oam = OamSubmit_1.oam;
|
|
250
|
+
})(myfaces = exports.myfaces || (exports.myfaces = {}));
|
|
251
|
+
//# sourceMappingURL=_faces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_faces.js","sourceRoot":"","sources":["../../src/main/typescript/api/_faces.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA4C;AAE5C,+CAAgD;AAChD,+CAA0C;AAC1C,oDAAiD;AAKjD,IAAc,KAAK,CAsMlB;AAtMD,WAAc,KAAK;IACf,YAAY,CAAC;IAEb;;;;;;;;;;OAUG;IACQ,iBAAW,GAAG,MAAM,CAAC;IAChC;;;;;;;OAOG;IACQ,iBAAW,GAAG,CAAC,CAAC;IAE3B;;;OAGG;IACQ,mBAAa,GAAG,gBAAgB,EAAE,CAAC;IAE9C;;;;;;;;;;;;;;OAcG;IACH,SAAgB,eAAe;QAC3B,OAAO,yBAAc,CAAC,eAAe,EAAE,CAAC;IAC5C,CAAC;IAFe,qBAAe,kBAE9B,CAAA;IAED;;;;;;;OAOG;IACH,SAAgB,YAAY,CAAC,WAA6B;QACtD,OAAO,yBAAc,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAFe,kBAAY,eAE3B,CAA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AAC;aACrD;SACJ;QACD,IAAI,OAAO,EAAE;YACT,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;SAChC;QACD,IAAI,MAAM,EAAE;YACR,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;SAC9B;QAED,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;IAhBe,UAAE,KAgBjB,CAAA;IAED;;OAEG;IACU,WAAG,GAAG,eAAI,CAAC;AAC5B,CAAC,EApCa,OAAO,GAAP,eAAO,KAAP,eAAO,QAoCpB"}
|
package/target/api/faces.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
4
3
|
* this work for additional information regarding copyright ownership.
|
|
@@ -14,252 +13,26 @@
|
|
|
14
13
|
* See the License for the specific language governing permissions and
|
|
15
14
|
* limitations under the License.
|
|
16
15
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
21
|
-
ar[i] = from[i];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
25
|
-
};
|
|
16
|
+
///<reference types='../../types/typedefs'/>
|
|
17
|
+
"use strict";
|
|
18
|
+
var _a, _b, _c;
|
|
26
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
20
|
exports.myfaces = exports.faces = void 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
* @constant
|
|
46
|
-
*/
|
|
47
|
-
faces.specversion = 400000;
|
|
48
|
-
/**
|
|
49
|
-
* Implementation version as specified within the jsf specification.
|
|
50
|
-
* <p />
|
|
51
|
-
* A number increased with every implementation version
|
|
52
|
-
* and reset by moving to a new spec release number
|
|
53
|
-
*
|
|
54
|
-
* @constant
|
|
55
|
-
*/
|
|
56
|
-
faces.implversion = 0;
|
|
57
|
-
/**
|
|
58
|
-
* SeparatorChar as defined by UINamingContainer.getNamingContainerSeparatorChar()
|
|
59
|
-
* @type {Char}
|
|
60
|
-
*/
|
|
61
|
-
faces.separatorchar = getSeparatorChar();
|
|
62
|
-
/**
|
|
63
|
-
* This method is responsible for the return of a given project stage as defined
|
|
64
|
-
* by the jsf specification.
|
|
65
|
-
* <p/>
|
|
66
|
-
* Valid return values are:
|
|
67
|
-
* <ul>
|
|
68
|
-
* <li>"Production"</li>
|
|
69
|
-
* <li>"Development"</li>
|
|
70
|
-
* <li>"SystemTest"</li>
|
|
71
|
-
* <li>"UnitTest"</li>
|
|
72
|
-
* </li>
|
|
73
|
-
*
|
|
74
|
-
* @return {String} the current project state emitted by the server side method:
|
|
75
|
-
* <i>jakarta.faces.application.Application.getProjectStage()</i>
|
|
76
|
-
*/
|
|
77
|
-
function getProjectStage() {
|
|
78
|
-
return AjaxImpl_1.Implementation.getProjectStage();
|
|
79
|
-
}
|
|
80
|
-
faces.getProjectStage = getProjectStage;
|
|
81
|
-
/**
|
|
82
|
-
* collect and encode data for a given form element (must be of type form)
|
|
83
|
-
* find the jakarta.faces.ViewState element and encode its value as well!
|
|
84
|
-
* return a concatenated string of the encoded values!
|
|
85
|
-
*
|
|
86
|
-
* @throws an exception in case of the given element not being of type form!
|
|
87
|
-
* https://issues.apache.org/jira/browse/MYFACES-2110
|
|
88
|
-
*/
|
|
89
|
-
function getViewState(formElement) {
|
|
90
|
-
return AjaxImpl_1.Implementation.getViewState(formElement);
|
|
91
|
-
}
|
|
92
|
-
faces.getViewState = getViewState;
|
|
93
|
-
/**
|
|
94
|
-
* returns the window identifier for the given node / window
|
|
95
|
-
* @return the window identifier or null if none is found
|
|
96
|
-
* @param rootNode
|
|
97
|
-
*/
|
|
98
|
-
function getClientWindow(rootNode) {
|
|
99
|
-
return AjaxImpl_1.Implementation.getClientWindow(rootNode);
|
|
100
|
-
}
|
|
101
|
-
faces.getClientWindow = getClientWindow;
|
|
102
|
-
//private helper functions
|
|
103
|
-
function getSeparatorChar() {
|
|
104
|
-
return AjaxImpl_1.Implementation.getSeparatorChar();
|
|
105
|
-
}
|
|
106
|
-
var ajax;
|
|
107
|
-
(function (ajax) {
|
|
108
|
-
"use strict";
|
|
109
|
-
/**
|
|
110
|
-
* this function has to send the ajax requests
|
|
111
|
-
*
|
|
112
|
-
* following requestInternal conditions must be met:
|
|
113
|
-
* <ul>
|
|
114
|
-
* <li> the requestInternal must be sent asynchronously! </li>
|
|
115
|
-
* <li> the requestInternal must be a POST!!! requestInternal </li>
|
|
116
|
-
* <li> the requestInternal url must be the form action attribute </li>
|
|
117
|
-
* <li> all requests must be queued with a client side requestInternal queue to ensure the requestInternal ordering!</li>
|
|
118
|
-
* </ul>
|
|
119
|
-
*
|
|
120
|
-
* @param {String|Node} element: any dom element no matter being it html or jsf, from which the event is emitted
|
|
121
|
-
* @param {EVENT} event: any javascript event supported by that object
|
|
122
|
-
* @param {Map} options : map of options being pushed into the ajax cycle
|
|
123
|
-
*/
|
|
124
|
-
function request(element, event, options) {
|
|
125
|
-
AjaxImpl_1.Implementation.request(element, event, options);
|
|
126
|
-
//Implementation.getInstance().requestInternal(element, event, options);
|
|
127
|
-
}
|
|
128
|
-
ajax.request = request;
|
|
129
|
-
/**
|
|
130
|
-
* response handler
|
|
131
|
-
* @param request the request object having triggered this response
|
|
132
|
-
* @param context the request context
|
|
133
|
-
*
|
|
134
|
-
* TODO add info on what can be in the context
|
|
135
|
-
*/
|
|
136
|
-
function response(request, context) {
|
|
137
|
-
AjaxImpl_1.Implementation.response(request, context);
|
|
138
|
-
}
|
|
139
|
-
ajax.response = response;
|
|
140
|
-
/**
|
|
141
|
-
* Adds an error handler to our global error queue.
|
|
142
|
-
* the error handler must be of the format <i>function errorListener(<errorData>)</i>
|
|
143
|
-
* with errorData being of following format:
|
|
144
|
-
* <ul>
|
|
145
|
-
* <li> errorData.type : "error"</li>
|
|
146
|
-
* <li> errorData.status : the error status message</li>
|
|
147
|
-
* <li> errorData.serverErrorName : the server error name in case of a server error</li>
|
|
148
|
-
* <li> errorData.serverErrorMessage : the server error message in case of a server error</li>
|
|
149
|
-
* <li> errorData.source : the issuing source element which triggered the requestInternal </li>
|
|
150
|
-
* <li> eventData.responseCode: the response code (aka http requestInternal response code, 401 etc...) </li>
|
|
151
|
-
* <li> eventData.responseText: the requestInternal response text </li>
|
|
152
|
-
* <li> eventData.responseXML: the requestInternal response xml </li>
|
|
153
|
-
* </ul>
|
|
154
|
-
*
|
|
155
|
-
* @param {function} errorListener error handler must be of the format <i>function errorListener(<errorData>)</i>
|
|
156
|
-
*/
|
|
157
|
-
function addOnError(errorFunc) {
|
|
158
|
-
AjaxImpl_1.Implementation.addOnError(errorFunc);
|
|
159
|
-
}
|
|
160
|
-
ajax.addOnError = addOnError;
|
|
161
|
-
/**
|
|
162
|
-
* Adds a global event listener to the ajax event queue. The event listener must be a function
|
|
163
|
-
* of following format: <i>function eventListener(<eventData>)</i>
|
|
164
|
-
*
|
|
165
|
-
* @param {function} eventListener event must be of the format <i>function eventListener(<eventData>)</i>
|
|
166
|
-
*/
|
|
167
|
-
function addOnEvent(eventFunc) {
|
|
168
|
-
AjaxImpl_1.Implementation.addOnEvent(eventFunc);
|
|
169
|
-
}
|
|
170
|
-
ajax.addOnEvent = addOnEvent;
|
|
171
|
-
})(ajax = faces.ajax || (faces.ajax = {}));
|
|
172
|
-
var util;
|
|
173
|
-
(function (util) {
|
|
174
|
-
/**
|
|
175
|
-
* varargs function which executes a chain of code (functions or any other code)
|
|
176
|
-
*
|
|
177
|
-
* if any of the code returns false, the execution
|
|
178
|
-
* is terminated prematurely skipping the rest of the code!
|
|
179
|
-
*
|
|
180
|
-
* @param {DomNode} source, the callee object
|
|
181
|
-
* @param {Event} event, the event object of the callee event triggering this function
|
|
182
|
-
* @param funcs ... arbitrary array of functions or strings
|
|
183
|
-
* @returns true if the chain has succeeded false otherwise
|
|
184
|
-
*/
|
|
185
|
-
function chain(source, event) {
|
|
186
|
-
var funcs = [];
|
|
187
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
188
|
-
funcs[_i - 2] = arguments[_i];
|
|
189
|
-
}
|
|
190
|
-
return AjaxImpl_1.Implementation.chain.apply(AjaxImpl_1.Implementation, __spreadArray([source, event], funcs, false));
|
|
191
|
-
}
|
|
192
|
-
util.chain = chain;
|
|
193
|
-
})(util = faces.util || (faces.util = {}));
|
|
194
|
-
var push;
|
|
195
|
-
(function (push) {
|
|
196
|
-
/**
|
|
197
|
-
* @param {function} onopen The function to be invoked when the web socket is opened.
|
|
198
|
-
* @param {function} onmessage The function to be invoked when a message is received.
|
|
199
|
-
* @param {function} onclose The function to be invoked when the web socket is closed.
|
|
200
|
-
* @param {boolean} autoconnect Whether or not to immediately open the socket. Defaults to <code>false</code>.
|
|
201
|
-
*/
|
|
202
|
-
function init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect) {
|
|
203
|
-
PushImpl_1.PushImpl.init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect);
|
|
204
|
-
}
|
|
205
|
-
push.init = init;
|
|
206
|
-
/**
|
|
207
|
-
* Open the web socket on the given channel.
|
|
208
|
-
* @param {string} channel The name of the web socket channel.
|
|
209
|
-
* @throws {Error} When channel is unknown.
|
|
210
|
-
*/
|
|
211
|
-
function open(socketClientId) {
|
|
212
|
-
PushImpl_1.PushImpl.open(socketClientId);
|
|
213
|
-
}
|
|
214
|
-
push.open = open;
|
|
215
|
-
/**
|
|
216
|
-
* Close the web socket on the given channel.
|
|
217
|
-
* @param {string} channel The name of the web socket channel.
|
|
218
|
-
* @throws {Error} When channel is unknown.
|
|
219
|
-
*/
|
|
220
|
-
function close(socketClientId) {
|
|
221
|
-
PushImpl_1.PushImpl.close(socketClientId);
|
|
222
|
-
}
|
|
223
|
-
push.close = close;
|
|
224
|
-
})(push = faces.push || (faces.push = {}));
|
|
225
|
-
})(faces = exports.faces || (exports.faces = {}));
|
|
226
|
-
//fullfill the window contract for the myfaces namespace
|
|
227
|
-
var myfaces;
|
|
228
|
-
(function (myfaces) {
|
|
229
|
-
/**
|
|
230
|
-
* AB function similar to mojarra and Primefaces
|
|
231
|
-
* not part of the spec but a convenience accessor method
|
|
232
|
-
* Code provided by Thomas Andraschko
|
|
233
|
-
*
|
|
234
|
-
* @param source the event source
|
|
235
|
-
* @param event the event
|
|
236
|
-
* @param eventName event name for java.jakarta.faces.behavior.evemnt
|
|
237
|
-
* @param execute execute list as passed down in faces.ajax.request
|
|
238
|
-
* @param render
|
|
239
|
-
* @param options
|
|
240
|
-
*/
|
|
241
|
-
function ab(source, event, eventName, execute, render, options) {
|
|
242
|
-
if (options === void 0) { options = {}; }
|
|
243
|
-
if (eventName) {
|
|
244
|
-
if (!(window === null || window === void 0 ? void 0 : window.jsf)) {
|
|
245
|
-
options["jakarta.faces.behavior.event"] = eventName;
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
options["javax.faces.behavior.event"] = eventName;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
if (execute) {
|
|
252
|
-
options["execute"] = execute;
|
|
253
|
-
}
|
|
254
|
-
if (render) {
|
|
255
|
-
options["render"] = render;
|
|
256
|
-
}
|
|
257
|
-
faces.ajax.request(source, event, options);
|
|
258
|
-
}
|
|
259
|
-
myfaces.ab = ab;
|
|
260
|
-
/**
|
|
261
|
-
* legacy oam functions
|
|
262
|
-
*/
|
|
263
|
-
myfaces.oam = OamSubmit_1.oam;
|
|
264
|
-
})(myfaces = exports.myfaces || (exports.myfaces = {}));
|
|
21
|
+
/**
|
|
22
|
+
* faces.js init layer which provides as per spec the proper
|
|
23
|
+
* window namespace if it does not exist already
|
|
24
|
+
*/
|
|
25
|
+
if (!window.faces) {
|
|
26
|
+
//we lazily load the code to prevent ram bloat
|
|
27
|
+
const faces = require("./_api").faces;
|
|
28
|
+
window['faces'] = (_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : faces;
|
|
29
|
+
}
|
|
30
|
+
if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
|
|
31
|
+
const myfaces = require("./_api").myfaces;
|
|
32
|
+
//namespace might be extended is not exclusively reserved so we merge
|
|
33
|
+
window["myfaces"] = (_c = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _c !== void 0 ? _c : {};
|
|
34
|
+
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]; });
|
|
35
|
+
}
|
|
36
|
+
exports.faces = window.faces;
|
|
37
|
+
exports.myfaces = window.myfaces;
|
|
265
38
|
//# sourceMappingURL=faces.js.map
|
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":"
|
|
1
|
+
{"version":3,"file":"faces.js","sourceRoot":"","sources":["../../src/main/typescript/api/faces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAA4C;AAC5C,YAAY,CAAC;;;;AAGb;;;GAGG;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,MAAC,MAAc,aAAd,MAAM,uBAAN,MAAM,CAAU,KAAK,mCAAI,KAAK,CAAC;CACrD;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;IACrE,MAAM,CAAC,SAAS,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;IAC1C,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"}
|