@motifx-community/ui 0.1.0-beta.11 → 0.1.0-beta.12
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 +49 -0
- package/dist/components/combobox/ComboBox.d.ts +5 -0
- package/dist/components/combobox/combo-box-props.d.ts +6 -0
- package/dist/components/datagrid/DataGrid.d.ts +4 -1
- package/dist/components/datagrid/grid-lookup.d.ts +8 -0
- package/dist/components/datagrid/model/FilterModel.d.ts +5 -0
- package/dist/components/datagrid/model/LookupTexts.d.ts +2 -0
- package/dist/components/datagrid/model/LookupValues.d.ts +4 -0
- package/dist/components/datagrid/view/ActionWidths.d.ts +13 -3
- package/dist/components/datagrid/view/GridRow.d.ts +1 -1
- package/dist/components/dropdown/DropDown.d.ts +5 -0
- package/dist/components/dropdown/drop-down-props.d.ts +6 -0
- package/dist/components/filterbuilder/filter-builder-lookup.d.ts +3 -0
- package/dist/components/listbox/ListBox.d.ts +5 -0
- package/dist/components/listbox/list-box-props.d.ts +6 -0
- package/dist/components/listbox/select-all-state.d.ts +1 -1
- package/dist/components/ribbonmenu/RibbonKeyHints.d.ts +1 -0
- package/dist/components/tagbox/TagBox.d.ts +5 -0
- package/dist/components/tagbox/tag-box-props.d.ts +6 -0
- package/dist/components/toolbar/Toolbar.d.ts +8 -0
- package/dist/core/measure/after-frame.d.ts +7 -0
- package/dist/core/measure/drawn.d.ts +7 -0
- package/dist/core/measure/index.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +553 -136
- package/dist/index.js.map +1 -1
- package/dist/parts/data/DataItems.d.ts +24 -0
- package/dist/parts/data/KeyedItems.d.ts +31 -5
- package/dist/parts/data/normalize-key.d.ts +7 -0
- package/dist/styles.css +32 -0
- package/docs/accordion.md +1 -1
- package/docs/actionsheet.md +1 -1
- package/docs/appbar.md +1 -1
- package/docs/appmenu-api.md +1 -1
- package/docs/appmenu-programmatic.md +1 -1
- package/docs/appmenu-search.md +1 -1
- package/docs/appmenu.md +1 -1
- package/docs/avatar.md +1 -1
- package/docs/badge.md +1 -1
- package/docs/bar-gauge-angles.md +1 -1
- package/docs/bar-gauge-data.md +1 -1
- package/docs/bar-gauge-labels.md +1 -1
- package/docs/bar-gauge.md +1 -1
- package/docs/barcode.md +1 -1
- package/docs/bottomnavigation.md +1 -1
- package/docs/bottomsheet.md +1 -1
- package/docs/breadcrumb.md +1 -1
- package/docs/button.md +1 -1
- package/docs/buttongroup.md +1 -1
- package/docs/buttons.md +1 -1
- package/docs/calendar.md +1 -1
- package/docs/card.md +1 -1
- package/docs/chart-bars.md +1 -1
- package/docs/chart-candles.md +1 -1
- package/docs/chart-funnel.md +1 -1
- package/docs/chart-heatmap.md +1 -1
- package/docs/chart-lines.md +1 -1
- package/docs/chart-live.md +1 -1
- package/docs/chart-pie.md +1 -1
- package/docs/chart-radar.md +1 -1
- package/docs/chart-ranges.md +1 -1
- package/docs/chart-references.md +1 -1
- package/docs/chart-scatter.md +1 -1
- package/docs/chart-waterfall.md +1 -1
- package/docs/chart-zoom.md +1 -1
- package/docs/chart.md +1 -1
- package/docs/checkbox.md +1 -1
- package/docs/chip.md +1 -1
- package/docs/choice.md +1 -1
- package/docs/colorbox.md +1 -1
- package/docs/combobox.md +1 -1
- package/docs/commands.md +1 -1
- package/docs/control.md +1 -1
- package/docs/data.md +1 -1
- package/docs/datagrid-api.md +1 -1
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +1 -1
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +1 -1
- package/docs/datagrid-filtering.md +1 -1
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +1 -1
- package/docs/datagrid-layout.md +1 -1
- package/docs/datagrid-lookups.md +1 -1
- package/docs/datagrid-master-detail.md +1 -1
- package/docs/datagrid-scrolling.md +1 -1
- package/docs/datagrid-selection.md +1 -1
- package/docs/datagrid.md +1 -1
- package/docs/datebox.md +1 -1
- package/docs/daterangebox.md +1 -1
- package/docs/display.md +1 -1
- package/docs/draggable.md +1 -1
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +1 -1
- package/docs/editors.md +1 -1
- package/docs/feedback.md +1 -1
- package/docs/fileuploader.md +1 -1
- package/docs/filterbuilder.md +1 -1
- package/docs/formlayout.md +1 -1
- package/docs/foundations.md +1 -1
- package/docs/gallery.md +1 -1
- package/docs/gauge-base.md +1 -1
- package/docs/gauge-circular.md +1 -1
- package/docs/gauge-dashboards.md +1 -1
- package/docs/gauge-linear.md +1 -1
- package/docs/gauge-markers.md +1 -1
- package/docs/gauge-marks.md +1 -1
- package/docs/gauge-ranges.md +1 -1
- package/docs/gauge-scales.md +1 -1
- package/docs/gauge.md +1 -1
- package/docs/home.md +1 -1
- package/docs/keyboard.md +1 -1
- package/docs/language.md +1 -1
- package/docs/layout.md +1 -1
- package/docs/listbox.md +1 -1
- package/docs/loadpanel.md +1 -1
- package/docs/lookup.md +1 -1
- package/docs/menus-api.md +1 -1
- package/docs/menus-context.md +1 -1
- package/docs/menus-customization.md +1 -1
- package/docs/menus-merging.md +1 -1
- package/docs/menus-programmatic.md +1 -1
- package/docs/menus.md +1 -1
- package/docs/multiview.md +1 -1
- package/docs/navigation.md +1 -1
- package/docs/numberbox.md +1 -1
- package/docs/otpinput.md +1 -1
- package/docs/pagination.md +1 -1
- package/docs/popover.md +1 -1
- package/docs/progress.md +1 -1
- package/docs/qrcode.md +1 -1
- package/docs/radiogroup.md +1 -1
- package/docs/rating.md +1 -1
- package/docs/resizable.md +1 -1
- package/docs/ribbonmenu-api.md +1 -1
- package/docs/ribbonmenu-commands.md +1 -1
- package/docs/ribbonmenu-customization.md +1 -1
- package/docs/ribbonmenu-display.md +1 -1
- package/docs/ribbonmenu-layouts.md +1 -1
- package/docs/ribbonmenu-programmatic.md +1 -1
- package/docs/ribbonmenu.md +1 -1
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +1 -1
- package/docs/scheduler-form.md +1 -1
- package/docs/scheduler-icalendar.md +1 -1
- package/docs/scheduler-mobile.md +1 -1
- package/docs/scheduler-recurrence.md +1 -1
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +1 -1
- package/docs/scrollview.md +1 -1
- package/docs/shortcuteditor.md +1 -1
- package/docs/showcase-home.md +1 -1
- package/docs/showcase.md +1 -1
- package/docs/signature.md +1 -1
- package/docs/skeleton.md +1 -1
- package/docs/slider.md +1 -1
- package/docs/sortable.md +1 -1
- package/docs/sparkline.md +1 -1
- package/docs/speeddial.md +1 -1
- package/docs/splitter.md +1 -1
- package/docs/stepper.md +1 -1
- package/docs/switch.md +1 -1
- package/docs/tabdocs-dock.md +1 -1
- package/docs/tabdocs-drag.md +1 -1
- package/docs/tabdocs-menus.md +1 -1
- package/docs/tabdocs-mobile.md +1 -1
- package/docs/tabdocs-tabs.md +1 -1
- package/docs/tabdocs-windows.md +1 -1
- package/docs/tabdocs-workspace.md +1 -1
- package/docs/tabdocs.md +1 -1
- package/docs/tabs.md +1 -1
- package/docs/tagbox.md +1 -1
- package/docs/textarea.md +1 -1
- package/docs/textbox.md +1 -1
- package/docs/tileview.md +1 -1
- package/docs/timeline.md +1 -1
- package/docs/toast.md +1 -1
- package/docs/tokens.md +1 -1
- package/docs/toolbar.md +1 -1
- package/docs/tooltip.md +1 -1
- package/docs/treeview.md +1 -1
- package/docs/validationsummary.md +1 -1
- package/docs/window.md +1 -1
- package/docs/wizard.md +1 -1
- package/llms-full.txt +157 -157
- package/llms.txt +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,55 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.0-beta.12] - 2026-11-14
|
|
10
|
+
|
|
11
|
+
Needs `@motifx/core` 1.2.0-rc.30.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `normalizeKey` on a `DataGrid` lookup column, `DropDown`, `TagBox`, `ComboBox`, `ListBox` and a `FilterBuilder`
|
|
16
|
+
lookup (the `NormalizeKey` type): keys equal once normalized are one key, such as
|
|
17
|
+
`(k) => (typeof k === 'string' ? k.trimEnd() : k)` for codes a database pads with spaces. It spares the requests a
|
|
18
|
+
source that compares keys its own way needs (below), and it is the rule for in-memory items, where no source decides.
|
|
19
|
+
One function per source keeps one shared cache.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Lookup keys a data source compares its own way are matched to their items (#2): a database that disregards trailing
|
|
24
|
+
spaces (`char(n)` codes such as `'A '` against `'A'`), case (an ID written in capitals) or accents, or reads `'007'`
|
|
25
|
+
as `7`. When a batch leaves keys unmatched while the source returned items no key matched exactly, or items that
|
|
26
|
+
differ from a key only in such a way, those keys are asked for one by one, and what the source returns for a key is
|
|
27
|
+
that key's item; a key the source does not have stays missing with no request more. A lookup cell shows the item's
|
|
28
|
+
text instead of the key, its editor shows it and its list marks it, the filter row and the header filter list it
|
|
29
|
+
(only "(All)" was listed when a server grouped by padded keys), and keys matched to one item are one entry there,
|
|
30
|
+
which filters by all of them. `DropDown`, `TagBox`, `ComboBox` and `ListBox` over a data source mark the item of such
|
|
31
|
+
a value, and picking it again in a `TagBox` or a multiple `ListBox` takes the value out instead of adding the item a
|
|
32
|
+
second time. The row's value is never changed: an editor writes another value only when another item is picked.
|
|
33
|
+
- `TagBox` and `ListBox` with a `dataSource` ask for a value on no loaded page by their `valueField`, as `DropDown` and
|
|
34
|
+
`ComboBox` do, instead of by the adapter's key.
|
|
35
|
+
|
|
36
|
+
- `RibbonMenu` key hints: the letter of the button before the tabs (Alt, then F) ends the hints, as a command does,
|
|
37
|
+
instead of going on to the commands of the selected tab over the app menu it opened; Escape then reaches that menu
|
|
38
|
+
and closes it. A quick command's digit ends them too. A command that holds a field and has no text takes its letters
|
|
39
|
+
from the field's label (and its access key), instead of `?1`.
|
|
40
|
+
|
|
41
|
+
- `DataGrid` keeps focus in the grid when the column of the focused header leaves (a header dropped on the group
|
|
42
|
+
panel, a column hidden): focus goes to the cell that is active then. Before, it fell to the page and the focus guard
|
|
43
|
+
moved it to the next button after the grid, with two forced style recalcs on the way. Moving focus between cells no
|
|
44
|
+
longer changes the tab index of the cell that still has focus, which made the browser work out the page's style.
|
|
45
|
+
|
|
46
|
+
- `Toolbar` sized by its items takes back the items it put in the "more" menu when what holds it grows (an `AppBar`'s
|
|
47
|
+
actions in a window made narrow, then wide again). The bar keeps asking for the room of all its items, also of the
|
|
48
|
+
ones in the menu, through a hidden part that takes no room on the bar; so it grows with what holds it, and its size
|
|
49
|
+
notice puts the items back. The `AppBar`'s actions keep to the end, with that room before them.
|
|
50
|
+
|
|
51
|
+
- `DataGrid` and `Toolbar` no longer make the browser lay the page out from script when they first show ("Forced
|
|
52
|
+
reflow" in the console, about 30 to 60 ms on a page with grids). Their first measure waits until the page is drawn,
|
|
53
|
+
and every measure asked for that frame reads in one go before any of them writes. A grid's row action buttons stay out
|
|
54
|
+
of sight in their place until their widths are known, as before.
|
|
55
|
+
- A scroll event no longer reads the scrolled element at once (it could lay out a page written since the last frame):
|
|
56
|
+
the element is read once the frame is drawn, and at once only when its place is asked before that.
|
|
57
|
+
|
|
9
58
|
## [0.1.0-beta.11] - 2026-11-14
|
|
10
59
|
|
|
11
60
|
### Fixed
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Bind, type ComponentBase, type Event as MotifEvent, type IBaseProp } from '@motifx/core';
|
|
2
2
|
import type { data } from '@motifx-community/data';
|
|
3
3
|
import { DataItems } from '../../parts/data/DataItems';
|
|
4
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
4
5
|
import { Field } from '../../parts/field/Field';
|
|
5
6
|
import type { ItemField } from '../../parts/list/item-field';
|
|
6
7
|
import type { PopupCloseReason } from '../../parts/popup/popup-close-reason';
|
|
@@ -26,6 +27,8 @@ export declare class ComboBox<T = unknown, V = unknown> extends Field<V | null,
|
|
|
26
27
|
set textField(value: Bind<ItemField<T>>);
|
|
27
28
|
get valueField(): ItemField<T> | undefined;
|
|
28
29
|
set valueField(value: Bind<ItemField<T>>);
|
|
30
|
+
get normalizeKey(): NormalizeKey | undefined;
|
|
31
|
+
set normalizeKey(value: Bind<NormalizeKey>);
|
|
29
32
|
get iconField(): ItemField<T> | undefined;
|
|
30
33
|
set iconField(value: Bind<ItemField<T>>);
|
|
31
34
|
get groupField(): ItemField<T> | undefined;
|
|
@@ -79,6 +82,8 @@ export declare class ComboBox<T = unknown, V = unknown> extends Field<V | null,
|
|
|
79
82
|
/** The text shown for a value that has no item. */
|
|
80
83
|
protected textOfValue(value: V | null): string;
|
|
81
84
|
protected itemText(item: T): string;
|
|
85
|
+
/** The test for the item of `value`: the same value, the same once normalized, or the one the data source matched to it. */
|
|
86
|
+
private holderOf;
|
|
82
87
|
protected itemValue(item: T): unknown;
|
|
83
88
|
/** The value of text that matches no item, with `acceptCustomValue`. */
|
|
84
89
|
protected customValue(text: string): V | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Bind, ComponentBase } from '@motifx/core';
|
|
2
2
|
import type { data } from '@motifx-community/data';
|
|
3
3
|
import type { FieldProps } from '../../parts/field/field-props';
|
|
4
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
4
5
|
import type { ItemField } from '../../parts/list/item-field';
|
|
5
6
|
import type { PopupCloseReason } from '../../parts/popup/popup-close-reason';
|
|
6
7
|
/** Props of `ComboBox`, in addition to the field props. Each prop is also a settable, reactive property. */
|
|
@@ -11,6 +12,11 @@ export interface ComboBoxProps<T, V> extends FieldProps<V | null> {
|
|
|
11
12
|
dataSource?: Bind<data.DataSource<T, unknown> | null>;
|
|
12
13
|
textField?: Bind<ItemField<T>>;
|
|
13
14
|
valueField?: Bind<ItemField<T>>;
|
|
15
|
+
/**
|
|
16
|
+
* Values equal once normalized are one value (`NormalizeKey`). Without it, the item of a value a data source compares
|
|
17
|
+
* its own way (`'A '` for `'A'`, a different case) is still found: the source is asked for it and decides.
|
|
18
|
+
*/
|
|
19
|
+
normalizeKey?: Bind<NormalizeKey>;
|
|
14
20
|
iconField?: Bind<ItemField<T>>;
|
|
15
21
|
/** Applies to in-memory items only. */
|
|
16
22
|
groupField?: Bind<ItemField<T>>;
|
|
@@ -994,7 +994,10 @@ export declare class DataGrid<T = any> extends Control<HTMLDivElement, DataGridP
|
|
|
994
994
|
private headerCellOf;
|
|
995
995
|
/** The buttons of a row's actions cell that show, in order, the "more" button last. */
|
|
996
996
|
private actionButtons;
|
|
997
|
-
/**
|
|
997
|
+
/**
|
|
998
|
+
* Exactly one cell is in the tab order: the active one. `leave: false` keeps the one it was in the tab order, for the
|
|
999
|
+
* caller to take it out once focus has left it (`focusActive`).
|
|
1000
|
+
*/
|
|
998
1001
|
private syncTabStop;
|
|
999
1002
|
private setActive;
|
|
1000
1003
|
/** Asks `onFocusedRowChanging` and `onFocusedCellChanging` before the active cell moves; whether it may. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
2
|
import type { data } from '@motifx-community/data';
|
|
3
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
3
4
|
/**
|
|
4
5
|
* The source of a lookup column's text: the cell holds a key (a customer id), and the grid displays the
|
|
5
6
|
* text of its item (the customer's name). The items can be on a different service from the rows, over
|
|
@@ -16,6 +17,13 @@ export interface GridLookup<T = any> {
|
|
|
16
17
|
* array of plain values, the value itself.
|
|
17
18
|
*/
|
|
18
19
|
valueField?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Keys equal once normalized are one key (`NormalizeKey`), such as `(k) => (typeof k === 'string' ? k.trimEnd() : k)`
|
|
22
|
+
* for codes a database pads with spaces. Without it, a key the source compares its own way (`'A '` for `'A'`, a
|
|
23
|
+
* different case) is still matched: the source is asked for it and decides. Give it to spare those requests, and for
|
|
24
|
+
* an in-memory array, where no source decides. Give one function wherever the source is used, so they share a cache.
|
|
25
|
+
*/
|
|
26
|
+
normalizeKey?: NormalizeKey;
|
|
19
27
|
/** The displayed text: a field of the item or a function of it. The default is the value. */
|
|
20
28
|
textField?: string | ((item: any) => string);
|
|
21
29
|
/** The fields the editor and the text search cover. By default, `textField` when it is a field. */
|
|
@@ -27,6 +27,11 @@ export declare class FilterModel<T> {
|
|
|
27
27
|
typed: boolean;
|
|
28
28
|
/** How a column's header filter value filters when not by being equal (a range, an expression); the grid gives it. */
|
|
29
29
|
conditionOf: (field: string) => ((value: unknown) => data.FilterExpression | null) | null;
|
|
30
|
+
/**
|
|
31
|
+
* The keys a lookup column's chosen key stands with: the keys its list showed as one item (the source matched them to
|
|
32
|
+
* it); a key alone otherwise. The grid gives it.
|
|
33
|
+
*/
|
|
34
|
+
keysOf: (field: string, value: unknown) => readonly unknown[];
|
|
30
35
|
/** Whether the filter row and the header filters are part of the filter value (`filterSyncEnabled`); the grid gives it. */
|
|
31
36
|
sync: () => boolean;
|
|
32
37
|
private searchPart;
|
|
@@ -29,6 +29,8 @@ export declare class LookupTexts<T> {
|
|
|
29
29
|
});
|
|
30
30
|
/** The cache of a lookup column's source now (the source may be a tracked function). */
|
|
31
31
|
items(col: GridColumn<T>): KeyedItems<any> | null;
|
|
32
|
+
/** The string a key of the column is kept under: by its cache (`normalizeKey`), else as it is. */
|
|
33
|
+
private keyOf;
|
|
32
34
|
/** The text of an item: `textField`, else its `text`, else its value. */
|
|
33
35
|
textOf(col: GridColumn<T>, item: unknown): string;
|
|
34
36
|
/** How the column's items are searched by text; `entered` holds the values entered in the row. */
|
|
@@ -10,7 +10,11 @@ import type { GridModel } from './GridModel';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class LookupValues<T> {
|
|
12
12
|
private readonly model;
|
|
13
|
+
/** By column, the keys each entry of its last list stands for, when the source matched more than one key to its item. */
|
|
14
|
+
private readonly merged;
|
|
13
15
|
constructor(model: GridModel<T>);
|
|
16
|
+
/** The keys `value` stands with in the column's list (see `FilterModel.keysOf`): itself alone, unless its entry holds several. */
|
|
17
|
+
keysOf(field: string, value: unknown): readonly unknown[];
|
|
14
18
|
/** The filter of the other columns (and the source's own), which a synced list honors. */
|
|
15
19
|
otherFilter(field: string): data.FilterExpression | null;
|
|
16
20
|
/** The list as a data source a `DropDown` or `ListBox` reads; `first` is the entry put before the values. */
|
|
@@ -3,13 +3,17 @@ import type { ResolvedAction } from './resolved-action';
|
|
|
3
3
|
/**
|
|
4
4
|
* Widths of action buttons, measured once per action (its id, text and look) in a hidden cell and
|
|
5
5
|
* kept, so fitting a row's buttons only adds numbers: scrolling triggers no layout. An action not
|
|
6
|
-
* measured yet counts 0 and is measured
|
|
7
|
-
*
|
|
6
|
+
* measured yet counts 0 and is measured once the page is drawn, with everything asked in that frame:
|
|
7
|
+
* read then, it lays nothing out. `waiting` tells while it waits (the rows keep their buttons out of
|
|
8
|
+
* sight meanwhile) and `measured` then asks the rows to fit their buttons again. A width of 0 (the
|
|
9
|
+
* grid is not shown yet) is not kept.
|
|
8
10
|
*/
|
|
9
11
|
export declare class ActionWidths {
|
|
10
12
|
private readonly host;
|
|
11
13
|
/** Runs after new widths are kept. */
|
|
12
14
|
private readonly measured;
|
|
15
|
+
/** Tells whether buttons wait to be measured. */
|
|
16
|
+
private readonly waiting;
|
|
13
17
|
private readonly widths;
|
|
14
18
|
private frameSize;
|
|
15
19
|
private box;
|
|
@@ -17,9 +21,13 @@ export declare class ActionWidths {
|
|
|
17
21
|
private readonly probes;
|
|
18
22
|
/** The "more" button waiting for the next read, with the cell's padding and gap. */
|
|
19
23
|
private moreProbe;
|
|
24
|
+
/** Takes back the read that waits for the page to be drawn. */
|
|
25
|
+
private pending;
|
|
20
26
|
constructor(host: () => ComponentBase | null,
|
|
21
27
|
/** Runs after new widths are kept. */
|
|
22
|
-
measured?: () => void
|
|
28
|
+
measured?: () => void,
|
|
29
|
+
/** Tells whether buttons wait to be measured. */
|
|
30
|
+
waiting?: (on: boolean) => void);
|
|
23
31
|
/** Measure again (the density changed). */
|
|
24
32
|
clear(): void;
|
|
25
33
|
width<T>(a: ResolvedAction<T>): number;
|
|
@@ -29,6 +37,8 @@ export declare class ActionWidths {
|
|
|
29
37
|
gap: number;
|
|
30
38
|
more: number;
|
|
31
39
|
};
|
|
40
|
+
/** One read for everything asked before the page is drawn; a window that lays nothing out (a test document) reads with its next round. */
|
|
41
|
+
private ask;
|
|
32
42
|
private readonly read;
|
|
33
43
|
private readonly write;
|
|
34
44
|
private cell;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from '@motifx/core';
|
|
2
2
|
import type { CellTipTarget } from './cell-tip-target';
|
|
3
|
-
import { KeyedItems } from '../../../parts/data/KeyedItems';
|
|
3
|
+
import type { KeyedItems } from '../../../parts/data/KeyedItems';
|
|
4
4
|
import type { GridModel } from '../model/GridModel';
|
|
5
5
|
import type { ActionWidths } from './ActionWidths';
|
|
6
6
|
import { RowActions } from './RowActions';
|
|
@@ -7,6 +7,7 @@ import type { OptionParts } from '../../parts/list/option-parts';
|
|
|
7
7
|
import { Popup } from '../../parts/popup/Popup';
|
|
8
8
|
import type { PopupCloseReason } from '../../parts/popup/popup-close-reason';
|
|
9
9
|
import type { DropDownProps } from './drop-down-props';
|
|
10
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
10
11
|
type Template<T> = ((item: T, host: ComponentBase<HTMLElement>) => (() => void) | void) | null;
|
|
11
12
|
type OptionDrawer<T> = ((item: T, option: OptionParts) => (() => void) | void) | null;
|
|
12
13
|
/**
|
|
@@ -30,6 +31,8 @@ export declare class DropDown<T = unknown, V = unknown> extends Field<V | null,
|
|
|
30
31
|
set textField(value: Bind<ItemField<T>>);
|
|
31
32
|
get valueField(): ItemField<T> | undefined;
|
|
32
33
|
set valueField(value: Bind<ItemField<T>>);
|
|
34
|
+
get normalizeKey(): NormalizeKey | undefined;
|
|
35
|
+
set normalizeKey(value: Bind<NormalizeKey>);
|
|
33
36
|
get iconField(): ItemField<T> | undefined;
|
|
34
37
|
set iconField(value: Bind<ItemField<T>>);
|
|
35
38
|
get groupField(): ItemField<T> | undefined;
|
|
@@ -90,6 +93,8 @@ export declare class DropDown<T = unknown, V = unknown> extends Field<V | null,
|
|
|
90
93
|
private get dropParts();
|
|
91
94
|
private itemText;
|
|
92
95
|
private itemValue;
|
|
96
|
+
/** The test for the item of `value`: the same value, the same once normalized, or the one the data source matched to it. */
|
|
97
|
+
private holderOf;
|
|
93
98
|
private indexOfValue;
|
|
94
99
|
/** The item of `value`: among the items in memory, or the one known from a data source (asked by key when needed). */
|
|
95
100
|
private itemOfValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Bind, ComponentBase } from '@motifx/core';
|
|
2
2
|
import type { data } from '@motifx-community/data';
|
|
3
3
|
import type { FieldProps } from '../../parts/field/field-props';
|
|
4
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
4
5
|
import type { ItemField } from '../../parts/list/item-field';
|
|
5
6
|
import type { PopupCloseReason } from '../../parts/popup/popup-close-reason';
|
|
6
7
|
/** Props of `DropDown`, in addition to the field props. Each prop is also a settable, reactive property. */
|
|
@@ -23,6 +24,11 @@ export interface DropDownProps<T, V> extends FieldProps<V | null> {
|
|
|
23
24
|
textField?: Bind<ItemField<T>>;
|
|
24
25
|
/** The default is `'value'` when the object has one, and the item itself otherwise. */
|
|
25
26
|
valueField?: Bind<ItemField<T>>;
|
|
27
|
+
/**
|
|
28
|
+
* Values equal once normalized are one value (`NormalizeKey`). Without it, the item of a value a data source compares
|
|
29
|
+
* its own way (`'A '` for `'A'`, a different case) is still found: the source is asked for it and decides.
|
|
30
|
+
*/
|
|
31
|
+
normalizeKey?: Bind<NormalizeKey>;
|
|
26
32
|
iconField?: Bind<ItemField<T>>;
|
|
27
33
|
/** Options in the same group appear together under its name. */
|
|
28
34
|
groupField?: Bind<ItemField<T>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
2
|
import type { data } from '@motifx-community/data';
|
|
3
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
3
4
|
/** The values of a lookup field come from a list: a drop-down of its items, or a tag box for "is any of". */
|
|
4
5
|
export interface FilterBuilderLookup {
|
|
5
6
|
/** The items: a data source, searched on its service, or an in-memory array. */
|
|
@@ -9,6 +10,8 @@ export interface FilterBuilderLookup {
|
|
|
9
10
|
* plain values.
|
|
10
11
|
*/
|
|
11
12
|
valueField?: string;
|
|
13
|
+
/** Keys equal once normalized are one key (`NormalizeKey`); see `GridLookup.normalizeKey`. */
|
|
14
|
+
normalizeKey?: NormalizeKey;
|
|
12
15
|
/** The display text: an item field or a function of the item. The default is the value. */
|
|
13
16
|
textField?: string | ((item: any) => string);
|
|
14
17
|
/** Shows a clear button in the drop-down. The default is `false`. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Bind, type ComponentBase, type IBaseProp } from '@motifx/core';
|
|
2
2
|
import type { data } from '@motifx-community/data';
|
|
3
3
|
import { DataItems } from '../../parts/data/DataItems';
|
|
4
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
4
5
|
import { Field } from '../../parts/field/Field';
|
|
5
6
|
import type { ItemField } from '../../parts/list/item-field';
|
|
6
7
|
import { TextBox } from '../textbox/TextBox';
|
|
@@ -26,6 +27,8 @@ export declare class ListBox<T = unknown, V = unknown> extends Field<V | V[] | n
|
|
|
26
27
|
set textField(value: Bind<ItemField<T>>);
|
|
27
28
|
get valueField(): ItemField<T> | undefined;
|
|
28
29
|
set valueField(value: Bind<ItemField<T>>);
|
|
30
|
+
get normalizeKey(): NormalizeKey | undefined;
|
|
31
|
+
set normalizeKey(value: Bind<NormalizeKey>);
|
|
29
32
|
get iconField(): ItemField<T> | undefined;
|
|
30
33
|
set iconField(value: Bind<ItemField<T>>);
|
|
31
34
|
get groupField(): ItemField<T> | undefined;
|
|
@@ -76,6 +79,8 @@ export declare class ListBox<T = unknown, V = unknown> extends Field<V | V[] | n
|
|
|
76
79
|
protected sameValue(a: V | V[] | null, b: V | V[] | null): boolean;
|
|
77
80
|
protected renderValue(value: V | V[] | null): void;
|
|
78
81
|
protected itemText(item: T): string;
|
|
82
|
+
/** Whether `item` is chosen: its value is, or a chosen value stands for it (`DataItems.sameItem`). */
|
|
83
|
+
private isChosen;
|
|
79
84
|
protected itemValue(item: T): unknown;
|
|
80
85
|
private get listParts();
|
|
81
86
|
private setUpList;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
2
|
import type { data } from '@motifx-community/data';
|
|
3
3
|
import type { FieldProps } from '../../parts/field/field-props';
|
|
4
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
4
5
|
import type { ItemField } from '../../parts/list/item-field';
|
|
5
6
|
import type { ItemTemplate } from './item-template';
|
|
6
7
|
import type { ListSelectionMode } from './list-selection-mode';
|
|
@@ -12,6 +13,11 @@ export interface ListBoxProps<T, V> extends FieldProps<V | V[] | null> {
|
|
|
12
13
|
dataSource?: Bind<data.DataSource<T, unknown> | null>;
|
|
13
14
|
textField?: Bind<ItemField<T>>;
|
|
14
15
|
valueField?: Bind<ItemField<T>>;
|
|
16
|
+
/**
|
|
17
|
+
* Values equal once normalized are one value (`NormalizeKey`). Without it, the item of a value a data source compares
|
|
18
|
+
* its own way (`'A '` for `'A'`, a different case) is still found: the source is asked for it and decides.
|
|
19
|
+
*/
|
|
20
|
+
normalizeKey?: Bind<NormalizeKey>;
|
|
15
21
|
iconField?: Bind<ItemField<T>>;
|
|
16
22
|
/** Applies to in-memory items only. */
|
|
17
23
|
groupField?: Bind<ItemField<T>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DataItems } from '../../parts/data/DataItems';
|
|
2
2
|
/** Whether the items the list shows are all chosen (`true`), none of them (`false`) or some (`'mixed'`). */
|
|
3
|
-
export declare function selectAllState<T>(items: DataItems<T>, chosen: ReadonlySet<unknown>,
|
|
3
|
+
export declare function selectAllState<T>(items: DataItems<T>, chosen: ReadonlySet<unknown>, isChosen: (item: T) => boolean, enabledOf: (item: T) => boolean): boolean | 'mixed';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Bind, type ComponentBase, type Event as MotifEvent, type IBaseProp } from '@motifx/core';
|
|
2
2
|
import type { data } from '@motifx-community/data';
|
|
3
3
|
import { DataItems } from '../../parts/data/DataItems';
|
|
4
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
4
5
|
import { Field } from '../../parts/field/Field';
|
|
5
6
|
import type { ItemField } from '../../parts/list/item-field';
|
|
6
7
|
import type { PopupCloseReason } from '../../parts/popup/popup-close-reason';
|
|
@@ -25,6 +26,8 @@ export declare class TagBox<T = unknown, V = unknown> extends Field<V[], TagBoxP
|
|
|
25
26
|
set textField(value: Bind<ItemField<T>>);
|
|
26
27
|
get valueField(): ItemField<T> | undefined;
|
|
27
28
|
set valueField(value: Bind<ItemField<T>>);
|
|
29
|
+
get normalizeKey(): NormalizeKey | undefined;
|
|
30
|
+
set normalizeKey(value: Bind<NormalizeKey>);
|
|
28
31
|
get iconField(): ItemField<T> | undefined;
|
|
29
32
|
set iconField(value: Bind<ItemField<T>>);
|
|
30
33
|
get groupField(): ItemField<T> | undefined;
|
|
@@ -98,6 +101,8 @@ export declare class TagBox<T = unknown, V = unknown> extends Field<V[], TagBoxP
|
|
|
98
101
|
protected sameValue(a: V[], b: V[]): boolean;
|
|
99
102
|
protected renderValue(value: V[]): void;
|
|
100
103
|
protected itemText(item: T): string;
|
|
104
|
+
/** Whether `item` is chosen: its value is, or a chosen value stands for it (`DataItems.sameItem`). */
|
|
105
|
+
private isChosen;
|
|
101
106
|
protected itemValue(item: T): unknown;
|
|
102
107
|
/** The text of a tag whose value has no item. */
|
|
103
108
|
protected textOfValue(value: V): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
2
|
import type { data } from '@motifx-community/data';
|
|
3
3
|
import type { FieldProps } from '../../parts/field/field-props';
|
|
4
|
+
import type { NormalizeKey } from '../../parts/data/normalize-key';
|
|
4
5
|
import type { ItemField } from '../../parts/list/item-field';
|
|
5
6
|
import type { PopupCloseReason } from '../../parts/popup/popup-close-reason';
|
|
6
7
|
import type { ItemTemplate } from '../listbox/item-template';
|
|
@@ -12,6 +13,11 @@ export interface TagBoxProps<T, V> extends FieldProps<V[]> {
|
|
|
12
13
|
dataSource?: Bind<data.DataSource<T, unknown> | null>;
|
|
13
14
|
textField?: Bind<ItemField<T>>;
|
|
14
15
|
valueField?: Bind<ItemField<T>>;
|
|
16
|
+
/**
|
|
17
|
+
* Values equal once normalized are one value (`NormalizeKey`). Without it, the item of a value a data source compares
|
|
18
|
+
* its own way (`'A '` for `'A'`, a different case) is still found: the source is asked for it and decides.
|
|
19
|
+
*/
|
|
20
|
+
normalizeKey?: Bind<NormalizeKey>;
|
|
15
21
|
iconField?: Bind<ItemField<T>>;
|
|
16
22
|
/** Applies to in-memory items only. */
|
|
17
23
|
groupField?: Bind<ItemField<T>>;
|
|
@@ -107,6 +107,14 @@ export declare class Toolbar extends Control<HTMLDivElement, ToolbarProps> {
|
|
|
107
107
|
private readonly readBar;
|
|
108
108
|
/** Moves into the "more" menu what does not fit (and what always goes there). */
|
|
109
109
|
private readonly fit;
|
|
110
|
+
/**
|
|
111
|
+
* Keeps the room of the parts put in the "more" menu in the bar's own size, so it still asks what holds it for the
|
|
112
|
+
* room of every part: a hidden part as long as they are, which takes no room on the bar (it grows by a millionth of
|
|
113
|
+
* the room to spare). A bar sized by its parts then grows when what holds it does, and its size notice puts them
|
|
114
|
+
* back; without it, the bar would stay as small as the parts left on it.
|
|
115
|
+
*/
|
|
116
|
+
private keepRoom;
|
|
117
|
+
private makeReserve;
|
|
110
118
|
private showOverflow;
|
|
111
119
|
/**
|
|
112
120
|
* Runs in the fit's write: when something has to go, the "more" button is shown, and measured there the first time
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { View } from './view';
|
|
2
|
+
/**
|
|
3
|
+
* Runs `then` in a task after the next frame of `view`: the frame's own work (style, layout, paint) is done by then, so
|
|
4
|
+
* reading or moving focus there lays nothing out. A window that draws no frames runs it on a timer. Returns what takes
|
|
5
|
+
* it back.
|
|
6
|
+
*/
|
|
7
|
+
export declare function afterFrame(view: View, then: () => void): () => void;
|
|
@@ -5,3 +5,10 @@ import { type ComponentBase } from '@motifx/core';
|
|
|
5
5
|
* runs for an owner disposed by then. Returns what takes it back.
|
|
6
6
|
*/
|
|
7
7
|
export declare function afterDrawn(owner: ComponentBase, then: () => void): () => void;
|
|
8
|
+
/**
|
|
9
|
+
* Reads once the window of `owner` has drawn its next frame, in one run with every other measure asked for that frame:
|
|
10
|
+
* the page is laid out by then and the reads come before the writes, so nothing is laid out to read. What `write`
|
|
11
|
+
* writes shows a frame later. For a first measure that can wait a frame (a part that clips what does not fit until
|
|
12
|
+
* then). Returns what takes it back.
|
|
13
|
+
*/
|
|
14
|
+
export declare function measureAfterDrawn<T>(owner: ComponentBase, read: () => T, write: (value: T) => void): () => void;
|
|
@@ -14,7 +14,7 @@ export type { Size } from './size';
|
|
|
14
14
|
export type { SizeBox } from './size-box';
|
|
15
15
|
export type { Viewport } from './viewport-rect';
|
|
16
16
|
export { everyFrame } from './every-frame';
|
|
17
|
-
export { afterDrawn } from './drawn';
|
|
17
|
+
export { afterDrawn, measureAfterDrawn } from './drawn';
|
|
18
18
|
export { componentAt, shareAlong, visibleRectOf } from './hits';
|
|
19
19
|
export { lengthOf, probeLengths } from './lengths';
|
|
20
20
|
export { onLookChange } from './look';
|
package/dist/index.d.ts
CHANGED
|
@@ -108,6 +108,7 @@ export type { ItemSource } from './parts/list/item-source';
|
|
|
108
108
|
export { DataItems } from './parts/data/DataItems';
|
|
109
109
|
export { KeyedItems } from './parts/data/KeyedItems';
|
|
110
110
|
export type { KeyedItem } from './parts/data/keyed-item';
|
|
111
|
+
export type { NormalizeKey } from './parts/data/normalize-key';
|
|
111
112
|
export type { TextSearch } from './parts/data/text-search';
|
|
112
113
|
export { readItemField } from './parts/list/read-item-field';
|
|
113
114
|
export type { ItemField } from './parts/list/item-field';
|