derive-dashboards 0.5.1 → 0.7.0
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/README.md +4 -2
- package/dist/body.mjs +2 -2
- package/dist/charts/data/buckets.d.mts +11 -0
- package/dist/charts/data/buckets.mjs +66 -0
- package/dist/charts/data/clean.mjs +55 -0
- package/dist/charts/data/format.d.mts +19 -0
- package/dist/charts/data/format.mjs +174 -0
- package/dist/charts/data/input-error.d.mts +5 -0
- package/dist/charts/data/input-error.mjs +11 -0
- package/dist/charts/data/range.mjs +14 -0
- package/dist/charts/data/rows.d.mts +13 -0
- package/dist/charts/data/rows.mjs +31 -0
- package/dist/charts/data/shares.mjs +55 -0
- package/dist/charts/data/types.d.mts +106 -0
- package/dist/charts/data/words.d.mts +44 -0
- package/dist/charts/data/words.mjs +31 -0
- package/dist/charts/describe.mjs +110 -0
- package/dist/charts/index.d.mts +34 -0
- package/dist/charts/index.mjs +24 -0
- package/dist/charts/kinds/area-marks.mjs +120 -0
- package/dist/charts/kinds/area.d.mts +23 -0
- package/dist/charts/kinds/area.mjs +71 -0
- package/dist/charts/kinds/bars-data.d.mts +11 -0
- package/dist/charts/kinds/bars-data.mjs +30 -0
- package/dist/charts/kinds/bars-layout.mjs +30 -0
- package/dist/charts/kinds/bars-marks.mjs +93 -0
- package/dist/charts/kinds/bars-words.mjs +56 -0
- package/dist/charts/kinds/bars.d.mts +17 -0
- package/dist/charts/kinds/bars.mjs +68 -0
- package/dist/charts/kinds/columns-data.mjs +116 -0
- package/dist/charts/kinds/columns-layout.mjs +29 -0
- package/dist/charts/kinds/columns-marks.mjs +200 -0
- package/dist/charts/kinds/columns-words.mjs +26 -0
- package/dist/charts/kinds/columns.d.mts +13 -0
- package/dist/charts/kinds/columns.mjs +80 -0
- package/dist/charts/kinds/dumbbell-data.d.mts +22 -0
- package/dist/charts/kinds/dumbbell-data.mjs +59 -0
- package/dist/charts/kinds/dumbbell-layout.mjs +113 -0
- package/dist/charts/kinds/dumbbell-marks.mjs +119 -0
- package/dist/charts/kinds/dumbbell-words.d.mts +7 -0
- package/dist/charts/kinds/dumbbell-words.mjs +94 -0
- package/dist/charts/kinds/dumbbell.d.mts +14 -0
- package/dist/charts/kinds/dumbbell.mjs +67 -0
- package/dist/charts/kinds/funnel-data.d.mts +11 -0
- package/dist/charts/kinds/funnel-data.mjs +70 -0
- package/dist/charts/kinds/funnel-layout.mjs +32 -0
- package/dist/charts/kinds/funnel-marks.mjs +204 -0
- package/dist/charts/kinds/funnel-words.mjs +77 -0
- package/dist/charts/kinds/funnel.d.mts +11 -0
- package/dist/charts/kinds/funnel.mjs +75 -0
- package/dist/charts/kinds/grid-data.d.mts +18 -0
- package/dist/charts/kinds/grid-data.mjs +35 -0
- package/dist/charts/kinds/grid-layout.mjs +77 -0
- package/dist/charts/kinds/grid-marks.mjs +140 -0
- package/dist/charts/kinds/grid-time.mjs +41 -0
- package/dist/charts/kinds/grid-words.mjs +86 -0
- package/dist/charts/kinds/grid.d.mts +22 -0
- package/dist/charts/kinds/grid.mjs +55 -0
- package/dist/charts/kinds/histogram-data.mjs +142 -0
- package/dist/charts/kinds/histogram-layout.mjs +144 -0
- package/dist/charts/kinds/histogram-marks.mjs +110 -0
- package/dist/charts/kinds/histogram-words.mjs +104 -0
- package/dist/charts/kinds/histogram.d.mts +15 -0
- package/dist/charts/kinds/histogram.mjs +47 -0
- package/dist/charts/kinds/line-marks.mjs +36 -0
- package/dist/charts/kinds/line.d.mts +17 -0
- package/dist/charts/kinds/line.mjs +52 -0
- package/dist/charts/kinds/multiples-grid.mjs +107 -0
- package/dist/charts/kinds/multiples-head.mjs +44 -0
- package/dist/charts/kinds/multiples-layout.mjs +159 -0
- package/dist/charts/kinds/multiples-marks.mjs +95 -0
- package/dist/charts/kinds/multiples-words.mjs +110 -0
- package/dist/charts/kinds/multiples.d.mts +26 -0
- package/dist/charts/kinds/multiples.mjs +42 -0
- package/dist/charts/kinds/row-chart.mjs +112 -0
- package/dist/charts/kinds/row-marks.mjs +121 -0
- package/dist/charts/kinds/scatter-data.d.mts +18 -0
- package/dist/charts/kinds/scatter-data.mjs +123 -0
- package/dist/charts/kinds/scatter-layout.mjs +189 -0
- package/dist/charts/kinds/scatter-marks.mjs +149 -0
- package/dist/charts/kinds/scatter-words.mjs +80 -0
- package/dist/charts/kinds/scatter.d.mts +21 -0
- package/dist/charts/kinds/scatter.mjs +72 -0
- package/dist/charts/kinds/stat-data.mjs +91 -0
- package/dist/charts/kinds/stat-layout.mjs +108 -0
- package/dist/charts/kinds/stat-marks.mjs +85 -0
- package/dist/charts/kinds/stat-words.mjs +57 -0
- package/dist/charts/kinds/stat.d.mts +28 -0
- package/dist/charts/kinds/stat.mjs +35 -0
- package/dist/charts/kinds/time-chart.mjs +74 -0
- package/dist/charts/kinds/time-frame.mjs +113 -0
- package/dist/charts/kinds/time-notes.mjs +36 -0
- package/dist/charts/kinds/time-plan.d.mts +8 -0
- package/dist/charts/kinds/time-plan.mjs +57 -0
- package/dist/charts/kinds/time-plot.mjs +56 -0
- package/dist/charts/kinds/time-stops.mjs +56 -0
- package/dist/charts/kinds/value-plot.mjs +33 -0
- package/dist/charts/kinds/waterfall-data.d.mts +7 -0
- package/dist/charts/kinds/waterfall-data.mjs +71 -0
- package/dist/charts/kinds/waterfall-layout.mjs +38 -0
- package/dist/charts/kinds/waterfall-marks.mjs +82 -0
- package/dist/charts/kinds/waterfall-words.mjs +118 -0
- package/dist/charts/kinds/waterfall.d.mts +17 -0
- package/dist/charts/kinds/waterfall.mjs +66 -0
- package/dist/charts/layout/boxes.mjs +28 -0
- package/dist/charts/layout/dodge.mjs +75 -0
- package/dist/charts/layout/extent.mjs +25 -0
- package/dist/charts/layout/frame.mjs +97 -0
- package/dist/charts/layout/place-labels.mjs +101 -0
- package/dist/charts/layout/stack.mjs +31 -0
- package/dist/charts/marks/axes.mjs +137 -0
- package/dist/charts/marks/dot.mjs +31 -0
- package/dist/charts/marks/end-labels.mjs +124 -0
- package/dist/charts/marks/legend.mjs +141 -0
- package/dist/charts/marks/lines.d.mts +2 -0
- package/dist/charts/marks/lines.mjs +38 -0
- package/dist/charts/marks/lit.d.mts +3 -0
- package/dist/charts/marks/lit.mjs +63 -0
- package/dist/charts/marks/more.mjs +18 -0
- package/dist/charts/marks/notes.mjs +253 -0
- package/dist/charts/marks/series-line.mjs +110 -0
- package/dist/charts/marks/thin.mjs +138 -0
- package/dist/charts/marks/x-axis.mjs +32 -0
- package/dist/charts/scale/calendar.mjs +174 -0
- package/dist/charts/scale/time-ticks.mjs +154 -0
- package/dist/charts/scale/time.mjs +33 -0
- package/dist/charts/scale/value.mjs +161 -0
- package/dist/charts/scene/defs.mjs +33 -0
- package/dist/charts/scene/markup.mjs +35 -0
- package/dist/charts/scene/nearest.d.mts +11 -0
- package/dist/charts/scene/nearest.mjs +49 -0
- package/dist/charts/scene/paint.d.mts +12 -0
- package/dist/charts/scene/paint.mjs +13 -0
- package/dist/charts/scene/svg.d.mts +18 -0
- package/dist/charts/scene/svg.mjs +185 -0
- package/dist/charts/scene/types.d.mts +177 -0
- package/dist/charts/text/measure.d.mts +9 -0
- package/dist/charts/text/measure.mjs +123 -0
- package/dist/charts/theme.d.mts +47 -0
- package/dist/charts/theme.mjs +239 -0
- package/dist/charts-react/Chart.d.mts +91 -0
- package/dist/charts-react/Chart.mjs +166 -0
- package/dist/charts-react/Overlay.mjs +171 -0
- package/dist/charts-react/Picture.mjs +22 -0
- package/dist/charts-react/Reader.mjs +147 -0
- package/dist/charts-react/bucket-names.mjs +29 -0
- package/dist/charts-react/chart-unlayered.css +1 -0
- package/dist/charts-react/chart-unlayered.css.d.ts +1 -0
- package/dist/charts-react/chart.css +1 -0
- package/dist/charts-react/chart.css.d.ts +1 -0
- package/dist/charts-react/events.mjs +72 -0
- package/dist/charts-react/exact-sum.mjs +24 -0
- package/dist/charts-react/from-answer.mjs +185 -0
- package/dist/charts-react/index.d.mts +3 -0
- package/dist/charts-react/index.mjs +4 -0
- package/dist/charts-react/keys.mjs +117 -0
- package/dist/charts-react/opens.mjs +28 -0
- package/dist/charts-react/plan-bars.mjs +95 -0
- package/dist/charts-react/plan-funnel.mjs +120 -0
- package/dist/charts-react/plan-grid.mjs +121 -0
- package/dist/charts-react/plan-parts.d.mts +2 -0
- package/dist/charts-react/plan-parts.mjs +30 -0
- package/dist/charts-react/plan-time.mjs +84 -0
- package/dist/charts-react/plan.d.mts +3 -0
- package/dist/charts-react/plan.mjs +37 -0
- package/dist/charts-react/point-keys.mjs +22 -0
- package/dist/charts-react/pointer.mjs +99 -0
- package/dist/charts-react/reader-page.d.mts +8 -0
- package/dist/charts-react/reader-page.mjs +116 -0
- package/dist/charts-react/tiles.d.mts +24 -0
- package/dist/charts-react/tiles.mjs +142 -0
- package/dist/charts-react/tip-place.mjs +107 -0
- package/dist/charts-react/tip-room.mjs +31 -0
- package/dist/charts-react/useClientLayoutEffect.mjs +8 -0
- package/dist/charts-react/useScene.mjs +76 -0
- package/dist/charts-react/useSize.mjs +44 -0
- package/dist/charts-react/useStop.mjs +68 -0
- package/dist/core/conformance/memory/aggregate.mjs +2 -1
- package/dist/core/conformance/memory/rows.mjs +1 -1
- package/dist/core/conformance/memory/source.mjs +3 -2
- package/dist/core/document/display-comparisons.mjs +49 -0
- package/dist/core/document/display-entries.mjs +2 -1
- package/dist/core/document/display-validation.d.mts +12 -0
- package/dist/core/document/display-validation.mjs +56 -0
- package/dist/core/document/display.d.mts +27 -12
- package/dist/core/document/display.mjs +40 -49
- package/dist/core/document/view-layout.mjs +16 -0
- package/dist/core/engine/access.mjs +4 -2
- package/dist/core/engine/context.mjs +5 -7
- package/dist/core/engine/custom/cells.mjs +1 -1
- package/dist/core/engine/custom/records.mjs +2 -1
- package/dist/core/engine/dialect.d.mts +2 -0
- package/dist/core/engine/index.mjs +1 -1
- package/dist/core/engine/levels.mjs +33 -1
- package/dist/core/engine/plan.d.mts +2 -0
- package/dist/core/engine/postgres.mjs +1 -0
- package/dist/core/engine/rank.mjs +1 -1
- package/dist/core/engine/reader.d.mts +4 -0
- package/dist/core/engine/sql-partition.mjs +45 -0
- package/dist/core/engine/sql-reads.mjs +4 -1
- package/dist/core/engine/statement.mjs +4 -4
- package/dist/core/engine/version.d.mts +1 -1
- package/dist/core/engine/version.mjs +1 -1
- package/dist/core/error/codes.d.mts +1 -1
- package/dist/core/error/codes.mjs +1 -1
- package/dist/core/exact/decimal.d.mts +1 -4
- package/dist/core/exact/decimal.mjs +1 -14
- package/dist/core/exact/text.d.mts +5 -0
- package/dist/core/exact/text.mjs +19 -0
- package/dist/core/index.d.mts +9 -6
- package/dist/core/index.mjs +11 -8
- package/dist/core/model/types.d.mts +2 -0
- package/dist/core/model/validate/fields.mjs +1 -1
- package/dist/core/model/validate/known-members.mjs +2 -0
- package/dist/core/model/validate/shape.mjs +5 -1
- package/dist/core/oracle/visibility.mjs +2 -2
- package/dist/core/policy/bind.mjs +29 -1
- package/dist/core/query/drill/compose.d.mts +2 -0
- package/dist/core/query/drill/compose.mjs +1 -1
- package/dist/core/query/drill/synthetic.mjs +2 -1
- package/dist/core/query/drill/types.d.mts +7 -0
- package/dist/core/query/drill/types.mjs +3 -1
- package/dist/core/result/number.mjs +2 -1
- package/dist/core/result/time-axis.mjs +2 -1
- package/dist/core/schema/answers.d.mts +1176 -362
- package/dist/core/schema/commands.mjs +2 -1
- package/dist/core/schema/document.mjs +27 -2
- package/dist/core/schema/drill-answers.mjs +19 -1
- package/dist/core/schema/drill.d.mts +21 -6
- package/dist/core/schema/drill.mjs +7 -1
- package/dist/core/schema/index.d.mts +2 -1
- package/dist/core/schema/index.mjs +2 -1
- package/dist/core/schema/null-ops.d.mts +6 -0
- package/dist/core/schema/null-ops.mjs +18 -0
- package/dist/core/schema/query.mjs +30 -4
- package/dist/core/schema/tools.mjs +13 -0
- package/dist/core/schema/union-error.mjs +38 -0
- package/dist/core/time/bucket.mjs +2 -1
- package/dist/core/time/index.d.mts +3 -2
- package/dist/core/time/instant.d.mts +1 -2
- package/dist/core/time/instant.mjs +2 -30
- package/dist/core/time/range.mjs +2 -1
- package/dist/core/time/stored.mjs +2 -1
- package/dist/core/time/text-time.d.mts +10 -0
- package/dist/core/time/text-time.mjs +80 -0
- package/dist/core/types/api.d.mts +1 -1
- package/dist/core/types/api.mjs +1 -1
- package/dist/core/types/drill-api.d.mts +22 -2
- package/dist/dashboard-documents.d.mts +8 -0
- package/dist/dashboard-documents.mjs +52 -0
- package/dist/drill-access.mjs +40 -3
- package/dist/drill-comparison.mjs +71 -0
- package/dist/drill-crumbs.mjs +21 -2
- package/dist/drill-group-seal.mjs +13 -0
- package/dist/drill-open.mjs +7 -1
- package/dist/drill-seal.mjs +4 -6
- package/dist/drill-views.mjs +5 -13
- package/dist/drill.mjs +28 -58
- package/dist/editing.mjs +1 -1
- package/dist/endpoints/drill.mjs +2 -3
- package/dist/endpoints/index.d.mts +20 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +6 -27
- package/dist/llms.txt +1 -1
- package/dist/react/Cell.mjs +2 -2
- package/dist/react/DashboardList.mjs +3 -3
- package/dist/react/Editing.mjs +3 -3
- package/dist/react/Header.mjs +2 -2
- package/dist/react/History.mjs +3 -3
- package/dist/react/Parts.mjs +2 -2
- package/dist/react/RowBody.d.mts +2 -4
- package/dist/react/RowBody.mjs +14 -39
- package/dist/react/Tile.mjs +4 -5
- package/dist/react/builder/FilterEditor.mjs +2 -2
- package/dist/react/builder/Picker.mjs +3 -3
- package/dist/react/builder/RangeEditor.mjs +3 -3
- package/dist/react/builder/Time.mjs +3 -3
- package/dist/react/builder/Values.mjs +2 -2
- package/dist/react/builder/WidgetBuilder.mjs +2 -2
- package/dist/react/digits.mjs +1 -1
- package/dist/react/drill/Bars.mjs +34 -38
- package/dist/react/drill/Comparison.mjs +204 -0
- package/dist/react/drill/Controls.mjs +8 -12
- package/dist/react/drill/DrillDrawer.mjs +42 -0
- package/dist/react/drill/DrillPanel.mjs +61 -41
- package/dist/react/drill/Header.mjs +65 -35
- package/dist/react/drill/ItemLink.mjs +40 -0
- package/dist/react/drill/Items.d.mts +2 -1
- package/dist/react/drill/Items.mjs +126 -99
- package/dist/react/drill/ItemsBody.mjs +38 -0
- package/dist/react/drill/ItemsFoot.mjs +24 -19
- package/dist/react/drill/Notes.mjs +23 -13
- package/dist/react/drill/PanelBody.mjs +7 -25
- package/dist/react/drill/RecordRow.mjs +47 -0
- package/dist/react/drill/Trend.mjs +186 -0
- package/dist/react/drill/board.mjs +21 -11
- package/dist/react/drill/drawer-context.mjs +5 -0
- package/dist/react/drill/item-parts.mjs +53 -35
- package/dist/react/drill/item-type.d.mts +2 -2
- package/dist/react/drill/lazy.d.mts +1 -4
- package/dist/react/drill/lazy.mjs +29 -11
- package/dist/react/drill/panel-focus.mjs +18 -7
- package/dist/react/drill/props.d.mts +7 -1
- package/dist/react/drill/props.mjs +39 -8
- package/dist/react/drill/record-page.mjs +61 -0
- package/dist/react/drill/state.mjs +17 -2
- package/dist/react/drill/trend-touch.mjs +33 -0
- package/dist/react/drill/useDrill.d.mts +3 -3
- package/dist/react/drill/useDrill.mjs +35 -15
- package/dist/react/drill/words.d.mts +14 -0
- package/dist/react/drill/words.mjs +20 -8
- package/dist/react/english.d.mts +4 -1
- package/dist/react/english.mjs +17 -2
- package/dist/react/filters/chip.mjs +2 -2
- package/dist/react/filters/menu-search.mjs +5 -5
- package/dist/react/filters/menu.mjs +2 -2
- package/dist/react/filters/number.mjs +2 -2
- package/dist/react/filters/operator.mjs +2 -2
- package/dist/react/filters/phone.mjs +2 -2
- package/dist/react/filters/values.mjs +4 -4
- package/dist/react/format-time.d.mts +2 -1
- package/dist/react/format-time.mjs +42 -34
- package/dist/react/format.mjs +15 -3
- package/dist/react/index.d.mts +4 -3
- package/dist/react/index.mjs +4 -3
- package/dist/react/messages.d.mts +23 -2
- package/dist/react/renderers/entries.d.mts +11 -0
- package/dist/react/renderers/list.mjs +8 -10
- package/dist/react/renderers/table-cells.mjs +38 -9
- package/dist/react/renderers/table-measure.mjs +2 -0
- package/dist/react/renderers/table-row.mjs +64 -7
- package/dist/react/renderers/table-sort.mjs +2 -8
- package/dist/react/renderers/table.mjs +16 -15
- package/dist/react/series.mjs +8 -3
- package/dist/react/theme-unlayered.css +1 -3144
- package/dist/react/theme.css +1 -3146
- package/dist/recharts/parts.mjs +1 -1
- package/dist/skills/derive-dashboards/SKILL.md +10 -5
- package/dist/store/apply.mjs +2 -2
- package/dist/store/editor.mjs +2 -2
- package/dist/store/writer.mjs +2 -2
- package/package.json +27 -2
|
@@ -1,47 +1,14 @@
|
|
|
1
1
|
import { isNumberType } from "../columns.mjs";
|
|
2
2
|
import { useDashboards } from "../context.mjs";
|
|
3
3
|
import { formatCell } from "../format.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { columnShape, itemParts,
|
|
4
|
+
import { Opener, hrefOf } from "./ItemLink.mjs";
|
|
5
|
+
import { columnShape, itemParts, itemTitle, recordField, recordParts, sortDate } from "./item-parts.mjs";
|
|
6
6
|
import { asItem } from "./item-type.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { RecordHeading, RecordRow } from "./RecordRow.mjs";
|
|
8
|
+
import { RecordPager, useRecordPage } from "./record-page.mjs";
|
|
9
|
+
import { useEffect, useRef } from "react";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
// src/drill/Items.tsx
|
|
11
|
-
const plainClick = (event) => event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey;
|
|
12
|
-
/**
|
|
13
|
-
* An item's link: the host's `itemHref` when it gives one (its `undefined` turns the link off),
|
|
14
|
-
* else its source's `itemLinks` template, else the server's. A hidden key never has one.
|
|
15
|
-
*/
|
|
16
|
-
const hrefOf = (options, item) => options.itemHref === void 0 ? itemLink(options.itemLinks, item) ?? item.link : options.itemHref(asItem(item));
|
|
17
|
-
/** How an item opens: as a link, a button, or not at all. */
|
|
18
|
-
function Opener(props) {
|
|
19
|
-
const { link: Link = "a" } = useDashboards();
|
|
20
|
-
const { item, options } = props;
|
|
21
|
-
const href = hrefOf(options, item);
|
|
22
|
-
const onItem = options.onItem;
|
|
23
|
-
if (href === void 0 && onItem === void 0) return /* @__PURE__ */ jsx("div", {
|
|
24
|
-
className: props.className,
|
|
25
|
-
children: props.children
|
|
26
|
-
});
|
|
27
|
-
if (href === void 0) return /* @__PURE__ */ jsx("button", {
|
|
28
|
-
type: "button",
|
|
29
|
-
className: props.className,
|
|
30
|
-
onClick: (event) => onItem?.(asItem(item), { event }),
|
|
31
|
-
children: props.children
|
|
32
|
-
});
|
|
33
|
-
const onClick = (event) => {
|
|
34
|
-
if (onItem === void 0 || !plainClick(event)) return;
|
|
35
|
-
event.preventDefault();
|
|
36
|
-
onItem(asItem(item), { event });
|
|
37
|
-
};
|
|
38
|
-
return /* @__PURE__ */ jsx(Link, {
|
|
39
|
-
href,
|
|
40
|
-
className: props.className,
|
|
41
|
-
onClick,
|
|
42
|
-
children: props.children
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
12
|
/** A noun as a column heading: "task" reads "Task". */
|
|
46
13
|
const headOf = (noun) => noun === void 0 ? void 0 : `${noun.charAt(0).toLocaleUpperCase()}${noun.slice(1)}`;
|
|
47
14
|
/**
|
|
@@ -52,14 +19,18 @@ const headOf = (noun) => noun === void 0 ? void 0 : `${noun.charAt(0).toLocaleUp
|
|
|
52
19
|
function Table(props) {
|
|
53
20
|
const format = useDashboards();
|
|
54
21
|
const { view } = props;
|
|
22
|
+
const body = useAppendedRow(props);
|
|
55
23
|
const cell = {
|
|
56
24
|
...format,
|
|
57
25
|
timeZone: props.timeZone
|
|
58
26
|
};
|
|
59
|
-
const
|
|
27
|
+
const priority = (member) => member === view.sorted?.member ? 0 : view.fixed?.includes(member) === true ? 2 : 1;
|
|
28
|
+
const rest = view.columns.filter((c) => c.member !== view.title).toSorted((a, b) => priority(a.member) - priority(b.member));
|
|
60
29
|
const named = view.columns.find((c) => c.member === view.title);
|
|
61
|
-
return /* @__PURE__ */ jsx("
|
|
30
|
+
return /* @__PURE__ */ jsx("section", {
|
|
62
31
|
className: "dd-records-scroll",
|
|
32
|
+
tabIndex: 0,
|
|
33
|
+
"aria-label": format.messages.drillViews.items,
|
|
63
34
|
children: /* @__PURE__ */ jsxs("table", {
|
|
64
35
|
className: "dd-table",
|
|
65
36
|
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
|
|
@@ -69,21 +40,28 @@ function Table(props) {
|
|
|
69
40
|
scope: "col",
|
|
70
41
|
"data-numeric": isNumberType(c.type),
|
|
71
42
|
children: c.label
|
|
72
|
-
}, c.member))] }) }), /* @__PURE__ */ jsx("tbody", {
|
|
73
|
-
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
43
|
+
}, c.member))] }) }), /* @__PURE__ */ jsx("tbody", {
|
|
44
|
+
ref: body,
|
|
45
|
+
children: props.items.map((item, i) => /* @__PURE__ */ jsxs("tr", {
|
|
46
|
+
tabIndex: -1,
|
|
47
|
+
children: [/* @__PURE__ */ jsx("th", {
|
|
48
|
+
scope: "row",
|
|
49
|
+
children: /* @__PURE__ */ jsx(Opener, {
|
|
50
|
+
item,
|
|
51
|
+
options: props.options,
|
|
52
|
+
className: "dd-item-cell",
|
|
53
|
+
children: itemTitle(named, item, {
|
|
54
|
+
n: props.start + i + 1,
|
|
55
|
+
noun: props.noun
|
|
56
|
+
}, cell)
|
|
57
|
+
})
|
|
58
|
+
}), rest.map((c) => /* @__PURE__ */ jsx("td", {
|
|
59
|
+
"data-numeric": isNumberType(c.type),
|
|
60
|
+
"data-type": c.type,
|
|
61
|
+
children: formatCell(item.values[c.member] ?? null, columnShape(c), cell)
|
|
62
|
+
}, c.member))]
|
|
63
|
+
}, item.id))
|
|
64
|
+
})]
|
|
87
65
|
})
|
|
88
66
|
});
|
|
89
67
|
}
|
|
@@ -99,71 +77,120 @@ function helpersOf(options, item, base) {
|
|
|
99
77
|
} }
|
|
100
78
|
};
|
|
101
79
|
}
|
|
102
|
-
/**
|
|
103
|
-
function
|
|
104
|
-
const format = useDashboards();
|
|
105
|
-
const { view, options } = props;
|
|
80
|
+
/** Reveal the first new record for keyboard and pointer users, including read-only records. */
|
|
81
|
+
function useAppendedRow({ loaded, start }) {
|
|
106
82
|
const list = useRef(null);
|
|
107
|
-
const seen = useRef(
|
|
83
|
+
const seen = useRef(loaded);
|
|
108
84
|
useEffect(() => {
|
|
109
85
|
const before = seen.current;
|
|
110
|
-
seen.current =
|
|
111
|
-
if (
|
|
112
|
-
list.current?.children[before
|
|
113
|
-
|
|
86
|
+
seen.current = loaded;
|
|
87
|
+
if (loaded <= before || before === 0 || before < start) return;
|
|
88
|
+
const row = list.current?.children[before - start];
|
|
89
|
+
if (!(row instanceof HTMLElement)) return;
|
|
90
|
+
const target = row.querySelector("a[href], button:not(:disabled), [tabindex]") ?? row;
|
|
91
|
+
target.focus({ preventScroll: true });
|
|
92
|
+
target.scrollIntoView({
|
|
93
|
+
block: "nearest",
|
|
94
|
+
inline: "nearest"
|
|
95
|
+
});
|
|
96
|
+
}, [loaded, start]);
|
|
97
|
+
return list;
|
|
98
|
+
}
|
|
99
|
+
function List(props) {
|
|
100
|
+
const format = useDashboards();
|
|
101
|
+
const { view, options } = props;
|
|
102
|
+
const list = useAppendedRow(props);
|
|
114
103
|
const cell = {
|
|
115
104
|
...format,
|
|
116
105
|
timeZone: props.timeZone
|
|
117
106
|
};
|
|
107
|
+
const field = recordField(view);
|
|
108
|
+
const sorted = sortDate(view);
|
|
118
109
|
return /* @__PURE__ */ jsx("ul", {
|
|
119
110
|
className: "dd-items",
|
|
120
111
|
ref: list,
|
|
121
112
|
children: props.items.map((item, i) => {
|
|
122
|
-
const parts = itemParts(view, item, {
|
|
123
|
-
n: i + 1,
|
|
124
|
-
noun: props.noun
|
|
125
|
-
}, cell);
|
|
126
113
|
const render = options.renderItem;
|
|
114
|
+
const row = {
|
|
115
|
+
n: props.start + i + 1,
|
|
116
|
+
noun: props.noun
|
|
117
|
+
};
|
|
127
118
|
const opens = hrefOf(options, item) !== void 0 || options.onItem !== void 0;
|
|
128
|
-
return /* @__PURE__ */ jsx("li", {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
119
|
+
return /* @__PURE__ */ jsx("li", {
|
|
120
|
+
tabIndex: -1,
|
|
121
|
+
children: render === void 0 ? /* @__PURE__ */ jsx(Opener, {
|
|
122
|
+
item,
|
|
123
|
+
options,
|
|
124
|
+
className: "dd-item",
|
|
125
|
+
children: /* @__PURE__ */ jsx(RecordRow, {
|
|
126
|
+
parts: recordParts(view, item, {
|
|
127
|
+
...row,
|
|
128
|
+
date: sorted?.member
|
|
129
|
+
}, cell),
|
|
130
|
+
opens,
|
|
131
|
+
date: sorted?.label,
|
|
132
|
+
field,
|
|
133
|
+
value: field && formatCell(item.values[field.member] ?? null, columnShape(field), cell)
|
|
134
|
+
})
|
|
135
|
+
}) : render(asItem(item), helpersOf(options, item, {
|
|
136
|
+
...itemParts(view, item, row, cell),
|
|
137
|
+
view
|
|
138
|
+
}))
|
|
139
|
+
}, item.id);
|
|
143
140
|
})
|
|
144
141
|
});
|
|
145
142
|
}
|
|
146
|
-
/** The
|
|
143
|
+
/** The toggle survives both layouts and takes focus back when the wide table closes. */
|
|
144
|
+
function useReturnToSummary(fields) {
|
|
145
|
+
const toggle = useRef(null);
|
|
146
|
+
const previous = useRef(fields);
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
if (previous.current && !fields) toggle.current?.focus({ preventScroll: true });
|
|
149
|
+
previous.current = fields;
|
|
150
|
+
}, [fields]);
|
|
151
|
+
return toggle;
|
|
152
|
+
}
|
|
153
|
+
/** The same page of records as a summary list or a full table. */
|
|
147
154
|
function Items(props) {
|
|
148
155
|
const format = useDashboards();
|
|
149
156
|
const { view, Empty } = props;
|
|
150
|
-
const
|
|
157
|
+
const toggle = useReturnToSummary(props.fields);
|
|
158
|
+
const page = useRecordPage(props.items);
|
|
159
|
+
const visible = {
|
|
160
|
+
...props,
|
|
161
|
+
start: page.start,
|
|
162
|
+
items: page.items,
|
|
163
|
+
loaded: props.items.length
|
|
164
|
+
};
|
|
151
165
|
if (props.items.length === 0) return Empty === void 0 ? /* @__PURE__ */ jsx("p", {
|
|
152
166
|
className: "dd-tile-state",
|
|
153
167
|
children: format.messages.drillNoItems
|
|
154
168
|
}) : /* @__PURE__ */ jsx(Empty, {});
|
|
155
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
170
|
+
/* @__PURE__ */ jsxs("div", {
|
|
171
|
+
className: "dd-drill-records-head",
|
|
172
|
+
children: [props.count(page.paged ? {
|
|
173
|
+
first: page.start + 1,
|
|
174
|
+
last: page.end
|
|
175
|
+
} : void 0), /* @__PURE__ */ jsx("button", {
|
|
176
|
+
className: "dd-records-switch",
|
|
177
|
+
ref: toggle,
|
|
178
|
+
type: "button",
|
|
179
|
+
onClick: props.switchMode,
|
|
180
|
+
"aria-expanded": props.fields,
|
|
181
|
+
children: props.fields ? format.messages.drillList : format.messages.drillTable
|
|
182
|
+
})]
|
|
183
|
+
}),
|
|
184
|
+
page.paged && /* @__PURE__ */ jsx(RecordPager, {
|
|
185
|
+
page,
|
|
186
|
+
loaded: props.items.length
|
|
187
|
+
}),
|
|
188
|
+
!props.fields && props.options.renderItem === void 0 ? /* @__PURE__ */ jsx(RecordHeading, {
|
|
189
|
+
view,
|
|
190
|
+
noun: props.noun,
|
|
191
|
+
field: recordField(view)
|
|
192
|
+
}) : null,
|
|
193
|
+
props.fields ? /* @__PURE__ */ jsx(Table, { ...visible }) : /* @__PURE__ */ jsx(List, { ...visible })
|
|
194
|
+
] });
|
|
168
195
|
}
|
|
169
196
|
export { Items };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useDashboards } from "../context.mjs";
|
|
2
|
+
import { formatCell } from "../format.mjs";
|
|
3
|
+
import { OnlyToggle } from "./Controls.mjs";
|
|
4
|
+
import { Items } from "./Items.mjs";
|
|
5
|
+
import { RecordCount } from "./ItemsFoot.mjs";
|
|
6
|
+
import { itemFields, showsFields } from "./state.mjs";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/drill/ItemsBody.tsx
|
|
9
|
+
/** Items: the Only filter, a percentile's marker row, then the rows. */
|
|
10
|
+
function ItemsBody(a) {
|
|
11
|
+
const format = useDashboards();
|
|
12
|
+
const { d, view, props } = a;
|
|
13
|
+
const p = view.percentile;
|
|
14
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
|
+
/* @__PURE__ */ jsx(OnlyToggle, { d }),
|
|
16
|
+
p === void 0 || d.summary === void 0 ? null : /* @__PURE__ */ jsx("p", {
|
|
17
|
+
className: "dd-drill-marker",
|
|
18
|
+
children: format.messages.drillPercentile(p, formatCell(d.summary.value, d.summary.column, format))
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsx(Items, {
|
|
21
|
+
count: (range) => /* @__PURE__ */ jsx(RecordCount, {
|
|
22
|
+
d,
|
|
23
|
+
range
|
|
24
|
+
}),
|
|
25
|
+
fields: showsFields(d.state),
|
|
26
|
+
switchMode: () => {
|
|
27
|
+
if (d.state) d.setView(itemFields(d.state, !showsFields(d.state)).view, "push");
|
|
28
|
+
},
|
|
29
|
+
view,
|
|
30
|
+
items: d.items.items,
|
|
31
|
+
options: props,
|
|
32
|
+
noun: d.summary?.noun?.one,
|
|
33
|
+
timeZone: d.summary?.receipt.calendar.timezone,
|
|
34
|
+
Empty: props.components?.Empty
|
|
35
|
+
})
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
export { ItemsBody };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useDashboards } from "../context.mjs";
|
|
2
|
+
import { formatCell } from "../format.mjs";
|
|
2
3
|
import { countText } from "./counts.mjs";
|
|
4
|
+
import { RECORD_PAGES } from "./words.mjs";
|
|
3
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
// src/drill/ItemsFoot.tsx
|
|
5
7
|
/**
|
|
@@ -11,7 +13,7 @@ function listCount(view, summary) {
|
|
|
11
13
|
return summary.semantics === "distinct" ? summary.value : summary.itemCount;
|
|
12
14
|
}
|
|
13
15
|
/** Items' count and sort, then Show more while there are more, with a retry when a page fails. */
|
|
14
|
-
function
|
|
16
|
+
function RecordCount({ d, range }) {
|
|
15
17
|
const format = useDashboards();
|
|
16
18
|
const { messages } = format;
|
|
17
19
|
const view = d.items.view;
|
|
@@ -19,23 +21,26 @@ function ItemsFoot({ d }) {
|
|
|
19
21
|
const count = listCount(view, d.summary);
|
|
20
22
|
const total = count === void 0 ? void 0 : countText(count, format);
|
|
21
23
|
const sort = sortText(view, messages);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
const number = (n) => formatCell(n, { type: "int" }, format);
|
|
25
|
+
return /* @__PURE__ */ jsxs("p", {
|
|
26
|
+
className: "dd-records-count",
|
|
27
|
+
"aria-live": "polite",
|
|
28
|
+
children: [
|
|
29
|
+
range === void 0 ? messages.drillShowing(d.items.items.length, total) : (messages.drillRecordPages ?? RECORD_PAGES).range(number(range.first), number(range.last), number(d.items.items.length), total),
|
|
30
|
+
" ",
|
|
31
|
+
"· ",
|
|
32
|
+
sort
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function ItemsFoot({ d }) {
|
|
37
|
+
const { messages } = useDashboards();
|
|
38
|
+
if (d.items.view === void 0) return null;
|
|
39
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [d.items.moreError === void 0 ? null : /* @__PURE__ */ jsx("p", {
|
|
40
|
+
className: "dd-tile-error",
|
|
41
|
+
role: "alert",
|
|
42
|
+
children: messages.drillFailed
|
|
43
|
+
}), d.items.hasMore ? /* @__PURE__ */ jsx(More, { d }) : null] });
|
|
39
44
|
}
|
|
40
45
|
/** How the Items are sorted, in words: the declared order, or by the value. */
|
|
41
46
|
function sortText(view, messages) {
|
|
@@ -57,4 +62,4 @@ function More({ d }) {
|
|
|
57
62
|
children: label
|
|
58
63
|
});
|
|
59
64
|
}
|
|
60
|
-
export { ItemsFoot };
|
|
65
|
+
export { ItemsFoot, RecordCount };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { formatInstantAt } from "../format-time.mjs";
|
|
2
1
|
import { useDashboards } from "../context.mjs";
|
|
3
2
|
import { formatCell } from "../format.mjs";
|
|
3
|
+
import { formatPeriod } from "../format-time.mjs";
|
|
4
|
+
import { trendWindowLabel } from "./words.mjs";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
// src/drill/Notes.tsx
|
|
6
7
|
/** The value as the line reads it: a ratio as a percent when its column says so. */
|
|
@@ -10,17 +11,26 @@ const valueColumn = (summary) => summary.semantics === "ratio" && summary.column
|
|
|
10
11
|
fraction: true,
|
|
11
12
|
type: "float"
|
|
12
13
|
} : summary.column;
|
|
13
|
-
/**
|
|
14
|
-
function
|
|
14
|
+
/** Show a trend's window separately only when it differs from the selection. */
|
|
15
|
+
function TrendPeriod({ range, summary }) {
|
|
16
|
+
const format = useDashboards();
|
|
17
|
+
const selected = summary?.range;
|
|
18
|
+
if (range === void 0 || range.from === selected?.from && range.to === selected.to) return null;
|
|
19
|
+
const period = formatPeriod(range, format, summary?.receipt.calendar.timezone);
|
|
20
|
+
const window = format.messages.drillTrendWindow ?? trendWindowLabel;
|
|
21
|
+
return /* @__PURE__ */ jsx("span", {
|
|
22
|
+
className: "dd-drill-range",
|
|
23
|
+
children: summary && !selected ? window(period) : period
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function Period({ summary }) {
|
|
15
27
|
const format = useDashboards();
|
|
16
28
|
const { messages } = format;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const zone = summary.receipt.calendar.timezone;
|
|
20
|
-
const day = (at) => formatInstantAt(at, "day", format.locale, zone);
|
|
29
|
+
if (summary.range === void 0) return null;
|
|
30
|
+
const period = formatPeriod(summary.range, format, summary.receipt.calendar.timezone);
|
|
21
31
|
return /* @__PURE__ */ jsx("p", {
|
|
22
32
|
className: "dd-drill-period",
|
|
23
|
-
children: messages.drillEarlier(
|
|
33
|
+
children: summary.previous === true ? messages.drillEarlier(period) : period
|
|
24
34
|
});
|
|
25
35
|
}
|
|
26
36
|
/** The notes under the value: the period before, a moved value (the viewer's own link only), a shared link's limits. */
|
|
@@ -28,14 +38,14 @@ function Notes({ summary, value, onRefresh }) {
|
|
|
28
38
|
const format = useDashboards();
|
|
29
39
|
const { messages } = format;
|
|
30
40
|
const clicked = summary.clicked;
|
|
31
|
-
const
|
|
41
|
+
const previous = clicked === void 0 || summary.foreign === true ? void 0 : formatCell(clicked, valueColumn(summary), format);
|
|
32
42
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
-
/* @__PURE__ */ jsx(
|
|
34
|
-
|
|
43
|
+
/* @__PURE__ */ jsx(Period, { summary }),
|
|
44
|
+
previous !== void 0 && previous !== value ? /* @__PURE__ */ jsxs("p", {
|
|
35
45
|
className: "dd-tile-note",
|
|
36
46
|
role: "status",
|
|
37
47
|
children: [
|
|
38
|
-
messages.drillMoved(value,
|
|
48
|
+
messages.drillMoved(value, previous),
|
|
39
49
|
" ",
|
|
40
50
|
/* @__PURE__ */ jsx("button", {
|
|
41
51
|
type: "button",
|
|
@@ -56,4 +66,4 @@ function Notes({ summary, value, onRefresh }) {
|
|
|
56
66
|
}) : null
|
|
57
67
|
] });
|
|
58
68
|
}
|
|
59
|
-
export { Notes, valueColumn };
|
|
69
|
+
export { Notes, TrendPeriod, valueColumn };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { useDashboards } from "../context.mjs";
|
|
2
|
-
import { formatCell } from "../format.mjs";
|
|
3
1
|
import { Bars } from "./Bars.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { Comparison } from "./Comparison.mjs";
|
|
3
|
+
import { FieldPicker, Operands } from "./Controls.mjs";
|
|
4
|
+
import { ItemsBody } from "./ItemsBody.mjs";
|
|
6
5
|
import { ItemsFoot } from "./ItemsFoot.mjs";
|
|
7
6
|
import { Failed, SeeRows } from "./PanelStates.mjs";
|
|
8
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -11,6 +10,10 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
11
10
|
function Body({ d, props }) {
|
|
12
11
|
const shown = d.shown;
|
|
13
12
|
if (shown === void 0) return null;
|
|
13
|
+
if (shown.by === "comparison") return d.answer && /* @__PURE__ */ jsx(Comparison, {
|
|
14
|
+
answer: d.answer,
|
|
15
|
+
view: shown
|
|
16
|
+
});
|
|
14
17
|
if (shown.by === "items") return /* @__PURE__ */ jsx(ItemsBody, {
|
|
15
18
|
d,
|
|
16
19
|
view: shown,
|
|
@@ -23,27 +26,6 @@ function Body({ d, props }) {
|
|
|
23
26
|
onOpen: d.open
|
|
24
27
|
});
|
|
25
28
|
}
|
|
26
|
-
/** Items: the Only filter, a percentile's marker row, then the rows. */
|
|
27
|
-
function ItemsBody(a) {
|
|
28
|
-
const format = useDashboards();
|
|
29
|
-
const { d, view, props } = a;
|
|
30
|
-
const p = view.percentile;
|
|
31
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
32
|
-
/* @__PURE__ */ jsx(OnlyToggle, { d }),
|
|
33
|
-
p === void 0 || d.summary === void 0 ? null : /* @__PURE__ */ jsx("p", {
|
|
34
|
-
className: "dd-drill-marker",
|
|
35
|
-
children: format.messages.drillPercentile(p, formatCell(d.summary.value, d.summary.column, format))
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ jsx(Items, {
|
|
38
|
-
view,
|
|
39
|
-
items: d.items.items,
|
|
40
|
-
options: props,
|
|
41
|
-
noun: d.summary?.noun?.one,
|
|
42
|
-
timeZone: d.summary?.receipt.calendar.timezone,
|
|
43
|
-
Empty: props.components?.Empty
|
|
44
|
-
})
|
|
45
|
-
] });
|
|
46
|
-
}
|
|
47
29
|
/** A failed read, or the panel loading, or its body. */
|
|
48
30
|
function Main({ d, props, close }) {
|
|
49
31
|
if (d.status === "error") return /* @__PURE__ */ jsx(Failed, {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { isNumberType } from "../columns.mjs";
|
|
2
|
+
import { useDashboards } from "../context.mjs";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/drill/RecordRow.tsx
|
|
5
|
+
function RecordRow(props) {
|
|
6
|
+
const { parts, field } = props;
|
|
7
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("span", {
|
|
8
|
+
className: "dd-record-name",
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ jsx("strong", { children: parts.title }),
|
|
11
|
+
props.opens ? /* @__PURE__ */ jsxs("span", {
|
|
12
|
+
className: "dd-direction",
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
children: [" ", "›"]
|
|
15
|
+
}) : null,
|
|
16
|
+
parts.value === void 0 ? null : /* @__PURE__ */ jsxs("small", { children: [/* @__PURE__ */ jsxs("span", {
|
|
17
|
+
className: "dd-sr-only",
|
|
18
|
+
children: [props.date, " "]
|
|
19
|
+
}), parts.value] }),
|
|
20
|
+
parts.badge === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
21
|
+
className: "dd-item-badge",
|
|
22
|
+
"data-tone": parts.badge.tone,
|
|
23
|
+
children: parts.badge.text
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
}), field === void 0 ? null : /* @__PURE__ */ jsxs("span", {
|
|
27
|
+
className: "dd-record-field",
|
|
28
|
+
"data-numeric": isNumberType(field.type),
|
|
29
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
30
|
+
className: "dd-sr-only",
|
|
31
|
+
children: [field.label, " "]
|
|
32
|
+
}), props.value]
|
|
33
|
+
})] });
|
|
34
|
+
}
|
|
35
|
+
function RecordHeading(props) {
|
|
36
|
+
const { messages } = useDashboards();
|
|
37
|
+
const name = props.view.columns.find((c) => c.member === props.view.title)?.label ?? props.noun ?? messages.drillItem;
|
|
38
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
39
|
+
className: "dd-record-heading",
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
children: [/* @__PURE__ */ jsx("span", { children: name }), props.field === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
42
|
+
"data-numeric": isNumberType(props.field.type),
|
|
43
|
+
children: props.field.label
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export { RecordHeading, RecordRow };
|