@pythia-software/query-table-ui 0.9.4 → 0.9.6

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/README.md CHANGED
@@ -234,6 +234,15 @@ full workbenches use the shared modal/sheet foundation with Apply/Cancel and foc
234
234
  containment. Native selects, expandable sections, and formula autocomplete keep
235
235
  their respective form, disclosure, and combobox interactions.
236
236
 
237
+ Distinct filter values use a freeform combobox. Focus or click the value input
238
+ to open suggestions; Arrow Up/Down highlights a choice and Enter selects it.
239
+ Escape dismisses suggestions and Tab leaves without selecting. The menu sizes
240
+ to its contents independently of the compact input, wraps long values, and
241
+ scrolls within the viewport, including inside mobile filter dialogs. Loading,
242
+ unavailable suggestions, and no matches never prevent typing arbitrary values.
243
+ While fetching new suggestions, matching values from the previous response stay
244
+ visible and selectable. A loading message appears only when no known values match.
245
+
237
246
  ## Tag/set filters
238
247
 
239
248
  Set `filter.editor: "set"` on a `textarray` field to use the native WHERE
@@ -370,6 +379,54 @@ status indicators an accessible label on their wrapper.
370
379
 
371
380
  ## Mobile behavior
372
381
 
382
+ ### Responsive target sizing
383
+
384
+ Set the public, unitless `--qt-touch-target-scale` CSS custom property to
385
+ configure the **added** touch-target size in the bundled theme:
386
+
387
+ | Value | Target sizing |
388
+ | --- | --- |
389
+ | `1` (default, including when unset) | Existing responsive enlargement |
390
+ | `0.5` | Half the added size |
391
+ | `0` | Desktop target sizing with the responsive layout |
392
+
393
+ ```css
394
+ /* Scope to a host wrapper containing the builder, table and metrics. */
395
+ .pharos-query-table {
396
+ --qt-touch-target-scale: 0.5;
397
+ }
398
+ ```
399
+
400
+ For each enlarged dimension, the theme uses
401
+ `desktop + (responsive - desktop) * scale`. A desktop 24px button that normally
402
+ grows to 44px therefore becomes 34px at `0.5`. Each control uses its own desktop
403
+ baseline, including its line box, padding and borders; collapse controls, chips,
404
+ picker rows and editor buttons have different baselines. Narrow and coarse
405
+ pointer rules use the final responsive size once, so matching both does not
406
+ compound the enlargement. Use a number from `0` to `1`, without a unit.
407
+
408
+ The setting covers query actions/chips, table cells/actions, picker and menu
409
+ rows, selection actions, saved-query controls, JSON controls, and select,
410
+ property and metric editor controls. Content remains a lower bound: wrapped
411
+ labels, icons, native controls and the retained mobile input fonts can require
412
+ more room than the scaled minimum. Existing responsive size reductions stay
413
+ compact. Layout widths, wrapping, sheets, scrolling, focus behavior, drag/touch
414
+ actions, breakpoints and input font sizes are independent of the factor.
415
+
416
+ Use `:root` for an application-wide setting, or a wrapper for independent
417
+ instances. Built-in portaled menus, pickers, dialogs and sheets inherit the
418
+ setting from their trigger/overlay anchor through the same theme propagation
419
+ as the palette, including live ancestor `class`, `style` and `data-theme`
420
+ changes. Keep standalone overlays beneath that wrapper in the React tree (and
421
+ their anchor within it). Host-owned portals and controls with custom styling
422
+ must propagate/apply their own sizing. `QueryBuilder`'s `compact` prop controls
423
+ clause presentation separately.
424
+
425
+ Run `npm run test:touch-targets` with `npm run demo` running to check relative
426
+ sizing, scoped portal updates and interactions in Chromium and WebKit.
427
+
428
+ ### Responsive layout and interactions
429
+
373
430
  The bundled theme keeps the table as a horizontally scrollable grid on narrow
374
431
  screens so columns remain comparable. Narrow screens (up to 760px) and short,
375
432
  touch-based landscape viewports use a mobile interaction model:
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, SetStateAction, ButtonHTMLAttributes, CSSProperties, PointerEvent, Ref, MutableRefObject } from 'react';
2
+ import { ReactNode, SetStateAction, CSSProperties, ButtonHTMLAttributes, PointerEvent, Ref, MutableRefObject } from 'react';
3
3
  import { FieldDef, QueryState, LinkTargets, CellDisplay, JsonCellDisplay, RowId, AggregationClause, AggregationBucket, AggregationResultEntry, MetricValue, SavedQuery, FieldStats, WhereClause, MetricValueFormat, FieldSchema, PropertyViewState, RelationshipAdapter, ObjectReference, PropertyFormat, PropertyViewStorage, ItemPropertyMode, FormulaFunction, GroupedRow } from '@pythia-software/query-table-core';
4
4
  import { ItemDetailsApi, SelectionApi, ColumnDragApi, QueryTableApi, QueryFilterApi, AggregationsApi, SavedQueriesApi, RequestActivityApi, PropertyViewApi, GroupingApi } from '@pythia-software/query-table-react';
5
5
  import { Placement } from '@floating-ui/react';
@@ -346,7 +346,11 @@ interface FloatingOverlayOptions {
346
346
  anchor: OverlayAnchor;
347
347
  onClose: () => void;
348
348
  returnFocus?: HTMLElement | null | undefined;
349
- width?: number | undefined;
349
+ width?: CSSProperties["width"] | undefined;
350
+ /** Combobox suggestions remain anchored on mobile and keep focus in their input. */
351
+ modalOnMobile?: boolean | undefined;
352
+ retainAnchorFocus?: boolean | undefined;
353
+ maxHeight?: number | undefined;
350
354
  placement?: Placement | undefined;
351
355
  nodeId?: string | undefined;
352
356
  }