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.
Files changed (188) hide show
  1. package/dist/docs/assets/style.css +4 -5
  2. package/dist/window/faces-development.js +111 -91
  3. package/dist/window/faces-development.js.br +0 -0
  4. package/dist/window/faces-development.js.gz +0 -0
  5. package/dist/window/faces-development.js.map +1 -1
  6. package/dist/window/faces.js +1 -1
  7. package/dist/window/faces.js.br +0 -0
  8. package/dist/window/faces.js.gz +0 -0
  9. package/dist/window/faces.js.map +1 -1
  10. package/dist/window/jsf-development.js +111 -91
  11. package/dist/window/jsf-development.js.br +0 -0
  12. package/dist/window/jsf-development.js.gz +0 -0
  13. package/dist/window/jsf-development.js.map +1 -1
  14. package/dist/window/jsf.js +1 -1
  15. package/dist/window/jsf.js.br +0 -0
  16. package/dist/window/jsf.js.gz +0 -0
  17. package/dist/window/jsf.js.map +1 -1
  18. package/package.json +10 -10
  19. package/src/main/typescript/impl/util/XhrQueueController.ts +3 -17
  20. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +94 -51
  21. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -1
  22. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +126 -0
  23. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +60 -0
  24. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/bootstrap-icons.css +15 -0
  25. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/tobago.css +15 -0
  26. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +15 -0
  27. package/src/main/typescript/test/myfaces/{OnLoadSpec.ts → OnLoad.spec.ts} +2 -2
  28. package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +136 -0
  29. package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +9 -12
  30. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +1 -1
  31. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +18 -0
  32. package/target/AssocArray.js +281 -0
  33. package/target/AssocArray.js.map +1 -0
  34. package/target/Config.js +235 -0
  35. package/target/Config.js.map +1 -0
  36. package/target/CryptoExtensions.js +112 -0
  37. package/target/CryptoExtensions.js.map +1 -0
  38. package/target/DomQuery.js +1963 -0
  39. package/target/DomQuery.js.map +1 -0
  40. package/target/Es2019Array.js +117 -0
  41. package/target/Es2019Array.js.map +1 -0
  42. package/target/Global.js +38 -0
  43. package/target/Global.js.map +1 -0
  44. package/target/IDomQuery.js +3 -0
  45. package/target/IDomQuery.js.map +1 -0
  46. package/target/Lang.js +183 -0
  47. package/target/Lang.js.map +1 -0
  48. package/target/Messaging.js +645 -0
  49. package/target/Messaging.js.map +1 -0
  50. package/target/Monad.js +330 -0
  51. package/target/Monad.js.map +1 -0
  52. package/target/Promise.js +296 -0
  53. package/target/Promise.js.map +1 -0
  54. package/target/PromiseShim.js +30 -0
  55. package/target/PromiseShim.js.map +1 -0
  56. package/target/SourcesCollectors.js +444 -0
  57. package/target/SourcesCollectors.js.map +1 -0
  58. package/target/Stream.js +562 -0
  59. package/target/Stream.js.map +1 -0
  60. package/target/TagBuilder.js +178 -0
  61. package/target/TagBuilder.js.map +1 -0
  62. package/target/XmlQuery.js +84 -0
  63. package/target/XmlQuery.js.map +1 -0
  64. package/target/impl/util/XhrQueueController.js +3 -18
  65. package/target/impl/util/XhrQueueController.js.map +1 -1
  66. package/target/impl/xhrCore/XhrRequest.js +89 -45
  67. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  68. package/target/index.js +80 -0
  69. package/target/index.js.map +1 -0
  70. package/target/index_core.js +76 -0
  71. package/target/index_core.js.map +1 -0
  72. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +1 -1
  73. package/target/test/frameworkBase/_ext/shared/StandardInits.js +124 -0
  74. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  75. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +57 -1
  76. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  77. package/target/test/myfaces/OnLoad.spec.js +57 -0
  78. package/target/test/myfaces/OnLoad.spec.js.map +1 -0
  79. package/target/test/myfaces/OnLoadSpec.js +2 -2
  80. package/target/test/myfaces/OnLoadSpec.js.map +1 -1
  81. package/target/test/xhrCore/ErrorChainTest.spec.js +156 -0
  82. package/target/test/xhrCore/ErrorChainTest.spec.js.map +1 -0
  83. package/target/test/xhrCore/NamespacesRequestTest.spec.js +8 -5
  84. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
  85. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  86. package/target/test/xhrCore/ResponseTest23.spec.js +13 -0
  87. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  88. package/target/types/main/typescript/AssocArray.d.ts +86 -0
  89. package/target/types/main/typescript/Config.d.ts +94 -0
  90. package/target/types/main/typescript/CryptoExtensions.d.ts +87 -0
  91. package/target/types/main/typescript/DomQuery.d.ts +587 -0
  92. package/target/types/main/typescript/Es2019Array.d.ts +30 -0
  93. package/target/types/main/typescript/Global.d.ts +23 -0
  94. package/target/types/main/typescript/IDomQuery.d.ts +480 -0
  95. package/target/types/main/typescript/Lang.d.ts +97 -0
  96. package/target/types/main/typescript/Messaging.d.ts +285 -0
  97. package/target/types/main/typescript/Monad.d.ts +161 -0
  98. package/target/types/main/typescript/Promise.d.ts +58 -0
  99. package/target/types/main/typescript/PromiseShim.d.ts +22 -0
  100. package/target/types/main/typescript/SourcesCollectors.d.ts +280 -0
  101. package/target/types/main/typescript/Stream.d.ts +284 -0
  102. package/target/types/main/typescript/TagBuilder.d.ts +50 -0
  103. package/target/types/main/typescript/XmlQuery.d.ts +31 -0
  104. package/target/types/main/typescript/api/_api.d.ts +182 -0
  105. package/target/types/main/typescript/api/faces.d.ts +17 -0
  106. package/target/types/main/typescript/api/jsf.d.ts +17 -0
  107. package/target/types/main/typescript/impl/AjaxImpl.d.ts +164 -0
  108. package/target/types/main/typescript/impl/PushImpl.d.ts +38 -0
  109. package/target/types/main/typescript/impl/core/Const.d.ts +138 -0
  110. package/target/types/main/typescript/impl/core/ImplTypes.d.ts +16 -0
  111. package/target/types/main/typescript/impl/i18n/Messages.d.ts +102 -0
  112. package/target/types/main/typescript/impl/util/Assertions.d.ts +46 -0
  113. package/target/types/main/typescript/impl/util/AsyncRunnable.d.ts +112 -0
  114. package/target/types/main/typescript/impl/util/ExtDomQuery.d.ts +100 -0
  115. package/target/types/main/typescript/impl/util/FileUtils.d.ts +25 -0
  116. package/target/types/main/typescript/impl/util/HiddenInputBuilder.d.ts +37 -0
  117. package/target/types/main/typescript/impl/util/IListener.d.ts +18 -0
  118. package/target/types/main/typescript/impl/util/Lang.d.ts +138 -0
  119. package/target/types/main/typescript/impl/util/XhrQueueController.d.ts +51 -0
  120. package/target/types/main/typescript/impl/xhrCore/ErrorData.d.ts +37 -0
  121. package/target/types/main/typescript/impl/xhrCore/EventData.d.ts +25 -0
  122. package/target/types/main/typescript/impl/xhrCore/IResponseProcessor.d.ts +136 -0
  123. package/target/types/main/typescript/impl/xhrCore/RequestDataResolver.d.ts +84 -0
  124. package/target/types/main/typescript/impl/xhrCore/ResonseDataResolver.d.ts +60 -0
  125. package/target/types/main/typescript/impl/xhrCore/Response.d.ts +29 -0
  126. package/target/types/main/typescript/impl/xhrCore/ResponseProcessor.d.ts +208 -0
  127. package/target/types/main/typescript/impl/xhrCore/XhrFormData.d.ts +83 -0
  128. package/target/types/main/typescript/impl/xhrCore/XhrRequest.d.ts +102 -0
  129. package/target/types/main/typescript/index.d.ts +34 -0
  130. package/target/types/main/typescript/index_core.d.ts +29 -0
  131. package/target/types/main/typescript/myfaces/OamSubmit.d.ts +53 -0
  132. package/target/types/main/typescript/test/frameworkBase/LangTest.spec.d.ts +1 -0
  133. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.d.ts +1 -0
  134. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.d.ts +16 -0
  135. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.d.ts +39 -0
  136. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.d.ts +16 -0
  137. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.d.ts +16 -0
  138. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.d.ts +0 -0
  139. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.d.ts +1 -0
  140. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.d.ts +1 -0
  141. package/target/types/main/typescript/test/frameworkBase/_ext/shared/StandardInits.d.ts +63 -0
  142. package/target/types/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.d.ts +23 -0
  143. package/target/types/main/typescript/test/impl/ImplTest.spec.d.ts +16 -0
  144. package/target/types/main/typescript/test/impl/ImplTest_23.spec.d.ts +16 -0
  145. package/target/types/main/typescript/test/impl/SeparatorCharsTest.spec.d.ts +16 -0
  146. package/target/types/main/typescript/test/myfaces/OamSubmit.spec.d.ts +16 -0
  147. package/target/types/main/typescript/test/myfaces/OnLoad.spec.d.ts +16 -0
  148. package/target/types/main/typescript/test/queue/AsynchronousProbe.d.ts +38 -0
  149. package/target/types/main/typescript/test/queue/AsynchronousQueueTest.spec.d.ts +16 -0
  150. package/target/types/main/typescript/test/xhrCore/ClientWindow.spec.d.ts +1 -0
  151. package/target/types/main/typescript/test/xhrCore/ErrorChainTest.spec.d.ts +16 -0
  152. package/target/types/main/typescript/test/xhrCore/EventTests.spec.d.ts +16 -0
  153. package/target/types/main/typescript/test/xhrCore/FakeWebsocket.d.ts +24 -0
  154. package/target/types/main/typescript/test/xhrCore/FileUploadTest.spec.d.ts +1 -0
  155. package/target/types/main/typescript/test/xhrCore/NamespacesRequestTest.spec.d.ts +16 -0
  156. package/target/types/main/typescript/test/xhrCore/OamSubmitTest.spec.d.ts +16 -0
  157. package/target/types/main/typescript/test/xhrCore/RequestParamsTest.spec.d.ts +1 -0
  158. package/target/types/main/typescript/test/xhrCore/RequestTest.spec.d.ts +16 -0
  159. package/target/types/main/typescript/test/xhrCore/RequestTest_23.spec.d.ts +16 -0
  160. package/target/types/main/typescript/test/xhrCore/ResponseTest.spec.d.ts +16 -0
  161. package/target/types/main/typescript/test/xhrCore/ResponseTest23.spec.d.ts +16 -0
  162. package/target/types/main/typescript/test/xhrCore/ShadowDomTest.spec.d.ts +16 -0
  163. package/target/types/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.d.ts +1 -0
  164. package/target/types/main/typescript/test/xhrCore/WebsocketTest.d.ts +1 -0
  165. package/target/types/main/typescript/test/xhrCore/XhrFormDataTest.spec.d.ts +16 -0
  166. package/target/types/test/typescript/AssocArrayTest.spec.d.ts +1 -0
  167. package/target/types/test/typescript/DomQueryTest.spec.d.ts +1 -0
  168. package/target/types/test/typescript/ExtendedArrayTest.spec.d.ts +1 -0
  169. package/target/types/test/typescript/LangTest.spec.d.ts +1 -0
  170. package/target/types/test/typescript/MappingProbes.d.ts +24 -0
  171. package/target/types/test/typescript/MappingTest.spec.d.ts +1 -0
  172. package/target/types/test/typescript/MessagingTest.spec.d.ts +1 -0
  173. package/target/types/test/typescript/MonadTest.spec.d.ts +16 -0
  174. package/target/types/test/typescript/PromiseTest.spec.d.ts +1 -0
  175. package/target/types/test/typescript/StreamTest.spec.d.ts +1 -0
  176. package/target/types/test/typescript/XmlQueryTest.spec.d.ts +1 -0
  177. package/target/types/test/typescript/markups/tobago-with-header.d.ts +1 -0
  178. package/target/types/test/typescript/markups/tobago-without-header.d.ts +1 -0
  179. package/webpack.config.js +1 -1
  180. package/webpack.config.js.map +1 -1
  181. package/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
  182. package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
  183. package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
  184. package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
  185. package/.nyc_output/processinfo/index.json +0 -1
  186. package/src/test.html +0 -75
  187. package/src/tmp/test.html +0 -16
  188. package/tmp.xml +0 -36
@@ -0,0 +1,587 @@
1
+ /*!
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
+ import { Optional, ValueEmbedder } from "./Monad";
18
+ import { XMLQuery } from "./XmlQuery";
19
+ import { ICollector, IStreamDataSource, ITERATION_STATUS } from "./SourcesCollectors";
20
+ import { _global$ } from "./Global";
21
+ import { IDomQuery } from "./IDomQuery";
22
+ /**
23
+ * in order to poss custom parameters we need to extend the mutation observer init
24
+ */
25
+ export interface WAIT_OPTS extends MutationObserverInit {
26
+ timeout?: number;
27
+ /**
28
+ * interval on non legacy browsers
29
+ */
30
+ interval?: number;
31
+ }
32
+ export declare class ElementAttribute extends ValueEmbedder<string> {
33
+ private element;
34
+ private name;
35
+ private defaultVal;
36
+ constructor(element: DomQuery, name: string, defaultVal?: string);
37
+ get value(): string;
38
+ set value(value: string);
39
+ protected getClass(): any;
40
+ static fromNullable<ElementAttribute, T>(value?: any, valueKey?: string): ElementAttribute;
41
+ }
42
+ export declare class Style extends ValueEmbedder<string> {
43
+ private element;
44
+ private name;
45
+ private defaultVal;
46
+ constructor(element: DomQuery, name: string, defaultVal?: string);
47
+ get value(): string;
48
+ set value(value: string);
49
+ protected getClass(): any;
50
+ static fromNullable<ElementAttribute, T>(value?: any, valueKey?: string): ElementAttribute;
51
+ }
52
+ /**
53
+ * Monadic DomNode representation, ala jquery
54
+ * This is a thin wrapper over querySelectorAll
55
+ * to get slim monadic support
56
+ * to reduce implementation code on the users side.
57
+ * This is vital for frameworks which want to rely on
58
+ * plain dom but still do not want to lose
59
+ * the reduced code footprint of querying dom trees and traversing
60
+ * by using functional patterns.
61
+ *
62
+ * Also, a few convenience methods are added to reduce
63
+ * the code footprint of standard dom processing
64
+ * operations like eval
65
+ *
66
+ * in most older systems
67
+ * Note parts of this code still stem from the Dom.js I have written 10 years
68
+ * ago, those parts look a bit ancient and will be replaced over time.
69
+ *
70
+ */
71
+ export declare class DomQuery implements IDomQuery, IStreamDataSource<DomQuery>, Iterable<DomQuery> {
72
+ static absent: DomQuery;
73
+ /**
74
+ * reference to the environmental global object
75
+ */
76
+ static global: typeof _global$;
77
+ private rootNode;
78
+ pos: number;
79
+ constructor(...rootNode: Array<Element | ShadowRoot | DomQuery | Document | Array<any> | string>);
80
+ /**
81
+ * returns the first element
82
+ */
83
+ get value(): Optional<Element>;
84
+ get values(): Element[];
85
+ get global(): any;
86
+ get stream(): any;
87
+ get lazyStream(): any;
88
+ /**
89
+ * returns the id of the first element
90
+ */
91
+ get id(): ValueEmbedder<string>;
92
+ /**
93
+ * length of the entire query set
94
+ */
95
+ get length(): number;
96
+ /**
97
+ * convenience method for tagName
98
+ */
99
+ get tagName(): Optional<string>;
100
+ /**
101
+ * convenience method for nodeName
102
+ */
103
+ get nodeName(): Optional<string>;
104
+ isTag(tagName: string): boolean;
105
+ /**
106
+ * convenience property for type
107
+ *
108
+ * returns null in case of no type existing otherwise
109
+ * the type of the first element
110
+ */
111
+ get type(): Optional<string>;
112
+ /**
113
+ * convenience property for name
114
+ *
115
+ * returns null in case of no type existing otherwise
116
+ * the name of the first element
117
+ */
118
+ get name(): ValueEmbedder<string>;
119
+ /**
120
+ * convenience property for value
121
+ *
122
+ * returns null in case of no type existing otherwise
123
+ * the value of the first element
124
+ */
125
+ get inputValue(): ValueEmbedder<string | boolean>;
126
+ get val(): string | boolean;
127
+ set val(value: string | boolean);
128
+ get nodeId(): string;
129
+ set nodeId(value: string);
130
+ get checked(): boolean;
131
+ set checked(newChecked: boolean);
132
+ get elements(): DomQuery;
133
+ get deepElements(): DomQuery;
134
+ /**
135
+ * a deep search which treats the single isolated shadow dom areas
136
+ * separately and runs the query on each shadow dom
137
+ * @param queryStr
138
+ */
139
+ querySelectorAllDeep(queryStr: string): DomQuery;
140
+ /**
141
+ * disabled flag
142
+ */
143
+ get disabled(): boolean;
144
+ set disabled(disabled: boolean);
145
+ removeAttribute(name: string): void;
146
+ get childNodes(): DomQuery;
147
+ get asArray(): DomQuery[];
148
+ get offsetWidth(): number;
149
+ get offsetHeight(): number;
150
+ get offsetLeft(): number;
151
+ get offsetTop(): number;
152
+ get asNodeArray(): Array<Element>;
153
+ static querySelectorAllDeep(selector: string): DomQuery;
154
+ /**
155
+ * easy query selector all producer
156
+ *
157
+ * @param selector the selector
158
+ * @returns a results dom query object
159
+ */
160
+ static querySelectorAll(selector: string): DomQuery;
161
+ /**
162
+ * byId producer
163
+ *
164
+ * @param selector id
165
+ * @param deep true if you want to go into shadow areas
166
+ * @return a DomQuery containing the found elements
167
+ */
168
+ static byId(selector: string | DomQuery | Element, deep?: boolean): DomQuery;
169
+ /**
170
+ * byTagName producer
171
+ *
172
+ * @param selector name
173
+ * @return a DomQuery containing the found elements
174
+ */
175
+ static byTagName(selector: string | DomQuery | Element): DomQuery;
176
+ static globalEval(code: string, nonce?: string): DomQuery;
177
+ static globalEvalSticky(code: string, nonce?: string): DomQuery;
178
+ /**
179
+ * builds the ie nodes properly in a placeholder
180
+ * and bypasses a non script insert bug that way
181
+ * @param markup the markup code to be executed from
182
+ */
183
+ static fromMarkup(markup: string): DomQuery;
184
+ /**
185
+ * returns the nth element as DomQuery
186
+ * from the internal elements
187
+ * note if you try to reach a non-existing element position
188
+ * you will get back an absent entry
189
+ *
190
+ * @param index the nth index
191
+ */
192
+ get(index: number): DomQuery;
193
+ /**
194
+ * returns the nth element as optional of an Element object
195
+ * @param index the number from the index
196
+ * @param defaults the default value if the index is overrun default Optional\.absent
197
+ */
198
+ getAsElem(index: number, defaults?: Optional<any>): Optional<Element>;
199
+ /**
200
+ * returns the files from a given element
201
+ * @param index
202
+ */
203
+ filesFromElem(index: number): Array<any>;
204
+ /**
205
+ * returns the value array< of all elements
206
+ */
207
+ allElems(): Array<Element>;
208
+ /**
209
+ * absent no values reached?
210
+ */
211
+ isAbsent(): boolean;
212
+ /**
213
+ * should make the code clearer
214
+ * note if you pass a function
215
+ * this refers to the active DomQuery object
216
+ */
217
+ isPresent(presentRunnable?: (elem?: DomQuery) => void): boolean;
218
+ /**
219
+ * should make the code clearer
220
+ * note if you pass a function
221
+ * this refers to the active DomQuery object
222
+ *
223
+ *
224
+ * @param presentRunnable
225
+ */
226
+ ifPresentLazy(presentRunnable?: (elem?: DomQuery) => void): DomQuery;
227
+ /**
228
+ * remove all affected nodes from this query object from the dom tree
229
+ */
230
+ delete(): void;
231
+ querySelectorAll(selector: any): DomQuery;
232
+ closest(selector: any): DomQuery;
233
+ /**
234
+ * core byId method
235
+ * @param id the id to search for
236
+ * @param includeRoot also match the root element?
237
+ */
238
+ byId(id: string, includeRoot?: boolean): DomQuery;
239
+ byIdDeep(id: string, includeRoot?: boolean): DomQuery;
240
+ /**
241
+ * same as byId just for the tag name
242
+ * @param tagName the tag-name to search for
243
+ * @param includeRoot shall the root element be part of this search
244
+ * @param deep do we also want to go into shadow dom areas
245
+ */
246
+ byTagName(tagName: string, includeRoot?: boolean, deep?: boolean): DomQuery;
247
+ /**
248
+ * attr accessor, usage myQuery.attr("class").value = "bla"
249
+ * or let value myQuery.attr("class").value
250
+ * @param attr the attribute to set
251
+ * @param defaultValue the default value in case nothing is presented (defaults to null)
252
+ */
253
+ attr(attr: string, defaultValue?: string): ElementAttribute;
254
+ style(cssProperty: string, defaultValue?: string): Style;
255
+ /**
256
+ * Checks for an existing class in the class attributes
257
+ *
258
+ * @param clazz the class to search for
259
+ */
260
+ hasClass(clazz: string): boolean;
261
+ /**
262
+ * appends a class string if not already in the element(s)
263
+ *
264
+ * @param clazz the style class to append
265
+ */
266
+ addClass(clazz: string): DomQuery;
267
+ /**
268
+ * remove the style class if in the class definitions
269
+ *
270
+ * @param clazz
271
+ */
272
+ removeClass(clazz: string): DomQuery;
273
+ /**
274
+ * checks whether we have a multipart element in our children
275
+ * or are one
276
+ */
277
+ isMultipartCandidate(deep?: boolean): boolean;
278
+ /**
279
+ * innerHtml
280
+ * equivalent to jQueries html
281
+ * as setter the html is set and the
282
+ * DomQuery is given back
283
+ * as getter the html string is returned
284
+ *
285
+ * @param newInnerHTML the inner html to be inserted
286
+ */
287
+ html(newInnerHTML?: string): DomQuery | Optional<string>;
288
+ /**
289
+ * Standard dispatch event method, delegated from node
290
+ */
291
+ dispatchEvent(evt: Event): DomQuery;
292
+ /**
293
+ * abbreviation property to use innerHTML directly like on the dom tree
294
+ * @param newInnerHTML the new inner html which should be attached to "this" domQuery
295
+ */
296
+ set innerHTML(newInnerHTML: string);
297
+ /**
298
+ * getter abbreviation to use innerHTML directly
299
+ */
300
+ get innerHTML(): string;
301
+ /**
302
+ * since the dom allows both innerHTML and innerHtml we also have to implement both
303
+ * @param newInnerHtml see above
304
+ */
305
+ set innerHtml(newInnerHtml: string);
306
+ /**
307
+ * same here, getter for allowing innerHtml directly
308
+ */
309
+ get innerHtml(): string;
310
+ /**
311
+ * filters the current dom query elements
312
+ * upon a given selector
313
+ *
314
+ * @param selector
315
+ */
316
+ filterSelector(selector: string): DomQuery;
317
+ /**
318
+ * checks whether any item in this domQuery level matches the selector
319
+ * if there is one element only attached, as root the match is only
320
+ * performed on this element.
321
+ * @param selector
322
+ */
323
+ matchesSelector(selector: string): boolean;
324
+ /**
325
+ * easy node traversal, you can pass
326
+ * a set of node selectors which are joined as direct children
327
+ *
328
+ * Note!!! The root nodes are not in the getIf, those are always the child nodes
329
+ *
330
+ * @param nodeSelector
331
+ */
332
+ getIf(...nodeSelector: Array<string>): DomQuery;
333
+ eachElem(func: (item: Element, cnt?: number) => any): DomQuery;
334
+ firstElem(func?: (item: Element, cnt?: number) => any): DomQuery;
335
+ lastElem(func?: (item: Element, cnt?: number) => any): DomQuery;
336
+ each(func: (item: DomQuery, cnt?: number) => any): DomQuery;
337
+ /**
338
+ * replace convenience function, replaces one or more elements with
339
+ * a set of elements passed as DomQuery
340
+ * @param toReplace the replaced nodes as reference (original node has been replaced)
341
+ */
342
+ replace(toReplace: DomQuery): DomQuery;
343
+ /**
344
+ * returns a new dom query containing only the first element max
345
+ *
346
+ * @param func a an optional callback function to perform an operation on the first element
347
+ */
348
+ first(func?: (item: DomQuery, cnt?: number) => any): DomQuery;
349
+ /**
350
+ * returns a new dom query containing only the first element max
351
+ *
352
+ * @param func a an optional callback function to perform an operation on the first element
353
+ */
354
+ last(func?: (item: DomQuery, cnt?: number) => any): DomQuery;
355
+ /**
356
+ * filter function which filters a subset
357
+ *
358
+ * @param func
359
+ */
360
+ filter(func: (item: DomQuery) => boolean): DomQuery;
361
+ /**
362
+ * global eval head appendix method
363
+ * no other methods are supported anymore
364
+ * @param code the code to be evaluated
365
+ * @param nonce optional nonce key for higher security
366
+ */
367
+ globalEval(code: string, nonce?: string): DomQuery;
368
+ /**
369
+ * global eval head appendix method
370
+ * no other methods are supported anymore
371
+ * @param code the code to be evaluated
372
+ * @param nonce optional nonce key for higher security
373
+ */
374
+ globalEvalSticky(code: string, nonce?: string): DomQuery;
375
+ /**
376
+ * detaches a set of nodes from their parent elements
377
+ * in a browser independent manner
378
+ * @return {Array} an array of nodes with the detached dom nodes
379
+ */
380
+ detach(): DomQuery;
381
+ /**
382
+ * appends the current set of elements
383
+ * to the element or first element passed via elem
384
+ * @param elem
385
+ */
386
+ appendTo(elem: DomQuery | string): DomQuery;
387
+ /**
388
+ * loads and evaluates a script from a source uri
389
+ *
390
+ * @param src the source to be loaded and evaluated
391
+ * @param delay in milliseconds execution default (0 == no delay)
392
+ * @param nonce optional nonce value to allow increased security via nonce crypto token
393
+ */
394
+ loadScriptEval(src: string, delay?: number, nonce?: string): this;
395
+ /**
396
+ * loads and evaluates a script from a source uri
397
+ *
398
+ * @param src the source to be loaded and evaluated
399
+ * @param delay in milliseconds execution default (0 == no delay)
400
+ * @param nonce optional nonce parameter for increased security via nonce crypto token
401
+ */
402
+ loadScriptEvalSticky(src: string, delay?: number, nonce?: string): this;
403
+ insertAfter(...toInsertParams: Array<DomQuery>): DomQuery;
404
+ insertBefore(...toInsertParams: Array<DomQuery>): DomQuery;
405
+ orElse(...elseValue: any): DomQuery;
406
+ orElseLazy(func: () => any): DomQuery;
407
+ /**
408
+ * find all parents in the hierarchy for which the selector matches
409
+ * @param selector
410
+ */
411
+ allParents(selector: string): DomQuery;
412
+ /**
413
+ * finds the first parent in the hierarchy for which the selector matches
414
+ * @param selector
415
+ */
416
+ firstParent(selector: string): DomQuery;
417
+ /**
418
+ * fetches all parents as long as the filter criterium matches
419
+ * @param selector
420
+ */
421
+ parentsWhileMatch(selector: string): DomQuery;
422
+ parent(): DomQuery;
423
+ copyAttrs(sourceItem: DomQuery | XMLQuery): DomQuery;
424
+ /**
425
+ * outerHTML convenience method
426
+ * browsers only support innerHTML but
427
+ * for instance for your jsf.js we have a full
428
+ * replace pattern which needs outerHTML processing
429
+ *
430
+ * @param markup the markup which should replace the root element
431
+ * @param runEmbeddedScripts if true the embedded scripts are executed
432
+ * @param runEmbeddedCss if true the embedded css are executed
433
+ * @param deep should this also work for shadow dom (run scripts etc...)
434
+ */
435
+ outerHTML(markup: string, runEmbeddedScripts?: boolean, runEmbeddedCss?: boolean, deep?: boolean): DomQuery;
436
+ /**
437
+ * Run through the given nodes in the DomQuery execute the inline scripts
438
+ * @param sticky if set to true the evaluated elements will stick to the head, default false
439
+ * @param whitelisted: optional whitelist function which can filter out script tags which are not processed
440
+ * defaults to the standard jsf.js exclusion (we use this code for myfaces)
441
+ */
442
+ runScripts(sticky?: boolean, whitelisted?: (val: string) => boolean): DomQuery;
443
+ runCss(): DomQuery;
444
+ /**
445
+ * fires a click event on the underlying dom elements
446
+ */
447
+ click(): DomQuery;
448
+ addEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery;
449
+ removeEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery;
450
+ /**
451
+ * fires an event
452
+ */
453
+ fireEvent(eventName: string, options?: {
454
+ [key: string]: any;
455
+ }): void;
456
+ textContent(joinString?: string): string;
457
+ innerText(joinString?: string): string;
458
+ /**
459
+ * encodes all input elements properly into respective
460
+ * config entries, this can be used
461
+ * for legacy systems, for newer use-cases, use the
462
+ * HTML5 Form class which all newer browsers provide
463
+ *
464
+ * @param toMerge optional config which can be merged in
465
+ * @return a copy pf
466
+ */
467
+ encodeFormElement(toMerge?: {}): {
468
+ [key: string]: any;
469
+ };
470
+ get cDATAAsString(): string;
471
+ subNodes(from: number, to?: number): DomQuery;
472
+ _limits: number;
473
+ limits(end: number): DomQuery;
474
+ hasNext(): boolean;
475
+ next(): DomQuery;
476
+ lookAhead(cnt?: number): ITERATION_STATUS | DomQuery;
477
+ current(): DomQuery | ITERATION_STATUS;
478
+ reset(): void;
479
+ attachShadow(params?: {
480
+ [key: string]: string;
481
+ }): DomQuery;
482
+ /**
483
+ * helper to fix a common dom problem
484
+ * we have to wait until a certain condition is met, in most of the cases we just want to know whether an element is present in the sub dom-tree before being able to proceed
485
+ * @param condition
486
+ * @param options
487
+ */
488
+ waitUntilDom(condition: (element: DomQuery) => boolean, options?: WAIT_OPTS): Promise<DomQuery>;
489
+ /**
490
+ * returns the embedded shadow elements
491
+ */
492
+ get shadowElements(): DomQuery;
493
+ get shadowRoot(): DomQuery;
494
+ get hasShadow(): boolean;
495
+ static getCaretPosition(ctrl: any): number;
496
+ /**
497
+ * sets the caret position
498
+ *
499
+ * @param ctrl the control to set the caret position to
500
+ * @param pos the position to set
501
+ *
502
+ * note if the control does not have any selectable and focusable behavior
503
+ * calling this method does nothing (silent fail)
504
+ *
505
+ */
506
+ static setCaretPosition(ctrl: any, pos: number): void;
507
+ /**
508
+ * Implementation of an iterator
509
+ * to allow loops over dom query collections
510
+ */
511
+ [Symbol.iterator](): Iterator<DomQuery>;
512
+ /**
513
+ * Concatenates the elements of two Dom Queries into a single one
514
+ * @param toAttach the elements to attach
515
+ * @param filterDoubles filter out possible double elements (aka same markup)
516
+ */
517
+ concat(toAttach: DomQuery, filterDoubles?: boolean): DomQuery;
518
+ append(elem: DomQuery): DomQuery;
519
+ prependTo(elem: DomQuery): DomQuery;
520
+ prepend(elem: DomQuery): DomQuery;
521
+ /**
522
+ * query selector all on the existing dom queryX object
523
+ *
524
+ * @param selector the standard selector
525
+ * @return a DomQuery with the results
526
+ */
527
+ private _querySelectorAll;
528
+ private _querySelectorAllDeep;
529
+ /**
530
+ * query selector all on the existing dom queryX object
531
+ *
532
+ * @param selector the standard selector
533
+ * @return a DomQuery with the results
534
+ */
535
+ private _closest;
536
+ private _closestDeep;
537
+ /**
538
+ * matches selector call in a browser independent manner
539
+ *
540
+ * @param toMatch
541
+ * @param selector
542
+ * @private
543
+ */
544
+ private _mozMatchesSelector;
545
+ /**
546
+ * sticky non-sticky unified code of the load script eval
547
+ * implementation if programmatic &gt;script src="... loading
548
+ *
549
+ * @param sticky if set to true a head element is left in the dom tree after the script has loaded
550
+ *
551
+ * @param src the sec to load
552
+ * @param delay delay the script loading x ms (default immediately === 0)
553
+ * @param nonce optional nonce token to be passed into the script tag
554
+ * @private
555
+ */
556
+ private _loadScriptEval;
557
+ /**
558
+ * resolves an attribute holder compared
559
+ * @param attrName the attribute name
560
+ */
561
+ private resolveAttributeHolder;
562
+ private createSourceNode;
563
+ private applyNonce;
564
+ }
565
+ /**
566
+ * Various collectors
567
+ * which can be used in conjunction with Streams
568
+ */
569
+ /**
570
+ * A collector which bundles a full dom query stream into a single dom query element
571
+ *
572
+ * This connects basically our stream back into DomQuery
573
+ */
574
+ export declare class DomQueryCollector implements ICollector<DomQuery, DomQuery> {
575
+ data: DomQuery[];
576
+ collect(element: DomQuery): void;
577
+ get finalValue(): DomQuery;
578
+ }
579
+ /**
580
+ * abbreviation for DomQuery
581
+ */
582
+ export declare const DQ: typeof DomQuery;
583
+ export type DQ = DomQuery;
584
+ /**
585
+ * replacement for the jquery $
586
+ */
587
+ export declare const DQ$: typeof DomQuery.querySelectorAll;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Extended array
3
+ */
4
+ /**
5
+ * Extended array which adds various es 2019 shim functions to the normal array
6
+ * We must remap all array producing functions in order to keep
7
+ * the delegation active, once we are in!
8
+ */
9
+ declare class Es2019Array_<T> extends Array<T> {
10
+ _another: T[];
11
+ constructor(...another: T[]);
12
+ map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
13
+ concat(...items: any[]): T[];
14
+ reverse(): T[];
15
+ slice(start?: number, end?: number): T[];
16
+ splice(start: number, deleteCount?: number): T[];
17
+ filter<S extends T>(predicate: (value: T, index: number, array: T[]) => any, thisArg?: any): S[];
18
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
19
+ private _flat;
20
+ private _flatResolve;
21
+ private _flatMap;
22
+ }
23
+ export declare function _Es2019Array<T>(...data: T[]): Es2019Array_<T>;
24
+ /**
25
+ * this is the switch between normal array and our shim
26
+ * the shim is only provided in case the native browser
27
+ * does not yet have flatMap support on arrays
28
+ */
29
+ export declare var Es2019Array: any;
30
+ export {};
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ /**
20
+ * various environments handle the global variable different
21
+ * we have to deal with this.
22
+ */
23
+ export declare function _global$(): any | null;