@viewkitjs/views 0.4.0 → 0.6.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 +768 -0
- package/README.md +5 -3
- package/dist/atoms/Avatar.d.ts +2 -0
- package/dist/atoms/Avatar.js +13 -0
- package/dist/atoms/CellMore.d.ts +2 -0
- package/dist/atoms/CellMore.js +4 -0
- package/dist/atoms/DisabledReason.d.ts +11 -0
- package/dist/atoms/DisabledReason.js +10 -0
- package/dist/atoms/DrillRows.d.ts +3 -0
- package/dist/atoms/DrillRows.js +27 -0
- package/dist/atoms/Loading.d.ts +6 -0
- package/dist/atoms/Loading.js +4 -1
- package/dist/atoms/PanelRows.d.ts +5 -0
- package/dist/atoms/PanelRows.js +38 -0
- package/dist/atoms/PanelSearch.d.ts +2 -0
- package/dist/atoms/PanelSearch.js +21 -0
- package/dist/atoms/Pill.d.ts +2 -0
- package/dist/atoms/Pill.js +25 -0
- package/dist/atoms/RangeCalendar.d.ts +8 -0
- package/dist/atoms/RangeCalendar.js +30 -0
- package/dist/atoms/RelationRoles.js +2 -2
- package/dist/atoms/SelectionSheet.d.ts +3 -0
- package/dist/atoms/SelectionSheet.js +31 -0
- package/dist/atoms/ToolbarButton.d.ts +2 -0
- package/dist/atoms/ToolbarButton.js +18 -0
- package/dist/atoms/defaults.js +22 -0
- package/dist/atoms/types.d.ts +257 -1
- package/dist/cells/cell-format.d.ts +10 -1
- package/dist/cells/cell-title.d.ts +5 -1
- package/dist/cells/cell-title.js +2 -2
- package/dist/cells/cell-values.js +22 -7
- package/dist/cells/relation-wrap.js +1 -1
- package/dist/contract.d.ts +515 -18
- package/dist/contract.js +660 -5
- package/dist/display/actor.js +1 -1
- package/dist/display/boolean.js +5 -0
- package/dist/display/entity-chip.d.ts +12 -9
- package/dist/display/entity-chip.js +4 -5
- package/dist/display/fit-values.d.ts +34 -0
- package/dist/display/fit-values.js +45 -0
- package/dist/display/location.js +1 -1
- package/dist/display/multi-value.js +72 -8
- package/dist/display/options.d.ts +9 -1
- package/dist/display/relation.js +1 -1
- package/dist/display/rich-text.js +17 -6
- package/dist/display/select.js +6 -4
- package/dist/display/status-steps.d.ts +8 -0
- package/dist/display/status-steps.js +18 -0
- package/dist/display/viewer.js +1 -0
- package/dist/editors/BodyFrame.d.ts +29 -0
- package/dist/editors/BodyFrame.js +80 -0
- package/dist/editors/DateEditor.js +13 -17
- package/dist/editors/LocationEditor.d.ts +2 -0
- package/dist/editors/LocationEditor.js +29 -5
- package/dist/editors/NameEditor.d.ts +2 -0
- package/dist/editors/NameEditor.js +27 -7
- package/dist/editors/NumberEditor.d.ts +18 -0
- package/dist/editors/NumberEditor.js +29 -2
- package/dist/editors/RangeEditor.d.ts +2 -0
- package/dist/editors/RangeEditor.js +29 -4
- package/dist/editors/SelectEditor.d.ts +5 -0
- package/dist/editors/SelectEditor.js +3 -2
- package/dist/editors/TextEditor.d.ts +11 -1
- package/dist/editors/TextEditor.js +25 -8
- package/dist/editors/ValueListEditor.d.ts +7 -0
- package/dist/editors/ValueListEditor.js +60 -48
- package/dist/editors/body-panel.d.ts +7 -0
- package/dist/editors/body-panel.js +8 -0
- package/dist/editors/edit-session.d.ts +20 -3
- package/dist/editors/edit-session.js +43 -3
- package/dist/editors/leave-scope.d.ts +23 -0
- package/dist/editors/leave-scope.js +28 -0
- package/dist/editors/number-body.d.ts +29 -0
- package/dist/editors/number-body.js +37 -0
- package/dist/editors/parts-body.d.ts +66 -0
- package/dist/editors/parts-body.js +114 -0
- package/dist/editors/tab-ends.d.ts +5 -0
- package/dist/editors/tab-ends.js +7 -0
- package/dist/editors/text-body.d.ts +16 -0
- package/dist/editors/text-body.js +30 -0
- package/dist/editors/values-body.d.ts +47 -0
- package/dist/editors/values-body.js +140 -0
- package/dist/field-row/FieldRow.d.ts +7 -0
- package/dist/field-row/FieldRow.js +44 -24
- package/dist/field-row/FieldRowLane.js +12 -4
- package/dist/field-row/editors/RowChipsEditor.js +3 -1
- package/dist/field-row/editors/RowEditor.js +2 -1
- package/dist/field-row/editors/RowNameEditor.d.ts +5 -2
- package/dist/field-row/editors/RowNameEditor.js +12 -5
- package/dist/field-row/editors/RowNumberEditor.js +18 -2
- package/dist/field-row/editors/RowPlaceEditor.js +4 -2
- package/dist/field-row/editors/RowRangeEditor.d.ts +5 -2
- package/dist/field-row/editors/RowRangeEditor.js +13 -6
- package/dist/field-row/editors/RowRelationEditor.js +5 -2
- package/dist/field-row/editors/RowSelectEditor.js +4 -1
- package/dist/field-row/editors/RowTextEditor.d.ts +1 -1
- package/dist/field-row/editors/RowTextEditor.js +12 -3
- package/dist/field-row/editors/RowValueListEditor.d.ts +2 -1
- package/dist/field-row/editors/RowValueListEditor.js +17 -4
- package/dist/field-row/editors/host.d.ts +3 -0
- package/dist/field-row/editors/row-session.d.ts +12 -1
- package/dist/field-row/editors/row-session.js +52 -2
- package/dist/field-row/field-row-button.d.ts +40 -0
- package/dist/field-row/field-row-button.js +18 -0
- package/dist/field-row/field-row-checkbox.d.ts +9 -0
- package/dist/field-row/field-row-checkbox.js +7 -0
- package/dist/figures.d.ts +5 -48
- package/dist/figures.js +1 -63
- package/dist/filters/filter-model.d.ts +2 -0
- package/dist/grid/chrome/GridAddColumn.js +17 -3
- package/dist/grid/chrome/GridAggregateMenu.d.ts +2 -0
- package/dist/grid/chrome/GridAggregateMenu.js +2 -0
- package/dist/grid/chrome/GridCellEditors.js +16 -6
- package/dist/grid/chrome/GridCellOutline.d.ts +7 -4
- package/dist/grid/chrome/GridCellOutline.js +4 -2
- package/dist/grid/chrome/GridChipsEditor.js +3 -1
- package/dist/grid/chrome/GridColumnMenu.d.ts +7 -4
- package/dist/grid/chrome/GridColumnMenu.js +5 -3
- package/dist/grid/chrome/GridColumnSortSection.d.ts +23 -3
- package/dist/grid/chrome/GridColumnSortSection.js +18 -1
- package/dist/grid/chrome/GridFooter.d.ts +4 -1
- package/dist/grid/chrome/GridFooter.js +6 -4
- package/dist/grid/chrome/GridGroupMenu.d.ts +7 -3
- package/dist/grid/chrome/GridGroupMenu.js +30 -8
- package/dist/grid/chrome/GridHeader.d.ts +5 -1
- package/dist/grid/chrome/GridHeader.js +9 -5
- package/dist/grid/chrome/GridLongTextEditor.js +15 -11
- package/dist/grid/chrome/GridNameEditor.js +4 -2
- package/dist/grid/chrome/GridNumberEditor.d.ts +8 -1
- package/dist/grid/chrome/GridNumberEditor.js +15 -3
- package/dist/grid/chrome/GridPager.d.ts +7 -0
- package/dist/grid/chrome/GridPager.js +34 -0
- package/dist/grid/chrome/GridPlaceEditor.js +4 -2
- package/dist/grid/chrome/GridRangeEditor.js +12 -4
- package/dist/grid/chrome/GridRelationEditor.js +5 -2
- package/dist/grid/chrome/GridRow.js +18 -6
- package/dist/grid/chrome/GridRowActions.d.ts +8 -3
- package/dist/grid/chrome/GridRowActions.js +16 -6
- package/dist/grid/chrome/GridRowCells.js +23 -7
- package/dist/grid/chrome/GridRowGlyph.d.ts +3 -1
- package/dist/grid/chrome/GridRowGlyph.js +7 -2
- package/dist/grid/chrome/GridSelectEditor.js +6 -3
- package/dist/grid/chrome/GridStructure.d.ts +6 -1
- package/dist/grid/chrome/GridStructure.js +32 -8
- package/dist/grid/chrome/GridTable.js +36 -24
- package/dist/grid/chrome/GridTableSurface.d.ts +5 -1
- package/dist/grid/chrome/GridTableSurface.js +5 -2
- package/dist/grid/chrome/GridTextEditor.d.ts +5 -1
- package/dist/grid/chrome/GridTextEditor.js +13 -3
- package/dist/grid/chrome/GridValueListEditor.d.ts +12 -4
- package/dist/grid/chrome/GridValueListEditor.js +11 -3
- package/dist/grid/chrome/StuckMarker.d.ts +3 -1
- package/dist/grid/chrome/StuckMarker.js +6 -2
- package/dist/grid/chrome/cells.d.ts +4 -2
- package/dist/grid/chrome/cells.js +2 -2
- package/dist/grid/chrome/grid-add-column-items.d.ts +1 -1
- package/dist/grid/chrome/grid-add-column-items.js +8 -1
- package/dist/grid/chrome/grid-button.d.ts +32 -0
- package/dist/grid/chrome/grid-button.js +12 -0
- package/dist/grid/chrome/grid-cell-classes.d.ts +38 -0
- package/dist/grid/chrome/grid-cell-classes.js +30 -0
- package/dist/grid/chrome/grid-column-menu-items.d.ts +3 -0
- package/dist/grid/chrome/grid-column-menu-items.js +32 -3
- package/dist/grid/chrome/grid-columns-template.d.ts +27 -0
- package/dist/grid/chrome/grid-columns-template.js +13 -0
- package/dist/grid/chrome/grid-edit-session.d.ts +4 -1
- package/dist/grid/chrome/grid-edit-session.js +11 -1
- package/dist/grid/chrome/grid-group-menu-items.d.ts +8 -1
- package/dist/grid/chrome/grid-group-menu-items.js +17 -0
- package/dist/grid/chrome/grid-group-menu-parts.d.ts +10 -6
- package/dist/grid/chrome/grid-group-menu-parts.js +4 -2
- package/dist/grid/chrome/grid-hover.d.ts +4 -1
- package/dist/grid/chrome/grid-hover.js +16 -6
- package/dist/grid/chrome/grid-pages.d.ts +15 -0
- package/dist/grid/chrome/grid-pages.js +9 -0
- package/dist/grid/chrome/grid-row-menu-items.js +18 -10
- package/dist/grid/chrome/grid-row-props.d.ts +6 -2
- package/dist/grid/chrome/grid-row-window.d.ts +7 -0
- package/dist/grid/chrome/grid-row-window.js +35 -1
- package/dist/grid/chrome/grid-table-props.d.ts +38 -4
- package/dist/grid/chrome/useGridColumnLayout.d.ts +3 -1
- package/dist/grid/chrome/useGridColumnLayout.js +29 -9
- package/dist/grid/chrome/useGridPartColumns.js +1 -1
- package/dist/grid/chrome/useGridScrollArea.js +2 -0
- package/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -0
- package/dist/grid/chrome/useGridTableInteractionModel.js +5 -3
- package/dist/grid/chrome/useGridTableSelection.d.ts +3 -1
- package/dist/grid/chrome/useGridTableSelection.js +2 -2
- package/dist/grid/chrome/useHeaderDragReorder.js +2 -0
- package/dist/grid/core/editing-controller.d.ts +36 -11
- package/dist/grid/core/editing-controller.js +92 -25
- package/dist/grid/core/grid-aria.d.ts +4 -0
- package/dist/grid/core/grid-aria.js +6 -4
- package/dist/grid/core/grid-focus.d.ts +6 -0
- package/dist/grid/core/grid-focus.js +28 -5
- package/dist/grid/core/useGridEditing.d.ts +11 -2
- package/dist/grid/core/useGridEditing.js +9 -5
- package/dist/grid/core/write-states.d.ts +20 -0
- package/dist/grid/core/write-states.js +21 -0
- package/dist/grid/grid-format-props.d.ts +26 -0
- package/dist/grid/grid-format-props.js +65 -0
- package/dist/grid/index.d.ts +3 -1
- package/dist/grid/index.js +1 -0
- package/dist/grid/useGridTablePrefs.d.ts +20 -21
- package/dist/grid/useGridTablePrefs.js +6 -58
- package/dist/grid/useGridTableSettings.d.ts +60 -0
- package/dist/grid/useGridTableSettings.js +61 -0
- package/dist/grouping/sort-groups.d.ts +6 -7
- package/dist/internal/count.d.ts +3 -0
- package/dist/internal/count.js +3 -0
- package/dist/model/aggregates.d.ts +3 -3
- package/dist/model/aggregates.js +17 -71
- package/dist/model/body-frame.d.ts +16 -0
- package/dist/model/body-frame.js +5 -0
- package/dist/model/column-capabilities.d.ts +4 -1
- package/dist/model/column-capabilities.js +4 -1
- package/dist/model/column-filters.d.ts +7 -4
- package/dist/model/column-filters.js +26 -18
- package/dist/model/column-inspect.d.ts +3 -2
- package/dist/model/column-inspect.js +3 -1
- package/dist/model/column-order.d.ts +2 -2
- package/dist/model/column-schema.d.ts +6 -7
- package/dist/model/column-sort.d.ts +11 -0
- package/dist/model/column-sort.js +14 -0
- package/dist/model/column-state.d.ts +3 -20
- package/dist/model/column-state.js +1 -4
- package/dist/model/column-types.d.ts +1 -15
- package/dist/model/column-types.js +1 -1
- package/dist/model/one-value.d.ts +6 -0
- package/dist/model/one-value.js +5 -0
- package/dist/model/part-columns.d.ts +1 -6
- package/dist/model/part-columns.js +1 -1
- package/dist/model/part-rows.d.ts +2 -9
- package/dist/model/part-rows.js +1 -10
- package/dist/model/part-write.js +1 -1
- package/dist/model/place-parts.d.ts +6 -0
- package/dist/model/place-parts.js +14 -0
- package/dist/model/preferences.d.ts +3 -23
- package/dist/model/preferences.js +1 -17
- package/dist/model/prefs-buckets.d.ts +0 -27
- package/dist/model/prefs-buckets.js +1 -1
- package/dist/model/relation-filters.d.ts +13 -3
- package/dist/model/relation-filters.js +9 -4
- package/dist/model/row-icon.d.ts +17 -11
- package/dist/model/settings-columns.d.ts +34 -0
- package/dist/model/settings-columns.js +146 -0
- package/dist/model/settings-look.d.ts +17 -0
- package/dist/model/settings-look.js +23 -0
- package/dist/model/view-rules.d.ts +32 -6
- package/dist/model/view-rules.js +99 -23
- package/dist/panels/availability.d.ts +26 -0
- package/dist/panels/availability.js +28 -0
- package/dist/panels/filter/DateFilterBody.d.ts +42 -0
- package/dist/panels/filter/DateFilterBody.js +64 -0
- package/dist/panels/filter/DateFilterCalendar.d.ts +19 -0
- package/dist/panels/filter/DateFilterCalendar.js +37 -0
- package/dist/panels/filter/DateFilterInput.d.ts +16 -0
- package/dist/panels/filter/DateFilterInput.js +37 -0
- package/dist/panels/filter/FilterIcon.d.ts +7 -0
- package/dist/panels/filter/FilterIcon.js +15 -0
- package/dist/panels/filter/MenuSelect.d.ts +12 -0
- package/dist/panels/filter/MenuSelect.js +34 -0
- package/dist/panels/filter/NumberFilterBody.d.ts +21 -0
- package/dist/panels/filter/NumberFilterBody.js +76 -0
- package/dist/panels/filter/RangeFilterBody.d.ts +19 -0
- package/dist/panels/filter/RangeFilterBody.js +71 -0
- package/dist/panels/filter/RelationFilterBody.d.ts +17 -0
- package/dist/panels/filter/RelationFilterBody.js +20 -0
- package/dist/panels/filter/TextFilterBody.d.ts +31 -0
- package/dist/panels/filter/TextFilterBody.js +44 -0
- package/dist/panels/filter/TimeScopeDetail.d.ts +6 -0
- package/dist/panels/filter/TimeScopeDetail.js +47 -0
- package/dist/panels/filter/details.d.ts +17 -0
- package/dist/panels/filter/details.js +73 -0
- package/dist/panels/filter/filter-list.d.ts +23 -0
- package/dist/panels/filter/filter-list.js +38 -0
- package/dist/panels/group-sort.d.ts +24 -0
- package/dist/panels/group-sort.js +58 -0
- package/dist/panels/index.d.ts +24 -0
- package/dist/panels/index.js +17 -0
- package/dist/panels/labels.d.ts +37 -0
- package/dist/panels/labels.js +166 -0
- package/dist/panels/model.d.ts +343 -0
- package/dist/panels/model.js +77 -0
- package/dist/panels/react/GroupBucketsList.d.ts +16 -0
- package/dist/panels/react/GroupBucketsList.js +38 -0
- package/dist/panels/react/LayoutColumnsList.d.ts +24 -0
- package/dist/panels/react/LayoutColumnsList.js +71 -0
- package/dist/panels/react/PopoverColumnDetail.d.ts +11 -0
- package/dist/panels/react/PopoverColumnDetail.js +24 -0
- package/dist/panels/react/chrome.d.ts +17 -0
- package/dist/panels/react/chrome.js +8 -0
- package/dist/panels/react/column-refusals.d.ts +7 -0
- package/dist/panels/react/column-refusals.js +14 -0
- package/dist/panels/react/customize.d.ts +26 -0
- package/dist/panels/react/customize.js +98 -0
- package/dist/panels/react/drag.d.ts +2 -0
- package/dist/panels/react/drag.js +6 -0
- package/dist/panels/react/field-editor.d.ts +10 -0
- package/dist/panels/react/field-editor.js +1 -0
- package/dist/panels/react/filter-panel.d.ts +15 -0
- package/dist/panels/react/filter-panel.js +48 -0
- package/dist/panels/react/layout-detail.d.ts +4 -0
- package/dist/panels/react/layout-detail.js +21 -0
- package/dist/panels/react/order-details.d.ts +32 -0
- package/dist/panels/react/order-details.js +81 -0
- package/dist/panels/react/panel-header.d.ts +10 -0
- package/dist/panels/react/panel-header.js +12 -0
- package/dist/panels/react/panel-sheet.d.ts +19 -0
- package/dist/panels/react/panel-sheet.js +22 -0
- package/dist/panels/react/popover.d.ts +71 -0
- package/dist/panels/react/popover.js +47 -0
- package/dist/panels/react/root-list.d.ts +6 -0
- package/dist/panels/react/root-list.js +31 -0
- package/dist/panels/react/toolbar/ReadyToolbar.d.ts +42 -0
- package/dist/panels/react/toolbar/ReadyToolbar.js +92 -0
- package/dist/panels/react/toolbar/Toolbar.d.ts +16 -0
- package/dist/panels/react/toolbar/Toolbar.js +34 -0
- package/dist/panels/react/toolbar/ToolbarButton.d.ts +5 -0
- package/dist/panels/react/toolbar/ToolbarButton.js +9 -0
- package/dist/panels/react/toolbar/ToolbarFilter.d.ts +19 -0
- package/dist/panels/react/toolbar/ToolbarFilter.js +32 -0
- package/dist/panels/react/toolbar/ToolbarNew.d.ts +12 -0
- package/dist/panels/react/toolbar/ToolbarNew.js +21 -0
- package/dist/panels/react/toolbar/ToolbarOptions.d.ts +25 -0
- package/dist/panels/react/toolbar/ToolbarOptions.js +33 -0
- package/dist/panels/react/toolbar/ToolbarSearch.d.ts +9 -0
- package/dist/panels/react/toolbar/ToolbarSearch.js +41 -0
- package/dist/panels/react/toolbar/ToolbarSort.d.ts +12 -0
- package/dist/panels/react/toolbar/ToolbarSort.js +16 -0
- package/dist/panels/react/toolbar/ToolbarViews.d.ts +13 -0
- package/dist/panels/react/toolbar/ToolbarViews.js +24 -0
- package/dist/panels/react/toolbar/context.d.ts +29 -0
- package/dist/panels/react/toolbar/context.js +49 -0
- package/dist/panels/react/toolbar/panel-part.d.ts +37 -0
- package/dist/panels/react/toolbar/panel-part.js +37 -0
- package/dist/panels/react/toolbar/panel-state.d.ts +9 -0
- package/dist/panels/react/toolbar/panel-state.js +12 -0
- package/dist/panels/react/toolbar/use-box-narrow.d.ts +2 -0
- package/dist/panels/react/toolbar/use-box-narrow.js +18 -0
- package/dist/panels/react/toolbar/use-list-settings-state.d.ts +10 -0
- package/dist/panels/react/toolbar/use-list-settings-state.js +10 -0
- package/dist/panels/react/view-actions.d.ts +4 -0
- package/dist/panels/react/view-actions.js +37 -0
- package/dist/panels/react/view-footer.d.ts +16 -0
- package/dist/panels/react/view-footer.js +11 -0
- package/dist/panels/react/views-row/FoldingViewRow.d.ts +4 -0
- package/dist/panels/react/views-row/FoldingViewRow.js +105 -0
- package/dist/panels/react/views-row/HScrollRow.d.ts +7 -0
- package/dist/panels/react/views-row/HScrollRow.js +42 -0
- package/dist/panels/react/views-row/PillGroup.d.ts +30 -0
- package/dist/panels/react/views-row/PillGroup.js +86 -0
- package/dist/panels/react/views-row/ViewAxes.d.ts +6 -0
- package/dist/panels/react/views-row/ViewAxes.js +16 -0
- package/dist/panels/react/views-row/ViewCreatePill.d.ts +7 -0
- package/dist/panels/react/views-row/ViewCreatePill.js +11 -0
- package/dist/panels/react/views-row/ViewPicker.d.ts +5 -0
- package/dist/panels/react/views-row/ViewPicker.js +65 -0
- package/dist/panels/react/views-row/ViewPickerRow.d.ts +7 -0
- package/dist/panels/react/views-row/ViewPickerRow.js +18 -0
- package/dist/panels/react/views-row/ViewTabs.d.ts +31 -0
- package/dist/panels/react/views-row/ViewTabs.js +29 -0
- package/dist/panels/react/views-row/menu-classes.d.ts +6 -0
- package/dist/panels/react/views-row/menu-classes.js +3 -0
- package/dist/panels/react/views-row/use-anchored-toggle.d.ts +19 -0
- package/dist/panels/react/views-row/use-anchored-toggle.js +31 -0
- package/dist/panels/react.d.ts +51 -0
- package/dist/panels/react.js +43 -0
- package/dist/panels/settings/axes.d.ts +28 -0
- package/dist/panels/settings/axes.js +71 -0
- package/dist/panels/settings/filters.d.ts +5 -0
- package/dist/panels/settings/filters.js +62 -0
- package/dist/panels/settings/group-buckets.d.ts +23 -0
- package/dist/panels/settings/group-buckets.js +73 -0
- package/dist/panels/settings/input.d.ts +69 -0
- package/dist/panels/settings/input.js +1 -0
- package/dist/panels/settings/layout.d.ts +5 -0
- package/dist/panels/settings/layout.js +244 -0
- package/dist/panels/settings/order.d.ts +19 -0
- package/dist/panels/settings/order.js +271 -0
- package/dist/panels/settings/settings-panels.d.ts +17 -0
- package/dist/panels/settings/settings-panels.js +28 -0
- package/dist/panels/toolbar/clear.d.ts +9 -0
- package/dist/panels/toolbar/clear.js +26 -0
- package/dist/panels/toolbar/counts.d.ts +15 -0
- package/dist/panels/toolbar/counts.js +21 -0
- package/dist/panels/toolbar/edit-view.d.ts +5 -0
- package/dist/panels/toolbar/edit-view.js +18 -0
- package/dist/panels/toolbar/model.d.ts +34 -0
- package/dist/panels/toolbar/model.js +52 -0
- package/dist/panels/use-filter-opened.d.ts +8 -0
- package/dist/panels/use-filter-opened.js +11 -0
- package/dist/panels/view-state.d.ts +38 -0
- package/dist/panels/view-state.js +1 -0
- package/dist/panels/views-row/model.d.ts +131 -0
- package/dist/panels/views-row/model.js +14 -0
- package/dist/provider/ViewsProvider.d.ts +50 -6
- package/dist/provider/ViewsProvider.js +33 -2
- package/dist/provider/components.d.ts +274 -11
- package/dist/provider/context.d.ts +23 -2
- package/dist/provider/desktop.d.ts +3 -0
- package/dist/provider/desktop.js +7 -4
- package/dist/react.d.ts +5 -2
- package/dist/selection/SelectionBar.d.ts +18 -0
- package/dist/selection/SelectionBar.js +98 -0
- package/dist/selection/SelectionBarPhone.d.ts +3 -0
- package/dist/selection/SelectionBarPhone.js +14 -0
- package/dist/selection/bar-overflow.d.ts +12 -0
- package/dist/selection/bar-overflow.js +55 -0
- package/dist/selection/bar-parts.d.ts +17 -0
- package/dist/selection/bar-parts.js +19 -0
- package/dist/selection/index.d.ts +2 -0
- package/dist/selection/index.js +1 -0
- package/dist/selection/types.d.ts +3 -2
- package/dist/selection/useListSelectionShortcuts.d.ts +3 -2
- package/dist/selection/useListSelectionShortcuts.js +1 -1
- package/dist/selection/verbs.d.ts +41 -0
- package/dist/selection/verbs.js +1 -0
- package/docs/contract.md +355 -35
- package/docs/getting-started.md +1 -1
- package/docs/guides/atoms.md +39 -6
- package/docs/guides/columns.md +1 -1
- package/docs/guides/display.md +3 -2
- package/docs/guides/editors.md +4 -3
- package/docs/guides/selection.md +35 -21
- package/docs/guides/the-grid.md +24 -13
- package/docs/guides/the-provider.md +24 -6
- package/docs/index.md +2 -0
- package/docs/install.md +3 -1
- package/docs/reference/cells.md +1 -1
- package/docs/reference/display.md +5 -4
- package/docs/reference/editors-location.md +3 -1
- package/docs/reference/editors-name.md +3 -1
- package/docs/reference/editors-number.md +1 -0
- package/docs/reference/editors-range.md +3 -1
- package/docs/reference/editors-session.md +1 -0
- package/docs/reference/editors-text.md +2 -2
- package/docs/reference/editors-value-list.md +1 -1
- package/docs/reference/field-row.md +2 -2
- package/docs/reference/grid.md +10 -7
- package/docs/reference/panels-react.md +101 -0
- package/docs/reference/panels.md +123 -0
- package/docs/reference/react.md +45 -12
- package/docs/reference/selection.md +11 -3
- package/docs/reference/views.md +41 -38
- package/package.json +33 -4
- package/skills/views/SKILL.md +5 -4
package/dist/atoms/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { ComponentType, MouseEventHandler, ReactElement, ReactNode } from "react";
|
|
1
|
+
import type { ComponentType, KeyboardEvent, MouseEventHandler, MouseEvent as ReactMouseEvent, PointerEvent as ReactPointerEvent, ReactElement, ReactNode, Ref, RefObject } from "react";
|
|
2
2
|
import type { LinkPlatform, RelationValue } from "@viewkitjs/fields";
|
|
3
3
|
import type { CategoryColor } from "@viewkitjs/fields/design/category-colors";
|
|
4
4
|
import type { StatusSlot } from "@viewkitjs/fields/design/status-slots";
|
|
5
5
|
import type { FieldRowMenuItem } from "../fields/menus.js";
|
|
6
|
+
import type { ViewsOpenChange } from "../provider/components.js";
|
|
7
|
+
import type { SelectionVerb } from "../selection/verbs.js";
|
|
6
8
|
/** A row's inside. Inside a command list's item it is all the row is: the item owns
|
|
7
9
|
* the element, the highlight and the keyboard. */
|
|
8
10
|
export type ViewsRowContentProps = {
|
|
@@ -54,14 +56,45 @@ export type ViewsTickBoxProps = {
|
|
|
54
56
|
checked: boolean;
|
|
55
57
|
className?: string;
|
|
56
58
|
};
|
|
59
|
+
/** A person's or a record's picture: a user's, a relation's and an actor's chip, and the name's when the list
|
|
60
|
+
* hands the row's avatar. Paint only: whatever wraps it owns the click. */
|
|
61
|
+
export type ViewsAvatarProps = {
|
|
62
|
+
/** Whose picture: the name the chip or the row shows, for initials. */
|
|
63
|
+
label: string;
|
|
64
|
+
/** The picture, when there is one. */
|
|
65
|
+
avatarUrl?: string | null;
|
|
66
|
+
/** The record's kind as your app names it, for the avatar's shape: a relation's `entity`, `user` for a member,
|
|
67
|
+
* an actor's type. */
|
|
68
|
+
kind?: string;
|
|
69
|
+
/** `chip`: inside a chip, 16px by default. `glyph`: before the name, at `--vk-glyph`. */
|
|
70
|
+
size: "chip" | "glyph";
|
|
71
|
+
/** The glyph the chip or the name draws with no picture. The default draws it when the picture is missing or
|
|
72
|
+
* fails to load; yours may draw it for a kind it doesn't dress (an automation, say). */
|
|
73
|
+
fallback?: ReactNode;
|
|
74
|
+
};
|
|
57
75
|
/** The rows' container: the inset a run of rows sits in, inside a panel or a command group. */
|
|
58
76
|
export type ViewsListProps = {
|
|
59
77
|
children: ReactNode;
|
|
60
78
|
className?: string;
|
|
61
79
|
};
|
|
80
|
+
/** One of a status field's options, as a badge is handed them. */
|
|
81
|
+
export type ViewsStatusOption = {
|
|
82
|
+
value: string;
|
|
83
|
+
label: string;
|
|
84
|
+
slot?: StatusSlot;
|
|
85
|
+
};
|
|
86
|
+
/** Where a status stands among its field's steps: the field's active options in their order, and this one's index. */
|
|
87
|
+
export type ViewsStatusPlace = {
|
|
88
|
+
index: number;
|
|
89
|
+
options: readonly ViewsStatusOption[];
|
|
90
|
+
};
|
|
62
91
|
export type ViewsStatusBadgeProps = {
|
|
63
92
|
slot: StatusSlot;
|
|
64
93
|
label: ReactNode;
|
|
94
|
+
/** Where this status stands among its field's steps (its active options), handed wherever a field's option is
|
|
95
|
+
* drawn: a cell, the select editor, the selection bar. Absent for a value that is no step (a stray value, an
|
|
96
|
+
* archived one) and for a badge that is no option. */
|
|
97
|
+
place?: ViewsStatusPlace;
|
|
65
98
|
/** Replaces the slot's own mark. */
|
|
66
99
|
leading?: ReactNode;
|
|
67
100
|
title?: string;
|
|
@@ -122,6 +155,14 @@ export type ViewsRelationRolesProps = {
|
|
|
122
155
|
label: string;
|
|
123
156
|
}[];
|
|
124
157
|
};
|
|
158
|
+
/** The count after a cell's shown values ("+2"), drawn inside its element (`data-slot="vk-cell-more"`): a button that
|
|
159
|
+
* opens the whole list, or plain text when the host owns the click (`inert`). The default draws the "+" and the number,
|
|
160
|
+
* and with it ViewKit keeps today's frame on the element; with an app's own the element is bare, so the app's chip (a
|
|
161
|
+
* count tag) stands there alone. */
|
|
162
|
+
export type ViewsCellMoreProps = {
|
|
163
|
+
count: number;
|
|
164
|
+
inert: boolean;
|
|
165
|
+
};
|
|
125
166
|
/** A wait: the whole list reloading (`body`), or more rows arriving (`footer`). The default is a
|
|
126
167
|
* plain ring; an app swaps in its own loader. */
|
|
127
168
|
export type ViewsLoadingProps = {
|
|
@@ -157,6 +198,23 @@ export type ViewsRowMenuItem = {
|
|
|
157
198
|
/** A keyboard hint drawn at the row's end, never bound by the menu. */
|
|
158
199
|
shortcut?: string;
|
|
159
200
|
};
|
|
201
|
+
/** The phone's sheet of a selection's verbs, opened by the selection bar's Actions. The default is the
|
|
202
|
+
* components map's `Sheet` holding the atoms' rows: a group's or an options verb's rows open in place under
|
|
203
|
+
* it, and the delete comes last, in words. Picking a row closes the sheet, then runs it, since a verb usually
|
|
204
|
+
* ends by clearing the selection and taking the bar down with it. An app swaps in its own action sheet. */
|
|
205
|
+
export type ViewsSelectionSheetProps = {
|
|
206
|
+
open: boolean;
|
|
207
|
+
onOpenChange: ViewsOpenChange;
|
|
208
|
+
/** "3 selected". */
|
|
209
|
+
title: string;
|
|
210
|
+
/** Each disabled verb carries its `disabledReason`; the default draws it as the row's second line. */
|
|
211
|
+
verbs: readonly SelectionVerb[];
|
|
212
|
+
/** The bar's own delete, drawn last; absent when the list has no bulk delete. */
|
|
213
|
+
onDelete?: () => void;
|
|
214
|
+
deleteLabel: string;
|
|
215
|
+
/** A batch is running: every row is disabled. */
|
|
216
|
+
busy: boolean;
|
|
217
|
+
};
|
|
160
218
|
/** The rows' right-click menu, around the rows it opens on. The grid mounts ONE for each section's rows'
|
|
161
219
|
* container, never one per row, and AIMS it: its props are those of the row a press or a right-click came
|
|
162
220
|
* from, set in the same event the menu opens on, so a person meets each row's own menu. The rendering
|
|
@@ -182,19 +240,217 @@ export type ViewsRowMenuProps = {
|
|
|
182
240
|
* The default doesn't use it: on a phone the ⋯ is the way in. */
|
|
183
241
|
onToggleSelect?: () => void;
|
|
184
242
|
};
|
|
243
|
+
/** Picks one value: its label, a second line, a right-hand `meta` (a sample, a count), the check when chosen. */
|
|
244
|
+
export type ViewsChoiceRowProps = {
|
|
245
|
+
selected?: boolean;
|
|
246
|
+
label: ReactNode;
|
|
247
|
+
/** A second line under the label. */
|
|
248
|
+
description?: ReactNode;
|
|
249
|
+
/** Right-aligned secondary text; a row with one draws no check, its meta in the brand colour when chosen. */
|
|
250
|
+
meta?: ReactNode;
|
|
251
|
+
leading?: ReactNode;
|
|
252
|
+
trailing?: ReactNode;
|
|
253
|
+
onClick: () => void;
|
|
254
|
+
/** For a row inside an editor that must keep its input focused. */
|
|
255
|
+
onMouseDown?: MouseEventHandler<HTMLButtonElement>;
|
|
256
|
+
disabled?: boolean;
|
|
257
|
+
className?: string;
|
|
258
|
+
role?: string;
|
|
259
|
+
"aria-selected"?: boolean;
|
|
260
|
+
};
|
|
261
|
+
/** Toggles one of many: a tick box on the left shows both states. */
|
|
262
|
+
export type ViewsCheckRowProps = {
|
|
263
|
+
checked: boolean;
|
|
264
|
+
onClick: () => void;
|
|
265
|
+
children: ReactNode;
|
|
266
|
+
leading?: ReactNode;
|
|
267
|
+
trailing?: ReactNode;
|
|
268
|
+
/** Drawn but not togglable for now (a toggle still saving). */
|
|
269
|
+
disabled?: boolean;
|
|
270
|
+
className?: string;
|
|
271
|
+
};
|
|
272
|
+
/** Picks one of a set: `mark="check"` (default) marks the chosen row with a check, `mark="box"` draws a tick
|
|
273
|
+
* box with radio semantics. `trailing` sits outside the choosing button. A disabled row with a
|
|
274
|
+
* `disabledReason` shows it in the map's `Tooltip` once the pointer rests. */
|
|
275
|
+
export type ViewsRadioRowProps = {
|
|
276
|
+
selected: boolean;
|
|
277
|
+
label: string;
|
|
278
|
+
onClick: () => void;
|
|
279
|
+
leading?: ReactNode;
|
|
280
|
+
trailing?: ReactNode;
|
|
281
|
+
className?: string;
|
|
282
|
+
checkClassName?: string;
|
|
283
|
+
labelClassName?: string;
|
|
284
|
+
mark?: "check" | "box";
|
|
285
|
+
disabled?: boolean;
|
|
286
|
+
disabledReason?: string;
|
|
287
|
+
};
|
|
288
|
+
/** A sort's direction arrow, flipped by a press that never reaches the row around it. */
|
|
289
|
+
export type ViewsDirectionButtonProps = {
|
|
290
|
+
dir: "asc" | "desc";
|
|
291
|
+
onClick: () => void;
|
|
292
|
+
className?: string;
|
|
293
|
+
iconClassName?: string;
|
|
294
|
+
};
|
|
295
|
+
/** A drill-in row: a glyph, the section's name, where it stands, and a chevron unless disabled. */
|
|
296
|
+
export type ViewsMenuRowProps = {
|
|
297
|
+
icon: ReactNode;
|
|
298
|
+
label: string;
|
|
299
|
+
value: string;
|
|
300
|
+
active: boolean;
|
|
301
|
+
/** Listed but not openable. */
|
|
302
|
+
disabled?: boolean;
|
|
303
|
+
/** Why it is disabled; a disabled row with one shows it in the map's `Tooltip` once the pointer rests. */
|
|
304
|
+
disabledReason?: string;
|
|
305
|
+
onClick: () => void;
|
|
306
|
+
};
|
|
307
|
+
/** A boolean that flips in place, a painted switch where the chevron would be; `reset` draws the way back to
|
|
308
|
+
* the reader's default on the row. */
|
|
309
|
+
export type ViewsToggleRowProps = {
|
|
310
|
+
icon?: ReactNode;
|
|
311
|
+
label: string;
|
|
312
|
+
active: boolean;
|
|
313
|
+
disabled?: boolean;
|
|
314
|
+
/** Why it is disabled; a disabled row with one shows it in the map's `Tooltip` once the pointer rests. */
|
|
315
|
+
disabledReason?: string;
|
|
316
|
+
onClick: () => void;
|
|
317
|
+
reset?: {
|
|
318
|
+
onReset: () => void;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
/** A panel's text box: a filled well with a magnifier. `leading` replaces it, `null` drops it. */
|
|
322
|
+
export type ViewsPanelSearchProps = {
|
|
323
|
+
value: string;
|
|
324
|
+
onChange: (value: string) => void;
|
|
325
|
+
/** Emptying, committed at once; falls back to `onChange("")`. */
|
|
326
|
+
onClear?: () => void;
|
|
327
|
+
placeholder?: string;
|
|
328
|
+
autoFocus?: boolean;
|
|
329
|
+
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
330
|
+
onFocus?: () => void;
|
|
331
|
+
inputRef?: RefObject<HTMLInputElement | null>;
|
|
332
|
+
className?: string;
|
|
333
|
+
leading?: ReactNode | null;
|
|
334
|
+
suffix?: ReactNode;
|
|
335
|
+
inputMode?: "text" | "decimal" | "numeric";
|
|
336
|
+
};
|
|
337
|
+
/** One option of a row of pills (the views row, a tab row): a button. The row decides its state and
|
|
338
|
+
* hands its glyph and label in; the pill draws its look. */
|
|
339
|
+
export type ViewsPillProps = {
|
|
340
|
+
/** The pill stands for the current choice. */
|
|
341
|
+
active: boolean;
|
|
342
|
+
/** `solid`: every pill a filled chip, the active one tinted; `plain`: a ghost, the active one a selected wash. */
|
|
343
|
+
variant: "solid" | "plain";
|
|
344
|
+
/** `sm` for a row beneath another. */
|
|
345
|
+
size: "default" | "sm";
|
|
346
|
+
/** The glyph slot ahead of the label: the option's glyph, or in a row that reorders the grip over it. */
|
|
347
|
+
leading?: ReactNode;
|
|
348
|
+
/** Keep the leading inset with no glyph: a pill that can be dragged, where the grip lands. */
|
|
349
|
+
leadingSlot?: boolean;
|
|
350
|
+
/** The app's own classes for this option's active look, in place of the pill's own: a status colour. */
|
|
351
|
+
activeClassName?: string;
|
|
352
|
+
/** The app's own `hover:` classes while this option is inactive, in place of the pill's own hover. */
|
|
353
|
+
hoverClassName?: string;
|
|
354
|
+
onClick?: () => void;
|
|
355
|
+
onContextMenu?: (event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
356
|
+
onPointerDown?: (event: ReactPointerEvent<HTMLButtonElement>) => void;
|
|
357
|
+
/** Set when the pill opens a menu: `aria-haspopup="menu"`, and `aria-expanded` from it. */
|
|
358
|
+
menuOpen?: boolean;
|
|
359
|
+
ref?: Ref<HTMLButtonElement>;
|
|
360
|
+
children: ReactNode;
|
|
361
|
+
};
|
|
362
|
+
/** A month to pick one day or a range of days on, in ISO days (`YYYY-MM-DD`): the filter panel's date, its date
|
|
363
|
+
* ranges and its custom time scope (VK-392). The default is the map's one-day `Calendar`; an app hands its own
|
|
364
|
+
* to paint a range. */
|
|
365
|
+
export type ViewsRangeCalendarProps = {
|
|
366
|
+
/** `single`: one day, held in `from`. `range`: two ends. */
|
|
367
|
+
mode: "single" | "range";
|
|
368
|
+
from: string | null;
|
|
369
|
+
to: string | null;
|
|
370
|
+
/** Every press: the selection the calendar makes of it, and the day pressed (null when the calendar emptied
|
|
371
|
+
* the selection). */
|
|
372
|
+
onSelect: (next: {
|
|
373
|
+
from: string | null;
|
|
374
|
+
to: string | null;
|
|
375
|
+
}, day: string | null) => void;
|
|
376
|
+
/** The end the next press sets, which the editor decides; the other end is drawn quieter. Absent, the
|
|
377
|
+
* calendar picks a range by its own rule: a first press starts it, a second ends it. */
|
|
378
|
+
armed?: "from" | "to";
|
|
379
|
+
/** Days before `before` or after `after` can't be pressed. */
|
|
380
|
+
limit?: {
|
|
381
|
+
before?: string;
|
|
382
|
+
after?: string;
|
|
383
|
+
};
|
|
384
|
+
/** A window painted in place of the selection, which no press changes (a relative date). */
|
|
385
|
+
window?: {
|
|
386
|
+
from: string;
|
|
387
|
+
to: string;
|
|
388
|
+
};
|
|
389
|
+
/** A range spans at least this many nights, so a first press stays a partial range. */
|
|
390
|
+
minNights?: number;
|
|
391
|
+
/** Drawn under the month. */
|
|
392
|
+
footer?: ReactNode;
|
|
393
|
+
/** A day cell's size, a CSS length; every other size follows it. */
|
|
394
|
+
cellSize?: string;
|
|
395
|
+
/** The conventions' locale (BCP 47), as the map's `Calendar` takes it. */
|
|
396
|
+
locale: string;
|
|
397
|
+
className?: string;
|
|
398
|
+
};
|
|
399
|
+
/** A toolbar's button (VK-409): a glyph in a circle, its word for the dresses that show one, and what it says
|
|
400
|
+
* about the list. The toolbar's parts hand it in; an app swaps it for its own. */
|
|
401
|
+
export type ViewsToolbarButtonProps = {
|
|
402
|
+
/** The glyph. */
|
|
403
|
+
icon: ReactNode;
|
|
404
|
+
/** The button's name: its `aria-label`, and the word a dress shows unless `word` says otherwise. */
|
|
405
|
+
label: string;
|
|
406
|
+
/** The word a dress shows in place of the glyph; `null`, none (Search: its glyph is its word). */
|
|
407
|
+
word?: string | null;
|
|
408
|
+
/** A number in the corner: what is applied. */
|
|
409
|
+
count?: number;
|
|
410
|
+
/** With a count: the count becomes a ✕ badge that clears what it counts. */
|
|
411
|
+
onClear?: () => void;
|
|
412
|
+
/** "Something is applied" with no number; drawn instead of a count. */
|
|
413
|
+
dot?: boolean;
|
|
414
|
+
/** What it opens is open: the ground stays painted. */
|
|
415
|
+
open?: boolean;
|
|
416
|
+
/** The list differs from its default here (lit). */
|
|
417
|
+
changed?: boolean;
|
|
418
|
+
/** The row's outermost button, the one a dress may set apart (New). */
|
|
419
|
+
edge?: boolean;
|
|
420
|
+
disabled?: boolean;
|
|
421
|
+
size: "md" | "sm";
|
|
422
|
+
/** Set when it opens a popup: `aria-haspopup`, and `aria-expanded` from `open`. */
|
|
423
|
+
popup?: "menu" | "dialog";
|
|
424
|
+
onClick?: (event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
425
|
+
onPointerDown?: (event: ReactPointerEvent<HTMLButtonElement>) => void;
|
|
426
|
+
ref?: Ref<HTMLButtonElement>;
|
|
427
|
+
};
|
|
185
428
|
export type ViewsAtoms = {
|
|
186
429
|
List: ComponentType<ViewsListProps>;
|
|
187
430
|
Row: ComponentType<ViewsRowProps>;
|
|
188
431
|
RowContent: ComponentType<ViewsRowContentProps>;
|
|
189
432
|
TickBox: ComponentType<ViewsTickBoxProps>;
|
|
433
|
+
Avatar: ComponentType<ViewsAvatarProps>;
|
|
190
434
|
StatusBadge: ComponentType<ViewsStatusBadgeProps>;
|
|
191
435
|
StatusMarker: ComponentType<ViewsStatusMarkerProps>;
|
|
192
436
|
Tag: ComponentType<ViewsTagProps>;
|
|
193
437
|
CommandMenu: ComponentType<ViewsCommandMenuProps>;
|
|
194
438
|
RelationLink: ComponentType<ViewsRelationLinkProps>;
|
|
195
439
|
RelationRoles: ComponentType<ViewsRelationRolesProps>;
|
|
440
|
+
CellMore: ComponentType<ViewsCellMoreProps>;
|
|
196
441
|
Loading: ComponentType<ViewsLoadingProps>;
|
|
197
442
|
LoadMore: ComponentType<ViewsLoadMoreProps>;
|
|
198
443
|
PlatformMark: ComponentType<ViewsPlatformMarkProps>;
|
|
199
444
|
RowMenu: ComponentType<ViewsRowMenuProps>;
|
|
445
|
+
ChoiceRow: ComponentType<ViewsChoiceRowProps>;
|
|
446
|
+
CheckRow: ComponentType<ViewsCheckRowProps>;
|
|
447
|
+
RadioRow: ComponentType<ViewsRadioRowProps>;
|
|
448
|
+
DirectionButton: ComponentType<ViewsDirectionButtonProps>;
|
|
449
|
+
MenuRow: ComponentType<ViewsMenuRowProps>;
|
|
450
|
+
ToggleRow: ComponentType<ViewsToggleRowProps>;
|
|
451
|
+
PanelSearch: ComponentType<ViewsPanelSearchProps>;
|
|
452
|
+
SelectionSheet: ComponentType<ViewsSelectionSheetProps>;
|
|
453
|
+
Pill: ComponentType<ViewsPillProps>;
|
|
454
|
+
RangeCalendar: ComponentType<ViewsRangeCalendarProps>;
|
|
455
|
+
ToolbarButton: ComponentType<ViewsToolbarButtonProps>;
|
|
200
456
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
2
|
import type { PercentDisplay } from "@viewkitjs/fields";
|
|
3
3
|
import type { FieldPresentation, FieldViewerContext } from "../display/options.js";
|
|
4
4
|
import type { FieldRowMenuItem } from "../fields/menus.js";
|
|
5
5
|
import type { ListColumn, ListRelationValue, ListSelectColor } from "../model/column-schema.js";
|
|
6
6
|
import type { ListDateStyle, ListDurationStyle } from "../model/column-format.js";
|
|
7
|
+
import type { ViewsCheckboxProps } from "../provider/components.js";
|
|
7
8
|
/**
|
|
8
9
|
* COLUMN-SHAPED FORMATTING — the two string formatters that still take a column,
|
|
9
10
|
* and the per-row currency only this layer can resolve.
|
|
@@ -36,6 +37,11 @@ export type GridCellOptions = {
|
|
|
36
37
|
withTime?: boolean;
|
|
37
38
|
/** Percent columns: the workspace's display — wins over `format.percentDisplay`. */
|
|
38
39
|
percentDisplay?: PercentDisplay;
|
|
40
|
+
/** The grid's part on a title's name link (`vk-grid-title`), spread on the element that opens the row. Only the
|
|
41
|
+
* grid hands it; a title drawn anywhere else names no part. */
|
|
42
|
+
titleData?: {
|
|
43
|
+
readonly "data-slot": string;
|
|
44
|
+
};
|
|
39
45
|
/** Optimistic pending value (Tier 3) — wins over `accessor(row)` when defined.
|
|
40
46
|
* Only typed cells honor it; custom `render` columns show confirmed data. */
|
|
41
47
|
valueOverride?: unknown;
|
|
@@ -56,6 +62,9 @@ export type GridCellOptions = {
|
|
|
56
62
|
* unclickable glyph, so a read-only or settings-locked column can't be toggled.
|
|
57
63
|
*/
|
|
58
64
|
onToggle?: (next: boolean) => void;
|
|
65
|
+
/** A two-way boolean in the checkbox style draws this control in place of ViewKit's tick box in its own button:
|
|
66
|
+
* the grid hands the components map's `Checkbox` while the provider's `gridCheckboxes` is `checkbox`. */
|
|
67
|
+
booleanCheckbox?: ComponentType<ViewsCheckboxProps>;
|
|
59
68
|
/**
|
|
60
69
|
* `command` columns: the verbs this row offers INSTEAD of an editor, already
|
|
61
70
|
* resolved for the row (`FieldMenus<Row>[key](row)`). Behavioral, like the two
|
|
@@ -13,4 +13,8 @@ import type { ListColumn } from "../model/column-schema.js";
|
|
|
13
13
|
* generic indicator lane for this type: the adornment has to sit inside the
|
|
14
14
|
* cell's own layout rules about where the click target ends.
|
|
15
15
|
*/
|
|
16
|
-
export declare function renderTitleCell<Row>(col: ListColumn<Row>, row: Row, content: ReactNode
|
|
16
|
+
export declare function renderTitleCell<Row>(col: ListColumn<Row>, row: Row, content: ReactNode,
|
|
17
|
+
/** The surface's part on the name link: the grid hands `vk-grid-title`; elsewhere none. */
|
|
18
|
+
data?: {
|
|
19
|
+
readonly "data-slot": string;
|
|
20
|
+
}): ReactNode;
|
package/dist/cells/cell-title.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cellTextClass } from "../display/text-class.js";
|
|
4
4
|
import { cx } from "../internal/cx.js";
|
|
5
|
-
export function renderTitleCell(col, row, content) {
|
|
5
|
+
export function renderTitleCell(col, row, content, data) {
|
|
6
6
|
const indicator = col.indicator?.(row);
|
|
7
|
-
return (_jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx("span", { "data-cell-open": true, className: cx("min-w-0 cursor-pointer font-medium text-(color:--vk-fg)", cellTextClass()), children: content }), indicator] }));
|
|
7
|
+
return (_jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx("span", { ...data, "data-cell-open": true, className: cx("min-w-0 cursor-pointer font-medium text-(color:--vk-fg)", cellTextClass()), children: content }), indicator] }));
|
|
8
8
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { valueTypeOf } from "@viewkitjs/fields";
|
|
4
4
|
import { ConvertedFigure } from "../display/converted.js";
|
|
5
|
-
import { cx } from "../internal/cx.js";
|
|
6
|
-
import { ELEMENT_RESET } from "../internal/reset.js";
|
|
7
5
|
import { renderFieldValue } from "../display/display-cores.js";
|
|
8
6
|
import { convertedFromOf } from "../fields/money.js";
|
|
9
7
|
import { columnLabel } from "../model/column-capabilities.js";
|
|
@@ -13,6 +11,7 @@ import { renderTitleCell } from "./cell-title.js";
|
|
|
13
11
|
import { resolveRowCurrency } from "./cell-format.js";
|
|
14
12
|
import { legacyFieldFromColumn } from "./legacy-field.js";
|
|
15
13
|
import { listRelationWrap } from "./relation-wrap.js";
|
|
14
|
+
import { drawGridButton } from "../grid/chrome/grid-button.js";
|
|
16
15
|
export function renderTypedCellValue(col, row, opts) {
|
|
17
16
|
const value = opts?.valueOverride !== undefined ? opts.valueOverride : col.accessor?.(row);
|
|
18
17
|
if (col.type !== "boolean" &&
|
|
@@ -23,7 +22,7 @@ export function renderTypedCellValue(col, row, opts) {
|
|
|
23
22
|
if (!col.type)
|
|
24
23
|
return null;
|
|
25
24
|
if (col.type === "title")
|
|
26
|
-
return renderTitleCell(col, row, identityContent(col, row, value, opts));
|
|
25
|
+
return renderTitleCell(col, row, identityContent(col, row, value, opts), opts?.titleData);
|
|
27
26
|
const field = col.field ?? legacyFieldFromColumn(col);
|
|
28
27
|
const cell = renderFieldValue(field, value, displayOptionsFor(col, row, opts));
|
|
29
28
|
if (col.command && opts?.commandItems?.length) {
|
|
@@ -56,14 +55,29 @@ const CONTROL_VALUES = new Set([
|
|
|
56
55
|
"domain",
|
|
57
56
|
]);
|
|
58
57
|
function CommandCell({ col, cell, items, }) {
|
|
59
|
-
const
|
|
58
|
+
const views = useViews();
|
|
59
|
+
const { atoms, icons } = views;
|
|
60
60
|
const { CommandMenu } = atoms;
|
|
61
61
|
const Chevron = icons.chevronDown;
|
|
62
62
|
const verbs = items.map((item) => ({ ...item }));
|
|
63
63
|
if (CONTROL_VALUES.has(col.type)) {
|
|
64
|
-
return (_jsxs("span", { className: "flex min-w-0 items-center gap-1", children: [cell, _jsx(CommandMenu, { items: verbs, align: "start", label: columnLabel(col), trigger:
|
|
64
|
+
return (_jsxs("span", { className: "flex min-w-0 items-center gap-1", children: [cell, _jsx(CommandMenu, { items: verbs, align: "start", label: columnLabel(col), trigger: drawGridButton(views, {
|
|
65
|
+
"aria-label": columnLabel(col),
|
|
66
|
+
own: "shrink-0 -m-1 p-1",
|
|
67
|
+
frame: "h-5 w-5 shrink-0",
|
|
68
|
+
variant: "ghost",
|
|
69
|
+
size: "icon",
|
|
70
|
+
children: _jsx(Chevron, { className: "h-3 w-3 opacity-60" }),
|
|
71
|
+
}) })] }));
|
|
65
72
|
}
|
|
66
|
-
return (_jsx(CommandMenu, { items: verbs, align: "start", label: columnLabel(col), trigger:
|
|
73
|
+
return (_jsx(CommandMenu, { items: verbs, align: "start", label: columnLabel(col), trigger: drawGridButton(views, {
|
|
74
|
+
"aria-label": columnLabel(col),
|
|
75
|
+
own: "flex min-w-0 items-center gap-1 text-left",
|
|
76
|
+
frame: "h-auto min-w-0 max-w-full justify-start gap-1 -mx-1 px-1 py-0 text-left [font:inherit]",
|
|
77
|
+
variant: "ghost",
|
|
78
|
+
size: "sm",
|
|
79
|
+
children: (_jsxs(_Fragment, { children: [cell, _jsx(Chevron, { className: "h-3 w-3 opacity-60" })] })),
|
|
80
|
+
}) }));
|
|
67
81
|
}
|
|
68
82
|
function displayOptionsFor(col, row, opts) {
|
|
69
83
|
const resolved = resolveRowCurrency(col, row, opts);
|
|
@@ -84,6 +98,7 @@ function displayOptionsFor(col, row, opts) {
|
|
|
84
98
|
markerReason: opts?.markerReason,
|
|
85
99
|
onResolve: opts?.onResolve,
|
|
86
100
|
onToggle: opts?.onToggle,
|
|
101
|
+
booleanCheckbox: opts?.booleanCheckbox,
|
|
87
102
|
entityIcon: opts?.entityIcon,
|
|
88
103
|
slotOwnsClick: opts?.slotOwnsClick,
|
|
89
104
|
hostOwnsPlainClick: opts?.hostOwnsPlainClick,
|
|
@@ -10,7 +10,7 @@ export function listRelationWrap(opts) {
|
|
|
10
10
|
const onOpenRelation = opts?.onOpenRelation;
|
|
11
11
|
if (onOpenRelation) {
|
|
12
12
|
return function openRelationWrap(relation, chip) {
|
|
13
|
-
return (_jsx("button", { type: "button", "data-no-nav": true, title: relation.label, onClick: (event) => {
|
|
13
|
+
return (_jsx("button", { type: "button", "data-no-nav": true, "data-slot": "vk-relation-link", title: relation.label, onClick: (event) => {
|
|
14
14
|
event.stopPropagation();
|
|
15
15
|
onOpenRelation(relation);
|
|
16
16
|
}, className: cx(ELEMENT_RESET, CHIP_INTERACTIVE), children: chip }));
|