(core) updates from grist-core

This commit is contained in:
Paul Fitzpatrick
2024-03-25 09:45:23 -04:00
11 changed files with 102 additions and 11 deletions

View File

@@ -8,6 +8,7 @@ const t = makeT('RowContextMenu');
export interface IRowContextMenu {
disableInsert: boolean;
disableDelete: boolean;
disableMakeHeadersFromRow: boolean;
disableShowRecordCard: boolean;
isViewSorted: boolean;
numRows: number;
@@ -16,6 +17,7 @@ export interface IRowContextMenu {
export function RowContextMenu({
disableInsert,
disableDelete,
disableMakeHeadersFromRow,
disableShowRecordCard,
isViewSorted,
numRows
@@ -51,6 +53,11 @@ export function RowContextMenu({
menuItemCmd(allCommands.duplicateRows, t('Duplicate rows', { count: numRows }),
dom.cls('disabled', disableInsert || numRows === 0)),
);
result.push(
menuDivider(),
menuItemCmd(allCommands.makeHeadersFromRow, t("Use as table headers"),
dom.cls('disabled', disableMakeHeadersFromRow)),
);
result.push(
menuDivider(),
// TODO: should show `Delete ${num} rows` when multiple are selected