neo.mjs 5.4.0 → 5.4.1
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
CHANGED
package/package.json
CHANGED
package/src/DefaultConfig.mjs
CHANGED
@@ -237,12 +237,12 @@ const DefaultConfig = {
|
|
237
237
|
useVdomWorker: true,
|
238
238
|
/**
|
239
239
|
* buildScripts/injectPackageVersion.mjs will update this value
|
240
|
-
* @default '5.4.
|
240
|
+
* @default '5.4.1'
|
241
241
|
* @memberOf! module:Neo
|
242
242
|
* @name config.version
|
243
243
|
* @type String
|
244
244
|
*/
|
245
|
-
version: '5.4.
|
245
|
+
version: '5.4.1'
|
246
246
|
};
|
247
247
|
|
248
248
|
Object.assign(DefaultConfig, {
|
package/src/form/Container.mjs
CHANGED
@@ -122,14 +122,19 @@ class Container extends BaseContainer {
|
|
122
122
|
ns = values;
|
123
123
|
}
|
124
124
|
|
125
|
+
/*
|
126
|
+
* CheckBoxes need custom logic
|
127
|
+
* => we only want to pass the uncheckedValue in case the field does not belong to a group
|
128
|
+
* (multiple fields using the same name)
|
129
|
+
*/
|
125
130
|
if (Object.hasOwn(ns, key) && value !== undefined) {
|
126
|
-
if (ns[key] ===
|
131
|
+
if (ns[key] === item.uncheckedValue) {
|
127
132
|
ns[key] = []
|
128
133
|
} else if (!Array.isArray(ns[key])) {
|
129
134
|
ns[key] = [ns[key]]
|
130
135
|
}
|
131
136
|
|
132
|
-
value !==
|
137
|
+
value !== item.uncheckedValue && ns[key].unshift(value)
|
133
138
|
} else if (value !== undefined) {
|
134
139
|
ns[key] = value
|
135
140
|
}
|
@@ -91,6 +91,13 @@ class CheckBox extends Base {
|
|
91
91
|
]}
|
92
92
|
}
|
93
93
|
|
94
|
+
/**
|
95
|
+
* In case the CheckBox does not belong to a group (multiple fields with the same name),
|
96
|
+
* you can pass a custom value for the unchecked state.
|
97
|
+
* @member {*} uncheckedValue=null
|
98
|
+
*/
|
99
|
+
uncheckedValue = null
|
100
|
+
|
94
101
|
/**
|
95
102
|
* @param {Object} config
|
96
103
|
*/
|
@@ -316,7 +323,9 @@ class CheckBox extends Base {
|
|
316
323
|
* @returns {String|null}
|
317
324
|
*/
|
318
325
|
getValue() {
|
319
|
-
|
326
|
+
let me = this;
|
327
|
+
|
328
|
+
return me.checked ? me.value : me.uncheckedValue
|
320
329
|
}
|
321
330
|
|
322
331
|
/**
|