@rivet-health/design-system 33.1.2 → 34.0.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.
@@ -115,6 +115,12 @@ export declare namespace RivSelect {
115
115
  error: unknown | null;
116
116
  };
117
117
  sourceOptionGroups: SourceOptionGroup<O>[];
118
+ /**
119
+ * Stores the unfiltered original option groups when search filtering is active.
120
+ * Used by `allowSelectNonLeafDuringSearch` to select all children of a parent,
121
+ * including those not visible in the filtered search results.
122
+ */
123
+ originalOptionGroups: SourceOptionGroup<O>[];
118
124
  selection: {
119
125
  selected: OptionSet<O>;
120
126
  };
@@ -180,7 +186,16 @@ export declare namespace RivSelect {
180
186
  * The Source's job is to fetch options (based on the current state) which
181
187
  * then blend with the other pieces of state to produce the FullState.
182
188
  */
183
- type Source<O extends BaseOption> = (query: CoreState<O>['query'], mostRecentAction: Action<O>) => Promise<SourceOptionGroup<O>[]>;
189
+ type SourceResult<O extends BaseOption> = SourceOptionGroup<O>[] | {
190
+ data: SourceOptionGroup<O>[];
191
+ /**
192
+ * Original unfiltered data, provided when search filtering is active.
193
+ * Used by `allowSelectNonLeafDuringSearch` to select all children of
194
+ * a parent, including those not visible in the filtered search results.
195
+ */
196
+ originalData?: SourceOptionGroup<O>[];
197
+ };
198
+ type Source<O extends BaseOption> = (query: CoreState<O>['query'], mostRecentAction: Action<O>) => Promise<SourceResult<O>>;
184
199
  type Manager<O extends BaseOption> = {
185
200
  actions: Subject<Action<O>>;
186
201
  state: Connectable<FullState<O>>;
@@ -203,6 +218,14 @@ export declare namespace RivSelect {
203
218
  showSingleSelected?: boolean;
204
219
  useTopLevelOptionsForDisplay?: boolean;
205
220
  getCustomOptionDisplay?: (selectedOptions: SourceOption<O>[]) => string;
221
+ /**
222
+ * When true, non-leaf nodes (parents) remain selectable during search,
223
+ * and selecting them will select/deselect ALL children from the original
224
+ * dataset, not just the visible filtered results.
225
+ *
226
+ * Default: false (current behavior - parents are not selectable during search)
227
+ */
228
+ allowSelectNonLeafDuringSearch?: boolean;
206
229
  };
207
230
  function createManager<O extends BaseOption>(source: Source<O>, options?: ManagerOptions<O>): Manager<O>;
208
231
  type InMemoryManagerOptions<O extends BaseOption> = ManagerOptions<O> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivet-health/design-system",
3
- "version": "33.1.2",
3
+ "version": "34.0.1",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^14.0.0",
6
6
  "@angular/common": "^14.0.0",