@carto/ps-react-ui 4.11.3 → 4.12.1
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/dist/chat.js +962 -733
- package/dist/chat.js.map +1 -1
- package/dist/csv-item-hH_Gt7ur.js +32 -0
- package/dist/csv-item-hH_Gt7ur.js.map +1 -0
- package/dist/{echart-BMPpj7n_.js → echart-Bdvbfx9s.js} +2 -2
- package/dist/echart-Bdvbfx9s.js.map +1 -0
- package/dist/{option-builders-F-c9ELi1.js → option-builders-DPeoyQaM.js} +41 -33
- package/dist/option-builders-DPeoyQaM.js.map +1 -0
- package/dist/png-item-9dNbB37T.js +57 -0
- package/dist/png-item-9dNbB37T.js.map +1 -0
- package/dist/table-B3ZWWhJt.js +383 -0
- package/dist/table-B3ZWWhJt.js.map +1 -0
- package/dist/types/chat/containers/chat-footer.d.ts +1 -1
- package/dist/types/chat/containers/styles.d.ts +79 -12
- package/dist/types/chat/index.d.ts +1 -1
- package/dist/types/chat/types.d.ts +21 -0
- package/dist/types/chat/use-typewriter.d.ts +5 -3
- package/dist/types/widgets/utils/chart-config/index.d.ts +1 -1
- package/dist/types/widgets-v2/actions/download/constants.d.ts +12 -0
- package/dist/types/widgets-v2/actions/download/csv-item.d.ts +38 -0
- package/dist/types/widgets-v2/actions/download/icons.d.ts +6 -0
- package/dist/types/widgets-v2/actions/download/index.d.ts +3 -1
- package/dist/types/widgets-v2/actions/index.d.ts +1 -1
- package/dist/types/widgets-v2/pie/skeleton.d.ts +9 -0
- package/dist/widgets/bar.js +1 -1
- package/dist/widgets/histogram.js +1 -1
- package/dist/widgets/pie.js +1 -1
- package/dist/widgets/scatterplot.js +5 -5
- package/dist/widgets/timeseries.js +1 -1
- package/dist/widgets/utils.js +1 -1
- package/dist/widgets-v2/actions.js +40 -36
- package/dist/widgets-v2/actions.js.map +1 -1
- package/dist/widgets-v2/bar.js +69 -76
- package/dist/widgets-v2/bar.js.map +1 -1
- package/dist/widgets-v2/category.js +50 -55
- package/dist/widgets-v2/category.js.map +1 -1
- package/dist/widgets-v2/echart.js +1 -1
- package/dist/widgets-v2/formula.js +37 -43
- package/dist/widgets-v2/formula.js.map +1 -1
- package/dist/widgets-v2/histogram.js +141 -147
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/dist/widgets-v2/markdown.js +18 -17
- package/dist/widgets-v2/markdown.js.map +1 -1
- package/dist/widgets-v2/pie.js +174 -126
- package/dist/widgets-v2/pie.js.map +1 -1
- package/dist/widgets-v2/scatterplot.js +156 -166
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/spread.js +36 -41
- package/dist/widgets-v2/spread.js.map +1 -1
- package/dist/widgets-v2/table.js +46 -55
- package/dist/widgets-v2/table.js.map +1 -1
- package/dist/widgets-v2/timeseries.js +83 -89
- package/dist/widgets-v2/timeseries.js.map +1 -1
- package/dist/widgets-v2.js +3 -3
- package/package.json +1 -1
- package/src/chat/bubbles/styles.ts +5 -1
- package/src/chat/containers/chat-content.tsx +4 -1
- package/src/chat/containers/chat-footer.test.tsx +59 -0
- package/src/chat/containers/chat-footer.tsx +124 -36
- package/src/chat/containers/styles.ts +107 -16
- package/src/chat/feedback/styles.ts +11 -4
- package/src/chat/index.ts +1 -0
- package/src/chat/types.ts +22 -0
- package/src/chat/use-typewriter.ts +32 -24
- package/src/widgets/utils/chart-config/index.ts +1 -0
- package/src/widgets/utils/chart-config/option-builders.test.ts +34 -0
- package/src/widgets/utils/chart-config/option-builders.ts +21 -0
- package/src/widgets-v2/actions/download/constants.ts +14 -0
- package/src/widgets-v2/actions/download/csv-item.test.tsx +77 -0
- package/src/widgets-v2/actions/download/csv-item.tsx +71 -0
- package/src/widgets-v2/actions/download/icons.tsx +10 -1
- package/src/widgets-v2/actions/download/index.ts +3 -1
- package/src/widgets-v2/actions/download/png-item.tsx +2 -1
- package/src/widgets-v2/actions/index.ts +5 -0
- package/src/widgets-v2/bar/download.tsx +16 -22
- package/src/widgets-v2/bar/options.ts +3 -2
- package/src/widgets-v2/category/download.test.ts +9 -0
- package/src/widgets-v2/category/download.ts +16 -20
- package/src/widgets-v2/echart/edge-label-clamp.ts +7 -4
- package/src/widgets-v2/formula/download.tsx +23 -29
- package/src/widgets-v2/histogram/download.ts +22 -26
- package/src/widgets-v2/histogram/options.ts +3 -2
- package/src/widgets-v2/markdown/{download.ts → download.tsx} +5 -2
- package/src/widgets-v2/pie/download.ts +16 -20
- package/src/widgets-v2/pie/skeleton.test.tsx +6 -3
- package/src/widgets-v2/pie/skeleton.tsx +69 -7
- package/src/widgets-v2/scatterplot/download.ts +16 -20
- package/src/widgets-v2/scatterplot/options.ts +3 -6
- package/src/widgets-v2/spread/download.ts +23 -27
- package/src/widgets-v2/table/download.test.ts +10 -0
- package/src/widgets-v2/table/download.ts +11 -15
- package/src/widgets-v2/table/helpers.test.ts +19 -0
- package/src/widgets-v2/table/helpers.ts +7 -12
- package/src/widgets-v2/timeseries/download.ts +36 -40
- package/src/widgets-v2/timeseries/options.ts +3 -2
- package/dist/echart-BMPpj7n_.js.map +0 -1
- package/dist/option-builders-F-c9ELi1.js.map +0 -1
- package/dist/png-item-BE9uEqlD.js +0 -45
- package/dist/png-item-BE9uEqlD.js.map +0 -1
- package/dist/table-C9IMbTr0.js +0 -385
- package/dist/table-C9IMbTr0.js.map +0 -1
- package/dist/types/chat/feedback/styles.d.ts +0 -211
- package/dist/types/widgets/utils/chart-config/option-builders.d.ts +0 -124
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface UseTypewriterOptions {
|
|
2
2
|
/** Characters revealed per second (default: `500`). */
|
|
3
3
|
speed?: number;
|
|
4
|
-
/** When true
|
|
4
|
+
/** When true, reveal the full text immediately (and snap to it if it grows). */
|
|
5
5
|
skipAnimation?: boolean;
|
|
6
6
|
}
|
|
7
7
|
interface UseTypewriterResult {
|
|
@@ -12,8 +12,10 @@ interface UseTypewriterResult {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Reveals a string character-by-character at a steady rate via
|
|
15
|
-
* `requestAnimationFrame`.
|
|
16
|
-
*
|
|
15
|
+
* `requestAnimationFrame`. Designed for bursty, streamed agent text: as
|
|
16
|
+
* `fullText` grows the reveal keeps chasing the new end, and flipping
|
|
17
|
+
* `skipAnimation` to `true` (e.g. once generation finishes) snaps to the full
|
|
18
|
+
* text. Pair it with `ChatAgentMessage`.
|
|
17
19
|
*
|
|
18
20
|
* @example
|
|
19
21
|
* ```tsx
|
|
@@ -5,5 +5,5 @@ export { defaultFormatter, defaultLabelFormatter } from '../formatter';
|
|
|
5
5
|
export { createChartWidgetConfig } from './config-factory';
|
|
6
6
|
export type { ChartWidgetBaseConfig, CreateChartWidgetConfigParams, } from './config-factory';
|
|
7
7
|
export { flattenObjectArrayToCSV, scatterplotDataToCSV } from './csv-modifiers';
|
|
8
|
-
export { buildLegendConfig, buildGridConfig, createTooltipPositioner, createAxisLabelFormatter, createTooltipFormatter, applyXAxisFormatter, applyYAxisFormatter, niceNum, buildSeriesLabelConfig, buildHistogramSeriesLabelConfig, } from './option-builders';
|
|
8
|
+
export { buildLegendConfig, buildGridConfig, buildAxisLabelStyle, createTooltipPositioner, createAxisLabelFormatter, createTooltipFormatter, applyXAxisFormatter, applyYAxisFormatter, niceNum, buildSeriesLabelConfig, buildHistogramSeriesLabelConfig, } from './option-builders';
|
|
9
9
|
export { createChartDownloadConfig } from './download-config';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical `DownloadItem.id`s for the built-in download formats. Centralised
|
|
3
|
+
* so the per-format builders — and anything that keys off the id (menu logic,
|
|
4
|
+
* tests) — reference one source of truth instead of re-typing string literals.
|
|
5
|
+
* The Markdown format keeps the short `'md'` id to match its `.md` extension.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DOWNLOAD_ITEM_IDS: {
|
|
8
|
+
readonly png: "png";
|
|
9
|
+
readonly csv: "csv";
|
|
10
|
+
readonly markdown: "md";
|
|
11
|
+
};
|
|
12
|
+
export type DownloadItemId = (typeof DOWNLOAD_ITEM_IDS)[keyof typeof DOWNLOAD_ITEM_IDS];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DownloadItem } from './types';
|
|
2
|
+
interface BuildCsvDownloadItemBase {
|
|
3
|
+
/** Base filename (without extension). The item appends `.csv`. */
|
|
4
|
+
filename: string;
|
|
5
|
+
/** Override the menu label. Default `'CSV'`. */
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Args for {@link buildCsvDownloadItem}. A discriminated union: a caller must
|
|
10
|
+
* supply exactly one content source — `getRows` (rows serialised through the
|
|
11
|
+
* shared `toCsvString`) or `getCsv` (a pre-built CSV string). The `?: never`
|
|
12
|
+
* arms make passing both — or neither — a compile-time error.
|
|
13
|
+
*/
|
|
14
|
+
export type BuildCsvDownloadItemArgs = (BuildCsvDownloadItemBase & {
|
|
15
|
+
/**
|
|
16
|
+
* Builds the CSV rows at click time. Used by most widgets — rows are run
|
|
17
|
+
* through `toCsvString` so escaping (incl. the spreadsheet
|
|
18
|
+
* formula-injection guard) stays consistent across widgets.
|
|
19
|
+
*/
|
|
20
|
+
getRows: () => readonly (readonly unknown[])[];
|
|
21
|
+
getCsv?: never;
|
|
22
|
+
}) | (BuildCsvDownloadItemBase & {
|
|
23
|
+
/**
|
|
24
|
+
* Returns a pre-built CSV string at click time. Escape hatch for widgets
|
|
25
|
+
* (e.g. Table) that already serialise their own CSV with bespoke
|
|
26
|
+
* header/cell handling.
|
|
27
|
+
*/
|
|
28
|
+
getCsv: () => string;
|
|
29
|
+
getRows?: never;
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Builds the standard CSV `DownloadItem` used by every per-widget download
|
|
33
|
+
* config. Centralised so the menu label, icon, and `.csv` filename suffix stay
|
|
34
|
+
* consistent across widgets — mirrors {@link buildPngDownloadItem} so neither
|
|
35
|
+
* format can drift again.
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildCsvDownloadItem(args: BuildCsvDownloadItemArgs): DownloadItem;
|
|
38
|
+
export {};
|
|
@@ -5,6 +5,12 @@ import { SvgIconProps } from '@mui/material';
|
|
|
5
5
|
* config's `icon` override without pulling MUI directly.
|
|
6
6
|
*/
|
|
7
7
|
export declare function PNGIcon(props: SvgIconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Generic "document" glyph used for the Markdown download item. Wraps MUI's
|
|
10
|
+
* `ArticleOutlined`, mirroring {@link PNGIcon}, so the Markdown menu item
|
|
11
|
+
* carries an icon consistent with the other download formats.
|
|
12
|
+
*/
|
|
13
|
+
export declare function MarkdownIcon(props: SvgIconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
14
|
/**
|
|
9
15
|
* "CSV" rectangle with the letters spelled inside — matches v1 visual and is
|
|
10
16
|
* easier to recognise in a download menu than a generic table glyph.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { Download, type DownloadProps } from './download';
|
|
2
2
|
export { downloadToCSV, downloadDOMToPNG, toCsvString, triggerLinkDownload, type DownloadHandle, type DownloadDOMToPNGOptions, } from './exports';
|
|
3
|
-
export { CSVIcon, PNGIcon } from './icons';
|
|
3
|
+
export { CSVIcon, PNGIcon, MarkdownIcon } from './icons';
|
|
4
4
|
export { buildPngDownloadItem, type BuildPngDownloadItemArgs } from './png-item';
|
|
5
|
+
export { buildCsvDownloadItem, type BuildCsvDownloadItemArgs } from './csv-item';
|
|
6
|
+
export { DOWNLOAD_ITEM_IDS, type DownloadItemId } from './constants';
|
|
5
7
|
export type { DownloadItem } from './types';
|
|
6
8
|
export { DEFAULT_DOWNLOAD_LABELS, type DownloadLabels } from './labels';
|
|
@@ -4,7 +4,7 @@ export { ShowAllToggle, setShowAll, SHOW_ALL_ID, DEFAULT_SHOW_ALL_LABELS, type S
|
|
|
4
4
|
export { ZoomToggle, addZoom, createAddZoom, ZOOM_LAYOUT, DEFAULT_ZOOM_TOGGLE_LABELS, type ZoomToggleProps, type ZoomToggleLabels, } from './zoom-toggle';
|
|
5
5
|
export { BrushToggle, addBrush, DEFAULT_BRUSH_TOGGLE_LABELS, type BrushToggleProps, type BrushToggleLabels, } from './brush-toggle';
|
|
6
6
|
export { RelativeData, toRelativeData, createPercentFormatter, DEFAULT_RELATIVE_DATA_LABELS, type RelativeDataProps, type RelativeDataLabels, } from './relative-data';
|
|
7
|
-
export { Download, downloadToCSV, downloadDOMToPNG, toCsvString, triggerLinkDownload, buildPngDownloadItem, CSVIcon, PNGIcon, DEFAULT_DOWNLOAD_LABELS, type DownloadProps, type DownloadItem, type DownloadHandle, type DownloadDOMToPNGOptions, type BuildPngDownloadItemArgs, type DownloadLabels, } from './download';
|
|
7
|
+
export { Download, downloadToCSV, downloadDOMToPNG, toCsvString, triggerLinkDownload, buildPngDownloadItem, buildCsvDownloadItem, CSVIcon, PNGIcon, MarkdownIcon, DEFAULT_DOWNLOAD_LABELS, DOWNLOAD_ITEM_IDS, type DownloadProps, type DownloadItem, type DownloadItemId, type DownloadHandle, type DownloadDOMToPNGOptions, type BuildPngDownloadItemArgs, type BuildCsvDownloadItemArgs, type DownloadLabels, } from './download';
|
|
8
8
|
export { FullScreen, DEFAULT_FULLSCREEN_LABELS, type FullScreenTriggerProps, type FullScreenSlotProps, type FullScreenLabels, type FullScreenWidgetState, } from './fullscreen';
|
|
9
9
|
export { LockSelection, filterByLockedItems, DEFAULT_LOCK_SELECTION_LABELS, type LockSelectionProps, type LockSelectionKey, type LockSelectionLabels, } from './lock-selection';
|
|
10
10
|
export { ChangeColumn, DEFAULT_CHANGE_COLUMN_LABELS, type ChangeColumnProps, type ChangeColumnItem, type ChangeColumnLabels, type ChangeColumnWidgetState, } from './change-column';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
export interface PieSkeletonProps {
|
|
2
2
|
count?: number;
|
|
3
3
|
}
|
|
4
|
+
/**
|
|
5
|
+
* Loading state for the Pie widget. Mirrors the donut silhouette — a ring
|
|
6
|
+
* (gray circle with a background-coloured hole punched out), a stacked
|
|
7
|
+
* value/name stub in the centre, and a centered legend stub below — so the
|
|
8
|
+
* skeleton reads as "a donut chart" rather than a solid disc.
|
|
9
|
+
*
|
|
10
|
+
* Single donut only: multi-series pie loads as a horizontal bar chart, so
|
|
11
|
+
* rendering one ring stays honest regardless of `count`.
|
|
12
|
+
*/
|
|
4
13
|
export declare function PieSkeleton({ count }: PieSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/widgets/bar.js
CHANGED
|
@@ -7,7 +7,7 @@ import "zustand/shallow";
|
|
|
7
7
|
import { g as w } from "../options-CthfUJDz.js";
|
|
8
8
|
import { m as v } from "../utils-BOhInag6.js";
|
|
9
9
|
import { c as L, f as S } from "../download-config-oJIFZ2WC.js";
|
|
10
|
-
import {
|
|
10
|
+
import { i as _, f as C, g as M, n as u, a as A, c as I, d as N } from "../option-builders-DPeoyQaM.js";
|
|
11
11
|
import { Box as l, Skeleton as o } from "@mui/material";
|
|
12
12
|
import { b as T } from "../styles-cohnxh9F.js";
|
|
13
13
|
const R = L(S);
|
|
@@ -6,7 +6,7 @@ import "../widget-store-Bw5zRUGg.js";
|
|
|
6
6
|
import "zustand/shallow";
|
|
7
7
|
import { g as k } from "../options-CthfUJDz.js";
|
|
8
8
|
import { m as C } from "../utils-BOhInag6.js";
|
|
9
|
-
import {
|
|
9
|
+
import { j as v, f as $, g as A, n as u, c as M, d as T } from "../option-builders-DPeoyQaM.js";
|
|
10
10
|
import { Box as f, Skeleton as y } from "@mui/material";
|
|
11
11
|
import "@mui/icons-material";
|
|
12
12
|
import { d as h, a as d } from "../exports-Cr43OCul.js";
|
package/dist/widgets/pie.js
CHANGED
|
@@ -7,7 +7,7 @@ import "zustand/shallow";
|
|
|
7
7
|
import { g as L } from "../options-CthfUJDz.js";
|
|
8
8
|
import { m as N } from "../utils-BOhInag6.js";
|
|
9
9
|
import { c as j, f as A } from "../download-config-oJIFZ2WC.js";
|
|
10
|
-
import {
|
|
10
|
+
import { i as O, f as b, g as T, n as v, c as S, d as _ } from "../option-builders-DPeoyQaM.js";
|
|
11
11
|
import { Box as h, Skeleton as f } from "@mui/material";
|
|
12
12
|
import { b as z } from "../styles-cohnxh9F.js";
|
|
13
13
|
const ee = j(A);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as g, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as b } from "react/compiler-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "echarts";
|
|
5
5
|
import "../widget-store-Bw5zRUGg.js";
|
|
6
6
|
import "zustand/shallow";
|
|
7
|
-
import { g as
|
|
7
|
+
import { g as h } from "../options-CthfUJDz.js";
|
|
8
8
|
import { m as S } from "../utils-BOhInag6.js";
|
|
9
9
|
import { c as v, s as k } from "../download-config-oJIFZ2WC.js";
|
|
10
|
-
import {
|
|
10
|
+
import { i as w, f as L, b as I, a as _, d as C } from "../option-builders-DPeoyQaM.js";
|
|
11
11
|
import { Box as p, Skeleton as c } from "@mui/material";
|
|
12
12
|
import { b as A } from "../styles-cohnxh9F.js";
|
|
13
13
|
const G = v(k);
|
|
14
14
|
function H(e) {
|
|
15
15
|
return {
|
|
16
16
|
type: "scatterplot",
|
|
17
|
-
option: S(
|
|
17
|
+
option: S(h(e), D(e)),
|
|
18
18
|
formatter: e.formatter,
|
|
19
19
|
labelFormatter: e.labelFormatter
|
|
20
20
|
};
|
|
@@ -180,7 +180,7 @@ const f = {
|
|
|
180
180
|
top: "40%"
|
|
181
181
|
}];
|
|
182
182
|
function J() {
|
|
183
|
-
const e =
|
|
183
|
+
const e = b(2);
|
|
184
184
|
let t;
|
|
185
185
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = T.map(O), e[0] = t) : t = e[0];
|
|
186
186
|
let o;
|
|
@@ -7,7 +7,7 @@ import "zustand/shallow";
|
|
|
7
7
|
import { g as b } from "../options-CthfUJDz.js";
|
|
8
8
|
import { m as k } from "../utils-BOhInag6.js";
|
|
9
9
|
import { c as v, f as w } from "../download-config-oJIFZ2WC.js";
|
|
10
|
-
import {
|
|
10
|
+
import { i as L, f as C, b as I, a as S, c as _, d as A } from "../option-builders-DPeoyQaM.js";
|
|
11
11
|
import { Box as l, Skeleton as r } from "@mui/material";
|
|
12
12
|
import { b as j } from "../styles-cohnxh9F.js";
|
|
13
13
|
const H = v(w);
|
package/dist/widgets/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as i, a as n } from "../formatter-B9Bxn1k7.js";
|
|
2
2
|
import { c as f, f as p, s as c } from "../download-config-oJIFZ2WC.js";
|
|
3
|
-
import { a as d, b as u, c as b, d as x, e as C, f as g, g as F, n as y } from "../option-builders-
|
|
3
|
+
import { a as d, b as u, c as b, d as x, e as C, f as g, g as F, n as y } from "../option-builders-DPeoyQaM.js";
|
|
4
4
|
import { b as S } from "../styles-cohnxh9F.js";
|
|
5
5
|
function r({
|
|
6
6
|
type: a,
|
|
@@ -1,47 +1,51 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { Z as
|
|
3
|
-
import { d as
|
|
4
|
-
import { C as V, P as
|
|
1
|
+
import { B as L, C as o, D as e, a as A, b as E, c as r, d as t, e as S, f as _, g as T, h as l, i as D, j as d, F as n, L as c, R as O, S as g, k as B, l as C, m, n as F, Z as U, o as i, p as I, q as h, r as w, s as G, t as f, u as N, v as R } from "../change-column-DjjwoPt1.js";
|
|
2
|
+
import { Z as u, a as x, c as M } from "../transforms-Cdx4fkU5.js";
|
|
3
|
+
import { d as b, a as p, t as v, b as H } from "../exports-Cx-f6m6U.js";
|
|
4
|
+
import { C as W, D as V, M as y, P as K, b as j } from "../png-item-9dNbB37T.js";
|
|
5
|
+
import { b as Y } from "../csv-item-hH_Gt7ur.js";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
L as BrushToggle,
|
|
8
|
+
W as CSVIcon,
|
|
9
|
+
o as ChangeColumn,
|
|
10
|
+
e as DEFAULT_BRUSH_TOGGLE_LABELS,
|
|
10
11
|
A as DEFAULT_CHANGE_COLUMN_LABELS,
|
|
11
12
|
E as DEFAULT_DOWNLOAD_LABELS,
|
|
12
|
-
|
|
13
|
+
r as DEFAULT_FULLSCREEN_LABELS,
|
|
13
14
|
t as DEFAULT_LOCK_SELECTION_LABELS,
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
S as DEFAULT_RELATIVE_DATA_LABELS,
|
|
16
|
+
_ as DEFAULT_SEARCHER_LABELS,
|
|
16
17
|
T as DEFAULT_SHOW_ALL_LABELS,
|
|
17
18
|
l as DEFAULT_STACK_TOGGLE_LABELS,
|
|
18
19
|
D as DEFAULT_ZOOM_TOGGLE_LABELS,
|
|
20
|
+
V as DOWNLOAD_ITEM_IDS,
|
|
19
21
|
d as Download,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
n as FullScreen,
|
|
23
|
+
c as LockSelection,
|
|
24
|
+
y as MarkdownIcon,
|
|
25
|
+
K as PNGIcon,
|
|
26
|
+
O as RelativeData,
|
|
27
|
+
g as SHOW_ALL_ID,
|
|
28
|
+
B as Searcher,
|
|
26
29
|
C as SearcherToggle,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
m as ShowAllToggle,
|
|
31
|
+
F as StackToggle,
|
|
32
|
+
u as ZOOM_LAYOUT,
|
|
33
|
+
U as ZoomToggle,
|
|
34
|
+
i as addBrush,
|
|
35
|
+
I as addStack,
|
|
36
|
+
x as addZoom,
|
|
37
|
+
Y as buildCsvDownloadItem,
|
|
38
|
+
j as buildPngDownloadItem,
|
|
39
|
+
M as createAddZoom,
|
|
40
|
+
h as createPercentFormatter,
|
|
41
|
+
b as downloadDOMToPNG,
|
|
42
|
+
p as downloadToCSV,
|
|
43
|
+
w as filterByLockedItems,
|
|
44
|
+
G as filterBySearchText,
|
|
45
|
+
f as setSearcherText,
|
|
46
|
+
N as setShowAll,
|
|
47
|
+
v as toCsvString,
|
|
48
|
+
R as toRelativeData,
|
|
49
|
+
H as triggerLinkDownload
|
|
46
50
|
};
|
|
47
51
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/dist/widgets-v2/bar.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { n as y, d as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { c as
|
|
5
|
-
import { Box as g, Skeleton as
|
|
1
|
+
import * as N from "echarts";
|
|
2
|
+
import { h as B, n as y, d as R, g as H, c as W, f as Y } from "../option-builders-DPeoyQaM.js";
|
|
3
|
+
import { jsx as d, jsxs as _ } from "react/jsx-runtime";
|
|
4
|
+
import { c as q } from "react/compiler-runtime";
|
|
5
|
+
import { Box as g, Skeleton as I } from "@mui/material";
|
|
6
6
|
import "../widget-store-Bw5zRUGg.js";
|
|
7
7
|
import "zustand/shallow";
|
|
8
8
|
import "@mui/icons-material";
|
|
@@ -20,24 +20,24 @@ import "zustand";
|
|
|
20
20
|
import "zustand/vanilla";
|
|
21
21
|
import "zustand/middleware";
|
|
22
22
|
import "zustand/react/shallow";
|
|
23
|
-
import { Z as
|
|
24
|
-
import { m as
|
|
25
|
-
import { p as
|
|
26
|
-
import {
|
|
27
|
-
import { b as
|
|
23
|
+
import { Z as O } from "../transforms-Cdx4fkU5.js";
|
|
24
|
+
import { m as z, r as U } from "../resolve-theme-color-BdojIw0K.js";
|
|
25
|
+
import { p as V } from "../data-zoom-layout-CkVnm6ej.js";
|
|
26
|
+
import { b as J } from "../png-item-9dNbB37T.js";
|
|
27
|
+
import { b as K } from "../csv-item-hH_Gt7ur.js";
|
|
28
28
|
function Q({
|
|
29
29
|
theme: e,
|
|
30
30
|
formatter: o,
|
|
31
31
|
labelFormatter: t
|
|
32
32
|
}) {
|
|
33
|
-
let s = 0,
|
|
33
|
+
let s = 0, n = 1;
|
|
34
34
|
return {
|
|
35
35
|
grid: {
|
|
36
36
|
left: parseInt(e.spacing(1)),
|
|
37
37
|
top: parseInt(e.spacing(3)),
|
|
38
38
|
right: parseInt(e.spacing(1)),
|
|
39
39
|
// Default: no legend. Merger bumps this when there are >1 series.
|
|
40
|
-
...
|
|
40
|
+
...W(!1, e),
|
|
41
41
|
containLabel: !0
|
|
42
42
|
},
|
|
43
43
|
tooltip: {
|
|
@@ -53,13 +53,13 @@ function Q({
|
|
|
53
53
|
axisPointer: {
|
|
54
54
|
type: "line"
|
|
55
55
|
},
|
|
56
|
-
position:
|
|
57
|
-
formatter:
|
|
56
|
+
position: H(e),
|
|
57
|
+
formatter: M(o, t)
|
|
58
58
|
},
|
|
59
59
|
// Legend styling baked here; `show` is toggled by the merger based on
|
|
60
60
|
// series count.
|
|
61
61
|
legend: {
|
|
62
|
-
...
|
|
62
|
+
...R({
|
|
63
63
|
hasLegend: !1,
|
|
64
64
|
labelFormatter: t
|
|
65
65
|
})
|
|
@@ -79,6 +79,7 @@ function Q({
|
|
|
79
79
|
show: !1
|
|
80
80
|
},
|
|
81
81
|
axisLabel: {
|
|
82
|
+
...B(e),
|
|
82
83
|
padding: [parseInt(e.spacing(0.5)), 0, 0, 0],
|
|
83
84
|
margin: 0,
|
|
84
85
|
hideOverlap: !0,
|
|
@@ -90,7 +91,7 @@ function Q({
|
|
|
90
91
|
yAxis: {
|
|
91
92
|
type: "value",
|
|
92
93
|
min: (a) => (s = a.min < 0 ? y(a.min) : 0, s),
|
|
93
|
-
max: (a) => (
|
|
94
|
+
max: (a) => (n = a.max <= 0 ? 1 : y(a.max), n),
|
|
94
95
|
axisLine: {
|
|
95
96
|
show: !1
|
|
96
97
|
},
|
|
@@ -104,15 +105,14 @@ function Q({
|
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
107
|
axisLabel: {
|
|
107
|
-
|
|
108
|
-
fontFamily: e.typography.overlineDelicate?.fontFamily,
|
|
108
|
+
...B(e),
|
|
109
109
|
margin: parseInt(e.spacing(1)),
|
|
110
110
|
show: !0,
|
|
111
111
|
showMaxLabel: !0,
|
|
112
112
|
showMinLabel: !0,
|
|
113
113
|
verticalAlign: "bottom",
|
|
114
114
|
inside: !0,
|
|
115
|
-
formatter: (a) => a !==
|
|
115
|
+
formatter: (a) => a !== n && a !== s || a === 0 ? "" : o ? o(a) : String(a)
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
};
|
|
@@ -122,43 +122,43 @@ function Te(e) {
|
|
|
122
122
|
theme: o,
|
|
123
123
|
formatter: t,
|
|
124
124
|
labelFormatter: s,
|
|
125
|
-
optionsOverride:
|
|
126
|
-
} = e, a = e.series, c = e.selection,
|
|
127
|
-
return (
|
|
128
|
-
if (
|
|
125
|
+
optionsOverride: n
|
|
126
|
+
} = e, a = e.series, c = e.selection, f = c && c.length > 0 ? new Set(c) : null;
|
|
127
|
+
return (i, C, v) => {
|
|
128
|
+
if (i == null) {
|
|
129
129
|
const r = Q({
|
|
130
130
|
theme: o,
|
|
131
131
|
formatter: t,
|
|
132
132
|
labelFormatter: s
|
|
133
133
|
});
|
|
134
|
-
return
|
|
134
|
+
return n ? z(r, n) : r;
|
|
135
135
|
}
|
|
136
|
-
const u = Array.isArray(
|
|
136
|
+
const u = Array.isArray(C) ? C : [];
|
|
137
137
|
if (u.length === 0)
|
|
138
138
|
return {
|
|
139
|
-
...
|
|
139
|
+
...i,
|
|
140
140
|
dataset: [],
|
|
141
141
|
series: []
|
|
142
142
|
};
|
|
143
|
-
const b = u.length > 1,
|
|
144
|
-
let
|
|
145
|
-
const
|
|
143
|
+
const b = u.length > 1, D = typeof i.legend == "object" && !Array.isArray(i.legend) ? i.legend : {}, x = typeof i.grid == "object" && !Array.isArray(i.grid) ? i.grid : {}, F = typeof i.tooltip == "object" && !Array.isArray(i.tooltip) ? i.tooltip : {}, k = typeof i.yAxis == "object" && !Array.isArray(i.yAxis) ? i.yAxis : {}, T = Array.isArray(i.series) ? i.series : [], Z = T[0] ?? {}, h = v?.formatter, P = v?.labelFormatter;
|
|
144
|
+
let A = 0, w = 1;
|
|
145
|
+
const L = V(i.dataZoom, b), $ = typeof x.bottom == "number" ? x.bottom : 24, j = b ? 56 : $, E = L ? j + O.sliderHeight + O.sliderGap : j, G = {
|
|
146
146
|
color: (r) => {
|
|
147
147
|
const l = r.color;
|
|
148
|
-
if (!
|
|
149
|
-
const
|
|
150
|
-
return
|
|
148
|
+
if (!f) return l;
|
|
149
|
+
const m = r.value?.name ?? r.name;
|
|
150
|
+
return m != null && f.has(m) ? l : N.color.modifyAlpha(l, 0.15);
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
return {
|
|
154
|
-
...
|
|
154
|
+
...i,
|
|
155
155
|
dataset: u.map((r) => ({
|
|
156
156
|
source: r
|
|
157
157
|
})),
|
|
158
158
|
series: u.map((r, l) => {
|
|
159
|
-
const
|
|
159
|
+
const S = T[l] ?? Z, m = U(o, a?.[l]?.color);
|
|
160
160
|
return {
|
|
161
|
-
...typeof
|
|
161
|
+
...typeof S == "object" ? S : {},
|
|
162
162
|
type: "bar",
|
|
163
163
|
datasetIndex: l,
|
|
164
164
|
name: a?.[l]?.name ?? `Series ${l + 1}`,
|
|
@@ -170,51 +170,51 @@ function Te(e) {
|
|
|
170
170
|
emphasis: {
|
|
171
171
|
focus: "series"
|
|
172
172
|
},
|
|
173
|
-
itemStyle:
|
|
174
|
-
...
|
|
175
|
-
color:
|
|
173
|
+
itemStyle: G,
|
|
174
|
+
...m ? {
|
|
175
|
+
color: m
|
|
176
176
|
} : {}
|
|
177
177
|
};
|
|
178
178
|
}),
|
|
179
179
|
legend: {
|
|
180
|
-
...
|
|
180
|
+
...D,
|
|
181
181
|
show: b
|
|
182
182
|
},
|
|
183
183
|
grid: {
|
|
184
184
|
...x,
|
|
185
|
-
bottom:
|
|
185
|
+
bottom: E
|
|
186
186
|
},
|
|
187
|
-
...
|
|
188
|
-
dataZoom:
|
|
187
|
+
...L ? {
|
|
188
|
+
dataZoom: L
|
|
189
189
|
} : {},
|
|
190
190
|
yAxis: {
|
|
191
191
|
...k,
|
|
192
|
-
min: (r) => (
|
|
193
|
-
max: (r) => (
|
|
192
|
+
min: (r) => (A = r.min < 0 ? y(r.min) : 0, A),
|
|
193
|
+
max: (r) => (w = r.max <= 0 ? 1 : y(r.max), w),
|
|
194
194
|
axisLabel: {
|
|
195
195
|
...k.axisLabel ?? {},
|
|
196
|
-
formatter: (r) => r !==
|
|
196
|
+
formatter: (r) => r !== w && r !== A || r === 0 ? "" : h ? h(r) : String(r)
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
199
|
tooltip: {
|
|
200
|
-
...
|
|
201
|
-
formatter:
|
|
200
|
+
...F,
|
|
201
|
+
formatter: M(h, P)
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
208
|
-
const
|
|
206
|
+
function M(e, o) {
|
|
207
|
+
return Y((t) => {
|
|
208
|
+
const n = t.value?.value, a = typeof n == "number" && e ? e(n) : n ?? "", c = typeof t.marker == "string" ? t.marker : "", f = t.seriesName ? `${t.seriesName}: ` : "", i = o ? String(o(t.name ?? "")) : t.name ?? "";
|
|
209
209
|
return {
|
|
210
|
-
name: String(
|
|
211
|
-
seriesName:
|
|
210
|
+
name: String(i),
|
|
211
|
+
seriesName: f,
|
|
212
212
|
marker: c,
|
|
213
213
|
value: a
|
|
214
214
|
};
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
-
const
|
|
217
|
+
const p = {
|
|
218
218
|
container: {
|
|
219
219
|
display: "flex",
|
|
220
220
|
alignItems: "center",
|
|
@@ -264,23 +264,23 @@ const f = {
|
|
|
264
264
|
}
|
|
265
265
|
}, X = ["20%", "40%", "60%", "20%", "80%"];
|
|
266
266
|
function je() {
|
|
267
|
-
const e =
|
|
267
|
+
const e = q(2);
|
|
268
268
|
let o;
|
|
269
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */
|
|
269
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ d(g, { sx: p.grid, children: X.map(te) }), e[0] = o) : o = e[0];
|
|
270
270
|
let t;
|
|
271
|
-
return e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */
|
|
271
|
+
return e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ _(g, { sx: p.container, children: [
|
|
272
272
|
o,
|
|
273
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ d(g, { sx: p.legend, children: [0, 1].map(ee) })
|
|
274
274
|
] }), e[1] = t) : t = e[1], t;
|
|
275
275
|
}
|
|
276
276
|
function ee(e) {
|
|
277
|
-
return /* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ _(g, { sx: p.legendItem, children: [
|
|
278
|
+
/* @__PURE__ */ d(I, { variant: "circular", width: 8, height: 8 }),
|
|
279
|
+
/* @__PURE__ */ d(I, { width: 48, height: 8 })
|
|
280
280
|
] }, `legend-${e}`);
|
|
281
281
|
}
|
|
282
282
|
function te(e, o) {
|
|
283
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ d(I, { sx: p.bar, variant: "rectangular", height: e }, `bar-${o}`);
|
|
284
284
|
}
|
|
285
285
|
function Be(e) {
|
|
286
286
|
const o = [];
|
|
@@ -289,24 +289,17 @@ function Be(e) {
|
|
|
289
289
|
getCaptureEl: e.getCaptureEl,
|
|
290
290
|
pixelRatio: e.pngPixelRatio,
|
|
291
291
|
backgroundColor: e.pngBackgroundColor
|
|
292
|
-
})), o.push({
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
icon: /* @__PURE__ */ p(K, { fontSize: "small" }),
|
|
296
|
-
resolve: () => {
|
|
292
|
+
})), o.push(K({
|
|
293
|
+
filename: e.filename,
|
|
294
|
+
getRows: () => {
|
|
297
295
|
const t = e.getData(), s = [];
|
|
298
|
-
for (const [
|
|
299
|
-
|
|
300
|
-
for (const
|
|
296
|
+
for (const [n, a] of t.entries()) {
|
|
297
|
+
n > 0 && s.push([]), s.push(["name", "value"]);
|
|
298
|
+
for (const c of a) s.push([c.name, c.value]);
|
|
301
299
|
}
|
|
302
|
-
|
|
303
|
-
return Promise.resolve({
|
|
304
|
-
url: i.url,
|
|
305
|
-
filename: `${e.filename}.csv`,
|
|
306
|
-
revoke: i.revoke
|
|
307
|
-
});
|
|
300
|
+
return s;
|
|
308
301
|
}
|
|
309
|
-
}), o;
|
|
302
|
+
})), o;
|
|
310
303
|
}
|
|
311
304
|
export {
|
|
312
305
|
je as BarSkeleton,
|