@masterteam/components 0.0.227 → 0.0.228
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/fesm2022/masterteam-components-entities.mjs +134 -95
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-select-field.mjs +3 -3
- package/fesm2022/masterteam-components-select-field.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +39 -12
|
@@ -901,13 +901,101 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
901
901
|
args: [{ selector: 'mt-entity-schedule-item', standalone: true, imports: [EntityField, Chip], template: "<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n gap=\"normal\"\n>\n @if (items().length) {\n <div class=\"flex flex-wrap items-center gap-2\">\n @for (item of items(); track item.id) {\n <mt-chip [label]=\"item.name\" size=\"small\" />\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" }]
|
|
902
902
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
903
903
|
|
|
904
|
+
class EntityLeafDetails {
|
|
905
|
+
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
906
|
+
leafValue = computed(() => {
|
|
907
|
+
const v = this.data().value;
|
|
908
|
+
if (v && typeof v === 'object' && !Array.isArray(v) && 'levelId' in v) {
|
|
909
|
+
return v;
|
|
910
|
+
}
|
|
911
|
+
return null;
|
|
912
|
+
}, ...(ngDevMode ? [{ debugName: "leafValue" }] : /* istanbul ignore next */ []));
|
|
913
|
+
/** Label shown below the badges: "Level Name (total)" */
|
|
914
|
+
labelWithTotal = computed(() => {
|
|
915
|
+
const leaf = this.leafValue();
|
|
916
|
+
const name = this.data().name ?? leaf?.levelName ?? '';
|
|
917
|
+
if (!leaf)
|
|
918
|
+
return name;
|
|
919
|
+
const total = leaf.statuses.reduce((sum, s) => sum + s.count, 0);
|
|
920
|
+
return `${name} (${total})`;
|
|
921
|
+
}, ...(ngDevMode ? [{ debugName: "labelWithTotal" }] : /* istanbul ignore next */ []));
|
|
922
|
+
labelIcon = computed(() => this.leafValue()?.levelIcon ?? null, ...(ngDevMode ? [{ debugName: "labelIcon" }] : /* istanbul ignore next */ []));
|
|
923
|
+
/** Default LeafDetails labels to top, while still honoring saved configuration */
|
|
924
|
+
fieldConfig = computed(() => {
|
|
925
|
+
const configuration = this.data().configuration;
|
|
926
|
+
if (configuration?.labelPosition || configuration?.labelPostion) {
|
|
927
|
+
return configuration;
|
|
928
|
+
}
|
|
929
|
+
return {
|
|
930
|
+
...configuration,
|
|
931
|
+
labelPosition: 'top',
|
|
932
|
+
};
|
|
933
|
+
}, ...(ngDevMode ? [{ debugName: "fieldConfig" }] : /* istanbul ignore next */ []));
|
|
934
|
+
statusColor(color) {
|
|
935
|
+
return color ?? '#9CA3AF';
|
|
936
|
+
}
|
|
937
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLeafDetails, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
938
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLeafDetails, isStandalone: true, selector: "mt-entity-leaf-details", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"labelWithTotal()\"\r\n [labelIconName]=\"labelIcon()\"\r\n [configuration]=\"fieldConfig()\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue(); as leaf) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (status of leaf.statuses; track status.key) {\r\n <div\r\n class=\"flex items-center justify-center min-w-7 h-7 px-1.5 rounded-lg text-xs font-bold text-white\"\r\n [style.background-color]=\"statusColor(status.color)\"\r\n [pTooltip]=\"status.display\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ status.count }}\r\n </div>\r\n }\r\n @if (leaf.statuses.length === 0) {\r\n <span class=\"text-sm text-muted-color\">\u2014</span>\r\n }\r\n </div>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
939
|
+
}
|
|
940
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLeafDetails, decorators: [{
|
|
941
|
+
type: Component,
|
|
942
|
+
args: [{ selector: 'mt-entity-leaf-details', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, TooltipModule], template: "<mt-entity-field\r\n [label]=\"labelWithTotal()\"\r\n [labelIconName]=\"labelIcon()\"\r\n [configuration]=\"fieldConfig()\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue(); as leaf) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (status of leaf.statuses; track status.key) {\r\n <div\r\n class=\"flex items-center justify-center min-w-7 h-7 px-1.5 rounded-lg text-xs font-bold text-white\"\r\n [style.background-color]=\"statusColor(status.color)\"\r\n [pTooltip]=\"status.display\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ status.count }}\r\n </div>\r\n }\r\n @if (leaf.statuses.length === 0) {\r\n <span class=\"text-sm text-muted-color\">\u2014</span>\r\n }\r\n </div>\r\n }\r\n</mt-entity-field>\r\n" }]
|
|
943
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
944
|
+
|
|
904
945
|
/**
|
|
905
|
-
*
|
|
906
|
-
*
|
|
907
|
-
*
|
|
908
|
-
*
|
|
909
|
-
*
|
|
910
|
-
*
|
|
946
|
+
* Renders an entity value by view type.
|
|
947
|
+
*
|
|
948
|
+
* `LookupModuleCheckList` is deliberately not handled here: that component
|
|
949
|
+
* renders each of its nested properties *through* this one, so routing it back
|
|
950
|
+
* through here would make the two files import each other. `EntityPreviewBody`
|
|
951
|
+
* owns that case and delegates every other view type to this component.
|
|
952
|
+
*/
|
|
953
|
+
class EntityValuePreview {
|
|
954
|
+
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
955
|
+
attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
|
|
956
|
+
/** A matrix resolves to a single lookup item, so it renders as a lookup. */
|
|
957
|
+
previewType = computed(() => {
|
|
958
|
+
const viewType = this.data().viewType;
|
|
959
|
+
return viewType === 'LookupMatrix' ? 'Lookup' : viewType;
|
|
960
|
+
}, ...(ngDevMode ? [{ debugName: "previewType" }] : /* istanbul ignore next */ []));
|
|
961
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityValuePreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
962
|
+
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()) {\n @case (\"Text\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"LongText\") {\n <mt-entity-long-text [data]=\"data()\" />\n }\n @case (\"Date\") {\n <mt-entity-date [data]=\"data()\" />\n }\n @case (\"DateTime\") {\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\n }\n @case (\"User\") {\n <mt-entity-user [data]=\"data()\" />\n }\n @case (\"Percentage\") {\n <mt-entity-percentage [data]=\"data()\" />\n }\n @case (\"Currency\") {\n <mt-entity-currency [data]=\"data()\" />\n }\n @case (\"Number\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"Checkbox\") {\n <mt-entity-checkbox [data]=\"data()\" />\n }\n @case (\"Lookup\") {\n <mt-entity-lookup [data]=\"data()\" />\n }\n @case (\"Status\") {\n <mt-entity-status [data]=\"data()\" />\n }\n @case (\"Attachment\") {\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\n }\n @case (\"Location\") {\n <mt-entity-location [data]=\"data()\" />\n }\n @case (\"Connection\") {\n <mt-entity-connection [data]=\"data()\" />\n }\n @case (\"ScheduleItemSelector\") {\n <mt-entity-schedule-item [data]=\"data()\" />\n }\n @case (\"LeafDetails\") {\n <mt-entity-leaf-details [data]=\"data()\" />\n }\n @default {\n <mt-entity-text [data]=\"data()\" />\n }\n}\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: 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 });
|
|
963
|
+
}
|
|
964
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityValuePreview, decorators: [{
|
|
965
|
+
type: Component,
|
|
966
|
+
args: [{ selector: 'mt-entity-value-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
967
|
+
EntityText,
|
|
968
|
+
EntityLongText,
|
|
969
|
+
EntityDate,
|
|
970
|
+
EntityUser,
|
|
971
|
+
EntityPercentage,
|
|
972
|
+
EntityCurrency,
|
|
973
|
+
EntityCheckbox,
|
|
974
|
+
EntityLookup,
|
|
975
|
+
EntityAttachment,
|
|
976
|
+
EntityStatus,
|
|
977
|
+
EntityLeafDetails,
|
|
978
|
+
EntityLocation,
|
|
979
|
+
EntityConnection,
|
|
980
|
+
EntityScheduleItem,
|
|
981
|
+
], host: {
|
|
982
|
+
class: 'block min-w-0 w-full',
|
|
983
|
+
}, template: "@switch (previewType()) {\n @case (\"Text\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"LongText\") {\n <mt-entity-long-text [data]=\"data()\" />\n }\n @case (\"Date\") {\n <mt-entity-date [data]=\"data()\" />\n }\n @case (\"DateTime\") {\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\n }\n @case (\"User\") {\n <mt-entity-user [data]=\"data()\" />\n }\n @case (\"Percentage\") {\n <mt-entity-percentage [data]=\"data()\" />\n }\n @case (\"Currency\") {\n <mt-entity-currency [data]=\"data()\" />\n }\n @case (\"Number\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"Checkbox\") {\n <mt-entity-checkbox [data]=\"data()\" />\n }\n @case (\"Lookup\") {\n <mt-entity-lookup [data]=\"data()\" />\n }\n @case (\"Status\") {\n <mt-entity-status [data]=\"data()\" />\n }\n @case (\"Attachment\") {\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\n }\n @case (\"Location\") {\n <mt-entity-location [data]=\"data()\" />\n }\n @case (\"Connection\") {\n <mt-entity-connection [data]=\"data()\" />\n }\n @case (\"ScheduleItemSelector\") {\n <mt-entity-schedule-item [data]=\"data()\" />\n }\n @case (\"LeafDetails\") {\n <mt-entity-leaf-details [data]=\"data()\" />\n }\n @default {\n <mt-entity-text [data]=\"data()\" />\n }\n}\n" }]
|
|
984
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Nested props render inside the entry card's own grid, so they take the label
|
|
988
|
+
* treatment and leave sizing to the grid.
|
|
989
|
+
*/
|
|
990
|
+
const NESTED_PROP_CONFIG = {
|
|
991
|
+
labelPosition: 'top',
|
|
992
|
+
hideLabel: false,
|
|
993
|
+
};
|
|
994
|
+
/**
|
|
995
|
+
* Derive a readable label from a raw lookup key. The stored checklist value
|
|
996
|
+
* only carries the key of the selected lookup item (e.g. `Open_test`) and the
|
|
997
|
+
* response resolves no display for it, so this strips separators and
|
|
998
|
+
* title-cases the key.
|
|
911
999
|
*/
|
|
912
1000
|
function humanizeKey(key) {
|
|
913
1001
|
const words = key
|
|
@@ -920,6 +1008,18 @@ function humanizeKey(key) {
|
|
|
920
1008
|
}
|
|
921
1009
|
class EntityLookupModuleCheckList {
|
|
922
1010
|
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1011
|
+
/**
|
|
1012
|
+
* Catalog metadata for the captured properties, keyed by property key. The
|
|
1013
|
+
* stored value carries keys only — this is what gives each nested prop its
|
|
1014
|
+
* label and view type.
|
|
1015
|
+
*/
|
|
1016
|
+
metaByKey = computed(() => {
|
|
1017
|
+
const map = new Map();
|
|
1018
|
+
for (const meta of this.data().nestedProperties ?? []) {
|
|
1019
|
+
map.set(meta.key, meta);
|
|
1020
|
+
}
|
|
1021
|
+
return map;
|
|
1022
|
+
}, ...(ngDevMode ? [{ debugName: "metaByKey" }] : /* istanbul ignore next */ []));
|
|
923
1023
|
/**
|
|
924
1024
|
* Normalizes the stored value into a flat list of checklist entries.
|
|
925
1025
|
* Accepts both the rendered view model (`{ items: [...] }`) and the raw
|
|
@@ -937,20 +1037,34 @@ class EntityLookupModuleCheckList {
|
|
|
937
1037
|
return {
|
|
938
1038
|
lookupKey,
|
|
939
1039
|
lookupLabel: humanizeKey(lookupKey),
|
|
940
|
-
props: (Array.isArray(props) ? props : []).map((prop) =>
|
|
941
|
-
const propRecord = (prop ?? {});
|
|
942
|
-
const key = String(propRecord['key'] ?? propRecord['Key'] ?? '');
|
|
943
|
-
return {
|
|
944
|
-
key,
|
|
945
|
-
label: humanizeKey(key),
|
|
946
|
-
value: this.renderPropValue(propRecord['value'] ?? propRecord['Value'] ?? null),
|
|
947
|
-
};
|
|
948
|
-
}),
|
|
1040
|
+
props: (Array.isArray(props) ? props : []).map((prop) => this.toNestedEntity(prop)),
|
|
949
1041
|
};
|
|
950
1042
|
});
|
|
951
1043
|
}, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
952
1044
|
hasItems = computed(() => this.items().length > 0, ...(ngDevMode ? [{ debugName: "hasItems" }] : /* istanbul ignore next */ []));
|
|
953
1045
|
emptyLabel = displayOrPlaceholder(null);
|
|
1046
|
+
/**
|
|
1047
|
+
* Builds the entity for one captured property. Without catalog metadata the
|
|
1048
|
+
* key is all there is to show it with, so it degrades to a humanized label
|
|
1049
|
+
* and plain text.
|
|
1050
|
+
*/
|
|
1051
|
+
toNestedEntity(prop) {
|
|
1052
|
+
const propRecord = (prop ?? {});
|
|
1053
|
+
const key = String(propRecord['key'] ?? propRecord['Key'] ?? '');
|
|
1054
|
+
const meta = this.metaByKey().get(key);
|
|
1055
|
+
const value = propRecord['value'] ?? propRecord['Value'] ?? null;
|
|
1056
|
+
return {
|
|
1057
|
+
propertyId: meta?.id,
|
|
1058
|
+
key,
|
|
1059
|
+
normalizedKey: meta?.normalizedKey,
|
|
1060
|
+
name: meta?.label ?? humanizeKey(key),
|
|
1061
|
+
value: (value ?? ''),
|
|
1062
|
+
viewType: meta?.viewType ?? 'Text',
|
|
1063
|
+
propertyConfiguration: meta?.configuration,
|
|
1064
|
+
configuration: NESTED_PROP_CONFIG,
|
|
1065
|
+
order: meta?.order,
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
954
1068
|
extractEntries(raw) {
|
|
955
1069
|
if (Array.isArray(raw)) {
|
|
956
1070
|
return raw;
|
|
@@ -974,67 +1088,12 @@ class EntityLookupModuleCheckList {
|
|
|
974
1088
|
const key = entry.lookupKey ?? record['Lookupkey'] ?? record['lookupkey'];
|
|
975
1089
|
return typeof key === 'string' ? key : '';
|
|
976
1090
|
}
|
|
977
|
-
renderPropValue(value) {
|
|
978
|
-
if (value === null || value === undefined || value === '') {
|
|
979
|
-
return this.emptyLabel;
|
|
980
|
-
}
|
|
981
|
-
if (typeof value === 'object') {
|
|
982
|
-
try {
|
|
983
|
-
return JSON.stringify(value);
|
|
984
|
-
}
|
|
985
|
-
catch {
|
|
986
|
-
return String(value);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
return String(value);
|
|
990
|
-
}
|
|
991
1091
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookupModuleCheckList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
992
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLookupModuleCheckList, isStandalone: true, selector: "mt-entity-lookup-module-check-list", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\
|
|
1092
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLookupModuleCheckList, isStandalone: true, selector: "mt-entity-lookup-module-check-list", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\n [label]=\"data().name ?? ''\"\n [configuration]=\"data()?.configuration\"\n gap=\"normal\"\n>\n @if (hasItems()) {\n <div class=\"flex flex-col gap-2\">\n @for (item of items(); track $index) {\n <div\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\n >\n {{ item.lookupLabel || emptyLabel }}\n </span>\n @if (item.props.length) {\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\n @for (prop of item.props; track prop.key) {\n <div class=\"min-w-0 overflow-hidden\">\n <mt-entity-value-preview\n [data]=\"prop\"\n attachmentShape=\"compact\"\n />\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n } @else {\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\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"] }, { kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
993
1093
|
}
|
|
994
1094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookupModuleCheckList, decorators: [{
|
|
995
1095
|
type: Component,
|
|
996
|
-
args: [{ selector: 'mt-entity-lookup-module-check-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField], template: "<mt-entity-field\
|
|
997
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
998
|
-
|
|
999
|
-
class EntityLeafDetails {
|
|
1000
|
-
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1001
|
-
leafValue = computed(() => {
|
|
1002
|
-
const v = this.data().value;
|
|
1003
|
-
if (v && typeof v === 'object' && !Array.isArray(v) && 'levelId' in v) {
|
|
1004
|
-
return v;
|
|
1005
|
-
}
|
|
1006
|
-
return null;
|
|
1007
|
-
}, ...(ngDevMode ? [{ debugName: "leafValue" }] : /* istanbul ignore next */ []));
|
|
1008
|
-
/** Label shown below the badges: "Level Name (total)" */
|
|
1009
|
-
labelWithTotal = computed(() => {
|
|
1010
|
-
const leaf = this.leafValue();
|
|
1011
|
-
const name = this.data().name ?? leaf?.levelName ?? '';
|
|
1012
|
-
if (!leaf)
|
|
1013
|
-
return name;
|
|
1014
|
-
const total = leaf.statuses.reduce((sum, s) => sum + s.count, 0);
|
|
1015
|
-
return `${name} (${total})`;
|
|
1016
|
-
}, ...(ngDevMode ? [{ debugName: "labelWithTotal" }] : /* istanbul ignore next */ []));
|
|
1017
|
-
labelIcon = computed(() => this.leafValue()?.levelIcon ?? null, ...(ngDevMode ? [{ debugName: "labelIcon" }] : /* istanbul ignore next */ []));
|
|
1018
|
-
/** Default LeafDetails labels to top, while still honoring saved configuration */
|
|
1019
|
-
fieldConfig = computed(() => {
|
|
1020
|
-
const configuration = this.data().configuration;
|
|
1021
|
-
if (configuration?.labelPosition || configuration?.labelPostion) {
|
|
1022
|
-
return configuration;
|
|
1023
|
-
}
|
|
1024
|
-
return {
|
|
1025
|
-
...configuration,
|
|
1026
|
-
labelPosition: 'top',
|
|
1027
|
-
};
|
|
1028
|
-
}, ...(ngDevMode ? [{ debugName: "fieldConfig" }] : /* istanbul ignore next */ []));
|
|
1029
|
-
statusColor(color) {
|
|
1030
|
-
return color ?? '#9CA3AF';
|
|
1031
|
-
}
|
|
1032
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLeafDetails, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1033
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLeafDetails, isStandalone: true, selector: "mt-entity-leaf-details", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"labelWithTotal()\"\r\n [labelIconName]=\"labelIcon()\"\r\n [configuration]=\"fieldConfig()\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue(); as leaf) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (status of leaf.statuses; track status.key) {\r\n <div\r\n class=\"flex items-center justify-center min-w-7 h-7 px-1.5 rounded-lg text-xs font-bold text-white\"\r\n [style.background-color]=\"statusColor(status.color)\"\r\n [pTooltip]=\"status.display\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ status.count }}\r\n </div>\r\n }\r\n @if (leaf.statuses.length === 0) {\r\n <span class=\"text-sm text-muted-color\">\u2014</span>\r\n }\r\n </div>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1034
|
-
}
|
|
1035
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLeafDetails, decorators: [{
|
|
1036
|
-
type: Component,
|
|
1037
|
-
args: [{ selector: 'mt-entity-leaf-details', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, TooltipModule], template: "<mt-entity-field\r\n [label]=\"labelWithTotal()\"\r\n [labelIconName]=\"labelIcon()\"\r\n [configuration]=\"fieldConfig()\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue(); as leaf) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (status of leaf.statuses; track status.key) {\r\n <div\r\n class=\"flex items-center justify-center min-w-7 h-7 px-1.5 rounded-lg text-xs font-bold text-white\"\r\n [style.background-color]=\"statusColor(status.color)\"\r\n [pTooltip]=\"status.display\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ status.count }}\r\n </div>\r\n }\r\n @if (leaf.statuses.length === 0) {\r\n <span class=\"text-sm text-muted-color\">\u2014</span>\r\n }\r\n </div>\r\n }\r\n</mt-entity-field>\r\n" }]
|
|
1096
|
+
args: [{ selector: 'mt-entity-lookup-module-check-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, EntityValuePreview], template: "<mt-entity-field\n [label]=\"data().name ?? ''\"\n [configuration]=\"data()?.configuration\"\n gap=\"normal\"\n>\n @if (hasItems()) {\n <div class=\"flex flex-col gap-2\">\n @for (item of items(); track $index) {\n <div\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\n >\n {{ item.lookupLabel || emptyLabel }}\n </span>\n @if (item.props.length) {\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\n @for (prop of item.props; track prop.key) {\n <div class=\"min-w-0 overflow-hidden\">\n <mt-entity-value-preview\n [data]=\"prop\"\n attachmentShape=\"compact\"\n />\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n } @else {\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\n >\n {{ emptyLabel }}\n </span>\n }\n</mt-entity-field>\n" }]
|
|
1038
1097
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
1039
1098
|
|
|
1040
1099
|
const LEAF_DETAILS_KEY_SEPARATOR = '::leaflevel::';
|
|
@@ -1220,34 +1279,14 @@ function buildDisplayEntities(entities) {
|
|
|
1220
1279
|
class EntityPreviewBody {
|
|
1221
1280
|
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1222
1281
|
attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
|
|
1223
|
-
previewType = computed(() => {
|
|
1224
|
-
const viewType = this.data().viewType;
|
|
1225
|
-
return viewType === 'LookupMatrix' ? 'Lookup' : viewType;
|
|
1226
|
-
}, ...(ngDevMode ? [{ debugName: "previewType" }] : /* istanbul ignore next */ []));
|
|
1227
1282
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1228
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreviewBody, isStandalone: true, selector: "mt-entity-preview-body", 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: "w-full" }, ngImport: i0, template: "@
|
|
1283
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreviewBody, isStandalone: true, selector: "mt-entity-preview-body", 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: "w-full" }, ngImport: i0, template: "@if (data().viewType === \"LookupModuleCheckList\") {\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\n} @else {\n <mt-entity-value-preview\n [data]=\"data()\"\n [attachmentShape]=\"attachmentShape()\"\n />\n}\n", dependencies: [{ kind: "component", type: EntityLookupModuleCheckList, selector: "mt-entity-lookup-module-check-list", inputs: ["data"] }, { kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1229
1284
|
}
|
|
1230
1285
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, decorators: [{
|
|
1231
1286
|
type: Component,
|
|
1232
|
-
args: [{ selector: 'mt-entity-preview-body', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1233
|
-
EntityText,
|
|
1234
|
-
EntityLongText,
|
|
1235
|
-
EntityDate,
|
|
1236
|
-
EntityUser,
|
|
1237
|
-
EntityPercentage,
|
|
1238
|
-
EntityCurrency,
|
|
1239
|
-
EntityCheckbox,
|
|
1240
|
-
EntityLookup,
|
|
1241
|
-
EntityAttachment,
|
|
1242
|
-
EntityStatus,
|
|
1243
|
-
EntityLeafDetails,
|
|
1244
|
-
EntityLocation,
|
|
1245
|
-
EntityConnection,
|
|
1246
|
-
EntityScheduleItem,
|
|
1247
|
-
EntityLookupModuleCheckList,
|
|
1248
|
-
], host: {
|
|
1287
|
+
args: [{ selector: 'mt-entity-preview-body', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityLookupModuleCheckList, EntityValuePreview], host: {
|
|
1249
1288
|
class: 'w-full',
|
|
1250
|
-
}, template: "@
|
|
1289
|
+
}, template: "@if (data().viewType === \"LookupModuleCheckList\") {\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\n} @else {\n <mt-entity-value-preview\n [data]=\"data()\"\n [attachmentShape]=\"attachmentShape()\"\n />\n}\n" }]
|
|
1251
1290
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
|
|
1252
1291
|
|
|
1253
1292
|
class ComparisonValue {
|