@masterteam/components 0.0.323 → 0.0.324
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.
|
@@ -3107,8 +3107,8 @@ class EntityListField {
|
|
|
3107
3107
|
viewType: column.viewType ?? 'Text',
|
|
3108
3108
|
value: value !== null && typeof value === 'object'
|
|
3109
3109
|
? value
|
|
3110
|
-
: (this.toRawValue(value) ?? ''),
|
|
3111
|
-
rawValue: this.toRawValue(raw) ?? undefined,
|
|
3110
|
+
: (this.toRawValue(value, column.viewType) ?? ''),
|
|
3111
|
+
rawValue: this.toRawValue(raw, column.viewType) ?? undefined,
|
|
3112
3112
|
configuration: column.configuration,
|
|
3113
3113
|
propertyConfiguration: this.propertyByKey().get(propertyKey)?.configuration,
|
|
3114
3114
|
};
|
|
@@ -3261,15 +3261,24 @@ class EntityListField {
|
|
|
3261
3261
|
.filter(([propertyKey]) => allowed.size === 0 || allowed.has(propertyKey))
|
|
3262
3262
|
.map(([propertyKey, value]) => ({
|
|
3263
3263
|
propertyKey,
|
|
3264
|
-
rawValue: this.toRawValue(propertyKey in submitShaped ? submitShaped[propertyKey] : value),
|
|
3264
|
+
rawValue: this.toRawValue(propertyKey in submitShaped ? submitShaped[propertyKey] : value, this.propertyByKey().get(propertyKey)?.viewType),
|
|
3265
3265
|
}));
|
|
3266
3266
|
}
|
|
3267
3267
|
/** Backend `rawValue` is a serialized scalar; objects/arrays go as JSON. */
|
|
3268
|
-
toRawValue(value) {
|
|
3268
|
+
toRawValue(value, viewType) {
|
|
3269
3269
|
if (value == null || value === '')
|
|
3270
3270
|
return null;
|
|
3271
|
-
if (value instanceof Date)
|
|
3271
|
+
if (value instanceof Date) {
|
|
3272
|
+
// The picker holds local midnight. A Date property is a calendar day,
|
|
3273
|
+
// so converting it to UTC can display yesterday in the pending row.
|
|
3274
|
+
// DateTime remains an instant and keeps its existing UTC serialization.
|
|
3275
|
+
if (viewType === 'Date') {
|
|
3276
|
+
if (Number.isNaN(value.getTime()))
|
|
3277
|
+
return null;
|
|
3278
|
+
return `${String(value.getFullYear()).padStart(4, '0')}-${String(value.getMonth() + 1).padStart(2, '0')}-${String(value.getDate()).padStart(2, '0')}`;
|
|
3279
|
+
}
|
|
3272
3280
|
return value.toISOString();
|
|
3281
|
+
}
|
|
3273
3282
|
if (typeof value === 'object')
|
|
3274
3283
|
return JSON.stringify(value);
|
|
3275
3284
|
return String(value);
|