@masterteam/components 0.0.323 → 0.0.325

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