@masterteam/components 0.0.259 → 0.0.261

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.
@@ -261,7 +261,7 @@ class EntityUser {
261
261
  return displayOrPlaceholder(user.displayName ?? null);
262
262
  }
263
263
  userPhotoFor(user) {
264
- return user.photoUrl ?? '';
264
+ return this.showUserImage() ? (user.photoUrl ?? '') : '';
265
265
  }
266
266
  labelTextFor(user) {
267
267
  return user.name ?? '';
@@ -282,7 +282,7 @@ class EntityUser {
282
282
  emptyUserName = computed(() => displayOrPlaceholder(null), ...(ngDevMode ? [{ debugName: "emptyUserName" }] : /* istanbul ignore next */ []));
283
283
  rawUserName = computed(() => this.userValue()?.displayName ?? null, ...(ngDevMode ? [{ debugName: "rawUserName" }] : /* istanbul ignore next */ []));
284
284
  userName = computed(() => displayOrPlaceholder(this.rawUserName()), ...(ngDevMode ? [{ debugName: "userName" }] : /* istanbul ignore next */ []));
285
- userPhoto = computed(() => this.userValue()?.photoUrl ?? '', ...(ngDevMode ? [{ debugName: "userPhoto" }] : /* istanbul ignore next */ []));
285
+ userPhoto = computed(() => this.showUserImage() ? (this.userValue()?.photoUrl ?? '') : '', ...(ngDevMode ? [{ debugName: "userPhoto" }] : /* istanbul ignore next */ []));
286
286
  labelText = computed(() => this.userValue()?.name ?? '', ...(ngDevMode ? [{ debugName: "labelText" }] : /* istanbul ignore next */ []));
287
287
  /**
288
288
  * `true` when the referenced user is no longer linked to the application.
@@ -295,6 +295,11 @@ class EntityUser {
295
295
  showDisplayName = computed(() => this.config().showDisplayName ?? true, ...(ngDevMode ? [{ debugName: "showDisplayName" }] : /* istanbul ignore next */ []));
296
296
  showPhoneNumber = computed(() => this.config().showPhoneNumber ?? false, ...(ngDevMode ? [{ debugName: "showPhoneNumber" }] : /* istanbul ignore next */ []));
297
297
  showEmail = computed(() => this.config().showEmail ?? false, ...(ngDevMode ? [{ debugName: "showEmail" }] : /* istanbul ignore next */ []));
298
+ /**
299
+ * When off, the avatar falls back to the generic user icon so the layout keeps
300
+ * its shape while the user's real picture stays hidden.
301
+ */
302
+ showUserImage = computed(() => this.config().showUserImage ?? true, ...(ngDevMode ? [{ debugName: "showUserImage" }] : /* istanbul ignore next */ []));
298
303
  phoneNumber = computed(() => this.userValue()?.phoneNumber ?? '', ...(ngDevMode ? [{ debugName: "phoneNumber" }] : /* istanbul ignore next */ []));
299
304
  email = computed(() => this.userValue()?.email ?? '', ...(ngDevMode ? [{ debugName: "email" }] : /* istanbul ignore next */ []));
300
305
  hasContactInfo = computed(() => (this.showPhoneNumber() && !!this.phoneNumber()) ||
@@ -594,11 +599,11 @@ class EntityLookup {
594
599
  return `rgba(${r}, ${g}, ${b}, ${alpha})`;
595
600
  }
596
601
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookup, deps: [], target: i0.ɵɵFactoryTarget.Component });
597
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLookup, isStandalone: true, selector: "mt-entity-lookup", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n gap=\"normal\"\n>\n @if (lookupValues().length) {\n <div class=\"flex flex-wrap gap-2\" data-testid=\"lookup-values\">\n @for (lookup of lookupValues(); track lookup.key) {\n <span\n class=\"inline-flex w-fit items-center rounded-md px-3 py-2 text-xs font-semibold\"\n data-testid=\"lookup-value\"\n [style]=\"lookupBadgeStyle(lookup)\"\n >\n {{ lookupLabel(lookup) }}\n </span>\n }\n </div>\n } @else {\n <span\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\n >\n {{ emptyLabel }}\n </span>\n }\n</mt-entity-field>\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }] });
602
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLookup, isStandalone: true, selector: "mt-entity-lookup", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (lookupValues().length) {\r\n <div class=\"flex flex-wrap gap-2\" data-testid=\"lookup-values\">\r\n @for (lookup of lookupValues(); track lookup.key) {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md px-3 py-2 text-xs font-semibold\"\r\n data-testid=\"lookup-value\"\r\n [style]=\"lookupBadgeStyle(lookup)\"\r\n >\r\n {{ lookupLabel(lookup) }}\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }] });
598
603
  }
599
604
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookup, decorators: [{
600
605
  type: Component,
601
- args: [{ selector: 'mt-entity-lookup', standalone: true, imports: [EntityField], template: "<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n gap=\"normal\"\n>\n @if (lookupValues().length) {\n <div class=\"flex flex-wrap gap-2\" data-testid=\"lookup-values\">\n @for (lookup of lookupValues(); track lookup.key) {\n <span\n class=\"inline-flex w-fit items-center rounded-md px-3 py-2 text-xs font-semibold\"\n data-testid=\"lookup-value\"\n [style]=\"lookupBadgeStyle(lookup)\"\n >\n {{ lookupLabel(lookup) }}\n </span>\n }\n </div>\n } @else {\n <span\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\n >\n {{ emptyLabel }}\n </span>\n }\n</mt-entity-field>\n" }]
606
+ args: [{ selector: 'mt-entity-lookup', standalone: true, imports: [EntityField], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (lookupValues().length) {\r\n <div class=\"flex flex-wrap gap-2\" data-testid=\"lookup-values\">\r\n @for (lookup of lookupValues(); track lookup.key) {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md px-3 py-2 text-xs font-semibold\"\r\n data-testid=\"lookup-value\"\r\n [style]=\"lookupBadgeStyle(lookup)\"\r\n >\r\n {{ lookupLabel(lookup) }}\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
602
607
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
603
608
 
604
609
  /**