@masterteam/components 0.0.280 → 0.0.282
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/i18n/ar.json +15 -0
- package/assets/i18n/en.json +15 -0
- package/fesm2022/masterteam-components-entities.mjs +136 -75
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +141 -4
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +35 -2
- package/types/masterteam-components-formula.d.ts +68 -3
package/assets/i18n/ar.json
CHANGED
|
@@ -206,6 +206,18 @@
|
|
|
206
206
|
"not": {
|
|
207
207
|
"name": "نفي",
|
|
208
208
|
"description": "نفي منطقي"
|
|
209
|
+
},
|
|
210
|
+
"openParen": {
|
|
211
|
+
"name": "قوس فتح",
|
|
212
|
+
"description": "قوس فتح"
|
|
213
|
+
},
|
|
214
|
+
"closeParen": {
|
|
215
|
+
"name": "قوس إغلاق",
|
|
216
|
+
"description": "قوس إغلاق"
|
|
217
|
+
},
|
|
218
|
+
"comma": {
|
|
219
|
+
"name": "فاصلة",
|
|
220
|
+
"description": "فاصلة بين المعاملات"
|
|
209
221
|
}
|
|
210
222
|
},
|
|
211
223
|
"tree": {
|
|
@@ -224,12 +236,15 @@
|
|
|
224
236
|
"noFunctionsFound": "لا توجد دوال",
|
|
225
237
|
"noPropertiesAvailable": "لا توجد خصائص متاحة",
|
|
226
238
|
"noOperatorsFound": "لا توجد مشغلات",
|
|
239
|
+
"values": "القيم",
|
|
240
|
+
"noValuesAvailable": "لا توجد قيم متاحة",
|
|
227
241
|
"property": "خاصية",
|
|
228
242
|
"insertType": "إدراج {{ type }} (Enter)",
|
|
229
243
|
"operatorTypes": {
|
|
230
244
|
"arithmetic": "الحسابية",
|
|
231
245
|
"comparison": "المقارنة",
|
|
232
246
|
"logical": "المنطقية",
|
|
247
|
+
"grouping": "الأقواس",
|
|
233
248
|
"other": "أخرى"
|
|
234
249
|
}
|
|
235
250
|
},
|
package/assets/i18n/en.json
CHANGED
|
@@ -206,6 +206,18 @@
|
|
|
206
206
|
"not": {
|
|
207
207
|
"name": "Not",
|
|
208
208
|
"description": "Logical NOT"
|
|
209
|
+
},
|
|
210
|
+
"openParen": {
|
|
211
|
+
"name": "Open Bracket",
|
|
212
|
+
"description": "Open bracket"
|
|
213
|
+
},
|
|
214
|
+
"closeParen": {
|
|
215
|
+
"name": "Close Bracket",
|
|
216
|
+
"description": "Close bracket"
|
|
217
|
+
},
|
|
218
|
+
"comma": {
|
|
219
|
+
"name": "Comma",
|
|
220
|
+
"description": "Argument separator"
|
|
209
221
|
}
|
|
210
222
|
},
|
|
211
223
|
"tree": {
|
|
@@ -254,12 +266,15 @@
|
|
|
254
266
|
"noFunctionsFound": "No functions found",
|
|
255
267
|
"noPropertiesAvailable": "No properties available",
|
|
256
268
|
"noOperatorsFound": "No operators found",
|
|
269
|
+
"values": "Values",
|
|
270
|
+
"noValuesAvailable": "No values available",
|
|
257
271
|
"property": "Property",
|
|
258
272
|
"insertType": "Insert {{ type }} (Enter)",
|
|
259
273
|
"operatorTypes": {
|
|
260
274
|
"arithmetic": "Arithmetic",
|
|
261
275
|
"comparison": "Comparison",
|
|
262
276
|
"logical": "Logical",
|
|
277
|
+
"grouping": "Grouping",
|
|
263
278
|
"other": "Other"
|
|
264
279
|
}
|
|
265
280
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, ChangeDetectionStrategy, Component, inject, ElementRef, DestroyRef, afterNextRender, Directive, signal, effect, untracked, output, NgZone, model } from '@angular/core';
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component, inject, ElementRef, DestroyRef, afterNextRender, Directive, signal, effect, untracked, ViewEncapsulation, output, NgZone, 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, readableTextOn } from '@masterteam/components';
|
|
@@ -19,6 +19,76 @@ import { TooltipModule } from 'primeng/tooltip';
|
|
|
19
19
|
import { NgTemplateOutlet, DOCUMENT } from '@angular/common';
|
|
20
20
|
import { CdkDrag, CdkDropList, CdkDragPlaceholder } from '@angular/cdk/drag-drop';
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* A section is persisted/transported as an ordinary display item whose
|
|
24
|
+
* `propertyKey` carries this sentinel prefix instead of a real property key
|
|
25
|
+
* (mirrors the LeafDetails synthetic-key convention). Both the customization
|
|
26
|
+
* builder and the runtime renderer recognize it, so the constant lives here in
|
|
27
|
+
* the shared entities layer rather than in either consumer.
|
|
28
|
+
*/
|
|
29
|
+
const SECTION_KEY_PREFIX = '__section__::';
|
|
30
|
+
/** True when a display item's key denotes a section marker. */
|
|
31
|
+
function isSectionKey(key) {
|
|
32
|
+
return typeof key === 'string' && key.startsWith(SECTION_KEY_PREFIX);
|
|
33
|
+
}
|
|
34
|
+
/** Mints a unique section marker key. */
|
|
35
|
+
function buildSectionKey() {
|
|
36
|
+
return `${SECTION_KEY_PREFIX}${crypto.randomUUID()}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolves a localized label (`{ en, ar }`) for the given language, falling
|
|
40
|
+
* back across locales. Returns '' when nothing is set.
|
|
41
|
+
*/
|
|
42
|
+
function resolveLocalizedLabel(label, lang) {
|
|
43
|
+
if (!label)
|
|
44
|
+
return '';
|
|
45
|
+
const primary = lang === 'ar' ? label.ar : label.en;
|
|
46
|
+
return (primary || label.en || label.ar || '').trim();
|
|
47
|
+
}
|
|
48
|
+
/** True when the entity is a `Section` layout marker rather than a value. */
|
|
49
|
+
function isEntitySection(entity) {
|
|
50
|
+
return entity?.viewType === 'Section';
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Splits a flat, order-sorted entity list into section groups. Membership is
|
|
54
|
+
* purely positional: each entity belongs to whichever `Section` marker precedes
|
|
55
|
+
* it. Pass the output of `buildDisplayEntities` (already sorted by `order`).
|
|
56
|
+
*
|
|
57
|
+
* Zero markers → a single `{ section: null }` group holding everything, so the
|
|
58
|
+
* bare-grid rendering is unchanged. Empty leading/trailing runs are dropped.
|
|
59
|
+
*/
|
|
60
|
+
function groupEntitiesIntoSections(entities) {
|
|
61
|
+
const groups = [];
|
|
62
|
+
let current = { section: null, entities: [] };
|
|
63
|
+
const flush = () => {
|
|
64
|
+
if (current.section || current.entities.length > 0) {
|
|
65
|
+
groups.push(current);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
for (const entity of entities) {
|
|
69
|
+
if (isEntitySection(entity)) {
|
|
70
|
+
flush();
|
|
71
|
+
current = { section: entity, entities: [] };
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
current.entities.push(entity);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
flush();
|
|
78
|
+
return groups;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Resolves a section marker's display label for the given language, falling
|
|
82
|
+
* back across locales and finally to the entity's `name`.
|
|
83
|
+
*/
|
|
84
|
+
function getEntitySectionTitle(section, lang) {
|
|
85
|
+
if (!section)
|
|
86
|
+
return '';
|
|
87
|
+
const label = section.configuration
|
|
88
|
+
?.label;
|
|
89
|
+
return resolveLocalizedLabel(label, lang) || (section.name ?? '');
|
|
90
|
+
}
|
|
91
|
+
|
|
22
92
|
const ENTITY_EMPTY_VALUE_PLACEHOLDER = '_';
|
|
23
93
|
function isValueMissing(value) {
|
|
24
94
|
if (value === null || value === undefined) {
|
|
@@ -81,6 +151,19 @@ function isEntityAlignEnd(configuration) {
|
|
|
81
151
|
const config = configuration;
|
|
82
152
|
return config?.alignEnd ?? false;
|
|
83
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* The admin-authored note attached to a property in the customization drawer
|
|
156
|
+
* (`configuration.info`), resolved for the active language.
|
|
157
|
+
*
|
|
158
|
+
* Returns `''` when there is no note, which is what the renderer keys off to
|
|
159
|
+
* decide whether the entity gets an info affordance at all. The drawer omits
|
|
160
|
+
* the key entirely rather than writing an empty object, so "absent" and "blank"
|
|
161
|
+
* collapse to the same answer here on purpose.
|
|
162
|
+
*/
|
|
163
|
+
function resolveEntityInfo(configuration, lang) {
|
|
164
|
+
const config = configuration;
|
|
165
|
+
return resolveLocalizedLabel(config?.info, lang);
|
|
166
|
+
}
|
|
84
167
|
/**
|
|
85
168
|
* The product default: label above value.
|
|
86
169
|
*
|
|
@@ -918,76 +1001,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
918
1001
|
args: [{ selector: 'mt-entity-lookup', changeDetection: ChangeDetectionStrategy.OnPush, 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" }]
|
|
919
1002
|
}], 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 }] }] } });
|
|
920
1003
|
|
|
921
|
-
/**
|
|
922
|
-
* A section is persisted/transported as an ordinary display item whose
|
|
923
|
-
* `propertyKey` carries this sentinel prefix instead of a real property key
|
|
924
|
-
* (mirrors the LeafDetails synthetic-key convention). Both the customization
|
|
925
|
-
* builder and the runtime renderer recognize it, so the constant lives here in
|
|
926
|
-
* the shared entities layer rather than in either consumer.
|
|
927
|
-
*/
|
|
928
|
-
const SECTION_KEY_PREFIX = '__section__::';
|
|
929
|
-
/** True when a display item's key denotes a section marker. */
|
|
930
|
-
function isSectionKey(key) {
|
|
931
|
-
return typeof key === 'string' && key.startsWith(SECTION_KEY_PREFIX);
|
|
932
|
-
}
|
|
933
|
-
/** Mints a unique section marker key. */
|
|
934
|
-
function buildSectionKey() {
|
|
935
|
-
return `${SECTION_KEY_PREFIX}${crypto.randomUUID()}`;
|
|
936
|
-
}
|
|
937
|
-
/**
|
|
938
|
-
* Resolves a localized label (`{ en, ar }`) for the given language, falling
|
|
939
|
-
* back across locales. Returns '' when nothing is set.
|
|
940
|
-
*/
|
|
941
|
-
function resolveLocalizedLabel(label, lang) {
|
|
942
|
-
if (!label)
|
|
943
|
-
return '';
|
|
944
|
-
const primary = lang === 'ar' ? label.ar : label.en;
|
|
945
|
-
return (primary || label.en || label.ar || '').trim();
|
|
946
|
-
}
|
|
947
|
-
/** True when the entity is a `Section` layout marker rather than a value. */
|
|
948
|
-
function isEntitySection(entity) {
|
|
949
|
-
return entity?.viewType === 'Section';
|
|
950
|
-
}
|
|
951
|
-
/**
|
|
952
|
-
* Splits a flat, order-sorted entity list into section groups. Membership is
|
|
953
|
-
* purely positional: each entity belongs to whichever `Section` marker precedes
|
|
954
|
-
* it. Pass the output of `buildDisplayEntities` (already sorted by `order`).
|
|
955
|
-
*
|
|
956
|
-
* Zero markers → a single `{ section: null }` group holding everything, so the
|
|
957
|
-
* bare-grid rendering is unchanged. Empty leading/trailing runs are dropped.
|
|
958
|
-
*/
|
|
959
|
-
function groupEntitiesIntoSections(entities) {
|
|
960
|
-
const groups = [];
|
|
961
|
-
let current = { section: null, entities: [] };
|
|
962
|
-
const flush = () => {
|
|
963
|
-
if (current.section || current.entities.length > 0) {
|
|
964
|
-
groups.push(current);
|
|
965
|
-
}
|
|
966
|
-
};
|
|
967
|
-
for (const entity of entities) {
|
|
968
|
-
if (isEntitySection(entity)) {
|
|
969
|
-
flush();
|
|
970
|
-
current = { section: entity, entities: [] };
|
|
971
|
-
}
|
|
972
|
-
else {
|
|
973
|
-
current.entities.push(entity);
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
flush();
|
|
977
|
-
return groups;
|
|
978
|
-
}
|
|
979
|
-
/**
|
|
980
|
-
* Resolves a section marker's display label for the given language, falling
|
|
981
|
-
* back across locales and finally to the entity's `name`.
|
|
982
|
-
*/
|
|
983
|
-
function getEntitySectionTitle(section, lang) {
|
|
984
|
-
if (!section)
|
|
985
|
-
return '';
|
|
986
|
-
const label = section.configuration
|
|
987
|
-
?.label;
|
|
988
|
-
return resolveLocalizedLabel(label, lang) || (section.name ?? '');
|
|
989
|
-
}
|
|
990
|
-
|
|
991
1004
|
/** `#RGB` / `#RRGGBB`. Anything else is used as-is for the text color only. */
|
|
992
1005
|
const HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
993
1006
|
/**
|
|
@@ -2058,6 +2071,34 @@ function buildDisplayEntities(entities) {
|
|
|
2058
2071
|
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
2059
2072
|
}
|
|
2060
2073
|
|
|
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
|
+
|
|
2061
2102
|
class EntityPreviewBody {
|
|
2062
2103
|
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
2063
2104
|
attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
|
|
@@ -2155,8 +2196,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2155
2196
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
2156
2197
|
|
|
2157
2198
|
class EntityPreview {
|
|
2199
|
+
transloco = inject(TranslocoService);
|
|
2158
2200
|
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
2159
2201
|
attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
|
|
2202
|
+
activeLang = sharedActiveLang(this.transloco);
|
|
2203
|
+
/**
|
|
2204
|
+
* The admin-authored note for the active language, or `''` when the property
|
|
2205
|
+
* has none. Resolved here rather than in each `entity-*` component because
|
|
2206
|
+
* this is the one wrapper every view type and every call site passes through
|
|
2207
|
+
* — the card grid, the customization builder preview, and the standalone
|
|
2208
|
+
* `mt-entity-preview` usages in the app.
|
|
2209
|
+
*/
|
|
2210
|
+
infoText = computed(() => resolveEntityInfo(this.data().configuration, this.activeLang()), ...(ngDevMode ? [{ debugName: "infoText" }] : /* istanbul ignore next */ []));
|
|
2160
2211
|
comparisonKind = computed(() => {
|
|
2161
2212
|
const c = this.data().comparison;
|
|
2162
2213
|
if (!c)
|
|
@@ -2168,13 +2219,23 @@ class EntityPreview {
|
|
|
2168
2219
|
return null;
|
|
2169
2220
|
}, ...(ngDevMode ? [{ debugName: "comparisonKind" }] : /* istanbul ignore next */ []));
|
|
2170
2221
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2171
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreview, isStandalone: true, selector: "mt-entity-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: "w-full" }, ngImport: i0, template: "@switch (comparisonKind()) {\
|
|
2222
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreview, isStandalone: true, selector: "mt-entity-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: { properties: { "class.relative": "infoText()", "class.pe-4": "infoText()" }, classAttribute: "w-full" }, ngImport: i0, template: "@if (infoText(); as info) {\n <!--\n The note affordance. Absolutely positioned so it stays out of the value's\n own layout \u2014 each viewType renders its own markup and there is no shared\n slot to put this in \u2014 while the host reserves the corner with `pe-4`, so a\n long value truncates before it can run underneath the icon.\n -->\n <!--\n Sized with `text-sm`, not a `size` input: `mt-icon` has none, and its host\n is `width: 1em` \u2014 so font-size is what actually scales the glyph.\n -->\n <mt-icon\n icon=\"general.info-circle\"\n class=\"absolute top-0 end-0 z-10 cursor-help text-sm text-surface-400 transition-colors hover:text-primary-600\"\n [mtTooltip]=\"info\"\n tooltipPosition=\"top\"\n tooltipStyleClass=\"mt-entity-info-tooltip\"\n [attr.aria-label]=\"info\"\n />\n}\n\n@switch (comparisonKind()) {\n @case (\"Value\") {\n <mt-comparison-value [data]=\"data()\" />\n }\n @case (\"EntityList\") {\n <mt-comparison-entity-list [data]=\"data()\" />\n }\n @default {\n <mt-entity-preview-body\n [data]=\"data()\"\n [attachmentShape]=\"attachmentShape()\"\n />\n }\n}\n", styles: [".mt-entity-info-tooltip{max-width:22rem}.mt-entity-info-tooltip .p-tooltip-text{white-space:pre-wrap;text-align:start;overflow-wrap:anywhere}\n"], dependencies: [{ kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }, { kind: "component", type: ComparisonValue, selector: "mt-comparison-value", inputs: ["data"] }, { kind: "component", type: ComparisonEntityList, selector: "mt-comparison-entity-list", inputs: ["data"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2172
2223
|
}
|
|
2173
2224
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, decorators: [{
|
|
2174
2225
|
type: Component,
|
|
2175
|
-
args: [{ selector: 'mt-entity-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
2226
|
+
args: [{ selector: 'mt-entity-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
2227
|
+
EntityPreviewBody,
|
|
2228
|
+
ComparisonValue,
|
|
2229
|
+
ComparisonEntityList,
|
|
2230
|
+
Tooltip,
|
|
2231
|
+
Icon,
|
|
2232
|
+
], encapsulation: ViewEncapsulation.None, host: {
|
|
2176
2233
|
class: 'w-full',
|
|
2177
|
-
|
|
2234
|
+
// Both only apply when there is a note, so an entity without one keeps
|
|
2235
|
+
// exactly the box it had before this feature existed.
|
|
2236
|
+
'[class.relative]': 'infoText()',
|
|
2237
|
+
'[class.pe-4]': 'infoText()',
|
|
2238
|
+
}, template: "@if (infoText(); as info) {\n <!--\n The note affordance. Absolutely positioned so it stays out of the value's\n own layout \u2014 each viewType renders its own markup and there is no shared\n slot to put this in \u2014 while the host reserves the corner with `pe-4`, so a\n long value truncates before it can run underneath the icon.\n -->\n <!--\n Sized with `text-sm`, not a `size` input: `mt-icon` has none, and its host\n is `width: 1em` \u2014 so font-size is what actually scales the glyph.\n -->\n <mt-icon\n icon=\"general.info-circle\"\n class=\"absolute top-0 end-0 z-10 cursor-help text-sm text-surface-400 transition-colors hover:text-primary-600\"\n [mtTooltip]=\"info\"\n tooltipPosition=\"top\"\n tooltipStyleClass=\"mt-entity-info-tooltip\"\n [attr.aria-label]=\"info\"\n />\n}\n\n@switch (comparisonKind()) {\n @case (\"Value\") {\n <mt-comparison-value [data]=\"data()\" />\n }\n @case (\"EntityList\") {\n <mt-comparison-entity-list [data]=\"data()\" />\n }\n @default {\n <mt-entity-preview-body\n [data]=\"data()\"\n [attachmentShape]=\"attachmentShape()\"\n />\n }\n}\n", styles: [".mt-entity-info-tooltip{max-width:22rem}.mt-entity-info-tooltip .p-tooltip-text{white-space:pre-wrap;text-align:start;overflow-wrap:anywhere}\n"] }]
|
|
2178
2239
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
|
|
2179
2240
|
|
|
2180
2241
|
const EMPTY_KEY_SET = new Set();
|
|
@@ -2510,5 +2571,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2510
2571
|
* Generated bundle index. Do not edit.
|
|
2511
2572
|
*/
|
|
2512
2573
|
|
|
2513
|
-
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, resolveEntityLabelPosition, resolveLocalizedLabel, resolvePercentageColor, serializeEntityRawValue, splitConnectionKey };
|
|
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 };
|
|
2514
2575
|
//# sourceMappingURL=masterteam-components-entities.mjs.map
|