@turquoisehealth/pit-viper 2.182.1-dev.4 → 2.183.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 (29) hide show
  1. package/package.json +1 -1
  2. package/pv-components/dist/stats/vue/base/stats.html +1 -1
  3. package/pv-components/dist/stats/vue/visualizations/stats.html +1 -1
  4. package/pv-components/dist/stats/web/pv-menu-stats.html +1 -1
  5. package/pv-components/dist/stats/web/pv-multi-select-button-stats.html +1 -1
  6. package/pv-components/dist/stats/web/pv-query-builder-input-stats.html +1 -1
  7. package/pv-components/dist/stats/web/pv-select-button-stats.html +1 -1
  8. package/pv-components/dist/vue/base/components/base/PvMenu/cascadeUtils.d.ts +1 -2
  9. package/pv-components/dist/vue/base/components/base/PvMultiSelectButton/PvMultiSelectButton.vue.d.ts +0 -3
  10. package/pv-components/dist/vue/base/components/base/PvMultiSelectButton/types.d.ts +1 -3
  11. package/pv-components/dist/vue/base/pv-components-base.mjs +871 -924
  12. package/pv-components/dist/vue/base/pv-components-base.mjs.map +1 -1
  13. package/pv-components/dist/vue/base/types.d.ts +4 -6
  14. package/pv-components/dist/vue/visualizations/components/base/PvMenu/cascadeUtils.d.ts +1 -2
  15. package/pv-components/dist/vue/visualizations/components/base/PvMultiSelectButton/PvMultiSelectButton.vue.d.ts +0 -3
  16. package/pv-components/dist/vue/visualizations/components/base/PvMultiSelectButton/types.d.ts +1 -3
  17. package/pv-components/dist/vue/visualizations/components/tables/PvDataTable/helpers.d.ts +1 -5
  18. package/pv-components/dist/vue/visualizations/components/tables/PvDataTable/types.d.ts +17 -24
  19. package/pv-components/dist/vue/visualizations/components/tables/PvDataTable/useFilterStore.d.ts +0 -4
  20. package/pv-components/dist/vue/visualizations/components/tables/PvDataTable/useSetFilter.d.ts +8 -10
  21. package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs +1355 -1656
  22. package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs.map +1 -1
  23. package/pv-components/dist/vue/visualizations/types.d.ts +4 -6
  24. package/pv-components/dist/web/components/pv-menu/pv-menu.js +35 -44
  25. package/pv-components/dist/web/components/pv-multi-select-button/pv-multi-select-button.js +963 -1016
  26. package/pv-components/dist/web/components/pv-query-builder-input/pv-query-builder-input.js +59 -68
  27. package/pv-components/dist/web/components/pv-select-button/pv-select-button.js +35 -44
  28. package/pv-components/dist/web/pv-components.iife.js +20 -20
  29. package/pv-components/dist/web/pv-components.iife.js.map +1 -1
@@ -56,14 +56,12 @@ export interface MenuOptionSelectedEvent {
56
56
  }
57
57
  export interface SeeMoreEvent {
58
58
  parentId?: string;
59
- offset?: number;
60
59
  }
61
- export interface SelectionNode {
62
- id: string;
63
- state: "selected" | "deselected";
64
- children?: SelectionNode[];
60
+ export interface MultiSelectState {
61
+ selectedParentIds: string[];
62
+ selectedChildrenIds: string[];
63
+ deselectedChildrenIds: string[];
65
64
  }
66
- export type MultiSelectState = SelectionNode[];
67
65
  export declare enum MenuItemType {
68
66
  simple = "simple",
69
67
  checkbox = "checkbox",
@@ -1,4 +1,4 @@
1
- import { MenuOption, MultiSelectState } from '../../../types';
1
+ import { MenuOption } from '../../../types';
2
2
  /** Recursively collect all leaf (childless) options from a tree. */
3
3
  export declare function collectLeafOptions<T>(options: MenuOption<T>[]): MenuOption<T>[];
4
4
  /**
@@ -21,7 +21,6 @@ export declare function mergeLeafOptions<T>(base: MenuOption<T>[], overlay: Menu
21
21
  * not depend on Map iteration order.
22
22
  */
23
23
  export declare function countWithCollapsedParents<T>(options: MenuOption<T>[], selectedIds: Set<string>): number;
24
- export declare function countFromSelectionState(state: MultiSelectState): number;
25
24
  /**
26
25
  * Recursively filter a tree for a search value.
27
26
  *
@@ -34,7 +34,6 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
34
34
  groupings: string[];
35
35
  hideParentOnChildQueryMatch: boolean;
36
36
  icon: string;
37
- hasMoreOptions: boolean;
38
37
  optionsAction: MenuAction<T> | undefined;
39
38
  optionsRenderer: Component;
40
39
  overlayTrigger: boolean;
@@ -73,7 +72,6 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
73
72
  groupings: string[];
74
73
  hideParentOnChildQueryMatch: boolean;
75
74
  icon: string;
76
- hasMoreOptions: boolean;
77
75
  optionsAction: MenuAction<T> | undefined;
78
76
  optionsRenderer: Component;
79
77
  overlayTrigger: boolean;
@@ -112,7 +110,6 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
112
110
  groupings: string[];
113
111
  hideParentOnChildQueryMatch: boolean;
114
112
  icon: string;
115
- hasMoreOptions: boolean;
116
113
  optionsAction: MenuAction<T> | undefined;
117
114
  optionsRenderer: Component;
118
115
  overlayTrigger: boolean;
@@ -47,8 +47,6 @@ export interface PvMultiSelectButtonProps<T = unknown, SlotContext extends Recor
47
47
  icon?: string;
48
48
  /** Show a loading spinner inside the dropdown */
49
49
  isLoading?: boolean;
50
- /** Whether more top-level options are available after the loaded options */
51
- hasMoreOptions?: boolean;
52
50
  /** Text label on the trigger button */
53
51
  label?: string;
54
52
  /** Style of the footer action panel. "select-clear" shows select/clear all; "cancel-confirm" requires explicit confirmation. */
@@ -84,7 +82,7 @@ export interface PvMultiSelectButtonProps<T = unknown, SlotContext extends Recor
84
82
  /** CSS selector for teleporting the popover dropdown */
85
83
  teleportLocation?: string;
86
84
  /** Total available top-level options (may exceed options.length when paginating).
87
- * Used as a fallback to show "See more" when hasMoreOptions is not provided. */
85
+ * When totalOptionCount > options.length, a "See more" button appears. */
88
86
  totalOptionCount?: number;
89
87
  /** Visual style of the trigger button */
90
88
  variant?: PvSelectButtonVariant;
@@ -1,6 +1,6 @@
1
1
  import { Column, ColumnVO, ICellRendererParams, ValueFormatterFunc } from 'ag-grid-enterprise';
2
2
  import { ColDef } from 'ag-grid-community';
3
- import { AggregateFieldHierarchy, ColDefContextProps } from './types';
3
+ import { ColDefContextProps } from './types';
4
4
  /**
5
5
  * Returns row data for a cell renderer. For leaf rows, returns `params.data` directly.
6
6
  * For group rows (where `params.data` is null), falls back to the first child row's data.
@@ -13,10 +13,6 @@ export declare const colDefValueFormatter: <T>(colDef: ColDef<T>) => ValueFormat
13
13
  export declare const colDefMaxSelectableValues: <T>(colDef: ColDef<T>) => number | null;
14
14
  export declare const isColDefSingleSelect: <T>(colDef: ColDef<T>) => boolean;
15
15
  export declare const isColDefNumericDataType: <T>(colDef: ColDef<T>) => boolean;
16
- export declare const flattenAggregateFieldHierarchy: (hierarchy: AggregateFieldHierarchy | undefined) => string[];
17
- export declare const getAggregateFields: <T>(colDef: ColDef<T>) => string[];
18
- export declare const getAggregateLeafFields: (hierarchy: AggregateFieldHierarchy | undefined) => string[];
19
- export declare const getAggregateRootField: <T>(colDef: ColDef<T>) => string | undefined;
20
16
  export declare const isAggregateColDef: <T>(colDef: ColDef<T>) => boolean;
21
17
  export declare const processRowGroupCols: (rowGroupCols: ColumnVO[], colDefs: (ColDef | null | undefined)[] | undefined) => ColumnVO[];
22
18
  export declare const mapColsToColumnV0: (columns: Column[]) => ColumnVO[];
@@ -44,12 +44,6 @@ export interface TooltipDatum {
44
44
  [key: string]: string | number | undefined;
45
45
  }
46
46
  export type ChartTooltipRenderer = (params: AgCartesianSeriesTooltipRendererParams<TooltipDatum>) => string;
47
- export interface AggregateFieldHierarchy {
48
- /** Field represented by this hierarchy node. Parent/child relationships are determined by nesting. */
49
- field: string;
50
- /** Child fields nested under this field. */
51
- children?: AggregateFieldHierarchy[];
52
- }
53
47
  export interface ColDefContextProps<T> {
54
48
  /**
55
49
  * Display name for the aggregation function (e.g. "Sum", "Average", etc.) to show in the UI, if different from the aggFunc name
@@ -145,24 +139,27 @@ export interface ColDefContextProps<T> {
145
139
  customTooltipRenderer?: ChartTooltipRenderer;
146
140
  /**
147
141
  * For server-side filtering, list of associated column IDs to query against when searching for filter values.
142
+ *
143
+ * Interaction with `aggregateFields`:
144
+ * - `queryColIds` only, with query: rows matching the query in any `queryColIds` field are found,
145
+ * then the base column's `field` values are collected from those rows.
146
+ * - `queryColIds` + `aggregateFields`, with query: rows matching the query via `queryColIds` are found,
147
+ * then values are collected from each `aggregateFields` field (not the base `field`).
148
+ * - `queryColIds` only, no query: ignored — all values from the base `field` are returned.
149
+ * - `aggregateFields` only, no query: values are collected from each `aggregateFields` field across all rows.
148
150
  */
149
151
  queryColIds?: string[];
150
152
  /**
151
- * Hierarchy of fields represented by this aggregate filter column.
153
+ * A list of fields to use when aggregating data for this column.
154
+ * Fields must be present as their own columns in the table.
155
+ * The filter types must match between the aggregated column AND the fields used for aggregation.
156
+ * Filters for the aggregated fields will be hidden from the UI.
152
157
  *
153
- * Example: `{ field: "health_system", children: [{ field: "provider_id" }] }`
154
- * renders health systems as parent options and providers as nested child options.
155
- * Fields must be present as their own columns in the table. Filters for the
156
- * hierarchy fields are hidden from the filter panel in favor of this aggregate filter.
158
+ * Requires `enableAdvancedFilter: true` on the table columns with `aggregateFields` are
159
+ * excluded (and may log a console warning) when advanced filtering is disabled.
157
160
  *
158
- * Requires `enableAdvancedFilter: true` on the table columns with an aggregate hierarchy
159
- * are excluded (and may log a console warning) when advanced filtering is disabled.
160
- */
161
- aggregateFieldHierarchy?: AggregateFieldHierarchy;
162
- /**
163
- * Aggregate filter column for columns that have "peer" relationships, as opposed to hierarchical
164
- * Requires `enableAdvancedFilter: true` on the table — columns with aggregate fields
165
- * are excluded (and may log a console warning) when advanced filtering is disabled.
161
+ * Selected filter values are routed back to their originating field via `colField` metadata
162
+ * and composed into an OR join across fields, then ANDed with existing filters.
166
163
  */
167
164
  aggregateFields?: string[];
168
165
  /**
@@ -173,7 +170,7 @@ export interface ColDefContextProps<T> {
173
170
  export interface FilterValuesSetHandlerParams<T> {
174
171
  api?: GridApi<T>;
175
172
  colDef: ColDef<T>;
176
- filterModel?: FilterModel | AdvancedFilterModel | null;
173
+ filterModel?: FilterModel | null;
177
174
  query?: string;
178
175
  selectedValues?: (string | null)[];
179
176
  /** Pagination offset for "see more" requests */
@@ -194,8 +191,6 @@ export interface FilterValueMatchResult {
194
191
  }
195
192
  export interface FilterValuesResponse {
196
193
  values: (FilterValueResponseOption | null)[];
197
- /** Whether additional matching values are available after this page */
198
- hasMore?: boolean;
199
194
  /** Total count of matching values (before pagination/truncation) */
200
195
  totalCount?: number;
201
196
  }
@@ -222,8 +217,6 @@ export interface FilterValueResponseOption {
222
217
  matchedValue?: string;
223
218
  /** The field used to match the value (for search scenarios) */
224
219
  matchedField?: string;
225
- /** Optional PvMenu option props to apply when rendering this value in custom/nested filters. */
226
- menuOption?: Partial<Omit<MenuOption<FilterValueResponseOption>, "id" | "text" | "children" | "context">>;
227
220
  /** Nested child options for hierarchical/cascade filtering */
228
221
  children?: FilterValueResponseOption[];
229
222
  /** Total number of children available (may exceed children.length when paginating) */
@@ -21,7 +21,6 @@ export declare const createFilterStore: () => {
21
21
  filterModel?: FilterModel | AdvancedFilterModel;
22
22
  offset?: number;
23
23
  parentId?: string;
24
- useStaged?: boolean;
25
24
  }) => Promise<(string | null)[]>;
26
25
  filterValueContext: (colField: string, value: string | null) => FilterValueResponseOption | null | undefined;
27
26
  filterModelEmpty: ComputedRef<boolean>;
@@ -52,7 +51,6 @@ export declare const createFilterStore: () => {
52
51
  getStagedSelectedValues: (colField: string) => (string | null)[];
53
52
  setStagedSelectedValues: (colField: string, selectedValues: (string | null)[]) => void;
54
53
  filterValueSearchTextMap: Ref<Record<string, string | null>, Record<string, string | null>>;
55
- filterValuesHasMoreMap: Ref<Record<string, boolean | undefined>, Record<string, boolean | undefined>>;
56
54
  filterValuesTotalCountMap: Ref<Record<string, number | undefined>, Record<string, number | undefined>>;
57
55
  };
58
56
  export declare const useFilterStore: () => {
@@ -69,7 +67,6 @@ export declare const useFilterStore: () => {
69
67
  filterModel?: FilterModel | AdvancedFilterModel;
70
68
  offset?: number;
71
69
  parentId?: string;
72
- useStaged?: boolean;
73
70
  }) => Promise<(string | null)[]>;
74
71
  filterValueContext: (colField: string, value: string | null) => FilterValueResponseOption | null | undefined;
75
72
  filterModelEmpty: ComputedRef<boolean>;
@@ -100,6 +97,5 @@ export declare const useFilterStore: () => {
100
97
  getStagedSelectedValues: (colField: string) => (string | null)[];
101
98
  setStagedSelectedValues: (colField: string, selectedValues: (string | null)[]) => void;
102
99
  filterValueSearchTextMap: Ref<Record<string, string | null>, Record<string, string | null>>;
103
- filterValuesHasMoreMap: Ref<Record<string, boolean | undefined>, Record<string, boolean | undefined>>;
104
100
  filterValuesTotalCountMap: Ref<Record<string, number | undefined>, Record<string, number | undefined>>;
105
101
  };
@@ -32,20 +32,18 @@ export declare const useSetFilter: <T>(options: UseSetFilterOptions<T>) => {
32
32
  filterOptionsSortDescription: ComputedRef<string | undefined>;
33
33
  filterOptionsSortTooltip: ComputedRef<string | undefined>;
34
34
  totalOptionCount: ComputedRef<number | undefined>;
35
- hasMoreOptions: ComputedRef<boolean | undefined>;
36
35
  isAggregate: ComputedRef<boolean>;
37
36
  cascadeSelectionState: Ref<{
38
- id: string;
39
- state: "selected" | "deselected";
40
- children?: /*elided*/ any[] | undefined;
41
- }[], MultiSelectState | {
42
- id: string;
43
- state: "selected" | "deselected";
44
- children?: /*elided*/ any[] | undefined;
45
- }[]>;
37
+ selectedParentIds: string[];
38
+ selectedChildrenIds: string[];
39
+ deselectedChildrenIds: string[];
40
+ }, MultiSelectState | {
41
+ selectedParentIds: string[];
42
+ selectedChildrenIds: string[];
43
+ deselectedChildrenIds: string[];
44
+ }>;
46
45
  filterValueContext: (colField: string, value: string | null) => FilterValueResponseOption | null | undefined;
47
46
  formatDisplayValue: (input: string | null) => string | null;
48
- resolvedFilterValueContext: (input: string | null) => FilterValueResponseOption | null | undefined;
49
47
  isUnresolvedMetadataValue: (value: string | null) => boolean;
50
48
  getLatestFilterValues: (fetchNewValues?: boolean, forceFetchValues?: boolean) => Promise<void>;
51
49
  addSelectedValue: (value: string | null, field?: string) => void;