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
|
@@ -22,8 +22,7 @@ export type ViewsButtonProps = {
|
|
|
22
22
|
children?: ReactNode;
|
|
23
23
|
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
24
24
|
disabled?: boolean;
|
|
25
|
-
/** `secondary` is handed only to the views picker's chip
|
|
26
|
-
* chip with no border. */
|
|
25
|
+
/** `secondary` is handed only to the views picker's chip: a filled chip with no border. */
|
|
27
26
|
variant?: "default" | "secondary" | "ghost" | "outline" | "destructive";
|
|
28
27
|
size?: "default" | "sm" | "icon";
|
|
29
28
|
type?: "button" | "submit";
|
|
@@ -45,18 +44,15 @@ export type ViewsButtonProps = {
|
|
|
45
44
|
"aria-disabled"?: boolean;
|
|
46
45
|
/** The ids of what describes it: why it can't be used, on a button with a reason. Forward it to your element. */
|
|
47
46
|
"aria-describedby"?: string;
|
|
48
|
-
/** A toggle's state: the Columns list's new-line mark, and the quick filters' open field
|
|
49
|
-
* `panelButtons` is `button`. */
|
|
47
|
+
/** A toggle's state: the Columns list's new-line mark, and the quick filters' open field. */
|
|
50
48
|
"aria-pressed"?: boolean;
|
|
51
|
-
/** `option` on a view's row in the picker
|
|
49
|
+
/** `option` on a view's row in the picker. */
|
|
52
50
|
role?: "option";
|
|
53
51
|
/** Whether that row is the current view, with `role` `option`. */
|
|
54
52
|
"aria-selected"?: boolean;
|
|
55
|
-
/** `open` while the list a views-row chip or a view's ⋯ opens is open, `closed` otherwise
|
|
56
|
-
* `button`. */
|
|
53
|
+
/** `open` while the list a views-row chip or a view's ⋯ opens is open, `closed` otherwise. */
|
|
57
54
|
"data-state"?: "open" | "closed";
|
|
58
|
-
/** An actions row a host insets through `[data-vs-row]`: the Options panel's Export
|
|
59
|
-
* `button`. Forward it to your element. */
|
|
55
|
+
/** An actions row a host insets through `[data-vs-row]`: the Options panel's Export. Forward it to your element. */
|
|
60
56
|
"data-vs-row"?: boolean;
|
|
61
57
|
};
|
|
62
58
|
export type ViewsPopoverProps = {
|
|
@@ -118,9 +114,8 @@ export type ViewsCheckboxProps = {
|
|
|
118
114
|
* whose partial state is a live selection. */
|
|
119
115
|
partialTone?: "muted" | "brand";
|
|
120
116
|
disabled?: boolean;
|
|
121
|
-
/** Shown as it is and not pressable, unlike `disabled`, which greys it: a yes/no cell the grid can't write
|
|
122
|
-
*
|
|
123
|
-
* `checkbox`. Forward it to your control; absent means false. */
|
|
117
|
+
/** Shown as it is and not pressable, unlike `disabled`, which greys it: a yes/no cell the grid can't write, or a
|
|
118
|
+
* field row's yes/no it can't write. Forward it to your control; absent means false. */
|
|
124
119
|
readOnly?: boolean;
|
|
125
120
|
className?: string;
|
|
126
121
|
tabIndex?: number;
|
|
@@ -605,6 +600,10 @@ export type ViewsTextBodyProps = {
|
|
|
605
600
|
autoFocus: boolean;
|
|
606
601
|
/** `phone`: it stands in a sheet; draw no ✕, ✓ or Cancel of your own (the sheet holds them). */
|
|
607
602
|
form: "computer" | "phone";
|
|
603
|
+
/** Where it stands on a computer: `cell`, a grid cell, whose box it fills and may grow past over the rows below; `row`,
|
|
604
|
+
* a record's field row, in the row's flow, so the row grows with it and nothing that clips the row cuts it. ViewKit's
|
|
605
|
+
* editors always hand it; absent (a page drawing the body alone), `cell`. */
|
|
606
|
+
place?: "cell" | "row";
|
|
608
607
|
/** In the phone's sheet: tell it you stand on a step of your own (a list of countries, a label's list), and hand
|
|
609
608
|
* `null` once you are back. The sheet's head shows the step's title, Back in ✕'s place and ✓; Escape calls `onBack`;
|
|
610
609
|
* a swipe still closes the whole editor, as ✕ does. Absent on a computer. */
|
|
@@ -918,9 +917,8 @@ export type ViewsFieldsBodyProps = {
|
|
|
918
917
|
/** Done with no pick: what holds the list closes (on a phone, the sheet's body turns back). */
|
|
919
918
|
onDone: () => void;
|
|
920
919
|
};
|
|
921
|
-
/** A filter rule's part, which your app draws (`FilterPartBody`
|
|
922
|
-
*
|
|
923
|
-
* of ViewKit's ways menu and value body. Handed the rule as data, it hands back the rule changed; ViewKit checks it,
|
|
920
|
+
/** A filter rule's part, which your app draws (`FilterPartBody`; `CONTROLS.FilterPartBody` is ViewKit's own): what a
|
|
921
|
+
* filter's way and its value on the bar open. Handed the rule as data, it hands back the rule changed; ViewKit checks it,
|
|
924
922
|
* keeps a rule held until whole, and writes it. Never opened inside `FilterBody`'s `ruleValue`. */
|
|
925
923
|
export type ViewsFilterPartBodyProps = {
|
|
926
924
|
/** Which part opened it: `way`, how the rule compares; `value`, what it compares with. */
|
|
@@ -1294,8 +1292,87 @@ export type ViewsCustomizeColumns = {
|
|
|
1294
1292
|
/** Your field editor's rows under the columns (Add field, the archived fields). */
|
|
1295
1293
|
footer?: ReactNode;
|
|
1296
1294
|
};
|
|
1295
|
+
/** A list's per-field filter, its time range or a date range, as a Customize body is handed it: its row's words, what it
|
|
1296
|
+
* holds and its screen's content, exactly one of `pick`, `check`, `time`, `dates` and `body`. Each is written through its
|
|
1297
|
+
* own change. */
|
|
1298
|
+
export type ViewsCustomizeField = {
|
|
1299
|
+
key: string;
|
|
1300
|
+
label: string;
|
|
1301
|
+
icon?: ReactNode;
|
|
1302
|
+
/** The heading its row stands under (a filter's section). */
|
|
1303
|
+
section?: string;
|
|
1304
|
+
/** What it holds, in words ("All", "2 selected", "Last 30 days"). */
|
|
1305
|
+
says: string;
|
|
1306
|
+
inForce: boolean;
|
|
1307
|
+
/** Why it can't be opened: its row says so and opens nothing. */
|
|
1308
|
+
disabled?: string;
|
|
1309
|
+
/** Where its row stands: with the filters (after Columns), or after Group (a time range, a date range). */
|
|
1310
|
+
place: "filters" | "after";
|
|
1311
|
+
/** Asked once each time its screen opens (a field's values loading). */
|
|
1312
|
+
onOpen?: () => void;
|
|
1313
|
+
/** One value picked from a few (its All choice first, where the list has one); an option's `mark` stands before its name. */
|
|
1314
|
+
pick?: {
|
|
1315
|
+
value: string;
|
|
1316
|
+
options: readonly {
|
|
1317
|
+
value: string;
|
|
1318
|
+
label: string;
|
|
1319
|
+
mark?: ReactNode;
|
|
1320
|
+
}[];
|
|
1321
|
+
onChange: (value: string) => void;
|
|
1322
|
+
};
|
|
1323
|
+
/** Several values checked. */
|
|
1324
|
+
check?: {
|
|
1325
|
+
value: readonly string[];
|
|
1326
|
+
options: readonly {
|
|
1327
|
+
value: string;
|
|
1328
|
+
label: string;
|
|
1329
|
+
mark?: ReactNode;
|
|
1330
|
+
}[];
|
|
1331
|
+
onChange: (value: readonly string[]) => void;
|
|
1332
|
+
};
|
|
1333
|
+
/** A time range: its presets, and Custom, a range picked on a calendar, where the list offers it. Days are ISO days. */
|
|
1334
|
+
time?: {
|
|
1335
|
+
value: string;
|
|
1336
|
+
options: readonly {
|
|
1337
|
+
value: string;
|
|
1338
|
+
label: string;
|
|
1339
|
+
}[];
|
|
1340
|
+
onChange: (value: string) => void;
|
|
1341
|
+
custom?: {
|
|
1342
|
+
label: string;
|
|
1343
|
+
/** The custom range in words, while it is the one in force. */
|
|
1344
|
+
says?: string;
|
|
1345
|
+
on: boolean;
|
|
1346
|
+
from: string | null;
|
|
1347
|
+
to: string | null;
|
|
1348
|
+
/** A day pressed on its calendar: the range the calendar makes of it, and the day itself. */
|
|
1349
|
+
onPress: (next: {
|
|
1350
|
+
from: string | null;
|
|
1351
|
+
to: string | null;
|
|
1352
|
+
}, day: string | null) => void;
|
|
1353
|
+
};
|
|
1354
|
+
};
|
|
1355
|
+
/** A date range picked on a calendar. Days are ISO days. */
|
|
1356
|
+
dates?: {
|
|
1357
|
+
from: string | null;
|
|
1358
|
+
to: string | null;
|
|
1359
|
+
onChange: (next: {
|
|
1360
|
+
from: string | null;
|
|
1361
|
+
to: string | null;
|
|
1362
|
+
}) => void;
|
|
1363
|
+
};
|
|
1364
|
+
/** Any other kind of filter (text, a number, a date, a relation, or a select that draws its options its own way): ViewKit's
|
|
1365
|
+
* own body for its value. */
|
|
1366
|
+
body?: ReactNode;
|
|
1367
|
+
};
|
|
1368
|
+
/** A list's per-field filters, its time range and its date ranges, as a Customize body is handed them. */
|
|
1369
|
+
export type ViewsCustomizeFields = {
|
|
1370
|
+
/** Behind one Filter row (a list), or each its own row (a dashboard). */
|
|
1371
|
+
folded: boolean;
|
|
1372
|
+
items: readonly ViewsCustomizeField[];
|
|
1373
|
+
};
|
|
1297
1374
|
/** Customize's body, which your app draws (`CustomizeBody`): what Options opens on a computer and in the phone's Sheet,
|
|
1298
|
-
*
|
|
1375
|
+
* wherever ViewKit draws Customize: ViewKit draws none of its own. A panel's body, as every panel's, holding
|
|
1299
1376
|
* several values: each section is handed as data and written through its own change, and the sort, filter and group
|
|
1300
1377
|
* are handed as their own slots' bodies are. The view's name, Copy link and Export are your app's to hand it. */
|
|
1301
1378
|
export type ViewsCustomizeBodyProps = {
|
|
@@ -1306,11 +1383,12 @@ export type ViewsCustomizeBodyProps = {
|
|
|
1306
1383
|
onPageChange: (page: ViewsCustomizePage) => void;
|
|
1307
1384
|
/** The layouts and the layout in use's settings, where the list has layouts. */
|
|
1308
1385
|
layout?: ViewsCustomizeLayout;
|
|
1309
|
-
/** The columns, where
|
|
1386
|
+
/** The columns, where the layout in use has a Columns section (`columnsFor`, else the layout's sub-options). */
|
|
1310
1387
|
columns?: ViewsCustomizeColumns;
|
|
1311
|
-
/** The filter as and/or groups, as `FilterBody` is handed it on a phone: the whole filter, 3 levels deep.
|
|
1312
|
-
* filter is only per-field values (no filter tree), ViewKit draws its own Customize instead of the body. */
|
|
1388
|
+
/** The filter as and/or groups, as `FilterBody` is handed it on a phone: the whole filter, 3 levels deep. */
|
|
1313
1389
|
filter?: Omit<ViewsFilterBodyProps, "form" | "onDone" | "actions" | "onStepChange">;
|
|
1390
|
+
/** The per-field filters, the time range and the date ranges, where the list hands them. */
|
|
1391
|
+
fields?: ViewsCustomizeFields;
|
|
1314
1392
|
/** The sort, as `SortBody` is handed it: a list with one sort as one rule, `max` 1. */
|
|
1315
1393
|
sort?: Omit<ViewsSortBodyProps, "form" | "onDone" | "actions" | "onStepChange">;
|
|
1316
1394
|
/** The group, as `GroupBody` is handed it. */
|
|
@@ -1359,25 +1437,6 @@ export type ViewsCustomizeBodyProps = {
|
|
|
1359
1437
|
/** Where the editor panel's ✕ and ✓, and a toolbar panel's ✕, stand on a phone: `bar`, the panel's own inside the
|
|
1360
1438
|
* Sheet; `head`, handed to the Sheet as `actions` for its own head, with none drawn inside. */
|
|
1361
1439
|
export type ViewsSheetActionsPlace = "bar" | "head";
|
|
1362
|
-
/** How the grid opens its own menus (a column's, a footer's figure picker, a group's ⋯, Add column):
|
|
1363
|
-
* `popover`, ViewKit's rows in your `Popover`; `menu`, your `Menu`, handed rows as data. The row menu and
|
|
1364
|
-
* a command cell's menu always go through your `Menu`. */
|
|
1365
|
-
export type ViewsMenuRoute = "popover" | "menu";
|
|
1366
|
-
/** Who draws the buttons the grid draws itself (a group's fold and ⋯, "+ Add column", a row's ⋯, the name's actions,
|
|
1367
|
-
* an action column's buttons, a pick-list cell's ▾): `own`, ViewKit's, as on 0.5.0; `button`, your `Button`. */
|
|
1368
|
-
export type ViewsGridButtons = "own" | "button";
|
|
1369
|
-
/** Who draws a yes/no cell's box in the grid (the checkbox style): `own`, ViewKit's tick box in its own button, as
|
|
1370
|
-
* on 0.5.0; `checkbox`, your `Checkbox`, the box your rail draws. */
|
|
1371
|
-
export type ViewsGridCheckboxes = "own" | "checkbox";
|
|
1372
|
-
/** Who draws a field row's own buttons (its edit target, the verb trigger around a value, the lane's ▾, rich text's
|
|
1373
|
-
* Show more): `own`, ViewKit's, as on 0.5.0; `button`, your `Button`. */
|
|
1374
|
-
export type ViewsFieldRowButtons = "own" | "button";
|
|
1375
|
-
/** Who draws the buttons the toolbar's panels, the search's ✕ and the views row draw themselves: `own`, ViewKit's,
|
|
1376
|
-
* as on 0.6.0; `button`, your `Button`. */
|
|
1377
|
-
export type ViewsPanelButtons = "own" | "button";
|
|
1378
|
-
/** Who draws a field row's yes/no box (the checkbox style): `own`, ViewKit's tick box in its own button, as on 0.5.0;
|
|
1379
|
-
* `checkbox`, your `Checkbox`, a Tab stop as the row's own switch is. */
|
|
1380
|
-
export type ViewsFieldRowCheckboxes = "own" | "checkbox";
|
|
1381
1440
|
/** Where the selection bar's fixed box sits on one form. `bottom` is a CSS length (default
|
|
1382
1441
|
* `calc(1rem + env(safe-area-inset-bottom))`), `zIndex` its layer (default 50), and `className` the app's
|
|
1383
1442
|
* own classes on the box (a hook its CSS reads, a rule that hides the bar). */
|
|
@@ -1393,17 +1452,14 @@ export type ViewsSelectionBarSettings = {
|
|
|
1393
1452
|
phoneQuery?: string;
|
|
1394
1453
|
desktop?: ViewsBarPlacement;
|
|
1395
1454
|
phone?: ViewsBarPlacement;
|
|
1396
|
-
/** Who draws the count chip that clears the selection on the desktop: `own` (the default), ViewKit's, as on 0.5.0;
|
|
1397
|
-
* `button`, your `Button`. */
|
|
1398
|
-
chip?: ViewsSelectionChip;
|
|
1399
1455
|
};
|
|
1400
|
-
/**
|
|
1401
|
-
*
|
|
1402
|
-
export type ViewsSelectionChip = "own" | "button";
|
|
1403
|
-
/** A phone sheet. `snap` is a hint: an app whose sheet has no snap points ignores it. */
|
|
1456
|
+
/** A phone sheet. `snap` is a hint: an app whose sheet has no snap points ignores it. The Sheet pads its body; a body
|
|
1457
|
+
* draws no side inset of its own: stand what it holds in your phone's side padding, as `CONTROLS.Sheet` does. */
|
|
1404
1458
|
export type ViewsSheetProps = {
|
|
1405
1459
|
open: boolean;
|
|
1406
1460
|
onOpenChange: ViewsOpenChange;
|
|
1461
|
+
/** Its title. Absent, with `label` alone handed, what it holds heads itself (a toolbar panel, its own title and ✕ in
|
|
1462
|
+
* its body): draw no title or close of your own over it. */
|
|
1407
1463
|
title?: ReactNode;
|
|
1408
1464
|
/** The title in words, whenever the title is words: the sheet's accessible name, and the title of
|
|
1409
1465
|
* a head that takes only text. Absent for a title that is something else (a header with a glyph). */
|
|
@@ -1448,11 +1504,11 @@ export type ViewsComponents = {
|
|
|
1448
1504
|
Tooltip: ComponentType<ViewsTooltipProps>;
|
|
1449
1505
|
Checkbox: ComponentType<ViewsCheckboxProps>;
|
|
1450
1506
|
Menu: ComponentType<ViewsMenuProps>;
|
|
1451
|
-
/**
|
|
1452
|
-
*
|
|
1507
|
+
/** @deprecated Read by nothing: the grid's menus are your `Menu` and every list an editor opens is your `Picker`.
|
|
1508
|
+
* Leave it out; it goes at a later minor. */
|
|
1453
1509
|
Command?: ViewsCommandParts;
|
|
1454
|
-
/** Optional: the
|
|
1455
|
-
*
|
|
1510
|
+
/** Optional: the filter's month draws through it (the date editor opens `DateBody`). Reached without one, it throws
|
|
1511
|
+
* an error naming it. */
|
|
1456
1512
|
Calendar?: ComponentType<ViewsCalendarProps>;
|
|
1457
1513
|
Collapse: ComponentType<ViewsCollapseProps>;
|
|
1458
1514
|
Sheet: ComponentType<ViewsSheetProps>;
|
|
@@ -1474,63 +1530,57 @@ export type ViewsComponents = {
|
|
|
1474
1530
|
/** Optional: every editor's single-line box draws through it. Left out, the provider draws a
|
|
1475
1531
|
* plain `<input>`. */
|
|
1476
1532
|
Input?: ComponentType<ViewsInputProps>;
|
|
1477
|
-
/**
|
|
1478
|
-
* editors open it, handed their rows as data
|
|
1479
|
-
Picker
|
|
1480
|
-
/**
|
|
1481
|
-
* whose field declares `links` opens it, handed each link's roles, the lead and the field's
|
|
1482
|
-
*
|
|
1483
|
-
LinksBody
|
|
1484
|
-
/**
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
* bar and in ViewKit's own filter editor, handed the rule as data; left out, they open ViewKit's ways menu and value
|
|
1511
|
-
* body. */
|
|
1512
|
-
FilterPartBody?: ComponentType<ViewsFilterPartBodyProps>;
|
|
1533
|
+
/** Required: a whole pick list your app draws (`CONTROLS.Picker` is ViewKit's own). The select, several-values,
|
|
1534
|
+
* place and relation editors open it, handed their rows as data. */
|
|
1535
|
+
Picker: ComponentType<ViewsPickerProps>;
|
|
1536
|
+
/** Required: a whole links body your app draws (`CONTROLS.LinksBody` is ViewKit's own). The set editor of a relation
|
|
1537
|
+
* holding several records whose field declares `links` opens it, handed each link's roles, the lead and the field's
|
|
1538
|
+
* roles; a relation with no `links` opens `Picker`. */
|
|
1539
|
+
LinksBody: ComponentType<ViewsLinksBodyProps>;
|
|
1540
|
+
/** Required: a whole date body your app draws (`CONTROLS.DateBody` is ViewKit's own). The date editors open it. */
|
|
1541
|
+
DateBody: ComponentType<ViewsDateBodyProps>;
|
|
1542
|
+
/** Required: a whole body for a field made of parts your app draws (`CONTROLS.PartsBody` is ViewKit's own). The name,
|
|
1543
|
+
* place and range editors open it. */
|
|
1544
|
+
PartsBody: ComponentType<ViewsPartsBodyProps>;
|
|
1545
|
+
/** Required: a whole body for a field holding several emails, phones, links or domains, which your app draws
|
|
1546
|
+
* (`CONTROLS.ValuesBody` is ViewKit's own). The value list editors open it. */
|
|
1547
|
+
ValuesBody: ComponentType<ViewsValuesBodyProps>;
|
|
1548
|
+
/** Required: a whole body for a field typed as one string, which your app draws (`CONTROLS.TextBody` is ViewKit's own).
|
|
1549
|
+
* The text editors open it; a text opened only to be read keeps ViewKit's own panel. */
|
|
1550
|
+
TextBody: ComponentType<ViewsTextBodyProps>;
|
|
1551
|
+
/** Required: a whole body for a number, money or a percent, which your app draws (`CONTROLS.NumberBody` is ViewKit's
|
|
1552
|
+
* own). The number editors open it; a number formatted as a duration keeps ViewKit's own box. */
|
|
1553
|
+
NumberBody: ComponentType<ViewsNumberBodyProps>;
|
|
1554
|
+
/** Required: the sort editor's whole body, which your app draws (`CONTROLS.SortBody` is ViewKit's own). The sort pill
|
|
1555
|
+
* opens it on a computer and in the phone's Sheet, handed the rules as data. */
|
|
1556
|
+
SortBody: ComponentType<ViewsSortBodyProps>;
|
|
1557
|
+
/** Required: the filter editor's whole body, which your app draws (`CONTROLS.FilterBody` is ViewKit's own). An
|
|
1558
|
+
* advanced filter's pill opens it on a computer and Filter opens it in the phone's Sheet, handed the level as data. */
|
|
1559
|
+
FilterBody: ComponentType<ViewsFilterBodyProps>;
|
|
1560
|
+
/** Required: the field list's whole body, which your app draws (`CONTROLS.FieldsBody` is ViewKit's own). Every sort
|
|
1561
|
+
* and filter field list ViewKit opens opens it, handed the fields as data. */
|
|
1562
|
+
FieldsBody: ComponentType<ViewsFieldsBodyProps>;
|
|
1563
|
+
/** Required: a filter rule's way and value, which your app draws (`CONTROLS.FilterPartBody` is ViewKit's own). A
|
|
1564
|
+
* filter's way and value on the bar open it, handed the rule as data. */
|
|
1565
|
+
FilterPartBody: ComponentType<ViewsFilterPartBodyProps>;
|
|
1513
1566
|
/** Optional: wraps a grid's rows. Handed one, a grid that already shows rows keeps them on screen, inert, as its
|
|
1514
1567
|
* children while new ones load, and hands it `pending`; left out, the grid draws Loading in place of its body. A
|
|
1515
1568
|
* grid with no rows yet draws Loading either way. Draw it as a block in flow that neither scrolls nor clips. */
|
|
1516
1569
|
RowsWait?: ComponentType<ViewsRowsWaitProps>;
|
|
1517
|
-
/**
|
|
1518
|
-
* a computer and in the phone's Sheet, handed the fields, their values and the
|
|
1519
|
-
*
|
|
1520
|
-
QuickFiltersBody
|
|
1521
|
-
/**
|
|
1522
|
-
* computer and in the phone's Sheet, handed the views as data
|
|
1523
|
-
ViewsListBody
|
|
1524
|
-
/**
|
|
1525
|
-
*
|
|
1570
|
+
/** Required: the quick filters' whole body, which your app draws (`CONTROLS.QuickFiltersBody` is ViewKit's own). The
|
|
1571
|
+
* quick filters' button opens it on a computer and in the phone's Sheet, handed the fields, their values and the
|
|
1572
|
+
* hold as data. */
|
|
1573
|
+
QuickFiltersBody: ComponentType<ViewsQuickFiltersBodyProps>;
|
|
1574
|
+
/** Required: the views list's whole body, which your app draws (`CONTROLS.ViewsListBody` is ViewKit's own). The view
|
|
1575
|
+
* picker's chip opens it on a computer and in the phone's Sheet, handed the views as data. */
|
|
1576
|
+
ViewsListBody: ComponentType<ViewsViewsListBodyProps>;
|
|
1577
|
+
/** @deprecated Read by nothing: only ViewKit's own Customize opened it, and that Customize is gone. A `CustomizeBody`
|
|
1578
|
+
* holds its own group editor, handed the group as `GroupBody` was (`ViewsCustomizeBodyProps.group`). */
|
|
1526
1579
|
GroupBody?: ComponentType<ViewsGroupBodyProps>;
|
|
1527
|
-
/**
|
|
1528
|
-
* phone's Sheet, and so does
|
|
1529
|
-
*
|
|
1530
|
-
|
|
1531
|
-
CustomizeBody?: ComponentType<ViewsCustomizeBodyProps> & {
|
|
1532
|
-
stepsAside?: (props: ViewsCustomizeBodyProps) => boolean;
|
|
1533
|
-
};
|
|
1580
|
+
/** Required: Customize's whole body, which your app draws (`CONTROLS.CustomizeBody`, or your own). Options opens it on a
|
|
1581
|
+
* computer and in the phone's Sheet, and so does everything else that draws Customize, handed the view's settings as
|
|
1582
|
+
* data. ViewKit draws no Customize of its own. */
|
|
1583
|
+
CustomizeBody: ComponentType<ViewsCustomizeBodyProps>;
|
|
1534
1584
|
/** Optional: the toolbar's search box, which your app draws. Handed one, the search opens it in place of its own
|
|
1535
1585
|
* field, on a computer and on a phone; left out, ViewKit draws its own. */
|
|
1536
1586
|
SearchField?: ComponentType<ViewsSearchFieldProps>;
|
|
@@ -1545,13 +1595,10 @@ export type ViewsComponents = {
|
|
|
1545
1595
|
};
|
|
1546
1596
|
/** The selection bar's props, as your `SelectionBar` is handed them: ViewKit's `SelectionBar`'s own. */
|
|
1547
1597
|
export type ViewsSelectionBarProps = SelectionBarProps;
|
|
1548
|
-
/** The map as the views read it: `Input
|
|
1549
|
-
* package's own; `
|
|
1550
|
-
* `FieldsBody`, `FilterPartBody`, `RowsWait`, `QuickFiltersBody`, `ViewsListBody`, `GroupBody`, `CustomizeBody`,
|
|
1551
|
-
* `SearchField`, `PortsHost` and `SelectionBar` as the app handed them. */
|
|
1598
|
+
/** The map as the views read it: `Input` and `Calendar` always filled, the app's or the
|
|
1599
|
+
* package's own; `RowsWait`, `GroupBody`, `SearchField`, `PortsHost` and `SelectionBar` as the app handed them. */
|
|
1552
1600
|
export type ViewsResolvedComponents = ViewsComponents & {
|
|
1553
1601
|
Input: ComponentType<ViewsInputProps>;
|
|
1554
|
-
Command: ViewsCommandParts;
|
|
1555
1602
|
Calendar: ComponentType<ViewsCalendarProps>;
|
|
1556
1603
|
};
|
|
1557
1604
|
export {};
|
|
@@ -2,11 +2,10 @@ import type { FieldConventions } from "viewkitjs/fields";
|
|
|
2
2
|
import type { ViewsMessageResolver } from "../contract.js";
|
|
3
3
|
import type { ViewsAtoms } from "../atoms/types.js";
|
|
4
4
|
import type { FieldPresentation } from "../display/options.js";
|
|
5
|
-
import type { ViewsDatePicks,
|
|
5
|
+
import type { ViewsDatePicks, ViewsResolvedComponents, ViewsSelectionBarSettings, ViewsSheetActionsPlace } from "./components.js";
|
|
6
6
|
import type { ViewsIcons } from "./icons.js";
|
|
7
7
|
import type { ViewsResolvedPorts } from "./ports.js";
|
|
8
8
|
import type { ViewsEscapeRules } from "../editors/escape-rule.js";
|
|
9
|
-
import type { ViewsBodyFrame, ViewsGridBodyPlace } from "../model/body-frame.js";
|
|
10
9
|
import type { ViewsSeveralValues } from "../display/fit-values.js";
|
|
11
10
|
import type { ViewsOneValueEditors } from "../model/one-value.js";
|
|
12
11
|
export type ViewsContextValue = {
|
|
@@ -34,27 +33,8 @@ export type ViewsContextValue = {
|
|
|
34
33
|
escape?: ViewsEscapeRules;
|
|
35
34
|
/** Which single types open as the value list holding one (`ViewsProvider`'s `oneValue`); absent, the text box. */
|
|
36
35
|
oneValue?: ViewsOneValueEditors;
|
|
37
|
-
/** The grid says why the app refused an edit it sent (`ViewsProvider`'s `sayRefusals`); absent, it says nothing. */
|
|
38
|
-
sayRefusals?: boolean;
|
|
39
|
-
/** How the grid opens its own menus (`ViewsProvider`'s `menus`). Absent means `popover`. */
|
|
40
|
-
menus?: ViewsMenuRoute;
|
|
41
|
-
/** Who draws the buttons the grid draws itself (`ViewsProvider`'s `gridButtons`). Absent means `own`. */
|
|
42
|
-
gridButtons?: ViewsGridButtons;
|
|
43
36
|
/** How a cell of several values draws on one line (`ViewsProvider`'s `severalValues`). Absent means `fit`. */
|
|
44
37
|
severalValues?: ViewsSeveralValues;
|
|
45
|
-
/** Who draws a yes/no cell's box in the grid (`ViewsProvider`'s `gridCheckboxes`). Absent means `own`. */
|
|
46
|
-
gridCheckboxes?: ViewsGridCheckboxes;
|
|
47
|
-
/** Who draws a field row's own buttons (`ViewsProvider`'s `fieldRowButtons`). Absent means `own`. */
|
|
48
|
-
fieldRowButtons?: ViewsFieldRowButtons;
|
|
49
|
-
/** Who draws a field row's yes/no box (`ViewsProvider`'s `fieldRowCheckboxes`). Absent means `own`. */
|
|
50
|
-
fieldRowCheckboxes?: ViewsFieldRowCheckboxes;
|
|
51
|
-
/** Who draws the panels' own buttons (`ViewsProvider`'s `panelButtons`). Absent means `own`. */
|
|
52
|
-
panelButtons?: ViewsPanelButtons;
|
|
53
|
-
/** Who frames a whole body the app hands (`ViewsProvider`'s `bodyFrame`). Absent means `views`. */
|
|
54
|
-
bodyFrame?: ViewsBodyFrame;
|
|
55
|
-
/** Where a grid editor opens the popover around a body the app hands (`ViewsProvider`'s `gridBodyPlace`). Absent
|
|
56
|
-
* means `under`. */
|
|
57
|
-
gridBodyPlace?: ViewsGridBodyPlace;
|
|
58
38
|
/** Where the selection bar sits (`ViewsProvider`'s `selectionBar`); absent, the package's defaults. */
|
|
59
39
|
selectionBar?: ViewsSelectionBarSettings;
|
|
60
40
|
/** The quick days the date editors offer (`ViewsProvider`'s `datePicks`); absent, today, tomorrow and next Monday. */
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { ComponentType } from "react";
|
|
2
|
-
import type { ViewsCalendarProps
|
|
3
|
-
/** What
|
|
4
|
-
export declare const
|
|
5
|
-
/** What the date editor says when it reaches the components map's `Calendar` and the app handed none. */
|
|
6
|
-
export declare const MISSING_CALENDAR = "ViewKit drew the date editor's month through the components map's `Calendar`, and the app handed none. Hand `Calendar`, or hand `DateBody`, your whole date body, which the date editor then opens instead: `CONTROLS.DateBody` is ViewKit's, and `CONTROLS.Calendar` its month.";
|
|
7
|
-
/** Parts standing in for a `Command` the app left out: each throws the error naming the slot. */
|
|
8
|
-
export declare function missingParts(name: "Command"): ViewsCommandParts;
|
|
2
|
+
import type { ViewsCalendarProps } from "./components.js";
|
|
3
|
+
/** What the filter's month says when it reaches the components map's `Calendar` and the app handed none. */
|
|
4
|
+
export declare const MISSING_CALENDAR = "ViewKit drew the filter's month through the components map's `Calendar`, and the app handed none. Hand `Calendar`: `CONTROLS.Calendar` is ViewKit's.";
|
|
9
5
|
/** A component standing in for a slot the app left out: it throws the error naming the slot. */
|
|
10
6
|
export declare function missingComponent(name: "Calendar"): ComponentType<ViewsCalendarProps>;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export const
|
|
3
|
-
|
|
4
|
-
const MESSAGES = { Command: MISSING_COMMAND, Calendar: MISSING_CALENDAR };
|
|
5
|
-
export function missingParts(name) {
|
|
6
|
-
const Missing = () => {
|
|
7
|
-
throw new Error(MESSAGES[name]);
|
|
8
|
-
};
|
|
9
|
-
return { Root: Missing, Input: Missing, List: Missing, Empty: Missing, Group: Missing, Item: Missing };
|
|
10
|
-
}
|
|
2
|
+
export const MISSING_CALENDAR = "ViewKit drew the filter's month through the components map's `Calendar`, and the app handed none. Hand `Calendar`: `CONTROLS.Calendar` is ViewKit's.";
|
|
3
|
+
const MESSAGES = { Calendar: MISSING_CALENDAR };
|
|
11
4
|
export function missingComponent(name) {
|
|
12
5
|
return function Missing() {
|
|
13
6
|
throw new Error(MESSAGES[name]);
|
package/views/dist/react.d.ts
CHANGED
|
@@ -2,10 +2,9 @@ export { ViewsProvider, useViews } from "./provider/ViewsProvider.js";
|
|
|
2
2
|
export type { ViewsContextValue, ViewsProviderProps } from "./provider/ViewsProvider.js";
|
|
3
3
|
export type { EditEscape, EditEscapeByEditor, ViewsEscapeRules } from "./editors/escape-rule.js";
|
|
4
4
|
export type { ViewsOneValueEditors } from "./model/one-value.js";
|
|
5
|
-
export type { ViewsBodyFrame, ViewsGridBodyPlace } from "./model/body-frame.js";
|
|
6
5
|
export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
|
|
7
6
|
export type { ViewsSeveralValues } from "./display/fit-values.js";
|
|
8
|
-
export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsCustomizeBodyProps, ViewsCustomizeChoice, ViewsCustomizeColumn, ViewsCustomizeColumns, ViewsCustomizeLayout, ViewsCustomizePage, ViewsCustomizeToggle, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks,
|
|
7
|
+
export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsCustomizeBodyProps, ViewsCustomizeChoice, ViewsCustomizeColumn, ViewsCustomizeColumns, ViewsCustomizeField, ViewsCustomizeFields, ViewsCustomizeLayout, ViewsCustomizePage, ViewsCustomizeToggle, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks, ViewsInputProps, ViewsFieldsBodyField, ViewsFieldsBodyProps, ViewsFilterBodyField, ViewsFilterBodyProps, ViewsFilterPartBodyProps, ViewsGroupBodyProps, ViewsGroupDimension, ViewsGroupEntry, ViewsGroupValue, ViewsMenuItem, ViewsMenuProps, ViewsNumberBodyProps, ViewsOpenChange, ViewsPartsBodyProps, ViewsPickerAction, ViewsPickerItem, ViewsPickerProps, ViewsLink, ViewsLinkRole, ViewsLinksBodyProps, ViewsPlacePart, ViewsPlaceParts, ViewsPopoverProps, ViewsPortsHostProps, ViewsSelectionBarProps, ViewsQuickFiltersBodyProps, ViewsResolvedComponents, ViewsRowsWaitProps, ViewsSearchFieldProps, ViewsSelectionBarSettings, ViewsSheetAction, ViewsSheetActions, ViewsBodyStep, ViewsSheetActionsPlace, ViewsSheetProps, ViewsSide, ViewsSortBodyProps, ViewsTextBodyProps, ViewsTooltipProps, ViewsValueLine, ViewsValuesBodyProps, ViewsViewsListBodyProps, ViewsViewsListItem, ViewsViewChange, ViewsViewLayout, ViewsViewRecord, ViewsViewVerbs, } from "./provider/components.js";
|
|
9
8
|
export type { ViewsIconProps, ViewsIcons } from "./provider/icons.js";
|
|
10
9
|
export { NOOP_PORTS, NOOP_TOAST } from "./provider/ports.js";
|
|
11
10
|
export type { ViewsClipboardPort, ViewsConfirmPort, ViewsConfirmRequest, ViewsHapticsPort, ViewsPorts, ViewsPrefsPort, ViewsResolvedPorts, ViewsToastPort, } from "./provider/ports.js";
|
|
@@ -3,7 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useContext, useRef, useState } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import { cx } from "../internal/cx.js";
|
|
6
|
-
import { ELEMENT_RESET } from "../internal/reset.js";
|
|
7
6
|
import { DisabledReason } from "../atoms/DisabledReason.js";
|
|
8
7
|
import { useViews } from "../provider/context.js";
|
|
9
8
|
import { BarRoomContext } from "./bar-room.js";
|
|
@@ -29,14 +28,14 @@ export function SelectionBar(props) {
|
|
|
29
28
|
return createPortal(_jsx("div", { ref: barRoomRef ?? undefined, "data-slot": "vk-selection-bar", className: cx("fixed left-1/2 -translate-x-1/2", placement?.className), style: { bottom: placement?.bottom ?? DEFAULT_BOTTOM, zIndex: placement?.zIndex ?? DEFAULT_LAYER }, children: phone ? _jsx(SelectionBarPhone, { ...props }) : _jsx(DesktopBar, { ...props }) }), document.body);
|
|
30
29
|
}
|
|
31
30
|
function DesktopBar({ count, onClear, verbs, busy = false, onDelete, deleteLabel }) {
|
|
32
|
-
const { components, icons, messages
|
|
31
|
+
const { components, icons, messages } = useViews();
|
|
33
32
|
const { Button, Tooltip } = components;
|
|
34
33
|
const { inline, overflow } = splitVerbs(verbs);
|
|
35
34
|
const Close = icons.close;
|
|
36
35
|
const Trash = icons.delete;
|
|
37
36
|
const trashLabel = deleteLabel ?? messages({ key: "views.selection.delete" });
|
|
38
37
|
const deselect = messages({ key: "views.selection.deselect-all" });
|
|
39
|
-
return (_jsxs("div", { "data-slot": "vk-selection-pill", className: cx(PILL_CLASS, "pl-1.5"), children: [_jsx(Tooltip, { side: "top", delayMs: 300, className: "flex items-center gap-2", content: _jsxs(_Fragment, { children: [deselect, _jsx("span", { className: "rounded-sm border border-solid border-(color:--vk-border) px-1 py-px text-(length:--vk-caption-text,10px) font-medium text-(color:--vk-fg-subtle)", children: messages({ key: "views.selection.escape" }) })] }), children:
|
|
38
|
+
return (_jsxs("div", { "data-slot": "vk-selection-pill", className: cx(PILL_CLASS, "pl-1.5"), children: [_jsx(Tooltip, { side: "top", delayMs: 300, className: "flex items-center gap-2", content: _jsxs(_Fragment, { children: [deselect, _jsx("span", { className: "rounded-sm border border-solid border-(color:--vk-border) px-1 py-px text-(length:--vk-caption-text,10px) font-medium text-(color:--vk-fg-subtle)", children: messages({ key: "views.selection.escape" }) })] }), children: _jsxs(Button, { type: "button", variant: "outline", size: "sm", className: "group/selchip h-8 gap-1.5 rounded-full pl-3 pr-2.5", "data-slot": "vk-selection-chip", "aria-label": deselect, disabled: busy, onClick: onClear, children: [_jsx(CountWords, { count: count }), _jsx(Close, { className: "h-3 w-3 text-(color:--vk-fg-subtle) transition-colors group-hover/selchip:text-(color:--vk-fg)" })] }) }), _jsxs("div", { className: "flex items-center gap-1 pl-4", children: [inline.map((verb, index) => (_jsx(InlineVerb, { verb: verb, busy: busy }, index))), onDelete ? (_jsx(Button, { size: "icon", variant: "ghost", className: "h-8 w-8 rounded-full text-(color:--vk-danger) hover:bg-(color:--vk-danger-subtlest) hover:text-(color:--vk-danger)", disabled: busy, onClick: onDelete, "aria-label": trashLabel, title: trashLabel, children: _jsx(Trash, { className: "h-4 w-4" }) })) : null] }), _jsx("span", { className: DIVIDER_CLASS }), _jsx(MoreVerbs, { overflow: overflow, busy: busy })] }));
|
|
40
39
|
}
|
|
41
40
|
function InlineVerb({ verb, busy }) {
|
|
42
41
|
const { Button } = useViews().components;
|