@masterteam/components 0.0.317 → 0.0.319
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/fesm2022/masterteam-components-business-fields.mjs +4 -4
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +44 -44
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-field-validation.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +53 -6
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-treeselect-field.mjs +2 -2
- package/fesm2022/masterteam-components-treeselect-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +4 -0
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-table.d.ts +12 -1
- package/types/masterteam-components.d.ts +42 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-entities.mjs","sources":["../../../../packages/masterteam/components/entities/entity.model.ts","../../../../packages/masterteam/components/entities/entity-sections.util.ts","../../../../packages/masterteam/components/entities/entity-display.utils.ts","../../../../packages/masterteam/components/entities/stakeholder-name.utils.ts","../../../../packages/masterteam/components/entities/entity-runtime-context.ts","../../../../packages/masterteam/components/entities/entity-field/entity-field.ts","../../../../packages/masterteam/components/entities/entity-text/entity-text.ts","../../../../packages/masterteam/components/entities/entity-text/entity-text.html","../../../../packages/masterteam/components/entities/fit-text.directive.ts","../../../../packages/masterteam/components/entities/entity-date/entity-date.ts","../../../../packages/masterteam/components/entities/entity-date/entity-date.html","../../../../packages/masterteam/components/entities/entity-status/entity-status.ts","../../../../packages/masterteam/components/entities/entity-status/entity-status.html","../../../../packages/masterteam/components/entities/entity-icon/entity-icon.ts","../../../../packages/masterteam/components/entities/entity-icon/entity-icon.html","../../../../packages/masterteam/components/entities/entity-user/entity-user.ts","../../../../packages/masterteam/components/entities/entity-user/entity-user.html","../../../../packages/masterteam/components/entities/percentage-color.utils.ts","../../../../packages/masterteam/components/entities/entity-percentage/entity-percentage.ts","../../../../packages/masterteam/components/entities/entity-percentage/entity-percentage.html","../../../../packages/masterteam/components/entities/currency-display.utils.ts","../../../../packages/masterteam/components/entities/entity-currency/entity-currency.ts","../../../../packages/masterteam/components/entities/entity-currency/entity-currency.html","../../../../packages/masterteam/components/entities/entity-checkbox/entity-checkbox.ts","../../../../packages/masterteam/components/entities/entity-checkbox/entity-checkbox.html","../../../../packages/masterteam/components/entities/entity-long-text/entity-long-text.ts","../../../../packages/masterteam/components/entities/entity-long-text/entity-long-text.html","../../../../packages/masterteam/components/entities/entity-lookup/entity-lookup.ts","../../../../packages/masterteam/components/entities/entity-lookup/entity-lookup.html","../../../../packages/masterteam/components/entities/entity-phase-gate/entity-phase-gate.ts","../../../../packages/masterteam/components/entities/entity-phase-gate/entity-phase-gate.html","../../../../packages/masterteam/components/entities/active-lang.ts","../../../../packages/masterteam/components/entities/performance-score.utils.ts","../../../../packages/masterteam/components/entities/entity-performance-score/entity-performance-score.ts","../../../../packages/masterteam/components/entities/entity-performance-score/entity-performance-score.html","../../../../packages/masterteam/components/entities/entity-attachment/entity-attachment.ts","../../../../packages/masterteam/components/entities/entity-attachment/entity-attachment.html","../../../../packages/masterteam/components/entities/entity-location/entity-location.ts","../../../../packages/masterteam/components/entities/entity-location/entity-location.html","../../../../packages/masterteam/components/entities/entity-connection/entity-connection.ts","../../../../packages/masterteam/components/entities/entity-connection/entity-connection.html","../../../../packages/masterteam/components/entities/entity-schedule-item/entity-schedule-item.ts","../../../../packages/masterteam/components/entities/entity-schedule-item/entity-schedule-item.html","../../../../packages/masterteam/components/entities/entity-list-local.util.ts","../../../../packages/masterteam/components/entities/entity-list-rows.util.ts","../../../../packages/masterteam/components/entities/entity-leaf-details/entity-leaf-details.ts","../../../../packages/masterteam/components/entities/entity-leaf-details/entity-leaf-details.html","../../../../packages/masterteam/components/entities/entity-preview/entity-value-preview.ts","../../../../packages/masterteam/components/entities/entity-preview/entity-value-preview.html","../../../../packages/masterteam/components/entities/entity-list-preview/entity-list-drawer.ts","../../../../packages/masterteam/components/entities/entity-list-preview/entity-list-drawer.html","../../../../packages/masterteam/components/entities/entity-list-preview/entity-list-preview.ts","../../../../packages/masterteam/components/entities/entity-list-preview/entity-list-preview.html","../../../../packages/masterteam/components/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.ts","../../../../packages/masterteam/components/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.html","../../../../packages/masterteam/components/entities/connection-display.utils.ts","../../../../packages/masterteam/components/entities/leaf-details-display.utils.ts","../../../../packages/masterteam/components/entities/entity-preview/entity-preview-body.ts","../../../../packages/masterteam/components/entities/entity-preview/entity-preview-body.html","../../../../packages/masterteam/components/entities/comparison/comparison-value/comparison-value.ts","../../../../packages/masterteam/components/entities/comparison/comparison-value/comparison-value.html","../../../../packages/masterteam/components/entities/comparison/comparison-entity-list/comparison-entity-list.ts","../../../../packages/masterteam/components/entities/comparison/comparison-entity-list/comparison-entity-list.html","../../../../packages/masterteam/components/entities/entity-preview/entity-preview.ts","../../../../packages/masterteam/components/entities/entity-preview/entity-preview.html","../../../../packages/masterteam/components/entities/entities-preview/entities-preview.ts","../../../../packages/masterteam/components/entities/entities-preview/entities-preview.html","../../../../packages/masterteam/components/entities/entities-manage/entities-resize-base.ts","../../../../packages/masterteam/components/entities/entities-manage/entities-manage.ts","../../../../packages/masterteam/components/entities/entities-manage/entities-manage.html","../../../../packages/masterteam/components/entities/masterteam-components-entities.ts"],"sourcesContent":["import type { PropertyValueComparison } from './entity-comparison.model';\r\nimport type { EntityRuntimeContext } from './entity-runtime-context';\r\n\r\nexport type EntityViewType =\r\n | 'Text'\r\n | 'LongText'\r\n | 'Date'\r\n | 'DateTime'\r\n /**\r\n * Time-of-day. The value on the wire is still a full ISO instant (the\r\n * backend stores and returns the same shape as `DateTime`); only the\r\n * rendering and the picker are narrowed to the clock time.\r\n */\r\n | 'Time'\r\n | 'Number'\r\n | 'Percentage'\r\n | 'Status'\r\n | 'Currency'\r\n | 'Checkbox'\r\n | 'User'\r\n | 'MultiUser'\r\n | 'Lookup'\r\n | 'LookupMultiSelect'\r\n /**\r\n * Calculated, read-only lookup resolved by the backend to the schema phase\r\n * gate the record currently sits on. Never editable at runtime.\r\n */\r\n | 'PhaseGate'\r\n /**\r\n * Calculated, read-only KPI performance — a semicircle gauge (ported from\r\n * SPlus v3's `app-performance-gauge`). The value is an\r\n * {@link EntityPerformanceScoreValue}; never editable at runtime.\r\n */\r\n | 'PerformanceScore'\r\n | 'Attachment'\r\n | 'Location'\r\n | 'LookupMatrix'\r\n | 'LookupModuleCheckList'\r\n | 'LeafDetails'\r\n | 'Connection'\r\n | 'ScheduleItemSelector'\r\n /**\r\n * A nested list of related rows. Read-only here: the editable runtime is\r\n * `mt-entity-list-field`, which fetches its own rows; this view type is what\r\n * arrives when an `EntityList` property is itself a *column* of that fetch —\r\n * a calculated inline list the backend renders inline, such as the phase\r\n * gate `phasegate_checklists` virtual property. The value carries its own\r\n * rows, so nothing is fetched to display it.\r\n */\r\n | 'EntityList'\r\n /**\r\n * A stored icon reference. The value is a plain icon key (e.g.\r\n * `custom.strategy`) — the backend's own system icon property (Name/Icon on\r\n * a Template) reports this view type. Rendered as the actual glyph via\r\n * `mt-icon`, not as the raw key string; `mt-icon` degrades to an empty glyph\r\n * for an unknown key.\r\n */\r\n | 'Icon'\r\n /**\r\n * Layout marker, not a value. Rendered full-width and non-resizable; the\r\n * preview layer (`groupEntitiesIntoSections`) turns each marker into a titled\r\n * section box that owns every entity following it until the next marker.\r\n */\r\n | 'Section';\r\n\r\nexport type EntityLabelPosition = 'top' | 'bottom';\r\n\r\n/** Entity size – controls column span (1-24) inside a 24-column grid */\r\nexport type EntitySize =\r\n | 1\r\n | 2\r\n | 3\r\n | 4\r\n | 5\r\n | 6\r\n | 7\r\n | 8\r\n | 9\r\n | 10\r\n | 11\r\n | 12\r\n | 13\r\n | 14\r\n | 15\r\n | 16\r\n | 17\r\n | 18\r\n | 19\r\n | 20\r\n | 21\r\n | 22\r\n | 23\r\n | 24;\r\n\r\n// ── Per-type configuration interfaces ──\r\n\r\nexport interface EntityBaseConfig {\r\n /** Column span of the entity card (1-24). Default: 8 */\r\n size?: EntitySize;\r\n /** Whether to show a dashed border around the entity card */\r\n showBorder?: boolean;\r\n /** Whether to hide the entity name label. Prefer hideLabel for new config. */\r\n hideName?: boolean;\r\n /** Whether to hide the entity label */\r\n hideLabel?: boolean;\r\n /** Controls whether the label is rendered above or below the value */\r\n labelPosition?: EntityLabelPosition;\r\n /** Legacy misspelled alias kept for compatibility */\r\n labelPostion?: EntityLabelPosition;\r\n /** Whether the entity content is aligned to the end (right in LTR) */\r\n alignEnd?: boolean;\r\n /**\r\n * Custom localized label override. When present it replaces the catalog\r\n * label; it also serves as the heading for `Section` markers.\r\n */\r\n label?: EntitySectionLabel;\r\n /**\r\n * Admin-authored explanatory note, localized. When present the entity grows a\r\n * small info affordance at its top-end corner that reveals this text on hover.\r\n *\r\n * Plain text, deliberately. Every string inside a `configuration` payload is\r\n * sanitized server-side with the PlainText profile, which strips HTML tags\r\n * outright — rich markup authored here would come back as bare words. The\r\n * renderer preserves the author's own line breaks instead.\r\n */\r\n info?: EntitySectionLabel;\r\n}\r\n\r\nexport interface EntityUserConfig extends EntityBaseConfig {\r\n showDisplayName?: boolean;\r\n showPhoneNumber?: boolean;\r\n showEmail?: boolean;\r\n /**\r\n * Whether the avatar is rendered at all. When `false` neither the user's\r\n * picture nor the generic fallback icon shows — only the name remains.\r\n */\r\n showAvatar?: boolean;\r\n /** Maximum users shown before the MultiUser preview collapses behind +N. */\r\n maxVisibleUsers?: number;\r\n}\r\n\r\n/**\r\n * One Progress/Percentage color rule. Bounds are inclusive and at least one of\r\n * `minValue`/`maxValue` must be present — a rule with neither matches nothing.\r\n */\r\nexport interface PercentageColorRule {\r\n minValue?: number | null;\r\n maxValue?: number | null;\r\n color: string;\r\n}\r\n\r\n/**\r\n * Where a Percentage property's colour comes from.\r\n *\r\n * - `rules` — the value itself picks the colour out of `colorRules`.\r\n * - `property` — another property on the same record supplies it, so the bar\r\n * follows that property's own colour (a Status's colour, a Lookup item's\r\n * colour) rather than the percentage it is showing.\r\n *\r\n * An absent mode reads as `rules`: every configuration authored before this\r\n * existed is value-based.\r\n */\r\nexport type PercentageColorMode = 'rules' | 'property';\r\n\r\n/**\r\n * The property that supplies the colour in `property` mode.\r\n *\r\n * Both identifiers are stored on purpose. `propertyId` is what the backend\r\n * resolves against, and `propertyKey` is what a renderer holding an already\r\n * rendered record can match without a catalog lookup — rendered properties\r\n * carry their key, not the catalog id they came from.\r\n */\r\nexport interface PercentageColorPropertyRef {\r\n /** Catalog id of the colour-bearing property. */\r\n propertyId: number;\r\n /** Its key, for matching against a rendered record. */\r\n propertyKey?: string | null;\r\n /**\r\n * Its view type — `Status`, `Lookup`, `LookupMultiSelect` or `PhaseGate`.\r\n * Deliberately a plain string: it arrives from stored JSON, and a view type\r\n * this build does not know about must survive the round trip rather than be\r\n * normalised away.\r\n */\r\n viewType?: string | null;\r\n}\r\n\r\nexport interface EntityPercentageConfig extends EntityBaseConfig {\r\n /**\r\n * The colour to paint the bar with. The backend resolves the configuration —\r\n * the rules, or the source property in `property` mode — and ships the winner\r\n * here on render/value/fetch responses, so this always wins over a\r\n * client-side evaluation.\r\n */\r\n color?: string;\r\n /** Which of the two colour strategies applies. Absent ⇒ `rules`. */\r\n colorSource?: PercentageColorMode | null;\r\n /** The colour-bearing property. `property` mode only. */\r\n colorProperty?: PercentageColorPropertyRef | null;\r\n /** Ordered rules — evaluated in order, first match wins. `rules` mode only. */\r\n colorRules?: PercentageColorRule[] | null;\r\n /**\r\n * Fallback colour. In `rules` mode it applies when no rule matches; in\r\n * `property` mode when the source property is empty or its value carries no\r\n * colour of its own.\r\n */\r\n defaultColor?: string | null;\r\n}\r\n\r\n/**\r\n * How wide a `PerformanceScore` gauge may grow inside its cell. The gauge is\r\n * centred and shrinks with a narrower cell; this only caps it. Absent ⇒\r\n * `medium`.\r\n */\r\nexport type EntityPerformanceScoreChartSize =\r\n | 'small'\r\n | 'medium'\r\n | 'large'\r\n | 'full';\r\n\r\nexport interface EntityPerformanceScoreConfig extends EntityBaseConfig {\r\n /** Set from the customization drawer. */\r\n chartSize?: EntityPerformanceScoreChartSize;\r\n}\r\n\r\nexport interface LeafLevelSavedConfig {\r\n /** Position order for this level entity in the preview grid */\r\n order: number;\r\n /** Column span (1-24), persisted from drag-resize */\r\n size?: EntitySize;\r\n /** Status keys the user has chosen to display */\r\n selectedStatuses: string[];\r\n /**\r\n * Custom label for THIS tile, localized.\r\n *\r\n * Per-level rather than on the parent property because one LeafDetails\r\n * property renders one tile per child level per projection — a single shared\r\n * label would paint the same text on every one of them and leave the tiles\r\n * indistinguishable. Same reasoning as `order` and `size`, which are already\r\n * per-level. Empty → the child level's own name.\r\n */\r\n label?: EntitySectionLabel;\r\n}\r\n\r\n/**\r\n * Per-level display overrides for the *phase* projection of a LeafDetails\r\n * property — the sibling of {@link LeafLevelSavedConfig}. The two are kept\r\n * apart on purpose: one level can contribute a status item, a phase item, or\r\n * both, each with its own slot and width in the grid.\r\n *\r\n * Unlike `leafLevels`, an absent `leafPhases` map hides every phase item.\r\n * Phases are strictly opt-in so existing cards do not grow badges they were\r\n * never configured with.\r\n */\r\nexport interface LeafPhaseSavedConfig {\r\n /** Position order for this level's phase entity in the preview grid */\r\n order: number;\r\n /** Column span (1-24), persisted from drag-resize */\r\n size?: EntitySize;\r\n /** Phase keys the user has chosen to display */\r\n selectedPhases: string[];\r\n /** Custom label for this phase tile, localized. See `LeafLevelSavedConfig.label`. */\r\n label?: EntitySectionLabel;\r\n}\r\n\r\nexport interface EntityLeafDetailsConfig extends EntityBaseConfig {\r\n /** Per-level display overrides for LeafDetails entities */\r\n leafLevels?: Record<string, LeafLevelSavedConfig>;\r\n /** Per-level phase-badge overrides for LeafDetails entities */\r\n leafPhases?: Record<string, LeafPhaseSavedConfig>;\r\n}\r\n\r\n/**\r\n * Per-source-level display overrides for a Connection entity. Unlike\r\n * `LeafLevelSavedConfig` an absent entry does not hide the level — every source\r\n * level always renders as its own item and simply inherits the parent's\r\n * order/size until the user drags it.\r\n */\r\nexport interface ConnectionLevelSavedConfig {\r\n /** Position order for this source-level item in the preview grid */\r\n order?: number;\r\n /** Column span (1-24), persisted from drag-resize */\r\n size?: EntitySize;\r\n}\r\n\r\nexport interface EntityConnectionConfig extends EntityBaseConfig {\r\n /** Per-source-level display overrides for Connection entities */\r\n connectionLevels?: Record<string, ConnectionLevelSavedConfig>;\r\n}\r\n\r\n/**\r\n * One source level a Connection property can link to, as published on the\r\n * property catalog's `configuration.sourceLevels`. Its `name` supplies the\r\n * label of the split item that represents this level.\r\n */\r\nexport interface ConnectionSourceLevelConfig {\r\n levelId: number;\r\n levelKey?: string;\r\n name?: EntitySectionLabel | string;\r\n connectionId?: number;\r\n [key: string]: unknown;\r\n}\r\n\r\n/** Catalog `configuration` shape of a `Connection` property. */\r\nexport interface ConnectionCatalogConfiguration {\r\n sourceLevels?: ConnectionSourceLevelConfig[];\r\n [key: string]: unknown;\r\n}\r\n\r\n/** One connected record inside a Connection value's `Sources` array. */\r\nexport interface EntityConnectionSourceValue {\r\n sourceLevelId?: number;\r\n SourceLevelId?: number;\r\n sourceLevelDataId?: number;\r\n SourceLevelDataId?: number;\r\n display?: string;\r\n Display?: string;\r\n name?: string;\r\n Name?: string;\r\n [key: string]: unknown;\r\n}\r\n\r\n/** A localized label ({ en, ar }) — used by section headings and custom labels. */\r\nexport interface EntitySectionLabel {\r\n en?: string;\r\n ar?: string;\r\n}\r\n\r\n/** Configuration for a `Section` layout marker (`viewType: 'Section'`). */\r\nexport interface EntitySectionConfig extends EntityBaseConfig {\r\n /** Section heading, localized. Empty/absent renders a header-less box. */\r\n label?: EntitySectionLabel;\r\n}\r\n\r\nexport type EntityConfiguration =\r\n | EntityBaseConfig\r\n | EntityUserConfig\r\n | EntityPercentageConfig\r\n | EntityPerformanceScoreConfig\r\n | EntityLeafDetailsConfig\r\n | EntityConnectionConfig\r\n | EntitySectionConfig;\r\n\r\n/** Value shape for a translatable Text/LongText property: `{ display, ar?, en? }`. */\r\nexport interface EntityTranslatableTextValue extends EntitySectionLabel {\r\n display: string;\r\n}\r\n\r\nexport interface EntityStatusValue {\r\n key: string;\r\n display: string;\r\n color: string;\r\n description?: string;\r\n}\r\n\r\nexport interface EntityLookupValue {\r\n key: string;\r\n display: string;\r\n color: string;\r\n description?: string;\r\n}\r\n\r\nexport type EntityMultiLookupValue = EntityLookupValue[];\r\n\r\n/**\r\n * A `PhaseGate` value — the schema phase gate the record currently sits on.\r\n *\r\n * Calculated and read-only: the backend owns it, nothing in the runtime writes\r\n * it back. `key` is the stable phase-gate key; the schema phase-gate *id* rides\r\n * on the owning entity's `rawValue`, not here. `display` is resolved for the\r\n * request language, and `en`/`ar` carry the explicit per-language labels so the\r\n * renderer can follow a client-side language switch without a refetch.\r\n */\r\nexport interface EntityPhaseGateValue {\r\n key: string;\r\n display: string;\r\n en?: string;\r\n ar?: string;\r\n description?: string;\r\n /**\r\n * Optional presentation metadata (hex). Absent → the renderer's\r\n * `DEFAULT_PHASE_GATE_COLOR` neutral badge.\r\n */\r\n color?: string;\r\n}\r\n\r\n/**\r\n * One performance band of a `PerformanceScore` gauge — a status item with the\r\n * range of performance it covers. Bounds are percentages; a missing `from`\r\n * starts at the gauge minimum and a missing `to` runs to the gauge maximum.\r\n */\r\nexport interface EntityPerformanceScoreStatus {\r\n key: string;\r\n display: string;\r\n color: string;\r\n from?: number | null;\r\n to?: number | null;\r\n}\r\n\r\n/**\r\n * A `PerformanceScore` value, calculated by the backend.\r\n *\r\n * - `performance` — the score, in percent. May exceed 100 or fall below 0; the\r\n * gauge widens its scale to the outermost band, then clamps the marker.\r\n * - `status` — the band the score currently sits in. Absent → resolved here\r\n * from `statuses` by range.\r\n * - `statuses` — every band, drawn as coloured arc segments. Absent/empty → a\r\n * single arc painted in the status colour.\r\n */\r\nexport interface EntityPerformanceScoreValue {\r\n performance: number | string | null;\r\n status?: EntityPerformanceScoreStatus | null;\r\n statuses?: EntityPerformanceScoreStatus[] | null;\r\n}\r\n\r\nexport interface EntityUserValue {\r\n id?: string;\r\n userName?: string;\r\n name?: string;\r\n displayName?: string;\r\n photoUrl?: string;\r\n phoneNumber?: string;\r\n email?: string;\r\n /**\r\n * `false` when the user is no longer linked to the current application\r\n * (e.g. removed/deleted) but is still referenced by historical records.\r\n */\r\n isLinkedToCurrentApplication?: boolean;\r\n}\r\n\r\nexport type EntityMultiUserValue = EntityUserValue[];\r\n\r\nexport interface LeafDetailsStatusSummary {\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n /** Always 0 in preview/configuration context; populated from runtime fetch */\r\n count: number;\r\n}\r\n\r\nexport interface LeafDetailsCatalogStatusValue {\r\n key: string;\r\n display: string;\r\n description?: string | null;\r\n color: string | null;\r\n icon?: string | null;\r\n order?: number;\r\n}\r\n\r\n/**\r\n * One phase bucket of a child level, as published on the catalog\r\n * `configuration` and counted at runtime. `id` is the schema phase-gate id and\r\n * is `null` on the backend's synthetic \"No current phase\" bucket — `key` is\r\n * what the saved configuration selects on, so it is the stable identifier here.\r\n */\r\nexport interface LeafDetailsCatalogPhaseValue {\r\n id?: number | null;\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n icon?: string | null;\r\n order?: number;\r\n}\r\n\r\nexport interface LeafDetailsPhaseSummary {\r\n id?: number | null;\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n /** Always 0 in preview/configuration context; populated from runtime fetch */\r\n count: number;\r\n}\r\n\r\nexport interface LeafDetailsCatalogLevelValue {\r\n levelId: number;\r\n levelName: string;\r\n levelIcon: string;\r\n statuses: LeafDetailsCatalogStatusValue[];\r\n /** Absent for child levels the tenant has defined no phase gates on. */\r\n phases?: LeafDetailsCatalogPhaseValue[] | null;\r\n}\r\n\r\n/** Which projection of a child level an expanded LeafDetails item renders. */\r\nexport type LeafDetailsBadgeKind = 'status' | 'phase';\r\n\r\nexport interface LeafDetailsEntityValue {\r\n levelId: number;\r\n levelName: string;\r\n levelIcon: string;\r\n statuses: LeafDetailsStatusSummary[];\r\n phases?: LeafDetailsPhaseSummary[];\r\n /**\r\n * Set by `expandLeafDetailsEntity` on the split items. `'status'` (or absent,\r\n * for values produced before phases existed) renders the status badges;\r\n * `'phase'` renders the phase badges.\r\n */\r\n kind?: LeafDetailsBadgeKind;\r\n}\r\n\r\nexport type LeafDetailsEntityCollectionValue = LeafDetailsEntityValue[];\r\nexport type LeafDetailsCatalogConfiguration = LeafDetailsCatalogLevelValue[];\r\nexport type EntityPropertyConfiguration =\r\n | Record<string, unknown>\r\n | LeafDetailsCatalogConfiguration\r\n | null;\r\n\r\nexport interface LeafDetailsRuntimeStatusDetails {\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n description?: string | null;\r\n icon?: string | null;\r\n order?: number;\r\n}\r\n\r\nexport interface LeafDetailsRuntimeStatusCount {\r\n details: LeafDetailsRuntimeStatusDetails;\r\n count: number;\r\n}\r\n\r\nexport interface LeafDetailsRuntimePhaseDetails {\r\n id?: number | null;\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n icon?: string | null;\r\n order?: number;\r\n}\r\n\r\nexport interface LeafDetailsRuntimePhaseCount {\r\n details: LeafDetailsRuntimePhaseDetails;\r\n count: number;\r\n}\r\n\r\nexport interface LeafDetailsRuntimeChildSchema {\r\n levelId: number;\r\n levelName: string;\r\n levelIcon: string;\r\n totalCount?: number;\r\n statuses: LeafDetailsRuntimeStatusCount[];\r\n /** Absent for child levels the tenant has defined no phase gates on. */\r\n phases?: LeafDetailsRuntimePhaseCount[] | null;\r\n}\r\n\r\nexport interface LeafDetailsRuntimeValue {\r\n totalCount?: number;\r\n childSchemas: LeafDetailsRuntimeChildSchema[];\r\n}\r\n\r\nexport interface EntityAttachmentItemValue {\r\n id?: string;\r\n name?: string;\r\n fileName?: string;\r\n contentType?: string;\r\n extension?: string;\r\n size?: number;\r\n}\r\n\r\nexport type EntityAttachmentValue = Array<EntityAttachmentItemValue | string>;\r\n\r\nexport interface EntityLocationValue {\r\n display_name?: string;\r\n address?: string;\r\n lat?: string | number;\r\n lon?: string | number;\r\n lng?: string | number;\r\n [key: string]: unknown;\r\n}\r\n\r\nexport interface EntityConnectionValue {\r\n /** Human-readable label of the connected record (read from `rawValue.display`). */\r\n display?: string;\r\n /** Per-source breakdown; the backend serializes it as `Sources`. */\r\n sources?: EntityConnectionSourceValue[];\r\n Sources?: EntityConnectionSourceValue[];\r\n [key: string]: unknown;\r\n}\r\n\r\n/** A single property key/value captured for a checklist entry. */\r\nexport interface EntityLookupCheckListPropValue {\r\n key: string;\r\n /**\r\n * Rendered value resolved by the backend, in the same shape a top-level\r\n * property of the same `viewType` carries. Paired with the matching\r\n * `EntityNestedPropertyMeta` to render it as a real typed entity.\r\n */\r\n value: unknown;\r\n}\r\n\r\n/** One checklist entry: a selected lookup item plus its captured property values. */\r\nexport interface EntityLookupCheckListItem {\r\n lookupKey: string;\r\n props: EntityLookupCheckListPropValue[];\r\n}\r\n\r\n/**\r\n * Rendered view model for a `LookupModuleCheckList` value.\r\n * The backend renderer wraps the checklist entries in `{ items: [...] }`.\r\n */\r\nexport interface EntityLookupCheckListValue {\r\n items: EntityLookupCheckListItem[];\r\n}\r\n\r\nexport interface EntityScheduleItemValue {\r\n id: number;\r\n name: string;\r\n levelDataId?: number;\r\n parentId?: number | null;\r\n status?: string | null;\r\n plannedStart?: string | null;\r\n plannedFinish?: string | null;\r\n moduleKey?: string;\r\n itemType?: string;\r\n}\r\n\r\n/** One cell of an `EntityList` row. Values are always sent as strings. */\r\nexport interface EntityListValueItem {\r\n propertyKey: string;\r\n rawValue?: string | null;\r\n}\r\n\r\n/** One row of an `EntityList` value. */\r\nexport interface EntityListRowValue {\r\n rowId?: string;\r\n entityId?: number;\r\n values?: EntityListValueItem[];\r\n}\r\n\r\n/**\r\n * The stored `EntityList` payload, as the backend renders it. `rows` is the\r\n * only part this view type displays — `entityIds` and the operation-marker\r\n * arrays exist for the writable runtime, not for reading.\r\n */\r\nexport interface EntityListEntityValue {\r\n entityIds?: number[];\r\n rows?: EntityListRowValue[];\r\n}\r\n\r\n/** A `{ en, ar }` pair, as the backend's `Translatable` serializes. */\r\nexport interface EntityListTranslatable {\r\n en?: string | null;\r\n ar?: string | null;\r\n}\r\n\r\n/**\r\n * The source property definition a Local list captured when its schema was\r\n * published (`PropertyDefinitionReadDto`). Server-owned and response-only: the\r\n * backend never trusts one sent back, and pins it so saved values stay\r\n * readable after the source field or module changes or is deleted.\r\n */\r\nexport interface EntityListLocalFieldDefinition {\r\n key: string;\r\n name?: string | null;\r\n nameEn?: string | null;\r\n nameAr?: string | null;\r\n viewType: string;\r\n isRequired?: boolean;\r\n isTranslatable?: boolean;\r\n configuration?: Record<string, unknown> | string | null;\r\n}\r\n\r\n/** A field's share of a row, as the form builder sizes it: ¼, ½ or full. */\r\nexport type EntityListLocalFieldWidth = '25' | '50' | '100';\r\n\r\n/**\r\n * One field of a Local list's schema. `id` is the stable local identity cells\r\n * are keyed by — a UUID, not the source property id. `label` is an optional\r\n * local override of the source label, and `required` is local to the list.\r\n */\r\nexport interface EntityListLocalSchemaField {\r\n id?: string;\r\n sourceKey: string;\r\n label?: EntityListTranslatable | null;\r\n required?: boolean;\r\n hidden?: boolean;\r\n order?: number;\r\n /**\r\n * The field's size in the row dialog. Sent by the configuration screen but\r\n * **not yet stored by the backend** (`LocalEntityListField` has no such\r\n * member), so it is absent from what comes back and the dialog falls back\r\n * to its default until the backend adds it.\r\n */\r\n width?: EntityListLocalFieldWidth | null;\r\n definition?: EntityListLocalFieldDefinition | null;\r\n}\r\n\r\n/**\r\n * A published Local schema. `version` is a UUID that changes whenever the\r\n * field set does; every mutation names the version it was built against.\r\n */\r\nexport interface EntityListLocalSchema {\r\n lineageId?: string;\r\n version?: string;\r\n fields: EntityListLocalSchemaField[];\r\n}\r\n\r\n/** One cell of a Local row. `value` is the rendered counterpart, read-only. */\r\nexport interface EntityListLocalCell {\r\n fieldId: string;\r\n rawValue: string | null;\r\n value?: unknown;\r\n}\r\n\r\n/** One Local row. `rowId` is a client-generated UUID, not a record id. */\r\nexport interface EntityListLocalRow {\r\n rowId: string;\r\n order: number;\r\n version: number;\r\n cells: EntityListLocalCell[];\r\n}\r\n\r\n/**\r\n * A Local `EntityList` value (`storageMode: \"Local\"`): rows owned by the parent\r\n * record, stored inside it rather than as records of the source module.\r\n *\r\n * Arrives from `process-form-load` as the *projected* document — current\r\n * versions, rendered cells, and `schema` with hidden fields already removed —\r\n * and leaves as a *mutation* carrying only what changed, a fresh `mutationId`,\r\n * and no `schema`. See `.github/instructions/properties/EntityList.md`.\r\n */\r\nexport interface EntityListLocalDocument {\r\n storageMode: 'Local';\r\n formatVersion: number;\r\n schemaVersion: string;\r\n version: number;\r\n mutationId?: string;\r\n localRows: EntityListLocalRow[];\r\n deletedRowIds?: string[];\r\n /** Response-only: the schema the rows were projected against. */\r\n schema?: EntityListLocalSchema | null;\r\n}\r\n\r\n/** Whether a stored or rendered `EntityList` value is a Local document. */\r\nexport function isEntityListLocalDocument(\r\n value: unknown,\r\n): value is EntityListLocalDocument {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n !Array.isArray(value) &&\r\n (value as { storageMode?: unknown }).storageMode === 'Local'\r\n );\r\n}\r\n\r\n/** One source value of a selected record: stored scalar plus rendered value. */\r\nexport interface EntityListSelectionRecordValue {\r\n propertyKey: string;\r\n rawValue?: string | null;\r\n value?: unknown;\r\n}\r\n\r\n/** A selected source record, with the configured read fields' values. */\r\nexport interface EntityListSelectionRecord {\r\n entityId: number;\r\n values: EntityListSelectionRecordValue[];\r\n}\r\n\r\n/**\r\n * A Selected `EntityList` value (`recordMode: \"Selected\"`): the source records\r\n * the user picked, by id. Selecting never creates, edits or deletes a source\r\n * record.\r\n *\r\n * Arrives from `process-form-load` as the projected document — `records`\r\n * rendered for display, `unavailableIds` for chosen records the user can no\r\n * longer see — and leaves as a *mutation* carrying only `recordMode`,\r\n * `version`, `mutationId` and the full replacement `entityIds`. See\r\n * `.github/instructions/properties/EntityList.md`.\r\n */\r\nexport interface EntityListSelectionDocument {\r\n recordMode: 'Selected';\r\n version: number;\r\n mutationId?: string;\r\n entityIds: number[];\r\n /** Response-only: the selected records, rendered for display. */\r\n records?: EntityListSelectionRecord[];\r\n /** Response-only: server-captured values; never replayed as a write. */\r\n snapshot?: unknown;\r\n /** Response-only: chosen ids whose record is deleted or no longer visible. */\r\n unavailableIds?: number[];\r\n}\r\n\r\n/** Whether a stored or rendered `EntityList` value is a Selected document. */\r\nexport function isEntityListSelectionDocument(\r\n value: unknown,\r\n): value is EntityListSelectionDocument {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n !Array.isArray(value) &&\r\n (value as { recordMode?: unknown }).recordMode === 'Selected'\r\n );\r\n}\r\n\r\n/**\r\n * One field definition of an inline `EntityList`, from its property\r\n * configuration's `inlineFields`. This is the only description of the nested\r\n * columns: the value itself carries bare keys.\r\n */\r\nexport interface EntityListInlineFieldMeta {\r\n key: string;\r\n viewType?: string;\r\n order?: number;\r\n required?: boolean;\r\n configuration?: EntityPropertyConfiguration;\r\n}\r\n\r\n/**\r\n * Catalog metadata for a property nested inside another property's value.\r\n * Mirrors the top-level catalog property shape, which the backend sends under\r\n * `catalog.nestedProperties` keyed by the owning property key. Only\r\n * `LookupModuleCheckList` values carry nested properties today.\r\n */\r\nexport interface EntityNestedPropertyMeta {\r\n id?: number;\r\n key: string;\r\n normalizedKey?: string;\r\n label: string;\r\n viewType: EntityViewType;\r\n configuration?: EntityPropertyConfiguration;\r\n order?: number;\r\n}\r\n\r\nexport interface EntityData {\r\n id?: number;\r\n propertyId?: number;\r\n key?: string;\r\n normalizedKey?: string;\r\n name?: string;\r\n rawValue?: string;\r\n /**\r\n * The colour the backend resolved for *this value*, from the value cell's own\r\n * `color` field.\r\n *\r\n * Distinct from `configuration.color`, which is a colour the configuration\r\n * declares for every value alike. This one is per-record: the backend\r\n * evaluates a Percentage property's colour rules — or, in `property` mode,\r\n * the record's colour-bearing source property — and ships the winner here.\r\n * It is therefore the most specific answer available and outranks anything\r\n * derived from the configuration.\r\n *\r\n * Status and Lookup cells repeat the same colour inside `value`, which is\r\n * where those renderers already read it; a Percentage's `value` is a\r\n * formatted string with nowhere to hang a colour, which is why this exists.\r\n */\r\n color?: string;\r\n order?: number;\r\n propertyConfiguration?: EntityPropertyConfiguration;\r\n /**\r\n * Catalog metadata for the properties captured inside `value`. The stored\r\n * checklist value only carries property keys, so without this the nested\r\n * props have no label and no view type to render with.\r\n */\r\n nestedProperties?: EntityNestedPropertyMeta[];\r\n value:\r\n | string\r\n | EntityTranslatableTextValue\r\n | EntityStatusValue\r\n | EntityUserValue\r\n | EntityMultiUserValue\r\n | EntityLookupValue\r\n | EntityMultiLookupValue\r\n | EntityPhaseGateValue\r\n | EntityPerformanceScoreValue\r\n | EntityAttachmentValue\r\n | EntityLocationValue\r\n | EntityConnectionValue\r\n | EntityScheduleItemValue[]\r\n | EntityLookupCheckListValue\r\n | EntityLookupCheckListItem[]\r\n | LeafDetailsEntityValue\r\n | LeafDetailsEntityCollectionValue\r\n | LeafDetailsRuntimeValue\r\n | EntityListEntityValue;\r\n viewType: EntityViewType;\r\n type?: string;\r\n configuration?: EntityConfiguration;\r\n /** Present on submitted ChangeRequest records — frozen old→new snapshot. */\r\n comparison?: PropertyValueComparison;\r\n /**\r\n * The record's runtime ids, set by a host that renders the value outside\r\n * any `EntityRuntimeContextStore` — a table cell. `EntityList` reads it to\r\n * render its full list in the drawer, as a record preview does inline.\r\n */\r\n runtimeContext?: EntityRuntimeContext | null;\r\n}\r\n\r\n/** Emitted when an entity is resized via the drag handle */\r\nexport interface EntityResizeEvent {\r\n entity: EntityData;\r\n previousSize: EntitySize;\r\n newSize: EntitySize;\r\n}\r\n","import type {\r\n EntityData,\r\n EntitySectionConfig,\r\n EntitySectionLabel,\r\n} from './entity.model';\r\n\r\n/**\r\n * A section is persisted/transported as an ordinary display item whose\r\n * `propertyKey` carries this sentinel prefix instead of a real property key\r\n * (mirrors the LeafDetails synthetic-key convention). Both the customization\r\n * builder and the runtime renderer recognize it, so the constant lives here in\r\n * the shared entities layer rather than in either consumer.\r\n */\r\nexport const SECTION_KEY_PREFIX = '__section__::';\r\n\r\n/** True when a display item's key denotes a section marker. */\r\nexport function isSectionKey(key?: string | null): boolean {\r\n return typeof key === 'string' && key.startsWith(SECTION_KEY_PREFIX);\r\n}\r\n\r\n/** Mints a unique section marker key. */\r\nexport function buildSectionKey(): string {\r\n return `${SECTION_KEY_PREFIX}${crypto.randomUUID()}`;\r\n}\r\n\r\n/**\r\n * Resolves a localized label (`{ en, ar }`) for the given language, falling\r\n * back across locales. Returns '' when nothing is set.\r\n */\r\nexport function resolveLocalizedLabel(\r\n label: EntitySectionLabel | null | undefined,\r\n lang?: string,\r\n): string {\r\n if (!label) return '';\r\n const primary = lang === 'ar' ? label.ar : label.en;\r\n return (primary || label.en || label.ar || '').trim();\r\n}\r\n\r\n/**\r\n * A run of entities that belong to the same section. `section` is the marker\r\n * entity (`viewType: 'Section'`) whose title heads the group, or `null` for the\r\n * leading run of entities that appear before the first marker (rendered bare,\r\n * with no box — so a card with no markers looks exactly like it did before\r\n * sections existed).\r\n */\r\nexport interface EntitySectionGroup {\r\n section: EntityData | null;\r\n entities: EntityData[];\r\n}\r\n\r\n/** True when the entity is a `Section` layout marker rather than a value. */\r\nexport function isEntitySection(\r\n entity: EntityData | null | undefined,\r\n): entity is EntityData {\r\n return entity?.viewType === 'Section';\r\n}\r\n\r\n/**\r\n * Splits a flat, order-sorted entity list into section groups. Membership is\r\n * purely positional: each entity belongs to whichever `Section` marker precedes\r\n * it. Pass the output of `buildDisplayEntities` (already sorted by `order`).\r\n *\r\n * Zero markers → a single `{ section: null }` group holding everything, so the\r\n * bare-grid rendering is unchanged. Empty leading/trailing runs are dropped.\r\n */\r\nexport function groupEntitiesIntoSections(\r\n entities: EntityData[],\r\n): EntitySectionGroup[] {\r\n const groups: EntitySectionGroup[] = [];\r\n let current: EntitySectionGroup = { section: null, entities: [] };\r\n\r\n const flush = (): void => {\r\n if (current.section || current.entities.length > 0) {\r\n groups.push(current);\r\n }\r\n };\r\n\r\n for (const entity of entities) {\r\n if (isEntitySection(entity)) {\r\n flush();\r\n current = { section: entity, entities: [] };\r\n } else {\r\n current.entities.push(entity);\r\n }\r\n }\r\n flush();\r\n\r\n return groups;\r\n}\r\n\r\n/**\r\n * Resolves a section marker's display label for the given language, falling\r\n * back across locales and finally to the entity's `name`.\r\n */\r\nexport function getEntitySectionTitle(\r\n section: EntityData | null | undefined,\r\n lang?: string,\r\n): string {\r\n if (!section) return '';\r\n const label = (section.configuration as EntitySectionConfig | undefined)\r\n ?.label;\r\n return resolveLocalizedLabel(label, lang) || (section.name ?? '');\r\n}\r\n","import {\r\n EntityConfiguration,\r\n EntityLabelPosition,\r\n EntitySectionLabel,\r\n} from './entity.model';\r\nimport { resolveLocalizedLabel } from './entity-sections.util';\r\n\r\nexport const ENTITY_EMPTY_VALUE_PLACEHOLDER = '_';\r\n\r\nexport function isValueMissing(value: unknown): boolean {\r\n if (value === null || value === undefined) {\r\n return true;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n return value.trim().length === 0;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Serializes a backend `raw` cell into the string `EntityData.rawValue` holds.\r\n *\r\n * Object raws — the Connection payload, the LeafDetails summary — must be\r\n * JSON-encoded: `String(obj)` yields \"[object Object]\" and silently destroys\r\n * the payload the display layer needs to expand them. Primitives keep plain\r\n * `String()` so dates/percentages/checkboxes are not wrapped in quotes.\r\n */\r\nexport function serializeEntityRawValue(raw: unknown): string | undefined {\r\n if (raw === null || raw === undefined) {\r\n return undefined;\r\n }\r\n\r\n if (typeof raw === 'object') {\r\n try {\r\n return JSON.stringify(raw);\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n\r\n return String(raw);\r\n}\r\n\r\n/**\r\n * Reads the colour the backend resolved for a value cell.\r\n *\r\n * The cell carries it as a sibling of `raw`/`value` — `{ raw: \"22\", value:\r\n * \"22%\", color: \"#FF0000\" }` — because for a Percentage the value is a\r\n * formatted string with nowhere to hang a colour on. Status and Lookup cells\r\n * repeat it inside `value`, where those renderers already read it.\r\n *\r\n * Typed as `unknown` on purpose: every fetch-cell interface in the consuming\r\n * packages carries an index signature, so a mistyped or absent `color` is a\r\n * runtime possibility rather than a compile error.\r\n */\r\nexport function readEntityValueColor(color: unknown): string | undefined {\r\n if (typeof color !== 'string') {\r\n return undefined;\r\n }\r\n\r\n const trimmed = color.trim();\r\n return trimmed || undefined;\r\n}\r\n\r\nexport function displayOrPlaceholder(value: unknown): string {\r\n if (isValueMissing(value)) {\r\n return ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n }\r\n\r\n return String(value);\r\n}\r\n\r\n/**\r\n * Text/LongText values are a plain string, except for translatable\r\n * properties, where the backend sends `{ display, ar?, en? }` instead.\r\n * Unwraps either shape to the string to render.\r\n */\r\nexport function extractDisplayText(value: unknown): string | null {\r\n if (typeof value === 'string') {\r\n return value;\r\n }\r\n\r\n if (\r\n value &&\r\n typeof value === 'object' &&\r\n typeof (value as { display?: unknown }).display === 'string'\r\n ) {\r\n return (value as { display: string }).display;\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport function isEntityLabelHidden(\r\n configuration?: EntityConfiguration | null,\r\n): boolean {\r\n const config = configuration as\r\n | {\r\n hideLabel?: boolean;\r\n hideName?: boolean;\r\n }\r\n | null\r\n | undefined;\r\n\r\n return config?.hideLabel ?? config?.hideName ?? false;\r\n}\r\n\r\nexport function isEntityAlignEnd(\r\n configuration?: EntityConfiguration | null,\r\n): boolean {\r\n const config = configuration as { alignEnd?: boolean } | null | undefined;\r\n return config?.alignEnd ?? false;\r\n}\r\n\r\n/**\r\n * The admin-authored note attached to a property in the customization drawer\r\n * (`configuration.info`), resolved for the active language.\r\n *\r\n * Returns `''` when there is no note, which is what the renderer keys off to\r\n * decide whether the entity gets an info affordance at all. The drawer omits\r\n * the key entirely rather than writing an empty object, so \"absent\" and \"blank\"\r\n * collapse to the same answer here on purpose.\r\n */\r\nexport function resolveEntityInfo(\r\n configuration?: EntityConfiguration | null,\r\n lang?: string,\r\n): string {\r\n const config = configuration as\r\n | { info?: EntitySectionLabel }\r\n | null\r\n | undefined;\r\n\r\n return resolveLocalizedLabel(config?.info, lang);\r\n}\r\n\r\n/**\r\n * The product default: label above value.\r\n *\r\n * It used to be `bottom`, which is why Portfolio and Program cards rendered\r\n * \"06/07/2026\" then \"Start Date\" while Project cards — whose properties had\r\n * been through the property-configuration drawer, and so carry an explicit\r\n * `labelPosition` — rendered the label first. Two orders inside one Explore\r\n * module, reachable by clicking a different item in the same sidebar\r\n * (finding M-13). Label-first reads better down a column of mixed field types,\r\n * so it is what every unconfigured property now gets.\r\n *\r\n * An explicit configuration still wins: an administrator who deliberately\r\n * chose value-above-label for a property keeps it.\r\n */\r\nexport function resolveEntityLabelPosition(\r\n configuration?: EntityConfiguration | null,\r\n): EntityLabelPosition {\r\n const config = configuration as\r\n | {\r\n labelPosition?: EntityLabelPosition;\r\n labelPostion?: EntityLabelPosition;\r\n }\r\n | null\r\n | undefined;\r\n\r\n return config?.labelPosition ?? config?.labelPostion ?? 'top';\r\n}\r\n\r\n/**\r\n * Rewrites a localised numeric string into something `parseFloat` can read.\r\n *\r\n * `rawNumericValue` can fall back to the already-formatted display string, so\r\n * whatever `Intl.NumberFormat` produced has to survive a round trip. Under\r\n * `ar` that is harmless (Latin digits plus invisible direction marks), but\r\n * `ar-SA` renders Arabic-Indic digits and an Arabic decimal separator, which\r\n * parse to NaN — the bar would silently disappear rather than show a value.\r\n *\r\n * Handles Arabic-Indic (U+0660-0669) and Eastern Arabic-Indic (U+06F0-06F9)\r\n * digits, the Arabic decimal separator, thousands separators, and the\r\n * bidirectional marks Intl inserts around the percent sign.\r\n */\r\nexport function normalizeNumerals(input: string): string {\r\n return input\r\n .replace(/[]/g, '')\r\n .replace(/[٠-٩]/g, (d) => String(d.charCodeAt(0) - 0x0660))\r\n .replace(/[۰-۹]/g, (d) => String(d.charCodeAt(0) - 0x06f0))\r\n .replace(/[٫]/g, '.')\r\n .replace(/[٬ ]/g, '');\r\n}\r\n","import type { EntityData, EntityUserValue } from './entity.model';\r\n\r\ninterface StakeholderNameColumn {\r\n key: string;\r\n normalizedKey?: string;\r\n}\r\n\r\nconst INTERNAL_NAME_KEY = 'internal_username';\r\nconst EXTERNAL_NAME_KEY = 'external_username';\r\n\r\nfunction matchesKey(\r\n field: { key?: string; normalizedKey?: string },\r\n key: string,\r\n): boolean {\r\n return field.normalizedKey === key || field.key === key;\r\n}\r\n\r\n/** Keep the name slot's identity/layout, and use the populated name's renderer. */\r\nfunction projectName(internal: EntityData, external: EntityData): EntityData {\r\n const isEmptyUser =\r\n internal.viewType === 'User' &&\r\n internal.value != null &&\r\n typeof internal.value === 'object' &&\r\n !(internal.value as EntityUserValue).userName?.trim();\r\n if (internal.value != null && internal.value !== '' && !isEmptyUser) {\r\n return internal;\r\n }\r\n if (external.value == null || external.value === '') return internal;\r\n return {\r\n ...internal,\r\n rawValue: external.rawValue,\r\n value: external.value,\r\n viewType: external.viewType,\r\n type: external.type,\r\n propertyConfiguration: external.propertyConfiguration,\r\n nestedProperties: external.nestedProperties,\r\n comparison: external.comparison,\r\n color: external.color,\r\n };\r\n}\r\n\r\n/** Stakeholder cards show the two mutually exclusive names in one name slot. */\r\nexport function mergeStakeholderNameEntities(\r\n entities: EntityData[],\r\n): EntityData[] {\r\n const internal = entities.find((entity) =>\r\n matchesKey(entity, INTERNAL_NAME_KEY),\r\n );\r\n const external = entities.find((entity) =>\r\n matchesKey(entity, EXTERNAL_NAME_KEY),\r\n );\r\n if (!internal || !external) return entities;\r\n\r\n const name = projectName(internal, external);\r\n return entities.flatMap((entity) =>\r\n entity === external ? [] : [entity === internal ? name : entity],\r\n );\r\n}\r\n\r\n/** Hide the duplicate only when both stakeholder name fields are displayed. */\r\nexport function mergeStakeholderNameColumns<T extends StakeholderNameColumn>(\r\n columns: T[],\r\n): T[] {\r\n if (!columns.some((column) => matchesKey(column, INTERNAL_NAME_KEY))) {\r\n return columns;\r\n }\r\n if (!columns.some((column) => matchesKey(column, EXTERNAL_NAME_KEY))) {\r\n return columns;\r\n }\r\n return columns.filter((column) => !matchesKey(column, EXTERNAL_NAME_KEY));\r\n}\r\n\r\n/** Presentation only: retain the original cells and row edit/submission maps. */\r\nexport function mergeStakeholderNameRows<T extends Record<string, unknown>>(\r\n columns: StakeholderNameColumn[],\r\n rows: T[],\r\n): T[] {\r\n const internal = columns.find((column) =>\r\n matchesKey(column, INTERNAL_NAME_KEY),\r\n );\r\n const external = columns.find((column) =>\r\n matchesKey(column, EXTERNAL_NAME_KEY),\r\n );\r\n if (!internal || !external) return rows;\r\n\r\n return rows.map((row) => {\r\n const internalCell = row[internal.key] as EntityData | undefined;\r\n const externalCell = row[external.key] as EntityData | undefined;\r\n if (!internalCell || !externalCell) return row;\r\n const name = projectName(internalCell, externalCell);\r\n return name === internalCell ? row : { ...row, [internal.key]: name };\r\n });\r\n}\r\n","import { Injectable, InjectionToken, Type, signal } from '@angular/core';\r\n\r\n/**\r\n * The runtime ids an entity renderer needs to fetch anything of its own.\r\n *\r\n * A rendered `EntityData` describes one *value*; it carries no idea of which\r\n * level or level-data row it was read from. Most view types never need one —\r\n * the value is the whole answer. `EntityList` is the exception: a module-backed\r\n * list's rows live in another module and are scoped by the owning level-data\r\n * row, so the renderer cannot resolve them from the value alone.\r\n *\r\n * Hosts that know these ids publish them through `EntityRuntimeContextStore`;\r\n * hosts that do not simply leave it unprovided and every renderer keeps its\r\n * value-only behaviour.\r\n */\r\nexport interface EntityRuntimeContext {\r\n /** Owning level id — addresses the per-level configuration override. */\r\n levelId?: number | string | null;\r\n /** Owning level-data row — what related records are scoped to. */\r\n levelDataId?: number | string | null;\r\n /**\r\n * The record that owns the list, for the reads addressed to it rather than\r\n * to its level — the saved list's `entity-lists/comparison`. Set by a host\r\n * that knows the row it renders (a table cell); a record preview leaves it.\r\n */\r\n ownerKind?: 'ModuleData' | 'LevelData' | null;\r\n ownerId?: number | null;\r\n}\r\n\r\n/**\r\n * Publishes an `EntityRuntimeContext` to a subtree of entity renderers.\r\n *\r\n * Deliberately **not** `providedIn: 'root'`: an unprovided store is the signal\r\n * that the host has no runtime context, and every consumer injects it\r\n * `{ optional: true }`. Providing it on a component scopes it to that\r\n * component's view — which is also how a nested renderer shuts the context\r\n * off for its own children (see `EntityListField`, whose table cells must not\r\n * re-enter the fetching path).\r\n */\r\n@Injectable()\r\nexport class EntityRuntimeContextStore {\r\n readonly context = signal<EntityRuntimeContext | null>(null);\r\n}\r\n\r\n/**\r\n * The component `mt-entity-list-preview` renders inline instead of its\r\n * count-and-drawer trigger, when a runtime context is available.\r\n *\r\n * Indirection rather than a direct import because the real renderer is\r\n * `mt-entity-list-field` (`@masterteam/components/business-fields`), which\r\n * builds on `mt-table` — and `table` already imports `entities`, so importing\r\n * it back here would make the two entry points circular. The provider lives\r\n * with the component: `provideEntityListTablePreview()`.\r\n *\r\n * The component is created with `NgComponentOutlet` and receives\r\n * `propertyId`, `runtimeContext`, `configuration`, `initialValue`, `readonly`\r\n * and `label` as inputs.\r\n */\r\nexport const ENTITY_LIST_TABLE_COMPONENT = new InjectionToken<Type<unknown>>(\r\n 'ENTITY_LIST_TABLE_COMPONENT',\r\n);\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\r\nimport { Icon } from '@masterteam/icons';\r\nimport {\r\n isEntityAlignEnd,\r\n isEntityLabelHidden,\r\n resolveEntityLabelPosition,\r\n} from '../entity-display.utils';\r\nimport { EntityConfiguration } from '../entity.model';\r\n\r\ntype EntityFieldGap = 'compact' | 'normal' | 'relaxed';\r\n\r\n@Component({\r\n selector: 'mt-entity-field',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [TruncateTooltip, Icon],\r\n template: `\r\n <div [class]=\"containerClass()\">\r\n <div [class]=\"contentContainerClass()\">\r\n <ng-content />\r\n </div>\r\n @if (!hideLabel()) {\r\n <div [class]=\"labelContainerClass()\">\r\n @if (labelIconName(); as iconName) {\r\n <mt-icon [icon]=\"iconName\" size=\"xs\" class=\"shrink-0\" />\r\n }\r\n <span\r\n class=\"block min-w-0 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n {{ label() }}\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n `,\r\n host: {\r\n class: 'block min-w-0 w-full',\r\n },\r\n})\r\nexport class EntityField {\r\n readonly label = input<string>('');\r\n readonly labelIconName = input<string | null>(null);\r\n readonly configuration = input<EntityConfiguration | null | undefined>();\r\n readonly gap = input<EntityFieldGap>('compact');\r\n\r\n readonly hideLabel = computed(() =>\r\n isEntityLabelHidden(this.configuration()),\r\n );\r\n\r\n readonly labelPosition = computed(() =>\r\n resolveEntityLabelPosition(this.configuration()),\r\n );\r\n\r\n readonly labelContainerClass = computed(() => {\r\n const justifyClass = isEntityAlignEnd(this.configuration())\r\n ? 'justify-end'\r\n : '';\r\n\r\n return `flex min-w-0 max-w-full items-center gap-1 text-sm text-gray-500 ${justifyClass}`.trimEnd();\r\n });\r\n\r\n readonly contentContainerClass = computed(() => {\r\n const alignClass = isEntityAlignEnd(this.configuration())\r\n ? 'self-end'\r\n : 'self-stretch';\r\n\r\n return `min-w-0 max-w-full ${alignClass}`;\r\n });\r\n\r\n readonly containerClass = computed(() => {\r\n const gapClass =\r\n this.gap() === 'relaxed'\r\n ? 'gap-2'\r\n : this.gap() === 'normal'\r\n ? 'gap-1'\r\n : 'gap-0.5';\r\n\r\n const directionClass =\r\n this.labelPosition() === 'top' ? 'flex-col-reverse' : 'flex-col';\r\n\r\n const alignClass = isEntityAlignEnd(this.configuration())\r\n ? 'items-end'\r\n : '';\r\n\r\n return `flex min-w-0 ${directionClass} ${gapClass} ${alignClass}`.trimEnd();\r\n });\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\r\nimport {\r\n displayOrPlaceholder,\r\n extractDisplayText,\r\n} from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityData } from '../entity.model';\r\n\r\n@Component({\r\n selector: 'mt-entity-text',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField, TruncateTooltip],\r\n templateUrl: './entity-text.html',\r\n})\r\nexport class EntityText {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<string>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n readonly displayValue = computed(() => {\r\n const d = this.data();\r\n if (d) {\r\n return displayOrPlaceholder(extractDisplayText(d.value));\r\n }\r\n return displayOrPlaceholder(this.value());\r\n });\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <!--\r\n Two lines before the ellipsis, not one. Portfolio and project names were\r\n being cut mid-word on the Explore board (\"Smart City Infrastructure Po…\"),\r\n which makes similarly-titled records indistinguishable without opening each\r\n one (finding H-06). `line-clamp-2` still ellipsises what genuinely does not\r\n fit, and `mtTruncateTooltip` reads `scrollHeight > clientHeight`, so the\r\n tooltip keeps working for the clamped case exactly as it did for the\r\n single-line one.\r\n -->\r\n <div\r\n class=\"min-w-0 max-w-full line-clamp-2 break-words text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n","import {\r\n afterNextRender,\r\n DestroyRef,\r\n Directive,\r\n ElementRef,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\n\r\n/** Smallest size the text may shrink to before ellipsis takes over, in px. */\r\nconst MIN_FONT_PX = 11;\r\n/** Each pass down the ramp. Small enough to look deliberate, not stepped. */\r\nconst STEP_PX = 0.5;\r\n\r\n/**\r\n * Shrinks an atomic value a little rather than letting it truncate.\r\n *\r\n * A date and an amount are single indivisible facts: `2026/08/16` cut to\r\n * `2026/08…` has lost the day, and `100,000 SAR` cut to `100,000 …` has lost\r\n * the currency — which is the one part a reader cannot infer. Prose survives an\r\n * ellipsis; these do not, so they get one lever before it.\r\n *\r\n * Why measure instead of thresholding. The first pass at this capped currency\r\n * by magnitude — compact anything above 100,000 — with the threshold read off\r\n * one measured card slot. But slot width is a property of the card layout, not\r\n * of the number: the three-across boxes on an Explore card are far narrower\r\n * than the slot that was measured, so `100,000 SAR` and `50,000 SAR` sat under\r\n * the threshold and truncated anyway. No constant can know the width it has.\r\n * This asks the element.\r\n *\r\n * The element keeps its `truncate`, so anything still too long at the floor\r\n * ellipsizes exactly as before — with the tooltip callers already attach\r\n * carrying the full value. Shrinking is a nudge, never the whole answer.\r\n */\r\n@Directive({\r\n selector: '[mtFitText]',\r\n standalone: true,\r\n})\r\nexport class FitText {\r\n /** Set false to leave a particular instance alone. */\r\n readonly mtFitText = input(true, {\r\n transform: (value: unknown) => value !== false && value !== 'false',\r\n });\r\n\r\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private readonly destroyRef = inject(DestroyRef);\r\n private basePx = 0;\r\n private frame = 0;\r\n private resizeObserver?: ResizeObserver;\r\n private mutationObserver?: MutationObserver;\r\n\r\n constructor() {\r\n afterNextRender(() => {\r\n const el = this.host.nativeElement;\r\n this.basePx = parseFloat(getComputedStyle(el).fontSize) || 0;\r\n if (!this.basePx) {\r\n return;\r\n }\r\n\r\n if (typeof ResizeObserver !== 'undefined') {\r\n this.resizeObserver = new ResizeObserver(() => this.schedule());\r\n this.resizeObserver.observe(el);\r\n }\r\n // The value itself changes without the box changing size — a re-fetch,\r\n // a locale switch, an edit committed in place.\r\n this.mutationObserver = new MutationObserver(() => this.schedule());\r\n this.mutationObserver.observe(el, {\r\n characterData: true,\r\n childList: true,\r\n subtree: true,\r\n });\r\n\r\n this.schedule();\r\n });\r\n\r\n this.destroyRef.onDestroy(() => {\r\n this.resizeObserver?.disconnect();\r\n this.mutationObserver?.disconnect();\r\n if (this.frame) {\r\n cancelAnimationFrame(this.frame);\r\n }\r\n });\r\n }\r\n\r\n private schedule(): void {\r\n if (this.frame) {\r\n cancelAnimationFrame(this.frame);\r\n }\r\n this.frame = requestAnimationFrame(() => {\r\n this.frame = 0;\r\n this.fit();\r\n });\r\n }\r\n\r\n private fit(): void {\r\n const el = this.host.nativeElement;\r\n if (!this.mtFitText() || !this.basePx) {\r\n el.style.removeProperty('font-size');\r\n return;\r\n }\r\n\r\n // Always measure from the base size: the box may have grown back, and a\r\n // value that once needed shrinking should return to full size when it fits.\r\n el.style.fontSize = `${this.basePx}px`;\r\n if (el.clientWidth === 0) {\r\n return;\r\n }\r\n\r\n let size = this.basePx;\r\n while (el.scrollWidth > el.clientWidth && size > MIN_FONT_PX) {\r\n size = Math.max(MIN_FONT_PX, size - STEP_PX);\r\n el.style.fontSize = `${size}px`;\r\n }\r\n\r\n if (size === this.basePx) {\r\n el.style.removeProperty('font-size');\r\n }\r\n }\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport {\r\n MTDateFormatPipe,\r\n type MTDateFormatType,\r\n} from '@masterteam/components';\r\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityData } from '../entity.model';\r\nimport { FitText } from '../fit-text.directive';\r\n\r\n@Component({\r\n selector: 'mt-entity-date',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField, TruncateTooltip, MTDateFormatPipe, FitText],\r\n templateUrl: './entity-date.html',\r\n})\r\nexport class EntityDate {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<unknown>();\r\n readonly viewType = input<'Date' | 'DateTime' | 'Time'>('Date');\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n /**\r\n * `Time` carries a wall-clock value (`HH:mm:ss`) with no date and no zone, so\r\n * `mtDateFormat` renders it as stored instead of shifting it into the\r\n * viewer's timezone the way its `DateTime` sibling is shifted.\r\n */\r\n readonly resolvedViewType = computed<MTDateFormatType>(() => {\r\n switch (this.data()?.viewType ?? this.viewType()) {\r\n case 'DateTime':\r\n return 'dateTime';\r\n case 'Time':\r\n return 'time';\r\n default:\r\n return 'date';\r\n }\r\n });\r\n readonly displayValue = computed(\r\n () => this.data()?.rawValue ?? this.data()?.value ?? this.value(),\r\n );\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <span\r\n class=\"block min-w-0 truncate text-sm font-semibold tabular-nums whitespace-nowrap\"\r\n mtFitText\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n @if (displayValue()) {\r\n {{ displayValue() | mtDateFormat: resolvedViewType() }}\r\n } @else {\r\n -\r\n }\r\n </span>\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport {\r\n displayOrPlaceholder,\r\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\r\n} from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityData, EntityStatusValue } from '../entity.model';\r\n\r\n@Component({\r\n selector: 'mt-entity-status',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField],\r\n templateUrl: './entity-status.html',\r\n})\r\nexport class EntityStatus {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<EntityStatusValue>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n readonly statusValue = computed<EntityStatusValue | null>(() => {\r\n const d = this.data();\r\n if (d && typeof d.value === 'object' && d.value !== null) {\r\n return d.value as EntityStatusValue;\r\n }\r\n return this.value() ?? null;\r\n });\r\n\r\n readonly badgeStyle = computed(() => {\r\n const status = this.statusValue();\r\n if (!status?.color) return {};\r\n return {\r\n color: status.color,\r\n backgroundColor: this.hexToRgba(status.color, 0.12),\r\n };\r\n });\r\n\r\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n\r\n readonly statusLabel = computed(() =>\r\n displayOrPlaceholder(this.statusValue()?.display),\r\n );\r\n\r\n private hexToRgba(hex: string, alpha: number): string {\r\n const r = parseInt(hex.slice(1, 3), 16);\r\n const g = parseInt(hex.slice(3, 5), 16);\r\n const b = parseInt(hex.slice(5, 7), 16);\r\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\r\n }\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (statusValue(); as status) {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit\"\r\n [style]=\"badgeStyle()\"\r\n >\r\n {{ statusLabel() }}\r\n </span>\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","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\nimport {\r\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\r\n extractDisplayText,\r\n} from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityData } from '../entity.model';\r\n\r\n/**\r\n * Renders an `Icon` view-type value — a stored icon key such as\r\n * `custom.strategy` — as the actual glyph via `mt-icon`, rather than printing\r\n * the raw key as text (which is what the plain-text fallback used to do before\r\n * `Icon` was a distinct view type).\r\n */\r\n@Component({\r\n selector: 'mt-entity-icon',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField, Icon],\r\n templateUrl: './entity-icon.html',\r\n})\r\nexport class EntityIcon {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<string>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n\r\n readonly iconName = computed<MTIcon | null>(() => {\r\n const d = this.data();\r\n const raw = d ? extractDisplayText(d.value) : (this.value() ?? null);\r\n return raw ? (raw as MTIcon) : null;\r\n });\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (iconName(); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-2xl\" />\r\n } @else {\r\n <span class=\"text-sm text-gray-500\">{{ emptyLabel }}</span>\r\n }\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n effect,\r\n input,\r\n signal,\r\n untracked,\r\n} from '@angular/core';\r\nimport { HttpContext } from '@angular/common/http';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { Tooltip, TruncateTooltip } from '@masterteam/components/tooltip';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { EntityData, EntityUserConfig, EntityUserValue } from '../entity.model';\r\nimport { SecureImagePipe } from '@masterteam/components/upload-field';\r\nimport { displayOrPlaceholder } from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { REQUEST_CONTEXT } from '@masterteam/components';\r\n\r\n@Component({\r\n selector: 'mt-entity-user',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [\r\n Avatar,\r\n Tooltip,\r\n TruncateTooltip,\r\n Icon,\r\n SecureImagePipe,\r\n EntityField,\r\n TranslocoPipe,\r\n ],\r\n templateUrl: './entity-user.html',\r\n})\r\nexport class EntityUser {\r\n readonly httpContext = new HttpContext().set(REQUEST_CONTEXT, {\r\n useBaseUrl: true,\r\n });\r\n\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n readonly expanded = signal(false);\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? '');\r\n readonly isMultiUser = computed(() => this.data()?.viewType === 'MultiUser');\r\n\r\n /** Resolved user objects from either a User or MultiUser entity value. */\r\n readonly users = computed<EntityUserValue[]>(() => {\r\n const val = this.data()?.value;\r\n const values = Array.isArray(val) ? val : [val];\r\n return values.filter(isEntityUserValue);\r\n });\r\n\r\n readonly maxVisibleUsers = computed(() => {\r\n const configured = Number(this.config().maxVisibleUsers);\r\n return Number.isInteger(configured) && configured > 0 ? configured : 5;\r\n });\r\n\r\n readonly visibleUsers = computed(() => {\r\n const users = this.users();\r\n if (!this.isMultiUser() || this.expanded()) {\r\n return users;\r\n }\r\n\r\n return users.slice(0, this.maxVisibleUsers());\r\n });\r\n\r\n readonly hiddenUserCount = computed(\r\n () => this.users().length - this.visibleUsers().length,\r\n );\r\n\r\n /** First user retained for the existing single-user computed API. */\r\n private readonly userValue = computed(() => this.users()[0] ?? null);\r\n\r\n userNameFor(user: EntityUserValue): string {\r\n return displayOrPlaceholder(user.displayName ?? null);\r\n }\r\n\r\n userPhotoFor(user: EntityUserValue): string {\r\n return user.photoUrl ?? '';\r\n }\r\n\r\n labelTextFor(user: EntityUserValue): string {\r\n return user.name ?? '';\r\n }\r\n\r\n isUnlinkedUser(user: EntityUserValue): boolean {\r\n return user.isLinkedToCurrentApplication === false && !!user.userName;\r\n }\r\n\r\n phoneNumberFor(user: EntityUserValue): string {\r\n return user.phoneNumber ?? '';\r\n }\r\n\r\n emailFor(user: EntityUserValue): string {\r\n return user.email ?? '';\r\n }\r\n\r\n hasContactInfoFor(user: EntityUserValue): boolean {\r\n return (\r\n (this.showPhoneNumber() && !!this.phoneNumberFor(user)) ||\r\n (this.showEmail() && !!this.emailFor(user))\r\n );\r\n }\r\n\r\n readonly emptyUserName = computed(() => displayOrPlaceholder(null));\r\n\r\n readonly rawUserName = computed(() => this.userValue()?.displayName ?? null);\r\n\r\n readonly userName = computed(() => displayOrPlaceholder(this.rawUserName()));\r\n\r\n readonly userPhoto = computed(() => this.userValue()?.photoUrl ?? '');\r\n\r\n readonly labelText = computed(() => this.userValue()?.name ?? '');\r\n\r\n /**\r\n * `true` when the referenced user is no longer linked to the application.\r\n * Drives the inline info badge/tooltip next to the display name.\r\n */\r\n readonly isUnlinked = computed(\r\n () =>\r\n this.userValue()?.isLinkedToCurrentApplication === false &&\r\n this.userValue()?.userName,\r\n );\r\n\r\n // ── Configuration-driven visibility ──\r\n\r\n private readonly config = computed(\r\n () => (this.data()?.configuration as EntityUserConfig) ?? {},\r\n );\r\n\r\n readonly showDisplayName = computed(\r\n () => this.config().showDisplayName ?? true,\r\n );\r\n\r\n readonly showPhoneNumber = computed(\r\n () => this.config().showPhoneNumber ?? false,\r\n );\r\n\r\n readonly showEmail = computed(() => this.config().showEmail ?? false);\r\n\r\n /** When off the avatar is dropped entirely, leaving the name on its own. */\r\n readonly showAvatar = computed(() => this.config().showAvatar ?? true);\r\n\r\n readonly phoneNumber = computed(() => this.userValue()?.phoneNumber ?? '');\r\n\r\n readonly email = computed(() => this.userValue()?.email ?? '');\r\n\r\n readonly hasContactInfo = computed(\r\n () =>\r\n (this.showPhoneNumber() && !!this.phoneNumber()) ||\r\n (this.showEmail() && !!this.email()),\r\n );\r\n\r\n constructor() {\r\n effect(() => {\r\n void this.data()?.value;\r\n untracked(() => this.expanded.set(false));\r\n });\r\n }\r\n\r\n showAllUsers(): void {\r\n this.expanded.set(true);\r\n }\r\n}\r\n\r\nfunction isEntityUserValue(value: unknown): value is EntityUserValue {\r\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\r\n return false;\r\n }\r\n\r\n return 'displayName' in value;\r\n}\r\n","<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 pe-2\"\r\n [class.ps-1]=\"showAvatar()\"\r\n [class.ps-2]=\"!showAvatar()\"\r\n >\r\n @if (showAvatar()) {\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\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 @if (showAvatar()) {\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\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 @if (showAvatar()) {\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 }\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","import { PercentageColorRule } from './entity.model';\r\n\r\n/**\r\n * Anything that can supply a percentage colour: an ordered rule set plus the\r\n * fallback used when no rule matches.\r\n */\r\nexport interface PercentageColorSource {\r\n colorRules?: PercentageColorRule[] | null;\r\n defaultColor?: string | null;\r\n}\r\n\r\n/** A finite number, or null for anything that cannot be compared numerically. */\r\nfunction toFiniteNumber(value: unknown): number | null {\r\n if (value === null || value === undefined || value === '') {\r\n return null;\r\n }\r\n\r\n const parsed =\r\n typeof value === 'number'\r\n ? value\r\n : Number(String(value).replace(/%/g, '').trim());\r\n\r\n return Number.isFinite(parsed) ? parsed : null;\r\n}\r\n\r\n/**\r\n * Whether `value` falls inside a rule's band. Both bounds are inclusive, an\r\n * absent bound is open-ended, and a rule carrying neither bound is malformed —\r\n * it never matches rather than swallowing every value.\r\n */\r\nexport function matchesPercentageColorRule(\r\n value: number,\r\n rule?: PercentageColorRule | null,\r\n): boolean {\r\n if (!rule) {\r\n return false;\r\n }\r\n\r\n const min = toFiniteNumber(rule.minValue);\r\n const max = toFiniteNumber(rule.maxValue);\r\n\r\n if (min === null && max === null) {\r\n return false;\r\n }\r\n\r\n if (min !== null && value < min) {\r\n return false;\r\n }\r\n\r\n return max === null || value <= max;\r\n}\r\n\r\n/**\r\n * The colour for a percentage value: rules in their configured order, first\r\n * match wins, `defaultColor` when nothing matches.\r\n *\r\n * The backend owns this evaluation and ships the winner as `color` on\r\n * render/value/fetch responses, so callers must prefer that resolved colour.\r\n * This exists for the surfaces that hold a raw rule set and no resolved colour\r\n * — the property-form preview, and catalog reads that never went through a\r\n * value response.\r\n */\r\nexport function resolvePercentageColor(\r\n value: unknown,\r\n source?: PercentageColorSource | null,\r\n): string | null {\r\n const fallback = source?.defaultColor?.trim() || null;\r\n const numericValue = toFiniteNumber(value);\r\n const rules = source?.colorRules;\r\n\r\n if (numericValue === null || !Array.isArray(rules)) {\r\n return fallback;\r\n }\r\n\r\n const match = rules.find((rule) =>\r\n matchesPercentageColorRule(numericValue, rule),\r\n );\r\n\r\n return match?.color?.trim() || fallback;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Progress } from '@masterteam/components/progress';\r\nimport {\r\n displayOrPlaceholder,\r\n isEntityLabelHidden,\r\n isValueMissing,\r\n normalizeNumerals,\r\n readEntityValueColor,\r\n} from '../entity-display.utils';\r\nimport { EntityData, EntityPercentageConfig } from '../entity.model';\r\nimport { resolvePercentageColor } from '../percentage-color.utils';\r\n\r\n@Component({\r\n selector: 'mt-entity-percentage',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [Progress],\r\n templateUrl: './entity-percentage.html',\r\n})\r\nexport class EntityPercentage {\r\n private readonly transloco = inject(TranslocoService);\r\n /** Active locale, so number formatting follows the UI language. */\r\n private readonly locale = computed(\r\n () => this.transloco.getActiveLang() || 'en',\r\n );\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<string>();\r\n readonly rawValue = input<string>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n readonly displayValue = computed(() => {\r\n const d = this.data();\r\n const raw = d\r\n ? typeof d.value === 'string'\r\n ? d.value\r\n : null\r\n : this.value();\r\n return displayOrPlaceholder(this.formatPercentageDisplay(raw));\r\n });\r\n\r\n private readonly rawNumericValue = computed(\r\n () =>\r\n this.data()?.rawValue ??\r\n this.rawValue() ??\r\n this.value() ??\r\n this.displayValue(),\r\n );\r\n\r\n readonly hasNumericValue = computed(() => {\r\n return this.parseNumericValue(this.rawNumericValue()) !== null;\r\n });\r\n\r\n readonly numericValue = computed(() => {\r\n const num = this.parseNumericValue(this.rawNumericValue());\r\n return num === null ? 0 : Math.min(num, 100);\r\n });\r\n\r\n readonly maxValue = computed(() => {\r\n const num = this.parseNumericValue(this.rawNumericValue());\r\n if (num === null) return 100;\r\n return num > 100 ? Math.ceil(num) : 100;\r\n });\r\n\r\n // ── Configuration-driven visibility ──\r\n\r\n readonly hideName = computed(() =>\r\n isEntityLabelHidden(this.data()?.configuration),\r\n );\r\n\r\n /**\r\n * The bar colour. The backend evaluates the property's colour rules and\r\n * returns the winner as `color` on render/value/fetch responses, so a\r\n * resolved colour always wins — the rules are only evaluated here for\r\n * configurations that arrive without one (a catalog read, or the\r\n * property-form preview).\r\n *\r\n * The value's own `color` is checked first and is not the same thing as\r\n * `configuration.color`: it is resolved per record, so it is the only one\r\n * that can carry a band colour for *this* value, or the colour a\r\n * `colorSource: 'property'` configuration took from a sibling property on\r\n * this record. A configuration-level colour applies to every value alike and\r\n * cannot answer either question.\r\n */\r\n readonly progressColor = computed(() => {\r\n const d = this.data();\r\n const direct = d?.configuration as EntityPercentageConfig | undefined;\r\n const fromProperty = d?.propertyConfiguration as\r\n | EntityPercentageConfig\r\n | undefined;\r\n\r\n const perValue = readEntityValueColor(d?.color);\r\n if (perValue) {\r\n return perValue;\r\n }\r\n\r\n const resolved = direct?.color?.trim() || fromProperty?.color?.trim();\r\n if (resolved) {\r\n return resolved;\r\n }\r\n\r\n const raw = this.rawNumericValue();\r\n return (\r\n resolvePercentageColor(raw, direct) ??\r\n resolvePercentageColor(raw, fromProperty) ??\r\n 'primary'\r\n );\r\n });\r\n\r\n /**\r\n * Renders a percentage for the active locale.\r\n *\r\n * This used to echo the backend's string and only append `%` when that string\r\n * already carried one — so in Arabic, where the API returns a bare `\"25\"`,\r\n * the symbol vanished and a progress value rendered as an unlabelled `25`.\r\n * Next to a bar that could be a percentage, a count or a score (finding\r\n * H-08).\r\n *\r\n * Formatting from the NUMBER through `Intl.NumberFormat` makes the symbol,\r\n * the decimal separator and the digit shapes follow the locale instead of the\r\n * payload. `maximumFractionDigits: 1` preserves the precision the old code\r\n * kept; `style: 'percent'` expects a fraction, hence the /100.\r\n *\r\n * Non-numeric values pass through untouched — a status string or an em dash\r\n * must not be mangled into `NaN%`.\r\n */\r\n private formatPercentageDisplay(\r\n raw: string | null | undefined,\r\n ): string | null | undefined {\r\n if (isValueMissing(raw)) {\r\n return raw;\r\n }\r\n\r\n const num = this.parseNumericValue(raw);\r\n if (num === null) {\r\n return raw;\r\n }\r\n\r\n try {\r\n return new Intl.NumberFormat(this.locale(), {\r\n style: 'percent',\r\n maximumFractionDigits: 1,\r\n }).format(num / 100);\r\n } catch {\r\n // An unknown locale tag must not cost the user their number.\r\n return `${Number(num.toFixed(1))}%`;\r\n }\r\n }\r\n\r\n private parseNumericValue(raw: unknown): number | null {\r\n if (isValueMissing(raw)) {\r\n return null;\r\n }\r\n\r\n const normalizedRawValue = normalizeNumerals(String(raw))\r\n .replace(/[%٪]/g, '')\r\n .trim();\r\n if (!normalizedRawValue) {\r\n return null;\r\n }\r\n\r\n const numericValue = Number.parseFloat(normalizedRawValue);\r\n return Number.isNaN(numericValue) ? null : numericValue;\r\n }\r\n}\r\n","<div class=\"flex flex-col gap-1\">\r\n <div class=\"flex items-center justify-between\">\r\n @if (!hideName()) {\r\n <span class=\"text-xs font-semibold\">{{ displayName() }}</span>\r\n }\r\n <span class=\"text-xs font-bold\" [class.ms-auto]=\"hideName()\">{{\r\n displayValue()\r\n }}</span>\r\n </div>\r\n @if (hasNumericValue()) {\r\n <mt-progress\r\n [value]=\"numericValue()\"\r\n [showLabel]=\"false\"\r\n [height]=\"9\"\r\n [maxValue]=\"maxValue()\"\r\n [color]=\"progressColor()\"\r\n >\r\n </mt-progress>\r\n } @else {\r\n <div class=\"h-[9px] rounded-full bg-gray-200\"></div>\r\n }\r\n</div>\r\n","import { normalizeNumerals } from './entity-display.utils';\r\n\r\n/**\r\n * The largest amount still rendered in full.\r\n *\r\n * The reviewer measured exactly where the line falls: `100,000 SAR` fits a card\r\n * slot, `1,000,000 SAR` does not and loses its currency to the ellipsis. So the\r\n * comparison below is inclusive — anything ABOVE this compacts, and everything\r\n * a tenant sees today at or under it is untouched.\r\n */\r\nexport const CURRENCY_COMPACT_THRESHOLD = 100_000;\r\n\r\n/**\r\n * The numeric amount inside a formatted currency string.\r\n *\r\n * Strips the currency token, the grouping separators and the bidirectional\r\n * marks `Intl` leaves around them, and normalises Arabic-Indic digits so an\r\n * `ar-SA` payload parses like an `en` one. `null` when there is no number.\r\n */\r\nexport function parseCurrencyAmount(\r\n raw: string | null | undefined,\r\n): number | null {\r\n if (typeof raw !== 'string') {\r\n return null;\r\n }\r\n\r\n const numeric = normalizeNumerals(raw).replace(/[^0-9.+-]/g, '');\r\n if (!numeric || !/\\d/.test(numeric)) {\r\n return null;\r\n }\r\n\r\n const parsed = Number.parseFloat(numeric);\r\n return Number.isFinite(parsed) ? parsed : null;\r\n}\r\n\r\n/**\r\n * Whatever is left of a formatted amount once the number is removed — `SAR`,\r\n * `ر.س`, `$`. Read from the payload rather than configured, so a tenant's own\r\n * currency survives untouched.\r\n */\r\nexport function currencyUnitOf(formatted: string): string {\r\n return normalizeNumerals(formatted)\r\n .replace(/[0-9.,+-]/g, '')\r\n .trim();\r\n}\r\n\r\n/**\r\n * A large currency amount shortened so it fits a card slot, with the unit kept.\r\n *\r\n * A budget of a million or more used to render as `1,000,000 …`: the digits\r\n * survived the ellipsis and the currency did not, so the largest and most\r\n * consequential figures in the product were the only ones whose unit could not\r\n * be read (finding H-06). Compact notation keeps the whole thing inside the\r\n * slot — `SAR 1M` instead of `1,000,000 SAR` — and callers put the exact figure\r\n * in a tooltip, which is where a precise number belongs on a summary card.\r\n *\r\n * Returns `formatted` unchanged whenever the value already fits, is not a\r\n * number, or the runtime has no compact notation — so no tenant sees an\r\n * existing number change shape for no reason.\r\n */\r\nexport function compactCurrencyDisplay(\r\n formatted: string,\r\n rawValue: string | null | undefined,\r\n locale: string,\r\n threshold: number = CURRENCY_COMPACT_THRESHOLD,\r\n): string {\r\n const amount = parseCurrencyAmount(rawValue ?? formatted);\r\n if (amount === null || Math.abs(amount) <= threshold) {\r\n return formatted;\r\n }\r\n\r\n let compact: string;\r\n try {\r\n compact = new Intl.NumberFormat(locale, {\r\n notation: 'compact',\r\n maximumFractionDigits: 1,\r\n }).format(amount);\r\n } catch {\r\n return formatted;\r\n }\r\n\r\n const unit = currencyUnitOf(formatted);\r\n if (!unit) {\r\n return compact;\r\n }\r\n\r\n // Keep the payload's own unit placement — `SAR 1,000` and `1,000 SAR` are\r\n // both in use, and flipping one to the other reads as a different currency.\r\n return formatted.trimStart().startsWith(unit)\r\n ? `${unit} ${compact}`\r\n : `${compact} ${unit}`;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\nimport { compactCurrencyDisplay } from '../currency-display.utils';\r\nimport { displayOrPlaceholder } from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityData } from '../entity.model';\r\nimport { FitText } from '../fit-text.directive';\r\n\r\n@Component({\r\n selector: 'mt-entity-currency',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField, Tooltip, FitText],\r\n templateUrl: './entity-currency.html',\r\n})\r\nexport class EntityCurrency {\r\n private readonly transloco = inject(TranslocoService);\r\n /** Active locale, so number formatting follows the UI language. */\r\n private readonly locale = computed(\r\n () => this.transloco.getActiveLang() || 'en',\r\n );\r\n\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<string>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n /** The backend's fully grouped string — always the tooltip, never truncated. */\r\n readonly fullValue = computed(() => {\r\n const d = this.data();\r\n if (d) {\r\n return displayOrPlaceholder(typeof d.value === 'string' ? d.value : null);\r\n }\r\n return displayOrPlaceholder(this.value());\r\n });\r\n\r\n /**\r\n * What the cell renders: the backend's string, or a compact form of it when\r\n * the amount is large enough that the currency token would be truncated away.\r\n * See {@link compactCurrencyDisplay} (finding H-06).\r\n */\r\n readonly displayValue = computed(() =>\r\n compactCurrencyDisplay(\r\n this.fullValue(),\r\n this.data()?.rawValue,\r\n this.locale(),\r\n ),\r\n );\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <span\r\n class=\"block min-w-0 truncate text-sm font-semibold tabular-nums whitespace-nowrap\"\r\n mtFitText\r\n [mtTooltip]=\"fullValue()\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ displayValue() }}\r\n </span>\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport {\r\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\r\n isEntityLabelHidden,\r\n} from '../entity-display.utils';\r\nimport { EntityData } from '../entity.model';\r\nimport { coerceCheckboxValue } from '@masterteam/components';\r\n\r\n@Component({\r\n selector: 'mt-entity-checkbox',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n templateUrl: './entity-checkbox.html',\r\n})\r\nexport class EntityCheckbox {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<string>();\r\n readonly rawValue = input<string>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n\r\n readonly hideName = computed(() =>\r\n isEntityLabelHidden(this.data()?.configuration),\r\n );\r\n\r\n // Reads `rawValue` first (the value as stored) and falls back to the\r\n // rendered `value`. Both arrive as text — `coerceCheckboxValue` owns the\r\n // single definition of which strings count as checked, shared with the\r\n // editable form so a record cannot preview one way and edit another.\r\n readonly checkboxState = computed<boolean | null>(() => {\r\n const raw = coerceCheckboxValue(this.data()?.rawValue ?? this.rawValue());\r\n if (raw !== null) return raw;\r\n\r\n return coerceCheckboxValue(this.data()?.value ?? this.value());\r\n });\r\n}\r\n","<div class=\"flex items-center gap-2\">\r\n @if (checkboxState() === true) {\r\n <svg class=\"w-5 h-5 text-green-500\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else if (checkboxState() === false) {\r\n <svg class=\"w-5 h-5 text-gray-300\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5.414l-2.293-2.293a1 1 0 011.414-1.414L10 11.172l3.879-3.879a1 1 0 111.414 1.414L10 13.414l-.707-.707-.293-.293z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else {\r\n <span\r\n class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-100 px-1 text-[10px] font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n @if (!hideName()) {\r\n <span class=\"text-sm font-semibold\">{{ displayName() }}</span>\r\n }\r\n</div>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport {\r\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\r\n extractDisplayText,\r\n isValueMissing,\r\n} from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityData } from '../entity.model';\r\n\r\n@Component({\r\n selector: 'mt-entity-long-text',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField],\r\n templateUrl: './entity-long-text.html',\r\n})\r\nexport class EntityLongText {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<string>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n readonly displayValue = computed(() => {\r\n const d = this.data();\r\n const raw = d ? extractDisplayText(d.value) : this.value();\r\n\r\n if (isValueMissing(raw)) {\r\n return ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n }\r\n\r\n return raw as string;\r\n });\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"text-sm font-semibold break-words\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport {\r\n displayOrPlaceholder,\r\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\r\n} from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport {\r\n EntityData,\r\n EntityLookupValue,\r\n EntityMultiLookupValue,\r\n} from '../entity.model';\r\n\r\n@Component({\r\n selector: 'mt-entity-lookup',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField],\r\n templateUrl: './entity-lookup.html',\r\n})\r\nexport class EntityLookup {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<EntityLookupValue | EntityMultiLookupValue>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n readonly lookupValues = computed<EntityMultiLookupValue>(() => {\r\n const value = this.data()?.value ?? this.value();\r\n if (Array.isArray(value)) {\r\n return value as EntityMultiLookupValue;\r\n }\r\n\r\n if (typeof value === 'object' && value !== null) {\r\n return [value as EntityLookupValue];\r\n }\r\n\r\n return [];\r\n });\r\n\r\n lookupBadgeStyle(lookup: EntityLookupValue): Record<string, string> {\r\n if (!lookup?.color) return {};\r\n return {\r\n color: lookup.color,\r\n backgroundColor: this.hexToRgba(lookup.color, 0.12),\r\n };\r\n }\r\n\r\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n\r\n lookupLabel(lookup: EntityLookupValue): string {\r\n return displayOrPlaceholder(lookup.display);\r\n }\r\n\r\n private hexToRgba(hex: string, alpha: number): string {\r\n const r = parseInt(hex.slice(1, 3), 16);\r\n const g = parseInt(hex.slice(3, 5), 16);\r\n const b = parseInt(hex.slice(5, 7), 16);\r\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\r\n }\r\n}\r\n","<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","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport {\r\n displayOrPlaceholder,\r\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\r\n} from '../entity-display.utils';\r\nimport { resolveLocalizedLabel } from '../entity-sections.util';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityData, EntityPhaseGateValue } from '../entity.model';\r\n\r\n/** `#RGB` / `#RRGGBB`. Anything else is used as-is for the text color only. */\r\nconst HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\r\n\r\n/**\r\n * Badge color used when the phase gate carries no `color`. `color` is optional\r\n * presentation metadata, so a phase gate without one must still read as a\r\n * badge rather than as bare text — this is the same neutral slate the table\r\n * falls back to for uncategorized status chips.\r\n */\r\nexport const DEFAULT_PHASE_GATE_COLOR = '#475569';\r\n\r\n/**\r\n * Preview renderer for `PhaseGate` properties — a calculated, read-only lookup\r\n * pointing at the schema phase gate the record currently sits on. It renders\r\n * exactly like {@link EntityLookup} (colored badge) but resolves its label\r\n * per-language.\r\n *\r\n * Label resolution, in order:\r\n * 1. `value.ar` / `value.en` for the active language — the backend sends both\r\n * so a client-side language switch re-renders without a refetch, which is\r\n * why they win over the already-resolved `display`.\r\n * 2. `value.display`, then the other locale.\r\n * 3. The flat display, for payloads that send the value as a bare string\r\n * (comparison snapshots build their sides that way).\r\n * 4. `rawValue` — the schema phase-gate id — as a last resort.\r\n */\r\n@Component({\r\n selector: 'mt-entity-phase-gate',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField],\r\n templateUrl: './entity-phase-gate.html',\r\n})\r\nexport class EntityPhaseGate {\r\n private readonly transloco = inject(TranslocoService);\r\n\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<EntityPhaseGateValue>();\r\n\r\n private readonly activeLang = toSignal(this.transloco.langChanges$, {\r\n initialValue: this.transloco.getActiveLang(),\r\n });\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n readonly phaseGateValue = computed<EntityPhaseGateValue | null>(() => {\r\n const value = this.data()?.value;\r\n if (value && typeof value === 'object' && !Array.isArray(value)) {\r\n return value as EntityPhaseGateValue;\r\n }\r\n return this.value() ?? null;\r\n });\r\n\r\n /** Resolved label, or `null` when nothing at all is available. */\r\n private readonly resolvedLabel = computed<string | null>(() => {\r\n const phaseGate = this.phaseGateValue();\r\n if (phaseGate) {\r\n const localized = resolveLocalizedLabel(phaseGate, this.activeLang());\r\n const label = localized || phaseGate.display?.trim();\r\n if (label) return label;\r\n }\r\n\r\n return this.flatDisplay() ?? this.rawId();\r\n });\r\n\r\n readonly hasValue = computed(() => this.resolvedLabel() !== null);\r\n\r\n readonly phaseGateLabel = computed(() =>\r\n displayOrPlaceholder(this.resolvedLabel()),\r\n );\r\n\r\n readonly badgeStyle = computed(() => {\r\n const color =\r\n this.phaseGateValue()?.color?.trim() || DEFAULT_PHASE_GATE_COLOR;\r\n if (!HEX_COLOR_PATTERN.test(color)) return { color };\r\n return {\r\n color,\r\n backgroundColor: this.hexToRgba(color, 0.12),\r\n };\r\n });\r\n\r\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n\r\n /** The value flattened to a plain display string by the sender. */\r\n private flatDisplay(): string | null {\r\n const value = this.data()?.value;\r\n return typeof value === 'string' && value.trim() ? value.trim() : null;\r\n }\r\n\r\n /** The schema phase-gate id. */\r\n private rawId(): string | null {\r\n const rawValue = this.data()?.rawValue;\r\n return typeof rawValue === 'string' && rawValue.trim()\r\n ? rawValue.trim()\r\n : null;\r\n }\r\n\r\n private hexToRgba(hex: string, alpha: number): string {\r\n const expanded =\r\n hex.length === 4\r\n ? `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`\r\n : hex;\r\n const r = parseInt(expanded.slice(1, 3), 16);\r\n const g = parseInt(expanded.slice(3, 5), 16);\r\n const b = parseInt(expanded.slice(5, 7), 16);\r\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\r\n }\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasValue()) {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit\"\r\n [style]=\"badgeStyle()\"\r\n >\r\n {{ phaseGateLabel() }}\r\n </span>\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","import { Signal } from '@angular/core';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\n\r\n/**\r\n * One shared active-language signal per `TranslocoService`.\r\n *\r\n * `mt-entity-preview` renders once per property per record — a client-list card\r\n * grid mounts thousands of them — so a `toSignal(langChanges$)` inside each\r\n * instance would open thousands of subscriptions to the same Subject just to\r\n * read one global value. The language is global, so the signal is too: created\r\n * once, cached against the service, and shared by every entity that needs it.\r\n *\r\n * `manualCleanup` is deliberate. The cached signal outlives any single\r\n * component by design, and the service it hangs off is the root injector's —\r\n * tying its subscription to whichever entity happened to ask first would tear\r\n * it down the moment that entity scrolled out of view.\r\n */\r\nconst langSignals = new WeakMap<TranslocoService, Signal<string>>();\r\n\r\nexport function sharedActiveLang(transloco: TranslocoService): Signal<string> {\r\n const cached = langSignals.get(transloco);\r\n if (cached) {\r\n return cached;\r\n }\r\n\r\n const lang = toSignal(transloco.langChanges$, {\r\n initialValue: transloco.getActiveLang(),\r\n manualCleanup: true,\r\n });\r\n langSignals.set(transloco, lang);\r\n return lang;\r\n}\r\n","/**\r\n * Shared reading of a `PerformanceScore` value. The gauge draws from it and the\r\n * table resolver filters by it, so a card's pill and the filter it sets can\r\n * never disagree about which status a record is in.\r\n */\r\n\r\nimport { isValueMissing, normalizeNumerals } from './entity-display.utils';\r\nimport {\r\n EntityPerformanceScoreChartSize,\r\n EntityPerformanceScoreStatus,\r\n EntityPerformanceScoreValue,\r\n} from './entity.model';\r\n\r\n/** Every `chartSize`, smallest first — the order the drawer offers them in. */\r\nexport const PERFORMANCE_SCORE_CHART_SIZES: readonly EntityPerformanceScoreChartSize[] =\r\n ['small', 'medium', 'large', 'full'];\r\n\r\n/** The cap applied when a display configuration carries no `chartSize`. */\r\nexport const DEFAULT_PERFORMANCE_SCORE_CHART_SIZE: EntityPerformanceScoreChartSize =\r\n 'medium';\r\n\r\n/** The score as a number, or `null` when there is no measurement. */\r\nexport function parsePerformanceScore(raw: unknown): number | null {\r\n if (typeof raw === 'number') return Number.isFinite(raw) ? raw : null;\r\n if (isValueMissing(raw)) return null;\r\n const parsed = Number.parseFloat(\r\n normalizeNumerals(String(raw)).replace(/[%٪]/g, '').trim(),\r\n );\r\n return Number.isNaN(parsed) ? null : parsed;\r\n}\r\n\r\n/** Bands with at least one bound, ordered along the arc. */\r\nexport function getPerformanceScoreBands(\r\n value: EntityPerformanceScoreValue | null | undefined,\r\n): EntityPerformanceScoreStatus[] {\r\n return (value?.statuses ?? [])\r\n .filter((status) => status.from != null || status.to != null)\r\n .sort((a, b) => (a.from ?? -Infinity) - (b.from ?? -Infinity));\r\n}\r\n\r\n/**\r\n * The backend's status, else the band whose range holds the score. A missing\r\n * bound is open-ended here — unlike on the arc, where it stops at the scale —\r\n * so a 120% score still lands in a `from: 95` band.\r\n */\r\nexport function resolvePerformanceScoreStatus(\r\n value: EntityPerformanceScoreValue | null | undefined,\r\n): EntityPerformanceScoreStatus | null {\r\n if (value?.status) return value.status;\r\n\r\n const performance = parsePerformanceScore(value?.performance);\r\n if (performance === null) return null;\r\n\r\n const bands = getPerformanceScoreBands(value);\r\n return (\r\n bands.find((band, index) => {\r\n const from = band.from ?? -Infinity;\r\n const to = band.to ?? Infinity;\r\n const isLast = index === bands.length - 1;\r\n return (\r\n performance >= from && (isLast ? performance <= to : performance < to)\r\n );\r\n }) ?? null\r\n );\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\r\nimport { sharedActiveLang } from '../active-lang';\r\nimport { ENTITY_EMPTY_VALUE_PLACEHOLDER } from '../entity-display.utils';\r\nimport {\r\n EntityData,\r\n EntityPerformanceScoreChartSize,\r\n EntityPerformanceScoreConfig,\r\n EntityPerformanceScoreStatus,\r\n EntityPerformanceScoreValue,\r\n} from '../entity.model';\r\nimport {\r\n DEFAULT_PERFORMANCE_SCORE_CHART_SIZE,\r\n getPerformanceScoreBands,\r\n parsePerformanceScore,\r\n resolvePerformanceScoreStatus,\r\n} from '../performance-score.utils';\r\n\r\n/** Arc geometry, in viewBox units: a semicircle centred on (50, 100). */\r\nconst ARC_RADIUS = 50;\r\nconst ARC_CENTER_X = 50;\r\nconst ARC_CENTER_Y = 100;\r\n/** Radius band labels sit on — just outside the 6-unit stroke. */\r\nconst LABEL_RADIUS = 59;\r\n/**\r\n * How far each band is pulled back from an interior boundary, as a fraction of\r\n * the arc. Round caps add half the stroke (3 units) past each end, so without\r\n * this neighbouring bands would overlap instead of showing a gap.\r\n */\r\nconst BAND_INSET = 4.5 / (Math.PI * ARC_RADIUS);\r\n/** Shortest band still drawn, so a very narrow range renders as a dot. */\r\nconst MIN_BAND_SPAN = 0.001;\r\n/**\r\n * What the gauge always occupies, labels aside: the stroke (±3) and the marker\r\n * (r 5 + half its 3-unit stroke) at either end of the arc.\r\n */\r\nconst GAUGE_EXTENT = 6.5;\r\n/** Rough advance of one 7-unit bold label glyph, to size the viewBox. */\r\nconst LABEL_CHAR_WIDTH = 4.4;\r\nconst LABEL_HALF_HEIGHT = 4;\r\n\r\n/** Width cap per `chartSize`. */\r\nconst CHART_MAX_WIDTH: Record<EntityPerformanceScoreChartSize, string> = {\r\n small: '11rem',\r\n medium: '15rem',\r\n large: '20rem',\r\n full: '100%',\r\n};\r\n\r\nconst FALLBACK_COLOR = 'var(--p-primary-color)';\r\nconst EMPTY_COLOR = 'var(--p-surface-300)';\r\n\r\ninterface GaugeBand {\r\n key: string;\r\n path: string;\r\n color: string;\r\n opacity: number;\r\n}\r\n\r\ninterface GaugeLabel {\r\n key: string;\r\n text: string;\r\n x: number;\r\n y: number;\r\n anchor: 'start' | 'middle' | 'end';\r\n}\r\n\r\n/**\r\n * Preview renderer for `PerformanceScore` properties — a KPI's performance as a\r\n * semicircle gauge, ported from SPlus v3's `app-performance-gauge`.\r\n *\r\n * Each status band is an arc segment; the band the score sits in is drawn at\r\n * full strength and the rest are faded. The marker rides the arc at the score,\r\n * the score itself sits in the middle, and the current status is a pill below.\r\n *\r\n * Geometry is computed, not measured: the SVG has a fixed `viewBox` and\r\n * `width: 100%` (capped by `configuration.chartSize`, centred), so it scales with its grid\r\n * cell without a `ResizeObserver` — a card grid mounts one of these per record.\r\n */\r\n@Component({\r\n selector: 'mt-entity-performance-score',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [TranslocoPipe],\r\n templateUrl: './entity-performance-score.html',\r\n})\r\nexport class EntityPerformanceScore {\r\n private readonly activeLang = sharedActiveLang(inject(TranslocoService));\r\n\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<EntityPerformanceScoreValue>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n /** The display configuration's `chartSize`, as a CSS `max-width`. */\r\n readonly chartMaxWidth = computed(() => {\r\n const size = (\r\n this.data()?.configuration as EntityPerformanceScoreConfig | undefined\r\n )?.chartSize;\r\n return (\r\n CHART_MAX_WIDTH[size ?? DEFAULT_PERFORMANCE_SCORE_CHART_SIZE] ??\r\n CHART_MAX_WIDTH[DEFAULT_PERFORMANCE_SCORE_CHART_SIZE]\r\n );\r\n });\r\n\r\n readonly scoreValue = computed<EntityPerformanceScoreValue | null>(() => {\r\n const value = this.data()?.value;\r\n if (value && typeof value === 'object' && !Array.isArray(value)) {\r\n return value as EntityPerformanceScoreValue;\r\n }\r\n return this.value() ?? null;\r\n });\r\n\r\n readonly performance = computed(() =>\r\n parsePerformanceScore(this.scoreValue()?.performance),\r\n );\r\n\r\n readonly hasPerformance = computed(() => this.performance() !== null);\r\n\r\n /** Bands with at least one bound, ordered along the arc. */\r\n private readonly statuses = computed<EntityPerformanceScoreStatus[]>(() =>\r\n getPerformanceScoreBands(this.scoreValue()),\r\n );\r\n\r\n /** 0–100, widened to the outermost band bound. */\r\n private readonly scale = computed(() => {\r\n let min = 0;\r\n let max = 100;\r\n for (const status of this.statuses()) {\r\n if (status.from != null && status.from < min) min = status.from;\r\n if (status.to != null && status.to > max) max = status.to;\r\n }\r\n return { min, max };\r\n });\r\n\r\n /** See {@link resolvePerformanceScoreStatus}; the table filters by it too. */\r\n readonly status = computed<EntityPerformanceScoreStatus | null>(() =>\r\n resolvePerformanceScoreStatus(this.scoreValue()),\r\n );\r\n\r\n readonly accentColor = computed(() => {\r\n if (!this.hasPerformance()) return EMPTY_COLOR;\r\n return this.status()?.color?.trim() || FALLBACK_COLOR;\r\n });\r\n\r\n readonly bands = computed<GaugeBand[]>(() => {\r\n const statuses = this.statuses();\r\n if (!statuses.length) {\r\n return [\r\n {\r\n key: 'full',\r\n path: this.arcPath(0, 1),\r\n color: this.accentColor(),\r\n opacity: 1,\r\n },\r\n ];\r\n }\r\n\r\n const activeKey = this.status()?.key;\r\n const { min, max } = this.scale();\r\n return statuses.map((status, index) => {\r\n const start = this.toFraction(status.from ?? min);\r\n const end = this.toFraction(status.to ?? max);\r\n const insetStart = index > 0 ? start + BAND_INSET : start;\r\n const insetEnd = index < statuses.length - 1 ? end - BAND_INSET : end;\r\n return {\r\n key: status.key,\r\n path: this.arcPath(\r\n insetStart,\r\n Math.max(insetEnd, insetStart + MIN_BAND_SPAN),\r\n ),\r\n color: status.color?.trim() || FALLBACK_COLOR,\r\n opacity: status.key === activeKey ? 1 : 0.2,\r\n };\r\n });\r\n });\r\n\r\n /** A label at every band start except the gauge minimum. */\r\n readonly labels = computed<GaugeLabel[]>(() => {\r\n const { min } = this.scale();\r\n return this.statuses()\r\n .filter((status) => status.from != null && status.from > min)\r\n .map((status) => {\r\n const angle = this.toAngle(this.toFraction(status.from as number));\r\n const cos = Math.cos(angle);\r\n return {\r\n key: status.key,\r\n text: this.formatPercent(status.from as number),\r\n x: ARC_CENTER_X + LABEL_RADIUS * cos,\r\n y: ARC_CENTER_Y - LABEL_RADIUS * Math.sin(angle),\r\n anchor: cos > 0.25 ? 'start' : cos < -0.25 ? 'end' : 'middle',\r\n };\r\n });\r\n });\r\n\r\n /**\r\n * Fitted to what is actually drawn, so the arc fills its cell instead of\r\n * reserving label room it may not need. Kept symmetric about the arc's\r\n * centre so the gauge stays centred over the status pill.\r\n */\r\n readonly viewBox = computed(() => {\r\n let minX = ARC_CENTER_X - ARC_RADIUS - GAUGE_EXTENT;\r\n let maxX = ARC_CENTER_X + ARC_RADIUS + GAUGE_EXTENT;\r\n let minY = ARC_CENTER_Y - ARC_RADIUS - GAUGE_EXTENT;\r\n const maxY = ARC_CENTER_Y + GAUGE_EXTENT;\r\n\r\n for (const label of this.labels()) {\r\n const width = label.text.length * LABEL_CHAR_WIDTH;\r\n const left =\r\n label.anchor === 'start'\r\n ? label.x\r\n : label.anchor === 'end'\r\n ? label.x - width\r\n : label.x - width / 2;\r\n minX = Math.min(minX, left);\r\n maxX = Math.max(maxX, left + width);\r\n minY = Math.min(minY, label.y - LABEL_HALF_HEIGHT);\r\n }\r\n\r\n const halfWidth = Math.max(ARC_CENTER_X - minX, maxX - ARC_CENTER_X);\r\n return `${ARC_CENTER_X - halfWidth} ${minY} ${halfWidth * 2} ${maxY - minY}`;\r\n });\r\n\r\n readonly marker = computed(() => {\r\n const performance = this.performance();\r\n if (performance === null) return null;\r\n return this.pointAt(this.toFraction(performance), ARC_RADIUS);\r\n });\r\n\r\n readonly performanceLabel = computed(() => {\r\n const performance = this.performance();\r\n return performance === null\r\n ? ENTITY_EMPTY_VALUE_PLACEHOLDER\r\n : this.formatPercent(performance);\r\n });\r\n\r\n readonly statusLabel = computed(() => this.status()?.display?.trim() || '');\r\n\r\n /** Same tinted badge as `mt-entity-status`, so both read as one status. */\r\n readonly statusPillStyle = computed(() => {\r\n const color = this.status()?.color?.trim() || FALLBACK_COLOR;\r\n return {\r\n color,\r\n backgroundColor: `color-mix(in srgb, ${color} 12%, transparent)`,\r\n };\r\n });\r\n\r\n /** Score → position along the arc, clamped to its ends. */\r\n private toFraction(value: number): number {\r\n const { min, max } = this.scale();\r\n return Math.min(Math.max((value - min) / (max - min), 0), 1);\r\n }\r\n\r\n /** Arc fraction → angle; 0 is the left end, 1 the right. */\r\n private toAngle(fraction: number): number {\r\n return Math.PI * (1 - fraction);\r\n }\r\n\r\n private pointAt(fraction: number, radius: number): { x: number; y: number } {\r\n const angle = this.toAngle(fraction);\r\n return {\r\n x: ARC_CENTER_X + radius * Math.cos(angle),\r\n y: ARC_CENTER_Y - radius * Math.sin(angle),\r\n };\r\n }\r\n\r\n private arcPath(from: number, to: number): string {\r\n const start = this.pointAt(from, ARC_RADIUS);\r\n const end = this.pointAt(to, ARC_RADIUS);\r\n return `M ${start.x} ${start.y} A ${ARC_RADIUS} ${ARC_RADIUS} 0 0 1 ${end.x} ${end.y}`;\r\n }\r\n\r\n /** Same locale-aware formatting as `mt-entity-percentage`. */\r\n private formatPercent(value: number): string {\r\n try {\r\n return new Intl.NumberFormat(this.activeLang() || 'en', {\r\n style: 'percent',\r\n maximumFractionDigits: 1,\r\n }).format(value / 100);\r\n } catch {\r\n return `${Number(value.toFixed(1))}%`;\r\n }\r\n }\r\n}\r\n","<!--\r\n No property label above the gauge: the gauge carries its own caption\r\n (\"Performance Score\"), and the label repeated it. The property name is kept\r\n as the SVG's accessible name instead.\r\n-->\r\n<div class=\"flex w-full flex-col items-center\">\r\n <!--\r\n `direction=\"ltr\"` pins the band labels' text-anchor to the arc's own\r\n left/right — under an RTL host `start`/`end` would otherwise flip and push\r\n the labels into the arc. The gauge itself runs left to right in both\r\n languages, as it does in SPlus.\r\n -->\r\n <svg\r\n class=\"block h-auto w-full overflow-visible\"\r\n [style.max-width]=\"chartMaxWidth()\"\r\n [attr.viewBox]=\"viewBox()\"\r\n direction=\"ltr\"\r\n role=\"img\"\r\n [attr.aria-label]=\"displayName() + ' ' + performanceLabel()\"\r\n >\r\n @for (band of bands(); track band.key) {\r\n <path\r\n [attr.d]=\"band.path\"\r\n fill=\"none\"\r\n stroke-width=\"6\"\r\n stroke-linecap=\"round\"\r\n [style.stroke]=\"band.color\"\r\n [style.opacity]=\"band.opacity\"\r\n />\r\n }\r\n @for (label of labels(); track label.key) {\r\n <text\r\n [attr.x]=\"label.x\"\r\n [attr.y]=\"label.y\"\r\n [attr.text-anchor]=\"label.anchor\"\r\n dominant-baseline=\"middle\"\r\n font-size=\"7\"\r\n font-weight=\"700\"\r\n fill=\"currentColor\"\r\n >\r\n {{ label.text }}\r\n </text>\r\n }\r\n @if (marker(); as point) {\r\n <circle\r\n [attr.cx]=\"point.x\"\r\n [attr.cy]=\"point.y\"\r\n r=\"5\"\r\n fill=\"#ffffff\"\r\n stroke-width=\"3\"\r\n [style.stroke]=\"accentColor()\"\r\n style=\"filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.1))\"\r\n />\r\n }\r\n <text\r\n x=\"50\"\r\n y=\"87\"\r\n text-anchor=\"middle\"\r\n font-size=\"16\"\r\n font-weight=\"700\"\r\n [style.fill]=\"accentColor()\"\r\n >\r\n {{ performanceLabel() }}\r\n </text>\r\n <text\r\n x=\"50\"\r\n y=\"99\"\r\n text-anchor=\"middle\"\r\n font-size=\"6.5\"\r\n fill=\"currentColor\"\r\n class=\"text-gray-600\"\r\n >\r\n {{ \"components.performanceScore.label\" | transloco }}\r\n </text>\r\n </svg>\r\n\r\n @if (statusLabel()) {\r\n <span\r\n class=\"inline-block max-w-full truncate rounded-md px-3 py-2 text-xs font-semibold\"\r\n [style]=\"statusPillStyle()\"\r\n >\r\n {{ statusLabel() }}\r\n </span>\r\n }\r\n</div>\r\n","import { HttpClient, HttpContext } from '@angular/common/http';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n signal,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { UploadField } from '@masterteam/components/upload-field';\r\nimport { MTIcon } from '@masterteam/icons';\r\nimport {\r\n EMPTY,\r\n catchError,\r\n finalize,\r\n forkJoin,\r\n map,\r\n of,\r\n switchMap,\r\n take,\r\n} from 'rxjs';\r\n\r\nimport {\r\n EntityAttachmentItemValue,\r\n EntityAttachmentValue,\r\n EntityData,\r\n} from '../entity.model';\r\nimport { EntityField } from '../entity-field/entity-field';\r\n\r\ninterface AttachmentMetadataResponse {\r\n data: EntityAttachmentItemValue;\r\n}\r\n\r\ntype AttachmentReference = EntityAttachmentItemValue | string;\r\n\r\n@Component({\r\n selector: 'mt-entity-attachment',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [FormsModule, UploadField, Button, EntityField],\r\n templateUrl: './entity-attachment.html',\r\n})\r\nexport class EntityAttachment {\r\n readonly data = input<EntityData>();\r\n readonly name = input<string>();\r\n readonly shape = input<'default' | 'compact'>('default');\r\n readonly value = input<\r\n EntityAttachmentValue | EntityAttachmentItemValue | string | null\r\n >();\r\n readonly endPoint = input<string>('uploader');\r\n readonly context = input<HttpContext | undefined>(undefined);\r\n\r\n private readonly httpClient = inject(HttpClient);\r\n private readonly transloco = inject(TranslocoService);\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n readonly loading = signal(false);\r\n readonly attachments = signal<EntityAttachmentItemValue[]>([]);\r\n /** Key of the compact chip currently hovered, so it can reveal the download affordance. */\r\n readonly hoveredAttachmentKey = signal<string | null>(null);\r\n readonly attachmentReferences = computed(() =>\r\n this.normalizeAttachmentValue(this.data()?.value ?? this.value()),\r\n );\r\n readonly uploadValue = computed(() => {\r\n const references = this.attachmentReferences().map((reference) => {\r\n if (typeof reference === 'string') {\r\n return reference.trim();\r\n }\r\n\r\n if (reference.fileName) {\r\n return reference;\r\n }\r\n\r\n return reference.id?.trim() || reference;\r\n });\r\n\r\n if (!references.length) {\r\n return null;\r\n }\r\n\r\n return references.length === 1 ? references[0] : references;\r\n });\r\n readonly hasAttachments = computed(() =>\r\n this.shape() === 'compact'\r\n ? this.attachments().length > 0\r\n : this.uploadValue() != null,\r\n );\r\n readonly isMultiple = computed(() => this.attachmentReferences().length > 1);\r\n readonly acceptTypes = computed(() =>\r\n this.normalizeAcceptTypes(\r\n (this.data()?.configuration as Record<string, unknown> | undefined)?.[\r\n 'AcceptTypes'\r\n ],\r\n ),\r\n );\r\n\r\n protected readonly empty = '-';\r\n\r\n constructor() {\r\n effect((onCleanup) => {\r\n if (this.shape() !== 'compact') {\r\n this.loading.set(false);\r\n this.attachments.set([]);\r\n return;\r\n }\r\n\r\n const references = this.attachmentReferences();\r\n\r\n if (!references.length) {\r\n this.loading.set(false);\r\n this.attachments.set([]);\r\n return;\r\n }\r\n\r\n const shouldFetchMetadata = references.some((reference) =>\r\n this.requiresMetadataRequest(reference),\r\n );\r\n\r\n if (!shouldFetchMetadata) {\r\n this.attachments.set(\r\n references.filter(this.isAttachmentItemValue).map((reference) => ({\r\n ...reference,\r\n name:\r\n reference.name ??\r\n reference.fileName ??\r\n reference.id ??\r\n reference.name,\r\n extension: this.resolveExtension(reference),\r\n })),\r\n );\r\n this.loading.set(false);\r\n return;\r\n }\r\n\r\n this.loading.set(true);\r\n\r\n const sub = forkJoin(\r\n references.map((reference) => this.resolveAttachment$(reference)),\r\n )\r\n .pipe(finalize(() => this.loading.set(false)))\r\n .subscribe((attachments) => {\r\n this.attachments.set(\r\n attachments.filter(\r\n (attachment): attachment is EntityAttachmentItemValue =>\r\n attachment != null,\r\n ),\r\n );\r\n });\r\n\r\n onCleanup(() => sub.unsubscribe());\r\n });\r\n }\r\n\r\n attachmentTrackBy(\r\n index: number,\r\n attachment: EntityAttachmentItemValue,\r\n ): string {\r\n return (\r\n attachment.id ?? attachment.fileName ?? attachment.name ?? String(index)\r\n );\r\n }\r\n\r\n attachmentTooltip(attachment: EntityAttachmentItemValue): string {\r\n const name =\r\n attachment.name ??\r\n attachment.fileName ??\r\n attachment.id ??\r\n this.transloco.translate('components.entitiesPreview.attachment');\r\n\r\n return this.transloco.translate(\r\n 'components.entitiesPreview.downloadAttachment',\r\n { name },\r\n );\r\n }\r\n\r\n /**\r\n * Compact chips are clickable downloads but only show a file-type glyph,\r\n * which doesn't read as actionable. Swap to a download icon while hovered\r\n * so the action is obvious.\r\n */\r\n attachmentActionIcon(\r\n index: number,\r\n attachment: EntityAttachmentItemValue,\r\n ): MTIcon {\r\n return this.hoveredAttachmentKey() ===\r\n this.attachmentTrackBy(index, attachment)\r\n ? 'general.download-01'\r\n : this.attachmentIcon(attachment);\r\n }\r\n\r\n attachmentIcon(attachment: EntityAttachmentItemValue): MTIcon {\r\n const extension = this.resolveExtension(attachment);\r\n const contentType = attachment.contentType?.toLowerCase() ?? '';\r\n\r\n if (contentType.startsWith('image/')) {\r\n return 'image.image-03';\r\n }\r\n\r\n switch (extension) {\r\n case '.pdf':\r\n return 'file.file-06';\r\n case '.doc':\r\n case '.docx':\r\n case '.txt':\r\n case '.rtf':\r\n return 'file.file-04';\r\n case '.xls':\r\n case '.xlsx':\r\n case '.csv':\r\n return 'file.file-03';\r\n case '.ppt':\r\n case '.pptx':\r\n return 'file.file-05';\r\n default:\r\n return 'file.clipboard-attachment';\r\n }\r\n }\r\n\r\n onCompactAttachmentClick(\r\n event: MouseEvent,\r\n attachment: EntityAttachmentItemValue,\r\n ): void {\r\n event.stopPropagation();\r\n this.downloadAttachment(attachment);\r\n }\r\n\r\n downloadAttachment(attachment: EntityAttachmentItemValue): void {\r\n const resolvedAttachment$ = this.requiresMetadataRequest(attachment)\r\n ? this.resolveAttachment$(attachment)\r\n : of(this.normalizeAttachmentItem(attachment));\r\n\r\n resolvedAttachment$\r\n .pipe(\r\n take(1),\r\n switchMap((resolvedAttachment) => {\r\n if (!resolvedAttachment?.fileName) {\r\n return EMPTY;\r\n }\r\n\r\n return this.httpClient\r\n .get(`${this.endPoint()}/${resolvedAttachment.fileName}`, {\r\n responseType: 'blob',\r\n context: this.context(),\r\n })\r\n .pipe(\r\n take(1),\r\n map((blob) => ({\r\n attachment: resolvedAttachment,\r\n blob,\r\n })),\r\n );\r\n }),\r\n )\r\n .subscribe(({ attachment, blob }) => {\r\n const downloadBlob = new Blob([blob], {\r\n type:\r\n attachment.contentType || blob.type || 'application/octet-stream',\r\n });\r\n const objectUrl = window.URL.createObjectURL(downloadBlob);\r\n const anchor = document.createElement('a');\r\n\r\n anchor.href = objectUrl;\r\n anchor.download =\r\n attachment.name ??\r\n attachment.fileName ??\r\n attachment.id ??\r\n 'attachment';\r\n anchor.click();\r\n\r\n window.URL.revokeObjectURL(objectUrl);\r\n });\r\n }\r\n\r\n private resolveAttachment$(reference: AttachmentReference) {\r\n const normalizedAttachment = this.normalizeAttachmentItem(reference);\r\n\r\n if (!this.requiresMetadataRequest(reference)) {\r\n return of(normalizedAttachment);\r\n }\r\n\r\n const attachmentId =\r\n typeof reference === 'string' ? reference.trim() : reference.id?.trim();\r\n\r\n if (!attachmentId) {\r\n return of(normalizedAttachment);\r\n }\r\n\r\n return this.httpClient\r\n .get<AttachmentMetadataResponse>(\r\n `${this.endPoint()}/${attachmentId}/metaData`,\r\n {\r\n context: this.context(),\r\n },\r\n )\r\n .pipe(\r\n take(1),\r\n map((response) => this.normalizeAttachmentItem(response.data)),\r\n catchError(() => of(normalizedAttachment)),\r\n );\r\n }\r\n\r\n private normalizeAttachmentValue(value: unknown): AttachmentReference[] {\r\n if (value === null || value === undefined) {\r\n return [];\r\n }\r\n\r\n if (Array.isArray(value)) {\r\n return value.flatMap((item) => this.normalizeAttachmentValue(item));\r\n }\r\n\r\n if (typeof value === 'string') {\r\n const trimmedValue = value.trim();\r\n\r\n if (!trimmedValue || trimmedValue === '[]') {\r\n return [];\r\n }\r\n\r\n if (\r\n (trimmedValue.startsWith('[') && trimmedValue.endsWith(']')) ||\r\n (trimmedValue.startsWith('{') && trimmedValue.endsWith('}'))\r\n ) {\r\n try {\r\n return this.normalizeAttachmentValue(JSON.parse(trimmedValue));\r\n } catch {\r\n return [trimmedValue];\r\n }\r\n }\r\n\r\n return [trimmedValue];\r\n }\r\n\r\n if (typeof value === 'object') {\r\n const envelope = value as {\r\n value?: unknown;\r\n attachments?: unknown;\r\n id?: unknown;\r\n fileName?: unknown;\r\n name?: unknown;\r\n };\r\n\r\n // Backend attachment envelope:\r\n // { value: <id | id[]>, attachments: [{ value: <id>, name, fileName }] }\r\n // The stored items don't carry the storage key (their `fileName` is the\r\n // display name), only the upload id, so resolve every attachment by its\r\n // id through the metadata endpoint — the same contract\r\n // `mt-upload-field` uses.\r\n if (Array.isArray(envelope.attachments)) {\r\n return envelope.attachments.flatMap((item) =>\r\n this.normalizeAttachmentValue(item),\r\n );\r\n }\r\n\r\n // A single backend attachment item carries its upload id under `value`.\r\n if (\r\n typeof envelope.value === 'string' &&\r\n envelope.id === undefined &&\r\n (envelope.fileName !== undefined || envelope.name !== undefined)\r\n ) {\r\n return this.normalizeAttachmentValue(envelope.value);\r\n }\r\n\r\n // Envelope with no resolved attachments yet — unwrap the inner id(s).\r\n if (\r\n 'value' in envelope &&\r\n envelope.id === undefined &&\r\n envelope.fileName === undefined &&\r\n envelope.name === undefined\r\n ) {\r\n return this.normalizeAttachmentValue(envelope.value);\r\n }\r\n\r\n return [value as EntityAttachmentItemValue];\r\n }\r\n\r\n return [];\r\n }\r\n\r\n private normalizeAttachmentItem(\r\n value: AttachmentReference | null | undefined,\r\n ): EntityAttachmentItemValue | null {\r\n if (!value) {\r\n return null;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n const trimmedValue = value.trim();\r\n\r\n return trimmedValue\r\n ? {\r\n id: trimmedValue,\r\n name: trimmedValue,\r\n }\r\n : null;\r\n }\r\n\r\n const normalizedAttachment: EntityAttachmentItemValue = {\r\n ...value,\r\n name: value.name ?? value.fileName ?? value.id ?? '',\r\n extension: this.resolveExtension(value),\r\n };\r\n\r\n return normalizedAttachment.name ||\r\n normalizedAttachment.fileName ||\r\n normalizedAttachment.id\r\n ? normalizedAttachment\r\n : null;\r\n }\r\n\r\n private requiresMetadataRequest(reference: AttachmentReference): boolean {\r\n if (typeof reference === 'string') {\r\n return reference.trim().length > 0;\r\n }\r\n\r\n return !!reference.id?.trim() && !reference.fileName;\r\n }\r\n\r\n private isAttachmentItemValue(\r\n reference: AttachmentReference,\r\n ): reference is EntityAttachmentItemValue {\r\n return typeof reference === 'object' && reference != null;\r\n }\r\n\r\n private resolveExtension(\r\n value: EntityAttachmentItemValue,\r\n ): string | undefined {\r\n const explicitExtension = value.extension?.trim();\r\n\r\n if (explicitExtension) {\r\n return explicitExtension.startsWith('.')\r\n ? explicitExtension.toLowerCase()\r\n : `.${explicitExtension.toLowerCase()}`;\r\n }\r\n\r\n const fileName = value.fileName ?? value.name;\r\n if (!fileName || !fileName.includes('.')) {\r\n return undefined;\r\n }\r\n\r\n return `.${fileName.split('.').pop()!.toLowerCase()}`;\r\n }\r\n\r\n private normalizeAcceptTypes(value: unknown): string | undefined {\r\n if (Array.isArray(value)) {\r\n const acceptTypes = value\r\n .map((item) => (typeof item === 'string' ? item.trim() : ''))\r\n .filter(Boolean);\r\n\r\n return acceptTypes.length ? acceptTypes.join(',') : undefined;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n const acceptTypes = value.trim();\r\n return acceptTypes || undefined;\r\n }\r\n\r\n return undefined;\r\n }\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"relaxed\"\r\n>\r\n @if (hasAttachments()) {\r\n @if (shape() === \"compact\") {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (\r\n attachment of attachments();\r\n track attachmentTrackBy($index, attachment)\r\n ) {\r\n <mt-button\r\n iconPos=\"top\"\r\n size=\"small\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n [icon]=\"attachmentActionIcon($index, attachment)\"\r\n [tooltip]=\"attachmentTooltip(attachment)\"\r\n styleClass=\"h-9! w-9! rounded-lg! transition-all duration-200 hover:scale-105 hover:border-primary-500! hover:text-primary-600! hover:bg-primary-50!\"\r\n (onClick)=\"onCompactAttachmentClick($event, attachment)\"\r\n (mouseenter)=\"\r\n hoveredAttachmentKey.set(attachmentTrackBy($index, attachment))\r\n \"\r\n (mouseleave)=\"hoveredAttachmentKey.set(null)\"\r\n (onFocus)=\"\r\n hoveredAttachmentKey.set(attachmentTrackBy($index, attachment))\r\n \"\r\n (onBlur)=\"hoveredAttachmentKey.set(null)\"\r\n />\r\n }\r\n </div>\r\n } @else {\r\n <mt-upload-field\r\n class=\"w-full\"\r\n [ngModel]=\"uploadValue()\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [shape]=\"'card'\"\r\n [multiple]=\"isMultiple()\"\r\n [readonly]=\"true\"\r\n [endPoint]=\"endPoint()\"\r\n [accept]=\"acceptTypes()\"\r\n [context]=\"context()\"\r\n />\r\n }\r\n } @else {\r\n <span class=\"text-sm font-semibold\">{{ empty }}</span>\r\n }\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { displayOrPlaceholder } from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityData, EntityLocationValue } from '../entity.model';\r\n\r\n@Component({\r\n selector: 'mt-entity-location',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityField, Icon, TruncateTooltip],\r\n templateUrl: './entity-location.html',\r\n})\r\nexport class EntityLocation {\r\n readonly data = input<EntityData>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? '');\r\n readonly location = computed(() =>\r\n normalizeEntityLocation(this.data()?.value),\r\n );\r\n readonly displayValue = computed(() =>\r\n displayOrPlaceholder(\r\n this.location()?.display_name ?? this.location()?.address ?? null,\r\n ),\r\n );\r\n readonly coordinates = computed(() => {\r\n const location = this.location();\r\n const lat = location?.lat;\r\n const lon = location?.lon ?? location?.lng;\r\n if (lat === undefined || lon === undefined || lat === '' || lon === '') {\r\n return '';\r\n }\r\n return `${lat}, ${lon}`;\r\n });\r\n readonly mapsUrl = computed(() => {\r\n const location = this.location();\r\n const lat = location?.lat;\r\n const lon = location?.lon ?? location?.lng;\r\n if (lat === undefined || lon === undefined || lat === '' || lon === '') {\r\n return '';\r\n }\r\n return `https://www.google.com/maps/?q=${encodeURIComponent(`${lat},${lon}`)}`;\r\n });\r\n}\r\n\r\nfunction normalizeEntityLocation(\r\n value: EntityData['value'] | undefined,\r\n): EntityLocationValue | null {\r\n if (value === null || value === undefined || value === '') {\r\n return null;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n const trimmed = value.trim();\r\n if (!trimmed) return null;\r\n\r\n try {\r\n return normalizeEntityLocation(\r\n JSON.parse(trimmed) as EntityData['value'],\r\n );\r\n } catch {\r\n return {\r\n display_name: trimmed,\r\n address: trimmed,\r\n };\r\n }\r\n }\r\n\r\n if (typeof value !== 'object' || Array.isArray(value)) {\r\n return {\r\n display_name: String(value),\r\n address: String(value),\r\n };\r\n }\r\n\r\n const source = value as Record<string, unknown>;\r\n const displayName =\r\n readString(source['display_name']) ??\r\n readString(source['displayName']) ??\r\n readString(source['address']) ??\r\n readString(source['name']);\r\n const lon = source['lon'] ?? source['lng'];\r\n\r\n return {\r\n ...source,\r\n ...(displayName ? { display_name: displayName, address: displayName } : {}),\r\n ...(lon !== undefined ? { lon: lon as string | number } : {}),\r\n };\r\n}\r\n\r\nfunction readString(value: unknown): string | undefined {\r\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [labelIconName]=\"'map.marker-pin-01'\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (mapsUrl()) {\r\n <a\r\n [href]=\"mapsUrl()\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n class=\"flex min-w-0 max-w-full items-center gap-1.5 text-sm font-semibold text-primary-600 hover:text-primary-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"map.marker-pin-01\" size=\"sm\" class=\"shrink-0\" />\r\n <span class=\"min-w-0 truncate\">{{ displayValue() }}</span>\r\n </a>\r\n } @else {\r\n <div\r\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n {{ displayValue() }}\r\n </div>\r\n }\r\n\r\n @if (coordinates()) {\r\n <div class=\"min-w-0 truncate text-xs text-gray-500\">\r\n {{ coordinates() }}\r\n </div>\r\n }\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\r\nimport { displayOrPlaceholder } from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityConnectionValue, EntityData } from '../entity.model';\r\n\r\n@Component({\r\n selector: 'mt-entity-connection',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField, TruncateTooltip],\r\n templateUrl: './entity-connection.html',\r\n})\r\nexport class EntityConnection {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<EntityConnectionValue | string>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n /** The connection display lives on `rawValue.display`; fall back to `value`. */\r\n readonly connection = computed<EntityConnectionValue | null>(() => {\r\n const d = this.data();\r\n return (\r\n normalizeEntityConnection(d?.value ?? d?.rawValue) ??\r\n normalizeEntityConnection(this.value())\r\n );\r\n });\r\n\r\n readonly displayValue = computed(() =>\r\n displayOrPlaceholder(this.connection()?.display),\r\n );\r\n}\r\n\r\nfunction normalizeEntityConnection(\r\n value: unknown,\r\n): EntityConnectionValue | null {\r\n if (value === null || value === undefined || value === '') {\r\n return null;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n const trimmed = value.trim();\r\n if (!trimmed) return null;\r\n\r\n try {\r\n return normalizeEntityConnection(JSON.parse(trimmed));\r\n } catch {\r\n return { display: trimmed };\r\n }\r\n }\r\n\r\n if (typeof value !== 'object' || Array.isArray(value)) {\r\n return { display: String(value) };\r\n }\r\n\r\n const source = value as Record<string, unknown>;\r\n // Parsed payload uses `display`; the serialized JSON value uses `Display`.\r\n const display =\r\n typeof source['display'] === 'string'\r\n ? (source['display'] as string)\r\n : typeof source['Display'] === 'string'\r\n ? (source['Display'] as string)\r\n : undefined;\r\n\r\n return { ...source, ...(display !== undefined ? { display } : {}) };\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n {{ displayValue() }}\r\n </div>\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { Chip } from '@masterteam/components/chip';\r\nimport { ENTITY_EMPTY_VALUE_PLACEHOLDER } from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityData, EntityScheduleItemValue } from '../entity.model';\r\n\r\n/**\r\n * Preview renderer for `ScheduleItemSelector` properties.\r\n *\r\n * The value is the array of resolved schedule items returned by runtime\r\n * rendering (`{ id, name, status, ... }`); each one is shown as a chip.\r\n */\r\n@Component({\r\n selector: 'mt-entity-schedule-item',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityField, Chip],\r\n templateUrl: './entity-schedule-item.html',\r\n})\r\nexport class EntityScheduleItem {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? '');\r\n\r\n readonly items = computed<EntityScheduleItemValue[]>(() => {\r\n const value = this.data()?.value;\r\n if (!Array.isArray(value)) return [];\r\n return (value as unknown[]).filter(\r\n (item): item is EntityScheduleItemValue =>\r\n !!item && typeof item === 'object' && 'name' in item,\r\n );\r\n });\r\n\r\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n}\r\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (items().length) {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (item of items(); track item.id) {\r\n <mt-chip [label]=\"item.name\" size=\"small\" />\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","import {\r\n EntityListLocalCell,\r\n EntityListLocalRow,\r\n EntityListLocalSchema,\r\n EntityListLocalSchemaField,\r\n EntityListTranslatable,\r\n} from './entity.model';\r\n\r\n/**\r\n * Pure helpers shared by everything that reads a Local `EntityList`\r\n * (`storageMode: \"Local\"`) — the runtime field that edits it and the preview\r\n * that only renders it. See `.github/instructions/properties/EntityList.md`.\r\n */\r\n\r\n/**\r\n * The schema's fields a row is rendered with, in order.\r\n *\r\n * A removed field stays in the stored schema as `hidden` so its values survive\r\n * and come back if it is re-added. The projected schema of a loaded value has\r\n * already dropped them, but the configuration's copy — what a create form falls\r\n * back to — has not.\r\n */\r\nexport function visibleLocalSchemaFields(\r\n schema: EntityListLocalSchema | null | undefined,\r\n): EntityListLocalSchemaField[] {\r\n const fields = Array.isArray(schema?.fields) ? schema.fields : [];\r\n return fields\r\n .filter((field) => !!field && !field.hidden && !!field.id)\r\n .slice()\r\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\r\n}\r\n\r\nfunction pickTranslatable(\r\n value: EntityListTranslatable | null | undefined,\r\n lang: string,\r\n): string {\r\n if (!value) return '';\r\n const own = lang === 'ar' ? value.ar : value.en;\r\n const other = lang === 'ar' ? value.en : value.ar;\r\n return (own ?? '').trim() || (other ?? '').trim();\r\n}\r\n\r\n/**\r\n * The label a field renders under: its local override, then the source label\r\n * captured when it was published, then its key. The publisher writes an\r\n * override into the captured definition as well, so either path shows it.\r\n */\r\nexport function resolveLocalFieldLabel(\r\n field: EntityListLocalSchemaField,\r\n lang = 'en',\r\n): string {\r\n const definition = field.definition;\r\n return (\r\n pickTranslatable(field.label, lang) ||\r\n pickTranslatable(\r\n { en: definition?.nameEn, ar: definition?.nameAr },\r\n lang,\r\n ) ||\r\n (definition?.name ?? '').trim() ||\r\n field.sourceKey\r\n );\r\n}\r\n\r\n/** The source view type the field captured; `Text` when none was. */\r\nexport function resolveLocalFieldViewType(\r\n field: EntityListLocalSchemaField,\r\n): string {\r\n return field.definition?.viewType || 'Text';\r\n}\r\n\r\n/**\r\n * The captured source configuration (lookup id, percentage colour rules …).\r\n * `PropertyDefinitionReadDto.configuration` is typed `object?`, so the backend\r\n * writes whatever the source held — an object, or its JSON text.\r\n */\r\nexport function resolveLocalFieldConfiguration(\r\n field: EntityListLocalSchemaField,\r\n): Record<string, unknown> | null {\r\n const configuration = field.definition?.configuration;\r\n if (!configuration) return null;\r\n if (typeof configuration !== 'string') return configuration;\r\n try {\r\n const parsed: unknown = JSON.parse(configuration);\r\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\r\n ? (parsed as Record<string, unknown>)\r\n : null;\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\n/** A row's cells keyed by field id. */\r\nexport function localCellsByFieldId(\r\n row: EntityListLocalRow,\r\n): Map<string, EntityListLocalCell> {\r\n const map = new Map<string, EntityListLocalCell>();\r\n for (const cell of Array.isArray(row?.cells) ? row.cells : []) {\r\n if (cell?.fieldId) map.set(cell.fieldId, cell);\r\n }\r\n return map;\r\n}\r\n\r\n/** Rows in their stored order. */\r\nexport function sortLocalRows(\r\n rows: readonly EntityListLocalRow[] | null | undefined,\r\n): EntityListLocalRow[] {\r\n return (Array.isArray(rows) ? rows : [])\r\n .filter((row) => !!row?.rowId)\r\n .slice()\r\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\r\n}\r\n","import {\r\n EntityConfiguration,\r\n EntityData,\r\n EntityListEntityValue,\r\n EntityListInlineFieldMeta,\r\n EntityListLocalDocument,\r\n EntityListLocalSchema,\r\n EntityListRowValue,\r\n EntityListSelectionDocument,\r\n EntityPropertyConfiguration,\r\n EntityViewType,\r\n isEntityListLocalDocument,\r\n isEntityListSelectionDocument,\r\n} from './entity.model';\r\nimport {\r\n localCellsByFieldId,\r\n resolveLocalFieldConfiguration,\r\n resolveLocalFieldLabel,\r\n resolveLocalFieldViewType,\r\n sortLocalRows,\r\n visibleLocalSchemaFields,\r\n} from './entity-list-local.util';\r\n\r\n/** One rendered row of an `EntityList` value: a title plus the rest. */\r\nexport interface EntityListRenderedRow {\r\n id: string;\r\n /** First field by order — the row's own name. */\r\n title: EntityData | null;\r\n /** Everything else, already stripped of machine companions. */\r\n fields: EntityData[];\r\n}\r\n\r\n/**\r\n * Nested fields render as small labelled pairs. The row is the unit of\r\n * meaning, so labels sit above their values and stay muted.\r\n */\r\nconst NESTED_FIELD_CONFIG: EntityConfiguration = {\r\n labelPosition: 'top',\r\n hideLabel: false,\r\n};\r\n\r\n/**\r\n * A badge already says what it is: \"Status\" stacked above a green \"Completed\"\r\n * pill is one wasted line per row. Applies only to the folded `_key`/`_color`\r\n * status, whose display text is its own label.\r\n */\r\nconst BADGE_FIELD_CONFIG: EntityConfiguration = {\r\n hideLabel: true,\r\n};\r\n\r\n/** The title renders bare — the row itself is the label. */\r\nconst TITLE_FIELD_CONFIG: EntityConfiguration = {\r\n hideLabel: true,\r\n};\r\n\r\n/**\r\n * Suffixes that mark a field as the *machine companion* of another field\r\n * present in the same list — `status_key` and `status_color` describe\r\n * `status`, they are not values of their own. Folded into a single `Status`\r\n * entity so the trio renders as one coloured badge, which is what the backend\r\n * emits them for.\r\n */\r\nconst COMPANION_SUFFIXES = ['key', 'color'] as const;\r\n\r\nfunction normalizeViewType(viewType: string | undefined): EntityViewType {\r\n return (viewType ?? 'Text') as EntityViewType;\r\n}\r\n\r\n/**\r\n * Identifier fields are plumbing, not content: a row that reads\r\n * \"Schema Phase Gate Item Id: 5\" tells the reader nothing. Only `Number`\r\n * fields are dropped, so a genuine text field ending in `_id` still renders.\r\n */\r\nfunction isIdentifierField(meta: EntityListInlineFieldMeta): boolean {\r\n return (\r\n normalizeViewType(meta.viewType) === 'Number' &&\r\n meta.key.toLowerCase().endsWith('_id')\r\n );\r\n}\r\n\r\n/**\r\n * Derive a readable label from a raw field key. Inline `EntityList` fields\r\n * carry no label of their own — the configuration defines them as bare keys —\r\n * so this strips separators and title-cases what is left.\r\n */\r\nexport function humanizeEntityListKey(key: string): string {\r\n const words = key\r\n .replace(/[_-]+/g, ' ')\r\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\r\n .trim();\r\n if (!words) return key;\r\n return words.charAt(0).toUpperCase() + words.slice(1);\r\n}\r\n\r\n/**\r\n * The value arrives parsed when the host hands over the rendered cell, and as\r\n * JSON when it comes through `rawValue` — the table serializes object cells on\r\n * the way in.\r\n */\r\nfunction coerceValue(\r\n data: EntityData,\r\n):\r\n | EntityListEntityValue\r\n | EntityListLocalDocument\r\n | EntityListSelectionDocument\r\n | null {\r\n const value = data.value;\r\n if (value && typeof value === 'object' && !Array.isArray(value)) {\r\n return value as EntityListEntityValue;\r\n }\r\n\r\n const raw = typeof value === 'string' && value ? value : data.rawValue;\r\n if (typeof raw !== 'string' || !raw.trim()) return null;\r\n\r\n try {\r\n const parsed: unknown = JSON.parse(raw);\r\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\r\n ? (parsed as EntityListEntityValue)\r\n : null;\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * The inline field catalog. `propertyConfiguration` is the untouched catalog\r\n * entry; `configuration` is read as well because the table merges its own\r\n * display flags into that object when it builds a cell.\r\n */\r\nfunction readInlineFields(data: EntityData): EntityListInlineFieldMeta[] {\r\n const sources: EntityPropertyConfiguration[] = [\r\n data.propertyConfiguration ?? null,\r\n (data.configuration ?? null) as EntityPropertyConfiguration,\r\n ];\r\n\r\n for (const source of sources) {\r\n if (!source || Array.isArray(source)) continue;\r\n const fields = (source as Record<string, unknown>)['inlineFields'];\r\n if (Array.isArray(fields) && fields.length > 0) {\r\n return fields as EntityListInlineFieldMeta[];\r\n }\r\n }\r\n\r\n return [];\r\n}\r\n\r\n/**\r\n * The field this one is a machine companion of, when that field is present in\r\n * the same list. `status_color` returns `status`; a standalone `color` field\r\n * with no `color` sibling returns null and renders normally.\r\n */\r\nfunction companionTargetOf(\r\n field: EntityListInlineFieldMeta,\r\n present: Set<string>,\r\n): string | null {\r\n for (const suffix of COMPANION_SUFFIXES) {\r\n if (!field.key.endsWith(`_${suffix}`)) continue;\r\n const target = field.key.slice(0, -(suffix.length + 1));\r\n if (target && present.has(target)) return target;\r\n }\r\n return null;\r\n}\r\n\r\n/** Field definitions in render order, machine companions already removed. */\r\nfunction visibleFields(\r\n data: EntityData,\r\n allowed: readonly string[],\r\n): EntityListInlineFieldMeta[] {\r\n const declared = [...readInlineFields(data)].sort(\r\n (a, b) => (a.order ?? 0) - (b.order ?? 0),\r\n );\r\n const present = new Set(declared.map((field) => field.key));\r\n const visible = declared.filter(\r\n (field) => !isIdentifierField(field) && !companionTargetOf(field, present),\r\n );\r\n\r\n if (allowed.length === 0) return visible;\r\n\r\n const byKey = new Map(visible.map((field) => [field.key, field]));\r\n return allowed\r\n .map((key) => byKey.get(key))\r\n .filter((field): field is EntityListInlineFieldMeta => !!field);\r\n}\r\n\r\nfunction valuesByKey(row: EntityListRowValue): Map<string, string | null> {\r\n const map = new Map<string, string | null>();\r\n for (const item of row.values ?? []) {\r\n if (item?.propertyKey) map.set(item.propertyKey, item.rawValue ?? null);\r\n }\r\n return map;\r\n}\r\n\r\n/**\r\n * Builds the entity for one nested field. A field with a `_key`/`_color`\r\n * companion becomes a `Status`, so the trio renders as one coloured badge\r\n * instead of three separate cells.\r\n */\r\nfunction toNestedEntity(\r\n field: EntityListInlineFieldMeta,\r\n values: Map<string, string | null>,\r\n): EntityData | null {\r\n const raw = values.get(field.key) ?? null;\r\n const color = values.get(`${field.key}_color`);\r\n const statusKey = values.get(`${field.key}_key`);\r\n\r\n const base = {\r\n key: field.key,\r\n name: humanizeEntityListKey(field.key),\r\n propertyConfiguration: field.configuration,\r\n configuration: NESTED_FIELD_CONFIG,\r\n order: field.order,\r\n };\r\n\r\n if (color !== undefined || statusKey !== undefined) {\r\n // No display text means no badge to show — an empty status is empty.\r\n if (!raw) return null;\r\n return {\r\n ...base,\r\n configuration: BADGE_FIELD_CONFIG,\r\n rawValue: raw,\r\n viewType: 'Status',\r\n value: { key: statusKey ?? raw, display: raw, color: color ?? '' },\r\n };\r\n }\r\n\r\n return {\r\n ...base,\r\n rawValue: raw ?? undefined,\r\n viewType: normalizeViewType(field.viewType),\r\n value: raw ?? '',\r\n };\r\n}\r\n\r\n/**\r\n * Turns an `EntityList` entity into rendered rows.\r\n *\r\n * Nothing is fetched: the value already carries `rows[]`, and the property\r\n * configuration's `inlineFields` is the only description of the nested columns\r\n * — the rows themselves carry bare keys. Shared by the trigger\r\n * (`mt-entity-list-preview`, which needs the count and the titles) and the\r\n * drawer that renders them in full.\r\n *\r\n * `allowed` narrows to those keys, in that order; empty renders every field\r\n * that survives the companion and identifier rules.\r\n */\r\nexport function buildEntityListRows(\r\n data: EntityData,\r\n allowed: readonly string[] = [],\r\n lang = 'en',\r\n): EntityListRenderedRow[] {\r\n const value = coerceValue(data);\r\n if (isEntityListLocalDocument(value)) {\r\n return buildLocalRows(value, data, allowed, lang);\r\n }\r\n if (isEntityListSelectionDocument(value)) {\r\n return buildSelectionRows(value, data, allowed);\r\n }\r\n\r\n const fields = visibleFields(data, allowed);\r\n const rows = value?.rows;\r\n if (!Array.isArray(rows)) return [];\r\n\r\n return rows\r\n .filter((row) => !!row)\r\n .map((row, index) => {\r\n const values = valuesByKey(row);\r\n const rendered = fields\r\n .map((field) => toNestedEntity(field, values))\r\n .filter((entity): entity is EntityData => !!entity);\r\n\r\n // The title is the first field that actually rendered, not the first\r\n // that was declared: a leading field can drop out (an empty status\r\n // renders nothing), and the survivor promoted into the title slot must\r\n // lose its label there rather than keep the one it was built with.\r\n const [first, ...rest] = rendered;\r\n\r\n return {\r\n id: String(row.rowId ?? row.entityId ?? index),\r\n title: first ? { ...first, configuration: TITLE_FIELD_CONFIG } : null,\r\n fields: rest,\r\n };\r\n });\r\n}\r\n\r\n/**\r\n * Rows of a Local list (`storageMode: \"Local\"`).\r\n *\r\n * The projected document `process-form-load` returns carries its own\r\n * `schema`, and it wins: pending and approved evidence is pinned to the schema\r\n * it was submitted against, which the property configuration's *active* one\r\n * may no longer be. The fetch endpoints project against the active schema;\r\n * an older backend returned the stored document there (`schema: null`), for\r\n * which the configuration's `localSchema` is the fallback.\r\n * Cells are keyed by the field's local id and carry the backend-rendered\r\n * `value` beside `rawValue` where one was rendered; otherwise the raw value\r\n * shows.\r\n *\r\n * `allowed` narrows by source key, the one identity the host can know.\r\n */\r\nfunction buildLocalRows(\r\n document: EntityListLocalDocument,\r\n data: EntityData,\r\n allowed: readonly string[],\r\n lang: string,\r\n): EntityListRenderedRow[] {\r\n const declared = visibleLocalSchemaFields(\r\n document.schema ?? readConfiguredLocalSchema(data),\r\n );\r\n const bySourceKey = new Map(\r\n declared.map((field) => [field.sourceKey, field]),\r\n );\r\n const fields =\r\n allowed.length === 0\r\n ? declared\r\n : allowed\r\n .map((key) => bySourceKey.get(key))\r\n .filter((field): field is (typeof declared)[number] => !!field);\r\n\r\n return sortLocalRows(document.localRows).map((row) => {\r\n const cells = localCellsByFieldId(row);\r\n const rendered = fields.map<EntityData>((field) => {\r\n const cell = cells.get(field.id as string);\r\n const rawValue = cell?.rawValue ?? undefined;\r\n return {\r\n key: field.sourceKey,\r\n name: resolveLocalFieldLabel(field, lang),\r\n viewType: normalizeViewType(resolveLocalFieldViewType(field)),\r\n value: (cell?.value ?? rawValue ?? '') as EntityData['value'],\r\n rawValue,\r\n propertyConfiguration:\r\n resolveLocalFieldConfiguration(field) ?? undefined,\r\n configuration: NESTED_FIELD_CONFIG,\r\n order: field.order,\r\n };\r\n });\r\n\r\n // The title names the row, and it renders without its label. The first\r\n // field of a Local list is whatever the field manager put first — often a\r\n // progress bar or a date, which as a bare headline reads as the row's\r\n // name. So the title is the first filled text field; everything else keeps\r\n // its label, in schema order. A row with no text to name it has no title.\r\n const titleIndex = rendered.findIndex(isRowNameField);\r\n const title = titleIndex >= 0 ? rendered[titleIndex] : null;\r\n\r\n return {\r\n id: row.rowId,\r\n title: title ? { ...title, configuration: TITLE_FIELD_CONFIG } : null,\r\n fields: rendered.filter((_, index) => index !== titleIndex),\r\n };\r\n });\r\n}\r\n\r\n/**\r\n * Rows of a Selected list (`recordMode: \"Selected\"`): one per selected record\r\n * the value carries values for, in selection order.\r\n *\r\n * Here there is no metadata request, so nothing names the fields or their\r\n * view types: labels come from the keys and each value renders as its display\r\n * text. A record whose values the backend withheld (`unavailableIds`) has\r\n * nothing to show and is left out.\r\n *\r\n * `allowed` narrows by field key; otherwise the configured `readFields`\r\n * order, then the order the values arrived in.\r\n */\r\nfunction buildSelectionRows(\r\n document: EntityListSelectionDocument,\r\n data: EntityData,\r\n allowed: readonly string[],\r\n): EntityListRenderedRow[] {\r\n const records = new Map(\r\n (document.records ?? []).map((record) => [record.entityId, record]),\r\n );\r\n const ids = document.entityIds?.length\r\n ? document.entityIds\r\n : [...records.keys()];\r\n const configured = readConfiguredReadFields(data);\r\n\r\n return ids.flatMap((id) => {\r\n const record = records.get(id);\r\n if (!record) return [];\r\n const values = new Map(\r\n (record.values ?? []).map((item) => [item.propertyKey, item]),\r\n );\r\n const keys = allowed.length\r\n ? allowed\r\n : configured.length\r\n ? configured\r\n : [...values.keys()];\r\n const rendered = keys\r\n .map((key) => values.get(key))\r\n .filter((item) => !!item)\r\n .map<EntityData>((item, index) => ({\r\n key: item.propertyKey,\r\n name: humanizeEntityListKey(item.propertyKey),\r\n ...selectionCell(item.value, item.rawValue),\r\n rawValue: item.rawValue ?? undefined,\r\n configuration: NESTED_FIELD_CONFIG,\r\n order: index,\r\n }));\r\n const [first, ...rest] = rendered;\r\n\r\n return [\r\n {\r\n id: String(record.entityId),\r\n title: first ? { ...first, configuration: TITLE_FIELD_CONFIG } : null,\r\n fields: rest,\r\n },\r\n ];\r\n });\r\n}\r\n\r\n/** The configured displayed fields of a Selected list, if any. */\r\nfunction readConfiguredReadFields(data: EntityData): string[] {\r\n for (const source of [data.propertyConfiguration, data.configuration]) {\r\n if (!source || Array.isArray(source)) continue;\r\n const fields = (source as Record<string, unknown>)['readFields'];\r\n if (Array.isArray(fields) && fields.length) {\r\n return fields.filter(\r\n (key): key is string => typeof key === 'string' && !!key,\r\n );\r\n }\r\n }\r\n return [];\r\n}\r\n\r\n/** An ISO date or date-time, as the backend renders a Date / DateTime value. */\r\nconst ISO_DATE =\r\n /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:?\\d{2})?)?$/;\r\n\r\n/**\r\n * How one Selected cell renders without field metadata — a table cell has\r\n * none to ask for. The rendered value's own shape decides: an ISO date is a\r\n * `Date` (printed `2026/09/20`, not `2026-09-20T00:00:00.0000000Z`), a user\r\n * object a `User`, and everything else its display text.\r\n */\r\nfunction selectionCell(\r\n value: unknown,\r\n rawValue: string | null | undefined,\r\n): Pick<EntityData, 'viewType' | 'value'> {\r\n if (typeof value === 'string' && ISO_DATE.test(value.trim())) {\r\n return { viewType: 'Date', value: value.trim() };\r\n }\r\n if (\r\n value &&\r\n typeof value === 'object' &&\r\n !Array.isArray(value) &&\r\n typeof (value as Record<string, unknown>)['displayName'] === 'string'\r\n ) {\r\n return { viewType: 'User', value: value as EntityData['value'] };\r\n }\r\n return { viewType: 'Text', value: selectionDisplayText(value, rawValue) };\r\n}\r\n\r\n/**\r\n * A rendered source value as text: a scalar as is, a user or a lookup by its\r\n * display name, a list joined. Falls back to the stored scalar.\r\n */\r\nfunction selectionDisplayText(\r\n value: unknown,\r\n rawValue: string | null | undefined,\r\n): string {\r\n if (value == null || value === '') return rawValue ?? '';\r\n if (Array.isArray(value)) {\r\n return value\r\n .map((entry) => selectionDisplayText(entry, null))\r\n .filter((text) => !!text)\r\n .join(', ');\r\n }\r\n if (typeof value !== 'object') return String(value);\r\n\r\n const record = value as Record<string, unknown>;\r\n for (const key of ['display', 'displayName', 'name']) {\r\n const text = record[key];\r\n if (typeof text === 'string' && text.trim()) return text.trim();\r\n }\r\n return rawValue ?? '';\r\n}\r\n\r\n/** A text field with a value — something that can name a row. */\r\nfunction isRowNameField(entity: EntityData): boolean {\r\n if (entity.viewType !== 'Text' && entity.viewType !== 'LongText') {\r\n return false;\r\n }\r\n const value = entity.value;\r\n return typeof value === 'string' ? value.trim().length > 0 : value != null;\r\n}\r\n\r\n/** The active Local schema from the property configuration, if any. */\r\nfunction readConfiguredLocalSchema(\r\n data: EntityData,\r\n): EntityListLocalSchema | null {\r\n for (const source of [data.propertyConfiguration, data.configuration]) {\r\n if (!source || Array.isArray(source)) continue;\r\n const schema = (source as Record<string, unknown>)['localSchema'];\r\n if (schema && typeof schema === 'object') {\r\n return schema as EntityListLocalSchema;\r\n }\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * The row's title as plain text. A title that folded into a `Status` carries\r\n * an object, not a string — reading only the string case would silently drop\r\n * every row from the tooltip whenever the leading field is a status.\r\n */\r\nfunction titleTextOf(row: EntityListRenderedRow): string {\r\n const value = row.title?.value;\r\n if (typeof value === 'string') return value.trim();\r\n if (value && typeof value === 'object' && 'display' in value) {\r\n const display = (value as { display?: unknown }).display;\r\n return typeof display === 'string' ? display.trim() : '';\r\n }\r\n return '';\r\n}\r\n\r\n/**\r\n * Plain-text summary of the rows, for the trigger's tooltip. Caps the list so\r\n * a forty-item checklist does not become a forty-line tooltip.\r\n */\r\nexport function summarizeEntityListRows(\r\n rows: readonly EntityListRenderedRow[],\r\n limit: number,\r\n): { names: string[]; remaining: number } {\r\n const names = rows.map(titleTextOf).filter((name) => name.length > 0);\r\n\r\n return {\r\n names: names.slice(0, limit),\r\n remaining: Math.max(0, names.length - limit),\r\n };\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { TooltipModule } from 'primeng/tooltip';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { readableTextOn } from '@masterteam/components';\r\nimport {\r\n EntityData,\r\n EntityLeafDetailsConfig,\r\n LeafDetailsEntityValue,\r\n LeafDetailsStatusSummary,\r\n LeafLevelSavedConfig,\r\n LeafPhaseSavedConfig,\r\n} from '../entity.model';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { resolveLocalizedLabel } from '../entity-sections.util';\r\nimport { sharedActiveLang } from '../active-lang';\r\n\r\n/** Neutral grey for a status the catalog left without a colour. */\r\nconst DEFAULT_STATUS_COLOR = '#9CA3AF';\r\n\r\n@Component({\r\n selector: 'mt-entity-leaf-details',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityField, TooltipModule],\r\n templateUrl: './entity-leaf-details.html',\r\n})\r\nexport class EntityLeafDetails {\r\n private readonly transloco = inject(TranslocoService);\r\n\r\n readonly data = input.required<EntityData>();\r\n\r\n /**\r\n * Re-resolves the \"Phases\" qualifier when the user switches language. The\r\n * shared signal keeps this to one subscription for the whole grid — a cards\r\n * board mounts thousands of these.\r\n */\r\n private readonly activeLang = sharedActiveLang(this.transloco);\r\n\r\n readonly leafValue = computed<LeafDetailsEntityValue | null>(() => {\r\n const v = this.data().value;\r\n if (v && typeof v === 'object' && !Array.isArray(v) && 'levelId' in v) {\r\n return v as LeafDetailsEntityValue;\r\n }\r\n return null;\r\n });\r\n\r\n /** True when this item paints the level's phase badges instead of statuses. */\r\n readonly isPhaseItem = computed(() => this.leafValue()?.kind === 'phase');\r\n\r\n /**\r\n * This tile's own saved overrides — the `leafLevels` / `leafPhases` entry for\r\n * its child level. The two maps are kept apart because one level can render\r\n * both projections, each with its own slot, width and now label.\r\n */\r\n private readonly tileConfig = computed<\r\n LeafLevelSavedConfig | LeafPhaseSavedConfig | undefined\r\n >(() => {\r\n const levelId = this.leafValue()?.levelId;\r\n if (levelId == null) return undefined;\r\n const config = this.data().configuration as\r\n | EntityLeafDetailsConfig\r\n | undefined;\r\n const map = this.isPhaseItem() ? config?.leafPhases : config?.leafLevels;\r\n return map?.[String(levelId)];\r\n });\r\n\r\n /**\r\n * The badges to paint. Phases and statuses carry the same `{ key, display,\r\n * color, count }` shape, so one template drives both — only which projection\r\n * of the level is read differs.\r\n */\r\n readonly badges = computed<LeafDetailsStatusSummary[]>(() => {\r\n const leaf = this.leafValue();\r\n if (!leaf) return [];\r\n return this.isPhaseItem() ? (leaf.phases ?? []) : leaf.statuses;\r\n });\r\n\r\n /**\r\n * Label shown below the badges: \"Level Name (total)\", with a \"— Phases\"\r\n * qualifier on an unnamed phase item so a level configured with both\r\n * projections does not render two identically-labelled tiles.\r\n *\r\n * The custom label is read off the tile's OWN per-level entry, not from\r\n * `data().name` and not from the parent property's `configuration.label`.\r\n *\r\n * Not `name`, because for this view type it does not survive the trip: both\r\n * hosts resolve a label into `name` up front (`toEntityData` in\r\n * client-instance-preview, `openDrawer` in the customization builder), and\r\n * then `expandLeafDetailsEntity` rewrites `name` to the child level's own\r\n * name when it splits the property into one tile per level.\r\n *\r\n * Not the parent's label, because one property becomes many tiles — one per\r\n * child level, and again per projection. A label held on the parent paints\r\n * the same text on every one of them, which is what makes a card show\r\n * \"Delivery Portfolio (7)\" three times over. `order` and `size` were already\r\n * per-level for exactly this reason; the label follows them.\r\n *\r\n * A custom label owns the whole name. The \"— Phases\" qualifier is only the\r\n * *default* disambiguator for a level that renders both projections — once an\r\n * author names the phase tile themselves, appending it would force a suffix\r\n * onto text they wrote, and \"Delivery Stages — Phases\" is not something they\r\n * can spell their way out of. So the qualifier applies to the fallback name\r\n * only; the author is trusted to have distinguished the tile.\r\n *\r\n * `(total)` is the one thing always appended — the count is the point of the\r\n * tile, and it is live data, not part of anyone's label.\r\n */\r\n readonly labelWithTotal = computed(() => {\r\n const leaf = this.leafValue();\r\n const lang = this.activeLang();\r\n const custom = resolveLocalizedLabel(this.tileConfig()?.label, lang);\r\n const fallback = this.data().name || leaf?.levelName || '';\r\n const qualified =\r\n this.isPhaseItem() && fallback\r\n ? `${fallback} — ${this.transloco.translate('components.entitiesPreview.leafPhases', {}, lang)}`\r\n : fallback;\r\n const name = custom || qualified;\r\n if (!leaf) return name;\r\n const total = this.badges().reduce((sum, badge) => sum + badge.count, 0);\r\n return `${name} (${total})`;\r\n });\r\n\r\n readonly labelIcon = computed(() => this.leafValue()?.levelIcon ?? null);\r\n\r\n statusColor(color: string | null): string {\r\n return color ?? DEFAULT_STATUS_COLOR;\r\n }\r\n\r\n /**\r\n * Foreground for the count, chosen against the badge colour instead of always\r\n * white — a light catalog colour measured 2.59:1 with white on it, the lowest\r\n * contrast in the product (findings M-04, H-03).\r\n */\r\n statusTextColor(color: string | null): string {\r\n return readableTextOn(this.statusColor(color));\r\n }\r\n}\r\n","<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 — 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\">—</span>\r\n }\r\n </div>\r\n }\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { EntityData, EntityViewType } from '../entity.model';\r\nimport { EntityText } from '../entity-text/entity-text';\r\nimport { EntityLongText } from '../entity-long-text/entity-long-text';\r\nimport { EntityDate } from '../entity-date/entity-date';\r\nimport { EntityUser } from '../entity-user/entity-user';\r\nimport { EntityPercentage } from '../entity-percentage/entity-percentage';\r\nimport { EntityCurrency } from '../entity-currency/entity-currency';\r\nimport { EntityCheckbox } from '../entity-checkbox/entity-checkbox';\r\nimport { EntityLookup } from '../entity-lookup/entity-lookup';\r\nimport { EntityPhaseGate } from '../entity-phase-gate/entity-phase-gate';\r\nimport { EntityPerformanceScore } from '../entity-performance-score/entity-performance-score';\r\nimport { EntityAttachment } from '../entity-attachment/entity-attachment';\r\nimport { EntityStatus } from '../entity-status/entity-status';\r\nimport { EntityIcon } from '../entity-icon/entity-icon';\r\nimport { EntityLeafDetails } from '../entity-leaf-details/entity-leaf-details';\r\nimport { EntityLocation } from '../entity-location/entity-location';\r\nimport { EntityConnection } from '../entity-connection/entity-connection';\r\nimport { EntityScheduleItem } from '../entity-schedule-item/entity-schedule-item';\r\n\r\n/**\r\n * Renders an entity value by view type.\r\n *\r\n * `LookupModuleCheckList` is deliberately not handled here: that component\r\n * renders each of its nested properties *through* this one, so routing it back\r\n * through here would make the two files import each other. `EntityPreviewBody`\r\n * owns that case and delegates every other view type to this component.\r\n */\r\n@Component({\r\n selector: 'mt-entity-value-preview',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n EntityText,\r\n EntityLongText,\r\n EntityDate,\r\n EntityUser,\r\n EntityPercentage,\r\n EntityCurrency,\r\n EntityCheckbox,\r\n EntityLookup,\r\n EntityPhaseGate,\r\n EntityPerformanceScore,\r\n EntityAttachment,\r\n EntityStatus,\r\n EntityIcon,\r\n EntityLeafDetails,\r\n EntityLocation,\r\n EntityConnection,\r\n EntityScheduleItem,\r\n ],\r\n templateUrl: './entity-value-preview.html',\r\n host: {\r\n class: 'block min-w-0 w-full',\r\n },\r\n})\r\nexport class EntityValuePreview {\r\n readonly data = input.required<EntityData>();\r\n readonly attachmentShape = input<'default' | 'compact'>('default');\r\n\r\n /** Lookup variants share the same colored-badge renderer. */\r\n readonly previewType = computed<EntityViewType>(() => {\r\n const viewType = this.data().viewType;\r\n return viewType === 'LookupMatrix' || viewType === 'LookupMultiSelect'\r\n ? 'Lookup'\r\n : viewType;\r\n });\r\n}\r\n","@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 (\"Icon\") {\r\n <mt-entity-icon [data]=\"data()\" />\r\n }\r\n @case (\"PhaseGate\") {\r\n <mt-entity-phase-gate [data]=\"data()\" />\r\n }\r\n @case (\"PerformanceScore\") {\r\n <mt-entity-performance-score [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","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n Type,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { NgComponentOutlet } from '@angular/common';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { sharedActiveLang } from '../active-lang';\r\nimport { EntityValuePreview } from '../entity-preview/entity-value-preview';\r\nimport { EntityData } from '../entity.model';\r\nimport {\r\n buildEntityListRows,\r\n EntityListRenderedRow,\r\n} from '../entity-list-rows.util';\r\n\r\n/**\r\n * What `NgComponentOutlet` needs to render an `EntityList` table: the\r\n * read-only `mt-entity-list-field` (`ENTITY_LIST_TABLE_COMPONENT`) and its\r\n * inputs.\r\n */\r\nexport interface EntityListTableHost {\r\n component: Type<unknown>;\r\n inputs: Record<string, unknown>;\r\n}\r\n\r\n/**\r\n * The full nested `EntityList`, rendered in a drawer opened by\r\n * `mt-entity-list-preview`.\r\n *\r\n * It lives in a drawer rather than in the cell because the cell is a table\r\n * column: even three lines per row set the height of every row in the table,\r\n * and a checklist of fifteen made the grid unreadable. The drawer has the\r\n * width and height this content actually needs.\r\n *\r\n * With a `table` it renders the list the way a record preview does — the\r\n * read-only `mt-entity-list-field`, with its columns, typed cells and access\r\n * notices — for a table cell whose host knew the record's runtime ids.\r\n * Otherwise it renders the rows the value itself carries.\r\n *\r\n * Created through `ModalService`, so its inputs arrive via `inputValues` and\r\n * it is built with the **root** injector — nothing route-provided is visible\r\n * here, which is why it takes the already-resolved entity and table rather\r\n * than looking anything up.\r\n */\r\n@Component({\r\n selector: 'mt-entity-list-drawer',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityValuePreview, NgComponentOutlet],\r\n templateUrl: './entity-list-drawer.html',\r\n // `h-full` is load-bearing. `.p-drawer-content` is a definite height, but\r\n // this host sits between it and the content, so without a height of its own\r\n // the host grows to fit the rows and the content's `h-full` resolves against\r\n // *that* — the list then runs past the bottom of the drawer with nothing to\r\n // scroll. Verified with a twenty-row list.\r\n host: { class: 'block h-full' },\r\n})\r\nexport class EntityListDrawer {\r\n readonly data = input.required<EntityData>();\r\n\r\n /** Ordered allowlist of nested field keys; empty renders all of them. */\r\n readonly fields = input<string[]>([]);\r\n\r\n /** The list's table, when the opener could build one; see above. */\r\n readonly table = input<EntityListTableHost | null>(null);\r\n\r\n /** A Local list's labels are `{ en, ar }` pairs; see `sharedActiveLang`. */\r\n private readonly activeLang = sharedActiveLang(inject(TranslocoService));\r\n\r\n readonly rows = computed<EntityListRenderedRow[]>(() =>\r\n buildEntityListRows(this.data(), this.fields(), this.activeLang()),\r\n );\r\n}\r\n","<!--\r\n Owns its scroll rather than taking the shared `mt-modal-content` shell: that\r\n class reserves 60px for a footer, and this drawer is read-only and has none,\r\n so it would leave a dead strip at the bottom. `h-full` chains off the host's,\r\n which chains off `.p-drawer-content` — the one definite height here.\r\n-->\r\n<div class=\"flex h-full flex-col gap-2 overflow-auto p-5\">\r\n @if (table(); as host) {\r\n <!--\r\n The list as a record preview renders it: the read-only\r\n `mt-entity-list-field`, through the component the opener handed over —\r\n it cannot be imported here without a circular entry point.\r\n -->\r\n <ng-container\r\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\r\n ></ng-container>\r\n } @else {\r\n @for (row of rows(); track row.id) {\r\n <div\r\n class=\"rounded-md border border-surface-200 bg-surface-50 px-3 py-2.5\"\r\n >\r\n @if (row.title; as title) {\r\n <div class=\"min-w-0 text-sm font-medium text-color\">\r\n <mt-entity-value-preview [data]=\"title\" attachmentShape=\"compact\" />\r\n </div>\r\n }\r\n\r\n @if (row.fields.length) {\r\n <!--\r\n The drawer has room the cell did not, so fields get a real grid with\r\n their labels instead of being crushed onto one wrapping line.\r\n `auto-fill` adapts to the drawer's actual width without a container\r\n query, and the `min()` floor keeps a narrow drawer from being forced\r\n wider than the viewport.\r\n -->\r\n <div\r\n class=\"mt-2 grid gap-x-4 gap-y-3 [grid-template-columns:repeat(auto-fill,minmax(min(9rem,100%),1fr))]\"\r\n >\r\n @for (field of row.fields; track field.key) {\r\n <div class=\"min-w-0 overflow-hidden\">\r\n <mt-entity-value-preview\r\n [data]=\"field\"\r\n attachmentShape=\"compact\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { NgComponentOutlet } from '@angular/common';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { sharedActiveLang } from '../active-lang';\r\nimport { displayOrPlaceholder } from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport {\r\n EntityData,\r\n EntityPropertyConfiguration,\r\n isEntityListLocalDocument,\r\n isEntityListSelectionDocument,\r\n} from '../entity.model';\r\nimport {\r\n ENTITY_LIST_TABLE_COMPONENT,\r\n EntityRuntimeContext,\r\n EntityRuntimeContextStore,\r\n} from '../entity-runtime-context';\r\nimport {\r\n buildEntityListRows,\r\n EntityListRenderedRow,\r\n summarizeEntityListRows,\r\n} from '../entity-list-rows.util';\r\nimport { EntityListDrawer, EntityListTableHost } from './entity-list-drawer';\r\n\r\n/** Rows named in the tooltip before it collapses into \"+N more\". */\r\nconst TOOLTIP_ROW_LIMIT = 6;\r\n\r\n/**\r\n * Read-only renderer for an `EntityList` value. It has two shapes, and which\r\n * one applies is decided by what the host gave it — never by the value.\r\n *\r\n * **Inline table.** When the host published an `EntityRuntimeContext` and the\r\n * property is module-backed, the rows are the target module's own records and\r\n * live behind `Properties/{id}/entitylist/table-metadata` + `fetch/query`.\r\n * Nothing in the value describes them — a `Realtime` list's value is literally\r\n * `null` — so the whole table is fetched, by handing the work to the read-only\r\n * `mt-entity-list-field` through `ENTITY_LIST_TABLE_COMPONENT`. That component\r\n * already owns the metadata call, the authorization boundary (`403` is a\r\n * notice, not an error) and the column projection; duplicating it here would\r\n * be a second implementation of the same contract. This is the shape a card\r\n * preview gets.\r\n *\r\n * **Count + drawer.** Otherwise the value carries its own `rows[]` and the\r\n * property configuration's `inlineFields` is the only description of the\r\n * columns — a calculated inline list, phase gate checklists being the case\r\n * this was written for. Those render inside a *table cell* (`mt-table` builds\r\n * its entity cells through `mt-entity-preview`), where inline rows would own\r\n * the height of every row in the grid: three lines per checklist item, times\r\n * however many the phase gate has. The rows go in a drawer instead, and the\r\n * tooltip names them so \"which ones are these?\" is answered without opening\r\n * anything. A table cell publishes no runtime context, so it keeps this shape.\r\n *\r\n * There is no writable path in either case.\r\n */\r\n@Component({\r\n selector: 'mt-entity-list-preview',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityField, Button, NgComponentOutlet],\r\n templateUrl: './entity-list-preview.html',\r\n})\r\nexport class EntityListPreview {\r\n readonly data = input.required<EntityData>();\r\n\r\n /**\r\n * Restricts rendering to these nested field keys, in this order. Left empty,\r\n * every field in `inlineFields` renders — what the generic table path wants;\r\n * a host that knows the list narrows it here. Forwarded to the drawer.\r\n *\r\n * Applies to the drawer shape only: an inline table's columns come from the\r\n * backend's own projection, which already reflects the configured read\r\n * fields for this level.\r\n */\r\n readonly fields = input<string[]>([]);\r\n\r\n private readonly modal = inject(ModalService);\r\n private readonly transloco = inject(TranslocoService);\r\n\r\n /**\r\n * Both optional, and both have to be present for the inline table: the\r\n * component says the host *can* render one, the context says it knows which\r\n * level-data row to scope the rows to. A host that provides neither — every\r\n * `mt-table` cell — keeps the drawer.\r\n */\r\n private readonly tableComponent = inject(ENTITY_LIST_TABLE_COMPONENT, {\r\n optional: true,\r\n });\r\n private readonly runtimeContextStore = inject(EntityRuntimeContextStore, {\r\n optional: true,\r\n });\r\n\r\n /**\r\n * Read inside every computed that translates. `transloco.translate()` is a\r\n * one-shot read with no signal of its own, so without this dependency the\r\n * tooltip and the accessible name keep whatever language they were first\r\n * built in — both apps switch language at runtime. Shared rather than a\r\n * per-instance subscription: this renders once per cell per row.\r\n */\r\n private readonly activeLang = sharedActiveLang(this.transloco);\r\n\r\n readonly label = computed<string>(() => this.data().name ?? '');\r\n\r\n readonly rows = computed<EntityListRenderedRow[]>(() =>\r\n buildEntityListRows(this.data(), this.fields(), this.activeLang()),\r\n );\r\n\r\n readonly count = computed<number>(() => this.rows().length);\r\n\r\n readonly hasRows = computed<boolean>(() => this.count() > 0);\r\n\r\n /**\r\n * Whether the list's rows are records of another module rather than values\r\n * held inside this one.\r\n *\r\n * Mirrors the backend's own `ResolveSourceType`: an explicit `sourceType`\r\n * wins, and a configuration written before that field existed is module-\r\n * backed exactly when it names a module. Read from the stored configuration\r\n * because it is the only description available before the metadata request —\r\n * the effective, level-overridden one comes back from that endpoint, and the\r\n * table component gates on it again.\r\n */\r\n private readonly moduleBacked = computed<boolean>(() => {\r\n const configuration = this.propertyConfiguration();\r\n if (!configuration) return false;\r\n\r\n const sourceType = configuration['sourceType'];\r\n if (typeof sourceType === 'string' && sourceType.trim()) {\r\n return sourceType.trim().toLowerCase() === 'module';\r\n }\r\n return Number(configuration['moduleId'] ?? 0) > 0;\r\n });\r\n\r\n /**\r\n * The inline table's component and inputs, or null when this instance\r\n * renders the drawer trigger instead.\r\n *\r\n * A `computed` rather than a template expression on purpose: the object is\r\n * re-created only when its inputs actually change, and `NgComponentOutlet`\r\n * re-applies inputs on identity change — a fresh object per change-detection\r\n * pass would re-write every input on every tick.\r\n */\r\n protected readonly tableHost = computed<EntityListTableHost | null>(() =>\r\n this.buildTableHost(this.runtimeContextStore?.context() ?? null),\r\n );\r\n\r\n /**\r\n * The same table, for the drawer of a table cell. A cell publishes no\r\n * runtime context — an inline table would set the height of every row — but\r\n * a host that knows the record's ids puts them on the value\r\n * (`EntityData.runtimeContext`), and the drawer then shows the list exactly\r\n * as a record preview does, instead of the value-only rows.\r\n */\r\n private readonly drawerTable = computed<EntityListTableHost | null>(() =>\r\n this.tableHost() ? null : this.buildTableHost(this.data().runtimeContext),\r\n );\r\n\r\n private buildTableHost(\r\n context: EntityRuntimeContext | null | undefined,\r\n ): EntityListTableHost | null {\r\n const component = this.tableComponent;\r\n if (!component || !this.moduleBacked()) return null;\r\n if (!context || !(Number(context.levelId) > 0)) return null;\r\n\r\n const data = this.data();\r\n const propertyId = Number(data.propertyId ?? 0);\r\n if (!(propertyId > 0)) return null;\r\n\r\n return {\r\n component,\r\n inputs: {\r\n propertyId,\r\n runtimeContext: context,\r\n configuration: this.propertyConfiguration(),\r\n // Rendered outside a form, so there is no `ControlValueAccessor` to\r\n // write through. A Write-only list has no readable records and its\r\n // stored rows are the only thing it can show.\r\n initialValue: data.value ?? data.rawValue ?? null,\r\n readonly: true,\r\n // `mt-entity-field` already renders the property's label above the\r\n // table; the field would repeat it.\r\n label: '',\r\n },\r\n };\r\n }\r\n\r\n /**\r\n * Whether the value itself holds the list's rows — a Local or Selected\r\n * document. A Related list's value is membership and evidence only; its\r\n * rows are read by the table, so its cell does not claim a count.\r\n */\r\n private readonly valueHoldsRows = computed<boolean>(() => {\r\n const value = this.data().value;\r\n return (\r\n isEntityListLocalDocument(value) || isEntityListSelectionDocument(value)\r\n );\r\n });\r\n\r\n /** The trigger shows when there are rows to count, or a table to open. */\r\n protected readonly showTrigger = computed<boolean>(\r\n () => this.hasRows() || !!this.drawerTable(),\r\n );\r\n\r\n /**\r\n * The trigger's label: the row count when the value holds the rows, else\r\n * \"View\" — a Related list's saved membership is not what its table shows,\r\n * so it is not presented as a count.\r\n */\r\n protected readonly triggerLabel = computed<string>(() => {\r\n this.activeLang();\r\n return this.valueHoldsRows() || !this.drawerTable()\r\n ? this.count().toString()\r\n : this.viewLabel();\r\n });\r\n\r\n /**\r\n * An empty list reads as the standard empty value, not as a sentence — this\r\n * sits in a table cell, where a \"no related items\" line would be louder than\r\n * the rows it stands in for.\r\n */\r\n readonly emptyLabel = displayOrPlaceholder(null);\r\n\r\n /**\r\n * The button's accessible name. Set explicitly because `mt-button` resolves\r\n * it as `ariaLabel → label → tooltip`, and the label here is the bare count\r\n * — a screen reader would otherwise announce the button as \"2\".\r\n */\r\n readonly ariaLabel = computed<string>(() => {\r\n this.activeLang();\r\n const label = this.triggerLabel();\r\n return label === this.viewLabel()\r\n ? label\r\n : `${this.viewLabel()} (${label})`;\r\n });\r\n\r\n /**\r\n * Names the rows, so the cell answers \"which ones?\" on hover. Falls back to\r\n * the button's own wording when no row has a title to show.\r\n */\r\n readonly tooltip = computed<string>(() => {\r\n this.activeLang();\r\n const { names, remaining } = summarizeEntityListRows(\r\n this.rows(),\r\n TOOLTIP_ROW_LIMIT,\r\n );\r\n if (names.length === 0) return this.viewLabel();\r\n\r\n const more =\r\n remaining > 0\r\n ? [\r\n this.transloco.translate('components.entityListPreview.more', {\r\n count: remaining,\r\n }),\r\n ]\r\n : [];\r\n return [...names, ...more].join(' · ');\r\n });\r\n\r\n /**\r\n * The untouched catalog configuration. `configuration` is read as a fallback\r\n * because the table merges its own display flags into that object when it\r\n * builds a cell, and a `LeafDetails` catalog entry is an array — neither is\r\n * an `EntityList` configuration, so both are rejected here.\r\n */\r\n private readonly propertyConfiguration = computed<Record<\r\n string,\r\n unknown\r\n > | null>(() => {\r\n const data = this.data();\r\n const sources: (EntityPropertyConfiguration | undefined)[] = [\r\n data.propertyConfiguration,\r\n data.configuration as EntityPropertyConfiguration,\r\n ];\r\n\r\n for (const source of sources) {\r\n if (!source || Array.isArray(source)) continue;\r\n return source as Record<string, unknown>;\r\n }\r\n return null;\r\n });\r\n\r\n private viewLabel(): string {\r\n return this.transloco.translate('components.entityListPreview.view');\r\n }\r\n\r\n protected openDrawer(): void {\r\n const table = this.drawerTable();\r\n this.modal.openModal(EntityListDrawer, 'drawer', {\r\n header: this.label() || undefined,\r\n position: 'end',\r\n // A table needs the width a stack of rows does not.\r\n styleClass: table ? '!w-[60rem] max-w-[96vw]' : '!w-[34rem] max-w-[96vw]',\r\n dismissableMask: true,\r\n inputValues: {\r\n data: this.data(),\r\n fields: this.fields(),\r\n table,\r\n },\r\n });\r\n }\r\n}\r\n","<mt-entity-field\r\n [label]=\"label()\"\r\n [configuration]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (tableHost(); as host) {\r\n <!--\r\n The related records, rendered in full by the read-only\r\n `mt-entity-list-field`. It owns the metadata request, the access notices\r\n and the column projection — see `ENTITY_LIST_TABLE_COMPONENT` for why it\r\n arrives through an outlet rather than an import.\r\n -->\r\n <ng-container\r\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\r\n ></ng-container>\r\n } @else if (showTrigger()) {\r\n <!--\r\n The count carries the information; the button carries the affordance.\r\n `mt-button` owns the tooltip and the accessible name, so the trigger is\r\n one element rather than a button wrapped in a tooltip host. A Related\r\n list opened as a table says \"View\" instead of a count; see\r\n `triggerLabel`.\r\n\r\n `w-fit`: the `mt-button` host is a block-level grid, so in a cell it\r\n spans the full width and so does the `p-button` the tooltip anchors to —\r\n the tooltip centred over the cell, not over the button.\r\n -->\r\n <mt-button\r\n class=\"w-fit\"\r\n icon=\"general.eye\"\r\n [label]=\"triggerLabel()\"\r\n [tooltip]=\"tooltip()\"\r\n [ariaLabel]=\"ariaLabel()\"\r\n variant=\"text\"\r\n size=\"small\"\r\n styleClass=\"!px-2 !py-1 !gap-1\"\r\n (onClick)=\"openDrawer()\"\r\n />\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-surface-100 px-3 py-2 text-xs font-semibold text-muted-color\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { displayOrPlaceholder } from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport { EntityValuePreview } from '../entity-preview/entity-value-preview';\r\nimport {\r\n EntityConfiguration,\r\n EntityData,\r\n EntityLookupCheckListItem,\r\n EntityLookupCheckListValue,\r\n EntityNestedPropertyMeta,\r\n} from '../entity.model';\r\n\r\ninterface RenderedItem {\r\n lookupKey: string;\r\n /** Humanized lookup key for display. */\r\n lookupLabel: string;\r\n /** One entity per captured property, rendered by its catalog view type. */\r\n props: EntityData[];\r\n}\r\n\r\n/**\r\n * Nested props render inside the entry card's own grid, so they take the label\r\n * treatment and leave sizing to the grid.\r\n */\r\nconst NESTED_PROP_CONFIG: EntityConfiguration = {\r\n labelPosition: 'top',\r\n hideLabel: false,\r\n};\r\n\r\n/**\r\n * Derive a readable label from a raw lookup key. The stored checklist value\r\n * only carries the key of the selected lookup item (e.g. `Open_test`) and the\r\n * response resolves no display for it, so this strips separators and\r\n * title-cases the key.\r\n */\r\nfunction humanizeKey(key: string): string {\r\n const words = key\r\n .replace(/[_-]+/g, ' ')\r\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\r\n .trim();\r\n if (!words) return key;\r\n return words.charAt(0).toUpperCase() + words.slice(1);\r\n}\r\n\r\n@Component({\r\n selector: 'mt-entity-lookup-module-check-list',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityField, EntityValuePreview],\r\n templateUrl: './entity-lookup-module-check-list.html',\r\n})\r\nexport class EntityLookupModuleCheckList {\r\n readonly data = input.required<EntityData>();\r\n\r\n /**\r\n * Catalog metadata for the captured properties, keyed by property key. The\r\n * stored value carries keys only — this is what gives each nested prop its\r\n * label and view type.\r\n */\r\n private readonly metaByKey = computed(() => {\r\n const map = new Map<string, EntityNestedPropertyMeta>();\r\n for (const meta of this.data().nestedProperties ?? []) {\r\n map.set(meta.key, meta);\r\n }\r\n return map;\r\n });\r\n\r\n /**\r\n * Normalizes the stored value into a flat list of checklist entries.\r\n * Accepts both the rendered view model (`{ items: [...] }`) and the raw\r\n * stored array (`[{ lookupKey, props }]`); returns `[]` for anything else.\r\n */\r\n readonly items = computed<RenderedItem[]>(() => {\r\n const raw = this.data().value;\r\n const entries = this.extractEntries(raw);\r\n\r\n return entries\r\n .filter((entry) => entry && typeof entry === 'object')\r\n .map((entry) => {\r\n const record = entry as unknown as Record<string, unknown>;\r\n const props = record['props'] ?? record['Props'];\r\n const lookupKey = this.resolveLookupKey(entry);\r\n return {\r\n lookupKey,\r\n lookupLabel: humanizeKey(lookupKey),\r\n props: (Array.isArray(props) ? props : []).map((prop) =>\r\n this.toNestedEntity(prop),\r\n ),\r\n };\r\n });\r\n });\r\n\r\n readonly hasItems = computed(() => this.items().length > 0);\r\n\r\n readonly emptyLabel = displayOrPlaceholder(null);\r\n\r\n /**\r\n * Builds the entity for one captured property. Without catalog metadata the\r\n * key is all there is to show it with, so it degrades to a humanized label\r\n * and plain text.\r\n */\r\n private toNestedEntity(prop: unknown): EntityData {\r\n const propRecord = (prop ?? {}) as Record<string, unknown>;\r\n const key = String(propRecord['key'] ?? propRecord['Key'] ?? '');\r\n const meta = this.metaByKey().get(key);\r\n const value = propRecord['value'] ?? propRecord['Value'] ?? null;\r\n\r\n return {\r\n propertyId: meta?.id,\r\n key,\r\n normalizedKey: meta?.normalizedKey,\r\n name: meta?.label ?? humanizeKey(key),\r\n value: (value ?? '') as EntityData['value'],\r\n viewType: meta?.viewType ?? 'Text',\r\n propertyConfiguration: meta?.configuration,\r\n configuration: NESTED_PROP_CONFIG,\r\n order: meta?.order,\r\n };\r\n }\r\n\r\n private extractEntries(raw: unknown): EntityLookupCheckListItem[] {\r\n if (Array.isArray(raw)) {\r\n return raw as EntityLookupCheckListItem[];\r\n }\r\n\r\n const wrapped = (raw as EntityLookupCheckListValue | null)?.items;\r\n if (Array.isArray(wrapped)) {\r\n return wrapped;\r\n }\r\n\r\n if (typeof raw === 'string' && raw.trim()) {\r\n try {\r\n return this.extractEntries(JSON.parse(raw));\r\n } catch {\r\n return [];\r\n }\r\n }\r\n\r\n return [];\r\n }\r\n\r\n private resolveLookupKey(entry: EntityLookupCheckListItem): string {\r\n const record = entry as unknown as Record<string, unknown>;\r\n const key = entry.lookupKey ?? record['Lookupkey'] ?? record['lookupkey'];\r\n return typeof key === 'string' ? key : '';\r\n }\r\n}\r\n","<mt-entity-field\r\n [label]=\"data().name ?? ''\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasItems()) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (item of items(); track $index) {\r\n <div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ item.lookupLabel || emptyLabel }}\r\n </span>\r\n @if (item.props.length) {\r\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\r\n @for (prop of item.props; track prop.key) {\r\n <div class=\"min-w-0 overflow-hidden\">\r\n <mt-entity-value-preview\r\n [data]=\"prop\"\r\n attachmentShape=\"compact\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n","import type {\r\n ConnectionCatalogConfiguration,\r\n ConnectionSourceLevelConfig,\r\n EntityConnectionConfig,\r\n EntityConnectionSourceValue,\r\n EntityData,\r\n} from './entity.model';\r\n\r\n/**\r\n * Separator for the synthetic keys of the per-source-level items a Connection\r\n * property expands into. Mirrors `LEAF_DETAILS_KEY_SEPARATOR`: the persisted\r\n * display configuration is still keyed by the real property key, and the split\r\n * items only exist in the rendered/managed entity list.\r\n */\r\nexport const CONNECTION_KEY_SEPARATOR = '::connlevel::';\r\n\r\nexport function isConnectionSyntheticKey(key?: string | null): boolean {\r\n return key?.includes(CONNECTION_KEY_SEPARATOR) ?? false;\r\n}\r\n\r\nexport function buildConnectionKey(\r\n propertyKey: string,\r\n levelId: number | string,\r\n): string {\r\n return `${propertyKey}${CONNECTION_KEY_SEPARATOR}${levelId}`;\r\n}\r\n\r\n/** Splits a synthetic key back into the owning property key and its level id. */\r\nexport function splitConnectionKey(key: string): {\r\n propertyKey: string;\r\n levelId: string;\r\n} {\r\n const [propertyKey, levelId] = key.split(CONNECTION_KEY_SEPARATOR);\r\n return { propertyKey, levelId };\r\n}\r\n\r\nfunction isConnectionSourceLevel(\r\n value: unknown,\r\n): value is ConnectionSourceLevelConfig {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n !Array.isArray(value) &&\r\n 'levelId' in value &&\r\n typeof value.levelId === 'number' &&\r\n Number.isFinite(value.levelId)\r\n );\r\n}\r\n\r\n/**\r\n * Reads the `sourceLevels` published on a Connection property's catalog\r\n * configuration. These define the split — one item per source level — and carry\r\n * the level name used as each item's label.\r\n */\r\nexport function normalizeConnectionSourceLevels(\r\n configuration: unknown,\r\n): ConnectionSourceLevelConfig[] {\r\n if (typeof configuration === 'string' && configuration.trim().length > 0) {\r\n try {\r\n return normalizeConnectionSourceLevels(JSON.parse(configuration));\r\n } catch {\r\n return [];\r\n }\r\n }\r\n\r\n if (!configuration || typeof configuration !== 'object') return [];\r\n\r\n const sourceLevels = (configuration as ConnectionCatalogConfiguration)\r\n .sourceLevels;\r\n\r\n return Array.isArray(sourceLevels)\r\n ? sourceLevels.filter(isConnectionSourceLevel)\r\n : [];\r\n}\r\n\r\n/** Picks the source level's localized name for the active document language. */\r\nexport function resolveConnectionLevelName(\r\n level: ConnectionSourceLevelConfig,\r\n): string {\r\n const name = level.name;\r\n if (typeof name === 'string') return name.trim();\r\n if (!name || typeof name !== 'object') return '';\r\n\r\n const lang =\r\n typeof document !== 'undefined'\r\n ? document.documentElement.lang || 'en'\r\n : 'en';\r\n const primary = lang === 'ar' ? name.ar : name.en;\r\n\r\n return (primary || name.en || name.ar || '').trim();\r\n}\r\n\r\nfunction readSources(value: unknown): EntityConnectionSourceValue[] {\r\n if (typeof value === 'string' && value.trim().length > 0) {\r\n try {\r\n return readSources(JSON.parse(value));\r\n } catch {\r\n return [];\r\n }\r\n }\r\n\r\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\r\n\r\n const source = value as Record<string, unknown>;\r\n // The payload is serialized PascalCase; parsed values use camelCase.\r\n const sources = source['sources'] ?? source['Sources'];\r\n\r\n return Array.isArray(sources)\r\n ? (sources.filter(\r\n (item) => !!item && typeof item === 'object' && !Array.isArray(item),\r\n ) as EntityConnectionSourceValue[])\r\n : [];\r\n}\r\n\r\nfunction sourceLevelIdOf(source: EntityConnectionSourceValue): number | null {\r\n const id = source.sourceLevelId ?? source.SourceLevelId;\r\n return typeof id === 'number' && Number.isFinite(id) ? id : null;\r\n}\r\n\r\nfunction sourceDisplayOf(source: EntityConnectionSourceValue): string {\r\n const display =\r\n source.display ?? source.Display ?? source.name ?? source.Name;\r\n return typeof display === 'string' ? display.trim() : '';\r\n}\r\n\r\n/**\r\n * Groups a Connection value's connected records by their source level. A level\r\n * that allows many-to-many can hold several records, so the displays are joined\r\n * into the single value shown for that level's item.\r\n */\r\nfunction groupDisplaysByLevel(entity: EntityData): Map<number, string[]> {\r\n const sources = [\r\n ...readSources(entity.value),\r\n ...readSources(entity.rawValue),\r\n ];\r\n const grouped = new Map<number, string[]>();\r\n\r\n for (const source of sources) {\r\n const levelId = sourceLevelIdOf(source);\r\n if (levelId === null) continue;\r\n const display = sourceDisplayOf(source);\r\n if (!display) continue;\r\n const existing = grouped.get(levelId);\r\n if (existing) {\r\n if (!existing.includes(display)) existing.push(display);\r\n } else {\r\n grouped.set(levelId, [display]);\r\n }\r\n }\r\n\r\n return grouped;\r\n}\r\n\r\n/**\r\n * Splits a Connection entity into one item per source level, so a card shows\r\n * each connected level under its own name instead of a single comma-joined\r\n * value under the generic \"Connection\" label.\r\n *\r\n * Falls back to the original entity when the catalog publishes no source\r\n * levels — without them there is nothing to label the split items with.\r\n */\r\nexport function expandConnectionEntity(entity: EntityData): EntityData[] {\r\n if (entity.viewType !== 'Connection') {\r\n return [entity];\r\n }\r\n\r\n // Already expanded (e.g. re-running over a managed list).\r\n if (isConnectionSyntheticKey(entity.key)) {\r\n return [entity];\r\n }\r\n\r\n const levels = normalizeConnectionSourceLevels(entity.propertyConfiguration);\r\n if (levels.length === 0) {\r\n return [entity];\r\n }\r\n\r\n const configuration = entity.configuration as\r\n | EntityConnectionConfig\r\n | undefined;\r\n const displaysByLevel = groupDisplaysByLevel(entity);\r\n\r\n return levels.map((level) => {\r\n const levelConfig =\r\n configuration?.connectionLevels?.[String(level.levelId)];\r\n const display = (displaysByLevel.get(level.levelId) ?? []).join(', ');\r\n\r\n return {\r\n ...entity,\r\n key: entity.key\r\n ? buildConnectionKey(entity.key, level.levelId)\r\n : entity.key,\r\n name: resolveConnectionLevelName(level) || entity.name,\r\n value: { display },\r\n rawValue: display,\r\n order: levelConfig?.order ?? entity.order,\r\n configuration: {\r\n ...configuration,\r\n size: levelConfig?.size ?? configuration?.size,\r\n },\r\n } satisfies EntityData;\r\n });\r\n}\r\n","import { expandConnectionEntity } from './connection-display.utils';\r\nimport type {\r\n EntityData,\r\n EntityLeafDetailsConfig,\r\n LeafDetailsCatalogConfiguration,\r\n LeafDetailsCatalogLevelValue,\r\n LeafDetailsCatalogPhaseValue,\r\n LeafDetailsCatalogStatusValue,\r\n LeafDetailsEntityCollectionValue,\r\n LeafDetailsEntityValue,\r\n LeafDetailsPhaseSummary,\r\n LeafDetailsRuntimeChildSchema,\r\n LeafDetailsRuntimePhaseCount,\r\n LeafDetailsRuntimeStatusCount,\r\n LeafDetailsRuntimeStatusDetails,\r\n LeafDetailsRuntimeValue,\r\n LeafDetailsStatusSummary,\r\n} from './entity.model';\r\n\r\nexport const LEAF_DETAILS_KEY_SEPARATOR = '::leaflevel::';\r\n\r\n/**\r\n * The phase projection of the same child level. One level can contribute both\r\n * a status item and a phase item to the same area, so they need distinct keys\r\n * — the key is what each item's persisted order/size is looked up by.\r\n */\r\nexport const LEAF_PHASES_KEY_SEPARATOR = '::leafphase::';\r\n\r\nfunction isLeafDetailsStatusSummary(\r\n value: unknown,\r\n): value is LeafDetailsStatusSummary {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n 'key' in value &&\r\n 'display' in value &&\r\n 'count' in value\r\n );\r\n}\r\n\r\nfunction isLeafDetailsCatalogStatusValue(\r\n value: unknown,\r\n): value is LeafDetailsCatalogStatusValue {\r\n return (\r\n !!value && typeof value === 'object' && 'key' in value && 'display' in value\r\n );\r\n}\r\n\r\nfunction isLeafDetailsCatalogLevelValue(\r\n value: unknown,\r\n): value is LeafDetailsCatalogLevelValue {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n 'levelId' in value &&\r\n 'levelName' in value &&\r\n 'levelIcon' in value &&\r\n 'statuses' in value &&\r\n Array.isArray(value.statuses) &&\r\n value.statuses.every(isLeafDetailsCatalogStatusValue)\r\n );\r\n}\r\n\r\nfunction isLeafDetailsRuntimeStatusDetails(\r\n value: unknown,\r\n): value is LeafDetailsRuntimeStatusDetails {\r\n return (\r\n !!value && typeof value === 'object' && 'key' in value && 'display' in value\r\n );\r\n}\r\n\r\nfunction isLeafDetailsRuntimeStatusCount(\r\n value: unknown,\r\n): value is LeafDetailsRuntimeStatusCount {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n 'details' in value &&\r\n isLeafDetailsRuntimeStatusDetails(value.details) &&\r\n 'count' in value\r\n );\r\n}\r\n\r\nfunction isLeafDetailsRuntimePhaseCount(\r\n value: unknown,\r\n): value is LeafDetailsRuntimePhaseCount {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n 'details' in value &&\r\n isLeafDetailsRuntimeStatusDetails(value.details) &&\r\n 'count' in value\r\n );\r\n}\r\n\r\n/**\r\n * Phases are optional on both the catalog configuration and the runtime value —\r\n * the backend omits the field entirely for child levels with no phase gates —\r\n * so anything that is not a well-formed array reads as \"no phases\".\r\n */\r\nfunction readRuntimePhases(value: unknown): LeafDetailsRuntimePhaseCount[] {\r\n return Array.isArray(value) && value.every(isLeafDetailsRuntimePhaseCount)\r\n ? value\r\n : [];\r\n}\r\n\r\nfunction readCatalogPhases(value: unknown): LeafDetailsCatalogPhaseValue[] {\r\n return Array.isArray(value) && value.every(isLeafDetailsCatalogStatusValue)\r\n ? (value as LeafDetailsCatalogPhaseValue[])\r\n : [];\r\n}\r\n\r\nfunction isLeafDetailsRuntimeChildSchema(\r\n value: unknown,\r\n): value is LeafDetailsRuntimeChildSchema {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n 'levelId' in value &&\r\n 'levelName' in value &&\r\n 'levelIcon' in value &&\r\n 'statuses' in value &&\r\n Array.isArray(value.statuses) &&\r\n value.statuses.every(isLeafDetailsRuntimeStatusCount)\r\n );\r\n}\r\n\r\nexport function isLeafDetailsValue(\r\n value: unknown,\r\n): value is LeafDetailsEntityValue {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n !Array.isArray(value) &&\r\n 'levelId' in value &&\r\n 'statuses' in value &&\r\n Array.isArray(value.statuses) &&\r\n value.statuses.every(isLeafDetailsStatusSummary)\r\n );\r\n}\r\n\r\nexport function isLeafDetailsCollectionValue(\r\n value: unknown,\r\n): value is LeafDetailsEntityCollectionValue {\r\n return Array.isArray(value) && value.every(isLeafDetailsValue);\r\n}\r\n\r\nexport function isLeafDetailsCatalogConfiguration(\r\n value: unknown,\r\n): value is LeafDetailsCatalogConfiguration {\r\n return Array.isArray(value) && value.every(isLeafDetailsCatalogLevelValue);\r\n}\r\n\r\nexport function isLeafDetailsRuntimeValue(\r\n value: unknown,\r\n): value is LeafDetailsRuntimeValue {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n !Array.isArray(value) &&\r\n 'childSchemas' in value &&\r\n Array.isArray(value.childSchemas) &&\r\n value.childSchemas.every(isLeafDetailsRuntimeChildSchema)\r\n );\r\n}\r\n\r\nexport function isLeafDetailsSyntheticKey(key?: string | null): boolean {\r\n return key?.includes(LEAF_DETAILS_KEY_SEPARATOR) ?? false;\r\n}\r\n\r\n/** True for the key of an expanded *phase* item of a LeafDetails property. */\r\nexport function isLeafPhasesSyntheticKey(key?: string | null): boolean {\r\n return key?.includes(LEAF_PHASES_KEY_SEPARATOR) ?? false;\r\n}\r\n\r\n/** True for either projection's expanded key. */\r\nexport function isLeafSyntheticKey(key?: string | null): boolean {\r\n return isLeafDetailsSyntheticKey(key) || isLeafPhasesSyntheticKey(key);\r\n}\r\n\r\n/** Splits either projection's expanded key back into property key + level id. */\r\nexport function splitLeafKey(key: string): {\r\n propertyKey: string;\r\n levelId: string;\r\n kind: 'status' | 'phase';\r\n} {\r\n if (isLeafPhasesSyntheticKey(key)) {\r\n const [propertyKey, levelId] = key.split(LEAF_PHASES_KEY_SEPARATOR);\r\n return { propertyKey, levelId, kind: 'phase' };\r\n }\r\n const [propertyKey, levelId] = key.split(LEAF_DETAILS_KEY_SEPARATOR);\r\n return { propertyKey, levelId, kind: 'status' };\r\n}\r\n\r\nfunction toLeafDetailsStatusSummary(\r\n status: LeafDetailsRuntimeStatusCount,\r\n): LeafDetailsStatusSummary {\r\n return {\r\n key: status.details.key,\r\n display: status.details.display,\r\n color: status.details.color ?? null,\r\n count: status.count,\r\n };\r\n}\r\n\r\nfunction toLeafDetailsPhaseSummary(\r\n phase: LeafDetailsRuntimePhaseCount,\r\n): LeafDetailsPhaseSummary {\r\n return {\r\n id: phase.details.id ?? null,\r\n key: phase.details.key,\r\n display: phase.details.display,\r\n color: phase.details.color || null,\r\n count: phase.count,\r\n };\r\n}\r\n\r\nfunction normalizeLeafDetailsCollection(\r\n value: unknown,\r\n): LeafDetailsEntityCollectionValue {\r\n if (isLeafDetailsCollectionValue(value)) {\r\n return value;\r\n }\r\n\r\n if (isLeafDetailsValue(value)) {\r\n return [value];\r\n }\r\n\r\n if (isLeafDetailsRuntimeValue(value)) {\r\n return value.childSchemas.map((schema) => ({\r\n levelId: schema.levelId,\r\n levelName: schema.levelName,\r\n levelIcon: schema.levelIcon,\r\n statuses: schema.statuses.map(toLeafDetailsStatusSummary),\r\n phases: readRuntimePhases(schema.phases).map(toLeafDetailsPhaseSummary),\r\n }));\r\n }\r\n\r\n if (typeof value === 'string' && value.trim().length > 0) {\r\n try {\r\n return normalizeLeafDetailsCollection(JSON.parse(value));\r\n } catch {\r\n return [];\r\n }\r\n }\r\n\r\n return [];\r\n}\r\n\r\nfunction normalizeLeafDetailsCatalogConfiguration(\r\n value: unknown,\r\n): LeafDetailsEntityCollectionValue {\r\n if (isLeafDetailsCatalogConfiguration(value)) {\r\n return value.map((level) => ({\r\n levelId: level.levelId,\r\n levelName: level.levelName,\r\n levelIcon: level.levelIcon,\r\n statuses: level.statuses.map((status) => ({\r\n key: status.key,\r\n display: status.display,\r\n color: status.color ?? null,\r\n count: 0,\r\n })),\r\n phases: readCatalogPhases(level.phases).map((phase) => ({\r\n id: phase.id ?? null,\r\n key: phase.key,\r\n display: phase.display,\r\n color: phase.color || null,\r\n count: 0,\r\n })),\r\n }));\r\n }\r\n\r\n if (typeof value === 'string' && value.trim().length > 0) {\r\n try {\r\n return normalizeLeafDetailsCatalogConfiguration(JSON.parse(value));\r\n } catch {\r\n return [];\r\n }\r\n }\r\n\r\n return [];\r\n}\r\n\r\nexport function expandLeafDetailsEntity(entity: EntityData): EntityData[] {\r\n if (entity.viewType !== 'LeafDetails') {\r\n return [entity];\r\n }\r\n\r\n if (isLeafSyntheticKey(entity.key) && isLeafDetailsValue(entity.value)) {\r\n return [entity];\r\n }\r\n\r\n const configuration = entity.configuration as\r\n | EntityLeafDetailsConfig\r\n | undefined;\r\n const levels = normalizeLeafDetailsCollection(entity.value);\r\n const fallbackLevels = levels.length\r\n ? levels\r\n : normalizeLeafDetailsCollection(entity.rawValue);\r\n const resolvedLevels = fallbackLevels.length\r\n ? fallbackLevels\r\n : normalizeLeafDetailsCatalogConfiguration(entity.propertyConfiguration);\r\n\r\n if (resolvedLevels.length === 0) {\r\n return [entity];\r\n }\r\n\r\n const statusItems = resolvedLevels.flatMap((level) => {\r\n const levelConfig = configuration?.leafLevels?.[String(level.levelId)];\r\n if (configuration?.leafLevels && !levelConfig) {\r\n return [];\r\n }\r\n\r\n const selectedStatuses = levelConfig?.selectedStatuses?.length\r\n ? new Set(levelConfig.selectedStatuses)\r\n : null;\r\n\r\n return [\r\n {\r\n ...entity,\r\n key: entity.key\r\n ? `${entity.key}${LEAF_DETAILS_KEY_SEPARATOR}${level.levelId}`\r\n : entity.key,\r\n name: level.levelName,\r\n value: {\r\n ...level,\r\n kind: 'status',\r\n statuses: selectedStatuses\r\n ? level.statuses.filter((status) =>\r\n selectedStatuses.has(status.key),\r\n )\r\n : level.statuses,\r\n },\r\n order: levelConfig?.order ?? entity.order,\r\n configuration: {\r\n ...configuration,\r\n size: levelConfig?.size ?? configuration?.size,\r\n },\r\n } satisfies EntityData,\r\n ];\r\n });\r\n\r\n /**\r\n * Phases are opt-in: only levels with an explicit `leafPhases` entry produce\r\n * a phase item. An absent map means \"no phase badges\", never \"all of them\" —\r\n * the opposite of `leafLevels`, whose absence predates the per-level config\r\n * and has to keep meaning \"show every level\".\r\n */\r\n const phaseItems = resolvedLevels.flatMap((level) => {\r\n const phaseConfig = configuration?.leafPhases?.[String(level.levelId)];\r\n if (!phaseConfig) {\r\n return [];\r\n }\r\n\r\n const phases = level.phases ?? [];\r\n const selectedPhases = phaseConfig.selectedPhases?.length\r\n ? new Set(phaseConfig.selectedPhases)\r\n : null;\r\n\r\n return [\r\n {\r\n ...entity,\r\n key: entity.key\r\n ? `${entity.key}${LEAF_PHASES_KEY_SEPARATOR}${level.levelId}`\r\n : entity.key,\r\n name: level.levelName,\r\n value: {\r\n ...level,\r\n kind: 'phase',\r\n phases: selectedPhases\r\n ? phases.filter((phase) => selectedPhases.has(phase.key))\r\n : phases,\r\n },\r\n order: phaseConfig.order ?? entity.order,\r\n configuration: {\r\n ...configuration,\r\n size: phaseConfig.size ?? configuration?.size,\r\n },\r\n } satisfies EntityData,\r\n ];\r\n });\r\n\r\n const expanded = [...statusItems, ...phaseItems];\r\n return expanded.length > 0 ? expanded : [entity];\r\n}\r\n\r\n/**\r\n * Expands the entity types that render as several items — LeafDetails levels\r\n * and Connection source levels — then orders the flattened list. Shared by the\r\n * customization builder canvas and the runtime preview so both agree on what a\r\n * configured area actually contains.\r\n */\r\nexport function buildDisplayEntities(entities: EntityData[]): EntityData[] {\r\n return entities\r\n .flatMap((entity) => expandLeafDetailsEntity(entity))\r\n .flatMap((entity) => expandConnectionEntity(entity))\r\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { EntityData } from '../entity.model';\r\nimport { EntityListPreview } from '../entity-list-preview/entity-list-preview';\r\nimport { EntityLookupModuleCheckList } from '../entity-lookup-module-check-list/entity-lookup-module-check-list';\r\nimport { EntityValuePreview } from './entity-value-preview';\r\n\r\n/**\r\n * Owns the view types that render their own nested properties *through*\r\n * `EntityValuePreview`. Routing them from inside that component instead would\r\n * make the two files import each other, so they branch here and everything\r\n * else is delegated.\r\n */\r\n@Component({\r\n selector: 'mt-entity-preview-body',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityListPreview, EntityLookupModuleCheckList, EntityValuePreview],\r\n templateUrl: './entity-preview-body.html',\r\n host: {\r\n class: 'w-full',\r\n },\r\n})\r\nexport class EntityPreviewBody {\r\n readonly data = input.required<EntityData>();\r\n readonly attachmentShape = input<'default' | 'compact'>('default');\r\n}\r\n","@if (data().viewType === \"LookupModuleCheckList\") {\r\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\r\n} @else if (data().viewType === \"EntityList\") {\r\n <mt-entity-list-preview [data]=\"data()\" />\r\n} @else {\r\n <mt-entity-value-preview\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { EntityData } from '../../entity.model';\r\nimport {\r\n ComparisonValueSide,\r\n ValueComparison,\r\n} from '../../entity-comparison.model';\r\nimport { EntityPreviewBody } from '../../entity-preview/entity-preview-body';\r\n\r\n@Component({\r\n selector: 'mt-comparison-value',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityPreviewBody],\r\n templateUrl: './comparison-value.html',\r\n host: {\r\n class: 'block w-full',\r\n },\r\n})\r\nexport class ComparisonValue {\r\n readonly data = input.required<EntityData>();\r\n\r\n readonly comparison = computed<ValueComparison | null>(() => {\r\n const c = this.data().comparison;\r\n return c?.kind === 'Value' ? c : null;\r\n });\r\n\r\n readonly oldEntity = computed<EntityData | null>(() =>\r\n this.buildSide(this.comparison()?.oldValue),\r\n );\r\n\r\n readonly newEntity = computed<EntityData | null>(() =>\r\n this.buildSide(this.comparison()?.newValue),\r\n );\r\n\r\n private buildSide(side: ComparisonValueSide | undefined): EntityData | null {\r\n if (!side) return null;\r\n const base = this.data();\r\n return {\r\n ...base,\r\n rawValue:\r\n side.raw === null || side.raw === undefined\r\n ? undefined\r\n : String(side.raw),\r\n value: (side.display ?? side.value ?? '') as EntityData['value'],\r\n comparison: undefined,\r\n };\r\n }\r\n}\r\n","@if (comparison(); as cmp) {\r\n <div class=\"flex w-full min-w-0 items-stretch gap-3\">\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\r\n >Before</span\r\n >\r\n @if (oldEntity(); as old) {\r\n <mt-entity-preview-body [data]=\"old\" />\r\n } @else {\r\n <span class=\"text-sm text-muted-color\">_</span>\r\n }\r\n </div>\r\n <div class=\"flex shrink-0 items-center text-muted-color\" aria-hidden=\"true\">\r\n →\r\n </div>\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\r\n >\r\n <span class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\r\n >After</span\r\n >\r\n @if (newEntity(); as next) {\r\n <mt-entity-preview-body [data]=\"next\" />\r\n } @else {\r\n <span class=\"text-sm text-muted-color\">_</span>\r\n }\r\n </div>\r\n </div>\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { EntityData } from '../../entity.model';\r\nimport {\r\n EntityComparisonOperation,\r\n EntityListComparison,\r\n EntityListComparisonRow,\r\n} from '../../entity-comparison.model';\r\nimport { displayOrPlaceholder } from '../../entity-display.utils';\r\n\r\ninterface OperationBadge {\r\n label: string;\r\n classes: string;\r\n}\r\n\r\nconst OPERATION_BADGE_KEYS: Record<\r\n EntityComparisonOperation,\r\n { key: string; classes: string }\r\n> = {\r\n CreateRecord: {\r\n key: 'components.comparisonEntities.added',\r\n classes:\r\n 'bg-emerald-50 text-emerald-700 ring-1 ring-inset ring-emerald-200',\r\n },\r\n UpdateRecord: {\r\n key: 'components.comparisonEntities.updated',\r\n classes: 'bg-amber-50 text-amber-700 ring-1 ring-inset ring-amber-200',\r\n },\r\n DeleteRecord: {\r\n key: 'components.comparisonEntities.removed',\r\n classes: 'bg-rose-50 text-rose-700 ring-1 ring-inset ring-rose-200',\r\n },\r\n};\r\n\r\n@Component({\r\n selector: 'mt-comparison-entity-list',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [],\r\n templateUrl: './comparison-entity-list.html',\r\n host: {\r\n class: 'block w-full',\r\n },\r\n})\r\nexport class ComparisonEntityList {\r\n private readonly transloco = inject(TranslocoService);\r\n readonly data = input.required<EntityData>();\r\n\r\n readonly comparison = computed<EntityListComparison | null>(() => {\r\n const c = this.data().comparison;\r\n return c?.kind === 'EntityList' ? c : null;\r\n });\r\n\r\n readonly rows = computed<EntityListComparisonRow[]>(\r\n () => this.comparison()?.rows ?? [],\r\n );\r\n\r\n readonly targetModuleKey = computed<string>(\r\n () => this.comparison()?.targetModuleKey ?? '',\r\n );\r\n\r\n readonly label = computed<string>(() => this.data().name ?? '');\r\n\r\n badgeFor(op: EntityComparisonOperation): OperationBadge {\r\n const config = OPERATION_BADGE_KEYS[op];\r\n return {\r\n label: this.transloco.translate(config.key),\r\n classes: config.classes,\r\n };\r\n }\r\n\r\n displayField(value: unknown, display?: string | null): string {\r\n if (display && display.trim().length > 0) return display;\r\n return displayOrPlaceholder(value);\r\n }\r\n\r\n rowId(_i: number, row: EntityListComparisonRow): number | string {\r\n return row.entityId ?? _i;\r\n }\r\n\r\n oldField(\r\n row: EntityListComparisonRow,\r\n propertyKey: string,\r\n ): { value: unknown; display?: string | null } | undefined {\r\n return row.oldValues.find((v) => v.propertyKey === propertyKey);\r\n }\r\n}\r\n","@if (comparison(); as cmp) {\r\n <div class=\"flex w-full min-w-0 flex-col gap-2\">\r\n @if (label()) {\r\n <div class=\"flex items-baseline justify-between\">\r\n <span class=\"text-sm font-medium text-color\">{{ label() }}</span>\r\n @if (targetModuleKey()) {\r\n <span class=\"text-xs text-muted-color\">{{ targetModuleKey() }}</span>\r\n }\r\n </div>\r\n }\r\n @if (rows().length === 0) {\r\n <div class=\"text-sm text-muted-color\">_</div>\r\n } @else {\r\n <ul class=\"flex flex-col gap-2\">\r\n @for (row of rows(); track rowId($index, row)) {\r\n <li\r\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <span\r\n class=\"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"badgeFor(row.operation).classes\"\r\n >\r\n {{ badgeFor(row.operation).label }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">#{{ row.entityId }}</span>\r\n </div>\r\n\r\n @switch (row.operation) {\r\n @case (\"CreateRecord\") {\r\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\r\n @for (f of row.newValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"truncate text-sm text-color\">\r\n {{ displayField(f.value, f.display) }}\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n @case (\"DeleteRecord\") {\r\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\r\n @for (f of row.oldValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"truncate text-sm text-color line-through\">\r\n {{ displayField(f.value, f.display) }}\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n @default {\r\n <dl class=\"flex flex-col gap-1\">\r\n @for (f of row.newValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"flex min-w-0 flex-wrap items-center gap-2\">\r\n <span\r\n class=\"max-w-[40%] truncate text-sm text-muted-color line-through\"\r\n >\r\n {{\r\n displayField(\r\n $any(oldField(row, f.propertyKey))?.value,\r\n $any(oldField(row, f.propertyKey))?.display\r\n )\r\n }}\r\n </span>\r\n <span class=\"text-muted-color\" aria-hidden=\"true\"\r\n >→</span\r\n >\r\n <span class=\"max-w-[40%] truncate text-sm text-color\">\r\n {{ displayField(f.value, f.display) }}\r\n </span>\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n }\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { EntityData } from '../entity.model';\r\nimport { sharedActiveLang } from '../active-lang';\r\nimport { resolveEntityInfo } from '../entity-display.utils';\r\nimport { EntityPreviewBody } from './entity-preview-body';\r\nimport { ComparisonValue } from '../comparison/comparison-value/comparison-value';\r\nimport { ComparisonEntityList } from '../comparison/comparison-entity-list/comparison-entity-list';\r\n\r\n@Component({\r\n selector: 'mt-entity-preview',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n EntityPreviewBody,\r\n ComparisonValue,\r\n ComparisonEntityList,\r\n Tooltip,\r\n Icon,\r\n ],\r\n templateUrl: './entity-preview.html',\r\n styleUrl: './entity-preview.css',\r\n // The tooltip is appended to the body by PrimeNG, so its style rule has to\r\n // be global. See entity-preview.css.\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n class: 'w-full',\r\n // Both only apply when there is a note, so an entity without one keeps\r\n // exactly the box it had before this feature existed.\r\n '[class.relative]': 'infoText()',\r\n '[class.pe-4]': 'infoText()',\r\n },\r\n})\r\nexport class EntityPreview {\r\n private readonly transloco = inject(TranslocoService);\r\n\r\n readonly data = input.required<EntityData>();\r\n readonly attachmentShape = input<'default' | 'compact'>('default');\r\n\r\n private readonly activeLang = sharedActiveLang(this.transloco);\r\n\r\n /**\r\n * The admin-authored note for the active language, or `''` when the property\r\n * has none. Resolved here rather than in each `entity-*` component because\r\n * this is the one wrapper every view type and every call site passes through\r\n * — the card grid, the customization builder preview, and the standalone\r\n * `mt-entity-preview` usages in the app.\r\n */\r\n readonly infoText = computed(() =>\r\n resolveEntityInfo(this.data().configuration, this.activeLang()),\r\n );\r\n\r\n readonly comparisonKind = computed<'Value' | 'EntityList' | null>(() => {\r\n const c = this.data().comparison;\r\n if (!c) return null;\r\n if (c.kind === 'Value') return 'Value';\r\n if (c.kind === 'EntityList') return 'EntityList';\r\n return null;\r\n });\r\n}\r\n","@if (infoText(); as info) {\r\n <!--\r\n The note affordance. Absolutely positioned so it stays out of the value's\r\n own layout — each viewType renders its own markup and there is no shared\r\n slot to put this in — while the host reserves the corner with `pe-4`, so a\r\n long value truncates before it can run underneath the icon.\r\n -->\r\n <!--\r\n Sized with `text-sm`, not a `size` input: `mt-icon` has none, and its host\r\n is `width: 1em` — so font-size is what actually scales the glyph.\r\n -->\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"absolute top-0 end-0 z-10 cursor-help text-sm text-surface-400 transition-colors hover:text-primary-600\"\r\n [mtTooltip]=\"info\"\r\n tooltipPosition=\"top\"\r\n tooltipStyleClass=\"mt-entity-info-tooltip\"\r\n [attr.aria-label]=\"info\"\r\n />\r\n}\r\n\r\n@switch (comparisonKind()) {\r\n @case (\"Value\") {\r\n <mt-comparison-value [data]=\"data()\" />\r\n }\r\n @case (\"EntityList\") {\r\n <mt-comparison-entity-list [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-preview-body\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n }\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { EntityData, EntitySize } from '../entity.model';\r\nimport { buildDisplayEntities } from '../leaf-details-display.utils';\r\nimport {\r\n getEntitySectionTitle,\r\n groupEntitiesIntoSections,\r\n} from '../entity-sections.util';\r\nimport { EntityPreview } from '../entity-preview/entity-preview';\r\n\r\nexport interface EntityClickEvent {\r\n entity: EntityData;\r\n key: string;\r\n source: MouseEvent;\r\n}\r\n\r\nconst EMPTY_KEY_SET: ReadonlySet<string> = new Set();\r\n\r\n/** Classes every entity slot carries, before its per-slot modifiers. */\r\nconst SLOT_BASE_CLASS =\r\n 'min-w-0 overflow-hidden flex items-center rounded transition-colors';\r\n\r\n/** Opt-in dashed frame (`configuration.showBorder`). */\r\nconst SLOT_BORDER_CLASS = 'border p-3 border-dashed border-gray-200 rounded-lg';\r\n\r\n/**\r\n * One entity's fully-resolved render inputs.\r\n *\r\n * Precomputing these is what keeps large grids cheap. The template used to call\r\n * `isClickable` / `isActive` / `getColSpan` roughly eight times per entity on\r\n * *every* change detection pass; in a client-list card grid (60 cards of ~50\r\n * entities) that was tens of thousands of calls per tick. A slot is now rebuilt\r\n * only when the entity list, the clickable/active key sets, or the tooltip\r\n * strings actually change.\r\n */\r\ninterface EntitySlot {\r\n entity: EntityData;\r\n trackKey: string;\r\n containerClass: string;\r\n colSpan: string;\r\n clickable: boolean;\r\n rowClickIgnore: 'true' | null;\r\n title: string | null;\r\n}\r\n\r\n/** A section box (or the leading bare run) with its slots already resolved. */\r\ninterface EntitySlotGroup {\r\n trackKey: string;\r\n boxed: boolean;\r\n title: string;\r\n slots: EntitySlot[];\r\n}\r\n\r\n@Component({\r\n selector: 'mt-entities-preview',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityPreview, NgTemplateOutlet],\r\n templateUrl: './entities-preview.html',\r\n styleUrls: ['./entities-preview.css'],\r\n host: {\r\n class: 'block min-w-0 w-full',\r\n '[class.mt-entities-stack-narrow]': 'stackOnNarrow()',\r\n },\r\n})\r\nexport class EntitiesPreview {\r\n private readonly transloco = inject(TranslocoService);\r\n /** Array of entity data to display */\r\n readonly entities = input.required<EntityData[]>();\r\n readonly attachmentShape = input<'default' | 'compact'>('default');\r\n\r\n /**\r\n * Soft \"stack every field full-width when the host is narrower than the\r\n * 24-column grid reads well\" behavior (the ≤400px container-query fallback,\r\n * default on). Set to `false` in wide-enough card layouts — e.g. client-list\r\n * cards (~350px) — so the per-entity `size` configuration is honored instead\r\n * of forcing every item to full width. A hard ≤280px stack always applies\r\n * regardless, so the 24-column gap floor can never overflow the host (#1081).\r\n */\r\n readonly stackOnNarrow = input(true);\r\n\r\n /**\r\n * Set of entity keys that should appear interactive (cursor pointer,\r\n * clicks emit). Pass `new Set([...])` from a computed signal in the host\r\n * for reactive enabling — when the host's set changes, Angular re-renders\r\n * via its normal change detection, no manual subscriptions required.\r\n *\r\n * Pass a *stable* reference: a host method that mints a fresh `Set` on every\r\n * call re-writes this input on every change detection pass and defeats the\r\n * slot memoization below.\r\n */\r\n readonly clickableKeys = input<ReadonlySet<string>>(EMPTY_KEY_SET);\r\n\r\n /**\r\n * Set of entity keys that should render with the \"active\" treatment\r\n * (e.g. currently the filter source). Same reactive pattern — and the same\r\n * stable-reference requirement — as `clickableKeys`.\r\n */\r\n readonly activeKeys = input<ReadonlySet<string>>(EMPTY_KEY_SET);\r\n\r\n /** Tooltip text shown on hover when an entity is clickable but not active. */\r\n readonly clickableTooltip = input<string>(\r\n this.transloco.translate('components.entitiesPreview.filterByThis'),\r\n );\r\n\r\n /** Tooltip text shown on hover when an entity is the current active filter. */\r\n readonly activeTooltip = input<string>(\r\n this.transloco.translate('components.entitiesPreview.clearFilter'),\r\n );\r\n\r\n /**\r\n * Emits when an individual entity slot is clicked. Only fires when the\r\n * entity's key is present in `clickableKeys`.\r\n */\r\n readonly entityClick = output<EntityClickEvent>();\r\n\r\n /**\r\n * The active language as a signal. Section headings are resolved per-language\r\n * in a `computed`, so under `OnPush` a plain `getActiveLang()` read would\r\n * freeze them at whatever language was active on first render.\r\n */\r\n private readonly activeLang = toSignal(this.transloco.langChanges$, {\r\n initialValue: this.transloco.getActiveLang(),\r\n });\r\n\r\n /** Entities expanded and sorted by order */\r\n readonly displayEntities = computed(() =>\r\n buildDisplayEntities(this.entities()),\r\n );\r\n\r\n /**\r\n * The display entities split into section groups. With no `Section` markers\r\n * this is a single `{ section: null }` group, so the bare grid renders\r\n * exactly as before.\r\n */\r\n readonly sectionGroups = computed(() =>\r\n groupEntitiesIntoSections(this.displayEntities()),\r\n );\r\n\r\n /**\r\n * The render model the template iterates. Split from `sectionGroups` on\r\n * purpose: grouping only re-runs when the entities themselves change, while\r\n * this cheap mapping re-runs when the key sets or tooltips change.\r\n */\r\n protected readonly slotGroups = computed<EntitySlotGroup[]>(() => {\r\n const clickableKeys = this.clickableKeys();\r\n const activeKeys = this.activeKeys();\r\n const clickableTooltip = this.clickableTooltip();\r\n const activeTooltip = this.activeTooltip();\r\n const lang = this.activeLang();\r\n\r\n return this.sectionGroups().map((group, groupIndex) => ({\r\n trackKey: group.section?.key ?? `__group__${groupIndex}`,\r\n boxed: !!group.section,\r\n title: getEntitySectionTitle(group.section, lang),\r\n slots: group.entities.map((entity, entityIndex) => {\r\n const key = resolveEntityKey(entity);\r\n const clickable = key.length > 0 && clickableKeys.has(key);\r\n const active = clickable && activeKeys.has(key);\r\n\r\n return {\r\n entity,\r\n trackKey: entity.key ?? String(entity.order ?? entityIndex),\r\n containerClass: buildSlotClass(entity, clickable, active),\r\n colSpan: `span ${(entity.configuration?.size ?? 8) as EntitySize}`,\r\n clickable,\r\n rowClickIgnore: clickable ? ('true' as const) : null,\r\n title: clickable ? (active ? activeTooltip : clickableTooltip) : null,\r\n };\r\n }),\r\n }));\r\n });\r\n\r\n protected onSlotClick(source: MouseEvent, slot: EntitySlot): void {\r\n if (!slot.clickable) return;\r\n source.stopPropagation();\r\n this.entityClick.emit({\r\n entity: slot.entity,\r\n key: resolveEntityKey(slot.entity),\r\n source,\r\n });\r\n }\r\n}\r\n\r\n/** Stable key resolution shared with the host — must agree on order. */\r\nfunction resolveEntityKey(entity: EntityData): string {\r\n return entity.key || entity.normalizedKey || entity.name || '';\r\n}\r\n\r\nfunction buildSlotClass(\r\n entity: EntityData,\r\n clickable: boolean,\r\n active: boolean,\r\n): string {\r\n let result = SLOT_BASE_CLASS;\r\n if (entity.configuration?.showBorder) result += ` ${SLOT_BORDER_CLASS}`;\r\n if (clickable) {\r\n result += active ? ' mt-entity-filter-active' : ' mt-entity-filterable';\r\n }\r\n return result;\r\n}\r\n","<div class=\"flex flex-col gap-4\">\r\n @for (group of slotGroups(); track group.trackKey) {\r\n @if (group.boxed) {\r\n <!-- Titled section box (matches the client-form section view) -->\r\n <div\r\n class=\"flex flex-col gap-0 overflow-hidden rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n @if (group.title) {\r\n <h3\r\n class=\"m-0 border-b border-surface-200 bg-surface-50 px-4 py-3 text-lg font-semibold text-color\"\r\n dir=\"auto\"\r\n >\r\n {{ group.title }}\r\n </h3>\r\n }\r\n <div class=\"p-4\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"entityGrid\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group.slots }\"\r\n />\r\n </div>\r\n </div>\r\n } @else {\r\n <ng-container\r\n [ngTemplateOutlet]=\"entityGrid\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group.slots }\"\r\n />\r\n }\r\n }\r\n</div>\r\n\r\n<!--\r\n Every binding here reads a value the component already resolved into the slot\r\n (see `EntitiesPreview.slotGroups`). Keep it that way: this template runs once\r\n per entity per change detection pass, and a card grid renders thousands of\r\n them, so a method call or a fresh object literal in this block is measurably\r\n expensive.\r\n-->\r\n<ng-template #entityGrid let-slots>\r\n <div class=\"mt-entities-grid grid grid-cols-24 gap-x-3 gap-y-5\">\r\n @for (slot of slots; track slot.trackKey) {\r\n <div\r\n [class]=\"slot.containerClass\"\r\n [attr.data-row-click-ignore]=\"slot.rowClickIgnore\"\r\n [attr.title]=\"slot.title\"\r\n [style.grid-column]=\"slot.colSpan\"\r\n (click)=\"onSlotClick($event, slot)\"\r\n >\r\n <mt-entity-preview\r\n [data]=\"slot.entity\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n","import {\r\n Directive,\r\n ElementRef,\r\n inject,\r\n NgZone,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport { EntityData, EntityResizeEvent, EntitySize } from '../entity.model';\r\n\r\n/**\r\n * Base class that encapsulates all entity resize-via-drag logic.\r\n *\r\n * Extend this directive in any component that needs column-resize behaviour\r\n * on a 24-column CSS grid. The subclass must:\r\n * - Provide a `model.required<EntityData[]>()` (or equivalent) for the\r\n * entity list so `updateEntitySize()` can be called after resize.\r\n * - Contain a `.grid` element (or override `getGridElement()`).\r\n *\r\n * Resize flow:\r\n * 1. `onResizeStart(event, entity)` — called from a mousedown on the handle\r\n * 2. mousemove → snaps to nearest column, updates `resizePreviewSize`\r\n * 3. mouseup → emits `entityResized` with previous & new size\r\n */\r\n@Directive()\r\nexport abstract class EntitiesResizeBase {\r\n protected readonly elRef = inject(ElementRef);\r\n protected readonly zone = inject(NgZone);\r\n protected readonly doc = inject(DOCUMENT);\r\n\r\n /** Emits when an entity is resized via the drag handle */\r\n readonly entityResized = output<EntityResizeEvent>();\r\n\r\n // ── Resize state ──\r\n\r\n /** The entity currently being resized (null when idle) */\r\n readonly resizingEntity = signal<EntityData | null>(null);\r\n\r\n /** Live preview size while dragging */\r\n readonly resizePreviewSize = signal<EntitySize | null>(null);\r\n\r\n /** Bound listeners kept for cleanup */\r\n private _onMouseMove: ((e: MouseEvent) => void) | null = null;\r\n private _onMouseUp: ((e: MouseEvent) => void) | null = null;\r\n\r\n // ── Public API ──\r\n\r\n /**\r\n * Returns the grid element used to compute column widths.\r\n * Override if the grid selector differs.\r\n */\r\n protected getGridElement(): HTMLElement | null {\r\n return this.elRef.nativeElement.querySelector('.grid');\r\n }\r\n\r\n /**\r\n * Returns the grid-column span string for a given entity.\r\n * While resizing the active entity, returns the preview size.\r\n */\r\n getResizeColSpan(entity: EntityData): string {\r\n if (this.resizingEntity() === entity && this.resizePreviewSize() !== null) {\r\n return `span ${this.resizePreviewSize()}`;\r\n }\r\n const size: EntitySize = entity.configuration?.size ?? 8;\r\n return `span ${size}`;\r\n }\r\n\r\n /** Starts a resize operation from the right-edge handle */\r\n onResizeStart(event: MouseEvent, entity: EntityData): void {\r\n // Prevent the drag-drop from starting\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n const gridEl = this.getGridElement();\r\n if (!gridEl) return;\r\n\r\n const gridRect = gridEl.getBoundingClientRect();\r\n const gridWidth = gridRect.width;\r\n const columnWidth = gridWidth / 24;\r\n\r\n const previousSize: EntitySize = entity.configuration?.size ?? 8;\r\n\r\n // Left edge of the entity cell\r\n const cellEl = (event.target as HTMLElement).closest(\r\n '.entity-cell',\r\n ) as HTMLElement | null;\r\n if (!cellEl) return;\r\n const cellRect = cellEl.getBoundingClientRect();\r\n const isRtl =\r\n this.doc.documentElement.getAttribute('dir') === 'rtl' ||\r\n getComputedStyle(this.doc.documentElement).direction === 'rtl';\r\n\r\n this.resizingEntity.set(entity);\r\n this.resizePreviewSize.set(previousSize);\r\n\r\n // Run mouse listeners outside Angular zone for performance\r\n this.zone.runOutsideAngular(() => {\r\n this._onMouseMove = (e: MouseEvent) => {\r\n // In RTL the logical end is the left edge; dragging left widens the cell\r\n const rawWidth = isRtl\r\n ? cellRect.right - e.clientX\r\n : e.clientX - cellRect.left;\r\n // Snap to nearest full column (min 1, max 12)\r\n let cols = Math.round(rawWidth / columnWidth);\r\n cols = Math.max(1, Math.min(24, cols)) as EntitySize;\r\n const current = this.resizePreviewSize();\r\n if (current !== cols) {\r\n this.zone.run(() => this.resizePreviewSize.set(cols as EntitySize));\r\n }\r\n };\r\n\r\n this._onMouseUp = () => {\r\n this._cleanupListeners();\r\n\r\n const newSize = this.resizePreviewSize() as EntitySize;\r\n this.resizingEntity.set(null);\r\n this.resizePreviewSize.set(null);\r\n\r\n if (newSize !== previousSize) {\r\n this.zone.run(() => {\r\n this.onResizeComplete(entity, previousSize, newSize);\r\n });\r\n }\r\n };\r\n\r\n this.doc.addEventListener('mousemove', this._onMouseMove);\r\n this.doc.addEventListener('mouseup', this._onMouseUp, { once: true });\r\n });\r\n }\r\n\r\n /**\r\n * Called when a resize operation completes with a changed size.\r\n * Subclasses should update the entity list and emit events here.\r\n */\r\n protected abstract onResizeComplete(\r\n entity: EntityData,\r\n previousSize: EntitySize,\r\n newSize: EntitySize,\r\n ): void;\r\n\r\n /** Removes global mouse listeners */\r\n private _cleanupListeners(): void {\r\n if (this._onMouseMove) {\r\n this.doc.removeEventListener('mousemove', this._onMouseMove);\r\n this._onMouseMove = null;\r\n }\r\n if (this._onMouseUp) {\r\n this.doc.removeEventListener('mouseup', this._onMouseUp);\r\n this._onMouseUp = null;\r\n }\r\n }\r\n}\r\n","import { Component, computed, model, output } from '@angular/core';\r\nimport {\r\n CdkDrag,\r\n CdkDragDrop,\r\n CdkDragPlaceholder,\r\n CdkDropList,\r\n} from '@angular/cdk/drag-drop';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { EntityData, EntitySize } from '../entity.model';\r\nimport {\r\n buildDisplayEntities,\r\n isLeafSyntheticKey,\r\n} from '../leaf-details-display.utils';\r\nimport { isConnectionSyntheticKey } from '../connection-display.utils';\r\nimport { isEntitySection } from '../entity-sections.util';\r\nimport { EntityPreview } from '../entity-preview/entity-preview';\r\nimport { EntitiesResizeBase } from './entities-resize-base';\r\n\r\n@Component({\r\n selector: 'mt-entities-manage',\r\n standalone: true,\r\n imports: [EntityPreview, Icon, CdkDrag, CdkDropList, CdkDragPlaceholder],\r\n templateUrl: './entities-manage.html',\r\n styleUrl: './entities-manage.scss',\r\n})\r\nexport class EntitiesManage extends EntitiesResizeBase {\r\n /** Array of entity data – supports two-way binding to keep order in sync */\r\n readonly entities = model.required<EntityData[]>();\r\n\r\n /** Emits the reordered entities array after each drag-drop */\r\n readonly entitiesReordered = output<EntityData[]>();\r\n\r\n /** Emits when an entity cell is clicked (for opening edit drawer) */\r\n readonly entityClicked = output<EntityData>();\r\n\r\n /**\r\n * Emits when an item dragged from a *different* connected list (e.g. a sidebar\r\n * \"add section\" tool) is dropped onto this grid. `index` is the target slot;\r\n * `data` is the dropped `cdkDragData`. The host decides what to insert.\r\n */\r\n readonly externalItemDropped = output<{ index: number; data: unknown }>();\r\n\r\n /** Entities expanded and sorted by their configured order */\r\n readonly displayEntities = computed(() =>\r\n buildDisplayEntities(this.entities()),\r\n );\r\n\r\n /** Returns the grid-column span for a given entity size (1-24) */\r\n getColSpan(entity: EntityData): string {\r\n if (isEntitySection(entity)) return 'span 24';\r\n return this.getResizeColSpan(entity);\r\n }\r\n\r\n /** True when the entity is a full-width `Section` layout marker. */\r\n isSection(entity: EntityData): boolean {\r\n return isEntitySection(entity);\r\n }\r\n\r\n /** Handle drag-drop reorder */\r\n onDrop(event: CdkDragDrop<EntityData[]>): void {\r\n // Item dragged in from another connected list — let the host handle it.\r\n if (event.previousContainer !== event.container) {\r\n this.externalItemDropped.emit({\r\n index: event.currentIndex,\r\n data: event.item.data,\r\n });\r\n return;\r\n }\r\n\r\n if (event.previousIndex === event.currentIndex) return;\r\n\r\n const items = [...this.displayEntities()];\r\n const [moved] = items.splice(event.previousIndex, 1);\r\n items.splice(event.currentIndex, 0, moved);\r\n\r\n // Reassign order based on new positions\r\n const reordered = items.map((item, index) => ({\r\n ...item,\r\n order: index + 1,\r\n }));\r\n\r\n // Update the model (two-way binding)\r\n this.entities.set(reordered);\r\n\r\n // Emit the reordered list\r\n this.entitiesReordered.emit(reordered);\r\n }\r\n\r\n // ── Resize completion (from EntitiesResizeBase) ──\r\n\r\n protected override onResizeComplete(\r\n entity: EntityData,\r\n previousSize: EntitySize,\r\n newSize: EntitySize,\r\n ): void {\r\n const currentEntities = this.entities();\r\n const sourceEntities = currentEntities.some((e) => e === entity)\r\n ? currentEntities\r\n : this.displayEntities();\r\n // Expanded items (LeafDetails levels / Connection source levels) are rebuilt\r\n // on every render, so identity no longer matches — fall back to the key.\r\n const isExpandedItem =\r\n isLeafSyntheticKey(entity.key) || isConnectionSyntheticKey(entity.key);\r\n const updated = sourceEntities.map((e) =>\r\n e === entity || (isExpandedItem && e.key === entity.key)\r\n ? {\r\n ...e,\r\n configuration: {\r\n ...e.configuration,\r\n size: newSize,\r\n },\r\n }\r\n : e,\r\n );\r\n this.entities.set(updated);\r\n\r\n this.entityResized.emit({\r\n entity: {\r\n ...entity,\r\n configuration: { ...entity.configuration, size: newSize },\r\n },\r\n previousSize,\r\n newSize,\r\n });\r\n }\r\n}\r\n","<div\r\n cdkDropList\r\n cdkDropListOrientation=\"mixed\"\r\n [cdkDropListData]=\"displayEntities()\"\r\n (cdkDropListDropped)=\"onDrop($event)\"\r\n class=\"grid grid-cols-24 gap-x-4 gap-y-6\"\r\n>\r\n @for (\r\n entity of displayEntities();\r\n track entity.key ?? entity.order ?? $index\r\n ) {\r\n @if (isSection(entity)) {\r\n <!-- Section marker: full-width, non-resizable header row -->\r\n <div\r\n cdkDrag\r\n [cdkDragData]=\"entity\"\r\n class=\"entity-cell section-row group relative min-w-0 flex items-center gap-2 px-4 py-2.5 cursor-grab active:cursor-grabbing rounded-md border border-surface-200 bg-surface-50 transition-colors hover:bg-emphasis\"\r\n [class.resizing]=\"resizingEntity() === entity\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n (click)=\"entityClicked.emit(entity)\"\r\n >\r\n <div\r\n *cdkDragPlaceholder\r\n class=\"h-full min-h-11 bg-black/10 rounded-md\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n ></div>\r\n\r\n <span\r\n class=\"flex-1 min-w-0 truncate text-base font-semibold\"\r\n dir=\"auto\"\r\n >\r\n {{ entity.name }}\r\n </span>\r\n <mt-icon\r\n icon=\"editor.pencil-01\"\r\n class=\"shrink-0 opacity-0 transition-opacity group-hover:opacity-60\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n cdkDrag\r\n [cdkDragData]=\"entity\"\r\n class=\"entity-cell group relative min-w-0 flex items-center p-3 cursor-grab active:cursor-grabbing rounded-lg transition-colors bg-surface-100/60\"\r\n [class.border]=\"entity.configuration?.showBorder\"\r\n [class.border-dashed]=\"entity.configuration?.showBorder\"\r\n [class.border-gray-300]=\"entity.configuration?.showBorder\"\r\n [class.resizing]=\"resizingEntity() === entity\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n >\r\n <!-- Drag placeholder -->\r\n <div\r\n *cdkDragPlaceholder\r\n class=\"h-full min-h-12 bg-black/10 rounded-xl\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n ></div>\r\n\r\n <mt-entity-preview\r\n [data]=\"entity\"\r\n class=\"flex-1 min-w-0 cursor-pointer\"\r\n (click)=\"entityClicked.emit(entity)\"\r\n />\r\n\r\n <!-- Resize handle (right edge) -->\r\n <div\r\n class=\"resize-handle\"\r\n (mousedown)=\"onResizeStart($event, entity)\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div class=\"resize-handle-bar\"></div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2tBA;AACM,SAAU,yBAAyB,CACvC,KAAc,EAAA;IAEd,QACE,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;AACzB,QAAA,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AACpB,QAAA,KAAmC,CAAC,WAAW,KAAK,OAAO;AAEhE;AAuCA;AACM,SAAU,6BAA6B,CAC3C,KAAc,EAAA;IAEd,QACE,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;AACzB,QAAA,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AACpB,QAAA,KAAkC,CAAC,UAAU,KAAK,UAAU;AAEjE;;AChxBA;;;;;;AAMG;AACI,MAAM,kBAAkB,GAAG;AAElC;AACM,SAAU,YAAY,CAAC,GAAmB,EAAA;IAC9C,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,CAAC,kBAAkB,CAAC;AACtE;AAEA;SACgB,eAAe,GAAA;IAC7B,OAAO,CAAA,EAAG,kBAAkB,CAAA,EAAG,MAAM,CAAC,UAAU,EAAE,EAAE;AACtD;AAEA;;;AAGG;AACG,SAAU,qBAAqB,CACnC,KAA4C,EAC5C,IAAa,EAAA;AAEb,IAAA,IAAI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AO,EAAE,WAAW,EAAE,kBAAkB,CAAC,EAAA,QAAA,EAAA,gsFAAA,EAAA,MAAA,EAAA,CAAA,+5BAAA,CAAA,EAAA;;;AErB1E;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-entities.mjs","sources":["../../../../packages/masterteam/components/entities/entity.model.ts","../../../../packages/masterteam/components/entities/entity-sections.util.ts","../../../../packages/masterteam/components/entities/entity-display.utils.ts","../../../../packages/masterteam/components/entities/stakeholder-name.utils.ts","../../../../packages/masterteam/components/entities/entity-runtime-context.ts","../../../../packages/masterteam/components/entities/entity-field/entity-field.ts","../../../../packages/masterteam/components/entities/entity-text/entity-text.ts","../../../../packages/masterteam/components/entities/entity-text/entity-text.html","../../../../packages/masterteam/components/entities/fit-text.directive.ts","../../../../packages/masterteam/components/entities/entity-date/entity-date.ts","../../../../packages/masterteam/components/entities/entity-date/entity-date.html","../../../../packages/masterteam/components/entities/entity-status/entity-status.ts","../../../../packages/masterteam/components/entities/entity-status/entity-status.html","../../../../packages/masterteam/components/entities/entity-icon/entity-icon.ts","../../../../packages/masterteam/components/entities/entity-icon/entity-icon.html","../../../../packages/masterteam/components/entities/entity-user/entity-user.ts","../../../../packages/masterteam/components/entities/entity-user/entity-user.html","../../../../packages/masterteam/components/entities/percentage-color.utils.ts","../../../../packages/masterteam/components/entities/entity-percentage/entity-percentage.ts","../../../../packages/masterteam/components/entities/entity-percentage/entity-percentage.html","../../../../packages/masterteam/components/entities/currency-display.utils.ts","../../../../packages/masterteam/components/entities/entity-currency/entity-currency.ts","../../../../packages/masterteam/components/entities/entity-currency/entity-currency.html","../../../../packages/masterteam/components/entities/entity-checkbox/entity-checkbox.ts","../../../../packages/masterteam/components/entities/entity-checkbox/entity-checkbox.html","../../../../packages/masterteam/components/entities/entity-long-text/entity-long-text.ts","../../../../packages/masterteam/components/entities/entity-long-text/entity-long-text.html","../../../../packages/masterteam/components/entities/entity-lookup/entity-lookup.ts","../../../../packages/masterteam/components/entities/entity-lookup/entity-lookup.html","../../../../packages/masterteam/components/entities/entity-phase-gate/entity-phase-gate.ts","../../../../packages/masterteam/components/entities/entity-phase-gate/entity-phase-gate.html","../../../../packages/masterteam/components/entities/active-lang.ts","../../../../packages/masterteam/components/entities/performance-score.utils.ts","../../../../packages/masterteam/components/entities/entity-performance-score/entity-performance-score.ts","../../../../packages/masterteam/components/entities/entity-performance-score/entity-performance-score.html","../../../../packages/masterteam/components/entities/entity-attachment/entity-attachment.ts","../../../../packages/masterteam/components/entities/entity-attachment/entity-attachment.html","../../../../packages/masterteam/components/entities/entity-location/entity-location.ts","../../../../packages/masterteam/components/entities/entity-location/entity-location.html","../../../../packages/masterteam/components/entities/entity-connection/entity-connection.ts","../../../../packages/masterteam/components/entities/entity-connection/entity-connection.html","../../../../packages/masterteam/components/entities/entity-schedule-item/entity-schedule-item.ts","../../../../packages/masterteam/components/entities/entity-schedule-item/entity-schedule-item.html","../../../../packages/masterteam/components/entities/entity-list-local.util.ts","../../../../packages/masterteam/components/entities/entity-list-rows.util.ts","../../../../packages/masterteam/components/entities/entity-leaf-details/entity-leaf-details.ts","../../../../packages/masterteam/components/entities/entity-leaf-details/entity-leaf-details.html","../../../../packages/masterteam/components/entities/entity-preview/entity-value-preview.ts","../../../../packages/masterteam/components/entities/entity-preview/entity-value-preview.html","../../../../packages/masterteam/components/entities/entity-list-preview/entity-list-drawer.ts","../../../../packages/masterteam/components/entities/entity-list-preview/entity-list-drawer.html","../../../../packages/masterteam/components/entities/entity-list-preview/entity-list-preview.ts","../../../../packages/masterteam/components/entities/entity-list-preview/entity-list-preview.html","../../../../packages/masterteam/components/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.ts","../../../../packages/masterteam/components/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.html","../../../../packages/masterteam/components/entities/connection-display.utils.ts","../../../../packages/masterteam/components/entities/leaf-details-display.utils.ts","../../../../packages/masterteam/components/entities/entity-preview/entity-preview-body.ts","../../../../packages/masterteam/components/entities/entity-preview/entity-preview-body.html","../../../../packages/masterteam/components/entities/comparison/comparison-value/comparison-value.ts","../../../../packages/masterteam/components/entities/comparison/comparison-value/comparison-value.html","../../../../packages/masterteam/components/entities/comparison/comparison-entity-list/comparison-entity-list.ts","../../../../packages/masterteam/components/entities/comparison/comparison-entity-list/comparison-entity-list.html","../../../../packages/masterteam/components/entities/entity-preview/entity-preview.ts","../../../../packages/masterteam/components/entities/entity-preview/entity-preview.html","../../../../packages/masterteam/components/entities/entities-preview/entities-preview.ts","../../../../packages/masterteam/components/entities/entities-preview/entities-preview.html","../../../../packages/masterteam/components/entities/entities-manage/entities-resize-base.ts","../../../../packages/masterteam/components/entities/entities-manage/entities-manage.ts","../../../../packages/masterteam/components/entities/entities-manage/entities-manage.html","../../../../packages/masterteam/components/entities/masterteam-components-entities.ts"],"sourcesContent":["import type { PropertyValueComparison } from './entity-comparison.model';\r\nimport type { EntityRuntimeContext } from './entity-runtime-context';\r\n\r\nexport type EntityViewType =\r\n | 'Text'\r\n | 'LongText'\r\n | 'Date'\r\n | 'DateTime'\r\n /**\r\n * Time-of-day. The value on the wire is still a full ISO instant (the\r\n * backend stores and returns the same shape as `DateTime`); only the\r\n * rendering and the picker are narrowed to the clock time.\r\n */\r\n | 'Time'\r\n | 'Number'\r\n | 'Percentage'\r\n | 'Status'\r\n | 'Currency'\r\n | 'Checkbox'\r\n | 'User'\r\n | 'MultiUser'\r\n | 'Lookup'\r\n | 'LookupMultiSelect'\r\n /**\r\n * Calculated, read-only lookup resolved by the backend to the schema phase\r\n * gate the record currently sits on. Never editable at runtime.\r\n */\r\n | 'PhaseGate'\r\n /**\r\n * Calculated, read-only KPI performance — a semicircle gauge (ported from\r\n * SPlus v3's `app-performance-gauge`). The value is an\r\n * {@link EntityPerformanceScoreValue}; never editable at runtime.\r\n */\r\n | 'PerformanceScore'\r\n | 'Attachment'\r\n | 'Location'\r\n | 'LookupMatrix'\r\n | 'LookupModuleCheckList'\r\n | 'LeafDetails'\r\n | 'Connection'\r\n | 'ScheduleItemSelector'\r\n /**\r\n * A nested list of related rows. Read-only here: the editable runtime is\r\n * `mt-entity-list-field`, which fetches its own rows; this view type is what\r\n * arrives when an `EntityList` property is itself a *column* of that fetch —\r\n * a calculated inline list the backend renders inline, such as the phase\r\n * gate `phasegate_checklists` virtual property. The value carries its own\r\n * rows, so nothing is fetched to display it.\r\n */\r\n | 'EntityList'\r\n /**\r\n * A stored icon reference. The value is a plain icon key (e.g.\r\n * `custom.strategy`) — the backend's own system icon property (Name/Icon on\r\n * a Template) reports this view type. Rendered as the actual glyph via\r\n * `mt-icon`, not as the raw key string; `mt-icon` degrades to an empty glyph\r\n * for an unknown key.\r\n */\r\n | 'Icon'\r\n /**\r\n * Layout marker, not a value. Rendered full-width and non-resizable; the\r\n * preview layer (`groupEntitiesIntoSections`) turns each marker into a titled\r\n * section box that owns every entity following it until the next marker.\r\n */\r\n | 'Section';\r\n\r\nexport type EntityLabelPosition = 'top' | 'bottom';\r\n\r\n/** Entity size – controls column span (1-24) inside a 24-column grid */\r\nexport type EntitySize =\r\n | 1\r\n | 2\r\n | 3\r\n | 4\r\n | 5\r\n | 6\r\n | 7\r\n | 8\r\n | 9\r\n | 10\r\n | 11\r\n | 12\r\n | 13\r\n | 14\r\n | 15\r\n | 16\r\n | 17\r\n | 18\r\n | 19\r\n | 20\r\n | 21\r\n | 22\r\n | 23\r\n | 24;\r\n\r\n// ── Per-type configuration interfaces ──\r\n\r\nexport interface EntityBaseConfig {\r\n /** Column span of the entity card (1-24). Default: 8 */\r\n size?: EntitySize;\r\n /** Whether to show a dashed border around the entity card */\r\n showBorder?: boolean;\r\n /** Whether to hide the entity name label. Prefer hideLabel for new config. */\r\n hideName?: boolean;\r\n /** Whether to hide the entity label */\r\n hideLabel?: boolean;\r\n /** Controls whether the label is rendered above or below the value */\r\n labelPosition?: EntityLabelPosition;\r\n /** Legacy misspelled alias kept for compatibility */\r\n labelPostion?: EntityLabelPosition;\r\n /** Whether the entity content is aligned to the end (right in LTR) */\r\n alignEnd?: boolean;\r\n /**\r\n * Custom localized label override. When present it replaces the catalog\r\n * label; it also serves as the heading for `Section` markers.\r\n */\r\n label?: EntitySectionLabel;\r\n /**\r\n * Admin-authored explanatory note, localized. When present the entity grows a\r\n * small info affordance at its top-end corner that reveals this text on hover.\r\n *\r\n * Plain text, deliberately. Every string inside a `configuration` payload is\r\n * sanitized server-side with the PlainText profile, which strips HTML tags\r\n * outright — rich markup authored here would come back as bare words. The\r\n * renderer preserves the author's own line breaks instead.\r\n */\r\n info?: EntitySectionLabel;\r\n}\r\n\r\nexport interface EntityUserConfig extends EntityBaseConfig {\r\n showDisplayName?: boolean;\r\n showPhoneNumber?: boolean;\r\n showEmail?: boolean;\r\n /**\r\n * Whether the avatar is rendered at all. When `false` neither the user's\r\n * picture nor the generic fallback icon shows — only the name remains.\r\n */\r\n showAvatar?: boolean;\r\n /** Maximum users shown before the MultiUser preview collapses behind +N. */\r\n maxVisibleUsers?: number;\r\n}\r\n\r\n/**\r\n * One Progress/Percentage color rule. Bounds are inclusive and at least one of\r\n * `minValue`/`maxValue` must be present — a rule with neither matches nothing.\r\n */\r\nexport interface PercentageColorRule {\r\n minValue?: number | null;\r\n maxValue?: number | null;\r\n color: string;\r\n}\r\n\r\n/**\r\n * Where a Percentage property's colour comes from.\r\n *\r\n * - `rules` — the value itself picks the colour out of `colorRules`.\r\n * - `property` — another property on the same record supplies it, so the bar\r\n * follows that property's own colour (a Status's colour, a Lookup item's\r\n * colour) rather than the percentage it is showing.\r\n *\r\n * An absent mode reads as `rules`: every configuration authored before this\r\n * existed is value-based.\r\n */\r\nexport type PercentageColorMode = 'rules' | 'property';\r\n\r\n/**\r\n * The property that supplies the colour in `property` mode.\r\n *\r\n * Both identifiers are stored on purpose. `propertyId` is what the backend\r\n * resolves against, and `propertyKey` is what a renderer holding an already\r\n * rendered record can match without a catalog lookup — rendered properties\r\n * carry their key, not the catalog id they came from.\r\n */\r\nexport interface PercentageColorPropertyRef {\r\n /** Catalog id of the colour-bearing property. */\r\n propertyId: number;\r\n /** Its key, for matching against a rendered record. */\r\n propertyKey?: string | null;\r\n /**\r\n * Its view type — `Status`, `Lookup`, `LookupMultiSelect` or `PhaseGate`.\r\n * Deliberately a plain string: it arrives from stored JSON, and a view type\r\n * this build does not know about must survive the round trip rather than be\r\n * normalised away.\r\n */\r\n viewType?: string | null;\r\n}\r\n\r\nexport interface EntityPercentageConfig extends EntityBaseConfig {\r\n /**\r\n * The colour to paint the bar with. The backend resolves the configuration —\r\n * the rules, or the source property in `property` mode — and ships the winner\r\n * here on render/value/fetch responses, so this always wins over a\r\n * client-side evaluation.\r\n */\r\n color?: string;\r\n /** Which of the two colour strategies applies. Absent ⇒ `rules`. */\r\n colorSource?: PercentageColorMode | null;\r\n /** The colour-bearing property. `property` mode only. */\r\n colorProperty?: PercentageColorPropertyRef | null;\r\n /** Ordered rules — evaluated in order, first match wins. `rules` mode only. */\r\n colorRules?: PercentageColorRule[] | null;\r\n /**\r\n * Fallback colour. In `rules` mode it applies when no rule matches; in\r\n * `property` mode when the source property is empty or its value carries no\r\n * colour of its own.\r\n */\r\n defaultColor?: string | null;\r\n}\r\n\r\n/**\r\n * How wide a `PerformanceScore` gauge may grow inside its cell. The gauge is\r\n * centred and shrinks with a narrower cell; this only caps it. Absent ⇒\r\n * `medium`.\r\n */\r\nexport type EntityPerformanceScoreChartSize =\r\n | 'small'\r\n | 'medium'\r\n | 'large'\r\n | 'full';\r\n\r\nexport interface EntityPerformanceScoreConfig extends EntityBaseConfig {\r\n /** Set from the customization drawer. */\r\n chartSize?: EntityPerformanceScoreChartSize;\r\n}\r\n\r\nexport interface LeafLevelSavedConfig {\r\n /** Position order for this level entity in the preview grid */\r\n order: number;\r\n /** Column span (1-24), persisted from drag-resize */\r\n size?: EntitySize;\r\n /** Status keys the user has chosen to display */\r\n selectedStatuses: string[];\r\n /**\r\n * Custom label for THIS tile, localized.\r\n *\r\n * Per-level rather than on the parent property because one LeafDetails\r\n * property renders one tile per child level per projection — a single shared\r\n * label would paint the same text on every one of them and leave the tiles\r\n * indistinguishable. Same reasoning as `order` and `size`, which are already\r\n * per-level. Empty → the child level's own name.\r\n */\r\n label?: EntitySectionLabel;\r\n}\r\n\r\n/**\r\n * Per-level display overrides for the *phase* projection of a LeafDetails\r\n * property — the sibling of {@link LeafLevelSavedConfig}. The two are kept\r\n * apart on purpose: one level can contribute a status item, a phase item, or\r\n * both, each with its own slot and width in the grid.\r\n *\r\n * Unlike `leafLevels`, an absent `leafPhases` map hides every phase item.\r\n * Phases are strictly opt-in so existing cards do not grow badges they were\r\n * never configured with.\r\n */\r\nexport interface LeafPhaseSavedConfig {\r\n /** Position order for this level's phase entity in the preview grid */\r\n order: number;\r\n /** Column span (1-24), persisted from drag-resize */\r\n size?: EntitySize;\r\n /** Phase keys the user has chosen to display */\r\n selectedPhases: string[];\r\n /** Custom label for this phase tile, localized. See `LeafLevelSavedConfig.label`. */\r\n label?: EntitySectionLabel;\r\n}\r\n\r\nexport interface EntityLeafDetailsConfig extends EntityBaseConfig {\r\n /** Per-level display overrides for LeafDetails entities */\r\n leafLevels?: Record<string, LeafLevelSavedConfig>;\r\n /** Per-level phase-badge overrides for LeafDetails entities */\r\n leafPhases?: Record<string, LeafPhaseSavedConfig>;\r\n}\r\n\r\n/**\r\n * Per-source-level display overrides for a Connection entity. Unlike\r\n * `LeafLevelSavedConfig` an absent entry does not hide the level — every source\r\n * level always renders as its own item and simply inherits the parent's\r\n * order/size until the user drags it.\r\n */\r\nexport interface ConnectionLevelSavedConfig {\r\n /** Position order for this source-level item in the preview grid */\r\n order?: number;\r\n /** Column span (1-24), persisted from drag-resize */\r\n size?: EntitySize;\r\n}\r\n\r\nexport interface EntityConnectionConfig extends EntityBaseConfig {\r\n /** Per-source-level display overrides for Connection entities */\r\n connectionLevels?: Record<string, ConnectionLevelSavedConfig>;\r\n}\r\n\r\n/**\r\n * One source level a Connection property can link to, as published on the\r\n * property catalog's `configuration.sourceLevels`. Its `name` supplies the\r\n * label of the split item that represents this level.\r\n */\r\nexport interface ConnectionSourceLevelConfig {\r\n levelId: number;\r\n levelKey?: string;\r\n name?: EntitySectionLabel | string;\r\n connectionId?: number;\r\n [key: string]: unknown;\r\n}\r\n\r\n/** Catalog `configuration` shape of a `Connection` property. */\r\nexport interface ConnectionCatalogConfiguration {\r\n sourceLevels?: ConnectionSourceLevelConfig[];\r\n [key: string]: unknown;\r\n}\r\n\r\n/** One connected record inside a Connection value's `Sources` array. */\r\nexport interface EntityConnectionSourceValue {\r\n sourceLevelId?: number;\r\n SourceLevelId?: number;\r\n sourceLevelDataId?: number;\r\n SourceLevelDataId?: number;\r\n display?: string;\r\n Display?: string;\r\n name?: string;\r\n Name?: string;\r\n [key: string]: unknown;\r\n}\r\n\r\n/** A localized label ({ en, ar }) — used by section headings and custom labels. */\r\nexport interface EntitySectionLabel {\r\n en?: string;\r\n ar?: string;\r\n}\r\n\r\n/** Configuration for a `Section` layout marker (`viewType: 'Section'`). */\r\nexport interface EntitySectionConfig extends EntityBaseConfig {\r\n /** Section heading, localized. Empty/absent renders a header-less box. */\r\n label?: EntitySectionLabel;\r\n}\r\n\r\nexport type EntityConfiguration =\r\n | EntityBaseConfig\r\n | EntityUserConfig\r\n | EntityPercentageConfig\r\n | EntityPerformanceScoreConfig\r\n | EntityLeafDetailsConfig\r\n | EntityConnectionConfig\r\n | EntitySectionConfig;\r\n\r\n/** Value shape for a translatable Text/LongText property: `{ display, ar?, en? }`. */\r\nexport interface EntityTranslatableTextValue extends EntitySectionLabel {\r\n display: string;\r\n}\r\n\r\nexport interface EntityStatusValue {\r\n key: string;\r\n display: string;\r\n color: string;\r\n description?: string;\r\n}\r\n\r\nexport interface EntityLookupValue {\r\n key: string;\r\n display: string;\r\n color: string;\r\n description?: string;\r\n}\r\n\r\nexport type EntityMultiLookupValue = EntityLookupValue[];\r\n\r\n/**\r\n * A `PhaseGate` value — the schema phase gate the record currently sits on.\r\n *\r\n * Calculated and read-only: the backend owns it, nothing in the runtime writes\r\n * it back. `key` is the stable phase-gate key; the schema phase-gate *id* rides\r\n * on the owning entity's `rawValue`, not here. `display` is resolved for the\r\n * request language, and `en`/`ar` carry the explicit per-language labels so the\r\n * renderer can follow a client-side language switch without a refetch.\r\n */\r\nexport interface EntityPhaseGateValue {\r\n key: string;\r\n display: string;\r\n en?: string;\r\n ar?: string;\r\n description?: string;\r\n /**\r\n * Optional presentation metadata (hex). Absent → the renderer's\r\n * `DEFAULT_PHASE_GATE_COLOR` neutral badge.\r\n */\r\n color?: string;\r\n}\r\n\r\n/**\r\n * One performance band of a `PerformanceScore` gauge — a status item with the\r\n * range of performance it covers. Bounds are percentages; a missing `from`\r\n * starts at the gauge minimum and a missing `to` runs to the gauge maximum.\r\n */\r\nexport interface EntityPerformanceScoreStatus {\r\n key: string;\r\n display: string;\r\n color: string;\r\n from?: number | null;\r\n to?: number | null;\r\n}\r\n\r\n/**\r\n * A `PerformanceScore` value, calculated by the backend.\r\n *\r\n * - `performance` — the score, in percent. May exceed 100 or fall below 0; the\r\n * gauge widens its scale to the outermost band, then clamps the marker.\r\n * - `status` — the band the score currently sits in. Absent → resolved here\r\n * from `statuses` by range.\r\n * - `statuses` — every band, drawn as coloured arc segments. Absent/empty → a\r\n * single arc painted in the status colour.\r\n */\r\nexport interface EntityPerformanceScoreValue {\r\n performance: number | string | null;\r\n status?: EntityPerformanceScoreStatus | null;\r\n statuses?: EntityPerformanceScoreStatus[] | null;\r\n}\r\n\r\nexport interface EntityUserValue {\r\n id?: string;\r\n userName?: string;\r\n name?: string;\r\n displayName?: string;\r\n photoUrl?: string;\r\n phoneNumber?: string;\r\n email?: string;\r\n /**\r\n * `false` when the user is no longer linked to the current application\r\n * (e.g. removed/deleted) but is still referenced by historical records.\r\n */\r\n isLinkedToCurrentApplication?: boolean;\r\n}\r\n\r\nexport type EntityMultiUserValue = EntityUserValue[];\r\n\r\nexport interface LeafDetailsStatusSummary {\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n /** Always 0 in preview/configuration context; populated from runtime fetch */\r\n count: number;\r\n}\r\n\r\nexport interface LeafDetailsCatalogStatusValue {\r\n key: string;\r\n display: string;\r\n description?: string | null;\r\n color: string | null;\r\n icon?: string | null;\r\n order?: number;\r\n}\r\n\r\n/**\r\n * One phase bucket of a child level, as published on the catalog\r\n * `configuration` and counted at runtime. `id` is the schema phase-gate id and\r\n * is `null` on the backend's synthetic \"No current phase\" bucket — `key` is\r\n * what the saved configuration selects on, so it is the stable identifier here.\r\n */\r\nexport interface LeafDetailsCatalogPhaseValue {\r\n id?: number | null;\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n icon?: string | null;\r\n order?: number;\r\n}\r\n\r\nexport interface LeafDetailsPhaseSummary {\r\n id?: number | null;\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n /** Always 0 in preview/configuration context; populated from runtime fetch */\r\n count: number;\r\n}\r\n\r\nexport interface LeafDetailsCatalogLevelValue {\r\n levelId: number;\r\n levelName: string;\r\n levelIcon: string;\r\n statuses: LeafDetailsCatalogStatusValue[];\r\n /** Absent for child levels the tenant has defined no phase gates on. */\r\n phases?: LeafDetailsCatalogPhaseValue[] | null;\r\n}\r\n\r\n/** Which projection of a child level an expanded LeafDetails item renders. */\r\nexport type LeafDetailsBadgeKind = 'status' | 'phase';\r\n\r\nexport interface LeafDetailsEntityValue {\r\n levelId: number;\r\n levelName: string;\r\n levelIcon: string;\r\n statuses: LeafDetailsStatusSummary[];\r\n phases?: LeafDetailsPhaseSummary[];\r\n /**\r\n * Set by `expandLeafDetailsEntity` on the split items. `'status'` (or absent,\r\n * for values produced before phases existed) renders the status badges;\r\n * `'phase'` renders the phase badges.\r\n */\r\n kind?: LeafDetailsBadgeKind;\r\n}\r\n\r\nexport type LeafDetailsEntityCollectionValue = LeafDetailsEntityValue[];\r\nexport type LeafDetailsCatalogConfiguration = LeafDetailsCatalogLevelValue[];\r\nexport type EntityPropertyConfiguration =\r\n | Record<string, unknown>\r\n | LeafDetailsCatalogConfiguration\r\n | null;\r\n\r\nexport interface LeafDetailsRuntimeStatusDetails {\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n description?: string | null;\r\n icon?: string | null;\r\n order?: number;\r\n}\r\n\r\nexport interface LeafDetailsRuntimeStatusCount {\r\n details: LeafDetailsRuntimeStatusDetails;\r\n count: number;\r\n}\r\n\r\nexport interface LeafDetailsRuntimePhaseDetails {\r\n id?: number | null;\r\n key: string;\r\n display: string;\r\n color: string | null;\r\n icon?: string | null;\r\n order?: number;\r\n}\r\n\r\nexport interface LeafDetailsRuntimePhaseCount {\r\n details: LeafDetailsRuntimePhaseDetails;\r\n count: number;\r\n}\r\n\r\nexport interface LeafDetailsRuntimeChildSchema {\r\n levelId: number;\r\n levelName: string;\r\n levelIcon: string;\r\n totalCount?: number;\r\n statuses: LeafDetailsRuntimeStatusCount[];\r\n /** Absent for child levels the tenant has defined no phase gates on. */\r\n phases?: LeafDetailsRuntimePhaseCount[] | null;\r\n}\r\n\r\nexport interface LeafDetailsRuntimeValue {\r\n totalCount?: number;\r\n childSchemas: LeafDetailsRuntimeChildSchema[];\r\n}\r\n\r\nexport interface EntityAttachmentItemValue {\r\n id?: string;\r\n name?: string;\r\n fileName?: string;\r\n contentType?: string;\r\n extension?: string;\r\n size?: number;\r\n}\r\n\r\nexport type EntityAttachmentValue = Array<EntityAttachmentItemValue | string>;\r\n\r\nexport interface EntityLocationValue {\r\n display_name?: string;\r\n address?: string;\r\n lat?: string | number;\r\n lon?: string | number;\r\n lng?: string | number;\r\n [key: string]: unknown;\r\n}\r\n\r\nexport interface EntityConnectionValue {\r\n /** Human-readable label of the connected record (read from `rawValue.display`). */\r\n display?: string;\r\n /** Per-source breakdown; the backend serializes it as `Sources`. */\r\n sources?: EntityConnectionSourceValue[];\r\n Sources?: EntityConnectionSourceValue[];\r\n [key: string]: unknown;\r\n}\r\n\r\n/** A single property key/value captured for a checklist entry. */\r\nexport interface EntityLookupCheckListPropValue {\r\n key: string;\r\n /**\r\n * Rendered value resolved by the backend, in the same shape a top-level\r\n * property of the same `viewType` carries. Paired with the matching\r\n * `EntityNestedPropertyMeta` to render it as a real typed entity.\r\n */\r\n value: unknown;\r\n}\r\n\r\n/** One checklist entry: a selected lookup item plus its captured property values. */\r\nexport interface EntityLookupCheckListItem {\r\n lookupKey: string;\r\n props: EntityLookupCheckListPropValue[];\r\n}\r\n\r\n/**\r\n * Rendered view model for a `LookupModuleCheckList` value.\r\n * The backend renderer wraps the checklist entries in `{ items: [...] }`.\r\n */\r\nexport interface EntityLookupCheckListValue {\r\n items: EntityLookupCheckListItem[];\r\n}\r\n\r\nexport interface EntityScheduleItemValue {\r\n id: number;\r\n name: string;\r\n levelDataId?: number;\r\n parentId?: number | null;\r\n status?: string | null;\r\n plannedStart?: string | null;\r\n plannedFinish?: string | null;\r\n moduleKey?: string;\r\n itemType?: string;\r\n}\r\n\r\n/** One cell of an `EntityList` row. Values are always sent as strings. */\r\nexport interface EntityListValueItem {\r\n propertyKey: string;\r\n rawValue?: string | null;\r\n}\r\n\r\n/** One row of an `EntityList` value. */\r\nexport interface EntityListRowValue {\r\n rowId?: string;\r\n entityId?: number;\r\n values?: EntityListValueItem[];\r\n}\r\n\r\n/**\r\n * The stored `EntityList` payload, as the backend renders it. `rows` is the\r\n * only part this view type displays — `entityIds` and the operation-marker\r\n * arrays exist for the writable runtime, not for reading.\r\n */\r\nexport interface EntityListEntityValue {\r\n entityIds?: number[];\r\n rows?: EntityListRowValue[];\r\n}\r\n\r\n/** A `{ en, ar }` pair, as the backend's `Translatable` serializes. */\r\nexport interface EntityListTranslatable {\r\n en?: string | null;\r\n ar?: string | null;\r\n}\r\n\r\n/**\r\n * The source property definition a Local list captured when its schema was\r\n * published (`PropertyDefinitionReadDto`). Server-owned and response-only: the\r\n * backend never trusts one sent back, and pins it so saved values stay\r\n * readable after the source field or module changes or is deleted.\r\n */\r\nexport interface EntityListLocalFieldDefinition {\r\n key: string;\r\n name?: string | null;\r\n nameEn?: string | null;\r\n nameAr?: string | null;\r\n viewType: string;\r\n isRequired?: boolean;\r\n isTranslatable?: boolean;\r\n configuration?: Record<string, unknown> | string | null;\r\n}\r\n\r\n/** A field's share of a row, as the form builder sizes it: ¼, ½ or full. */\r\nexport type EntityListLocalFieldWidth = '25' | '50' | '100';\r\n\r\n/**\r\n * One field of a Local list's schema. `id` is the stable local identity cells\r\n * are keyed by — a UUID, not the source property id. `label` is an optional\r\n * local override of the source label, and `required` is local to the list.\r\n */\r\nexport interface EntityListLocalSchemaField {\r\n id?: string;\r\n sourceKey: string;\r\n label?: EntityListTranslatable | null;\r\n required?: boolean;\r\n hidden?: boolean;\r\n order?: number;\r\n /**\r\n * The field's size in the row dialog. Sent by the configuration screen but\r\n * **not yet stored by the backend** (`LocalEntityListField` has no such\r\n * member), so it is absent from what comes back and the dialog falls back\r\n * to its default until the backend adds it.\r\n */\r\n width?: EntityListLocalFieldWidth | null;\r\n definition?: EntityListLocalFieldDefinition | null;\r\n}\r\n\r\n/**\r\n * A published Local schema. `version` is a UUID that changes whenever the\r\n * field set does; every mutation names the version it was built against.\r\n */\r\nexport interface EntityListLocalSchema {\r\n lineageId?: string;\r\n version?: string;\r\n fields: EntityListLocalSchemaField[];\r\n}\r\n\r\n/** One cell of a Local row. `value` is the rendered counterpart, read-only. */\r\nexport interface EntityListLocalCell {\r\n fieldId: string;\r\n rawValue: string | null;\r\n value?: unknown;\r\n}\r\n\r\n/** One Local row. `rowId` is a client-generated UUID, not a record id. */\r\nexport interface EntityListLocalRow {\r\n rowId: string;\r\n order: number;\r\n version: number;\r\n cells: EntityListLocalCell[];\r\n}\r\n\r\n/**\r\n * A Local `EntityList` value (`storageMode: \"Local\"`): rows owned by the parent\r\n * record, stored inside it rather than as records of the source module.\r\n *\r\n * Arrives from `process-form-load` as the *projected* document — current\r\n * versions, rendered cells, and `schema` with hidden fields already removed —\r\n * and leaves as a *mutation* carrying only what changed, a fresh `mutationId`,\r\n * and no `schema`. See `.github/instructions/properties/EntityList.md`.\r\n */\r\nexport interface EntityListLocalDocument {\r\n storageMode: 'Local';\r\n formatVersion: number;\r\n schemaVersion: string;\r\n version: number;\r\n mutationId?: string;\r\n localRows: EntityListLocalRow[];\r\n deletedRowIds?: string[];\r\n /** Response-only: the schema the rows were projected against. */\r\n schema?: EntityListLocalSchema | null;\r\n}\r\n\r\n/** Whether a stored or rendered `EntityList` value is a Local document. */\r\nexport function isEntityListLocalDocument(\r\n value: unknown,\r\n): value is EntityListLocalDocument {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n !Array.isArray(value) &&\r\n (value as { storageMode?: unknown }).storageMode === 'Local'\r\n );\r\n}\r\n\r\n/** One source value of a selected record: stored scalar plus rendered value. */\r\nexport interface EntityListSelectionRecordValue {\r\n propertyKey: string;\r\n rawValue?: string | null;\r\n value?: unknown;\r\n}\r\n\r\n/** A selected source record, with the configured read fields' values. */\r\nexport interface EntityListSelectionRecord {\r\n entityId: number;\r\n values: EntityListSelectionRecordValue[];\r\n}\r\n\r\n/**\r\n * A Selected `EntityList` value (`recordMode: \"Selected\"`): the source records\r\n * the user picked, by id. Selecting never creates, edits or deletes a source\r\n * record.\r\n *\r\n * Arrives from `process-form-load` as the projected document — `records`\r\n * rendered for display, `unavailableIds` for chosen records the user can no\r\n * longer see — and leaves as a *mutation* carrying only `recordMode`,\r\n * `version`, `mutationId` and the full replacement `entityIds`. See\r\n * `.github/instructions/properties/EntityList.md`.\r\n */\r\nexport interface EntityListSelectionDocument {\r\n recordMode: 'Selected';\r\n version: number;\r\n mutationId?: string;\r\n entityIds: number[];\r\n /** Response-only: the selected records, rendered for display. */\r\n records?: EntityListSelectionRecord[];\r\n /** Response-only: server-captured values; never replayed as a write. */\r\n snapshot?: unknown;\r\n /** Response-only: chosen ids whose record is deleted or no longer visible. */\r\n unavailableIds?: number[];\r\n}\r\n\r\n/** Whether a stored or rendered `EntityList` value is a Selected document. */\r\nexport function isEntityListSelectionDocument(\r\n value: unknown,\r\n): value is EntityListSelectionDocument {\r\n return (\r\n !!value &&\r\n typeof value === 'object' &&\r\n !Array.isArray(value) &&\r\n (value as { recordMode?: unknown }).recordMode === 'Selected'\r\n );\r\n}\r\n\r\n/**\r\n * One field definition of an inline `EntityList`, from its property\r\n * configuration's `inlineFields`. This is the only description of the nested\r\n * columns: the value itself carries bare keys.\r\n */\r\nexport interface EntityListInlineFieldMeta {\r\n key: string;\r\n viewType?: string;\r\n order?: number;\r\n required?: boolean;\r\n configuration?: EntityPropertyConfiguration;\r\n}\r\n\r\n/**\r\n * Catalog metadata for a property nested inside another property's value.\r\n * Mirrors the top-level catalog property shape, which the backend sends under\r\n * `catalog.nestedProperties` keyed by the owning property key. Only\r\n * `LookupModuleCheckList` values carry nested properties today.\r\n */\r\nexport interface EntityNestedPropertyMeta {\r\n id?: number;\r\n key: string;\r\n normalizedKey?: string;\r\n label: string;\r\n viewType: EntityViewType;\r\n configuration?: EntityPropertyConfiguration;\r\n order?: number;\r\n}\r\n\r\nexport interface EntityData {\r\n id?: number;\r\n propertyId?: number;\r\n key?: string;\r\n normalizedKey?: string;\r\n name?: string;\r\n rawValue?: string;\r\n /**\r\n * The colour the backend resolved for *this value*, from the value cell's own\r\n * `color` field.\r\n *\r\n * Distinct from `configuration.color`, which is a colour the configuration\r\n * declares for every value alike. This one is per-record: the backend\r\n * evaluates a Percentage property's colour rules — or, in `property` mode,\r\n * the record's colour-bearing source property — and ships the winner here.\r\n * It is therefore the most specific answer available and outranks anything\r\n * derived from the configuration.\r\n *\r\n * Status and Lookup cells repeat the same colour inside `value`, which is\r\n * where those renderers already read it; a Percentage's `value` is a\r\n * formatted string with nowhere to hang a colour, which is why this exists.\r\n */\r\n color?: string;\r\n order?: number;\r\n propertyConfiguration?: EntityPropertyConfiguration;\r\n /**\r\n * Catalog metadata for the properties captured inside `value`. The stored\r\n * checklist value only carries property keys, so without this the nested\r\n * props have no label and no view type to render with.\r\n */\r\n nestedProperties?: EntityNestedPropertyMeta[];\r\n value:\r\n | string\r\n | EntityTranslatableTextValue\r\n | EntityStatusValue\r\n | EntityUserValue\r\n | EntityMultiUserValue\r\n | EntityLookupValue\r\n | EntityMultiLookupValue\r\n | EntityPhaseGateValue\r\n | EntityPerformanceScoreValue\r\n | EntityAttachmentValue\r\n | EntityLocationValue\r\n | EntityConnectionValue\r\n | EntityScheduleItemValue[]\r\n | EntityLookupCheckListValue\r\n | EntityLookupCheckListItem[]\r\n | LeafDetailsEntityValue\r\n | LeafDetailsEntityCollectionValue\r\n | LeafDetailsRuntimeValue\r\n | EntityListEntityValue;\r\n viewType: EntityViewType;\r\n type?: string;\r\n configuration?: EntityConfiguration;\r\n /** Present on submitted ChangeRequest records — frozen old→new snapshot. */\r\n comparison?: PropertyValueComparison;\r\n /**\r\n * The record's runtime ids, set by a host that renders the value outside\r\n * any `EntityRuntimeContextStore` — a table cell. `EntityList` reads it to\r\n * render its full list in the drawer, as a record preview does inline.\r\n */\r\n runtimeContext?: EntityRuntimeContext | null;\r\n}\r\n\r\n/** Emitted when an entity is resized via the drag handle */\r\nexport interface EntityResizeEvent {\r\n entity: EntityData;\r\n previousSize: EntitySize;\r\n newSize: EntitySize;\r\n}\r\n","import type {\n EntityData,\n EntitySectionConfig,\n EntitySectionLabel,\n} from './entity.model';\n\n/**\n * A section is persisted/transported as an ordinary display item whose\n * `propertyKey` carries this sentinel prefix instead of a real property key\n * (mirrors the LeafDetails synthetic-key convention). Both the customization\n * builder and the runtime renderer recognize it, so the constant lives here in\n * the shared entities layer rather than in either consumer.\n */\nexport const SECTION_KEY_PREFIX = '__section__::';\n\n/** True when a display item's key denotes a section marker. */\nexport function isSectionKey(key?: string | null): boolean {\n return typeof key === 'string' && key.startsWith(SECTION_KEY_PREFIX);\n}\n\n/** Mints a unique section marker key. */\nexport function buildSectionKey(): string {\n return `${SECTION_KEY_PREFIX}${crypto.randomUUID()}`;\n}\n\n/**\n * Resolves a localized label (`{ en, ar }`) for the given language, falling\n * back across locales. Returns '' when nothing is set.\n */\nexport function resolveLocalizedLabel(\n label: EntitySectionLabel | null | undefined,\n lang?: string,\n): string {\n if (!label) return '';\n const primary = lang === 'ar' ? label.ar : label.en;\n return (primary || label.en || label.ar || '').trim();\n}\n\n/**\n * A run of entities that belong to the same section. `section` is the marker\n * entity (`viewType: 'Section'`) whose title heads the group, or `null` for the\n * leading run of entities that appear before the first marker (rendered bare,\n * with no box — so a card with no markers looks exactly like it did before\n * sections existed).\n */\nexport interface EntitySectionGroup {\n section: EntityData | null;\n entities: EntityData[];\n}\n\n/** True when the entity is a `Section` layout marker rather than a value. */\nexport function isEntitySection(\n entity: EntityData | null | undefined,\n): entity is EntityData {\n return entity?.viewType === 'Section';\n}\n\n/**\n * Splits a flat, order-sorted entity list into section groups. Membership is\n * purely positional: each entity belongs to whichever `Section` marker precedes\n * it. Pass the output of `buildDisplayEntities` (already sorted by `order`).\n *\n * Zero markers → a single `{ section: null }` group holding everything, so the\n * bare-grid rendering is unchanged. Empty leading/trailing runs are dropped.\n */\nexport function groupEntitiesIntoSections(\n entities: EntityData[],\n): EntitySectionGroup[] {\n const groups: EntitySectionGroup[] = [];\n let current: EntitySectionGroup = { section: null, entities: [] };\n\n const flush = (): void => {\n if (current.section || current.entities.length > 0) {\n groups.push(current);\n }\n };\n\n for (const entity of entities) {\n if (isEntitySection(entity)) {\n flush();\n current = { section: entity, entities: [] };\n } else {\n current.entities.push(entity);\n }\n }\n flush();\n\n return groups;\n}\n\n/**\n * Resolves a section marker's display label for the given language, falling\n * back across locales and finally to the entity's `name`.\n */\nexport function getEntitySectionTitle(\n section: EntityData | null | undefined,\n lang?: string,\n): string {\n if (!section) return '';\n const label = (section.configuration as EntitySectionConfig | undefined)\n ?.label;\n return resolveLocalizedLabel(label, lang) || (section.name ?? '');\n}\n","import {\r\n EntityConfiguration,\r\n EntityLabelPosition,\r\n EntitySectionLabel,\r\n} from './entity.model';\r\nimport { resolveLocalizedLabel } from './entity-sections.util';\r\n\r\nexport const ENTITY_EMPTY_VALUE_PLACEHOLDER = '_';\r\n\r\nexport function isValueMissing(value: unknown): boolean {\r\n if (value === null || value === undefined) {\r\n return true;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n return value.trim().length === 0;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Serializes a backend `raw` cell into the string `EntityData.rawValue` holds.\r\n *\r\n * Object raws — the Connection payload, the LeafDetails summary — must be\r\n * JSON-encoded: `String(obj)` yields \"[object Object]\" and silently destroys\r\n * the payload the display layer needs to expand them. Primitives keep plain\r\n * `String()` so dates/percentages/checkboxes are not wrapped in quotes.\r\n */\r\nexport function serializeEntityRawValue(raw: unknown): string | undefined {\r\n if (raw === null || raw === undefined) {\r\n return undefined;\r\n }\r\n\r\n if (typeof raw === 'object') {\r\n try {\r\n return JSON.stringify(raw);\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n\r\n return String(raw);\r\n}\r\n\r\n/**\r\n * Reads the colour the backend resolved for a value cell.\r\n *\r\n * The cell carries it as a sibling of `raw`/`value` — `{ raw: \"22\", value:\r\n * \"22%\", color: \"#FF0000\" }` — because for a Percentage the value is a\r\n * formatted string with nowhere to hang a colour on. Status and Lookup cells\r\n * repeat it inside `value`, where those renderers already read it.\r\n *\r\n * Typed as `unknown` on purpose: every fetch-cell interface in the consuming\r\n * packages carries an index signature, so a mistyped or absent `color` is a\r\n * runtime possibility rather than a compile error.\r\n */\r\nexport function readEntityValueColor(color: unknown): string | undefined {\r\n if (typeof color !== 'string') {\r\n return undefined;\r\n }\r\n\r\n const trimmed = color.trim();\r\n return trimmed || undefined;\r\n}\r\n\r\nexport function displayOrPlaceholder(value: unknown): string {\r\n if (isValueMissing(value)) {\r\n return ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n }\r\n\r\n return String(value);\r\n}\r\n\r\n/**\r\n * Text/LongText values are a plain string, except for translatable\r\n * properties, where the backend sends `{ display, ar?, en? }` instead.\r\n * Unwraps either shape to the string to render.\r\n */\r\nexport function extractDisplayText(value: unknown): string | null {\r\n if (typeof value === 'string') {\r\n return value;\r\n }\r\n\r\n if (\r\n value &&\r\n typeof value === 'object' &&\r\n typeof (value as { display?: unknown }).display === 'string'\r\n ) {\r\n return (value as { display: string }).display;\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport function isEntityLabelHidden(\r\n configuration?: EntityConfiguration | null,\r\n): boolean {\r\n const config = configuration as\r\n | {\r\n hideLabel?: boolean;\r\n hideName?: boolean;\r\n }\r\n | null\r\n | undefined;\r\n\r\n return config?.hideLabel ?? config?.hideName ?? false;\r\n}\r\n\r\nexport function isEntityAlignEnd(\r\n configuration?: EntityConfiguration | null,\r\n): boolean {\r\n const config = configuration as { alignEnd?: boolean } | null | undefined;\r\n return config?.alignEnd ?? false;\r\n}\r\n\r\n/**\r\n * The admin-authored note attached to a property in the customization drawer\r\n * (`configuration.info`), resolved for the active language.\r\n *\r\n * Returns `''` when there is no note, which is what the renderer keys off to\r\n * decide whether the entity gets an info affordance at all. The drawer omits\r\n * the key entirely rather than writing an empty object, so \"absent\" and \"blank\"\r\n * collapse to the same answer here on purpose.\r\n */\r\nexport function resolveEntityInfo(\r\n configuration?: EntityConfiguration | null,\r\n lang?: string,\r\n): string {\r\n const config = configuration as\r\n | { info?: EntitySectionLabel }\r\n | null\r\n | undefined;\r\n\r\n return resolveLocalizedLabel(config?.info, lang);\r\n}\r\n\r\n/**\r\n * The product default: label above value.\r\n *\r\n * It used to be `bottom`, which is why Portfolio and Program cards rendered\r\n * \"06/07/2026\" then \"Start Date\" while Project cards — whose properties had\r\n * been through the property-configuration drawer, and so carry an explicit\r\n * `labelPosition` — rendered the label first. Two orders inside one Explore\r\n * module, reachable by clicking a different item in the same sidebar\r\n * (finding M-13). Label-first reads better down a column of mixed field types,\r\n * so it is what every unconfigured property now gets.\r\n *\r\n * An explicit configuration still wins: an administrator who deliberately\r\n * chose value-above-label for a property keeps it.\r\n */\r\nexport function resolveEntityLabelPosition(\r\n configuration?: EntityConfiguration | null,\r\n): EntityLabelPosition {\r\n const config = configuration as\r\n | {\r\n labelPosition?: EntityLabelPosition;\r\n labelPostion?: EntityLabelPosition;\r\n }\r\n | null\r\n | undefined;\r\n\r\n return config?.labelPosition ?? config?.labelPostion ?? 'top';\r\n}\r\n\r\n/**\r\n * Rewrites a localised numeric string into something `parseFloat` can read.\r\n *\r\n * `rawNumericValue` can fall back to the already-formatted display string, so\r\n * whatever `Intl.NumberFormat` produced has to survive a round trip. Under\r\n * `ar` that is harmless (Latin digits plus invisible direction marks), but\r\n * `ar-SA` renders Arabic-Indic digits and an Arabic decimal separator, which\r\n * parse to NaN — the bar would silently disappear rather than show a value.\r\n *\r\n * Handles Arabic-Indic (U+0660-0669) and Eastern Arabic-Indic (U+06F0-06F9)\r\n * digits, the Arabic decimal separator, thousands separators, and the\r\n * bidirectional marks Intl inserts around the percent sign.\r\n */\r\nexport function normalizeNumerals(input: string): string {\r\n return input\r\n .replace(/[]/g, '')\r\n .replace(/[٠-٩]/g, (d) => String(d.charCodeAt(0) - 0x0660))\r\n .replace(/[۰-۹]/g, (d) => String(d.charCodeAt(0) - 0x06f0))\r\n .replace(/[٫]/g, '.')\r\n .replace(/[٬ ]/g, '');\r\n}\r\n","import type { EntityData, EntityUserValue } from './entity.model';\r\n\r\ninterface StakeholderNameColumn {\r\n key: string;\r\n normalizedKey?: string;\r\n}\r\n\r\nconst INTERNAL_NAME_KEY = 'internal_username';\r\nconst EXTERNAL_NAME_KEY = 'external_username';\r\n\r\nfunction matchesKey(\r\n field: { key?: string; normalizedKey?: string },\r\n key: string,\r\n): boolean {\r\n return field.normalizedKey === key || field.key === key;\r\n}\r\n\r\n/** Keep the name slot's identity/layout, and use the populated name's renderer. */\r\nfunction projectName(internal: EntityData, external: EntityData): EntityData {\r\n const isEmptyUser =\r\n internal.viewType === 'User' &&\r\n internal.value != null &&\r\n typeof internal.value === 'object' &&\r\n !(internal.value as EntityUserValue).userName?.trim();\r\n if (internal.value != null && internal.value !== '' && !isEmptyUser) {\r\n return internal;\r\n }\r\n if (external.value == null || external.value === '') return internal;\r\n return {\r\n ...internal,\r\n rawValue: external.rawValue,\r\n value: external.value,\r\n viewType: external.viewType,\r\n type: external.type,\r\n propertyConfiguration: external.propertyConfiguration,\r\n nestedProperties: external.nestedProperties,\r\n comparison: external.comparison,\r\n color: external.color,\r\n };\r\n}\r\n\r\n/** Stakeholder cards show the two mutually exclusive names in one name slot. */\r\nexport function mergeStakeholderNameEntities(\r\n entities: EntityData[],\r\n): EntityData[] {\r\n const internal = entities.find((entity) =>\r\n matchesKey(entity, INTERNAL_NAME_KEY),\r\n );\r\n const external = entities.find((entity) =>\r\n matchesKey(entity, EXTERNAL_NAME_KEY),\r\n );\r\n if (!internal || !external) return entities;\r\n\r\n const name = projectName(internal, external);\r\n return entities.flatMap((entity) =>\r\n entity === external ? [] : [entity === internal ? name : entity],\r\n );\r\n}\r\n\r\n/** Hide the duplicate only when both stakeholder name fields are displayed. */\r\nexport function mergeStakeholderNameColumns<T extends StakeholderNameColumn>(\r\n columns: T[],\r\n): T[] {\r\n if (!columns.some((column) => matchesKey(column, INTERNAL_NAME_KEY))) {\r\n return columns;\r\n }\r\n if (!columns.some((column) => matchesKey(column, EXTERNAL_NAME_KEY))) {\r\n return columns;\r\n }\r\n return columns.filter((column) => !matchesKey(column, EXTERNAL_NAME_KEY));\r\n}\r\n\r\n/** Presentation only: retain the original cells and row edit/submission maps. */\r\nexport function mergeStakeholderNameRows<T extends Record<string, unknown>>(\r\n columns: StakeholderNameColumn[],\r\n rows: T[],\r\n): T[] {\r\n const internal = columns.find((column) =>\r\n matchesKey(column, INTERNAL_NAME_KEY),\r\n );\r\n const external = columns.find((column) =>\r\n matchesKey(column, EXTERNAL_NAME_KEY),\r\n );\r\n if (!internal || !external) return rows;\r\n\r\n return rows.map((row) => {\r\n const internalCell = row[internal.key] as EntityData | undefined;\r\n const externalCell = row[external.key] as EntityData | undefined;\r\n if (!internalCell || !externalCell) return row;\r\n const name = projectName(internalCell, externalCell);\r\n return name === internalCell ? row : { ...row, [internal.key]: name };\r\n });\r\n}\r\n","import { Injectable, InjectionToken, Type, signal } from '@angular/core';\r\n\r\n/**\r\n * The runtime ids an entity renderer needs to fetch anything of its own.\r\n *\r\n * A rendered `EntityData` describes one *value*; it carries no idea of which\r\n * level or level-data row it was read from. Most view types never need one —\r\n * the value is the whole answer. `EntityList` is the exception: a module-backed\r\n * list's rows live in another module and are scoped by the owning level-data\r\n * row, so the renderer cannot resolve them from the value alone.\r\n *\r\n * Hosts that know these ids publish them through `EntityRuntimeContextStore`;\r\n * hosts that do not simply leave it unprovided and every renderer keeps its\r\n * value-only behaviour.\r\n */\r\nexport interface EntityRuntimeContext {\r\n /** Owning level id — addresses the per-level configuration override. */\r\n levelId?: number | string | null;\r\n /** Owning level-data row — what related records are scoped to. */\r\n levelDataId?: number | string | null;\r\n /**\r\n * The record that owns the list, for the reads addressed to it rather than\r\n * to its level — the saved list's `entity-lists/comparison`. Set by a host\r\n * that knows the row it renders (a table cell); a record preview leaves it.\r\n */\r\n ownerKind?: 'ModuleData' | 'LevelData' | null;\r\n ownerId?: number | null;\r\n}\r\n\r\n/**\r\n * Publishes an `EntityRuntimeContext` to a subtree of entity renderers.\r\n *\r\n * Deliberately **not** `providedIn: 'root'`: an unprovided store is the signal\r\n * that the host has no runtime context, and every consumer injects it\r\n * `{ optional: true }`. Providing it on a component scopes it to that\r\n * component's view — which is also how a nested renderer shuts the context\r\n * off for its own children (see `EntityListField`, whose table cells must not\r\n * re-enter the fetching path).\r\n */\r\n@Injectable()\r\nexport class EntityRuntimeContextStore {\r\n readonly context = signal<EntityRuntimeContext | null>(null);\r\n}\r\n\r\n/**\r\n * The component `mt-entity-list-preview` renders inline instead of its\r\n * count-and-drawer trigger, when a runtime context is available.\r\n *\r\n * Indirection rather than a direct import because the real renderer is\r\n * `mt-entity-list-field` (`@masterteam/components/business-fields`), which\r\n * builds on `mt-table` — and `table` already imports `entities`, so importing\r\n * it back here would make the two entry points circular. The provider lives\r\n * with the component: `provideEntityListTablePreview()`.\r\n *\r\n * The component is created with `NgComponentOutlet` and receives\r\n * `propertyId`, `runtimeContext`, `configuration`, `initialValue`, `readonly`\r\n * and `label` as inputs.\r\n */\r\nexport const ENTITY_LIST_TABLE_COMPONENT = new InjectionToken<Type<unknown>>(\r\n 'ENTITY_LIST_TABLE_COMPONENT',\r\n);\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\nimport { Icon } from '@masterteam/icons';\nimport {\n isEntityAlignEnd,\n isEntityLabelHidden,\n resolveEntityLabelPosition,\n} from '../entity-display.utils';\nimport { EntityConfiguration } from '../entity.model';\n\ntype EntityFieldGap = 'compact' | 'normal' | 'relaxed';\n\n@Component({\n selector: 'mt-entity-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [TruncateTooltip, Icon],\n template: `\n <div [class]=\"containerClass()\">\n <div [class]=\"contentContainerClass()\">\n <ng-content />\n </div>\n @if (!hideLabel()) {\n <div [class]=\"labelContainerClass()\">\n @if (labelIconName(); as iconName) {\n <mt-icon [icon]=\"iconName\" size=\"xs\" class=\"shrink-0\" />\n }\n <span\n class=\"block min-w-0 truncate\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n >\n {{ label() }}\n </span>\n </div>\n }\n </div>\n `,\n host: {\n class: 'block min-w-0 w-full',\n },\n})\nexport class EntityField {\n readonly label = input<string>('');\n readonly labelIconName = input<string | null>(null);\n readonly configuration = input<EntityConfiguration | null | undefined>();\n readonly gap = input<EntityFieldGap>('compact');\n\n readonly hideLabel = computed(() =>\n isEntityLabelHidden(this.configuration()),\n );\n\n readonly labelPosition = computed(() =>\n resolveEntityLabelPosition(this.configuration()),\n );\n\n readonly labelContainerClass = computed(() => {\n const justifyClass = isEntityAlignEnd(this.configuration())\n ? 'justify-end'\n : '';\n\n return `flex min-w-0 max-w-full items-center gap-1 text-sm text-gray-500 ${justifyClass}`.trimEnd();\n });\n\n readonly contentContainerClass = computed(() => {\n const alignClass = isEntityAlignEnd(this.configuration())\n ? 'self-end'\n : 'self-stretch';\n\n return `min-w-0 max-w-full ${alignClass}`;\n });\n\n readonly containerClass = computed(() => {\n const gapClass =\n this.gap() === 'relaxed'\n ? 'gap-2'\n : this.gap() === 'normal'\n ? 'gap-1'\n : 'gap-0.5';\n\n const directionClass =\n this.labelPosition() === 'top' ? 'flex-col-reverse' : 'flex-col';\n\n const alignClass = isEntityAlignEnd(this.configuration())\n ? 'items-end'\n : '';\n\n return `flex min-w-0 ${directionClass} ${gapClass} ${alignClass}`.trimEnd();\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\nimport {\n displayOrPlaceholder,\n extractDisplayText,\n} from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityData } from '../entity.model';\n\n@Component({\n selector: 'mt-entity-text',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField, TruncateTooltip],\n templateUrl: './entity-text.html',\n})\nexport class EntityText {\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n /** Individual inputs (used when data is not provided) */\n readonly name = input<string>();\n readonly value = input<string>();\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n readonly displayValue = computed(() => {\n const d = this.data();\n if (d) {\n return displayOrPlaceholder(extractDisplayText(d.value));\n }\n return displayOrPlaceholder(this.value());\n });\n}\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <!--\r\n Two lines before the ellipsis, not one. Portfolio and project names were\r\n being cut mid-word on the Explore board (\"Smart City Infrastructure Po…\"),\r\n which makes similarly-titled records indistinguishable without opening each\r\n one (finding H-06). `line-clamp-2` still ellipsises what genuinely does not\r\n fit, and `mtTruncateTooltip` reads `scrollHeight > clientHeight`, so the\r\n tooltip keeps working for the clamped case exactly as it did for the\r\n single-line one.\r\n -->\r\n <div\r\n class=\"min-w-0 max-w-full line-clamp-2 break-words text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n","import {\n afterNextRender,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n} from '@angular/core';\n\n/** Smallest size the text may shrink to before ellipsis takes over, in px. */\nconst MIN_FONT_PX = 11;\n/** Each pass down the ramp. Small enough to look deliberate, not stepped. */\nconst STEP_PX = 0.5;\n\n/**\n * Shrinks an atomic value a little rather than letting it truncate.\n *\n * A date and an amount are single indivisible facts: `2026/08/16` cut to\n * `2026/08…` has lost the day, and `100,000 SAR` cut to `100,000 …` has lost\n * the currency — which is the one part a reader cannot infer. Prose survives an\n * ellipsis; these do not, so they get one lever before it.\n *\n * Why measure instead of thresholding. The first pass at this capped currency\n * by magnitude — compact anything above 100,000 — with the threshold read off\n * one measured card slot. But slot width is a property of the card layout, not\n * of the number: the three-across boxes on an Explore card are far narrower\n * than the slot that was measured, so `100,000 SAR` and `50,000 SAR` sat under\n * the threshold and truncated anyway. No constant can know the width it has.\n * This asks the element.\n *\n * The element keeps its `truncate`, so anything still too long at the floor\n * ellipsizes exactly as before — with the tooltip callers already attach\n * carrying the full value. Shrinking is a nudge, never the whole answer.\n */\n@Directive({\n selector: '[mtFitText]',\n standalone: true,\n})\nexport class FitText {\n /** Set false to leave a particular instance alone. */\n readonly mtFitText = input(true, {\n transform: (value: unknown) => value !== false && value !== 'false',\n });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private basePx = 0;\n private frame = 0;\n private resizeObserver?: ResizeObserver;\n private mutationObserver?: MutationObserver;\n\n constructor() {\n afterNextRender(() => {\n const el = this.host.nativeElement;\n this.basePx = parseFloat(getComputedStyle(el).fontSize) || 0;\n if (!this.basePx) {\n return;\n }\n\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => this.schedule());\n this.resizeObserver.observe(el);\n }\n // The value itself changes without the box changing size — a re-fetch,\n // a locale switch, an edit committed in place.\n this.mutationObserver = new MutationObserver(() => this.schedule());\n this.mutationObserver.observe(el, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n\n this.schedule();\n });\n\n this.destroyRef.onDestroy(() => {\n this.resizeObserver?.disconnect();\n this.mutationObserver?.disconnect();\n if (this.frame) {\n cancelAnimationFrame(this.frame);\n }\n });\n }\n\n private schedule(): void {\n if (this.frame) {\n cancelAnimationFrame(this.frame);\n }\n this.frame = requestAnimationFrame(() => {\n this.frame = 0;\n this.fit();\n });\n }\n\n private fit(): void {\n const el = this.host.nativeElement;\n if (!this.mtFitText() || !this.basePx) {\n el.style.removeProperty('font-size');\n return;\n }\n\n // Always measure from the base size: the box may have grown back, and a\n // value that once needed shrinking should return to full size when it fits.\n el.style.fontSize = `${this.basePx}px`;\n if (el.clientWidth === 0) {\n return;\n }\n\n let size = this.basePx;\n while (el.scrollWidth > el.clientWidth && size > MIN_FONT_PX) {\n size = Math.max(MIN_FONT_PX, size - STEP_PX);\n el.style.fontSize = `${size}px`;\n }\n\n if (size === this.basePx) {\n el.style.removeProperty('font-size');\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport {\n MTDateFormatPipe,\n type MTDateFormatType,\n} from '@masterteam/components';\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityData } from '../entity.model';\nimport { FitText } from '../fit-text.directive';\n\n@Component({\n selector: 'mt-entity-date',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField, TruncateTooltip, MTDateFormatPipe, FitText],\n templateUrl: './entity-date.html',\n})\nexport class EntityDate {\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n /** Individual inputs (used when data is not provided) */\n readonly name = input<string>();\n readonly value = input<unknown>();\n readonly viewType = input<'Date' | 'DateTime' | 'Time'>('Date');\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n /**\n * `Time` carries a wall-clock value (`HH:mm:ss`) with no date and no zone, so\n * `mtDateFormat` renders it as stored instead of shifting it into the\n * viewer's timezone the way its `DateTime` sibling is shifted.\n */\n readonly resolvedViewType = computed<MTDateFormatType>(() => {\n switch (this.data()?.viewType ?? this.viewType()) {\n case 'DateTime':\n return 'dateTime';\n case 'Time':\n return 'time';\n default:\n return 'date';\n }\n });\n readonly displayValue = computed(\n () => this.data()?.rawValue ?? this.data()?.value ?? this.value(),\n );\n}\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <span\r\n class=\"block min-w-0 truncate text-sm font-semibold tabular-nums whitespace-nowrap\"\r\n mtFitText\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n @if (displayValue()) {\r\n {{ displayValue() | mtDateFormat: resolvedViewType() }}\r\n } @else {\r\n -\r\n }\r\n </span>\r\n</mt-entity-field>\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport {\n displayOrPlaceholder,\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\n} from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityData, EntityStatusValue } from '../entity.model';\n\n@Component({\n selector: 'mt-entity-status',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField],\n templateUrl: './entity-status.html',\n})\nexport class EntityStatus {\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n /** Individual inputs (used when data is not provided) */\n readonly name = input<string>();\n readonly value = input<EntityStatusValue>();\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n\n readonly statusValue = computed<EntityStatusValue | null>(() => {\n const d = this.data();\n if (d && typeof d.value === 'object' && d.value !== null) {\n return d.value as EntityStatusValue;\n }\n return this.value() ?? null;\n });\n\n readonly badgeStyle = computed(() => {\n const status = this.statusValue();\n if (!status?.color) return {};\n return {\n color: status.color,\n backgroundColor: this.hexToRgba(status.color, 0.12),\n };\n });\n\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\n\n readonly statusLabel = computed(() =>\n displayOrPlaceholder(this.statusValue()?.display),\n );\n\n private hexToRgba(hex: string, alpha: number): string {\n const r = parseInt(hex.slice(1, 3), 16);\n const g = parseInt(hex.slice(3, 5), 16);\n const b = parseInt(hex.slice(5, 7), 16);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n }\n}\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (statusValue(); as status) {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit\"\r\n [style]=\"badgeStyle()\"\r\n >\r\n {{ statusLabel() }}\r\n </span>\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","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { Icon, MTIcon } from '@masterteam/icons';\nimport {\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\n extractDisplayText,\n} from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityData } from '../entity.model';\n\n/**\n * Renders an `Icon` view-type value — a stored icon key such as\n * `custom.strategy` — as the actual glyph via `mt-icon`, rather than printing\n * the raw key as text (which is what the plain-text fallback used to do before\n * `Icon` was a distinct view type).\n */\n@Component({\n selector: 'mt-entity-icon',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField, Icon],\n templateUrl: './entity-icon.html',\n})\nexport class EntityIcon {\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n /** Individual inputs (used when data is not provided) */\n readonly name = input<string>();\n readonly value = input<string>();\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\n\n readonly iconName = computed<MTIcon | null>(() => {\n const d = this.data();\n const raw = d ? extractDisplayText(d.value) : (this.value() ?? null);\n return raw ? (raw as MTIcon) : null;\n });\n}\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (iconName(); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-2xl\" />\r\n } @else {\r\n <span class=\"text-sm text-gray-500\">{{ emptyLabel }}</span>\r\n }\r\n</mt-entity-field>\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n input,\n signal,\n untracked,\n} from '@angular/core';\nimport { HttpContext } from '@angular/common/http';\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { Avatar } from '@masterteam/components/avatar';\nimport { Tooltip, TruncateTooltip } from '@masterteam/components/tooltip';\nimport { Icon } from '@masterteam/icons';\nimport { EntityData, EntityUserConfig, EntityUserValue } from '../entity.model';\nimport { SecureImagePipe } from '@masterteam/components/upload-field';\nimport { displayOrPlaceholder } from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { REQUEST_CONTEXT } from '@masterteam/components';\n\n@Component({\n selector: 'mt-entity-user',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n Avatar,\n Tooltip,\n TruncateTooltip,\n Icon,\n SecureImagePipe,\n EntityField,\n TranslocoPipe,\n ],\n templateUrl: './entity-user.html',\n})\nexport class EntityUser {\n readonly httpContext = new HttpContext().set(REQUEST_CONTEXT, {\n useBaseUrl: true,\n });\n\n /** Full entity data object */\n readonly data = input<EntityData>();\n readonly expanded = signal(false);\n\n readonly displayName = computed(() => this.data()?.name ?? '');\n readonly isMultiUser = computed(() => this.data()?.viewType === 'MultiUser');\n\n /** Resolved user objects from either a User or MultiUser entity value. */\n readonly users = computed<EntityUserValue[]>(() => {\n const val = this.data()?.value;\n const values = Array.isArray(val) ? val : [val];\n return values.filter(isEntityUserValue);\n });\n\n readonly maxVisibleUsers = computed(() => {\n const configured = Number(this.config().maxVisibleUsers);\n return Number.isInteger(configured) && configured > 0 ? configured : 5;\n });\n\n readonly visibleUsers = computed(() => {\n const users = this.users();\n if (!this.isMultiUser() || this.expanded()) {\n return users;\n }\n\n return users.slice(0, this.maxVisibleUsers());\n });\n\n readonly hiddenUserCount = computed(\n () => this.users().length - this.visibleUsers().length,\n );\n\n /** First user retained for the existing single-user computed API. */\n private readonly userValue = computed(() => this.users()[0] ?? null);\n\n userNameFor(user: EntityUserValue): string {\n return displayOrPlaceholder(user.displayName ?? null);\n }\n\n userPhotoFor(user: EntityUserValue): string {\n return user.photoUrl ?? '';\n }\n\n labelTextFor(user: EntityUserValue): string {\n return user.name ?? '';\n }\n\n isUnlinkedUser(user: EntityUserValue): boolean {\n return user.isLinkedToCurrentApplication === false && !!user.userName;\n }\n\n phoneNumberFor(user: EntityUserValue): string {\n return user.phoneNumber ?? '';\n }\n\n emailFor(user: EntityUserValue): string {\n return user.email ?? '';\n }\n\n hasContactInfoFor(user: EntityUserValue): boolean {\n return (\n (this.showPhoneNumber() && !!this.phoneNumberFor(user)) ||\n (this.showEmail() && !!this.emailFor(user))\n );\n }\n\n readonly emptyUserName = computed(() => displayOrPlaceholder(null));\n\n readonly rawUserName = computed(() => this.userValue()?.displayName ?? null);\n\n readonly userName = computed(() => displayOrPlaceholder(this.rawUserName()));\n\n readonly userPhoto = computed(() => this.userValue()?.photoUrl ?? '');\n\n readonly labelText = computed(() => this.userValue()?.name ?? '');\n\n /**\n * `true` when the referenced user is no longer linked to the application.\n * Drives the inline info badge/tooltip next to the display name.\n */\n readonly isUnlinked = computed(\n () =>\n this.userValue()?.isLinkedToCurrentApplication === false &&\n this.userValue()?.userName,\n );\n\n // ── Configuration-driven visibility ──\n\n private readonly config = computed(\n () => (this.data()?.configuration as EntityUserConfig) ?? {},\n );\n\n readonly showDisplayName = computed(\n () => this.config().showDisplayName ?? true,\n );\n\n readonly showPhoneNumber = computed(\n () => this.config().showPhoneNumber ?? false,\n );\n\n readonly showEmail = computed(() => this.config().showEmail ?? false);\n\n /** When off the avatar is dropped entirely, leaving the name on its own. */\n readonly showAvatar = computed(() => this.config().showAvatar ?? true);\n\n readonly phoneNumber = computed(() => this.userValue()?.phoneNumber ?? '');\n\n readonly email = computed(() => this.userValue()?.email ?? '');\n\n readonly hasContactInfo = computed(\n () =>\n (this.showPhoneNumber() && !!this.phoneNumber()) ||\n (this.showEmail() && !!this.email()),\n );\n\n constructor() {\n effect(() => {\n void this.data()?.value;\n untracked(() => this.expanded.set(false));\n });\n }\n\n showAllUsers(): void {\n this.expanded.set(true);\n }\n}\n\nfunction isEntityUserValue(value: unknown): value is EntityUserValue {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n return false;\n }\n\n return 'displayName' in value;\n}\n","<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 pe-2\"\r\n [class.ps-1]=\"showAvatar()\"\r\n [class.ps-2]=\"!showAvatar()\"\r\n >\r\n @if (showAvatar()) {\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\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 @if (showAvatar()) {\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\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 @if (showAvatar()) {\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 }\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","import { PercentageColorRule } from './entity.model';\r\n\r\n/**\r\n * Anything that can supply a percentage colour: an ordered rule set plus the\r\n * fallback used when no rule matches.\r\n */\r\nexport interface PercentageColorSource {\r\n colorRules?: PercentageColorRule[] | null;\r\n defaultColor?: string | null;\r\n}\r\n\r\n/** A finite number, or null for anything that cannot be compared numerically. */\r\nfunction toFiniteNumber(value: unknown): number | null {\r\n if (value === null || value === undefined || value === '') {\r\n return null;\r\n }\r\n\r\n const parsed =\r\n typeof value === 'number'\r\n ? value\r\n : Number(String(value).replace(/%/g, '').trim());\r\n\r\n return Number.isFinite(parsed) ? parsed : null;\r\n}\r\n\r\n/**\r\n * Whether `value` falls inside a rule's band. Both bounds are inclusive, an\r\n * absent bound is open-ended, and a rule carrying neither bound is malformed —\r\n * it never matches rather than swallowing every value.\r\n */\r\nexport function matchesPercentageColorRule(\r\n value: number,\r\n rule?: PercentageColorRule | null,\r\n): boolean {\r\n if (!rule) {\r\n return false;\r\n }\r\n\r\n const min = toFiniteNumber(rule.minValue);\r\n const max = toFiniteNumber(rule.maxValue);\r\n\r\n if (min === null && max === null) {\r\n return false;\r\n }\r\n\r\n if (min !== null && value < min) {\r\n return false;\r\n }\r\n\r\n return max === null || value <= max;\r\n}\r\n\r\n/**\r\n * The colour for a percentage value: rules in their configured order, first\r\n * match wins, `defaultColor` when nothing matches.\r\n *\r\n * The backend owns this evaluation and ships the winner as `color` on\r\n * render/value/fetch responses, so callers must prefer that resolved colour.\r\n * This exists for the surfaces that hold a raw rule set and no resolved colour\r\n * — the property-form preview, and catalog reads that never went through a\r\n * value response.\r\n */\r\nexport function resolvePercentageColor(\r\n value: unknown,\r\n source?: PercentageColorSource | null,\r\n): string | null {\r\n const fallback = source?.defaultColor?.trim() || null;\r\n const numericValue = toFiniteNumber(value);\r\n const rules = source?.colorRules;\r\n\r\n if (numericValue === null || !Array.isArray(rules)) {\r\n return fallback;\r\n }\r\n\r\n const match = rules.find((rule) =>\r\n matchesPercentageColorRule(numericValue, rule),\r\n );\r\n\r\n return match?.color?.trim() || fallback;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Progress } from '@masterteam/components/progress';\r\nimport {\r\n displayOrPlaceholder,\r\n isEntityLabelHidden,\r\n isValueMissing,\r\n normalizeNumerals,\r\n readEntityValueColor,\r\n} from '../entity-display.utils';\r\nimport { EntityData, EntityPercentageConfig } from '../entity.model';\r\nimport { resolvePercentageColor } from '../percentage-color.utils';\r\n\r\n@Component({\r\n selector: 'mt-entity-percentage',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [Progress],\r\n templateUrl: './entity-percentage.html',\r\n})\r\nexport class EntityPercentage {\r\n private readonly transloco = inject(TranslocoService);\r\n /** Active locale, so number formatting follows the UI language. */\r\n private readonly locale = computed(\r\n () => this.transloco.getActiveLang() || 'en',\r\n );\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<string>();\r\n readonly rawValue = input<string>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n readonly displayValue = computed(() => {\r\n const d = this.data();\r\n const raw = d\r\n ? typeof d.value === 'string'\r\n ? d.value\r\n : null\r\n : this.value();\r\n return displayOrPlaceholder(this.formatPercentageDisplay(raw));\r\n });\r\n\r\n private readonly rawNumericValue = computed(\r\n () =>\r\n this.data()?.rawValue ??\r\n this.rawValue() ??\r\n this.value() ??\r\n this.displayValue(),\r\n );\r\n\r\n readonly hasNumericValue = computed(() => {\r\n return this.parseNumericValue(this.rawNumericValue()) !== null;\r\n });\r\n\r\n readonly numericValue = computed(() => {\r\n const num = this.parseNumericValue(this.rawNumericValue());\r\n return num === null ? 0 : Math.min(num, 100);\r\n });\r\n\r\n readonly maxValue = computed(() => {\r\n const num = this.parseNumericValue(this.rawNumericValue());\r\n if (num === null) return 100;\r\n return num > 100 ? Math.ceil(num) : 100;\r\n });\r\n\r\n // ── Configuration-driven visibility ──\r\n\r\n readonly hideName = computed(() =>\r\n isEntityLabelHidden(this.data()?.configuration),\r\n );\r\n\r\n /**\r\n * The bar colour. The backend evaluates the property's colour rules and\r\n * returns the winner as `color` on render/value/fetch responses, so a\r\n * resolved colour always wins — the rules are only evaluated here for\r\n * configurations that arrive without one (a catalog read, or the\r\n * property-form preview).\r\n *\r\n * The value's own `color` is checked first and is not the same thing as\r\n * `configuration.color`: it is resolved per record, so it is the only one\r\n * that can carry a band colour for *this* value, or the colour a\r\n * `colorSource: 'property'` configuration took from a sibling property on\r\n * this record. A configuration-level colour applies to every value alike and\r\n * cannot answer either question.\r\n */\r\n readonly progressColor = computed(() => {\r\n const d = this.data();\r\n const direct = d?.configuration as EntityPercentageConfig | undefined;\r\n const fromProperty = d?.propertyConfiguration as\r\n | EntityPercentageConfig\r\n | undefined;\r\n\r\n const perValue = readEntityValueColor(d?.color);\r\n if (perValue) {\r\n return perValue;\r\n }\r\n\r\n const resolved = direct?.color?.trim() || fromProperty?.color?.trim();\r\n if (resolved) {\r\n return resolved;\r\n }\r\n\r\n const raw = this.rawNumericValue();\r\n return (\r\n resolvePercentageColor(raw, direct) ??\r\n resolvePercentageColor(raw, fromProperty) ??\r\n 'primary'\r\n );\r\n });\r\n\r\n /**\r\n * Renders a percentage for the active locale.\r\n *\r\n * This used to echo the backend's string and only append `%` when that string\r\n * already carried one — so in Arabic, where the API returns a bare `\"25\"`,\r\n * the symbol vanished and a progress value rendered as an unlabelled `25`.\r\n * Next to a bar that could be a percentage, a count or a score (finding\r\n * H-08).\r\n *\r\n * Formatting from the NUMBER through `Intl.NumberFormat` makes the symbol,\r\n * the decimal separator and the digit shapes follow the locale instead of the\r\n * payload. `maximumFractionDigits: 1` preserves the precision the old code\r\n * kept; `style: 'percent'` expects a fraction, hence the /100.\r\n *\r\n * Non-numeric values pass through untouched — a status string or an em dash\r\n * must not be mangled into `NaN%`.\r\n */\r\n private formatPercentageDisplay(\r\n raw: string | null | undefined,\r\n ): string | null | undefined {\r\n if (isValueMissing(raw)) {\r\n return raw;\r\n }\r\n\r\n const num = this.parseNumericValue(raw);\r\n if (num === null) {\r\n return raw;\r\n }\r\n\r\n try {\r\n return new Intl.NumberFormat(this.locale(), {\r\n style: 'percent',\r\n maximumFractionDigits: 1,\r\n }).format(num / 100);\r\n } catch {\r\n // An unknown locale tag must not cost the user their number.\r\n return `${Number(num.toFixed(1))}%`;\r\n }\r\n }\r\n\r\n private parseNumericValue(raw: unknown): number | null {\r\n if (isValueMissing(raw)) {\r\n return null;\r\n }\r\n\r\n const normalizedRawValue = normalizeNumerals(String(raw))\r\n .replace(/[%٪]/g, '')\r\n .trim();\r\n if (!normalizedRawValue) {\r\n return null;\r\n }\r\n\r\n const numericValue = Number.parseFloat(normalizedRawValue);\r\n return Number.isNaN(numericValue) ? null : numericValue;\r\n }\r\n}\r\n","<div class=\"flex flex-col gap-1\">\r\n <div class=\"flex items-center justify-between\">\r\n @if (!hideName()) {\r\n <span class=\"text-xs font-semibold\">{{ displayName() }}</span>\r\n }\r\n <span class=\"text-xs font-bold\" [class.ms-auto]=\"hideName()\">{{\r\n displayValue()\r\n }}</span>\r\n </div>\r\n @if (hasNumericValue()) {\r\n <mt-progress\r\n [value]=\"numericValue()\"\r\n [showLabel]=\"false\"\r\n [height]=\"9\"\r\n [maxValue]=\"maxValue()\"\r\n [color]=\"progressColor()\"\r\n >\r\n </mt-progress>\r\n } @else {\r\n <div class=\"h-[9px] rounded-full bg-gray-200\"></div>\r\n }\r\n</div>\r\n","import { normalizeNumerals } from './entity-display.utils';\n\n/**\n * The largest amount still rendered in full.\n *\n * The reviewer measured exactly where the line falls: `100,000 SAR` fits a card\n * slot, `1,000,000 SAR` does not and loses its currency to the ellipsis. So the\n * comparison below is inclusive — anything ABOVE this compacts, and everything\n * a tenant sees today at or under it is untouched.\n */\nexport const CURRENCY_COMPACT_THRESHOLD = 100_000;\n\n/**\n * The numeric amount inside a formatted currency string.\n *\n * Strips the currency token, the grouping separators and the bidirectional\n * marks `Intl` leaves around them, and normalises Arabic-Indic digits so an\n * `ar-SA` payload parses like an `en` one. `null` when there is no number.\n */\nexport function parseCurrencyAmount(\n raw: string | null | undefined,\n): number | null {\n if (typeof raw !== 'string') {\n return null;\n }\n\n const numeric = normalizeNumerals(raw).replace(/[^0-9.+-]/g, '');\n if (!numeric || !/\\d/.test(numeric)) {\n return null;\n }\n\n const parsed = Number.parseFloat(numeric);\n return Number.isFinite(parsed) ? parsed : null;\n}\n\n/**\n * Whatever is left of a formatted amount once the number is removed — `SAR`,\n * `ر.س`, `$`. Read from the payload rather than configured, so a tenant's own\n * currency survives untouched.\n */\nexport function currencyUnitOf(formatted: string): string {\n return normalizeNumerals(formatted)\n .replace(/[0-9.,+-]/g, '')\n .trim();\n}\n\n/**\n * A large currency amount shortened so it fits a card slot, with the unit kept.\n *\n * A budget of a million or more used to render as `1,000,000 …`: the digits\n * survived the ellipsis and the currency did not, so the largest and most\n * consequential figures in the product were the only ones whose unit could not\n * be read (finding H-06). Compact notation keeps the whole thing inside the\n * slot — `SAR 1M` instead of `1,000,000 SAR` — and callers put the exact figure\n * in a tooltip, which is where a precise number belongs on a summary card.\n *\n * Returns `formatted` unchanged whenever the value already fits, is not a\n * number, or the runtime has no compact notation — so no tenant sees an\n * existing number change shape for no reason.\n */\nexport function compactCurrencyDisplay(\n formatted: string,\n rawValue: string | null | undefined,\n locale: string,\n threshold: number = CURRENCY_COMPACT_THRESHOLD,\n): string {\n const amount = parseCurrencyAmount(rawValue ?? formatted);\n if (amount === null || Math.abs(amount) <= threshold) {\n return formatted;\n }\n\n let compact: string;\n try {\n compact = new Intl.NumberFormat(locale, {\n notation: 'compact',\n maximumFractionDigits: 1,\n }).format(amount);\n } catch {\n return formatted;\n }\n\n const unit = currencyUnitOf(formatted);\n if (!unit) {\n return compact;\n }\n\n // Keep the payload's own unit placement — `SAR 1,000` and `1,000 SAR` are\n // both in use, and flipping one to the other reads as a different currency.\n return formatted.trimStart().startsWith(unit)\n ? `${unit} ${compact}`\n : `${compact} ${unit}`;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { Tooltip } from '@masterteam/components/tooltip';\nimport { compactCurrencyDisplay } from '../currency-display.utils';\nimport { displayOrPlaceholder } from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityData } from '../entity.model';\nimport { FitText } from '../fit-text.directive';\n\n@Component({\n selector: 'mt-entity-currency',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField, Tooltip, FitText],\n templateUrl: './entity-currency.html',\n})\nexport class EntityCurrency {\n private readonly transloco = inject(TranslocoService);\n /** Active locale, so number formatting follows the UI language. */\n private readonly locale = computed(\n () => this.transloco.getActiveLang() || 'en',\n );\n\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n /** Individual inputs (used when data is not provided) */\n readonly name = input<string>();\n readonly value = input<string>();\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n\n /** The backend's fully grouped string — always the tooltip, never truncated. */\n readonly fullValue = computed(() => {\n const d = this.data();\n if (d) {\n return displayOrPlaceholder(typeof d.value === 'string' ? d.value : null);\n }\n return displayOrPlaceholder(this.value());\n });\n\n /**\n * What the cell renders: the backend's string, or a compact form of it when\n * the amount is large enough that the currency token would be truncated away.\n * See {@link compactCurrencyDisplay} (finding H-06).\n */\n readonly displayValue = computed(() =>\n compactCurrencyDisplay(\n this.fullValue(),\n this.data()?.rawValue,\n this.locale(),\n ),\n );\n}\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <span\r\n class=\"block min-w-0 truncate text-sm font-semibold tabular-nums whitespace-nowrap\"\r\n mtFitText\r\n [mtTooltip]=\"fullValue()\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ displayValue() }}\r\n </span>\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport {\r\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\r\n isEntityLabelHidden,\r\n} from '../entity-display.utils';\r\nimport { EntityData } from '../entity.model';\r\nimport { coerceCheckboxValue } from '@masterteam/components';\r\n\r\n@Component({\r\n selector: 'mt-entity-checkbox',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n templateUrl: './entity-checkbox.html',\r\n})\r\nexport class EntityCheckbox {\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<string>();\r\n readonly rawValue = input<string>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\r\n\r\n readonly hideName = computed(() =>\r\n isEntityLabelHidden(this.data()?.configuration),\r\n );\r\n\r\n // Reads `rawValue` first (the value as stored) and falls back to the\r\n // rendered `value`. Both arrive as text — `coerceCheckboxValue` owns the\r\n // single definition of which strings count as checked, shared with the\r\n // editable form so a record cannot preview one way and edit another.\r\n readonly checkboxState = computed<boolean | null>(() => {\r\n const raw = coerceCheckboxValue(this.data()?.rawValue ?? this.rawValue());\r\n if (raw !== null) return raw;\r\n\r\n return coerceCheckboxValue(this.data()?.value ?? this.value());\r\n });\r\n}\r\n","<div class=\"flex items-center gap-2\">\r\n @if (checkboxState() === true) {\r\n <svg class=\"w-5 h-5 text-green-500\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else if (checkboxState() === false) {\r\n <svg class=\"w-5 h-5 text-gray-300\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5.414l-2.293-2.293a1 1 0 011.414-1.414L10 11.172l3.879-3.879a1 1 0 111.414 1.414L10 13.414l-.707-.707-.293-.293z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else {\r\n <span\r\n class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-100 px-1 text-[10px] font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n @if (!hideName()) {\r\n <span class=\"text-sm font-semibold\">{{ displayName() }}</span>\r\n }\r\n</div>\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport {\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\n extractDisplayText,\n isValueMissing,\n} from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityData } from '../entity.model';\n\n@Component({\n selector: 'mt-entity-long-text',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField],\n templateUrl: './entity-long-text.html',\n})\nexport class EntityLongText {\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n /** Individual inputs (used when data is not provided) */\n readonly name = input<string>();\n readonly value = input<string>();\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n\n readonly displayValue = computed(() => {\n const d = this.data();\n const raw = d ? extractDisplayText(d.value) : this.value();\n\n if (isValueMissing(raw)) {\n return ENTITY_EMPTY_VALUE_PLACEHOLDER;\n }\n\n return raw as string;\n });\n}\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"text-sm font-semibold break-words\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport {\n displayOrPlaceholder,\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\n} from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport {\n EntityData,\n EntityLookupValue,\n EntityMultiLookupValue,\n} from '../entity.model';\n\n@Component({\n selector: 'mt-entity-lookup',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField],\n templateUrl: './entity-lookup.html',\n})\nexport class EntityLookup {\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n /** Individual inputs (used when data is not provided) */\n readonly name = input<string>();\n readonly value = input<EntityLookupValue | EntityMultiLookupValue>();\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n\n readonly lookupValues = computed<EntityMultiLookupValue>(() => {\n const value = this.data()?.value ?? this.value();\n if (Array.isArray(value)) {\n return value as EntityMultiLookupValue;\n }\n\n if (typeof value === 'object' && value !== null) {\n return [value as EntityLookupValue];\n }\n\n return [];\n });\n\n lookupBadgeStyle(lookup: EntityLookupValue): Record<string, string> {\n if (!lookup?.color) return {};\n return {\n color: lookup.color,\n backgroundColor: this.hexToRgba(lookup.color, 0.12),\n };\n }\n\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\n\n lookupLabel(lookup: EntityLookupValue): string {\n return displayOrPlaceholder(lookup.display);\n }\n\n private hexToRgba(hex: string, alpha: number): string {\n const r = parseInt(hex.slice(1, 3), 16);\n const g = parseInt(hex.slice(3, 5), 16);\n const b = parseInt(hex.slice(5, 7), 16);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n }\n}\n","<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","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { TranslocoService } from '@jsverse/transloco';\nimport {\n displayOrPlaceholder,\n ENTITY_EMPTY_VALUE_PLACEHOLDER,\n} from '../entity-display.utils';\nimport { resolveLocalizedLabel } from '../entity-sections.util';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityData, EntityPhaseGateValue } from '../entity.model';\n\n/** `#RGB` / `#RRGGBB`. Anything else is used as-is for the text color only. */\nconst HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\n\n/**\n * Badge color used when the phase gate carries no `color`. `color` is optional\n * presentation metadata, so a phase gate without one must still read as a\n * badge rather than as bare text — this is the same neutral slate the table\n * falls back to for uncategorized status chips.\n */\nexport const DEFAULT_PHASE_GATE_COLOR = '#475569';\n\n/**\n * Preview renderer for `PhaseGate` properties — a calculated, read-only lookup\n * pointing at the schema phase gate the record currently sits on. It renders\n * exactly like {@link EntityLookup} (colored badge) but resolves its label\n * per-language.\n *\n * Label resolution, in order:\n * 1. `value.ar` / `value.en` for the active language — the backend sends both\n * so a client-side language switch re-renders without a refetch, which is\n * why they win over the already-resolved `display`.\n * 2. `value.display`, then the other locale.\n * 3. The flat display, for payloads that send the value as a bare string\n * (comparison snapshots build their sides that way).\n * 4. `rawValue` — the schema phase-gate id — as a last resort.\n */\n@Component({\n selector: 'mt-entity-phase-gate',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField],\n templateUrl: './entity-phase-gate.html',\n})\nexport class EntityPhaseGate {\n private readonly transloco = inject(TranslocoService);\n\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n /** Individual inputs (used when data is not provided) */\n readonly name = input<string>();\n readonly value = input<EntityPhaseGateValue>();\n\n private readonly activeLang = toSignal(this.transloco.langChanges$, {\n initialValue: this.transloco.getActiveLang(),\n });\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n\n readonly phaseGateValue = computed<EntityPhaseGateValue | null>(() => {\n const value = this.data()?.value;\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n return value as EntityPhaseGateValue;\n }\n return this.value() ?? null;\n });\n\n /** Resolved label, or `null` when nothing at all is available. */\n private readonly resolvedLabel = computed<string | null>(() => {\n const phaseGate = this.phaseGateValue();\n if (phaseGate) {\n const localized = resolveLocalizedLabel(phaseGate, this.activeLang());\n const label = localized || phaseGate.display?.trim();\n if (label) return label;\n }\n\n return this.flatDisplay() ?? this.rawId();\n });\n\n readonly hasValue = computed(() => this.resolvedLabel() !== null);\n\n readonly phaseGateLabel = computed(() =>\n displayOrPlaceholder(this.resolvedLabel()),\n );\n\n readonly badgeStyle = computed(() => {\n const color =\n this.phaseGateValue()?.color?.trim() || DEFAULT_PHASE_GATE_COLOR;\n if (!HEX_COLOR_PATTERN.test(color)) return { color };\n return {\n color,\n backgroundColor: this.hexToRgba(color, 0.12),\n };\n });\n\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\n\n /** The value flattened to a plain display string by the sender. */\n private flatDisplay(): string | null {\n const value = this.data()?.value;\n return typeof value === 'string' && value.trim() ? value.trim() : null;\n }\n\n /** The schema phase-gate id. */\n private rawId(): string | null {\n const rawValue = this.data()?.rawValue;\n return typeof rawValue === 'string' && rawValue.trim()\n ? rawValue.trim()\n : null;\n }\n\n private hexToRgba(hex: string, alpha: number): string {\n const expanded =\n hex.length === 4\n ? `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`\n : hex;\n const r = parseInt(expanded.slice(1, 3), 16);\n const g = parseInt(expanded.slice(3, 5), 16);\n const b = parseInt(expanded.slice(5, 7), 16);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n }\n}\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasValue()) {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit\"\r\n [style]=\"badgeStyle()\"\r\n >\r\n {{ phaseGateLabel() }}\r\n </span>\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","import { Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { TranslocoService } from '@jsverse/transloco';\n\n/**\n * One shared active-language signal per `TranslocoService`.\n *\n * `mt-entity-preview` renders once per property per record — a client-list card\n * grid mounts thousands of them — so a `toSignal(langChanges$)` inside each\n * instance would open thousands of subscriptions to the same Subject just to\n * read one global value. The language is global, so the signal is too: created\n * once, cached against the service, and shared by every entity that needs it.\n *\n * `manualCleanup` is deliberate. The cached signal outlives any single\n * component by design, and the service it hangs off is the root injector's —\n * tying its subscription to whichever entity happened to ask first would tear\n * it down the moment that entity scrolled out of view.\n */\nconst langSignals = new WeakMap<TranslocoService, Signal<string>>();\n\nexport function sharedActiveLang(transloco: TranslocoService): Signal<string> {\n const cached = langSignals.get(transloco);\n if (cached) {\n return cached;\n }\n\n const lang = toSignal(transloco.langChanges$, {\n initialValue: transloco.getActiveLang(),\n manualCleanup: true,\n });\n langSignals.set(transloco, lang);\n return lang;\n}\n","/**\r\n * Shared reading of a `PerformanceScore` value. The gauge draws from it and the\r\n * table resolver filters by it, so a card's pill and the filter it sets can\r\n * never disagree about which status a record is in.\r\n */\r\n\r\nimport { isValueMissing, normalizeNumerals } from './entity-display.utils';\r\nimport {\r\n EntityPerformanceScoreChartSize,\r\n EntityPerformanceScoreStatus,\r\n EntityPerformanceScoreValue,\r\n} from './entity.model';\r\n\r\n/** Every `chartSize`, smallest first — the order the drawer offers them in. */\r\nexport const PERFORMANCE_SCORE_CHART_SIZES: readonly EntityPerformanceScoreChartSize[] =\r\n ['small', 'medium', 'large', 'full'];\r\n\r\n/** The cap applied when a display configuration carries no `chartSize`. */\r\nexport const DEFAULT_PERFORMANCE_SCORE_CHART_SIZE: EntityPerformanceScoreChartSize =\r\n 'medium';\r\n\r\n/** The score as a number, or `null` when there is no measurement. */\r\nexport function parsePerformanceScore(raw: unknown): number | null {\r\n if (typeof raw === 'number') return Number.isFinite(raw) ? raw : null;\r\n if (isValueMissing(raw)) return null;\r\n const parsed = Number.parseFloat(\r\n normalizeNumerals(String(raw)).replace(/[%٪]/g, '').trim(),\r\n );\r\n return Number.isNaN(parsed) ? null : parsed;\r\n}\r\n\r\n/** Bands with at least one bound, ordered along the arc. */\r\nexport function getPerformanceScoreBands(\r\n value: EntityPerformanceScoreValue | null | undefined,\r\n): EntityPerformanceScoreStatus[] {\r\n return (value?.statuses ?? [])\r\n .filter((status) => status.from != null || status.to != null)\r\n .sort((a, b) => (a.from ?? -Infinity) - (b.from ?? -Infinity));\r\n}\r\n\r\n/**\r\n * The backend's status, else the band whose range holds the score. A missing\r\n * bound is open-ended here — unlike on the arc, where it stops at the scale —\r\n * so a 120% score still lands in a `from: 95` band.\r\n */\r\nexport function resolvePerformanceScoreStatus(\r\n value: EntityPerformanceScoreValue | null | undefined,\r\n): EntityPerformanceScoreStatus | null {\r\n if (value?.status) return value.status;\r\n\r\n const performance = parsePerformanceScore(value?.performance);\r\n if (performance === null) return null;\r\n\r\n const bands = getPerformanceScoreBands(value);\r\n return (\r\n bands.find((band, index) => {\r\n const from = band.from ?? -Infinity;\r\n const to = band.to ?? Infinity;\r\n const isLast = index === bands.length - 1;\r\n return (\r\n performance >= from && (isLast ? performance <= to : performance < to)\r\n );\r\n }) ?? null\r\n );\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\r\nimport { sharedActiveLang } from '../active-lang';\r\nimport { ENTITY_EMPTY_VALUE_PLACEHOLDER } from '../entity-display.utils';\r\nimport {\r\n EntityData,\r\n EntityPerformanceScoreChartSize,\r\n EntityPerformanceScoreConfig,\r\n EntityPerformanceScoreStatus,\r\n EntityPerformanceScoreValue,\r\n} from '../entity.model';\r\nimport {\r\n DEFAULT_PERFORMANCE_SCORE_CHART_SIZE,\r\n getPerformanceScoreBands,\r\n parsePerformanceScore,\r\n resolvePerformanceScoreStatus,\r\n} from '../performance-score.utils';\r\n\r\n/** Arc geometry, in viewBox units: a semicircle centred on (50, 100). */\r\nconst ARC_RADIUS = 50;\r\nconst ARC_CENTER_X = 50;\r\nconst ARC_CENTER_Y = 100;\r\n/** Radius band labels sit on — just outside the 6-unit stroke. */\r\nconst LABEL_RADIUS = 59;\r\n/**\r\n * How far each band is pulled back from an interior boundary, as a fraction of\r\n * the arc. Round caps add half the stroke (3 units) past each end, so without\r\n * this neighbouring bands would overlap instead of showing a gap.\r\n */\r\nconst BAND_INSET = 4.5 / (Math.PI * ARC_RADIUS);\r\n/** Shortest band still drawn, so a very narrow range renders as a dot. */\r\nconst MIN_BAND_SPAN = 0.001;\r\n/**\r\n * What the gauge always occupies, labels aside: the stroke (±3) and the marker\r\n * (r 5 + half its 3-unit stroke) at either end of the arc.\r\n */\r\nconst GAUGE_EXTENT = 6.5;\r\n/** Rough advance of one 7-unit bold label glyph, to size the viewBox. */\r\nconst LABEL_CHAR_WIDTH = 4.4;\r\nconst LABEL_HALF_HEIGHT = 4;\r\n\r\n/** Width cap per `chartSize`. */\r\nconst CHART_MAX_WIDTH: Record<EntityPerformanceScoreChartSize, string> = {\r\n small: '11rem',\r\n medium: '15rem',\r\n large: '20rem',\r\n full: '100%',\r\n};\r\n\r\nconst FALLBACK_COLOR = 'var(--p-primary-color)';\r\nconst EMPTY_COLOR = 'var(--p-surface-300)';\r\n\r\ninterface GaugeBand {\r\n key: string;\r\n path: string;\r\n color: string;\r\n opacity: number;\r\n}\r\n\r\ninterface GaugeLabel {\r\n key: string;\r\n text: string;\r\n x: number;\r\n y: number;\r\n anchor: 'start' | 'middle' | 'end';\r\n}\r\n\r\n/**\r\n * Preview renderer for `PerformanceScore` properties — a KPI's performance as a\r\n * semicircle gauge, ported from SPlus v3's `app-performance-gauge`.\r\n *\r\n * Each status band is an arc segment; the band the score sits in is drawn at\r\n * full strength and the rest are faded. The marker rides the arc at the score,\r\n * the score itself sits in the middle, and the current status is a pill below.\r\n *\r\n * Geometry is computed, not measured: the SVG has a fixed `viewBox` and\r\n * `width: 100%` (capped by `configuration.chartSize`, centred), so it scales with its grid\r\n * cell without a `ResizeObserver` — a card grid mounts one of these per record.\r\n */\r\n@Component({\r\n selector: 'mt-entity-performance-score',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [TranslocoPipe],\r\n templateUrl: './entity-performance-score.html',\r\n})\r\nexport class EntityPerformanceScore {\r\n private readonly activeLang = sharedActiveLang(inject(TranslocoService));\r\n\r\n /** Full entity data object */\r\n readonly data = input<EntityData>();\r\n\r\n /** Individual inputs (used when data is not provided) */\r\n readonly name = input<string>();\r\n readonly value = input<EntityPerformanceScoreValue>();\r\n\r\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\r\n\r\n /** The display configuration's `chartSize`, as a CSS `max-width`. */\r\n readonly chartMaxWidth = computed(() => {\r\n const size = (\r\n this.data()?.configuration as EntityPerformanceScoreConfig | undefined\r\n )?.chartSize;\r\n return (\r\n CHART_MAX_WIDTH[size ?? DEFAULT_PERFORMANCE_SCORE_CHART_SIZE] ??\r\n CHART_MAX_WIDTH[DEFAULT_PERFORMANCE_SCORE_CHART_SIZE]\r\n );\r\n });\r\n\r\n readonly scoreValue = computed<EntityPerformanceScoreValue | null>(() => {\r\n const value = this.data()?.value;\r\n if (value && typeof value === 'object' && !Array.isArray(value)) {\r\n return value as EntityPerformanceScoreValue;\r\n }\r\n return this.value() ?? null;\r\n });\r\n\r\n readonly performance = computed(() =>\r\n parsePerformanceScore(this.scoreValue()?.performance),\r\n );\r\n\r\n readonly hasPerformance = computed(() => this.performance() !== null);\r\n\r\n /** Bands with at least one bound, ordered along the arc. */\r\n private readonly statuses = computed<EntityPerformanceScoreStatus[]>(() =>\r\n getPerformanceScoreBands(this.scoreValue()),\r\n );\r\n\r\n /** 0–100, widened to the outermost band bound. */\r\n private readonly scale = computed(() => {\r\n let min = 0;\r\n let max = 100;\r\n for (const status of this.statuses()) {\r\n if (status.from != null && status.from < min) min = status.from;\r\n if (status.to != null && status.to > max) max = status.to;\r\n }\r\n return { min, max };\r\n });\r\n\r\n /** See {@link resolvePerformanceScoreStatus}; the table filters by it too. */\r\n readonly status = computed<EntityPerformanceScoreStatus | null>(() =>\r\n resolvePerformanceScoreStatus(this.scoreValue()),\r\n );\r\n\r\n readonly accentColor = computed(() => {\r\n if (!this.hasPerformance()) return EMPTY_COLOR;\r\n return this.status()?.color?.trim() || FALLBACK_COLOR;\r\n });\r\n\r\n readonly bands = computed<GaugeBand[]>(() => {\r\n const statuses = this.statuses();\r\n if (!statuses.length) {\r\n return [\r\n {\r\n key: 'full',\r\n path: this.arcPath(0, 1),\r\n color: this.accentColor(),\r\n opacity: 1,\r\n },\r\n ];\r\n }\r\n\r\n const activeKey = this.status()?.key;\r\n const { min, max } = this.scale();\r\n return statuses.map((status, index) => {\r\n const start = this.toFraction(status.from ?? min);\r\n const end = this.toFraction(status.to ?? max);\r\n const insetStart = index > 0 ? start + BAND_INSET : start;\r\n const insetEnd = index < statuses.length - 1 ? end - BAND_INSET : end;\r\n return {\r\n key: status.key,\r\n path: this.arcPath(\r\n insetStart,\r\n Math.max(insetEnd, insetStart + MIN_BAND_SPAN),\r\n ),\r\n color: status.color?.trim() || FALLBACK_COLOR,\r\n opacity: status.key === activeKey ? 1 : 0.2,\r\n };\r\n });\r\n });\r\n\r\n /** A label at every band start except the gauge minimum. */\r\n readonly labels = computed<GaugeLabel[]>(() => {\r\n const { min } = this.scale();\r\n return this.statuses()\r\n .filter((status) => status.from != null && status.from > min)\r\n .map((status) => {\r\n const angle = this.toAngle(this.toFraction(status.from as number));\r\n const cos = Math.cos(angle);\r\n return {\r\n key: status.key,\r\n text: this.formatPercent(status.from as number),\r\n x: ARC_CENTER_X + LABEL_RADIUS * cos,\r\n y: ARC_CENTER_Y - LABEL_RADIUS * Math.sin(angle),\r\n anchor: cos > 0.25 ? 'start' : cos < -0.25 ? 'end' : 'middle',\r\n };\r\n });\r\n });\r\n\r\n /**\r\n * Fitted to what is actually drawn, so the arc fills its cell instead of\r\n * reserving label room it may not need. Kept symmetric about the arc's\r\n * centre so the gauge stays centred over the status pill.\r\n */\r\n readonly viewBox = computed(() => {\r\n let minX = ARC_CENTER_X - ARC_RADIUS - GAUGE_EXTENT;\r\n let maxX = ARC_CENTER_X + ARC_RADIUS + GAUGE_EXTENT;\r\n let minY = ARC_CENTER_Y - ARC_RADIUS - GAUGE_EXTENT;\r\n const maxY = ARC_CENTER_Y + GAUGE_EXTENT;\r\n\r\n for (const label of this.labels()) {\r\n const width = label.text.length * LABEL_CHAR_WIDTH;\r\n const left =\r\n label.anchor === 'start'\r\n ? label.x\r\n : label.anchor === 'end'\r\n ? label.x - width\r\n : label.x - width / 2;\r\n minX = Math.min(minX, left);\r\n maxX = Math.max(maxX, left + width);\r\n minY = Math.min(minY, label.y - LABEL_HALF_HEIGHT);\r\n }\r\n\r\n const halfWidth = Math.max(ARC_CENTER_X - minX, maxX - ARC_CENTER_X);\r\n return `${ARC_CENTER_X - halfWidth} ${minY} ${halfWidth * 2} ${maxY - minY}`;\r\n });\r\n\r\n readonly marker = computed(() => {\r\n const performance = this.performance();\r\n if (performance === null) return null;\r\n return this.pointAt(this.toFraction(performance), ARC_RADIUS);\r\n });\r\n\r\n readonly performanceLabel = computed(() => {\r\n const performance = this.performance();\r\n return performance === null\r\n ? ENTITY_EMPTY_VALUE_PLACEHOLDER\r\n : this.formatPercent(performance);\r\n });\r\n\r\n readonly statusLabel = computed(() => this.status()?.display?.trim() || '');\r\n\r\n /** Same tinted badge as `mt-entity-status`, so both read as one status. */\r\n readonly statusPillStyle = computed(() => {\r\n const color = this.status()?.color?.trim() || FALLBACK_COLOR;\r\n return {\r\n color,\r\n backgroundColor: `color-mix(in srgb, ${color} 12%, transparent)`,\r\n };\r\n });\r\n\r\n /** Score → position along the arc, clamped to its ends. */\r\n private toFraction(value: number): number {\r\n const { min, max } = this.scale();\r\n return Math.min(Math.max((value - min) / (max - min), 0), 1);\r\n }\r\n\r\n /** Arc fraction → angle; 0 is the left end, 1 the right. */\r\n private toAngle(fraction: number): number {\r\n return Math.PI * (1 - fraction);\r\n }\r\n\r\n private pointAt(fraction: number, radius: number): { x: number; y: number } {\r\n const angle = this.toAngle(fraction);\r\n return {\r\n x: ARC_CENTER_X + radius * Math.cos(angle),\r\n y: ARC_CENTER_Y - radius * Math.sin(angle),\r\n };\r\n }\r\n\r\n private arcPath(from: number, to: number): string {\r\n const start = this.pointAt(from, ARC_RADIUS);\r\n const end = this.pointAt(to, ARC_RADIUS);\r\n return `M ${start.x} ${start.y} A ${ARC_RADIUS} ${ARC_RADIUS} 0 0 1 ${end.x} ${end.y}`;\r\n }\r\n\r\n /** Same locale-aware formatting as `mt-entity-percentage`. */\r\n private formatPercent(value: number): string {\r\n try {\r\n return new Intl.NumberFormat(this.activeLang() || 'en', {\r\n style: 'percent',\r\n maximumFractionDigits: 1,\r\n }).format(value / 100);\r\n } catch {\r\n return `${Number(value.toFixed(1))}%`;\r\n }\r\n }\r\n}\r\n","<!--\r\n No property label above the gauge: the gauge carries its own caption\r\n (\"Performance Score\"), and the label repeated it. The property name is kept\r\n as the SVG's accessible name instead.\r\n-->\r\n<div class=\"flex w-full flex-col items-center\">\r\n <!--\r\n `direction=\"ltr\"` pins the band labels' text-anchor to the arc's own\r\n left/right — under an RTL host `start`/`end` would otherwise flip and push\r\n the labels into the arc. The gauge itself runs left to right in both\r\n languages, as it does in SPlus.\r\n -->\r\n <svg\r\n class=\"block h-auto w-full overflow-visible\"\r\n [style.max-width]=\"chartMaxWidth()\"\r\n [attr.viewBox]=\"viewBox()\"\r\n direction=\"ltr\"\r\n role=\"img\"\r\n [attr.aria-label]=\"displayName() + ' ' + performanceLabel()\"\r\n >\r\n @for (band of bands(); track band.key) {\r\n <path\r\n [attr.d]=\"band.path\"\r\n fill=\"none\"\r\n stroke-width=\"6\"\r\n stroke-linecap=\"round\"\r\n [style.stroke]=\"band.color\"\r\n [style.opacity]=\"band.opacity\"\r\n />\r\n }\r\n @for (label of labels(); track label.key) {\r\n <text\r\n [attr.x]=\"label.x\"\r\n [attr.y]=\"label.y\"\r\n [attr.text-anchor]=\"label.anchor\"\r\n dominant-baseline=\"middle\"\r\n font-size=\"7\"\r\n font-weight=\"700\"\r\n fill=\"currentColor\"\r\n >\r\n {{ label.text }}\r\n </text>\r\n }\r\n @if (marker(); as point) {\r\n <circle\r\n [attr.cx]=\"point.x\"\r\n [attr.cy]=\"point.y\"\r\n r=\"5\"\r\n fill=\"#ffffff\"\r\n stroke-width=\"3\"\r\n [style.stroke]=\"accentColor()\"\r\n style=\"filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.1))\"\r\n />\r\n }\r\n <text\r\n x=\"50\"\r\n y=\"87\"\r\n text-anchor=\"middle\"\r\n font-size=\"16\"\r\n font-weight=\"700\"\r\n [style.fill]=\"accentColor()\"\r\n >\r\n {{ performanceLabel() }}\r\n </text>\r\n <text\r\n x=\"50\"\r\n y=\"99\"\r\n text-anchor=\"middle\"\r\n font-size=\"6.5\"\r\n fill=\"currentColor\"\r\n class=\"text-gray-600\"\r\n >\r\n {{ \"components.performanceScore.label\" | transloco }}\r\n </text>\r\n </svg>\r\n\r\n @if (statusLabel()) {\r\n <span\r\n class=\"inline-block max-w-full truncate rounded-md px-3 py-2 text-xs font-semibold\"\r\n [style]=\"statusPillStyle()\"\r\n >\r\n {{ statusLabel() }}\r\n </span>\r\n }\r\n</div>\r\n","import { HttpClient, HttpContext } from '@angular/common/http';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { Button } from '@masterteam/components/button';\nimport { UploadField } from '@masterteam/components/upload-field';\nimport { MTIcon } from '@masterteam/icons';\nimport {\n EMPTY,\n catchError,\n finalize,\n forkJoin,\n map,\n of,\n switchMap,\n take,\n} from 'rxjs';\n\nimport {\n EntityAttachmentItemValue,\n EntityAttachmentValue,\n EntityData,\n} from '../entity.model';\nimport { EntityField } from '../entity-field/entity-field';\n\ninterface AttachmentMetadataResponse {\n data: EntityAttachmentItemValue;\n}\n\ntype AttachmentReference = EntityAttachmentItemValue | string;\n\n@Component({\n selector: 'mt-entity-attachment',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [FormsModule, UploadField, Button, EntityField],\n templateUrl: './entity-attachment.html',\n})\nexport class EntityAttachment {\n readonly data = input<EntityData>();\n readonly name = input<string>();\n readonly shape = input<'default' | 'compact'>('default');\n readonly value = input<\n EntityAttachmentValue | EntityAttachmentItemValue | string | null\n >();\n readonly endPoint = input<string>('uploader');\n readonly context = input<HttpContext | undefined>(undefined);\n\n private readonly httpClient = inject(HttpClient);\n private readonly transloco = inject(TranslocoService);\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n readonly loading = signal(false);\n readonly attachments = signal<EntityAttachmentItemValue[]>([]);\n /** Key of the compact chip currently hovered, so it can reveal the download affordance. */\n readonly hoveredAttachmentKey = signal<string | null>(null);\n readonly attachmentReferences = computed(() =>\n this.normalizeAttachmentValue(this.data()?.value ?? this.value()),\n );\n readonly uploadValue = computed(() => {\n const references = this.attachmentReferences().map((reference) => {\n if (typeof reference === 'string') {\n return reference.trim();\n }\n\n if (reference.fileName) {\n return reference;\n }\n\n return reference.id?.trim() || reference;\n });\n\n if (!references.length) {\n return null;\n }\n\n return references.length === 1 ? references[0] : references;\n });\n readonly hasAttachments = computed(() =>\n this.shape() === 'compact'\n ? this.attachments().length > 0\n : this.uploadValue() != null,\n );\n readonly isMultiple = computed(() => this.attachmentReferences().length > 1);\n readonly acceptTypes = computed(() =>\n this.normalizeAcceptTypes(\n (this.data()?.configuration as Record<string, unknown> | undefined)?.[\n 'AcceptTypes'\n ],\n ),\n );\n\n protected readonly empty = '-';\n\n constructor() {\n effect((onCleanup) => {\n if (this.shape() !== 'compact') {\n this.loading.set(false);\n this.attachments.set([]);\n return;\n }\n\n const references = this.attachmentReferences();\n\n if (!references.length) {\n this.loading.set(false);\n this.attachments.set([]);\n return;\n }\n\n const shouldFetchMetadata = references.some((reference) =>\n this.requiresMetadataRequest(reference),\n );\n\n if (!shouldFetchMetadata) {\n this.attachments.set(\n references.filter(this.isAttachmentItemValue).map((reference) => ({\n ...reference,\n name:\n reference.name ??\n reference.fileName ??\n reference.id ??\n reference.name,\n extension: this.resolveExtension(reference),\n })),\n );\n this.loading.set(false);\n return;\n }\n\n this.loading.set(true);\n\n const sub = forkJoin(\n references.map((reference) => this.resolveAttachment$(reference)),\n )\n .pipe(finalize(() => this.loading.set(false)))\n .subscribe((attachments) => {\n this.attachments.set(\n attachments.filter(\n (attachment): attachment is EntityAttachmentItemValue =>\n attachment != null,\n ),\n );\n });\n\n onCleanup(() => sub.unsubscribe());\n });\n }\n\n attachmentTrackBy(\n index: number,\n attachment: EntityAttachmentItemValue,\n ): string {\n return (\n attachment.id ?? attachment.fileName ?? attachment.name ?? String(index)\n );\n }\n\n attachmentTooltip(attachment: EntityAttachmentItemValue): string {\n const name =\n attachment.name ??\n attachment.fileName ??\n attachment.id ??\n this.transloco.translate('components.entitiesPreview.attachment');\n\n return this.transloco.translate(\n 'components.entitiesPreview.downloadAttachment',\n { name },\n );\n }\n\n /**\n * Compact chips are clickable downloads but only show a file-type glyph,\n * which doesn't read as actionable. Swap to a download icon while hovered\n * so the action is obvious.\n */\n attachmentActionIcon(\n index: number,\n attachment: EntityAttachmentItemValue,\n ): MTIcon {\n return this.hoveredAttachmentKey() ===\n this.attachmentTrackBy(index, attachment)\n ? 'general.download-01'\n : this.attachmentIcon(attachment);\n }\n\n attachmentIcon(attachment: EntityAttachmentItemValue): MTIcon {\n const extension = this.resolveExtension(attachment);\n const contentType = attachment.contentType?.toLowerCase() ?? '';\n\n if (contentType.startsWith('image/')) {\n return 'image.image-03';\n }\n\n switch (extension) {\n case '.pdf':\n return 'file.file-06';\n case '.doc':\n case '.docx':\n case '.txt':\n case '.rtf':\n return 'file.file-04';\n case '.xls':\n case '.xlsx':\n case '.csv':\n return 'file.file-03';\n case '.ppt':\n case '.pptx':\n return 'file.file-05';\n default:\n return 'file.clipboard-attachment';\n }\n }\n\n onCompactAttachmentClick(\n event: MouseEvent,\n attachment: EntityAttachmentItemValue,\n ): void {\n event.stopPropagation();\n this.downloadAttachment(attachment);\n }\n\n downloadAttachment(attachment: EntityAttachmentItemValue): void {\n const resolvedAttachment$ = this.requiresMetadataRequest(attachment)\n ? this.resolveAttachment$(attachment)\n : of(this.normalizeAttachmentItem(attachment));\n\n resolvedAttachment$\n .pipe(\n take(1),\n switchMap((resolvedAttachment) => {\n if (!resolvedAttachment?.fileName) {\n return EMPTY;\n }\n\n return this.httpClient\n .get(`${this.endPoint()}/${resolvedAttachment.fileName}`, {\n responseType: 'blob',\n context: this.context(),\n })\n .pipe(\n take(1),\n map((blob) => ({\n attachment: resolvedAttachment,\n blob,\n })),\n );\n }),\n )\n .subscribe(({ attachment, blob }) => {\n const downloadBlob = new Blob([blob], {\n type:\n attachment.contentType || blob.type || 'application/octet-stream',\n });\n const objectUrl = window.URL.createObjectURL(downloadBlob);\n const anchor = document.createElement('a');\n\n anchor.href = objectUrl;\n anchor.download =\n attachment.name ??\n attachment.fileName ??\n attachment.id ??\n 'attachment';\n anchor.click();\n\n window.URL.revokeObjectURL(objectUrl);\n });\n }\n\n private resolveAttachment$(reference: AttachmentReference) {\n const normalizedAttachment = this.normalizeAttachmentItem(reference);\n\n if (!this.requiresMetadataRequest(reference)) {\n return of(normalizedAttachment);\n }\n\n const attachmentId =\n typeof reference === 'string' ? reference.trim() : reference.id?.trim();\n\n if (!attachmentId) {\n return of(normalizedAttachment);\n }\n\n return this.httpClient\n .get<AttachmentMetadataResponse>(\n `${this.endPoint()}/${attachmentId}/metaData`,\n {\n context: this.context(),\n },\n )\n .pipe(\n take(1),\n map((response) => this.normalizeAttachmentItem(response.data)),\n catchError(() => of(normalizedAttachment)),\n );\n }\n\n private normalizeAttachmentValue(value: unknown): AttachmentReference[] {\n if (value === null || value === undefined) {\n return [];\n }\n\n if (Array.isArray(value)) {\n return value.flatMap((item) => this.normalizeAttachmentValue(item));\n }\n\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n if (!trimmedValue || trimmedValue === '[]') {\n return [];\n }\n\n if (\n (trimmedValue.startsWith('[') && trimmedValue.endsWith(']')) ||\n (trimmedValue.startsWith('{') && trimmedValue.endsWith('}'))\n ) {\n try {\n return this.normalizeAttachmentValue(JSON.parse(trimmedValue));\n } catch {\n return [trimmedValue];\n }\n }\n\n return [trimmedValue];\n }\n\n if (typeof value === 'object') {\n const envelope = value as {\n value?: unknown;\n attachments?: unknown;\n id?: unknown;\n fileName?: unknown;\n name?: unknown;\n };\n\n // Backend attachment envelope:\n // { value: <id | id[]>, attachments: [{ value: <id>, name, fileName }] }\n // The stored items don't carry the storage key (their `fileName` is the\n // display name), only the upload id, so resolve every attachment by its\n // id through the metadata endpoint — the same contract\n // `mt-upload-field` uses.\n if (Array.isArray(envelope.attachments)) {\n return envelope.attachments.flatMap((item) =>\n this.normalizeAttachmentValue(item),\n );\n }\n\n // A single backend attachment item carries its upload id under `value`.\n if (\n typeof envelope.value === 'string' &&\n envelope.id === undefined &&\n (envelope.fileName !== undefined || envelope.name !== undefined)\n ) {\n return this.normalizeAttachmentValue(envelope.value);\n }\n\n // Envelope with no resolved attachments yet — unwrap the inner id(s).\n if (\n 'value' in envelope &&\n envelope.id === undefined &&\n envelope.fileName === undefined &&\n envelope.name === undefined\n ) {\n return this.normalizeAttachmentValue(envelope.value);\n }\n\n return [value as EntityAttachmentItemValue];\n }\n\n return [];\n }\n\n private normalizeAttachmentItem(\n value: AttachmentReference | null | undefined,\n ): EntityAttachmentItemValue | null {\n if (!value) {\n return null;\n }\n\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n return trimmedValue\n ? {\n id: trimmedValue,\n name: trimmedValue,\n }\n : null;\n }\n\n const normalizedAttachment: EntityAttachmentItemValue = {\n ...value,\n name: value.name ?? value.fileName ?? value.id ?? '',\n extension: this.resolveExtension(value),\n };\n\n return normalizedAttachment.name ||\n normalizedAttachment.fileName ||\n normalizedAttachment.id\n ? normalizedAttachment\n : null;\n }\n\n private requiresMetadataRequest(reference: AttachmentReference): boolean {\n if (typeof reference === 'string') {\n return reference.trim().length > 0;\n }\n\n return !!reference.id?.trim() && !reference.fileName;\n }\n\n private isAttachmentItemValue(\n reference: AttachmentReference,\n ): reference is EntityAttachmentItemValue {\n return typeof reference === 'object' && reference != null;\n }\n\n private resolveExtension(\n value: EntityAttachmentItemValue,\n ): string | undefined {\n const explicitExtension = value.extension?.trim();\n\n if (explicitExtension) {\n return explicitExtension.startsWith('.')\n ? explicitExtension.toLowerCase()\n : `.${explicitExtension.toLowerCase()}`;\n }\n\n const fileName = value.fileName ?? value.name;\n if (!fileName || !fileName.includes('.')) {\n return undefined;\n }\n\n return `.${fileName.split('.').pop()!.toLowerCase()}`;\n }\n\n private normalizeAcceptTypes(value: unknown): string | undefined {\n if (Array.isArray(value)) {\n const acceptTypes = value\n .map((item) => (typeof item === 'string' ? item.trim() : ''))\n .filter(Boolean);\n\n return acceptTypes.length ? acceptTypes.join(',') : undefined;\n }\n\n if (typeof value === 'string') {\n const acceptTypes = value.trim();\n return acceptTypes || undefined;\n }\n\n return undefined;\n }\n}\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"relaxed\"\r\n>\r\n @if (hasAttachments()) {\r\n @if (shape() === \"compact\") {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (\r\n attachment of attachments();\r\n track attachmentTrackBy($index, attachment)\r\n ) {\r\n <mt-button\r\n iconPos=\"top\"\r\n size=\"small\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n [icon]=\"attachmentActionIcon($index, attachment)\"\r\n [tooltip]=\"attachmentTooltip(attachment)\"\r\n styleClass=\"h-9! w-9! rounded-lg! transition-all duration-200 hover:scale-105 hover:border-primary-500! hover:text-primary-600! hover:bg-primary-50!\"\r\n (onClick)=\"onCompactAttachmentClick($event, attachment)\"\r\n (mouseenter)=\"\r\n hoveredAttachmentKey.set(attachmentTrackBy($index, attachment))\r\n \"\r\n (mouseleave)=\"hoveredAttachmentKey.set(null)\"\r\n (onFocus)=\"\r\n hoveredAttachmentKey.set(attachmentTrackBy($index, attachment))\r\n \"\r\n (onBlur)=\"hoveredAttachmentKey.set(null)\"\r\n />\r\n }\r\n </div>\r\n } @else {\r\n <mt-upload-field\r\n class=\"w-full\"\r\n [ngModel]=\"uploadValue()\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [shape]=\"'card'\"\r\n [multiple]=\"isMultiple()\"\r\n [readonly]=\"true\"\r\n [endPoint]=\"endPoint()\"\r\n [accept]=\"acceptTypes()\"\r\n [context]=\"context()\"\r\n />\r\n }\r\n } @else {\r\n <span class=\"text-sm font-semibold\">{{ empty }}</span>\r\n }\r\n</mt-entity-field>\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\nimport { Icon } from '@masterteam/icons';\nimport { displayOrPlaceholder } from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityData, EntityLocationValue } from '../entity.model';\n\n@Component({\n selector: 'mt-entity-location',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [EntityField, Icon, TruncateTooltip],\n templateUrl: './entity-location.html',\n})\nexport class EntityLocation {\n readonly data = input<EntityData>();\n\n readonly displayName = computed(() => this.data()?.name ?? '');\n readonly location = computed(() =>\n normalizeEntityLocation(this.data()?.value),\n );\n readonly displayValue = computed(() =>\n displayOrPlaceholder(\n this.location()?.display_name ?? this.location()?.address ?? null,\n ),\n );\n readonly coordinates = computed(() => {\n const location = this.location();\n const lat = location?.lat;\n const lon = location?.lon ?? location?.lng;\n if (lat === undefined || lon === undefined || lat === '' || lon === '') {\n return '';\n }\n return `${lat}, ${lon}`;\n });\n readonly mapsUrl = computed(() => {\n const location = this.location();\n const lat = location?.lat;\n const lon = location?.lon ?? location?.lng;\n if (lat === undefined || lon === undefined || lat === '' || lon === '') {\n return '';\n }\n return `https://www.google.com/maps/?q=${encodeURIComponent(`${lat},${lon}`)}`;\n });\n}\n\nfunction normalizeEntityLocation(\n value: EntityData['value'] | undefined,\n): EntityLocationValue | null {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (!trimmed) return null;\n\n try {\n return normalizeEntityLocation(\n JSON.parse(trimmed) as EntityData['value'],\n );\n } catch {\n return {\n display_name: trimmed,\n address: trimmed,\n };\n }\n }\n\n if (typeof value !== 'object' || Array.isArray(value)) {\n return {\n display_name: String(value),\n address: String(value),\n };\n }\n\n const source = value as Record<string, unknown>;\n const displayName =\n readString(source['display_name']) ??\n readString(source['displayName']) ??\n readString(source['address']) ??\n readString(source['name']);\n const lon = source['lon'] ?? source['lng'];\n\n return {\n ...source,\n ...(displayName ? { display_name: displayName, address: displayName } : {}),\n ...(lon !== undefined ? { lon: lon as string | number } : {}),\n };\n}\n\nfunction readString(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n}\n","<mt-entity-field\r\n [label]=\"displayName()\"\r\n [labelIconName]=\"'map.marker-pin-01'\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (mapsUrl()) {\r\n <a\r\n [href]=\"mapsUrl()\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n class=\"flex min-w-0 max-w-full items-center gap-1.5 text-sm font-semibold text-primary-600 hover:text-primary-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"map.marker-pin-01\" size=\"sm\" class=\"shrink-0\" />\r\n <span class=\"min-w-0 truncate\">{{ displayValue() }}</span>\r\n </a>\r\n } @else {\r\n <div\r\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n {{ displayValue() }}\r\n </div>\r\n }\r\n\r\n @if (coordinates()) {\r\n <div class=\"min-w-0 truncate text-xs text-gray-500\">\r\n {{ coordinates() }}\r\n </div>\r\n }\r\n</mt-entity-field>\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { TruncateTooltip } from '@masterteam/components/tooltip';\nimport { displayOrPlaceholder } from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityConnectionValue, EntityData } from '../entity.model';\n\n@Component({\n selector: 'mt-entity-connection',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField, TruncateTooltip],\n templateUrl: './entity-connection.html',\n})\nexport class EntityConnection {\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n /** Individual inputs (used when data is not provided) */\n readonly name = input<string>();\n readonly value = input<EntityConnectionValue | string>();\n\n readonly displayName = computed(() => this.data()?.name ?? this.name() ?? '');\n\n /** The connection display lives on `rawValue.display`; fall back to `value`. */\n readonly connection = computed<EntityConnectionValue | null>(() => {\n const d = this.data();\n return (\n normalizeEntityConnection(d?.value ?? d?.rawValue) ??\n normalizeEntityConnection(this.value())\n );\n });\n\n readonly displayValue = computed(() =>\n displayOrPlaceholder(this.connection()?.display),\n );\n}\n\nfunction normalizeEntityConnection(\n value: unknown,\n): EntityConnectionValue | null {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (!trimmed) return null;\n\n try {\n return normalizeEntityConnection(JSON.parse(trimmed));\n } catch {\n return { display: trimmed };\n }\n }\n\n if (typeof value !== 'object' || Array.isArray(value)) {\n return { display: String(value) };\n }\n\n const source = value as Record<string, unknown>;\n // Parsed payload uses `display`; the serialized JSON value uses `Display`.\n const display =\n typeof source['display'] === 'string'\n ? (source['display'] as string)\n : typeof source['Display'] === 'string'\n ? (source['Display'] as string)\n : undefined;\n\n return { ...source, ...(display !== undefined ? { display } : {}) };\n}\n","<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n>\n <div\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n >\n {{ displayValue() }}\n </div>\n</mt-entity-field>\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { Chip } from '@masterteam/components/chip';\nimport { ENTITY_EMPTY_VALUE_PLACEHOLDER } from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityData, EntityScheduleItemValue } from '../entity.model';\n\n/**\n * Preview renderer for `ScheduleItemSelector` properties.\n *\n * The value is the array of resolved schedule items returned by runtime\n * rendering (`{ id, name, status, ... }`); each one is shown as a chip.\n */\n@Component({\n selector: 'mt-entity-schedule-item',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [EntityField, Chip],\n templateUrl: './entity-schedule-item.html',\n})\nexport class EntityScheduleItem {\n /** Full entity data object */\n readonly data = input<EntityData>();\n\n readonly displayName = computed(() => this.data()?.name ?? '');\n\n readonly items = computed<EntityScheduleItemValue[]>(() => {\n const value = this.data()?.value;\n if (!Array.isArray(value)) return [];\n return (value as unknown[]).filter(\n (item): item is EntityScheduleItemValue =>\n !!item && typeof item === 'object' && 'name' in item,\n );\n });\n\n readonly emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;\n}\n","<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","import {\r\n EntityListLocalCell,\r\n EntityListLocalRow,\r\n EntityListLocalSchema,\r\n EntityListLocalSchemaField,\r\n EntityListTranslatable,\r\n} from './entity.model';\r\n\r\n/**\r\n * Pure helpers shared by everything that reads a Local `EntityList`\r\n * (`storageMode: \"Local\"`) — the runtime field that edits it and the preview\r\n * that only renders it. See `.github/instructions/properties/EntityList.md`.\r\n */\r\n\r\n/**\r\n * The schema's fields a row is rendered with, in order.\r\n *\r\n * A removed field stays in the stored schema as `hidden` so its values survive\r\n * and come back if it is re-added. The projected schema of a loaded value has\r\n * already dropped them, but the configuration's copy — what a create form falls\r\n * back to — has not.\r\n */\r\nexport function visibleLocalSchemaFields(\r\n schema: EntityListLocalSchema | null | undefined,\r\n): EntityListLocalSchemaField[] {\r\n const fields = Array.isArray(schema?.fields) ? schema.fields : [];\r\n return fields\r\n .filter((field) => !!field && !field.hidden && !!field.id)\r\n .slice()\r\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\r\n}\r\n\r\nfunction pickTranslatable(\r\n value: EntityListTranslatable | null | undefined,\r\n lang: string,\r\n): string {\r\n if (!value) return '';\r\n const own = lang === 'ar' ? value.ar : value.en;\r\n const other = lang === 'ar' ? value.en : value.ar;\r\n return (own ?? '').trim() || (other ?? '').trim();\r\n}\r\n\r\n/**\r\n * The label a field renders under: its local override, then the source label\r\n * captured when it was published, then its key. The publisher writes an\r\n * override into the captured definition as well, so either path shows it.\r\n */\r\nexport function resolveLocalFieldLabel(\r\n field: EntityListLocalSchemaField,\r\n lang = 'en',\r\n): string {\r\n const definition = field.definition;\r\n return (\r\n pickTranslatable(field.label, lang) ||\r\n pickTranslatable(\r\n { en: definition?.nameEn, ar: definition?.nameAr },\r\n lang,\r\n ) ||\r\n (definition?.name ?? '').trim() ||\r\n field.sourceKey\r\n );\r\n}\r\n\r\n/** The source view type the field captured; `Text` when none was. */\r\nexport function resolveLocalFieldViewType(\r\n field: EntityListLocalSchemaField,\r\n): string {\r\n return field.definition?.viewType || 'Text';\r\n}\r\n\r\n/**\r\n * The captured source configuration (lookup id, percentage colour rules …).\r\n * `PropertyDefinitionReadDto.configuration` is typed `object?`, so the backend\r\n * writes whatever the source held — an object, or its JSON text.\r\n */\r\nexport function resolveLocalFieldConfiguration(\r\n field: EntityListLocalSchemaField,\r\n): Record<string, unknown> | null {\r\n const configuration = field.definition?.configuration;\r\n if (!configuration) return null;\r\n if (typeof configuration !== 'string') return configuration;\r\n try {\r\n const parsed: unknown = JSON.parse(configuration);\r\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\r\n ? (parsed as Record<string, unknown>)\r\n : null;\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\n/** A row's cells keyed by field id. */\r\nexport function localCellsByFieldId(\r\n row: EntityListLocalRow,\r\n): Map<string, EntityListLocalCell> {\r\n const map = new Map<string, EntityListLocalCell>();\r\n for (const cell of Array.isArray(row?.cells) ? row.cells : []) {\r\n if (cell?.fieldId) map.set(cell.fieldId, cell);\r\n }\r\n return map;\r\n}\r\n\r\n/** Rows in their stored order. */\r\nexport function sortLocalRows(\r\n rows: readonly EntityListLocalRow[] | null | undefined,\r\n): EntityListLocalRow[] {\r\n return (Array.isArray(rows) ? rows : [])\r\n .filter((row) => !!row?.rowId)\r\n .slice()\r\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\r\n}\r\n","import {\r\n EntityConfiguration,\r\n EntityData,\r\n EntityListEntityValue,\r\n EntityListInlineFieldMeta,\r\n EntityListLocalDocument,\r\n EntityListLocalSchema,\r\n EntityListRowValue,\r\n EntityListSelectionDocument,\r\n EntityPropertyConfiguration,\r\n EntityViewType,\r\n isEntityListLocalDocument,\r\n isEntityListSelectionDocument,\r\n} from './entity.model';\r\nimport {\r\n localCellsByFieldId,\r\n resolveLocalFieldConfiguration,\r\n resolveLocalFieldLabel,\r\n resolveLocalFieldViewType,\r\n sortLocalRows,\r\n visibleLocalSchemaFields,\r\n} from './entity-list-local.util';\r\n\r\n/** One rendered row of an `EntityList` value: a title plus the rest. */\r\nexport interface EntityListRenderedRow {\r\n id: string;\r\n /** First field by order — the row's own name. */\r\n title: EntityData | null;\r\n /** Everything else, already stripped of machine companions. */\r\n fields: EntityData[];\r\n}\r\n\r\n/**\r\n * Nested fields render as small labelled pairs. The row is the unit of\r\n * meaning, so labels sit above their values and stay muted.\r\n */\r\nconst NESTED_FIELD_CONFIG: EntityConfiguration = {\r\n labelPosition: 'top',\r\n hideLabel: false,\r\n};\r\n\r\n/**\r\n * A badge already says what it is: \"Status\" stacked above a green \"Completed\"\r\n * pill is one wasted line per row. Applies only to the folded `_key`/`_color`\r\n * status, whose display text is its own label.\r\n */\r\nconst BADGE_FIELD_CONFIG: EntityConfiguration = {\r\n hideLabel: true,\r\n};\r\n\r\n/** The title renders bare — the row itself is the label. */\r\nconst TITLE_FIELD_CONFIG: EntityConfiguration = {\r\n hideLabel: true,\r\n};\r\n\r\n/**\r\n * Suffixes that mark a field as the *machine companion* of another field\r\n * present in the same list — `status_key` and `status_color` describe\r\n * `status`, they are not values of their own. Folded into a single `Status`\r\n * entity so the trio renders as one coloured badge, which is what the backend\r\n * emits them for.\r\n */\r\nconst COMPANION_SUFFIXES = ['key', 'color'] as const;\r\n\r\nfunction normalizeViewType(viewType: string | undefined): EntityViewType {\r\n return (viewType ?? 'Text') as EntityViewType;\r\n}\r\n\r\n/**\r\n * Identifier fields are plumbing, not content: a row that reads\r\n * \"Schema Phase Gate Item Id: 5\" tells the reader nothing. Only `Number`\r\n * fields are dropped, so a genuine text field ending in `_id` still renders.\r\n */\r\nfunction isIdentifierField(meta: EntityListInlineFieldMeta): boolean {\r\n return (\r\n normalizeViewType(meta.viewType) === 'Number' &&\r\n meta.key.toLowerCase().endsWith('_id')\r\n );\r\n}\r\n\r\n/**\r\n * Derive a readable label from a raw field key. Inline `EntityList` fields\r\n * carry no label of their own — the configuration defines them as bare keys —\r\n * so this strips separators and title-cases what is left.\r\n */\r\nexport function humanizeEntityListKey(key: string): string {\r\n const words = key\r\n .replace(/[_-]+/g, ' ')\r\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\r\n .trim();\r\n if (!words) return key;\r\n return words.charAt(0).toUpperCase() + words.slice(1);\r\n}\r\n\r\n/**\r\n * The value arrives parsed when the host hands over the rendered cell, and as\r\n * JSON when it comes through `rawValue` — the table serializes object cells on\r\n * the way in.\r\n */\r\nfunction coerceValue(\r\n data: EntityData,\r\n):\r\n | EntityListEntityValue\r\n | EntityListLocalDocument\r\n | EntityListSelectionDocument\r\n | null {\r\n const value = data.value;\r\n if (value && typeof value === 'object' && !Array.isArray(value)) {\r\n return value as EntityListEntityValue;\r\n }\r\n\r\n const raw = typeof value === 'string' && value ? value : data.rawValue;\r\n if (typeof raw !== 'string' || !raw.trim()) return null;\r\n\r\n try {\r\n const parsed: unknown = JSON.parse(raw);\r\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\r\n ? (parsed as EntityListEntityValue)\r\n : null;\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * The inline field catalog. `propertyConfiguration` is the untouched catalog\r\n * entry; `configuration` is read as well because the table merges its own\r\n * display flags into that object when it builds a cell.\r\n */\r\nfunction readInlineFields(data: EntityData): EntityListInlineFieldMeta[] {\r\n const sources: EntityPropertyConfiguration[] = [\r\n data.propertyConfiguration ?? null,\r\n (data.configuration ?? null) as EntityPropertyConfiguration,\r\n ];\r\n\r\n for (const source of sources) {\r\n if (!source || Array.isArray(source)) continue;\r\n const fields = (source as Record<string, unknown>)['inlineFields'];\r\n if (Array.isArray(fields) && fields.length > 0) {\r\n return fields as EntityListInlineFieldMeta[];\r\n }\r\n }\r\n\r\n return [];\r\n}\r\n\r\n/**\r\n * The field this one is a machine companion of, when that field is present in\r\n * the same list. `status_color` returns `status`; a standalone `color` field\r\n * with no `color` sibling returns null and renders normally.\r\n */\r\nfunction companionTargetOf(\r\n field: EntityListInlineFieldMeta,\r\n present: Set<string>,\r\n): string | null {\r\n for (const suffix of COMPANION_SUFFIXES) {\r\n if (!field.key.endsWith(`_${suffix}`)) continue;\r\n const target = field.key.slice(0, -(suffix.length + 1));\r\n if (target && present.has(target)) return target;\r\n }\r\n return null;\r\n}\r\n\r\n/** Field definitions in render order, machine companions already removed. */\r\nfunction visibleFields(\r\n data: EntityData,\r\n allowed: readonly string[],\r\n): EntityListInlineFieldMeta[] {\r\n const declared = [...readInlineFields(data)].sort(\r\n (a, b) => (a.order ?? 0) - (b.order ?? 0),\r\n );\r\n const present = new Set(declared.map((field) => field.key));\r\n const visible = declared.filter(\r\n (field) => !isIdentifierField(field) && !companionTargetOf(field, present),\r\n );\r\n\r\n if (allowed.length === 0) return visible;\r\n\r\n const byKey = new Map(visible.map((field) => [field.key, field]));\r\n return allowed\r\n .map((key) => byKey.get(key))\r\n .filter((field): field is EntityListInlineFieldMeta => !!field);\r\n}\r\n\r\nfunction valuesByKey(row: EntityListRowValue): Map<string, string | null> {\r\n const map = new Map<string, string | null>();\r\n for (const item of row.values ?? []) {\r\n if (item?.propertyKey) map.set(item.propertyKey, item.rawValue ?? null);\r\n }\r\n return map;\r\n}\r\n\r\n/**\r\n * Builds the entity for one nested field. A field with a `_key`/`_color`\r\n * companion becomes a `Status`, so the trio renders as one coloured badge\r\n * instead of three separate cells.\r\n */\r\nfunction toNestedEntity(\r\n field: EntityListInlineFieldMeta,\r\n values: Map<string, string | null>,\r\n): EntityData | null {\r\n const raw = values.get(field.key) ?? null;\r\n const color = values.get(`${field.key}_color`);\r\n const statusKey = values.get(`${field.key}_key`);\r\n\r\n const base = {\r\n key: field.key,\r\n name: humanizeEntityListKey(field.key),\r\n propertyConfiguration: field.configuration,\r\n configuration: NESTED_FIELD_CONFIG,\r\n order: field.order,\r\n };\r\n\r\n if (color !== undefined || statusKey !== undefined) {\r\n // No display text means no badge to show — an empty status is empty.\r\n if (!raw) return null;\r\n return {\r\n ...base,\r\n configuration: BADGE_FIELD_CONFIG,\r\n rawValue: raw,\r\n viewType: 'Status',\r\n value: { key: statusKey ?? raw, display: raw, color: color ?? '' },\r\n };\r\n }\r\n\r\n return {\r\n ...base,\r\n rawValue: raw ?? undefined,\r\n viewType: normalizeViewType(field.viewType),\r\n value: raw ?? '',\r\n };\r\n}\r\n\r\n/**\r\n * Turns an `EntityList` entity into rendered rows.\r\n *\r\n * Nothing is fetched: the value already carries `rows[]`, and the property\r\n * configuration's `inlineFields` is the only description of the nested columns\r\n * — the rows themselves carry bare keys. Shared by the trigger\r\n * (`mt-entity-list-preview`, which needs the count and the titles) and the\r\n * drawer that renders them in full.\r\n *\r\n * `allowed` narrows to those keys, in that order; empty renders every field\r\n * that survives the companion and identifier rules.\r\n */\r\nexport function buildEntityListRows(\r\n data: EntityData,\r\n allowed: readonly string[] = [],\r\n lang = 'en',\r\n): EntityListRenderedRow[] {\r\n const value = coerceValue(data);\r\n if (isEntityListLocalDocument(value)) {\r\n return buildLocalRows(value, data, allowed, lang);\r\n }\r\n if (isEntityListSelectionDocument(value)) {\r\n return buildSelectionRows(value, data, allowed);\r\n }\r\n\r\n const fields = visibleFields(data, allowed);\r\n const rows = value?.rows;\r\n if (!Array.isArray(rows)) return [];\r\n\r\n return rows\r\n .filter((row) => !!row)\r\n .map((row, index) => {\r\n const values = valuesByKey(row);\r\n const rendered = fields\r\n .map((field) => toNestedEntity(field, values))\r\n .filter((entity): entity is EntityData => !!entity);\r\n\r\n // The title is the first field that actually rendered, not the first\r\n // that was declared: a leading field can drop out (an empty status\r\n // renders nothing), and the survivor promoted into the title slot must\r\n // lose its label there rather than keep the one it was built with.\r\n const [first, ...rest] = rendered;\r\n\r\n return {\r\n id: String(row.rowId ?? row.entityId ?? index),\r\n title: first ? { ...first, configuration: TITLE_FIELD_CONFIG } : null,\r\n fields: rest,\r\n };\r\n });\r\n}\r\n\r\n/**\r\n * Rows of a Local list (`storageMode: \"Local\"`).\r\n *\r\n * The projected document `process-form-load` returns carries its own\r\n * `schema`, and it wins: pending and approved evidence is pinned to the schema\r\n * it was submitted against, which the property configuration's *active* one\r\n * may no longer be. The fetch endpoints project against the active schema;\r\n * an older backend returned the stored document there (`schema: null`), for\r\n * which the configuration's `localSchema` is the fallback.\r\n * Cells are keyed by the field's local id and carry the backend-rendered\r\n * `value` beside `rawValue` where one was rendered; otherwise the raw value\r\n * shows.\r\n *\r\n * `allowed` narrows by source key, the one identity the host can know.\r\n */\r\nfunction buildLocalRows(\r\n document: EntityListLocalDocument,\r\n data: EntityData,\r\n allowed: readonly string[],\r\n lang: string,\r\n): EntityListRenderedRow[] {\r\n const declared = visibleLocalSchemaFields(\r\n document.schema ?? readConfiguredLocalSchema(data),\r\n );\r\n const bySourceKey = new Map(\r\n declared.map((field) => [field.sourceKey, field]),\r\n );\r\n const fields =\r\n allowed.length === 0\r\n ? declared\r\n : allowed\r\n .map((key) => bySourceKey.get(key))\r\n .filter((field): field is (typeof declared)[number] => !!field);\r\n\r\n return sortLocalRows(document.localRows).map((row) => {\r\n const cells = localCellsByFieldId(row);\r\n const rendered = fields.map<EntityData>((field) => {\r\n const cell = cells.get(field.id as string);\r\n const rawValue = cell?.rawValue ?? undefined;\r\n return {\r\n key: field.sourceKey,\r\n name: resolveLocalFieldLabel(field, lang),\r\n viewType: normalizeViewType(resolveLocalFieldViewType(field)),\r\n value: (cell?.value ?? rawValue ?? '') as EntityData['value'],\r\n rawValue,\r\n propertyConfiguration:\r\n resolveLocalFieldConfiguration(field) ?? undefined,\r\n configuration: NESTED_FIELD_CONFIG,\r\n order: field.order,\r\n };\r\n });\r\n\r\n // The title names the row, and it renders without its label. The first\r\n // field of a Local list is whatever the field manager put first — often a\r\n // progress bar or a date, which as a bare headline reads as the row's\r\n // name. So the title is the first filled text field; everything else keeps\r\n // its label, in schema order. A row with no text to name it has no title.\r\n const titleIndex = rendered.findIndex(isRowNameField);\r\n const title = titleIndex >= 0 ? rendered[titleIndex] : null;\r\n\r\n return {\r\n id: row.rowId,\r\n title: title ? { ...title, configuration: TITLE_FIELD_CONFIG } : null,\r\n fields: rendered.filter((_, index) => index !== titleIndex),\r\n };\r\n });\r\n}\r\n\r\n/**\r\n * Rows of a Selected list (`recordMode: \"Selected\"`): one per selected record\r\n * the value carries values for, in selection order.\r\n *\r\n * Here there is no metadata request, so nothing names the fields or their\r\n * view types: labels come from the keys and each value renders as its display\r\n * text. A record whose values the backend withheld (`unavailableIds`) has\r\n * nothing to show and is left out.\r\n *\r\n * `allowed` narrows by field key; otherwise the configured `readFields`\r\n * order, then the order the values arrived in.\r\n */\r\nfunction buildSelectionRows(\r\n document: EntityListSelectionDocument,\r\n data: EntityData,\r\n allowed: readonly string[],\r\n): EntityListRenderedRow[] {\r\n const records = new Map(\r\n (document.records ?? []).map((record) => [record.entityId, record]),\r\n );\r\n const ids = document.entityIds?.length\r\n ? document.entityIds\r\n : [...records.keys()];\r\n const configured = readConfiguredReadFields(data);\r\n\r\n return ids.flatMap((id) => {\r\n const record = records.get(id);\r\n if (!record) return [];\r\n const values = new Map(\r\n (record.values ?? []).map((item) => [item.propertyKey, item]),\r\n );\r\n const keys = allowed.length\r\n ? allowed\r\n : configured.length\r\n ? configured\r\n : [...values.keys()];\r\n const rendered = keys\r\n .map((key) => values.get(key))\r\n .filter((item) => !!item)\r\n .map<EntityData>((item, index) => ({\r\n key: item.propertyKey,\r\n name: humanizeEntityListKey(item.propertyKey),\r\n ...selectionCell(item.value, item.rawValue),\r\n rawValue: item.rawValue ?? undefined,\r\n configuration: NESTED_FIELD_CONFIG,\r\n order: index,\r\n }));\r\n const [first, ...rest] = rendered;\r\n\r\n return [\r\n {\r\n id: String(record.entityId),\r\n title: first ? { ...first, configuration: TITLE_FIELD_CONFIG } : null,\r\n fields: rest,\r\n },\r\n ];\r\n });\r\n}\r\n\r\n/** The configured displayed fields of a Selected list, if any. */\r\nfunction readConfiguredReadFields(data: EntityData): string[] {\r\n for (const source of [data.propertyConfiguration, data.configuration]) {\r\n if (!source || Array.isArray(source)) continue;\r\n const fields = (source as Record<string, unknown>)['readFields'];\r\n if (Array.isArray(fields) && fields.length) {\r\n return fields.filter(\r\n (key): key is string => typeof key === 'string' && !!key,\r\n );\r\n }\r\n }\r\n return [];\r\n}\r\n\r\n/** An ISO date or date-time, as the backend renders a Date / DateTime value. */\r\nconst ISO_DATE =\r\n /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:?\\d{2})?)?$/;\r\n\r\n/**\r\n * How one Selected cell renders without field metadata — a table cell has\r\n * none to ask for. The rendered value's own shape decides: an ISO date is a\r\n * `Date` (printed `2026/09/20`, not `2026-09-20T00:00:00.0000000Z`), a user\r\n * object a `User`, and everything else its display text.\r\n */\r\nfunction selectionCell(\r\n value: unknown,\r\n rawValue: string | null | undefined,\r\n): Pick<EntityData, 'viewType' | 'value'> {\r\n if (typeof value === 'string' && ISO_DATE.test(value.trim())) {\r\n return { viewType: 'Date', value: value.trim() };\r\n }\r\n if (\r\n value &&\r\n typeof value === 'object' &&\r\n !Array.isArray(value) &&\r\n typeof (value as Record<string, unknown>)['displayName'] === 'string'\r\n ) {\r\n return { viewType: 'User', value: value as EntityData['value'] };\r\n }\r\n return { viewType: 'Text', value: selectionDisplayText(value, rawValue) };\r\n}\r\n\r\n/**\r\n * A rendered source value as text: a scalar as is, a user or a lookup by its\r\n * display name, a list joined. Falls back to the stored scalar.\r\n */\r\nfunction selectionDisplayText(\r\n value: unknown,\r\n rawValue: string | null | undefined,\r\n): string {\r\n if (value == null || value === '') return rawValue ?? '';\r\n if (Array.isArray(value)) {\r\n return value\r\n .map((entry) => selectionDisplayText(entry, null))\r\n .filter((text) => !!text)\r\n .join(', ');\r\n }\r\n if (typeof value !== 'object') return String(value);\r\n\r\n const record = value as Record<string, unknown>;\r\n for (const key of ['display', 'displayName', 'name']) {\r\n const text = record[key];\r\n if (typeof text === 'string' && text.trim()) return text.trim();\r\n }\r\n return rawValue ?? '';\r\n}\r\n\r\n/** A text field with a value — something that can name a row. */\r\nfunction isRowNameField(entity: EntityData): boolean {\r\n if (entity.viewType !== 'Text' && entity.viewType !== 'LongText') {\r\n return false;\r\n }\r\n const value = entity.value;\r\n return typeof value === 'string' ? value.trim().length > 0 : value != null;\r\n}\r\n\r\n/** The active Local schema from the property configuration, if any. */\r\nfunction readConfiguredLocalSchema(\r\n data: EntityData,\r\n): EntityListLocalSchema | null {\r\n for (const source of [data.propertyConfiguration, data.configuration]) {\r\n if (!source || Array.isArray(source)) continue;\r\n const schema = (source as Record<string, unknown>)['localSchema'];\r\n if (schema && typeof schema === 'object') {\r\n return schema as EntityListLocalSchema;\r\n }\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * The row's title as plain text. A title that folded into a `Status` carries\r\n * an object, not a string — reading only the string case would silently drop\r\n * every row from the tooltip whenever the leading field is a status.\r\n */\r\nfunction titleTextOf(row: EntityListRenderedRow): string {\r\n const value = row.title?.value;\r\n if (typeof value === 'string') return value.trim();\r\n if (value && typeof value === 'object' && 'display' in value) {\r\n const display = (value as { display?: unknown }).display;\r\n return typeof display === 'string' ? display.trim() : '';\r\n }\r\n return '';\r\n}\r\n\r\n/**\r\n * Plain-text summary of the rows, for the trigger's tooltip. Caps the list so\r\n * a forty-item checklist does not become a forty-line tooltip.\r\n */\r\nexport function summarizeEntityListRows(\r\n rows: readonly EntityListRenderedRow[],\r\n limit: number,\r\n): { names: string[]; remaining: number } {\r\n const names = rows.map(titleTextOf).filter((name) => name.length > 0);\r\n\r\n return {\r\n names: names.slice(0, limit),\r\n remaining: Math.max(0, names.length - limit),\r\n };\r\n}\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { TooltipModule } from 'primeng/tooltip';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { readableTextOn } from '@masterteam/components';\nimport {\n EntityData,\n EntityLeafDetailsConfig,\n LeafDetailsEntityValue,\n LeafDetailsStatusSummary,\n LeafLevelSavedConfig,\n LeafPhaseSavedConfig,\n} from '../entity.model';\nimport { EntityField } from '../entity-field/entity-field';\nimport { resolveLocalizedLabel } from '../entity-sections.util';\nimport { sharedActiveLang } from '../active-lang';\n\n/** Neutral grey for a status the catalog left without a colour. */\nconst DEFAULT_STATUS_COLOR = '#9CA3AF';\n\n@Component({\n selector: 'mt-entity-leaf-details',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [EntityField, TooltipModule],\n templateUrl: './entity-leaf-details.html',\n})\nexport class EntityLeafDetails {\n private readonly transloco = inject(TranslocoService);\n\n readonly data = input.required<EntityData>();\n\n /**\n * Re-resolves the \"Phases\" qualifier when the user switches language. The\n * shared signal keeps this to one subscription for the whole grid — a cards\n * board mounts thousands of these.\n */\n private readonly activeLang = sharedActiveLang(this.transloco);\n\n readonly leafValue = computed<LeafDetailsEntityValue | null>(() => {\n const v = this.data().value;\n if (v && typeof v === 'object' && !Array.isArray(v) && 'levelId' in v) {\n return v as LeafDetailsEntityValue;\n }\n return null;\n });\n\n /** True when this item paints the level's phase badges instead of statuses. */\n readonly isPhaseItem = computed(() => this.leafValue()?.kind === 'phase');\n\n /**\n * This tile's own saved overrides — the `leafLevels` / `leafPhases` entry for\n * its child level. The two maps are kept apart because one level can render\n * both projections, each with its own slot, width and now label.\n */\n private readonly tileConfig = computed<\n LeafLevelSavedConfig | LeafPhaseSavedConfig | undefined\n >(() => {\n const levelId = this.leafValue()?.levelId;\n if (levelId == null) return undefined;\n const config = this.data().configuration as\n | EntityLeafDetailsConfig\n | undefined;\n const map = this.isPhaseItem() ? config?.leafPhases : config?.leafLevels;\n return map?.[String(levelId)];\n });\n\n /**\n * The badges to paint. Phases and statuses carry the same `{ key, display,\n * color, count }` shape, so one template drives both — only which projection\n * of the level is read differs.\n */\n readonly badges = computed<LeafDetailsStatusSummary[]>(() => {\n const leaf = this.leafValue();\n if (!leaf) return [];\n return this.isPhaseItem() ? (leaf.phases ?? []) : leaf.statuses;\n });\n\n /**\n * Label shown below the badges: \"Level Name (total)\", with a \"— Phases\"\n * qualifier on an unnamed phase item so a level configured with both\n * projections does not render two identically-labelled tiles.\n *\n * The custom label is read off the tile's OWN per-level entry, not from\n * `data().name` and not from the parent property's `configuration.label`.\n *\n * Not `name`, because for this view type it does not survive the trip: both\n * hosts resolve a label into `name` up front (`toEntityData` in\n * client-instance-preview, `openDrawer` in the customization builder), and\n * then `expandLeafDetailsEntity` rewrites `name` to the child level's own\n * name when it splits the property into one tile per level.\n *\n * Not the parent's label, because one property becomes many tiles — one per\n * child level, and again per projection. A label held on the parent paints\n * the same text on every one of them, which is what makes a card show\n * \"Delivery Portfolio (7)\" three times over. `order` and `size` were already\n * per-level for exactly this reason; the label follows them.\n *\n * A custom label owns the whole name. The \"— Phases\" qualifier is only the\n * *default* disambiguator for a level that renders both projections — once an\n * author names the phase tile themselves, appending it would force a suffix\n * onto text they wrote, and \"Delivery Stages — Phases\" is not something they\n * can spell their way out of. So the qualifier applies to the fallback name\n * only; the author is trusted to have distinguished the tile.\n *\n * `(total)` is the one thing always appended — the count is the point of the\n * tile, and it is live data, not part of anyone's label.\n */\n readonly labelWithTotal = computed(() => {\n const leaf = this.leafValue();\n const lang = this.activeLang();\n const custom = resolveLocalizedLabel(this.tileConfig()?.label, lang);\n const fallback = this.data().name || leaf?.levelName || '';\n const qualified =\n this.isPhaseItem() && fallback\n ? `${fallback} — ${this.transloco.translate('components.entitiesPreview.leafPhases', {}, lang)}`\n : fallback;\n const name = custom || qualified;\n if (!leaf) return name;\n const total = this.badges().reduce((sum, badge) => sum + badge.count, 0);\n return `${name} (${total})`;\n });\n\n readonly labelIcon = computed(() => this.leafValue()?.levelIcon ?? null);\n\n statusColor(color: string | null): string {\n return color ?? DEFAULT_STATUS_COLOR;\n }\n\n /**\n * Foreground for the count, chosen against the badge colour instead of always\n * white — a light catalog colour measured 2.59:1 with white on it, the lowest\n * contrast in the product (findings M-04, H-03).\n */\n statusTextColor(color: string | null): string {\n return readableTextOn(this.statusColor(color));\n }\n}\n","<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 — 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\">—</span>\r\n }\r\n </div>\r\n }\r\n</mt-entity-field>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\nimport { EntityData, EntityViewType } from '../entity.model';\r\nimport { EntityText } from '../entity-text/entity-text';\r\nimport { EntityLongText } from '../entity-long-text/entity-long-text';\r\nimport { EntityDate } from '../entity-date/entity-date';\r\nimport { EntityUser } from '../entity-user/entity-user';\r\nimport { EntityPercentage } from '../entity-percentage/entity-percentage';\r\nimport { EntityCurrency } from '../entity-currency/entity-currency';\r\nimport { EntityCheckbox } from '../entity-checkbox/entity-checkbox';\r\nimport { EntityLookup } from '../entity-lookup/entity-lookup';\r\nimport { EntityPhaseGate } from '../entity-phase-gate/entity-phase-gate';\r\nimport { EntityPerformanceScore } from '../entity-performance-score/entity-performance-score';\r\nimport { EntityAttachment } from '../entity-attachment/entity-attachment';\r\nimport { EntityStatus } from '../entity-status/entity-status';\r\nimport { EntityIcon } from '../entity-icon/entity-icon';\r\nimport { EntityLeafDetails } from '../entity-leaf-details/entity-leaf-details';\r\nimport { EntityLocation } from '../entity-location/entity-location';\r\nimport { EntityConnection } from '../entity-connection/entity-connection';\r\nimport { EntityScheduleItem } from '../entity-schedule-item/entity-schedule-item';\r\n\r\n/**\r\n * Renders an entity value by view type.\r\n *\r\n * `LookupModuleCheckList` is deliberately not handled here: that component\r\n * renders each of its nested properties *through* this one, so routing it back\r\n * through here would make the two files import each other. `EntityPreviewBody`\r\n * owns that case and delegates every other view type to this component.\r\n */\r\n@Component({\r\n selector: 'mt-entity-value-preview',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n EntityText,\r\n EntityLongText,\r\n EntityDate,\r\n EntityUser,\r\n EntityPercentage,\r\n EntityCurrency,\r\n EntityCheckbox,\r\n EntityLookup,\r\n EntityPhaseGate,\r\n EntityPerformanceScore,\r\n EntityAttachment,\r\n EntityStatus,\r\n EntityIcon,\r\n EntityLeafDetails,\r\n EntityLocation,\r\n EntityConnection,\r\n EntityScheduleItem,\r\n ],\r\n templateUrl: './entity-value-preview.html',\r\n host: {\r\n class: 'block min-w-0 w-full',\r\n },\r\n})\r\nexport class EntityValuePreview {\r\n readonly data = input.required<EntityData>();\r\n readonly attachmentShape = input<'default' | 'compact'>('default');\r\n\r\n /** Lookup variants share the same colored-badge renderer. */\r\n readonly previewType = computed<EntityViewType>(() => {\r\n const viewType = this.data().viewType;\r\n return viewType === 'LookupMatrix' || viewType === 'LookupMultiSelect'\r\n ? 'Lookup'\r\n : viewType;\r\n });\r\n}\r\n","@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 (\"Icon\") {\r\n <mt-entity-icon [data]=\"data()\" />\r\n }\r\n @case (\"PhaseGate\") {\r\n <mt-entity-phase-gate [data]=\"data()\" />\r\n }\r\n @case (\"PerformanceScore\") {\r\n <mt-entity-performance-score [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","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n Type,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { NgComponentOutlet } from '@angular/common';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { sharedActiveLang } from '../active-lang';\r\nimport { EntityValuePreview } from '../entity-preview/entity-value-preview';\r\nimport { EntityData } from '../entity.model';\r\nimport {\r\n buildEntityListRows,\r\n EntityListRenderedRow,\r\n} from '../entity-list-rows.util';\r\n\r\n/**\r\n * What `NgComponentOutlet` needs to render an `EntityList` table: the\r\n * read-only `mt-entity-list-field` (`ENTITY_LIST_TABLE_COMPONENT`) and its\r\n * inputs.\r\n */\r\nexport interface EntityListTableHost {\r\n component: Type<unknown>;\r\n inputs: Record<string, unknown>;\r\n}\r\n\r\n/**\r\n * The full nested `EntityList`, rendered in a drawer opened by\r\n * `mt-entity-list-preview`.\r\n *\r\n * It lives in a drawer rather than in the cell because the cell is a table\r\n * column: even three lines per row set the height of every row in the table,\r\n * and a checklist of fifteen made the grid unreadable. The drawer has the\r\n * width and height this content actually needs.\r\n *\r\n * With a `table` it renders the list the way a record preview does — the\r\n * read-only `mt-entity-list-field`, with its columns, typed cells and access\r\n * notices — for a table cell whose host knew the record's runtime ids.\r\n * Otherwise it renders the rows the value itself carries.\r\n *\r\n * Created through `ModalService`, so its inputs arrive via `inputValues` and\r\n * it is built with the **root** injector — nothing route-provided is visible\r\n * here, which is why it takes the already-resolved entity and table rather\r\n * than looking anything up.\r\n */\r\n@Component({\r\n selector: 'mt-entity-list-drawer',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityValuePreview, NgComponentOutlet],\r\n templateUrl: './entity-list-drawer.html',\r\n // `h-full` is load-bearing. `.p-drawer-content` is a definite height, but\r\n // this host sits between it and the content, so without a height of its own\r\n // the host grows to fit the rows and the content's `h-full` resolves against\r\n // *that* — the list then runs past the bottom of the drawer with nothing to\r\n // scroll. Verified with a twenty-row list.\r\n host: { class: 'block h-full' },\r\n})\r\nexport class EntityListDrawer {\r\n readonly data = input.required<EntityData>();\r\n\r\n /** Ordered allowlist of nested field keys; empty renders all of them. */\r\n readonly fields = input<string[]>([]);\r\n\r\n /** The list's table, when the opener could build one; see above. */\r\n readonly table = input<EntityListTableHost | null>(null);\r\n\r\n /** A Local list's labels are `{ en, ar }` pairs; see `sharedActiveLang`. */\r\n private readonly activeLang = sharedActiveLang(inject(TranslocoService));\r\n\r\n readonly rows = computed<EntityListRenderedRow[]>(() =>\r\n buildEntityListRows(this.data(), this.fields(), this.activeLang()),\r\n );\r\n}\r\n","<!--\r\n Owns its scroll rather than taking the shared `mt-modal-content` shell: that\r\n class reserves 60px for a footer, and this drawer is read-only and has none,\r\n so it would leave a dead strip at the bottom. `h-full` chains off the host's,\r\n which chains off `.p-drawer-content` — the one definite height here.\r\n-->\r\n<div class=\"flex h-full flex-col gap-2 overflow-auto p-5\">\r\n @if (table(); as host) {\r\n <!--\r\n The list as a record preview renders it: the read-only\r\n `mt-entity-list-field`, through the component the opener handed over —\r\n it cannot be imported here without a circular entry point.\r\n -->\r\n <ng-container\r\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\r\n ></ng-container>\r\n } @else {\r\n @for (row of rows(); track row.id) {\r\n <div\r\n class=\"rounded-md border border-surface-200 bg-surface-50 px-3 py-2.5\"\r\n >\r\n @if (row.title; as title) {\r\n <div class=\"min-w-0 text-sm font-medium text-color\">\r\n <mt-entity-value-preview [data]=\"title\" attachmentShape=\"compact\" />\r\n </div>\r\n }\r\n\r\n @if (row.fields.length) {\r\n <!--\r\n The drawer has room the cell did not, so fields get a real grid with\r\n their labels instead of being crushed onto one wrapping line.\r\n `auto-fill` adapts to the drawer's actual width without a container\r\n query, and the `min()` floor keeps a narrow drawer from being forced\r\n wider than the viewport.\r\n -->\r\n <div\r\n class=\"mt-2 grid gap-x-4 gap-y-3 [grid-template-columns:repeat(auto-fill,minmax(min(9rem,100%),1fr))]\"\r\n >\r\n @for (field of row.fields; track field.key) {\r\n <div class=\"min-w-0 overflow-hidden\">\r\n <mt-entity-value-preview\r\n [data]=\"field\"\r\n attachmentShape=\"compact\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { NgComponentOutlet } from '@angular/common';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { sharedActiveLang } from '../active-lang';\r\nimport { displayOrPlaceholder } from '../entity-display.utils';\r\nimport { EntityField } from '../entity-field/entity-field';\r\nimport {\r\n EntityData,\r\n EntityPropertyConfiguration,\r\n isEntityListLocalDocument,\r\n isEntityListSelectionDocument,\r\n} from '../entity.model';\r\nimport {\r\n ENTITY_LIST_TABLE_COMPONENT,\r\n EntityRuntimeContext,\r\n EntityRuntimeContextStore,\r\n} from '../entity-runtime-context';\r\nimport {\r\n buildEntityListRows,\r\n EntityListRenderedRow,\r\n summarizeEntityListRows,\r\n} from '../entity-list-rows.util';\r\nimport { EntityListDrawer, EntityListTableHost } from './entity-list-drawer';\r\n\r\n/** Rows named in the tooltip before it collapses into \"+N more\". */\r\nconst TOOLTIP_ROW_LIMIT = 6;\r\n\r\n/**\r\n * Read-only renderer for an `EntityList` value. It has two shapes, and which\r\n * one applies is decided by what the host gave it — never by the value.\r\n *\r\n * **Inline table.** When the host published an `EntityRuntimeContext` and the\r\n * property is module-backed, the rows are the target module's own records and\r\n * live behind `Properties/{id}/entitylist/table-metadata` + `fetch/query`.\r\n * Nothing in the value describes them — a `Realtime` list's value is literally\r\n * `null` — so the whole table is fetched, by handing the work to the read-only\r\n * `mt-entity-list-field` through `ENTITY_LIST_TABLE_COMPONENT`. That component\r\n * already owns the metadata call, the authorization boundary (`403` is a\r\n * notice, not an error) and the column projection; duplicating it here would\r\n * be a second implementation of the same contract. This is the shape a card\r\n * preview gets.\r\n *\r\n * **Count + drawer.** Otherwise the value carries its own `rows[]` and the\r\n * property configuration's `inlineFields` is the only description of the\r\n * columns — a calculated inline list, phase gate checklists being the case\r\n * this was written for. Those render inside a *table cell* (`mt-table` builds\r\n * its entity cells through `mt-entity-preview`), where inline rows would own\r\n * the height of every row in the grid: three lines per checklist item, times\r\n * however many the phase gate has. The rows go in a drawer instead, and the\r\n * tooltip names them so \"which ones are these?\" is answered without opening\r\n * anything. A table cell publishes no runtime context, so it keeps this shape.\r\n *\r\n * There is no writable path in either case.\r\n */\r\n@Component({\r\n selector: 'mt-entity-list-preview',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityField, Button, NgComponentOutlet],\r\n templateUrl: './entity-list-preview.html',\r\n})\r\nexport class EntityListPreview {\r\n readonly data = input.required<EntityData>();\r\n\r\n /**\r\n * Restricts rendering to these nested field keys, in this order. Left empty,\r\n * every field in `inlineFields` renders — what the generic table path wants;\r\n * a host that knows the list narrows it here. Forwarded to the drawer.\r\n *\r\n * Applies to the drawer shape only: an inline table's columns come from the\r\n * backend's own projection, which already reflects the configured read\r\n * fields for this level.\r\n */\r\n readonly fields = input<string[]>([]);\r\n\r\n private readonly modal = inject(ModalService);\r\n private readonly transloco = inject(TranslocoService);\r\n\r\n /**\r\n * Both optional, and both have to be present for the inline table: the\r\n * component says the host *can* render one, the context says it knows which\r\n * level-data row to scope the rows to. A host that provides neither — every\r\n * `mt-table` cell — keeps the drawer.\r\n */\r\n private readonly tableComponent = inject(ENTITY_LIST_TABLE_COMPONENT, {\r\n optional: true,\r\n });\r\n private readonly runtimeContextStore = inject(EntityRuntimeContextStore, {\r\n optional: true,\r\n });\r\n\r\n /**\r\n * Read inside every computed that translates. `transloco.translate()` is a\r\n * one-shot read with no signal of its own, so without this dependency the\r\n * tooltip and the accessible name keep whatever language they were first\r\n * built in — both apps switch language at runtime. Shared rather than a\r\n * per-instance subscription: this renders once per cell per row.\r\n */\r\n private readonly activeLang = sharedActiveLang(this.transloco);\r\n\r\n readonly label = computed<string>(() => this.data().name ?? '');\r\n\r\n readonly rows = computed<EntityListRenderedRow[]>(() =>\r\n buildEntityListRows(this.data(), this.fields(), this.activeLang()),\r\n );\r\n\r\n readonly count = computed<number>(() => this.rows().length);\r\n\r\n readonly hasRows = computed<boolean>(() => this.count() > 0);\r\n\r\n /**\r\n * Whether the list's rows are records of another module rather than values\r\n * held inside this one.\r\n *\r\n * Mirrors the backend's own `ResolveSourceType`: an explicit `sourceType`\r\n * wins, and a configuration written before that field existed is module-\r\n * backed exactly when it names a module. Read from the stored configuration\r\n * because it is the only description available before the metadata request —\r\n * the effective, level-overridden one comes back from that endpoint, and the\r\n * table component gates on it again.\r\n */\r\n private readonly moduleBacked = computed<boolean>(() => {\r\n const configuration = this.propertyConfiguration();\r\n if (!configuration) return false;\r\n\r\n const sourceType = configuration['sourceType'];\r\n if (typeof sourceType === 'string' && sourceType.trim()) {\r\n return sourceType.trim().toLowerCase() === 'module';\r\n }\r\n return Number(configuration['moduleId'] ?? 0) > 0;\r\n });\r\n\r\n /**\r\n * The inline table's component and inputs, or null when this instance\r\n * renders the drawer trigger instead.\r\n *\r\n * A `computed` rather than a template expression on purpose: the object is\r\n * re-created only when its inputs actually change, and `NgComponentOutlet`\r\n * re-applies inputs on identity change — a fresh object per change-detection\r\n * pass would re-write every input on every tick.\r\n */\r\n protected readonly tableHost = computed<EntityListTableHost | null>(() =>\r\n this.buildTableHost(this.runtimeContextStore?.context() ?? null),\r\n );\r\n\r\n /**\r\n * The same table, for the drawer of a table cell. A cell publishes no\r\n * runtime context — an inline table would set the height of every row — but\r\n * a host that knows the record's ids puts them on the value\r\n * (`EntityData.runtimeContext`), and the drawer then shows the list exactly\r\n * as a record preview does, instead of the value-only rows.\r\n */\r\n private readonly drawerTable = computed<EntityListTableHost | null>(() =>\r\n this.tableHost() ? null : this.buildTableHost(this.data().runtimeContext),\r\n );\r\n\r\n private buildTableHost(\r\n context: EntityRuntimeContext | null | undefined,\r\n ): EntityListTableHost | null {\r\n const component = this.tableComponent;\r\n if (!component || !this.moduleBacked()) return null;\r\n if (!context || !(Number(context.levelId) > 0)) return null;\r\n\r\n const data = this.data();\r\n const propertyId = Number(data.propertyId ?? 0);\r\n if (!(propertyId > 0)) return null;\r\n\r\n return {\r\n component,\r\n inputs: {\r\n propertyId,\r\n runtimeContext: context,\r\n configuration: this.propertyConfiguration(),\r\n // Rendered outside a form, so there is no `ControlValueAccessor` to\r\n // write through. A Write-only list has no readable records and its\r\n // stored rows are the only thing it can show.\r\n initialValue: data.value ?? data.rawValue ?? null,\r\n readonly: true,\r\n // `mt-entity-field` already renders the property's label above the\r\n // table; the field would repeat it.\r\n label: '',\r\n },\r\n };\r\n }\r\n\r\n /**\r\n * Whether the value itself holds the list's rows — a Local or Selected\r\n * document. A Related list's value is membership and evidence only; its\r\n * rows are read by the table, so its cell does not claim a count.\r\n */\r\n private readonly valueHoldsRows = computed<boolean>(() => {\r\n const value = this.data().value;\r\n return (\r\n isEntityListLocalDocument(value) || isEntityListSelectionDocument(value)\r\n );\r\n });\r\n\r\n /** The trigger shows when there are rows to count, or a table to open. */\r\n protected readonly showTrigger = computed<boolean>(\r\n () => this.hasRows() || !!this.drawerTable(),\r\n );\r\n\r\n /**\r\n * The trigger's label: the row count when the value holds the rows, else\r\n * \"View\" — a Related list's saved membership is not what its table shows,\r\n * so it is not presented as a count.\r\n */\r\n protected readonly triggerLabel = computed<string>(() => {\r\n this.activeLang();\r\n return this.valueHoldsRows() || !this.drawerTable()\r\n ? this.count().toString()\r\n : this.viewLabel();\r\n });\r\n\r\n /**\r\n * An empty list reads as the standard empty value, not as a sentence — this\r\n * sits in a table cell, where a \"no related items\" line would be louder than\r\n * the rows it stands in for.\r\n */\r\n readonly emptyLabel = displayOrPlaceholder(null);\r\n\r\n /**\r\n * The button's accessible name. Set explicitly because `mt-button` resolves\r\n * it as `ariaLabel → label → tooltip`, and the label here is the bare count\r\n * — a screen reader would otherwise announce the button as \"2\".\r\n */\r\n readonly ariaLabel = computed<string>(() => {\r\n this.activeLang();\r\n const label = this.triggerLabel();\r\n return label === this.viewLabel()\r\n ? label\r\n : `${this.viewLabel()} (${label})`;\r\n });\r\n\r\n /**\r\n * Names the rows, so the cell answers \"which ones?\" on hover. Falls back to\r\n * the button's own wording when no row has a title to show.\r\n */\r\n readonly tooltip = computed<string>(() => {\r\n this.activeLang();\r\n const { names, remaining } = summarizeEntityListRows(\r\n this.rows(),\r\n TOOLTIP_ROW_LIMIT,\r\n );\r\n if (names.length === 0) return this.viewLabel();\r\n\r\n const more =\r\n remaining > 0\r\n ? [\r\n this.transloco.translate('components.entityListPreview.more', {\r\n count: remaining,\r\n }),\r\n ]\r\n : [];\r\n return [...names, ...more].join(' · ');\r\n });\r\n\r\n /**\r\n * The untouched catalog configuration. `configuration` is read as a fallback\r\n * because the table merges its own display flags into that object when it\r\n * builds a cell, and a `LeafDetails` catalog entry is an array — neither is\r\n * an `EntityList` configuration, so both are rejected here.\r\n */\r\n private readonly propertyConfiguration = computed<Record<\r\n string,\r\n unknown\r\n > | null>(() => {\r\n const data = this.data();\r\n const sources: (EntityPropertyConfiguration | undefined)[] = [\r\n data.propertyConfiguration,\r\n data.configuration as EntityPropertyConfiguration,\r\n ];\r\n\r\n for (const source of sources) {\r\n if (!source || Array.isArray(source)) continue;\r\n return source as Record<string, unknown>;\r\n }\r\n return null;\r\n });\r\n\r\n private viewLabel(): string {\r\n return this.transloco.translate('components.entityListPreview.view');\r\n }\r\n\r\n protected openDrawer(): void {\r\n const table = this.drawerTable();\r\n this.modal.openModal(EntityListDrawer, 'drawer', {\r\n header: this.label() || undefined,\r\n position: 'end',\r\n // A table needs the width a stack of rows does not.\r\n styleClass: table ? '!w-[60rem] max-w-[96vw]' : '!w-[34rem] max-w-[96vw]',\r\n dismissableMask: true,\r\n inputValues: {\r\n data: this.data(),\r\n fields: this.fields(),\r\n table,\r\n },\r\n });\r\n }\r\n}\r\n","<mt-entity-field\r\n [label]=\"label()\"\r\n [configuration]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (tableHost(); as host) {\r\n <!--\r\n The related records, rendered in full by the read-only\r\n `mt-entity-list-field`. It owns the metadata request, the access notices\r\n and the column projection — see `ENTITY_LIST_TABLE_COMPONENT` for why it\r\n arrives through an outlet rather than an import.\r\n -->\r\n <ng-container\r\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\r\n ></ng-container>\r\n } @else if (showTrigger()) {\r\n <!--\r\n The count carries the information; the button carries the affordance.\r\n `mt-button` owns the tooltip and the accessible name, so the trigger is\r\n one element rather than a button wrapped in a tooltip host. A Related\r\n list opened as a table says \"View\" instead of a count; see\r\n `triggerLabel`.\r\n\r\n `w-fit`: the `mt-button` host is a block-level grid, so in a cell it\r\n spans the full width and so does the `p-button` the tooltip anchors to —\r\n the tooltip centred over the cell, not over the button.\r\n -->\r\n <mt-button\r\n class=\"w-fit\"\r\n icon=\"general.eye\"\r\n [label]=\"triggerLabel()\"\r\n [tooltip]=\"tooltip()\"\r\n [ariaLabel]=\"ariaLabel()\"\r\n variant=\"text\"\r\n size=\"small\"\r\n styleClass=\"!px-2 !py-1 !gap-1\"\r\n (onClick)=\"openDrawer()\"\r\n />\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-surface-100 px-3 py-2 text-xs font-semibold text-muted-color\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { displayOrPlaceholder } from '../entity-display.utils';\nimport { EntityField } from '../entity-field/entity-field';\nimport { EntityValuePreview } from '../entity-preview/entity-value-preview';\nimport {\n EntityConfiguration,\n EntityData,\n EntityLookupCheckListItem,\n EntityLookupCheckListValue,\n EntityNestedPropertyMeta,\n} from '../entity.model';\n\ninterface RenderedItem {\n lookupKey: string;\n /** Humanized lookup key for display. */\n lookupLabel: string;\n /** One entity per captured property, rendered by its catalog view type. */\n props: EntityData[];\n}\n\n/**\n * Nested props render inside the entry card's own grid, so they take the label\n * treatment and leave sizing to the grid.\n */\nconst NESTED_PROP_CONFIG: EntityConfiguration = {\n labelPosition: 'top',\n hideLabel: false,\n};\n\n/**\n * Derive a readable label from a raw lookup key. The stored checklist value\n * only carries the key of the selected lookup item (e.g. `Open_test`) and the\n * response resolves no display for it, so this strips separators and\n * title-cases the key.\n */\nfunction humanizeKey(key: string): string {\n const words = key\n .replace(/[_-]+/g, ' ')\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .trim();\n if (!words) return key;\n return words.charAt(0).toUpperCase() + words.slice(1);\n}\n\n@Component({\n selector: 'mt-entity-lookup-module-check-list',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [EntityField, EntityValuePreview],\n templateUrl: './entity-lookup-module-check-list.html',\n})\nexport class EntityLookupModuleCheckList {\n readonly data = input.required<EntityData>();\n\n /**\n * Catalog metadata for the captured properties, keyed by property key. The\n * stored value carries keys only — this is what gives each nested prop its\n * label and view type.\n */\n private readonly metaByKey = computed(() => {\n const map = new Map<string, EntityNestedPropertyMeta>();\n for (const meta of this.data().nestedProperties ?? []) {\n map.set(meta.key, meta);\n }\n return map;\n });\n\n /**\n * Normalizes the stored value into a flat list of checklist entries.\n * Accepts both the rendered view model (`{ items: [...] }`) and the raw\n * stored array (`[{ lookupKey, props }]`); returns `[]` for anything else.\n */\n readonly items = computed<RenderedItem[]>(() => {\n const raw = this.data().value;\n const entries = this.extractEntries(raw);\n\n return entries\n .filter((entry) => entry && typeof entry === 'object')\n .map((entry) => {\n const record = entry as unknown as Record<string, unknown>;\n const props = record['props'] ?? record['Props'];\n const lookupKey = this.resolveLookupKey(entry);\n return {\n lookupKey,\n lookupLabel: humanizeKey(lookupKey),\n props: (Array.isArray(props) ? props : []).map((prop) =>\n this.toNestedEntity(prop),\n ),\n };\n });\n });\n\n readonly hasItems = computed(() => this.items().length > 0);\n\n readonly emptyLabel = displayOrPlaceholder(null);\n\n /**\n * Builds the entity for one captured property. Without catalog metadata the\n * key is all there is to show it with, so it degrades to a humanized label\n * and plain text.\n */\n private toNestedEntity(prop: unknown): EntityData {\n const propRecord = (prop ?? {}) as Record<string, unknown>;\n const key = String(propRecord['key'] ?? propRecord['Key'] ?? '');\n const meta = this.metaByKey().get(key);\n const value = propRecord['value'] ?? propRecord['Value'] ?? null;\n\n return {\n propertyId: meta?.id,\n key,\n normalizedKey: meta?.normalizedKey,\n name: meta?.label ?? humanizeKey(key),\n value: (value ?? '') as EntityData['value'],\n viewType: meta?.viewType ?? 'Text',\n propertyConfiguration: meta?.configuration,\n configuration: NESTED_PROP_CONFIG,\n order: meta?.order,\n };\n }\n\n private extractEntries(raw: unknown): EntityLookupCheckListItem[] {\n if (Array.isArray(raw)) {\n return raw as EntityLookupCheckListItem[];\n }\n\n const wrapped = (raw as EntityLookupCheckListValue | null)?.items;\n if (Array.isArray(wrapped)) {\n return wrapped;\n }\n\n if (typeof raw === 'string' && raw.trim()) {\n try {\n return this.extractEntries(JSON.parse(raw));\n } catch {\n return [];\n }\n }\n\n return [];\n }\n\n private resolveLookupKey(entry: EntityLookupCheckListItem): string {\n const record = entry as unknown as Record<string, unknown>;\n const key = entry.lookupKey ?? record['Lookupkey'] ?? record['lookupkey'];\n return typeof key === 'string' ? key : '';\n }\n}\n","<mt-entity-field\r\n [label]=\"data().name ?? ''\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasItems()) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (item of items(); track $index) {\r\n <div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ item.lookupLabel || emptyLabel }}\r\n </span>\r\n @if (item.props.length) {\r\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\r\n @for (prop of item.props; track prop.key) {\r\n <div class=\"min-w-0 overflow-hidden\">\r\n <mt-entity-value-preview\r\n [data]=\"prop\"\r\n attachmentShape=\"compact\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n","import type {\n ConnectionCatalogConfiguration,\n ConnectionSourceLevelConfig,\n EntityConnectionConfig,\n EntityConnectionSourceValue,\n EntityData,\n} from './entity.model';\n\n/**\n * Separator for the synthetic keys of the per-source-level items a Connection\n * property expands into. Mirrors `LEAF_DETAILS_KEY_SEPARATOR`: the persisted\n * display configuration is still keyed by the real property key, and the split\n * items only exist in the rendered/managed entity list.\n */\nexport const CONNECTION_KEY_SEPARATOR = '::connlevel::';\n\nexport function isConnectionSyntheticKey(key?: string | null): boolean {\n return key?.includes(CONNECTION_KEY_SEPARATOR) ?? false;\n}\n\nexport function buildConnectionKey(\n propertyKey: string,\n levelId: number | string,\n): string {\n return `${propertyKey}${CONNECTION_KEY_SEPARATOR}${levelId}`;\n}\n\n/** Splits a synthetic key back into the owning property key and its level id. */\nexport function splitConnectionKey(key: string): {\n propertyKey: string;\n levelId: string;\n} {\n const [propertyKey, levelId] = key.split(CONNECTION_KEY_SEPARATOR);\n return { propertyKey, levelId };\n}\n\nfunction isConnectionSourceLevel(\n value: unknown,\n): value is ConnectionSourceLevelConfig {\n return (\n !!value &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n 'levelId' in value &&\n typeof value.levelId === 'number' &&\n Number.isFinite(value.levelId)\n );\n}\n\n/**\n * Reads the `sourceLevels` published on a Connection property's catalog\n * configuration. These define the split — one item per source level — and carry\n * the level name used as each item's label.\n */\nexport function normalizeConnectionSourceLevels(\n configuration: unknown,\n): ConnectionSourceLevelConfig[] {\n if (typeof configuration === 'string' && configuration.trim().length > 0) {\n try {\n return normalizeConnectionSourceLevels(JSON.parse(configuration));\n } catch {\n return [];\n }\n }\n\n if (!configuration || typeof configuration !== 'object') return [];\n\n const sourceLevels = (configuration as ConnectionCatalogConfiguration)\n .sourceLevels;\n\n return Array.isArray(sourceLevels)\n ? sourceLevels.filter(isConnectionSourceLevel)\n : [];\n}\n\n/** Picks the source level's localized name for the active document language. */\nexport function resolveConnectionLevelName(\n level: ConnectionSourceLevelConfig,\n): string {\n const name = level.name;\n if (typeof name === 'string') return name.trim();\n if (!name || typeof name !== 'object') return '';\n\n const lang =\n typeof document !== 'undefined'\n ? document.documentElement.lang || 'en'\n : 'en';\n const primary = lang === 'ar' ? name.ar : name.en;\n\n return (primary || name.en || name.ar || '').trim();\n}\n\nfunction readSources(value: unknown): EntityConnectionSourceValue[] {\n if (typeof value === 'string' && value.trim().length > 0) {\n try {\n return readSources(JSON.parse(value));\n } catch {\n return [];\n }\n }\n\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\n\n const source = value as Record<string, unknown>;\n // The payload is serialized PascalCase; parsed values use camelCase.\n const sources = source['sources'] ?? source['Sources'];\n\n return Array.isArray(sources)\n ? (sources.filter(\n (item) => !!item && typeof item === 'object' && !Array.isArray(item),\n ) as EntityConnectionSourceValue[])\n : [];\n}\n\nfunction sourceLevelIdOf(source: EntityConnectionSourceValue): number | null {\n const id = source.sourceLevelId ?? source.SourceLevelId;\n return typeof id === 'number' && Number.isFinite(id) ? id : null;\n}\n\nfunction sourceDisplayOf(source: EntityConnectionSourceValue): string {\n const display =\n source.display ?? source.Display ?? source.name ?? source.Name;\n return typeof display === 'string' ? display.trim() : '';\n}\n\n/**\n * Groups a Connection value's connected records by their source level. A level\n * that allows many-to-many can hold several records, so the displays are joined\n * into the single value shown for that level's item.\n */\nfunction groupDisplaysByLevel(entity: EntityData): Map<number, string[]> {\n const sources = [\n ...readSources(entity.value),\n ...readSources(entity.rawValue),\n ];\n const grouped = new Map<number, string[]>();\n\n for (const source of sources) {\n const levelId = sourceLevelIdOf(source);\n if (levelId === null) continue;\n const display = sourceDisplayOf(source);\n if (!display) continue;\n const existing = grouped.get(levelId);\n if (existing) {\n if (!existing.includes(display)) existing.push(display);\n } else {\n grouped.set(levelId, [display]);\n }\n }\n\n return grouped;\n}\n\n/**\n * Splits a Connection entity into one item per source level, so a card shows\n * each connected level under its own name instead of a single comma-joined\n * value under the generic \"Connection\" label.\n *\n * Falls back to the original entity when the catalog publishes no source\n * levels — without them there is nothing to label the split items with.\n */\nexport function expandConnectionEntity(entity: EntityData): EntityData[] {\n if (entity.viewType !== 'Connection') {\n return [entity];\n }\n\n // Already expanded (e.g. re-running over a managed list).\n if (isConnectionSyntheticKey(entity.key)) {\n return [entity];\n }\n\n const levels = normalizeConnectionSourceLevels(entity.propertyConfiguration);\n if (levels.length === 0) {\n return [entity];\n }\n\n const configuration = entity.configuration as\n | EntityConnectionConfig\n | undefined;\n const displaysByLevel = groupDisplaysByLevel(entity);\n\n return levels.map((level) => {\n const levelConfig =\n configuration?.connectionLevels?.[String(level.levelId)];\n const display = (displaysByLevel.get(level.levelId) ?? []).join(', ');\n\n return {\n ...entity,\n key: entity.key\n ? buildConnectionKey(entity.key, level.levelId)\n : entity.key,\n name: resolveConnectionLevelName(level) || entity.name,\n value: { display },\n rawValue: display,\n order: levelConfig?.order ?? entity.order,\n configuration: {\n ...configuration,\n size: levelConfig?.size ?? configuration?.size,\n },\n } satisfies EntityData;\n });\n}\n","import { expandConnectionEntity } from './connection-display.utils';\nimport type {\n EntityData,\n EntityLeafDetailsConfig,\n LeafDetailsCatalogConfiguration,\n LeafDetailsCatalogLevelValue,\n LeafDetailsCatalogPhaseValue,\n LeafDetailsCatalogStatusValue,\n LeafDetailsEntityCollectionValue,\n LeafDetailsEntityValue,\n LeafDetailsPhaseSummary,\n LeafDetailsRuntimeChildSchema,\n LeafDetailsRuntimePhaseCount,\n LeafDetailsRuntimeStatusCount,\n LeafDetailsRuntimeStatusDetails,\n LeafDetailsRuntimeValue,\n LeafDetailsStatusSummary,\n} from './entity.model';\n\nexport const LEAF_DETAILS_KEY_SEPARATOR = '::leaflevel::';\n\n/**\n * The phase projection of the same child level. One level can contribute both\n * a status item and a phase item to the same area, so they need distinct keys\n * — the key is what each item's persisted order/size is looked up by.\n */\nexport const LEAF_PHASES_KEY_SEPARATOR = '::leafphase::';\n\nfunction isLeafDetailsStatusSummary(\n value: unknown,\n): value is LeafDetailsStatusSummary {\n return (\n !!value &&\n typeof value === 'object' &&\n 'key' in value &&\n 'display' in value &&\n 'count' in value\n );\n}\n\nfunction isLeafDetailsCatalogStatusValue(\n value: unknown,\n): value is LeafDetailsCatalogStatusValue {\n return (\n !!value && typeof value === 'object' && 'key' in value && 'display' in value\n );\n}\n\nfunction isLeafDetailsCatalogLevelValue(\n value: unknown,\n): value is LeafDetailsCatalogLevelValue {\n return (\n !!value &&\n typeof value === 'object' &&\n 'levelId' in value &&\n 'levelName' in value &&\n 'levelIcon' in value &&\n 'statuses' in value &&\n Array.isArray(value.statuses) &&\n value.statuses.every(isLeafDetailsCatalogStatusValue)\n );\n}\n\nfunction isLeafDetailsRuntimeStatusDetails(\n value: unknown,\n): value is LeafDetailsRuntimeStatusDetails {\n return (\n !!value && typeof value === 'object' && 'key' in value && 'display' in value\n );\n}\n\nfunction isLeafDetailsRuntimeStatusCount(\n value: unknown,\n): value is LeafDetailsRuntimeStatusCount {\n return (\n !!value &&\n typeof value === 'object' &&\n 'details' in value &&\n isLeafDetailsRuntimeStatusDetails(value.details) &&\n 'count' in value\n );\n}\n\nfunction isLeafDetailsRuntimePhaseCount(\n value: unknown,\n): value is LeafDetailsRuntimePhaseCount {\n return (\n !!value &&\n typeof value === 'object' &&\n 'details' in value &&\n isLeafDetailsRuntimeStatusDetails(value.details) &&\n 'count' in value\n );\n}\n\n/**\n * Phases are optional on both the catalog configuration and the runtime value —\n * the backend omits the field entirely for child levels with no phase gates —\n * so anything that is not a well-formed array reads as \"no phases\".\n */\nfunction readRuntimePhases(value: unknown): LeafDetailsRuntimePhaseCount[] {\n return Array.isArray(value) && value.every(isLeafDetailsRuntimePhaseCount)\n ? value\n : [];\n}\n\nfunction readCatalogPhases(value: unknown): LeafDetailsCatalogPhaseValue[] {\n return Array.isArray(value) && value.every(isLeafDetailsCatalogStatusValue)\n ? (value as LeafDetailsCatalogPhaseValue[])\n : [];\n}\n\nfunction isLeafDetailsRuntimeChildSchema(\n value: unknown,\n): value is LeafDetailsRuntimeChildSchema {\n return (\n !!value &&\n typeof value === 'object' &&\n 'levelId' in value &&\n 'levelName' in value &&\n 'levelIcon' in value &&\n 'statuses' in value &&\n Array.isArray(value.statuses) &&\n value.statuses.every(isLeafDetailsRuntimeStatusCount)\n );\n}\n\nexport function isLeafDetailsValue(\n value: unknown,\n): value is LeafDetailsEntityValue {\n return (\n !!value &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n 'levelId' in value &&\n 'statuses' in value &&\n Array.isArray(value.statuses) &&\n value.statuses.every(isLeafDetailsStatusSummary)\n );\n}\n\nexport function isLeafDetailsCollectionValue(\n value: unknown,\n): value is LeafDetailsEntityCollectionValue {\n return Array.isArray(value) && value.every(isLeafDetailsValue);\n}\n\nexport function isLeafDetailsCatalogConfiguration(\n value: unknown,\n): value is LeafDetailsCatalogConfiguration {\n return Array.isArray(value) && value.every(isLeafDetailsCatalogLevelValue);\n}\n\nexport function isLeafDetailsRuntimeValue(\n value: unknown,\n): value is LeafDetailsRuntimeValue {\n return (\n !!value &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n 'childSchemas' in value &&\n Array.isArray(value.childSchemas) &&\n value.childSchemas.every(isLeafDetailsRuntimeChildSchema)\n );\n}\n\nexport function isLeafDetailsSyntheticKey(key?: string | null): boolean {\n return key?.includes(LEAF_DETAILS_KEY_SEPARATOR) ?? false;\n}\n\n/** True for the key of an expanded *phase* item of a LeafDetails property. */\nexport function isLeafPhasesSyntheticKey(key?: string | null): boolean {\n return key?.includes(LEAF_PHASES_KEY_SEPARATOR) ?? false;\n}\n\n/** True for either projection's expanded key. */\nexport function isLeafSyntheticKey(key?: string | null): boolean {\n return isLeafDetailsSyntheticKey(key) || isLeafPhasesSyntheticKey(key);\n}\n\n/** Splits either projection's expanded key back into property key + level id. */\nexport function splitLeafKey(key: string): {\n propertyKey: string;\n levelId: string;\n kind: 'status' | 'phase';\n} {\n if (isLeafPhasesSyntheticKey(key)) {\n const [propertyKey, levelId] = key.split(LEAF_PHASES_KEY_SEPARATOR);\n return { propertyKey, levelId, kind: 'phase' };\n }\n const [propertyKey, levelId] = key.split(LEAF_DETAILS_KEY_SEPARATOR);\n return { propertyKey, levelId, kind: 'status' };\n}\n\nfunction toLeafDetailsStatusSummary(\n status: LeafDetailsRuntimeStatusCount,\n): LeafDetailsStatusSummary {\n return {\n key: status.details.key,\n display: status.details.display,\n color: status.details.color ?? null,\n count: status.count,\n };\n}\n\nfunction toLeafDetailsPhaseSummary(\n phase: LeafDetailsRuntimePhaseCount,\n): LeafDetailsPhaseSummary {\n return {\n id: phase.details.id ?? null,\n key: phase.details.key,\n display: phase.details.display,\n color: phase.details.color || null,\n count: phase.count,\n };\n}\n\nfunction normalizeLeafDetailsCollection(\n value: unknown,\n): LeafDetailsEntityCollectionValue {\n if (isLeafDetailsCollectionValue(value)) {\n return value;\n }\n\n if (isLeafDetailsValue(value)) {\n return [value];\n }\n\n if (isLeafDetailsRuntimeValue(value)) {\n return value.childSchemas.map((schema) => ({\n levelId: schema.levelId,\n levelName: schema.levelName,\n levelIcon: schema.levelIcon,\n statuses: schema.statuses.map(toLeafDetailsStatusSummary),\n phases: readRuntimePhases(schema.phases).map(toLeafDetailsPhaseSummary),\n }));\n }\n\n if (typeof value === 'string' && value.trim().length > 0) {\n try {\n return normalizeLeafDetailsCollection(JSON.parse(value));\n } catch {\n return [];\n }\n }\n\n return [];\n}\n\nfunction normalizeLeafDetailsCatalogConfiguration(\n value: unknown,\n): LeafDetailsEntityCollectionValue {\n if (isLeafDetailsCatalogConfiguration(value)) {\n return value.map((level) => ({\n levelId: level.levelId,\n levelName: level.levelName,\n levelIcon: level.levelIcon,\n statuses: level.statuses.map((status) => ({\n key: status.key,\n display: status.display,\n color: status.color ?? null,\n count: 0,\n })),\n phases: readCatalogPhases(level.phases).map((phase) => ({\n id: phase.id ?? null,\n key: phase.key,\n display: phase.display,\n color: phase.color || null,\n count: 0,\n })),\n }));\n }\n\n if (typeof value === 'string' && value.trim().length > 0) {\n try {\n return normalizeLeafDetailsCatalogConfiguration(JSON.parse(value));\n } catch {\n return [];\n }\n }\n\n return [];\n}\n\nexport function expandLeafDetailsEntity(entity: EntityData): EntityData[] {\n if (entity.viewType !== 'LeafDetails') {\n return [entity];\n }\n\n if (isLeafSyntheticKey(entity.key) && isLeafDetailsValue(entity.value)) {\n return [entity];\n }\n\n const configuration = entity.configuration as\n | EntityLeafDetailsConfig\n | undefined;\n const levels = normalizeLeafDetailsCollection(entity.value);\n const fallbackLevels = levels.length\n ? levels\n : normalizeLeafDetailsCollection(entity.rawValue);\n const resolvedLevels = fallbackLevels.length\n ? fallbackLevels\n : normalizeLeafDetailsCatalogConfiguration(entity.propertyConfiguration);\n\n if (resolvedLevels.length === 0) {\n return [entity];\n }\n\n const statusItems = resolvedLevels.flatMap((level) => {\n const levelConfig = configuration?.leafLevels?.[String(level.levelId)];\n if (configuration?.leafLevels && !levelConfig) {\n return [];\n }\n\n const selectedStatuses = levelConfig?.selectedStatuses?.length\n ? new Set(levelConfig.selectedStatuses)\n : null;\n\n return [\n {\n ...entity,\n key: entity.key\n ? `${entity.key}${LEAF_DETAILS_KEY_SEPARATOR}${level.levelId}`\n : entity.key,\n name: level.levelName,\n value: {\n ...level,\n kind: 'status',\n statuses: selectedStatuses\n ? level.statuses.filter((status) =>\n selectedStatuses.has(status.key),\n )\n : level.statuses,\n },\n order: levelConfig?.order ?? entity.order,\n configuration: {\n ...configuration,\n size: levelConfig?.size ?? configuration?.size,\n },\n } satisfies EntityData,\n ];\n });\n\n /**\n * Phases are opt-in: only levels with an explicit `leafPhases` entry produce\n * a phase item. An absent map means \"no phase badges\", never \"all of them\" —\n * the opposite of `leafLevels`, whose absence predates the per-level config\n * and has to keep meaning \"show every level\".\n */\n const phaseItems = resolvedLevels.flatMap((level) => {\n const phaseConfig = configuration?.leafPhases?.[String(level.levelId)];\n if (!phaseConfig) {\n return [];\n }\n\n const phases = level.phases ?? [];\n const selectedPhases = phaseConfig.selectedPhases?.length\n ? new Set(phaseConfig.selectedPhases)\n : null;\n\n return [\n {\n ...entity,\n key: entity.key\n ? `${entity.key}${LEAF_PHASES_KEY_SEPARATOR}${level.levelId}`\n : entity.key,\n name: level.levelName,\n value: {\n ...level,\n kind: 'phase',\n phases: selectedPhases\n ? phases.filter((phase) => selectedPhases.has(phase.key))\n : phases,\n },\n order: phaseConfig.order ?? entity.order,\n configuration: {\n ...configuration,\n size: phaseConfig.size ?? configuration?.size,\n },\n } satisfies EntityData,\n ];\n });\n\n const expanded = [...statusItems, ...phaseItems];\n return expanded.length > 0 ? expanded : [entity];\n}\n\n/**\n * Expands the entity types that render as several items — LeafDetails levels\n * and Connection source levels — then orders the flattened list. Shared by the\n * customization builder canvas and the runtime preview so both agree on what a\n * configured area actually contains.\n */\nexport function buildDisplayEntities(entities: EntityData[]): EntityData[] {\n return entities\n .flatMap((entity) => expandLeafDetailsEntity(entity))\n .flatMap((entity) => expandConnectionEntity(entity))\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { EntityData } from '../entity.model';\r\nimport { EntityListPreview } from '../entity-list-preview/entity-list-preview';\r\nimport { EntityLookupModuleCheckList } from '../entity-lookup-module-check-list/entity-lookup-module-check-list';\r\nimport { EntityValuePreview } from './entity-value-preview';\r\n\r\n/**\r\n * Owns the view types that render their own nested properties *through*\r\n * `EntityValuePreview`. Routing them from inside that component instead would\r\n * make the two files import each other, so they branch here and everything\r\n * else is delegated.\r\n */\r\n@Component({\r\n selector: 'mt-entity-preview-body',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [EntityListPreview, EntityLookupModuleCheckList, EntityValuePreview],\r\n templateUrl: './entity-preview-body.html',\r\n host: {\r\n class: 'w-full',\r\n },\r\n})\r\nexport class EntityPreviewBody {\r\n readonly data = input.required<EntityData>();\r\n readonly attachmentShape = input<'default' | 'compact'>('default');\r\n}\r\n","@if (data().viewType === \"LookupModuleCheckList\") {\r\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\r\n} @else if (data().viewType === \"EntityList\") {\r\n <mt-entity-list-preview [data]=\"data()\" />\r\n} @else {\r\n <mt-entity-value-preview\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n}\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { EntityData } from '../../entity.model';\nimport {\n ComparisonValueSide,\n ValueComparison,\n} from '../../entity-comparison.model';\nimport { EntityPreviewBody } from '../../entity-preview/entity-preview-body';\n\n@Component({\n selector: 'mt-comparison-value',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [EntityPreviewBody],\n templateUrl: './comparison-value.html',\n host: {\n class: 'block w-full',\n },\n})\nexport class ComparisonValue {\n readonly data = input.required<EntityData>();\n\n readonly comparison = computed<ValueComparison | null>(() => {\n const c = this.data().comparison;\n return c?.kind === 'Value' ? c : null;\n });\n\n readonly oldEntity = computed<EntityData | null>(() =>\n this.buildSide(this.comparison()?.oldValue),\n );\n\n readonly newEntity = computed<EntityData | null>(() =>\n this.buildSide(this.comparison()?.newValue),\n );\n\n private buildSide(side: ComparisonValueSide | undefined): EntityData | null {\n if (!side) return null;\n const base = this.data();\n return {\n ...base,\n rawValue:\n side.raw === null || side.raw === undefined\n ? undefined\n : String(side.raw),\n value: (side.display ?? side.value ?? '') as EntityData['value'],\n comparison: undefined,\n };\n }\n}\n","@if (comparison(); as cmp) {\r\n <div class=\"flex w-full min-w-0 items-stretch gap-3\">\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\r\n >Before</span\r\n >\r\n @if (oldEntity(); as old) {\r\n <mt-entity-preview-body [data]=\"old\" />\r\n } @else {\r\n <span class=\"text-sm text-muted-color\">_</span>\r\n }\r\n </div>\r\n <div class=\"flex shrink-0 items-center text-muted-color\" aria-hidden=\"true\">\r\n →\r\n </div>\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\r\n >\r\n <span class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\r\n >After</span\r\n >\r\n @if (newEntity(); as next) {\r\n <mt-entity-preview-body [data]=\"next\" />\r\n } @else {\r\n <span class=\"text-sm text-muted-color\">_</span>\r\n }\r\n </div>\r\n </div>\r\n}\r\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { EntityData } from '../../entity.model';\nimport {\n EntityComparisonOperation,\n EntityListComparison,\n EntityListComparisonRow,\n} from '../../entity-comparison.model';\nimport { displayOrPlaceholder } from '../../entity-display.utils';\n\ninterface OperationBadge {\n label: string;\n classes: string;\n}\n\nconst OPERATION_BADGE_KEYS: Record<\n EntityComparisonOperation,\n { key: string; classes: string }\n> = {\n CreateRecord: {\n key: 'components.comparisonEntities.added',\n classes:\n 'bg-emerald-50 text-emerald-700 ring-1 ring-inset ring-emerald-200',\n },\n UpdateRecord: {\n key: 'components.comparisonEntities.updated',\n classes: 'bg-amber-50 text-amber-700 ring-1 ring-inset ring-amber-200',\n },\n DeleteRecord: {\n key: 'components.comparisonEntities.removed',\n classes: 'bg-rose-50 text-rose-700 ring-1 ring-inset ring-rose-200',\n },\n};\n\n@Component({\n selector: 'mt-comparison-entity-list',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [],\n templateUrl: './comparison-entity-list.html',\n host: {\n class: 'block w-full',\n },\n})\nexport class ComparisonEntityList {\n private readonly transloco = inject(TranslocoService);\n readonly data = input.required<EntityData>();\n\n readonly comparison = computed<EntityListComparison | null>(() => {\n const c = this.data().comparison;\n return c?.kind === 'EntityList' ? c : null;\n });\n\n readonly rows = computed<EntityListComparisonRow[]>(\n () => this.comparison()?.rows ?? [],\n );\n\n readonly targetModuleKey = computed<string>(\n () => this.comparison()?.targetModuleKey ?? '',\n );\n\n readonly label = computed<string>(() => this.data().name ?? '');\n\n badgeFor(op: EntityComparisonOperation): OperationBadge {\n const config = OPERATION_BADGE_KEYS[op];\n return {\n label: this.transloco.translate(config.key),\n classes: config.classes,\n };\n }\n\n displayField(value: unknown, display?: string | null): string {\n if (display && display.trim().length > 0) return display;\n return displayOrPlaceholder(value);\n }\n\n rowId(_i: number, row: EntityListComparisonRow): number | string {\n return row.entityId ?? _i;\n }\n\n oldField(\n row: EntityListComparisonRow,\n propertyKey: string,\n ): { value: unknown; display?: string | null } | undefined {\n return row.oldValues.find((v) => v.propertyKey === propertyKey);\n }\n}\n","@if (comparison(); as cmp) {\r\n <div class=\"flex w-full min-w-0 flex-col gap-2\">\r\n @if (label()) {\r\n <div class=\"flex items-baseline justify-between\">\r\n <span class=\"text-sm font-medium text-color\">{{ label() }}</span>\r\n @if (targetModuleKey()) {\r\n <span class=\"text-xs text-muted-color\">{{ targetModuleKey() }}</span>\r\n }\r\n </div>\r\n }\r\n @if (rows().length === 0) {\r\n <div class=\"text-sm text-muted-color\">_</div>\r\n } @else {\r\n <ul class=\"flex flex-col gap-2\">\r\n @for (row of rows(); track rowId($index, row)) {\r\n <li\r\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <span\r\n class=\"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"badgeFor(row.operation).classes\"\r\n >\r\n {{ badgeFor(row.operation).label }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">#{{ row.entityId }}</span>\r\n </div>\r\n\r\n @switch (row.operation) {\r\n @case (\"CreateRecord\") {\r\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\r\n @for (f of row.newValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"truncate text-sm text-color\">\r\n {{ displayField(f.value, f.display) }}\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n @case (\"DeleteRecord\") {\r\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\r\n @for (f of row.oldValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"truncate text-sm text-color line-through\">\r\n {{ displayField(f.value, f.display) }}\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n @default {\r\n <dl class=\"flex flex-col gap-1\">\r\n @for (f of row.newValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"flex min-w-0 flex-wrap items-center gap-2\">\r\n <span\r\n class=\"max-w-[40%] truncate text-sm text-muted-color line-through\"\r\n >\r\n {{\r\n displayField(\r\n $any(oldField(row, f.propertyKey))?.value,\r\n $any(oldField(row, f.propertyKey))?.display\r\n )\r\n }}\r\n </span>\r\n <span class=\"text-muted-color\" aria-hidden=\"true\"\r\n >→</span\r\n >\r\n <span class=\"max-w-[40%] truncate text-sm text-color\">\r\n {{ displayField(f.value, f.display) }}\r\n </span>\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n }\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n computed,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { EntityData } from '../entity.model';\r\nimport { sharedActiveLang } from '../active-lang';\r\nimport { resolveEntityInfo } from '../entity-display.utils';\r\nimport { EntityPreviewBody } from './entity-preview-body';\r\nimport { ComparisonValue } from '../comparison/comparison-value/comparison-value';\r\nimport { ComparisonEntityList } from '../comparison/comparison-entity-list/comparison-entity-list';\r\n\r\n@Component({\r\n selector: 'mt-entity-preview',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n EntityPreviewBody,\r\n ComparisonValue,\r\n ComparisonEntityList,\r\n Tooltip,\r\n Icon,\r\n ],\r\n templateUrl: './entity-preview.html',\r\n styleUrl: './entity-preview.css',\r\n // The tooltip is appended to the body by PrimeNG, so its style rule has to\r\n // be global. See entity-preview.css.\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n class: 'w-full',\r\n // Both only apply when there is a note, so an entity without one keeps\r\n // exactly the box it had before this feature existed.\r\n '[class.relative]': 'infoText()',\r\n '[class.pe-4]': 'infoText()',\r\n },\r\n})\r\nexport class EntityPreview {\r\n private readonly transloco = inject(TranslocoService);\r\n\r\n readonly data = input.required<EntityData>();\r\n readonly attachmentShape = input<'default' | 'compact'>('default');\r\n\r\n private readonly activeLang = sharedActiveLang(this.transloco);\r\n\r\n /**\r\n * The admin-authored note for the active language, or `''` when the property\r\n * has none. Resolved here rather than in each `entity-*` component because\r\n * this is the one wrapper every view type and every call site passes through\r\n * — the card grid, the customization builder preview, and the standalone\r\n * `mt-entity-preview` usages in the app.\r\n */\r\n readonly infoText = computed(() =>\r\n resolveEntityInfo(this.data().configuration, this.activeLang()),\r\n );\r\n\r\n readonly comparisonKind = computed<'Value' | 'EntityList' | null>(() => {\r\n const c = this.data().comparison;\r\n if (!c) return null;\r\n if (c.kind === 'Value') return 'Value';\r\n if (c.kind === 'EntityList') return 'EntityList';\r\n return null;\r\n });\r\n}\r\n","@if (infoText(); as info) {\r\n <!--\r\n The note affordance. Absolutely positioned so it stays out of the value's\r\n own layout — each viewType renders its own markup and there is no shared\r\n slot to put this in — while the host reserves the corner with `pe-4`, so a\r\n long value truncates before it can run underneath the icon.\r\n -->\r\n <!--\r\n Sized with `text-sm`, not a `size` input: `mt-icon` has none, and its host\r\n is `width: 1em` — so font-size is what actually scales the glyph.\r\n -->\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"absolute top-0 end-0 z-10 cursor-help text-sm text-surface-400 transition-colors hover:text-primary-600\"\r\n [mtTooltip]=\"info\"\r\n tooltipPosition=\"top\"\r\n tooltipStyleClass=\"mt-entity-info-tooltip\"\r\n [attr.aria-label]=\"info\"\r\n />\r\n}\r\n\r\n@switch (comparisonKind()) {\r\n @case (\"Value\") {\r\n <mt-comparison-value [data]=\"data()\" />\r\n }\r\n @case (\"EntityList\") {\r\n <mt-comparison-entity-list [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-preview-body\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n }\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { EntityData, EntitySize } from '../entity.model';\r\nimport { buildDisplayEntities } from '../leaf-details-display.utils';\r\nimport {\r\n getEntitySectionTitle,\r\n groupEntitiesIntoSections,\r\n} from '../entity-sections.util';\r\nimport { EntityPreview } from '../entity-preview/entity-preview';\r\n\r\nexport interface EntityClickEvent {\r\n entity: EntityData;\r\n key: string;\r\n source: MouseEvent;\r\n}\r\n\r\nconst EMPTY_KEY_SET: ReadonlySet<string> = new Set();\r\n\r\n/** Classes every entity slot carries, before its per-slot modifiers. */\r\nconst SLOT_BASE_CLASS =\r\n 'min-w-0 overflow-hidden flex items-center rounded transition-colors';\r\n\r\n/** Opt-in dashed frame (`configuration.showBorder`). */\r\nconst SLOT_BORDER_CLASS = 'border p-3 border-dashed border-gray-200 rounded-lg';\r\n\r\n/**\r\n * One entity's fully-resolved render inputs.\r\n *\r\n * Precomputing these is what keeps large grids cheap. The template used to call\r\n * `isClickable` / `isActive` / `getColSpan` roughly eight times per entity on\r\n * *every* change detection pass; in a client-list card grid (60 cards of ~50\r\n * entities) that was tens of thousands of calls per tick. A slot is now rebuilt\r\n * only when the entity list, the clickable/active key sets, or the tooltip\r\n * strings actually change.\r\n */\r\ninterface EntitySlot {\r\n entity: EntityData;\r\n trackKey: string;\r\n containerClass: string;\r\n colSpan: string;\r\n clickable: boolean;\r\n rowClickIgnore: 'true' | null;\r\n title: string | null;\r\n}\r\n\r\n/** A section box (or the leading bare run) with its slots already resolved. */\r\ninterface EntitySlotGroup {\r\n trackKey: string;\r\n boxed: boolean;\r\n title: string;\r\n slots: EntitySlot[];\r\n}\r\n\r\n@Component({\r\n selector: 'mt-entities-preview',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [EntityPreview, NgTemplateOutlet],\r\n templateUrl: './entities-preview.html',\r\n styleUrls: ['./entities-preview.css'],\r\n host: {\r\n class: 'block min-w-0 w-full',\r\n '[class.mt-entities-stack-narrow]': 'stackOnNarrow()',\r\n },\r\n})\r\nexport class EntitiesPreview {\r\n private readonly transloco = inject(TranslocoService);\r\n /** Array of entity data to display */\r\n readonly entities = input.required<EntityData[]>();\r\n readonly attachmentShape = input<'default' | 'compact'>('default');\r\n\r\n /**\r\n * Soft \"stack every field full-width when the host is narrower than the\r\n * 24-column grid reads well\" behavior (the ≤400px container-query fallback,\r\n * default on). Set to `false` in wide-enough card layouts — e.g. client-list\r\n * cards (~350px) — so the per-entity `size` configuration is honored instead\r\n * of forcing every item to full width. A hard ≤280px stack always applies\r\n * regardless, so the 24-column gap floor can never overflow the host (#1081).\r\n */\r\n readonly stackOnNarrow = input(true);\r\n\r\n /**\r\n * Set of entity keys that should appear interactive (cursor pointer,\r\n * clicks emit). Pass `new Set([...])` from a computed signal in the host\r\n * for reactive enabling — when the host's set changes, Angular re-renders\r\n * via its normal change detection, no manual subscriptions required.\r\n *\r\n * Pass a *stable* reference: a host method that mints a fresh `Set` on every\r\n * call re-writes this input on every change detection pass and defeats the\r\n * slot memoization below.\r\n */\r\n readonly clickableKeys = input<ReadonlySet<string>>(EMPTY_KEY_SET);\r\n\r\n /**\r\n * Set of entity keys that should render with the \"active\" treatment\r\n * (e.g. currently the filter source). Same reactive pattern — and the same\r\n * stable-reference requirement — as `clickableKeys`.\r\n */\r\n readonly activeKeys = input<ReadonlySet<string>>(EMPTY_KEY_SET);\r\n\r\n /** Tooltip text shown on hover when an entity is clickable but not active. */\r\n readonly clickableTooltip = input<string>(\r\n this.transloco.translate('components.entitiesPreview.filterByThis'),\r\n );\r\n\r\n /** Tooltip text shown on hover when an entity is the current active filter. */\r\n readonly activeTooltip = input<string>(\r\n this.transloco.translate('components.entitiesPreview.clearFilter'),\r\n );\r\n\r\n /**\r\n * Emits when an individual entity slot is clicked. Only fires when the\r\n * entity's key is present in `clickableKeys`.\r\n */\r\n readonly entityClick = output<EntityClickEvent>();\r\n\r\n /**\r\n * The active language as a signal. Section headings are resolved per-language\r\n * in a `computed`, so under `OnPush` a plain `getActiveLang()` read would\r\n * freeze them at whatever language was active on first render.\r\n */\r\n private readonly activeLang = toSignal(this.transloco.langChanges$, {\r\n initialValue: this.transloco.getActiveLang(),\r\n });\r\n\r\n /** Entities expanded and sorted by order */\r\n readonly displayEntities = computed(() =>\r\n buildDisplayEntities(this.entities()),\r\n );\r\n\r\n /**\r\n * The display entities split into section groups. With no `Section` markers\r\n * this is a single `{ section: null }` group, so the bare grid renders\r\n * exactly as before.\r\n */\r\n readonly sectionGroups = computed(() =>\r\n groupEntitiesIntoSections(this.displayEntities()),\r\n );\r\n\r\n /**\r\n * The render model the template iterates. Split from `sectionGroups` on\r\n * purpose: grouping only re-runs when the entities themselves change, while\r\n * this cheap mapping re-runs when the key sets or tooltips change.\r\n */\r\n protected readonly slotGroups = computed<EntitySlotGroup[]>(() => {\r\n const clickableKeys = this.clickableKeys();\r\n const activeKeys = this.activeKeys();\r\n const clickableTooltip = this.clickableTooltip();\r\n const activeTooltip = this.activeTooltip();\r\n const lang = this.activeLang();\r\n\r\n return this.sectionGroups().map((group, groupIndex) => ({\r\n trackKey: group.section?.key ?? `__group__${groupIndex}`,\r\n boxed: !!group.section,\r\n title: getEntitySectionTitle(group.section, lang),\r\n slots: group.entities.map((entity, entityIndex) => {\r\n const key = resolveEntityKey(entity);\r\n const clickable = key.length > 0 && clickableKeys.has(key);\r\n const active = clickable && activeKeys.has(key);\r\n\r\n return {\r\n entity,\r\n trackKey: entity.key ?? String(entity.order ?? entityIndex),\r\n containerClass: buildSlotClass(entity, clickable, active),\r\n colSpan: `span ${(entity.configuration?.size ?? 8) as EntitySize}`,\r\n clickable,\r\n rowClickIgnore: clickable ? ('true' as const) : null,\r\n title: clickable ? (active ? activeTooltip : clickableTooltip) : null,\r\n };\r\n }),\r\n }));\r\n });\r\n\r\n protected onSlotClick(source: MouseEvent, slot: EntitySlot): void {\r\n if (!slot.clickable) return;\r\n source.stopPropagation();\r\n this.entityClick.emit({\r\n entity: slot.entity,\r\n key: resolveEntityKey(slot.entity),\r\n source,\r\n });\r\n }\r\n}\r\n\r\n/** Stable key resolution shared with the host — must agree on order. */\r\nfunction resolveEntityKey(entity: EntityData): string {\r\n return entity.key || entity.normalizedKey || entity.name || '';\r\n}\r\n\r\nfunction buildSlotClass(\r\n entity: EntityData,\r\n clickable: boolean,\r\n active: boolean,\r\n): string {\r\n let result = SLOT_BASE_CLASS;\r\n if (entity.configuration?.showBorder) result += ` ${SLOT_BORDER_CLASS}`;\r\n if (clickable) {\r\n result += active ? ' mt-entity-filter-active' : ' mt-entity-filterable';\r\n }\r\n return result;\r\n}\r\n","<div class=\"flex flex-col gap-4\">\r\n @for (group of slotGroups(); track group.trackKey) {\r\n @if (group.boxed) {\r\n <!-- Titled section box (matches the client-form section view) -->\r\n <div\r\n class=\"flex flex-col gap-0 overflow-hidden rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n @if (group.title) {\r\n <h3\r\n class=\"m-0 border-b border-surface-200 bg-surface-50 px-4 py-3 text-lg font-semibold text-color\"\r\n dir=\"auto\"\r\n >\r\n {{ group.title }}\r\n </h3>\r\n }\r\n <div class=\"p-4\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"entityGrid\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group.slots }\"\r\n />\r\n </div>\r\n </div>\r\n } @else {\r\n <ng-container\r\n [ngTemplateOutlet]=\"entityGrid\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group.slots }\"\r\n />\r\n }\r\n }\r\n</div>\r\n\r\n<!--\r\n Every binding here reads a value the component already resolved into the slot\r\n (see `EntitiesPreview.slotGroups`). Keep it that way: this template runs once\r\n per entity per change detection pass, and a card grid renders thousands of\r\n them, so a method call or a fresh object literal in this block is measurably\r\n expensive.\r\n-->\r\n<ng-template #entityGrid let-slots>\r\n <div class=\"mt-entities-grid grid grid-cols-24 gap-x-3 gap-y-5\">\r\n @for (slot of slots; track slot.trackKey) {\r\n <div\r\n [class]=\"slot.containerClass\"\r\n [attr.data-row-click-ignore]=\"slot.rowClickIgnore\"\r\n [attr.title]=\"slot.title\"\r\n [style.grid-column]=\"slot.colSpan\"\r\n (click)=\"onSlotClick($event, slot)\"\r\n >\r\n <mt-entity-preview\r\n [data]=\"slot.entity\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n","import {\n Directive,\n ElementRef,\n inject,\n NgZone,\n output,\n signal,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { EntityData, EntityResizeEvent, EntitySize } from '../entity.model';\n\n/**\n * Base class that encapsulates all entity resize-via-drag logic.\n *\n * Extend this directive in any component that needs column-resize behaviour\n * on a 24-column CSS grid. The subclass must:\n * - Provide a `model.required<EntityData[]>()` (or equivalent) for the\n * entity list so `updateEntitySize()` can be called after resize.\n * - Contain a `.grid` element (or override `getGridElement()`).\n *\n * Resize flow:\n * 1. `onResizeStart(event, entity)` — called from a mousedown on the handle\n * 2. mousemove → snaps to nearest column, updates `resizePreviewSize`\n * 3. mouseup → emits `entityResized` with previous & new size\n */\n@Directive()\nexport abstract class EntitiesResizeBase {\n protected readonly elRef = inject(ElementRef);\n protected readonly zone = inject(NgZone);\n protected readonly doc = inject(DOCUMENT);\n\n /** Emits when an entity is resized via the drag handle */\n readonly entityResized = output<EntityResizeEvent>();\n\n // ── Resize state ──\n\n /** The entity currently being resized (null when idle) */\n readonly resizingEntity = signal<EntityData | null>(null);\n\n /** Live preview size while dragging */\n readonly resizePreviewSize = signal<EntitySize | null>(null);\n\n /** Bound listeners kept for cleanup */\n private _onMouseMove: ((e: MouseEvent) => void) | null = null;\n private _onMouseUp: ((e: MouseEvent) => void) | null = null;\n\n // ── Public API ──\n\n /**\n * Returns the grid element used to compute column widths.\n * Override if the grid selector differs.\n */\n protected getGridElement(): HTMLElement | null {\n return this.elRef.nativeElement.querySelector('.grid');\n }\n\n /**\n * Returns the grid-column span string for a given entity.\n * While resizing the active entity, returns the preview size.\n */\n getResizeColSpan(entity: EntityData): string {\n if (this.resizingEntity() === entity && this.resizePreviewSize() !== null) {\n return `span ${this.resizePreviewSize()}`;\n }\n const size: EntitySize = entity.configuration?.size ?? 8;\n return `span ${size}`;\n }\n\n /** Starts a resize operation from the right-edge handle */\n onResizeStart(event: MouseEvent, entity: EntityData): void {\n // Prevent the drag-drop from starting\n event.preventDefault();\n event.stopPropagation();\n\n const gridEl = this.getGridElement();\n if (!gridEl) return;\n\n const gridRect = gridEl.getBoundingClientRect();\n const gridWidth = gridRect.width;\n const columnWidth = gridWidth / 24;\n\n const previousSize: EntitySize = entity.configuration?.size ?? 8;\n\n // Left edge of the entity cell\n const cellEl = (event.target as HTMLElement).closest(\n '.entity-cell',\n ) as HTMLElement | null;\n if (!cellEl) return;\n const cellRect = cellEl.getBoundingClientRect();\n const isRtl =\n this.doc.documentElement.getAttribute('dir') === 'rtl' ||\n getComputedStyle(this.doc.documentElement).direction === 'rtl';\n\n this.resizingEntity.set(entity);\n this.resizePreviewSize.set(previousSize);\n\n // Run mouse listeners outside Angular zone for performance\n this.zone.runOutsideAngular(() => {\n this._onMouseMove = (e: MouseEvent) => {\n // In RTL the logical end is the left edge; dragging left widens the cell\n const rawWidth = isRtl\n ? cellRect.right - e.clientX\n : e.clientX - cellRect.left;\n // Snap to nearest full column (min 1, max 12)\n let cols = Math.round(rawWidth / columnWidth);\n cols = Math.max(1, Math.min(24, cols)) as EntitySize;\n const current = this.resizePreviewSize();\n if (current !== cols) {\n this.zone.run(() => this.resizePreviewSize.set(cols as EntitySize));\n }\n };\n\n this._onMouseUp = () => {\n this._cleanupListeners();\n\n const newSize = this.resizePreviewSize() as EntitySize;\n this.resizingEntity.set(null);\n this.resizePreviewSize.set(null);\n\n if (newSize !== previousSize) {\n this.zone.run(() => {\n this.onResizeComplete(entity, previousSize, newSize);\n });\n }\n };\n\n this.doc.addEventListener('mousemove', this._onMouseMove);\n this.doc.addEventListener('mouseup', this._onMouseUp, { once: true });\n });\n }\n\n /**\n * Called when a resize operation completes with a changed size.\n * Subclasses should update the entity list and emit events here.\n */\n protected abstract onResizeComplete(\n entity: EntityData,\n previousSize: EntitySize,\n newSize: EntitySize,\n ): void;\n\n /** Removes global mouse listeners */\n private _cleanupListeners(): void {\n if (this._onMouseMove) {\n this.doc.removeEventListener('mousemove', this._onMouseMove);\n this._onMouseMove = null;\n }\n if (this._onMouseUp) {\n this.doc.removeEventListener('mouseup', this._onMouseUp);\n this._onMouseUp = null;\n }\n }\n}\n","import { Component, computed, model, output } from '@angular/core';\nimport {\n CdkDrag,\n CdkDragDrop,\n CdkDragPlaceholder,\n CdkDropList,\n} from '@angular/cdk/drag-drop';\nimport { Icon } from '@masterteam/icons';\nimport { EntityData, EntitySize } from '../entity.model';\nimport {\n buildDisplayEntities,\n isLeafSyntheticKey,\n} from '../leaf-details-display.utils';\nimport { isConnectionSyntheticKey } from '../connection-display.utils';\nimport { isEntitySection } from '../entity-sections.util';\nimport { EntityPreview } from '../entity-preview/entity-preview';\nimport { EntitiesResizeBase } from './entities-resize-base';\n\n@Component({\n selector: 'mt-entities-manage',\n standalone: true,\n imports: [EntityPreview, Icon, CdkDrag, CdkDropList, CdkDragPlaceholder],\n templateUrl: './entities-manage.html',\n styleUrl: './entities-manage.scss',\n})\nexport class EntitiesManage extends EntitiesResizeBase {\n /** Array of entity data – supports two-way binding to keep order in sync */\n readonly entities = model.required<EntityData[]>();\n\n /** Emits the reordered entities array after each drag-drop */\n readonly entitiesReordered = output<EntityData[]>();\n\n /** Emits when an entity cell is clicked (for opening edit drawer) */\n readonly entityClicked = output<EntityData>();\n\n /**\n * Emits when an item dragged from a *different* connected list (e.g. a sidebar\n * \"add section\" tool) is dropped onto this grid. `index` is the target slot;\n * `data` is the dropped `cdkDragData`. The host decides what to insert.\n */\n readonly externalItemDropped = output<{ index: number; data: unknown }>();\n\n /** Entities expanded and sorted by their configured order */\n readonly displayEntities = computed(() =>\n buildDisplayEntities(this.entities()),\n );\n\n /** Returns the grid-column span for a given entity size (1-24) */\n getColSpan(entity: EntityData): string {\n if (isEntitySection(entity)) return 'span 24';\n return this.getResizeColSpan(entity);\n }\n\n /** True when the entity is a full-width `Section` layout marker. */\n isSection(entity: EntityData): boolean {\n return isEntitySection(entity);\n }\n\n /** Handle drag-drop reorder */\n onDrop(event: CdkDragDrop<EntityData[]>): void {\n // Item dragged in from another connected list — let the host handle it.\n if (event.previousContainer !== event.container) {\n this.externalItemDropped.emit({\n index: event.currentIndex,\n data: event.item.data,\n });\n return;\n }\n\n if (event.previousIndex === event.currentIndex) return;\n\n const items = [...this.displayEntities()];\n const [moved] = items.splice(event.previousIndex, 1);\n items.splice(event.currentIndex, 0, moved);\n\n // Reassign order based on new positions\n const reordered = items.map((item, index) => ({\n ...item,\n order: index + 1,\n }));\n\n // Update the model (two-way binding)\n this.entities.set(reordered);\n\n // Emit the reordered list\n this.entitiesReordered.emit(reordered);\n }\n\n // ── Resize completion (from EntitiesResizeBase) ──\n\n protected override onResizeComplete(\n entity: EntityData,\n previousSize: EntitySize,\n newSize: EntitySize,\n ): void {\n const currentEntities = this.entities();\n const sourceEntities = currentEntities.some((e) => e === entity)\n ? currentEntities\n : this.displayEntities();\n // Expanded items (LeafDetails levels / Connection source levels) are rebuilt\n // on every render, so identity no longer matches — fall back to the key.\n const isExpandedItem =\n isLeafSyntheticKey(entity.key) || isConnectionSyntheticKey(entity.key);\n const updated = sourceEntities.map((e) =>\n e === entity || (isExpandedItem && e.key === entity.key)\n ? {\n ...e,\n configuration: {\n ...e.configuration,\n size: newSize,\n },\n }\n : e,\n );\n this.entities.set(updated);\n\n this.entityResized.emit({\n entity: {\n ...entity,\n configuration: { ...entity.configuration, size: newSize },\n },\n previousSize,\n newSize,\n });\n }\n}\n","<div\r\n cdkDropList\r\n cdkDropListOrientation=\"mixed\"\r\n [cdkDropListData]=\"displayEntities()\"\r\n (cdkDropListDropped)=\"onDrop($event)\"\r\n class=\"grid grid-cols-24 gap-x-4 gap-y-6\"\r\n>\r\n @for (\r\n entity of displayEntities();\r\n track entity.key ?? entity.order ?? $index\r\n ) {\r\n @if (isSection(entity)) {\r\n <!-- Section marker: full-width, non-resizable header row -->\r\n <div\r\n cdkDrag\r\n [cdkDragData]=\"entity\"\r\n class=\"entity-cell section-row group relative min-w-0 flex items-center gap-2 px-4 py-2.5 cursor-grab active:cursor-grabbing rounded-md border border-surface-200 bg-surface-50 transition-colors hover:bg-emphasis\"\r\n [class.resizing]=\"resizingEntity() === entity\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n (click)=\"entityClicked.emit(entity)\"\r\n >\r\n <div\r\n *cdkDragPlaceholder\r\n class=\"h-full min-h-11 bg-black/10 rounded-md\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n ></div>\r\n\r\n <span\r\n class=\"flex-1 min-w-0 truncate text-base font-semibold\"\r\n dir=\"auto\"\r\n >\r\n {{ entity.name }}\r\n </span>\r\n <mt-icon\r\n icon=\"editor.pencil-01\"\r\n class=\"shrink-0 opacity-0 transition-opacity group-hover:opacity-60\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n cdkDrag\r\n [cdkDragData]=\"entity\"\r\n class=\"entity-cell group relative min-w-0 flex items-center p-3 cursor-grab active:cursor-grabbing rounded-lg transition-colors bg-surface-100/60\"\r\n [class.border]=\"entity.configuration?.showBorder\"\r\n [class.border-dashed]=\"entity.configuration?.showBorder\"\r\n [class.border-gray-300]=\"entity.configuration?.showBorder\"\r\n [class.resizing]=\"resizingEntity() === entity\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n >\r\n <!-- Drag placeholder -->\r\n <div\r\n *cdkDragPlaceholder\r\n class=\"h-full min-h-12 bg-black/10 rounded-xl\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n ></div>\r\n\r\n <mt-entity-preview\r\n [data]=\"entity\"\r\n class=\"flex-1 min-w-0 cursor-pointer\"\r\n (click)=\"entityClicked.emit(entity)\"\r\n />\r\n\r\n <!-- Resize handle (right edge) -->\r\n <div\r\n class=\"resize-handle\"\r\n (mousedown)=\"onResizeStart($event, entity)\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div class=\"resize-handle-bar\"></div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2tBA;AACM,SAAU,yBAAyB,CACvC,KAAc,EAAA;IAEd,QACE,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;AACzB,QAAA,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AACpB,Q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