jsf.js_next_gen 1.0.0-beta-1 → 1.0.0-beta-4
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/.github/workflows/codeql-analysis.yml +83 -0
- package/.github/workflows/nodejs.yml +1 -1
- package/dist/docs/.nojekyll +1 -0
- package/dist/docs/assets/highlight.css +22 -0
- package/dist/docs/assets/main.js +54 -0
- package/dist/docs/assets/search.js +1 -0
- package/dist/docs/assets/style.css +1225 -0
- package/dist/docs/assets/widgets.png +0 -0
- package/dist/docs/assets/widgets@2x.png +0 -0
- package/dist/docs/functions/jsf.ajax.addOnError.html +84 -0
- package/dist/docs/functions/jsf.ajax.addOnEvent.html +74 -0
- package/dist/docs/functions/jsf.ajax.request.html +74 -0
- package/dist/docs/functions/jsf.ajax.response.html +69 -0
- package/dist/docs/functions/jsf.getClientWindow.html +65 -0
- package/dist/docs/functions/jsf.getProjectStage.html +69 -0
- package/dist/docs/functions/jsf.getViewState.html +68 -0
- package/dist/docs/functions/jsf.push.close.html +63 -0
- package/dist/docs/functions/jsf.push.init.html +81 -0
- package/dist/docs/functions/jsf.push.open.html +63 -0
- package/dist/docs/functions/jsf.util.chain.html +69 -0
- package/dist/docs/functions/myfaces.ab.html +78 -0
- package/dist/docs/index.html +173 -0
- package/dist/docs/modules/jsf.ajax.html +59 -0
- package/dist/docs/modules/jsf.html +71 -0
- package/dist/docs/modules/jsf.push.html +57 -0
- package/dist/docs/modules/jsf.util.html +53 -0
- package/dist/docs/modules/myfaces.html +52 -0
- package/dist/docs/modules.html +48 -0
- package/dist/docs/variables/jsf.implversion.html +57 -0
- package/dist/docs/variables/jsf.separatorchar.html +54 -0
- package/dist/docs/variables/jsf.specversion.html +52 -0
- package/dist/window/jsf-development.js +51 -39
- 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 +26 -25
- package/remap.js +44 -0
- package/remap.js.map +1 -0
- package/remap.ts +1 -1
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +1 -1
- package/src/main/typescript/tsconfig-typedoc.json +20 -0
- package/src/test/typescript/frameworkBase/LangTest.ts +2 -10
- package/src/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.ts +12 -11
- package/src/test/typescript/frameworkBase/_ext/monadish/LangTest.ts +1 -1
- package/src/test/typescript/frameworkBase/_ext/monadish/MappingProbes.ts +13 -19
- package/src/test/typescript/frameworkBase/_ext/monadish/StreamTest.ts +5 -9
- package/target/api/Jsf.js +258 -0
- package/target/api/Jsf.js.map +1 -0
- package/target/impl/AjaxImpl.js +569 -0
- package/target/impl/AjaxImpl.js.map +1 -0
- package/target/impl/PushImpl.js +215 -0
- package/target/impl/PushImpl.js.map +1 -0
- package/target/impl/core/Const.js +135 -0
- package/target/impl/core/Const.js.map +1 -0
- package/target/impl/core/ImplTypes.js +43 -0
- package/target/impl/core/ImplTypes.js.map +1 -0
- package/target/impl/i18n/Messages.js +114 -0
- package/target/impl/i18n/Messages.js.map +1 -0
- package/target/impl/util/Assertions.js +90 -0
- package/target/impl/util/Assertions.js.map +1 -0
- package/target/impl/util/AsyncQueue.js +104 -0
- package/target/impl/util/AsyncQueue.js.map +1 -0
- package/target/impl/util/AsyncRunnable.js +18 -0
- package/target/impl/util/AsyncRunnable.js.map +1 -0
- package/target/impl/util/ExtDomQuery.js +129 -0
- package/target/impl/util/ExtDomQuery.js.map +1 -0
- package/target/impl/util/Lang.js +215 -0
- package/target/impl/util/Lang.js.map +1 -0
- package/target/impl/util/ListenerQueue.js +3 -0
- package/target/impl/util/ListenerQueue.js.map +1 -0
- package/target/impl/xhrCore/ErrorData.js +89 -0
- package/target/impl/xhrCore/ErrorData.js.map +1 -0
- package/target/impl/xhrCore/EventData.js +30 -0
- package/target/impl/xhrCore/EventData.js.map +1 -0
- package/target/impl/xhrCore/IResponseProcessor.js +3 -0
- package/target/impl/xhrCore/IResponseProcessor.js.map +1 -0
- package/target/impl/xhrCore/RequestDataResolver.js +143 -0
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -0
- package/target/impl/xhrCore/ResonseDataResolver.js +103 -0
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -0
- package/target/impl/xhrCore/Response.js +167 -0
- package/target/impl/xhrCore/Response.js.map +1 -0
- package/target/impl/xhrCore/ResponseProcessor.js +368 -0
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -0
- package/target/impl/xhrCore/XhrFormData.js +272 -0
- package/target/impl/xhrCore/XhrFormData.js.map +1 -0
- package/target/impl/xhrCore/XhrRequest.js +281 -0
- package/target/impl/xhrCore/XhrRequest.js.map +1 -0
- package/target/main/typescript/api/Jsf.js +258 -0
- package/target/main/typescript/api/Jsf.js.map +1 -0
- package/target/main/typescript/impl/AjaxImpl.js +569 -0
- package/target/main/typescript/impl/AjaxImpl.js.map +1 -0
- package/target/main/typescript/impl/PushImpl.js +215 -0
- package/target/main/typescript/impl/PushImpl.js.map +1 -0
- package/target/main/typescript/impl/core/Const.js +135 -0
- package/target/main/typescript/impl/core/Const.js.map +1 -0
- package/target/main/typescript/impl/core/ImplTypes.js +43 -0
- package/target/main/typescript/impl/core/ImplTypes.js.map +1 -0
- package/target/main/typescript/impl/i18n/Messages.js +114 -0
- package/target/main/typescript/impl/i18n/Messages.js.map +1 -0
- package/target/main/typescript/impl/util/Assertions.js +90 -0
- package/target/main/typescript/impl/util/Assertions.js.map +1 -0
- package/target/main/typescript/impl/util/AsyncQueue.js +104 -0
- package/target/main/typescript/impl/util/AsyncQueue.js.map +1 -0
- package/target/main/typescript/impl/util/AsyncRunnable.js +18 -0
- package/target/main/typescript/impl/util/AsyncRunnable.js.map +1 -0
- package/target/main/typescript/impl/util/ExtDomQuery.js +129 -0
- package/target/main/typescript/impl/util/ExtDomQuery.js.map +1 -0
- package/target/main/typescript/impl/util/Lang.js +215 -0
- package/target/main/typescript/impl/util/Lang.js.map +1 -0
- package/target/main/typescript/impl/util/ListenerQueue.js +3 -0
- package/target/main/typescript/impl/util/ListenerQueue.js.map +1 -0
- package/target/main/typescript/impl/xhrCore/ErrorData.js +89 -0
- package/target/main/typescript/impl/xhrCore/ErrorData.js.map +1 -0
- package/target/main/typescript/impl/xhrCore/EventData.js +30 -0
- package/target/main/typescript/impl/xhrCore/EventData.js.map +1 -0
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js +3 -0
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js.map +1 -0
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js +143 -0
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js.map +1 -0
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js +103 -0
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js.map +1 -0
- package/target/main/typescript/impl/xhrCore/Response.js +167 -0
- package/target/main/typescript/impl/xhrCore/Response.js.map +1 -0
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js +368 -0
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js.map +1 -0
- package/target/main/typescript/impl/xhrCore/XhrFormData.js +272 -0
- package/target/main/typescript/impl/xhrCore/XhrFormData.js.map +1 -0
- package/target/main/typescript/impl/xhrCore/XhrRequest.js +281 -0
- package/target/main/typescript/impl/xhrCore/XhrRequest.js.map +1 -0
- package/target/test/typescript/frameworkBase/LangTest.js +112 -0
- package/target/test/typescript/frameworkBase/LangTest.js.map +1 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js +293 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js.map +1 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js +89 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js.map +1 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js +115 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js +39 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js.map +1 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js +155 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js.map +1 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js +176 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js.map +1 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js +1 -0
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js.map +1 -0
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js +264 -0
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js.map +1 -0
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js +23 -0
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js.map +1 -0
- package/target/test/typescript/impl/ImplTest.js +98 -0
- package/target/test/typescript/impl/ImplTest.js.map +1 -0
- package/target/test/typescript/impl/SeparatorCharsTest.js +72 -0
- package/target/test/typescript/impl/SeparatorCharsTest.js.map +1 -0
- package/target/test/typescript/queue/AsynchronousProbe.js +99 -0
- package/target/test/typescript/queue/AsynchronousProbe.js.map +1 -0
- package/target/test/typescript/queue/AsynchronousQueueTest.js +130 -0
- package/target/test/typescript/queue/AsynchronousQueueTest.js.map +1 -0
- package/target/test/typescript/xhrCore/EventTests.js +155 -0
- package/target/test/typescript/xhrCore/EventTests.js.map +1 -0
- package/target/test/typescript/xhrCore/FakeWebsocket.js +25 -0
- package/target/test/typescript/xhrCore/FakeWebsocket.js.map +1 -0
- package/target/test/typescript/xhrCore/FileUploadTest.js +166 -0
- package/target/test/typescript/xhrCore/FileUploadTest.js.map +1 -0
- package/target/test/typescript/xhrCore/RequestParamsTest.js +151 -0
- package/target/test/typescript/xhrCore/RequestParamsTest.js.map +1 -0
- package/target/test/typescript/xhrCore/RequestTest.js +318 -0
- package/target/test/typescript/xhrCore/RequestTest.js.map +1 -0
- package/target/test/typescript/xhrCore/ResponseTest.js +257 -0
- package/target/test/typescript/xhrCore/ResponseTest.js.map +1 -0
- package/target/test/typescript/xhrCore/ShadowDomTest.js +122 -0
- package/target/test/typescript/xhrCore/ShadowDomTest.js.map +1 -0
- package/target/test/typescript/xhrCore/WebsocketTest.js +182 -0
- package/target/test/typescript/xhrCore/WebsocketTest.js.map +1 -0
- package/target/test/typescript/xhrCore/XhrFormDataTest.js +58 -0
- package/target/test/typescript/xhrCore/XhrFormDataTest.js.map +1 -0
- package/webpack.config.js +71 -0
- package/webpack.config.js.map +1 -0
- package/webpack.config.ts +4 -6
- package/dist/window/jsf-development.js.LICENSE.txt +0 -135
- package/dist/window/jsf-development.js.br +0 -0
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsf.js_next_gen",
|
|
3
|
-
"version": "1.0.0-beta-
|
|
3
|
+
"version": "1.0.0-beta-4",
|
|
4
4
|
"description": "A next generation typescript reimplementation of jsf.js",
|
|
5
5
|
"main": "dist/window/jsf.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
7
|
+
"doc": "npx typedoc --tsconfig src/main/typescript/tsconfig-typedoc.json",
|
|
8
|
+
"test": "env TS_NODE_PROJECT=./src/test/typescript/tsconfig.json mocha -r ts-node/register ./src/test/typescript/**/**/*Test*.ts",
|
|
8
9
|
"coverage": "nyc --reporter=html --reporter=text mocha -r ts-node/register ./**/test/typescript/**/**/*Test*.ts",
|
|
9
10
|
"build-production": "webpack --mode production --env FILE_NAME=jsf && ts-node ./remap.ts --production",
|
|
10
11
|
"build-development": "webpack --mode development --env FILE_NAME=jsf-development && ts-node ./remap.ts --development",
|
|
11
|
-
"build": "npm run build-development && npm run build-production"
|
|
12
|
+
"build": "npm run doc && npm run build-development && npm run build-production"
|
|
12
13
|
},
|
|
13
14
|
"keywords": [
|
|
14
15
|
"myfaces",
|
|
@@ -18,32 +19,32 @@
|
|
|
18
19
|
"author": "Werner Punz werpu@apache.org",
|
|
19
20
|
"license": "Apache-2.0",
|
|
20
21
|
"devDependencies": {
|
|
21
|
-
"@istanbuljs/nyc-config-typescript": "^1.0.
|
|
22
|
-
"@types/chai": "^4.
|
|
23
|
-
"@types/mocha": "^
|
|
24
|
-
"@types/sinon": "^10.0.
|
|
22
|
+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
23
|
+
"@types/chai": "^4.3.3",
|
|
24
|
+
"@types/mocha": "^9.1.1",
|
|
25
|
+
"@types/sinon": "^10.0.13",
|
|
25
26
|
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"jsdom": "^16.5.3",
|
|
27
|
+
"chai": "^4.3.6",
|
|
28
|
+
"compression-webpack-plugin": "^10.0.0",
|
|
29
|
+
"html-webpack-plugin": "^5.5.0",
|
|
30
|
+
"jsdom": "^20.0.0",
|
|
31
31
|
"jsdom-global": "^3.0.2",
|
|
32
|
-
"mocha": "^
|
|
33
|
-
"npm-check-updates": "^
|
|
32
|
+
"mocha": "^10.0.0",
|
|
33
|
+
"npm-check-updates": "^16.1.0",
|
|
34
34
|
"nyc": "^15.1.0",
|
|
35
|
-
"replace-in-file": "^6.
|
|
36
|
-
"rxjs": "^
|
|
37
|
-
"sinon": "^
|
|
38
|
-
"terser-webpack-plugin": "^5.
|
|
39
|
-
"ts-loader": "^9.
|
|
40
|
-
"ts-node": "^9.1
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"webpack
|
|
44
|
-
"webpack-
|
|
35
|
+
"replace-in-file": "^6.3.5",
|
|
36
|
+
"rxjs": "^7.5.6",
|
|
37
|
+
"sinon": "^14.0.0",
|
|
38
|
+
"terser-webpack-plugin": "^5.3.6",
|
|
39
|
+
"ts-loader": "^9.3.1",
|
|
40
|
+
"ts-node": "^10.9.1",
|
|
41
|
+
"typedoc": "^0.23.14",
|
|
42
|
+
"typescript": "^4.8.2",
|
|
43
|
+
"webpack": "^5.74.0",
|
|
44
|
+
"webpack-cli": "^4.10.0",
|
|
45
|
+
"webpack-dev-server": "^4.10.1"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
|
-
"mona-dish": "0.
|
|
48
|
+
"mona-dish": "0.21.2"
|
|
48
49
|
}
|
|
49
50
|
}
|
package/remap.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* we are remapping the mappings in our dist file, to meet the expected
|
|
18
|
+
* jsf loading criteria...
|
|
19
|
+
* luckily we can use more than one source map entry
|
|
20
|
+
* so either one is found and the other is not
|
|
21
|
+
*/
|
|
22
|
+
//the replace in file plugin meets our system independent grep/awk criteria
|
|
23
|
+
//does pretty much what grep and awk do on unix systems
|
|
24
|
+
var replace = require('replace-in-file');
|
|
25
|
+
// we ned to fetch the proper argument
|
|
26
|
+
var args = process.argv.slice(2);
|
|
27
|
+
// and remap it into our proper option
|
|
28
|
+
var buildStage = (args[0] == "--development") ? "-development" : "";
|
|
29
|
+
console.log("fixing mapping file references for jsf");
|
|
30
|
+
var option = {
|
|
31
|
+
//development
|
|
32
|
+
files: 'dist/**/*.js',
|
|
33
|
+
from: (buildStage == "-development") ? /jsf-development.js\.map/g : /jsf.js\.map/g,
|
|
34
|
+
to: "jsf".concat(buildStage, ".js.map\n//# sourceMappingURL=jsf").concat(buildStage, ".js.map.jsf?ln=scripts")
|
|
35
|
+
};
|
|
36
|
+
try {
|
|
37
|
+
var result = replace.sync(option);
|
|
38
|
+
console.log("mapping file references fixed!");
|
|
39
|
+
console.log('Replacement results:', result);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error('Error occurred:', error);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=remap.js.map
|
package/remap.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remap.js","sourceRoot":"","sources":["remap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;GAKG;AAEH,2EAA2E;AAC3E,uDAAuD;AACvD,IAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE3C,sCAAsC;AACtC,IAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,sCAAsC;AACtC,IAAM,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;AACtE,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;AAEtD,IAAI,MAAM,GAAG;IACT,aAAa;IACb,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,CAAC,UAAU,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,cAAc;IAClF,EAAE,EAAE,aAAM,UAAU,8CAAoC,UAAU,2BAAwB;CAC7F,CAAA;AAED,IAAI;IACA,IAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;CAC/C;AAAC,OAAO,KAAK,EAAE;IACZ,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;CAC3C"}
|
package/remap.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* so either one is found and the other is not
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
//the replace in file plugin meets our system
|
|
24
|
+
//the replace in file plugin meets our system independent grep/awk criteria
|
|
25
25
|
//does pretty much what grep and awk do on unix systems
|
|
26
26
|
const replace = require('replace-in-file');
|
|
27
27
|
|
|
@@ -14,7 +14,7 @@ import {AsyncRunnable} from "./AsyncRunnable";
|
|
|
14
14
|
export class AsynchronouseQueue<T extends AsyncRunnable<any>> {
|
|
15
15
|
|
|
16
16
|
private runnableQueue = [];
|
|
17
|
-
private delayTimeout:
|
|
17
|
+
private delayTimeout: null | ReturnType<typeof setTimeout>;
|
|
18
18
|
|
|
19
19
|
currentlyRunning: AsyncRunnable<any>;
|
|
20
20
|
|
|
@@ -57,7 +57,7 @@ export function resolveTargetUrl(srcFormElement: HTMLFormElement) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export function resolveFinalUrl(sourceForm: DomQuery, formData: XhrFormData, ajaxType = REQ_TYPE_POST) {
|
|
60
|
-
let targetUrl =
|
|
60
|
+
let targetUrl = resolveTargetUrl(<HTMLFormElement>sourceForm.getAsElem(0).value);
|
|
61
61
|
|
|
62
62
|
return targetUrl + (ajaxType == REQ_TYPE_GET ? "?" + formData.toString() : EMPTY_STR);
|
|
63
63
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Special config to generate the tsdocs
|
|
3
|
+
*/
|
|
4
|
+
{
|
|
5
|
+
"extends": "./tsconfig.json",
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"skipLibCheck": true
|
|
8
|
+
},
|
|
9
|
+
"typedocOptions": {
|
|
10
|
+
"entryPoints": ["api/Jsf.ts"],
|
|
11
|
+
"out": "../../../dist/docs",
|
|
12
|
+
"externalPattern": "**/node_modules/**",
|
|
13
|
+
"exclude": "**/{node_modules,test,doc,impl,myfaces}/**/*",
|
|
14
|
+
"excludeExternals": true,
|
|
15
|
+
"excludePrivate": true,
|
|
16
|
+
"excludeProtected": true,
|
|
17
|
+
"emit": "both",
|
|
18
|
+
"disableSources": true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -33,7 +33,7 @@ const dom = new JSDOM(`
|
|
|
33
33
|
`)
|
|
34
34
|
|
|
35
35
|
export const window = dom.window;
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
|
|
38
38
|
function hello_world() {
|
|
39
39
|
return "Hello World!"
|
|
@@ -71,8 +71,6 @@ describe('Lang tests', () => {
|
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
it('strToArray working', () => {
|
|
74
|
-
const lang = Lang;
|
|
75
|
-
|
|
76
74
|
let arr = strToArray("hello.world.from.me", /\./gi);
|
|
77
75
|
|
|
78
76
|
expect(arr).to.exist;
|
|
@@ -82,7 +80,6 @@ describe('Lang tests', () => {
|
|
|
82
80
|
});
|
|
83
81
|
|
|
84
82
|
it('trim working', () => {
|
|
85
|
-
const lang = Lang;
|
|
86
83
|
let origStr = " hello world from me ";
|
|
87
84
|
let trimmed = trim(origStr);
|
|
88
85
|
expect(trimmed).to.exist;
|
|
@@ -91,7 +88,6 @@ describe('Lang tests', () => {
|
|
|
91
88
|
});
|
|
92
89
|
|
|
93
90
|
it('isString working', () => {
|
|
94
|
-
const lang = Lang;
|
|
95
91
|
expect(isString(" ")).to.be.true;
|
|
96
92
|
expect(isString('')).to.be.true;
|
|
97
93
|
expect(isString(null)).to.be.false;
|
|
@@ -103,7 +99,6 @@ describe('Lang tests', () => {
|
|
|
103
99
|
});
|
|
104
100
|
|
|
105
101
|
it('isFunc working', () => {
|
|
106
|
-
const lang = Lang;
|
|
107
102
|
expect(isFunc(() => {
|
|
108
103
|
})).to.be.true;
|
|
109
104
|
expect(isFunc(function () {
|
|
@@ -114,7 +109,6 @@ describe('Lang tests', () => {
|
|
|
114
109
|
});
|
|
115
110
|
|
|
116
111
|
it('objToArray working', () => {
|
|
117
|
-
const lang = Lang;
|
|
118
112
|
let obj_probe = new Probe();
|
|
119
113
|
let resultArr = objToArray(obj_probe);
|
|
120
114
|
expect(assertType(resultArr, Array)).to.be.true;
|
|
@@ -126,15 +120,13 @@ describe('Lang tests', () => {
|
|
|
126
120
|
});
|
|
127
121
|
|
|
128
122
|
it('keyval to string working', () => {
|
|
129
|
-
const lang = Lang;
|
|
130
123
|
let keyval = keyValToStr("key", "val", ":")
|
|
131
124
|
expect(keyval).to.eq("key:val");
|
|
132
125
|
|
|
133
126
|
});
|
|
134
127
|
|
|
135
128
|
it('equals ignore case test', () => {
|
|
136
|
-
|
|
137
|
-
expect(equalsIgnoreCase(null, null)).to.be.true;
|
|
129
|
+
expect(equalsIgnoreCase(<any>null, <any>null)).to.be.true;
|
|
138
130
|
expect(equalsIgnoreCase("", "")).to.be.true;
|
|
139
131
|
expect(equalsIgnoreCase("null", "NuLL")).to.be.true;
|
|
140
132
|
expect(equalsIgnoreCase("null ", "NuLL")).to.be.false;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// noinspection HtmlUnknownAttribute
|
|
2
|
+
|
|
1
3
|
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
4
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
5
|
* this work for additional information regarding copyright ownership.
|
|
@@ -24,7 +26,6 @@ import trim = Lang.trim;
|
|
|
24
26
|
const jsdom = require("jsdom");
|
|
25
27
|
const {JSDOM} = jsdom;
|
|
26
28
|
|
|
27
|
-
|
|
28
29
|
describe('DOMQuery tests', function () {
|
|
29
30
|
|
|
30
31
|
beforeEach(function () {
|
|
@@ -60,7 +61,7 @@ describe('DOMQuery tests', function () {
|
|
|
60
61
|
|
|
61
62
|
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
62
63
|
this.requests = [];
|
|
63
|
-
this.xhr.onCreate = (xhr) => {
|
|
64
|
+
this.xhr.onCreate = (xhr: any) => {
|
|
64
65
|
this.requests.push(xhr);
|
|
65
66
|
};
|
|
66
67
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
@@ -118,7 +119,7 @@ describe('DOMQuery tests', function () {
|
|
|
118
119
|
it('domquery ops test2 eachNode', function () {
|
|
119
120
|
let probe2 = DomQuery.querySelectorAll("div");
|
|
120
121
|
let noIter = 0;
|
|
121
|
-
probe2
|
|
122
|
+
probe2.each((item, cnt) => {
|
|
122
123
|
expect(item instanceof DomQuery).to.be.true;
|
|
123
124
|
expect(noIter == cnt).to.be.true;
|
|
124
125
|
noIter++;
|
|
@@ -229,19 +230,19 @@ describe('DOMQuery tests', function () {
|
|
|
229
230
|
it("must have a working input handling", function () {
|
|
230
231
|
DomQuery.querySelectorAll("body").innerHtml = `<form id="blarg">
|
|
231
232
|
<div id="embed1">
|
|
232
|
-
<input type="text" id="id_1" name="id_1" value="id_1_val"
|
|
233
|
-
<input type="text" id="id_2" name="id_2" value="id_2_val" disabled="disabled"
|
|
233
|
+
<input type="text" id="id_1" name="id_1" value="id_1_val"/>
|
|
234
|
+
<input type="text" id="id_2" name="id_2" value="id_2_val" disabled="disabled"/>
|
|
234
235
|
<textarea type="text" id="id_3" name="id_3">textareaVal</textarea>
|
|
235
236
|
|
|
236
237
|
<fieldset>
|
|
237
|
-
<input type="radio" id="mc" name="cc_1" value="Mastercard" checked="checked"
|
|
238
|
+
<input type="radio" id="mc" name="cc_1" value="Mastercard" checked="checked"/>
|
|
238
239
|
<label for="mc"> Mastercard</label>
|
|
239
|
-
<input type="radio" id="vi" name="cc_1" value="Visa"
|
|
240
|
+
<input type="radio" id="vi" name="cc_1" value="Visa"/>
|
|
240
241
|
<label for="vi"> Visa</label>
|
|
241
|
-
<input type="radio" id="ae" name="cc_1" value="AmericanExpress"
|
|
242
|
+
<input type="radio" id="ae" name="cc_1" value="AmericanExpress"/>
|
|
242
243
|
<label for="ae"> American Express</label>
|
|
243
244
|
</fieldset>
|
|
244
|
-
<select id="val_5" name="val_5"
|
|
245
|
+
<select id="val_5" name="val_5" size="5">
|
|
245
246
|
<option>barg</option>
|
|
246
247
|
<option>jjj</option>
|
|
247
248
|
<option selected>akaka</option>
|
|
@@ -343,7 +344,7 @@ describe('DOMQuery tests', function () {
|
|
|
343
344
|
//-->
|
|
344
345
|
</script>
|
|
345
346
|
|
|
346
|
-
<style
|
|
347
|
+
<style>
|
|
347
348
|
#first {
|
|
348
349
|
border: 1px solid black;
|
|
349
350
|
}
|
|
@@ -380,7 +381,7 @@ describe('DOMQuery tests', function () {
|
|
|
380
381
|
|
|
381
382
|
it("it must handle events properly", function () {
|
|
382
383
|
let clicked = 0;
|
|
383
|
-
let listener = (
|
|
384
|
+
let listener = () => {
|
|
384
385
|
clicked++;
|
|
385
386
|
};
|
|
386
387
|
let eventReceiver = DomQuery.byId("id_1");
|
|
@@ -117,7 +117,7 @@ describe('Lang tests', () => {
|
|
|
117
117
|
|
|
118
118
|
it('equals ignore case test', () => {
|
|
119
119
|
const lang = Lang;
|
|
120
|
-
expect(lang.equalsIgnoreCase(null, null)).to.be.true;
|
|
120
|
+
expect(lang.equalsIgnoreCase(<any>null, <any>null)).to.be.true;
|
|
121
121
|
expect(lang.equalsIgnoreCase("", "")).to.be.true;
|
|
122
122
|
expect(lang.equalsIgnoreCase("null", "NuLL")).to.be.true;
|
|
123
123
|
expect(lang.equalsIgnoreCase("null ", "NuLL")).to.be.false;
|
|
@@ -52,14 +52,10 @@ class DtoUils {
|
|
|
52
52
|
(<any>target)[key] = {};
|
|
53
53
|
|
|
54
54
|
for (let key2 in newVal) {
|
|
55
|
-
|
|
56
|
-
// subTarget = this.mapIt(subTarget, <any> newVal[key2]);
|
|
57
|
-
(<any>target)[key][key2] = subTarget;
|
|
55
|
+
(<any>target)[key][key2] = new mappings[key].clazz(newVal[key2]);
|
|
58
56
|
}
|
|
59
57
|
} else if (mappings && mappings[key]) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
(<any>target)[key] = subTarget;
|
|
58
|
+
(<any>target)[key] = new mappings[key](newVal);
|
|
63
59
|
} else {
|
|
64
60
|
(<any>target)[key] = newVal
|
|
65
61
|
}
|
|
@@ -71,13 +67,14 @@ class DtoUils {
|
|
|
71
67
|
|
|
72
68
|
}
|
|
73
69
|
|
|
70
|
+
// noinspection JSUnusedLocalSymbols
|
|
74
71
|
class BaseDto<T> {
|
|
75
72
|
|
|
76
73
|
TYPES = "___mappable_types___";
|
|
77
74
|
|
|
78
75
|
constructor(data?: T, dtoTypes: any = {}) {
|
|
79
76
|
|
|
80
|
-
this[this.TYPES] = dtoTypes;
|
|
77
|
+
(<any>this)[this.TYPES] = dtoTypes;
|
|
81
78
|
|
|
82
79
|
if (data) {
|
|
83
80
|
this.mapIt(this, data);
|
|
@@ -99,14 +96,11 @@ class BaseDto<T> {
|
|
|
99
96
|
(<any>target)[key] = {};
|
|
100
97
|
|
|
101
98
|
for (let key2 in newVal) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
(<any>target)[key][key2] = subTarget;
|
|
99
|
+
// subTarget = this.mapIt(subTarget, <any> newVal[key2]);
|
|
100
|
+
(<any>target)[key][key2] = new target[this.TYPES][key].clazz(newVal[key2]);
|
|
105
101
|
}
|
|
106
102
|
} else if (target[this.TYPES] && target[this.TYPES][key]) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
(<any>target)[key] = subTarget;
|
|
103
|
+
(<any>target)[key] = new target[this.TYPES][key](newVal);
|
|
110
104
|
} else {
|
|
111
105
|
(<any>target)[key] = newVal
|
|
112
106
|
}
|
|
@@ -136,12 +130,12 @@ function mixMaps(target: any, src: any): any {
|
|
|
136
130
|
|
|
137
131
|
export class Probe1Impl implements Probe1 {
|
|
138
132
|
|
|
139
|
-
val1
|
|
140
|
-
val2
|
|
141
|
-
val3
|
|
142
|
-
val4
|
|
143
|
-
val5
|
|
144
|
-
val6
|
|
133
|
+
val1!: string;
|
|
134
|
+
val2!: Date;
|
|
135
|
+
val3!: any;
|
|
136
|
+
val4!: Probe2[];
|
|
137
|
+
val5!: Probe2;
|
|
138
|
+
val6!: any;
|
|
145
139
|
|
|
146
140
|
constructor(data: Probe1, mixin: any = {} /*put your own arguments in here*/) {
|
|
147
141
|
DtoUils.mapIt(this, data, mixMaps({
|
|
@@ -75,11 +75,9 @@ describe('early stream tests', () => {
|
|
|
75
75
|
})
|
|
76
76
|
|
|
77
77
|
it("must have a correct first last", function () {
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
let first = Stream.of<number>(...this.probe).filter((data) => data != 5).onElem((data) => {
|
|
78
|
+
let first = Stream.of<number>(...this.probe).filter((data) => data != 5).onElem(() => {
|
|
81
79
|
}).first().value;
|
|
82
|
-
let last = Stream.of<number>(...this.probe).filter((data) => data != 5).onElem((
|
|
80
|
+
let last = Stream.of<number>(...this.probe).filter((data) => data != 5).onElem(() => {
|
|
83
81
|
}).last().value;
|
|
84
82
|
expect(first).to.eq(1);
|
|
85
83
|
expect(last).to.eq(4);
|
|
@@ -87,8 +85,6 @@ describe('early stream tests', () => {
|
|
|
87
85
|
});
|
|
88
86
|
|
|
89
87
|
it("must have a correct first last lazy", function () {
|
|
90
|
-
let stream = LazyStream.of<number>(...this.probe);
|
|
91
|
-
|
|
92
88
|
let first = LazyStream.of<number>(...this.probe).filter((data) => data != 5).onElem((data) => {
|
|
93
89
|
data;
|
|
94
90
|
}).first().value;
|
|
@@ -102,7 +98,7 @@ describe('early stream tests', () => {
|
|
|
102
98
|
|
|
103
99
|
it("must have a correct limits", function () {
|
|
104
100
|
let cnt = 0;
|
|
105
|
-
let last = Stream.of<number>(...this.probe).filter((data) => data != 5).limits(2).onElem((
|
|
101
|
+
let last = Stream.of<number>(...this.probe).filter((data) => data != 5).limits(2).onElem(() => {
|
|
106
102
|
cnt++;
|
|
107
103
|
}).last().value;
|
|
108
104
|
|
|
@@ -118,8 +114,8 @@ describe('early stream tests', () => {
|
|
|
118
114
|
key3: "val3"
|
|
119
115
|
}
|
|
120
116
|
|
|
121
|
-
let arr1 = [];
|
|
122
|
-
let arr2 = [];
|
|
117
|
+
let arr1: Array<string | number> = [];
|
|
118
|
+
let arr2: Array<string | number> = [];
|
|
123
119
|
|
|
124
120
|
Stream.ofAssoc(probe).each(item => {
|
|
125
121
|
expect(item.length).to.eq(2);
|