jsf.js_next_gen 4.0.1-beta.6 → 4.0.1-beta.8

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 (184) hide show
  1. package/dist/docs/assets/style.css +4 -5
  2. package/dist/window/faces-development.js +43 -54
  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 +43 -54
  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/AjaxImpl.ts +5 -5
  20. package/src/main/typescript/impl/util/ExtDomQuery.ts +17 -22
  21. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +2 -2
  22. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +1 -1
  23. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -1
  24. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +86 -0
  25. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +53 -0
  26. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/bootstrap-icons.css +15 -0
  27. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/tobago.css +15 -0
  28. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +15 -0
  29. package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +23 -0
  30. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +1 -1
  31. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +19 -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/AjaxImpl.js +4 -4
  65. package/target/impl/AjaxImpl.js.map +1 -1
  66. package/target/impl/util/ExtDomQuery.js +13 -19
  67. package/target/impl/util/ExtDomQuery.js.map +1 -1
  68. package/target/impl/xhrCore/RequestDataResolver.js +1 -1
  69. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  70. package/target/index.js +80 -0
  71. package/target/index.js.map +1 -0
  72. package/target/index_core.js +76 -0
  73. package/target/index_core.js.map +1 -0
  74. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +1 -1
  75. package/target/test/frameworkBase/_ext/shared/StandardInits.js +85 -0
  76. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  77. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +53 -1
  78. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  79. package/target/test/xhrCore/ErrorChainTest.spec.js +21 -0
  80. package/target/test/xhrCore/ErrorChainTest.spec.js.map +1 -1
  81. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  82. package/target/test/xhrCore/ResponseTest23.spec.js +14 -0
  83. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  84. package/target/types/main/typescript/AssocArray.d.ts +86 -0
  85. package/target/types/main/typescript/Config.d.ts +94 -0
  86. package/target/types/main/typescript/CryptoExtensions.d.ts +87 -0
  87. package/target/types/main/typescript/DomQuery.d.ts +587 -0
  88. package/target/types/main/typescript/Es2019Array.d.ts +30 -0
  89. package/target/types/main/typescript/Global.d.ts +23 -0
  90. package/target/types/main/typescript/IDomQuery.d.ts +480 -0
  91. package/target/types/main/typescript/Lang.d.ts +97 -0
  92. package/target/types/main/typescript/Messaging.d.ts +285 -0
  93. package/target/types/main/typescript/Monad.d.ts +161 -0
  94. package/target/types/main/typescript/Promise.d.ts +58 -0
  95. package/target/types/main/typescript/PromiseShim.d.ts +22 -0
  96. package/target/types/main/typescript/SourcesCollectors.d.ts +280 -0
  97. package/target/types/main/typescript/Stream.d.ts +284 -0
  98. package/target/types/main/typescript/TagBuilder.d.ts +50 -0
  99. package/target/types/main/typescript/XmlQuery.d.ts +31 -0
  100. package/target/types/main/typescript/api/_api.d.ts +182 -0
  101. package/target/types/main/typescript/api/faces.d.ts +17 -0
  102. package/target/types/main/typescript/api/jsf.d.ts +17 -0
  103. package/target/types/main/typescript/impl/AjaxImpl.d.ts +164 -0
  104. package/target/types/main/typescript/impl/PushImpl.d.ts +38 -0
  105. package/target/types/main/typescript/impl/core/Const.d.ts +138 -0
  106. package/target/types/main/typescript/impl/core/ImplTypes.d.ts +16 -0
  107. package/target/types/main/typescript/impl/i18n/Messages.d.ts +102 -0
  108. package/target/types/main/typescript/impl/util/Assertions.d.ts +46 -0
  109. package/target/types/main/typescript/impl/util/AsyncRunnable.d.ts +112 -0
  110. package/target/types/main/typescript/impl/util/ExtDomQuery.d.ts +100 -0
  111. package/target/types/main/typescript/impl/util/FileUtils.d.ts +25 -0
  112. package/target/types/main/typescript/impl/util/HiddenInputBuilder.d.ts +37 -0
  113. package/target/types/main/typescript/impl/util/IListener.d.ts +18 -0
  114. package/target/types/main/typescript/impl/util/Lang.d.ts +138 -0
  115. package/target/types/main/typescript/impl/util/XhrQueueController.d.ts +51 -0
  116. package/target/types/main/typescript/impl/xhrCore/ErrorData.d.ts +37 -0
  117. package/target/types/main/typescript/impl/xhrCore/EventData.d.ts +25 -0
  118. package/target/types/main/typescript/impl/xhrCore/IResponseProcessor.d.ts +136 -0
  119. package/target/types/main/typescript/impl/xhrCore/RequestDataResolver.d.ts +84 -0
  120. package/target/types/main/typescript/impl/xhrCore/ResonseDataResolver.d.ts +60 -0
  121. package/target/types/main/typescript/impl/xhrCore/Response.d.ts +29 -0
  122. package/target/types/main/typescript/impl/xhrCore/ResponseProcessor.d.ts +208 -0
  123. package/target/types/main/typescript/impl/xhrCore/XhrFormData.d.ts +83 -0
  124. package/target/types/main/typescript/impl/xhrCore/XhrRequest.d.ts +102 -0
  125. package/target/types/main/typescript/index.d.ts +34 -0
  126. package/target/types/main/typescript/index_core.d.ts +29 -0
  127. package/target/types/main/typescript/myfaces/OamSubmit.d.ts +53 -0
  128. package/target/types/main/typescript/test/frameworkBase/LangTest.spec.d.ts +1 -0
  129. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.d.ts +1 -0
  130. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.d.ts +16 -0
  131. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.d.ts +39 -0
  132. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.d.ts +16 -0
  133. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.d.ts +16 -0
  134. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.d.ts +0 -0
  135. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.d.ts +1 -0
  136. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.d.ts +1 -0
  137. package/target/types/main/typescript/test/frameworkBase/_ext/shared/StandardInits.d.ts +63 -0
  138. package/target/types/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.d.ts +23 -0
  139. package/target/types/main/typescript/test/impl/ImplTest.spec.d.ts +16 -0
  140. package/target/types/main/typescript/test/impl/ImplTest_23.spec.d.ts +16 -0
  141. package/target/types/main/typescript/test/impl/SeparatorCharsTest.spec.d.ts +16 -0
  142. package/target/types/main/typescript/test/myfaces/OamSubmit.spec.d.ts +16 -0
  143. package/target/types/main/typescript/test/myfaces/OnLoad.spec.d.ts +16 -0
  144. package/target/types/main/typescript/test/queue/AsynchronousProbe.d.ts +38 -0
  145. package/target/types/main/typescript/test/queue/AsynchronousQueueTest.spec.d.ts +16 -0
  146. package/target/types/main/typescript/test/xhrCore/ClientWindow.spec.d.ts +1 -0
  147. package/target/types/main/typescript/test/xhrCore/ErrorChainTest.spec.d.ts +16 -0
  148. package/target/types/main/typescript/test/xhrCore/EventTests.spec.d.ts +16 -0
  149. package/target/types/main/typescript/test/xhrCore/FakeWebsocket.d.ts +24 -0
  150. package/target/types/main/typescript/test/xhrCore/FileUploadTest.spec.d.ts +1 -0
  151. package/target/types/main/typescript/test/xhrCore/NamespacesRequestTest.spec.d.ts +16 -0
  152. package/target/types/main/typescript/test/xhrCore/OamSubmitTest.spec.d.ts +16 -0
  153. package/target/types/main/typescript/test/xhrCore/RequestParamsTest.spec.d.ts +1 -0
  154. package/target/types/main/typescript/test/xhrCore/RequestTest.spec.d.ts +16 -0
  155. package/target/types/main/typescript/test/xhrCore/RequestTest_23.spec.d.ts +16 -0
  156. package/target/types/main/typescript/test/xhrCore/ResponseTest.spec.d.ts +16 -0
  157. package/target/types/main/typescript/test/xhrCore/ResponseTest23.spec.d.ts +16 -0
  158. package/target/types/main/typescript/test/xhrCore/ShadowDomTest.spec.d.ts +16 -0
  159. package/target/types/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.d.ts +1 -0
  160. package/target/types/main/typescript/test/xhrCore/WebsocketTest.d.ts +1 -0
  161. package/target/types/main/typescript/test/xhrCore/XhrFormDataTest.spec.d.ts +16 -0
  162. package/target/types/test/typescript/AssocArrayTest.spec.d.ts +1 -0
  163. package/target/types/test/typescript/DomQueryTest.spec.d.ts +1 -0
  164. package/target/types/test/typescript/ExtendedArrayTest.spec.d.ts +1 -0
  165. package/target/types/test/typescript/LangTest.spec.d.ts +1 -0
  166. package/target/types/test/typescript/MappingProbes.d.ts +24 -0
  167. package/target/types/test/typescript/MappingTest.spec.d.ts +1 -0
  168. package/target/types/test/typescript/MessagingTest.spec.d.ts +1 -0
  169. package/target/types/test/typescript/MonadTest.spec.d.ts +16 -0
  170. package/target/types/test/typescript/PromiseTest.spec.d.ts +1 -0
  171. package/target/types/test/typescript/StreamTest.spec.d.ts +1 -0
  172. package/target/types/test/typescript/XmlQueryTest.spec.d.ts +1 -0
  173. package/target/types/test/typescript/markups/tobago-with-header.d.ts +1 -0
  174. package/target/types/test/typescript/markups/tobago-without-header.d.ts +1 -0
  175. package/webpack.config.js +1 -1
  176. package/webpack.config.js.map +1 -1
  177. package/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
  178. package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
  179. package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
  180. package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
  181. package/.nyc_output/processinfo/index.json +0 -1
  182. package/src/test.html +0 -75
  183. package/src/tmp/test.html +0 -16
  184. package/tmp.xml +0 -36
@@ -0,0 +1,480 @@
1
+ import { Optional, ValueEmbedder } from "./Monad";
2
+ import { XMLQuery } from "./XmlQuery";
3
+ import { DomQuery, ElementAttribute, Style, WAIT_OPTS } from "./DomQuery";
4
+ export interface IDomQuery {
5
+ /**
6
+ * reference to the systems global object
7
+ * (globalThis, window, global, depending on the environment)
8
+ */
9
+ readonly global: any;
10
+ /**
11
+ * reads the first element if it exists and returns an optional
12
+ */
13
+ readonly value: Optional<Element>;
14
+ /**
15
+ * All elements as array
16
+ */
17
+ readonly values: Element[];
18
+ /**
19
+ * returns the id as settable value (See also ValueEmbedder)
20
+ */
21
+ readonly id: ValueEmbedder<string>;
22
+ /**
23
+ * returns the length of embedded nodes (top level)
24
+ */
25
+ readonly length: number;
26
+ /**
27
+ * the tag name of the first element
28
+ */
29
+ readonly tagName: Optional<string>;
30
+ /**
31
+ * the node name of the first element
32
+ */
33
+ readonly nodeName: Optional<string>;
34
+ /**
35
+ * the type of the first element
36
+ */
37
+ readonly type: Optional<string>;
38
+ /**
39
+ * The name as changeable value
40
+ */
41
+ readonly name: ValueEmbedder<string>;
42
+ /**
43
+ * The value in case of inputs as changeable value
44
+ */
45
+ readonly inputValue: ValueEmbedder<string | boolean>;
46
+ /**
47
+ * accumulated top element offsetWidth
48
+ */
49
+ readonly offsetWidth: number;
50
+ /**
51
+ * accumulated top element offsetHeight
52
+ */
53
+ readonly offsetHeight: number;
54
+ /**
55
+ * accumulated top element offsetLeft
56
+ */
57
+ readonly offsetLeft: number;
58
+ /**
59
+ * accumulated top element offsetTop
60
+ */
61
+ readonly offsetTop: number;
62
+ /**
63
+ * abbreviation for inputValue\.value to make
64
+ * the code terser
65
+ */
66
+ val: string | boolean;
67
+ /**
68
+ * the underlying form elements as DomQuery object
69
+ */
70
+ readonly elements: DomQuery;
71
+ /**
72
+ * settable flag for disabled
73
+ */
74
+ disabled: boolean;
75
+ /**
76
+ * The child nodes of this node collection as readonly attribute
77
+ */
78
+ readonly childNodes: DomQuery;
79
+ /**
80
+ * an early stream representation for this DomQuery
81
+ */
82
+ readonly stream: any;
83
+ /**
84
+ * lazy stream representation for this DomQuery
85
+ */
86
+ readonly lazyStream: any;
87
+ /**
88
+ * transform this node collection to an array
89
+ */
90
+ readonly asArray: Array<DomQuery>;
91
+ /**
92
+ * inner html property
93
+ * setter and getter which works directly on strings
94
+ */
95
+ innerHTML: string;
96
+ /**
97
+ * same as innerHTML
98
+ * will be removed once
99
+ * my code is transitioned
100
+ * @deprecated do not use anymore, user innerHTML instead
101
+ */
102
+ innerHtml: string;
103
+ /**
104
+ * convenience for dq.id.value to make the code a little tighter
105
+ */
106
+ nodeId: string;
107
+ /**
108
+ * returns true if the elements have the tag *tagName* as tag embedded ( highest level )
109
+ * @param tagName
110
+ */
111
+ isTag(tagName: string): boolean;
112
+ /**
113
+ * returns the nth element as DomQuery
114
+ * from the internal elements
115
+ * note if you try to reach a non-existing element position
116
+ * you will get back an absent entry
117
+ *
118
+ * @param index the nth index
119
+ */
120
+ get(index: number): DomQuery;
121
+ /**
122
+ * returns the nth element as optional of an Element object
123
+ * @param index the number from the index
124
+ * @param defaults the default value if the index is overrun default Optional\.absent
125
+ */
126
+ getAsElem(index: number, defaults: Optional<any>): Optional<Element>;
127
+ /**
128
+ * returns the value array< of all elements
129
+ */
130
+ allElems(): Array<Element>;
131
+ /**
132
+ * absent no values reached?
133
+ */
134
+ isAbsent(): boolean;
135
+ /**
136
+ * should make the code clearer
137
+ * note if you pass a function
138
+ * this refers to the active DomQuery object
139
+ */
140
+ isPresent(presentRunnable?: (elem?: DomQuery) => void): boolean;
141
+ /**
142
+ * should make the code clearer
143
+ * note if you pass a function
144
+ * this refers to the active DomQuery object
145
+ *
146
+ *
147
+ * @param presentRunnable
148
+ */
149
+ ifPresentLazy(presentRunnable: (elem?: DomQuery) => void): DomQuery;
150
+ /**
151
+ * remove all affected nodes from this query object from the dom tree
152
+ */
153
+ delete(): void;
154
+ /**
155
+ * query selector all on the existing dom query object
156
+ *
157
+ * @param selector the standard selector
158
+ * @return a DomQuery with the results
159
+ */
160
+ querySelectorAll(selector: any): DomQuery;
161
+ /**
162
+ * closest, walks up the dom tree to fid the closest element to match
163
+ *
164
+ * @param selector the standard selector
165
+ * @return a DomQuery with the results
166
+ */
167
+ querySelectorAll(selector: any): DomQuery;
168
+ /**
169
+ * core byId method
170
+ * @param id the id to search for
171
+ * @param includeRoot also match the root element?
172
+ */
173
+ byId(id: string, includeRoot?: boolean): DomQuery;
174
+ /**
175
+ * same as byId just for the tag name
176
+ * @param tagName
177
+ * @param includeRoot
178
+ */
179
+ byTagName(tagName: string, includeRoot?: boolean): DomQuery;
180
+ /**
181
+ * attr accessor, usage myQuery.attr("class").value = "bla"
182
+ * or let value myQuery.attr("class").value
183
+ * @param attr the attribute to set
184
+ * @param defaultValue the default value in case nothing is presented (defaults to null)
185
+ */
186
+ attr(attr: string, defaultValue: string): ElementAttribute;
187
+ /**
188
+ * style accessor
189
+ * @param defaultValue the default value in case nothing is presented (defaults to null)
190
+ * @param cssProperty
191
+ */
192
+ style(cssProperty: string, defaultValue: string): Style;
193
+ /**
194
+ * Checks for an existing class in the class attributes
195
+ *
196
+ * @param clazz the class to search for
197
+ */
198
+ hasClass(clazz: string): boolean;
199
+ /**
200
+ * appends a class string if not already in the element(s)
201
+ *
202
+ * @param clazz the style class to append
203
+ */
204
+ addClass(clazz: string): DomQuery;
205
+ /**
206
+ * remove the style class if in the class definitions
207
+ *
208
+ * @param clazz
209
+ */
210
+ removeClass(clazz: string): DomQuery;
211
+ /**
212
+ * checks whether we have a multipart element in our children
213
+ */
214
+ isMultipartCandidate(): boolean;
215
+ /**
216
+ * innerHtml
217
+ * equivalent to jQueries html
218
+ * as setter the html is set and the
219
+ * DomQuery is given back
220
+ * as getter the html string is returned
221
+ *
222
+ * @param newInnerHTML
223
+ */
224
+ html(newInnerHTML?: string): DomQuery | Optional<string>;
225
+ /**
226
+ * dispatch event on all children
227
+ * just a delegated dispatchEvent from the standard
228
+ * dom working on all queried elements in the monad level
229
+ *
230
+ * @param evt the event to be dispatched
231
+ */
232
+ dispatchEvent(evt: Event): DomQuery;
233
+ /**
234
+ * easy node traversal, you can pass
235
+ * a set of node selectors which are joined as direct children
236
+ *
237
+ * Note! The root nodes are not in the getIf, those are always the child nodes
238
+ *
239
+ * @param nodeSelector
240
+ */
241
+ getIf(...nodeSelector: Array<string>): DomQuery;
242
+ /**
243
+ * iterate over each element and perform something on the element
244
+ * (Dom element is passed instead of DomQuery)
245
+ * @param func
246
+ */
247
+ eachElem(func: (item: Element, cnt?: number) => any): DomQuery;
248
+ /**
249
+ * perform an operation on the first element
250
+ * returns a DomQuery on the first element only
251
+ * @param func
252
+ */
253
+ firstElem(func: (item: Element, cnt?: number) => any): DomQuery;
254
+ /**
255
+ * perform an operation on the first element
256
+ * returns a DomQuery on the first element only
257
+ * @param func
258
+ */
259
+ lastElem(func: (item: Element, cnt?: number) => any): DomQuery;
260
+ /**
261
+ * same as eachElem, but a DomQuery object is passed down
262
+ *
263
+ * @param func
264
+ */
265
+ each(func: (item: DomQuery, cnt?: number) => any): DomQuery;
266
+ /**
267
+ * returns a new dom query containing only the first element max
268
+ *
269
+ * @param func a an optional callback function to perform an operation on the first element
270
+ */
271
+ first(func: (item: DomQuery, cnt?: number) => any): DomQuery;
272
+ /**
273
+ * returns a new dom query containing only the first element max
274
+ *
275
+ * @param func a an optional callback function to perform an operation on the first element
276
+ */
277
+ last(func: (item: DomQuery, cnt?: number) => any): DomQuery;
278
+ /**
279
+ * filter function which filters a subset
280
+ *
281
+ * @param func
282
+ */
283
+ filter(func: (item: DomQuery) => boolean): DomQuery;
284
+ /**
285
+ * global eval head appendix method
286
+ * no other methods are supported anymore
287
+ * @param code the code to be evaluated
288
+ * @param nonce optional nonce key for higher security
289
+ */
290
+ globalEval(code: string, nonce?: string): DomQuery;
291
+ /**
292
+ * Runs an eval and keeps the evaluated code in the head
293
+ * This is a corner condition, where we want to update the head with custom
294
+ * code and leave the code in (instead of deleting ig)
295
+ *
296
+ * @param code the code to be evaluated
297
+ * @param nonce optional nonce key for higher security
298
+ */
299
+ globalEvalSticky(code: string, nonce?: string): DomQuery;
300
+ /**
301
+ * detaches a set of nodes from their parent elements
302
+ * in a browser independent manner
303
+ * @return {DomQuery} DomQuery of nodes with the detached dom nodes
304
+ */
305
+ detach(): DomQuery;
306
+ /**
307
+ * appends the current set of elements
308
+ * to the element or first element passed via elem
309
+ * @param elem
310
+ */
311
+ appendTo(elem: DomQuery | string): DomQuery;
312
+ /**
313
+ * appends the passed elements to our existing queries
314
+ * note, double appends can happen if you are not careful
315
+ *
316
+ * @param elem to append
317
+ */
318
+ append(elem: DomQuery): DomQuery;
319
+ /**
320
+ * replace convenience function replaces the domquery elements with the
321
+ * elements passed as parameter
322
+ * @param toReplace the replacement elements
323
+ * @return a reference on the replacement elements
324
+ */
325
+ replace(toReplace: DomQuery): DomQuery;
326
+ /**
327
+ * appends the passed elements to our existing queries
328
+ * note, double appends can happen if you are not careful
329
+ *
330
+ * @param elem to append
331
+ */
332
+ prepend(elem: DomQuery): DomQuery;
333
+ /**
334
+ * prepend equivalent to appendTo
335
+ *
336
+ * @param elem the element to prepend to
337
+ */
338
+ prependTo(elem: DomQuery): DomQuery;
339
+ /**
340
+ * loads and evaluates a script from a source uri
341
+ *
342
+ * @param src the source to be loaded and evaluated
343
+ * @param delay in milliseconds execution default (0 == no delay)
344
+ * @param charSet
345
+ */
346
+ loadScriptEval(src: string, delay: number, charSet: string): void;
347
+ /**
348
+ * insert toInsert after the current element
349
+ *
350
+ * @param toInsert an array of DomQuery objects
351
+ */
352
+ insertAfter(...toInsert: Array<DomQuery>): DomQuery;
353
+ /**
354
+ * inserts the elements before the current element
355
+ *
356
+ * @param toInsert
357
+ */
358
+ insertBefore(...toInsert: Array<DomQuery>): DomQuery;
359
+ /**
360
+ * in case the DomQuery is pointing to nothing the else value is taken into consideration
361
+ * als alternative
362
+ *
363
+ * @param elseValue the else value
364
+ */
365
+ orElse(...elseValue: any): DomQuery;
366
+ /**
367
+ * the same with lazy evaluation for cases where getting the else value
368
+ * is a heavy operation
369
+ *
370
+ * @param func the else provider function
371
+ */
372
+ orElseLazy(func: () => any): DomQuery;
373
+ /**
374
+ * find all parents in the hierarchy for which the selector matches
375
+ * @param selector
376
+ */
377
+ allParents(selector: string): DomQuery;
378
+ /**
379
+ * first parents with a matching selector
380
+ * @param selector
381
+ */
382
+ firstParent(selector: string): DomQuery;
383
+ /**
384
+ * all parents until the selector match stops
385
+ * @param selector
386
+ */
387
+ parentsWhileMatch(selector: string): DomQuery;
388
+ /**
389
+ * the parent of the elements
390
+ */
391
+ parent(): DomQuery;
392
+ /**
393
+ * copy all attributes of sourceItem to this DomQuery items
394
+ *
395
+ * @param sourceItem the source item to copy over (can be another DomQuery or a parsed XML Query item)
396
+ */
397
+ copyAttrs(sourceItem: DomQuery | XMLQuery): DomQuery;
398
+ /**
399
+ * outerHTML convenience method
400
+ * browsers only support innerHTML but
401
+ * for instance for your jsf.js we have a full
402
+ * replace pattern which needs outerHTML processing
403
+ *
404
+ * @param markup
405
+ * @param runEmbeddedScripts
406
+ * @param runEmbeddedCss
407
+ */
408
+ outerHTML(markup: string, runEmbeddedScripts?: boolean, runEmbeddedCss?: boolean): DomQuery;
409
+ /**
410
+ * Run through the given nodes in the DomQuery execute the inline scripts
411
+ * @param sticky if set to true the element must be left in the head after eval default === false
412
+ * @param whiteListed: optional whitelist function which can filter out script tags which are not processed
413
+ * defaults to the standard jsf.js exclusion (we use this code for myfaces)
414
+ */
415
+ runScripts(sticky?: boolean, whiteListed?: (val: string) => boolean): DomQuery;
416
+ /**
417
+ * runs the embedded css
418
+ */
419
+ runCss(): DomQuery;
420
+ /**
421
+ * fires a click event on the underlying dom elements
422
+ */
423
+ click(): DomQuery;
424
+ /**
425
+ * adds an event listener
426
+ *
427
+ * @param type
428
+ * @param listener
429
+ * @param options
430
+ */
431
+ addEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery;
432
+ /**
433
+ * removes an event listener
434
+ *
435
+ * @param type
436
+ * @param listener
437
+ * @param options
438
+ */
439
+ removeEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery;
440
+ /**
441
+ * fires an event
442
+ */
443
+ fireEvent(eventName: string): void;
444
+ textContent(joinString?: string): string;
445
+ innerText(joinString?: string): string;
446
+ /**
447
+ * encodes all input elements properly into respective
448
+ * config entries, this can be used
449
+ * for legacy systems, for newer use-cases, use the
450
+ * HTML5 Form class which all newer browsers provide
451
+ *
452
+ * @param toMerge optional config which can be merged in
453
+ * @return a copy pf
454
+ */
455
+ encodeFormElement(toMerge: any): {
456
+ [key: string]: any;
457
+ };
458
+ /**
459
+ * fetches the sub-nodes from ... to..
460
+ * @param from
461
+ * @param to
462
+ */
463
+ subNodes(from: number, to?: number): DomQuery;
464
+ /**
465
+ * attach shadow elements
466
+ * 1:1 mapping from attach shadow
467
+ *
468
+ * @param modeParams
469
+ */
470
+ attachShadow(modeParams: {
471
+ [key: string]: string;
472
+ }): DomQuery;
473
+ /**
474
+ * wait until a condition on the dom is reached
475
+ *
476
+ * @return a promise on the affected elements where the condition
477
+ * @throws an error in case of a timeout
478
+ */
479
+ waitUntilDom(condition: (element: DomQuery) => boolean, options: WAIT_OPTS): Promise<DomQuery>;
480
+ }
@@ -0,0 +1,97 @@
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 } from "./Monad";
18
+ /**
19
+ * Lang helpers crossported from the apache myfaces project
20
+ */
21
+ export declare module Lang {
22
+ /**
23
+ * helper function to safely resolve anything
24
+ * this is not an elvis operator, it resolves
25
+ * a value without exception in a tree and if
26
+ * it is not resolvable then an optional of
27
+ * a default value is restored or Optional.empty
28
+ * if none is given
29
+ *
30
+ * usage
31
+ * <code>
32
+ * let var: Optiona<string> = saveResolve(() => a.b.c.d.e, "foobaz")
33
+ * </code>
34
+ *
35
+ * @param resolverProducer a lambda which can produce the value
36
+ * @param defaultValue an optional default value if the producer failes to produce anything
37
+ * @returns an Optional of the produced value
38
+ */
39
+ function saveResolve<T>(resolverProducer: () => T, defaultValue?: T): Optional<T>;
40
+ /**
41
+ * lazy resolve... aka the function is called on resolve and a default value also
42
+ * is a producing function (called only if the original producer does not produce any result)
43
+ * @param resolverProducer the producer for the resolve
44
+ * @param defaultValue the default value producer function
45
+ */
46
+ function saveResolveLazy<T>(resolverProducer: () => T, defaultValue?: () => T): Optional<T>;
47
+ /**
48
+ * String to array function performs a string to array transformation
49
+ * @param {String} it the string which has to be changed into an array
50
+ * @param {RegExp} splitter our splitter reglar expression
51
+ * @return a trimmed array of the splitted string
52
+ */
53
+ function strToArray(it: string, splitter?: string | RegExp): Array<string>;
54
+ /**
55
+ * hyperfast trim
56
+ * http://blog.stevenlevithan.com/archives/faster-trim-javascript
57
+ * crossported from dojo
58
+ */
59
+ function trim(str: string): string;
60
+ /**
61
+ * generic object arrays like dom definitions to array conversion method which
62
+ * transforms any object to something array like
63
+ * @param obj
64
+ * @param offset
65
+ * @param pack
66
+ * @returns an array converted from the object
67
+ */
68
+ function objToArray<T>(obj: any, offset?: number, pack?: Array<T>): Array<T>;
69
+ /**
70
+ * equalsIgnoreCase, case-insensitive comparison of two strings
71
+ *
72
+ * @param source
73
+ * @param destination
74
+ */
75
+ function equalsIgnoreCase(source?: string, destination?: string): boolean;
76
+ /**
77
+ * runtime type assertion
78
+ *
79
+ * @param probe the probe to be tested for a type
80
+ * @param theType the type to be tested for
81
+ */
82
+ function assertType(probe: any, theType: any): boolean;
83
+ /**
84
+ * Back ported from Dojo
85
+ * a failsafe string determination method
86
+ * (since in javascript String != "" typeof alone fails!)
87
+ * @param it {|Object|} the object to be checked for being a string
88
+ * @return true in case of being a string false otherwise
89
+ */
90
+ function isString(it?: any): boolean;
91
+ /**
92
+ * Back-ported, a failsafe determination code for checking whether an object is a function
93
+ * @param it the object to check for being a function
94
+ */
95
+ function isFunc(it: any): boolean;
96
+ function objAssign(target: any, ...theArgs: any): any;
97
+ }