viewkitjs 0.28.0 → 0.29.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 +107 -0
- package/MIGRATION.md +85 -4
- package/fields/dist/derived.d.ts +2 -1
- package/fields/dist/derived.js +9 -3
- package/fields/dist/entities.js +41 -3
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +8 -2
- package/fields/dist/messages.js +3 -0
- package/fields/dist/range.d.ts +6 -0
- package/fields/dist/range.js +8 -0
- package/fields/dist/registry.js +11 -1
- package/fields/dist/spec-changes.js +1 -0
- package/fields/dist/types.d.ts +23 -1
- package/fields/docs/guides/derived-fields.md +7 -5
- package/fields/docs/guides/field-types.md +2 -2
- package/fields/docs/guides/the-index.md +1 -1
- package/fields/docs/reference/fields.md +3 -1
- package/fields/docs/reference/types.md +3 -1
- package/fields/skills/viewkit/SKILL.md +1 -1
- package/package.json +2 -1
- package/postgres/dist/definitions/build.js +29 -5
- package/postgres/dist/definitions/label.d.ts +7 -0
- package/postgres/dist/definitions/label.js +9 -1
- package/postgres/dist/definitions/lookup.js +6 -2
- package/postgres/dist/definitions/place.d.ts +6 -3
- package/postgres/dist/definitions/rollup.js +5 -1
- package/postgres/dist/definitions/storage.d.ts +15 -0
- package/postgres/dist/definitions/storage.js +52 -1
- package/postgres/dist/definitions/stored.js +21 -0
- package/postgres/dist/phone.d.ts +13 -1
- package/postgres/dist/phone.js +23 -3
- package/postgres/dist/search-indexes.d.ts +6 -1
- package/postgres/dist/search-indexes.js +71 -25
- package/postgres/dist/search.js +3 -3
- package/postgres/docs/guides/definitions.md +22 -5
- package/postgres/docs/guides/field-map.md +5 -4
- package/postgres/docs/reference/definitions.md +3 -3
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/cells/cell-format.js +2 -2
- package/views/dist/cells/cell-values.js +9 -10
- package/views/dist/contract.d.ts +149 -3
- package/views/dist/contract.js +157 -1
- package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
- package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
- package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
- package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
- package/views/dist/controls/bulk-bar/looks.js +14 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
- package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
- package/views/dist/controls/bulk-bar/tokens.js +36 -0
- package/views/dist/controls/bulk-bar/words.d.ts +50 -0
- package/views/dist/controls/bulk-bar/words.js +19 -0
- package/views/dist/controls/bulk-bar.css +96 -0
- package/views/dist/controls/button/button.js +3 -1
- package/views/dist/controls/button.css +5 -4
- package/views/dist/controls/checkbox/checkbox.js +3 -1
- package/views/dist/controls/checkbox.css +1 -1
- package/views/dist/controls/choice/tokens.d.ts +79 -0
- package/views/dist/controls/choice/tokens.js +22 -0
- package/views/dist/controls/choice.css +31 -0
- package/views/dist/controls/compound-editor/looks.js +1 -1
- package/views/dist/controls/controls.d.ts +10 -0
- package/views/dist/controls/controls.js +8 -0
- package/views/dist/controls/customize/customize.d.ts +125 -0
- package/views/dist/controls/customize/customize.js +243 -0
- package/views/dist/controls/customize/glide.d.ts +10 -0
- package/views/dist/controls/customize/glide.js +55 -0
- package/views/dist/controls/customize/looks.d.ts +13 -0
- package/views/dist/controls/customize/looks.js +11 -0
- package/views/dist/controls/customize/map-customize-body.d.ts +18 -0
- package/views/dist/controls/customize/map-customize-body.js +160 -0
- package/views/dist/controls/customize/rules.d.ts +23 -0
- package/views/dist/controls/customize/rules.js +19 -0
- package/views/dist/controls/customize/tokens.d.ts +40 -0
- package/views/dist/controls/customize/tokens.js +12 -0
- package/views/dist/controls/customize/words.d.ts +58 -0
- package/views/dist/controls/customize/words.js +37 -0
- package/views/dist/controls/customize.css +54 -0
- package/views/dist/controls/date-editor/looks.js +1 -1
- package/views/dist/controls/filter-editor/block.d.ts +31 -0
- package/views/dist/controls/filter-editor/block.js +27 -0
- package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
- package/views/dist/controls/filter-editor/filter-editor.js +85 -43
- package/views/dist/controls/filter-editor/how.d.ts +1 -1
- package/views/dist/controls/filter-editor/how.js +1 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +16 -1
- package/views/dist/controls/filter-editor/map-filter-body.js +39 -13
- package/views/dist/controls/filter-editor/map-rules.d.ts +27 -11
- package/views/dist/controls/filter-editor/map-rules.js +73 -42
- package/views/dist/controls/filter-editor/rules.d.ts +43 -5
- package/views/dist/controls/filter-editor/rules.js +55 -2
- package/views/dist/controls/filter-editor/words.d.ts +15 -0
- package/views/dist/controls/filter-editor/words.js +6 -0
- package/views/dist/controls/filter-editor.css +18 -0
- package/views/dist/controls/index.d.ts +26 -2
- package/views/dist/controls/index.js +25 -2
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- package/views/dist/controls/internal/phone.d.ts +5 -4
- package/views/dist/controls/internal/phone.js +7 -7
- package/views/dist/controls/internal/scroll.js +5 -1
- package/views/dist/controls/internal/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/number-editor/looks.js +1 -1
- package/views/dist/controls/option/option.js +3 -1
- package/views/dist/controls/option.css +1 -1
- package/views/dist/controls/pane/pane.d.ts +4 -0
- package/views/dist/controls/pane/pane.js +2 -1
- package/views/dist/controls/picker/looks.js +1 -1
- package/views/dist/controls/picker/map-picker.d.ts +6 -2
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.d.ts +7 -0
- package/views/dist/controls/picker/picker.js +57 -8
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +2 -2
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/popover.css +3 -0
- package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
- package/views/dist/controls/ports-host/map-ports-host.js +43 -0
- package/views/dist/controls/press/tokens.d.ts +8 -0
- package/views/dist/controls/press/tokens.js +4 -0
- package/views/dist/controls/press.css +44 -0
- package/views/dist/controls/quick-filters/looks.d.ts +11 -0
- package/views/dist/controls/quick-filters/looks.js +9 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +56 -0
- package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
- package/views/dist/controls/quick-filters/quick-filters.js +89 -0
- package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
- package/views/dist/controls/quick-filters/reminder.js +41 -0
- package/views/dist/controls/quick-filters/rules.d.ts +89 -0
- package/views/dist/controls/quick-filters/rules.js +52 -0
- package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
- package/views/dist/controls/quick-filters/tokens.js +30 -0
- package/views/dist/controls/quick-filters/words.d.ts +25 -0
- package/views/dist/controls/quick-filters/words.js +13 -0
- package/views/dist/controls/quick-filters.css +118 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
- package/views/dist/controls/sheet/bottom-sheet.js +4 -4
- package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
- package/views/dist/controls/sheet/map-sheet.js +19 -6
- package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
- package/views/dist/controls/sheet/sheet-parts.js +2 -0
- package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
- package/views/dist/controls/switch-row/switch-row.js +9 -0
- package/views/dist/controls/switch-row/tokens.d.ts +51 -0
- package/views/dist/controls/switch-row/tokens.js +15 -0
- package/views/dist/controls/switch-row.css +39 -0
- package/views/dist/controls/switch.css +1 -1
- package/views/dist/controls/tag/tag.js +3 -1
- package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
- package/views/dist/controls/tag-field/tag-field.js +19 -0
- package/views/dist/controls/tag-field/tokens.d.ts +7 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +13 -0
- package/views/dist/controls/text-editor/looks.js +1 -1
- package/views/dist/controls/text-editor/text-editor.js +1 -5
- package/views/dist/controls/toast/toast.d.ts +5 -1
- package/views/dist/controls/toast/toast.js +5 -3
- package/views/dist/controls/tokens.js +18 -0
- package/views/dist/controls/toolbar/keys.d.ts +3 -0
- package/views/dist/controls/toolbar/keys.js +11 -0
- package/views/dist/controls/toolbar/looks.d.ts +10 -0
- package/views/dist/controls/toolbar/looks.js +40 -0
- package/views/dist/controls/toolbar/tokens.d.ts +28 -0
- package/views/dist/controls/toolbar/tokens.js +9 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
- package/views/dist/controls/toolbar/toolbar.js +370 -0
- package/views/dist/controls/toolbar/words.d.ts +28 -0
- package/views/dist/controls/toolbar/words.js +17 -0
- package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
- package/views/dist/controls/toolbar-button/looks.js +21 -0
- package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
- package/views/dist/controls/toolbar-button/tokens.js +28 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
- package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
- package/views/dist/controls/toolbar-button.css +75 -0
- package/views/dist/controls/toolbar.css +65 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +2 -2
- package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
- package/views/dist/controls/tooltip/tooltip.js +2 -2
- package/views/dist/controls/values-editor/looks.js +1 -1
- package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
- package/views/dist/controls/views-list/map-views-list-body.js +128 -4
- package/views/dist/controls/views-list/rules.d.ts +26 -0
- package/views/dist/controls/views-list/rules.js +63 -0
- package/views/dist/controls/views-list/view-menu.d.ts +84 -0
- package/views/dist/controls/views-list/view-menu.js +201 -0
- package/views/dist/controls/views-list/views-list.d.ts +8 -1
- package/views/dist/controls/views-list/views-list.js +18 -3
- package/views/dist/controls/views-list/words.d.ts +54 -0
- package/views/dist/controls/views-list/words.js +10 -1
- package/views/dist/controls/views-list.css +5 -1
- package/views/dist/display/date.js +3 -3
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +3 -0
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/grid/chrome/GridHeader.js +2 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
- package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/grid.css +240 -0
- package/views/dist/grid/looks.d.ts +5 -1
- package/views/dist/grid/looks.js +20 -12
- package/views/dist/grid-tokens.d.ts +109 -0
- package/views/dist/grid-tokens.js +29 -0
- package/views/dist/looks/index.d.ts +5 -0
- package/views/dist/looks/index.js +5 -0
- package/views/dist/looks/pieces.js +10 -0
- package/views/dist/model/column-capabilities.d.ts +2 -0
- package/views/dist/model/column-filters.d.ts +2 -1
- package/views/dist/model/column-from.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/index.d.ts +2 -2
- package/views/dist/panels/index.js +2 -2
- package/views/dist/panels/labels.d.ts +4 -0
- package/views/dist/panels/labels.js +8 -0
- package/views/dist/panels/model.d.ts +10 -2
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/customize-body.d.ts +9 -4
- package/views/dist/panels/react/customize-body.js +39 -11
- package/views/dist/panels/react/customize.d.ts +8 -1
- package/views/dist/panels/react/customize.js +9 -6
- package/views/dist/panels/react/filter/FilterEditor.js +4 -4
- package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +3 -3
- package/views/dist/panels/react/filter/filter-body.js +5 -2
- package/views/dist/panels/react/panel-step.d.ts +3 -0
- package/views/dist/panels/react/panel-step.js +2 -1
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -3
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +10 -3
- package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +13 -3
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -3
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
- package/views/dist/panels/react/view-footer.d.ts +1 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +40 -9
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.js +29 -5
- package/views/dist/provider/components.d.ts +149 -8
- package/views/dist/provider/context.d.ts +6 -0
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +4 -1
- package/views/dist/selection/bar-props.d.ts +26 -0
- package/views/dist/selection/bar-props.js +1 -0
- package/views/dist/selection/index.d.ts +1 -1
- package/views/dist/selection/verbs.d.ts +32 -5
- package/views/dist/styles.css +656 -25
- package/views/dist/styles.unlayered.css +653 -22
- package/views/docs/contract.md +44 -17
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/customize.md +17 -0
- package/views/docs/controls/popover.md +2 -0
- package/views/docs/controls/press.md +9 -0
- package/views/docs/controls/quick-filters.md +35 -0
- package/views/docs/controls/radio.md +1 -1
- package/views/docs/controls/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -0
- package/views/docs/controls/toolbar-button.md +31 -0
- package/views/docs/controls/toolbar.md +14 -0
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +2 -2
- package/views/docs/guides/display.md +2 -2
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +6 -6
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +1 -1
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +1 -1
- package/views/docs/reference/controls.md +194 -13
- package/views/docs/reference/display.md +1 -0
- package/views/docs/reference/looks.md +25 -11
- package/views/docs/reference/panels-react.md +7 -7
- package/views/docs/reference/panels.md +8 -6
- package/views/docs/reference/react.md +13 -6
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +7 -6
- package/views/skills/views/SKILL.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,113 @@ Until 0.19.0 ViewKit shipped as three packages; their changes are in [fields/CHA
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.29.0] — 2026-11-30
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `viewkitjs/views/display`: `timeShown(declared?, chosen?)`, whether a date-and-time shows its time: the reader's choice, else the declared `withTime`, else yes. An app drawing its own date line reads the same rule.
|
|
13
|
+
- `viewkitjs/fields`: `exactPresetOf(field, value)`, the preset whose two ends are exactly a range value's, and `rangeShownText(field, value, conventions?)`, the value as a cell shows it: that preset's label, else its numbers as `rangeText` writes them.
|
|
14
|
+
- `viewkitjs/views/controls`: `CONTROLS.QuickFiltersBody`, the Outright quick filters: a strip of the fields, a search past eight values, each value with its mark and its count, one Tab stop over the values, in the one sheet on a phone. Their option Holds (`data-quick-filters-holds`, `one` or `several`) is `QUICK_FILTERS_LOOKS` in `viewkitjs/views/looks`. The body itself is `QuickFilters`, with its rules as `QUICK_FILTERS_RULES`, and its stylesheet `viewkitjs/views/controls/quick-filters.css`.
|
|
15
|
+
- `viewkitjs/views/panels`: a quick filter field may hand its `options` (`ViewsPickerItem`s), and a quick filters' body is handed them, so each value draws its option's mark (a status's step, a person's or a company's face).
|
|
16
|
+
- The message key `views.panels.quick-clear-value`, "Clear filter": what a held value says before its count.
|
|
17
|
+
- `viewkitjs/views/controls`: `BulkBar`, the Outright bulk bar: on a computer a surface floating at the foot of the list that holds it, its count, its verbs as outlined buttons, Delete and More; on a phone the tray, or the pill. Its options (`delete`, `phone`, `picked`) and its look are `BULK_BAR_LOOKS` in `viewkitjs/views/looks`, its stylesheet `viewkitjs/views/controls/bulk-bar.css`.
|
|
18
|
+
- The components map's optional `SelectionBar`, and `CONTROLS.SelectionBar`, which draws the Outright bulk bar wherever ViewKit's `SelectionBar` is called.
|
|
19
|
+
- `viewkitjs/views/selection`: `SelectionBar`'s optional `noun` and `deleteLine`; a verb's optional `more`; an options verb's optional `value`, `empty`, `onEmpty` and `search`, and its `options` may be `ViewsPickerItem`s; a press may hand back `{ words, undo }` (`SelectionDone`) or a promise of one, which the Outright bulk bar says in its Toast.
|
|
20
|
+
- The message keys `views.selection.many` ("{count} {one}" or "{count} {other}"), `views.selection.bar-label` ("{many} selected"), `views.selection.delete-many` ("Delete {many}"), `views.selection.delete-ask` ("Delete {many}?"), `views.selection.noun-one` ("row"), `views.selection.noun-other` ("rows"), `views.selection.bar-count` ("Selected"), `views.selection.clear-the` ("Clear the selection"), `views.selection.delete-button` ("Delete"), `views.selection.cant-use` ("Can't be used now") and `views.panels.toast-region` ("Notifications").
|
|
21
|
+
- `viewkitjs/views/grid.css`: the grid's look stylesheet, which draws the grid's options (`GRID_LOOKS`) worn on a frame round the grid as `data-grid-*`: the header's words, the column lines' pinned edge, the pinned edge's fade, line or divider, the rows' lines, a picked cell's wash, the cell frames' corners and colours, picked rows' tint, compact groups, names underlined, phones as links, a phone kept as typed, the footer's figures value first, and a header, footer or + Add column cell pressed while its menu is open. A grid with no frame round it wears each option's default. Where ViewKit's own Text, Number, Picker, Compound, Values or Date editor draws its own edge, the edited cell's outline stands down. Plain CSS on the contract's names; an app that imports ViewKit's stylesheets one by one imports it after ViewKit's own classes.
|
|
22
|
+
- `viewkitjs/views`: `VK_GRID_TOKENS`, every name the grid's look reads beside the grid's own geometry, each with its kind and the Outright token it stands for. One is new, `--vk-frozen-fade`: the shade a pinned column casts over the columns scrolling under it.
|
|
23
|
+
- `viewkitjs/postgres/definitions`: `buildFieldMap` takes `readUnder`, by kind and field, the name of a condition a lookup or a rollup reads its far records under. Such a field reads through tables keyed `far:<kind>:<name>`, which `reads` names, so you hand it a condition and a list of readable fields of its own: a list can show a related record's name to everyone who sees the row and its other fields only to readers who may see that record. Fields given one name share their tables. A map that names no field is built as before.
|
|
24
|
+
- `viewkitjs/postgres/definitions`: a storage keeps a select, a status or a text of one value as another kind's record, `{ column, from: { kind, value } }`: `column` holds that record's key and the field's value is its `value` column (a status kept as a code table's row id, valued by its code). The code table is declared as a kind, read as `far:<kind>` under the condition you hand for it; the field filters, sorts, groups and counts by that value, and an empty, unmatched, hidden or trashed id reads as no value. A field you declared `notKept` for this reason can now be kept.
|
|
25
|
+
- `viewkitjs/views/controls`: the pressing area, `viewkitjs/views/controls/press.css`, in the ready stylesheet. On a phone a Button under 44px, a Checkbox's box, a Radio's ring, a Tag's remove button, a Switch and an Option drawn as a link take taps from an invisible area 44px round them, never overlapping a neighbour's; on a computer the Switch, the Checkbox's box and the Radio's ring take a little room round them.
|
|
26
|
+
|
|
27
|
+
- `viewkitjs/views/controls`: the TagField, tags typed into the Input's field (Enter or a comma adds one, Backspace on an empty box takes the last off), and the SwitchRow and SwitchRows, a settings list's rows, each with its stylesheet (`tag-field.css`, `switch-row.css`), in the ready stylesheet.
|
|
28
|
+
- `viewkitjs/views/controls`: the Tooltip's and the Sheet's `className`, a class on the tooltip or the sheet itself; a Sheet's head takes a title that isn't words.
|
|
29
|
+
- `viewkitjs/views/controls`: `PickerProps.menuWords`, the words of the Picker's own menus (a row's menu, and on a phone the ⋯ beside its search): a level's search, a sheet's ✕ and Back, the Close row. A level's list in them takes the Picker's own `words`.
|
|
30
|
+
- `CONTROLS.FilterBody` draws a relation rule as a block in the kit's look, on a computer and on a phone: its relation, Any, None or Every where (Every waiting, saying why, until a rule in it narrows), its rules on that relation's fields, Add filter listing those alone, and Delete condition. A rule on a related field's ⋮ offers Any, None and Every; None or Every turns it into the block. Opened on a relation's where, the same head stands over its rules and hands the quantifier back with the level.
|
|
31
|
+
- A group's ⋮ offers Exclude matches (a group joined by And), and an excluded group says so. `FilterEditorProps.excludable`: the filter itself may exclude its matches, an advanced filter's own group.
|
|
32
|
+
- Nothing a filter holds is out of sight in `CONTROLS.FilterBody`: a `not` group, every relation rule, and a rule on a field the kit has no type for (in ViewKit's own words). Created by is a person in the kit's filter editor, and a long text compares by contains, does not contain, empty and not empty.
|
|
33
|
+
- A place's Country in the kit's filter editor, with `parts: true`: a choice of country names, handed as the field's `options` where ViewKit holds the list (VK-735).
|
|
34
|
+
- `viewkitjs/views/controls`: Customize (`useCustomize`, with its rules, words and options). `CONTROLS.CustomizeBody` draws ViewKit's Customize body with it: the view's sections (Layout, Columns, Filter, Sort, Group) as rows saying where they stand, each opening its screen in place; Layout's cards and the layout's own settings (its density and pick-one settings as rows whose choices open in place, its toggles under their sections with a toggle's way back, For you with its own); Columns with a search, shown and hidden, dragged into place, with Reset columns; Filter, Sort and Group drawing the filter, sort and group editors; the shared view's stale note in a Notice. On a computer it stands in the Pane where your app hands a Pane host, and in the toolbar's popover otherwise; on a phone it heads the one sheet, each section's step under its head. Its stylesheet is `viewkitjs/views/controls/customize.css`.
|
|
35
|
+
- `viewkitjs/views/looks`: `CUSTOMIZE_LOOKS`, its options Its head and Columns.
|
|
36
|
+
- `SheetPartsFrom`: a body in the controls' Sheet may hand it the sheet's head and foot.
|
|
37
|
+
- `ViewsComponents.CustomizeBody.stepsAside`: a Customize body may say which lists it can't draw; for those ViewKit draws its own Customize. `CONTROLS.CustomizeBody` steps aside for a column with its own settings, your field editor's rows and a card layout's line breaks.
|
|
38
|
+
- `viewkitjs/views/controls`: the toolbar button, `ToolbarButtonControl`, a default control on Base UI. It is the Button: its ground (ghost, bordered, filled), its words (icon and word, icon, word), its size and its corners are read from the frame around it, a computer's or a phone's, and follow it as it changes, and it says a count, a dot, an empty place, lit, set aside, joined to its neighbours, or a view tab. Inside a toolbar (`InToolbar`) it takes the row's size and form and is one of the toolbar's stops; `useToolbarButtonWorn` reads its options as worn. Its options and looks are `TOOLBAR_BUTTON_LOOKS` on `viewkitjs/views/looks` (nothing set: bordered, 32, icon and word on a computer; filled, 36, round, its icon alone on a phone), its stylesheet `viewkitjs/views/controls/toolbar-button.css`, in the ready stylesheet too. ViewKit's own toolbar still draws its `ToolbarButton` atom: nothing an app draws changes.
|
|
39
|
+
- `ReadyToolbar` and `ToolbarOptions` take `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount`, handed on to Customize: `CONTROLS.CustomizeBody` draws the view's name (where its head is the view's name, renamed in place where `onRenameView` is handed), Copy link to view, and Export CSV with its count, each only where handed. An app's own `CustomizeBody` is handed them as `name`, `onRename`, `onCopyLink`, `onExport` and `exportCount` on `ViewsCustomizeBodyProps`.
|
|
40
|
+
- `ViewsCustomizeBodyProps.onStepChange`: on a phone, a body tells the level of its own it stands on inside a section, and the sheet's Escape goes back a level.
|
|
41
|
+
- `viewkitjs/views/controls`: `ToolbarControl`, the Outright Toolbar: the row and the filter bar under it, a phone's one line, a list's places standing where its options pick, folding as it narrows (words to icons, view tabs into "+N", filters into "+N filters", the rest into ⋯), one Tab stop with the arrows, Home and End. With it `ToolbarSeparatorControl`, `ToolbarSpacer`, `ToolbarInput`, `ToolbarFolds` and its words (`TOOLBAR_WORDS`). Its 14 options and four looks (Outright, Attio, Attio with the buttons on the right, and the portal's) are `TOOLBAR_LOOKS` in `viewkitjs/views/looks`, and its stylesheet `viewkitjs/views/controls/toolbar.css`.
|
|
42
|
+
- `viewkitjs/views/controls`: `QuickFiltersReminderControl`, the quick filters' reminder at a phone list's foot, drawn in the Toolbar, with its words (`QUICK_FILTERS_REMINDER_WORDS`); its rules join `quick-filters.css`, which reads one new name, `--vk-layer-sticky`.
|
|
43
|
+
- `viewkitjs/postgres`: `SEARCH_INDEX_REASONS.notImmutable`, for a searched field read with a function Postgres won't index (such as `concat_ws`, `concat`, `to_char`, `unaccent` or `now()`), and `SEARCH_INDEX_REASONS.farLabel`, for a relation whose far table's label no index can hold.
|
|
44
|
+
- `viewkitjs/fields`: the message `field.label` (`{ entity, field, label }`), a field a lookup's or a rollup's note names, before it goes into the note. Its English is the label. An app whose labels are its own catalog's keys words them here; an app whose `messages` handles every key exhaustively adds this one.
|
|
45
|
+
- `viewkitjs/fields`: `defineIndex` stamps each lookup and rollup with `names` (`DerivedNames`): the relation, the hops and the far field its note names, each a `NamedField` as the index found it. Like a lookup's `target`, it is never written in a registry.
|
|
46
|
+
- `viewkitjs/views/panels`: the builder's `filterTree.listed`, what a field list shows: its `fields` and, in their places in the person's column order, each column the list can't filter, carrying `disabled` (why, in your words: your capability's reason, a column with no field's, else `views.panels.filter-not-offered`). `listedFieldsOf(filterTree)` reads it, `fields` where it is absent. `FilterEditorField.disabled`.
|
|
47
|
+
- The components map's `ViewsFilterBodyField.disabled`: why no rule can be made on that field. Your `FilterBody` draws it greyed and never writes a rule on it nor puts one back; ViewKit refuses a level that does.
|
|
48
|
+
- The message key `views.panels.filter-fieldless` ("Not a field of this list; a view cannot filter on it."): why a saved view can't filter a column with no field, in the Filter rows and the filter editor's field lists.
|
|
49
|
+
- `CONTROLS.PortsHost` answers the ports an app leaves out: an app that spreads `CONTROLS` and hands no `confirm` asks a row's Delete, and every question ViewKit asks, in ViewKit's alert dialog, not the browser's; one that hands no `toast` sees what ViewKit reports in ViewKit's Toast. An app's own `toast` or `confirm` still wins, and a server render draws neither. This is a new default every app that spreads `CONTROLS` sees.
|
|
50
|
+
- The `PortsHost` slot (`ViewsPortsHostProps`), for an app that draws the missing ports its own way.
|
|
51
|
+
- The toast port's `success(message, { undo })`: a report that can be taken back, shown with Undo in ViewKit's Toast. The confirm request's `detail`: one line under the question.
|
|
52
|
+
- A view's menu is ViewKit's: `useViewMenu` (with `ViewMenuProps`, `ViewMenuShows`, `ViewMenuParts`, `ViewMenuStep`, `ViewMenuWords`) and the rules an app keeping its views uses, `ViewsState`, `viewsAfter`, `copyName`, `canDelete`, `deleteLine` and `columnsLabel`, from `viewkitjs/views/controls`, for an app that draws its own menu. Handed `ask` and `report` it asks and says through your ports; handed `steps`, a phone's menu and what it opens are steps of one Sheet.
|
|
53
|
+
- The views axis's `verbs` (`ViewsViewVerbs`: layouts, the records' noun, a board's columns and one `onChange` taking every `ViewsViewChange`), and each view's `layout`, `changed` and `favorite`. Handed them, `CONTROLS.ViewsListBody` draws a view's whole menu in the Outright look: Rename and New view in the Modal, Edit view, Private view, Save for everyone, Reset, Save as new view, Copy link, Favorite, Duplicate, and Delete, asked through your `confirm` port and said through your `toast` port with Undo. Every word is your messages'. ViewKit moves no view itself: your `onChange` opens the right one (after a delete, an Undo, a create or a duplicate), and `viewsAfter` does it over your views. New view stands only where the axis grows (`onCreate`).
|
|
54
|
+
- `ViewsViewsListBodyProps` gains `verbs`, `onStepChange` and `onHold` (the list holds open while the body asks outside it, the `confirm` port's dialog), and `actions.back` on a step.
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
|
|
58
|
+
- A date-and-time now shows its time by default ("20 Nov, 14:30"): in a grid cell, a field row, a column's printed value and its column menu's Show time, wherever the field's `format.withTime` is left unset. This changes what every app draws for such a field. A field that wants the day alone sets `format: { withTime: false }`; a reader's Show time, and the `withTime` display option, still win over the field. `columnFrom` now carries a field's `withTime: false` onto its column.
|
|
59
|
+
- A range cell and a range field row read as the band's name when the value's ends are exactly one of the field's `presets` ("Small"), with the numbers on hover; any other value still reads as its numbers. The grid's copy writes what the cell shows, and a paste reads a band's name back, in any case (a name two bands share is refused). On hover a band shows its whole value, its code and period included. `rangeText` still writes the numbers.
|
|
60
|
+
- An app that spreads `CONTROLS` now opens these quick filters from the quick filters' button, in place of ViewKit's plain panel. An app that hands its own `QuickFiltersBody` after `CONTROLS` keeps its own.
|
|
61
|
+
- An app that spreads `CONTROLS` now draws the Outright bulk bar where it calls `SelectionBar`, in place of ViewKit's own: in the box that holds the list, at its foot, rather than portalled to the screen's foot; its Delete asks first, then calls `onDelete`; the provider's `selectionBar` placement, `phoneQuery` and `chip` apply to ViewKit's own bar alone. An app that wants ViewKit's own leaves the slot out: `{ ...CONTROLS, SelectionBar: undefined }`.
|
|
62
|
+
- ViewKit's Toast names the region its toasts stand in with the app's words (`views.panels.toast-region`), where Base UI said "Notifications" in English.
|
|
63
|
+
- The ready stylesheet (`viewkitjs/views/styles.css` and `styles.unlayered.css`) now carries the grid's look, after ViewKit's own classes, and declares `--vk-frozen-fade` at the Outright look's value. This changes what every app on the ready stylesheet draws for its grid; the `portal` look's picks, worn on a frame round it (`lookAttrs(GRID_LOOKS, lookPicks(GRID_LOOKS, "portal"))`), come closest to the grid as it was. An app that imports ViewKit's stylesheets one by one sees no change until it imports `viewkitjs/views/grid.css`.
|
|
64
|
+
- `viewkitjs/views/looks`: the grid's option defaults are now the Outright look's: column lines `all`, pinned edge `line`, checkboxes `always`, picked rows `line`, cell corners `round`, hover frame `strong`, groups `titles`, names `hover`, phones `text` and figures `word`. A grid that wears no picks, and `gridLookWorn()` with none, take them; the `attio` look keeps its own picks.
|
|
65
|
+
- Every app on the ready stylesheet: on a phone the small targets above take taps from 44px round them.
|
|
66
|
+
- Every app on the ready stylesheet: the words beside a Checkbox, a Radio and a Switch draw with the label type styles (`viewkitjs/views/controls/choice.css`, now in the ready stylesheet): the label in the small text and the text colour, a note under it in the extra-small text and the subtle colour, and a choice drawn as a card takes its edge and ground.
|
|
67
|
+
- An app that imports ViewKit's control stylesheets one by one adds `viewkitjs/views/controls/press.css` and `viewkitjs/views/controls/choice.css` to get them.
|
|
68
|
+
- The Button, the Checkbox, a Tag's remove button and an Option drawn as a link carry `data-vk-phone` on a phone, as the Switch and the Radio do: an app's own phone rule written as ViewKit's are (`:where([data-vk-phone], [data-vk-phone] *)`) now reaches one of them standing outside any panel too.
|
|
69
|
+
- A Button's own-look dot (`dot: "brand"`) is drawn with `::before`, so on a phone it stays at its top end corner and the Button keeps its pressing area.
|
|
70
|
+
- `viewkitjs/views/looks`: every look named "Mihai's" is named "Outright": the inline input's, the Text editor's, the Values editor's, the Compound editor's, the Number editor's, the Date editor's and the Picker's. Their ids (`mihais`, `mihai`) are unchanged, so a saved pick still finds its look.
|
|
71
|
+
- Every app on `CONTROLS`: a tooltip takes the side, the alignment, the wait (`delayMs`; 0 opens it at once) and the class ViewKit asks for, a date's one second and its start alignment among them.
|
|
72
|
+
- Every app on `CONTROLS`: a popup that holds a list carries `data-popover-chrome="menu"`, which your styles may draw otherwise; it draws as before.
|
|
73
|
+
- An app on the default Sheet (`CONTROLS.Sheet`): it now opens at the height `snap` asks for (`auto` as tall as its content, which an editor's sheet and the selection's ask; `half` at half, with a drag to the top; `peek` low; `full` to the top), and takes its title (words of its own, or words with a mark), named to screen readers by its label where the two differ, a description under its title, and its class.
|
|
74
|
+
- On the bar's part body (`CONTROLS.FilterPartBody`), an actor's rule and a place's Country now open the kit's ways and values, not ViewKit's.
|
|
75
|
+
- On a phone, a rule's ⋯ in the kit's filter editor opens as a step of the same sheet with Back, not a menu sheet on top (one sheet, never a sheet on top).
|
|
76
|
+
- In an app that spreads `CONTROLS`, View settings now opens the kit's Customize in place of ViewKit's own. To keep ViewKit's own:
|
|
77
|
+
|
|
78
|
+
Before: `components={CONTROLS}`
|
|
79
|
+
After: `components={{ ...CONTROLS, CustomizeBody: undefined }}`
|
|
80
|
+
- Customize's popover is 300 px wide by default (`w-75`, was `w-60`, 240 px), the Pane it was designed in: every app that hands `ToolbarOptions` no `widthClassName` sees it, `ReadyToolbar`'s included. Sort's and Filter's popovers keep their width.
|
|
81
|
+
- On a phone, Escape on Customize's group level (Group by's fields, an order's choices) goes back a level instead of closing Customize, in ViewKit's own Customize and in `CONTROLS.CustomizeBody`, whose sort and filter levels go back too.
|
|
82
|
+
- The Toolbar wearing none of its options draws the Outright look: one row at rest, the sort and Filter on its right with their words, the filter bar once a filter is added, the quick filters' button, and on a phone the sort, Filter and View settings on the right of the views. An app that wants Attio's two lines wears the look `attio` (`lookAttrs(TOOLBAR_LOOKS, lookPicks(TOOLBAR_LOOKS, "attio"))`). The looks list Outright first.
|
|
83
|
+
- `viewkitjs/views`: the default English for `views.panels.view-publish` is now "Save for everyone", where it was "Set default for everyone". Customize's foot on a shared view says Reset · Save for everyone, as do `ViewFooter` and `CONTROLS.CustomizeBody`. Every app without its own word for this key sees the new word; an app whose catalog words it keeps its own.
|
|
84
|
+
- `ReadyToolbar`: in Mihai's look, where Clear and Save don't stand on the bar (on a phone, or with no filter), Customize's foot on a shared view now says Reset · Save for everyone, where it said Clear · Save. With no shared view it still offers Clear alone.
|
|
85
|
+
- `viewkitjs/views`: a `command` cell holding a member opens its verbs on one click on the name, as a select's does: the member's chip is drawn inert inside the one trigger, so it no longer opens the member there (`onOpenRelation` and the `RelationLink` atom stand aside in a command cell). A relation, link, email, phone or domain keeps its own control and the ▾ beside it.
|
|
86
|
+
- `viewkitjs/views`: an empty `command` cell handed `commandItems` draws a ▾ that opens its verbs, where it drew nothing before. Without `commandItems` an empty cell still draws nothing.
|
|
87
|
+
- `viewkitjs/postgres`: `searchIndexes` no longer prints an index on an expression that calls a function it knows Postgres won't index; it names the field in `unserved` with `notImmutable`. A relation whose far label no index can hold is now named in `unserved` with `farLabel`, its own column's index still printed; a relation to one record through a link table's lead row names `farLabel` where it named `otherTable`.
|
|
88
|
+
- `viewkitjs/postgres`: a search word reaches a phone through arms an index serves: an international phone whose number holds it, or any other phone whose text as typed holds it, in place of a choice made on each row, which no index served and which made a whole search read every row. A word holding anything but digits and `+` reaches the typed text alone. What a search finds on a phone is unchanged.
|
|
89
|
+
- `viewkitjs/postgres`: `searchIndexes` prints a trigram index on a phone's folded number (when its `parts` keep one) and on its folded text as typed, on the record or on its row's own table, with their statistics, where it named every phone in `unserved`. Run `searchIndexes` again and add them: a search naming a phone then reads through them and the other fields' indexes. `SEARCH_INDEX_REASONS.phone` is no longer given and stays exported.
|
|
90
|
+
- `viewkitjs/postgres`: on a page, a search word on a phone kept in a row of its own, three characters or more, counts its rows through those indexes first, as a text kept in a row does.
|
|
91
|
+
- `viewkitjs/fields`: a lookup's and a rollup's note (`derivedReason`, and `lockReason` for them) names its fields by their labels, through `field.label`, where the field came through the index: "From the linked Company: Country" where it read "From the linked company: country", and "The latest Scheduled start over Calls" where it read "The latest scheduledStartAt over calls". A field outside the index, or a part it couldn't reach, keeps the words it had. This changes the lock's hover and the grid's refusal for every app whose fields come through `defineIndex`.
|
|
92
|
+
- The filter editor's field lists (Filter, +, a filter's field, the advanced filter's editor and the phone's sheet) show a column the list can't filter greyed with its reason, in its place, as the Filter panel's rows do, where they left it out. A press on it picks nothing. Your `FieldsBody` and `FilterBody` are handed it with `disabled`, and a pick of it writes nothing. `filterEditorFields` and `filterTree.fields`, what a rule may name, are unchanged.
|
|
93
|
+
- A filter on the bar whose one value it can only draw by its stored key (a person, an actor or a record your app hasn't named yet, such as after a reload) asks your `filterData.onValuesWanted` once for that field, as opening its filter row does (a related record's field: `relationFilters.farValues.onWanted`), and draws the name once you hand the value in `knownValues` and its name in `knownLabels` (a related record's field: `farValues.values` and `labels`). An app that hands no `onValuesWanted` sees no change.
|
|
94
|
+
- `viewkitjs/views/panels`: `drawsUnnamedValue(filter)`, whether `filterValueLabel` draws a filter's value by its stored key.
|
|
95
|
+
- The builder words that reason through your messages (`filterData.messages`, else your resolver), where it drew `VIEW_FIELDLESS_FILTER_REASON`'s English in every language. The constant stays, as the key's English.
|
|
96
|
+
- `toast` is an optional port. `useViews().ports.toast` is always there: ViewKit's Toast through `PortsHost`, or one that draws nothing.
|
|
97
|
+
- An app that hands its own `toast` and `confirm` (Atlas) sees no change. The portal hands a `toast`, no `confirm`, and doesn't spread `CONTROLS`, so it sees no change either: a row's Delete still asks in the browser's confirm, as before. An app's own toast that ignores `success`'s `{ undo }` shows the report without Undo.
|
|
98
|
+
- On a phone, a view's ⋯ in `CONTROLS.ViewsListBody` opens its menu as a step of the same sheet with Back, not a menu sheet on top (one sheet, never a sheet on top), and Rename, New view and the delete question opened from it turn the same sheet.
|
|
99
|
+
|
|
100
|
+
### Fixed
|
|
101
|
+
|
|
102
|
+
- `viewkitjs/views/controls`: the Picker's search box and rows, and the Clear all of a several-values Picker, no longer throw on open where the page or a test (Testing Library's `user-event`) made `HTMLElement.prototype.focus` a getter with no setter.
|
|
103
|
+
- `viewkitjs/views/controls`: one ⌘Z (Ctrl+Z) takes back a typed run in the Input's long text (`multiline`), where it took back one letter a press in Chromium when the box was handed a `value`: a place's street lines in `CONTROLS.PartsBody`, and every long-text Input your app draws. A value set from outside still draws in the box. The box's default value now stays what it was first drawn with, which only a form's reset reads: an app that resets an uncontrolled long-text Input by changing its `defaultValue` sets `value` instead.
|
|
104
|
+
- A view's menu in `CONTROLS.ViewsListBody`, and the ⋯ beside the search of `CONTROLS.Picker` on a phone, now say your app's words where they said ViewKit's English: the Close row, a sheet's ✕ and Back and a level's search, from `views.panels.close`, `views.panels.back` and `views.menus.search`. It showed where your app turns on the menu list's Close row. No new message key.
|
|
105
|
+
- `viewkitjs/views/controls`: in the Picker on a computer, ↓ and ↑ pass a greyed row by, as a greyed row promises. A bare ↓ in a list whose first row can't be picked (a sorted field in the sort's fields) lit that row, and Enter then picked nothing; it now lights the first row that can be picked. This changes every Picker an app draws, `CONTROLS`' included.
|
|
106
|
+
- A click on a date in the grid selects its cell even when the press comes in the same moment the pointer jumps onto the date. The date's full form, shown on a slow hover, could replace the date's element mid-press, and the browser then fired no click.
|
|
107
|
+
- `viewkitjs/views/controls`: on a phone, a rule's ⋯ and a group's ⋯ in `CONTROLS.FilterBody` turn the sheet to a step whose rows stand in its body, under its head, on the sheet's ground, drawn as the sheet's card rows like Customize's. They drew as a floating menu's rows, so the sheet lost its ground and the first row ran up under its head: Convert to group, and a group's only choice, Exclude matches, couldn't be seen or pressed. This changes the filter editor on a phone for every app that draws `CONTROLS.FilterBody`.
|
|
108
|
+
- `viewkitjs/postgres`: `searchIndexes` names a lookup read through a relation in `unserved`, with the `otherTable` reason, where it threw ("render: a fragment asks for a part its statement doesn't write") and printed nothing. The other searched fields' indexes and statistics print as they would without it.
|
|
109
|
+
- `viewkitjs/postgres`: a kind whose label is a name kept in parts (full, given, family) has its label written in functions Postgres can index, so the trigram index `searchIndexes` prints for a relation to that kind is one `CREATE INDEX` accepts, and a search through the relation reads the far table through it instead of whole for each word. The label reads as before: the full name, else the given and family names that aren't blank, joined by one space. A lookup of a name sorts by the same text, written the same way.
|
|
110
|
+
- The filter editor's field list names a place's parts ("Location · Country") in your words where you hand them as the panels' resolver (the ready toolbar's `resolve`, or the provider's messages), not only in `filterData.messages`.
|
|
111
|
+
- The ready toolbar's kit arrangement contains its own inline size: its width comes from where it stands, never from what its lines hold. Inside a holder sized from its content (an app's main beside a sidebar, a flex item with no `min-width: 0`) its row now gives way as the page narrows (words to icons, view tabs into "+N", the rest into ⋯) instead of holding its whole width and pushing the page sideways. An app that wrapped the ready toolbar in its own `contain: inline-size` box can drop it. The row arrangement (`arrangement: "row"`) is unchanged, and so is `ToolbarControl`, whose holder gives it its width.
|
|
112
|
+
- A money or phone cell edited through `CONTROLS.NumberBody` or `CONTROLS.TextBody` in a narrow column now grows past the cell, as ViewKit's own editor does, so the currency or the country and the whole figure typed show together; an empty amount keeps room to type in. A right-aligned column grows leftward. A cell wide enough opens exactly as before.
|
|
113
|
+
- In the Picker on a computer, a typed search lights its first match that can be picked, so Enter takes it: a greyed first match is passed over, and where nothing matches, Enter creates the typed value as a press on Create does.
|
|
114
|
+
|
|
8
115
|
## [0.28.0] — 2026-11-29
|
|
9
116
|
|
|
10
117
|
### Added
|
package/MIGRATION.md
CHANGED
|
@@ -252,7 +252,7 @@ import { CONTROLS } from "viewkitjs/views/controls";
|
|
|
252
252
|
It holds `Button`, `Tooltip`, `Popover`, `Sheet`, `Input`, `Checkbox` and `Menu`; the Text editor
|
|
253
253
|
(`TextBody`); the Picker (`Picker`, and `FieldsBody`, the sort's and the filter's field lists); the Date editor
|
|
254
254
|
(`DateBody`); the month the filter panel picks a day in (`Calendar`); the Compound editor (`PartsBody`) for
|
|
255
|
-
a name, a place and a range; the Number editor (`NumberBody`) for a number, money or a percent; the Values editor (`ValuesBody`) for several emails, phones, links or domains; the Links editor (`LinksBody`) for a relation whose field declares `links`, where an app that hands none edits it in the Picker; the views list (`ViewsListBody`), what the view switcher opens, where an app that hands none keeps ViewKit's own list; and the group editor (`GroupBody`), what Customize's Group opens, where an app that hands none keeps ViewKit's own group pages; and the Collapsible (`Collapse`), the fold a grid's group, a field's note and the selection sheet open in. **An app that spreads it hands no `Calendar`:** the filter panel's date, its date
|
|
255
|
+
a name, a place and a range; the Number editor (`NumberBody`) for a number, money or a percent; the Values editor (`ValuesBody`) for several emails, phones, links or domains; the Links editor (`LinksBody`) for a relation whose field declares `links`, where an app that hands none edits it in the Picker; the views list (`ViewsListBody`), what the view switcher opens, where an app that hands none keeps ViewKit's own list; and the group editor (`GroupBody`), what Customize's Group opens, where an app that hands none keeps ViewKit's own group pages; and the Collapsible (`Collapse`), the fold a grid's group, a field's note and the selection sheet open in; and `PortsHost`, which answers the `toast` and `confirm` ports an app leaves out with ViewKit's Toast and alert dialog. **An app that spreads it hands no `Calendar`:** the filter panel's date, its date
|
|
256
256
|
ranges and its custom time scope open ViewKit's own month. An app's own `Calendar` or `RangeCalendar` atom is
|
|
257
257
|
kept. You still hand `AppIcon` and `Markdown`, and `Command` unless you set `menus: "menu"`: the
|
|
258
258
|
grid's + Add column and a group's menu search still draw through it. `CONTROL_ATOMS` (0.23) does the same for the atoms
|
|
@@ -260,7 +260,7 @@ grid's + Add column and a group's menu search still draw through it. `CONTROL_AT
|
|
|
260
260
|
|
|
261
261
|
The controls' stylesheet is in `viewkitjs/views/styles.css` (step 9). An app that imports the controls'
|
|
262
262
|
stylesheets one by one instead imports `smooth.css` first, then each control's own, and now adds
|
|
263
|
-
`picker.css`, `text-editor.css`, `date-editor.css`, `compound-editor.css`, `flag.css`, `number-editor.css`, `values-editor.css`, `radio.css`, `links-editor.css`, `sort-editor.css`, `views-list.css`, `filter-editor.css`, `group-editor.css`, `pane.css` and `
|
|
263
|
+
`picker.css`, `text-editor.css`, `date-editor.css`, `compound-editor.css`, `flag.css`, `number-editor.css`, `values-editor.css`, `radio.css`, `links-editor.css`, `sort-editor.css`, `views-list.css`, `filter-editor.css`, `group-editor.css`, `pane.css`, `collapsible.css` and `toolbar-button.css`.
|
|
264
264
|
|
|
265
265
|
What an app meets when it moves from its own editors, or ViewKit's older ones, to these:
|
|
266
266
|
|
|
@@ -347,6 +347,9 @@ hydrates.
|
|
|
347
347
|
|
|
348
348
|
**Toolbar and panels**
|
|
349
349
|
|
|
350
|
+
- An app that spreads `CONTROLS` and hands no `confirm` asks a row's Delete in ViewKit's alert dialog, not the
|
|
351
|
+
browser's, and one that hands no `toast` sees ViewKit's reports in ViewKit's Toast. `toast` is optional now. An
|
|
352
|
+
app's own ports win.
|
|
350
353
|
- Inside `ToolbarSlotProvider`, the views part and Save draw through your `ToolbarButton` (views 0.10).
|
|
351
354
|
`slot={{ appFrame: false }}` keeps the old way.
|
|
352
355
|
- Drag announcements come from your messages and name a row by its label (views 0.10).
|
|
@@ -403,8 +406,8 @@ Every word the default controls draw is a message, so an app whose catalog words
|
|
|
403
406
|
from them. The one exception is Base UI's own: its combobox carries a hidden "Dismiss" button for screen
|
|
404
407
|
readers, which ViewKit can't word.
|
|
405
408
|
|
|
406
|
-
|
|
407
|
-
what the new editors say:
|
|
409
|
+
Five keys kept their names and changed their English: four so the older editors and a field's part rows
|
|
410
|
+
say what the new editors say, and Customize's save so every Customize's foot says Reset · Save for everyone:
|
|
408
411
|
|
|
409
412
|
| Key | Was | Is |
|
|
410
413
|
| --- | --- | --- |
|
|
@@ -412,6 +415,7 @@ what the new editors say:
|
|
|
412
415
|
| `views.editors.name-family` | Family name | Last name |
|
|
413
416
|
| `views.editors.place-country-search` | Search countries | Search for a country |
|
|
414
417
|
| `type.label` (fields 0.16) | Rich text, Percentage, User, Location | Long text, Percent, Member, Place |
|
|
418
|
+
| `views.panels.view-publish` | Set default for everyone | Save for everyone |
|
|
415
419
|
|
|
416
420
|
The keys added since views 0.9 and fields 0.15, with their English. A word in braces is a value ViewKit hands
|
|
417
421
|
the message.
|
|
@@ -545,6 +549,43 @@ The views list (`CONTROLS.ViewsListBody`; its other words are ViewKit's own list
|
|
|
545
549
|
| --- | --- |
|
|
546
550
|
| `views.panels.views-find` | Find a view |
|
|
547
551
|
|
|
552
|
+
The ports' own (`CONTROLS.PortsHost`):
|
|
553
|
+
|
|
554
|
+
| Key | English |
|
|
555
|
+
| --- | --- |
|
|
556
|
+
| `views.panels.toast-undo` | Undo |
|
|
557
|
+
| `views.panels.alert-failed` | That didn't go through. Nothing changed. |
|
|
558
|
+
| `views.panels.toast-region` | Notifications |
|
|
559
|
+
|
|
560
|
+
A view's menu and what it opens (`CONTROLS.ViewsListBody` where the axis hands `verbs`, and `useViewMenu`; its other words are keys worded already: `views.panels.copy-link`, `views.panels.view-reset`, `views.panels.view-save`, `views.panels.view-create`, `views.panels.layout`, `views.panels.back`):
|
|
561
|
+
|
|
562
|
+
| Key | English |
|
|
563
|
+
| --- | --- |
|
|
564
|
+
| `views.panels.view-rename` | Rename… |
|
|
565
|
+
| `views.panels.view-rename-short` | Rename |
|
|
566
|
+
| `views.panels.view-edit` | Edit view… |
|
|
567
|
+
| `views.panels.view-private-toggle` | Private view |
|
|
568
|
+
| `views.panels.view-save-everyone` | Save for everyone |
|
|
569
|
+
| `views.panels.view-save-new` | Save as new view… |
|
|
570
|
+
| `views.panels.view-copy-link-short` | Copy link |
|
|
571
|
+
| `views.panels.view-favorite` | Favorite |
|
|
572
|
+
| `views.panels.view-unfavorite` | Unfavorite |
|
|
573
|
+
| `views.panels.view-duplicate` | Duplicate view |
|
|
574
|
+
| `views.panels.view-duplicate-short` | Duplicate |
|
|
575
|
+
| `views.panels.view-delete` | Delete view |
|
|
576
|
+
| `views.panels.view-keep-one` | A list keeps one view |
|
|
577
|
+
| `views.panels.view-unsaved` | Unsaved changes |
|
|
578
|
+
| `views.panels.view-this` | This view |
|
|
579
|
+
| `views.panels.view-rename-title` | Rename view |
|
|
580
|
+
| `views.panels.view-name` | Name |
|
|
581
|
+
| `views.panels.view-create-action` | Create view |
|
|
582
|
+
| `views.panels.view-delete-title` | Delete {name}? |
|
|
583
|
+
| `views.panels.view-deleted` | {name} was deleted |
|
|
584
|
+
| `views.panels.view-copy-name` | Copy of {name} |
|
|
585
|
+
| `views.panels.view-delete-stays` | The {records} in it stay as they are. |
|
|
586
|
+
| `views.panels.view-delete-goes` | The view goes for everyone who uses it. |
|
|
587
|
+
| `views.panels.view-columns` | {layout} columns |
|
|
588
|
+
|
|
548
589
|
The filter editor (`CONTROLS.FilterBody`, `CONTROLS.FilterPartBody`; its other words are ViewKit's own editor's keys, worded already):
|
|
549
590
|
|
|
550
591
|
| Key | English |
|
|
@@ -574,6 +615,44 @@ The group editor (`CONTROLS.GroupBody`; its other words are ViewKit's own group
|
|
|
574
615
|
| `views.panels.list-move-hold` | Hold, then drag to move it |
|
|
575
616
|
| `views.panels.list-moved` | {label}, {at} of {of} |
|
|
576
617
|
|
|
618
|
+
Customize (`CONTROLS.CustomizeBody`; its other words are ViewKit's own Customize's, its group pages' and the sort editor's keys, worded already):
|
|
619
|
+
|
|
620
|
+
| Key | English |
|
|
621
|
+
| --- | --- |
|
|
622
|
+
| `views.panels.customize-list` | Customize |
|
|
623
|
+
| `views.panels.customize-shown` | Shown in the table |
|
|
624
|
+
| `views.panels.customize-shown-fields` | Shown |
|
|
625
|
+
| `views.panels.customize-hidden` | Hidden |
|
|
626
|
+
| `views.panels.customize-search` | Search columns |
|
|
627
|
+
| `views.panels.customize-find` | Find a column |
|
|
628
|
+
| `views.panels.customize-no-column` | No column is named “{words}” |
|
|
629
|
+
| `views.panels.customize-always-shown` | Always shown |
|
|
630
|
+
| `views.panels.customize-view-name` | The view's name |
|
|
631
|
+
| `views.panels.customize-layout-button` | Layout: {name} |
|
|
632
|
+
| `views.panels.customize-layout-settings` | {name} settings |
|
|
633
|
+
| `views.panels.customize-share` | Share the view |
|
|
634
|
+
|
|
635
|
+
The quick filters (`CONTROLS.QuickFiltersBody`; its other words are ViewKit's own quick filters' keys, worded already):
|
|
636
|
+
|
|
637
|
+
| Key | English |
|
|
638
|
+
| --- | --- |
|
|
639
|
+
| `views.panels.quick-clear-value` | Clear filter |
|
|
640
|
+
|
|
641
|
+
The bulk bar (`CONTROLS.SelectionBar`; its other words are ViewKit's own bar's keys, worded already: `views.selection.selected`, `views.selection.more`, `views.selection.actions`):
|
|
642
|
+
|
|
643
|
+
| Key | English |
|
|
644
|
+
| --- | --- |
|
|
645
|
+
| `views.selection.many` | {count} {one} or {count} {other} |
|
|
646
|
+
| `views.selection.bar-label` | {many} selected |
|
|
647
|
+
| `views.selection.delete-many` | Delete {many} |
|
|
648
|
+
| `views.selection.delete-ask` | Delete {many}? |
|
|
649
|
+
| `views.selection.noun-one` | row |
|
|
650
|
+
| `views.selection.noun-other` | rows |
|
|
651
|
+
| `views.selection.bar-count` | Selected |
|
|
652
|
+
| `views.selection.clear-the` | Clear the selection |
|
|
653
|
+
| `views.selection.delete-button` | Delete |
|
|
654
|
+
| `views.selection.cant-use` | Can't be used now |
|
|
655
|
+
|
|
577
656
|
Adding an option to a select:
|
|
578
657
|
|
|
579
658
|
| Key | English |
|
|
@@ -599,6 +678,7 @@ The panels: quick filters, set-aside rules, dragging:
|
|
|
599
678
|
| `views.panels.drag-dropped-over` | Draggable item {label} was dropped over droppable area {over} |
|
|
600
679
|
| `views.panels.drag-dropped` | Draggable item {label} was dropped. |
|
|
601
680
|
| `views.panels.drag-cancelled` | Dragging was cancelled. Draggable item {label} was dropped. |
|
|
681
|
+
| `views.panels.filter-fieldless` | Not a field of this list; a view cannot filter on it. |
|
|
602
682
|
|
|
603
683
|
`viewkitjs/fields` (the conventions' `messages`):
|
|
604
684
|
|
|
@@ -621,6 +701,7 @@ The panels: quick filters, set-aside rules, dragging:
|
|
|
621
701
|
| `date.not-a-date` | That isn't a date. Write a day and a month: 12/11 |
|
|
622
702
|
| `date.no-such-day` | {month} has no {day, as an ordinal}. Write a day and a month: 12/11 |
|
|
623
703
|
| `field.must-tick` | This box must be ticked |
|
|
704
|
+
| `field.label` | A field a lookup's or a rollup's note names, by `{ entity, field, label }`: its label |
|
|
624
705
|
|
|
625
706
|
### Check you're done with this part
|
|
626
707
|
|
package/fields/dist/derived.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ export declare function scalarOf(field: FieldDef, value: unknown): unknown;
|
|
|
17
17
|
/** The type a consumer dispatches on — the result's for a rollup or a formula,
|
|
18
18
|
* the far field's for a lookup (text while unresolved). */
|
|
19
19
|
export declare function valueTypeOf(field: FieldDef): ValueType;
|
|
20
|
-
/** The sentence a lock shows for a derived field — data-model truth in words.
|
|
20
|
+
/** The sentence a lock shows for a derived field — data-model truth in words. Each field it names is worded by its
|
|
21
|
+
* label, through the host's `field.label`, where the index named it (`names`); else by its key, as before. */
|
|
21
22
|
export declare function derivedReason(field: DerivedDef, cv?: FieldConventions): string;
|
|
22
23
|
/**
|
|
23
24
|
* WHY a field refuses an edit, in the user's words — the lock glyph's hover and
|
package/fields/dist/derived.js
CHANGED
|
@@ -27,16 +27,22 @@ function humanizeKey(key) {
|
|
|
27
27
|
}
|
|
28
28
|
export function derivedReason(field, cv = DEFAULT_CONVENTIONS) {
|
|
29
29
|
cv = conventionsOr(cv);
|
|
30
|
+
const word = (named, key) => named ? cv.messages({ key: "field.label", values: named }) : humanizeKey(key);
|
|
30
31
|
if (field.type === "lookup") {
|
|
31
32
|
return cv.messages({
|
|
32
33
|
key: "derived.lookup",
|
|
33
|
-
values: { via:
|
|
34
|
+
values: { via: word(field.names?.via, field.via), field: word(field.names?.field, field.field) },
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
if (field.type === "formula") {
|
|
37
38
|
return cv.messages({ key: "derived.formula", values: { from: field.from } });
|
|
38
39
|
}
|
|
39
|
-
const
|
|
40
|
+
const hops = field.names?.over;
|
|
41
|
+
const over = hops
|
|
42
|
+
? hops.map((hop) => cv.messages({ key: "field.label", values: hop })).join(" → ")
|
|
43
|
+
: typeof field.over === "string"
|
|
44
|
+
? field.over
|
|
45
|
+
: field.over.join(" → ");
|
|
40
46
|
if (field.fn === "count" || field.fn === "countDistinct") {
|
|
41
47
|
return cv.messages({ key: "derived.count", values: { over } });
|
|
42
48
|
}
|
|
@@ -46,7 +52,7 @@ export function derivedReason(field, cv = DEFAULT_CONVENTIONS) {
|
|
|
46
52
|
return cv.messages({ key: "derived.none", values: { over } });
|
|
47
53
|
return cv.messages({
|
|
48
54
|
key: "derived.rollup",
|
|
49
|
-
values: { fn: field.fn, of:
|
|
55
|
+
values: { fn: field.fn, of: word(field.names?.of, field.of ?? ""), over },
|
|
50
56
|
});
|
|
51
57
|
}
|
|
52
58
|
export function lockReason(field, cv = DEFAULT_CONVENTIONS) {
|
package/fields/dist/entities.js
CHANGED
|
@@ -458,6 +458,38 @@ function withContributions(raw, contributions) {
|
|
|
458
458
|
raw[c.entity] = { entity: base.entity, identity: base.identity, fields };
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
+
function namedField(entity, key) {
|
|
462
|
+
const field = key === undefined ? undefined : ownField(entity?.fields, key);
|
|
463
|
+
return entity && field ? Object.freeze({ entity: entity.entity, field: key, label: field.label }) : undefined;
|
|
464
|
+
}
|
|
465
|
+
function derivedNames(index, near, field) {
|
|
466
|
+
if (field.type === "lookup") {
|
|
467
|
+
const via = namedField(near, field.via);
|
|
468
|
+
const far = namedField(farEntityOf(index, near, field.via), field.field);
|
|
469
|
+
return { ...(via ? { via } : {}), ...(far ? { field: far } : {}) };
|
|
470
|
+
}
|
|
471
|
+
const hops = typeof field.over === "string" ? [field.over] : field.over;
|
|
472
|
+
const over = [];
|
|
473
|
+
let at = near;
|
|
474
|
+
for (const hop of hops) {
|
|
475
|
+
const named = namedField(at, hop);
|
|
476
|
+
if (!named)
|
|
477
|
+
break;
|
|
478
|
+
over.push(named);
|
|
479
|
+
at = farEntityOf(index, at, hop);
|
|
480
|
+
}
|
|
481
|
+
const first = ownField(near.fields, hops[0]);
|
|
482
|
+
const severalKinds = first?.type === "relation" && "kinds" in first.relation;
|
|
483
|
+
const of = severalKinds ? undefined : namedField(at, field.of);
|
|
484
|
+
return {
|
|
485
|
+
...(over.length === hops.length ? { over: Object.freeze(over) } : {}),
|
|
486
|
+
...(of && over.length === hops.length ? { of } : {}),
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
function withNames(field, names) {
|
|
490
|
+
const { names: _written, ...own } = field;
|
|
491
|
+
return Object.freeze(Object.keys(names).length ? { ...own, names: Object.freeze(names) } : own);
|
|
492
|
+
}
|
|
461
493
|
export function defineIndex(entities, contributions = []) {
|
|
462
494
|
const raw = {};
|
|
463
495
|
for (const e of entities) {
|
|
@@ -474,7 +506,13 @@ export function defineIndex(entities, contributions = []) {
|
|
|
474
506
|
const ready = done.get(address);
|
|
475
507
|
if (ready)
|
|
476
508
|
return ready;
|
|
477
|
-
const
|
|
509
|
+
const near = ownField(raw, kind);
|
|
510
|
+
const field = ownField(near.fields, key);
|
|
511
|
+
if (field.type === "rollup") {
|
|
512
|
+
const out = withNames(field, derivedNames(raw, near, field));
|
|
513
|
+
done.set(address, out);
|
|
514
|
+
return out;
|
|
515
|
+
}
|
|
478
516
|
if (field.type !== "lookup") {
|
|
479
517
|
done.set(address, field);
|
|
480
518
|
return field;
|
|
@@ -483,7 +521,7 @@ export function defineIndex(entities, contributions = []) {
|
|
|
483
521
|
throw new FieldDefinitionError(address, "a lookup cycle — follow the chain and break it");
|
|
484
522
|
}
|
|
485
523
|
resolving.add(address);
|
|
486
|
-
const far = farEntityOf(raw,
|
|
524
|
+
const far = farEntityOf(raw, near, field.via);
|
|
487
525
|
const target = far ? resolve(far.entity, field.field) : undefined;
|
|
488
526
|
resolving.delete(address);
|
|
489
527
|
if (target) {
|
|
@@ -496,7 +534,7 @@ export function defineIndex(entities, contributions = []) {
|
|
|
496
534
|
}
|
|
497
535
|
}
|
|
498
536
|
const { target: _written, ...own } = field;
|
|
499
|
-
const out =
|
|
537
|
+
const out = withNames({ ...own, ...(target ? { target } : {}) }, derivedNames(raw, near, field));
|
|
500
538
|
done.set(address, out);
|
|
501
539
|
return out;
|
|
502
540
|
};
|
package/fields/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { checkFormula, evaluateFormula, FORMULA_FUNCTIONS, FORMULA_MAX_NODES, ty
|
|
|
11
11
|
export { ACTOR_TYPES, actorKey, actorLabel, actorOfKey, isActorValue } from "./actor.js";
|
|
12
12
|
export { markdownFirstLine, markdownPlainText, normalizeMarkdown } from "./markdown.js";
|
|
13
13
|
export { applyNormalize, NORMALIZE_STEPS, normalizerFor, type NormalizeStep } from "./normalize.js";
|
|
14
|
-
export { isEmptyRange, isRangeValue, presetOf, rangeDecimals, RANGE_PARTS, rangeOverlaps, rangeText, sameRange, withRangeEnd, type RangePart, } from "./range.js";
|
|
14
|
+
export { exactPresetOf, isEmptyRange, isRangeValue, presetOf, rangeDecimals, RANGE_PARTS, rangeOverlaps, rangeShownText, rangeText, sameRange, withRangeEnd, type RangePart, } from "./range.js";
|
|
15
15
|
export { LOCATION_PARTS, locationLines, locationPart, locationShort, locationText, withLocationPart, type LocationPart, } from "./location.js";
|
|
16
16
|
export { placeFormat, writesLatin, type CityWord, type PlaceFormat, type PlaceLineItem, type PostalWord, type RegionWord, } from "./places/format.js";
|
|
17
17
|
export { COUNTRY_CODES, countryCodeOf, countryName, isCountryCode } from "./countries.js";
|
package/fields/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export { checkFormula, evaluateFormula, FORMULA_FUNCTIONS, FORMULA_MAX_NODES, }
|
|
|
8
8
|
export { ACTOR_TYPES, actorKey, actorLabel, actorOfKey, isActorValue } from "./actor.js";
|
|
9
9
|
export { markdownFirstLine, markdownPlainText, normalizeMarkdown } from "./markdown.js";
|
|
10
10
|
export { applyNormalize, NORMALIZE_STEPS, normalizerFor } from "./normalize.js";
|
|
11
|
-
export { isEmptyRange, isRangeValue, presetOf, rangeDecimals, RANGE_PARTS, rangeOverlaps, rangeText, sameRange, withRangeEnd, } from "./range.js";
|
|
11
|
+
export { exactPresetOf, isEmptyRange, isRangeValue, presetOf, rangeDecimals, RANGE_PARTS, rangeOverlaps, rangeShownText, rangeText, sameRange, withRangeEnd, } from "./range.js";
|
|
12
12
|
export { LOCATION_PARTS, locationLines, locationPart, locationShort, locationText, withLocationPart, } from "./location.js";
|
|
13
13
|
export { placeFormat, writesLatin, } from "./places/format.js";
|
|
14
14
|
export { COUNTRY_CODES, countryCodeOf, countryName, isCountryCode } from "./countries.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActorType, CreatableFieldType, FieldType, RollupFn } from "./types.js";
|
|
1
|
+
import type { ActorType, CreatableFieldType, FieldType, NamedField, RollupFn } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* A typed message plus the values its host may interpolate. EVERY sentence the
|
|
4
4
|
* library writes is one of these — a host that translates them translates the
|
|
@@ -54,6 +54,12 @@ export type FieldMessage = {
|
|
|
54
54
|
values: {
|
|
55
55
|
over: string;
|
|
56
56
|
};
|
|
57
|
+
}
|
|
58
|
+
/** A field a worked-out field's note names (its relation, its far field), before it goes into the note: where it
|
|
59
|
+
* lives and its label. The default is the label; a host whose labels are its own catalog's keys words them here. */
|
|
60
|
+
| {
|
|
61
|
+
key: "field.label";
|
|
62
|
+
values: NamedField;
|
|
57
63
|
} | {
|
|
58
64
|
key: "settlement.requested";
|
|
59
65
|
values: {
|
|
@@ -431,6 +437,6 @@ export type FieldMessage = {
|
|
|
431
437
|
export type FieldMessageKey = FieldMessage["key"];
|
|
432
438
|
export type FieldMessageResolver = (message: FieldMessage) => string;
|
|
433
439
|
/** Every key a host words, once: a host tests that its catalog holds each (`VIEWS_MESSAGE_KEYS` is the views part's). */
|
|
434
|
-
export declare const FIELD_MESSAGE_KEYS: readonly ["lock.system", "lock.provider", "lock.create", "lock.never", "derived.formula", "derived.lookup", "derived.count", "derived.rollup", "derived.exists", "derived.none", "settlement.requested", "provider.name", "type.label", "setting.label", "setting.word", "field.cannot-empty", "field.must-tick", "field.cannot-edit", "field.cannot-save", "field.retry-save", "field.stored-value-required", "field.history-unavailable", "field.restore-refused", "field.already-saving", "field.unavailable", "field.derived", "editor.search", "editor.searching", "editor.search-failed", "editor.loading-more", "editor.nothing-matches", "editor.use-value", "relation.none", "relation.lead", "relation.make-lead", "date.placeholder", "date.label", "date.today", "date.tomorrow", "date.next-monday", "date.in-a-week", "date.clear", "time.placeholder", "time.label", "date.type", "date.none", "date.add-time", "date.last-month", "date.next-month", "date.day", "date.month", "date.year", "date.months", "date.years", "time.hour", "time.minute", "date.not-a-date", "date.no-such-day", "chips.add-placeholder", "chips.everything-picked", "chips.add", "validation.invalid", "validation.text", "validation.number", "validation.integer", "validation.date", "validation.datetime", "validation.boolean", "validation.option", "validation.options-list", "validation.values-list", "validation.relation", "validation.url", "validation.domain", "validation.email", "validation.email-list", "validation.unit", "validation.phone", "validation.phone-country", "validation.phone-short", "validation.phone-long", "validation.phone-whole", "validation.user", "validation.location", "validation.country-code", "validation.region-code", "validation.name", "validation.actor", "actor.type", "validation.range-order", "range.up-to", "range.and-up", "validation.pattern", "validation.tag-empty", "validation.max-length", "validation.min-length", "validation.min", "validation.max", "validation.greater-than", "validation.less-than", "validation.decimals", "validation.max-items", "validation.max-addresses", "validation.one-main", "validation.duplicate-value", "save.failed", "save.refresh-failed", "filter.any", "filter.operator", "filter.text-summary", "filter.date-summary", "filter.relative", "filter.relative-direction", "filter.relative-unit", "group.none", "group.relative", "group.due", "group.week-of", "time.never", "time.future", "time.ago", "platform.website"];
|
|
440
|
+
export declare const FIELD_MESSAGE_KEYS: readonly ["lock.system", "lock.provider", "lock.create", "lock.never", "derived.formula", "derived.lookup", "derived.count", "derived.rollup", "derived.exists", "derived.none", "field.label", "settlement.requested", "provider.name", "type.label", "setting.label", "setting.word", "field.cannot-empty", "field.must-tick", "field.cannot-edit", "field.cannot-save", "field.retry-save", "field.stored-value-required", "field.history-unavailable", "field.restore-refused", "field.already-saving", "field.unavailable", "field.derived", "editor.search", "editor.searching", "editor.search-failed", "editor.loading-more", "editor.nothing-matches", "editor.use-value", "relation.none", "relation.lead", "relation.make-lead", "date.placeholder", "date.label", "date.today", "date.tomorrow", "date.next-monday", "date.in-a-week", "date.clear", "time.placeholder", "time.label", "date.type", "date.none", "date.add-time", "date.last-month", "date.next-month", "date.day", "date.month", "date.year", "date.months", "date.years", "time.hour", "time.minute", "date.not-a-date", "date.no-such-day", "chips.add-placeholder", "chips.everything-picked", "chips.add", "validation.invalid", "validation.text", "validation.number", "validation.integer", "validation.date", "validation.datetime", "validation.boolean", "validation.option", "validation.options-list", "validation.values-list", "validation.relation", "validation.url", "validation.domain", "validation.email", "validation.email-list", "validation.unit", "validation.phone", "validation.phone-country", "validation.phone-short", "validation.phone-long", "validation.phone-whole", "validation.user", "validation.location", "validation.country-code", "validation.region-code", "validation.name", "validation.actor", "actor.type", "validation.range-order", "range.up-to", "range.and-up", "validation.pattern", "validation.tag-empty", "validation.max-length", "validation.min-length", "validation.min", "validation.max", "validation.greater-than", "validation.less-than", "validation.decimals", "validation.max-items", "validation.max-addresses", "validation.one-main", "validation.duplicate-value", "save.failed", "save.refresh-failed", "filter.any", "filter.operator", "filter.text-summary", "filter.date-summary", "filter.relative", "filter.relative-direction", "filter.relative-unit", "group.none", "group.relative", "group.due", "group.week-of", "time.never", "time.future", "time.ago", "platform.website"];
|
|
435
441
|
/** Neutral English fallback for hosts that do not provide localization. */
|
|
436
442
|
export declare const resolveFieldMessage: FieldMessageResolver;
|
package/fields/dist/messages.js
CHANGED
|
@@ -9,6 +9,7 @@ export const FIELD_MESSAGE_KEYS = [
|
|
|
9
9
|
"derived.rollup",
|
|
10
10
|
"derived.exists",
|
|
11
11
|
"derived.none",
|
|
12
|
+
"field.label",
|
|
12
13
|
"settlement.requested",
|
|
13
14
|
"provider.name",
|
|
14
15
|
"type.label",
|
|
@@ -304,6 +305,8 @@ export const resolveFieldMessage = (message) => {
|
|
|
304
305
|
return `Whether any of ${message.values.over}`;
|
|
305
306
|
case "derived.none":
|
|
306
307
|
return `Whether none of ${message.values.over}`;
|
|
308
|
+
case "field.label":
|
|
309
|
+
return message.values.label;
|
|
307
310
|
case "settlement.requested":
|
|
308
311
|
return `Saved here — waiting for ${message.values.providerName ?? "the provider"} to confirm`;
|
|
309
312
|
case "provider.name":
|
package/fields/dist/range.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export declare function rangeOverlaps(value: RangeValue, low: number | null, hig
|
|
|
14
14
|
* end; a preset picked in the filter panel matches any part between its ends
|
|
15
15
|
* instead, so 5–20 groups under 1–10 and is also found by the 11–50 pick. */
|
|
16
16
|
export declare function presetOf(field: FieldDefOf<"range">, value: unknown): RangePreset | undefined;
|
|
17
|
+
/** The preset whose two ends are exactly the value's: the band a value IS, not the one it is grouped under
|
|
18
|
+
* (`presetOf`, by its low end). None for an empty value or one off every band. */
|
|
19
|
+
export declare function exactPresetOf(field: FieldDefOf<"range">, value: unknown): RangePreset | undefined;
|
|
17
20
|
/** The most fraction digits an end is edited and drawn with: none for an
|
|
18
21
|
* integer range, else the field's `format.decimals`, else the number editor's
|
|
19
22
|
* own default (2; a percent 0). An editor rounds to it and a cell shows up to it. */
|
|
@@ -21,5 +24,8 @@ export declare function rangeDecimals(field: FieldDefOf<"range">): number;
|
|
|
21
24
|
/** The value written out: "11–50", "10,001+", "up to 50", "7", "2.5–10". Up to
|
|
22
25
|
* `rangeDecimals` fraction digits; exactly `format.decimals` when the field states it. */
|
|
23
26
|
export declare function rangeText(field: FieldDefOf<"range">, value: unknown, cv?: FieldConventions): string;
|
|
27
|
+
/** The value as a cell shows it: its band's name when its ends are exactly a preset's ("Small"), else its numbers
|
|
28
|
+
* (`rangeText`). A copy writes the same, and a paste reads a band's name back. */
|
|
29
|
+
export declare function rangeShownText(field: FieldDefOf<"range">, value: unknown, cv?: FieldConventions): string;
|
|
24
30
|
/** A range with one end replaced; the other end is kept. Anything that is not a range is read as an empty one. */
|
|
25
31
|
export declare function withRangeEnd(value: unknown, end: RangePart, n: number | null): RangeValue;
|
package/fields/dist/range.js
CHANGED
|
@@ -24,6 +24,11 @@ export function presetOf(field, value) {
|
|
|
24
24
|
const at = value.low ?? value.high;
|
|
25
25
|
return field.presets?.find((p) => (p.low === null || at >= p.low) && (p.high === null || at <= p.high));
|
|
26
26
|
}
|
|
27
|
+
export function exactPresetOf(field, value) {
|
|
28
|
+
if (!isRangeValue(value) || isEmptyRange(value))
|
|
29
|
+
return undefined;
|
|
30
|
+
return field.presets?.find((p) => p.low === value.low && p.high === value.high);
|
|
31
|
+
}
|
|
27
32
|
export function rangeDecimals(field) {
|
|
28
33
|
if (field.validation?.integer)
|
|
29
34
|
return 0;
|
|
@@ -57,6 +62,9 @@ export function rangeText(field, value, cv = DEFAULT_CONVENTIONS) {
|
|
|
57
62
|
return cv.messages({ key: "range.and-up", values: { value: n(low) } });
|
|
58
63
|
return cv.messages({ key: "range.up-to", values: { value: n(high) } });
|
|
59
64
|
}
|
|
65
|
+
export function rangeShownText(field, value, cv = DEFAULT_CONVENTIONS) {
|
|
66
|
+
return exactPresetOf(field, value)?.label ?? rangeText(field, value, cv);
|
|
67
|
+
}
|
|
60
68
|
export function withRangeEnd(value, end, n) {
|
|
61
69
|
const before = isRangeValue(value) ? value : { low: null, high: null };
|
|
62
70
|
return { ...before, [end]: n };
|
package/fields/dist/registry.js
CHANGED
|
@@ -681,6 +681,8 @@ export function checkFieldSpec(key, spec, all = {}, context = {}) {
|
|
|
681
681
|
fail(`preset "${p.key}" has its low end above its high end`);
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
+
if ((f.type === "lookup" || f.type === "rollup") && "names" in f && f.names !== undefined)
|
|
685
|
+
fail("the fields a note names are filled in by defineIndex(), never written — remove names");
|
|
684
686
|
if (f.type === "lookup") {
|
|
685
687
|
if ("target" in f && f.target !== undefined)
|
|
686
688
|
fail("a lookup's far definition is filled in by defineIndex(), never written — remove target");
|
|
@@ -1074,10 +1076,18 @@ const fieldSpecSchema = z.discriminatedUnion("type", [
|
|
|
1074
1076
|
const fallback = DEFAULTS[own.type.value];
|
|
1075
1077
|
return z.strictObject({ ...BASE, ...own, ...(fallback ? { default: fallback.optional() } : {}) });
|
|
1076
1078
|
}),
|
|
1077
|
-
z.strictObject({
|
|
1079
|
+
z.strictObject({
|
|
1080
|
+
...BASE,
|
|
1081
|
+
type: z.literal("lookup"),
|
|
1082
|
+
via: ruled,
|
|
1083
|
+
field: ruled,
|
|
1084
|
+
target: z.unknown().optional(),
|
|
1085
|
+
names: z.unknown().optional(),
|
|
1086
|
+
}),
|
|
1078
1087
|
z.strictObject({
|
|
1079
1088
|
...BASE,
|
|
1080
1089
|
type: z.literal("rollup"),
|
|
1090
|
+
names: z.unknown().optional(),
|
|
1081
1091
|
over: z.union([text, z.array(ruled)]),
|
|
1082
1092
|
of: text.optional(),
|
|
1083
1093
|
fn: word,
|