neo.mjs 4.4.13 → 4.4.14
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.
@@ -70,7 +70,7 @@ class MainContainer extends Viewport {
|
|
70
70
|
iconCls: 'fa fa-home',
|
71
71
|
|
72
72
|
bind: {
|
73
|
-
text: data =>
|
73
|
+
text: data => data.button1Text
|
74
74
|
}
|
75
75
|
}, {
|
76
76
|
handler: 'onButton2Click',
|
@@ -91,11 +91,7 @@ class MainContainer extends Viewport {
|
|
91
91
|
width : 300,
|
92
92
|
|
93
93
|
bind: {
|
94
|
-
value: data =>
|
95
|
-
},
|
96
|
-
|
97
|
-
listeners: {
|
98
|
-
change: 'onTextField1Change'
|
94
|
+
value: {twoWay: true, value: data => data.button1Text}
|
99
95
|
}
|
100
96
|
}, {
|
101
97
|
module : TextField,
|
package/package.json
CHANGED
package/src/button/Base.mjs
CHANGED
@@ -104,9 +104,9 @@ class Base extends Component {
|
|
104
104
|
route_: null,
|
105
105
|
/**
|
106
106
|
* The text displayed on the button [optional]
|
107
|
-
* @member {String} text_=
|
107
|
+
* @member {String|null} text_=null
|
108
108
|
*/
|
109
|
-
text_:
|
109
|
+
text_: null,
|
110
110
|
/**
|
111
111
|
* Transforms the button tag into an a tag [optional]
|
112
112
|
* @member {String|null} url_=null
|
@@ -271,8 +271,8 @@ class Base extends Component {
|
|
271
271
|
|
272
272
|
/**
|
273
273
|
* Triggered after the text config got changed
|
274
|
-
* @param {String} value
|
275
|
-
* @param {String} oldValue
|
274
|
+
* @param {String|null} value
|
275
|
+
* @param {String|null} oldValue
|
276
276
|
* @protected
|
277
277
|
*/
|
278
278
|
afterSetText(value, oldValue) {
|
@@ -280,7 +280,7 @@ class Base extends Component {
|
|
280
280
|
vdomRoot = me.getVdomRoot(),
|
281
281
|
textNode = vdomRoot.cn[1];
|
282
282
|
|
283
|
-
if (value === '') {
|
283
|
+
if (!value || value === '') {
|
284
284
|
NeoArray.add(me._cls, 'no-text');
|
285
285
|
NeoArray.add(vdomRoot.cls, 'no-text');
|
286
286
|
textNode.removeDom = true;
|
package/src/component/Base.mjs
CHANGED
@@ -425,9 +425,11 @@ class Base extends CoreBase {
|
|
425
425
|
* @protected
|
426
426
|
*/
|
427
427
|
afterSetConfig(key, value, oldValue) {
|
428
|
-
if (Neo.currentWorker.isUsingViewModels) {
|
429
|
-
|
430
|
-
|
428
|
+
if (Neo.currentWorker.isUsingViewModels && oldValue !== undefined) {
|
429
|
+
let binding = this.bind?.[key];
|
430
|
+
|
431
|
+
if (binding?.twoWay) {
|
432
|
+
this.getModel()?.setData(binding.key, value);
|
431
433
|
}
|
432
434
|
}
|
433
435
|
}
|
package/src/model/Component.mjs
CHANGED