@schukai/monster 3.55.2 → 3.55.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/package.json +4 -3
  3. package/source/components/datatable/filter/select.mjs +2 -3
  4. package/source/components/datatable/stylesheet/column-bar.mjs +8 -14
  5. package/source/components/datatable/stylesheet/dataset.mjs +8 -14
  6. package/source/components/datatable/stylesheet/datasource.mjs +7 -13
  7. package/source/components/datatable/stylesheet/datatable.mjs +8 -14
  8. package/source/components/datatable/stylesheet/embedded-pagination.mjs +8 -14
  9. package/source/components/datatable/stylesheet/filter-button.mjs +7 -13
  10. package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +7 -13
  11. package/source/components/datatable/stylesheet/filter-date-range.mjs +7 -13
  12. package/source/components/datatable/stylesheet/filter-range.mjs +7 -13
  13. package/source/components/datatable/stylesheet/filter.mjs +8 -14
  14. package/source/components/datatable/stylesheet/pagination.mjs +8 -14
  15. package/source/components/datatable/stylesheet/select-filter.mjs +8 -14
  16. package/source/components/datatable/stylesheet/status.mjs +8 -14
  17. package/source/components/form/select.mjs +1812 -1638
  18. package/source/components/form/state-button.mjs +3 -1
  19. package/source/components/form/style/state-button.pcss +6 -0
  20. package/source/components/form/stylesheet/action-button.mjs +7 -13
  21. package/source/components/form/stylesheet/api-button.mjs +7 -13
  22. package/source/components/form/stylesheet/button-bar.mjs +7 -13
  23. package/source/components/form/stylesheet/button.mjs +7 -13
  24. package/source/components/form/stylesheet/confirm-button.mjs +7 -13
  25. package/source/components/form/stylesheet/context-error.mjs +7 -13
  26. package/source/components/form/stylesheet/context-help.mjs +7 -13
  27. package/source/components/form/stylesheet/form.mjs +7 -13
  28. package/source/components/form/stylesheet/message-state-button.mjs +7 -13
  29. package/source/components/form/stylesheet/popper-button.mjs +7 -13
  30. package/source/components/form/stylesheet/popper.mjs +7 -13
  31. package/source/components/form/stylesheet/select.mjs +7 -13
  32. package/source/components/form/stylesheet/state-button.mjs +8 -14
  33. package/source/components/form/stylesheet/tabs.mjs +7 -13
  34. package/source/components/form/stylesheet/tree-select.mjs +7 -13
  35. package/source/components/form/tree-select.mjs +12 -3
  36. package/source/components/host/stylesheet/call-button.mjs +8 -14
  37. package/source/components/host/stylesheet/collapse.mjs +8 -14
  38. package/source/components/host/stylesheet/config-manager.mjs +7 -13
  39. package/source/components/host/stylesheet/details.mjs +8 -14
  40. package/source/components/host/stylesheet/host.mjs +8 -14
  41. package/source/components/host/stylesheet/overlay.mjs +8 -14
  42. package/source/components/host/stylesheet/toggle-button.mjs +8 -14
  43. package/source/components/host/stylesheet/viewer.mjs +8 -14
  44. package/source/components/notify/stylesheet/message.mjs +8 -14
  45. package/source/components/notify/stylesheet/notify.mjs +7 -13
  46. package/source/components/state/stylesheet/log.mjs +7 -13
  47. package/source/components/state/stylesheet/state.mjs +7 -13
  48. package/source/components/style/normalize.pcss +3 -3
  49. package/source/components/stylesheet/badge.mjs +7 -13
  50. package/source/components/stylesheet/border.mjs +7 -13
  51. package/source/components/stylesheet/button.mjs +7 -13
  52. package/source/components/stylesheet/card.mjs +7 -13
  53. package/source/components/stylesheet/color.mjs +7 -13
  54. package/source/components/stylesheet/common.mjs +7 -13
  55. package/source/components/stylesheet/control.mjs +7 -13
  56. package/source/components/stylesheet/data-grid.mjs +7 -13
  57. package/source/components/stylesheet/display.mjs +7 -13
  58. package/source/components/stylesheet/floating-ui.mjs +7 -13
  59. package/source/components/stylesheet/form.mjs +7 -13
  60. package/source/components/stylesheet/host.mjs +7 -13
  61. package/source/components/stylesheet/icons.mjs +7 -13
  62. package/source/components/stylesheet/link.mjs +7 -13
  63. package/source/components/stylesheet/normalize.mjs +8 -14
  64. package/source/components/stylesheet/popper.mjs +7 -13
  65. package/source/components/stylesheet/property.mjs +7 -13
  66. package/source/components/stylesheet/ripple.mjs +7 -13
  67. package/source/components/stylesheet/skeleton.mjs +7 -13
  68. package/source/components/stylesheet/space.mjs +7 -13
  69. package/source/components/stylesheet/spinner.mjs +7 -13
  70. package/source/components/stylesheet/table.mjs +7 -13
  71. package/source/components/stylesheet/theme.mjs +7 -13
  72. package/source/components/stylesheet/typography.mjs +7 -13
  73. package/source/components/tree-menu/stylesheet/tree-menu.mjs +7 -13
  74. package/source/data/extend.mjs +56 -47
  75. package/source/dom/customelement.mjs +8 -3
  76. package/source/dom/util/init-options-from-attributes.mjs +0 -1
  77. package/source/monster.mjs +1 -0
  78. package/source/types/version.mjs +1 -1
  79. package/test/cases/components/form/button.mjs +1 -1
  80. package/test/cases/components/form/confirm-button.mjs +1 -1
  81. package/test/cases/components/form/reload.mjs +1 -1
  82. package/test/cases/components/form/select.mjs +25 -29
  83. package/test/cases/components/form/state-button.mjs +1 -1
  84. package/test/cases/components/form/tabs.mjs +1 -1
  85. package/test/cases/components/form/template.mjs +1 -1
  86. package/test/cases/components/form/tree-select.mjs +26 -18
  87. package/test/cases/data/extend.mjs +43 -2
  88. package/test/cases/monster.mjs +1 -1
  89. package/test/web/test.html +2 -2
  90. package/test/web/tests.js +10 -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 has options', function (done) {
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
- const mutationobserver = new MutationObserver(function (mutations) {
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
- } catch (e) {
173
- return done(e);
174
- }
161
+ try {
162
+ const options = select.shadowRoot.querySelectorAll('[data-monster-role=option]');
163
+ expect(options.length).is.equal(3);
175
164
 
176
- done();
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
- }, 100)
171
+ } catch (e) {
172
+ done(e)
173
+ return;
180
174
  }
181
- }
182
175
 
183
- });
176
+ done();
184
177
 
185
- mutationobserver.observe(mocks, {childList: true});
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 has no options', function (done) {
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 has no options', function (done) {
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');
@@ -64,7 +64,7 @@ describe('Tabs', function () {
64
64
  mocks.innerHTML = "";
65
65
  })
66
66
 
67
- it('should has buttons and tabs', function (done) {
67
+ it('should have buttons and tabs', function (done) {
68
68
 
69
69
  let mocks = document.getElementById('mocks');
70
70
  mocks.innerHTML = html1;
@@ -97,7 +97,7 @@ describe('Template', function () {
97
97
  mocks.innerHTML = "";
98
98
  })
99
99
 
100
- it('should has no options', function (done) {
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 has options', function (done) {
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
- mocks.appendChild(treeselect);
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
- // 3 options (see fetch above)
161
- expect(options.length).is.equal(3);
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
- 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"');
175
+ done();
169
176
 
170
- } catch (e) {
171
- return done(e);
172
- }
177
+ }, 10)
178
+ })
179
+
180
+
181
+ mocks.appendChild(treeselect);
173
182
 
174
- done();
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 has no options', function (done) {
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":["1","2","3"]}}',
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
+
@@ -7,7 +7,7 @@ describe('Monster', function () {
7
7
  let monsterVersion
8
8
 
9
9
  /** don´t touch, replaced by make with package.json version */
10
- monsterVersion = new Version("3.55.2")
10
+ monsterVersion = new Version("3.55.4")
11
11
 
12
12
  let m = getMonsterVersion();
13
13
 
@@ -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.54.0</h1>
19
- <div id="lastupdate" style='font-size:0.7em'>last update Mi 29. Nov 15:34:53 CET 2023</div>
18
+ <h1 style='margin-bottom: 0.1em;'>Monster 3.55.3</h1>
19
+ <div id="lastupdate" style='font-size:0.7em'>last update Mi 24. Jan 19:51:51 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,8 @@ try {
5
5
  try {
6
6
  try {
7
7
  try {
8
+ try {
9
+ try {
8
10
  (() => {
9
11
  var __create = Object.create;
10
12
  var __defProp = Object.defineProperty;
@@ -48103,3 +48105,11 @@ document.getElementById('mocha-stats').style.backgroundColor = 'red';
48103
48105
  document.getElementById('mocha-errors').insertAdjacentHTML('afterbegin', e );
48104
48106
  document.getElementById('mocha-stats').style.backgroundColor = 'red';
48105
48107
  }
48108
+ } catch (e) {
48109
+ document.getElementById('mocha-errors').insertAdjacentHTML('afterbegin', e );
48110
+ document.getElementById('mocha-stats').style.backgroundColor = 'red';
48111
+ }
48112
+ } catch (e) {
48113
+ document.getElementById('mocha-errors').insertAdjacentHTML('afterbegin', e );
48114
+ document.getElementById('mocha-stats').style.backgroundColor = 'red';
48115
+ }