@turquoisehealth/pit-viper 2.197.3-dev.1 → 2.198.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.
Files changed (30) hide show
  1. package/_site/assets/css/pit-viper-a11y.css +2 -0
  2. package/_site/assets/css/pit-viper-consumer.css +2 -0
  3. package/_site/assets/css/pit-viper-v2-scoped.css +2 -0
  4. package/_site/assets/css/pit-viper-v2.css +2 -0
  5. package/_site/assets/css/pit-viper.css +2 -0
  6. package/package.json +1 -1
  7. package/pv-components/dist/stats/vue/visualizations/stats.html +1 -1
  8. package/pv-components/dist/vue/visualizations/components/base/PvDrawer/PvDrawer.vue.d.ts +1 -1
  9. package/pv-components/dist/vue/visualizations/components/base/PvDropdown/PvDropdown.vue.d.ts +5 -5
  10. package/pv-components/dist/vue/visualizations/components/base/PvFilterPanel/PvFilterPanel.vue.d.ts +2 -2
  11. package/pv-components/dist/vue/visualizations/components/base/PvInsightCard/PvInsightCard.vue.d.ts +1 -1
  12. package/pv-components/dist/vue/visualizations/components/base/PvMultiSelectButton/PvMultiSelectButton.vue.d.ts +7 -7
  13. package/pv-components/dist/vue/visualizations/components/base/PvPopoverV2/PvPopoverV2.vue.d.ts +2 -2
  14. package/pv-components/dist/vue/visualizations/components/base/PvRange/PvRange.vue.d.ts +2 -2
  15. package/pv-components/dist/vue/visualizations/components/base/PvSelectButton/PvSelectButton.vue.d.ts +3 -3
  16. package/pv-components/dist/vue/visualizations/components/charts/PvChartWidget/PvChartWidget.vue.d.ts +180 -0
  17. package/pv-components/dist/vue/visualizations/components/charts/PvChartWidget/constants.d.ts +4 -0
  18. package/pv-components/dist/vue/visualizations/components/charts/PvChartWidget/types.d.ts +31 -0
  19. package/pv-components/dist/vue/visualizations/components/charts/PvDataTableWithChart/PvDataTableWithChart.vue.d.ts +7 -4
  20. package/pv-components/dist/vue/visualizations/components/charts/PvDataWidget/PvDataWidget.vue.d.ts +43 -0
  21. package/pv-components/dist/vue/visualizations/components/charts/PvDataWidget/PvDataWidgetTable.vue.d.ts +4 -0
  22. package/pv-components/dist/vue/visualizations/components/charts/PvDataWidget/constants.d.ts +9 -0
  23. package/pv-components/dist/vue/visualizations/components/charts/PvDataWidget/helpers.d.ts +63 -0
  24. package/pv-components/dist/vue/visualizations/components/charts/PvDataWidget/types.d.ts +130 -0
  25. package/pv-components/dist/vue/visualizations/components/charts/PvDataWidget/usePvDataWidgetData.d.ts +40 -0
  26. package/pv-components/dist/vue/visualizations/components/charts/PvMapChart/PvMapChart.vue.d.ts +3 -8
  27. package/pv-components/dist/vue/visualizations/components/charts/widgetOptions.d.ts +58 -0
  28. package/pv-components/dist/vue/visualizations/components/visualizations/index.d.ts +6 -0
  29. package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs +11524 -10742
  30. package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs.map +1 -1
@@ -0,0 +1,130 @@
1
+ import { AgChartOptions } from 'ag-charts-types';
2
+ export type PvDataWidgetChartType = "area" | "bar" | "bar_stacked" | "column" | "column_stacked" | "histogram" | "line" | "map" | "pie" | "scatter";
3
+ export type PvDataWidgetViewType = PvDataWidgetChartType | "table" | (string & {});
4
+ export type PvDataWidgetDataRow = Record<string, unknown>;
5
+ export interface PvDataWidgetTableHeader {
6
+ /** Field identifier for this table column. */
7
+ field: string;
8
+ /** Resolved display label for this table column. */
9
+ label: string;
10
+ }
11
+ export interface PvDataWidgetTableProps {
12
+ /** Header cells rendered in the table head. */
13
+ headers: PvDataWidgetTableHeader[];
14
+ /** Pre-resolved string cells, one inner array per row. */
15
+ rows: string[][];
16
+ }
17
+ export interface PvDataWidgetColumnDefinition {
18
+ /**
19
+ * Optional context compatible with AG Grid ColDef context for simple data definitions.
20
+ * `context.dataType` takes precedence over the top-level `dataType` and `type` hints.
21
+ */
22
+ context?: {
23
+ [key: string]: unknown;
24
+ chartOnSecondaryAxes?: boolean;
25
+ chartSeriesDescription?: string;
26
+ chartSeriesDisplayName?: string;
27
+ dataType?: string;
28
+ hideFromCharting?: boolean;
29
+ };
30
+ /** Data type hint used to infer categories and series without formatter functions. Falls back to `type` and is superseded by `context.dataType`. */
31
+ dataType?: string;
32
+ /** Field name in each data row. */
33
+ field: string;
34
+ /** Display label for table headers, axes, and series names. */
35
+ headerName?: string;
36
+ /** Hide this column from generated charts and tables. */
37
+ hide?: boolean;
38
+ /** Data type hint alias for A2UI-style definitions. */
39
+ type?: string;
40
+ /** Allow simple AG Grid ColDef-style objects without requiring JS formatter support. */
41
+ [key: string]: unknown;
42
+ }
43
+ export interface PvDataWidgetChartTypeOption {
44
+ /** Accessible label for icon-only segmented controls. */
45
+ ariaLabel?: string;
46
+ /** Icon displayed in the segmented control. */
47
+ icon?: string;
48
+ /** Visible label displayed in the segmented control. */
49
+ label?: string;
50
+ /** Stable chart/view type value. */
51
+ value?: PvDataWidgetViewType;
52
+ }
53
+ export interface PvDataWidgetProps {
54
+ /** Applied filter labels rendered in the header area. */
55
+ appliedFilters?: string[];
56
+ /** Data rows used for generated chart and table views. */
57
+ chartData?: PvDataWidgetDataRow[];
58
+ /** Loading state passed to generated charts. */
59
+ chartLoading?: boolean;
60
+ /** AG Charts options. When supplied, these are used for chart rendering. */
61
+ chartOptions?: AgChartOptions;
62
+ /**
63
+ * Chart/view types available in the header segmented control. Accepts simple
64
+ * string values (e.g. `["column", "table"]`) or full option objects with custom
65
+ * labels and icons. At least one non-table chart type is always guaranteed.
66
+ */
67
+ chartTypes?: (PvDataWidgetViewType | PvDataWidgetChartTypeOption)[];
68
+ /** Column definitions used to infer labels and numeric/category fields. Compatible with simple AG Grid ColDefs. */
69
+ colDefs?: PvDataWidgetColumnDefinition[];
70
+ /** Maximum number of data rows rendered in generated chart and table views. Set to `0` to render no rows. */
71
+ dataLimit?: number;
72
+ /** When true, wraps large generated charts in a native Pit Viper-styled scroll container. */
73
+ enableChartScrolling?: boolean;
74
+ /**
75
+ * When true, scrolls table overflow. The body is capped by `tableMaxHeight` when set,
76
+ * otherwise by the constrained flex layout (i.e. a bounded widget `height`/`maxHeight`).
77
+ */
78
+ enableTableScrolling?: boolean;
79
+ /** Widget height. Numbers are treated as pixel values; strings are passed through as CSS values. */
80
+ height?: number | string;
81
+ /**
82
+ * When true, hides cartesian axis labels, ticks, lines, titles, and grid lines.
83
+ * Supersedes `hideAxisTitles` and `hideValueAxis` — the whole axis is hidden.
84
+ */
85
+ hideAxes?: boolean;
86
+ /** When true, hides axis titles (e.g. "Plan Type") while keeping tick labels. */
87
+ hideAxisTitles?: boolean;
88
+ /** When true, hides the chart legend on generated charts. */
89
+ hideLegend?: boolean;
90
+ /** When true, hides the numeric value axis while keeping the category (x) axis labels. */
91
+ hideValueAxis?: boolean;
92
+ /** Data field containing map region values. Defaults to `state` when present. */
93
+ mapKey?: string;
94
+ /** Maximum widget height. Numbers are treated as pixel values; strings are passed through as CSS values. */
95
+ maxHeight?: number | string;
96
+ /** Maximum widget width. Numbers are treated as pixel values; strings are passed through as CSS values. */
97
+ maxWidth?: number | string;
98
+ /**
99
+ * Minimum pixel height for generated charts. Required as a number because ag-charts
100
+ * sizes its canvas from an explicit height rather than CSS alone.
101
+ */
102
+ minHeight?: number;
103
+ /**
104
+ * Overlay text shown when a generated chart has no data. When omitted, the chart's
105
+ * own default overlay text is used.
106
+ */
107
+ noDataOverlayText?: string;
108
+ /** When true, renders value labels on generated cartesian series (e.g. above bars). */
109
+ showSeriesLabels?: boolean;
110
+ /**
111
+ * When true, renders the data table beneath the chart for non-table view types.
112
+ * Independent of whether `table` appears in the view toggle. The below-table is
113
+ * hidden when `table` is the selected view (a table is never stacked under a table).
114
+ */
115
+ showTableBelowChart?: boolean;
116
+ /** When true (default), shows the chart/table type toggle in the header. */
117
+ showWidgetTypeToggle?: boolean;
118
+ /** Field used as the generated stacked chart grouping key. Defaults to the second category-like column. */
119
+ stackKey?: string;
120
+ /** Maximum table container height when table scrolling is enabled. Numbers are treated as pixel values. */
121
+ tableMaxHeight?: number | string;
122
+ /** Title displayed in the widget header. */
123
+ title?: string;
124
+ /** Widget width. Numbers are treated as pixel values; strings are passed through as CSS values. */
125
+ width?: number | string;
126
+ /** Field used as the generated chart category/x-axis. */
127
+ xKey?: string;
128
+ /** Field used as the generated chart series/y-axis. */
129
+ yKey?: string;
130
+ }
@@ -0,0 +1,40 @@
1
+ import { ComputedRef, Ref, WatchSource } from 'vue';
2
+ import { PvDataWidgetDataRow, PvDataWidgetProps } from './types';
3
+ /** Overlay text shown when a data handler fails and no `errorText` option is provided. */
4
+ export declare const DEFAULT_DATA_WIDGET_ERROR_TEXT = "Unable to load data";
5
+ /** Fetches the data rows for a PvDataWidget, e.g. from an API. */
6
+ export type PvDataWidgetDataHandler = () => PvDataWidgetDataRow[] | Promise<PvDataWidgetDataRow[]>;
7
+ export interface UsePvDataWidgetDataOptions {
8
+ /** Overlay text shown on the widget when the handler fails. */
9
+ errorText?: string;
10
+ /** When false, data is not fetched until `refresh` is called. Defaults to true. */
11
+ immediate?: boolean;
12
+ /** Reactive sources (e.g. filter state) that trigger a refetch when changed. */
13
+ watch?: WatchSource | WatchSource[];
14
+ }
15
+ export interface UsePvDataWidgetDataReturn {
16
+ /** Rows returned by the most recent successful handler call. */
17
+ chartData: Ref<PvDataWidgetDataRow[]>;
18
+ /** True while a handler call is pending. */
19
+ chartLoading: Ref<boolean>;
20
+ /** Error from the most recent handler call, cleared on the next successful call. */
21
+ error: Ref<Error | undefined>;
22
+ /** Re-invokes the handler. Resolves when the call settles. */
23
+ refresh: () => Promise<void>;
24
+ /**
25
+ * Spreadable PvDataWidget props: `chartData`, `chartLoading`, and — only while in an
26
+ * error state — `noDataOverlayText`. Place `v-bind="widgetProps"` after your own
27
+ * bindings: your `noDataOverlayText` then applies to genuinely empty data, while the
28
+ * error text takes precedence when a fetch fails.
29
+ */
30
+ widgetProps: ComputedRef<Pick<PvDataWidgetProps, "chartData" | "chartLoading" | "noDataOverlayText">>;
31
+ }
32
+ /**
33
+ * Manages the fetch lifecycle for a PvDataWidget whose rows come from an async
34
+ * source: loading state, error-to-overlay mapping, stale-response protection,
35
+ * and refetching on demand or when watched sources change.
36
+ *
37
+ * Entirely optional — PvDataWidget itself stays a pure presentational component
38
+ * and can be fed `chartData` directly.
39
+ */
40
+ export declare const usePvDataWidgetData: (handler: PvDataWidgetDataHandler, options?: UsePvDataWidgetDataOptions) => UsePvDataWidgetDataReturn;
@@ -12,15 +12,9 @@ export interface PvMapChartProps {
12
12
  seriesKey: string;
13
13
  /** The geographic granularity of the map. Currently only `"state"` is fully supported. */
14
14
  mapType?: MapTopologyType;
15
- /**
16
- * Reserved for future use. Currently has no effect on rendering; the color gradient legend
17
- * below the map is always rendered.
18
- */
15
+ /** When true, renders the color gradient legend above the map. */
19
16
  displayGradientLegend?: boolean;
20
- /**
21
- * Reserved for future use. Currently has no effect on rendering; the region selector dropdown
22
- * is always rendered.
23
- */
17
+ /** When true, renders the region selector dropdown above the map. */
24
18
  displayRegionSelector?: boolean;
25
19
  /** Minimum value for the gradient legend scale. */
26
20
  gradientLegendMin?: number;
@@ -54,6 +48,7 @@ declare const _default: DefineComponent<{
54
48
  isLoading: boolean;
55
49
  mapType: MapTopologyType;
56
50
  displayGradientLegend: boolean;
51
+ displayRegionSelector: boolean;
57
52
  gradientLegendMin: number;
58
53
  gradientLegendMax: number;
59
54
  seriesValueFormatter: (value: number) => string;
@@ -0,0 +1,58 @@
1
+ import { AgChartOptions } from 'ag-charts-types';
2
+ type ChartRecord = Record<string, unknown>;
3
+ /** Pixels of horizontal width allotted per data point when a chart scrolls horizontally. */
4
+ export declare const CHART_SCROLL_ITEM_WIDTH_PX = 56;
5
+ /** Pixels of vertical height allotted per data point when a horizontal-bar chart scrolls. */
6
+ export declare const CHART_SCROLL_ITEM_HEIGHT_PX = 32;
7
+ /** Coerce a numeric (pixel) or string CSS size into a CSS length, or `undefined` when unset. */
8
+ export declare const getCssSize: (value: number | string | undefined) => string | undefined;
9
+ /**
10
+ * Build the explicit `height`/`width` (and matching `max-*`) style for a widget shell.
11
+ * An explicit dimension also caps its `max-*` so the widget never grows past it.
12
+ */
13
+ export declare const buildWidgetStyle: (dimensions: {
14
+ height?: number | string;
15
+ maxHeight?: number | string;
16
+ maxWidth?: number | string;
17
+ width?: number | string;
18
+ }) => Record<string, string>;
19
+ /** Whether any explicit dimension bounds the widget shell (switching it to constrained flex layout). */
20
+ export declare const getIsWidgetConstrained: (dimensions: {
21
+ height?: number | string;
22
+ maxHeight?: number | string;
23
+ maxWidth?: number | string;
24
+ width?: number | string;
25
+ }) => boolean;
26
+ /**
27
+ * Minimum chart height for a widget: when a horizontal-bar chart scrolls vertically,
28
+ * grow past the base height so every data point keeps its allotted row height.
29
+ */
30
+ export declare const getScrollableChartMinHeight: (params: {
31
+ baseMinHeight: number;
32
+ dataCount: number;
33
+ enableChartScrolling: boolean;
34
+ isHorizontalScrollingChart: boolean;
35
+ }) => number;
36
+ /**
37
+ * Inline style for the scrollable chart content: horizontal-bar charts grow vertically
38
+ * per data point; all other charts grow horizontally, never below `minContentWidth`.
39
+ */
40
+ export declare const getChartScrollContentStyle: (params: {
41
+ chartMinHeight: number;
42
+ dataCount: number;
43
+ enableChartScrolling: boolean;
44
+ isHorizontalScrollingChart: boolean;
45
+ minContentWidth: number;
46
+ }) => Record<string, string> | undefined;
47
+ /** Coerce to a plain object record, or `undefined` when the value is not one. */
48
+ export declare const asObjectRecord: (value: unknown) => ChartRecord | undefined;
49
+ export declare const limitDataRows: <T>(data: T[], dataLimit: number | undefined) => T[];
50
+ export declare const getChartDataLength: (options: AgChartOptions) => number;
51
+ export declare const getIsHorizontalBarChart: (options: AgChartOptions) => boolean;
52
+ export declare const applyChartWidgetOptions: (options: AgChartOptions, config: {
53
+ dataLimit?: number;
54
+ hideAxisTitles?: boolean;
55
+ hideValueAxis?: boolean;
56
+ showAxes?: boolean;
57
+ }) => AgChartOptions;
58
+ export {};
@@ -1,4 +1,6 @@
1
1
  export { default as PvChart } from '../charts/PvChart/PvChart.vue';
2
+ export { default as PvChartWidget } from '../charts/PvChartWidget/PvChartWidget.vue';
3
+ export { default as PvDataWidget } from '../charts/PvDataWidget/PvDataWidget.vue';
2
4
  export { default as PvDataTableWithChart } from '../charts/PvDataTableWithChart/PvDataTableWithChart.vue';
3
5
  export { default as PvMapChart } from '../charts/PvMapChart/PvMapChart.vue';
4
6
  export { SCATTER_MARKER_STROKE, PitViperAGChartsMonochromeTheme, PitViperAGChartsMonochromeThemeName, PitViperAGChartsMulticolorTheme, PitViperAGChartsMulticolorThemeName, } from '../charts/themes';
@@ -6,6 +8,10 @@ export { default as PvDataTable } from '../tables/PvDataTable/PvDataTable.vue';
6
8
  export { createPvDataTableFilterStore, providePvDataTableFilterStore, usePvDataTableFilterStore, } from '../tables/PvDataTable/useFilterStore';
7
9
  export type { PvDataTableFilterController, PvDataTableFilterModel, PvDataTableFilterStore, } from '../tables/PvDataTable/useFilterStore';
8
10
  export type { FocusUpdateEvent, FilterValueResponseOption, FilterRendererProps } from '../tables/PvDataTable/types';
11
+ export type { PvChartWidgetMiniChartMode, PvChartWidgetProps, PvChartWidgetSlotProps, } from '../charts/PvChartWidget/types';
12
+ export type { PvDataWidgetChartType, PvDataWidgetChartTypeOption, PvDataWidgetColumnDefinition, PvDataWidgetDataRow, PvDataWidgetProps, PvDataWidgetViewType, } from '../charts/PvDataWidget/types';
13
+ export { DEFAULT_DATA_WIDGET_ERROR_TEXT, usePvDataWidgetData } from '../charts/PvDataWidget/usePvDataWidgetData';
14
+ export type { PvDataWidgetDataHandler, UsePvDataWidgetDataOptions, UsePvDataWidgetDataReturn, } from '../charts/PvDataWidget/usePvDataWidgetData';
9
15
  export type { CrosslineOverlayGroup, VerticalLineOverlay } from '../charts/PvDataTableWithChart/types';
10
16
  export { constructAdvancedFilterCondition, convertFilterModelToAdvanced, filterModelContainsColId, mergeFilterModels, getSelectedValuesFromFilterModel, filterModelsEqual, mergeAdvancedFilterCondition, removeColumnFromAdvancedFilter, getSelectedValuesFromAdvancedFilterModel, isAdvancedFilterModel, isFilterModelEmpty, getSelectedValues, getSelectedValuesFromFilterModelByColId, updateSetFilter, updateMultiOrSetFilter, removeColumnFilter, excludeValueFromSetFilter, } from '../tables/PvDataTable/filters/filterHelpers';
11
17
  export type { AnyFilterModel } from '../tables/PvDataTable/filters/filterHelpers';