@schukai/monster 4.81.0 → 4.82.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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.
|
|
1
|
+
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.82.0"}
|
|
@@ -408,7 +408,7 @@ class Select extends CustomControl {
|
|
|
408
408
|
* e.value=1
|
|
409
409
|
* ```
|
|
410
410
|
*
|
|
411
|
-
* @property {string|array} value
|
|
411
|
+
* @property {string|array|null} value
|
|
412
412
|
* @throws {Error} unsupported type
|
|
413
413
|
* @fires monster-selected this event is fired when the selection is set
|
|
414
414
|
*/
|
|
@@ -3140,6 +3140,8 @@ function checkOptionState() {
|
|
|
3140
3140
|
function convertValueToSelection(value) {
|
|
3141
3141
|
const selection = [];
|
|
3142
3142
|
|
|
3143
|
+
value = isValueIsEmptyThenGetNormalize.call(this, value);
|
|
3144
|
+
|
|
3143
3145
|
if (isString(value)) {
|
|
3144
3146
|
value = value
|
|
3145
3147
|
.split(",")
|
|
@@ -281,6 +281,34 @@ describe('Select', function () {
|
|
|
281
281
|
}, 350);
|
|
282
282
|
});
|
|
283
283
|
|
|
284
|
+
it('should treat null value as empty selection', function (done) {
|
|
285
|
+
this.timeout(2000);
|
|
286
|
+
|
|
287
|
+
let mocks = document.getElementById('mocks');
|
|
288
|
+
const select = document.createElement('monster-select');
|
|
289
|
+
select.setOption('options', [{label: 'One', value: '1'}]);
|
|
290
|
+
mocks.appendChild(select);
|
|
291
|
+
|
|
292
|
+
setTimeout(() => {
|
|
293
|
+
select.value = null;
|
|
294
|
+
|
|
295
|
+
setTimeout(() => {
|
|
296
|
+
try {
|
|
297
|
+
const selection = select.getOption('selection');
|
|
298
|
+
const error = select.getAttribute('data-monster-error') ?? '';
|
|
299
|
+
expect(Array.isArray(selection)).to.equal(true);
|
|
300
|
+
expect(selection.length).to.equal(0);
|
|
301
|
+
expect(select.value).to.equal('');
|
|
302
|
+
expect(error).to.not.contain('unsupported type');
|
|
303
|
+
} catch (e) {
|
|
304
|
+
return done(e);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
done();
|
|
308
|
+
}, 50);
|
|
309
|
+
}, 50);
|
|
310
|
+
});
|
|
311
|
+
|
|
284
312
|
});
|
|
285
313
|
|
|
286
314
|
|