@bmsuisse/datagrid 0.35.3 → 0.37.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/dist/index.d.ts +25 -2
- package/dist/index.js +232 -87
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -258,6 +258,16 @@ type BooleanColumn<TRow> = BaseColumn<TRow> & {
|
|
|
258
258
|
interface EnumOption {
|
|
259
259
|
value: string;
|
|
260
260
|
label: string;
|
|
261
|
+
/**
|
|
262
|
+
* Groups this option under a sticky header in `EnumFilter`'s dropdown,
|
|
263
|
+
* with a tri-state checkbox that selects/deselects the whole group at
|
|
264
|
+
* once — mirrors `@bmsuisse/ui`'s `ComboboxOption.group`/
|
|
265
|
+
* `TagComboboxOption.group`. Options sharing a `group` must be adjacent in
|
|
266
|
+
* `options`: a header renders the first time a group key is seen, so
|
|
267
|
+
* interleaved groups would render more than one header for the same key.
|
|
268
|
+
* Options with no `group` render individually, with no header.
|
|
269
|
+
*/
|
|
270
|
+
group?: string;
|
|
261
271
|
}
|
|
262
272
|
type EnumColumn<TRow> = BaseColumn<TRow> & {
|
|
263
273
|
type: "enum";
|
|
@@ -318,9 +328,22 @@ declare function DateRangeFilter<TRow>({ column, value, onChange, today, bare, }
|
|
|
318
328
|
* - a tri-state "Select all" checkbox acts on whatever subset is currently
|
|
319
329
|
* visible after that search, not the full option set — matching Excel's
|
|
320
330
|
* own column-filter behavior ("select all of what's shown").
|
|
331
|
+
* - options sharing an `EnumOption.group` render under a sticky group
|
|
332
|
+
* header with its own tri-state checkbox, letting a whole group be
|
|
333
|
+
* selected/deselected in one click — mirrors `@bmsuisse/ui`'s
|
|
334
|
+
* `Combobox`/`TagCombobox` grouped-dropdown treatment (sticky `bg-muted`
|
|
335
|
+
* header, same contiguous-group chunking), kept as a local mirror rather
|
|
336
|
+
* than a shared dependency since `datagrid` and `ui` are sibling packages
|
|
337
|
+
* with no cross-dependency (see that package's `Combobox` doc, which
|
|
338
|
+
* mirrors this component's own plain-substring search for the same
|
|
339
|
+
* reason). The header's tri-state and toggle are scoped to that group's
|
|
340
|
+
* currently-*visible* options, same as "Select all" — unlike `Combobox`,
|
|
341
|
+
* which scopes its group toggle to the full option set regardless of
|
|
342
|
+
* search.
|
|
321
343
|
* - every visible option gets its own plain checkbox + label row (a real
|
|
322
|
-
* shadcn `Checkbox`, not a menu item
|
|
323
|
-
* option
|
|
344
|
+
* shadcn `Checkbox`, not a menu item — unlike `Combobox`'s button/`role=
|
|
345
|
+
* "option"` rows), inside a scrollable list so long option lists don't
|
|
346
|
+
* blow up the popover's height.
|
|
324
347
|
* - every toggle emits the updated `FilterDescriptor` immediately — there's
|
|
325
348
|
* no OK/Cancel step, matching every other filter widget in this package.
|
|
326
349
|
*
|