@masterteam/components 0.0.250 → 0.0.252
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/assets/common.css +1 -1
- package/assets/ds-components/datepicker.css +180 -180
- package/assets/ds-components/misc.css +263 -263
- package/assets/ds-components/tabs.css +265 -331
- package/assets/ds-identity.css +284 -284
- package/assets/i18n/ar.json +2 -1
- package/assets/i18n/en.json +2 -1
- package/fesm2022/masterteam-components-business-fields.mjs +6 -2
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +64 -12
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +14 -14
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +24 -4
- package/types/masterteam-components-table.d.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, ChangeDetectionStrategy, Component,
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component, signal, effect, untracked, inject, output, ElementRef, NgZone, Directive, model } from '@angular/core';
|
|
3
3
|
import { TruncateTooltip, Tooltip } from '@masterteam/components/tooltip';
|
|
4
4
|
import { Icon } from '@masterteam/icons';
|
|
5
5
|
import { MTDateFormatPipe, REQUEST_CONTEXT } from '@masterteam/components';
|
|
@@ -234,15 +234,52 @@ class EntityUser {
|
|
|
234
234
|
});
|
|
235
235
|
/** Full entity data object */
|
|
236
236
|
data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
|
|
237
|
+
expanded = signal(false, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
237
238
|
displayName = computed(() => this.data()?.name ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
|
|
238
|
-
|
|
239
|
-
|
|
239
|
+
isMultiUser = computed(() => this.data()?.viewType === 'MultiUser', ...(ngDevMode ? [{ debugName: "isMultiUser" }] : /* istanbul ignore next */ []));
|
|
240
|
+
/** Resolved user objects from either a User or MultiUser entity value. */
|
|
241
|
+
users = computed(() => {
|
|
240
242
|
const val = this.data()?.value;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
+
const values = Array.isArray(val) ? val : [val];
|
|
244
|
+
return values.filter(isEntityUserValue);
|
|
245
|
+
}, ...(ngDevMode ? [{ debugName: "users" }] : /* istanbul ignore next */ []));
|
|
246
|
+
maxVisibleUsers = computed(() => {
|
|
247
|
+
const configured = Number(this.config().maxVisibleUsers);
|
|
248
|
+
return Number.isInteger(configured) && configured > 0 ? configured : 5;
|
|
249
|
+
}, ...(ngDevMode ? [{ debugName: "maxVisibleUsers" }] : /* istanbul ignore next */ []));
|
|
250
|
+
visibleUsers = computed(() => {
|
|
251
|
+
const users = this.users();
|
|
252
|
+
if (!this.isMultiUser() || this.expanded()) {
|
|
253
|
+
return users;
|
|
243
254
|
}
|
|
244
|
-
return
|
|
245
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
255
|
+
return users.slice(0, this.maxVisibleUsers());
|
|
256
|
+
}, ...(ngDevMode ? [{ debugName: "visibleUsers" }] : /* istanbul ignore next */ []));
|
|
257
|
+
hiddenUserCount = computed(() => this.users().length - this.visibleUsers().length, ...(ngDevMode ? [{ debugName: "hiddenUserCount" }] : /* istanbul ignore next */ []));
|
|
258
|
+
/** First user retained for the existing single-user computed API. */
|
|
259
|
+
userValue = computed(() => this.users()[0] ?? null, ...(ngDevMode ? [{ debugName: "userValue" }] : /* istanbul ignore next */ []));
|
|
260
|
+
userNameFor(user) {
|
|
261
|
+
return displayOrPlaceholder(user.displayName ?? null);
|
|
262
|
+
}
|
|
263
|
+
userPhotoFor(user) {
|
|
264
|
+
return user.photoUrl ?? '';
|
|
265
|
+
}
|
|
266
|
+
labelTextFor(user) {
|
|
267
|
+
return user.name ?? '';
|
|
268
|
+
}
|
|
269
|
+
isUnlinkedUser(user) {
|
|
270
|
+
return user.isLinkedToCurrentApplication === false && !!user.userName;
|
|
271
|
+
}
|
|
272
|
+
phoneNumberFor(user) {
|
|
273
|
+
return user.phoneNumber ?? '';
|
|
274
|
+
}
|
|
275
|
+
emailFor(user) {
|
|
276
|
+
return user.email ?? '';
|
|
277
|
+
}
|
|
278
|
+
hasContactInfoFor(user) {
|
|
279
|
+
return ((this.showPhoneNumber() && !!this.phoneNumberFor(user)) ||
|
|
280
|
+
(this.showEmail() && !!this.emailFor(user)));
|
|
281
|
+
}
|
|
282
|
+
emptyUserName = computed(() => displayOrPlaceholder(null), ...(ngDevMode ? [{ debugName: "emptyUserName" }] : /* istanbul ignore next */ []));
|
|
246
283
|
rawUserName = computed(() => this.userValue()?.displayName ?? null, ...(ngDevMode ? [{ debugName: "rawUserName" }] : /* istanbul ignore next */ []));
|
|
247
284
|
userName = computed(() => displayOrPlaceholder(this.rawUserName()), ...(ngDevMode ? [{ debugName: "userName" }] : /* istanbul ignore next */ []));
|
|
248
285
|
userPhoto = computed(() => this.userValue()?.photoUrl ?? '', ...(ngDevMode ? [{ debugName: "userPhoto" }] : /* istanbul ignore next */ []));
|
|
@@ -262,8 +299,17 @@ class EntityUser {
|
|
|
262
299
|
email = computed(() => this.userValue()?.email ?? '', ...(ngDevMode ? [{ debugName: "email" }] : /* istanbul ignore next */ []));
|
|
263
300
|
hasContactInfo = computed(() => (this.showPhoneNumber() && !!this.phoneNumber()) ||
|
|
264
301
|
(this.showEmail() && !!this.email()), ...(ngDevMode ? [{ debugName: "hasContactInfo" }] : /* istanbul ignore next */ []));
|
|
302
|
+
constructor() {
|
|
303
|
+
effect(() => {
|
|
304
|
+
void this.data()?.value;
|
|
305
|
+
untracked(() => this.expanded.set(false));
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
showAllUsers() {
|
|
309
|
+
this.expanded.set(true);
|
|
310
|
+
}
|
|
265
311
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityUser, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
266
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityUser, isStandalone: true, selector: "mt-entity-user", inputs: { data: { classPropertyName: "data", publicName: "data", 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 <div class=\"flex items-center gap-2\">\r\n
|
|
312
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityUser, isStandalone: true, selector: "mt-entity-user", inputs: { data: { classPropertyName: "data", publicName: "data", 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 (isMultiUser()) {\r\n <div\r\n class=\"flex min-w-0 flex-wrap items-center gap-2\"\r\n data-testid=\"multi-user-list\"\r\n >\r\n @for (user of visibleUsers(); track user.id ?? $index) {\r\n <div\r\n class=\"inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-full border border-surface-200 bg-surface-50 py-1 ps-1 pe-2\"\r\n >\r\n <mt-avatar\r\n [image]=\"\r\n userPhotoFor(user)\r\n ? (userPhotoFor(user)\r\n | secureImage: true : httpContext : 'avatar/')\r\n : ''\r\n \"\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-7! h-7! text-white! text-sm! bg-primary-500!\"\r\n ></mt-avatar>\r\n\r\n @if (showDisplayName()) {\r\n <span\r\n class=\"max-w-36 truncate text-xs text-gray-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ userNameFor(user) }}</span\r\n >\r\n }\r\n\r\n @if (isUnlinkedUser(user)) {\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"shrink-0 text-xs text-amber-500\"\r\n [mtTooltip]=\"'components.userReference.notLinked' | transloco\"\r\n tooltipPosition=\"top\"\r\n />\r\n }\r\n\r\n @if (showPhoneNumber() && phoneNumberFor(user)) {\r\n <a\r\n [href]=\"'tel:' + phoneNumberFor(user)\"\r\n [attr.aria-label]=\"phoneNumberFor(user)\"\r\n [mtTooltip]=\"phoneNumberFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex shrink-0\"\r\n >\r\n <mt-icon icon=\"communication.phone\" size=\"xs\" />\r\n </a>\r\n }\r\n\r\n @if (showEmail() && emailFor(user)) {\r\n <a\r\n [href]=\"'mailto:' + emailFor(user)\"\r\n [attr.aria-label]=\"emailFor(user)\"\r\n [mtTooltip]=\"emailFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex shrink-0\"\r\n >\r\n <mt-icon icon=\"communication.mail-01\" size=\"xs\" />\r\n </a>\r\n }\r\n </div>\r\n } @empty {\r\n <span class=\"text-sm text-gray-700\">{{ emptyUserName() }}</span>\r\n }\r\n\r\n @if (hiddenUserCount() > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-8 min-w-8 shrink-0 cursor-pointer items-center justify-center rounded-full border border-primary-200 bg-primary-50 px-2 text-xs font-semibold text-primary-700 transition-colors hover:bg-primary-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500\"\r\n data-testid=\"show-all-users\"\r\n [attr.aria-label]=\"\r\n 'components.userReference.showMore'\r\n | transloco: { count: hiddenUserCount() }\r\n \"\r\n [mtTooltip]=\"\r\n 'components.userReference.showMore'\r\n | transloco: { count: hiddenUserCount() }\r\n \"\r\n tooltipPosition=\"top\"\r\n (click)=\"showAllUsers()\"\r\n >\r\n +{{ hiddenUserCount() }}\r\n </button>\r\n }\r\n </div>\r\n } @else {\r\n @if (users()[0]; as user) {\r\n <div class=\"flex min-w-0 items-center gap-2\">\r\n <mt-avatar\r\n [image]=\"\r\n userPhotoFor(user)\r\n ? (userPhotoFor(user)\r\n | secureImage: true : httpContext : 'avatar/')\r\n : ''\r\n \"\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-10! h-10! text-white! text-xxl! bg-primary-500!\"\r\n ></mt-avatar>\r\n\r\n @if (showDisplayName()) {\r\n <div class=\"flex min-w-0 flex-1 flex-col\">\r\n <div class=\"flex min-w-0 items-center gap-1\">\r\n <span\r\n class=\"truncate text-sm text-gray-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ userNameFor(user) }}</span\r\n >\r\n @if (isUnlinkedUser(user)) {\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"shrink-0 text-sm text-amber-500\"\r\n [mtTooltip]=\"'components.userReference.notLinked' | transloco\"\r\n tooltipPosition=\"top\"\r\n />\r\n }\r\n </div>\r\n @if (labelTextFor(user)) {\r\n <span class=\"truncate text-xs text-gray-500\">{{\r\n labelTextFor(user)\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (hasContactInfoFor(user)) {\r\n <div class=\"ms-auto flex shrink-0 items-center gap-1.5\">\r\n @if (showPhoneNumber() && phoneNumberFor(user)) {\r\n <a\r\n [href]=\"'tel:' + phoneNumberFor(user)\"\r\n [attr.aria-label]=\"phoneNumberFor(user)\"\r\n [mtTooltip]=\"phoneNumberFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex\"\r\n >\r\n <mt-avatar\r\n icon=\"communication.phone\"\r\n badgeSeverity=\"secondary\"\r\n styleClass=\"bg-surface-100! text-surface-600! h-7! w-7! text-sm! font-semibold!\"\r\n />\r\n </a>\r\n }\r\n @if (showEmail() && emailFor(user)) {\r\n <a\r\n [href]=\"'mailto:' + emailFor(user)\"\r\n [attr.aria-label]=\"emailFor(user)\"\r\n [mtTooltip]=\"emailFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex\"\r\n >\r\n <mt-avatar\r\n styleClass=\"bg-surface-100! text-surface-600! h-7! w-7! text-sm! font-semibold!\"\r\n icon=\"communication.mail-01\"\r\n badgeSeverity=\"secondary\"\r\n />\r\n </a>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"flex min-w-0 items-center gap-2\">\r\n <mt-avatar\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-10! h-10! text-white! text-xxl! bg-primary-500!\"\r\n ></mt-avatar>\r\n @if (showDisplayName()) {\r\n <span class=\"truncate text-sm text-gray-700\">{{\r\n emptyUserName()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "pipe", type: SecureImagePipe, name: "secureImage" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
|
|
267
313
|
}
|
|
268
314
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityUser, decorators: [{
|
|
269
315
|
type: Component,
|
|
@@ -275,8 +321,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
275
321
|
SecureImagePipe,
|
|
276
322
|
EntityField,
|
|
277
323
|
TranslocoPipe,
|
|
278
|
-
], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n <div class=\"flex items-center gap-2\">\r\n
|
|
279
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
324
|
+
], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (isMultiUser()) {\r\n <div\r\n class=\"flex min-w-0 flex-wrap items-center gap-2\"\r\n data-testid=\"multi-user-list\"\r\n >\r\n @for (user of visibleUsers(); track user.id ?? $index) {\r\n <div\r\n class=\"inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-full border border-surface-200 bg-surface-50 py-1 ps-1 pe-2\"\r\n >\r\n <mt-avatar\r\n [image]=\"\r\n userPhotoFor(user)\r\n ? (userPhotoFor(user)\r\n | secureImage: true : httpContext : 'avatar/')\r\n : ''\r\n \"\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-7! h-7! text-white! text-sm! bg-primary-500!\"\r\n ></mt-avatar>\r\n\r\n @if (showDisplayName()) {\r\n <span\r\n class=\"max-w-36 truncate text-xs text-gray-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ userNameFor(user) }}</span\r\n >\r\n }\r\n\r\n @if (isUnlinkedUser(user)) {\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"shrink-0 text-xs text-amber-500\"\r\n [mtTooltip]=\"'components.userReference.notLinked' | transloco\"\r\n tooltipPosition=\"top\"\r\n />\r\n }\r\n\r\n @if (showPhoneNumber() && phoneNumberFor(user)) {\r\n <a\r\n [href]=\"'tel:' + phoneNumberFor(user)\"\r\n [attr.aria-label]=\"phoneNumberFor(user)\"\r\n [mtTooltip]=\"phoneNumberFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex shrink-0\"\r\n >\r\n <mt-icon icon=\"communication.phone\" size=\"xs\" />\r\n </a>\r\n }\r\n\r\n @if (showEmail() && emailFor(user)) {\r\n <a\r\n [href]=\"'mailto:' + emailFor(user)\"\r\n [attr.aria-label]=\"emailFor(user)\"\r\n [mtTooltip]=\"emailFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex shrink-0\"\r\n >\r\n <mt-icon icon=\"communication.mail-01\" size=\"xs\" />\r\n </a>\r\n }\r\n </div>\r\n } @empty {\r\n <span class=\"text-sm text-gray-700\">{{ emptyUserName() }}</span>\r\n }\r\n\r\n @if (hiddenUserCount() > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-8 min-w-8 shrink-0 cursor-pointer items-center justify-center rounded-full border border-primary-200 bg-primary-50 px-2 text-xs font-semibold text-primary-700 transition-colors hover:bg-primary-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500\"\r\n data-testid=\"show-all-users\"\r\n [attr.aria-label]=\"\r\n 'components.userReference.showMore'\r\n | transloco: { count: hiddenUserCount() }\r\n \"\r\n [mtTooltip]=\"\r\n 'components.userReference.showMore'\r\n | transloco: { count: hiddenUserCount() }\r\n \"\r\n tooltipPosition=\"top\"\r\n (click)=\"showAllUsers()\"\r\n >\r\n +{{ hiddenUserCount() }}\r\n </button>\r\n }\r\n </div>\r\n } @else {\r\n @if (users()[0]; as user) {\r\n <div class=\"flex min-w-0 items-center gap-2\">\r\n <mt-avatar\r\n [image]=\"\r\n userPhotoFor(user)\r\n ? (userPhotoFor(user)\r\n | secureImage: true : httpContext : 'avatar/')\r\n : ''\r\n \"\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-10! h-10! text-white! text-xxl! bg-primary-500!\"\r\n ></mt-avatar>\r\n\r\n @if (showDisplayName()) {\r\n <div class=\"flex min-w-0 flex-1 flex-col\">\r\n <div class=\"flex min-w-0 items-center gap-1\">\r\n <span\r\n class=\"truncate text-sm text-gray-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ userNameFor(user) }}</span\r\n >\r\n @if (isUnlinkedUser(user)) {\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"shrink-0 text-sm text-amber-500\"\r\n [mtTooltip]=\"'components.userReference.notLinked' | transloco\"\r\n tooltipPosition=\"top\"\r\n />\r\n }\r\n </div>\r\n @if (labelTextFor(user)) {\r\n <span class=\"truncate text-xs text-gray-500\">{{\r\n labelTextFor(user)\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (hasContactInfoFor(user)) {\r\n <div class=\"ms-auto flex shrink-0 items-center gap-1.5\">\r\n @if (showPhoneNumber() && phoneNumberFor(user)) {\r\n <a\r\n [href]=\"'tel:' + phoneNumberFor(user)\"\r\n [attr.aria-label]=\"phoneNumberFor(user)\"\r\n [mtTooltip]=\"phoneNumberFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex\"\r\n >\r\n <mt-avatar\r\n icon=\"communication.phone\"\r\n badgeSeverity=\"secondary\"\r\n styleClass=\"bg-surface-100! text-surface-600! h-7! w-7! text-sm! font-semibold!\"\r\n />\r\n </a>\r\n }\r\n @if (showEmail() && emailFor(user)) {\r\n <a\r\n [href]=\"'mailto:' + emailFor(user)\"\r\n [attr.aria-label]=\"emailFor(user)\"\r\n [mtTooltip]=\"emailFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex\"\r\n >\r\n <mt-avatar\r\n styleClass=\"bg-surface-100! text-surface-600! h-7! w-7! text-sm! font-semibold!\"\r\n icon=\"communication.mail-01\"\r\n badgeSeverity=\"secondary\"\r\n />\r\n </a>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"flex min-w-0 items-center gap-2\">\r\n <mt-avatar\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-10! h-10! text-white! text-xxl! bg-primary-500!\"\r\n ></mt-avatar>\r\n @if (showDisplayName()) {\r\n <span class=\"truncate text-sm text-gray-700\">{{\r\n emptyUserName()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n }\r\n</mt-entity-field>\r\n" }]
|
|
325
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
326
|
+
function isEntityUserValue(value) {
|
|
327
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
return 'displayName' in value;
|
|
331
|
+
}
|
|
280
332
|
|
|
281
333
|
/** A finite number, or null for anything that cannot be compared numerically. */
|
|
282
334
|
function toFiniteNumber(value) {
|
|
@@ -1200,7 +1252,7 @@ class EntityValuePreview {
|
|
|
1200
1252
|
return viewType === 'LookupMatrix' ? 'Lookup' : viewType;
|
|
1201
1253
|
}, ...(ngDevMode ? [{ debugName: "previewType" }] : /* istanbul ignore next */ []));
|
|
1202
1254
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityValuePreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1203
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityValuePreview, isStandalone: true, selector: "mt-entity-value-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block min-w-0 w-full" }, ngImport: i0, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"Time\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'Time'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Number\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"PhaseGate\") {\r\n <mt-entity-phase-gate [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n", dependencies: [{ kind: "component", type: EntityText, selector: "mt-entity-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLongText, selector: "mt-entity-long-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityDate, selector: "mt-entity-date", inputs: ["data", "name", "value", "viewType"] }, { kind: "component", type: EntityUser, selector: "mt-entity-user", inputs: ["data"] }, { kind: "component", type: EntityPercentage, selector: "mt-entity-percentage", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityCurrency, selector: "mt-entity-currency", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityCheckbox, selector: "mt-entity-checkbox", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityLookup, selector: "mt-entity-lookup", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityPhaseGate, selector: "mt-entity-phase-gate", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityAttachment, selector: "mt-entity-attachment", inputs: ["data", "name", "shape", "value", "endPoint", "context"] }, { kind: "component", type: EntityStatus, selector: "mt-entity-status", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLeafDetails, selector: "mt-entity-leaf-details", inputs: ["data"] }, { kind: "component", type: EntityLocation, selector: "mt-entity-location", inputs: ["data"] }, { kind: "component", type: EntityConnection, selector: "mt-entity-connection", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityScheduleItem, selector: "mt-entity-schedule-item", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1255
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityValuePreview, isStandalone: true, selector: "mt-entity-value-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block min-w-0 w-full" }, ngImport: i0, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"Time\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'Time'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"MultiUser\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Number\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"PhaseGate\") {\r\n <mt-entity-phase-gate [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n", dependencies: [{ kind: "component", type: EntityText, selector: "mt-entity-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLongText, selector: "mt-entity-long-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityDate, selector: "mt-entity-date", inputs: ["data", "name", "value", "viewType"] }, { kind: "component", type: EntityUser, selector: "mt-entity-user", inputs: ["data"] }, { kind: "component", type: EntityPercentage, selector: "mt-entity-percentage", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityCurrency, selector: "mt-entity-currency", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityCheckbox, selector: "mt-entity-checkbox", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityLookup, selector: "mt-entity-lookup", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityPhaseGate, selector: "mt-entity-phase-gate", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityAttachment, selector: "mt-entity-attachment", inputs: ["data", "name", "shape", "value", "endPoint", "context"] }, { kind: "component", type: EntityStatus, selector: "mt-entity-status", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLeafDetails, selector: "mt-entity-leaf-details", inputs: ["data"] }, { kind: "component", type: EntityLocation, selector: "mt-entity-location", inputs: ["data"] }, { kind: "component", type: EntityConnection, selector: "mt-entity-connection", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityScheduleItem, selector: "mt-entity-schedule-item", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1204
1256
|
}
|
|
1205
1257
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityValuePreview, decorators: [{
|
|
1206
1258
|
type: Component,
|
|
@@ -1222,7 +1274,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1222
1274
|
EntityScheduleItem,
|
|
1223
1275
|
], host: {
|
|
1224
1276
|
class: 'block min-w-0 w-full',
|
|
1225
|
-
}, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"Time\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'Time'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Number\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"PhaseGate\") {\r\n <mt-entity-phase-gate [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n" }]
|
|
1277
|
+
}, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"Time\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'Time'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"MultiUser\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Number\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"PhaseGate\") {\r\n <mt-entity-phase-gate [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n" }]
|
|
1226
1278
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
|
|
1227
1279
|
|
|
1228
1280
|
/**
|