@schukai/monster 3.96.0 → 3.96.2

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +22 -5
  2. package/package.json +1 -1
  3. package/source/components/content/copy.mjs +1 -1
  4. package/source/components/datatable/change-button.mjs +39 -41
  5. package/source/components/datatable/dataset.mjs +337 -327
  6. package/source/components/datatable/datasource/rest.mjs +3 -22
  7. package/source/components/datatable/embedded-pagination.mjs +3 -1
  8. package/source/components/datatable/pagination.mjs +14 -7
  9. package/source/components/datatable/save-button.mjs +25 -3
  10. package/source/components/datatable/status.mjs +21 -26
  11. package/source/components/datatable/style/status.pcss +12 -2
  12. package/source/components/datatable/stylesheet/status.mjs +1 -1
  13. package/source/components/datatable/util.mjs +1 -2
  14. package/source/components/form/api-bar.mjs +1 -1
  15. package/source/components/form/api-button.mjs +1 -1
  16. package/source/components/form/button-bar.mjs +1 -1
  17. package/source/components/form/button.mjs +2 -2
  18. package/source/components/form/confirm-button.mjs +1 -1
  19. package/source/components/form/form.mjs +6 -5
  20. package/source/components/form/select.mjs +12 -9
  21. package/source/components/form/style/field-set.pcss +35 -5
  22. package/source/components/form/style/toggle-switch.pcss +16 -2
  23. package/source/components/form/stylesheet/field-set.mjs +1 -1
  24. package/source/components/form/stylesheet/toggle-switch.mjs +1 -1
  25. package/source/components/form/toggle-switch.mjs +139 -91
  26. package/source/components/layout/tabs.mjs +4 -5
  27. package/source/components/layout/width-toggle.mjs +1 -1
  28. package/source/components/navigation/table-of-content.mjs +1 -1
  29. package/source/components/notify/message.mjs +1 -1
  30. package/source/components/notify/notify.mjs +2 -2
  31. package/source/components/state/log.mjs +1 -1
  32. package/source/components/state/state.mjs +1 -1
  33. package/source/components/style/theme.css +4 -4
  34. package/source/dom/constants.mjs +7 -5
  35. package/source/dom/updater.mjs +3 -6
  36. package/source/types/version.mjs +1 -1
  37. package/test/cases/components/form/toggle-switch.mjs +80 -65
  38. package/test/cases/monster.mjs +1 -1
  39. package/test/web/test.html +2 -2
  40. package/test/web/tests.js +154 -104
@@ -1,7 +1,7 @@
1
- import { getGlobal } from "../../../../source/types/global.mjs";
1
+ import {getGlobal} from "../../../../source/types/global.mjs";
2
2
  import * as chai from 'chai';
3
- import { chaiDom } from "../../../util/chai-dom.mjs";
4
- import { initJSDOM } from "../../../util/jsdom.mjs";
3
+ import {chaiDom} from "../../../util/chai-dom.mjs";
4
+ import {initJSDOM} from "../../../util/jsdom.mjs";
5
5
 
6
6
  let expect = chai.expect;
7
7
  chai.use(chaiDom);
@@ -91,21 +91,24 @@ describe('ToggleSwitch', function () {
91
91
  it('toggle to on', function () {
92
92
 
93
93
  const toggleSwitch = document.createElement('monster-toggle-switch');
94
- toggleSwitch.setOption('actions.on', 'true');
95
- toggleSwitch.setOption('actions.off', 'false');
94
+ toggleSwitch.setOption('values.on', 'true');
95
+ toggleSwitch.setOption('values.off', 'false');
96
96
 
97
- expect(toggleSwitch.value).is.equal('off');
98
- expect(toggleSwitch.state).is.equal('off');
97
+ toggleSwitch.value = "true";
98
+
99
+ expect("true").is.equal(toggleSwitch.value);
100
+ expect("on").is.equal(toggleSwitch.state);
99
101
 
100
102
  toggleSwitch.toggle();
101
103
 
102
- expect(toggleSwitch.value).is.equal('on');
103
- expect(toggleSwitch.state).is.equal('on');
104
+ expect("false").is.equal(toggleSwitch.value);
105
+ expect("off").is.equal(toggleSwitch.state);
104
106
 
105
107
  toggleSwitch.toggle();
106
108
 
107
- expect(toggleSwitch.value).is.equal('off');
108
- expect(toggleSwitch.state).is.equal('off');
109
+ expect("true").is.equal(toggleSwitch.value);
110
+ expect("on").is.equal(toggleSwitch.state);
111
+
109
112
  });
110
113
 
111
114
  it('toggle on to off', function () {
@@ -156,37 +159,46 @@ describe('ToggleSwitch', function () {
156
159
  */
157
160
  document.getElementById('mocks').appendChild(toggleSwitch);
158
161
 
159
- /**
160
- * expect that classes.on is set to Element Switch
161
- */
162
- let hasClassA = toggleSwitch.shadowRoot.querySelectorAll('[data-monster-role="switch"]')[0].classList.contains(toggleSwitch.getOption('classes.on'));
163
- expect(hasClassA).is.true;
164
-
165
- /**
166
- * switch off
167
- */
168
- toggleSwitch.value = "off";
169
-
170
162
  /**
171
163
  * Updater prozess runs in setTimeout
172
164
  * self[internalSymbol].attachObserver();
173
165
  */
174
166
  setTimeout(() => {
175
-
176
- /**
177
- * expect that classes.on is removed from Element Switch
178
- */
179
- let hasClassB = toggleSwitch.shadowRoot.querySelectorAll('[data-monster-role="switch"]')[0].classList.contains(toggleSwitch.getOption('classes.on'));
180
- expect(hasClassB).is.false;
181
167
 
182
- /**
183
- * expect that classes.off is set to Element Switch
184
- */
185
- let hasClassC = toggleSwitch.shadowRoot.querySelectorAll('[data-monster-role="switch"]')[0].classList.contains(toggleSwitch.getOption('classes.off'));
186
- expect(hasClassC).is.true;
168
+ window.requestAnimationFrame(() => {
169
+
170
+ /**
171
+ * expect that classes.on is set to Element Switch
172
+ */
173
+ let hasClassA = toggleSwitch.shadowRoot.querySelectorAll('[data-monster-role="switch"]')[0].classList.contains(toggleSwitch.getOption('classes.on'));
174
+
175
+
176
+ expect(hasClassA).is.true;
177
+
178
+ /**
179
+ * switch off
180
+ */
181
+ toggleSwitch.value = "off";
187
182
 
183
+ window.requestAnimationFrame(() => {
184
+ /**
185
+ * expect that classes.on is removed from Element Switch
186
+ */
187
+ let hasClassB = toggleSwitch.shadowRoot.querySelectorAll('[data-monster-role="switch"]')[0].classList.contains(toggleSwitch.getOption('classes.on'));
188
+ expect(hasClassB).is.false;
189
+
190
+ /**
191
+ * expect that classes.off is set to Element Switch
192
+ */
193
+ let hasClassC = toggleSwitch.shadowRoot.querySelectorAll('[data-monster-role="switch"]')[0].classList.contains(toggleSwitch.getOption('classes.off'));
194
+ expect(hasClassC).is.true;
195
+
196
+
197
+ done();
198
+ });
199
+
200
+ });
188
201
 
189
- done();
190
202
  }, 0);
191
203
 
192
204
  })
@@ -212,16 +224,18 @@ describe('ToggleSwitch', function () {
212
224
  * new Control
213
225
  */
214
226
  let toggleSwitch = document.createElement('monster-toggle-switch');
227
+ window.requestAnimationFrame(() => {
215
228
 
216
- /**
217
- * the switch is off and provides the value for off
218
- */
219
- expect(toggleSwitch.value).is.equal('off');
229
+ /**
230
+ * the switch is off and provides the value for off
231
+ */
232
+ expect(null).is.equal(toggleSwitch.value);
220
233
 
221
- /**
222
- * the switch is off
223
- */
224
- expect(toggleSwitch.state).is.equal('off');
234
+ /**
235
+ * the switch is off
236
+ */
237
+ expect(toggleSwitch.state).is.equal('off');
238
+ });
225
239
 
226
240
  });
227
241
 
@@ -240,31 +254,33 @@ describe('ToggleSwitch', function () {
240
254
  */
241
255
  toggleSwitch.value = "test";
242
256
 
243
- /**
244
- * the switch is off and provides the value for off
245
- */
246
- expect(toggleSwitch.value).is.equal('false');
257
+ window.requestAnimationFrame(() => {
247
258
 
248
- /**
249
- * the switch is off
250
- */
251
- expect(toggleSwitch.state).is.equal('off');
259
+ /**
260
+ * the switch is off and provides the value for off
261
+ */
262
+ expect(null).is.equal(toggleSwitch.value);
252
263
 
253
- /**
254
- * disabled attribute is only set when the element has been mounted in the DOM
255
- */
256
- expect(toggleSwitch.hasAttribute('disabled')).is.false;
264
+ /**
265
+ * the switch is off
266
+ */
267
+ expect(toggleSwitch.state).is.equal('off');
257
268
 
258
- /**
259
- * insert DOM
260
- */
261
- document.getElementById('mocks').appendChild(toggleSwitch);
269
+ /**
270
+ * disabled attribute is only set when the element has been mounted in the DOM
271
+ */
272
+ expect(toggleSwitch.hasAttribute('disabled')).is.false;
262
273
 
263
- /**
264
- * now the element is disabled
265
- */
266
- expect(toggleSwitch.hasAttribute('disabled')).is.true;
274
+ /**
275
+ * insert DOM
276
+ */
277
+ document.getElementById('mocks').appendChild(toggleSwitch);
267
278
 
279
+ /**
280
+ * now the element is disabled
281
+ */
282
+ expect(toggleSwitch.hasAttribute('disabled')).is.false;
283
+ });
268
284
 
269
285
  });
270
286
 
@@ -294,8 +310,8 @@ describe('ToggleSwitch', function () {
294
310
  expect(toggleSwitch.state).is.equal('on');
295
311
 
296
312
  /**
297
- * insert DOM
298
- */
313
+ * insert DOM
314
+ */
299
315
  document.getElementById('mocks').appendChild(toggleSwitch);
300
316
 
301
317
  /**
@@ -308,5 +324,4 @@ describe('ToggleSwitch', function () {
308
324
  });
309
325
 
310
326
 
311
-
312
327
  });
@@ -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.95.2")
10
+ monsterVersion = new Version("3.96.1")
11
11
 
12
12
  let m = getMonsterVersion();
13
13
 
@@ -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 3.95.2</h1>
13
- <div id="lastupdate" style='font-size:0.7em'>last update So 29. Dez 11:41:55 CET 2024</div>
12
+ <h1 style='margin-bottom: 0.1em;'>Monster 3.96.1</h1>
13
+ <div id="lastupdate" style='font-size:0.7em'>last update Di 31. Dez 23:30:20 CET 2024</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>