neo.mjs 4.3.6 → 4.3.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.3.6",
3
+ "version": "4.3.8",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
package/src/core/Util.mjs CHANGED
@@ -142,6 +142,10 @@ class Util extends Base {
142
142
  * @returns {Boolean}
143
143
  */
144
144
  static isEmpty(value) {
145
+ if (value === null || value === undefined) {
146
+ return true;
147
+ }
148
+
145
149
  if (Array.isArray(value)) {
146
150
  return value.length === 0;
147
151
  }
@@ -305,7 +305,7 @@ class Text extends Base {
305
305
 
306
306
  NeoArray.remove(cls, 'label-' + oldValue);
307
307
  NeoArray.add(cls, 'label-' + value);
308
- me[oldValue === 'inline' || value === 'inline' ? '_cls' : 'cls'] = cls; // silent update if needed
308
+ me.cls = cls; // todo: silent update if needed
309
309
 
310
310
  if (oldValue === 'inline') {
311
311
  vdom = me.vdom;
@@ -558,17 +558,19 @@ class Text extends Base {
558
558
  */
559
559
  afterSetValue(value, oldValue) {
560
560
  let me = this,
561
+ cls = me.cls,
561
562
  vdom = me.vdom;
562
563
 
563
564
  me.getInputEl().value = value;
564
565
 
565
- if (!!value !== !!oldValue) { // change from empty to non-empty
566
- NeoArray[value && value.toString().length > 0 ? 'add' : 'remove'](me._cls, 'neo-has-content');
566
+ if (Neo.isEmpty(value) !== Neo.isEmpty(oldValue)) {
567
+ NeoArray[value !== null && value.toString().length > 0 ? 'add' : 'remove'](cls, 'neo-has-content');
567
568
  }
568
569
 
569
- NeoArray[me.originalConfig.value !== value ? 'add' : 'remove'](me._cls, 'neo-is-dirty');
570
+ NeoArray[me.originalConfig.value !== value ? 'add' : 'remove'](cls, 'neo-is-dirty');
570
571
  me.validate(); // silent
571
572
 
573
+ me.cls = cls;
572
574
  me.vdom = vdom;
573
575
 
574
576
  super.afterSetValue(value, oldValue); // fires the change event