@pythia-software/query-table-ui 1.0.1 → 1.0.2

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
@@ -350,6 +350,52 @@ and handle selection, save feedback, and unsaved-edit protection in your control
350
350
  Share and query history remain available. The demo's `/saved-queries` route shows
351
351
  an integrated prototype of this slot.
352
352
 
353
+ Pass `runActionsBeforeActivity` to insert host-owned React content into the
354
+ row-count/update bar, after any auto-update status and immediately before
355
+ **Request activity**, **Auto-Update**, and **Run Now**:
356
+
357
+ ```tsx
358
+ <QueryBuilder
359
+ api={table}
360
+ fields={schema.fields}
361
+ total={table.total}
362
+ runActionsBeforeActivity={
363
+ <DataReadinessIndicator dataset={dataset} query={table.query} />
364
+ }
365
+ />
366
+ ```
367
+
368
+ The slot stays in the normal React tree, mounted in both expanded and collapsed
369
+ layouts, through loading, errors, polling, and parent rerenders. Each builder
370
+ has its own content and lifecycle. Omit it (or pass `null`/`false`) for no extra
371
+ element or spacing. The theme wraps actions on constrained widths; narrow/touch
372
+ layouts use a two-column grid in DOM/tab order, with polling status spanning
373
+ both columns. Prefer compact buttons as direct children (a fragment can supply
374
+ several); host dialogs should use a portal or a native `<dialog>` so their
375
+ contents do not occupy an action cell. `requestActivityDetails` remains a
376
+ separate slot **inside** the activity panel.
377
+
378
+ With the bundled `theme.css`, `qt-btn` is a supported styling class for native
379
+ host `<button type="button">` elements. It supplies normal, hover, disabled and
380
+ visible `:focus-visible` states and the builder's responsive touch targets
381
+ (44px at the default `--qt-touch-target-scale: 1`). `qt-btn--active` and
382
+ `qt-btn--primary` provide the matching state/primary treatments. Keep status
383
+ colors on the icon rather than the whole button, for example:
384
+
385
+ ```tsx
386
+ <button type="button" className="qt-btn" aria-label="Data readiness"
387
+ aria-haspopup="dialog" onClick={openReadinessDialog}>
388
+ <span className="host-readiness-ready"><Icon name="check" /></span>
389
+ </button>
390
+ ```
391
+
392
+ Use your own status-colored icon or wrap `Icon` in a host-styled span. The host
393
+ owns the accessible name, state, event handlers and dialog, including focus
394
+ restoration to the invoking button on close. Query Table adds no button wrapper,
395
+ disabled state or tab index to the slot. With a custom theme, apply your host
396
+ button styles directly; `classNames.button` only styles Query Table's controls.
397
+ The demo's `/run-actions` route shows independent builders and a host dialog.
398
+
353
399
  The query builder's **Share** button copies a URL containing the complete
354
400
  current query, including a saved default query. Configure `useQueryTable` with
355
401
  `syncUrl: true` so recipients load shared query URLs. Query tokens are encoded,
package/dist/index.d.ts CHANGED
@@ -288,6 +288,9 @@ interface QueryBuilderProps<Row> {
288
288
  shareUrl?: string;
289
289
  /** Additional diagnostics shown inside request activity. */
290
290
  requestActivityDetails?: ReactNode;
291
+ /** Host content after auto-update status and before Request activity.
292
+ * Remains mounted when the editor is collapsed; the host owns its behavior. */
293
+ runActionsBeforeActivity?: ReactNode;
291
294
  /** The controller; QueryBuilder drives it through the intent helpers. */
292
295
  api: QueryTableApi<Row>;
293
296
  /** All schema fields (for the field picker / sort picker). */
@@ -315,7 +318,7 @@ interface SelectPresentation {
315
318
  hint?: ReactNode;
316
319
  editorNotice?: ReactNode;
317
320
  }
318
- declare function QueryBuilder<Row>({ api, fields, total, running, classNames, collapsed, onCollapsedChange, defaultCollapsed, compact, metricTheme, metricLocale, requestActivityDetails, clauses, whereRow, summary, selectPresentation, matchesSavedQuery, savedQueryControls, shareUrl, }: QueryBuilderProps<Row>): ReactNode;
321
+ declare function QueryBuilder<Row>({ api, fields, total, running, classNames, collapsed, onCollapsedChange, defaultCollapsed, compact, metricTheme, metricLocale, requestActivityDetails, runActionsBeforeActivity, clauses, whereRow, summary, selectPresentation, matchesSavedQuery, savedQueryControls, shareUrl, }: QueryBuilderProps<Row>): ReactNode;
319
322
  /** Reuse the same typed predicates for a host's source or result filter stage. */
320
323
  declare function QueryFilterRow<Row>({ api, fields, label, }: {
321
324
  api: QueryFilterApi<Row>;
package/dist/index.js CHANGED
@@ -14494,6 +14494,7 @@ function QueryBuilder({
14494
14494
  metricTheme,
14495
14495
  metricLocale,
14496
14496
  requestActivityDetails,
14497
+ runActionsBeforeActivity,
14497
14498
  clauses,
14498
14499
  whereRow,
14499
14500
  summary,
@@ -15029,6 +15030,7 @@ function QueryBuilder({
15029
15030
  autoRefreshStatus ? /* @__PURE__ */ jsx40("span", { className: "qt-qb-auto-status", children: `Every ${formatDuration2(autoRefreshStatus.frequencyMs)}; clear after ${formatDuration2(
15030
15031
  autoRefreshStatus.turnOffAfterMs
15031
15032
  )} (${autoRefreshStatus.pollCount} polls run)` }) : null,
15033
+ runActionsBeforeActivity,
15032
15034
  /* @__PURE__ */ jsx40(
15033
15035
  "button",
15034
15036
  {