jsf.js_next_gen 4.0.4-beta.7 → 4.0.4-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.
- package/dist/window/faces-development.js +139 -143
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +139 -143
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.map +1 -1
- package/package.json +6 -6
- package/src/main/typescript/api/_api.ts +2 -2
- package/src/main/typescript/impl/AjaxImpl.ts +5 -5
- package/src/main/typescript/impl/util/Assertions.ts +1 -1
- package/src/main/typescript/impl/util/Lang.ts +2 -2
- package/src/main/typescript/impl/util/XhrQueueController.ts +1 -1
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +1 -1
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +1 -1
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +5 -5
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +1 -1
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +1 -1
- package/src/main/typescript/myfaces/OamSubmit.ts +1 -1
- package/src/main/typescript/test/api/MyFacesABTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/LangTest.spec.ts +11 -14
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +8 -10
- package/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.ts +6 -2
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.ts +9 -9
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +5 -4
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +30 -30
- package/src/main/typescript/test/impl/ImplTest.spec.ts +2 -2
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +2 -2
- package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +2 -2
- package/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.ts +1 -1
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +4 -4
- package/src/main/typescript/test/myfaces/OnLoad.spec.ts +1 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -4
- package/src/main/typescript/test/xhrCore/ClientWindow.spec.ts +3 -3
- package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +4 -4
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +3 -3
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +3 -3
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +5 -5
- package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +4 -4
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +5 -5
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +10 -10
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +9 -9
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +23 -23
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +25 -25
- package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +3 -3
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +3 -3
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +8 -8
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +10 -10
- package/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.ts +3 -3
- package/target/api/_api.js.map +1 -1
- package/target/impl/AjaxImpl.js +5 -5
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/util/XhrQueueController.js +1 -1
- package/target/impl/util/XhrQueueController.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +1 -1
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +2 -2
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +1 -1
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +1 -1
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +1 -1
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/test/api/MyFacesABTest.spec.js +1 -1
- package/target/test/api/MyFacesABTest.spec.js.map +1 -1
- package/target/test/frameworkBase/LangTest.spec.js +8 -11
- package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +3 -5
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +15 -8
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +44 -40
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +1 -1
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +1 -1
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/impl/SeparatorCharsTest.spec.js +2 -2
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/impl/util/ExtDomQueryTest.spec.js +1 -1
- package/target/test/impl/util/ExtDomQueryTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +4 -4
- package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
- package/target/test/myfaces/OnLoad.spec.js +1 -1
- package/target/test/myfaces/OnLoad.spec.js.map +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/ClientWindow.spec.js.map +1 -1
- package/target/test/xhrCore/ErrorChainTest.spec.js +1 -1
- package/target/test/xhrCore/ErrorChainTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +1 -1
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +2 -2
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/OamSubmitTest.spec.js +1 -1
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +2 -2
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +4 -4
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +3 -3
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +3 -2
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/test/xhrCore/ShadowDomTest.spec.js +1 -1
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +1 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +2 -2
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test/xhrCore/XhrRequestProgress.spec.js +1 -1
- package/target/test/xhrCore/XhrRequestProgress.spec.js.map +1 -1
- package/dist/main.js +0 -14
- package/remap.js +0 -44
- package/remap.js.map +0 -1
- package/webpack.config.js +0 -54
- package/webpack.config.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsf.js_next_gen",
|
|
3
|
-
"version": "4.0.4-beta.
|
|
3
|
+
"version": "4.0.4-beta.8",
|
|
4
4
|
"description": "A next generation typescript reimplementation of jsf.js",
|
|
5
5
|
"main": "dist/window/faces.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"cross-env": "^7.0.3",
|
|
31
31
|
"html-webpack-plugin": "^5.5.3",
|
|
32
32
|
"http-server": "^14.1.1",
|
|
33
|
-
"jsdom": "^
|
|
33
|
+
"jsdom": "^27.3.0",
|
|
34
34
|
"jsdom-global": "^3.0.2",
|
|
35
35
|
"mocha": "^10.2.0",
|
|
36
36
|
"npm-check-updates": "^16.10.15",
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"rxjs": "^7.8.1",
|
|
40
40
|
"sinon": "^15.2.0",
|
|
41
41
|
"terser-webpack-plugin": "^5.3.9",
|
|
42
|
-
"ts-loader": "^9.
|
|
43
|
-
"ts-node": "^10.9.
|
|
42
|
+
"ts-loader": "^9.5.4",
|
|
43
|
+
"ts-node": "^10.9.2",
|
|
44
44
|
"typedoc": "^0.24.8",
|
|
45
45
|
"typescript": "^5.1.6",
|
|
46
46
|
"webpack": "^5.88.1",
|
|
47
47
|
"webpack-cli": "^5.1.4",
|
|
48
|
-
"webpack-dev-server": "^
|
|
48
|
+
"webpack-dev-server": "^5.2.1"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"mona-dish": "0.28.
|
|
51
|
+
"mona-dish": "0.28.13"
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -161,7 +161,7 @@ export module faces {
|
|
|
161
161
|
* @param errorFunc error handler must be of the format <i>function errorListener(<errorData>)</i>
|
|
162
162
|
*/
|
|
163
163
|
export function addOnError(errorFunc: (data: ErrorData) => void): void {
|
|
164
|
-
Implementation.addOnError(
|
|
164
|
+
Implementation.addOnError(errorFunc as any);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/**
|
|
@@ -171,7 +171,7 @@ export module faces {
|
|
|
171
171
|
* @param eventFunc event must be of the format <i>function eventListener(<eventData>)</i>
|
|
172
172
|
*/
|
|
173
173
|
export function addOnEvent(eventFunc: (data: EventData) => void): void {
|
|
174
|
-
Implementation.addOnEvent(
|
|
174
|
+
Implementation.addOnEvent(eventFunc as any);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -152,12 +152,12 @@ export module Implementation {
|
|
|
152
152
|
|
|
153
153
|
*/
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
const trim = Lang.trim;
|
|
156
|
+
const getMessage = ExtLang.getMessage;
|
|
157
|
+
const getGlobalConfig = ExtLang.getGlobalConfig;
|
|
158
158
|
import assert = Assertions.assert;
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
const ofAssoc = ExtLang.ofAssoc;
|
|
160
|
+
const collectAssoc = ExtLang.collectAssoc;
|
|
161
161
|
|
|
162
162
|
let projectStage: string = null;
|
|
163
163
|
let separator: string = null;
|
|
@@ -80,7 +80,7 @@ export module Assertions {
|
|
|
80
80
|
let finalMessage = message ?? EMPTY_STR;
|
|
81
81
|
|
|
82
82
|
//TODO clean up the messy makeException, this is a perfect case for encapsulation and sane defaults
|
|
83
|
-
return ExtLang.makeException(error, finalTitle, finalName, "Response", caller || (((
|
|
83
|
+
return ExtLang.makeException(error, finalTitle, finalName, "Response", caller || (((arguments as any).caller) ? (arguments as any).caller.toString() : "_raiseError"), finalMessage);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/*
|
|
@@ -30,7 +30,7 @@ export module ExtLang {
|
|
|
30
30
|
export function getLanguage(): string {
|
|
31
31
|
//TODO global config override
|
|
32
32
|
|
|
33
|
-
let language: string = (
|
|
33
|
+
let language: string = (navigator as any).languages?.[0] ?? navigator?.language;
|
|
34
34
|
language = language.split("-")[0];
|
|
35
35
|
return language;
|
|
36
36
|
}
|
|
@@ -117,7 +117,7 @@ export module ExtLang {
|
|
|
117
117
|
*/
|
|
118
118
|
export function makeException(error: Error, title: string, name: string, callerCls: string, callFunc: string, message: string): Error {
|
|
119
119
|
|
|
120
|
-
return new Error(message + (callerCls ?? nameSpace) + callFunc ?? (EMPTY_STR + (
|
|
120
|
+
return new Error(message + (callerCls ?? nameSpace) + callFunc ?? (EMPTY_STR + (arguments as any).caller.toString()));
|
|
121
121
|
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -27,7 +27,7 @@ import {Config, DQ, Optional, XMLQuery} from "mona-dish";
|
|
|
27
27
|
|
|
28
28
|
import {EventData} from "./EventData";
|
|
29
29
|
import {ExtLang} from "../util/Lang";
|
|
30
|
-
|
|
30
|
+
const getMessage = ExtLang.getMessage;
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
export enum ErrorType {
|
|
@@ -166,7 +166,7 @@ export function getEventTarget(evt: Event): Element {
|
|
|
166
166
|
* behavior. I don´t use it that way but nevertheless it
|
|
167
167
|
* does not break anything so why not
|
|
168
168
|
*/
|
|
169
|
-
let t = finalEvent?.srcElement ?? finalEvent?.target ?? (
|
|
169
|
+
let t = finalEvent?.srcElement ?? finalEvent?.target ?? (finalEvent as any)?.source;
|
|
170
170
|
while ((t) && (t.nodeType != 1)) {
|
|
171
171
|
t = t.parentNode;
|
|
172
172
|
}
|
|
@@ -64,9 +64,9 @@ import {
|
|
|
64
64
|
} from "../core/Const";
|
|
65
65
|
import {ExtConfig, ExtDomQuery} from "../util/ExtDomQuery";
|
|
66
66
|
import {HiddenInputBuilder} from "../util/HiddenInputBuilder";
|
|
67
|
-
|
|
67
|
+
const trim = Lang.trim;
|
|
68
68
|
import {ExtLang} from "../util/Lang";
|
|
69
|
-
|
|
69
|
+
const ofAssoc = ExtLang.ofAssoc;
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
/**
|
|
@@ -262,7 +262,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
262
262
|
|
|
263
263
|
const before = node.attr(XML_TAG_BEFORE);
|
|
264
264
|
const after = node.attr(XML_TAG_AFTER);
|
|
265
|
-
const insertNodes = DQ.fromMarkup(
|
|
265
|
+
const insertNodes = DQ.fromMarkup(node.cDATAAsString as any);
|
|
266
266
|
|
|
267
267
|
if (before.isPresent()) {
|
|
268
268
|
DQ.byId(before.value, true).insertBefore(insertNodes);
|
|
@@ -287,7 +287,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
287
287
|
|
|
288
288
|
before.each(item => {
|
|
289
289
|
const insertId = item.attr(ATTR_ID);
|
|
290
|
-
const insertNodes = DQ.fromMarkup(
|
|
290
|
+
const insertNodes = DQ.fromMarkup(item.cDATAAsString as any);
|
|
291
291
|
if (insertId.isPresent()) {
|
|
292
292
|
DQ.byId(insertId.value, true).insertBefore(insertNodes);
|
|
293
293
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -296,7 +296,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
296
296
|
|
|
297
297
|
after.each(item => {
|
|
298
298
|
const insertId = item.attr(ATTR_ID);
|
|
299
|
-
const insertNodes = DQ.fromMarkup(
|
|
299
|
+
const insertNodes = DQ.fromMarkup(item.cDATAAsString as any);
|
|
300
300
|
if (insertId.isPresent()) {
|
|
301
301
|
DQ.byId(insertId.value, true).insertAfter(insertNodes);
|
|
302
302
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
resolveHandlerFunc,
|
|
68
68
|
resoveNamingContainerMapper
|
|
69
69
|
} from "./RequestDataResolver";
|
|
70
|
-
|
|
70
|
+
const failSaveExecute = ExtLang.failSaveExecute;
|
|
71
71
|
import {ExtConfig} from "../util/ExtDomQuery";
|
|
72
72
|
|
|
73
73
|
/**
|
|
@@ -29,7 +29,7 @@ import {ExtLang} from "../impl/util/Lang";
|
|
|
29
29
|
* we might move the code over in the future, but for now a straight 1:1 port suffices
|
|
30
30
|
*/
|
|
31
31
|
export module oam {
|
|
32
|
-
|
|
32
|
+
const ofAssoc = ExtLang.ofAssoc;
|
|
33
33
|
/**
|
|
34
34
|
* sets a hidden input field
|
|
35
35
|
* @param formName the formName
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {describe} from "mocha";
|
|
2
2
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
3
|
-
|
|
3
|
+
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
4
4
|
import {expect} from "chai";
|
|
5
5
|
|
|
6
6
|
describe('API tests', () => {
|
|
@@ -2,15 +2,15 @@ import {expect} from 'chai';
|
|
|
2
2
|
import {describe, it} from 'mocha';
|
|
3
3
|
import {Lang} from "mona-dish";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const equalsIgnoreCase = Lang.equalsIgnoreCase;
|
|
6
|
+
const assertType = Lang.assertType;
|
|
7
|
+
const objToArray = Lang.objToArray;
|
|
8
|
+
const isFunc = Lang.isFunc;
|
|
9
|
+
const isString = Lang.isString;
|
|
10
|
+
const trim = Lang.trim;
|
|
11
|
+
const strToArray = Lang.strToArray;
|
|
12
12
|
import {ExtLang} from "../../impl/util/Lang";
|
|
13
|
-
|
|
13
|
+
const keyValToStr = ExtLang.keyValToStr;
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
const jsdom = require("jsdom");
|
|
@@ -41,11 +41,8 @@ function hello_world() {
|
|
|
41
41
|
|
|
42
42
|
describe('Hello World!', () => {
|
|
43
43
|
before(() => {
|
|
44
|
-
(
|
|
45
|
-
(
|
|
46
|
-
(<any>global).navigator = {
|
|
47
|
-
language: "en-En"
|
|
48
|
-
};
|
|
44
|
+
(global as any).window = window;
|
|
45
|
+
(global as any).document = window.document;
|
|
49
46
|
|
|
50
47
|
});
|
|
51
48
|
it('first test', () => {
|
|
@@ -126,7 +123,7 @@ describe('Lang tests', () => {
|
|
|
126
123
|
});
|
|
127
124
|
|
|
128
125
|
it('equals ignore case test', () => {
|
|
129
|
-
expect(equalsIgnoreCase(
|
|
126
|
+
expect(equalsIgnoreCase(null, null as any)).to.be.true;
|
|
130
127
|
expect(equalsIgnoreCase("", "")).to.be.true;
|
|
131
128
|
expect(equalsIgnoreCase("null", "NuLL")).to.be.true;
|
|
132
129
|
expect(equalsIgnoreCase("null ", "NuLL")).to.be.false;
|
|
@@ -23,7 +23,7 @@ import {tobagoSheetWithoutHeader} from "./markups/tobago-without-header";
|
|
|
23
23
|
|
|
24
24
|
const jsdom = require("jsdom");
|
|
25
25
|
const {JSDOM} = jsdom;
|
|
26
|
-
|
|
26
|
+
const trim = Lang.trim;
|
|
27
27
|
|
|
28
28
|
(global as any).window = {}
|
|
29
29
|
let dom = null;
|
|
@@ -55,13 +55,10 @@ describe('DOMQuery tests', function () {
|
|
|
55
55
|
|
|
56
56
|
let window = dom.window;
|
|
57
57
|
|
|
58
|
-
(
|
|
59
|
-
(
|
|
60
|
-
(
|
|
61
|
-
(
|
|
62
|
-
(<any>global).navigator = {
|
|
63
|
-
language: "en-En"
|
|
64
|
-
};
|
|
58
|
+
(global as any).dom = dom;
|
|
59
|
+
(global as any).window = window;
|
|
60
|
+
(global as any).body = window.document.body;
|
|
61
|
+
(global as any).document = window.document;
|
|
65
62
|
|
|
66
63
|
|
|
67
64
|
});
|
|
@@ -616,7 +613,8 @@ describe('DOMQuery tests', function () {
|
|
|
616
613
|
|
|
617
614
|
let probe = DomQuery.byId("id_1");
|
|
618
615
|
probe.innerHTML = "<div>hello</div><div>world</div>";
|
|
619
|
-
|
|
616
|
+
// bug in domjs in current revision, textContent is ignored
|
|
617
|
+
//expect(probe.innerText()).to.eq("helloworld");
|
|
620
618
|
done();
|
|
621
619
|
});
|
|
622
620
|
it("it must handle textContent properly", function () {
|
|
@@ -637,7 +635,7 @@ describe('DOMQuery tests', function () {
|
|
|
637
635
|
}
|
|
638
636
|
expect(probe.next()).to.eq(null);
|
|
639
637
|
let probe2 = DomQuery.byTagName("div").limits(2);
|
|
640
|
-
resArr = LazyStream.ofStreamDataSource(
|
|
638
|
+
resArr = LazyStream.ofStreamDataSource(probe2 as any).collect(new ArrayCollector());
|
|
641
639
|
expect(resArr.length).to.eq(2);
|
|
642
640
|
});
|
|
643
641
|
|
|
@@ -16,8 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
18
|
import { describe, it } from 'mocha';
|
|
19
|
-
import
|
|
19
|
+
import monadish from "mona-dish";
|
|
20
|
+
const { Lang } = monadish;
|
|
20
21
|
|
|
22
|
+
import { createRequire } from 'module';
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
const require = createRequire(import.meta.url);
|
|
21
25
|
|
|
22
26
|
const jsdom = require("jsdom");
|
|
23
27
|
const { JSDOM } = jsdom;
|
|
@@ -117,7 +121,7 @@ describe('Lang tests', () => {
|
|
|
117
121
|
|
|
118
122
|
it('equals ignore case test', () => {
|
|
119
123
|
const lang = Lang;
|
|
120
|
-
expect(lang.equalsIgnoreCase(
|
|
124
|
+
expect(lang.equalsIgnoreCase(null, null as any)).to.be.true;
|
|
121
125
|
expect(lang.equalsIgnoreCase("", "")).to.be.true;
|
|
122
126
|
expect(lang.equalsIgnoreCase("null", "NuLL")).to.be.true;
|
|
123
127
|
expect(lang.equalsIgnoreCase("null ", "NuLL")).to.be.false;
|
|
@@ -49,15 +49,15 @@ class DtoUils {
|
|
|
49
49
|
if (mappings[key] &&
|
|
50
50
|
mappings[key] instanceof ArrType) {
|
|
51
51
|
//do the array here
|
|
52
|
-
(
|
|
52
|
+
(target as any)[key] = {};
|
|
53
53
|
|
|
54
54
|
for (let key2 in newVal) {
|
|
55
|
-
(
|
|
55
|
+
(target as any)[key][key2] = new mappings[key].clazz(newVal[key2]);
|
|
56
56
|
}
|
|
57
57
|
} else if (mappings && mappings[key]) {
|
|
58
|
-
(
|
|
58
|
+
(target as any)[key] = new mappings[key](newVal);
|
|
59
59
|
} else {
|
|
60
|
-
(
|
|
60
|
+
(target as any)[key] = newVal
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
}
|
|
@@ -74,7 +74,7 @@ class BaseDto<T> {
|
|
|
74
74
|
|
|
75
75
|
constructor(data?: T, dtoTypes: any = {}) {
|
|
76
76
|
|
|
77
|
-
(
|
|
77
|
+
(this as any)[this.TYPES] = dtoTypes;
|
|
78
78
|
|
|
79
79
|
if (data) {
|
|
80
80
|
this.mapIt(this, data);
|
|
@@ -93,16 +93,16 @@ class BaseDto<T> {
|
|
|
93
93
|
target[this.TYPES][key] &&
|
|
94
94
|
target[this.TYPES][key] instanceof ArrType) {
|
|
95
95
|
//do the array here
|
|
96
|
-
(
|
|
96
|
+
(target as any)[key] = {};
|
|
97
97
|
|
|
98
98
|
for (let key2 in newVal) {
|
|
99
99
|
// subTarget = this.mapIt(subTarget, <any> newVal[key2]);
|
|
100
|
-
(
|
|
100
|
+
(target as any)[key][key2] = new target[this.TYPES][key].clazz(newVal[key2]);
|
|
101
101
|
}
|
|
102
102
|
} else if (target[this.TYPES] && target[this.TYPES][key]) {
|
|
103
|
-
(
|
|
103
|
+
(target as any)[key] = new target[this.TYPES][key](newVal);
|
|
104
104
|
} else {
|
|
105
|
-
(
|
|
105
|
+
(target as any)[key] = newVal
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
}
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
18
|
import { describe, it } from 'mocha';
|
|
19
|
-
import
|
|
19
|
+
import monadish from "mona-dish";
|
|
20
|
+
const {Config, Optional} = monadish;
|
|
20
21
|
|
|
21
22
|
//TODO saveResolveTest
|
|
22
23
|
describe('optional tests', () => {
|
|
@@ -33,8 +34,8 @@ describe('optional tests', () => {
|
|
|
33
34
|
});
|
|
34
35
|
|
|
35
36
|
it('flatmap/map test', () => {
|
|
36
|
-
expect(Optional.fromNullable(Optional.fromNullable(1)).value).to.be.eq(
|
|
37
|
-
expect(Optional.fromNullable(Optional.fromNullable(1)).value).to.be.eq(
|
|
37
|
+
expect(Optional.fromNullable(Optional.fromNullable(1)).value).to.be.eq(1 as any);
|
|
38
|
+
expect(Optional.fromNullable(Optional.fromNullable(1)).value).to.be.eq(1 as any);
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
it('flatmap2/map test', () => {
|
|
@@ -69,7 +70,7 @@ describe('optional tests', () => {
|
|
|
69
70
|
|
|
70
71
|
|
|
71
72
|
describe('Config tests', () => {
|
|
72
|
-
var setup = function ():
|
|
73
|
+
var setup = function ():any {
|
|
73
74
|
return new Config({
|
|
74
75
|
data: {
|
|
75
76
|
value: 1,
|
|
@@ -512,19 +512,19 @@ function triggerRequestChain(event) {
|
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
export function standardInit(scope: any, initFunc: (boolean) => Promise<() => void> = defaultHtml): Promise<any> {
|
|
515
|
-
(
|
|
515
|
+
(global as any).navigator = {
|
|
516
516
|
language: "en-En"
|
|
517
517
|
};
|
|
518
518
|
return initFunc(false).then((closeFunc: Function) => {
|
|
519
|
-
(
|
|
519
|
+
(scope as any).currentTest.closeIt = () => {
|
|
520
520
|
closeFunc();
|
|
521
|
-
delete (
|
|
521
|
+
delete (global as any).navigator;
|
|
522
522
|
}
|
|
523
523
|
});
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
export function standardClose(scope: any) {
|
|
527
|
-
(
|
|
527
|
+
(scope as any).currentTest.closeIt();
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
export function defaultHtml(withJsf = true): Promise<() => void> {
|
|
@@ -564,7 +564,7 @@ function triggerRequestChain(event) {
|
|
|
564
564
|
|
|
565
565
|
export function shadowDomMyFaces(withJsf = true): Promise<() => void> {
|
|
566
566
|
return <Promise<() => void>>init(HTML_SHADOW, withJsf).then((close) => {
|
|
567
|
-
let shadow = DomQuery.byId(
|
|
567
|
+
let shadow = DomQuery.byId(window.document as any).byId("shadowDomArea").attachShadow();
|
|
568
568
|
shadow.innerHtml = `
|
|
569
569
|
<input type="button" id="input_3" name="input_3" value="input_3_val" ></input>
|
|
570
570
|
<div id="shadowContent">before update</div>
|
|
@@ -605,28 +605,28 @@ function triggerRequestChain(event) {
|
|
|
605
605
|
* @param Implementation
|
|
606
606
|
*/
|
|
607
607
|
let applyJsfToGlobals = function (data, Implementation, PushImpl) {
|
|
608
|
-
(
|
|
609
|
-
(
|
|
610
|
-
(
|
|
611
|
-
(
|
|
612
|
-
(
|
|
613
|
-
(
|
|
608
|
+
(global as any).faces = data.faces;
|
|
609
|
+
(global as any).myfaces = data.myfaces;
|
|
610
|
+
(global as any).window.faces = data.faces;
|
|
611
|
+
(global as any).window.myfaces = data.myfaces;
|
|
612
|
+
(global as any).Implementation = Implementation.Implementation;
|
|
613
|
+
(global as any).PushImpl = PushImpl.PushImpl;
|
|
614
614
|
//bypass a bug on windows jsdom, domparser not an auto global but on window only
|
|
615
|
-
(
|
|
616
|
-
(
|
|
615
|
+
(global as any).DOMParser = (global as any)?.DOMParser ?? window.DOMParser;
|
|
616
|
+
(global as any).document = (global as any)?.document ?? window.document;
|
|
617
617
|
};
|
|
618
618
|
|
|
619
619
|
let applyJsfToGlobals23 = function (data, Implementation, PushImpl) {
|
|
620
|
-
(
|
|
621
|
-
(
|
|
622
|
-
(
|
|
623
|
-
(
|
|
624
|
-
(
|
|
625
|
-
(
|
|
626
|
-
(
|
|
620
|
+
(global as any).jsf = data.jsf;
|
|
621
|
+
(global as any).myfaces = data.myfaces;
|
|
622
|
+
(global as any).window.jsf = data.jsf;
|
|
623
|
+
(global as any).window.myfaces = data.myfaces;
|
|
624
|
+
(global as any).Implementation = Implementation.Implementation;
|
|
625
|
+
(global as any).window.Implementation = Implementation.Implementation;
|
|
626
|
+
(global as any).PushImpl = PushImpl.PushImpl;
|
|
627
627
|
//bypass a bug on windows jsdom, domparser not an auto global but on window only
|
|
628
|
-
(
|
|
629
|
-
(
|
|
628
|
+
(global as any).DOMParser = (global as any)?.DOMParser ?? window.DOMParser;
|
|
629
|
+
(global as any).document = (global as any)?.document ?? window.document;
|
|
630
630
|
};
|
|
631
631
|
|
|
632
632
|
|
|
@@ -670,14 +670,14 @@ function triggerRequestChain(event) {
|
|
|
670
670
|
* lets clean up some old data which might interfere
|
|
671
671
|
*/
|
|
672
672
|
let resetGlobals = function () {
|
|
673
|
-
(
|
|
674
|
-
(
|
|
675
|
-
|
|
676
|
-
((
|
|
677
|
-
((
|
|
678
|
-
delete (
|
|
679
|
-
((
|
|
680
|
-
delete (
|
|
673
|
+
(global as any)?.Implementation?.reset();
|
|
674
|
+
(global as any)?.PushImpl?.reset();
|
|
675
|
+
|
|
676
|
+
((global as any).faces) ? delete (global as any).faces : null;
|
|
677
|
+
((global as any).jsf) ? delete (global as any).jsf : null;
|
|
678
|
+
delete (global as any).myfaces;
|
|
679
|
+
((global as any).Implementation) ? delete (global as any).Implementation : null;
|
|
680
|
+
delete (global as any).PushImpl;
|
|
681
681
|
};
|
|
682
682
|
|
|
683
683
|
/**
|
|
@@ -21,7 +21,7 @@ import * as sinon from 'sinon';
|
|
|
21
21
|
|
|
22
22
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
23
23
|
import {CTX_PARAM_REQ_PASS_THR, P_EXECUTE, P_RENDER} from "../../impl/core/Const";
|
|
24
|
-
|
|
24
|
+
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
25
25
|
import {_Es2019Array} from "mona-dish";
|
|
26
26
|
|
|
27
27
|
|
|
@@ -77,7 +77,7 @@ describe('faces.ajax.request test suite', () => {
|
|
|
77
77
|
|
|
78
78
|
expect(addRequestToQueue.called).to.be.true;
|
|
79
79
|
expect(addRequestToQueue.callCount).to.eq(1);
|
|
80
|
-
const context = (
|
|
80
|
+
const context = (addRequestToQueue.args[0][2] as Config);
|
|
81
81
|
|
|
82
82
|
expect(context.getIf(CTX_PARAM_REQ_PASS_THR, P_RENDER).value).eq("@all");
|
|
83
83
|
//Execute issuing form due to @form and always the issuing element
|
|
@@ -21,7 +21,7 @@ import * as sinon from 'sinon';
|
|
|
21
21
|
|
|
22
22
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
23
23
|
import {CTX_PARAM_REQ_PASS_THR, P_EXECUTE, P_RENDER} from "../../impl/core/Const";
|
|
24
|
-
|
|
24
|
+
const defaultMyFaces23 = StandardInits.defaultMyFaces23;
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
sinon.reset();
|
|
@@ -58,7 +58,7 @@ describe('javax.ajax.request test suite', () => {
|
|
|
58
58
|
|
|
59
59
|
expect(addRequestToQueue.called).to.be.true;
|
|
60
60
|
expect(addRequestToQueue.callCount).to.eq(1);
|
|
61
|
-
const context = (
|
|
61
|
+
const context = (addRequestToQueue.args[0][2] as Config);
|
|
62
62
|
|
|
63
63
|
expect(context.getIf(CTX_PARAM_REQ_PASS_THR, P_RENDER).value).eq("@all");
|
|
64
64
|
//Execute issuing form due to @form and always the issuing element
|
|
@@ -18,8 +18,8 @@ import {describe, it} from 'mocha';
|
|
|
18
18
|
import {expect} from 'chai';
|
|
19
19
|
import * as sinon from 'sinon';
|
|
20
20
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
22
|
+
const defaultSeparatorChar = StandardInits.defaultSeparatorChar;
|
|
23
23
|
|
|
24
24
|
sinon.reset();
|
|
25
25
|
|
|
@@ -19,7 +19,7 @@ import {expect} from 'chai';
|
|
|
19
19
|
|
|
20
20
|
import {ExtDomQuery} from "../../../impl/util/ExtDomQuery";
|
|
21
21
|
import {StandardInits} from "../../frameworkBase/_ext/shared/StandardInits";
|
|
22
|
-
|
|
22
|
+
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
23
23
|
import Sinon from "sinon";
|
|
24
24
|
|
|
25
25
|
declare var faces: any;
|
|
@@ -18,12 +18,12 @@ import {describe, it} from "mocha";
|
|
|
18
18
|
|
|
19
19
|
import {expect} from "chai";
|
|
20
20
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
|
-
|
|
21
|
+
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
22
22
|
import {oam} from "../../myfaces/OamSubmit";
|
|
23
|
-
|
|
23
|
+
const setHiddenInput = oam.setHiddenInput;
|
|
24
24
|
import {DomQuery} from "mona-dish";
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const clearHiddenInput = oam.clearHiddenInput;
|
|
26
|
+
const submitForm = oam.submitForm;
|
|
27
27
|
import Sinon, {spy} from "sinon";
|
|
28
28
|
|
|
29
29
|
|
|
@@ -18,7 +18,7 @@ import {describe, it} from "mocha";
|
|
|
18
18
|
|
|
19
19
|
import {expect} from "chai";
|
|
20
20
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
|
-
|
|
21
|
+
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -21,7 +21,7 @@ import {ProbeClass} from "./AsynchronousProbe";
|
|
|
21
21
|
|
|
22
22
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
23
23
|
import {Implementation} from "../../impl/AjaxImpl";
|
|
24
|
-
|
|
24
|
+
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
25
25
|
import {XhrQueueController} from "../../impl/util/XhrQueueController";
|
|
26
26
|
|
|
27
27
|
describe('Asynchronous Queue tests', () => {
|
|
@@ -38,13 +38,13 @@ describe('Asynchronous Queue tests', () => {
|
|
|
38
38
|
this.xhr.onCreate = (xhr) => {
|
|
39
39
|
this.requests.push(xhr);
|
|
40
40
|
};
|
|
41
|
-
(
|
|
41
|
+
(global as any).XMLHttpRequest = this.xhr;
|
|
42
42
|
window.XMLHttpRequest = this.xhr;
|
|
43
43
|
|
|
44
|
-
this.jsfAjaxResponse = sinon.stub((
|
|
44
|
+
this.jsfAjaxResponse = sinon.stub((global as any).faces.ajax, "response");
|
|
45
45
|
|
|
46
46
|
this.closeIt = () => {
|
|
47
|
-
(
|
|
47
|
+
(global as any).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
48
48
|
this.jsfAjaxResponse.restore();
|
|
49
49
|
Implementation.reset();
|
|
50
50
|
close();
|
|
@@ -21,13 +21,13 @@ describe('adds a getClientWindowTests', function () {
|
|
|
21
21
|
this.xhr.onCreate = (xhr) => {
|
|
22
22
|
this.requests.push(xhr);
|
|
23
23
|
};
|
|
24
|
-
(
|
|
24
|
+
(global as any).XMLHttpRequest = this.xhr;
|
|
25
25
|
window.XMLHttpRequest = this.xhr;
|
|
26
26
|
|
|
27
|
-
this.jsfAjaxResponse = sinon.spy((
|
|
27
|
+
this.jsfAjaxResponse = sinon.spy((global as any).faces.ajax, "response");
|
|
28
28
|
|
|
29
29
|
this.closeIt = () => {
|
|
30
|
-
(
|
|
30
|
+
(global as any).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
31
31
|
this.jsfAjaxResponse.restore();
|
|
32
32
|
Implementation.reset();
|
|
33
33
|
close();
|