jsf.js_next_gen 4.0.0-beta-4 → 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.
Files changed (134) hide show
  1. package/dist/window/faces-development.js +1952 -2468
  2. package/dist/window/faces-development.js.br +0 -0
  3. package/dist/window/faces-development.js.gz +0 -0
  4. package/dist/window/faces-development.js.map +1 -1
  5. package/dist/window/faces.js +1 -1
  6. package/dist/window/faces.js.br +0 -0
  7. package/dist/window/faces.js.gz +0 -0
  8. package/dist/window/faces.js.map +1 -1
  9. package/dist/window/jsf-development.js +1926 -2469
  10. package/dist/window/jsf-development.js.br +0 -0
  11. package/dist/window/jsf-development.js.gz +0 -0
  12. package/dist/window/jsf-development.js.map +1 -1
  13. package/dist/window/jsf.js +1 -1
  14. package/dist/window/jsf.js.br +0 -0
  15. package/dist/window/jsf.js.gz +0 -0
  16. package/dist/window/jsf.js.map +1 -1
  17. package/package.json +2 -2
  18. package/src/main/typescript/api/_api.ts +258 -0
  19. package/src/main/typescript/api/faces.ts +17 -245
  20. package/src/main/typescript/api/jsf.ts +24 -7
  21. package/src/main/typescript/impl/AjaxImpl.ts +1 -0
  22. package/src/main/typescript/impl/core/Const.ts +10 -29
  23. package/src/main/typescript/impl/util/ExtDomQuery.ts +89 -16
  24. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +4 -4
  25. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +5 -3
  26. package/src/main/typescript/impl/xhrCore/Response.ts +8 -6
  27. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +14 -13
  28. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +2 -1
  29. package/src/main/typescript/myfaces/OamSubmit.ts +6 -5
  30. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +6 -4
  31. package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +14 -23
  32. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +362 -0
  33. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +372 -0
  34. package/src/main/typescript/tsconfig-typedoc.json +17 -1
  35. package/src/main/typescript/tsconfig.json +17 -2
  36. package/src/test/resources/jsf-development.js +1 -1
  37. package/target/api/Jsf.js +24 -10
  38. package/target/api/Jsf.js.map +1 -1
  39. package/target/api/_api.js +246 -0
  40. package/target/api/_api.js.map +1 -0
  41. package/target/api/_faces.js +251 -0
  42. package/target/api/_faces.js.map +1 -0
  43. package/target/api/faces.js +20 -247
  44. package/target/api/faces.js.map +1 -1
  45. package/target/impl/AjaxImpl.js +53 -61
  46. package/target/impl/AjaxImpl.js.map +1 -1
  47. package/target/impl/PushImpl.js +38 -41
  48. package/target/impl/PushImpl.js.map +1 -1
  49. package/target/impl/core/Const.js +10 -33
  50. package/target/impl/core/Const.js.map +1 -1
  51. package/target/impl/core/ImplTypes.js +9 -14
  52. package/target/impl/core/ImplTypes.js.map +1 -1
  53. package/target/impl/i18n/Messages.js +3 -4
  54. package/target/impl/i18n/Messages.js.map +1 -1
  55. package/target/impl/util/Assertions.js +9 -18
  56. package/target/impl/util/Assertions.js.map +1 -1
  57. package/target/impl/util/AsyncQueue.js +28 -36
  58. package/target/impl/util/AsyncQueue.js.map +1 -1
  59. package/target/impl/util/ExtDomQuery.js +153 -133
  60. package/target/impl/util/ExtDomQuery.js.map +1 -1
  61. package/target/impl/util/Lang.js +21 -28
  62. package/target/impl/util/Lang.js.map +1 -1
  63. package/target/impl/xhrCore/ErrorData.js +36 -61
  64. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  65. package/target/impl/xhrCore/EventData.js +10 -13
  66. package/target/impl/xhrCore/EventData.js.map +1 -1
  67. package/target/impl/xhrCore/RequestDataResolver.js +16 -19
  68. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  69. package/target/impl/xhrCore/ResonseDataResolver.js +17 -16
  70. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  71. package/target/impl/xhrCore/Response.js +21 -20
  72. package/target/impl/xhrCore/Response.js.map +1 -1
  73. package/target/impl/xhrCore/ResponseProcessor.js +126 -140
  74. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  75. package/target/impl/xhrCore/XhrFormData.js +68 -97
  76. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  77. package/target/impl/xhrCore/XhrRequest.js +81 -91
  78. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  79. package/target/myfaces/OamSubmit.js +20 -18
  80. package/target/myfaces/OamSubmit.js.map +1 -1
  81. package/target/test/frameworkBase/LangTest.spec.js +46 -32
  82. package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
  83. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +160 -82
  84. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  85. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +45 -31
  86. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
  87. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +24 -33
  88. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
  89. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +8 -8
  90. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
  91. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +31 -31
  92. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
  93. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +50 -48
  94. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
  95. package/target/test/frameworkBase/_ext/shared/StandardInits.js +235 -132
  96. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  97. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +162 -18
  98. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  99. package/target/test/impl/ImplTest.spec.js +34 -61
  100. package/target/test/impl/ImplTest.spec.js.map +1 -1
  101. package/target/test/impl/ImplTest_23.spec.js +35 -64
  102. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  103. package/target/test/impl/SeparatorCharsTest.spec.js +19 -19
  104. package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
  105. package/target/test/myfaces/OamSubmit.spec.js +34 -41
  106. package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
  107. package/target/test/queue/AsynchronousProbe.js +23 -29
  108. package/target/test/queue/AsynchronousProbe.js.map +1 -1
  109. package/target/test/queue/AsynchronousQueueTest.spec.js +39 -70
  110. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  111. package/target/test/xhrCore/EventTests.spec.js +47 -78
  112. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  113. package/target/test/xhrCore/FakeWebsocket.js +14 -16
  114. package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
  115. package/target/test/xhrCore/FileUploadTest.spec.js +49 -80
  116. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  117. package/target/test/xhrCore/RequestParamsTest.spec.js +39 -70
  118. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  119. package/target/test/xhrCore/RequestTest.spec.js +76 -113
  120. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  121. package/target/test/xhrCore/RequestTest_23.spec.js +332 -0
  122. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -0
  123. package/target/test/xhrCore/ResponseTest.spec.js +118 -87
  124. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  125. package/target/test/xhrCore/ResponseTest23.spec.js +314 -0
  126. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -0
  127. package/target/test/xhrCore/ShadowDomTest.spec.js +31 -62
  128. package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
  129. package/target/test/xhrCore/WebsocketTest.js +60 -93
  130. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
  131. package/target/test/xhrCore/XhrFormDataTest.spec.js +41 -15
  132. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  133. package/webpack.config.js +71 -0
  134. package/webpack.config.js.map +1 -0
@@ -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>&quot;Production&quot;</li>
60
+ * <li>&quot;Development&quot;</li>
61
+ * <li>&quot;SystemTest&quot;</li>
62
+ * <li>&quot;UnitTest&quot;</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(&lt;errorData&gt;)</i>
134
+ * with errorData being of following format:
135
+ * <ul>
136
+ * <li> errorData.type : &quot;error&quot;</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(&lt;errorData&gt;)</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(&lt;eventData&gt;)</i>
155
+ *
156
+ * @param {function} eventListener event must be of the format <i>function eventListener(&lt;eventData&gt;)</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,IAAc,KAAK,CAsMlB;AAtMD,WAAc,KAAK;IAGf;;;;;;;;;;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,CAAA;IAED;;;;OAIG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AM,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;IAZe,UAAE,KAYjB,CAAA;IAED;;OAEG;IACU,WAAG,GAAG,eAAI,CAAC;AAC5B,CAAC,EA/Ba,OAAO,GAAP,eAAO,KAAP,eAAO,QA+BpB"}
@@ -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>&quot;Production&quot;</li>
59
+ * <li>&quot;Development&quot;</li>
60
+ * <li>&quot;SystemTest&quot;</li>
61
+ * <li>&quot;UnitTest&quot;</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(&lt;errorData&gt;)</i>
133
+ * with errorData being of following format:
134
+ * <ul>
135
+ * <li> errorData.type : &quot;error&quot;</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(&lt;errorData&gt;)</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(&lt;eventData&gt;)</i>
154
+ *
155
+ * @param {function} eventListener event must be of the format <i>function eventListener(&lt;eventData&gt;)</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;;;;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