@dloizides/ui-tables 1.13.0 → 1.15.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/CHANGELOG.md +105 -0
- package/README.md +11 -2
- package/dist/index.d.mts +22 -32
- package/dist/index.d.ts +22 -32
- package/dist/index.js +130 -425
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -377
- package/dist/index.mjs.map +1 -1
- package/package.json +119 -115
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,110 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.15.0
|
|
4
|
+
|
|
5
|
+
**A re-fetch no longer blanks the grid — the server-paged paging defect.**
|
|
6
|
+
|
|
7
|
+
`DataTable` returned its full-bleed loading state whenever `loading` was true, unconditionally.
|
|
8
|
+
On a server-paged grid that is not a cosmetic flicker, it is the paging bug: clicking **Next**
|
|
9
|
+
replaced the table with "Loading…", so the grid visibly EMPTIED and only refilled once the next
|
|
10
|
+
page arrived. To anyone watching — and to any assertion that samples the rows after the click —
|
|
11
|
+
the grid appeared to page to nothing. The same applied to re-filtering and to any `reload()`.
|
|
12
|
+
|
|
13
|
+
Evidence this was real and not theoretical: against the live AML v2 cases console, the API
|
|
14
|
+
returned a correct, non-overlapping page at `skip=50`, yet the UI rendered **zero** rows after
|
|
15
|
+
Next. The rows were being discarded by this component, not by the query.
|
|
16
|
+
|
|
17
|
+
### The rule now
|
|
18
|
+
|
|
19
|
+
The state view is reserved for when there is genuinely nothing to show:
|
|
20
|
+
|
|
21
|
+
| `loading` | `rows.length` | Renders |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| true | 0 | loading state (first load) |
|
|
24
|
+
| false | 0 | empty state |
|
|
25
|
+
| true | > 0 | **the existing rows** (stale for a moment), `aria-busy="true"` |
|
|
26
|
+
| false | > 0 | the rows |
|
|
27
|
+
|
|
28
|
+
Rows that already exist stay on screen and swap when the new page resolves. Because the content
|
|
29
|
+
no longer vanishes, the in-flight fetch is announced explicitly via `aria-busy` on the table
|
|
30
|
+
container rather than being implied by the table's destruction.
|
|
31
|
+
|
|
32
|
+
**Behaviour is unchanged for every first load and every empty result**, which is what keeps this a
|
|
33
|
+
MINOR bump. The only consumers that see a difference are those that were already passing `loading`
|
|
34
|
+
alongside non-empty `rows` — i.e. exactly the ones that were silently blanking.
|
|
35
|
+
|
|
36
|
+
All 266 pre-existing tests pass unmodified; 3 added for the retained-rows / busy / swap contract.
|
|
37
|
+
|
|
38
|
+
## 1.14.0
|
|
39
|
+
|
|
40
|
+
**Campaign F2 — the private filter fields are now public, in `@dloizides/ui-forms`.**
|
|
41
|
+
|
|
42
|
+
This package contained a complete, themed, a11y-wired set of form controls inside its `Filters`
|
|
43
|
+
bar and exported NONE of them. Six portals could see them working and none could import them, so
|
|
44
|
+
the fleet reimplemented them: **6 select implementations, 5 date fields, 2 typeaheads**. Same
|
|
45
|
+
shape as `MultiTenancy.EntityFrameworkCore` shipping no EF Core. They now live in
|
|
46
|
+
`@dloizides/ui-forms` 1.8.0 as `SelectControl` / `TypeaheadControl` / `DateRangeControl` /
|
|
47
|
+
`AnchoredMenu` / `controlStyles`, and this package consumes them.
|
|
48
|
+
|
|
49
|
+
**No behaviour changed. All 258 pre-existing tests pass UNMODIFIED** — including
|
|
50
|
+
`Filters.test.tsx` (which drives every field kind through the bar), `selectAccessibleName.test.tsx`
|
|
51
|
+
(the i18n path) and `suggest.test.ts` (now running against the moved implementation). That is the
|
|
52
|
+
proof the move preserved behaviour rather than merely relocating it.
|
|
53
|
+
|
|
54
|
+
### What moved, and what deliberately did not
|
|
55
|
+
|
|
56
|
+
The controls moved; the **schema** stayed. Each field was bound to this bar's `FilterField` types
|
|
57
|
+
(`field: SelectFilterField`, `barTestID`, `fieldTestID`), so moving them verbatim would have
|
|
58
|
+
dragged `FilterField`, `FilterFieldKind`, `FilterValues` and `FIELD_MIN_WIDTH` into `ui-forms` —
|
|
59
|
+
i.e. `ui-forms` would have come to own "what a filter bar's field schema is". Wrong direction.
|
|
60
|
+
The field files are now thin ADAPTERS mapping schema → plain props.
|
|
61
|
+
|
|
62
|
+
`TextField` and `BooleanField` stayed. `ui-forms` already ships two text inputs (`ThemedTextInput`,
|
|
63
|
+
`FormField`) and a switch row (`FormSwitch`); promoting a third of each would ADD duplicates to the
|
|
64
|
+
package this campaign is de-duplicating. Converging onto the existing ones is right but VISIBLE
|
|
65
|
+
(focus ring, hover border, `surfaceElevated` background, different switch-row metrics), so it
|
|
66
|
+
belongs in the visual-QA-gated wave. Both now use the shared `controlStyles` boxes, so no metric
|
|
67
|
+
is forked in the meantime.
|
|
68
|
+
|
|
69
|
+
### `FieldShell` is deleted
|
|
70
|
+
|
|
71
|
+
The private label-wrapper fork existed only because `Field` hard-coded the 13/600 `field` label
|
|
72
|
+
voice. `Field` 1.7.0 named both contract voices, so the bar now asks for `labelVariant="control"`
|
|
73
|
+
— the 11/700/uppercase metrics `FieldShell` carried, verbatim. This ends the label-metric split
|
|
74
|
+
between `Field` and `FieldShell` that caused several defects this campaign.
|
|
75
|
+
|
|
76
|
+
The swap replaces the label implementation under six live portals, so it is guarded by a dedicated
|
|
77
|
+
test (`fieldShellRetirement.test.tsx`) asserting the voice, the absence of `Field`'s 16px form
|
|
78
|
+
rhythm, the per-kind reflow rules and the caller-override precedence. Removing `labelVariant`
|
|
79
|
+
fails two of its five assertions — verified, not assumed.
|
|
80
|
+
|
|
81
|
+
### i18n manifests are untouched
|
|
82
|
+
|
|
83
|
+
`FILTERS_I18N` and `TABLE_I18N` are unchanged, and every portal guard that binds to them keeps
|
|
84
|
+
working. `ui-forms` never calls `t`, so the one field that resolved an i18n key —
|
|
85
|
+
`SelectField`'s `FILTERS_I18N.selectTriggerLabel` accessible name — composes that string HERE, in
|
|
86
|
+
the adapter, and passes the finished value down as `accessibilityLabel`. The i18n stayed with the
|
|
87
|
+
package that owns the keys.
|
|
88
|
+
|
|
89
|
+
### Notes
|
|
90
|
+
|
|
91
|
+
- New peer dependency: `@dloizides/ui-forms >= 1.8.0`, plus `@dloizides/ui-buttons >= 1.4.0`
|
|
92
|
+
inherited through it (`ui-forms` bundles `FormActions`). All five portals consuming `ui-tables`
|
|
93
|
+
already declare `ui-buttons ^1.4.0`, so this is a declaration of existing reality, not a new
|
|
94
|
+
requirement.
|
|
95
|
+
- `FilterOption` and `DateRangeValue` are now ALIASES of `ui-forms`' `ControlOption` /
|
|
96
|
+
`DateRangeValue`. Public names unchanged; one definition instead of two structurally-identical
|
|
97
|
+
twins free to drift.
|
|
98
|
+
- `DEFAULT_TYPEAHEAD_MIN_CHARS` / `DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS` and `suggestOptions` /
|
|
99
|
+
`isUnmatched` are re-exported from `ui-forms`. Public API unchanged.
|
|
100
|
+
- Inherits the `AnchoredMenu` WCAG fix from `ui-forms` 1.8.0: the selected option now carries
|
|
101
|
+
`aria-selected`. `accessibilityState` is native-only and react-native-web ignores it, so on web
|
|
102
|
+
the current option had been conveyed by colour and font-weight alone (WCAG 1.4.1).
|
|
103
|
+
- `AnchoredMenu` remains one of three near-identical anchored-menu implementations, with
|
|
104
|
+
`ui-layout`'s `InlineMenu` and this package's `SizeDropdown`. Collapsing them was out of scope.
|
|
105
|
+
The move makes it EASIER: two of the three now sit in packages that may depend on `ui-forms`, so
|
|
106
|
+
a future collapse has an obvious home rather than needing a new shared package first.
|
|
107
|
+
|
|
3
108
|
## 1.13.0
|
|
4
109
|
|
|
5
110
|
De-fork wave W1.1: pagination logic promoted from the byte-identical `PaginatedList`
|
package/README.md
CHANGED
|
@@ -39,6 +39,13 @@ behaviour everywhere — only the theme changes. Field kinds: `select`, `text`,
|
|
|
39
39
|
Every user-facing string is **pre-localized** and passed in (labels, option labels, placeholders,
|
|
40
40
|
errors) — the package never calls FM/i18n for content, touches a router, or reads a store.
|
|
41
41
|
|
|
42
|
+
> **Since 1.14.0 the controls themselves live in [`@dloizides/ui-forms`](https://www.npmjs.com/package/@dloizides/ui-forms)**
|
|
43
|
+
> as `SelectControl`, `TypeaheadControl` and `DateRangeControl`. They used to be private to this
|
|
44
|
+
> bar, which is why the fleet grew 6 selects, 5 date fields and 2 typeaheads — apps could see them
|
|
45
|
+
> working and could not import them. **If you need a select or a date range OUTSIDE a filter bar,
|
|
46
|
+
> import it from `ui-forms` — do not rebuild it, and do not reach into this package.** `Filters`
|
|
47
|
+
> is unchanged and still the right thing for a filter bar; it now composes the shared controls.
|
|
48
|
+
|
|
42
49
|
```tsx
|
|
43
50
|
import { Filters, useFilterDraft, type FilterField, type FilterValues } from '@dloizides/ui-tables';
|
|
44
51
|
|
|
@@ -262,10 +269,12 @@ required.forEach((key) => expect(en).toHaveProperty(key));
|
|
|
262
269
|
## Install
|
|
263
270
|
|
|
264
271
|
```bash
|
|
265
|
-
npm install @dloizides/ui-tables @dloizides/ui-feedback
|
|
272
|
+
npm install @dloizides/ui-tables @dloizides/ui-feedback @dloizides/ui-forms @dloizides/ui-buttons
|
|
266
273
|
```
|
|
267
274
|
|
|
268
|
-
Peer dependencies: `@dloizides/ui-feedback >= 1.1.0`,
|
|
275
|
+
Peer dependencies: `@dloizides/ui-feedback >= 1.1.0`, `@dloizides/ui-forms >= 1.8.0`,
|
|
276
|
+
`@dloizides/ui-buttons >= 1.4.0` (inherited through `ui-forms`), `react >= 18`,
|
|
277
|
+
`react-native >= 0.74`.
|
|
269
278
|
|
|
270
279
|
## Usage
|
|
271
280
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import { DateRangeValue, ControlOption } from '@dloizides/ui-forms';
|
|
4
|
+
export { DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateRangeValue, isUnmatched, suggestOptions } from '@dloizides/ui-forms';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* StatCard — a single labelled metric tile (label + formatted numeric value).
|
|
@@ -486,16 +488,16 @@ declare const TABLE_I18N: {
|
|
|
486
488
|
|
|
487
489
|
/** The kinds of field the declarative bar can render. */
|
|
488
490
|
type FilterFieldKind = 'select' | 'text' | 'number' | 'dateRange' | 'typeahead' | 'boolean';
|
|
489
|
-
/**
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
491
|
+
/**
|
|
492
|
+
* A single choice for a `select` / `typeahead` field. Label is pre-localized.
|
|
493
|
+
*
|
|
494
|
+
* F2: an ALIAS of `@dloizides/ui-forms`' `ControlOption`, not a second declaration. The two were
|
|
495
|
+
* structurally identical, which is precisely the shape that drifts silently — a field added to
|
|
496
|
+
* one would type-check against the other until the day it didn't. The public name is unchanged,
|
|
497
|
+
* so this is not a breaking change for any consumer.
|
|
498
|
+
*/
|
|
499
|
+
type FilterOption = ControlOption;
|
|
500
|
+
|
|
499
501
|
/** The runtime value a field holds, by kind. */
|
|
500
502
|
type FilterValue = string | boolean | DateRangeValue;
|
|
501
503
|
/** The applied/draft value map, keyed by each field's `key`. */
|
|
@@ -566,7 +568,13 @@ type FilterField = SelectFilterField | TextFilterField | NumberFilterField | Dat
|
|
|
566
568
|
* FilterFieldView — dispatches one {@link FilterField} to its renderer, wired to the value map.
|
|
567
569
|
* Reads the field's typed value out of {@link FilterValues} (coercing a missing/mismatched
|
|
568
570
|
* entry to that kind's empty value) and writes edits back via `setField`. `boolean` renders its
|
|
569
|
-
* own inline switch-row; every other kind is wrapped in
|
|
571
|
+
* own inline switch-row; every other kind is wrapped in `@dloizides/ui-forms`' `Field`.
|
|
572
|
+
*
|
|
573
|
+
* F2: the label wrapper used to be a PRIVATE `FieldShell` fork, which existed only because
|
|
574
|
+
* `Field` hard-coded the 13/600 `field` label voice and offered no way out. `Field` now names
|
|
575
|
+
* both contract voices, so the fork is deleted and the bar asks for `labelVariant="control"`
|
|
576
|
+
* (11/700/uppercase) — the exact metrics `FieldShell` carried. One label implementation, and the
|
|
577
|
+
* label-metric split that caused several defects this campaign is gone.
|
|
570
578
|
*/
|
|
571
579
|
|
|
572
580
|
/** Resolved, pre-localized strings the bar passes down to every field. */
|
|
@@ -580,7 +588,7 @@ interface FieldStrings {
|
|
|
580
588
|
/**
|
|
581
589
|
* Args for a custom select renderer — the injection point apps use to swap the built-in
|
|
582
590
|
* in-tree dropdown for `@dloizides/ui-layout`'s responsive ModalDropdown (modal on mobile /
|
|
583
|
-
* native, inline menu on desktop). The label wrapper
|
|
591
|
+
* native, inline menu on desktop). The label wrapper is still supplied by the bar.
|
|
584
592
|
*/
|
|
585
593
|
interface RenderSelectArgs {
|
|
586
594
|
field: SelectFilterField;
|
|
@@ -673,21 +681,6 @@ interface FilterDraft<V extends FilterValues> {
|
|
|
673
681
|
}
|
|
674
682
|
declare function useFilterDraft<V extends FilterValues>({ initial, onApply, onReset }: UseFilterDraftOptions<V>): FilterDraft<V>;
|
|
675
683
|
|
|
676
|
-
/**
|
|
677
|
-
* suggestOptions — the ranked substring matcher behind the `typeahead` field, generalized
|
|
678
|
-
* from aml-v2's `suggestCountries`. Ranks: value exact (0) > value prefix (1) > label prefix
|
|
679
|
-
* (2) > label contains (3); ties broken by `label.localeCompare`. Empty/short queries return
|
|
680
|
-
* `[]` (nothing surfaces until `minChars` is typed, mirroring a native `<datalist>`).
|
|
681
|
-
*/
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* Rank + cap the options matching `query`. Returns `[]` until `query` (trimmed) is at least
|
|
685
|
-
* `minChars` long, then the best `limit` matches, ranked as documented above.
|
|
686
|
-
*/
|
|
687
|
-
declare function suggestOptions(options: readonly FilterOption[], query: string, minChars: number, limit: number): readonly FilterOption[];
|
|
688
|
-
/** True when `text` is non-empty yet matches no option's value or label exactly (case-insensitive). */
|
|
689
|
-
declare function isUnmatched(options: readonly FilterOption[], text: string): boolean;
|
|
690
|
-
|
|
691
684
|
/**
|
|
692
685
|
* Constants for the declarative Filters bar — every test id, i18n key and layout number in
|
|
693
686
|
* one place so the components carry no magic numbers and no ad-hoc strings.
|
|
@@ -697,10 +690,7 @@ declare function isUnmatched(options: readonly FilterOption[], text: string): bo
|
|
|
697
690
|
declare const FILTERS_TEST_ID = "ui-filters-declarative";
|
|
698
691
|
/** Default minimum widths (px) per field kind before it wraps. */
|
|
699
692
|
declare const FIELD_MIN_WIDTH: Record<FilterFieldKind, number>;
|
|
700
|
-
|
|
701
|
-
declare const DEFAULT_TYPEAHEAD_MIN_CHARS = 1;
|
|
702
|
-
/** Default cap on typeahead suggestions rendered. */
|
|
703
|
-
declare const DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS = 8;
|
|
693
|
+
|
|
704
694
|
/** Derived testIDs for the declarative bar. */
|
|
705
695
|
declare const fieldTestID: (barTestID: string, key: string) => string;
|
|
706
696
|
declare const applyTestID: (barTestID: string) => string;
|
|
@@ -758,4 +748,4 @@ interface PagedRows<T> {
|
|
|
758
748
|
*/
|
|
759
749
|
declare function usePagedRows<T>(rows: readonly T[], options?: UsePagedRowsOptions): PagedRows<T>;
|
|
760
750
|
|
|
761
|
-
export { type BooleanFilterField, CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS,
|
|
751
|
+
export { type BooleanFilterField, CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, type DataTableColumn, type DataTableProps, type DataTableStyleOverrides, type DateRangeFilterField, FIELD_MIN_WIDTH, FILTERS_I18N, FILTERS_TEST_ID, type FieldStrings, FilterBar, type FilterBarProps, type FilterBarStyleOverrides, type FilterDraft, type FilterField, type FilterFieldKind, type FilterOption, type FilterValue, type FilterValues, Filters, type FiltersProps, type NumberFilterField, type PagedRows, Pager, type PagerProps, type PagerStyleOverrides, type RenderSelectArgs, type SelectFilterField, StatCard, type StatCardProps, TABLE_I18N, TABLE_TEST_IDS, type TextFilterField, type TypeaheadFilterField, type UseFilterDraftOptions, type UsePagedRowsOptions, applyTestID, clearTestID, fieldTestID, rowDetailTestID, rowSelectTestID, rowTestID, selectAllTestID, useFilterDraft, usePagedRows };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import { DateRangeValue, ControlOption } from '@dloizides/ui-forms';
|
|
4
|
+
export { DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateRangeValue, isUnmatched, suggestOptions } from '@dloizides/ui-forms';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* StatCard — a single labelled metric tile (label + formatted numeric value).
|
|
@@ -486,16 +488,16 @@ declare const TABLE_I18N: {
|
|
|
486
488
|
|
|
487
489
|
/** The kinds of field the declarative bar can render. */
|
|
488
490
|
type FilterFieldKind = 'select' | 'text' | 'number' | 'dateRange' | 'typeahead' | 'boolean';
|
|
489
|
-
/**
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
491
|
+
/**
|
|
492
|
+
* A single choice for a `select` / `typeahead` field. Label is pre-localized.
|
|
493
|
+
*
|
|
494
|
+
* F2: an ALIAS of `@dloizides/ui-forms`' `ControlOption`, not a second declaration. The two were
|
|
495
|
+
* structurally identical, which is precisely the shape that drifts silently — a field added to
|
|
496
|
+
* one would type-check against the other until the day it didn't. The public name is unchanged,
|
|
497
|
+
* so this is not a breaking change for any consumer.
|
|
498
|
+
*/
|
|
499
|
+
type FilterOption = ControlOption;
|
|
500
|
+
|
|
499
501
|
/** The runtime value a field holds, by kind. */
|
|
500
502
|
type FilterValue = string | boolean | DateRangeValue;
|
|
501
503
|
/** The applied/draft value map, keyed by each field's `key`. */
|
|
@@ -566,7 +568,13 @@ type FilterField = SelectFilterField | TextFilterField | NumberFilterField | Dat
|
|
|
566
568
|
* FilterFieldView — dispatches one {@link FilterField} to its renderer, wired to the value map.
|
|
567
569
|
* Reads the field's typed value out of {@link FilterValues} (coercing a missing/mismatched
|
|
568
570
|
* entry to that kind's empty value) and writes edits back via `setField`. `boolean` renders its
|
|
569
|
-
* own inline switch-row; every other kind is wrapped in
|
|
571
|
+
* own inline switch-row; every other kind is wrapped in `@dloizides/ui-forms`' `Field`.
|
|
572
|
+
*
|
|
573
|
+
* F2: the label wrapper used to be a PRIVATE `FieldShell` fork, which existed only because
|
|
574
|
+
* `Field` hard-coded the 13/600 `field` label voice and offered no way out. `Field` now names
|
|
575
|
+
* both contract voices, so the fork is deleted and the bar asks for `labelVariant="control"`
|
|
576
|
+
* (11/700/uppercase) — the exact metrics `FieldShell` carried. One label implementation, and the
|
|
577
|
+
* label-metric split that caused several defects this campaign is gone.
|
|
570
578
|
*/
|
|
571
579
|
|
|
572
580
|
/** Resolved, pre-localized strings the bar passes down to every field. */
|
|
@@ -580,7 +588,7 @@ interface FieldStrings {
|
|
|
580
588
|
/**
|
|
581
589
|
* Args for a custom select renderer — the injection point apps use to swap the built-in
|
|
582
590
|
* in-tree dropdown for `@dloizides/ui-layout`'s responsive ModalDropdown (modal on mobile /
|
|
583
|
-
* native, inline menu on desktop). The label wrapper
|
|
591
|
+
* native, inline menu on desktop). The label wrapper is still supplied by the bar.
|
|
584
592
|
*/
|
|
585
593
|
interface RenderSelectArgs {
|
|
586
594
|
field: SelectFilterField;
|
|
@@ -673,21 +681,6 @@ interface FilterDraft<V extends FilterValues> {
|
|
|
673
681
|
}
|
|
674
682
|
declare function useFilterDraft<V extends FilterValues>({ initial, onApply, onReset }: UseFilterDraftOptions<V>): FilterDraft<V>;
|
|
675
683
|
|
|
676
|
-
/**
|
|
677
|
-
* suggestOptions — the ranked substring matcher behind the `typeahead` field, generalized
|
|
678
|
-
* from aml-v2's `suggestCountries`. Ranks: value exact (0) > value prefix (1) > label prefix
|
|
679
|
-
* (2) > label contains (3); ties broken by `label.localeCompare`. Empty/short queries return
|
|
680
|
-
* `[]` (nothing surfaces until `minChars` is typed, mirroring a native `<datalist>`).
|
|
681
|
-
*/
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* Rank + cap the options matching `query`. Returns `[]` until `query` (trimmed) is at least
|
|
685
|
-
* `minChars` long, then the best `limit` matches, ranked as documented above.
|
|
686
|
-
*/
|
|
687
|
-
declare function suggestOptions(options: readonly FilterOption[], query: string, minChars: number, limit: number): readonly FilterOption[];
|
|
688
|
-
/** True when `text` is non-empty yet matches no option's value or label exactly (case-insensitive). */
|
|
689
|
-
declare function isUnmatched(options: readonly FilterOption[], text: string): boolean;
|
|
690
|
-
|
|
691
684
|
/**
|
|
692
685
|
* Constants for the declarative Filters bar — every test id, i18n key and layout number in
|
|
693
686
|
* one place so the components carry no magic numbers and no ad-hoc strings.
|
|
@@ -697,10 +690,7 @@ declare function isUnmatched(options: readonly FilterOption[], text: string): bo
|
|
|
697
690
|
declare const FILTERS_TEST_ID = "ui-filters-declarative";
|
|
698
691
|
/** Default minimum widths (px) per field kind before it wraps. */
|
|
699
692
|
declare const FIELD_MIN_WIDTH: Record<FilterFieldKind, number>;
|
|
700
|
-
|
|
701
|
-
declare const DEFAULT_TYPEAHEAD_MIN_CHARS = 1;
|
|
702
|
-
/** Default cap on typeahead suggestions rendered. */
|
|
703
|
-
declare const DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS = 8;
|
|
693
|
+
|
|
704
694
|
/** Derived testIDs for the declarative bar. */
|
|
705
695
|
declare const fieldTestID: (barTestID: string, key: string) => string;
|
|
706
696
|
declare const applyTestID: (barTestID: string) => string;
|
|
@@ -758,4 +748,4 @@ interface PagedRows<T> {
|
|
|
758
748
|
*/
|
|
759
749
|
declare function usePagedRows<T>(rows: readonly T[], options?: UsePagedRowsOptions): PagedRows<T>;
|
|
760
750
|
|
|
761
|
-
export { type BooleanFilterField, CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS,
|
|
751
|
+
export { type BooleanFilterField, CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, type DataTableColumn, type DataTableProps, type DataTableStyleOverrides, type DateRangeFilterField, FIELD_MIN_WIDTH, FILTERS_I18N, FILTERS_TEST_ID, type FieldStrings, FilterBar, type FilterBarProps, type FilterBarStyleOverrides, type FilterDraft, type FilterField, type FilterFieldKind, type FilterOption, type FilterValue, type FilterValues, Filters, type FiltersProps, type NumberFilterField, type PagedRows, Pager, type PagerProps, type PagerStyleOverrides, type RenderSelectArgs, type SelectFilterField, StatCard, type StatCardProps, TABLE_I18N, TABLE_TEST_IDS, type TextFilterField, type TypeaheadFilterField, type UseFilterDraftOptions, type UsePagedRowsOptions, applyTestID, clearTestID, fieldTestID, rowDetailTestID, rowSelectTestID, rowTestID, selectAllTestID, useFilterDraft, usePagedRows };
|