@ai-matrx/design-system 0.49.54 → 0.49.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/data-table/copy-helpers.d.cts +2 -2
- package/dist/data-table/copy-helpers.d.ts +2 -2
- package/dist/data-table/drill-chart.cjs +44 -6
- package/dist/data-table/drill-chart.cjs.map +1 -1
- package/dist/data-table/drill-chart.d.cts +8 -3
- package/dist/data-table/drill-chart.d.ts +8 -3
- package/dist/data-table/drill-chart.js +44 -6
- package/dist/data-table/drill-chart.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +2 -2
- package/dist/data-table/filter-engine.d.ts +2 -2
- package/dist/data-table/host.d.cts +2 -2
- package/dist/data-table/host.d.ts +2 -2
- package/dist/data-table/index.cjs +116 -40
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +28 -6
- package/dist/data-table/index.d.ts +28 -6
- package/dist/data-table/index.js +116 -40
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +2 -2
- package/dist/data-table/infer-filter.d.ts +2 -2
- package/dist/data-table/layered-filters.d.cts +2 -2
- package/dist/data-table/layered-filters.d.ts +2 -2
- package/dist/data-table/query-control.d.cts +2 -2
- package/dist/data-table/query-control.d.ts +2 -2
- package/dist/data-table/types.d.cts +2 -2
- package/dist/data-table/types.d.ts +2 -2
- package/dist/data-table/url-state.d.cts +2 -2
- package/dist/data-table/url-state.d.ts +2 -2
- package/dist/data-table/xlsx.d.cts +2 -2
- package/dist/data-table/xlsx.d.ts +2 -2
- package/dist/{drill-cISpem5b.d.cts → drill-qJ5gHL2F.d.cts} +11 -0
- package/dist/{drill-cISpem5b.d.ts → drill-qJ5gHL2F.d.ts} +11 -0
- package/dist/{layered-filters-ma_P0GDG.d.ts → layered-filters-CTdPPgxf.d.ts} +1 -1
- package/dist/{layered-filters-RHe2Kzrs.d.cts → layered-filters-HFquDviC.d.cts} +1 -1
- package/dist/styles.css +5 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-
|
|
1
|
+
import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-HFquDviC.cjs';
|
|
2
2
|
import '../content-transfer.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@ai-matrx/kit/content-transfer';
|
|
@@ -7,7 +7,7 @@ import './copy-types.cjs';
|
|
|
7
7
|
import './table-style.cjs';
|
|
8
8
|
import '../types-JnZD8wM0.cjs';
|
|
9
9
|
import './grouping.cjs';
|
|
10
|
-
import '../drill-
|
|
10
|
+
import '../drill-qJ5gHL2F.cjs';
|
|
11
11
|
import './fill.cjs';
|
|
12
12
|
import './facets.cjs';
|
|
13
13
|
import './spreadsheet.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-
|
|
1
|
+
import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-CTdPPgxf.js';
|
|
2
2
|
import '../content-transfer.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@ai-matrx/kit/content-transfer';
|
|
@@ -7,7 +7,7 @@ import './copy-types.js';
|
|
|
7
7
|
import './table-style.js';
|
|
8
8
|
import '../types-JnZD8wM0.js';
|
|
9
9
|
import './grouping.js';
|
|
10
|
-
import '../drill-
|
|
10
|
+
import '../drill-qJ5gHL2F.js';
|
|
11
11
|
import './fill.js';
|
|
12
12
|
import './facets.js';
|
|
13
13
|
import './spreadsheet.js';
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ComponentType, ReactNode, MouseEventHandler } from 'react';
|
|
3
3
|
import { CopyControlProps } from './copy-types.cjs';
|
|
4
4
|
export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.cjs';
|
|
5
|
-
import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-
|
|
5
|
+
import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-HFquDviC.cjs';
|
|
6
6
|
import { MatrxTableMenuItem, MatrxTableMenuTarget, MatrxTableMenuPayload, MatrxTableMenuSectionsResolver, MatrxTableMenuIconName } from './menu-targets.cjs';
|
|
7
7
|
export { MatrxTableMenuSection } from './menu-targets.cjs';
|
|
8
8
|
import '../content-transfer.cjs';
|
|
@@ -11,7 +11,7 @@ import '../content-transfer/icon.cjs';
|
|
|
11
11
|
import './table-style.cjs';
|
|
12
12
|
import '../types-JnZD8wM0.cjs';
|
|
13
13
|
import './grouping.cjs';
|
|
14
|
-
import '../drill-
|
|
14
|
+
import '../drill-qJ5gHL2F.cjs';
|
|
15
15
|
import './fill.cjs';
|
|
16
16
|
import './facets.cjs';
|
|
17
17
|
import './spreadsheet.cjs';
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ComponentType, ReactNode, MouseEventHandler } from 'react';
|
|
3
3
|
import { CopyControlProps } from './copy-types.js';
|
|
4
4
|
export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.js';
|
|
5
|
-
import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-
|
|
5
|
+
import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-CTdPPgxf.js';
|
|
6
6
|
import { MatrxTableMenuItem, MatrxTableMenuTarget, MatrxTableMenuPayload, MatrxTableMenuSectionsResolver, MatrxTableMenuIconName } from './menu-targets.js';
|
|
7
7
|
export { MatrxTableMenuSection } from './menu-targets.js';
|
|
8
8
|
import '../content-transfer.js';
|
|
@@ -11,7 +11,7 @@ import '../content-transfer/icon.js';
|
|
|
11
11
|
import './table-style.js';
|
|
12
12
|
import '../types-JnZD8wM0.js';
|
|
13
13
|
import './grouping.js';
|
|
14
|
-
import '../drill-
|
|
14
|
+
import '../drill-qJ5gHL2F.js';
|
|
15
15
|
import './fill.js';
|
|
16
16
|
import './facets.js';
|
|
17
17
|
import './spreadsheet.js';
|
|
@@ -34144,6 +34144,7 @@ __export(data_table_exports, {
|
|
|
34144
34144
|
drillPareto: () => drillPareto,
|
|
34145
34145
|
drillParetoSentence: () => drillParetoSentence,
|
|
34146
34146
|
drillPath: () => drillPath,
|
|
34147
|
+
drillPivotSortKey: () => drillPivotSortKey,
|
|
34147
34148
|
drillQuestionFromParams: () => drillQuestionFromParams,
|
|
34148
34149
|
drillQuestionToParams: () => drillQuestionToParams,
|
|
34149
34150
|
drillRequestKey: () => drillRequestKey,
|
|
@@ -44350,7 +44351,7 @@ function otherOf(parent, children, measures) {
|
|
|
44350
44351
|
}
|
|
44351
44352
|
return { row_count: rest, measures: out };
|
|
44352
44353
|
}
|
|
44353
|
-
function sortRows(rows, ref, sort) {
|
|
44354
|
+
function sortRows(rows, ref, sort, cellOf) {
|
|
44354
44355
|
if (!sort) return rows;
|
|
44355
44356
|
const dir = sort.direction === "asc" ? 1 : -1;
|
|
44356
44357
|
return [...rows].sort((a, b) => {
|
|
@@ -44363,6 +44364,13 @@ function sortRows(rows, ref, sort) {
|
|
|
44363
44364
|
return av2.localeCompare(bv2, void 0, { numeric: true }) * dir;
|
|
44364
44365
|
}
|
|
44365
44366
|
const read = (row) => {
|
|
44367
|
+
if (sort.key.startsWith("across:")) {
|
|
44368
|
+
const rest = sort.key.slice(7);
|
|
44369
|
+
const at2 = rest.indexOf(":");
|
|
44370
|
+
if (at2 < 0 || !cellOf) return null;
|
|
44371
|
+
const value = rest.slice(at2 + 1);
|
|
44372
|
+
return cellOf(row, rest.slice(0, at2), value === "(none)" ? null : value);
|
|
44373
|
+
}
|
|
44366
44374
|
if (sort.key.startsWith("delta:")) {
|
|
44367
44375
|
const key = sort.key.slice(6);
|
|
44368
44376
|
return drillDelta(row.measures[key], row.prior_measures?.[key]).change;
|
|
@@ -44392,10 +44400,17 @@ function buildDrillTree(question, answers, measures) {
|
|
|
44392
44400
|
const build = (level, parentGroups, parentKey) => {
|
|
44393
44401
|
const ref = by[level];
|
|
44394
44402
|
const sort = question.sort ?? (parseDimensionRef(ref).grain ? { key: "label", direction: "asc" } : null);
|
|
44403
|
+
const across = question.across ?? null;
|
|
44404
|
+
const crossed = across ? answers[drillRequestKey([...by.slice(0, level + 1), across])] : void 0;
|
|
44395
44405
|
const rows = sortRows(
|
|
44396
44406
|
(levels[level] ?? []).filter((row) => matches(row, parentGroups)),
|
|
44397
44407
|
ref,
|
|
44398
|
-
sort
|
|
44408
|
+
sort,
|
|
44409
|
+
across && crossed ? (row, measure, value) => {
|
|
44410
|
+
const groups = { ...parentGroups, [ref]: row.groups[ref] ?? null };
|
|
44411
|
+
const hit = crossed.find((r) => matches(r, groups) && (r.groups[across] ?? null) === value);
|
|
44412
|
+
return hit ? hit.measures[measure] ?? null : null;
|
|
44413
|
+
} : void 0
|
|
44399
44414
|
);
|
|
44400
44415
|
return rows.map((row) => {
|
|
44401
44416
|
const groups = { ...parentGroups, [ref]: row.groups[ref] ?? null };
|
|
@@ -44675,9 +44690,16 @@ function drillChartQuestions(question, seriesLimit = MATRX_DRILL_CHART_SERIES_LI
|
|
|
44675
44690
|
const timeInBy = question.by.find((ref) => parseDimensionRef(ref).grain !== null);
|
|
44676
44691
|
const firstTime = context.dimensions.find((d) => d.kind === "time");
|
|
44677
44692
|
const time = timeInBy ?? context.time ?? (firstTime ? `${firstTime.key}:${drillAutoGrain(question.window ?? null, context.now, firstTime.grains ?? MATRX_DRILL_DEFAULT_GRAINS)}` : null);
|
|
44678
|
-
const
|
|
44693
|
+
const stack = context.stack && context.stack.length >= 2 ? [...context.stack] : null;
|
|
44694
|
+
const split = stack ? null : question.by.find((ref) => parseDimensionRef(ref).grain === null && dimensionFor(context.dimensions, ref)?.kind !== "time") ?? null;
|
|
44679
44695
|
const refuse = (sentence) => ({ ...base, time, split, refused: sentence, first: [], periodsHint: null });
|
|
44680
44696
|
if (!time) return refuse("This answer has no time to chart it over.");
|
|
44697
|
+
if (stack) {
|
|
44698
|
+
const missing = stack.find((k) => !context.measures.some((m) => m.key === k));
|
|
44699
|
+
if (missing) return refuse(`There is no Measure "${missing}" to chart.`);
|
|
44700
|
+
const loose = stack.map((k) => context.measures.find((m) => m.key === k)).find((m) => !m.additive || m.moment);
|
|
44701
|
+
if (loose) return refuse(`${loose.label} does not add up, so it cannot be stacked.`);
|
|
44702
|
+
}
|
|
44681
44703
|
if (!measure) return refuse(`There is no Measure "${measureKey}" to chart.`);
|
|
44682
44704
|
if (split && !measure.additive) {
|
|
44683
44705
|
return refuse(
|
|
@@ -44690,13 +44712,13 @@ function drillChartQuestions(question, seriesLimit = MATRX_DRILL_CHART_SERIES_LI
|
|
|
44690
44712
|
const periodsHint = Number.isFinite(days2) && days2 > 0 ? Math.ceil(days2 / GRAIN_DAYS[grain]) + 1 : null;
|
|
44691
44713
|
const where = trailWhere(question);
|
|
44692
44714
|
const window2 = question.window ?? null;
|
|
44693
|
-
const show = [measureKey];
|
|
44715
|
+
const show = stack ?? [measureKey];
|
|
44694
44716
|
const first = [];
|
|
44695
44717
|
if (split) {
|
|
44696
44718
|
first.push({ key: "series", by: [split], where, show, sort: { key: measureKey, direction: "desc" }, limit, window: window2 });
|
|
44697
44719
|
}
|
|
44698
44720
|
first.push({ key: "periods", by: [time], where, show, sort: null, limit: periodsHint ? clampLimit(periodsHint, ceiling) : null, window: window2 });
|
|
44699
|
-
return { ...base, time, split, refused: null, first, periodsHint };
|
|
44721
|
+
return { ...base, ...stack ? { measure: stack[0], stack } : {}, time, split, refused: null, first, periodsHint };
|
|
44700
44722
|
}
|
|
44701
44723
|
function drillChartCellsQuestion(plan, question, series) {
|
|
44702
44724
|
if (plan.refused || !plan.split || !plan.time) return null;
|
|
@@ -44770,6 +44792,35 @@ function drillChartData(plan, answers, dimensions, measures, emptyLabel = "No va
|
|
|
44770
44792
|
values: {}
|
|
44771
44793
|
};
|
|
44772
44794
|
});
|
|
44795
|
+
if (plan.stack) {
|
|
44796
|
+
const keys2 = plan.stack;
|
|
44797
|
+
const readOf = (row, k) => {
|
|
44798
|
+
const v = row?.measures[k];
|
|
44799
|
+
return v === null || v === void 0 ? null : v;
|
|
44800
|
+
};
|
|
44801
|
+
const totalRow = periodRows.find((r) => rowKind(r) === "total");
|
|
44802
|
+
for (const [i, p] of periodBase.entries()) {
|
|
44803
|
+
const row = groups[i];
|
|
44804
|
+
let sum = null;
|
|
44805
|
+
for (const k of keys2) {
|
|
44806
|
+
const v = readOf(row, k);
|
|
44807
|
+
p.values[`m:${k}`] = v;
|
|
44808
|
+
if (v !== null) sum = (sum ?? 0) + v;
|
|
44809
|
+
}
|
|
44810
|
+
p.total = sum;
|
|
44811
|
+
}
|
|
44812
|
+
const totals = keys2.map((k) => readOf(totalRow, k));
|
|
44813
|
+
const total = totals.every((t) => t === null) ? null : totals.reduce((a, t) => a + (t ?? 0), 0);
|
|
44814
|
+
return {
|
|
44815
|
+
time,
|
|
44816
|
+
split: null,
|
|
44817
|
+
measure: m,
|
|
44818
|
+
series: keys2.map((k, i) => ({ key: `m:${k}`, value: null, label: measures.find((x) => x.key === k)?.label ?? k, other: false, total: totals[i] ?? null })),
|
|
44819
|
+
periods: periodBase,
|
|
44820
|
+
total,
|
|
44821
|
+
says
|
|
44822
|
+
};
|
|
44823
|
+
}
|
|
44773
44824
|
if (!split) {
|
|
44774
44825
|
const key = "all";
|
|
44775
44826
|
for (const p of periodBase) p.values[key] = p.total;
|
|
@@ -44970,6 +45021,9 @@ function drillGroupsAgentInput(nodes, question, dimensions, measures, actions, r
|
|
|
44970
45021
|
|
|
44971
45022
|
// src/data-table/DrillAnswerTable.tsx
|
|
44972
45023
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
45024
|
+
function drillPivotSortKey(measure, value) {
|
|
45025
|
+
return `across:${measure}:${value === null ? "(none)" : value}`;
|
|
45026
|
+
}
|
|
44973
45027
|
var NO_PATHS = [];
|
|
44974
45028
|
function plural(n, noun) {
|
|
44975
45029
|
return `${n.toLocaleString()} ${n === 1 ? noun : `${noun}s`}`;
|
|
@@ -45113,7 +45167,8 @@ function MatrxDrillAnswerTable({
|
|
|
45113
45167
|
pareto,
|
|
45114
45168
|
rowActions,
|
|
45115
45169
|
pivotColumnCap,
|
|
45116
|
-
search
|
|
45170
|
+
search,
|
|
45171
|
+
attributes
|
|
45117
45172
|
}) {
|
|
45118
45173
|
const host = useMatrxDataTableHost();
|
|
45119
45174
|
const tableId = `drill-answer-${(0, import_react15.useId)()}`;
|
|
@@ -45225,8 +45280,18 @@ function MatrxDrillAnswerTable({
|
|
|
45225
45280
|
}
|
|
45226
45281
|
const ref = node.level >= 0 ? question.by[node.level] : void 0;
|
|
45227
45282
|
const color = ref ? drillValueColor(dimensions, ref, node.groups[ref] ?? null) : null;
|
|
45228
|
-
|
|
45283
|
+
const glance = (attributes ?? []).map((a) => {
|
|
45284
|
+
const said = node.level === 0 ? a.read(node.groups) : null;
|
|
45285
|
+
return {
|
|
45286
|
+
id: `attr::${a.key}`,
|
|
45287
|
+
align: "left",
|
|
45288
|
+
aggregate: false,
|
|
45289
|
+
content: node.level !== 0 ? "" : said === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-muted-foreground", children: "\u2026" }) : said === null ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { "data-matrx-drill-attribute": a.key, className: "block max-w-[14rem] truncate text-xs", title: said, children: said })
|
|
45290
|
+
};
|
|
45291
|
+
});
|
|
45292
|
+
return [...glance, ...shown.map((m) => ({ id: m.key, align: "right", aggregate: true, content: valueCell(m, row, parent, color) }))];
|
|
45229
45293
|
};
|
|
45294
|
+
const glanceShown = !pivot && (attributes?.length ?? 0) > 0 ? attributes : [];
|
|
45230
45295
|
const toggleSort = (key) => {
|
|
45231
45296
|
const current = question.sort;
|
|
45232
45297
|
const direction = current?.key === key && current.direction === "desc" ? "asc" : "desc";
|
|
@@ -45236,39 +45301,43 @@ function MatrxDrillAnswerTable({
|
|
|
45236
45301
|
if (question.sort?.key !== key) return null;
|
|
45237
45302
|
return question.sort.direction === "desc" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ArrowDown, { "aria-hidden": "true", className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ArrowUp, { "aria-hidden": "true", className: "h-3 w-3" });
|
|
45238
45303
|
};
|
|
45239
|
-
const measureHeader = (m, id) =>
|
|
45240
|
-
|
|
45241
|
-
|
|
45242
|
-
|
|
45243
|
-
|
|
45244
|
-
|
|
45245
|
-
|
|
45246
|
-
|
|
45247
|
-
|
|
45248
|
-
|
|
45249
|
-
|
|
45250
|
-
|
|
45251
|
-
|
|
45252
|
-
|
|
45253
|
-
|
|
45254
|
-
|
|
45255
|
-
|
|
45256
|
-
|
|
45257
|
-
|
|
45258
|
-
"
|
|
45259
|
-
|
|
45260
|
-
|
|
45261
|
-
|
|
45262
|
-
|
|
45263
|
-
|
|
45264
|
-
|
|
45265
|
-
|
|
45266
|
-
|
|
45267
|
-
|
|
45268
|
-
|
|
45269
|
-
|
|
45304
|
+
const measureHeader = (m, id, column) => {
|
|
45305
|
+
const key = column ? drillPivotSortKey(m.key, column.value) : m.key;
|
|
45306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("th", { scope: "col", className: "whitespace-nowrap px-2 py-2 text-right text-xs font-medium text-muted-foreground", children: [
|
|
45307
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
45308
|
+
"button",
|
|
45309
|
+
{
|
|
45310
|
+
type: "button",
|
|
45311
|
+
"data-matrx-drill-sort": key,
|
|
45312
|
+
"aria-label": `Sort groups by ${m.label}`,
|
|
45313
|
+
title: m.description,
|
|
45314
|
+
onClick: () => toggleSort(key),
|
|
45315
|
+
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
45316
|
+
children: [
|
|
45317
|
+
m.label,
|
|
45318
|
+
sortMark(key)
|
|
45319
|
+
]
|
|
45320
|
+
}
|
|
45321
|
+
),
|
|
45322
|
+
comparing ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
45323
|
+
"button",
|
|
45324
|
+
{
|
|
45325
|
+
type: "button",
|
|
45326
|
+
"data-matrx-drill-sort": `delta:${m.key}`,
|
|
45327
|
+
"aria-label": `Sort groups by the change in ${m.label}`,
|
|
45328
|
+
title: "Sort by the change against the prior window",
|
|
45329
|
+
onClick: () => toggleSort(`delta:${m.key}`),
|
|
45330
|
+
className: "ml-1.5 inline-flex items-center gap-0.5 hover:text-foreground",
|
|
45331
|
+
children: [
|
|
45332
|
+
"\u0394",
|
|
45333
|
+
sortMark(`delta:${m.key}`)
|
|
45334
|
+
]
|
|
45335
|
+
}
|
|
45336
|
+
) : null
|
|
45337
|
+
] }, id);
|
|
45338
|
+
};
|
|
45270
45339
|
const labelHeader = question.by.map((ref) => dimensionRefLabel(dimensions, ref)).join(" \u203A ");
|
|
45271
|
-
const colCount = 1 + (pivot && columns ? (columns.length + 1) * shown.length : shown.length) + 1;
|
|
45340
|
+
const colCount = 1 + glanceShown.length + (pivot && columns ? (columns.length + 1) * shown.length : shown.length) + 1;
|
|
45272
45341
|
const renderOther = (other, depth, key, siblings = []) => {
|
|
45273
45342
|
if (!other) return null;
|
|
45274
45343
|
const distinct = siblings.reduce((m, n) => {
|
|
@@ -45425,6 +45494,7 @@ function MatrxDrillAnswerTable({
|
|
|
45425
45494
|
type: "button",
|
|
45426
45495
|
"data-matrx-drill-sort": "label",
|
|
45427
45496
|
"aria-label": `Sort groups by ${labelHeader}`,
|
|
45497
|
+
title: question.by.length === 1 ? dimensionFor(dimensions, question.by[0])?.description : void 0,
|
|
45428
45498
|
onClick: () => toggleSort("label"),
|
|
45429
45499
|
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
45430
45500
|
children: [
|
|
@@ -45433,7 +45503,12 @@ function MatrxDrillAnswerTable({
|
|
|
45433
45503
|
]
|
|
45434
45504
|
}
|
|
45435
45505
|
) }),
|
|
45436
|
-
|
|
45506
|
+
glanceShown.map((a) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { scope: "col", "data-matrx-drill-attribute-header": a.key, title: a.description, className: "whitespace-nowrap px-2 py-2 text-left text-xs font-medium text-muted-foreground", children: a.label }, `attr-${a.key}`)),
|
|
45507
|
+
pivot && columns ? [
|
|
45508
|
+
// a named pivot column sorts by its own cell (L5); the rest column and the total by the row's number
|
|
45509
|
+
...columns.flatMap((c) => shown.map((m) => measureHeader(m, `${c.value ?? "\u2205"}::${m.key}`, c.other ? void 0 : { value: c.value }))),
|
|
45510
|
+
...shown.map((m) => measureHeader(m, `total::${m.key}`))
|
|
45511
|
+
] : shown.map((m) => measureHeader(m, m.key)),
|
|
45437
45512
|
pivot ? null : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { className: "w-8", "aria-label": "Drill options" })
|
|
45438
45513
|
] })
|
|
45439
45514
|
] }),
|
|
@@ -45454,6 +45529,7 @@ function MatrxDrillAnswerTable({
|
|
|
45454
45529
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "pl-[1.625rem]", children: "Total" }),
|
|
45455
45530
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "ml-1.5 text-xs font-normal text-muted-foreground", children: plural(tree.total.row_count, rowNoun) })
|
|
45456
45531
|
] }),
|
|
45532
|
+
glanceShown.map((a) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", {}, `t-attr-${a.key}`)),
|
|
45457
45533
|
pivot && columns ? [
|
|
45458
45534
|
...columns.flatMap(
|
|
45459
45535
|
(column) => shown.map((m) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-2 py-2 text-right text-xs", children: formatMeasure(m, column.total.measures[m.key]) }, `t-${column.value ?? "\u2205"}-${m.key}`))
|