@masterteam/components 0.0.282 → 0.0.284
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/i18n/ar.json +2 -1
- package/assets/i18n/en.json +2 -1
- package/fesm2022/masterteam-components-entities.mjs +166 -39
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +10 -0
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +105 -3
package/assets/i18n/ar.json
CHANGED
|
@@ -106,7 +106,8 @@
|
|
|
106
106
|
"filterByThis": "انقر للتصفية بهذه القيمة",
|
|
107
107
|
"clearFilter": "انقر لمسح التصفية",
|
|
108
108
|
"attachment": "مرفق",
|
|
109
|
-
"downloadAttachment": "تنزيل {{name}}"
|
|
109
|
+
"downloadAttachment": "تنزيل {{name}}",
|
|
110
|
+
"leafPhases": "المراحل"
|
|
110
111
|
},
|
|
111
112
|
"comparisonEntities": {
|
|
112
113
|
"added": "مضاف",
|
package/assets/i18n/en.json
CHANGED
|
@@ -106,7 +106,8 @@
|
|
|
106
106
|
"filterByThis": "Click to filter by this value",
|
|
107
107
|
"clearFilter": "Click to clear filter",
|
|
108
108
|
"attachment": "Attachment",
|
|
109
|
-
"downloadAttachment": "Download {{name}}"
|
|
109
|
+
"downloadAttachment": "Download {{name}}",
|
|
110
|
+
"leafPhases": "Phases"
|
|
110
111
|
},
|
|
111
112
|
"comparisonEntities": {
|
|
112
113
|
"added": "Added",
|
|
@@ -1528,10 +1528,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1528
1528
|
args: [{ selector: 'mt-entity-schedule-item', changeDetection: ChangeDetectionStrategy.OnPush, 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" }]
|
|
1529
1529
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
1530
1530
|
|
|
1531
|
+
/**
|
|
1532
|
+
* One shared active-language signal per `TranslocoService`.
|
|
1533
|
+
*
|
|
1534
|
+
* `mt-entity-preview` renders once per property per record — a client-list card
|
|
1535
|
+
* grid mounts thousands of them — so a `toSignal(langChanges$)` inside each
|
|
1536
|
+
* instance would open thousands of subscriptions to the same Subject just to
|
|
1537
|
+
* read one global value. The language is global, so the signal is too: created
|
|
1538
|
+
* once, cached against the service, and shared by every entity that needs it.
|
|
1539
|
+
*
|
|
1540
|
+
* `manualCleanup` is deliberate. The cached signal outlives any single
|
|
1541
|
+
* component by design, and the service it hangs off is the root injector's —
|
|
1542
|
+
* tying its subscription to whichever entity happened to ask first would tear
|
|
1543
|
+
* it down the moment that entity scrolled out of view.
|
|
1544
|
+
*/
|
|
1545
|
+
const langSignals = new WeakMap();
|
|
1546
|
+
function sharedActiveLang(transloco) {
|
|
1547
|
+
const cached = langSignals.get(transloco);
|
|
1548
|
+
if (cached) {
|
|
1549
|
+
return cached;
|
|
1550
|
+
}
|
|
1551
|
+
const lang = toSignal(transloco.langChanges$, {
|
|
1552
|
+
initialValue: transloco.getActiveLang(),
|
|
1553
|
+
manualCleanup: true,
|
|
1554
|
+
});
|
|
1555
|
+
langSignals.set(transloco, lang);
|
|
1556
|
+
return lang;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1531
1559
|
/** Neutral grey for a status the catalog left without a colour. */
|
|
1532
1560
|
const DEFAULT_STATUS_COLOR = '#9CA3AF';
|
|
1533
1561
|
class EntityLeafDetails {
|
|
1562
|
+
transloco = inject(TranslocoService);
|
|
1534
1563
|
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1564
|
+
/**
|
|
1565
|
+
* Re-resolves the "Phases" qualifier when the user switches language. The
|
|
1566
|
+
* shared signal keeps this to one subscription for the whole grid — a cards
|
|
1567
|
+
* board mounts thousands of these.
|
|
1568
|
+
*/
|
|
1569
|
+
activeLang = sharedActiveLang(this.transloco);
|
|
1535
1570
|
leafValue = computed(() => {
|
|
1536
1571
|
const v = this.data().value;
|
|
1537
1572
|
if (v && typeof v === 'object' && !Array.isArray(v) && 'levelId' in v) {
|
|
@@ -1539,13 +1574,34 @@ class EntityLeafDetails {
|
|
|
1539
1574
|
}
|
|
1540
1575
|
return null;
|
|
1541
1576
|
}, ...(ngDevMode ? [{ debugName: "leafValue" }] : /* istanbul ignore next */ []));
|
|
1542
|
-
/**
|
|
1577
|
+
/** True when this item paints the level's phase badges instead of statuses. */
|
|
1578
|
+
isPhaseItem = computed(() => this.leafValue()?.kind === 'phase', ...(ngDevMode ? [{ debugName: "isPhaseItem" }] : /* istanbul ignore next */ []));
|
|
1579
|
+
/**
|
|
1580
|
+
* The badges to paint. Phases and statuses carry the same `{ key, display,
|
|
1581
|
+
* color, count }` shape, so one template drives both — only which projection
|
|
1582
|
+
* of the level is read differs.
|
|
1583
|
+
*/
|
|
1584
|
+
badges = computed(() => {
|
|
1585
|
+
const leaf = this.leafValue();
|
|
1586
|
+
if (!leaf)
|
|
1587
|
+
return [];
|
|
1588
|
+
return this.isPhaseItem() ? (leaf.phases ?? []) : leaf.statuses;
|
|
1589
|
+
}, ...(ngDevMode ? [{ debugName: "badges" }] : /* istanbul ignore next */ []));
|
|
1590
|
+
/**
|
|
1591
|
+
* Label shown below the badges: "Level Name (total)", with a "— Phases"
|
|
1592
|
+
* qualifier on the phase item so a level configured with both projections
|
|
1593
|
+
* does not render two identically-labelled tiles.
|
|
1594
|
+
*/
|
|
1543
1595
|
labelWithTotal = computed(() => {
|
|
1544
1596
|
const leaf = this.leafValue();
|
|
1545
|
-
const
|
|
1597
|
+
const lang = this.activeLang();
|
|
1598
|
+
const base = this.data().name ?? leaf?.levelName ?? '';
|
|
1599
|
+
const name = this.isPhaseItem()
|
|
1600
|
+
? `${base} — ${this.transloco.translate('components.entitiesPreview.leafPhases', {}, lang)}`
|
|
1601
|
+
: base;
|
|
1546
1602
|
if (!leaf)
|
|
1547
1603
|
return name;
|
|
1548
|
-
const total =
|
|
1604
|
+
const total = this.badges().reduce((sum, badge) => sum + badge.count, 0);
|
|
1549
1605
|
return `${name} (${total})`;
|
|
1550
1606
|
}, ...(ngDevMode ? [{ debugName: "labelWithTotal" }] : /* istanbul ignore next */ []));
|
|
1551
1607
|
labelIcon = computed(() => this.leafValue()?.levelIcon ?? null, ...(ngDevMode ? [{ debugName: "labelIcon" }] : /* istanbul ignore next */ []));
|
|
@@ -1561,11 +1617,11 @@ class EntityLeafDetails {
|
|
|
1561
1617
|
return readableTextOn(this.statusColor(color));
|
|
1562
1618
|
}
|
|
1563
1619
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLeafDetails, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1564
|
-
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]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue()
|
|
1620
|
+
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]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue()) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (badge of badges(); track badge.key) {\r\n <!--\r\n The badge is a count, and the colour is the only thing saying WHICH\r\n count \u2014 so the status/phase name has to be reachable without hovering,\r\n and the number has to be legible on whatever hex the tenant's catalog\r\n carries. The tooltip names it for a pointer, the aria-label names it\r\n for a screen reader, and the foreground is chosen against the badge\r\n colour rather than hardcoded white (findings M-04, H-03).\r\n -->\r\n <div\r\n class=\"flex h-7 min-w-7 items-center justify-center rounded-lg px-1.5 text-xs font-bold tabular-nums\"\r\n role=\"img\"\r\n [style.background-color]=\"statusColor(badge.color)\"\r\n [style.color]=\"statusTextColor(badge.color)\"\r\n [attr.aria-label]=\"badge.display + ': ' + badge.count\"\r\n [pTooltip]=\"badge.display\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ badge.count }}\r\n </div>\r\n }\r\n @if (badges().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 });
|
|
1565
1621
|
}
|
|
1566
1622
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLeafDetails, decorators: [{
|
|
1567
1623
|
type: Component,
|
|
1568
|
-
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]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue()
|
|
1624
|
+
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]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue()) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (badge of badges(); track badge.key) {\r\n <!--\r\n The badge is a count, and the colour is the only thing saying WHICH\r\n count \u2014 so the status/phase name has to be reachable without hovering,\r\n and the number has to be legible on whatever hex the tenant's catalog\r\n carries. The tooltip names it for a pointer, the aria-label names it\r\n for a screen reader, and the foreground is chosen against the badge\r\n colour rather than hardcoded white (findings M-04, H-03).\r\n -->\r\n <div\r\n class=\"flex h-7 min-w-7 items-center justify-center rounded-lg px-1.5 text-xs font-bold tabular-nums\"\r\n role=\"img\"\r\n [style.background-color]=\"statusColor(badge.color)\"\r\n [style.color]=\"statusTextColor(badge.color)\"\r\n [attr.aria-label]=\"badge.display + ': ' + badge.count\"\r\n [pTooltip]=\"badge.display\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ badge.count }}\r\n </div>\r\n }\r\n @if (badges().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" }]
|
|
1569
1625
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
1570
1626
|
|
|
1571
1627
|
/**
|
|
@@ -1885,6 +1941,12 @@ function expandConnectionEntity(entity) {
|
|
|
1885
1941
|
}
|
|
1886
1942
|
|
|
1887
1943
|
const LEAF_DETAILS_KEY_SEPARATOR = '::leaflevel::';
|
|
1944
|
+
/**
|
|
1945
|
+
* The phase projection of the same child level. One level can contribute both
|
|
1946
|
+
* a status item and a phase item to the same area, so they need distinct keys
|
|
1947
|
+
* — the key is what each item's persisted order/size is looked up by.
|
|
1948
|
+
*/
|
|
1949
|
+
const LEAF_PHASES_KEY_SEPARATOR = '::leafphase::';
|
|
1888
1950
|
function isLeafDetailsStatusSummary(value) {
|
|
1889
1951
|
return (!!value &&
|
|
1890
1952
|
typeof value === 'object' &&
|
|
@@ -1915,6 +1977,28 @@ function isLeafDetailsRuntimeStatusCount(value) {
|
|
|
1915
1977
|
isLeafDetailsRuntimeStatusDetails(value.details) &&
|
|
1916
1978
|
'count' in value);
|
|
1917
1979
|
}
|
|
1980
|
+
function isLeafDetailsRuntimePhaseCount(value) {
|
|
1981
|
+
return (!!value &&
|
|
1982
|
+
typeof value === 'object' &&
|
|
1983
|
+
'details' in value &&
|
|
1984
|
+
isLeafDetailsRuntimeStatusDetails(value.details) &&
|
|
1985
|
+
'count' in value);
|
|
1986
|
+
}
|
|
1987
|
+
/**
|
|
1988
|
+
* Phases are optional on both the catalog configuration and the runtime value —
|
|
1989
|
+
* the backend omits the field entirely for child levels with no phase gates —
|
|
1990
|
+
* so anything that is not a well-formed array reads as "no phases".
|
|
1991
|
+
*/
|
|
1992
|
+
function readRuntimePhases(value) {
|
|
1993
|
+
return Array.isArray(value) && value.every(isLeafDetailsRuntimePhaseCount)
|
|
1994
|
+
? value
|
|
1995
|
+
: [];
|
|
1996
|
+
}
|
|
1997
|
+
function readCatalogPhases(value) {
|
|
1998
|
+
return Array.isArray(value) && value.every(isLeafDetailsCatalogStatusValue)
|
|
1999
|
+
? value
|
|
2000
|
+
: [];
|
|
2001
|
+
}
|
|
1918
2002
|
function isLeafDetailsRuntimeChildSchema(value) {
|
|
1919
2003
|
return (!!value &&
|
|
1920
2004
|
typeof value === 'object' &&
|
|
@@ -1951,6 +2035,23 @@ function isLeafDetailsRuntimeValue(value) {
|
|
|
1951
2035
|
function isLeafDetailsSyntheticKey(key) {
|
|
1952
2036
|
return key?.includes(LEAF_DETAILS_KEY_SEPARATOR) ?? false;
|
|
1953
2037
|
}
|
|
2038
|
+
/** True for the key of an expanded *phase* item of a LeafDetails property. */
|
|
2039
|
+
function isLeafPhasesSyntheticKey(key) {
|
|
2040
|
+
return key?.includes(LEAF_PHASES_KEY_SEPARATOR) ?? false;
|
|
2041
|
+
}
|
|
2042
|
+
/** True for either projection's expanded key. */
|
|
2043
|
+
function isLeafSyntheticKey(key) {
|
|
2044
|
+
return isLeafDetailsSyntheticKey(key) || isLeafPhasesSyntheticKey(key);
|
|
2045
|
+
}
|
|
2046
|
+
/** Splits either projection's expanded key back into property key + level id. */
|
|
2047
|
+
function splitLeafKey(key) {
|
|
2048
|
+
if (isLeafPhasesSyntheticKey(key)) {
|
|
2049
|
+
const [propertyKey, levelId] = key.split(LEAF_PHASES_KEY_SEPARATOR);
|
|
2050
|
+
return { propertyKey, levelId, kind: 'phase' };
|
|
2051
|
+
}
|
|
2052
|
+
const [propertyKey, levelId] = key.split(LEAF_DETAILS_KEY_SEPARATOR);
|
|
2053
|
+
return { propertyKey, levelId, kind: 'status' };
|
|
2054
|
+
}
|
|
1954
2055
|
function toLeafDetailsStatusSummary(status) {
|
|
1955
2056
|
return {
|
|
1956
2057
|
key: status.details.key,
|
|
@@ -1959,6 +2060,15 @@ function toLeafDetailsStatusSummary(status) {
|
|
|
1959
2060
|
count: status.count,
|
|
1960
2061
|
};
|
|
1961
2062
|
}
|
|
2063
|
+
function toLeafDetailsPhaseSummary(phase) {
|
|
2064
|
+
return {
|
|
2065
|
+
id: phase.details.id ?? null,
|
|
2066
|
+
key: phase.details.key,
|
|
2067
|
+
display: phase.details.display,
|
|
2068
|
+
color: phase.details.color || null,
|
|
2069
|
+
count: phase.count,
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
1962
2072
|
function normalizeLeafDetailsCollection(value) {
|
|
1963
2073
|
if (isLeafDetailsCollectionValue(value)) {
|
|
1964
2074
|
return value;
|
|
@@ -1972,6 +2082,7 @@ function normalizeLeafDetailsCollection(value) {
|
|
|
1972
2082
|
levelName: schema.levelName,
|
|
1973
2083
|
levelIcon: schema.levelIcon,
|
|
1974
2084
|
statuses: schema.statuses.map(toLeafDetailsStatusSummary),
|
|
2085
|
+
phases: readRuntimePhases(schema.phases).map(toLeafDetailsPhaseSummary),
|
|
1975
2086
|
}));
|
|
1976
2087
|
}
|
|
1977
2088
|
if (typeof value === 'string' && value.trim().length > 0) {
|
|
@@ -1996,6 +2107,13 @@ function normalizeLeafDetailsCatalogConfiguration(value) {
|
|
|
1996
2107
|
color: status.color ?? null,
|
|
1997
2108
|
count: 0,
|
|
1998
2109
|
})),
|
|
2110
|
+
phases: readCatalogPhases(level.phases).map((phase) => ({
|
|
2111
|
+
id: phase.id ?? null,
|
|
2112
|
+
key: phase.key,
|
|
2113
|
+
display: phase.display,
|
|
2114
|
+
color: phase.color || null,
|
|
2115
|
+
count: 0,
|
|
2116
|
+
})),
|
|
1999
2117
|
}));
|
|
2000
2118
|
}
|
|
2001
2119
|
if (typeof value === 'string' && value.trim().length > 0) {
|
|
@@ -2012,8 +2130,7 @@ function expandLeafDetailsEntity(entity) {
|
|
|
2012
2130
|
if (entity.viewType !== 'LeafDetails') {
|
|
2013
2131
|
return [entity];
|
|
2014
2132
|
}
|
|
2015
|
-
if (
|
|
2016
|
-
isLeafDetailsValue(entity.value)) {
|
|
2133
|
+
if (isLeafSyntheticKey(entity.key) && isLeafDetailsValue(entity.value)) {
|
|
2017
2134
|
return [entity];
|
|
2018
2135
|
}
|
|
2019
2136
|
const configuration = entity.configuration;
|
|
@@ -2027,7 +2144,7 @@ function expandLeafDetailsEntity(entity) {
|
|
|
2027
2144
|
if (resolvedLevels.length === 0) {
|
|
2028
2145
|
return [entity];
|
|
2029
2146
|
}
|
|
2030
|
-
const
|
|
2147
|
+
const statusItems = resolvedLevels.flatMap((level) => {
|
|
2031
2148
|
const levelConfig = configuration?.leafLevels?.[String(level.levelId)];
|
|
2032
2149
|
if (configuration?.leafLevels && !levelConfig) {
|
|
2033
2150
|
return [];
|
|
@@ -2044,6 +2161,7 @@ function expandLeafDetailsEntity(entity) {
|
|
|
2044
2161
|
name: level.levelName,
|
|
2045
2162
|
value: {
|
|
2046
2163
|
...level,
|
|
2164
|
+
kind: 'status',
|
|
2047
2165
|
statuses: selectedStatuses
|
|
2048
2166
|
? level.statuses.filter((status) => selectedStatuses.has(status.key))
|
|
2049
2167
|
: level.statuses,
|
|
@@ -2056,6 +2174,44 @@ function expandLeafDetailsEntity(entity) {
|
|
|
2056
2174
|
},
|
|
2057
2175
|
];
|
|
2058
2176
|
});
|
|
2177
|
+
/**
|
|
2178
|
+
* Phases are opt-in: only levels with an explicit `leafPhases` entry produce
|
|
2179
|
+
* a phase item. An absent map means "no phase badges", never "all of them" —
|
|
2180
|
+
* the opposite of `leafLevels`, whose absence predates the per-level config
|
|
2181
|
+
* and has to keep meaning "show every level".
|
|
2182
|
+
*/
|
|
2183
|
+
const phaseItems = resolvedLevels.flatMap((level) => {
|
|
2184
|
+
const phaseConfig = configuration?.leafPhases?.[String(level.levelId)];
|
|
2185
|
+
if (!phaseConfig) {
|
|
2186
|
+
return [];
|
|
2187
|
+
}
|
|
2188
|
+
const phases = level.phases ?? [];
|
|
2189
|
+
const selectedPhases = phaseConfig.selectedPhases?.length
|
|
2190
|
+
? new Set(phaseConfig.selectedPhases)
|
|
2191
|
+
: null;
|
|
2192
|
+
return [
|
|
2193
|
+
{
|
|
2194
|
+
...entity,
|
|
2195
|
+
key: entity.key
|
|
2196
|
+
? `${entity.key}${LEAF_PHASES_KEY_SEPARATOR}${level.levelId}`
|
|
2197
|
+
: entity.key,
|
|
2198
|
+
name: level.levelName,
|
|
2199
|
+
value: {
|
|
2200
|
+
...level,
|
|
2201
|
+
kind: 'phase',
|
|
2202
|
+
phases: selectedPhases
|
|
2203
|
+
? phases.filter((phase) => selectedPhases.has(phase.key))
|
|
2204
|
+
: phases,
|
|
2205
|
+
},
|
|
2206
|
+
order: phaseConfig.order ?? entity.order,
|
|
2207
|
+
configuration: {
|
|
2208
|
+
...configuration,
|
|
2209
|
+
size: phaseConfig.size ?? configuration?.size,
|
|
2210
|
+
},
|
|
2211
|
+
},
|
|
2212
|
+
];
|
|
2213
|
+
});
|
|
2214
|
+
const expanded = [...statusItems, ...phaseItems];
|
|
2059
2215
|
return expanded.length > 0 ? expanded : [entity];
|
|
2060
2216
|
}
|
|
2061
2217
|
/**
|
|
@@ -2071,34 +2227,6 @@ function buildDisplayEntities(entities) {
|
|
|
2071
2227
|
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
2072
2228
|
}
|
|
2073
2229
|
|
|
2074
|
-
/**
|
|
2075
|
-
* One shared active-language signal per `TranslocoService`.
|
|
2076
|
-
*
|
|
2077
|
-
* `mt-entity-preview` renders once per property per record — a client-list card
|
|
2078
|
-
* grid mounts thousands of them — so a `toSignal(langChanges$)` inside each
|
|
2079
|
-
* instance would open thousands of subscriptions to the same Subject just to
|
|
2080
|
-
* read one global value. The language is global, so the signal is too: created
|
|
2081
|
-
* once, cached against the service, and shared by every entity that needs it.
|
|
2082
|
-
*
|
|
2083
|
-
* `manualCleanup` is deliberate. The cached signal outlives any single
|
|
2084
|
-
* component by design, and the service it hangs off is the root injector's —
|
|
2085
|
-
* tying its subscription to whichever entity happened to ask first would tear
|
|
2086
|
-
* it down the moment that entity scrolled out of view.
|
|
2087
|
-
*/
|
|
2088
|
-
const langSignals = new WeakMap();
|
|
2089
|
-
function sharedActiveLang(transloco) {
|
|
2090
|
-
const cached = langSignals.get(transloco);
|
|
2091
|
-
if (cached) {
|
|
2092
|
-
return cached;
|
|
2093
|
-
}
|
|
2094
|
-
const lang = toSignal(transloco.langChanges$, {
|
|
2095
|
-
initialValue: transloco.getActiveLang(),
|
|
2096
|
-
manualCleanup: true,
|
|
2097
|
-
});
|
|
2098
|
-
langSignals.set(transloco, lang);
|
|
2099
|
-
return lang;
|
|
2100
|
-
}
|
|
2101
|
-
|
|
2102
2230
|
class EntityPreviewBody {
|
|
2103
2231
|
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
2104
2232
|
attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
|
|
@@ -2538,8 +2666,7 @@ class EntitiesManage extends EntitiesResizeBase {
|
|
|
2538
2666
|
: this.displayEntities();
|
|
2539
2667
|
// Expanded items (LeafDetails levels / Connection source levels) are rebuilt
|
|
2540
2668
|
// on every render, so identity no longer matches — fall back to the key.
|
|
2541
|
-
const isExpandedItem =
|
|
2542
|
-
isConnectionSyntheticKey(entity.key);
|
|
2669
|
+
const isExpandedItem = isLeafSyntheticKey(entity.key) || isConnectionSyntheticKey(entity.key);
|
|
2543
2670
|
const updated = sourceEntities.map((e) => e === entity || (isExpandedItem && e.key === entity.key)
|
|
2544
2671
|
? {
|
|
2545
2672
|
...e,
|
|
@@ -2571,5 +2698,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2571
2698
|
* Generated bundle index. Do not edit.
|
|
2572
2699
|
*/
|
|
2573
2700
|
|
|
2574
|
-
export { CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityIcon, EntityLeafDetails, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, groupEntitiesIntoSections, isConnectionSyntheticKey, isEntityAlignEnd, isEntityLabelHidden, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isSectionKey, isValueMissing, matchesPercentageColorRule, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, resolveConnectionLevelName, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalizedLabel, resolvePercentageColor, serializeEntityRawValue, sharedActiveLang, splitConnectionKey };
|
|
2701
|
+
export { CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityIcon, EntityLeafDetails, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, LEAF_PHASES_KEY_SEPARATOR, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, groupEntitiesIntoSections, isConnectionSyntheticKey, isEntityAlignEnd, isEntityLabelHidden, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, matchesPercentageColorRule, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, resolveConnectionLevelName, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalizedLabel, resolvePercentageColor, serializeEntityRawValue, sharedActiveLang, splitConnectionKey, splitLeafKey };
|
|
2575
2702
|
//# sourceMappingURL=masterteam-components-entities.mjs.map
|