@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/display/actor.js
CHANGED
|
@@ -22,5 +22,5 @@ function ActorChip({ actor, opts }) {
|
|
|
22
22
|
const Glyph = views.icons[ACTOR_GLYPH[actor.type]];
|
|
23
23
|
const label = actorLabel(actor, views.conventions);
|
|
24
24
|
const avatarUrl = actor.avatarUrl;
|
|
25
|
-
return (_jsx("span", { className: CHIP_BASE, title: label, children: _jsx(EntityChipIdentity, { label: label, avatarUrl: avatarUrl, fallbackIcon: _jsx(Glyph, { className: "h-3 w-3 shrink-0 text-(color:--vk-fg-subtlest)" }), labelClassName: cellTextClass(opts?.wrap) }) }));
|
|
25
|
+
return (_jsx("span", { className: CHIP_BASE, title: label, children: _jsx(EntityChipIdentity, { label: label, avatarUrl: avatarUrl, kind: actor.type, fallbackIcon: _jsx(Glyph, { className: "h-3 w-3 shrink-0 text-(color:--vk-fg-subtlest)" }), labelClassName: cellTextClass(opts?.wrap) }) }));
|
|
26
26
|
}
|
package/dist/display/boolean.js
CHANGED
|
@@ -15,6 +15,11 @@ export function renderBoolean(field, value, opts) {
|
|
|
15
15
|
const option = field.options?.find((o) => o.value === String(truthy));
|
|
16
16
|
return option ? (_jsx("span", { className: "truncate text-(color:--vk-fg-subtle)", children: option.label })) : (_jsx(BooleanWord, { value: truthy }));
|
|
17
17
|
}
|
|
18
|
+
const Box = opts?.booleanCheckbox;
|
|
19
|
+
if (Box && !opts?.booleanIcon && !opts?.slotOwnsClick) {
|
|
20
|
+
const onToggle = opts.onToggle;
|
|
21
|
+
return (_jsx(Box, { checked: truthy, "aria-label": field.label, tabIndex: -1, disabled: onToggle ? opts.booleanDisabled : undefined, readOnly: onToggle ? undefined : true, onCheckedChange: onToggle ? (next) => onToggle(next) : () => undefined }));
|
|
22
|
+
}
|
|
18
23
|
const glyph = opts?.booleanIcon ? opts.booleanIcon(truthy) : _jsx(BooleanTick, { checked: truthy });
|
|
19
24
|
return renderToggle(glyph, truthy, field, opts);
|
|
20
25
|
}
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* THE identity of an entity reference, anywhere one is drawn inline — a grid
|
|
4
4
|
* relation cell, a board-card chip, the activity feed's entity link.
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* The picture is the `Avatar` atom's: handed whose it is, its url, its kind and
|
|
7
|
+
* the glyph this chip draws without one. The default draws the picture while it
|
|
8
|
+
* loads and the glyph otherwise (avatar first, icon second); an app's own draws
|
|
9
|
+
* initials on a tone, or a record in its own shape. The glyph chain under it is
|
|
10
|
+
* this component's: host-supplied icon → the caller's fallback. Surfaces supply
|
|
11
|
+
* the data (`avatarUrl` rides the relation value), so "should this show the
|
|
12
|
+
* picture?" is never re-decided per surface.
|
|
12
13
|
*
|
|
13
|
-
* Renders a fragment (
|
|
14
|
+
* Renders a fragment (picture + label as siblings) — the CALLER owns the flex
|
|
14
15
|
* container, its gap, and the interactivity around it. That is what lets the
|
|
15
16
|
* grid chip, with its own hover/link contract, and the feed link, with its
|
|
16
17
|
* primary-colored label, share one identity without sharing chrome.
|
|
17
18
|
*/
|
|
18
|
-
export declare function EntityChipIdentity({ label, avatarUrl, iconOverride, fallbackIcon, labelClassName, }: {
|
|
19
|
+
export declare function EntityChipIdentity({ label, avatarUrl, kind, iconOverride, fallbackIcon, labelClassName, }: {
|
|
19
20
|
label: string;
|
|
20
21
|
avatarUrl?: string | null;
|
|
22
|
+
/** The record's kind as the app names it, handed to the Avatar for its shape. */
|
|
23
|
+
kind?: string;
|
|
21
24
|
/** Host-resolved glyph — never beats a real avatar. */
|
|
22
25
|
iconOverride?: ReactNode;
|
|
23
26
|
/** Rendered when neither an avatar nor an override exists. */
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
3
|
import { cx } from "../internal/cx.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
return (_jsxs(_Fragment, { children: [
|
|
4
|
+
import { useViews } from "../provider/context.js";
|
|
5
|
+
export function EntityChipIdentity({ label, avatarUrl, kind, iconOverride, fallbackIcon, labelClassName, }) {
|
|
6
|
+
const { Avatar } = useViews().atoms;
|
|
7
|
+
return (_jsxs(_Fragment, { children: [_jsx(Avatar, { label: label, avatarUrl: avatarUrl, kind: kind, size: "chip", fallback: iconOverride ?? fallbackIcon ?? null }), _jsx("span", { className: cx("min-w-0", labelClassName), children: label })] }));
|
|
9
8
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HOW MANY OF A CELL'S VALUES FIT — the arithmetic and the one observer behind `severalValues: "fit"`.
|
|
3
|
+
*
|
|
4
|
+
* A cell of several values measures them once, when it mounts and when they change: each value's right
|
|
5
|
+
* edge, and the room the count needs. From then on a change of its width is arithmetic over what it kept,
|
|
6
|
+
* so a column resize reads nothing from the page and draws again only the cells whose number changed.
|
|
7
|
+
*/
|
|
8
|
+
/** How a cell of several values draws on one line (`ViewsProvider`'s `severalValues`). `first`: its first
|
|
9
|
+
* value and a count, at any width, as on 0.5.0. `fit`: as many whole values as fit its width, then a count. */
|
|
10
|
+
export type ViewsSeveralValues = "first" | "fit";
|
|
11
|
+
/** The most values drawn to be measured: no column fits more, and a cell of 200 records doesn't draw 200
|
|
12
|
+
* chips to find out. */
|
|
13
|
+
export declare const FIT_MEASURE_CAP = 20;
|
|
14
|
+
/**
|
|
15
|
+
* How many values to show. `ends[i]` is value i's right edge from the box's left, for the first
|
|
16
|
+
* `ends.length` of `total` values; `room` is the box's width; `more` is the count's own width plus the gap
|
|
17
|
+
* before it. All of them when every value was measured and the last one's edge is inside the room;
|
|
18
|
+
* otherwise as many as leave room for the count, and never fewer than one, which shows cut. One in a box
|
|
19
|
+
* that isn't laid out (`room` 0), as on 0.5.0.
|
|
20
|
+
*/
|
|
21
|
+
export declare function fitCount(ends: readonly number[], total: number, room: number, more: number): number;
|
|
22
|
+
/** One layout read of a cell's values. Counted always: an increment is free, and the grid's count tests read it. */
|
|
23
|
+
export declare function countValuesMeasure(): void;
|
|
24
|
+
/** The layout reads since the last take; the count starts again. */
|
|
25
|
+
export declare function takeValuesMeasures(): number;
|
|
26
|
+
/**
|
|
27
|
+
* Hands `onWidth` the box's width whenever it changes, through ONE observer for the whole page, made on the
|
|
28
|
+
* first call: a grid with fit on holds one observer and a box per drawn cell of several values, and a page
|
|
29
|
+
* with fit off holds none. The returned function lets the box go. No `ResizeObserver` (a server, an old
|
|
30
|
+
* engine): nothing is observed, and the cell keeps the width it measured.
|
|
31
|
+
*/
|
|
32
|
+
export declare function observeWidth(box: Element, onWidth: (width: number) => void): () => void;
|
|
33
|
+
/** For a test that swaps `ResizeObserver`: forget the page's observer, so the next box makes a new one. */
|
|
34
|
+
export declare function forgetWidthObserverInTest(): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const FIT_MEASURE_CAP = 20;
|
|
2
|
+
const SLACK = 1;
|
|
3
|
+
export function fitCount(ends, total, room, more) {
|
|
4
|
+
if (room <= 0 || ends.length === 0)
|
|
5
|
+
return 1;
|
|
6
|
+
const limit = room + SLACK;
|
|
7
|
+
if (total === ends.length && ends[ends.length - 1] <= limit)
|
|
8
|
+
return total;
|
|
9
|
+
let shown = 1;
|
|
10
|
+
for (let k = 2; k <= ends.length; k++) {
|
|
11
|
+
if (ends[k - 1] + more > limit)
|
|
12
|
+
break;
|
|
13
|
+
shown = k;
|
|
14
|
+
}
|
|
15
|
+
return shown;
|
|
16
|
+
}
|
|
17
|
+
let measures = 0;
|
|
18
|
+
export function countValuesMeasure() {
|
|
19
|
+
measures += 1;
|
|
20
|
+
}
|
|
21
|
+
export function takeValuesMeasures() {
|
|
22
|
+
const count = measures;
|
|
23
|
+
measures = 0;
|
|
24
|
+
return count;
|
|
25
|
+
}
|
|
26
|
+
let observer = null;
|
|
27
|
+
const handlers = new WeakMap();
|
|
28
|
+
export function observeWidth(box, onWidth) {
|
|
29
|
+
if (typeof ResizeObserver === "undefined")
|
|
30
|
+
return () => undefined;
|
|
31
|
+
observer ??= new ResizeObserver((entries) => {
|
|
32
|
+
for (const entry of entries)
|
|
33
|
+
handlers.get(entry.target)?.(entry.contentRect.width);
|
|
34
|
+
});
|
|
35
|
+
handlers.set(box, onWidth);
|
|
36
|
+
observer.observe(box);
|
|
37
|
+
return () => {
|
|
38
|
+
handlers.delete(box);
|
|
39
|
+
observer?.unobserve(box);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function forgetWidthObserverInTest() {
|
|
43
|
+
observer?.disconnect();
|
|
44
|
+
observer = null;
|
|
45
|
+
}
|
package/dist/display/location.js
CHANGED
|
@@ -13,7 +13,7 @@ export function renderLocation(field, value, opts) {
|
|
|
13
13
|
function PlaceValue({ value, opts: given }) {
|
|
14
14
|
const opts = useDisplayOptions(given);
|
|
15
15
|
const write = opts.wrap === "full" ? locationText : locationShort;
|
|
16
|
-
const locale = opts.viewer?.locale;
|
|
16
|
+
const locale = opts.viewer?.language ?? opts.viewer?.locale;
|
|
17
17
|
if (Array.isArray(value)) {
|
|
18
18
|
const places = value.map((place) => write(place, locale)).filter(Boolean);
|
|
19
19
|
return (_jsx(MultiValueCell, { items: places, wrap: !!opts.wrap, title: places.join(", "), slotOwnsClick: opts.slotOwnsClick }));
|
|
@@ -1,27 +1,91 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useRef, useState } from "react";
|
|
3
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { DefaultCellMore } from "../atoms/CellMore.js";
|
|
4
5
|
import { cx } from "../internal/cx.js";
|
|
5
6
|
import { ELEMENT_RESET } from "../internal/reset.js";
|
|
6
7
|
import { useViews } from "../provider/context.js";
|
|
8
|
+
import { FIT_MEASURE_CAP, countValuesMeasure, fitCount, observeWidth } from "./fit-values.js";
|
|
7
9
|
const VISIBLE_FLAT = 1;
|
|
8
10
|
const VISIBLE_WRAPPED = 3;
|
|
9
11
|
const ROW_INSET = 14;
|
|
12
|
+
const MORE_LOOK = cx("shrink-0 rounded-md [corner-shape:squircle] border border-(color:--vk-border)", "bg-(color:--vk-ground) px-1 text-[10px] leading-[0.9rem] text-(color:--vk-fg-subtle) shadow-xs", "transition-colors hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg)");
|
|
13
|
+
const MORE_TEXT = "shrink-0 text-[10px] leading-[0.9rem] text-(color:--vk-fg-subtle)";
|
|
10
14
|
export function MultiValueCell({ items, details, wrap, title, slotOwnsClick, }) {
|
|
11
|
-
const { atoms, components, messages } = useViews();
|
|
15
|
+
const { atoms, components, messages, severalValues } = useViews();
|
|
16
|
+
const { CellMore } = atoms;
|
|
17
|
+
const ownCount = CellMore === DefaultCellMore;
|
|
12
18
|
const [open, setOpen] = useState(false);
|
|
13
19
|
const anchor = useRef(null);
|
|
14
20
|
const trigger = useRef(null);
|
|
21
|
+
const fit = severalValues === "fit" && !wrap && items.length > 1;
|
|
22
|
+
const key = `${items.length}\u0000${title ?? ""}`;
|
|
23
|
+
const keyRef = useRef(key);
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
keyRef.current = key;
|
|
26
|
+
}, [key]);
|
|
27
|
+
const kept = useRef(null);
|
|
28
|
+
const [fitted, setFitted] = useState(null);
|
|
29
|
+
const measuring = fit && (fitted === null || fitted.key !== key || "measure" in fitted);
|
|
30
|
+
useLayoutEffect(() => {
|
|
31
|
+
if (!measuring)
|
|
32
|
+
return;
|
|
33
|
+
const box = anchor.current;
|
|
34
|
+
if (!box)
|
|
35
|
+
return;
|
|
36
|
+
const measure = () => {
|
|
37
|
+
countValuesMeasure();
|
|
38
|
+
const room = box.getBoundingClientRect();
|
|
39
|
+
const valueBoxes = [...box.querySelectorAll(":scope > [data-vk-fit-value]")];
|
|
40
|
+
const ends = valueBoxes.map((value) => value.getBoundingClientRect().right - room.left);
|
|
41
|
+
const count = box.querySelector(':scope > [data-slot="vk-cell-more"]')?.getBoundingClientRect();
|
|
42
|
+
if (room.width <= 0 || ends.every((end) => end <= 0) || !count) {
|
|
43
|
+
kept.current = null;
|
|
44
|
+
setFitted({ key, shown: 1 });
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const more = count.right - room.left - ends[ends.length - 1];
|
|
48
|
+
kept.current = { key, ends, more, total: items.length };
|
|
49
|
+
setFitted({ key, shown: fitCount(ends, items.length, room.width, more) });
|
|
50
|
+
};
|
|
51
|
+
measure();
|
|
52
|
+
}, [measuring, key, items.length]);
|
|
53
|
+
useLayoutEffect(() => {
|
|
54
|
+
const box = anchor.current;
|
|
55
|
+
if (!fit || !box)
|
|
56
|
+
return;
|
|
57
|
+
return observeWidth(box, (width) => {
|
|
58
|
+
const at = kept.current;
|
|
59
|
+
if (!at || at.key !== keyRef.current) {
|
|
60
|
+
if (width > 0)
|
|
61
|
+
setFitted({ key: keyRef.current, measure: true });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const shown = fitCount(at.ends, at.total, width, at.more);
|
|
65
|
+
setFitted((current) => (current && "shown" in current && current.key === at.key && current.shown === shown ? current : { key: at.key, shown }));
|
|
66
|
+
});
|
|
67
|
+
}, [fit]);
|
|
15
68
|
if (items.length === 0)
|
|
16
69
|
return null;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
70
|
+
const shownCount = !fit
|
|
71
|
+
? wrap
|
|
72
|
+
? VISIBLE_WRAPPED
|
|
73
|
+
: VISIBLE_FLAT
|
|
74
|
+
: measuring
|
|
75
|
+
? FIT_MEASURE_CAP
|
|
76
|
+
: fitted && "shown" in fitted
|
|
77
|
+
? fitted.shown
|
|
78
|
+
: VISIBLE_FLAT;
|
|
79
|
+
const shown = items.slice(0, shownCount);
|
|
80
|
+
const hidden = measuring ? items.length : items.length - shown.length;
|
|
81
|
+
const content = (_jsxs("span", { ref: anchor, className: cx("flex min-w-0 items-center gap-1", wrap && "flex-wrap gap-y-0.5", fit && "flex-1"), title: title, "data-vk-fit": fit ? "" : undefined, children: [shown.map((item, index) => (_jsx("span", { "data-vk-fit-value": fit ? "" : undefined, className: measuring
|
|
82
|
+
? "flex shrink-0 items-center whitespace-nowrap"
|
|
83
|
+
: "flex min-w-0 items-center truncate *:min-w-0 *:truncate", children: typeof item === "string" || typeof item === "number" ? _jsx("span", { children: item }) : item }, index))), hidden > 0 &&
|
|
84
|
+
(slotOwnsClick ? (_jsx("span", { "data-slot": "vk-cell-more", className: ownCount ? MORE_TEXT : "shrink-0", children: _jsx(CellMore, { count: hidden, inert: true }) })) : (_jsx("button", { ref: trigger, type: "button", tabIndex: -1, "data-no-nav": true, "data-slot": "vk-cell-more", "data-open": open ? "" : undefined, "aria-label": messages({ key: "views.display.show-all", values: { count: items.length } }), "aria-haspopup": "dialog", "aria-expanded": open, onClick: (event) => {
|
|
21
85
|
event.stopPropagation();
|
|
22
86
|
setOpen((current) => !current);
|
|
23
|
-
}, className: cx(ELEMENT_RESET,
|
|
24
|
-
if (hidden === 0 || slotOwnsClick)
|
|
87
|
+
}, className: ownCount ? cx(ELEMENT_RESET, MORE_LOOK) : cx(ELEMENT_RESET, "shrink-0"), children: _jsx(CellMore, { count: hidden, inert: false }) })))] }));
|
|
88
|
+
if (hidden === 0 || slotOwnsClick || measuring)
|
|
25
89
|
return content;
|
|
26
90
|
const { Popover } = components;
|
|
27
91
|
const { List, Row } = atoms;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
2
|
import type { CategoryColor } from "@viewkitjs/fields/design/category-colors";
|
|
3
3
|
import type { CurrencyFormat, DateStyle, FieldMessageResolver, NumberFormat, PercentDisplay, PercentFormat, RelationValue } from "@viewkitjs/fields";
|
|
4
4
|
import type { DurationStyle } from "@viewkitjs/fields/format/time";
|
|
5
5
|
import type { ViewsMessageResolver } from "../contract.js";
|
|
6
|
+
import type { ViewsCheckboxProps } from "../provider/components.js";
|
|
6
7
|
/**
|
|
7
8
|
* What the number FORMATTER accepts — wider than what a number FIELD declares.
|
|
8
9
|
*
|
|
@@ -45,6 +46,9 @@ export type RelationWrap = (relation: RelationValue, chip: ReactNode) => ReactNo
|
|
|
45
46
|
/** Viewer-owned context. No mutable locale or timezone singleton lives in fields. */
|
|
46
47
|
export type FieldViewerContext = {
|
|
47
48
|
locale: string;
|
|
49
|
+
/** The language names are written in (a place's country and region): the conventions' `language`. Absent,
|
|
50
|
+
* `locale`. */
|
|
51
|
+
language?: string;
|
|
48
52
|
timeZone?: string;
|
|
49
53
|
/** The viewer's country, from the conventions: a phone of that country is written as at home. */
|
|
50
54
|
region?: string;
|
|
@@ -139,6 +143,10 @@ export type DisplayOptions = {
|
|
|
139
143
|
onToggle?: (next: boolean) => void;
|
|
140
144
|
/** Temporarily disables a two-way control while preserving its rendered shape. */
|
|
141
145
|
booleanDisabled?: boolean;
|
|
146
|
+
/** boolean `checkbox` style: the control that draws the box, handed `checked`, the field's label, `tabIndex` -1 and
|
|
147
|
+
* `onCheckedChange` (or `readOnly` without `onToggle`). Absent: ViewKit's `TickBox`, in its own switch button when
|
|
148
|
+
* `onToggle` is handed. The grid hands the components map's `Checkbox` while `gridCheckboxes` is `checkbox`. */
|
|
149
|
+
booleanCheckbox?: ComponentType<ViewsCheckboxProps>;
|
|
142
150
|
/** relation: the caller's glyph for a kind. The field core has no app registry. */
|
|
143
151
|
entityIcon?: (kind: string | undefined) => ReactNode;
|
|
144
152
|
/** relation: the caller wraps each chip with its own click-through. Absent = inert. */
|
package/dist/display/relation.js
CHANGED
|
@@ -37,7 +37,7 @@ function RelationChip({ field, relation, opts, }) {
|
|
|
37
37
|
const Glyph = views.icons.relation;
|
|
38
38
|
const { RelationRoles } = views.atoms;
|
|
39
39
|
const roles = roleLabels(field, relation);
|
|
40
|
-
const chip = (_jsxs(_Fragment, { children: [_jsx(EntityChipIdentity, { label: relation.label, avatarUrl: relation.avatarUrl, iconOverride: relation.icon ?? opts?.entityIcon?.(relation.entity), fallbackIcon: _jsx(Glyph, { className: "h-3 w-3 shrink-0 text-(color:--vk-fg-subtlest)" }), labelClassName: cellTextClass(opts?.wrap) }), roles.length > 0 ? _jsx(RelationRoles, { relation: relation, roles: roles }) : null] }));
|
|
40
|
+
const chip = (_jsxs(_Fragment, { children: [_jsx(EntityChipIdentity, { label: relation.label, avatarUrl: relation.avatarUrl, kind: relation.entity, iconOverride: relation.icon ?? opts?.entityIcon?.(relation.entity), fallbackIcon: _jsx(Glyph, { className: "h-3 w-3 shrink-0 text-(color:--vk-fg-subtlest)" }), labelClassName: cellTextClass(opts?.wrap) }), roles.length > 0 ? _jsx(RelationRoles, { relation: relation, roles: roles }) : null] }));
|
|
41
41
|
if (opts?.relationWrap)
|
|
42
42
|
return opts.relationWrap(relation, chip);
|
|
43
43
|
return (_jsx("span", { className: CHIP_BASE, title: chipTitle(relation, roles), children: chip }));
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { markdownFirstLine, markdownPlainText } from "@viewkitjs/fields";
|
|
5
5
|
import { cx } from "../internal/cx.js";
|
|
6
|
-
import {
|
|
6
|
+
import { drawFieldRowButton } from "../field-row/field-row-button.js";
|
|
7
7
|
import { useViews } from "../provider/context.js";
|
|
8
8
|
import { cellTextClass } from "./text-class.js";
|
|
9
9
|
const FOLDED_PX = 160;
|
|
@@ -18,7 +18,8 @@ export function renderRichText(_field, value, opts) {
|
|
|
18
18
|
return (_jsx("span", { className: cellTextClass(false), title: line, children: line }));
|
|
19
19
|
}
|
|
20
20
|
function RichTextBlock({ source }) {
|
|
21
|
-
const
|
|
21
|
+
const views = useViews();
|
|
22
|
+
const { components, messages } = views;
|
|
22
23
|
const { Markdown } = components;
|
|
23
24
|
const boxRef = useRef(null);
|
|
24
25
|
const [tall, setTall] = useState(false);
|
|
@@ -28,8 +29,18 @@ function RichTextBlock({ source }) {
|
|
|
28
29
|
if (el)
|
|
29
30
|
setTall(el.scrollHeight > FOLDED_PX + 8);
|
|
30
31
|
}, [source]);
|
|
31
|
-
return (_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { ref: boxRef, className: cx("relative min-w-0 overflow-hidden", !open && tall && "max-h-40"), children: [_jsx(Markdown, { source: source }), !open && tall && (_jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-linear-to-t from-(color:--vk-ground) to-transparent" }))] }), tall &&
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
return (_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { ref: boxRef, className: cx("relative min-w-0 overflow-hidden", !open && tall && "max-h-40"), children: [_jsx(Markdown, { source: source }), !open && tall && (_jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-linear-to-t from-(color:--vk-ground) to-transparent" }))] }), tall &&
|
|
33
|
+
drawFieldRowButton(views, {
|
|
34
|
+
own: "mt-1 text-xs text-(color:--vk-fg-subtle) hover:text-(color:--vk-fg)",
|
|
35
|
+
frame: "mt-1 -mx-1 h-auto px-1 py-0.5 text-xs",
|
|
36
|
+
variant: "ghost",
|
|
37
|
+
size: "sm",
|
|
38
|
+
"data-slot": "vk-show-more",
|
|
39
|
+
noNav: true,
|
|
40
|
+
onClick: (event) => {
|
|
41
|
+
event.stopPropagation();
|
|
42
|
+
setOpen((was) => !was);
|
|
43
|
+
},
|
|
44
|
+
children: messages({ key: open ? "views.display.show-less" : "views.display.show-more" }),
|
|
45
|
+
})] }));
|
|
35
46
|
}
|
package/dist/display/select.js
CHANGED
|
@@ -4,6 +4,7 @@ import { resolveCategoryColor } from "@viewkitjs/fields/design/category-colors";
|
|
|
4
4
|
import { optionFor } from "@viewkitjs/fields";
|
|
5
5
|
import { useViews } from "../provider/context.js";
|
|
6
6
|
import { MultiValueCell } from "./multi-value.js";
|
|
7
|
+
import { placeAmong, statusSteps } from "./status-steps.js";
|
|
7
8
|
export function renderSelect(field, value, opts) {
|
|
8
9
|
return renderOptionValue(field, String(value), "category", opts, field.vocabulary === "custom-values");
|
|
9
10
|
}
|
|
@@ -20,17 +21,18 @@ function renderOptionValue(field, value, style, opts, selfLabelled = false) {
|
|
|
20
21
|
const label = option?.label ?? opts?.labelFallback?.(value) ?? (selfLabelled ? value : undefined);
|
|
21
22
|
if (label === undefined)
|
|
22
23
|
return _jsx(StrayOption, { value: value });
|
|
23
|
-
if (style === "status")
|
|
24
|
-
return _jsx(OptionStatus, { slot: option?.slot ?? "muted", label: label, icon: option?.icon });
|
|
24
|
+
if (style === "status") {
|
|
25
|
+
return (_jsx(OptionStatus, { slot: option?.slot ?? "muted", label: label, icon: option?.icon, place: placeAmong(statusSteps(field), value) }));
|
|
26
|
+
}
|
|
25
27
|
return (_jsx(OptionCategory, { label: label, color: resolveCategoryColor(value, field.options, opts?.optionColors), icon: option?.icon }));
|
|
26
28
|
}
|
|
27
29
|
function StrayOption({ value }) {
|
|
28
30
|
const { messages } = useViews();
|
|
29
31
|
return (_jsx("span", { className: "text-(color:--vk-fg-subtle)", title: messages({ key: "views.display.not-an-option" }), children: value }));
|
|
30
32
|
}
|
|
31
|
-
function OptionStatus({ slot, label, icon }) {
|
|
33
|
+
function OptionStatus({ slot, label, icon, place, }) {
|
|
32
34
|
const { atoms: { StatusBadge }, components: { AppIcon }, } = useViews();
|
|
33
|
-
return (_jsx(StatusBadge, { slot: slot, label: label, className: "border-0", leading: icon ? _jsx(AppIcon, { name: icon, className: "size-3 shrink-0" }) : undefined }));
|
|
35
|
+
return (_jsx(StatusBadge, { slot: slot, label: label, place: place, className: "border-0", leading: icon ? _jsx(AppIcon, { name: icon, className: "size-3 shrink-0" }) : undefined }));
|
|
34
36
|
}
|
|
35
37
|
function OptionCategory({ label, color, icon }) {
|
|
36
38
|
const { atoms: { Tag }, components: { AppIcon }, } = useViews();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FieldOption } from "@viewkitjs/fields";
|
|
2
|
+
import type { ViewsStatusOption, ViewsStatusPlace } from "../atoms/types.js";
|
|
3
|
+
/** A field's steps: its active options, archived out, in declared order. The same array for the same options. */
|
|
4
|
+
export declare function statusSteps(holder: {
|
|
5
|
+
options?: readonly FieldOption[];
|
|
6
|
+
}): readonly FieldOption[];
|
|
7
|
+
/** A value's place among the steps, or none for a value that is no step (a stray, an archived value, the None row). */
|
|
8
|
+
export declare function placeAmong(steps: readonly ViewsStatusOption[], value: string): ViewsStatusPlace | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { optionsOf } from "@viewkitjs/fields";
|
|
2
|
+
const STEPS = new WeakMap();
|
|
3
|
+
const NONE = [];
|
|
4
|
+
export function statusSteps(holder) {
|
|
5
|
+
const options = holder.options;
|
|
6
|
+
if (!options)
|
|
7
|
+
return NONE;
|
|
8
|
+
let steps = STEPS.get(options);
|
|
9
|
+
if (!steps) {
|
|
10
|
+
steps = optionsOf(holder);
|
|
11
|
+
STEPS.set(options, steps);
|
|
12
|
+
}
|
|
13
|
+
return steps;
|
|
14
|
+
}
|
|
15
|
+
export function placeAmong(steps, value) {
|
|
16
|
+
const index = steps.findIndex((step) => step.value === value);
|
|
17
|
+
return index < 0 ? undefined : { index, options: steps };
|
|
18
|
+
}
|
package/dist/display/viewer.js
CHANGED
|
@@ -2,6 +2,7 @@ import { resolveViewsMessage } from "../contract.js";
|
|
|
2
2
|
export function viewerFrom(conventions, messages = resolveViewsMessage, now = new Date()) {
|
|
3
3
|
return {
|
|
4
4
|
locale: conventions.locale,
|
|
5
|
+
language: conventions.language,
|
|
5
6
|
timeZone: conventions.timeZone,
|
|
6
7
|
...(conventions.region ? { region: conventions.region } : {}),
|
|
7
8
|
now,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { CloseReason } from "@viewkitjs/fields";
|
|
3
|
+
/**
|
|
4
|
+
* The box around an app's whole body (a parts body, a values body, a text body, a number body): Escape and Tab from inside its element are the
|
|
5
|
+
* editor's, taken before the body hears them, so the field type's Escape rule decides what an Escape keeps and Tab walks the body's
|
|
6
|
+
* controls and closes from either end. A key that starts outside its element, in a popup the body draws in a portal
|
|
7
|
+
* (React still bubbles its events through here), is left to the body: its own list closes on its own Escape. Enter
|
|
8
|
+
* and every other key go to the body. `slot` names the body on the frame (`data-slot`); `innerEscape` marks it
|
|
9
|
+
* `EDITOR_INNER_ESCAPE`, so a popover that hears Escape on the document first leaves it to the frame (an editor whose
|
|
10
|
+
* session keeps on Escape).
|
|
11
|
+
*
|
|
12
|
+
* A text body's frame and a number body's take more: `closeOnModEnter`, ⌘ or Ctrl Enter from inside its element closes as Enter (ViewKit's own
|
|
13
|
+
* close for a line and a paragraph); `closeOnBlur`, the focus leaving its element for somewhere neither inside it nor in the
|
|
14
|
+
* body's own popup closes as a blur, as ViewKit's own box does in place, except the blur a press on the body's own surface
|
|
15
|
+
* causes (the cell around it takes the focus): the focus is put back instead; `inPlace`, it stands in a grid cell, so a Tab
|
|
16
|
+
* between the body's controls is stopped from reaching the grid, which cancels Tab while a cell edits. The package's own; no
|
|
17
|
+
* entry point exports it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function BodyFrame({ slot, innerEscape, closeOnModEnter, closeOnBlur, inPlace, onRequestClose, children, }: {
|
|
20
|
+
slot: "vk-parts-body" | "vk-values-body" | "vk-text-body" | "vk-number-body";
|
|
21
|
+
innerEscape?: boolean;
|
|
22
|
+
/** ⌘ or Ctrl Enter closes as Enter: `true` without Shift or Alt (a text body), `"any"` whatever else is held (a number
|
|
23
|
+
* body: ViewKit's own number box closes on Enter with any modifier). */
|
|
24
|
+
closeOnModEnter?: boolean | "any";
|
|
25
|
+
closeOnBlur?: boolean;
|
|
26
|
+
inPlace?: boolean;
|
|
27
|
+
onRequestClose: (reason: CloseReason) => void;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}): ReactNode;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { EDITOR_INNER_ESCAPE } from "./EditorPanel.js";
|
|
5
|
+
import { tabEnds } from "./tab-ends.js";
|
|
6
|
+
const inBodyPopup = (node) => node instanceof Element && node.closest(`[${EDITOR_INNER_ESCAPE}]`) !== null;
|
|
7
|
+
export function BodyFrame({ slot, innerEscape = false, closeOnModEnter = false, closeOnBlur = false, inPlace = false, onRequestClose, children, }) {
|
|
8
|
+
const tabbingRef = useRef(null);
|
|
9
|
+
const pressedRef = useRef(false);
|
|
10
|
+
const onKey = (event) => {
|
|
11
|
+
if (!event.currentTarget.contains(event.target))
|
|
12
|
+
return;
|
|
13
|
+
if (event.nativeEvent.isComposing)
|
|
14
|
+
return;
|
|
15
|
+
if (closeOnModEnter &&
|
|
16
|
+
event.key === "Enter" &&
|
|
17
|
+
(event.metaKey || event.ctrlKey) &&
|
|
18
|
+
(closeOnModEnter === "any" || (!event.altKey && !event.shiftKey))) {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
event.stopPropagation();
|
|
21
|
+
onRequestClose("enter");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (event.altKey || event.ctrlKey || event.metaKey)
|
|
25
|
+
return;
|
|
26
|
+
if (event.key === "Escape") {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
onRequestClose("escape");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (event.key !== "Tab")
|
|
33
|
+
return;
|
|
34
|
+
const { first, last } = tabEnds(event.currentTarget);
|
|
35
|
+
const leaving = event.shiftKey ? event.target === first : event.target === last;
|
|
36
|
+
if (!leaving) {
|
|
37
|
+
if (inPlace)
|
|
38
|
+
event.stopPropagation();
|
|
39
|
+
tabbingRef.current = event.shiftKey ? "shift-tab" : "tab";
|
|
40
|
+
setTimeout(() => (tabbingRef.current = null), 0);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
event.stopPropagation();
|
|
45
|
+
onRequestClose(event.shiftKey ? "shift-tab" : "tab");
|
|
46
|
+
};
|
|
47
|
+
const onBlurAway = (event) => {
|
|
48
|
+
const to = event.relatedTarget;
|
|
49
|
+
if (to && event.currentTarget.contains(to))
|
|
50
|
+
return;
|
|
51
|
+
const via = tabbingRef.current;
|
|
52
|
+
if (via) {
|
|
53
|
+
tabbingRef.current = null;
|
|
54
|
+
onRequestClose(via);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (!closeOnBlur || inBodyPopup(to))
|
|
58
|
+
return;
|
|
59
|
+
if (pressedRef.current) {
|
|
60
|
+
const lost = event.target;
|
|
61
|
+
const frame = event.currentTarget;
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
const at = document.activeElement;
|
|
64
|
+
if (at && (frame.contains(at) || inBodyPopup(at)))
|
|
65
|
+
return;
|
|
66
|
+
if (lost.isConnected)
|
|
67
|
+
lost.focus({ preventScroll: true });
|
|
68
|
+
}, 0);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
onRequestClose("blur");
|
|
72
|
+
};
|
|
73
|
+
const onPress = () => {
|
|
74
|
+
if (!closeOnBlur)
|
|
75
|
+
return;
|
|
76
|
+
pressedRef.current = true;
|
|
77
|
+
setTimeout(() => (pressedRef.current = false), 0);
|
|
78
|
+
};
|
|
79
|
+
return (_jsx("div", { "data-slot": slot, ...(innerEscape ? { [EDITOR_INNER_ESCAPE]: "" } : {}), className: "contents", onKeyDownCapture: onKey, onBlurCapture: onBlurAway, onPointerDownCapture: onPress, onMouseDownCapture: onPress, children: children }));
|
|
80
|
+
}
|
|
@@ -8,22 +8,17 @@ import { ELEMENT_RESET } from "../internal/reset.js";
|
|
|
8
8
|
import { useViews } from "../provider/context.js";
|
|
9
9
|
import { isDesktopNow } from "../provider/desktop.js";
|
|
10
10
|
import { usePickerForm } from "./picker-slot.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{ key: "date.
|
|
14
|
-
{ key: "date.
|
|
15
|
-
|
|
11
|
+
import { tabEnds } from "./tab-ends.js";
|
|
12
|
+
const QUICK_DAYS = {
|
|
13
|
+
today: { key: "date.today", offset: () => 0 },
|
|
14
|
+
tomorrow: { key: "date.tomorrow", offset: () => 1 },
|
|
15
|
+
"next-monday": { key: "date.next-monday", offset: (weekday) => (8 - weekday) % 7 || 7 },
|
|
16
|
+
"in-a-week": { key: "date.in-a-week", offset: () => 7 },
|
|
17
|
+
};
|
|
16
18
|
function quickDay(offset) {
|
|
17
19
|
const now = new Date();
|
|
18
20
|
return new Date(now.getFullYear(), now.getMonth(), now.getDate() + offset(now.getDay()));
|
|
19
21
|
}
|
|
20
|
-
const FOCUSABLE = "input, select, textarea, button, a[href], [tabindex]";
|
|
21
|
-
function tabEnds(root) {
|
|
22
|
-
const reachable = Array.from(root.querySelectorAll(FOCUSABLE)).filter((element) => element.tabIndex >= 0 &&
|
|
23
|
-
!element.disabled &&
|
|
24
|
-
element.closest("[hidden], [inert]") === null);
|
|
25
|
-
return { first: reachable[0], last: reachable.at(-1) };
|
|
26
|
-
}
|
|
27
22
|
const CALENDAR_START = "1900-01";
|
|
28
23
|
const CALENDAR_END = `${new Date().getFullYear() + 10}-12`;
|
|
29
24
|
const TIME_OPTIONS = Array.from({ length: 96 }, (_, i) => {
|
|
@@ -48,7 +43,7 @@ function readBodyValue(value) {
|
|
|
48
43
|
const time = normalizeTime(value.slice(11));
|
|
49
44
|
return time ? { day, time } : null;
|
|
50
45
|
}
|
|
51
|
-
const
|
|
46
|
+
const DEFAULT_DATE_PICKS = ["today", "tomorrow", "next-monday"];
|
|
52
47
|
function initialHasTime(iso, parsed) {
|
|
53
48
|
if (!iso || !parsed)
|
|
54
49
|
return false;
|
|
@@ -61,6 +56,7 @@ export const DateEditor = forwardRef(function DateEditor({ initial, timeOptional
|
|
|
61
56
|
const words = message ?? views.conventions.messages;
|
|
62
57
|
const { Calendar, Input, DateBody } = views.components;
|
|
63
58
|
const { List, Row } = views.atoms;
|
|
59
|
+
const quickPicks = views.datePicks ?? DEFAULT_DATE_PICKS;
|
|
64
60
|
const DateGlyph = views.icons.date;
|
|
65
61
|
const TimeGlyph = views.icons.time;
|
|
66
62
|
const [timeOpen, setTimeOpen] = useState(false);
|
|
@@ -215,7 +211,7 @@ export const DateEditor = forwardRef(function DateEditor({ initial, timeOptional
|
|
|
215
211
|
}
|
|
216
212
|
onTabOut(event);
|
|
217
213
|
};
|
|
218
|
-
return (_jsx("div", { "data-slot": "vk-date-editor", className: "contents", onKeyDownCapture: onBodyKey, onBlurCapture: onTabAway, children: _jsx(DateBody, { label: label ?? words({ key: "date.label" }), value: bodyValue, onValueChange: takeBodyValue, onDone: () => onRequestClose("pick"), time: !dayOnly, empty: clearable, picks: clearable ? [...
|
|
214
|
+
return (_jsx("div", { "data-slot": "vk-date-editor", className: "contents", onKeyDownCapture: onBodyKey, onBlurCapture: onTabAway, children: _jsx(DateBody, { label: label ?? words({ key: "date.label" }), value: bodyValue, onValueChange: takeBodyValue, onDone: () => onRequestClose("pick"), time: !dayOnly, empty: clearable, picks: clearable ? [...quickPicks, "none"] : [...quickPicks], today: toDayKey(new Date()), typed: seed, autoFocus: focusDate || seed != null, form: form }) }));
|
|
219
215
|
}
|
|
220
216
|
return (_jsxs("div", { "data-slot": "vk-date-editor", className: "contents", onKeyDownCapture: onTabOut, onBlurCapture: onTabAway, children: [_jsxs("div", { className: "flex items-center gap-1.5 border-b border-(color:--vk-border) p-2", children: [_jsxs("div", { className: "flex h-8 min-w-0 flex-1 items-center gap-2 rounded-lg bg-(color:--vk-neutral) px-2.5 focus-within:bg-(color:--vk-neutral-hovered)", children: [_jsx(DateGlyph, { className: "h-3.5 w-3.5 shrink-0 text-(color:--vk-fg-subtlest)" }), _jsx(Input, { ref: dateRef, type: "text", value: dateVal, onChange: (e) => {
|
|
221
217
|
touchedRef.current = true;
|
|
@@ -260,10 +256,10 @@ export const DateEditor = forwardRef(function DateEditor({ initial, timeOptional
|
|
|
260
256
|
setTimeOpen(false);
|
|
261
257
|
timeRef.current?.focus();
|
|
262
258
|
}, className: cx(ELEMENT_RESET, "w-full px-3 py-1.5 text-left text-sm tabular-nums hover:bg-(color:--vk-hovered)", active ? "bg-(color:--vk-neutral) font-medium text-(color:--vk-fg)" : "text-(color:--vk-fg-subtle)"), children: t }, t));
|
|
263
|
-
}) }))] }))] }), _jsx("div", { className: "flex gap-1 px-2 pt-2", children:
|
|
259
|
+
}) }))] }))] }), _jsx("div", { className: "flex gap-1 px-2 pt-2", children: quickPicks.map((pick) => (_jsx("button", { type: "button", onClick: (e) => {
|
|
264
260
|
e.stopPropagation();
|
|
265
|
-
chooseDay(quickDay(
|
|
266
|
-
}, className: cx(ELEMENT_RESET, "h-7 rounded-md bg-(color:--vk-neutral) px-2 text-xs text-(color:--vk-fg-subtle) hover:bg-(color:--vk-neutral-hovered) hover:text-(color:--vk-fg)"), children: words({ key:
|
|
261
|
+
chooseDay(quickDay(QUICK_DAYS[pick].offset));
|
|
262
|
+
}, className: cx(ELEMENT_RESET, "h-7 rounded-md bg-(color:--vk-neutral) px-2 text-xs text-(color:--vk-fg-subtle) hover:bg-(color:--vk-neutral-hovered) hover:text-(color:--vk-fg)"), children: words({ key: QUICK_DAYS[pick].key }) }, pick))) }), _jsx(Calendar, { locale: views.conventions.locale, ...(fill ? { className: "w-full" } : {}), value: (day ?? valid) ? toDayKey((day ?? valid)) : null, onChange: (picked) => {
|
|
267
263
|
const d = picked ? fromDayKey(picked) : null;
|
|
268
264
|
if (d)
|
|
269
265
|
chooseDay(d);
|
|
@@ -21,5 +21,7 @@ export declare const LocationEditor: import("react").ForwardRefExoticComponent<{
|
|
|
21
21
|
/** How each part's box is drawn: `bare` for a popover's compact rows, `field` where the boxes stand on their
|
|
22
22
|
* own (a phone's sheet), each in the app's field frame. Default `bare`. */
|
|
23
23
|
chrome?: "bare" | "field";
|
|
24
|
+
/** The field's name, for an app's `PartsBody`. Default: the field's label. */
|
|
25
|
+
label?: string;
|
|
24
26
|
onRequestClose: (reason: CloseReason) => void;
|
|
25
27
|
} & import("react").RefAttributes<LocationEditorHandle>>;
|