neo.mjs 5.10.1 → 5.10.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.
- package/apps/ServiceWorker.mjs +2 -2
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/form/field/checkbox/MainContainer.mjs +2 -2
- package/examples/form/field/text/MainContainer.mjs +2 -2
- package/package.json +1 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/form/field/CheckBox.mjs +19 -2
- package/src/form/field/Text.mjs +20 -5
package/apps/ServiceWorker.mjs
CHANGED
@@ -100,7 +100,7 @@ class MainContainer extends ConfigurationViewport {
|
|
100
100
|
handler: (() => {me.exampleComponent.reset()}),
|
101
101
|
style : {marginTop: '10px', width: '50%'},
|
102
102
|
text : 'reset()'
|
103
|
-
}]
|
103
|
+
}]
|
104
104
|
}
|
105
105
|
|
106
106
|
createExampleComponent() {
|
@@ -108,7 +108,7 @@ class MainContainer extends ConfigurationViewport {
|
|
108
108
|
labelText : 'Label',
|
109
109
|
labelWidth: 70,
|
110
110
|
width : 200
|
111
|
-
})
|
111
|
+
})
|
112
112
|
}
|
113
113
|
}
|
114
114
|
|
@@ -182,7 +182,7 @@ class MainContainer extends ConfigurationViewport {
|
|
182
182
|
handler: (() => {me.exampleComponent.reset()}),
|
183
183
|
style : {marginTop: '10px', width: '50%'},
|
184
184
|
text : 'reset()'
|
185
|
-
}]
|
185
|
+
}]
|
186
186
|
}
|
187
187
|
|
188
188
|
createExampleComponent() {
|
@@ -201,7 +201,7 @@ class MainContainer extends ConfigurationViewport {
|
|
201
201
|
},
|
202
202
|
scope: this
|
203
203
|
}
|
204
|
-
})
|
204
|
+
})
|
205
205
|
}
|
206
206
|
}
|
207
207
|
|
package/package.json
CHANGED
package/src/DefaultConfig.mjs
CHANGED
@@ -236,12 +236,12 @@ const DefaultConfig = {
|
|
236
236
|
useVdomWorker: true,
|
237
237
|
/**
|
238
238
|
* buildScripts/injectPackageVersion.mjs will update this value
|
239
|
-
* @default '5.10.
|
239
|
+
* @default '5.10.2'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '5.10.
|
244
|
+
version: '5.10.2'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
@@ -79,6 +79,17 @@ class CheckBox extends Base {
|
|
79
79
|
* @member {String[]} labelCls_=[]
|
80
80
|
*/
|
81
81
|
labelCls_: [],
|
82
|
+
/**
|
83
|
+
* Edge-case config in case we want to render leading content with their own selectors like:
|
84
|
+
* <span class="my-label-id-cls">E10</span> • Firstname
|
85
|
+
* @member {String|null} labelId_=null
|
86
|
+
*/
|
87
|
+
labelId_: null,
|
88
|
+
/**
|
89
|
+
* CSS rules for labelId
|
90
|
+
* @member {String[]} labelIdCls_=[]
|
91
|
+
*/
|
92
|
+
labelIdCls_: [],
|
82
93
|
/**
|
83
94
|
* Valid values: 'left', 'top'
|
84
95
|
* @member {String} labelPosition_='left'
|
@@ -296,8 +307,14 @@ class CheckBox extends Base {
|
|
296
307
|
* @protected
|
297
308
|
*/
|
298
309
|
afterSetLabelText(value, oldValue) {
|
299
|
-
|
300
|
-
|
310
|
+
let me = this;
|
311
|
+
|
312
|
+
if (me.labelId) {
|
313
|
+
value = `<span class="${me.labelIdCls.join(',')}">${me.labelId}</span> • ${value}`
|
314
|
+
}
|
315
|
+
|
316
|
+
me.vdom.cn[0].cn[0].innerHTML = value;
|
317
|
+
me.update()
|
301
318
|
}
|
302
319
|
|
303
320
|
/**
|
package/src/form/field/Text.mjs
CHANGED
@@ -130,6 +130,17 @@ class Text extends Base {
|
|
130
130
|
* @member {String[]} labelCls_=[]
|
131
131
|
*/
|
132
132
|
labelCls_: [],
|
133
|
+
/**
|
134
|
+
* Edge-case config in case we want to render leading content with their own selectors like:
|
135
|
+
* <span class="my-label-id-cls">E10</span> • Firstname
|
136
|
+
* @member {String|null} labelId_=null
|
137
|
+
*/
|
138
|
+
labelId_: null,
|
139
|
+
/**
|
140
|
+
* CSS rules for labelId
|
141
|
+
* @member {String[]} labelIdCls_=[]
|
142
|
+
*/
|
143
|
+
labelIdCls_: [],
|
133
144
|
/**
|
134
145
|
* @member {String} labelOptionalText_=' (Optional)'
|
135
146
|
*/
|
@@ -502,6 +513,10 @@ class Text extends Base {
|
|
502
513
|
let me = this,
|
503
514
|
isEmpty = me.isEmpty();
|
504
515
|
|
516
|
+
if (me.labelId) {
|
517
|
+
value = `<span class="${me.labelIdCls.join(',')}">${me.labelId}</span> • ${value}`
|
518
|
+
}
|
519
|
+
|
505
520
|
me.getLabelEl().innerHTML = value;
|
506
521
|
|
507
522
|
if (!me.hideLabel) {
|
@@ -512,9 +527,9 @@ class Text extends Base {
|
|
512
527
|
|
513
528
|
me.promiseVdomUpdate().then(() => {
|
514
529
|
me.updateCenterBorderElWidth(isEmpty)
|
515
|
-
})
|
530
|
+
})
|
516
531
|
} else {
|
517
|
-
me.update()
|
532
|
+
me.update()
|
518
533
|
}
|
519
534
|
}
|
520
535
|
}
|
@@ -532,7 +547,7 @@ class Text extends Base {
|
|
532
547
|
label = vdom.cn[0];
|
533
548
|
|
534
549
|
label.width = value;
|
535
|
-
!me.hideLabel && me.updateInputWidth()
|
550
|
+
!me.hideLabel && me.updateInputWidth()
|
536
551
|
}
|
537
552
|
}
|
538
553
|
|
@@ -544,7 +559,7 @@ class Text extends Base {
|
|
544
559
|
*/
|
545
560
|
afterSetMaxLength(value, oldValue) {
|
546
561
|
this.validate(); // silent
|
547
|
-
this.changeInputElKey('maxlength', value)
|
562
|
+
this.changeInputElKey('maxlength', value)
|
548
563
|
}
|
549
564
|
|
550
565
|
/**
|
@@ -576,7 +591,7 @@ class Text extends Base {
|
|
576
591
|
|
577
592
|
for (; i < len; i++) {
|
578
593
|
if (!triggers[i].vdom.removeDom) {
|
579
|
-
triggers[i].mounted = value
|
594
|
+
triggers[i].mounted = value
|
580
595
|
}
|
581
596
|
}
|
582
597
|
|