@masterteam/components 0.0.345 → 0.0.347

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.
@@ -346,8 +346,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
346
346
  */
347
347
  const ENTITY_LIST_TABLE_COMPONENT = new InjectionToken('ENTITY_LIST_TABLE_COMPONENT');
348
348
 
349
- /** Records named one by one when the owner's list did not have them. */
350
- const SINGLE_READS = 20;
349
+ /**
350
+ * Records named one by one when the owner's list did not have them: as many
351
+ * as a summarized rollup lists, whose items can sit past the list's first
352
+ * page in a schedule of up to 2,000.
353
+ */
354
+ const SINGLE_READS = 25;
351
355
  /** A missing name only costs a label: never a toast. */
352
356
  const SILENT = new HttpHeaders({ noMessage: 'true' });
353
357
  /**
@@ -949,12 +953,16 @@ function nodeValueText(node, ctx) {
949
953
  }
950
954
  const value = node.value;
951
955
  const viewType = nodeViewType(node);
952
- if (Array.isArray(value)) {
953
- return value.length <= INLINE_VALUES
956
+ const text = Array.isArray(value)
957
+ ? value.length <= INLINE_VALUES
954
958
  ? value.map((item) => formatTypedValue(item, viewType, ctx)).join(', ')
955
- : ctx.translate(`${K}.valueCount`, { count: value.length });
956
- }
957
- return formatTypedValue(value, viewType, ctx);
959
+ : ctx.translate(`${K}.valueCount`, { count: value.length })
960
+ : formatTypedValue(value, viewType, ctx);
961
+ // A summarized rollup lists none of its rows: say how many it read
962
+ // (`1, from 259 rows`), so a small result over a large schedule reads right.
963
+ return node.rowCount && node.rowCount > 0
964
+ ? ctx.translate(`${K}.valueFromRows`, { value: text, count: node.rowCount })
965
+ : text;
958
966
  }
959
967
  function scheduleDetailOf(document, reference) {
960
968
  return ((reference &&
@@ -1753,7 +1761,13 @@ function toScheduleView(detail, ctx, standalone = false) {
1753
1761
  const kind = scheduleKind(detail.reference);
1754
1762
  const missingBaseline = isMissingBaseline(detail);
1755
1763
  const contributors = detail.contributors ?? [];
1756
- const counted = contributors.filter((row) => row.includedInAggregation);
1764
+ // A summary lists only some items: its counts are the totals', never the
1765
+ // list's length.
1766
+ const summary = detail.summary ?? null;
1767
+ const counted = summary
1768
+ ? summary.includedContributors
1769
+ : contributors.filter((row) => row.includedInAggregation).length;
1770
+ const total = summary ? summary.totalContributors : contributors.length;
1757
1771
  const aggregation = ['weightedAverage', 'arithmeticMean', 'empty'].includes(detail.aggregation)
1758
1772
  ? t(`aggregation.${detail.aggregation}`)
1759
1773
  : null;
@@ -1774,16 +1788,88 @@ function toScheduleView(detail, ctx, standalone = false) {
1774
1788
  method: [standalone ? null : aggregation, weighting]
1775
1789
  .filter((part) => !!part)
1776
1790
  .join(' · '),
1777
- counted: t('counted', {
1778
- counted: counted.length,
1779
- total: contributors.length,
1780
- }),
1791
+ counted: t('counted', { counted, total }),
1781
1792
  notes: (detail.notes ?? [])
1782
1793
  .map((note) => (SCHEDULE_NOTES.has(note) ? t(`note.${note}`) : null))
1783
1794
  .filter((note) => !!note),
1784
1795
  missingBaseline,
1785
1796
  weightLabel: detail.weightMode === 'workingDays' ? t('workingDays') : t('weight'),
1797
+ listed: summary
1798
+ ? t('listedOf', {
1799
+ shown: summary.shownContributors,
1800
+ total: summary.totalContributors,
1801
+ })
1802
+ : String(contributors.length),
1786
1803
  contributors: contributors.map((row) => toContributorView(row, kind, missingBaseline, ctx)),
1804
+ summary: summary
1805
+ ? toScheduleSummaryView(detail, summary, kind, missingBaseline, ctx)
1806
+ : null,
1807
+ };
1808
+ }
1809
+ /** A total as a reader sees it: sums of decimals carry float noise. */
1810
+ function totalText(value) {
1811
+ return formatExplanationNumber(Math.round(value * 100) / 100);
1812
+ }
1813
+ /**
1814
+ * A large rollup's totals in words: `Sum of progress × weight ÷ Sum of
1815
+ * weights`, each with its value, then what was counted differently and the
1816
+ * share of each kind of item. The aggregate formula itself is never shown.
1817
+ */
1818
+ function toScheduleSummaryView(detail, summary, kind, missingBaseline, ctx) {
1819
+ const t = (key, params) => ctx.translate(`${K}.schedule.${key}`, params);
1820
+ const simple = detail.aggregation === 'arithmeticMean';
1821
+ const weighted = detail.aggregation === 'weightedAverage';
1822
+ // With a simple average the totals are the sum of progress and the number
1823
+ // of items; weighted by working days, the weights are working days.
1824
+ const terms = simple
1825
+ ? ['progressSum', 'itemCount']
1826
+ : detail.weightMode === 'workingDays'
1827
+ ? ['workingDaysProgressSum', 'workingDaysSum']
1828
+ : ['weightedProgressSum', 'weightSum'];
1829
+ const counts = [];
1830
+ if (summary.zeroWeightExcludedContributors > 0) {
1831
+ counts.push(t('summaryCount.zeroWeight', {
1832
+ count: summary.zeroWeightExcludedContributors,
1833
+ }));
1834
+ }
1835
+ if (summary.missingInputContributors > 0) {
1836
+ counts.push(t(kind === 'baseline' || missingBaseline
1837
+ ? 'summaryCount.missingBaseline'
1838
+ : 'summaryCount.missingInput', { count: summary.missingInputContributors }));
1839
+ }
1840
+ const groups = summary.byModule ?? [];
1841
+ return {
1842
+ listedItems: t('listedItems', { count: summary.shownContributors }),
1843
+ totals: (simple || weighted) && summary.weightTotal > 0
1844
+ ? [
1845
+ {
1846
+ kind: 'term',
1847
+ label: t(`totals.${terms[0]}`),
1848
+ value: totalText(summary.weightedProgressTotal),
1849
+ },
1850
+ { kind: 'text', text: '÷' },
1851
+ {
1852
+ kind: 'term',
1853
+ label: t(`totals.${terms[1]}`),
1854
+ value: totalText(summary.weightTotal),
1855
+ },
1856
+ ]
1857
+ : null,
1858
+ counts,
1859
+ // One kind of item only repeats the totals.
1860
+ groups: groups.length > 1
1861
+ ? groups.map((group) => ({
1862
+ type: ITEM_TYPES.has(group.moduleKey)
1863
+ ? t(`itemType.${group.moduleKey}`)
1864
+ : humanizeKey$1(group.moduleKey),
1865
+ counted: t('listedOf', {
1866
+ shown: group.includedContributors,
1867
+ total: group.contributors,
1868
+ }),
1869
+ weight: simple ? null : totalText(group.weightTotal),
1870
+ share: t('points', { value: totalText(group.resultContribution) }),
1871
+ }))
1872
+ : [],
1787
1873
  };
1788
1874
  }
1789
1875
  function toContributorView(row, kind, missingBaseline, ctx) {
@@ -1862,6 +1948,9 @@ function buildCalculationExplanationView(explanation, target, ctx, statusNames)
1862
1948
  }
1863
1949
  : null,
1864
1950
  missingBaseline: (document.schedule ?? []).some(isMissingBaseline),
1951
+ summarized: document.completeness === 'summary'
1952
+ ? { items: summarizedItems(document) }
1953
+ : null,
1865
1954
  details,
1866
1955
  hasDetails: hasExplanationDetails(details),
1867
1956
  };
@@ -1921,6 +2010,22 @@ function summarize(document, target, ctx) {
1921
2010
  // in words, then its result.
1922
2011
  return { ...none, description: describeDocument(document, ctx) };
1923
2012
  }
2013
+ /**
2014
+ * The items a summary covers, from the totals of its rollups (a status's are
2015
+ * in its rules). Rollups in one calculation read the same schedule, so the
2016
+ * largest count is the schedule's. Null when no rollup has totals, as with a
2017
+ * status that only counts baselines: its rules say how many rows they read.
2018
+ */
2019
+ function summarizedItems(document) {
2020
+ const rollups = [
2021
+ ...(document.schedule ?? []),
2022
+ ...(document.statusRules ?? []).flatMap((rule) => rule.condition?.schedule ?? []),
2023
+ ];
2024
+ const counts = rollups
2025
+ .map((detail) => detail.summary?.totalContributors ?? 0)
2026
+ .filter((count) => count > 0);
2027
+ return counts.length ? Math.max(...counts) : null;
2028
+ }
1924
2029
  /** Records the formula's list inputs read, counted once each. */
1925
2030
  function listedRecordCount(document) {
1926
2031
  const tables = new Map();
@@ -2042,59 +2147,59 @@ class CalculationExplanationEquation {
2042
2147
  });
2043
2148
  }, ...(ngDevMode ? [{ debugName: "pieces" }] : /* istanbul ignore next */ []));
2044
2149
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationEquation, deps: [], target: i0.ɵɵFactoryTarget.Component });
2045
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationEquation, isStandalone: true, selector: "mt-calculation-explanation-equation", inputs: { segments: { classPropertyName: "segments", publicName: "segments", isSignal: true, isRequired: true, transformFunction: null }, result: { classPropertyName: "result", publicName: "result", isSignal: true, isRequired: false, transformFunction: null }, resultOperator: { classPropertyName: "resultOperator", publicName: "resultOperator", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
2046
- <div class="text-start break-words">
2047
- @for (piece of pieces(); track $index) {
2048
- @switch (piece.segment.kind) {
2049
- @case ('term') {
2050
- <bdi class="inline-block max-w-full"
2051
- ><span class="font-medium text-surface-900 dark:text-surface-0">{{
2052
- piece.segment.label
2053
- }}</span>
2054
- @if (piece.segment.value !== null) {
2055
- <!-- The leading space lives inside the text node: Angular
2056
- drops whitespace-only nodes between elements. -->
2057
- <span class="text-surface-500 dark:text-surface-400">
2058
- ({{ piece.segment.value }})</span
2059
- >
2060
- }
2061
- </bdi>
2062
- }
2063
- @case ('value') {
2064
- <bdi
2065
- class="inline-block max-w-full font-medium text-surface-800 tabular-nums dark:text-surface-100"
2066
- >{{ piece.segment.text }}</bdi
2067
- >
2068
- }
2069
- @case ('result') {
2070
- <bdi
2071
- class="inline-block max-w-full text-surface-500 dark:text-surface-400"
2072
- >→ {{ piece.segment.text }}</bdi
2073
- >
2074
- }
2075
- @case ('muted') {
2076
- <span class="text-surface-400 italic">{{
2077
- piece.segment.text
2078
- }}</span>
2079
- }
2080
- @default {
2081
- <span class="text-surface-500 dark:text-surface-400">{{
2082
- piece.segment.text
2083
- }}</span>
2084
- }
2085
- }
2086
- @if (piece.space) {
2087
- {{ ' ' }}
2088
- }
2089
- }
2090
- @if (result(); as value) {
2091
- <span class="text-surface-400"> {{ resultOperator() }} </span>
2092
- <bdi
2093
- class="inline-block max-w-full font-semibold text-surface-900 tabular-nums dark:text-surface-0"
2094
- >{{ value }}</bdi
2095
- >
2096
- }
2097
- </div>
2150
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationEquation, isStandalone: true, selector: "mt-calculation-explanation-equation", inputs: { segments: { classPropertyName: "segments", publicName: "segments", isSignal: true, isRequired: true, transformFunction: null }, result: { classPropertyName: "result", publicName: "result", isSignal: true, isRequired: false, transformFunction: null }, resultOperator: { classPropertyName: "resultOperator", publicName: "resultOperator", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
2151
+ <div class="text-start break-words">
2152
+ @for (piece of pieces(); track $index) {
2153
+ @switch (piece.segment.kind) {
2154
+ @case ('term') {
2155
+ <bdi class="inline-block max-w-full"
2156
+ ><span class="font-medium text-surface-900 dark:text-surface-0">{{
2157
+ piece.segment.label
2158
+ }}</span>
2159
+ @if (piece.segment.value !== null) {
2160
+ <!-- The leading space lives inside the text node: Angular
2161
+ drops whitespace-only nodes between elements. -->
2162
+ <span class="text-surface-500 dark:text-surface-400">
2163
+ ({{ piece.segment.value }})</span
2164
+ >
2165
+ }
2166
+ </bdi>
2167
+ }
2168
+ @case ('value') {
2169
+ <bdi
2170
+ class="inline-block max-w-full font-medium text-surface-800 tabular-nums dark:text-surface-100"
2171
+ >{{ piece.segment.text }}</bdi
2172
+ >
2173
+ }
2174
+ @case ('result') {
2175
+ <bdi
2176
+ class="inline-block max-w-full text-surface-500 dark:text-surface-400"
2177
+ >→ {{ piece.segment.text }}</bdi
2178
+ >
2179
+ }
2180
+ @case ('muted') {
2181
+ <span class="text-surface-400 italic">{{
2182
+ piece.segment.text
2183
+ }}</span>
2184
+ }
2185
+ @default {
2186
+ <span class="text-surface-500 dark:text-surface-400">{{
2187
+ piece.segment.text
2188
+ }}</span>
2189
+ }
2190
+ }
2191
+ @if (piece.space) {
2192
+ {{ ' ' }}
2193
+ }
2194
+ }
2195
+ @if (result(); as value) {
2196
+ <span class="text-surface-400"> {{ resultOperator() }} </span>
2197
+ <bdi
2198
+ class="inline-block max-w-full font-semibold text-surface-900 tabular-nums dark:text-surface-0"
2199
+ >{{ value }}</bdi
2200
+ >
2201
+ }
2202
+ </div>
2098
2203
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2099
2204
  }
2100
2205
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationEquation, decorators: [{
@@ -2102,59 +2207,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
2102
2207
  args: [{
2103
2208
  selector: 'mt-calculation-explanation-equation',
2104
2209
  changeDetection: ChangeDetectionStrategy.OnPush,
2105
- template: `
2106
- <div class="text-start break-words">
2107
- @for (piece of pieces(); track $index) {
2108
- @switch (piece.segment.kind) {
2109
- @case ('term') {
2110
- <bdi class="inline-block max-w-full"
2111
- ><span class="font-medium text-surface-900 dark:text-surface-0">{{
2112
- piece.segment.label
2113
- }}</span>
2114
- @if (piece.segment.value !== null) {
2115
- <!-- The leading space lives inside the text node: Angular
2116
- drops whitespace-only nodes between elements. -->
2117
- <span class="text-surface-500 dark:text-surface-400">
2118
- ({{ piece.segment.value }})</span
2119
- >
2120
- }
2121
- </bdi>
2122
- }
2123
- @case ('value') {
2124
- <bdi
2125
- class="inline-block max-w-full font-medium text-surface-800 tabular-nums dark:text-surface-100"
2126
- >{{ piece.segment.text }}</bdi
2127
- >
2128
- }
2129
- @case ('result') {
2130
- <bdi
2131
- class="inline-block max-w-full text-surface-500 dark:text-surface-400"
2132
- >→ {{ piece.segment.text }}</bdi
2133
- >
2134
- }
2135
- @case ('muted') {
2136
- <span class="text-surface-400 italic">{{
2137
- piece.segment.text
2138
- }}</span>
2139
- }
2140
- @default {
2141
- <span class="text-surface-500 dark:text-surface-400">{{
2142
- piece.segment.text
2143
- }}</span>
2144
- }
2145
- }
2146
- @if (piece.space) {
2147
- {{ ' ' }}
2148
- }
2149
- }
2150
- @if (result(); as value) {
2151
- <span class="text-surface-400"> {{ resultOperator() }} </span>
2152
- <bdi
2153
- class="inline-block max-w-full font-semibold text-surface-900 tabular-nums dark:text-surface-0"
2154
- >{{ value }}</bdi
2155
- >
2156
- }
2157
- </div>
2210
+ template: `
2211
+ <div class="text-start break-words">
2212
+ @for (piece of pieces(); track $index) {
2213
+ @switch (piece.segment.kind) {
2214
+ @case ('term') {
2215
+ <bdi class="inline-block max-w-full"
2216
+ ><span class="font-medium text-surface-900 dark:text-surface-0">{{
2217
+ piece.segment.label
2218
+ }}</span>
2219
+ @if (piece.segment.value !== null) {
2220
+ <!-- The leading space lives inside the text node: Angular
2221
+ drops whitespace-only nodes between elements. -->
2222
+ <span class="text-surface-500 dark:text-surface-400">
2223
+ ({{ piece.segment.value }})</span
2224
+ >
2225
+ }
2226
+ </bdi>
2227
+ }
2228
+ @case ('value') {
2229
+ <bdi
2230
+ class="inline-block max-w-full font-medium text-surface-800 tabular-nums dark:text-surface-100"
2231
+ >{{ piece.segment.text }}</bdi
2232
+ >
2233
+ }
2234
+ @case ('result') {
2235
+ <bdi
2236
+ class="inline-block max-w-full text-surface-500 dark:text-surface-400"
2237
+ >→ {{ piece.segment.text }}</bdi
2238
+ >
2239
+ }
2240
+ @case ('muted') {
2241
+ <span class="text-surface-400 italic">{{
2242
+ piece.segment.text
2243
+ }}</span>
2244
+ }
2245
+ @default {
2246
+ <span class="text-surface-500 dark:text-surface-400">{{
2247
+ piece.segment.text
2248
+ }}</span>
2249
+ }
2250
+ }
2251
+ @if (piece.space) {
2252
+ {{ ' ' }}
2253
+ }
2254
+ }
2255
+ @if (result(); as value) {
2256
+ <span class="text-surface-400"> {{ resultOperator() }} </span>
2257
+ <bdi
2258
+ class="inline-block max-w-full font-semibold text-surface-900 tabular-nums dark:text-surface-0"
2259
+ >{{ value }}</bdi
2260
+ >
2261
+ }
2262
+ </div>
2158
2263
  `,
2159
2264
  }]
2160
2265
  }], propDecorators: { segments: [{ type: i0.Input, args: [{ isSignal: true, alias: "segments", required: true }] }], result: [{ type: i0.Input, args: [{ isSignal: true, alias: "result", required: false }] }], resultOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "resultOperator", required: false }] }] } });
@@ -2180,42 +2285,42 @@ class CalculationExplanationChecks {
2180
2285
  return met === null ? 'notChecked' : met ? 'met' : 'notMet';
2181
2286
  }
2182
2287
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationChecks, deps: [], target: i0.ɵɵFactoryTarget.Component });
2183
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationChecks, isStandalone: true, selector: "mt-calculation-explanation-checks", inputs: { checks: { classPropertyName: "checks", publicName: "checks", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
2184
- <ng-template #list let-checks>
2185
- <ul class="flex flex-col gap-1">
2186
- @for (check of checks; track $index) {
2187
- @let mark = markOf(check.met);
2188
- <li class="flex items-start gap-2">
2189
- <span
2190
- class="mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-full text-[10px] leading-none font-bold"
2191
- [class]="marks[mark].class"
2192
- role="img"
2193
- [attr.aria-label]="prefix + '.check.' + mark | transloco"
2194
- >{{ marks[mark].text }}</span
2195
- >
2196
- <div class="flex min-w-0 flex-1 flex-col gap-1">
2197
- @if (check.anyOf; as options) {
2198
- <span class="text-surface-600 dark:text-surface-300">{{
2199
- prefix + '.check.anyOf' | transloco
2200
- }}</span>
2201
- <ng-container
2202
- [ngTemplateOutlet]="list"
2203
- [ngTemplateOutletContext]="{ $implicit: options }"
2204
- />
2205
- } @else {
2206
- <mt-calculation-explanation-equation
2207
- [segments]="check.segments"
2208
- />
2209
- }
2210
- </div>
2211
- </li>
2212
- }
2213
- </ul>
2214
- </ng-template>
2215
- <ng-container
2216
- [ngTemplateOutlet]="list"
2217
- [ngTemplateOutletContext]="{ $implicit: checks() }"
2218
- />
2288
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationChecks, isStandalone: true, selector: "mt-calculation-explanation-checks", inputs: { checks: { classPropertyName: "checks", publicName: "checks", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
2289
+ <ng-template #list let-checks>
2290
+ <ul class="flex flex-col gap-1">
2291
+ @for (check of checks; track $index) {
2292
+ @let mark = markOf(check.met);
2293
+ <li class="flex items-start gap-2">
2294
+ <span
2295
+ class="mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-full text-[10px] leading-none font-bold"
2296
+ [class]="marks[mark].class"
2297
+ role="img"
2298
+ [attr.aria-label]="prefix + '.check.' + mark | transloco"
2299
+ >{{ marks[mark].text }}</span
2300
+ >
2301
+ <div class="flex min-w-0 flex-1 flex-col gap-1">
2302
+ @if (check.anyOf; as options) {
2303
+ <span class="text-surface-600 dark:text-surface-300">{{
2304
+ prefix + '.check.anyOf' | transloco
2305
+ }}</span>
2306
+ <ng-container
2307
+ [ngTemplateOutlet]="list"
2308
+ [ngTemplateOutletContext]="{ $implicit: options }"
2309
+ />
2310
+ } @else {
2311
+ <mt-calculation-explanation-equation
2312
+ [segments]="check.segments"
2313
+ />
2314
+ }
2315
+ </div>
2316
+ </li>
2317
+ }
2318
+ </ul>
2319
+ </ng-template>
2320
+ <ng-container
2321
+ [ngTemplateOutlet]="list"
2322
+ [ngTemplateOutletContext]="{ $implicit: checks() }"
2323
+ />
2219
2324
  `, isInline: true, dependencies: [{ kind: "component", type: CalculationExplanationEquation, selector: "mt-calculation-explanation-equation", inputs: ["segments", "result", "resultOperator"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2220
2325
  }
2221
2326
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationChecks, decorators: [{
@@ -2224,42 +2329,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
2224
2329
  selector: 'mt-calculation-explanation-checks',
2225
2330
  changeDetection: ChangeDetectionStrategy.OnPush,
2226
2331
  imports: [CalculationExplanationEquation, NgTemplateOutlet, TranslocoPipe],
2227
- template: `
2228
- <ng-template #list let-checks>
2229
- <ul class="flex flex-col gap-1">
2230
- @for (check of checks; track $index) {
2231
- @let mark = markOf(check.met);
2232
- <li class="flex items-start gap-2">
2233
- <span
2234
- class="mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-full text-[10px] leading-none font-bold"
2235
- [class]="marks[mark].class"
2236
- role="img"
2237
- [attr.aria-label]="prefix + '.check.' + mark | transloco"
2238
- >{{ marks[mark].text }}</span
2239
- >
2240
- <div class="flex min-w-0 flex-1 flex-col gap-1">
2241
- @if (check.anyOf; as options) {
2242
- <span class="text-surface-600 dark:text-surface-300">{{
2243
- prefix + '.check.anyOf' | transloco
2244
- }}</span>
2245
- <ng-container
2246
- [ngTemplateOutlet]="list"
2247
- [ngTemplateOutletContext]="{ $implicit: options }"
2248
- />
2249
- } @else {
2250
- <mt-calculation-explanation-equation
2251
- [segments]="check.segments"
2252
- />
2253
- }
2254
- </div>
2255
- </li>
2256
- }
2257
- </ul>
2258
- </ng-template>
2259
- <ng-container
2260
- [ngTemplateOutlet]="list"
2261
- [ngTemplateOutletContext]="{ $implicit: checks() }"
2262
- />
2332
+ template: `
2333
+ <ng-template #list let-checks>
2334
+ <ul class="flex flex-col gap-1">
2335
+ @for (check of checks; track $index) {
2336
+ @let mark = markOf(check.met);
2337
+ <li class="flex items-start gap-2">
2338
+ <span
2339
+ class="mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-full text-[10px] leading-none font-bold"
2340
+ [class]="marks[mark].class"
2341
+ role="img"
2342
+ [attr.aria-label]="prefix + '.check.' + mark | transloco"
2343
+ >{{ marks[mark].text }}</span
2344
+ >
2345
+ <div class="flex min-w-0 flex-1 flex-col gap-1">
2346
+ @if (check.anyOf; as options) {
2347
+ <span class="text-surface-600 dark:text-surface-300">{{
2348
+ prefix + '.check.anyOf' | transloco
2349
+ }}</span>
2350
+ <ng-container
2351
+ [ngTemplateOutlet]="list"
2352
+ [ngTemplateOutletContext]="{ $implicit: options }"
2353
+ />
2354
+ } @else {
2355
+ <mt-calculation-explanation-equation
2356
+ [segments]="check.segments"
2357
+ />
2358
+ }
2359
+ </div>
2360
+ </li>
2361
+ }
2362
+ </ul>
2363
+ </ng-template>
2364
+ <ng-container
2365
+ [ngTemplateOutlet]="list"
2366
+ [ngTemplateOutletContext]="{ $implicit: checks() }"
2367
+ />
2263
2368
  `,
2264
2369
  }]
2265
2370
  }], propDecorators: { checks: [{ type: i0.Input, args: [{ isSignal: true, alias: "checks", required: true }] }] } });
@@ -2272,94 +2377,112 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
2272
2377
  */
2273
2378
  class CalculationExplanationSummary {
2274
2379
  view = input.required(...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
2380
+ /**
2381
+ * Whether to say a summarized calculation is a summary. The details panel
2382
+ * does, above the totals and the few items it lists; the tooltip does not.
2383
+ */
2384
+ summaryNotice = input(false, ...(ngDevMode ? [{ debugName: "summaryNotice" }] : /* istanbul ignore next */ []));
2275
2385
  prefix = CALCULATION_EXPLANATION_KEYS;
2276
2386
  empty = [];
2277
2387
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationSummary, deps: [], target: i0.ɵɵFactoryTarget.Component });
2278
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationSummary, isStandalone: true, selector: "mt-calculation-explanation-summary", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
2279
- @let v = view();
2280
- <div class="flex flex-col gap-2">
2281
- <div
2282
- class="flex flex-col gap-1.5 rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-surface-800 dark:border-surface-700 dark:bg-surface-800 dark:text-surface-100"
2283
- >
2284
- @if (v.summary.status; as status) {
2285
- <bdi class="font-semibold text-surface-900 dark:text-surface-0">{{
2286
- v.result
2287
- }}</bdi>
2288
- <span class="text-xs text-surface-500 dark:text-surface-400">
2289
- {{
2290
- prefix + '.statusSelected'
2291
- | transloco: { position: status.position, total: status.total }
2292
- }}
2293
- </span>
2294
- @if (status.checks; as checks) {
2295
- <mt-calculation-explanation-checks
2296
- class="text-xs"
2297
- [checks]="checks"
2298
- />
2299
- } @else if (status.condition; as condition) {
2300
- <mt-calculation-explanation-equation
2301
- class="text-xs"
2302
- [segments]="condition"
2303
- />
2304
- }
2305
- } @else if (v.summary.noRuleMatched) {
2306
- <span>{{
2307
- prefix + '.noRuleMatched' | transloco: { status: v.result }
2308
- }}</span>
2309
- } @else {
2310
- @if (v.summary.labels; as labels) {
2311
- <mt-calculation-explanation-equation [segments]="labels" />
2312
- }
2313
- @if (v.summary.description; as description) {
2314
- <p class="break-words">{{ description }}</p>
2315
- }
2316
- @if (v.summary.values; as values) {
2317
- <mt-calculation-explanation-equation
2318
- [segments]="values"
2319
- [result]="v.result"
2320
- />
2321
- } @else {
2322
- <mt-calculation-explanation-equation
2323
- [segments]="empty"
2324
- [result]="v.result"
2325
- />
2326
- }
2327
- @if (v.summary.recordCount; as count) {
2328
- <span class="text-xs text-surface-500 dark:text-surface-400">{{
2329
- prefix + '.recordsUsed' | transloco: { count }
2330
- }}</span>
2331
- }
2332
- }
2333
- </div>
2334
- @if (v.missingBaseline) {
2335
- <div
2336
- class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2337
- >
2338
- {{ prefix + '.missingBaseline' | transloco }}
2339
- </div>
2340
- }
2341
- @if (v.differs; as differs) {
2342
- <div
2343
- class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2344
- >
2345
- {{ prefix + '.differsFromPage' | transloco: differs }}
2346
- </div>
2347
- }
2348
- @if (v.definitionChanged) {
2349
- <div
2350
- class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2351
- >
2352
- {{ prefix + '.definitionChanged' | transloco }}
2353
- </div>
2354
- }
2355
- @if (v.refreshed) {
2356
- <div
2357
- class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2358
- >
2359
- {{ prefix + '.valueRefreshed' | transloco }}
2360
- </div>
2361
- }
2362
- </div>
2388
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationSummary, isStandalone: true, selector: "mt-calculation-explanation-summary", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: true, transformFunction: null }, summaryNotice: { classPropertyName: "summaryNotice", publicName: "summaryNotice", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
2389
+ @let v = view();
2390
+ <div class="flex flex-col gap-2">
2391
+ <div
2392
+ class="flex flex-col gap-1.5 rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-surface-800 dark:border-surface-700 dark:bg-surface-800 dark:text-surface-100"
2393
+ >
2394
+ @if (v.summary.status; as status) {
2395
+ <bdi class="font-semibold text-surface-900 dark:text-surface-0">{{
2396
+ v.result
2397
+ }}</bdi>
2398
+ <span class="text-xs text-surface-500 dark:text-surface-400">
2399
+ {{
2400
+ prefix + '.statusSelected'
2401
+ | transloco: { position: status.position, total: status.total }
2402
+ }}
2403
+ </span>
2404
+ @if (status.checks; as checks) {
2405
+ <mt-calculation-explanation-checks
2406
+ class="text-xs"
2407
+ [checks]="checks"
2408
+ />
2409
+ } @else if (status.condition; as condition) {
2410
+ <mt-calculation-explanation-equation
2411
+ class="text-xs"
2412
+ [segments]="condition"
2413
+ />
2414
+ }
2415
+ } @else if (v.summary.noRuleMatched) {
2416
+ <span>{{
2417
+ prefix + '.noRuleMatched' | transloco: { status: v.result }
2418
+ }}</span>
2419
+ } @else {
2420
+ @if (v.summary.labels; as labels) {
2421
+ <mt-calculation-explanation-equation [segments]="labels" />
2422
+ }
2423
+ @if (v.summary.description; as description) {
2424
+ <p class="break-words">{{ description }}</p>
2425
+ }
2426
+ @if (v.summary.values; as values) {
2427
+ <mt-calculation-explanation-equation
2428
+ [segments]="values"
2429
+ [result]="v.result"
2430
+ />
2431
+ } @else {
2432
+ <mt-calculation-explanation-equation
2433
+ [segments]="empty"
2434
+ [result]="v.result"
2435
+ />
2436
+ }
2437
+ @if (v.summary.recordCount; as count) {
2438
+ <span class="text-xs text-surface-500 dark:text-surface-400">{{
2439
+ prefix + '.recordsUsed' | transloco: { count }
2440
+ }}</span>
2441
+ }
2442
+ }
2443
+ </div>
2444
+ <!-- Never read as the full list: the totals cover every item, the
2445
+ details list only some. Only where those details are shown. -->
2446
+ @if (summaryNotice() && v.summarized; as summarized) {
2447
+ <div
2448
+ class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2449
+ >
2450
+ @if (summarized.items; as count) {
2451
+ {{ prefix + '.summarized' | transloco: { count } }}
2452
+ } @else {
2453
+ {{ prefix + '.summarizedGeneric' | transloco }}
2454
+ }
2455
+ </div>
2456
+ }
2457
+ @if (v.missingBaseline) {
2458
+ <div
2459
+ class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2460
+ >
2461
+ {{ prefix + '.missingBaseline' | transloco }}
2462
+ </div>
2463
+ }
2464
+ @if (v.differs; as differs) {
2465
+ <div
2466
+ class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2467
+ >
2468
+ {{ prefix + '.differsFromPage' | transloco: differs }}
2469
+ </div>
2470
+ }
2471
+ @if (v.definitionChanged) {
2472
+ <div
2473
+ class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2474
+ >
2475
+ {{ prefix + '.definitionChanged' | transloco }}
2476
+ </div>
2477
+ }
2478
+ @if (v.refreshed) {
2479
+ <div
2480
+ class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2481
+ >
2482
+ {{ prefix + '.valueRefreshed' | transloco }}
2483
+ </div>
2484
+ }
2485
+ </div>
2363
2486
  `, isInline: true, dependencies: [{ kind: "component", type: CalculationExplanationChecks, selector: "mt-calculation-explanation-checks", inputs: ["checks"] }, { kind: "component", type: CalculationExplanationEquation, selector: "mt-calculation-explanation-equation", inputs: ["segments", "result", "resultOperator"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2364
2487
  }
2365
2488
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationSummary, decorators: [{
@@ -2372,94 +2495,107 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
2372
2495
  CalculationExplanationEquation,
2373
2496
  TranslocoPipe,
2374
2497
  ],
2375
- template: `
2376
- @let v = view();
2377
- <div class="flex flex-col gap-2">
2378
- <div
2379
- class="flex flex-col gap-1.5 rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-surface-800 dark:border-surface-700 dark:bg-surface-800 dark:text-surface-100"
2380
- >
2381
- @if (v.summary.status; as status) {
2382
- <bdi class="font-semibold text-surface-900 dark:text-surface-0">{{
2383
- v.result
2384
- }}</bdi>
2385
- <span class="text-xs text-surface-500 dark:text-surface-400">
2386
- {{
2387
- prefix + '.statusSelected'
2388
- | transloco: { position: status.position, total: status.total }
2389
- }}
2390
- </span>
2391
- @if (status.checks; as checks) {
2392
- <mt-calculation-explanation-checks
2393
- class="text-xs"
2394
- [checks]="checks"
2395
- />
2396
- } @else if (status.condition; as condition) {
2397
- <mt-calculation-explanation-equation
2398
- class="text-xs"
2399
- [segments]="condition"
2400
- />
2401
- }
2402
- } @else if (v.summary.noRuleMatched) {
2403
- <span>{{
2404
- prefix + '.noRuleMatched' | transloco: { status: v.result }
2405
- }}</span>
2406
- } @else {
2407
- @if (v.summary.labels; as labels) {
2408
- <mt-calculation-explanation-equation [segments]="labels" />
2409
- }
2410
- @if (v.summary.description; as description) {
2411
- <p class="break-words">{{ description }}</p>
2412
- }
2413
- @if (v.summary.values; as values) {
2414
- <mt-calculation-explanation-equation
2415
- [segments]="values"
2416
- [result]="v.result"
2417
- />
2418
- } @else {
2419
- <mt-calculation-explanation-equation
2420
- [segments]="empty"
2421
- [result]="v.result"
2422
- />
2423
- }
2424
- @if (v.summary.recordCount; as count) {
2425
- <span class="text-xs text-surface-500 dark:text-surface-400">{{
2426
- prefix + '.recordsUsed' | transloco: { count }
2427
- }}</span>
2428
- }
2429
- }
2430
- </div>
2431
- @if (v.missingBaseline) {
2432
- <div
2433
- class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2434
- >
2435
- {{ prefix + '.missingBaseline' | transloco }}
2436
- </div>
2437
- }
2438
- @if (v.differs; as differs) {
2439
- <div
2440
- class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2441
- >
2442
- {{ prefix + '.differsFromPage' | transloco: differs }}
2443
- </div>
2444
- }
2445
- @if (v.definitionChanged) {
2446
- <div
2447
- class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2448
- >
2449
- {{ prefix + '.definitionChanged' | transloco }}
2450
- </div>
2451
- }
2452
- @if (v.refreshed) {
2453
- <div
2454
- class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2455
- >
2456
- {{ prefix + '.valueRefreshed' | transloco }}
2457
- </div>
2458
- }
2459
- </div>
2498
+ template: `
2499
+ @let v = view();
2500
+ <div class="flex flex-col gap-2">
2501
+ <div
2502
+ class="flex flex-col gap-1.5 rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-surface-800 dark:border-surface-700 dark:bg-surface-800 dark:text-surface-100"
2503
+ >
2504
+ @if (v.summary.status; as status) {
2505
+ <bdi class="font-semibold text-surface-900 dark:text-surface-0">{{
2506
+ v.result
2507
+ }}</bdi>
2508
+ <span class="text-xs text-surface-500 dark:text-surface-400">
2509
+ {{
2510
+ prefix + '.statusSelected'
2511
+ | transloco: { position: status.position, total: status.total }
2512
+ }}
2513
+ </span>
2514
+ @if (status.checks; as checks) {
2515
+ <mt-calculation-explanation-checks
2516
+ class="text-xs"
2517
+ [checks]="checks"
2518
+ />
2519
+ } @else if (status.condition; as condition) {
2520
+ <mt-calculation-explanation-equation
2521
+ class="text-xs"
2522
+ [segments]="condition"
2523
+ />
2524
+ }
2525
+ } @else if (v.summary.noRuleMatched) {
2526
+ <span>{{
2527
+ prefix + '.noRuleMatched' | transloco: { status: v.result }
2528
+ }}</span>
2529
+ } @else {
2530
+ @if (v.summary.labels; as labels) {
2531
+ <mt-calculation-explanation-equation [segments]="labels" />
2532
+ }
2533
+ @if (v.summary.description; as description) {
2534
+ <p class="break-words">{{ description }}</p>
2535
+ }
2536
+ @if (v.summary.values; as values) {
2537
+ <mt-calculation-explanation-equation
2538
+ [segments]="values"
2539
+ [result]="v.result"
2540
+ />
2541
+ } @else {
2542
+ <mt-calculation-explanation-equation
2543
+ [segments]="empty"
2544
+ [result]="v.result"
2545
+ />
2546
+ }
2547
+ @if (v.summary.recordCount; as count) {
2548
+ <span class="text-xs text-surface-500 dark:text-surface-400">{{
2549
+ prefix + '.recordsUsed' | transloco: { count }
2550
+ }}</span>
2551
+ }
2552
+ }
2553
+ </div>
2554
+ <!-- Never read as the full list: the totals cover every item, the
2555
+ details list only some. Only where those details are shown. -->
2556
+ @if (summaryNotice() && v.summarized; as summarized) {
2557
+ <div
2558
+ class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2559
+ >
2560
+ @if (summarized.items; as count) {
2561
+ {{ prefix + '.summarized' | transloco: { count } }}
2562
+ } @else {
2563
+ {{ prefix + '.summarizedGeneric' | transloco }}
2564
+ }
2565
+ </div>
2566
+ }
2567
+ @if (v.missingBaseline) {
2568
+ <div
2569
+ class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2570
+ >
2571
+ {{ prefix + '.missingBaseline' | transloco }}
2572
+ </div>
2573
+ }
2574
+ @if (v.differs; as differs) {
2575
+ <div
2576
+ class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2577
+ >
2578
+ {{ prefix + '.differsFromPage' | transloco: differs }}
2579
+ </div>
2580
+ }
2581
+ @if (v.definitionChanged) {
2582
+ <div
2583
+ class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2584
+ >
2585
+ {{ prefix + '.definitionChanged' | transloco }}
2586
+ </div>
2587
+ }
2588
+ @if (v.refreshed) {
2589
+ <div
2590
+ class="rounded-md border border-primary-200 bg-primary-50 px-3 py-2 text-xs text-primary-700"
2591
+ >
2592
+ {{ prefix + '.valueRefreshed' | transloco }}
2593
+ </div>
2594
+ }
2595
+ </div>
2460
2596
  `,
2461
2597
  }]
2462
- }], propDecorators: { view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: true }] }] } });
2598
+ }], propDecorators: { view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: true }] }], summaryNotice: [{ type: i0.Input, args: [{ isSignal: true, alias: "summaryNotice", required: false }] }] } });
2463
2599
 
2464
2600
  /**
2465
2601
  * A part of the details panel the reader can fold: its title (and a count)
@@ -2474,36 +2610,36 @@ class CalculationExplanationSection {
2474
2610
  /** Whether it starts open. */
2475
2611
  open = input(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
2476
2612
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationSection, deps: [], target: i0.ɵɵFactoryTarget.Component });
2477
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationSection, isStandalone: true, selector: "mt-calculation-explanation-section", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, aside: { classPropertyName: "aside", publicName: "aside", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
2478
- <details
2479
- class="group rounded-md border border-surface-200 dark:border-surface-700"
2480
- [open]="open()"
2481
- >
2482
- <summary
2483
- class="flex cursor-pointer list-none items-center gap-2 rounded-md px-3 py-2 select-none hover:bg-surface-50 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500 dark:hover:bg-surface-800 [&::-webkit-details-marker]:hidden"
2484
- >
2485
- <mt-icon
2486
- icon="arrow.chevron-right"
2487
- size="xs"
2488
- class="shrink-0 text-surface-500 transition-transform group-open:rotate-90 rtl:rotate-180 dark:text-surface-400"
2489
- />
2490
- <span
2491
- class="min-w-0 flex-1 font-semibold text-surface-900 dark:text-surface-0"
2492
- >{{ title() }}</span
2493
- >
2494
- @if (aside(); as text) {
2495
- <span
2496
- class="shrink-0 text-xs text-surface-500 tabular-nums dark:text-surface-400"
2497
- >{{ text }}</span
2498
- >
2499
- }
2500
- </summary>
2501
- <div
2502
- class="flex flex-col gap-2 border-t border-surface-200 px-3 py-2 dark:border-surface-700"
2503
- >
2504
- <ng-content />
2505
- </div>
2506
- </details>
2613
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationSection, isStandalone: true, selector: "mt-calculation-explanation-section", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, aside: { classPropertyName: "aside", publicName: "aside", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
2614
+ <details
2615
+ class="group rounded-md border border-surface-200 dark:border-surface-700"
2616
+ [open]="open()"
2617
+ >
2618
+ <summary
2619
+ class="flex cursor-pointer list-none items-center gap-2 rounded-md px-3 py-2 select-none hover:bg-surface-50 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500 dark:hover:bg-surface-800 [&::-webkit-details-marker]:hidden"
2620
+ >
2621
+ <mt-icon
2622
+ icon="arrow.chevron-right"
2623
+ size="xs"
2624
+ class="shrink-0 text-surface-500 transition-transform group-open:rotate-90 rtl:rotate-180 dark:text-surface-400"
2625
+ />
2626
+ <span
2627
+ class="min-w-0 flex-1 font-semibold text-surface-900 dark:text-surface-0"
2628
+ >{{ title() }}</span
2629
+ >
2630
+ @if (aside(); as text) {
2631
+ <span
2632
+ class="shrink-0 text-xs text-surface-500 tabular-nums dark:text-surface-400"
2633
+ >{{ text }}</span
2634
+ >
2635
+ }
2636
+ </summary>
2637
+ <div
2638
+ class="flex flex-col gap-2 border-t border-surface-200 px-3 py-2 dark:border-surface-700"
2639
+ >
2640
+ <ng-content />
2641
+ </div>
2642
+ </details>
2507
2643
  `, isInline: true, dependencies: [{ kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2508
2644
  }
2509
2645
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationSection, decorators: [{
@@ -2512,36 +2648,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
2512
2648
  selector: 'mt-calculation-explanation-section',
2513
2649
  changeDetection: ChangeDetectionStrategy.OnPush,
2514
2650
  imports: [Icon],
2515
- template: `
2516
- <details
2517
- class="group rounded-md border border-surface-200 dark:border-surface-700"
2518
- [open]="open()"
2519
- >
2520
- <summary
2521
- class="flex cursor-pointer list-none items-center gap-2 rounded-md px-3 py-2 select-none hover:bg-surface-50 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500 dark:hover:bg-surface-800 [&::-webkit-details-marker]:hidden"
2522
- >
2523
- <mt-icon
2524
- icon="arrow.chevron-right"
2525
- size="xs"
2526
- class="shrink-0 text-surface-500 transition-transform group-open:rotate-90 rtl:rotate-180 dark:text-surface-400"
2527
- />
2528
- <span
2529
- class="min-w-0 flex-1 font-semibold text-surface-900 dark:text-surface-0"
2530
- >{{ title() }}</span
2531
- >
2532
- @if (aside(); as text) {
2533
- <span
2534
- class="shrink-0 text-xs text-surface-500 tabular-nums dark:text-surface-400"
2535
- >{{ text }}</span
2536
- >
2537
- }
2538
- </summary>
2539
- <div
2540
- class="flex flex-col gap-2 border-t border-surface-200 px-3 py-2 dark:border-surface-700"
2541
- >
2542
- <ng-content />
2543
- </div>
2544
- </details>
2651
+ template: `
2652
+ <details
2653
+ class="group rounded-md border border-surface-200 dark:border-surface-700"
2654
+ [open]="open()"
2655
+ >
2656
+ <summary
2657
+ class="flex cursor-pointer list-none items-center gap-2 rounded-md px-3 py-2 select-none hover:bg-surface-50 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500 dark:hover:bg-surface-800 [&::-webkit-details-marker]:hidden"
2658
+ >
2659
+ <mt-icon
2660
+ icon="arrow.chevron-right"
2661
+ size="xs"
2662
+ class="shrink-0 text-surface-500 transition-transform group-open:rotate-90 rtl:rotate-180 dark:text-surface-400"
2663
+ />
2664
+ <span
2665
+ class="min-w-0 flex-1 font-semibold text-surface-900 dark:text-surface-0"
2666
+ >{{ title() }}</span
2667
+ >
2668
+ @if (aside(); as text) {
2669
+ <span
2670
+ class="shrink-0 text-xs text-surface-500 tabular-nums dark:text-surface-400"
2671
+ >{{ text }}</span
2672
+ >
2673
+ }
2674
+ </summary>
2675
+ <div
2676
+ class="flex flex-col gap-2 border-t border-surface-200 px-3 py-2 dark:border-surface-700"
2677
+ >
2678
+ <ng-content />
2679
+ </div>
2680
+ </details>
2545
2681
  `,
2546
2682
  }]
2547
2683
  }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], aside: [{ type: i0.Input, args: [{ isSignal: true, alias: "aside", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }] } });
@@ -2553,7 +2689,8 @@ const OPEN_ROWS = 10;
2553
2689
  * summary. Each part folds, so a long status or schedule reads as a short
2554
2690
  * list of titles first: records behind list inputs (by name), intermediate
2555
2691
  * results, status rules (one row each, opening to their checklist), schedule
2556
- * rollups with their items, generated-code parts
2692
+ * rollups with their items (a large one in totals, with only its
2693
+ * highest-weight items listed), generated-code parts
2557
2694
  * and native facts. Everything is the backend's captured data in business
2558
2695
  * wording; nothing is recalculated here.
2559
2696
  */
@@ -2582,408 +2719,481 @@ class CalculationExplanationDetails {
2582
2719
  return name || this.fallbackLabel()(index + 1);
2583
2720
  }
2584
2721
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationDetails, deps: [], target: i0.ɵɵFactoryTarget.Component });
2585
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationDetails, isStandalone: true, selector: "mt-calculation-explanation-details", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, recordNames: { classPropertyName: "recordNames", publicName: "recordNames", isSignal: true, isRequired: false, transformFunction: null }, fallbackLabel: { classPropertyName: "fallbackLabel", publicName: "fallbackLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
2586
- <!-- A record by its title, a placeholder while titles are read, or a
2587
- generic label; never its id. -->
2588
- <ng-template #recordName let-ref let-n="n">
2589
- @if (recordNames() === null) {
2590
- <span
2591
- class="inline-block h-3 w-24 animate-pulse rounded-md bg-surface-100 align-middle dark:bg-surface-800"
2592
- aria-busy="true"
2593
- ></span>
2594
- } @else {
2595
- <bdi class="break-words">{{ nameOf(ref, n) }}</bdi>
2596
- }
2597
- </ng-template>
2598
-
2599
- <ng-template #dataTpl let-data>
2600
- @switch (data.kind) {
2601
- @case ('text') {
2602
- <bdi class="break-words">{{ data.text }}</bdi>
2603
- }
2604
- @case ('list') {
2605
- <bdi class="break-words">{{ data.items.join(', ') }}</bdi>
2606
- }
2607
- @case ('table') {
2608
- <div class="overflow-x-auto">
2609
- <table class="w-full text-xs tabular-nums">
2610
- <thead>
2611
- <tr class="text-surface-500 dark:text-surface-400">
2612
- @for (column of data.columns; track $index) {
2613
- <th class="px-2 py-1 text-start font-medium">
2614
- {{ column }}
2615
- </th>
2616
- }
2617
- </tr>
2618
- </thead>
2619
- <tbody>
2620
- @for (row of data.rows; track $index) {
2621
- <tr
2622
- class="border-t border-surface-200 dark:border-surface-700"
2623
- >
2624
- @for (cell of row; track $index) {
2625
- <td class="px-2 py-1 align-top break-words">
2626
- <bdi>{{ cell }}</bdi>
2627
- </td>
2628
- }
2629
- </tr>
2630
- }
2631
- </tbody>
2632
- </table>
2633
- @if (data.more > 0) {
2634
- <p class="mt-1 text-surface-500 dark:text-surface-400">
2635
- {{ prefix + '.moreRows' | transloco: { count: data.more } }}
2636
- </p>
2637
- }
2638
- </div>
2639
- }
2640
- @case ('fields') {
2641
- <dl
2642
- class="grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-3 gap-y-1"
2643
- >
2644
- @for (field of data.fields; track $index) {
2645
- <dt class="text-surface-500 dark:text-surface-400">
2646
- {{ field.label }}
2647
- </dt>
2648
- <dd class="ms-0 min-w-0">
2649
- <ng-container
2650
- [ngTemplateOutlet]="dataTpl"
2651
- [ngTemplateOutletContext]="{ $implicit: field.data }"
2652
- />
2653
- </dd>
2654
- }
2655
- </dl>
2656
- }
2657
- }
2658
- </ng-template>
2659
-
2660
- @let view = details();
2661
- <div
2662
- class="flex flex-col gap-3 text-sm text-surface-700 dark:text-surface-200"
2663
- >
2664
- @if (view.description) {
2665
- <p>{{ view.description }}</p>
2666
- }
2667
-
2668
- @if (view.values.length) {
2669
- <mt-calculation-explanation-section
2670
- [title]="prefix + '.valuesUsed' | transloco"
2671
- [aside]="'' + view.values.length"
2672
- [open]="true"
2673
- >
2674
- <dl class="grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 gap-y-1">
2675
- @for (item of view.values; track $index) {
2676
- <dt class="min-w-0 break-words">
2677
- <bdi>{{ item.label }}</bdi>
2678
- </dt>
2679
- <dd class="ms-0 text-end font-medium tabular-nums">
2680
- <bdi>{{ item.value }}</bdi>
2681
- </dd>
2682
- }
2683
- </dl>
2684
- </mt-calculation-explanation-section>
2685
- }
2686
-
2687
- @for (table of view.records; track $index) {
2688
- <mt-calculation-explanation-section
2689
- [title]="prefix + '.contributingRecords' | transloco"
2690
- [aside]="'' + table.rows.length"
2691
- [open]="table.rows.length <= openRows"
2692
- >
2693
- <div class="overflow-x-auto">
2694
- <table class="w-full tabular-nums">
2695
- <thead>
2696
- <tr class="text-xs text-surface-500 dark:text-surface-400">
2697
- <th class="py-1 pe-3 text-start font-medium">
2698
- {{ prefix + '.record' | transloco }}
2699
- </th>
2700
- @for (column of table.columns; track $index) {
2701
- <th class="py-1 ps-3 text-end font-medium">
2702
- {{ column }}
2703
- </th>
2704
- }
2705
- </tr>
2706
- </thead>
2707
- <tbody>
2708
- @for (row of table.rows; track $index; let n = $index) {
2709
- <tr
2710
- class="border-t border-surface-200 dark:border-surface-700"
2711
- >
2712
- <td class="py-1.5 pe-3 break-words">
2713
- <ng-container
2714
- [ngTemplateOutlet]="recordName"
2715
- [ngTemplateOutletContext]="{ $implicit: row.ref, n }"
2716
- />
2717
- </td>
2718
- @for (cell of row.cells; track $index) {
2719
- <td class="py-1.5 ps-3 text-end">
2720
- <bdi>{{ cell }}</bdi>
2721
- </td>
2722
- }
2723
- </tr>
2724
- }
2725
- </tbody>
2726
- </table>
2727
- </div>
2728
- </mt-calculation-explanation-section>
2729
- }
2730
-
2731
- @if (view.steps.length) {
2732
- <mt-calculation-explanation-section
2733
- [title]="prefix + '.steps' | transloco"
2734
- [aside]="'' + view.steps.length"
2735
- >
2736
- <ul class="flex flex-col gap-1.5">
2737
- @for (step of view.steps; track $index) {
2738
- <li>
2739
- <mt-calculation-explanation-equation
2740
- [segments]="step.segments"
2741
- [result]="step.result"
2742
- />
2743
- </li>
2744
- }
2745
- </ul>
2746
- </mt-calculation-explanation-section>
2747
- }
2748
-
2749
- @if (view.statusRules.length) {
2750
- <mt-calculation-explanation-section
2751
- [title]="prefix + '.statusRules' | transloco"
2752
- [aside]="'' + view.statusRules.length"
2753
- [open]="true"
2754
- >
2755
- <!-- One row per rule, in the order they are checked; a row opens
2756
- to the parts its condition required. -->
2757
- <ol class="flex flex-col gap-1">
2758
- @for (rule of view.statusRules; track rule.key) {
2759
- <li>
2760
- <details
2761
- class="group/rule rounded-md"
2762
- [class]="
2763
- rule.verdict === 'selected'
2764
- ? 'bg-primary-50 dark:bg-primary-950'
2765
- : ''
2766
- "
2767
- >
2768
- <summary
2769
- class="flex cursor-pointer list-none items-center gap-2 rounded-md px-2 py-1.5 select-none hover:bg-surface-50 focus-visible:outline-2 focus-visible:outline-primary-500 dark:hover:bg-surface-800 [&::-webkit-details-marker]:hidden"
2770
- >
2771
- <mt-icon
2772
- icon="arrow.chevron-right"
2773
- size="xs"
2774
- class="shrink-0 text-surface-400 transition-transform group-open/rule:rotate-90 rtl:rotate-180"
2775
- />
2776
- <span
2777
- class="shrink-0 text-xs text-surface-500 tabular-nums dark:text-surface-400"
2778
- >{{ rule.position }}.</span
2779
- >
2780
- <bdi class="min-w-0 flex-1 font-medium">{{
2781
- rule.name
2782
- }}</bdi>
2783
- <span
2784
- class="shrink-0 rounded-md px-1.5 py-0.5 text-xs"
2785
- [class]="verdictClass[rule.verdict]"
2786
- >
2787
- {{ prefix + '.verdict.' + rule.verdict | transloco }}
2788
- </span>
2789
- </summary>
2790
- <div class="px-2 pt-1 pb-2 ps-8">
2791
- @if (rule.checks; as checks) {
2792
- <mt-calculation-explanation-checks
2793
- class="text-xs"
2794
- [checks]="checks"
2795
- />
2796
- } @else if (rule.segments; as segments) {
2797
- <mt-calculation-explanation-equation
2798
- class="text-xs"
2799
- [segments]="segments"
2800
- />
2801
- }
2802
- </div>
2803
- </details>
2804
- </li>
2805
- }
2806
- </ol>
2807
- </mt-calculation-explanation-section>
2808
- }
2809
-
2810
- @for (detail of view.schedule; track $index) {
2811
- <section class="flex flex-col gap-2">
2812
- <!-- A rollup that is the whole formula already heads the summary. -->
2813
- @if (!detail.standalone) {
2814
- <div class="flex items-baseline justify-between gap-3">
2815
- <h3 class="font-semibold text-surface-900 dark:text-surface-0">
2816
- {{ detail.title }}
2817
- </h3>
2818
- <bdi class="font-semibold tabular-nums">{{ detail.result }}</bdi>
2819
- </div>
2820
- }
2821
- @if (detail.meaning) {
2822
- <p class="text-surface-500 dark:text-surface-400">
2823
- {{ detail.meaning }}
2824
- </p>
2825
- }
2826
- <p>
2827
- @if (detail.method) {
2828
- {{ detail.method }} ·
2829
- }
2830
- <span class="font-medium">{{ detail.counted }}</span>
2831
- </p>
2832
- @for (note of detail.notes; track $index) {
2833
- <div
2834
- class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-amber-700"
2835
- >
2836
- {{ note }}
2837
- </div>
2838
- }
2839
- @if (detail.contributors.length) {
2840
- <mt-calculation-explanation-section
2841
- [title]="scheduleKeys + '.items' | transloco"
2842
- [aside]="'' + detail.contributors.length"
2843
- [open]="detail.contributors.length <= openRows"
2844
- >
2845
- <div class="overflow-x-auto">
2846
- <table class="w-full tabular-nums">
2847
- <thead>
2848
- <tr class="text-xs text-surface-500 dark:text-surface-400">
2849
- <th class="py-1 pe-3 text-start font-medium">
2850
- {{ scheduleKeys + '.item' | transloco }}
2851
- </th>
2852
- <th class="px-3 py-1 text-end font-medium">
2853
- {{
2854
- scheduleKeys +
2855
- (detail.kind === 'planned'
2856
- ? '.expected'
2857
- : '.progress') | transloco
2858
- }}
2859
- </th>
2860
- <th class="px-3 py-1 text-end font-medium">
2861
- {{ detail.weightLabel }}
2862
- </th>
2863
- <th class="py-1 ps-3 text-start font-medium">
2864
- {{ scheduleKeys + '.included' | transloco }}
2865
- </th>
2866
- </tr>
2867
- </thead>
2868
- <tbody>
2869
- @for (
2870
- row of detail.contributors;
2871
- track $index;
2872
- let n = $index
2873
- ) {
2874
- <tr
2875
- class="border-t border-surface-200 align-top dark:border-surface-700"
2876
- >
2877
- <td class="py-1.5 pe-3">
2878
- <div class="flex flex-col gap-0.5">
2879
- <ng-container
2880
- [ngTemplateOutlet]="recordName"
2881
- [ngTemplateOutletContext]="{
2882
- $implicit: row.ref,
2883
- n,
2884
- }"
2885
- />
2886
- @if (row.type || row.planned) {
2887
- <span
2888
- class="text-xs text-surface-500 dark:text-surface-400"
2889
- >
2890
- {{ row.type }}
2891
- @if (row.planned; as planned) {
2892
- @if (row.type) {
2893
- ·
2894
- }
2895
- <bdi>{{ planned.dates }}</bdi>
2896
- }
2897
- </span>
2898
- }
2899
- </div>
2900
- </td>
2901
- <td class="px-3 py-1.5 text-end">
2902
- <bdi>{{ row.progress }}</bdi>
2903
- @if (row.planned?.time; as time) {
2904
- <div
2905
- class="text-xs text-surface-500 dark:text-surface-400"
2906
- >
2907
- <bdi>{{ time }}</bdi>
2908
- </div>
2909
- }
2910
- </td>
2911
- <td class="px-3 py-1.5 text-end">
2912
- <bdi>{{ row.weight }}</bdi>
2913
- </td>
2914
- <td class="py-1.5 ps-3">
2915
- @if (row.counted && !row.reason) {
2916
- <mt-icon
2917
- icon="general.check"
2918
- size="xs"
2919
- class="text-green-700"
2920
- [attr.aria-label]="prefix + '.yes' | transloco"
2921
- />
2922
- } @else {
2923
- <span
2924
- class="text-xs"
2925
- [class]="
2926
- row.counted
2927
- ? 'text-surface-600 dark:text-surface-300'
2928
- : 'text-surface-500 dark:text-surface-400'
2929
- "
2930
- >{{ row.reason }}</span
2931
- >
2932
- }
2933
- </td>
2934
- </tr>
2935
- }
2936
- </tbody>
2937
- </table>
2938
- </div>
2939
- </mt-calculation-explanation-section>
2940
- }
2941
- </section>
2942
- }
2943
-
2944
- @if (view.codeBlocks.length) {
2945
- <mt-calculation-explanation-section
2946
- [title]="prefix + '.codeBlocks' | transloco"
2947
- [aside]="'' + view.codeBlocks.length"
2948
- [open]="true"
2949
- >
2950
- <ol class="flex flex-col gap-1">
2951
- @for (block of view.codeBlocks; track $index) {
2952
- <li class="flex items-baseline justify-between gap-3">
2953
- <span class="text-surface-500 dark:text-surface-400">{{
2954
- block.type
2955
- }}</span>
2956
- <span class="flex flex-col items-end">
2957
- <bdi class="font-medium">{{ block.value }}</bdi>
2958
- @if (block.raw !== null) {
2959
- <span
2960
- class="text-xs text-surface-500 dark:text-surface-400"
2961
- >
2962
- {{
2963
- prefix + '.codeBlockBefore'
2964
- | transloco: { value: block.raw }
2965
- }}
2966
- </span>
2967
- }
2968
- </span>
2969
- </li>
2970
- }
2971
- </ol>
2972
- </mt-calculation-explanation-section>
2973
- }
2974
-
2975
- @for (fact of view.facts; track $index) {
2976
- <mt-calculation-explanation-section
2977
- [title]="fact.label"
2978
- [open]="view.facts.length === 1"
2979
- >
2980
- <ng-container
2981
- [ngTemplateOutlet]="dataTpl"
2982
- [ngTemplateOutletContext]="{ $implicit: fact.data }"
2983
- />
2984
- </mt-calculation-explanation-section>
2985
- }
2986
- </div>
2722
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationDetails, isStandalone: true, selector: "mt-calculation-explanation-details", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, recordNames: { classPropertyName: "recordNames", publicName: "recordNames", isSignal: true, isRequired: false, transformFunction: null }, fallbackLabel: { classPropertyName: "fallbackLabel", publicName: "fallbackLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
2723
+ <!-- A record by its title, a placeholder while titles are read, or a
2724
+ generic label; never its id. -->
2725
+ <ng-template #recordName let-ref let-n="n">
2726
+ @if (recordNames() === null) {
2727
+ <span
2728
+ class="inline-block h-3 w-24 animate-pulse rounded-md bg-surface-100 align-middle dark:bg-surface-800"
2729
+ aria-busy="true"
2730
+ ></span>
2731
+ } @else {
2732
+ <bdi class="break-words">{{ nameOf(ref, n) }}</bdi>
2733
+ }
2734
+ </ng-template>
2735
+
2736
+ <ng-template #dataTpl let-data>
2737
+ @switch (data.kind) {
2738
+ @case ('text') {
2739
+ <bdi class="break-words">{{ data.text }}</bdi>
2740
+ }
2741
+ @case ('list') {
2742
+ <bdi class="break-words">{{ data.items.join(', ') }}</bdi>
2743
+ }
2744
+ @case ('table') {
2745
+ <div class="overflow-x-auto">
2746
+ <table class="w-full text-xs tabular-nums">
2747
+ <thead>
2748
+ <tr class="text-surface-500 dark:text-surface-400">
2749
+ @for (column of data.columns; track $index) {
2750
+ <th class="px-2 py-1 text-start font-medium">
2751
+ {{ column }}
2752
+ </th>
2753
+ }
2754
+ </tr>
2755
+ </thead>
2756
+ <tbody>
2757
+ @for (row of data.rows; track $index) {
2758
+ <tr
2759
+ class="border-t border-surface-200 dark:border-surface-700"
2760
+ >
2761
+ @for (cell of row; track $index) {
2762
+ <td class="px-2 py-1 align-top break-words">
2763
+ <bdi>{{ cell }}</bdi>
2764
+ </td>
2765
+ }
2766
+ </tr>
2767
+ }
2768
+ </tbody>
2769
+ </table>
2770
+ @if (data.more > 0) {
2771
+ <p class="mt-1 text-surface-500 dark:text-surface-400">
2772
+ {{ prefix + '.moreRows' | transloco: { count: data.more } }}
2773
+ </p>
2774
+ }
2775
+ </div>
2776
+ }
2777
+ @case ('fields') {
2778
+ <dl
2779
+ class="grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-3 gap-y-1"
2780
+ >
2781
+ @for (field of data.fields; track $index) {
2782
+ <dt class="text-surface-500 dark:text-surface-400">
2783
+ {{ field.label }}
2784
+ </dt>
2785
+ <dd class="ms-0 min-w-0">
2786
+ <ng-container
2787
+ [ngTemplateOutlet]="dataTpl"
2788
+ [ngTemplateOutletContext]="{ $implicit: field.data }"
2789
+ />
2790
+ </dd>
2791
+ }
2792
+ </dl>
2793
+ }
2794
+ }
2795
+ </ng-template>
2796
+
2797
+ @let view = details();
2798
+ <div
2799
+ class="flex flex-col gap-3 text-sm text-surface-700 dark:text-surface-200"
2800
+ >
2801
+ @if (view.description) {
2802
+ <p>{{ view.description }}</p>
2803
+ }
2804
+
2805
+ @if (view.values.length) {
2806
+ <mt-calculation-explanation-section
2807
+ [title]="prefix + '.valuesUsed' | transloco"
2808
+ [aside]="'' + view.values.length"
2809
+ [open]="true"
2810
+ >
2811
+ <dl class="grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 gap-y-1">
2812
+ @for (item of view.values; track $index) {
2813
+ <dt class="min-w-0 break-words">
2814
+ <bdi>{{ item.label }}</bdi>
2815
+ </dt>
2816
+ <dd class="ms-0 text-end font-medium tabular-nums">
2817
+ <bdi>{{ item.value }}</bdi>
2818
+ </dd>
2819
+ }
2820
+ </dl>
2821
+ </mt-calculation-explanation-section>
2822
+ }
2823
+
2824
+ @for (table of view.records; track $index) {
2825
+ <mt-calculation-explanation-section
2826
+ [title]="prefix + '.contributingRecords' | transloco"
2827
+ [aside]="'' + table.rows.length"
2828
+ [open]="table.rows.length <= openRows"
2829
+ >
2830
+ <div class="overflow-x-auto">
2831
+ <table class="w-full tabular-nums">
2832
+ <thead>
2833
+ <tr class="text-xs text-surface-500 dark:text-surface-400">
2834
+ <th class="py-1 pe-3 text-start font-medium">
2835
+ {{ prefix + '.record' | transloco }}
2836
+ </th>
2837
+ @for (column of table.columns; track $index) {
2838
+ <th class="py-1 ps-3 text-end font-medium">
2839
+ {{ column }}
2840
+ </th>
2841
+ }
2842
+ </tr>
2843
+ </thead>
2844
+ <tbody>
2845
+ @for (row of table.rows; track $index; let n = $index) {
2846
+ <tr
2847
+ class="border-t border-surface-200 dark:border-surface-700"
2848
+ >
2849
+ <td class="py-1.5 pe-3 break-words">
2850
+ <ng-container
2851
+ [ngTemplateOutlet]="recordName"
2852
+ [ngTemplateOutletContext]="{ $implicit: row.ref, n }"
2853
+ />
2854
+ </td>
2855
+ @for (cell of row.cells; track $index) {
2856
+ <td class="py-1.5 ps-3 text-end">
2857
+ <bdi>{{ cell }}</bdi>
2858
+ </td>
2859
+ }
2860
+ </tr>
2861
+ }
2862
+ </tbody>
2863
+ </table>
2864
+ </div>
2865
+ </mt-calculation-explanation-section>
2866
+ }
2867
+
2868
+ @if (view.steps.length) {
2869
+ <mt-calculation-explanation-section
2870
+ [title]="prefix + '.steps' | transloco"
2871
+ [aside]="'' + view.steps.length"
2872
+ >
2873
+ <ul class="flex flex-col gap-1.5">
2874
+ @for (step of view.steps; track $index) {
2875
+ <li>
2876
+ <mt-calculation-explanation-equation
2877
+ [segments]="step.segments"
2878
+ [result]="step.result"
2879
+ />
2880
+ </li>
2881
+ }
2882
+ </ul>
2883
+ </mt-calculation-explanation-section>
2884
+ }
2885
+
2886
+ @if (view.statusRules.length) {
2887
+ <mt-calculation-explanation-section
2888
+ [title]="prefix + '.statusRules' | transloco"
2889
+ [aside]="'' + view.statusRules.length"
2890
+ [open]="true"
2891
+ >
2892
+ <!-- One row per rule, in the order they are checked; a row opens
2893
+ to the parts its condition required. -->
2894
+ <ol class="flex flex-col gap-1">
2895
+ @for (rule of view.statusRules; track rule.key) {
2896
+ <li>
2897
+ <details
2898
+ class="group/rule rounded-md"
2899
+ [class]="
2900
+ rule.verdict === 'selected'
2901
+ ? 'bg-primary-50 dark:bg-primary-950'
2902
+ : ''
2903
+ "
2904
+ >
2905
+ <summary
2906
+ class="flex cursor-pointer list-none items-center gap-2 rounded-md px-2 py-1.5 select-none hover:bg-surface-50 focus-visible:outline-2 focus-visible:outline-primary-500 dark:hover:bg-surface-800 [&::-webkit-details-marker]:hidden"
2907
+ >
2908
+ <mt-icon
2909
+ icon="arrow.chevron-right"
2910
+ size="xs"
2911
+ class="shrink-0 text-surface-400 transition-transform group-open/rule:rotate-90 rtl:rotate-180"
2912
+ />
2913
+ <span
2914
+ class="shrink-0 text-xs text-surface-500 tabular-nums dark:text-surface-400"
2915
+ >{{ rule.position }}.</span
2916
+ >
2917
+ <bdi class="min-w-0 flex-1 font-medium">{{
2918
+ rule.name
2919
+ }}</bdi>
2920
+ <span
2921
+ class="shrink-0 rounded-md px-1.5 py-0.5 text-xs"
2922
+ [class]="verdictClass[rule.verdict]"
2923
+ >
2924
+ {{ prefix + '.verdict.' + rule.verdict | transloco }}
2925
+ </span>
2926
+ </summary>
2927
+ <div class="px-2 pt-1 pb-2 ps-8">
2928
+ @if (rule.checks; as checks) {
2929
+ <mt-calculation-explanation-checks
2930
+ class="text-xs"
2931
+ [checks]="checks"
2932
+ />
2933
+ } @else if (rule.segments; as segments) {
2934
+ <mt-calculation-explanation-equation
2935
+ class="text-xs"
2936
+ [segments]="segments"
2937
+ />
2938
+ }
2939
+ </div>
2940
+ </details>
2941
+ </li>
2942
+ }
2943
+ </ol>
2944
+ </mt-calculation-explanation-section>
2945
+ }
2946
+
2947
+ @for (detail of view.schedule; track $index) {
2948
+ <section class="flex flex-col gap-2">
2949
+ <!-- A rollup that is the whole formula already heads the summary. -->
2950
+ @if (!detail.standalone) {
2951
+ <div class="flex items-baseline justify-between gap-3">
2952
+ <h3 class="font-semibold text-surface-900 dark:text-surface-0">
2953
+ {{ detail.title }}
2954
+ </h3>
2955
+ <bdi class="font-semibold tabular-nums">{{ detail.result }}</bdi>
2956
+ </div>
2957
+ }
2958
+ @if (detail.meaning) {
2959
+ <p class="text-surface-500 dark:text-surface-400">
2960
+ {{ detail.meaning }}
2961
+ </p>
2962
+ }
2963
+ <p>
2964
+ @if (detail.method) {
2965
+ {{ detail.method }} ·
2966
+ }
2967
+ <span class="font-medium">{{ detail.counted }}</span>
2968
+ </p>
2969
+ @for (note of detail.notes; track $index) {
2970
+ <div
2971
+ class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-amber-700"
2972
+ >
2973
+ {{ note }}
2974
+ </div>
2975
+ }
2976
+ <!-- A large rollup: totals over every item, since only some are
2977
+ listed below. -->
2978
+ @if (detail.summary; as summary) {
2979
+ <mt-calculation-explanation-section
2980
+ [title]="scheduleKeys + '.totals.title' | transloco"
2981
+ [open]="true"
2982
+ >
2983
+ @if (summary.totals; as totals) {
2984
+ <mt-calculation-explanation-equation
2985
+ [segments]="totals"
2986
+ [result]="detail.result"
2987
+ />
2988
+ }
2989
+ @for (count of summary.counts; track $index) {
2990
+ <p class="text-xs text-surface-500 dark:text-surface-400">
2991
+ {{ count }}
2992
+ </p>
2993
+ }
2994
+ @if (summary.groups.length) {
2995
+ <div class="overflow-x-auto">
2996
+ <table class="w-full tabular-nums">
2997
+ <thead>
2998
+ <tr
2999
+ class="text-xs text-surface-500 dark:text-surface-400"
3000
+ >
3001
+ <th class="py-1 pe-3 text-start font-medium">
3002
+ {{ scheduleKeys + '.type' | transloco }}
3003
+ </th>
3004
+ <th class="px-3 py-1 text-end font-medium">
3005
+ {{ scheduleKeys + '.included' | transloco }}
3006
+ </th>
3007
+ @if (summary.groups[0].weight !== null) {
3008
+ <th class="px-3 py-1 text-end font-medium">
3009
+ {{ detail.weightLabel }}
3010
+ </th>
3011
+ }
3012
+ <th class="py-1 ps-3 text-end font-medium">
3013
+ {{ scheduleKeys + '.share' | transloco }}
3014
+ </th>
3015
+ </tr>
3016
+ </thead>
3017
+ <tbody>
3018
+ @for (group of summary.groups; track $index) {
3019
+ <tr
3020
+ class="border-t border-surface-200 dark:border-surface-700"
3021
+ >
3022
+ <td class="py-1.5 pe-3">
3023
+ <bdi>{{ group.type }}</bdi>
3024
+ </td>
3025
+ <td class="px-3 py-1.5 text-end">
3026
+ <bdi>{{ group.counted }}</bdi>
3027
+ </td>
3028
+ @if (group.weight !== null) {
3029
+ <td class="px-3 py-1.5 text-end">
3030
+ <bdi>{{ group.weight }}</bdi>
3031
+ </td>
3032
+ }
3033
+ <td class="py-1.5 ps-3 text-end">
3034
+ <bdi>{{ group.share }}</bdi>
3035
+ </td>
3036
+ </tr>
3037
+ }
3038
+ </tbody>
3039
+ </table>
3040
+ </div>
3041
+ }
3042
+ </mt-calculation-explanation-section>
3043
+ }
3044
+ @if (detail.contributors.length) {
3045
+ <mt-calculation-explanation-section
3046
+ [title]="scheduleKeys + '.items' | transloco"
3047
+ [aside]="detail.listed"
3048
+ [open]="detail.contributors.length <= openRows"
3049
+ >
3050
+ @if (detail.summary; as summary) {
3051
+ <p class="text-xs text-surface-500 dark:text-surface-400">
3052
+ {{ summary.listedItems }}
3053
+ </p>
3054
+ }
3055
+ <div class="overflow-x-auto">
3056
+ <table class="w-full tabular-nums">
3057
+ <thead>
3058
+ <tr class="text-xs text-surface-500 dark:text-surface-400">
3059
+ <th class="py-1 pe-3 text-start font-medium">
3060
+ {{ scheduleKeys + '.item' | transloco }}
3061
+ </th>
3062
+ <th class="px-3 py-1 text-end font-medium">
3063
+ {{
3064
+ scheduleKeys +
3065
+ (detail.kind === 'planned'
3066
+ ? '.expected'
3067
+ : '.progress') | transloco
3068
+ }}
3069
+ </th>
3070
+ <th class="px-3 py-1 text-end font-medium">
3071
+ {{ detail.weightLabel }}
3072
+ </th>
3073
+ <th class="py-1 ps-3 text-start font-medium">
3074
+ {{ scheduleKeys + '.included' | transloco }}
3075
+ </th>
3076
+ </tr>
3077
+ </thead>
3078
+ <tbody>
3079
+ @for (
3080
+ row of detail.contributors;
3081
+ track $index;
3082
+ let n = $index
3083
+ ) {
3084
+ <tr
3085
+ class="border-t border-surface-200 align-top dark:border-surface-700"
3086
+ >
3087
+ <td class="py-1.5 pe-3">
3088
+ <div class="flex flex-col gap-0.5">
3089
+ <ng-container
3090
+ [ngTemplateOutlet]="recordName"
3091
+ [ngTemplateOutletContext]="{
3092
+ $implicit: row.ref,
3093
+ n,
3094
+ }"
3095
+ />
3096
+ @if (row.type || row.planned) {
3097
+ <span
3098
+ class="text-xs text-surface-500 dark:text-surface-400"
3099
+ >
3100
+ {{ row.type }}
3101
+ @if (row.planned; as planned) {
3102
+ @if (row.type) {
3103
+ ·
3104
+ }
3105
+ <bdi>{{ planned.dates }}</bdi>
3106
+ }
3107
+ </span>
3108
+ }
3109
+ </div>
3110
+ </td>
3111
+ <td class="px-3 py-1.5 text-end">
3112
+ <bdi>{{ row.progress }}</bdi>
3113
+ @if (row.planned?.time; as time) {
3114
+ <div
3115
+ class="text-xs text-surface-500 dark:text-surface-400"
3116
+ >
3117
+ <bdi>{{ time }}</bdi>
3118
+ </div>
3119
+ }
3120
+ </td>
3121
+ <td class="px-3 py-1.5 text-end">
3122
+ <bdi>{{ row.weight }}</bdi>
3123
+ </td>
3124
+ <td class="py-1.5 ps-3">
3125
+ @if (row.counted && !row.reason) {
3126
+ <mt-icon
3127
+ icon="general.check"
3128
+ size="xs"
3129
+ class="text-green-700"
3130
+ [attr.aria-label]="prefix + '.yes' | transloco"
3131
+ />
3132
+ } @else {
3133
+ <span
3134
+ class="text-xs"
3135
+ [class]="
3136
+ row.counted
3137
+ ? 'text-surface-600 dark:text-surface-300'
3138
+ : 'text-surface-500 dark:text-surface-400'
3139
+ "
3140
+ >{{ row.reason }}</span
3141
+ >
3142
+ }
3143
+ </td>
3144
+ </tr>
3145
+ }
3146
+ </tbody>
3147
+ </table>
3148
+ </div>
3149
+ </mt-calculation-explanation-section>
3150
+ }
3151
+ </section>
3152
+ }
3153
+
3154
+ @if (view.codeBlocks.length) {
3155
+ <mt-calculation-explanation-section
3156
+ [title]="prefix + '.codeBlocks' | transloco"
3157
+ [aside]="'' + view.codeBlocks.length"
3158
+ [open]="true"
3159
+ >
3160
+ <ol class="flex flex-col gap-1">
3161
+ @for (block of view.codeBlocks; track $index) {
3162
+ <li class="flex items-baseline justify-between gap-3">
3163
+ <span class="text-surface-500 dark:text-surface-400">{{
3164
+ block.type
3165
+ }}</span>
3166
+ <span class="flex flex-col items-end">
3167
+ <bdi class="font-medium">{{ block.value }}</bdi>
3168
+ @if (block.raw !== null) {
3169
+ <span
3170
+ class="text-xs text-surface-500 dark:text-surface-400"
3171
+ >
3172
+ {{
3173
+ prefix + '.codeBlockBefore'
3174
+ | transloco: { value: block.raw }
3175
+ }}
3176
+ </span>
3177
+ }
3178
+ </span>
3179
+ </li>
3180
+ }
3181
+ </ol>
3182
+ </mt-calculation-explanation-section>
3183
+ }
3184
+
3185
+ @for (fact of view.facts; track $index) {
3186
+ <mt-calculation-explanation-section
3187
+ [title]="fact.label"
3188
+ [open]="view.facts.length === 1"
3189
+ >
3190
+ <ng-container
3191
+ [ngTemplateOutlet]="dataTpl"
3192
+ [ngTemplateOutletContext]="{ $implicit: fact.data }"
3193
+ />
3194
+ </mt-calculation-explanation-section>
3195
+ }
3196
+ </div>
2987
3197
  `, isInline: true, dependencies: [{ kind: "component", type: CalculationExplanationChecks, selector: "mt-calculation-explanation-checks", inputs: ["checks"] }, { kind: "component", type: CalculationExplanationEquation, selector: "mt-calculation-explanation-equation", inputs: ["segments", "result", "resultOperator"] }, { kind: "component", type: CalculationExplanationSection, selector: "mt-calculation-explanation-section", inputs: ["title", "aside", "open"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2988
3198
  }
2989
3199
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationDetails, decorators: [{
@@ -2999,408 +3209,481 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
2999
3209
  NgTemplateOutlet,
3000
3210
  TranslocoPipe,
3001
3211
  ],
3002
- template: `
3003
- <!-- A record by its title, a placeholder while titles are read, or a
3004
- generic label; never its id. -->
3005
- <ng-template #recordName let-ref let-n="n">
3006
- @if (recordNames() === null) {
3007
- <span
3008
- class="inline-block h-3 w-24 animate-pulse rounded-md bg-surface-100 align-middle dark:bg-surface-800"
3009
- aria-busy="true"
3010
- ></span>
3011
- } @else {
3012
- <bdi class="break-words">{{ nameOf(ref, n) }}</bdi>
3013
- }
3014
- </ng-template>
3015
-
3016
- <ng-template #dataTpl let-data>
3017
- @switch (data.kind) {
3018
- @case ('text') {
3019
- <bdi class="break-words">{{ data.text }}</bdi>
3020
- }
3021
- @case ('list') {
3022
- <bdi class="break-words">{{ data.items.join(', ') }}</bdi>
3023
- }
3024
- @case ('table') {
3025
- <div class="overflow-x-auto">
3026
- <table class="w-full text-xs tabular-nums">
3027
- <thead>
3028
- <tr class="text-surface-500 dark:text-surface-400">
3029
- @for (column of data.columns; track $index) {
3030
- <th class="px-2 py-1 text-start font-medium">
3031
- {{ column }}
3032
- </th>
3033
- }
3034
- </tr>
3035
- </thead>
3036
- <tbody>
3037
- @for (row of data.rows; track $index) {
3038
- <tr
3039
- class="border-t border-surface-200 dark:border-surface-700"
3040
- >
3041
- @for (cell of row; track $index) {
3042
- <td class="px-2 py-1 align-top break-words">
3043
- <bdi>{{ cell }}</bdi>
3044
- </td>
3045
- }
3046
- </tr>
3047
- }
3048
- </tbody>
3049
- </table>
3050
- @if (data.more > 0) {
3051
- <p class="mt-1 text-surface-500 dark:text-surface-400">
3052
- {{ prefix + '.moreRows' | transloco: { count: data.more } }}
3053
- </p>
3054
- }
3055
- </div>
3056
- }
3057
- @case ('fields') {
3058
- <dl
3059
- class="grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-3 gap-y-1"
3060
- >
3061
- @for (field of data.fields; track $index) {
3062
- <dt class="text-surface-500 dark:text-surface-400">
3063
- {{ field.label }}
3064
- </dt>
3065
- <dd class="ms-0 min-w-0">
3066
- <ng-container
3067
- [ngTemplateOutlet]="dataTpl"
3068
- [ngTemplateOutletContext]="{ $implicit: field.data }"
3069
- />
3070
- </dd>
3071
- }
3072
- </dl>
3073
- }
3074
- }
3075
- </ng-template>
3076
-
3077
- @let view = details();
3078
- <div
3079
- class="flex flex-col gap-3 text-sm text-surface-700 dark:text-surface-200"
3080
- >
3081
- @if (view.description) {
3082
- <p>{{ view.description }}</p>
3083
- }
3084
-
3085
- @if (view.values.length) {
3086
- <mt-calculation-explanation-section
3087
- [title]="prefix + '.valuesUsed' | transloco"
3088
- [aside]="'' + view.values.length"
3089
- [open]="true"
3090
- >
3091
- <dl class="grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 gap-y-1">
3092
- @for (item of view.values; track $index) {
3093
- <dt class="min-w-0 break-words">
3094
- <bdi>{{ item.label }}</bdi>
3095
- </dt>
3096
- <dd class="ms-0 text-end font-medium tabular-nums">
3097
- <bdi>{{ item.value }}</bdi>
3098
- </dd>
3099
- }
3100
- </dl>
3101
- </mt-calculation-explanation-section>
3102
- }
3103
-
3104
- @for (table of view.records; track $index) {
3105
- <mt-calculation-explanation-section
3106
- [title]="prefix + '.contributingRecords' | transloco"
3107
- [aside]="'' + table.rows.length"
3108
- [open]="table.rows.length <= openRows"
3109
- >
3110
- <div class="overflow-x-auto">
3111
- <table class="w-full tabular-nums">
3112
- <thead>
3113
- <tr class="text-xs text-surface-500 dark:text-surface-400">
3114
- <th class="py-1 pe-3 text-start font-medium">
3115
- {{ prefix + '.record' | transloco }}
3116
- </th>
3117
- @for (column of table.columns; track $index) {
3118
- <th class="py-1 ps-3 text-end font-medium">
3119
- {{ column }}
3120
- </th>
3121
- }
3122
- </tr>
3123
- </thead>
3124
- <tbody>
3125
- @for (row of table.rows; track $index; let n = $index) {
3126
- <tr
3127
- class="border-t border-surface-200 dark:border-surface-700"
3128
- >
3129
- <td class="py-1.5 pe-3 break-words">
3130
- <ng-container
3131
- [ngTemplateOutlet]="recordName"
3132
- [ngTemplateOutletContext]="{ $implicit: row.ref, n }"
3133
- />
3134
- </td>
3135
- @for (cell of row.cells; track $index) {
3136
- <td class="py-1.5 ps-3 text-end">
3137
- <bdi>{{ cell }}</bdi>
3138
- </td>
3139
- }
3140
- </tr>
3141
- }
3142
- </tbody>
3143
- </table>
3144
- </div>
3145
- </mt-calculation-explanation-section>
3146
- }
3147
-
3148
- @if (view.steps.length) {
3149
- <mt-calculation-explanation-section
3150
- [title]="prefix + '.steps' | transloco"
3151
- [aside]="'' + view.steps.length"
3152
- >
3153
- <ul class="flex flex-col gap-1.5">
3154
- @for (step of view.steps; track $index) {
3155
- <li>
3156
- <mt-calculation-explanation-equation
3157
- [segments]="step.segments"
3158
- [result]="step.result"
3159
- />
3160
- </li>
3161
- }
3162
- </ul>
3163
- </mt-calculation-explanation-section>
3164
- }
3165
-
3166
- @if (view.statusRules.length) {
3167
- <mt-calculation-explanation-section
3168
- [title]="prefix + '.statusRules' | transloco"
3169
- [aside]="'' + view.statusRules.length"
3170
- [open]="true"
3171
- >
3172
- <!-- One row per rule, in the order they are checked; a row opens
3173
- to the parts its condition required. -->
3174
- <ol class="flex flex-col gap-1">
3175
- @for (rule of view.statusRules; track rule.key) {
3176
- <li>
3177
- <details
3178
- class="group/rule rounded-md"
3179
- [class]="
3180
- rule.verdict === 'selected'
3181
- ? 'bg-primary-50 dark:bg-primary-950'
3182
- : ''
3183
- "
3184
- >
3185
- <summary
3186
- class="flex cursor-pointer list-none items-center gap-2 rounded-md px-2 py-1.5 select-none hover:bg-surface-50 focus-visible:outline-2 focus-visible:outline-primary-500 dark:hover:bg-surface-800 [&::-webkit-details-marker]:hidden"
3187
- >
3188
- <mt-icon
3189
- icon="arrow.chevron-right"
3190
- size="xs"
3191
- class="shrink-0 text-surface-400 transition-transform group-open/rule:rotate-90 rtl:rotate-180"
3192
- />
3193
- <span
3194
- class="shrink-0 text-xs text-surface-500 tabular-nums dark:text-surface-400"
3195
- >{{ rule.position }}.</span
3196
- >
3197
- <bdi class="min-w-0 flex-1 font-medium">{{
3198
- rule.name
3199
- }}</bdi>
3200
- <span
3201
- class="shrink-0 rounded-md px-1.5 py-0.5 text-xs"
3202
- [class]="verdictClass[rule.verdict]"
3203
- >
3204
- {{ prefix + '.verdict.' + rule.verdict | transloco }}
3205
- </span>
3206
- </summary>
3207
- <div class="px-2 pt-1 pb-2 ps-8">
3208
- @if (rule.checks; as checks) {
3209
- <mt-calculation-explanation-checks
3210
- class="text-xs"
3211
- [checks]="checks"
3212
- />
3213
- } @else if (rule.segments; as segments) {
3214
- <mt-calculation-explanation-equation
3215
- class="text-xs"
3216
- [segments]="segments"
3217
- />
3218
- }
3219
- </div>
3220
- </details>
3221
- </li>
3222
- }
3223
- </ol>
3224
- </mt-calculation-explanation-section>
3225
- }
3226
-
3227
- @for (detail of view.schedule; track $index) {
3228
- <section class="flex flex-col gap-2">
3229
- <!-- A rollup that is the whole formula already heads the summary. -->
3230
- @if (!detail.standalone) {
3231
- <div class="flex items-baseline justify-between gap-3">
3232
- <h3 class="font-semibold text-surface-900 dark:text-surface-0">
3233
- {{ detail.title }}
3234
- </h3>
3235
- <bdi class="font-semibold tabular-nums">{{ detail.result }}</bdi>
3236
- </div>
3237
- }
3238
- @if (detail.meaning) {
3239
- <p class="text-surface-500 dark:text-surface-400">
3240
- {{ detail.meaning }}
3241
- </p>
3242
- }
3243
- <p>
3244
- @if (detail.method) {
3245
- {{ detail.method }} ·
3246
- }
3247
- <span class="font-medium">{{ detail.counted }}</span>
3248
- </p>
3249
- @for (note of detail.notes; track $index) {
3250
- <div
3251
- class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-amber-700"
3252
- >
3253
- {{ note }}
3254
- </div>
3255
- }
3256
- @if (detail.contributors.length) {
3257
- <mt-calculation-explanation-section
3258
- [title]="scheduleKeys + '.items' | transloco"
3259
- [aside]="'' + detail.contributors.length"
3260
- [open]="detail.contributors.length <= openRows"
3261
- >
3262
- <div class="overflow-x-auto">
3263
- <table class="w-full tabular-nums">
3264
- <thead>
3265
- <tr class="text-xs text-surface-500 dark:text-surface-400">
3266
- <th class="py-1 pe-3 text-start font-medium">
3267
- {{ scheduleKeys + '.item' | transloco }}
3268
- </th>
3269
- <th class="px-3 py-1 text-end font-medium">
3270
- {{
3271
- scheduleKeys +
3272
- (detail.kind === 'planned'
3273
- ? '.expected'
3274
- : '.progress') | transloco
3275
- }}
3276
- </th>
3277
- <th class="px-3 py-1 text-end font-medium">
3278
- {{ detail.weightLabel }}
3279
- </th>
3280
- <th class="py-1 ps-3 text-start font-medium">
3281
- {{ scheduleKeys + '.included' | transloco }}
3282
- </th>
3283
- </tr>
3284
- </thead>
3285
- <tbody>
3286
- @for (
3287
- row of detail.contributors;
3288
- track $index;
3289
- let n = $index
3290
- ) {
3291
- <tr
3292
- class="border-t border-surface-200 align-top dark:border-surface-700"
3293
- >
3294
- <td class="py-1.5 pe-3">
3295
- <div class="flex flex-col gap-0.5">
3296
- <ng-container
3297
- [ngTemplateOutlet]="recordName"
3298
- [ngTemplateOutletContext]="{
3299
- $implicit: row.ref,
3300
- n,
3301
- }"
3302
- />
3303
- @if (row.type || row.planned) {
3304
- <span
3305
- class="text-xs text-surface-500 dark:text-surface-400"
3306
- >
3307
- {{ row.type }}
3308
- @if (row.planned; as planned) {
3309
- @if (row.type) {
3310
- ·
3311
- }
3312
- <bdi>{{ planned.dates }}</bdi>
3313
- }
3314
- </span>
3315
- }
3316
- </div>
3317
- </td>
3318
- <td class="px-3 py-1.5 text-end">
3319
- <bdi>{{ row.progress }}</bdi>
3320
- @if (row.planned?.time; as time) {
3321
- <div
3322
- class="text-xs text-surface-500 dark:text-surface-400"
3323
- >
3324
- <bdi>{{ time }}</bdi>
3325
- </div>
3326
- }
3327
- </td>
3328
- <td class="px-3 py-1.5 text-end">
3329
- <bdi>{{ row.weight }}</bdi>
3330
- </td>
3331
- <td class="py-1.5 ps-3">
3332
- @if (row.counted && !row.reason) {
3333
- <mt-icon
3334
- icon="general.check"
3335
- size="xs"
3336
- class="text-green-700"
3337
- [attr.aria-label]="prefix + '.yes' | transloco"
3338
- />
3339
- } @else {
3340
- <span
3341
- class="text-xs"
3342
- [class]="
3343
- row.counted
3344
- ? 'text-surface-600 dark:text-surface-300'
3345
- : 'text-surface-500 dark:text-surface-400'
3346
- "
3347
- >{{ row.reason }}</span
3348
- >
3349
- }
3350
- </td>
3351
- </tr>
3352
- }
3353
- </tbody>
3354
- </table>
3355
- </div>
3356
- </mt-calculation-explanation-section>
3357
- }
3358
- </section>
3359
- }
3360
-
3361
- @if (view.codeBlocks.length) {
3362
- <mt-calculation-explanation-section
3363
- [title]="prefix + '.codeBlocks' | transloco"
3364
- [aside]="'' + view.codeBlocks.length"
3365
- [open]="true"
3366
- >
3367
- <ol class="flex flex-col gap-1">
3368
- @for (block of view.codeBlocks; track $index) {
3369
- <li class="flex items-baseline justify-between gap-3">
3370
- <span class="text-surface-500 dark:text-surface-400">{{
3371
- block.type
3372
- }}</span>
3373
- <span class="flex flex-col items-end">
3374
- <bdi class="font-medium">{{ block.value }}</bdi>
3375
- @if (block.raw !== null) {
3376
- <span
3377
- class="text-xs text-surface-500 dark:text-surface-400"
3378
- >
3379
- {{
3380
- prefix + '.codeBlockBefore'
3381
- | transloco: { value: block.raw }
3382
- }}
3383
- </span>
3384
- }
3385
- </span>
3386
- </li>
3387
- }
3388
- </ol>
3389
- </mt-calculation-explanation-section>
3390
- }
3391
-
3392
- @for (fact of view.facts; track $index) {
3393
- <mt-calculation-explanation-section
3394
- [title]="fact.label"
3395
- [open]="view.facts.length === 1"
3396
- >
3397
- <ng-container
3398
- [ngTemplateOutlet]="dataTpl"
3399
- [ngTemplateOutletContext]="{ $implicit: fact.data }"
3400
- />
3401
- </mt-calculation-explanation-section>
3402
- }
3403
- </div>
3212
+ template: `
3213
+ <!-- A record by its title, a placeholder while titles are read, or a
3214
+ generic label; never its id. -->
3215
+ <ng-template #recordName let-ref let-n="n">
3216
+ @if (recordNames() === null) {
3217
+ <span
3218
+ class="inline-block h-3 w-24 animate-pulse rounded-md bg-surface-100 align-middle dark:bg-surface-800"
3219
+ aria-busy="true"
3220
+ ></span>
3221
+ } @else {
3222
+ <bdi class="break-words">{{ nameOf(ref, n) }}</bdi>
3223
+ }
3224
+ </ng-template>
3225
+
3226
+ <ng-template #dataTpl let-data>
3227
+ @switch (data.kind) {
3228
+ @case ('text') {
3229
+ <bdi class="break-words">{{ data.text }}</bdi>
3230
+ }
3231
+ @case ('list') {
3232
+ <bdi class="break-words">{{ data.items.join(', ') }}</bdi>
3233
+ }
3234
+ @case ('table') {
3235
+ <div class="overflow-x-auto">
3236
+ <table class="w-full text-xs tabular-nums">
3237
+ <thead>
3238
+ <tr class="text-surface-500 dark:text-surface-400">
3239
+ @for (column of data.columns; track $index) {
3240
+ <th class="px-2 py-1 text-start font-medium">
3241
+ {{ column }}
3242
+ </th>
3243
+ }
3244
+ </tr>
3245
+ </thead>
3246
+ <tbody>
3247
+ @for (row of data.rows; track $index) {
3248
+ <tr
3249
+ class="border-t border-surface-200 dark:border-surface-700"
3250
+ >
3251
+ @for (cell of row; track $index) {
3252
+ <td class="px-2 py-1 align-top break-words">
3253
+ <bdi>{{ cell }}</bdi>
3254
+ </td>
3255
+ }
3256
+ </tr>
3257
+ }
3258
+ </tbody>
3259
+ </table>
3260
+ @if (data.more > 0) {
3261
+ <p class="mt-1 text-surface-500 dark:text-surface-400">
3262
+ {{ prefix + '.moreRows' | transloco: { count: data.more } }}
3263
+ </p>
3264
+ }
3265
+ </div>
3266
+ }
3267
+ @case ('fields') {
3268
+ <dl
3269
+ class="grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-3 gap-y-1"
3270
+ >
3271
+ @for (field of data.fields; track $index) {
3272
+ <dt class="text-surface-500 dark:text-surface-400">
3273
+ {{ field.label }}
3274
+ </dt>
3275
+ <dd class="ms-0 min-w-0">
3276
+ <ng-container
3277
+ [ngTemplateOutlet]="dataTpl"
3278
+ [ngTemplateOutletContext]="{ $implicit: field.data }"
3279
+ />
3280
+ </dd>
3281
+ }
3282
+ </dl>
3283
+ }
3284
+ }
3285
+ </ng-template>
3286
+
3287
+ @let view = details();
3288
+ <div
3289
+ class="flex flex-col gap-3 text-sm text-surface-700 dark:text-surface-200"
3290
+ >
3291
+ @if (view.description) {
3292
+ <p>{{ view.description }}</p>
3293
+ }
3294
+
3295
+ @if (view.values.length) {
3296
+ <mt-calculation-explanation-section
3297
+ [title]="prefix + '.valuesUsed' | transloco"
3298
+ [aside]="'' + view.values.length"
3299
+ [open]="true"
3300
+ >
3301
+ <dl class="grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 gap-y-1">
3302
+ @for (item of view.values; track $index) {
3303
+ <dt class="min-w-0 break-words">
3304
+ <bdi>{{ item.label }}</bdi>
3305
+ </dt>
3306
+ <dd class="ms-0 text-end font-medium tabular-nums">
3307
+ <bdi>{{ item.value }}</bdi>
3308
+ </dd>
3309
+ }
3310
+ </dl>
3311
+ </mt-calculation-explanation-section>
3312
+ }
3313
+
3314
+ @for (table of view.records; track $index) {
3315
+ <mt-calculation-explanation-section
3316
+ [title]="prefix + '.contributingRecords' | transloco"
3317
+ [aside]="'' + table.rows.length"
3318
+ [open]="table.rows.length <= openRows"
3319
+ >
3320
+ <div class="overflow-x-auto">
3321
+ <table class="w-full tabular-nums">
3322
+ <thead>
3323
+ <tr class="text-xs text-surface-500 dark:text-surface-400">
3324
+ <th class="py-1 pe-3 text-start font-medium">
3325
+ {{ prefix + '.record' | transloco }}
3326
+ </th>
3327
+ @for (column of table.columns; track $index) {
3328
+ <th class="py-1 ps-3 text-end font-medium">
3329
+ {{ column }}
3330
+ </th>
3331
+ }
3332
+ </tr>
3333
+ </thead>
3334
+ <tbody>
3335
+ @for (row of table.rows; track $index; let n = $index) {
3336
+ <tr
3337
+ class="border-t border-surface-200 dark:border-surface-700"
3338
+ >
3339
+ <td class="py-1.5 pe-3 break-words">
3340
+ <ng-container
3341
+ [ngTemplateOutlet]="recordName"
3342
+ [ngTemplateOutletContext]="{ $implicit: row.ref, n }"
3343
+ />
3344
+ </td>
3345
+ @for (cell of row.cells; track $index) {
3346
+ <td class="py-1.5 ps-3 text-end">
3347
+ <bdi>{{ cell }}</bdi>
3348
+ </td>
3349
+ }
3350
+ </tr>
3351
+ }
3352
+ </tbody>
3353
+ </table>
3354
+ </div>
3355
+ </mt-calculation-explanation-section>
3356
+ }
3357
+
3358
+ @if (view.steps.length) {
3359
+ <mt-calculation-explanation-section
3360
+ [title]="prefix + '.steps' | transloco"
3361
+ [aside]="'' + view.steps.length"
3362
+ >
3363
+ <ul class="flex flex-col gap-1.5">
3364
+ @for (step of view.steps; track $index) {
3365
+ <li>
3366
+ <mt-calculation-explanation-equation
3367
+ [segments]="step.segments"
3368
+ [result]="step.result"
3369
+ />
3370
+ </li>
3371
+ }
3372
+ </ul>
3373
+ </mt-calculation-explanation-section>
3374
+ }
3375
+
3376
+ @if (view.statusRules.length) {
3377
+ <mt-calculation-explanation-section
3378
+ [title]="prefix + '.statusRules' | transloco"
3379
+ [aside]="'' + view.statusRules.length"
3380
+ [open]="true"
3381
+ >
3382
+ <!-- One row per rule, in the order they are checked; a row opens
3383
+ to the parts its condition required. -->
3384
+ <ol class="flex flex-col gap-1">
3385
+ @for (rule of view.statusRules; track rule.key) {
3386
+ <li>
3387
+ <details
3388
+ class="group/rule rounded-md"
3389
+ [class]="
3390
+ rule.verdict === 'selected'
3391
+ ? 'bg-primary-50 dark:bg-primary-950'
3392
+ : ''
3393
+ "
3394
+ >
3395
+ <summary
3396
+ class="flex cursor-pointer list-none items-center gap-2 rounded-md px-2 py-1.5 select-none hover:bg-surface-50 focus-visible:outline-2 focus-visible:outline-primary-500 dark:hover:bg-surface-800 [&::-webkit-details-marker]:hidden"
3397
+ >
3398
+ <mt-icon
3399
+ icon="arrow.chevron-right"
3400
+ size="xs"
3401
+ class="shrink-0 text-surface-400 transition-transform group-open/rule:rotate-90 rtl:rotate-180"
3402
+ />
3403
+ <span
3404
+ class="shrink-0 text-xs text-surface-500 tabular-nums dark:text-surface-400"
3405
+ >{{ rule.position }}.</span
3406
+ >
3407
+ <bdi class="min-w-0 flex-1 font-medium">{{
3408
+ rule.name
3409
+ }}</bdi>
3410
+ <span
3411
+ class="shrink-0 rounded-md px-1.5 py-0.5 text-xs"
3412
+ [class]="verdictClass[rule.verdict]"
3413
+ >
3414
+ {{ prefix + '.verdict.' + rule.verdict | transloco }}
3415
+ </span>
3416
+ </summary>
3417
+ <div class="px-2 pt-1 pb-2 ps-8">
3418
+ @if (rule.checks; as checks) {
3419
+ <mt-calculation-explanation-checks
3420
+ class="text-xs"
3421
+ [checks]="checks"
3422
+ />
3423
+ } @else if (rule.segments; as segments) {
3424
+ <mt-calculation-explanation-equation
3425
+ class="text-xs"
3426
+ [segments]="segments"
3427
+ />
3428
+ }
3429
+ </div>
3430
+ </details>
3431
+ </li>
3432
+ }
3433
+ </ol>
3434
+ </mt-calculation-explanation-section>
3435
+ }
3436
+
3437
+ @for (detail of view.schedule; track $index) {
3438
+ <section class="flex flex-col gap-2">
3439
+ <!-- A rollup that is the whole formula already heads the summary. -->
3440
+ @if (!detail.standalone) {
3441
+ <div class="flex items-baseline justify-between gap-3">
3442
+ <h3 class="font-semibold text-surface-900 dark:text-surface-0">
3443
+ {{ detail.title }}
3444
+ </h3>
3445
+ <bdi class="font-semibold tabular-nums">{{ detail.result }}</bdi>
3446
+ </div>
3447
+ }
3448
+ @if (detail.meaning) {
3449
+ <p class="text-surface-500 dark:text-surface-400">
3450
+ {{ detail.meaning }}
3451
+ </p>
3452
+ }
3453
+ <p>
3454
+ @if (detail.method) {
3455
+ {{ detail.method }} ·
3456
+ }
3457
+ <span class="font-medium">{{ detail.counted }}</span>
3458
+ </p>
3459
+ @for (note of detail.notes; track $index) {
3460
+ <div
3461
+ class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-amber-700"
3462
+ >
3463
+ {{ note }}
3464
+ </div>
3465
+ }
3466
+ <!-- A large rollup: totals over every item, since only some are
3467
+ listed below. -->
3468
+ @if (detail.summary; as summary) {
3469
+ <mt-calculation-explanation-section
3470
+ [title]="scheduleKeys + '.totals.title' | transloco"
3471
+ [open]="true"
3472
+ >
3473
+ @if (summary.totals; as totals) {
3474
+ <mt-calculation-explanation-equation
3475
+ [segments]="totals"
3476
+ [result]="detail.result"
3477
+ />
3478
+ }
3479
+ @for (count of summary.counts; track $index) {
3480
+ <p class="text-xs text-surface-500 dark:text-surface-400">
3481
+ {{ count }}
3482
+ </p>
3483
+ }
3484
+ @if (summary.groups.length) {
3485
+ <div class="overflow-x-auto">
3486
+ <table class="w-full tabular-nums">
3487
+ <thead>
3488
+ <tr
3489
+ class="text-xs text-surface-500 dark:text-surface-400"
3490
+ >
3491
+ <th class="py-1 pe-3 text-start font-medium">
3492
+ {{ scheduleKeys + '.type' | transloco }}
3493
+ </th>
3494
+ <th class="px-3 py-1 text-end font-medium">
3495
+ {{ scheduleKeys + '.included' | transloco }}
3496
+ </th>
3497
+ @if (summary.groups[0].weight !== null) {
3498
+ <th class="px-3 py-1 text-end font-medium">
3499
+ {{ detail.weightLabel }}
3500
+ </th>
3501
+ }
3502
+ <th class="py-1 ps-3 text-end font-medium">
3503
+ {{ scheduleKeys + '.share' | transloco }}
3504
+ </th>
3505
+ </tr>
3506
+ </thead>
3507
+ <tbody>
3508
+ @for (group of summary.groups; track $index) {
3509
+ <tr
3510
+ class="border-t border-surface-200 dark:border-surface-700"
3511
+ >
3512
+ <td class="py-1.5 pe-3">
3513
+ <bdi>{{ group.type }}</bdi>
3514
+ </td>
3515
+ <td class="px-3 py-1.5 text-end">
3516
+ <bdi>{{ group.counted }}</bdi>
3517
+ </td>
3518
+ @if (group.weight !== null) {
3519
+ <td class="px-3 py-1.5 text-end">
3520
+ <bdi>{{ group.weight }}</bdi>
3521
+ </td>
3522
+ }
3523
+ <td class="py-1.5 ps-3 text-end">
3524
+ <bdi>{{ group.share }}</bdi>
3525
+ </td>
3526
+ </tr>
3527
+ }
3528
+ </tbody>
3529
+ </table>
3530
+ </div>
3531
+ }
3532
+ </mt-calculation-explanation-section>
3533
+ }
3534
+ @if (detail.contributors.length) {
3535
+ <mt-calculation-explanation-section
3536
+ [title]="scheduleKeys + '.items' | transloco"
3537
+ [aside]="detail.listed"
3538
+ [open]="detail.contributors.length <= openRows"
3539
+ >
3540
+ @if (detail.summary; as summary) {
3541
+ <p class="text-xs text-surface-500 dark:text-surface-400">
3542
+ {{ summary.listedItems }}
3543
+ </p>
3544
+ }
3545
+ <div class="overflow-x-auto">
3546
+ <table class="w-full tabular-nums">
3547
+ <thead>
3548
+ <tr class="text-xs text-surface-500 dark:text-surface-400">
3549
+ <th class="py-1 pe-3 text-start font-medium">
3550
+ {{ scheduleKeys + '.item' | transloco }}
3551
+ </th>
3552
+ <th class="px-3 py-1 text-end font-medium">
3553
+ {{
3554
+ scheduleKeys +
3555
+ (detail.kind === 'planned'
3556
+ ? '.expected'
3557
+ : '.progress') | transloco
3558
+ }}
3559
+ </th>
3560
+ <th class="px-3 py-1 text-end font-medium">
3561
+ {{ detail.weightLabel }}
3562
+ </th>
3563
+ <th class="py-1 ps-3 text-start font-medium">
3564
+ {{ scheduleKeys + '.included' | transloco }}
3565
+ </th>
3566
+ </tr>
3567
+ </thead>
3568
+ <tbody>
3569
+ @for (
3570
+ row of detail.contributors;
3571
+ track $index;
3572
+ let n = $index
3573
+ ) {
3574
+ <tr
3575
+ class="border-t border-surface-200 align-top dark:border-surface-700"
3576
+ >
3577
+ <td class="py-1.5 pe-3">
3578
+ <div class="flex flex-col gap-0.5">
3579
+ <ng-container
3580
+ [ngTemplateOutlet]="recordName"
3581
+ [ngTemplateOutletContext]="{
3582
+ $implicit: row.ref,
3583
+ n,
3584
+ }"
3585
+ />
3586
+ @if (row.type || row.planned) {
3587
+ <span
3588
+ class="text-xs text-surface-500 dark:text-surface-400"
3589
+ >
3590
+ {{ row.type }}
3591
+ @if (row.planned; as planned) {
3592
+ @if (row.type) {
3593
+ ·
3594
+ }
3595
+ <bdi>{{ planned.dates }}</bdi>
3596
+ }
3597
+ </span>
3598
+ }
3599
+ </div>
3600
+ </td>
3601
+ <td class="px-3 py-1.5 text-end">
3602
+ <bdi>{{ row.progress }}</bdi>
3603
+ @if (row.planned?.time; as time) {
3604
+ <div
3605
+ class="text-xs text-surface-500 dark:text-surface-400"
3606
+ >
3607
+ <bdi>{{ time }}</bdi>
3608
+ </div>
3609
+ }
3610
+ </td>
3611
+ <td class="px-3 py-1.5 text-end">
3612
+ <bdi>{{ row.weight }}</bdi>
3613
+ </td>
3614
+ <td class="py-1.5 ps-3">
3615
+ @if (row.counted && !row.reason) {
3616
+ <mt-icon
3617
+ icon="general.check"
3618
+ size="xs"
3619
+ class="text-green-700"
3620
+ [attr.aria-label]="prefix + '.yes' | transloco"
3621
+ />
3622
+ } @else {
3623
+ <span
3624
+ class="text-xs"
3625
+ [class]="
3626
+ row.counted
3627
+ ? 'text-surface-600 dark:text-surface-300'
3628
+ : 'text-surface-500 dark:text-surface-400'
3629
+ "
3630
+ >{{ row.reason }}</span
3631
+ >
3632
+ }
3633
+ </td>
3634
+ </tr>
3635
+ }
3636
+ </tbody>
3637
+ </table>
3638
+ </div>
3639
+ </mt-calculation-explanation-section>
3640
+ }
3641
+ </section>
3642
+ }
3643
+
3644
+ @if (view.codeBlocks.length) {
3645
+ <mt-calculation-explanation-section
3646
+ [title]="prefix + '.codeBlocks' | transloco"
3647
+ [aside]="'' + view.codeBlocks.length"
3648
+ [open]="true"
3649
+ >
3650
+ <ol class="flex flex-col gap-1">
3651
+ @for (block of view.codeBlocks; track $index) {
3652
+ <li class="flex items-baseline justify-between gap-3">
3653
+ <span class="text-surface-500 dark:text-surface-400">{{
3654
+ block.type
3655
+ }}</span>
3656
+ <span class="flex flex-col items-end">
3657
+ <bdi class="font-medium">{{ block.value }}</bdi>
3658
+ @if (block.raw !== null) {
3659
+ <span
3660
+ class="text-xs text-surface-500 dark:text-surface-400"
3661
+ >
3662
+ {{
3663
+ prefix + '.codeBlockBefore'
3664
+ | transloco: { value: block.raw }
3665
+ }}
3666
+ </span>
3667
+ }
3668
+ </span>
3669
+ </li>
3670
+ }
3671
+ </ol>
3672
+ </mt-calculation-explanation-section>
3673
+ }
3674
+
3675
+ @for (fact of view.facts; track $index) {
3676
+ <mt-calculation-explanation-section
3677
+ [title]="fact.label"
3678
+ [open]="view.facts.length === 1"
3679
+ >
3680
+ <ng-container
3681
+ [ngTemplateOutlet]="dataTpl"
3682
+ [ngTemplateOutletContext]="{ $implicit: fact.data }"
3683
+ />
3684
+ </mt-calculation-explanation-section>
3685
+ }
3686
+ </div>
3404
3687
  `,
3405
3688
  }]
3406
3689
  }], propDecorators: { details: [{ type: i0.Input, args: [{ isSignal: true, alias: "details", required: true }] }], recordNames: [{ type: i0.Input, args: [{ isSignal: true, alias: "recordNames", required: false }] }], fallbackLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallbackLabel", required: false }] }] } });
@@ -3441,30 +3724,30 @@ class CalculationExplanationPanel {
3441
3724
  this.destroyRef.onDestroy(() => subscription.unsubscribe());
3442
3725
  }
3443
3726
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
3444
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationPanel, isStandalone: true, selector: "mt-calculation-explanation-panel", inputs: { target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null }, explanation: { classPropertyName: "explanation", publicName: "explanation", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "block h-full" }, providers: [MTDateFormatPipe], ngImport: i0, template: `
3445
- @let v = view();
3446
- <div class="flex h-full flex-col gap-4 overflow-y-auto p-5 text-sm">
3447
- <!-- One line: when, and on what basis only when it is not the saved
3448
- value (the drawer's title already names the value). -->
3449
- <span class="text-xs text-surface-500 dark:text-surface-400">
3450
- @if (v.basis === 'currentCalculation') {
3451
- {{ prefix + '.currentTitle' | transloco }} ·
3452
- {{ prefix + '.currentCalculatedAt' | transloco }}
3453
- } @else {
3454
- {{ prefix + '.calculatedAt' | transloco }}
3455
- }
3456
- <bdi class="tabular-nums">{{
3457
- v.calculatedAt | mtDateFormat: 'dateTime'
3458
- }}</bdi>
3459
- </span>
3460
- <mt-calculation-explanation-summary [view]="v" />
3461
- <mt-calculation-explanation-details
3462
- [details]="v.details"
3463
- [recordNames]="recordNames()"
3464
- [fallbackLabel]="fallbackLabel"
3465
- />
3466
- </div>
3467
- `, isInline: true, dependencies: [{ kind: "component", type: CalculationExplanationSummary, selector: "mt-calculation-explanation-summary", inputs: ["view"] }, { kind: "component", type: CalculationExplanationDetails, selector: "mt-calculation-explanation-details", inputs: ["details", "recordNames", "fallbackLabel"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3727
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CalculationExplanationPanel, isStandalone: true, selector: "mt-calculation-explanation-panel", inputs: { target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null }, explanation: { classPropertyName: "explanation", publicName: "explanation", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "block h-full" }, providers: [MTDateFormatPipe], ngImport: i0, template: `
3728
+ @let v = view();
3729
+ <div class="flex h-full flex-col gap-4 overflow-y-auto p-5 text-sm">
3730
+ <!-- One line: when, and on what basis only when it is not the saved
3731
+ value (the drawer's title already names the value). -->
3732
+ <span class="text-xs text-surface-500 dark:text-surface-400">
3733
+ @if (v.basis === 'currentCalculation') {
3734
+ {{ prefix + '.currentTitle' | transloco }} ·
3735
+ {{ prefix + '.currentCalculatedAt' | transloco }}
3736
+ } @else {
3737
+ {{ prefix + '.calculatedAt' | transloco }}
3738
+ }
3739
+ <bdi class="tabular-nums">{{
3740
+ v.calculatedAt | mtDateFormat: 'dateTime'
3741
+ }}</bdi>
3742
+ </span>
3743
+ <mt-calculation-explanation-summary [view]="v" [summaryNotice]="true" />
3744
+ <mt-calculation-explanation-details
3745
+ [details]="v.details"
3746
+ [recordNames]="recordNames()"
3747
+ [fallbackLabel]="fallbackLabel"
3748
+ />
3749
+ </div>
3750
+ `, isInline: true, dependencies: [{ kind: "component", type: CalculationExplanationSummary, selector: "mt-calculation-explanation-summary", inputs: ["view", "summaryNotice"] }, { kind: "component", type: CalculationExplanationDetails, selector: "mt-calculation-explanation-details", inputs: ["details", "recordNames", "fallbackLabel"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3468
3751
  }
3469
3752
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CalculationExplanationPanel, decorators: [{
3470
3753
  type: Component,
@@ -3482,29 +3765,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
3482
3765
  // `EntityListDrawer`. The drawer pads only its header (`px-5`): content
3483
3766
  // that owns its scroll pads itself to line up with it.
3484
3767
  host: { class: 'block h-full' },
3485
- template: `
3486
- @let v = view();
3487
- <div class="flex h-full flex-col gap-4 overflow-y-auto p-5 text-sm">
3488
- <!-- One line: when, and on what basis only when it is not the saved
3489
- value (the drawer's title already names the value). -->
3490
- <span class="text-xs text-surface-500 dark:text-surface-400">
3491
- @if (v.basis === 'currentCalculation') {
3492
- {{ prefix + '.currentTitle' | transloco }} ·
3493
- {{ prefix + '.currentCalculatedAt' | transloco }}
3494
- } @else {
3495
- {{ prefix + '.calculatedAt' | transloco }}
3496
- }
3497
- <bdi class="tabular-nums">{{
3498
- v.calculatedAt | mtDateFormat: 'dateTime'
3499
- }}</bdi>
3500
- </span>
3501
- <mt-calculation-explanation-summary [view]="v" />
3502
- <mt-calculation-explanation-details
3503
- [details]="v.details"
3504
- [recordNames]="recordNames()"
3505
- [fallbackLabel]="fallbackLabel"
3506
- />
3507
- </div>
3768
+ template: `
3769
+ @let v = view();
3770
+ <div class="flex h-full flex-col gap-4 overflow-y-auto p-5 text-sm">
3771
+ <!-- One line: when, and on what basis only when it is not the saved
3772
+ value (the drawer's title already names the value). -->
3773
+ <span class="text-xs text-surface-500 dark:text-surface-400">
3774
+ @if (v.basis === 'currentCalculation') {
3775
+ {{ prefix + '.currentTitle' | transloco }} ·
3776
+ {{ prefix + '.currentCalculatedAt' | transloco }}
3777
+ } @else {
3778
+ {{ prefix + '.calculatedAt' | transloco }}
3779
+ }
3780
+ <bdi class="tabular-nums">{{
3781
+ v.calculatedAt | mtDateFormat: 'dateTime'
3782
+ }}</bdi>
3783
+ </span>
3784
+ <mt-calculation-explanation-summary [view]="v" [summaryNotice]="true" />
3785
+ <mt-calculation-explanation-details
3786
+ [details]="v.details"
3787
+ [recordNames]="recordNames()"
3788
+ [fallbackLabel]="fallbackLabel"
3789
+ />
3790
+ </div>
3508
3791
  `,
3509
3792
  }]
3510
3793
  }], propDecorators: { target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: true }] }], explanation: [{ type: i0.Input, args: [{ isSignal: true, alias: "explanation", required: true }] }] } });
@@ -3527,6 +3810,12 @@ const PROVIDERS = new Set([
3527
3810
  'schedule',
3528
3811
  ]);
3529
3812
  const BASES = new Set(['savedCalculation', 'currentCalculation']);
3813
+ /**
3814
+ * Outcomes that carry an explanation. `summarized` is a large schedule
3815
+ * rollup: its document says it is a summary (`completeness`), and the view
3816
+ * labels it as one.
3817
+ */
3818
+ const EXPLAINED = new Set(['available', 'summarized']);
3530
3819
  /**
3531
3820
  * How a calculated value was calculated, in short: the result with its
3532
3821
  * business reason (`Remaining = Budget − Spent`, then the values), when it was
@@ -3606,7 +3895,7 @@ class EntityCalculationExplanation {
3606
3895
  }
3607
3896
  const explanation = response.explanation;
3608
3897
  const basis = response.basis ?? 'savedCalculation';
3609
- if (response.status !== 'available' ||
3898
+ if (!EXPLAINED.has(response.status) ||
3610
3899
  !explanation ||
3611
3900
  explanation.schemaVersion !== 1 ||
3612
3901
  !PROVIDERS.has(explanation.provider) ||
@@ -3634,88 +3923,92 @@ class EntityCalculationExplanation {
3634
3923
  });
3635
3924
  }
3636
3925
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculationExplanation, deps: [], target: i0.ɵɵFactoryTarget.Component });
3637
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityCalculationExplanation, isStandalone: true, selector: "mt-entity-calculation-explanation", inputs: { target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { detailsOpened: "detailsOpened" }, host: { classAttribute: "block" }, providers: [MTDateFormatPipe], ngImport: i0, template: `
3638
- <!-- pb-1: the calculation time's text box is a pixel taller than its
3639
- line; without room for it the box showed a scrollbar for 1px. -->
3640
- <div
3641
- class="flex max-h-[70vh] w-80 max-w-[calc(100vw-2rem)] flex-col gap-3 overflow-y-auto pb-1 text-sm"
3642
- >
3643
- <div class="flex min-w-0 flex-col gap-0.5">
3644
- <span
3645
- class="truncate font-semibold text-surface-900 dark:text-surface-0"
3646
- >
3647
- {{ target().label }}
3648
- </span>
3649
- <span class="text-xs text-surface-500 dark:text-surface-400">
3650
- {{
3651
- prefix +
3652
- (available()?.basis === 'currentCalculation'
3653
- ? '.currentTitle'
3654
- : '.title') | transloco
3655
- }}
3656
- </span>
3657
- </div>
3658
-
3659
- @switch (state().kind) {
3660
- @case ('loading') {
3661
- <div class="flex flex-col gap-2" aria-busy="true">
3662
- <div
3663
- class="h-10 animate-pulse rounded-md bg-surface-100 dark:bg-surface-800"
3664
- ></div>
3665
- <div
3666
- class="h-3 w-1/2 animate-pulse rounded-md bg-surface-100 dark:bg-surface-800"
3667
- ></div>
3668
- </div>
3669
- }
3670
- @case ('available') {
3671
- @if (view(); as v) {
3672
- <mt-calculation-explanation-summary [view]="v" />
3673
- <div
3674
- class="flex flex-wrap items-center justify-between gap-x-3 gap-y-1"
3675
- >
3676
- <span class="text-xs text-surface-500 dark:text-surface-400">
3677
- {{
3678
- prefix +
3679
- (v.basis === 'currentCalculation'
3680
- ? '.currentCalculatedAt'
3681
- : '.calculatedAt') | transloco
3682
- }}
3683
- <bdi class="tabular-nums">{{
3684
- v.calculatedAt | mtDateFormat: 'dateTime'
3685
- }}</bdi>
3686
- </span>
3687
- @if (v.hasDetails) {
3688
- <button
3689
- type="button"
3690
- class="rounded-md text-xs font-medium text-primary-700 hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500 dark:text-primary-300"
3691
- aria-haspopup="dialog"
3692
- (click)="openDetails()"
3693
- >
3694
- {{ prefix + '.showDetails' | transloco }}
3695
- </button>
3696
- }
3697
- </div>
3698
- }
3699
- }
3700
- @case ('unavailable') {
3701
- @if (unavailableKey(); as messageKey) {
3702
- <div
3703
- class="rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-surface-600 dark:border-surface-700 dark:bg-surface-800 dark:text-surface-300"
3704
- >
3705
- {{ messageKey | transloco }}
3706
- </div>
3707
- }
3708
- }
3709
- @case ('failed') {
3710
- <div
3711
- class="rounded-md border border-red-200 bg-red-50 px-3 py-2 text-red-700"
3712
- >
3713
- {{ prefix + '.loadFailed' | transloco }}
3714
- </div>
3715
- }
3716
- }
3717
- </div>
3718
- `, isInline: true, dependencies: [{ kind: "component", type: CalculationExplanationSummary, selector: "mt-calculation-explanation-summary", inputs: ["view"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3926
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityCalculationExplanation, isStandalone: true, selector: "mt-entity-calculation-explanation", inputs: { target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { detailsOpened: "detailsOpened" }, host: { classAttribute: "block" }, providers: [MTDateFormatPipe], ngImport: i0, template: `
3927
+ <!-- pb-1: the calculation time's text box is a pixel taller than its
3928
+ line; without room for it the box showed a scrollbar for 1px. -->
3929
+ <div
3930
+ class="flex max-h-[70vh] w-80 max-w-[calc(100vw-2rem)] flex-col gap-3 overflow-y-auto pb-1 text-sm"
3931
+ >
3932
+ <div class="flex min-w-0 flex-col gap-0.5">
3933
+ <span
3934
+ class="truncate font-semibold text-surface-900 dark:text-surface-0"
3935
+ >
3936
+ {{ target().label }}
3937
+ </span>
3938
+ <span class="text-xs text-surface-500 dark:text-surface-400">
3939
+ {{
3940
+ prefix +
3941
+ (available()?.basis === 'currentCalculation'
3942
+ ? '.currentTitle'
3943
+ : '.title') | transloco
3944
+ }}
3945
+ </span>
3946
+ </div>
3947
+
3948
+ @switch (state().kind) {
3949
+ @case ('loading') {
3950
+ <div class="flex flex-col gap-2" aria-busy="true">
3951
+ <div
3952
+ class="h-10 animate-pulse rounded-md bg-surface-100 dark:bg-surface-800"
3953
+ ></div>
3954
+ <div
3955
+ class="h-3 w-1/2 animate-pulse rounded-md bg-surface-100 dark:bg-surface-800"
3956
+ ></div>
3957
+ </div>
3958
+ }
3959
+ @case ('available') {
3960
+ @if (view(); as v) {
3961
+ <!-- No summary notice here: the details say what a summary
3962
+ lists; the tooltip stays short. -->
3963
+ <mt-calculation-explanation-summary [view]="v" />
3964
+ <div
3965
+ class="flex flex-wrap items-center justify-between gap-x-3 gap-y-1"
3966
+ >
3967
+ <span class="text-xs text-surface-500 dark:text-surface-400">
3968
+ {{
3969
+ prefix +
3970
+ (v.basis === 'currentCalculation'
3971
+ ? '.currentCalculatedAt'
3972
+ : '.calculatedAt') | transloco
3973
+ }}
3974
+ <bdi class="tabular-nums">{{
3975
+ v.calculatedAt | mtDateFormat: 'dateTime'
3976
+ }}</bdi>
3977
+ </span>
3978
+ @if (v.hasDetails) {
3979
+ <!-- ms-auto: at the end of the card even when it wraps under
3980
+ the calculation time. -->
3981
+ <button
3982
+ type="button"
3983
+ class="ms-auto cursor-pointer rounded-md text-xs font-medium text-primary-700 hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500 dark:text-primary-300"
3984
+ aria-haspopup="dialog"
3985
+ (click)="openDetails()"
3986
+ >
3987
+ {{ prefix + '.showDetails' | transloco }}
3988
+ </button>
3989
+ }
3990
+ </div>
3991
+ }
3992
+ }
3993
+ @case ('unavailable') {
3994
+ @if (unavailableKey(); as messageKey) {
3995
+ <div
3996
+ class="rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-surface-600 dark:border-surface-700 dark:bg-surface-800 dark:text-surface-300"
3997
+ >
3998
+ {{ messageKey | transloco }}
3999
+ </div>
4000
+ }
4001
+ }
4002
+ @case ('failed') {
4003
+ <div
4004
+ class="rounded-md border border-red-200 bg-red-50 px-3 py-2 text-red-700"
4005
+ >
4006
+ {{ prefix + '.loadFailed' | transloco }}
4007
+ </div>
4008
+ }
4009
+ }
4010
+ </div>
4011
+ `, isInline: true, dependencies: [{ kind: "component", type: CalculationExplanationSummary, selector: "mt-calculation-explanation-summary", inputs: ["view", "summaryNotice"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3719
4012
  }
3720
4013
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculationExplanation, decorators: [{
3721
4014
  type: Component,
@@ -3726,87 +4019,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
3726
4019
  providers: [MTDateFormatPipe],
3727
4020
  // A box, so its host can follow its size (the popover re-aligns on it).
3728
4021
  host: { class: 'block' },
3729
- template: `
3730
- <!-- pb-1: the calculation time's text box is a pixel taller than its
3731
- line; without room for it the box showed a scrollbar for 1px. -->
3732
- <div
3733
- class="flex max-h-[70vh] w-80 max-w-[calc(100vw-2rem)] flex-col gap-3 overflow-y-auto pb-1 text-sm"
3734
- >
3735
- <div class="flex min-w-0 flex-col gap-0.5">
3736
- <span
3737
- class="truncate font-semibold text-surface-900 dark:text-surface-0"
3738
- >
3739
- {{ target().label }}
3740
- </span>
3741
- <span class="text-xs text-surface-500 dark:text-surface-400">
3742
- {{
3743
- prefix +
3744
- (available()?.basis === 'currentCalculation'
3745
- ? '.currentTitle'
3746
- : '.title') | transloco
3747
- }}
3748
- </span>
3749
- </div>
3750
-
3751
- @switch (state().kind) {
3752
- @case ('loading') {
3753
- <div class="flex flex-col gap-2" aria-busy="true">
3754
- <div
3755
- class="h-10 animate-pulse rounded-md bg-surface-100 dark:bg-surface-800"
3756
- ></div>
3757
- <div
3758
- class="h-3 w-1/2 animate-pulse rounded-md bg-surface-100 dark:bg-surface-800"
3759
- ></div>
3760
- </div>
3761
- }
3762
- @case ('available') {
3763
- @if (view(); as v) {
3764
- <mt-calculation-explanation-summary [view]="v" />
3765
- <div
3766
- class="flex flex-wrap items-center justify-between gap-x-3 gap-y-1"
3767
- >
3768
- <span class="text-xs text-surface-500 dark:text-surface-400">
3769
- {{
3770
- prefix +
3771
- (v.basis === 'currentCalculation'
3772
- ? '.currentCalculatedAt'
3773
- : '.calculatedAt') | transloco
3774
- }}
3775
- <bdi class="tabular-nums">{{
3776
- v.calculatedAt | mtDateFormat: 'dateTime'
3777
- }}</bdi>
3778
- </span>
3779
- @if (v.hasDetails) {
3780
- <button
3781
- type="button"
3782
- class="rounded-md text-xs font-medium text-primary-700 hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500 dark:text-primary-300"
3783
- aria-haspopup="dialog"
3784
- (click)="openDetails()"
3785
- >
3786
- {{ prefix + '.showDetails' | transloco }}
3787
- </button>
3788
- }
3789
- </div>
3790
- }
3791
- }
3792
- @case ('unavailable') {
3793
- @if (unavailableKey(); as messageKey) {
3794
- <div
3795
- class="rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-surface-600 dark:border-surface-700 dark:bg-surface-800 dark:text-surface-300"
3796
- >
3797
- {{ messageKey | transloco }}
3798
- </div>
3799
- }
3800
- }
3801
- @case ('failed') {
3802
- <div
3803
- class="rounded-md border border-red-200 bg-red-50 px-3 py-2 text-red-700"
3804
- >
3805
- {{ prefix + '.loadFailed' | transloco }}
3806
- </div>
3807
- }
3808
- }
3809
- </div>
4022
+ template: `
4023
+ <!-- pb-1: the calculation time's text box is a pixel taller than its
4024
+ line; without room for it the box showed a scrollbar for 1px. -->
4025
+ <div
4026
+ class="flex max-h-[70vh] w-80 max-w-[calc(100vw-2rem)] flex-col gap-3 overflow-y-auto pb-1 text-sm"
4027
+ >
4028
+ <div class="flex min-w-0 flex-col gap-0.5">
4029
+ <span
4030
+ class="truncate font-semibold text-surface-900 dark:text-surface-0"
4031
+ >
4032
+ {{ target().label }}
4033
+ </span>
4034
+ <span class="text-xs text-surface-500 dark:text-surface-400">
4035
+ {{
4036
+ prefix +
4037
+ (available()?.basis === 'currentCalculation'
4038
+ ? '.currentTitle'
4039
+ : '.title') | transloco
4040
+ }}
4041
+ </span>
4042
+ </div>
4043
+
4044
+ @switch (state().kind) {
4045
+ @case ('loading') {
4046
+ <div class="flex flex-col gap-2" aria-busy="true">
4047
+ <div
4048
+ class="h-10 animate-pulse rounded-md bg-surface-100 dark:bg-surface-800"
4049
+ ></div>
4050
+ <div
4051
+ class="h-3 w-1/2 animate-pulse rounded-md bg-surface-100 dark:bg-surface-800"
4052
+ ></div>
4053
+ </div>
4054
+ }
4055
+ @case ('available') {
4056
+ @if (view(); as v) {
4057
+ <!-- No summary notice here: the details say what a summary
4058
+ lists; the tooltip stays short. -->
4059
+ <mt-calculation-explanation-summary [view]="v" />
4060
+ <div
4061
+ class="flex flex-wrap items-center justify-between gap-x-3 gap-y-1"
4062
+ >
4063
+ <span class="text-xs text-surface-500 dark:text-surface-400">
4064
+ {{
4065
+ prefix +
4066
+ (v.basis === 'currentCalculation'
4067
+ ? '.currentCalculatedAt'
4068
+ : '.calculatedAt') | transloco
4069
+ }}
4070
+ <bdi class="tabular-nums">{{
4071
+ v.calculatedAt | mtDateFormat: 'dateTime'
4072
+ }}</bdi>
4073
+ </span>
4074
+ @if (v.hasDetails) {
4075
+ <!-- ms-auto: at the end of the card even when it wraps under
4076
+ the calculation time. -->
4077
+ <button
4078
+ type="button"
4079
+ class="ms-auto cursor-pointer rounded-md text-xs font-medium text-primary-700 hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500 dark:text-primary-300"
4080
+ aria-haspopup="dialog"
4081
+ (click)="openDetails()"
4082
+ >
4083
+ {{ prefix + '.showDetails' | transloco }}
4084
+ </button>
4085
+ }
4086
+ </div>
4087
+ }
4088
+ }
4089
+ @case ('unavailable') {
4090
+ @if (unavailableKey(); as messageKey) {
4091
+ <div
4092
+ class="rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-surface-600 dark:border-surface-700 dark:bg-surface-800 dark:text-surface-300"
4093
+ >
4094
+ {{ messageKey | transloco }}
4095
+ </div>
4096
+ }
4097
+ }
4098
+ @case ('failed') {
4099
+ <div
4100
+ class="rounded-md border border-red-200 bg-red-50 px-3 py-2 text-red-700"
4101
+ >
4102
+ {{ prefix + '.loadFailed' | transloco }}
4103
+ </div>
4104
+ }
4105
+ }
4106
+ </div>
3810
4107
  `,
3811
4108
  }]
3812
4109
  }], ctorParameters: () => [], propDecorators: { target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: true }] }], detailsOpened: [{ type: i0.Output, args: ["detailsOpened"] }] } });
@@ -3822,23 +4119,23 @@ const EXPLAIN_TOOLTIP_KEY = 'components.entitiesPreview.explainCalculation';
3822
4119
  /** The calculated-value mark. Drawn, so it sits centred at any size. */
3823
4120
  class EntityCalculatedGlyph {
3824
4121
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculatedGlyph, deps: [], target: i0.ɵɵFactoryTarget.Component });
3825
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: EntityCalculatedGlyph, isStandalone: true, selector: "mt-entity-calculated-glyph", host: { classAttribute: "block size-full" }, ngImport: i0, template: `
3826
- <svg
3827
- viewBox="0 0 16 16"
3828
- width="100%"
3829
- height="100%"
3830
- fill="none"
3831
- stroke="currentColor"
3832
- stroke-width="1.5"
3833
- stroke-linecap="round"
3834
- stroke-linejoin="round"
3835
- aria-hidden="true"
3836
- >
3837
- <path
3838
- d="M10.1 4.7c-.35-.42-.85-.62-1.38-.56-.87.1-1.4.76-1.57 1.66L6.1 11.3"
3839
- />
3840
- <path d="M5.5 7.5h3.9" />
3841
- </svg>
4122
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: EntityCalculatedGlyph, isStandalone: true, selector: "mt-entity-calculated-glyph", host: { classAttribute: "block size-full" }, ngImport: i0, template: `
4123
+ <svg
4124
+ viewBox="0 0 16 16"
4125
+ width="100%"
4126
+ height="100%"
4127
+ fill="none"
4128
+ stroke="currentColor"
4129
+ stroke-width="1.5"
4130
+ stroke-linecap="round"
4131
+ stroke-linejoin="round"
4132
+ aria-hidden="true"
4133
+ >
4134
+ <path
4135
+ d="M10.1 4.7c-.35-.42-.85-.62-1.38-.56-.87.1-1.4.76-1.57 1.66L6.1 11.3"
4136
+ />
4137
+ <path d="M5.5 7.5h3.9" />
4138
+ </svg>
3842
4139
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3843
4140
  }
3844
4141
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculatedGlyph, decorators: [{
@@ -3846,23 +4143,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
3846
4143
  args: [{
3847
4144
  selector: 'mt-entity-calculated-glyph',
3848
4145
  changeDetection: ChangeDetectionStrategy.OnPush,
3849
- template: `
3850
- <svg
3851
- viewBox="0 0 16 16"
3852
- width="100%"
3853
- height="100%"
3854
- fill="none"
3855
- stroke="currentColor"
3856
- stroke-width="1.5"
3857
- stroke-linecap="round"
3858
- stroke-linejoin="round"
3859
- aria-hidden="true"
3860
- >
3861
- <path
3862
- d="M10.1 4.7c-.35-.42-.85-.62-1.38-.56-.87.1-1.4.76-1.57 1.66L6.1 11.3"
3863
- />
3864
- <path d="M5.5 7.5h3.9" />
3865
- </svg>
4146
+ template: `
4147
+ <svg
4148
+ viewBox="0 0 16 16"
4149
+ width="100%"
4150
+ height="100%"
4151
+ fill="none"
4152
+ stroke="currentColor"
4153
+ stroke-width="1.5"
4154
+ stroke-linecap="round"
4155
+ stroke-linejoin="round"
4156
+ aria-hidden="true"
4157
+ >
4158
+ <path
4159
+ d="M10.1 4.7c-.35-.42-.85-.62-1.38-.56-.87.1-1.4.76-1.57 1.66L6.1 11.3"
4160
+ />
4161
+ <path d="M5.5 7.5h3.9" />
4162
+ </svg>
3866
4163
  `,
3867
4164
  host: {
3868
4165
  class: 'block size-full',
@@ -3925,65 +4222,65 @@ class EntityCalculatedIndicator {
3925
4222
  this.popover()?.toggle(event);
3926
4223
  }
3927
4224
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculatedIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component });
3928
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityCalculatedIndicator, isStandalone: true, selector: "mt-entity-calculated-indicator", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, change: { classPropertyName: "change", publicName: "change", isSignal: true, isRequired: false, transformFunction: null }, explanation: { classPropertyName: "explanation", publicName: "explanation", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "inline-flex shrink-0" }, viewQueries: [{ propertyName: "popover", first: true, predicate: Popover, descendants: true, isSignal: true }, { propertyName: "explanationElement", first: true, predicate: EntityCalculationExplanation, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
3929
- <ng-template #mark>
3930
- @if (pulsing()) {
3931
- <span
3932
- class="absolute inset-0 animate-ping rounded-full bg-primary-700 opacity-60 motion-reduce:animate-none"
3933
- aria-hidden="true"
3934
- ></span>
3935
- }
3936
- <mt-entity-calculated-glyph class="relative" />
3937
- </ng-template>
3938
-
3939
- @if (explanation(); as target) {
3940
- <button
3941
- type="button"
3942
- class="relative inline-flex size-4 cursor-pointer items-center justify-center rounded-full select-none focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500"
3943
- [class]="
3944
- status()
3945
- ? 'bg-primary-700 text-white'
3946
- : 'bg-surface-100 text-surface-500 hover:bg-primary-100 hover:text-primary-700 dark:bg-surface-800 dark:text-surface-300'
3947
- "
3948
- [attr.aria-label]="tooltipKey() | transloco: tooltipParams()"
3949
- aria-haspopup="dialog"
3950
- [mtTooltip]="tooltipKey() | transloco: tooltipParams()"
3951
- tooltipPosition="top"
3952
- (click)="toggle($event)"
3953
- >
3954
- <ng-container [ngTemplateOutlet]="mark" />
3955
- </button>
3956
- <!-- Projected content is created with this view even while the popover
3957
- is closed, so the explanation is gated on the open state: it reads
3958
- its value when opened, not when the page loads. -->
3959
- <p-popover
3960
- appendTo="body"
3961
- (onShow)="opened.set(true)"
3962
- (onHide)="opened.set(false)"
3963
- >
3964
- @if (opened()) {
3965
- <mt-entity-calculation-explanation
3966
- [target]="target"
3967
- (detailsOpened)="popover()?.hide()"
3968
- />
3969
- }
3970
- </p-popover>
3971
- } @else {
3972
- <span
3973
- class="relative inline-flex size-4 cursor-help items-center justify-center rounded-full select-none"
3974
- [class]="
3975
- status()
3976
- ? 'bg-primary-700 text-white'
3977
- : 'bg-surface-100 text-surface-500 dark:bg-surface-800 dark:text-surface-300'
3978
- "
3979
- role="img"
3980
- [attr.aria-label]="tooltipKey() | transloco: tooltipParams()"
3981
- [mtTooltip]="tooltipKey() | transloco: tooltipParams()"
3982
- tooltipPosition="top"
3983
- >
3984
- <ng-container [ngTemplateOutlet]="mark" />
3985
- </span>
3986
- }
4225
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityCalculatedIndicator, isStandalone: true, selector: "mt-entity-calculated-indicator", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, change: { classPropertyName: "change", publicName: "change", isSignal: true, isRequired: false, transformFunction: null }, explanation: { classPropertyName: "explanation", publicName: "explanation", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "inline-flex shrink-0" }, viewQueries: [{ propertyName: "popover", first: true, predicate: Popover, descendants: true, isSignal: true }, { propertyName: "explanationElement", first: true, predicate: EntityCalculationExplanation, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
4226
+ <ng-template #mark>
4227
+ @if (pulsing()) {
4228
+ <span
4229
+ class="absolute inset-0 animate-ping rounded-full bg-primary-700 opacity-60 motion-reduce:animate-none"
4230
+ aria-hidden="true"
4231
+ ></span>
4232
+ }
4233
+ <mt-entity-calculated-glyph class="relative" />
4234
+ </ng-template>
4235
+
4236
+ @if (explanation(); as target) {
4237
+ <button
4238
+ type="button"
4239
+ class="relative inline-flex size-4 cursor-pointer items-center justify-center rounded-full select-none focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500"
4240
+ [class]="
4241
+ status()
4242
+ ? 'bg-primary-700 text-white'
4243
+ : 'bg-surface-100 text-surface-500 hover:bg-primary-100 hover:text-primary-700 dark:bg-surface-800 dark:text-surface-300'
4244
+ "
4245
+ [attr.aria-label]="tooltipKey() | transloco: tooltipParams()"
4246
+ aria-haspopup="dialog"
4247
+ [mtTooltip]="tooltipKey() | transloco: tooltipParams()"
4248
+ tooltipPosition="top"
4249
+ (click)="toggle($event)"
4250
+ >
4251
+ <ng-container [ngTemplateOutlet]="mark" />
4252
+ </button>
4253
+ <!-- Projected content is created with this view even while the popover
4254
+ is closed, so the explanation is gated on the open state: it reads
4255
+ its value when opened, not when the page loads. -->
4256
+ <p-popover
4257
+ appendTo="body"
4258
+ (onShow)="opened.set(true)"
4259
+ (onHide)="opened.set(false)"
4260
+ >
4261
+ @if (opened()) {
4262
+ <mt-entity-calculation-explanation
4263
+ [target]="target"
4264
+ (detailsOpened)="popover()?.hide()"
4265
+ />
4266
+ }
4267
+ </p-popover>
4268
+ } @else {
4269
+ <span
4270
+ class="relative inline-flex size-4 cursor-help items-center justify-center rounded-full select-none"
4271
+ [class]="
4272
+ status()
4273
+ ? 'bg-primary-700 text-white'
4274
+ : 'bg-surface-100 text-surface-500 dark:bg-surface-800 dark:text-surface-300'
4275
+ "
4276
+ role="img"
4277
+ [attr.aria-label]="tooltipKey() | transloco: tooltipParams()"
4278
+ [mtTooltip]="tooltipKey() | transloco: tooltipParams()"
4279
+ tooltipPosition="top"
4280
+ >
4281
+ <ng-container [ngTemplateOutlet]="mark" />
4282
+ </span>
4283
+ }
3987
4284
  `, isInline: true, dependencies: [{ kind: "component", type: EntityCalculatedGlyph, selector: "mt-entity-calculated-glyph" }, { kind: "component", type: EntityCalculationExplanation, selector: "mt-entity-calculation-explanation", inputs: ["target"], outputs: ["detailsOpened"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3988
4285
  }
3989
4286
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculatedIndicator, decorators: [{
@@ -3999,65 +4296,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
3999
4296
  Tooltip,
4000
4297
  TranslocoPipe,
4001
4298
  ],
4002
- template: `
4003
- <ng-template #mark>
4004
- @if (pulsing()) {
4005
- <span
4006
- class="absolute inset-0 animate-ping rounded-full bg-primary-700 opacity-60 motion-reduce:animate-none"
4007
- aria-hidden="true"
4008
- ></span>
4009
- }
4010
- <mt-entity-calculated-glyph class="relative" />
4011
- </ng-template>
4012
-
4013
- @if (explanation(); as target) {
4014
- <button
4015
- type="button"
4016
- class="relative inline-flex size-4 cursor-pointer items-center justify-center rounded-full select-none focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500"
4017
- [class]="
4018
- status()
4019
- ? 'bg-primary-700 text-white'
4020
- : 'bg-surface-100 text-surface-500 hover:bg-primary-100 hover:text-primary-700 dark:bg-surface-800 dark:text-surface-300'
4021
- "
4022
- [attr.aria-label]="tooltipKey() | transloco: tooltipParams()"
4023
- aria-haspopup="dialog"
4024
- [mtTooltip]="tooltipKey() | transloco: tooltipParams()"
4025
- tooltipPosition="top"
4026
- (click)="toggle($event)"
4027
- >
4028
- <ng-container [ngTemplateOutlet]="mark" />
4029
- </button>
4030
- <!-- Projected content is created with this view even while the popover
4031
- is closed, so the explanation is gated on the open state: it reads
4032
- its value when opened, not when the page loads. -->
4033
- <p-popover
4034
- appendTo="body"
4035
- (onShow)="opened.set(true)"
4036
- (onHide)="opened.set(false)"
4037
- >
4038
- @if (opened()) {
4039
- <mt-entity-calculation-explanation
4040
- [target]="target"
4041
- (detailsOpened)="popover()?.hide()"
4042
- />
4043
- }
4044
- </p-popover>
4045
- } @else {
4046
- <span
4047
- class="relative inline-flex size-4 cursor-help items-center justify-center rounded-full select-none"
4048
- [class]="
4049
- status()
4050
- ? 'bg-primary-700 text-white'
4051
- : 'bg-surface-100 text-surface-500 dark:bg-surface-800 dark:text-surface-300'
4052
- "
4053
- role="img"
4054
- [attr.aria-label]="tooltipKey() | transloco: tooltipParams()"
4055
- [mtTooltip]="tooltipKey() | transloco: tooltipParams()"
4056
- tooltipPosition="top"
4057
- >
4058
- <ng-container [ngTemplateOutlet]="mark" />
4059
- </span>
4060
- }
4299
+ template: `
4300
+ <ng-template #mark>
4301
+ @if (pulsing()) {
4302
+ <span
4303
+ class="absolute inset-0 animate-ping rounded-full bg-primary-700 opacity-60 motion-reduce:animate-none"
4304
+ aria-hidden="true"
4305
+ ></span>
4306
+ }
4307
+ <mt-entity-calculated-glyph class="relative" />
4308
+ </ng-template>
4309
+
4310
+ @if (explanation(); as target) {
4311
+ <button
4312
+ type="button"
4313
+ class="relative inline-flex size-4 cursor-pointer items-center justify-center rounded-full select-none focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-500"
4314
+ [class]="
4315
+ status()
4316
+ ? 'bg-primary-700 text-white'
4317
+ : 'bg-surface-100 text-surface-500 hover:bg-primary-100 hover:text-primary-700 dark:bg-surface-800 dark:text-surface-300'
4318
+ "
4319
+ [attr.aria-label]="tooltipKey() | transloco: tooltipParams()"
4320
+ aria-haspopup="dialog"
4321
+ [mtTooltip]="tooltipKey() | transloco: tooltipParams()"
4322
+ tooltipPosition="top"
4323
+ (click)="toggle($event)"
4324
+ >
4325
+ <ng-container [ngTemplateOutlet]="mark" />
4326
+ </button>
4327
+ <!-- Projected content is created with this view even while the popover
4328
+ is closed, so the explanation is gated on the open state: it reads
4329
+ its value when opened, not when the page loads. -->
4330
+ <p-popover
4331
+ appendTo="body"
4332
+ (onShow)="opened.set(true)"
4333
+ (onHide)="opened.set(false)"
4334
+ >
4335
+ @if (opened()) {
4336
+ <mt-entity-calculation-explanation
4337
+ [target]="target"
4338
+ (detailsOpened)="popover()?.hide()"
4339
+ />
4340
+ }
4341
+ </p-popover>
4342
+ } @else {
4343
+ <span
4344
+ class="relative inline-flex size-4 cursor-help items-center justify-center rounded-full select-none"
4345
+ [class]="
4346
+ status()
4347
+ ? 'bg-primary-700 text-white'
4348
+ : 'bg-surface-100 text-surface-500 dark:bg-surface-800 dark:text-surface-300'
4349
+ "
4350
+ role="img"
4351
+ [attr.aria-label]="tooltipKey() | transloco: tooltipParams()"
4352
+ [mtTooltip]="tooltipKey() | transloco: tooltipParams()"
4353
+ tooltipPosition="top"
4354
+ >
4355
+ <ng-container [ngTemplateOutlet]="mark" />
4356
+ </span>
4357
+ }
4061
4358
  `,
4062
4359
  host: {
4063
4360
  class: 'inline-flex shrink-0',