@schukai/monster 4.128.3 → 4.129.0
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/package.json +1 -1
- package/source/components/datatable/datatable.mjs +4 -1
- package/source/components/datatable/pagination.mjs +39 -1
- package/source/components/form/login.mjs +197 -0
- package/source/components/form/select.mjs +4 -4
- package/source/components/form/tree-select.mjs +2 -2
- package/source/dom/customelement.mjs +182 -2
- package/source/types/version.mjs +1 -1
- package/test/cases/components/form/login.mjs +168 -0
- package/test/cases/components/form/select.mjs +24 -0
- package/test/cases/components/form/tree-select.mjs +22 -1
- package/test/cases/monster.mjs +1 -1
- package/test/web/import.js +1 -0
- package/test/web/test.html +2 -2
- package/test/web/tests.js +9300 -6050
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import * as chai from "chai";
|
|
2
|
+
import { chaiDom } from "../../../util/chai-dom.mjs";
|
|
3
|
+
import { initJSDOM } from "../../../util/jsdom.mjs";
|
|
4
|
+
|
|
5
|
+
let expect = chai.expect;
|
|
6
|
+
chai.use(chaiDom);
|
|
7
|
+
|
|
8
|
+
let Login;
|
|
9
|
+
|
|
10
|
+
describe("Login", function () {
|
|
11
|
+
before(function (done) {
|
|
12
|
+
initJSDOM().then(() => {
|
|
13
|
+
import("element-internals-polyfill")
|
|
14
|
+
.then(() => import("../../../../source/components/form/login.mjs"))
|
|
15
|
+
.then((module) => {
|
|
16
|
+
Login = module.Login;
|
|
17
|
+
done();
|
|
18
|
+
})
|
|
19
|
+
.catch((error) => done(error));
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
document.getElementById("mocks").innerHTML = "";
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
document.getElementById("mocks").innerHTML = "";
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("should create a monster-login element", function () {
|
|
32
|
+
expect(document.createElement("monster-login")).is.instanceof(Login);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("should respect the native hidden attribute on the host", function (done) {
|
|
36
|
+
const login = document.createElement("monster-login");
|
|
37
|
+
login.setAttribute("hidden", "");
|
|
38
|
+
document.getElementById("mocks").appendChild(login);
|
|
39
|
+
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
try {
|
|
42
|
+
expect(login.hidden).to.be.true;
|
|
43
|
+
expect(login.visible).to.be.false;
|
|
44
|
+
expect(login.isVisible).to.be.false;
|
|
45
|
+
done();
|
|
46
|
+
} catch (error) {
|
|
47
|
+
done(error);
|
|
48
|
+
}
|
|
49
|
+
}, 100);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("should hide and show the host with the public visibility API", function (done) {
|
|
53
|
+
const login = document.createElement("monster-login");
|
|
54
|
+
document.getElementById("mocks").appendChild(login);
|
|
55
|
+
|
|
56
|
+
const states = [];
|
|
57
|
+
login.addEventListener("monster-visibility-changed", (event) => {
|
|
58
|
+
states.push(event.detail.visible);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
try {
|
|
63
|
+
const username = login.shadowRoot.querySelector("input[name='username']");
|
|
64
|
+
username.focus();
|
|
65
|
+
|
|
66
|
+
login.hide();
|
|
67
|
+
} catch (error) {
|
|
68
|
+
done(error);
|
|
69
|
+
}
|
|
70
|
+
}, 150);
|
|
71
|
+
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
try {
|
|
74
|
+
expect(login.hidden).to.be.true;
|
|
75
|
+
expect(login.visible).to.be.false;
|
|
76
|
+
|
|
77
|
+
login.show();
|
|
78
|
+
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
try {
|
|
81
|
+
expect(login.hidden).to.be.false;
|
|
82
|
+
expect(login.visible).to.be.true;
|
|
83
|
+
expect(states).to.deep.equal([false, true]);
|
|
84
|
+
done();
|
|
85
|
+
} catch (error) {
|
|
86
|
+
done(error);
|
|
87
|
+
}
|
|
88
|
+
}, 25);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
done(error);
|
|
91
|
+
}
|
|
92
|
+
}, 200);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it("should keep host visibility separate from openLogin", function (done) {
|
|
96
|
+
const login = document.createElement("monster-login");
|
|
97
|
+
document.getElementById("mocks").appendChild(login);
|
|
98
|
+
|
|
99
|
+
setTimeout(() => {
|
|
100
|
+
try {
|
|
101
|
+
login.hide();
|
|
102
|
+
login.openLogin();
|
|
103
|
+
|
|
104
|
+
expect(login.hidden).to.be.true;
|
|
105
|
+
expect(login.visible).to.be.false;
|
|
106
|
+
done();
|
|
107
|
+
} catch (error) {
|
|
108
|
+
done(error);
|
|
109
|
+
}
|
|
110
|
+
}, 150);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("should show the custom collapse and close the login collapse", function (done) {
|
|
114
|
+
const login = document.createElement("monster-login");
|
|
115
|
+
document.getElementById("mocks").appendChild(login);
|
|
116
|
+
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
try {
|
|
119
|
+
const loginCollapse = login.shadowRoot.querySelector(
|
|
120
|
+
'[data-monster-role="login-collapse"]',
|
|
121
|
+
);
|
|
122
|
+
const customCollapse = login.shadowRoot.querySelector(
|
|
123
|
+
'[data-monster-role="custom-collapse"]',
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
expect(loginCollapse.isOpen()).to.be.true;
|
|
127
|
+
expect(customCollapse.isClosed()).to.be.true;
|
|
128
|
+
|
|
129
|
+
const button = document.createElement("button");
|
|
130
|
+
button.textContent = "Weiter";
|
|
131
|
+
|
|
132
|
+
login.showCustomCollapse({
|
|
133
|
+
header: "Hinweis",
|
|
134
|
+
content: ["Manueller Inhalt", button],
|
|
135
|
+
footer: "Footer",
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
setTimeout(() => {
|
|
139
|
+
try {
|
|
140
|
+
expect(customCollapse.isOpen()).to.be.true;
|
|
141
|
+
expect(loginCollapse.isClosed()).to.be.true;
|
|
142
|
+
expect(
|
|
143
|
+
login.shadowRoot.getElementById("customCollapseHeader").textContent,
|
|
144
|
+
).to.equal("Hinweis");
|
|
145
|
+
expect(
|
|
146
|
+
login.shadowRoot
|
|
147
|
+
.getElementById("customCollapseContent")
|
|
148
|
+
.textContent.includes("Manueller Inhalt"),
|
|
149
|
+
).to.be.true;
|
|
150
|
+
expect(
|
|
151
|
+
login.shadowRoot
|
|
152
|
+
.getElementById("customCollapseContent")
|
|
153
|
+
.querySelector("button"),
|
|
154
|
+
).to.equal(button);
|
|
155
|
+
expect(
|
|
156
|
+
login.shadowRoot.getElementById("customCollapseFooter").textContent,
|
|
157
|
+
).to.equal("Footer");
|
|
158
|
+
done();
|
|
159
|
+
} catch (error) {
|
|
160
|
+
done(error);
|
|
161
|
+
}
|
|
162
|
+
}, 700);
|
|
163
|
+
} catch (error) {
|
|
164
|
+
done(error);
|
|
165
|
+
}
|
|
166
|
+
}, 150);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
@@ -371,6 +371,30 @@ describe('Select', function () {
|
|
|
371
371
|
|
|
372
372
|
});
|
|
373
373
|
|
|
374
|
+
it('should expose styling parts for container, filter messages and pagination', function (done) {
|
|
375
|
+
|
|
376
|
+
let mocks = document.getElementById('mocks');
|
|
377
|
+
const select = document.createElement('monster-select');
|
|
378
|
+
select.setOption('filter.mode', 'remote');
|
|
379
|
+
mocks.appendChild(select);
|
|
380
|
+
|
|
381
|
+
setTimeout(() => {
|
|
382
|
+
try {
|
|
383
|
+
const container = select.shadowRoot.querySelector('[data-monster-role=container]');
|
|
384
|
+
const selectionMessages = select.shadowRoot.querySelector('[data-monster-role=selection-messages]');
|
|
385
|
+
const pagination = select.shadowRoot.querySelector('[data-monster-role=pagination]');
|
|
386
|
+
|
|
387
|
+
expect(container.getAttribute('part')).to.equal('container');
|
|
388
|
+
expect(selectionMessages.getAttribute('part')).to.equal('selection-messages');
|
|
389
|
+
expect(pagination.getAttribute('part')).to.equal('pagination');
|
|
390
|
+
} catch (e) {
|
|
391
|
+
return done(e);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
done();
|
|
395
|
+
}, 0)
|
|
396
|
+
});
|
|
397
|
+
|
|
374
398
|
it('should normalize options without throwing', function (done) {
|
|
375
399
|
this.timeout(2000);
|
|
376
400
|
|
|
@@ -212,7 +212,28 @@ describe('Treeselect', function () {
|
|
|
212
212
|
|
|
213
213
|
});
|
|
214
214
|
|
|
215
|
+
it('should expose styling parts for container and popper filter control', function (done) {
|
|
216
|
+
|
|
217
|
+
let mocks = document.getElementById('mocks');
|
|
218
|
+
const select = document.createElement('monster-tree-select');
|
|
219
|
+
mocks.appendChild(select);
|
|
220
|
+
|
|
221
|
+
setTimeout(() => {
|
|
222
|
+
try {
|
|
223
|
+
const container = select.shadowRoot.querySelector('[data-monster-role=container]');
|
|
224
|
+
const popperFilterControl = select.shadowRoot.querySelector('.option-filter-control');
|
|
225
|
+
|
|
226
|
+
expect(container.getAttribute('part')).to.equal('container');
|
|
227
|
+
expect(popperFilterControl.getAttribute('part')).to.equal('popper-filter-control');
|
|
228
|
+
} catch (e) {
|
|
229
|
+
return done(e);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
done();
|
|
233
|
+
}, 0)
|
|
234
|
+
});
|
|
235
|
+
|
|
215
236
|
});
|
|
216
237
|
|
|
217
238
|
|
|
218
|
-
});
|
|
239
|
+
});
|
package/test/cases/monster.mjs
CHANGED
package/test/web/import.js
CHANGED
|
@@ -10,6 +10,7 @@ import "../cases/components/form/button-bar.mjs";
|
|
|
10
10
|
import "../cases/components/form/reload.mjs";
|
|
11
11
|
import "../cases/components/form/state-button.mjs";
|
|
12
12
|
import "../cases/components/form/select.mjs";
|
|
13
|
+
import "../cases/components/form/login.mjs";
|
|
13
14
|
import "../cases/components/form/confirm-button.mjs";
|
|
14
15
|
import "../cases/components/form/form.mjs";
|
|
15
16
|
import "../cases/components/form/tree-select.mjs";
|
package/test/web/test.html
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
|
|
12
|
-
<h1 style='margin-bottom: 0.1em;'>Monster 4.128.
|
|
13
|
-
<div id="lastupdate" style='font-size:0.7em'>last update
|
|
12
|
+
<h1 style='margin-bottom: 0.1em;'>Monster 4.128.3</h1>
|
|
13
|
+
<div id="lastupdate" style='font-size:0.7em'>last update So 5. Apr 19:19:33 CEST 2026</div>
|
|
14
14
|
</div>
|
|
15
15
|
<div id="mocha-errors"
|
|
16
16
|
style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>
|