neo.mjs 4.0.53 → 4.0.54
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/examples/form/field/text/MainContainer.mjs +7 -5
- package/package.json +1 -1
- package/resources/scss/src/form/field/Text.scss +20 -8
- package/resources/scss/theme-dark/form/field/Text.scss +3 -1
- package/resources/scss/theme-light/form/field/Text.scss +3 -1
- package/src/data/RecordFactory.mjs +12 -4
|
@@ -151,11 +151,13 @@ class MainContainer extends ConfigurationViewport {
|
|
|
151
151
|
|
|
152
152
|
createExampleComponent() {
|
|
153
153
|
return Neo.create(TextField, {
|
|
154
|
-
clearable
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
clearable : true,
|
|
155
|
+
labelPosition: 'inline',
|
|
156
|
+
labelText : 'Label',
|
|
157
|
+
labelWidth : 70,
|
|
158
|
+
minLength : 3,
|
|
159
|
+
value : 'Hello World',
|
|
160
|
+
width : 200
|
|
159
161
|
});
|
|
160
162
|
}
|
|
161
163
|
}
|
package/package.json
CHANGED
|
@@ -12,14 +12,26 @@
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
&.neo-invalid {
|
|
15
|
+
&.neo-invalid:not(.neo-disabled) {
|
|
16
16
|
.neo-input-wrapper {
|
|
17
|
-
border-color:
|
|
17
|
+
border-color: v(textfield-border-color-invalid);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
.neo-
|
|
22
|
-
border-color:
|
|
20
|
+
.neo-label-wrapper {
|
|
21
|
+
.neo-center-border, .neo-left-border, .neo-right-border {
|
|
22
|
+
border-bottom-color: v(textfield-border-color-invalid);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.neo-left-border, .neo-right-border {
|
|
26
|
+
border-top-color: v(textfield-border-color-invalid);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.neo-left-border {
|
|
30
|
+
border-left-color: v(textfield-border-color-invalid);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.neo-right-border {
|
|
34
|
+
border-right-color: v(textfield-border-color-invalid);
|
|
23
35
|
}
|
|
24
36
|
}
|
|
25
37
|
}
|
|
@@ -48,7 +60,7 @@
|
|
|
48
60
|
}
|
|
49
61
|
|
|
50
62
|
.neo-center-border {
|
|
51
|
-
border-top-color: transparent;
|
|
63
|
+
border-top-color: transparent !important;
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
.neo-left-border {
|
|
@@ -82,7 +94,7 @@
|
|
|
82
94
|
}
|
|
83
95
|
|
|
84
96
|
.neo-input-wrapper {
|
|
85
|
-
border-color: transparent;
|
|
97
|
+
border-color: transparent !important;
|
|
86
98
|
}
|
|
87
99
|
|
|
88
100
|
.neo-label-wrapper {
|
|
@@ -193,7 +205,7 @@
|
|
|
193
205
|
}
|
|
194
206
|
|
|
195
207
|
&.neo-invalid {
|
|
196
|
-
border-color:
|
|
208
|
+
border-color: v(textfield-border-color-invalid);
|
|
197
209
|
|
|
198
210
|
&.neo-disabled {
|
|
199
211
|
border-color: inherit;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
$neoMap: map-merge($neoMap, (
|
|
2
2
|
'textfield-border-color' : #424242,
|
|
3
3
|
'textfield-border-color-active' : #5d83a7,
|
|
4
|
+
'textfield-border-color-invalid' : brown,
|
|
4
5
|
'textfield-border-radius' : 0,
|
|
5
6
|
'textfield-input-background-color' : #2b2b2b,
|
|
6
7
|
'textfield-input-color' : #ccc,
|
|
@@ -13,6 +14,7 @@ $neoMap: map-merge($neoMap, (
|
|
|
13
14
|
:root .neo-theme-dark { // .neo-textfield
|
|
14
15
|
--textfield-border-color : #{neo(textfield-border-color)};
|
|
15
16
|
--textfield-border-color-active : #{neo(textfield-border-color-active)};
|
|
17
|
+
--textfield-border-color-invalid : #{neo(textfield-border-color-invalid)};
|
|
16
18
|
--textfield-border-radius : #{neo(textfield-border-radius)};
|
|
17
19
|
--textfield-input-background-color : #{neo(textfield-input-background-color)};
|
|
18
20
|
--textfield-input-color : #{neo(textfield-input-color)};
|
|
@@ -20,4 +22,4 @@ $neoMap: map-merge($neoMap, (
|
|
|
20
22
|
--textfield-input-placeholder-opacity: #{neo(textfield-input-placeholder-opacity)};
|
|
21
23
|
--textfield-label-color : #{neo(textfield-label-color)};
|
|
22
24
|
}
|
|
23
|
-
}
|
|
25
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
$neoMap: map-merge($neoMap, (
|
|
2
2
|
'textfield-border-color' : #ddd,
|
|
3
3
|
'textfield-border-color-active' : #1c60a0,
|
|
4
|
+
'textfield-border-color-invalid' : brown,
|
|
4
5
|
'textfield-border-radius' : 3px,
|
|
5
6
|
'textfield-input-background-color' : #fff,
|
|
6
7
|
'textfield-input-color' : #000,
|
|
@@ -13,6 +14,7 @@ $neoMap: map-merge($neoMap, (
|
|
|
13
14
|
:root .neo-theme-light { // .neo-textfield
|
|
14
15
|
--textfield-border-color : #{neo(textfield-border-color)};
|
|
15
16
|
--textfield-border-color-active : #{neo(textfield-border-color-active)};
|
|
17
|
+
--textfield-border-color-invalid : #{neo(textfield-border-color-invalid)};
|
|
16
18
|
--textfield-border-radius : #{neo(textfield-border-radius)};
|
|
17
19
|
--textfield-input-background-color : #{neo(textfield-input-background-color)};
|
|
18
20
|
--textfield-input-color : #{neo(textfield-input-color)};
|
|
@@ -20,4 +22,4 @@ $neoMap: map-merge($neoMap, (
|
|
|
20
22
|
--textfield-input-placeholder-opacity: #{neo(textfield-input-placeholder-opacity)};
|
|
21
23
|
--textfield-label-color : #{neo(textfield-label-color)};
|
|
22
24
|
}
|
|
23
|
-
}
|
|
25
|
+
}
|
|
@@ -231,6 +231,7 @@ class RecordFactory extends Base {
|
|
|
231
231
|
let mapping = field.mapping,
|
|
232
232
|
maxLength = field.maxLength,
|
|
233
233
|
minLength = field.minLength,
|
|
234
|
+
nullable = field.nullable,
|
|
234
235
|
oldValue = recordConfig?.[field.name] || record[field.name],
|
|
235
236
|
type = field.type?.toLowerCase();
|
|
236
237
|
|
|
@@ -244,16 +245,23 @@ class RecordFactory extends Base {
|
|
|
244
245
|
value = ns[key];
|
|
245
246
|
}
|
|
246
247
|
|
|
247
|
-
if (Object.hasOwn(field, maxLength)) {
|
|
248
|
+
if (Object.hasOwn(field, 'maxLength')) {
|
|
248
249
|
if (value?.toString() > maxLength) {
|
|
249
|
-
console.warn(`Setting record field: ${field} value: ${value} conflicts with
|
|
250
|
+
console.warn(`Setting record field: ${field} value: ${value} conflicts with maxLength: ${maxLength}`);
|
|
250
251
|
return oldValue;
|
|
251
252
|
}
|
|
252
253
|
}
|
|
253
254
|
|
|
254
|
-
if (Object.hasOwn(field, minLength)) {
|
|
255
|
+
if (Object.hasOwn(field, 'minLength')) {
|
|
255
256
|
if (value?.toString() < minLength) {
|
|
256
|
-
console.warn(`Setting record field: ${field} value: ${value} conflicts with
|
|
257
|
+
console.warn(`Setting record field: ${field} value: ${value} conflicts with minLength: ${minLength}`);
|
|
258
|
+
return oldValue;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (Object.hasOwn(field, 'nullable')) {
|
|
263
|
+
if (nullable === false && value === null) {
|
|
264
|
+
console.warn(`Setting record field: ${field} value: ${value} conflicts with nullable: ${nullable}`);
|
|
257
265
|
return oldValue;
|
|
258
266
|
}
|
|
259
267
|
}
|