jsf.js_next_gen 4.0.1-beta.5 → 4.0.1-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/assets/style.css +4 -5
- package/dist/window/faces-development.js +111 -91
- 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 +111 -91
- 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 +10 -10
- package/src/main/typescript/impl/util/XhrQueueController.ts +3 -17
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +94 -51
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +126 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +60 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/bootstrap-icons.css +15 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/tobago.css +15 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +15 -0
- package/src/main/typescript/test/myfaces/{OnLoadSpec.ts → OnLoad.spec.ts} +2 -2
- package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +136 -0
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +9 -12
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +18 -0
- package/target/AssocArray.js +281 -0
- package/target/AssocArray.js.map +1 -0
- package/target/Config.js +235 -0
- package/target/Config.js.map +1 -0
- package/target/CryptoExtensions.js +112 -0
- package/target/CryptoExtensions.js.map +1 -0
- package/target/DomQuery.js +1963 -0
- package/target/DomQuery.js.map +1 -0
- package/target/Es2019Array.js +117 -0
- package/target/Es2019Array.js.map +1 -0
- package/target/Global.js +38 -0
- package/target/Global.js.map +1 -0
- package/target/IDomQuery.js +3 -0
- package/target/IDomQuery.js.map +1 -0
- package/target/Lang.js +183 -0
- package/target/Lang.js.map +1 -0
- package/target/Messaging.js +645 -0
- package/target/Messaging.js.map +1 -0
- package/target/Monad.js +330 -0
- package/target/Monad.js.map +1 -0
- package/target/Promise.js +296 -0
- package/target/Promise.js.map +1 -0
- package/target/PromiseShim.js +30 -0
- package/target/PromiseShim.js.map +1 -0
- package/target/SourcesCollectors.js +444 -0
- package/target/SourcesCollectors.js.map +1 -0
- package/target/Stream.js +562 -0
- package/target/Stream.js.map +1 -0
- package/target/TagBuilder.js +178 -0
- package/target/TagBuilder.js.map +1 -0
- package/target/XmlQuery.js +84 -0
- package/target/XmlQuery.js.map +1 -0
- package/target/impl/util/XhrQueueController.js +3 -18
- package/target/impl/util/XhrQueueController.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +89 -45
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/index.js +80 -0
- package/target/index.js.map +1 -0
- package/target/index_core.js +76 -0
- package/target/index_core.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +124 -0
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +57 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/myfaces/OnLoad.spec.js +57 -0
- package/target/test/myfaces/OnLoad.spec.js.map +1 -0
- package/target/test/myfaces/OnLoadSpec.js +2 -2
- package/target/test/myfaces/OnLoadSpec.js.map +1 -1
- package/target/test/xhrCore/ErrorChainTest.spec.js +156 -0
- package/target/test/xhrCore/ErrorChainTest.spec.js.map +1 -0
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +8 -5
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +13 -0
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/types/main/typescript/AssocArray.d.ts +86 -0
- package/target/types/main/typescript/Config.d.ts +94 -0
- package/target/types/main/typescript/CryptoExtensions.d.ts +87 -0
- package/target/types/main/typescript/DomQuery.d.ts +587 -0
- package/target/types/main/typescript/Es2019Array.d.ts +30 -0
- package/target/types/main/typescript/Global.d.ts +23 -0
- package/target/types/main/typescript/IDomQuery.d.ts +480 -0
- package/target/types/main/typescript/Lang.d.ts +97 -0
- package/target/types/main/typescript/Messaging.d.ts +285 -0
- package/target/types/main/typescript/Monad.d.ts +161 -0
- package/target/types/main/typescript/Promise.d.ts +58 -0
- package/target/types/main/typescript/PromiseShim.d.ts +22 -0
- package/target/types/main/typescript/SourcesCollectors.d.ts +280 -0
- package/target/types/main/typescript/Stream.d.ts +284 -0
- package/target/types/main/typescript/TagBuilder.d.ts +50 -0
- package/target/types/main/typescript/XmlQuery.d.ts +31 -0
- package/target/types/main/typescript/api/_api.d.ts +182 -0
- package/target/types/main/typescript/api/faces.d.ts +17 -0
- package/target/types/main/typescript/api/jsf.d.ts +17 -0
- package/target/types/main/typescript/impl/AjaxImpl.d.ts +164 -0
- package/target/types/main/typescript/impl/PushImpl.d.ts +38 -0
- package/target/types/main/typescript/impl/core/Const.d.ts +138 -0
- package/target/types/main/typescript/impl/core/ImplTypes.d.ts +16 -0
- package/target/types/main/typescript/impl/i18n/Messages.d.ts +102 -0
- package/target/types/main/typescript/impl/util/Assertions.d.ts +46 -0
- package/target/types/main/typescript/impl/util/AsyncRunnable.d.ts +112 -0
- package/target/types/main/typescript/impl/util/ExtDomQuery.d.ts +100 -0
- package/target/types/main/typescript/impl/util/FileUtils.d.ts +25 -0
- package/target/types/main/typescript/impl/util/HiddenInputBuilder.d.ts +37 -0
- package/target/types/main/typescript/impl/util/IListener.d.ts +18 -0
- package/target/types/main/typescript/impl/util/Lang.d.ts +138 -0
- package/target/types/main/typescript/impl/util/XhrQueueController.d.ts +51 -0
- package/target/types/main/typescript/impl/xhrCore/ErrorData.d.ts +37 -0
- package/target/types/main/typescript/impl/xhrCore/EventData.d.ts +25 -0
- package/target/types/main/typescript/impl/xhrCore/IResponseProcessor.d.ts +136 -0
- package/target/types/main/typescript/impl/xhrCore/RequestDataResolver.d.ts +84 -0
- package/target/types/main/typescript/impl/xhrCore/ResonseDataResolver.d.ts +60 -0
- package/target/types/main/typescript/impl/xhrCore/Response.d.ts +29 -0
- package/target/types/main/typescript/impl/xhrCore/ResponseProcessor.d.ts +208 -0
- package/target/types/main/typescript/impl/xhrCore/XhrFormData.d.ts +83 -0
- package/target/types/main/typescript/impl/xhrCore/XhrRequest.d.ts +102 -0
- package/target/types/main/typescript/index.d.ts +34 -0
- package/target/types/main/typescript/index_core.d.ts +29 -0
- package/target/types/main/typescript/myfaces/OamSubmit.d.ts +53 -0
- package/target/types/main/typescript/test/frameworkBase/LangTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.d.ts +39 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.d.ts +0 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.d.ts +1 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.d.ts +1 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/shared/StandardInits.d.ts +63 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.d.ts +23 -0
- package/target/types/main/typescript/test/impl/ImplTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/impl/ImplTest_23.spec.d.ts +16 -0
- package/target/types/main/typescript/test/impl/SeparatorCharsTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/myfaces/OamSubmit.spec.d.ts +16 -0
- package/target/types/main/typescript/test/myfaces/OnLoad.spec.d.ts +16 -0
- package/target/types/main/typescript/test/queue/AsynchronousProbe.d.ts +38 -0
- package/target/types/main/typescript/test/queue/AsynchronousQueueTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/ClientWindow.spec.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/ErrorChainTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/EventTests.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/FakeWebsocket.d.ts +24 -0
- package/target/types/main/typescript/test/xhrCore/FileUploadTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/NamespacesRequestTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/OamSubmitTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/RequestParamsTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/RequestTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/RequestTest_23.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/ResponseTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/ResponseTest23.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/ShadowDomTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/WebsocketTest.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/XhrFormDataTest.spec.d.ts +16 -0
- package/target/types/test/typescript/AssocArrayTest.spec.d.ts +1 -0
- package/target/types/test/typescript/DomQueryTest.spec.d.ts +1 -0
- package/target/types/test/typescript/ExtendedArrayTest.spec.d.ts +1 -0
- package/target/types/test/typescript/LangTest.spec.d.ts +1 -0
- package/target/types/test/typescript/MappingProbes.d.ts +24 -0
- package/target/types/test/typescript/MappingTest.spec.d.ts +1 -0
- package/target/types/test/typescript/MessagingTest.spec.d.ts +1 -0
- package/target/types/test/typescript/MonadTest.spec.d.ts +16 -0
- package/target/types/test/typescript/PromiseTest.spec.d.ts +1 -0
- package/target/types/test/typescript/StreamTest.spec.d.ts +1 -0
- package/target/types/test/typescript/XmlQueryTest.spec.d.ts +1 -0
- package/target/types/test/typescript/markups/tobago-with-header.d.ts +1 -0
- package/target/types/test/typescript/markups/tobago-without-header.d.ts +1 -0
- package/webpack.config.js +1 -1
- package/webpack.config.js.map +1 -1
- package/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
- package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
- package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
- package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/src/test.html +0 -75
- package/src/tmp/test.html +0 -16
- package/tmp.xml +0 -36
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { Config } from "mona-dish";
|
|
17
|
+
export declare class EventData implements IEventData {
|
|
18
|
+
type: string;
|
|
19
|
+
status: string;
|
|
20
|
+
source: any;
|
|
21
|
+
responseCode: string;
|
|
22
|
+
responseText: string;
|
|
23
|
+
responseXML: Document;
|
|
24
|
+
static createFromRequest(request: XMLHttpRequest, context: Config, /*event name*/ name: string): EventData;
|
|
25
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
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
|
+
import { XMLQuery } from "mona-dish";
|
|
17
|
+
import { DQ } from "mona-dish";
|
|
18
|
+
/**
|
|
19
|
+
* response processor interface
|
|
20
|
+
* We expose an interface
|
|
21
|
+
* to allow a clear contract for future
|
|
22
|
+
* testing and implementation extension points
|
|
23
|
+
*/
|
|
24
|
+
export interface IResponseProcessor {
|
|
25
|
+
/**
|
|
26
|
+
* replace the head element
|
|
27
|
+
*
|
|
28
|
+
* @param shadowHead
|
|
29
|
+
*/
|
|
30
|
+
replaceHead(shadowHead: XMLQuery | DQ): void;
|
|
31
|
+
/**
|
|
32
|
+
* adds new elements to the head
|
|
33
|
+
*
|
|
34
|
+
* @param newElements the elements which need addition
|
|
35
|
+
*/
|
|
36
|
+
addToHead(newElements: XMLQuery | DQ): void;
|
|
37
|
+
/**
|
|
38
|
+
* adds new elements to the head in a deferred manner
|
|
39
|
+
*
|
|
40
|
+
* @param newElements the elements which need addition
|
|
41
|
+
*/
|
|
42
|
+
addToHeadDeferred(newElements: XMLQuery | DQ): void;
|
|
43
|
+
/**
|
|
44
|
+
* replace the body
|
|
45
|
+
*
|
|
46
|
+
* @param shadowBody
|
|
47
|
+
*/
|
|
48
|
+
replaceBody(shadowBody: XMLQuery | DQ): void;
|
|
49
|
+
/**
|
|
50
|
+
* Leaf Tag eval... process whatever is in the evaluated cdata block
|
|
51
|
+
*
|
|
52
|
+
* @param node
|
|
53
|
+
*/
|
|
54
|
+
eval(node: XMLQuery): void;
|
|
55
|
+
/**
|
|
56
|
+
* processes an incoming error from the response
|
|
57
|
+
* which is hosted under the <error> tag
|
|
58
|
+
* @param node the node in the xml hosting the error message
|
|
59
|
+
*/
|
|
60
|
+
error(node: XMLQuery): void;
|
|
61
|
+
/**
|
|
62
|
+
* process the redirect operation
|
|
63
|
+
*
|
|
64
|
+
* @param node
|
|
65
|
+
*/
|
|
66
|
+
redirect(node: XMLQuery): void;
|
|
67
|
+
/**
|
|
68
|
+
* processes the update operation and updates the node with the cdata block
|
|
69
|
+
* @param node
|
|
70
|
+
* @param cdataBlock
|
|
71
|
+
*/
|
|
72
|
+
update(node: XMLQuery, cdataBlock: string): void;
|
|
73
|
+
/**
|
|
74
|
+
* delete operation, deletes the data from
|
|
75
|
+
* node from the dom
|
|
76
|
+
*
|
|
77
|
+
* @param node
|
|
78
|
+
*/
|
|
79
|
+
delete(node: XMLQuery): void;
|
|
80
|
+
/**
|
|
81
|
+
* attributes leaf tag... process the attributes
|
|
82
|
+
*
|
|
83
|
+
* @param node
|
|
84
|
+
*/
|
|
85
|
+
attributes(node: XMLQuery): void;
|
|
86
|
+
/**
|
|
87
|
+
* replace the entire viewRoot
|
|
88
|
+
* with shadowResponse
|
|
89
|
+
* @param shadowResponse
|
|
90
|
+
*/
|
|
91
|
+
replaceViewRoot(shadowResponse: XMLQuery | DQ): void;
|
|
92
|
+
/**
|
|
93
|
+
* jsf insert resolution
|
|
94
|
+
* which then has to handle the before and after situation
|
|
95
|
+
*
|
|
96
|
+
* @param node
|
|
97
|
+
*/
|
|
98
|
+
insert(node: XMLQuery): void;
|
|
99
|
+
/**
|
|
100
|
+
* insert with before, after sub-tags
|
|
101
|
+
* @param node
|
|
102
|
+
*/
|
|
103
|
+
insertWithSubTags(node: XMLQuery): any;
|
|
104
|
+
/**
|
|
105
|
+
* process the viewState update, update the affected
|
|
106
|
+
* forms with their respective new viewState values
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
109
|
+
processViewState(node: XMLQuery): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* process the viewState update, update the affected
|
|
112
|
+
* forms with their respective new viewState values
|
|
113
|
+
*
|
|
114
|
+
*/
|
|
115
|
+
processClientWindow(node: XMLQuery): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Eval - all processed elements so far
|
|
118
|
+
* and executes the embedded scripts
|
|
119
|
+
*/
|
|
120
|
+
globalEval(): void;
|
|
121
|
+
/**
|
|
122
|
+
* fix the viewStates of all processed forms
|
|
123
|
+
*/
|
|
124
|
+
fixViewStates(): void;
|
|
125
|
+
/**
|
|
126
|
+
* processing done
|
|
127
|
+
* send last event
|
|
128
|
+
*/
|
|
129
|
+
done(): void;
|
|
130
|
+
/**
|
|
131
|
+
* update internal state to
|
|
132
|
+
* check whether we still are in a named view root
|
|
133
|
+
* (can change after a navigation)
|
|
134
|
+
*/
|
|
135
|
+
updateNamedViewRootState(): any;
|
|
136
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
import { Config, DomQuery, DQ } from "mona-dish";
|
|
17
|
+
import { XhrFormData } from "./XhrFormData";
|
|
18
|
+
/**
|
|
19
|
+
* Resolver functions for various aspects of the request data
|
|
20
|
+
*
|
|
21
|
+
* stateless because it might be called from various
|
|
22
|
+
* parts of the response classes
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* resolves the event handlers lazily
|
|
26
|
+
* so that if some decoration happens in between we can deal with it
|
|
27
|
+
*
|
|
28
|
+
* @param requestContext
|
|
29
|
+
* @param responseContext
|
|
30
|
+
* @param funcName
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveHandlerFunc(requestContext: Config, responseContext: Config, funcName: string): any;
|
|
33
|
+
export declare function resolveTargetUrl(srcFormElement: HTMLFormElement): any;
|
|
34
|
+
export declare function resolveFinalUrl(sourceForm: DomQuery, formData: XhrFormData, ajaxType?: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* form resolution the same way our old implementation did
|
|
37
|
+
* it is either the id or the parent form of the element or an embedded form
|
|
38
|
+
* of the element
|
|
39
|
+
*
|
|
40
|
+
* @param elem
|
|
41
|
+
* @param event
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveForm(elem: DQ, event: Event): DQ;
|
|
44
|
+
export declare function resolveViewId(form: DQ): string;
|
|
45
|
+
export declare function resolveViewRootId(form: DQ): string;
|
|
46
|
+
/**
|
|
47
|
+
* as per jsdoc before the request it must be ensured that every post argument
|
|
48
|
+
* is prefixed with the naming container id (there is an exception in mojarra with
|
|
49
|
+
* the element=element param, which we have to follow here as well.
|
|
50
|
+
* (inputs are prefixed by name anyway normally this only affects our standard parameters)
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
53
|
+
export declare function resoveNamingContainerMapper(internalContext: Config): (key: string, value: any) => [string, any];
|
|
54
|
+
export declare function resolveTimeout(options: Config): number;
|
|
55
|
+
/**
|
|
56
|
+
* resolve the delay from the options and/or the request context and or the configuration
|
|
57
|
+
*
|
|
58
|
+
* @param options ... the options object, in most cases it will host the delay value
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveDelay(options: Config): number;
|
|
61
|
+
/**
|
|
62
|
+
* resolves the window-id from various sources
|
|
63
|
+
*
|
|
64
|
+
* @param options
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveWindowId(options: Config): any;
|
|
67
|
+
/**
|
|
68
|
+
* cross port from the dojo lib
|
|
69
|
+
* browser save event resolution
|
|
70
|
+
* @param evt the event object
|
|
71
|
+
* (with a fallback for ie events if none is present)
|
|
72
|
+
* @deprecated soon will be removed
|
|
73
|
+
*/
|
|
74
|
+
export declare function getEventTarget(evt: Event): Element;
|
|
75
|
+
/**
|
|
76
|
+
* resolves a bunch of default values
|
|
77
|
+
* which can be further processed from the given
|
|
78
|
+
* call parameters of faces.ajax.request
|
|
79
|
+
*
|
|
80
|
+
* @param event
|
|
81
|
+
* @param opts
|
|
82
|
+
* @param el
|
|
83
|
+
*/
|
|
84
|
+
export declare function resolveDefaults(event: Event, opts: Options | [[string, any]], el?: Element | string): any;
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
import { Config, XMLQuery } from "mona-dish";
|
|
17
|
+
import { DQ } from "mona-dish";
|
|
18
|
+
/**
|
|
19
|
+
* Resolver functions for various aspects of the response data
|
|
20
|
+
*
|
|
21
|
+
* stateless because it might be called from various
|
|
22
|
+
* parts of the response classes
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* fetches the response XML
|
|
26
|
+
* as XML Query object
|
|
27
|
+
*
|
|
28
|
+
* @param request the request hosting the responseXML
|
|
29
|
+
*
|
|
30
|
+
* Throws an error in case of non-existent or wrong xml data
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveResponseXML(request: Config): XMLQuery;
|
|
34
|
+
/**
|
|
35
|
+
* Splits the incoming pass-through context apart
|
|
36
|
+
* in an internal and an external normalized context
|
|
37
|
+
* the internal one is just for our internal processing
|
|
38
|
+
*
|
|
39
|
+
* @param context the root context as associative array
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveContexts(context: {
|
|
42
|
+
[p: string]: any;
|
|
43
|
+
}): any;
|
|
44
|
+
/**
|
|
45
|
+
* fetches the source element out of our contexts
|
|
46
|
+
*
|
|
47
|
+
* @param context the external context which should host the source id
|
|
48
|
+
* @param internalContext internal pass-through fall back
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveSourceElement(context: Config, internalContext: Config): DQ;
|
|
52
|
+
/**
|
|
53
|
+
* fetches the source form if it still exists
|
|
54
|
+
* also embedded forms and parent forms are taken into consideration
|
|
55
|
+
* as fallbacks
|
|
56
|
+
*
|
|
57
|
+
* @param internalContext
|
|
58
|
+
* @param elem
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveSourceForm(internalContext: Config, elem: DQ): DQ;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
export declare module Response {
|
|
17
|
+
/**
|
|
18
|
+
* Standardized faces.ts response
|
|
19
|
+
* this one is called straight from faces.ts.response
|
|
20
|
+
*
|
|
21
|
+
* The processing follows the spec by going for the responseXML
|
|
22
|
+
* and processing its tags
|
|
23
|
+
*
|
|
24
|
+
* @param {XMLHttpRequest} request (xhrRequest) - xhr request object
|
|
25
|
+
* @param context {Context} context (Map) - AJAX context
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
function processResponse(request: XMLHttpRequest, context: Context): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
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
|
+
import { Config, DQ, XMLQuery } from "mona-dish";
|
|
17
|
+
import { IResponseProcessor } from "./IResponseProcessor";
|
|
18
|
+
/**
|
|
19
|
+
* Response processor
|
|
20
|
+
*
|
|
21
|
+
* Each XML tag is either a node or a leaf
|
|
22
|
+
* or both
|
|
23
|
+
*
|
|
24
|
+
* the processor provides a set of operations
|
|
25
|
+
* which are executed on a single leaf node per operation
|
|
26
|
+
* and present the core functionality of our response
|
|
27
|
+
*
|
|
28
|
+
* Note the response processor is stateful hence we bundle it in a class
|
|
29
|
+
* to reduce code we keep references tot contexts in place
|
|
30
|
+
*/
|
|
31
|
+
export declare class ResponseProcessor implements IResponseProcessor {
|
|
32
|
+
private request;
|
|
33
|
+
private externalContext;
|
|
34
|
+
private internalContext;
|
|
35
|
+
constructor(request: Config, externalContext: Config, internalContext: Config);
|
|
36
|
+
/**
|
|
37
|
+
* head replacement
|
|
38
|
+
* @param shadowDocument incoming shadow head data (aka cdata as xml reference or dom element)
|
|
39
|
+
* the data incoming must represent the html representation of the head itself one way or the other
|
|
40
|
+
*/
|
|
41
|
+
replaceHead(shadowDocument: XMLQuery | DQ): void;
|
|
42
|
+
addToHead(shadowHead: XMLQuery | DQ): void;
|
|
43
|
+
addToHeadDeferred(newElements: XMLQuery | DQ): void;
|
|
44
|
+
/**
|
|
45
|
+
* replaces the body in the expected manner
|
|
46
|
+
* which means the entire body content is refreshed
|
|
47
|
+
* however also the body attributes must be transferred
|
|
48
|
+
* keeping event handlers etc... in place
|
|
49
|
+
*
|
|
50
|
+
* @param shadowDocument .. an incoming shadow document hosting the new nodes
|
|
51
|
+
*/
|
|
52
|
+
replaceBody(shadowDocument: XMLQuery | DQ): void;
|
|
53
|
+
/**
|
|
54
|
+
* Leaf Tag eval... process whatever is in the eval cdata block
|
|
55
|
+
*
|
|
56
|
+
* @param node the node to eval
|
|
57
|
+
*/
|
|
58
|
+
eval(node: XMLQuery): void;
|
|
59
|
+
/**
|
|
60
|
+
* processes an incoming error from the response
|
|
61
|
+
* which is hosted under the <error> tag
|
|
62
|
+
* @param node the node hosting the error in our response xml
|
|
63
|
+
* @param node the node in the xml hosting the error message
|
|
64
|
+
*/
|
|
65
|
+
error(node: XMLQuery): void;
|
|
66
|
+
/**
|
|
67
|
+
* process the redirect operation
|
|
68
|
+
*
|
|
69
|
+
* @param node
|
|
70
|
+
*/
|
|
71
|
+
redirect(node: XMLQuery): void;
|
|
72
|
+
/**
|
|
73
|
+
* processes the update operation and updates the node with the cdata block
|
|
74
|
+
* @param node the xml response node hosting the update info
|
|
75
|
+
* @param cdataBlock the cdata block with the new html code
|
|
76
|
+
*/
|
|
77
|
+
update(node: XMLQuery, cdataBlock: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Delete handler, simply deletes the node referenced by the xml data
|
|
80
|
+
* @param node
|
|
81
|
+
*/
|
|
82
|
+
delete(node: XMLQuery): void;
|
|
83
|
+
/**
|
|
84
|
+
* attributes leaf tag... process the attributes
|
|
85
|
+
*
|
|
86
|
+
* @param node
|
|
87
|
+
*/
|
|
88
|
+
attributes(node: XMLQuery): void;
|
|
89
|
+
/**
|
|
90
|
+
* @param shadowDocument a shadow document which is needed for further processing
|
|
91
|
+
*/
|
|
92
|
+
replaceViewRoot(shadowDocument: XMLQuery): void;
|
|
93
|
+
/**
|
|
94
|
+
* Insert handling, either before or after
|
|
95
|
+
*
|
|
96
|
+
* @param node
|
|
97
|
+
*/
|
|
98
|
+
insert(node: XMLQuery): void;
|
|
99
|
+
/**
|
|
100
|
+
* Handler for the case <insert << before id="...
|
|
101
|
+
*
|
|
102
|
+
* @param node the node hosting the insert data
|
|
103
|
+
*/
|
|
104
|
+
insertWithSubTags(node: XMLQuery): void;
|
|
105
|
+
/**
|
|
106
|
+
* Process the viewState update, update the affected
|
|
107
|
+
* forms with their respective new viewState values
|
|
108
|
+
*
|
|
109
|
+
*/
|
|
110
|
+
processViewState(node: XMLQuery): boolean;
|
|
111
|
+
processClientWindow(node: XMLQuery): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* generic global eval which runs the embedded css and scripts
|
|
114
|
+
*/
|
|
115
|
+
globalEval(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Postprocessing view state fixing
|
|
118
|
+
* this appends basically the incoming view states to the forms.
|
|
119
|
+
* It is called from outside after all forms have been processed basically
|
|
120
|
+
* as last lifecycle step, before going into the next request.
|
|
121
|
+
*/
|
|
122
|
+
fixViewStates(): void;
|
|
123
|
+
/**
|
|
124
|
+
* same as with view states before applies the incoming client windows as last step after the rest of the processing
|
|
125
|
+
* is done.
|
|
126
|
+
*/
|
|
127
|
+
fixClientWindow(): void;
|
|
128
|
+
updateNamedViewRootState(): void;
|
|
129
|
+
/**
|
|
130
|
+
* all processing done we can close the request and send the appropriate events
|
|
131
|
+
*/
|
|
132
|
+
done(): void;
|
|
133
|
+
/**
|
|
134
|
+
* proper viewState -> form assignment
|
|
135
|
+
*
|
|
136
|
+
* @param forms the forms to append the viewState to
|
|
137
|
+
* @param viewState the final viewState
|
|
138
|
+
* @param namingContainerId
|
|
139
|
+
*/
|
|
140
|
+
private appendViewStateToForms;
|
|
141
|
+
/**
|
|
142
|
+
* proper clientWindow -> form assignment
|
|
143
|
+
*
|
|
144
|
+
* @param forms the forms to append the viewState to
|
|
145
|
+
* @param clientWindow the final viewState
|
|
146
|
+
* @param namingContainerId
|
|
147
|
+
*/
|
|
148
|
+
private appendClientWindowToForms;
|
|
149
|
+
/**
|
|
150
|
+
* generic append state which appends a certain state as hidden element to an existing set of forms
|
|
151
|
+
*
|
|
152
|
+
* @param forms the forms to append or change to
|
|
153
|
+
* @param selector the selector for the state
|
|
154
|
+
* @param namedViewRoot if set to true, the name is also prefixed
|
|
155
|
+
* @param state the state itself which needs to be assigned
|
|
156
|
+
*
|
|
157
|
+
* @param namingContainerId
|
|
158
|
+
* @private
|
|
159
|
+
*/
|
|
160
|
+
private assignState;
|
|
161
|
+
/**
|
|
162
|
+
* Stores certain aspects of the dom for later post-processing
|
|
163
|
+
*
|
|
164
|
+
* @param updateForms the update forms which should receive standardized internal jsf data
|
|
165
|
+
* @param toBeEvaluated the resulting elements which should be evaluated
|
|
166
|
+
*/
|
|
167
|
+
private storeForPostProcessing;
|
|
168
|
+
/**
|
|
169
|
+
* helper to store a given form for the update post-processing (viewState)
|
|
170
|
+
*
|
|
171
|
+
* @param updateForms the dom query object pointing to the forms which need to be updated
|
|
172
|
+
*/
|
|
173
|
+
private storeForUpdate;
|
|
174
|
+
/**
|
|
175
|
+
* same for eval (js and css)
|
|
176
|
+
*
|
|
177
|
+
* @param toBeEvaluated
|
|
178
|
+
*/
|
|
179
|
+
private storeForEval;
|
|
180
|
+
/**
|
|
181
|
+
* check whether a given XMLQuery node is an explicit viewState node
|
|
182
|
+
*
|
|
183
|
+
* @param node the node to check
|
|
184
|
+
* @returns if it is a viewState node
|
|
185
|
+
*/
|
|
186
|
+
private static isViewStateNode;
|
|
187
|
+
/**
|
|
188
|
+
* incoming client window node also needs special processing
|
|
189
|
+
*
|
|
190
|
+
* @param node the node to check
|
|
191
|
+
* @returns true of it ii
|
|
192
|
+
*/
|
|
193
|
+
private static isClientWindowNode;
|
|
194
|
+
private triggerOnError;
|
|
195
|
+
/**
|
|
196
|
+
* filters the forms according to being member of the "execute" or "render" cycle
|
|
197
|
+
* @param affectedForm
|
|
198
|
+
* @private
|
|
199
|
+
*/
|
|
200
|
+
private isInExecuteOrRender;
|
|
201
|
+
/**
|
|
202
|
+
* gets all forms under a single naming container id
|
|
203
|
+
* @param namingContainerId
|
|
204
|
+
* @private
|
|
205
|
+
*/
|
|
206
|
+
private getContainerForms;
|
|
207
|
+
private getNameOrIdSelector;
|
|
208
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
import { Config, DQ } from "mona-dish";
|
|
17
|
+
type ParamsMapper<V, K> = (key: V, item: K) => [V, K];
|
|
18
|
+
/**
|
|
19
|
+
* A unified form data class
|
|
20
|
+
* which builds upon our configuration.
|
|
21
|
+
*
|
|
22
|
+
* We cannot use standard html5 forms everywhere
|
|
23
|
+
* due to api constraints on the HTML Form object in IE11
|
|
24
|
+
* and due to the url encoding constraint given by the faces.js spec
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* internal storage format
|
|
28
|
+
* every value is stored as an array
|
|
29
|
+
* even scalar ones!
|
|
30
|
+
*/
|
|
31
|
+
export declare class XhrFormData extends Config {
|
|
32
|
+
private dataSource;
|
|
33
|
+
private paramsMapper;
|
|
34
|
+
private partialIds?;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if the given datasource is a multipart request source
|
|
37
|
+
* multipart is only needed if one of the executes is a file input
|
|
38
|
+
* since file inputs are stateless, they fall out of the view state
|
|
39
|
+
* and need special handling. With file submits we have to send a formData object
|
|
40
|
+
* instead of an encoded string files cannot be sent that way
|
|
41
|
+
*/
|
|
42
|
+
isMultipartRequest: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* data collector from a given form
|
|
45
|
+
*
|
|
46
|
+
* @param dataSource either a form as DomQuery object or an encoded url string
|
|
47
|
+
* @param paramsMapper a remapper for the params keys and values
|
|
48
|
+
* @param executes the executes id list for the elements to being processed
|
|
49
|
+
* @param partialIds partial ids to collect, to reduce the data sent down
|
|
50
|
+
*/
|
|
51
|
+
constructor(dataSource: DQ, paramsMapper?: ParamsMapper<string, any>, executes?: string[], partialIds?: string[]);
|
|
52
|
+
/**
|
|
53
|
+
* @returns a Form data representation, this is needed for file submits
|
|
54
|
+
*/
|
|
55
|
+
toFormData(): FormData;
|
|
56
|
+
/**
|
|
57
|
+
* returns an encoded string representation of our xhr form data
|
|
58
|
+
*
|
|
59
|
+
* @param defaultStr optional default value if nothing is there to encode
|
|
60
|
+
*/
|
|
61
|
+
toString(defaultStr?: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* generic post init code, for now, this performs some post assign data post-processing
|
|
64
|
+
* @param rootElement the root element which knows the request type (usually a form)
|
|
65
|
+
* @param executes the executable dom nodes which need to be processed into the form data, which we can send
|
|
66
|
+
* in our ajax request
|
|
67
|
+
*/
|
|
68
|
+
private resolveRequestType;
|
|
69
|
+
/**
|
|
70
|
+
* special case view state handling
|
|
71
|
+
*
|
|
72
|
+
* @param form the form holding the view state value
|
|
73
|
+
*/
|
|
74
|
+
private applyViewState;
|
|
75
|
+
/**
|
|
76
|
+
* determines fields to submit
|
|
77
|
+
* @param {Node} parentItem - form element item is nested in
|
|
78
|
+
* @param {Array} partialIds - ids fo PPS
|
|
79
|
+
*/
|
|
80
|
+
private encodeSubmittableFields;
|
|
81
|
+
private remapKeyForNamingContainer;
|
|
82
|
+
}
|
|
83
|
+
export {};
|