@masterteam/components 0.0.338 → 0.0.340

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.
@@ -96,7 +96,22 @@ declare class EntityRuntimeContextStore {
96
96
  declare const ENTITY_LIST_TABLE_COMPONENT: InjectionToken<Type<unknown>>;
97
97
 
98
98
  /** A recalculation covering this value is running, or queued behind another. */
99
- type EntityCalculationStatus = 'running' | 'waiting';
99
+ type EntityCalculationStatus = 'running' | 'waiting' | 'delayed';
100
+ /** How a calculated value moved between two reads of the same record. */
101
+ interface EntityCalculationChange {
102
+ /** Signed difference; `null` for a value that has no numeric difference. */
103
+ delta: number | null;
104
+ /** The value's unit as the backend formats it, e.g. `SAR` or `%`. */
105
+ unit: string;
106
+ /** Whether the unit is written before the amount. */
107
+ unitLeads: boolean;
108
+ fractionDigits: number;
109
+ /** The value as it read before and after, in full. */
110
+ previous: string;
111
+ current: string;
112
+ /** While true a chip beside the value shows the change. Numbers only. */
113
+ recent: boolean;
114
+ }
100
115
  type EntityViewType = 'Text' | 'LongText' | 'Date' | 'DateTime'
101
116
  /**
102
117
  * Time-of-day. The value on the wire is still a full ISO instant (the
@@ -836,6 +851,8 @@ interface EntityData {
836
851
  calculated?: boolean;
837
852
  /** Set while the value is being recalculated: the icon pulses. */
838
853
  calculationStatus?: EntityCalculationStatus | null;
854
+ /** The last change to this calculated value since the record was opened. */
855
+ calculationChange?: EntityCalculationChange | null;
839
856
  propertyConfiguration?: EntityPropertyConfiguration;
840
857
  /**
841
858
  * Catalog metadata for the properties captured inside `value`. The stored
@@ -957,6 +974,8 @@ declare class EntityField {
957
974
  private readonly previewData;
958
975
  readonly calculated: _angular_core.Signal<boolean>;
959
976
  readonly calculationStatus: _angular_core.Signal<_masterteam_components_entities.EntityCalculationStatus | null | undefined>;
977
+ readonly calculationChange: _angular_core.Signal<_masterteam_components_entities.EntityCalculationChange | null | undefined>;
978
+ readonly recentChange: _angular_core.Signal<_masterteam_components_entities.EntityCalculationChange | null>;
960
979
  readonly label: _angular_core.InputSignal<string>;
961
980
  readonly labelIconName: _angular_core.InputSignal<string | null>;
962
981
  readonly configuration: _angular_core.InputSignal<EntityConfiguration | null | undefined>;
@@ -977,7 +996,12 @@ declare class EntityText {
977
996
  readonly name: _angular_core.InputSignal<string | undefined>;
978
997
  readonly value: _angular_core.InputSignal<string | undefined>;
979
998
  readonly displayName: _angular_core.Signal<string>;
980
- protected readonly hideLabel: _angular_core.Signal<boolean>;
999
+ /**
1000
+ * Renders without the field wrapper, which only carries the label, unless
1001
+ * the wrapper has a chip to show beside the value: how a calculated value
1002
+ * just changed. The wrapper hides the label itself.
1003
+ */
1004
+ protected readonly bare: _angular_core.Signal<boolean>;
981
1005
  protected readonly alignEnd: _angular_core.Signal<boolean>;
982
1006
  readonly displayValue: _angular_core.Signal<string>;
983
1007
  protected readonly hasMarkup: _angular_core.Signal<boolean>;
@@ -1926,6 +1950,101 @@ declare function currencyUnitOf(formatted: string): string;
1926
1950
  */
1927
1951
  declare function compactCurrencyDisplay(formatted: string, rawValue: string | null | undefined, locale: string, threshold?: number): string;
1928
1952
 
1953
+ /**
1954
+ * How a calculated value moved between two reads of the same record, or `null`
1955
+ * when it did not. Numeric view types get a signed difference; anything else
1956
+ * only records what it read before and after. `locale` formats the exact
1957
+ * values used when the displayed ones round to the same text.
1958
+ */
1959
+ declare function describeCalculationChange(previous: EntityData, current: EntityData, locale?: string): EntityCalculationChange | null;
1960
+ /** The signed difference as the chip shows it, e.g. `+500K SAR` or `+0.1%`. */
1961
+ declare function formatCalculationDelta(change: EntityCalculationChange, locale: string): string | null;
1962
+
1963
+ /** How long the chip beside a value that just changed stays visible. */
1964
+ declare const CALCULATION_CHANGE_CHIP_MS = 30000;
1965
+ /** The catalog fields that decide whether a property counts as calculated. */
1966
+ interface CalculatedPropertyMeta {
1967
+ viewType?: string | null;
1968
+ isCalculated?: boolean | null;
1969
+ calculationMethod?: string | null;
1970
+ }
1971
+ /**
1972
+ * Whether a surface marks this property as calculated. `isCalculated` alone is
1973
+ * too broad: the backend also sets it, with no calculation method, on system
1974
+ * columns such as `created_at`, `id` and `team_members`. A status has no method
1975
+ * but is recalculated, and an auto code is generated once.
1976
+ */
1977
+ declare function isCalculatedProperty(meta: CalculatedPropertyMeta | null | undefined): boolean;
1978
+ /**
1979
+ * Remembers the calculated values each surface last showed, for the whole
1980
+ * session, so a value that moved while the surface was closed still says so
1981
+ * when it opens again: the card of a project edited from its workspace, or a
1982
+ * preview opened a second time.
1983
+ *
1984
+ * A scope names a kind of surface, such as `preview:level:12` or
1985
+ * `list:level:12`. Each compares only with itself: two endpoints may not agree
1986
+ * at the same moment, and comparing across them would invent changes.
1987
+ */
1988
+ declare class CalculatedValueHistory {
1989
+ private readonly seen;
1990
+ private readonly timers;
1991
+ private readonly changes;
1992
+ /**
1993
+ * Records the calculated values a surface just read. Those that moved since
1994
+ * the scope last read them get a change, shown as recent for
1995
+ * {@link CALCULATION_CHANGE_CHIP_MS}.
1996
+ */
1997
+ observe(scope: string, recordId: string | number, entities: readonly EntityData[], locale: string): void;
1998
+ /** The last change of one value, if the scope saw it move. Reactive. */
1999
+ changeOf(scope: string, recordId: string | number, propertyKey: string): EntityCalculationChange | null;
2000
+ /**
2001
+ * The entities with the last change of each calculated value attached.
2002
+ * Returns the same array when nothing changed, so inputs stay stable.
2003
+ * Reactive.
2004
+ */
2005
+ apply<T extends EntityData>(scope: string, recordId: string | number, entities: T[]): T[];
2006
+ private expireLater;
2007
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CalculatedValueHistory, never>;
2008
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<CalculatedValueHistory>;
2009
+ }
2010
+
2011
+ /** The calculated-value mark. Drawn, so it sits centred at any size. */
2012
+ declare class EntityCalculatedGlyph {
2013
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityCalculatedGlyph, never>;
2014
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityCalculatedGlyph, "mt-entity-calculated-glyph", never, {}, {}, never, never, true, never>;
2015
+ }
2016
+ /**
2017
+ * Marks a property value the backend calculates. Rendered beside its label; it
2018
+ * pulses while a recalculation that covers the value is in progress, and stays
2019
+ * lit without pulsing once that is taking longer than expected.
2020
+ */
2021
+ declare class EntityCalculatedIndicator {
2022
+ /** Set while the value is being recalculated. */
2023
+ readonly status: _angular_core.InputSignal<EntityCalculationStatus | null | undefined>;
2024
+ /** The value's last change, described in the tooltip when it is not busy. */
2025
+ readonly change: _angular_core.InputSignal<EntityCalculationChange | null | undefined>;
2026
+ protected readonly pulsing: _angular_core.Signal<boolean>;
2027
+ protected readonly tooltipKey: _angular_core.Signal<string>;
2028
+ protected readonly tooltipParams: _angular_core.Signal<{
2029
+ previous: string;
2030
+ current: string;
2031
+ } | undefined>;
2032
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityCalculatedIndicator, never>;
2033
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityCalculatedIndicator, "mt-entity-calculated-indicator", never, { "status": { "alias": "status"; "required": false; "isSignal": true; }; "change": { "alias": "change"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
2034
+ }
2035
+
2036
+ /**
2037
+ * Says how a calculated number just moved: the signed difference, with the
2038
+ * exact values in its tooltip.
2039
+ */
2040
+ declare class EntityCalculationChangeChip {
2041
+ private readonly activeLang;
2042
+ readonly change: _angular_core.InputSignal<EntityCalculationChange>;
2043
+ protected readonly delta: _angular_core.Signal<string | null>;
2044
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityCalculationChangeChip, never>;
2045
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityCalculationChangeChip, "mt-entity-calculation-change", never, { "change": { "alias": "change"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
2046
+ }
2047
+
1929
2048
  /**
1930
2049
  * Anything that can supply a percentage colour: an ordered rule set plus the
1931
2050
  * fallback used when no rule matches.
@@ -2079,7 +2198,7 @@ declare class EntityPreview {
2079
2198
  * `mt-entity-preview` usages in the app.
2080
2199
  */
2081
2200
  readonly infoText: _angular_core.Signal<string>;
2082
- readonly comparisonKind: _angular_core.Signal<"EntityList" | "Value" | null>;
2201
+ readonly comparisonKind: _angular_core.Signal<"Value" | "EntityList" | null>;
2083
2202
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPreview, never>;
2084
2203
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityPreview, "mt-entity-preview", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "attachmentShape": { "alias": "attachmentShape"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
2085
2204
  }
@@ -2365,5 +2484,5 @@ declare class FitText {
2365
2484
 
2366
2485
  declare function sharedActiveLang(transloco: TranslocoService): Signal<string>;
2367
2486
 
2368
- export { CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PERFORMANCE_SCORE_CHART_SIZE, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, ENTITY_HEADER_VIEW_TYPES, ENTITY_LIST_TABLE_COMPONENT, ENTITY_ROW_SPANS, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityColor, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityHeader, EntityIcon, EntityLeafDetails, EntityListDrawer, EntityListPreview, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPerformanceScore, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityRuntimeContextStore, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, LEAF_PHASES_KEY_SEPARATOR, PERFORMANCE_SCORE_CHART_SIZES, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildEntityListRows, buildSectionKey, canEntityBeHeader, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, getPerformanceScoreBands, groupEntitiesIntoSections, humanizeEntityListKey, isConnectionSyntheticKey, isEntityAlignEnd, isEntityHeader, isEntityLabelHidden, isEntityListLocalDocument, isEntityListSelectionDocument, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, localCellsByFieldId, matchesPercentageColorRule, mergeStakeholderNameColumns, mergeStakeholderNameEntities, mergeStakeholderNameRows, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, parsePerformanceScore, pinEntityHeaderFirst, readEntityHeaderDefaults, readEntityValueColor, resolveConnectionLevelName, resolveEntityGridRow, resolveEntityHeader, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalFieldConfiguration, resolveLocalFieldLabel, resolveLocalFieldViewType, resolveLocalizedLabel, resolvePercentageColor, resolvePerformanceScoreStatus, serializeEntityRawValue, sharedActiveLang, sortLocalRows, splitConnectionKey, splitLeafKey, summarizeEntityListRows, visibleLocalSchemaFields };
2369
- export type { ComparisonValueSide, ConnectionCatalogConfiguration, ConnectionLevelSavedConfig, ConnectionSourceLevelConfig, EntityAttachmentItemValue, EntityAttachmentValue, EntityBaseConfig, EntityCalculationStatus, EntityClickEvent, EntityComparisonField, EntityComparisonOperation, EntityConfiguration, EntityConnectionConfig, EntityConnectionSourceValue, EntityConnectionValue, EntityData, EntityHeaderConfig, EntityLabelPosition, EntityLeafDetailsConfig, EntityListComparison, EntityListComparisonRow, EntityListEntityValue, EntityListInlineFieldMeta, EntityListLocalCell, EntityListLocalDocument, EntityListLocalFieldDefinition, EntityListLocalFieldWidth, EntityListLocalRow, EntityListLocalSchema, EntityListLocalSchemaField, EntityListRenderedRow, EntityListRowValue, EntityListSelectionDocument, EntityListSelectionRecord, EntityListSelectionRecordValue, EntityListTableHost, EntityListTranslatable, EntityListValueItem, EntityLocationValue, EntityLookupCheckListItem, EntityLookupCheckListPropValue, EntityLookupCheckListValue, EntityLookupValue, EntityMultiLookupValue, EntityMultiUserValue, EntityNestedPropertyMeta, EntityPercentageConfig, EntityPerformanceScoreChartSize, EntityPerformanceScoreConfig, EntityPerformanceScoreStatus, EntityPerformanceScoreValue, EntityPhaseGateValue, EntityPropertyConfiguration, EntityResizeEvent, EntityRowSpan, EntityRuntimeContext, EntityScheduleItemValue, EntitySectionConfig, EntitySectionGroup, EntitySectionLabel, EntitySize, EntityStatusValue, EntityTranslatableTextValue, EntityUserConfig, EntityUserValue, EntityViewType, LeafDetailsBadgeKind, LeafDetailsCatalogConfiguration, LeafDetailsCatalogLevelValue, LeafDetailsCatalogPhaseValue, LeafDetailsCatalogStatusValue, LeafDetailsEntityCollectionValue, LeafDetailsEntityValue, LeafDetailsPhaseSummary, LeafDetailsRuntimeChildSchema, LeafDetailsRuntimePhaseCount, LeafDetailsRuntimePhaseDetails, LeafDetailsRuntimeStatusCount, LeafDetailsRuntimeStatusDetails, LeafDetailsRuntimeValue, LeafDetailsStatusSummary, LeafLevelSavedConfig, LeafPhaseSavedConfig, PercentageColorMode, PercentageColorPropertyRef, PercentageColorRule, PercentageColorSource, PropertyValueComparison, ValueComparison };
2487
+ export { CALCULATION_CHANGE_CHIP_MS, CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, CalculatedValueHistory, ComparisonEntityList, ComparisonValue, DEFAULT_PERFORMANCE_SCORE_CHART_SIZE, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, ENTITY_HEADER_VIEW_TYPES, ENTITY_LIST_TABLE_COMPONENT, ENTITY_ROW_SPANS, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCalculatedGlyph, EntityCalculatedIndicator, EntityCalculationChangeChip, EntityCheckbox, EntityColor, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityHeader, EntityIcon, EntityLeafDetails, EntityListDrawer, EntityListPreview, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPerformanceScore, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityRuntimeContextStore, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, LEAF_PHASES_KEY_SEPARATOR, PERFORMANCE_SCORE_CHART_SIZES, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildEntityListRows, buildSectionKey, canEntityBeHeader, compactCurrencyDisplay, currencyUnitOf, describeCalculationChange, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, formatCalculationDelta, getEntitySectionTitle, getPerformanceScoreBands, groupEntitiesIntoSections, humanizeEntityListKey, isCalculatedProperty, isConnectionSyntheticKey, isEntityAlignEnd, isEntityHeader, isEntityLabelHidden, isEntityListLocalDocument, isEntityListSelectionDocument, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, localCellsByFieldId, matchesPercentageColorRule, mergeStakeholderNameColumns, mergeStakeholderNameEntities, mergeStakeholderNameRows, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, parsePerformanceScore, pinEntityHeaderFirst, readEntityHeaderDefaults, readEntityValueColor, resolveConnectionLevelName, resolveEntityGridRow, resolveEntityHeader, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalFieldConfiguration, resolveLocalFieldLabel, resolveLocalFieldViewType, resolveLocalizedLabel, resolvePercentageColor, resolvePerformanceScoreStatus, serializeEntityRawValue, sharedActiveLang, sortLocalRows, splitConnectionKey, splitLeafKey, summarizeEntityListRows, visibleLocalSchemaFields };
2488
+ export type { CalculatedPropertyMeta, ComparisonValueSide, ConnectionCatalogConfiguration, ConnectionLevelSavedConfig, ConnectionSourceLevelConfig, EntityAttachmentItemValue, EntityAttachmentValue, EntityBaseConfig, EntityCalculationChange, EntityCalculationStatus, EntityClickEvent, EntityComparisonField, EntityComparisonOperation, EntityConfiguration, EntityConnectionConfig, EntityConnectionSourceValue, EntityConnectionValue, EntityData, EntityHeaderConfig, EntityLabelPosition, EntityLeafDetailsConfig, EntityListComparison, EntityListComparisonRow, EntityListEntityValue, EntityListInlineFieldMeta, EntityListLocalCell, EntityListLocalDocument, EntityListLocalFieldDefinition, EntityListLocalFieldWidth, EntityListLocalRow, EntityListLocalSchema, EntityListLocalSchemaField, EntityListRenderedRow, EntityListRowValue, EntityListSelectionDocument, EntityListSelectionRecord, EntityListSelectionRecordValue, EntityListTableHost, EntityListTranslatable, EntityListValueItem, EntityLocationValue, EntityLookupCheckListItem, EntityLookupCheckListPropValue, EntityLookupCheckListValue, EntityLookupValue, EntityMultiLookupValue, EntityMultiUserValue, EntityNestedPropertyMeta, EntityPercentageConfig, EntityPerformanceScoreChartSize, EntityPerformanceScoreConfig, EntityPerformanceScoreStatus, EntityPerformanceScoreValue, EntityPhaseGateValue, EntityPropertyConfiguration, EntityResizeEvent, EntityRowSpan, EntityRuntimeContext, EntityScheduleItemValue, EntitySectionConfig, EntitySectionGroup, EntitySectionLabel, EntitySize, EntityStatusValue, EntityTranslatableTextValue, EntityUserConfig, EntityUserValue, EntityViewType, LeafDetailsBadgeKind, LeafDetailsCatalogConfiguration, LeafDetailsCatalogLevelValue, LeafDetailsCatalogPhaseValue, LeafDetailsCatalogStatusValue, LeafDetailsEntityCollectionValue, LeafDetailsEntityValue, LeafDetailsPhaseSummary, LeafDetailsRuntimeChildSchema, LeafDetailsRuntimePhaseCount, LeafDetailsRuntimePhaseDetails, LeafDetailsRuntimeStatusCount, LeafDetailsRuntimeStatusDetails, LeafDetailsRuntimeValue, LeafDetailsStatusSummary, LeafLevelSavedConfig, LeafPhaseSavedConfig, PercentageColorMode, PercentageColorPropertyRef, PercentageColorRule, PercentageColorSource, PropertyValueComparison, ValueComparison };