viewkitjs 0.29.0 → 0.30.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 +111 -0
- package/MIGRATION.md +97 -8
- package/package.json +1 -1
- package/views/dist/cells/cell-format.d.ts +2 -2
- package/views/dist/cells/cell-values.js +0 -2
- package/views/dist/contract.d.ts +15 -18
- package/views/dist/contract.js +13 -27
- package/views/dist/controls/controls.d.ts +2 -4
- package/views/dist/controls/controls.js +2 -2
- package/views/dist/controls/customize/customize.d.ts +51 -0
- package/views/dist/controls/customize/customize.js +128 -23
- package/views/dist/controls/customize/map-customize-body.d.ts +0 -3
- package/views/dist/controls/customize/map-customize-body.js +46 -11
- package/views/dist/controls/customize/map-ranges.d.ts +23 -0
- package/views/dist/controls/customize/map-ranges.js +41 -0
- package/views/dist/controls/customize/rules.d.ts +17 -1
- package/views/dist/controls/customize/rules.js +2 -0
- package/views/dist/controls/customize/words.d.ts +7 -0
- package/views/dist/controls/customize/words.js +5 -0
- package/views/dist/controls/customize.css +3 -0
- package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
- package/views/dist/controls/filter-editor/filter-editor.js +1 -0
- package/views/dist/controls/filter-editor/rules.d.ts +1 -2
- package/views/dist/controls/index.d.ts +8 -8
- package/views/dist/controls/index.js +8 -8
- package/views/dist/controls/menu-list/menu-list.d.ts +16 -1
- package/views/dist/controls/menu-list/menu-list.js +26 -8
- package/views/dist/controls/menu-list.css +8 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +1 -1
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +6 -3
- package/views/dist/controls/sheet/map-sheet.js +1 -1
- package/views/dist/controls/text-editor/map-text-body.d.ts +1 -1
- package/views/dist/controls/text-editor/map-text-body.js +2 -2
- package/views/dist/controls/text-editor/text-editor.d.ts +3 -0
- package/views/dist/controls/text-editor/text-editor.js +16 -2
- package/views/dist/controls/text-editor.css +11 -0
- package/views/dist/controls/values-editor/values.js +6 -2
- package/views/dist/display/options.d.ts +1 -1
- package/views/dist/display/rich-text.js +0 -1
- package/views/dist/editors/ChipsEditor.d.ts +4 -5
- package/views/dist/editors/ChipsEditor.js +12 -78
- package/views/dist/editors/DateEditor.d.ts +12 -16
- package/views/dist/editors/DateEditor.js +40 -191
- package/views/dist/editors/EditorPanel.d.ts +2 -6
- package/views/dist/editors/EditorPanel.js +2 -2
- package/views/dist/editors/LocationEditor.d.ts +11 -19
- package/views/dist/editors/LocationEditor.js +19 -211
- package/views/dist/editors/NameEditor.d.ts +8 -16
- package/views/dist/editors/NameEditor.js +11 -100
- package/views/dist/editors/NumberEditor.d.ts +14 -21
- package/views/dist/editors/NumberEditor.js +22 -49
- package/views/dist/editors/RangeEditor.d.ts +9 -33
- package/views/dist/editors/RangeEditor.js +12 -97
- package/views/dist/editors/RelationEditor.d.ts +6 -9
- package/views/dist/editors/RelationEditor.js +11 -30
- package/views/dist/editors/RelationSetEditor.d.ts +13 -24
- package/views/dist/editors/RelationSetEditor.js +33 -101
- package/views/dist/editors/SelectEditor.d.ts +15 -17
- package/views/dist/editors/SelectEditor.js +15 -94
- package/views/dist/editors/TextEditor.d.ts +23 -26
- package/views/dist/editors/TextEditor.js +11 -48
- package/views/dist/editors/ValueListEditor.d.ts +14 -23
- package/views/dist/editors/ValueListEditor.js +16 -202
- package/views/dist/editors/body-panel.d.ts +13 -7
- package/views/dist/editors/body-panel.js +3 -7
- package/views/dist/editors/edit-cores.d.ts +15 -15
- package/views/dist/editors/edit-cores.js +14 -14
- package/views/dist/editors/number-body.d.ts +1 -1
- package/views/dist/editors/number-step.d.ts +0 -34
- package/views/dist/editors/number-step.js +0 -37
- package/views/dist/editors/option-add-flow.d.ts +1 -13
- package/views/dist/editors/option-add-flow.js +0 -22
- package/views/dist/editors/relation-links-body.d.ts +2 -3
- package/views/dist/editors/relation-picker.d.ts +13 -3
- package/views/dist/editors/relation-source.d.ts +0 -22
- package/views/dist/editors/relation-source.js +0 -21
- package/views/dist/field-row/FieldRow.js +5 -6
- package/views/dist/field-row/FieldRowLane.js +0 -1
- package/views/dist/field-row/editors/RowChipsEditor.js +2 -2
- package/views/dist/field-row/editors/RowDateEditor.d.ts +2 -2
- package/views/dist/field-row/editors/RowDateEditor.js +2 -2
- package/views/dist/field-row/editors/RowNameEditor.d.ts +2 -5
- package/views/dist/field-row/editors/RowNameEditor.js +7 -12
- package/views/dist/field-row/editors/RowNumberEditor.d.ts +1 -1
- package/views/dist/field-row/editors/RowNumberEditor.js +4 -4
- package/views/dist/field-row/editors/RowPlaceEditor.js +3 -3
- package/views/dist/field-row/editors/RowRangeEditor.d.ts +2 -5
- package/views/dist/field-row/editors/RowRangeEditor.js +7 -14
- package/views/dist/field-row/editors/RowRelationEditor.js +3 -3
- package/views/dist/field-row/editors/RowSelectEditor.js +2 -2
- package/views/dist/field-row/editors/RowTextEditor.d.ts +1 -1
- package/views/dist/field-row/editors/RowTextEditor.js +3 -4
- package/views/dist/field-row/editors/RowValueListEditor.js +5 -5
- package/views/dist/field-row/field-row-button.d.ts +6 -9
- package/views/dist/field-row/field-row-button.js +1 -6
- package/views/dist/field-row/field-row-checkbox.d.ts +1 -1
- package/views/dist/field-row/row-target.d.ts +0 -7
- package/views/dist/field-row/row-target.js +0 -2
- package/views/dist/grid/chrome/GridAddColumn.d.ts +2 -1
- package/views/dist/grid/chrome/GridAddColumn.js +8 -66
- package/views/dist/grid/chrome/GridAggregateMenu.d.ts +5 -7
- package/views/dist/grid/chrome/GridAggregateMenu.js +20 -39
- package/views/dist/grid/chrome/GridCellEditors.d.ts +2 -2
- package/views/dist/grid/chrome/GridCellEditors.js +12 -12
- package/views/dist/grid/chrome/GridChipsEditor.js +3 -3
- package/views/dist/grid/chrome/GridColumnMenu.d.ts +11 -12
- package/views/dist/grid/chrome/GridColumnMenu.js +32 -93
- package/views/dist/grid/chrome/GridDateEditor.d.ts +6 -6
- package/views/dist/grid/chrome/GridDateEditor.js +3 -3
- package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -6
- package/views/dist/grid/chrome/GridGroupMenu.js +21 -62
- package/views/dist/grid/chrome/GridHeader.d.ts +1 -2
- package/views/dist/grid/chrome/GridHeader.js +2 -2
- package/views/dist/grid/chrome/GridLongTextEditor.d.ts +17 -38
- package/views/dist/grid/chrome/GridLongTextEditor.js +6 -7
- package/views/dist/grid/chrome/GridNameEditor.js +4 -4
- package/views/dist/grid/chrome/GridNumberEditor.d.ts +4 -5
- package/views/dist/grid/chrome/GridNumberEditor.js +3 -4
- package/views/dist/grid/chrome/GridPlaceEditor.d.ts +2 -5
- package/views/dist/grid/chrome/GridPlaceEditor.js +5 -5
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +6 -12
- package/views/dist/grid/chrome/GridRangeEditor.js +7 -15
- package/views/dist/grid/chrome/GridRelationEditor.js +5 -5
- package/views/dist/grid/chrome/GridRow.js +0 -3
- package/views/dist/grid/chrome/GridRowActions.d.ts +1 -1
- package/views/dist/grid/chrome/GridRowActions.js +0 -5
- package/views/dist/grid/chrome/GridRowCells.js +9 -6
- package/views/dist/grid/chrome/GridSelectEditor.js +3 -3
- package/views/dist/grid/chrome/GridStructure.js +0 -1
- package/views/dist/grid/chrome/GridTable.js +1 -1
- package/views/dist/grid/chrome/GridTextEditor.d.ts +5 -7
- package/views/dist/grid/chrome/GridTextEditor.js +4 -17
- package/views/dist/grid/chrome/GridValueListEditor.js +4 -4
- package/views/dist/grid/chrome/grid-body-place.d.ts +2 -3
- package/views/dist/grid/chrome/grid-body-place.js +4 -8
- package/views/dist/grid/chrome/grid-button.d.ts +7 -10
- package/views/dist/grid/chrome/grid-button.js +1 -6
- package/views/dist/grid/chrome/grid-cell-classes.js +1 -1
- package/views/dist/grid/chrome/grid-column-menu-items.d.ts +4 -4
- package/views/dist/grid/chrome/grid-column-menu-items.js +10 -6
- package/views/dist/grid/chrome/grid-group-menu-parts.d.ts +5 -9
- package/views/dist/grid/chrome/grid-group-menu-parts.js +1 -3
- package/views/dist/grid/chrome/grid-hover.js +0 -1
- package/views/dist/grid/chrome/grid-menu-focus.d.ts +7 -31
- package/views/dist/grid/chrome/grid-menu-focus.js +7 -47
- package/views/dist/grid/chrome/grid-styles.d.ts +0 -3
- package/views/dist/grid/chrome/grid-styles.js +0 -1
- package/views/dist/grid/chrome/grid-table-props.d.ts +6 -10
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -4
- package/views/dist/grid/core/editing-controller.d.ts +2 -1
- package/views/dist/grid/core/editing-controller.js +10 -2
- package/views/dist/grid/core/refusal-sentence.d.ts +3 -0
- package/views/dist/grid/core/refusal-sentence.js +2 -2
- package/views/dist/grid/core/write-states.d.ts +3 -1
- package/views/dist/grid/core/write-states.js +6 -2
- package/views/dist/grid/grid.css +1 -1
- package/views/dist/model/body-frame.d.ts +0 -32
- package/views/dist/model/body-frame.js +1 -15
- package/views/dist/model/column-inspect.d.ts +5 -5
- package/views/dist/model/column-inspect.js +2 -2
- package/views/dist/panels/customize-body.d.ts +1 -10
- package/views/dist/panels/customize-body.js +0 -3
- package/views/dist/panels/filter/MenuSelect.js +0 -5
- package/views/dist/panels/filter/RangeFilterBody.js +0 -1
- package/views/dist/panels/filter/details.d.ts +1 -5
- package/views/dist/panels/filter/details.js +0 -13
- package/views/dist/panels/filter/filter-list.d.ts +0 -1
- package/views/dist/panels/filter/filter-list.js +1 -1
- package/views/dist/panels/panel-button.d.ts +10 -12
- package/views/dist/panels/panel-button.js +1 -6
- package/views/dist/panels/react/chrome.d.ts +0 -17
- package/views/dist/panels/react/chrome.js +0 -8
- package/views/dist/panels/react/customize-body.d.ts +9 -12
- package/views/dist/panels/react/customize-body.js +57 -11
- package/views/dist/panels/react/customize.d.ts +9 -12
- package/views/dist/panels/react/customize.js +3 -112
- package/views/dist/panels/react/filter/FilterEditor.d.ts +4 -18
- package/views/dist/panels/react/filter/FilterEditor.js +6 -330
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +1 -1
- package/views/dist/panels/react/filter/FilterFieldList.js +27 -59
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +1 -11
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +8 -144
- package/views/dist/panels/react/filter/editor-ctx.d.ts +1 -33
- package/views/dist/panels/react/filter/editor-ctx.js +5 -33
- package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -6
- package/views/dist/panels/react/filter/filter-part-body.js +0 -5
- package/views/dist/panels/react/filter/rule-writes.d.ts +1 -26
- package/views/dist/panels/react/filter/rule-writes.js +4 -95
- package/views/dist/panels/react/order-details.d.ts +1 -26
- package/views/dist/panels/react/order-details.js +3 -69
- package/views/dist/panels/react/panel-header.js +0 -1
- package/views/dist/panels/react/popover.d.ts +4 -7
- package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +2 -4
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +16 -137
- package/views/dist/panels/react/sort/SortEditor.d.ts +4 -4
- package/views/dist/panels/react/sort/SortEditor.js +8 -245
- package/views/dist/panels/react/sort/SortFieldList.d.ts +1 -1
- package/views/dist/panels/react/sort/SortFieldList.js +11 -25
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -16
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.js +0 -4
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +0 -1
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +3 -3
- package/views/dist/panels/react/view-actions.js +0 -1
- package/views/dist/panels/react/views-row/FoldingViewRow.js +2 -5
- package/views/dist/panels/react/views-row/ViewCreatePill.js +0 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +7 -43
- package/views/dist/panels/react/views-row/ViewPickerRow.js +0 -2
- package/views/dist/panels/react/views-row/menu-classes.d.ts +0 -4
- package/views/dist/panels/react/views-row/menu-classes.js +0 -2
- package/views/dist/panels/react.d.ts +5 -12
- package/views/dist/panels/react.js +5 -12
- package/views/dist/provider/ViewsProvider.d.ts +2 -46
- package/views/dist/provider/ViewsProvider.js +2 -22
- package/views/dist/provider/components.d.ts +153 -106
- package/views/dist/provider/context.d.ts +1 -21
- package/views/dist/provider/missing-slot.d.ts +3 -7
- package/views/dist/provider/missing-slot.js +2 -9
- package/views/dist/react.d.ts +1 -2
- package/views/dist/selection/SelectionBar.js +2 -3
- package/views/dist/styles.css +40 -168
- package/views/dist/styles.unlayered.css +40 -168
- package/views/docs/contract.md +99 -123
- package/views/docs/getting-started.md +222 -2
- package/views/docs/guides/cells.md +222 -2
- package/views/docs/guides/display.md +1 -1
- package/views/docs/guides/editors.md +235 -20
- package/views/docs/guides/ports.md +1 -1
- package/views/docs/guides/selection.md +1 -1
- package/views/docs/guides/the-grid.md +14 -16
- package/views/docs/guides/the-provider.md +9 -15
- package/views/docs/reference/cells.md +1 -1
- package/views/docs/reference/controls.md +26 -13
- package/views/docs/reference/editors-chips.md +2 -2
- package/views/docs/reference/editors-date.md +4 -4
- package/views/docs/reference/editors-location.md +4 -7
- package/views/docs/reference/editors-name.md +3 -5
- package/views/docs/reference/editors-number.md +10 -10
- package/views/docs/reference/editors-panel.md +3 -3
- package/views/docs/reference/editors-range.md +3 -5
- package/views/docs/reference/editors-relation.md +4 -4
- package/views/docs/reference/editors-select.md +3 -3
- package/views/docs/reference/editors-text.md +3 -4
- package/views/docs/reference/editors-value-list.md +3 -3
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +2 -2
- package/views/docs/reference/panels-react.md +20 -34
- package/views/docs/reference/react.md +11 -18
- package/views/docs/reference/views.md +5 -5
- package/views/skills/views/SKILL.md +1 -1
- package/views/dist/editors/relation-panel.d.ts +0 -69
- package/views/dist/editors/relation-panel.js +0 -46
- package/views/dist/grid/chrome/GridColumnColorSection.d.ts +0 -13
- package/views/dist/grid/chrome/GridColumnColorSection.js +0 -40
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +0 -28
- package/views/dist/grid/chrome/GridColumnDateSection.js +0 -23
- package/views/dist/grid/chrome/GridColumnDurationSection.d.ts +0 -23
- package/views/dist/grid/chrome/GridColumnDurationSection.js +0 -24
- package/views/dist/grid/chrome/GridColumnNumberSection.d.ts +0 -29
- package/views/dist/grid/chrome/GridColumnNumberSection.js +0 -27
- package/views/dist/grid/chrome/GridColumnPercentSection.d.ts +0 -16
- package/views/dist/grid/chrome/GridColumnPercentSection.js +0 -16
- package/views/dist/grid/chrome/GridColumnSortSection.d.ts +0 -38
- package/views/dist/grid/chrome/GridColumnSortSection.js +0 -33
- package/views/dist/grid/chrome/GridFlyout.d.ts +0 -44
- package/views/dist/grid/chrome/GridFlyout.js +0 -80
- package/views/dist/grid/chrome/GridMenuRow.d.ts +0 -15
- package/views/dist/grid/chrome/GridMenuRow.js +0 -15
- package/views/dist/grid/chrome/grid-menu-search.d.ts +0 -7
- package/views/dist/grid/chrome/grid-menu-search.js +0 -7
- package/views/dist/panels/react/GroupBucketsList.d.ts +0 -16
- package/views/dist/panels/react/GroupBucketsList.js +0 -44
- package/views/dist/panels/react/LayoutColumnsList.d.ts +0 -24
- package/views/dist/panels/react/LayoutColumnsList.js +0 -101
- package/views/dist/panels/react/PopoverColumnDetail.d.ts +0 -11
- package/views/dist/panels/react/PopoverColumnDetail.js +0 -24
- package/views/dist/panels/react/drag.d.ts +0 -2
- package/views/dist/panels/react/drag.js +0 -5
- package/views/dist/panels/react/layout-detail.d.ts +0 -4
- package/views/dist/panels/react/layout-detail.js +0 -29
- package/views/dist/panels/react/root-list.d.ts +0 -6
- package/views/dist/panels/react/root-list.js +0 -31
- package/views/dist/panels/react/sort/use-sort-drag.d.ts +0 -17
- package/views/dist/panels/react/sort/use-sort-drag.js +0 -39
- package/views/dist/panels/react/view-footer.d.ts +0 -20
- package/views/dist/panels/react/view-footer.js +0 -41
|
@@ -202,7 +202,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
|
|
|
202
202
|
- `MenuListProps` — its props.
|
|
203
203
|
- `MenuListRows` — a menu's rows on a computer, every kind of entry, each level in with its own panel beside it, placed inside a Base UI Menu or ContextMenu popup; `host` is the popup host its levels open in.
|
|
204
204
|
- `MenuListShown` — the same rows standing still on a page: `open` shows a level's rows beside it, `on` a row as under the pointer.
|
|
205
|
-
- `MenuListPanelRows` — a menu's rows in a panel that is no menu (a pane, a popover): one tab stop, ↑ ↓ wrapping, Home, End and a typed letter, Enter and Space press, → presses a row one level in, which `onOpen` hands its holder; `ticks` `box`, `switch` or `eye`; rows with a `grip` moved by it, the pointer or ↑ ↓ on it.
|
|
205
|
+
- `MenuListPanelRows` — a menu's rows in a panel that is no menu (a pane, a popover): one tab stop, ↑ ↓ wrapping, Home, End and a typed letter, Enter and Space press, → presses a row one level in, which `onOpen` hands its holder; a tick row may open a level too (`opens`, the name of the › after its tick, which → presses while Enter and Space still tick it) and carry one Toggle before its tick (`toggle`: its mark, name, state, press, and `disabled` saying why it can't be pressed), the same in `MenuList` on a phone; `ticks` `box`, `switch` or `eye`; rows with a `grip` moved by it, the pointer or ↑ ↓ on it.
|
|
206
206
|
- `MenuListPanelRowsProps` — its props.
|
|
207
207
|
- `MenuListWords` — the words its rows with a grip and its Switches say: a grip's name, how the rows move on a computer and on a phone, a move said, a Switch's two words; handed as `words` to `MenuList` and `MenuListPanelRows`.
|
|
208
208
|
- `MENU_LIST_WORDS` — those words in English.
|
|
@@ -381,7 +381,9 @@ One of a few choices, all of them in sight, on Base UI's radio group: the arrow
|
|
|
381
381
|
|
|
382
382
|
What a list's sort opens, Attio's: the view's rules in order, the first sorting first, three at most, one per field (a place by one of its parts). Every change is handed on as it is made, so the list sorts again at once. Its stylesheet is `viewkitjs/views/controls/sort-editor.css`; its root marks a phone from the device (`data-vk-phone`).
|
|
383
383
|
|
|
384
|
-
- `
|
|
384
|
+
- `SortEditor` — the body alone, for a shell that holds only a body (the Popover, Customize's Sort): its props are `SortEditorProps`.
|
|
385
|
+
- `useSortEditor` — the editor's state and its parts (`SortEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`SortEditorProps`): `label`, the `fields` (Picker rows, each with its mark; one leading one level in holds its own), the `rules`, `onRulesChange` (the whole rules, and the set-aside sorts left when one of them is written), `max`, `form` (`computer`, `phone`, or `narrow`: the phone's structure at a computer's sizes, for a narrow place), `onDone`, the fields' `search` words, `aside` (the sorts set aside, `SortAside`s), `fieldOf` (the field a sort key sorts, so a place sorts once by one of its parts), `addSort` (Add sort at a computer's foot, true unless said), `words`, and for a page standing still `lifted`, `opens` (`SortEditorOpens`) and `level`. On a computer each rule is its grip, its field's and its direction's Select, and ×, with Add sort and Clear all sorts at the foot; the set-aside sorts follow, each its field's box dashed in the warning colour with why, its direction greyed, ⋯ holding why, Put back and Delete. On a phone each rule is a card row, its direction under its name; a press turns the body to its direction, Add sort to the fields, a set-aside sort's row to the fields to point it at one: steps of the same sheet, never a sheet on top. The body answers no Escape: its holder's sheet does. Its hook joins this door as `useSortEditor`, and the body alone as `SortEditor`, once VK-727 retires the panels' older sort editor of those names.
|
|
386
|
+
- `useSortEditorParts` — `useSortEditor`, under its name before the body took the plain one; kept.
|
|
385
387
|
- `SortEditorProps` — its props.
|
|
386
388
|
- `SortEditorParts` — its parts: the body, the head's buttons, and on a phone's step its title and Back.
|
|
387
389
|
- `SortEditorOpens` — what a page shows standing open: a rule's field or direction, by its place.
|
|
@@ -452,7 +454,9 @@ A view's menu and what it opens (VK-823), for an app that draws its own menu or
|
|
|
452
454
|
|
|
453
455
|
What an advanced filter opens on a computer and Filter on a phone, Attio's: the view's rules, each Where or its level's join, its field, how it compares and its value in its type's own box, joined by And or Or, in groups three deep; a relation rule's block (its relation, Any, None or Every where, its rules on that relation's fields inside, Add filter and Delete condition), which a rule on a related field's ⋮ makes with None or Every, Every waiting until a rule in it narrows; a group's ⋮ with Exclude matches (a group joined by And), an excluded group saying so; and the filter part, what a filter's way and value open on the bar. A body, as the sort editor is: the Popover holds it on a computer and the Sheet on a phone. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/filter-editor.css`; its root marks a phone from the device (`data-vk-phone`).
|
|
454
456
|
|
|
455
|
-
- `
|
|
457
|
+
- `FilterEditor` — the body alone, for a shell that holds only a body (the Popover): its props are `FilterEditorProps`.
|
|
458
|
+
- `useFilterEditor` — the editor's state and its parts (`FilterEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`FilterEditorProps`): `label`, the `fields` (each typed, a choice's values with it; one leading one level in holds its own), the `filter`, `onFilterChange`, `at`, `ids`, `levels`, `form` (`computer`, `phone`, or `narrow`), `onDone`, `standing`, `own` (ViewKit's own words and value body for a rule the kit has no box for), `excludable` (whether the filter itself may exclude its matches: an advanced filter's own group, its foot then holding a group's ⋮ too) and `words`. On a phone each box's list, a date, a value ViewKit draws, Add filter, a block's quantifier and a rule's or a group's ⋯ turn the body to a step of the same sheet, never a sheet on top; the body answers no Escape: its holder's sheet does. Its hook joins this door as `useFilterEditor`, and the body alone as `FilterEditor`, once VK-727 retires the panels' older filter editor of that name.
|
|
459
|
+
- `useFilterEditorParts` — deprecated: `useFilterEditor`, under its name before the body took the plain one.
|
|
456
460
|
- `FilterEditorProps` — its props.
|
|
457
461
|
- `FilterEditorParts` — its parts: the body, the head's buttons, and on a phone's step its title and Back.
|
|
458
462
|
- `FilterOwn` — ViewKit's own words and value body for a rule: its field's words, its way's word, its value's words, its value body.
|
|
@@ -489,6 +493,8 @@ What an advanced filter opens on a computer and Filter on a phone, Attio's: the
|
|
|
489
493
|
- `isSetAside` — whether a rule is set aside.
|
|
490
494
|
- `isPair` — whether a value is a range's From and To.
|
|
491
495
|
- `isGroup` — whether an item is a group.
|
|
496
|
+
- `FilterItem` — an item of a filter: a rule or a group.
|
|
497
|
+
- `putFilterBack` — a rule set aside put back: its `aside` dropped, so it is written as a rule again (the sort editor's is `putBack`).
|
|
492
498
|
- `isAdvanced` — whether the filter is advanced: an Or between its rules, or a group in it.
|
|
493
499
|
- `barOf` — the filter as the bar reads it: each rule at its own level plain, each group there advanced.
|
|
494
500
|
- `BarFilter` — a filter as the bar shows it.
|
|
@@ -507,6 +513,7 @@ What an advanced filter opens on a computer and Filter on a phone, Attio's: the
|
|
|
507
513
|
|
|
508
514
|
What Customize's Group opens: the list's group as the Menu list's rows. Group by, Order, Direction, a date field's Date step and Hide empty groups, each saying what it is and opening its choices in place; then the groups under their heading, each its grip, its name and its Switch, dragged into your own order, Hide all (Show all once none shows) at the heading; Remove grouping at its foot. A body: Customize holds it, a screen in its panel on a computer and a step of its sheet on a phone. A setting's choices stand in place of the settings, and the editor hands their name and the way back to its holder (`level`), whose head shows them. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/group-editor.css`; its root marks a phone from the device (`data-vk-phone`).
|
|
509
515
|
|
|
516
|
+
- `GroupEditor` — the body alone, for a shell that holds only a body: its props are `GroupEditorProps`.
|
|
510
517
|
- `useGroupEditor` — the editor's state and its parts (`GroupEditorParts`): the `body`, and the `level` it stands on. Its props (`GroupEditorProps`): `label`, the `fields` (Picker rows; one leading one level in holds its own), `ownOrders` (a field's own order, in its words), `orders` (the orders each field offers), `manualOrder` (whether Your own may be picked), `steps` (each date field's steps), the `group`, the groups as `values` (each with its count), `onGroupChange` (the whole group, null once taken off), `search`, `form`, `words`, and for a page standing still `opens` and `opensLevel`. The body alone, `GroupEditor`, joins this door with VK-727, beside the other panels' bodies.
|
|
511
518
|
- `GroupEditorProps` — its props.
|
|
512
519
|
- `GroupEditorParts` — its parts: the body, and the level it stands on (its name and the way back), null at the settings.
|
|
@@ -529,19 +536,21 @@ What Customize's Group opens: the list's group as the Menu list's rows. Group by
|
|
|
529
536
|
- `groupWords` — its words: the handed ones over the English.
|
|
530
537
|
- `GroupEditorWords` — its words' shape.
|
|
531
538
|
|
|
532
|
-
`CONTROLS.GroupBody` draws ViewKit's group body with it: the group as one value, every change handed back as one write, the orders each field offers, Your own where the list offers it, a date field's steps, each group's count (`ViewsGroupEntry.count`) for its Count order, and its level told to what holds it (`onStepChange`)
|
|
539
|
+
`CONTROLS.GroupBody` draws ViewKit's group body with it: the group as one value, every change handed back as one write, the orders each field offers, Your own where the list offers it, a date field's steps, each group's count (`ViewsGroupEntry.count`) for its Count order, and its level told to what holds it (`onStepChange`). No ViewKit part draws it since ViewKit's own Customize went: `CONTROLS.CustomizeBody` holds the group editor itself, and the `GroupBody` slot is deprecated. Every word is the app's, from its messages. It is internal: `CONTROLS` is the way in.
|
|
533
540
|
|
|
534
541
|
## Customize
|
|
535
542
|
|
|
536
|
-
What View settings opens: the view's sections as the Menu list's rows, Layout, Columns, then each of Filter, Sort and Group it is handed, each saying where it stands and opening its screen in place, then its toggles (Show counts among them). Layout is the layout cards and the layout's own settings: its pick-one settings (a density, a board's field) each opening its choices in place, its toggles under their sections with a toggle's way back, and For you with its own. Columns is a search, the shown columns, each its grip, its mark, its name and its Switch, dragged into place, the first one locked, the hidden ones under Hidden, Hide all, Reset columns and Show all at the headings. Its head is the view's name renamed in place, or a title, as its options say; its footer, Copy link and Export CSV, each where handed; Reset and Save over it once something changed, with the shared view's stale note. A body: on a computer the Pane holds it where an app hands a Pane, and elsewhere (the toolbar's popover) it draws the same head, body and foot in a frame of its own; on a phone it hands the Sheet its head and foot, each section's step under that one head. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/customize.css`; its options are `CUSTOMIZE_LOOKS`; its root marks a phone from the device (`data-vk-phone`).
|
|
543
|
+
What View settings opens: the view's sections as the Menu list's rows, Layout, Columns, then each of Filter, Sort and Group it is handed, each saying where it stands and opening its screen in place, then its toggles (Show counts among them). Layout is the layout cards and the layout's own settings: its pick-one settings (a density, a board's field) each opening its choices in place, its toggles under their sections with a toggle's way back, and For you with its own. Columns is a search, the shown columns, each its grip, its mark, its name and its Switch, dragged into place, the first one locked, the hidden ones under Hidden, Hide all, Reset columns and Show all at the headings. A column with settings of its own or the app's rows for its field carries a › after its Switch, opening its level in Columns' place: Shown, its pick-one settings each opening in place, its toggles under their sections, then the app's rows; on a card layout each field carries its new-line Toggle, refused with its reason on the card's first field and a hidden one; and the app's rows under Columns' rows (Add field) stand at its foot. A list's per-field filters stand as rows after Columns and its time range and date ranges after Group, each saying what it holds and opening its screen (choices to pick one of, choices to check, or a body of its own with its level), or, folded, all behind one Filter row. Its head is the view's name renamed in place, or a title, as its options say; its footer, Copy link and Export CSV, each where handed; Reset and Save over it once something changed, with the shared view's stale note. A body: on a computer the Pane holds it where an app hands a Pane, and elsewhere (the toolbar's popover) it draws the same head, body and foot in a frame of its own; on a phone it hands the Sheet its head and foot, each section's step under that one head. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/customize.css`; its options are `CUSTOMIZE_LOOKS`; its root marks a phone from the device (`data-vk-phone`).
|
|
537
544
|
|
|
538
|
-
- `
|
|
545
|
+
- `Customize` — the body alone, for a shell that holds only a body: its props are `CustomizeProps`.
|
|
546
|
+
- `useCustomize` — its state and its parts (`CustomizeParts`): the `body`, the `level` it stands on (a layout's choice, a column's settings, a section's level) or `null`, and on a phone the Sheet's `title`, `head` (Back and ✕) and `foot`. Its props (`CustomizeProps`): the `view`, `onViewChange` (the whole view, each change as it is made), the `layouts`, the `filter`, `sort` and `group` sections, `changed` with `onReset` and `onSave`, `pending`, `stale`, `exportCount` with `onCopyLink` and `onExport`, `toggles`, `layoutSettings`, `columnsReset`, `onLineChange` (a card's field starting a new line, turned on or off), `columnsFoot` (the app's rows under Columns' rows), `fields` and `foldFields` (a list's per-field filters, its time range and date ranges, `CustomizeField`), `onClose` (outside a Pane, the title head's ✕), `onScreenChange`, `words`, `form`, and for a page standing still `screen`. The body alone, `Customize`, joins this door with VK-727, beside the other panels' bodies.
|
|
539
547
|
- `useCustomizeWorn` — its options as the frame round it wears them, kept up to date as they change.
|
|
540
548
|
- `layoutMark` — a layout's mark by its id: table, board, list, calendar, timeline.
|
|
541
549
|
- `CustomizeProps` — its props.
|
|
542
550
|
- `CustomizeParts` — its parts.
|
|
543
551
|
- `CustomizeView` — the view it sets: its name, its layout, its columns, and a table's own settings as its page draws them.
|
|
544
|
-
- `
|
|
552
|
+
- `CustomizeField` — a list's per-field filter, its time range or a date range: its row's words, what it holds, where it stands, why it can't open, and what its screen holds (`pick`, `check` or a `body` with its `level`).
|
|
553
|
+
- `CustomizeColumn` — a column: its id, its name, whether it shows, whether it is locked, its mark, its own `settings`, the app's `rows` for its field, and on a card layout its `line` (whether it starts a new line, and why it can't).
|
|
545
554
|
- `CustomizeLayout` — a layout it offers: its id, its name, its mark; one still to come can't be picked.
|
|
546
555
|
- `CustomizeSection` — a section it is handed: what it says, whether that is in force, what its screen holds, and the level that screen stands on.
|
|
547
556
|
- `CustomizeScreen` — where it stands: its list, or a section's screen.
|
|
@@ -567,7 +576,7 @@ What View settings opens: the view's sections as the Menu list's rows, Layout, C
|
|
|
567
576
|
- `SheetPartsFrom` — what a Sheet holds for a body that heads it: the body hands its title, Back, ✕ and foot, drawn in place of the Sheet's head. The controls' Sheet holds it; an app's own may too.
|
|
568
577
|
- `SheetParts` — what a body hands its Sheet.
|
|
569
578
|
|
|
570
|
-
`CONTROLS.CustomizeBody` draws ViewKit's Customize body with it: the view's columns and layout, each change handed back as one write; the layout's own settings, its toggles, Columns' own Reset and the shared view's foot (Reset and Save for everyone; under the kit's foot, Clear and Save; with no shared view, the foot's Clear); its Filter, Sort and Group through the filter, sort and group editors, narrow on a computer, each step a level under its head on a phone. It
|
|
579
|
+
`CONTROLS.CustomizeBody` draws ViewKit's Customize body with it: the view's columns and layout, each change handed back as one write; the layout's own settings, its toggles, Columns' own Reset and the shared view's foot (Reset and Save for everyone; under the kit's foot, Clear and Save; with no shared view, the foot's Clear); its Filter, Sort and Group through the filter, sort and group editors, narrow on a computer, each step a level under its head on a phone. It draws a column's own settings one level into Columns, your field editor's rows for that column under them and its footer under Columns' rows, and on a card layout each field's new-line toggle. The view's name, Copy link and Export come through the toolbar (`ToolbarOptions`' and `ReadyToolbar`'s `viewName`, `onRenameView`, `onCopyLink`, `onExport`, `exportCount`), each drawn only where handed, and on a phone the level a section stands on (Group by's fields, Add sort's) is told as its step (`onStepChange`), so the sheet's Escape goes back a level. Every word is the app's, from its messages. It is internal: `CONTROLS` is the way in.
|
|
571
580
|
|
|
572
581
|
## The Modal
|
|
573
582
|
|
|
@@ -732,9 +741,11 @@ What picked rows bring, the Outright kit's (after Attio's): on a computer a surf
|
|
|
732
741
|
|
|
733
742
|
## The Text editor
|
|
734
743
|
|
|
735
|
-
`CONTROLS` fills its `TextBody` with the Text editor: ViewKit's text bodies, held as a shell that keeps the draft. A line, an email, a phone, a link and a domain type into the inline input over the cell, growing over the rows below a row at a time to eight; long text and rich text are its long text, as plain lines; a url is a link. A phone opens with its country first (its country, its dial code and its country's pattern, the countries the Picker's list in a Popover, on a phone a step of the Sheet), its extension after its digits and kept. ViewKit's text editor keeps the draft, Escape, Tab, ⌘ or Ctrl Enter, the check and the save; a refusal is the host's to show.
|
|
744
|
+
`CONTROLS` fills its `TextBody` with the Text editor: ViewKit's text bodies, held as a shell that keeps the draft. A line, an email, a phone, a link and a domain type into the inline input over the cell, growing over the rows below a row at a time to eight; long text and rich text are its long text, as plain lines; a url is a link. A phone opens with its country first (its country, its dial code and its country's pattern, the countries the Picker's list in a Popover, on a phone a step of the Sheet), its extension after its digits and kept. In a field row (`place: "row"`) it stands in the row's flow instead: a line one list row high (28px), long text growing with its text to 320px, then scrolling, so the row grows with it. ViewKit's text editor keeps the draft, Escape, Tab, ⌘ or Ctrl Enter, the check and the save; a refusal is the host's to show.
|
|
736
745
|
|
|
737
|
-
- `useTextEditor` — the Text editor, as the parts a shell pours in: its `body` (on a computer what stands in the cell, on a phone what the Sheet's body holds), and on a phone the Sheet head's buttons (`head`) and a step's `title`. Standing alone (`draft: "own"`, the default) it keeps on Enter or a press elsewhere and leaves on Escape, says why a value is refused just under the box, and on a phone hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change, the whole text each time, and keeps nothing. Its props are
|
|
746
|
+
- `useTextEditor` — the Text editor, as the parts a shell pours in: its `body` (on a computer what stands in the cell, on a phone what the Sheet's body holds), and on a phone the Sheet head's buttons (`head`) and a step's `title`. Standing alone (`draft: "own"`, the default) it keeps on Enter or a press elsewhere and leaves on Escape, says why a value is refused just under the box, and on a phone hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change, the whole text each time, and keeps nothing. Its props are `TextEditorProps`.
|
|
747
|
+
- `TextEditor` — the body alone, for a shell that holds only a body.
|
|
748
|
+
- `TextEditorProps` — its props: the field's `label`, its `kind`, its `value`, `onValueChange`, and how it keeps its draft (`draft`).
|
|
738
749
|
- `TextEditorParts` — what `useTextEditor` hands back: its `body`, its phone `head` and a step's `title`.
|
|
739
750
|
- `TextKind` — its kinds: `text`, `email`, `phone`, `link`, `domain`, `long`.
|
|
740
751
|
- `TEXT_KEYS` — the keyboard each kind brings on a phone.
|
|
@@ -766,7 +777,7 @@ Its stylesheet is `viewkitjs/views/controls/text-editor.css`, beside the inline
|
|
|
766
777
|
|
|
767
778
|
## The Picker as the editors' list
|
|
768
779
|
|
|
769
|
-
`CONTROLS` fills its `Picker` with the Picker: ViewKit's select, status, several-values, relation and set editors open it
|
|
780
|
+
`CONTROLS` fills its `Picker` with the Picker: ViewKit's select, status, several-values, relation and set editors open it, handed their rows as data, the panel round it keeping the draft and, on a phone, its ✕ and ✓, so the Picker is told the shell keeps them and hands every change. Its words are ViewKit's `views.picker.*` messages, so an app's own words reach it. A status field's steps come as `steps`: an archived option held stands outside them, as its cell draws it. It fills its `FieldsBody` with the Picker too: the sort's and the filter's field lists, each field its column's glyph, one that can't be picked greyed with why, a relation under Related records with its far fields one level in. The Picker's stylesheet, `viewkitjs/views/controls/picker.css`, stands on the Avatar's, the Button's, the Checkbox's, the Glass button's, the Input's, the Kbd's, the Menu's, the Option's, the Spinner's, the Status's, the Sheet's, the scrollbar's, the list's and the popup line's.
|
|
770
781
|
|
|
771
782
|
- `pickerItemsOf` — ViewKit's rows (`ViewsPickerItem`) as the Picker's: an avatar, the record's glyph, a status at its place (its quarters among `steps` when handed), an option, or the app's icon (handed `AppIcon`). For an app's own list in the Picker; the editors' own `pickerItemOf` is another, internal one.
|
|
772
783
|
|
|
@@ -776,7 +787,8 @@ Its stylesheet is `viewkitjs/views/controls/text-editor.css`, beside the inline
|
|
|
776
787
|
|
|
777
788
|
`CONTROLS` fills its `Calendar` with the Date editor's days: the filter panel's month (the date filter, its date ranges and its custom time scope), one day a press, the end being picked shown, the days outside its limits greyed. Its arrows and Page Up and Down move the month (with Shift a year); its words are the app's and its names in the conventions' `language`, as the Date editor's. An app that hands its own `Calendar`, or its own `RangeCalendar` atom, keeps it.
|
|
778
789
|
|
|
779
|
-
- `useDateEditor` — the Date editor, as the parts a shell pours in: its `body`, and on a phone the Sheet head's ✕ and ✓ (`head`). Standing alone (`draft: "own"`, the default) it keeps on Enter, Escape or a press elsewhere and, on a phone, hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change as it is made and keeps nothing. Its `words` and `language` say what it writes
|
|
790
|
+
- `useDateEditor` — the Date editor, as the parts a shell pours in: its `body`, and on a phone the Sheet head's ✕ and ✓ (`head`). Standing alone (`draft: "own"`, the default) it keeps on Enter, Escape or a press elsewhere and, on a phone, hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change as it is made and keeps nothing. Its `words` and `language` say what it writes.
|
|
791
|
+
- `DateEditor` — the body alone, for a shell that holds only a body.
|
|
780
792
|
- `DateEditorProps` — its props: the field's `label`, its `value` (`"2026-11-12"`, `"2026-11-12T14:30"` or null), `onValueChange`, `onDone`, `time`, `empty`, `days`, `picks`, `today`, `typed`, `opens`, `autoFocus`, `form`, `worn`, `draft`, `words` and `language`.
|
|
781
793
|
- `DateEditorParts` — what `useDateEditor` hands back: its `body` and its phone `head`.
|
|
782
794
|
- `useDateEditorWorn` — the options worn round an element, as a ref callback and what it wears, read again as a frame's attributes change.
|
|
@@ -877,6 +889,7 @@ A name's `NameValue` and `sameName`, and a range's `rangeText`, stay inside the
|
|
|
877
889
|
`CONTROLS` fills its `NumberBody` with the Number editor: ViewKit's number, money and percent bodies, held as a shell that keeps the draft. A number types into the number field inline, over its cell, its up and down arrows at its end while it is edited; money's code stands before the amount, a press away from a list of each currency's sign and name in the conventions' language, found by its name or its code, ↓ there going on from the currency held; a number's unit the same; a percent shows its %. Home and End move the cursor. On a phone the Sheet holds the number field with the number pad, the currencies a step of the Sheet (`onStepChange`). ViewKit's number editor keeps the draft, the rounding to the field's decimals, Escape, Tab, the check, the empty rule and the save; a refusal is the host's to show. A duration keeps ViewKit's own box.
|
|
878
890
|
|
|
879
891
|
- `useNumberEditor` — the Number editor, as the parts a shell pours in: its `body`, and on a phone the Sheet head's buttons (`head`) and the currencies' step `title`. Standing alone (`draft: "own"`, the default) it keeps on Enter or a press elsewhere and leaves on Escape, and on a phone hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change as it is read and keeps nothing.
|
|
892
|
+
- `NumberEditor` — the body alone, for a shell that holds only a body.
|
|
880
893
|
- `useNumberEditorWorn` — the options worn round the body, read again as they change: a ref for its root, and what it wears.
|
|
881
894
|
- `NumberEditorProps` — its props: a `number`, `money` or `percent`, its value, its currency or unit and those on offer, its limits, decimals and reading, and its change.
|
|
882
895
|
- `NumberEditorParts` — what `useNumberEditor` hands back: its `body`, its phone `head` and a step's `title`.
|
|
@@ -894,7 +907,7 @@ A name's `NameValue` and `sameName`, and a range's `rangeText`, stay inside the
|
|
|
894
907
|
- `numberWords` — the words handed over the English.
|
|
895
908
|
- `NumberEditorWords` — those words, and its lists' own (`picker`).
|
|
896
909
|
|
|
897
|
-
|
|
910
|
+
Its stylesheet is `viewkitjs/views/controls/number-editor.css`, beside those of the controls it draws with; its names are on [its page](../controls/number-editor.md).
|
|
898
911
|
## The Values editor
|
|
899
912
|
|
|
900
913
|
`CONTROLS` fills its `ValuesBody` with the Values editor: ViewKit's bodies for several emails, phones, links or domains (and for one email or domain an app opens as a list of one, `oneValue`), held as a shell that keeps the draft. Each value is a pill with copy and trash, pressed to edit it in place, its label quiet after it; a grip moves it, by the pointer or by ↑ and ↓, and the first is the main one. A line at the foot adds one: a plus and its kind's words, or a phone's country (ViewKit's region for the record, else the last one kept, else the browser's region), its dial code and its pattern. Enter there adds the value and stays open; Enter on the empty line saves, as Enter on a value being edited first finishes it. A new value takes Work, Mobile or Other (a domain none), and a label is picked from Work, Personal, Mobile and Other in the app's words, or typed. ViewKit's value list editor keeps the draft, which value is kept as stored, Escape, Tab, the check and the save; a value that doesn't read, left in the line or in a value being edited, is handed as typed, so the host refuses it, says why and stays open. Escape in a label's or a country's list closes the list alone.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/chips`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/chips` in a client component: the door opens with the client directive. It holds the editor of a `multiselect` field, a value that is several values. The chosen values stay on screen while you edit them,
|
|
3
|
+
Import from `viewkitjs/views/editors/chips` in a client component: the door opens with the client directive. It holds the editor of a `multiselect` field, a value that is several values. The chosen values stay on screen while you edit them, held in your app's `Picker`, and adds and removes build a draft that commits once when the host closes the panel: several tags are one write and one undo step. A pick adds a value and keeps the panel open, so this editor never sees the `pick` reason. It owns the draft and what a close means; its host owns the popover, the anchor and the write. It commits the list of values, a `string[]`. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `ChipsEditor` — the chips panel
|
|
5
|
+
- `ChipsEditor` — the chips panel, opened in your app's `Picker` with `multiple`, the values it holds and those on offer (the column's, then any held stray); its ref is a `ChipsEditorHandle`. Your Picker hands back the whole new list, every change as it is made; a value handed twice is held once, the empty text never, and a closed vocabulary (`creatable={false}`) takes only what it offers or holds. Unless `creatable` is false your Picker is handed `onCreate`: the typed text through the column's `normalize`, a value held or offered in any case being that value. Your Picker's `onDone` closes with `pick`; Escape closes with `escape`, Tab and Shift-Tab with `tab` and `shift-tab`. It takes `values` (what the cell holds), `suggestions` (what the column already holds, the same list its filter offers), `resolve` (one value's label and colour as a `PickerOption`, including a value just typed), `onRequestClose` (called with `escape`, `tab` or `shift-tab`) and `message`, and optionally `normalize`, the rule every added value goes through (default: trimmed), and `creatable` (default true), `seed`, the text the search opens with (a letter typed on the cell that opened it, the values held kept), and `addOption`, an `OptionAdd` from your app: your Picker is handed + Add (`onAdd`, with `adding` while your app answers and `addRefused` for a refusal or a failure) and no `onCreate`; a word a value held or offered already is (by label or value, ignoring spaces at either end, case and accents) is that value, never asked; otherwise your app is asked once, and the option it returns is added to the set and checked, the panel staying open, once `suggestions` carry it. `CONTROLS.Picker` doesn't draw + Add yet.
|
|
6
6
|
- `ChipsEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Its close rule is the date editor's: Escape discards, and any other close, an outside click included, commits the list when it differs from `values` (compared as fields compares a list) and is a `noop` when it doesn't.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/date`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/date` in a client component: the door opens with the client directive. It holds the editor of a `date` and a `datetime` field
|
|
3
|
+
Import from `viewkitjs/views/editors/date` in a client component: the door opens with the client directive. It holds the editor of a `date` and a `datetime` field, which opens your app's `DateBody` (`CONTROLS.DateBody` is ViewKit's own, the Date editor: its line, its days, its quick picks and its time; it has no list of every quarter hour). It owns the draft, the reading of the value on the conventions' calendar and clock, and what a close means; the body draws; its host owns the popover, the anchor and when a close means commit. It commits `YYYY-MM-DD` when no time is set, `YYYY-MM-DDTHH:MM` in local time, or `""` when the date is emptied. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `
|
|
5
|
+
- `DateEditorHost` — the date panel (the Date editor's body alone is `DateEditor`, on `viewkitjs/views/controls`); its ref is a `DateEditorHandle`. It takes `initial` (the stored value, which picks the day the body opens on: a full ISO string; a wall clock with no offset, read on the browser's clock, the form a commit waiting for its write comes back in; or `YYYY-MM-DD`, that day in every time zone, never midnight UTC), `onRequestClose` (Enter means done, Escape means leave, and `pick` means a choice that ends the edit; Tab from the body's last control asks to close with `tab`, and Shift-Tab from its first with `shift-tab`, while Tab between its own controls moves as usual, so a popover that keeps the focus in a loop can still be left; the panel never closes itself) and `message` (the fields message resolver, defaulting to the provider's conventions). With `timeOptional` the time starts empty and stays out of the commit until set; without it the time is the stored one, or 00:00, and every commit includes one. With `dayOnly`, for a calendar-day field, there is no time and the commit is the day. With `clearable` the body offers No date, which commits `""`, or nothing when there was no date. With `seed` the body's line opens holding that text (a character typed on the cell), read as a typed date. With `focusDate` the body takes the focus as the panel opens, without scrolling; leave it off on a phone, whose sheet opens with the keyboard down. With no stored value a close with no interaction writes nothing. The panel opens on, and takes, the wall clock of the conventions' zone (`timeZone`), the hour the cell shows, and today (which the body's quick days count from) is that zone's; the commit is the browser's wall clock of the instant set, so `mergeLocalOntoInstant` lands it there. A time the zone skips commits nothing. A day with no time (with `timeOptional`, the time left or made empty) lands at the zone's first instant that day, its midnight or, where its clocks skip midnight, the moment they land on; where that is the browser's own start of the day it commits the bare day, which `mergeLocalOntoInstant` lays onto the stored clock, as before. A `dayOnly` field reads a stored instant's day on the browser's calendar, as its cell does, and a grid column of type `date` with no field keeps its editor on the browser's clock.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- `DateEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape discards: `"escape"` answers `cancel`. After
|
|
7
|
+
It hands the body the value on the conventions' calendar and clock (a day, or a day and a time, a stored day read as that day on any clock), `time` (false for a date-only field), `empty` (where the date may be emptied), the quick picks, today, the text typed on what opened it, `autoFocus` and `form`. A change from the body is the draft a close resolves, `resolveClose` answers it unchanged, a datetime handed a bare day moves the day and keeps the time in force (the one it opened with, or the last one handed), while a field whose time is optional takes a bare day as holding no time, the empty pick (No date) empties the date, and a value that isn't a date changes nothing. `onDone` asks the host to close with `enter` when the body's last key was a plain Enter (so a grid's next key lands the write first), and with `pick` otherwise. Escape is taken before the body hears it and asks the host to close with `escape`, so your provider's rule for the field's type decides what it keeps; Tab walks the body's controls and asks to close with `tab` or `shift-tab` from either end, so a popover your body draws in a portal, outside its element, reads as a Tab out. `label` names the field for the body (default: the date's words); the grid and the field row hand their field's name.
|
|
8
|
+
- `DateEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape discards: `"escape"` answers `cancel`. After the body hands the empty pick, any other close commits `""`, or is a `noop` when there was no date. Otherwise every other close commits the draft when it differs from the stored value, and is a `noop` otherwise, with a seed typed on what opened it read as a typed date.
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/location`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/location` in a client component: the door opens with the client directive. It holds the editor of a `location` field: the country first, then that country's own parts in its own order and with its own words (one country's postal code, county and city on one line, another's city first), the parts the country asks for marked as required and never refused. It owns the
|
|
3
|
+
Import from `viewkitjs/views/editors/location` in a client component: the door opens with the client directive. It holds the editor of a `location` field, which opens your app's `PartsBody` as `kind: "place"` (`CONTROLS.PartsBody` is ViewKit's own, the Compound editor): the country first, then that country's own parts in its own order and with its own words (one country's postal code, county and city on one line, another's city first), the parts the country asks for marked as required and never refused. It owns the draft, the region's code and what a close means; the body draws the boxes and the country and region lists; its host owns the popover, the anchor and the write. It commits a `LocationValue` of `viewkitjs/fields` holding the field's parts, or null. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `LocationEditor` — the place
|
|
6
|
-
- Country:
|
|
5
|
+
- `LocationEditor` — the place panel; its ref is a `LocationEditorHandle`. It takes `field` (the location field, whose `parts` limit what it edits), `initial` (the stored place, or null) and `onRequestClose`, and optionally `allowEmpty` (the place may be emptied: the body is told so as `empty`), `conventions` (whose names language, `language`, names the countries and regions and picks each country's format; default: the provider's) and `label` (the field's name, for your `PartsBody`; default the field's label). It hands the body the place's parts, the boxes the field takes and their rows in the country's own order, each box's words, the parts the country asks for, every country where the field takes one, the country's regions once loaded, and `opens: "countries"` where the place has no country yet.
|
|
6
|
+
- Country: picking another country clears the region and its code.
|
|
7
7
|
- Region: where the country has a region list, the region is picked from it, storing the region's name and its ISO 3166-2 code; the list loads when the editor lands on that country. A typed region has no code.
|
|
8
8
|
- Parts: a field limited to some parts edits only those, and a part it names that the country's format has no place for comes after the country's lines, as does a part a stored place holds that its country has no place for.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Handed `PartsBody` in the components map, the editor opens it in place of its boxes and lists, as `kind: "place"`: it hands the body the place's parts, the boxes the field takes and their rows in the country's own order, each box's words, the parts the country asks for, every country where the field takes one, the country's regions once loaded, and `opens: "countries"` where the place has no country yet. It keeps the region's code (read from the region, cleared with a new country), the draft, Escape, Tab and the close.
|
|
12
|
-
- `LocationEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels. Each of the field's parts is trimmed, an empty one null; the same stored value as `initial` is a `noop`; every part empty commits null with `allowEmpty` and cancels without it; anything else commits. After a press on the Clear row, until the next edit, every close but Escape commits null, or is a `noop` when the place was already empty.
|
|
9
|
+
- `LocationEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels. Each of the field's parts is trimmed, an empty one null; the same stored value as `initial` is a `noop`; every part empty commits null with `allowEmpty` and cancels without it; anything else commits.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/name`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/name` in a client component: the door opens with the client directive. It holds the editor of a `name` field:
|
|
3
|
+
Import from `viewkitjs/views/editors/name` in a client component: the door opens with the client directive. It holds the editor of a `name` field, which opens your app's `PartsBody` as `kind: "name"` (`CONTROLS.PartsBody` is ViewKit's own, the Compound editor): given, family and full. Once a part is edited, the full name follows the parts ("given family") while nobody has typed one, and stops once someone does; a stored full name the parts would not give is the person's own and is left as it is, and an editor closed untouched writes nothing. It owns the draft, that rule and what a close means; the body draws; its host owns where it mounts, the write, and keeping each part in its own column. It commits a `NameValue` of `viewkitjs/fields`, `{ full, given, family }`, or null. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `NameEditor` — the
|
|
6
|
-
|
|
7
|
-
Handed `PartsBody` in the components map, the editor opens it in place of its three boxes, as `kind: "name"`: it hands the body `{ given, family, full }`, `full` as the rule above shows it, and keeps the rule itself (a full name typed in the body is its own, unless it is the parts joined, which follows them again; a changed part, while the full name isn't its own, makes it follow), the draft, Escape, Tab and the close.
|
|
8
|
-
- `NameEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels. The name is tidied as fields tidies one; the same name as `initial` is a `noop`; three empty boxes commit null with `allowEmpty` and cancel without it; anything else commits.
|
|
5
|
+
- `NameEditor` — the name panel; its ref is a `NameEditorHandle`. It takes `initial` (the stored name, or null) and `onRequestClose`, and optionally `seed` (the character that opened the editor, replacing the given name), `allowEmpty`, `conventions` and `label` (the field's name, for your `PartsBody`; default "Full name"). It hands the body `{ given, family, full }`, `full` as the rule above shows it, and keeps the rule itself (a full name typed in the body is its own, unless it is the parts joined, which follows them again; a changed part, while the full name isn't its own, makes it follow), the draft, Escape, Tab and the close.
|
|
6
|
+
- `NameEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels. The name is tidied as fields tidies one; the same name as `initial` is a `noop`; an empty name commits null with `allowEmpty` and cancel without it; anything else commits.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/number`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/number` in a client component: the door opens with the client directive. It holds the editor of a `number`, `percent` and `currency` field. It is inline: it replaces the cell's own content rather than opening a panel over it, so its closes are the keyboard's and the blur's (Enter, Tab, Shift-Tab, Escape, a blur) and never `outside`. It owns the
|
|
3
|
+
Import from `viewkitjs/views/editors/number` in a client component: the door opens with the client directive. It holds the editor of a `number`, `percent` and `currency` field. It is inline: it replaces the cell's own content rather than opening a panel over it, so its closes are the keyboard's and the blur's (Enter, Tab, Shift-Tab, Escape, a blur) and never `outside`. It owns the draft, the rounding and what a close means; the body draws the box, its unit and its list. Its host owns where it mounts and the write. It commits a `NumberEditValue`. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `
|
|
6
|
-
- Text: `seed`, the character that opened the editor,
|
|
7
|
-
- Limits: `min` and `max`, the field's lowest and highest value
|
|
8
|
-
- Unit: `unit`, the row's currency
|
|
9
|
-
- Duration: `durationUnit`, the unit a duration is stored in. The input then
|
|
10
|
-
- Layout: `align`, `end` (the default, a right-aligned column) or `start` (a row read left to right,
|
|
11
|
-
-
|
|
12
|
-
- `NumberEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels.
|
|
13
|
-
- `NumberEditValue` — what a number commits: `{ value, unit }`, the value a number or null and the unit
|
|
5
|
+
- `NumberEditorHost` — the editor (the Number editor's body alone is `NumberEditor`, on `viewkitjs/views/controls`); its ref is a `NumberEditorHandle`. It opens the components map's `NumberBody` (required; `CONTROLS.NumberBody` is ViewKit's own), hands it the draft and the field's settings (`ViewsNumberBodyProps`), and keeps the draft, the rounding, Escape's rule, Tab, ⌘ or Ctrl Enter, the close and the save; the body's `NaN` (text that reads as no number) closes as a cancel. A number formatted as a duration has no body form: the editor draws its own input, focused without scrolling, opening as written text (`1m 30s`). It takes `initial` (the signed stored value), `onRequestClose`, and optionally:
|
|
6
|
+
- Text: `seed`, the character that opened the editor, the draft's reading while `initial` stays the value it compares against; `decimals`, the rounding, in the stored unit (default 2, and 0 for a whole-number field); `conventions`, how your people write a number (default: the provider's); `allowEmpty`, which makes an emptied value a real null commit.
|
|
7
|
+
- Limits: `min` and `max`, the field's lowest and highest value, handed to the body.
|
|
8
|
+
- Unit: `unit`, the row's currency; `unitOptions`, the units the body may put it in; `code`, a fixed currency's code (`numberEditCode`), handed to the body as its unit and never part of the commit, ignored when `unit` is given.
|
|
9
|
+
- Duration: `durationUnit`, the unit a duration is stored in. The editor's own input then reads units, compounds or a bare number of seconds, and commits in that unit.
|
|
10
|
+
- Layout: `align`, `end` (the default, a right-aligned column) or `start` (a row read left to right), handed to the body; `boxClassName`, classes for a duration's own input (a field row drawn in place frames it).
|
|
11
|
+
- The body: `type` (`number`, `percent` or `currency`; default `number`), `label`, `check` (the host's reading of a value and its unit, asked with the value rounded to `decimals`), `escapeKeeps` (the session keeps on Escape), `closeOnBlur` (default true: in place, a focus leaving the body closes it, and a Tab between its controls never reaches the grid; a sheet passes false) and `form` (`phone` in a sheet).
|
|
12
|
+
- `NumberEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels. An emptied value cancels, or with `allowEmpty` commits a null value (`noop` when it was already empty and the unit is unchanged). Text that is not a number cancels, never clears. The same number at the editor's decimals with the same unit is a `noop`; anything else commits.
|
|
13
|
+
- `NumberEditValue` — what a number commits: `{ value, unit }`, the value a number or null and the unit it is in (the `NumberCommit` of `viewkitjs/fields`). The host maps it onto its row, such as a unit onto a currency column.
|
|
@@ -6,7 +6,7 @@ Import from `viewkitjs/views/editors/panel` in a client component: the door open
|
|
|
6
6
|
- On a desktop, your `Popover`, opened on `anchor`: its Escape is the session's (a discard, or a keep where the session keeps), asked once though the popover reports the close it causes right after `onEscape`, unless it comes from inside an element carrying `EDITOR_INNER_ESCAPE`, which the panel answers `false` to so the popover stays open and the editor closes its own list; and a press outside closes with `"outside"`, which the editor answers by its own rule, while the session is open: a press while the popover plays its exit after a close reaches nothing. Its panel carries `data-slot="vk-editor-panel"`.
|
|
7
7
|
- On a phone, your `Sheet`, titled with `title` (the field's name), handed `label` too whenever `title` is words, and a bar with ✕ (`views.editors.discard`) and ✓ (`views.editors.save`). ✕, a swipe, the backdrop and Escape discard; ✓ closes with `"enter"`, as done; a pick in a select saves on its own. With the provider's `sheetActions: "head"` the panel draws no bar: your `Sheet` is handed the ✕ and ✓ as `actions` (`close`, and `done` unless the host passed `savesOnPick`) for its own head. An app's body in the sheet (`TextBody`, `PartsBody`, `ValuesBody` or `LinksBody`) is handed `onStepChange`: while it stands on a step of its own (`ViewsBodyStep`), the sheet is titled with the step's title (and handed it as `label`), Back (`views.editors.back`) stands in the ✕'s place in the bar, or is handed as `actions.back` to a head of your own, and ✓ stays; Back and an Escape your `Sheet` reports as `escape-key` call the step's `onBack`, while a swipe, the backdrop and ✕ still discard the whole edit. Handed `null`, the head is the field's again. An Escape from an element the body marks `EDITOR_INNER_ESCAPE` inside its element is the body's: the sheet stays open. A picker always opens the sheet on a phone. A press inside the sheet stays in it: a click, a double-click or a context menu never bubbles through React's tree to what the panel is drawn in, such as a grid row.
|
|
8
8
|
- A type-in editor (`inPlace`) is drawn where it stands on a desktop, and on a phone too unless its host passes `sheetOnPhone`, which opens it in the sheet.
|
|
9
|
-
- A refusal your `onAttempt` gave (`refusal`) is drawn under the editor, with `role="alert"` and `data-slot="vk-editor-refusal"`, in the popover and the sheet. In place, your own box draws it: pass the children as a function of the `EditorSurface` to know where the editor is.
|
|
10
|
-
- `EditorPanelProps` — what the panel takes: `session` (an `EditSession`, from either mode), `title`, `anchor`, `inPlace` and `sheetOnPhone` (both default false), `snap` (the sheet's hint, default `auto`), the popover's `side`, `align`, `sideOffset`, `alignOffset`, `initialFocus`, `chrome`, `className`, `style` and `panelData`, handed on as they are, `onPanelClick` (a click inside the popover or the sheet; the sheet then keeps it, the popover leaves that to you), `
|
|
9
|
+
- A refusal your `onAttempt` gave (`refusal`) is drawn under the editor, with `role="alert"` and `data-slot="vk-editor-refusal"`, in the popover and the sheet. In place, your own box draws it: pass the children as a function of the `EditorSurface` to know where the editor is.
|
|
10
|
+
- `EditorPanelProps` — what the panel takes: `session` (an `EditSession`, from either mode), `title`, `anchor`, `inPlace` and `sheetOnPhone` (both default false), `snap` (the sheet's hint, default `auto`), the popover's `side`, `align`, `sideOffset`, `alignOffset`, `initialFocus`, `chrome`, `className`, `style` and `panelData`, handed on as they are, `onPanelClick` (a click inside the popover or the sheet; the sheet then keeps it, the popover leaves that to you), `savesOnPick` (default false: the body saves on its pick, a pick of one, so a `Sheet` drawing the panel's buttons in its head is handed no `done`; the panel's own bar keeps its ✓), and `children`: the editor, or a function of the `EditorSurface` the panel chose.
|
|
11
11
|
- `EditorSurface` — where the panel opened its editor: `popover`, `sheet` or `in-place`. An `in-place` editor is drawn in its value's own box, which the panel scrolls into view as the editor opens, at the nearest edge (`scrollIntoView` with `nearest`), when `anchor` is that box: a box partly past the edge of what scrolls it opens whole.
|
|
12
|
-
- `EDITOR_INNER_ESCAPE` — the attribute name (`data-vk-inner-escape`) an editor puts on an inner level of its own, such as a list opened from its boxes, while Escape there closes that level rather than the edit. A popover that hears Escape on the document before the editor does then leaves it to the editor.
|
|
12
|
+
- `EDITOR_INNER_ESCAPE` — the attribute name (`data-vk-inner-escape`) an editor puts on an inner level of its own, such as a list opened from its boxes, while Escape there closes that level rather than the edit. A popover that hears Escape on the document before the editor does then leaves it to the editor. An app's body may carry it on a level inside its own element (a list drawn in its rows' place): that Escape is the body's, and the editor stays open.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/range`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/range` in a client component: the door opens with the client directive. It holds the editor of a `range` field
|
|
3
|
+
Import from `viewkitjs/views/editors/range` in a client component: the door opens with the client directive. It holds the editor of a `range` field, which opens your app's `PartsBody` as `kind: "range"` (`CONTROLS.PartsBody` is ViewKit's own, the Compound editor): two ends, low and high. An empty end is an open end. It owns the draft and what a close means; the body draws; its host owns the popover (the grid's and the field row's open it under the value), the write, and keeping the pair in its own columns. It commits a `RangeValue` of `viewkitjs/fields`, `{ low, high }`, each a number or null. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `RangeEditor` — the
|
|
6
|
-
|
|
7
|
-
Handed `PartsBody` in the components map, the editor opens it in place of its boxes and bands, as `kind: "range"`: it hands the body the two ends, `decimals`, the `suffix` as `unit`, and the `bands` for the body to draw as picks (a band picked closes as `pick`). It keeps the draft, rounds the ends to `decimals` as it closes, and draws no refusal of its own: your panel draws it. Escape, Tab and the close are as above.
|
|
8
|
-
- `RangeEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels, and so does a box holding text that is not a number. Both ends unchanged as the boxes showed them is a `noop`, so a stored 2.555 that opened as 2.56 writes nothing. Two empty boxes cancel, or commit with `allowEmpty`. A low end above the high end commits as typed, for the host's acceptance to refuse in its own words.
|
|
5
|
+
- `RangeEditor` — the range panel; its ref is a `RangeEditorHandle`. It takes `initial` (the stored range, or null) and `onRequestClose`, and optionally `seed` (the character that opened the editor, replacing the low end), `decimals` (default 0), `allowEmpty`, `suffix` (a unit drawn after the high end, such as `%` or a currency code), `conventions` (how a typed seed is read; default: the provider's), `bands` (the field's `presets`) and `label` (the field's name, for your `PartsBody`; default the two ends' words). It hands the body the two ends, `decimals`, the `suffix` as `unit`, and the `bands` for the body to draw as picks (a band picked closes as `pick`, so it is read and judged as typed ends are). It keeps the draft, rounds the ends to `decimals` as it closes, and draws no refusal of its own: your panel draws it. Escape, Tab and the close are the body's frame's: Escape is taken before the body hears it, and Tab walks the body and closes from either end.
|
|
6
|
+
- `RangeEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels, and so does a seed that is not a number, left as typed. Both ends unchanged as the body showed them is a `noop`, so a stored 2.555 that opened as 2.56 writes nothing. Two empty ends cancel, or commit with `allowEmpty`. A low end above the high end commits as handed, for the host's acceptance to refuse in its own words.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/relation`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/relation` in a client component: the door opens with the client directive. It holds the picker for a link, the editor of a `relation` and a `user` field: search the candidates, pick one, and it replaces the link; and the editor of a relation holding several records, which adds and removes links with the list open. The candidates are the host's, through a `RelationSource`: a static list the panel filters on its labels, or a remote search your function answers a page at a time.
|
|
3
|
+
Import from `viewkitjs/views/editors/relation` in a client component: the door opens with the client directive. It holds the picker for a link, the editor of a `relation` and a `user` field: search the candidates, pick one, and it replaces the link; and the editor of a relation holding several records, which adds and removes links with the list open. The candidates are the host's, through a `RelationSource`: a static list the panel filters on its labels, or a remote search your function answers a page at a time. Your `Picker` draws the search box and the rows; the editor owns the filtering, the paging (it waits before a typed query searches, drops an answer a newer query superseded, asks for the next page when your Picker calls `onMore`, and hands `doing: "searching"` from the keystroke until the typed query answers, with none of the last answer's rows, so nothing can be picked meanwhile, and `failed` when it failed) and, in `RelationEditor`, what a close means: a pick is the commit, every other close discards (`RelationSetEditor` saves on every close but Escape). It never does the asking itself, so access stays in your function's closure. Its host owns the popover, the anchor and the write. It commits the picked id, or null for None. The door also re-exports `RelationCandidate`, `RelationSearch` and `RelationSource`, which are documented with the root door. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `RelationEditor` — the relation-picking panel,
|
|
5
|
+
- `RelationEditor` — the relation-picking panel, opened in your app's `Picker` (the list filtered or fetched by the editor, the create rows as its `actions`); its ref is a `RelationEditorHandle`. It takes `candidates` (the `RelationSource`), `initial` (the linked id, or null), `clearable` (the Picker's empty row, for a link the surface says is optional), `onRequestClose` (called with `pick` when someone chooses), `kindGlyph` (the glyph worn by every candidate with no icon of its own), `noneLabel` (the surface's words for the empty row), `message` (the fields message resolver, defaulting to the provider's conventions), `creates` (`RelationCreate` rows, handed as the Picker's actions after the rows), `seed` (the text the search opens with, such as a letter typed on the cell that opened it), `label` (the field's name, for your `Picker`; default the search's words) and `focusSearch` (your Picker takes the focus as the panel opens; off by default, and left off on a phone so its sheet opens with the keyboard down). A candidate's `sublabel` is handed as its row's line and its `badge` as its badge.
|
|
6
6
|
- `RelationEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. It answers `commit` with the picked id, or null for None, only for `pick` and only when it differs from `initial`; `noop` for a `pick` with nothing picked or the link already held; `cancel` for every other reason.
|
|
7
|
-
- `RelationCreate` — a row
|
|
7
|
+
- `RelationCreate` — a row after the list for a record that isn't in it yet, handed your Picker as an action: `label(query)` gives its words from the trimmed query, and `onCreate(query)` runs after the host has been asked to close, so your own create form opens with what was typed. In `RelationEditor` a click on it is a `pick` that resolves `noop`: nothing is written. In `RelationSetEditor` it saves the set as it stands first. The grid writes a record your form links on top of that save however soon you call the link, even before the editor has finished closing.
|
|
8
8
|
- `RELATION_SEARCH_DEBOUNCE_MS` — 200: how many milliseconds a typed query waits before a remote search runs. The empty query runs at once, so the panel opens on a first page.
|
|
9
9
|
- `RELATION_PAGE_SIZE` — 20: the rows per page when a remote source names no `pageSize`. A page shorter than the size ends the list.
|
|
10
|
-
- `RelationSetEditor` — the editor of a relation holding several records,
|
|
10
|
+
- `RelationSetEditor` — the editor of a relation holding several records, in your app's `Picker`; its ref is a `RelationSetEditorHandle`. It takes `candidates`, `initial` (the linked records as `RelationSetItem`s, in their stored order), `lead` (the field leads by a flag), `onRequestClose` (called with `tab` or `shift-tab` from inside the body, and with `pick` from a create row or the body's `onDone`, which saves the set; through your `LinksBody`, also with `escape` from inside it), `kindGlyph`, `message`, `creates`, `seed`, `label` and `focusSearch`, as `RelationEditor` does, and `links` (the field's `links`: handed, the set opens your `LinksBody`, handed each link's roles, the field's roles and the lead, and saves what it sets; left out, your `Picker`, with the linked records held and, where the field leads, `lead`). The linked records are handed first and chosen, whatever page a remote search holds, and filtered by the query on their labels; a pick of a candidate adds it to the end of the set, a pick of a linked record removes it, and the list stays open. With `lead`, the first link leads, and removing the lead passes it to the next; a set stored with none marked reads its first link as the lead.
|
|
11
11
|
- `RelationSetEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. It answers `cancel` for `escape`; for every other reason, `noop` when the set holds the same records in the same order as it opened, each with the roles it opened with, else `commit` with the whole set as `RelationDraftLink[]` (from `viewkitjs/fields`), in order with the lead first: each link's `id`, its `kind` where known, its roles, and with `lead`, `primary` on every link, true on the first. A link keeps the `role` and `roles` it was stored with (a new link has neither) unless your `LinksBody` sets its roles; then it writes the key it was stored with: `role` (its first role, or null) on a link stored with `role`, `roles` on one stored with `roles`, `roles` beside `role` on a link stored with `role` alone once it holds two or more, and `roles` alone on a new link once it holds one.
|
|
12
12
|
- `RelationSetItem` — one linked record as the set editor holds it: a `RelationDraftLink` with the `label` its row shows and an optional `icon`.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/select`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/select` in a client component: the door opens with the client directive. It holds the picker for one value out of a set, the editor of a `select` and a `status` field.
|
|
3
|
+
Import from `viewkitjs/views/editors/select` in a client component: the door opens with the client directive. It holds the picker for one value out of a set, the editor of a `select` and a `status` field. Your `Picker` draws the options, handed as data with their slot or colour; the editor owns what a close means: a pick is the commit, and every other close discards. Its host owns the popover, the anchor, the exit gap and the write. It commits the picked option's `value`, a string, and `""` for None, which a host maps to null. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `SelectEditor` — the option-picking panel; its ref is a `SelectEditorHandle`. It takes `options` (`PickerOption`s in display order, colours already resolved), `initial` (the value the surface holds,
|
|
5
|
+
- `SelectEditor` — the option-picking panel, opened in your app's `Picker`, handed the options as data; its ref is a `SelectEditorHandle`. It takes `options` (`PickerOption`s in display order, colours already resolved), `steps` (a status's active steps, handed your Picker by value), `initial` (the value the surface holds, held in the list), `clearable` (the Picker's empty row, for a value the surface says is optional; picking it commits ""), `onRequestClose` (called with `pick` when someone chooses, and with `tab` or `shift-tab`, which pick nothing) and `message` (the fields message resolver, defaulting to the provider's conventions). With `creatable`, for an open select, your Picker is handed `onCreate`: a typed word no option's value is, ignoring case, is committed trimmed; one an option names picks that option. `seed` is the text the search opens with (a letter typed on the cell that opened it); `focusSearch` gives your Picker the focus as it opens. `focusList`, for a host opened from the keyboard, makes the held row the keys' place, so an Enter at once changes nothing and ↓ goes on to the next option; opened by a pointer, ↓ and ↑ still go on from the held row (`fromHeld`). `addOption`, an `OptionAdd` from your app, hands your Picker **+ Add** (`onAdd`, with `adding` while your app answers and `addRefused` for a refusal or a failure) and no `onCreate`: a typed word an option already names (its label or value, ignoring spaces at either end, case and accents) picks that option without asking; otherwise your app is asked once, and the option it returns is picked once `options` carry it (after five seconds without it, `addRefused` says so). Any close cancels an add in flight.
|
|
6
6
|
- `SelectEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. It answers `commit` with the picked value only for `pick`, and only when the pick differs from `initial` (`""` and null are the same absence); `noop` for a `pick` with nothing picked or the value already held; `cancel` for every other reason, so Escape and an outside click discard.
|
|
7
|
-
- `SELECT_SEARCH_PAST` — the number of options a closed list holds before
|
|
7
|
+
- `SELECT_SEARCH_PAST` — the number of options a closed list holds before the Picker shows its search: 8.
|
|
8
8
|
- `PickerOption` — one option as the panel draws it: its `value` and `label`, and a `slot` (a status's lifecycle state, drawn as your status badge) or a `color` (a category colour, drawn as your tag), or neither for a plain label. `icon` names your app's glyph, drawn before the label. Colours are resolved by the caller, never by the panel.
|
|
9
9
|
- `pickerOptionsFromField` — a select or status field's options dressed the way its cells draw them, so a pick in a form looks like the grid. Archived options are left out. A status keeps each option's slot (`muted` when it names none); a select takes the category colour chain: your `optionColors` overrides, then the field's own colour, then the derived hue. Each option's icon is carried. `extraValues` adds an open select's values, the ones its records hold, labelled with their raw code; an archived value stays out. `current` is the value your surface holds: offered after the options when no active option is it, labelled with its archived option's label or its raw code, so its own list shows it checked. A closed list gets no `extraValues`, so a stray value shows only on the record that holds it.
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/text`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/text` in a client component: the door opens with the client directive. It holds the one editor for every text-like value: `text`, `url`, `domain`, `email`, `phone` and `rich_text`, a line or a paragraph. It tidies what was typed (trimmed; rich text tidied only at its edges, with fields' `normalizeMarkdown`, so its first line keeps its indent), and an unchanged value closes as no save. It owns
|
|
3
|
+
Import from `viewkitjs/views/editors/text` in a client component: the door opens with the client directive. It holds the one editor for every text-like value: `text`, `url`, `domain`, `email`, `phone` and `rich_text`, a line or a paragraph. It tidies what was typed (trimmed; rich text tidied only at its edges, with fields' `normalizeMarkdown`, so its first line keeps its indent), and an unchanged value closes as no save. It owns what a close means; its host owns where it opens (in place, a popover, a sheet), the session and the write. It commits a string. Guide: [editors](../guides/editors.md#a-text-box).
|
|
4
4
|
|
|
5
|
-
- `
|
|
6
|
-
- `
|
|
5
|
+
- `TextEditorHost` — the editor (the Text editor's body alone is `TextEditor`, on `viewkitjs/views/controls`); its ref is a `TextEditorHandle`. It opens the components map's `TextBody` (required; `CONTROLS.TextBody` is ViewKit's own) in a frame carrying `data-slot="vk-text-body"`: it hands the body the draft and the field's settings (`ViewsTextBodyProps`), and keeps the draft, Escape's rule, Tab and Shift-Tab (`"tab"` and `"shift-tab"`), ⌘ or Ctrl Enter (closes as `"enter"`), in place a press outside (`"blur"`, unless `closeOnBlur` is false), the close's tidy (a line's line breaks become a space; a phone that reads as the stored number is a `noop`) and the save. A text shown only to be read (`readOnly`) has no body form: the editor draws its own textarea, focused without scrolling, its caret at the end, carrying `data-slot="vk-text-editor"`; its keys ask the same closes, and every close is a `noop`.
|
|
6
|
+
- `TextEditorHostProps` — `type` (a `TextEditorType`), `initial` (the stored value, `""` when unset), `onRequestClose`, and optionally `seed` (type-to-replace: the draft opens on it, compared against `initial`), `multiline` (a paragraph; the default for rich text), `readOnly` (the editor's own textarea, every close a `noop`), `closeOnBlur` (default true; a host in a popover or a sheet passes false), `label` (the box's accessible name), and for the body: `check` (the host's reading of a value), `region` (a phone's country, handed to the body and read by its close), `escapeKeeps` (the session keeps on Escape: the frame carries `EDITOR_INNER_ESCAPE`), `form` (`phone` in a sheet, default `computer`) and `place` (`cell`, the default, in a grid cell; `row` in a field row, where the body stands in the row's flow); and for the read-only textarea: `rows` and `maxLines` (it opens at `rows`, default 1, and grows with its text to `maxLines`, default 12, then scrolls), `className`, `style` and `boxData` (`data-*` attributes set on it, over its own slot).
|
|
7
7
|
- `TextEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Read-only answers `noop`; Escape cancels; otherwise the tidied draft against the tidied `initial`: equal is a `noop`, different a `commit` of the tidied draft.
|
|
8
8
|
- `TextEditorType` — the types it edits: `text`, `url`, `domain`, `email`, `phone`, `rich_text`.
|
|
9
|
-
- `TEXT_INPUT_TYPE` — the native input type per `TextEditorType`, the phone keyboard each brings: `text` and `rich_text` `text`, `url` and `domain` `url`, `email` `email`, `phone` `tel`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/value-list`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/value-list` in a client component: the door opens with the client directive. It holds the editor of a field holding several values of one kind (a `multiple` email, phone, url or domain field), each with its label and one of them the main one. It is a draft, like the chips editor: the whole list commits once when the host closes it. It owns the
|
|
3
|
+
Import from `viewkitjs/views/editors/value-list` in a client component: the door opens with the client directive. It holds the editor of a field holding several values of one kind (a `multiple` email, phone, url or domain field), each with its label and one of them the main one, which opens your app's `ValuesBody` (`CONTROLS.ValuesBody` is ViewKit's own, the Values editor). It is a draft, like the chips editor: the whole list commits once when the host closes it. It owns the draft, the reading of each value and what a close means; the body draws; its host owns the popover, the anchor and the write. It commits a list of `ValueItem`s of `viewkitjs/fields`, `{ value, label, main }`, the main one first, or null. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `ValueListEditor` — the list
|
|
6
|
-
- `ValueListEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels; any other close keeps what was built. Blank
|
|
5
|
+
- `ValueListEditor` — the value list panel; its ref is a `ValueListEditorHandle`. Each value is read by its type's own rule (the field's single-value commit: an email's shape, a domain cleaned, a phone read in the region): the body is handed it as `check`, to say a value's reason as it is added or changed. It takes `field`, `initial` (the stored list, as items or as plain values) and `onRequestClose`, and optionally `labels` (default true; false hands the body no labels and commits every label null), `allowEmpty`, `region` (the record's country, where a phone typed without its country code is read; else the conventions' region), `escapeKeeps` (a host whose session keeps, `EditSession.keeps`: the body's Escape is left to the host, which checks the list first), `label` (the field's name for your `ValuesBody`; default `field.label`), `holds` (`"one"`: one line with no main mark, no label and no line to add another; default `"several"`) and `seed` (what was typed on what opened it: the first value starts as it).
|
|
6
|
+
- `ValueListEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels; any other close keeps what was built. Blank values are dropped. A value handed back as it was drawn keeps its stored value exactly as stored, and a value typed commits its trimmed text for the field's commit to read. With no main mark the first is the main one. The same values, labels and main as opened is a `noop`; an empty list commits null with `allowEmpty` and cancels without it.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Import from `viewkitjs/views/field-row` in a client component, under your `ViewsProvider`: the door opens with the client directive. It holds a record's field row: one field drawn as its label, its value and, on a click, its type's editor in place, and the write path that admits each edit at once, queues one record's writes, settles each on the save's receipt and rolls a failure back. The row knows no entity, only a binding, a value and a commit, so your app builds its record's panel (its sections, its related records) around the rows. It draws with your provider's `Popover`, `Sheet`, `Collapse`, `AppIcon`, icons, `CommandMenu` atom and toast port. The shapes its writes go through (the write target, the receipt, the admission, a value's note, the reconciliation error) are the root door's, described under [A write's target](views.md#a-writes-target), and this door re-exports them. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `FieldRow` — one field of a record: a glyph (the binding's `icon` through your `AppIcon`, else the type's icon), the label, and the value drawn by the display. Below the provider's `desktopQuery` the label stands above the value, which then takes the row's width; at it and above, glyph, label and value share one line. A writable row holding nothing draws your `views.field-row.empty` word, muted; a read-only one draws "—". A writable row's edit button is named by the label, then the value as it is drawn ("Stage, Won"; "Terms, Empty" for a row holding nothing); a row still loading, and a rich text laid over its button, are named by the label alone. A writable row opens its type's editor on a click, through the editor panel and one edit session: a picker (a select, a date, several tags, a relation or a set of records, several values, a place) anchored under the value in your `Popover` on a desktop and in your `Sheet` on a phone, by the provider's `desktopQuery`; a typed value (text, a number, money
|
|
5
|
+
- `FieldRow` — one field of a record: a glyph (the binding's `icon` through your `AppIcon`, else the type's icon), the label, and the value drawn by the display. Below the provider's `desktopQuery` the label stands above the value, which then takes the row's width; at it and above, glyph, label and value share one line. A writable row holding nothing draws your `views.field-row.empty` word, muted; a read-only one draws "—". A writable row's edit button is named by the label, then the value as it is drawn ("Stage, Won"; "Terms, Empty" for a row holding nothing); a row still loading, and a rich text laid over its button, are named by the label alone. A writable row opens its type's editor on a click, through the editor panel and one edit session: a picker (a select, a date, several tags, a relation or a set of records, several values, a place) anchored under the value in your `Popover` on a desktop and in your `Sheet` on a phone, by the provider's `desktopQuery`; a typed value (text, a number, money) in its own box on every width; a name and a range open your `PartsBody` anchored under the value, as a place does; and a single email or domain opens the value list holding one value, anchored, where the provider's `oneValue` says `list` for its type. Escape throws the edit away, unless the provider's `escape` keeps the field's type, on a desktop, where it keeps what was typed and a refusal stays open until a second Escape throws the edit away; a sheet's swipe or ✕ changes nothing. On a desktop the date editor opens with the keyboard in your `DateBody`, as a place's or a long select's does; and with an editor open in its popover, an Escape heard from the page itself or from an element holding the row closes that editor and goes no further, so a drawer around the row hears only the next one. On a desktop, a select gives your Picker the keys however it opened, by Enter, Space or a pointer: the focus in its search, the arrows going on from the value it holds, and Enter picking the one lit (opened by a key, an Enter at once changes nothing). On a desktop, an editor closed by Tab, Shift-Tab, Escape, Enter or a pick puts the focus back on the row's own button, once its exit has played out and a write still saving has saved, so the next Tab moves on from that row; a press or a focus outside an editor's panel since the close lets that go, so a row opened meanwhile keeps its editor, and an outside press leaves the focus where it put it. A relation saves what its row stores (an id, a ref with the picked record's kind, or a set of records with its lead); a date field has no time and offers No date where it may be empty; several values read a phone typed without its code in the binding's `region`. A value of several parts inside a writable row draws its count as plain text: the row's press opens the editor, which lists them all. A single email, phone, link or domain in a writable row reads as plain text too, with an open action beside the row's button (a mail, a call, the site), and a writable rich text lies over its button, so its links and "Show more" keep their own press while a press on its text edits. A money figure its host reads in another currency than the record's own (it hands the converted figure as `value` and that currency as `opts.currency`) is marked ≈ with the currency it came from, and its editor names it under the record's own amount. A boolean commits from its own control, a `command` field opens its verbs, and a read-only row draws a lock with its reason. A refused commit keeps the editor open with the reason under it, a saved value shows at once and stays until the receipt settles it, and a failed save rolls back with a retry. A text, an email, a phone, a link, a domain, long or rich text edits in place in the row; handed the components map's `TextBody`, the row opens it there, at every width, with the field's own check and the record's country. A number, money or a percent edits in place too; handed `NumberBody`, the row opens it there, at every width, with the field's own check and its limits (a duration keeps the editor's own box).
|
|
6
6
|
- `FieldRowProps` — the row's props: `binding`, `row`, `value` (the display value), `editValue` (the stored value the editor opens on), `writable`, `ready` (false refuses gestures while the record loads), `unread` (the value isn't read yet, drawn blank), `refusal` (why it's read-only here), `onCommit` (admits or refuses a draft, then settles; an editor still open when the page or the row goes is asked as for a press outside, so it can be called inside `pagehide`), `opts` (display options), `menu` (a `command` field's verbs), `meta` (a few words in the value's line), `note` (a sentence under the value, with an optional quote a tap opens) and `kindIcon` (your icon name for a record kind, the glyph a relation's candidates wear; unanswered, they wear the type's glyph).
|
|
7
7
|
- `RowEditor` — the editor a row mounts for its field's type, picked from `ROW_HOSTS`.
|
|
8
8
|
- `ROW_HOSTS` — the host each field type mounts in a row, or `null` for a type the row never opens (a boolean, a derived or system field).
|