@schukai/monster 3.55.1 → 3.55.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +18 -0
- package/package.json +1 -1
- package/source/components/datatable/datasource/rest.mjs +358 -314
- package/source/components/datatable/filter.mjs +7 -3
- package/source/components/datatable/stylesheet/column-bar.mjs +7 -13
- package/source/components/datatable/stylesheet/dataset.mjs +7 -13
- package/source/components/datatable/stylesheet/datasource.mjs +7 -13
- package/source/components/datatable/stylesheet/datatable.mjs +7 -13
- package/source/components/datatable/stylesheet/embedded-pagination.mjs +7 -13
- package/source/components/datatable/stylesheet/filter-button.mjs +7 -13
- package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +7 -13
- package/source/components/datatable/stylesheet/filter-date-range.mjs +7 -13
- package/source/components/datatable/stylesheet/filter-range.mjs +7 -13
- package/source/components/datatable/stylesheet/filter.mjs +7 -13
- package/source/components/datatable/stylesheet/pagination.mjs +7 -13
- package/source/components/datatable/stylesheet/select-filter.mjs +7 -13
- package/source/components/datatable/stylesheet/status.mjs +7 -13
- package/source/components/form/select.mjs +1812 -1638
- package/source/components/form/stylesheet/action-button.mjs +7 -13
- package/source/components/form/stylesheet/api-button.mjs +7 -13
- package/source/components/form/stylesheet/button-bar.mjs +7 -13
- package/source/components/form/stylesheet/button.mjs +7 -13
- package/source/components/form/stylesheet/confirm-button.mjs +7 -13
- package/source/components/form/stylesheet/context-error.mjs +7 -13
- package/source/components/form/stylesheet/context-help.mjs +7 -13
- package/source/components/form/stylesheet/form.mjs +7 -13
- package/source/components/form/stylesheet/message-state-button.mjs +7 -13
- package/source/components/form/stylesheet/popper-button.mjs +7 -13
- package/source/components/form/stylesheet/popper.mjs +7 -13
- package/source/components/form/stylesheet/select.mjs +7 -13
- package/source/components/form/stylesheet/state-button.mjs +7 -13
- package/source/components/form/stylesheet/tabs.mjs +7 -13
- package/source/components/form/stylesheet/tree-select.mjs +7 -13
- package/source/components/form/tree-select.mjs +12 -3
- package/source/components/host/stylesheet/call-button.mjs +7 -13
- package/source/components/host/stylesheet/collapse.mjs +7 -13
- package/source/components/host/stylesheet/config-manager.mjs +7 -13
- package/source/components/host/stylesheet/details.mjs +7 -13
- package/source/components/host/stylesheet/host.mjs +7 -13
- package/source/components/host/stylesheet/overlay.mjs +7 -13
- package/source/components/host/stylesheet/toggle-button.mjs +7 -13
- package/source/components/host/stylesheet/viewer.mjs +7 -13
- package/source/components/notify/stylesheet/message.mjs +7 -13
- package/source/components/notify/stylesheet/notify.mjs +7 -13
- package/source/components/state/stylesheet/log.mjs +7 -13
- package/source/components/state/stylesheet/state.mjs +7 -13
- package/source/components/stylesheet/badge.mjs +7 -13
- package/source/components/stylesheet/border.mjs +7 -13
- package/source/components/stylesheet/button.mjs +7 -13
- package/source/components/stylesheet/card.mjs +7 -13
- package/source/components/stylesheet/color.mjs +7 -13
- package/source/components/stylesheet/common.mjs +7 -13
- package/source/components/stylesheet/control.mjs +7 -13
- package/source/components/stylesheet/data-grid.mjs +7 -13
- package/source/components/stylesheet/display.mjs +7 -13
- package/source/components/stylesheet/floating-ui.mjs +7 -13
- package/source/components/stylesheet/form.mjs +7 -13
- package/source/components/stylesheet/host.mjs +7 -13
- package/source/components/stylesheet/icons.mjs +7 -13
- package/source/components/stylesheet/link.mjs +7 -13
- package/source/components/stylesheet/normalize.mjs +7 -13
- package/source/components/stylesheet/popper.mjs +7 -13
- package/source/components/stylesheet/property.mjs +7 -13
- package/source/components/stylesheet/ripple.mjs +7 -13
- package/source/components/stylesheet/skeleton.mjs +7 -13
- package/source/components/stylesheet/space.mjs +7 -13
- package/source/components/stylesheet/spinner.mjs +7 -13
- package/source/components/stylesheet/table.mjs +7 -13
- package/source/components/stylesheet/theme.mjs +7 -13
- package/source/components/stylesheet/typography.mjs +7 -13
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +7 -13
- package/source/data/datasource/server/restapi.mjs +1 -0
- package/source/data/extend.mjs +56 -47
- package/source/dom/customelement.mjs +9 -4
- package/source/dom/util/init-options-from-attributes.mjs +0 -1
- package/source/monster.mjs +1 -0
- package/source/types/version.mjs +1 -1
- package/test/cases/components/form/button.mjs +1 -1
- package/test/cases/components/form/confirm-button.mjs +1 -1
- package/test/cases/components/form/reload.mjs +1 -1
- package/test/cases/components/form/select.mjs +25 -29
- package/test/cases/components/form/state-button.mjs +1 -1
- package/test/cases/components/form/tabs.mjs +1 -1
- package/test/cases/components/form/template.mjs +1 -1
- package/test/cases/components/form/tree-select.mjs +26 -18
- package/test/cases/data/extend.mjs +43 -2
- package/test/cases/monster.mjs +1 -1
- package/test/web/test.html +2 -2
- package/test/web/tests.js +5 -0
@@ -2,6 +2,7 @@ import {getGlobal} from "../../../../source/types/global.mjs";
|
|
2
2
|
import chai from "chai"
|
3
3
|
import {chaiDom} from "../../../util/chai-dom.mjs";
|
4
4
|
import {initJSDOM} from "../../../util/jsdom.mjs";
|
5
|
+
import {ResizeObserverMock} from "../../../util/resize-observer.mjs";
|
5
6
|
|
6
7
|
let expect = chai.expect;
|
7
8
|
chai.use(chaiDom);
|
@@ -42,6 +43,10 @@ describe('Select', function () {
|
|
42
43
|
|
43
44
|
fetchReference = global['fetch'];
|
44
45
|
|
46
|
+
if (!global.ResizeObserver) {
|
47
|
+
global.ResizeObserver = ResizeObserverMock;
|
48
|
+
}
|
49
|
+
|
45
50
|
import("../../../../source/components/form/select.mjs").then((m) => {
|
46
51
|
Select = m['Select'];
|
47
52
|
done()
|
@@ -141,7 +146,7 @@ describe('Select', function () {
|
|
141
146
|
expect(select).is.instanceof(Select);
|
142
147
|
});
|
143
148
|
|
144
|
-
it('should
|
149
|
+
it('should have options', function (done) {
|
145
150
|
|
146
151
|
let mocks = document.getElementById('mocks');
|
147
152
|
const select = document.createElement('monster-select');
|
@@ -150,41 +155,32 @@ describe('Select', function () {
|
|
150
155
|
select.setOption('mapping.labelTemplate', '${id}')
|
151
156
|
select.setOption('mapping.valueTemplate', '${id}')
|
152
157
|
|
153
|
-
|
154
|
-
|
155
|
-
for (const [, mutation] of mutations.entries()) {
|
156
|
-
if (mutation.addedNodes[0].tagName === 'MONSTER-SELECT') {
|
157
|
-
|
158
|
-
setTimeout(() => {
|
159
|
-
mutationobserver.disconnect();
|
160
|
-
try {
|
161
|
-
|
162
|
-
const options = select.shadowRoot.querySelectorAll('[data-monster-role=option]');
|
163
|
-
// 3 options (see fetch above)
|
164
|
-
expect(options.length).is.equal(3);
|
165
|
-
|
166
|
-
const optionHtml = select.shadowRoot.querySelector('[data-monster-role=options]');
|
167
|
-
expect(optionHtml).contain.html('data-monster-insert-reference="options-0"');
|
168
|
-
expect(optionHtml).contain.html('data-monster-insert-reference="options-1"');
|
169
|
-
expect(optionHtml).contain.html('data-monster-insert-reference="options-2"');
|
170
|
-
expect(optionHtml).contain.not.html('data-monster-insert-reference="options-3"');
|
158
|
+
select.addEventListener('monster-options-set', (e) => {
|
159
|
+
setTimeout(() => {
|
171
160
|
|
172
|
-
|
173
|
-
|
174
|
-
|
161
|
+
try {
|
162
|
+
const options = select.shadowRoot.querySelectorAll('[data-monster-role=option]');
|
163
|
+
expect(options.length).is.equal(3);
|
175
164
|
|
176
|
-
|
165
|
+
const optionHtml = select.shadowRoot.querySelector('[data-monster-role=options]');
|
166
|
+
expect(optionHtml).contain.html('data-monster-insert-reference="options-0"');
|
167
|
+
expect(optionHtml).contain.html('data-monster-insert-reference="options-1"');
|
168
|
+
expect(optionHtml).contain.html('data-monster-insert-reference="options-2"');
|
169
|
+
expect(optionHtml).contain.not.html('data-monster-insert-reference="options-3"');
|
177
170
|
|
178
|
-
|
179
|
-
|
171
|
+
} catch (e) {
|
172
|
+
done(e)
|
173
|
+
return;
|
180
174
|
}
|
181
|
-
}
|
182
175
|
|
183
|
-
|
176
|
+
done();
|
184
177
|
|
185
|
-
|
178
|
+
}, 10)
|
179
|
+
})
|
180
|
+
|
186
181
|
mocks.appendChild(select);
|
187
182
|
|
183
|
+
|
188
184
|
});
|
189
185
|
|
190
186
|
});
|
@@ -198,7 +194,7 @@ describe('Select', function () {
|
|
198
194
|
mocks.innerHTML = "";
|
199
195
|
})
|
200
196
|
|
201
|
-
it('should
|
197
|
+
it('should have no options', function (done) {
|
202
198
|
|
203
199
|
let mocks = document.getElementById('mocks');
|
204
200
|
const select = document.createElement('monster-select');
|
@@ -103,7 +103,7 @@ describe('StateButton', function () {
|
|
103
103
|
mocks.innerHTML = "";
|
104
104
|
})
|
105
105
|
|
106
|
-
it('should
|
106
|
+
it('should have no options', function (done) {
|
107
107
|
|
108
108
|
let mocks = document.getElementById('mocks');
|
109
109
|
const button = document.createElement('monster-state-button');
|
@@ -97,7 +97,7 @@ describe('Template', function () {
|
|
97
97
|
mocks.innerHTML = "";
|
98
98
|
})
|
99
99
|
|
100
|
-
it('should
|
100
|
+
it('should have no options', function (done) {
|
101
101
|
|
102
102
|
const template = document.createElement('monster-template');
|
103
103
|
mocks.appendChild(template);
|
@@ -141,7 +141,7 @@ describe('Treeselect', function () {
|
|
141
141
|
expect(document.createElement('monster-tree-select')).is.instanceof(TreeSelect);
|
142
142
|
});
|
143
143
|
|
144
|
-
it('should
|
144
|
+
it('should have options', function (done) {
|
145
145
|
|
146
146
|
let mocks = document.getElementById('mocks');
|
147
147
|
const treeselect = document.createElement('monster-tree-select');
|
@@ -151,28 +151,36 @@ describe('Treeselect', function () {
|
|
151
151
|
treeselect.setOption('mapping.labelTemplate', '${last_name}');
|
152
152
|
treeselect.setOption('mapping.valueTemplate', '${id | tostring }');
|
153
153
|
|
154
|
-
|
154
|
+
treeselect.addEventListener('monster-options-set', (e) => {
|
155
|
+
setTimeout(() => {
|
156
|
+
|
157
|
+
try {
|
158
|
+
const options = treeselect.shadowRoot.querySelectorAll('[data-monster-role=option]');
|
159
|
+
|
160
|
+
// 3 options (see fetch above)
|
161
|
+
expect(options.length).is.equal(3);
|
155
162
|
|
156
|
-
setTimeout(() => {
|
157
|
-
try {
|
158
|
-
const options = treeselect.shadowRoot.querySelectorAll('[data-monster-role=option]');
|
159
163
|
|
160
|
-
|
161
|
-
|
164
|
+
const optionHtml = treeselect.shadowRoot.querySelector('[data-monster-role=options]');
|
165
|
+
expect(optionHtml).contain.html('data-monster-insert-reference="options-0"');
|
166
|
+
expect(optionHtml).contain.html('data-monster-insert-reference="options-1"');
|
167
|
+
expect(optionHtml).contain.html('data-monster-insert-reference="options-2"');
|
168
|
+
expect(optionHtml).contain.not.html('data-monster-insert-reference="options-3"');
|
162
169
|
|
170
|
+
} catch (e) {
|
171
|
+
done(e)
|
172
|
+
return;
|
173
|
+
}
|
163
174
|
|
164
|
-
|
165
|
-
expect(optionHtml).contain.html('data-monster-insert-reference="options-0"');
|
166
|
-
expect(optionHtml).contain.html('data-monster-insert-reference="options-1"');
|
167
|
-
expect(optionHtml).contain.html('data-monster-insert-reference="options-2"');
|
168
|
-
expect(optionHtml).contain.not.html('data-monster-insert-reference="options-3"');
|
175
|
+
done();
|
169
176
|
|
170
|
-
}
|
171
|
-
|
172
|
-
|
177
|
+
}, 10)
|
178
|
+
})
|
179
|
+
|
180
|
+
|
181
|
+
mocks.appendChild(treeselect);
|
173
182
|
|
174
|
-
|
175
|
-
}, 100)
|
183
|
+
|
176
184
|
|
177
185
|
|
178
186
|
});
|
@@ -188,7 +196,7 @@ describe('Treeselect', function () {
|
|
188
196
|
mocks.innerHTML = "";
|
189
197
|
})
|
190
198
|
|
191
|
-
it('should
|
199
|
+
it('should have no options', function (done) {
|
192
200
|
|
193
201
|
let mocks = document.getElementById('mocks');
|
194
202
|
const select = document.createElement('monster-tree-select');
|
@@ -3,6 +3,7 @@
|
|
3
3
|
import {extend} from "../../../source/data/extend.mjs";
|
4
4
|
import {expect} from "chai"
|
5
5
|
|
6
|
+
|
6
7
|
class MockForExtends {
|
7
8
|
constructor() {
|
8
9
|
}
|
@@ -16,7 +17,7 @@ describe('extend', function () {
|
|
16
17
|
'{"thekey":{}}',{},{thekey:new MockForExtends}
|
17
18
|
],
|
18
19
|
[
|
19
|
-
'{"a":{"b":[
|
20
|
+
'{"a":{"b":[]}}',
|
20
21
|
{
|
21
22
|
a: {
|
22
23
|
b: [
|
@@ -118,4 +119,44 @@ describe('extend', function () {
|
|
118
119
|
|
119
120
|
});
|
120
121
|
|
121
|
-
})
|
122
|
+
})
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
describe('extend function', () => {
|
127
|
+
it('should extend an object with properties from another object', () => {
|
128
|
+
const target = { a: 1 };
|
129
|
+
const source = { b: 2 };
|
130
|
+
const result = extend(target, source);
|
131
|
+
expect(result).to.deep.equal({ a: 1, b: 2 });
|
132
|
+
});
|
133
|
+
|
134
|
+
it('should throw an error for non-object target', () => {
|
135
|
+
const target = null;
|
136
|
+
const source = { b: 2 };
|
137
|
+
expect(() => extend(target, source)).to.throw();
|
138
|
+
});
|
139
|
+
|
140
|
+
it('should throw an error for non-object source', () => {
|
141
|
+
const target = { a: 1 };
|
142
|
+
const source = "not an object";
|
143
|
+
expect(() => extend(target, source)).to.throw();
|
144
|
+
});
|
145
|
+
|
146
|
+
it('should handle deep object extension', () => {
|
147
|
+
const target = { a: { b: 1 } };
|
148
|
+
const source = { a: { c: 2 }, d: 3 };
|
149
|
+
const result = extend(target, source);
|
150
|
+
expect(result).to.deep.equal({ a: { b: 1, c: 2 }, d: 3 });
|
151
|
+
});
|
152
|
+
|
153
|
+
it('should handle array extension', () => {
|
154
|
+
const target = { a: [1, 2] };
|
155
|
+
const source = { a: [3, 4] };
|
156
|
+
const result = extend(target, source);
|
157
|
+
expect(result).to.deep.equal({ a: [3, 4] });
|
158
|
+
});
|
159
|
+
});
|
160
|
+
|
161
|
+
|
162
|
+
|
package/test/cases/monster.mjs
CHANGED
package/test/web/test.html
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
</head>
|
16
16
|
<body>
|
17
17
|
<div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
|
18
|
-
<h1 style='margin-bottom: 0.1em;'>Monster 3.
|
19
|
-
<div id="lastupdate" style='font-size:0.7em'>last update
|
18
|
+
<h1 style='margin-bottom: 0.1em;'>Monster 3.55.2</h1>
|
19
|
+
<div id="lastupdate" style='font-size:0.7em'>last update Di 23. Jan 21:15:07 CET 2024</div>
|
20
20
|
</div>
|
21
21
|
<div id="mocha-errors"
|
22
22
|
style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>
|
package/test/web/tests.js
CHANGED
@@ -5,6 +5,7 @@ try {
|
|
5
5
|
try {
|
6
6
|
try {
|
7
7
|
try {
|
8
|
+
try {
|
8
9
|
(() => {
|
9
10
|
var __create = Object.create;
|
10
11
|
var __defProp = Object.defineProperty;
|
@@ -48103,3 +48104,7 @@ document.getElementById('mocha-stats').style.backgroundColor = 'red';
|
|
48103
48104
|
document.getElementById('mocha-errors').insertAdjacentHTML('afterbegin', e );
|
48104
48105
|
document.getElementById('mocha-stats').style.backgroundColor = 'red';
|
48105
48106
|
}
|
48107
|
+
} catch (e) {
|
48108
|
+
document.getElementById('mocha-errors').insertAdjacentHTML('afterbegin', e );
|
48109
|
+
document.getElementById('mocha-stats').style.backgroundColor = 'red';
|
48110
|
+
}
|