neo.mjs 5.5.3 → 5.5.5
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/package.json +1 -1
- package/resources/scss/src/form/field/CheckBox.scss +2 -1
- package/resources/scss/src/form/field/Text.scss +8 -0
- package/resources/scss/theme-dark/form/field/CheckBox.scss +2 -0
- package/resources/scss/theme-light/form/field/CheckBox.scss +2 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/form/field/Text.mjs +28 -5
package/apps/ServiceWorker.mjs
CHANGED
package/package.json
CHANGED
@@ -19,6 +19,7 @@
|
|
19
19
|
display : inline-block;
|
20
20
|
font-family: v(checkboxfield-icon-font-family);
|
21
21
|
font-size : v(checkboxfield-icon-font-size);
|
22
|
+
margin : v(checkboxfield-icon-margin);
|
22
23
|
width : 20px;
|
23
24
|
}
|
24
25
|
|
@@ -53,7 +54,7 @@
|
|
53
54
|
}
|
54
55
|
|
55
56
|
.neo-checkbox-label {
|
56
|
-
display:
|
57
|
+
display: flex;
|
57
58
|
margin : v(checkboxfield-label-top-margin);
|
58
59
|
}
|
59
60
|
}
|
@@ -325,6 +325,14 @@
|
|
325
325
|
margin-top : .3em;
|
326
326
|
white-space: break-spaces;
|
327
327
|
word-break : break-word;
|
328
|
+
|
329
|
+
&.neo-absolute {
|
330
|
+
position: absolute;
|
331
|
+
}
|
332
|
+
}
|
333
|
+
|
334
|
+
.neo-textfield-error-wrapper {
|
335
|
+
position: relative;
|
328
336
|
}
|
329
337
|
|
330
338
|
.neo-textfield-input {
|
@@ -3,6 +3,7 @@ $neoMap: map-merge($neoMap, (
|
|
3
3
|
'checkboxfield-color-checked' : #64B5F6,
|
4
4
|
'checkboxfield-icon-font-family': var(--fa-style-family-classic),
|
5
5
|
'checkboxfield-icon-font-size' : 14px,
|
6
|
+
'checkboxfield-icon-margin' : 0,
|
6
7
|
'checkboxfield-label-top-margin': 0 0 3px
|
7
8
|
));
|
8
9
|
|
@@ -12,6 +13,7 @@ $neoMap: map-merge($neoMap, (
|
|
12
13
|
--checkboxfield-color-checked : #{neo(checkboxfield-color-checked)};
|
13
14
|
--checkboxfield-icon-font-family: #{neo(checkboxfield-icon-font-family)};
|
14
15
|
--checkboxfield-icon-font-size : #{neo(checkboxfield-icon-font-size)};
|
16
|
+
--checkboxfield-icon-margin : #{neo(checkboxfield-icon-margin)};
|
15
17
|
--checkboxfield-label-top-margin: #{neo(checkboxfield-label-top-margin)};
|
16
18
|
}
|
17
19
|
}
|
@@ -3,6 +3,7 @@ $neoMap: map-merge($neoMap, (
|
|
3
3
|
'checkboxfield-color-checked' : #1c60a0,
|
4
4
|
'checkboxfield-icon-font-family': var(--fa-style-family-classic),
|
5
5
|
'checkboxfield-icon-font-size' : 14px,
|
6
|
+
'checkboxfield-icon-margin' : 0,
|
6
7
|
'checkboxfield-label-top-margin': 0 0 3px
|
7
8
|
));
|
8
9
|
|
@@ -12,6 +13,7 @@ $neoMap: map-merge($neoMap, (
|
|
12
13
|
--checkboxfield-color-checked : #{neo(checkboxfield-color-checked)};
|
13
14
|
--checkboxfield-icon-font-family: #{neo(checkboxfield-icon-font-family)};
|
14
15
|
--checkboxfield-icon-font-size : #{neo(checkboxfield-icon-font-size)};
|
16
|
+
--checkboxfield-icon-margin : #{neo(checkboxfield-icon-margin)};
|
15
17
|
--checkboxfield-label-top-margin: #{neo(checkboxfield-label-top-margin)};
|
16
18
|
}
|
17
19
|
}
|
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.5.
|
239
|
+
* @default '5.5.5'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '5.5.
|
244
|
+
version: '5.5.5'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
package/src/form/field/Text.mjs
CHANGED
@@ -59,7 +59,7 @@ class Text extends Base {
|
|
59
59
|
*/
|
60
60
|
centerBorderElWidth: null,
|
61
61
|
/**
|
62
|
-
* True shows a clear trigger in case the field has a non
|
62
|
+
* True shows a clear trigger in case the field has a non-empty value.
|
63
63
|
* @member {Boolean} clearable_=true
|
64
64
|
*/
|
65
65
|
clearable_: true,
|
@@ -73,6 +73,11 @@ class Text extends Base {
|
|
73
73
|
* @member {String|null} error_=null
|
74
74
|
*/
|
75
75
|
error_: null,
|
76
|
+
/**
|
77
|
+
* Useful for fields inside a css grid where errors should live outside the layout
|
78
|
+
* @member {Boolean} errorPositionAbsolute_=false
|
79
|
+
*/
|
80
|
+
errorPositionAbsolute_: false,
|
76
81
|
/**
|
77
82
|
* data passes inputPattern, maxLength, minLength & valueLength properties
|
78
83
|
* @member {Function} errorTextInputPattern=data=>`Input pattern violation: ${data.inputPattern}`
|
@@ -190,7 +195,9 @@ class Text extends Base {
|
|
190
195
|
{tag: 'label', cls: [], style: {}},
|
191
196
|
{tag: 'label', cls: []},
|
192
197
|
{tag: 'input', cls: ['neo-textfield-input'], flag: 'neo-real-input', style: {}},
|
193
|
-
{cls: ['neo-textfield-error'], removeDom: true
|
198
|
+
{cls: ['neo-textfield-error-wrapper'], removeDom: true, cn: [
|
199
|
+
{cls: ['neo-textfield-error']}
|
200
|
+
]}
|
194
201
|
]}
|
195
202
|
}
|
196
203
|
|
@@ -294,6 +301,21 @@ class Text extends Base {
|
|
294
301
|
this.updateError(value)
|
295
302
|
}
|
296
303
|
|
304
|
+
/**
|
305
|
+
* Triggered after the errorPositionAbsolute config got changed
|
306
|
+
* @param {Boolean} value
|
307
|
+
* @param {Boolean} oldValue
|
308
|
+
* @protected
|
309
|
+
*/
|
310
|
+
afterSetErrorPositionAbsolute(value, oldValue) {
|
311
|
+
let me = this,
|
312
|
+
cls = VDomUtil.findVdomChild(me.vdom, {cls: 'neo-textfield-error'}).vdom.cls;
|
313
|
+
|
314
|
+
NeoArray[value ? 'add' : 'remove'](cls, 'neo-absolute');
|
315
|
+
|
316
|
+
me.update()
|
317
|
+
}
|
318
|
+
|
297
319
|
/**
|
298
320
|
* Triggered after the hideLabel config got changed
|
299
321
|
* @param {Boolean} value
|
@@ -1256,13 +1278,14 @@ class Text extends Base {
|
|
1256
1278
|
updateError(value, silent=false) {
|
1257
1279
|
let me = this,
|
1258
1280
|
cls = me.cls,
|
1259
|
-
errorNode;
|
1281
|
+
errorNode, errorWrapper;
|
1260
1282
|
|
1261
1283
|
if (!(me.clean && !me.mounted)) {
|
1262
1284
|
NeoArray[value ? 'add' : 'remove'](cls, 'neo-invalid');
|
1263
1285
|
me.cls = cls;
|
1264
1286
|
|
1265
|
-
|
1287
|
+
errorWrapper = VDomUtil.findVdomChild(me.vdom, {cls: 'neo-textfield-error-wrapper'}).vdom;
|
1288
|
+
errorNode = errorWrapper.cn[0];
|
1266
1289
|
|
1267
1290
|
if (value) {
|
1268
1291
|
errorNode.html = value;
|
@@ -1270,7 +1293,7 @@ class Text extends Base {
|
|
1270
1293
|
delete errorNode.html;
|
1271
1294
|
}
|
1272
1295
|
|
1273
|
-
|
1296
|
+
errorWrapper.removeDom = !value;
|
1274
1297
|
|
1275
1298
|
!silent && me.update()
|
1276
1299
|
}
|