@masterteam/components 0.0.197 → 0.0.199

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.
@@ -238,7 +238,8 @@ class EntityUser {
238
238
  * `true` when the referenced user is no longer linked to the application.
239
239
  * Drives the inline info badge/tooltip next to the display name.
240
240
  */
241
- isUnlinked = computed(() => this.userValue()?.isLinkedToCurrentApplication === false, ...(ngDevMode ? [{ debugName: "isUnlinked" }] : /* istanbul ignore next */ []));
241
+ isUnlinked = computed(() => this.userValue()?.isLinkedToCurrentApplication === false &&
242
+ this.userValue()?.userName, ...(ngDevMode ? [{ debugName: "isUnlinked" }] : /* istanbul ignore next */ []));
242
243
  // ── Configuration-driven visibility ──
243
244
  config = computed(() => this.data()?.configuration ?? {}, ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
244
245
  showDisplayName = computed(() => this.config().showDisplayName ?? true, ...(ngDevMode ? [{ debugName: "showDisplayName" }] : /* istanbul ignore next */ []));
@@ -274,10 +275,12 @@ class EntityPercentage {
274
275
  displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
275
276
  displayValue = computed(() => {
276
277
  const d = this.data();
277
- if (d) {
278
- return displayOrPlaceholder(typeof d.value === 'string' ? d.value : null);
279
- }
280
- return displayOrPlaceholder(this.value());
278
+ const raw = d
279
+ ? typeof d.value === 'string'
280
+ ? d.value
281
+ : null
282
+ : this.value();
283
+ return displayOrPlaceholder(this.formatPercentageDisplay(raw));
281
284
  }, ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
282
285
  rawNumericValue = computed(() => this.data()?.rawValue ??
283
286
  this.rawValue() ??
@@ -304,6 +307,18 @@ class EntityPercentage {
304
307
  const fromProperty = d?.propertyConfiguration?.color?.trim();
305
308
  return direct || fromProperty || 'primary';
306
309
  }, ...(ngDevMode ? [{ debugName: "progressColor" }] : /* istanbul ignore next */ []));
310
+ /** Rounds a numeric percentage to one decimal place, preserving a `%` suffix. */
311
+ formatPercentageDisplay(raw) {
312
+ if (isValueMissing(raw)) {
313
+ return raw;
314
+ }
315
+ const num = this.parseNumericValue(raw);
316
+ if (num === null) {
317
+ return raw;
318
+ }
319
+ const rounded = String(Number(num.toFixed(1)));
320
+ return String(raw).includes('%') ? `${rounded}%` : rounded;
321
+ }
307
322
  parseNumericValue(raw) {
308
323
  if (isValueMissing(raw)) {
309
324
  return null;