@galaxy-io/dls 1.2.7 → 1.3.1
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/README.md +2 -0
- package/dist/avatar/Avatar.d.ts +2 -1
- package/dist/avatar/Avatar.js +103 -14
- package/dist/buttons/Button.d.ts +6 -1
- package/dist/buttons/Button.js +8 -4
- package/dist/charts/BarChart.d.ts +30 -20
- package/dist/charts/BarChart.js +183 -253
- package/dist/charts/ChartAxis.d.ts +47 -22
- package/dist/charts/ChartAxis.js +81 -60
- package/dist/charts/ChartCategoryTargets.d.ts +27 -0
- package/dist/charts/ChartCategoryTargets.js +75 -0
- package/dist/charts/ChartEmptyState.d.ts +17 -0
- package/dist/charts/ChartEmptyState.js +29 -0
- package/dist/charts/ChartFrame.d.ts +110 -0
- package/dist/charts/ChartFrame.js +143 -0
- package/dist/charts/ChartLegend.d.ts +27 -4
- package/dist/charts/ChartLegend.js +46 -23
- package/dist/charts/ChartPrimitives.d.ts +230 -0
- package/dist/charts/ChartPrimitives.js +305 -0
- package/dist/charts/ChartTooltip.d.ts +25 -4
- package/dist/charts/ChartTooltip.js +55 -49
- package/dist/charts/LineChart.d.ts +42 -20
- package/dist/charts/LineChart.js +175 -241
- package/dist/charts/PieChart.d.ts +48 -32
- package/dist/charts/PieChart.js +180 -170
- package/dist/charts/barChartGeometry.d.ts +120 -0
- package/dist/charts/barChartGeometry.js +210 -0
- package/dist/charts/barChartLegend.d.ts +25 -0
- package/dist/charts/barChartLegend.js +23 -0
- package/dist/charts/chartFormat.d.ts +27 -0
- package/dist/charts/chartFormat.js +71 -0
- package/dist/charts/chartScales.d.ts +120 -0
- package/dist/charts/chartScales.js +165 -0
- package/dist/charts/chartTheme.d.ts +18 -0
- package/dist/charts/chartTheme.js +26 -0
- package/dist/charts/constants.d.ts +241 -18
- package/dist/charts/constants.js +261 -32
- package/dist/charts/lineChartGeometry.d.ts +92 -0
- package/dist/charts/lineChartGeometry.js +134 -0
- package/dist/charts/pieChartGeometry.d.ts +60 -0
- package/dist/charts/pieChartGeometry.js +79 -0
- package/dist/charts/types.d.ts +428 -54
- package/dist/charts/types.js +155 -0
- package/dist/charts/useCartesianChartLayout.d.ts +70 -0
- package/dist/charts/useCartesianChartLayout.js +56 -0
- package/dist/charts/useChartDimensions.d.ts +47 -0
- package/dist/charts/useChartDimensions.js +63 -0
- package/dist/charts/useChartFormatters.d.ts +19 -0
- package/dist/charts/useChartFormatters.js +20 -0
- package/dist/charts/useChartInteraction.d.ts +76 -0
- package/dist/charts/useChartInteraction.js +126 -0
- package/dist/charts/useChartTooltipPosition.d.ts +53 -0
- package/dist/charts/useChartTooltipPosition.js +39 -0
- package/dist/charts/useSeriesColorResolver.d.ts +37 -0
- package/dist/charts/useSeriesColorResolver.js +27 -0
- package/dist/hooks/useElementClientSize.d.ts +20 -0
- package/dist/hooks/useElementClientSize.js +43 -0
- package/dist/inputs/CheckboxInput.d.ts +7 -2
- package/dist/inputs/CheckboxInput.js +30 -14
- package/dist/inputs/Input.d.ts +1 -1
- package/dist/inputs/Input.js +6 -2
- package/dist/inputs/MultiSelectInput.js +1 -1
- package/dist/inputs/RadioInput.js +7 -2
- package/dist/styles.css +69 -74
- package/dist/table/InfiniteSpreadsheet.d.ts +6 -0
- package/dist/table/InfiniteSpreadsheet.js +235 -0
- package/dist/table/InfiniteTable.d.ts +7 -88
- package/dist/table/InfiniteTable.js +366 -577
- package/dist/{spreadsheet → table}/SpreadsheetCell.d.ts +6 -4
- package/dist/table/SpreadsheetCell.js +71 -0
- package/dist/{spreadsheet → table}/SpreadsheetCellEditor.js +27 -21
- package/dist/table/SpreadsheetHeaderCell.d.ts +23 -0
- package/dist/table/SpreadsheetHeaderCell.js +91 -0
- package/dist/table/SpreadsheetMenuItem.d.ts +14 -0
- package/dist/table/SpreadsheetMenuItem.js +33 -0
- package/dist/table/SpreadsheetPrimitives.d.ts +172 -0
- package/dist/table/SpreadsheetPrimitives.js +105 -0
- package/dist/table/SpreadsheetRow.d.ts +33 -0
- package/dist/table/SpreadsheetRow.js +73 -0
- package/dist/{spreadsheet → table}/SpreadsheetRowActionCell.d.ts +5 -7
- package/dist/table/SpreadsheetRowActionCell.js +51 -0
- package/dist/table/TableExpandCell.d.ts +11 -0
- package/dist/table/TableExpandCell.js +24 -0
- package/dist/table/TableExpandedRow.d.ts +16 -0
- package/dist/table/TableExpandedRow.js +77 -0
- package/dist/table/TableHeaderCellContent.d.ts +30 -0
- package/dist/table/TableHeaderCellContent.js +48 -0
- package/dist/table/TablePrimitives.d.ts +307 -0
- package/dist/table/TablePrimitives.js +298 -0
- package/dist/table/TableSelectCell.d.ts +18 -0
- package/dist/table/TableSelectCell.js +26 -0
- package/dist/table/TableStatusRow.d.ts +18 -0
- package/dist/table/TableStatusRow.js +50 -0
- package/dist/table/VirtualizedInfiniteTable.d.ts +11 -27
- package/dist/table/VirtualizedInfiniteTable.js +182 -317
- package/dist/table/types.d.ts +249 -0
- package/dist/table/types.js +51 -0
- package/dist/table/useInfiniteScrollSentinel.d.ts +24 -0
- package/dist/table/useInfiniteScrollSentinel.js +53 -0
- package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.d.ts +1 -1
- package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.js +1 -1
- package/dist/table/useTableColumnLayout.d.ts +28 -0
- package/dist/table/useTableColumnLayout.js +63 -0
- package/dist/table/useTableColumnResize.d.ts +38 -0
- package/dist/table/useTableColumnResize.js +155 -0
- package/dist/table/useTableKeyboardNavigation.d.ts +25 -0
- package/dist/table/useTableKeyboardNavigation.js +83 -0
- package/dist/table/useTableRowExpansion.d.ts +24 -0
- package/dist/table/useTableRowExpansion.js +62 -0
- package/dist/table/useTableRowSelection.d.ts +27 -0
- package/dist/table/useTableRowSelection.js +94 -0
- package/dist/table/utils.d.ts +50 -0
- package/dist/table/utils.js +78 -0
- package/dist/text/MarkdownText.js +45 -27
- package/dist/theme/variants/dark.js +1 -1
- package/dist/widget/Widget.d.ts +2 -0
- package/dist/widget/Widget.js +14 -7
- package/package.json +1 -5
- package/dist/assets/components/enrichment/PerplexityIcon.d.ts +0 -3
- package/dist/assets/components/enrichment/PerplexityIcon.js +0 -35
- package/dist/assets/components/enrichment/TavilyIcon.d.ts +0 -3
- package/dist/assets/components/enrichment/TavilyIcon.js +0 -15
- package/dist/assets/components/onboarding/TenantSetupDark.d.ts +0 -3
- package/dist/assets/components/onboarding/TenantSetupDark.js +0 -498
- package/dist/assets/components/onboarding/TenantSetupLight.d.ts +0 -3
- package/dist/assets/components/onboarding/TenantSetupLight.js +0 -482
- package/dist/assets/components/onboarding/UserSetupDark.d.ts +0 -3
- package/dist/assets/components/onboarding/UserSetupDark.js +0 -1086
- package/dist/assets/components/onboarding/UserSetupLight.d.ts +0 -3
- package/dist/assets/components/onboarding/UserSetupLight.js +0 -1024
- package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.js +0 -466
- package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.js +0 -460
- package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.js +0 -336
- package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.js +0 -336
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.js +0 -153
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.js +0 -153
- package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.js +0 -117
- package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.js +0 -117
- package/dist/assets/components/projects/MappingMethodBlankDark.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodBlankDark.js +0 -150
- package/dist/assets/components/projects/MappingMethodBlankDarkHovered.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodBlankDarkHovered.js +0 -150
- package/dist/assets/components/projects/MappingMethodBlankLight.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodBlankLight.js +0 -150
- package/dist/assets/components/projects/MappingMethodBlankLightHovered.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodBlankLightHovered.js +0 -150
- package/dist/assets/components/projects/MappingMethodJsonDark.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodJsonDark.js +0 -90
- package/dist/assets/components/projects/MappingMethodJsonDarkHovered.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodJsonDarkHovered.js +0 -90
- package/dist/assets/components/projects/MappingMethodJsonLight.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodJsonLight.js +0 -90
- package/dist/assets/components/projects/MappingMethodJsonLightHovered.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodJsonLightHovered.js +0 -90
- package/dist/assets/components/projects/ProjectsEmptyStateDark.d.ts +0 -3
- package/dist/assets/components/projects/ProjectsEmptyStateDark.js +0 -454
- package/dist/assets/components/projects/ProjectsEmptyStateLight.d.ts +0 -3
- package/dist/assets/components/projects/ProjectsEmptyStateLight.js +0 -456
- package/dist/assets/components/root/CreateProjectActionCardDark.d.ts +0 -3
- package/dist/assets/components/root/CreateProjectActionCardDark.js +0 -1796
- package/dist/assets/components/root/CreateProjectActionCardDarkHovered.d.ts +0 -3
- package/dist/assets/components/root/CreateProjectActionCardDarkHovered.js +0 -1796
- package/dist/assets/components/root/CreateProjectActionCardLight.d.ts +0 -3
- package/dist/assets/components/root/CreateProjectActionCardLight.js +0 -1786
- package/dist/assets/components/root/CreateProjectActionCardLightHovered.d.ts +0 -3
- package/dist/assets/components/root/CreateProjectActionCardLightHovered.js +0 -1786
- package/dist/assets/components/root/CreateSourceActionCardDark.d.ts +0 -3
- package/dist/assets/components/root/CreateSourceActionCardDark.js +0 -879
- package/dist/assets/components/root/CreateSourceActionCardDarkHovered.d.ts +0 -3
- package/dist/assets/components/root/CreateSourceActionCardDarkHovered.js +0 -879
- package/dist/assets/components/root/CreateSourceActionCardLight.d.ts +0 -3
- package/dist/assets/components/root/CreateSourceActionCardLight.js +0 -889
- package/dist/assets/components/root/CreateSourceActionCardLightHovered.d.ts +0 -3
- package/dist/assets/components/root/CreateSourceActionCardLightHovered.js +0 -889
- package/dist/assets/components/sources/AttioIcon.d.ts +0 -3
- package/dist/assets/components/sources/AttioIcon.js +0 -11
- package/dist/assets/components/sources/BigquerySourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/BigquerySourceIcon.js +0 -39
- package/dist/assets/components/sources/BrowserbaseSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/BrowserbaseSourceIcon.js +0 -35
- package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.d.ts +0 -3
- package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.js +0 -13
- package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.d.ts +0 -3
- package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.js +0 -13
- package/dist/assets/components/sources/ConfluenceSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/ConfluenceSourceIcon.js +0 -30
- package/dist/assets/components/sources/GithubSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/GithubSourceIcon.js +0 -27
- package/dist/assets/components/sources/GoogleDriveIcon.d.ts +0 -3
- package/dist/assets/components/sources/GoogleDriveIcon.js +0 -45
- package/dist/assets/components/sources/HubspotSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/HubspotSourceIcon.js +0 -14
- package/dist/assets/components/sources/JiraSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/JiraSourceIcon.js +0 -54
- package/dist/assets/components/sources/LinearSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/LinearSourceIcon.js +0 -14
- package/dist/assets/components/sources/MysqlLogoSourceIconDark.d.ts +0 -3
- package/dist/assets/components/sources/MysqlLogoSourceIconDark.js +0 -17
- package/dist/assets/components/sources/NetsuiteSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/NetsuiteSourceIcon.js +0 -32
- package/dist/assets/components/sources/NotionIcon.d.ts +0 -3
- package/dist/assets/components/sources/NotionIcon.js +0 -20
- package/dist/assets/components/sources/PostgresqlIcon.d.ts +0 -3
- package/dist/assets/components/sources/PostgresqlIcon.js +0 -61
- package/dist/assets/components/sources/S3Icon.d.ts +0 -3
- package/dist/assets/components/sources/S3Icon.js +0 -76
- package/dist/assets/components/sources/SalesforceSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/SalesforceSourceIcon.js +0 -23
- package/dist/assets/components/sources/SlackIcon.d.ts +0 -3
- package/dist/assets/components/sources/SlackIcon.js +0 -32
- package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.d.ts +0 -3
- package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.js +0 -14
- package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.d.ts +0 -3
- package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.js +0 -14
- package/dist/assets/components/sources/WikipediaSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/WikipediaSourceIcon.js +0 -1490
- package/dist/avatar/AvatarEmpty.d.ts +0 -7
- package/dist/avatar/AvatarEmpty.js +0 -99
- package/dist/avatar/types.d.ts +0 -5
- package/dist/avatar/types.js +0 -9
- package/dist/charts/utils.d.ts +0 -29
- package/dist/charts/utils.js +0 -62
- package/dist/icons/BackIcon.d.ts +0 -3
- package/dist/icons/BackIcon.js +0 -13
- package/dist/icons/CloseIcon.d.ts +0 -3
- package/dist/icons/CloseIcon.js +0 -13
- package/dist/icons/CreateIcon.d.ts +0 -3
- package/dist/icons/CreateIcon.js +0 -13
- package/dist/icons/ForwardIcon.d.ts +0 -3
- package/dist/icons/ForwardIcon.js +0 -13
- package/dist/icons/HelpIcon.d.ts +0 -3
- package/dist/icons/HelpIcon.js +0 -14
- package/dist/icons/ProjectsIcon.d.ts +0 -3
- package/dist/icons/ProjectsIcon.js +0 -12
- package/dist/icons/SearchIcon.d.ts +0 -3
- package/dist/icons/SearchIcon.js +0 -12
- package/dist/icons/SourcesIcon.d.ts +0 -3
- package/dist/icons/SourcesIcon.js +0 -12
- package/dist/icons/TextIcon.d.ts +0 -4
- package/dist/icons/TextIcon.js +0 -22
- package/dist/icons/WebScrapeIcon.d.ts +0 -4
- package/dist/icons/WebScrapeIcon.js +0 -22
- package/dist/icons/WebhookIcon.d.ts +0 -4
- package/dist/icons/WebhookIcon.js +0 -22
- package/dist/icons/sources/AttioLogomark.d.ts +0 -4
- package/dist/icons/sources/AttioLogomark.js +0 -8
- package/dist/icons/sources/BrowserbaseLogomark.d.ts +0 -4
- package/dist/icons/sources/BrowserbaseLogomark.js +0 -8
- package/dist/icons/sources/ClickhouseLogomark.d.ts +0 -4
- package/dist/icons/sources/ClickhouseLogomark.js +0 -16
- package/dist/icons/sources/ConfluenceLogomark.d.ts +0 -4
- package/dist/icons/sources/ConfluenceLogomark.js +0 -8
- package/dist/icons/sources/GithubLogomark.d.ts +0 -4
- package/dist/icons/sources/GithubLogomark.js +0 -8
- package/dist/icons/sources/GoogleBigqueryLogomark.d.ts +0 -4
- package/dist/icons/sources/GoogleBigqueryLogomark.js +0 -8
- package/dist/icons/sources/GoogleDriveLogomark.d.ts +0 -4
- package/dist/icons/sources/GoogleDriveLogomark.js +0 -8
- package/dist/icons/sources/HubspotLogomark.d.ts +0 -4
- package/dist/icons/sources/HubspotLogomark.js +0 -8
- package/dist/icons/sources/JiraLogomark.d.ts +0 -4
- package/dist/icons/sources/JiraLogomark.js +0 -8
- package/dist/icons/sources/LinearLogomark.d.ts +0 -4
- package/dist/icons/sources/LinearLogomark.js +0 -8
- package/dist/icons/sources/MySQLLogomark.d.ts +0 -4
- package/dist/icons/sources/MySQLLogomark.js +0 -8
- package/dist/icons/sources/NetsuiteLogomark.d.ts +0 -4
- package/dist/icons/sources/NetsuiteLogomark.js +0 -8
- package/dist/icons/sources/NotionLogomark.d.ts +0 -4
- package/dist/icons/sources/NotionLogomark.js +0 -8
- package/dist/icons/sources/PostgresLogomark.d.ts +0 -4
- package/dist/icons/sources/PostgresLogomark.js +0 -8
- package/dist/icons/sources/S3Logomark.d.ts +0 -4
- package/dist/icons/sources/S3Logomark.js +0 -8
- package/dist/icons/sources/SalesforceLogomark.d.ts +0 -4
- package/dist/icons/sources/SalesforceLogomark.js +0 -8
- package/dist/icons/sources/SlackLogoIconmark.d.ts +0 -4
- package/dist/icons/sources/SlackLogoIconmark.js +0 -8
- package/dist/icons/sources/SnowflakeLogomark.d.ts +0 -4
- package/dist/icons/sources/SnowflakeLogomark.js +0 -16
- package/dist/icons/sources/WikipediaLogomark.d.ts +0 -4
- package/dist/icons/sources/WikipediaLogomark.js +0 -8
- package/dist/spreadsheet/InfiniteSpreadsheet.d.ts +0 -3
- package/dist/spreadsheet/InfiniteSpreadsheet.js +0 -265
- package/dist/spreadsheet/SpreadsheetAddColumnButton.d.ts +0 -6
- package/dist/spreadsheet/SpreadsheetAddColumnButton.js +0 -32
- package/dist/spreadsheet/SpreadsheetCell.js +0 -115
- package/dist/spreadsheet/SpreadsheetHeaderCell.d.ts +0 -18
- package/dist/spreadsheet/SpreadsheetHeaderCell.js +0 -141
- package/dist/spreadsheet/SpreadsheetRow.d.ts +0 -21
- package/dist/spreadsheet/SpreadsheetRow.js +0 -68
- package/dist/spreadsheet/SpreadsheetRowActionCell.js +0 -78
- package/dist/spreadsheet/hooks/useColumnResize.d.ts +0 -6
- package/dist/spreadsheet/hooks/useColumnResize.js +0 -46
- package/dist/spreadsheet/types.d.ts +0 -92
- package/dist/spreadsheet/types.js +0 -21
- /package/dist/{spreadsheet → table}/SpreadsheetCellEditor.d.ts +0 -0
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ColumnAlign, ColumnPin, type SpreadsheetColumnDef } from "./types";
|
|
2
|
+
import { ColumnAlign, ColumnPin, TableDensity, TableVariant, type SpreadsheetColumnDef } from "./types";
|
|
3
3
|
export interface SpreadsheetCellProps<TData> {
|
|
4
4
|
column: SpreadsheetColumnDef<TData, unknown>;
|
|
5
5
|
row: TData;
|
|
6
6
|
rowIndex: number;
|
|
7
|
+
columnIndex: number;
|
|
7
8
|
isEditing: boolean;
|
|
8
9
|
onStartEditing: () => void;
|
|
9
10
|
onCommit: (value: unknown) => void;
|
|
10
11
|
onCancel: () => void;
|
|
11
|
-
width
|
|
12
|
+
width?: number;
|
|
12
13
|
pin?: ColumnPin;
|
|
13
14
|
pinnedOffset?: number;
|
|
14
15
|
align?: ColumnAlign;
|
|
15
|
-
density:
|
|
16
|
+
density: TableDensity;
|
|
17
|
+
variant: TableVariant;
|
|
16
18
|
}
|
|
17
|
-
declare function SpreadsheetCellInner<TData>({ column, row, rowIndex, isEditing, onStartEditing, onCommit, onCancel, width, pin, pinnedOffset, align, }: SpreadsheetCellProps<TData>): React.JSX.Element;
|
|
19
|
+
declare function SpreadsheetCellInner<TData>({ column, row, rowIndex, columnIndex, isEditing, onStartEditing, onCommit, onCancel, width, pin, pinnedOffset, align, density, variant, }: SpreadsheetCellProps<TData>): React.JSX.Element;
|
|
18
20
|
declare const SpreadsheetCell: typeof SpreadsheetCellInner;
|
|
19
21
|
export default SpreadsheetCell;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import Text, { TextSize, TextVariant } from "../text/Text.js";
|
|
2
|
+
import { CellEnrichmentStatus, SpreadsheetCellType } from "./types.js";
|
|
3
|
+
import { createVirtualRow } from "./utils.js";
|
|
4
|
+
import { TableDataCell } from "./TablePrimitives.js";
|
|
5
|
+
import { CellStatusDot } from "./SpreadsheetPrimitives.js";
|
|
6
|
+
import SpreadsheetCellEditor from "./SpreadsheetCellEditor.js";
|
|
7
|
+
import { match } from "ts-pattern";
|
|
8
|
+
import React, { useCallback } from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/table/SpreadsheetCell.tsx
|
|
11
|
+
function formatDisplayValue(value, cellType) {
|
|
12
|
+
if (value === null || value === void 0 || value === "") return "—";
|
|
13
|
+
return match(cellType).with(SpreadsheetCellType.BOOLEAN, () => value ? "Yes" : "No").with(SpreadsheetCellType.DATE, () => {
|
|
14
|
+
if (value instanceof Date) return value.toLocaleDateString();
|
|
15
|
+
return String(value);
|
|
16
|
+
}).otherwise(() => String(value));
|
|
17
|
+
}
|
|
18
|
+
function SpreadsheetCellInner({ column, row, rowIndex, columnIndex, isEditing, onStartEditing, onCommit, onCancel, width, pin, pinnedOffset, align, density, variant }) {
|
|
19
|
+
const value = column.accessorFn ? column.accessorFn(row) : void 0;
|
|
20
|
+
const isEditable = column.editable !== false && column.cellType !== SpreadsheetCellType.READONLY;
|
|
21
|
+
const enrichmentStatus = column.getCellEnrichmentStatus?.(row, rowIndex) ?? CellEnrichmentStatus.IDLE;
|
|
22
|
+
const showStatusDot = enrichmentStatus !== CellEnrichmentStatus.IDLE;
|
|
23
|
+
const handleClick = useCallback(() => {
|
|
24
|
+
if (isEditable && !isEditing) onStartEditing();
|
|
25
|
+
}, [
|
|
26
|
+
isEditable,
|
|
27
|
+
isEditing,
|
|
28
|
+
onStartEditing
|
|
29
|
+
]);
|
|
30
|
+
const renderContent = () => {
|
|
31
|
+
if (column.cell) return column.cell({
|
|
32
|
+
value,
|
|
33
|
+
row: createVirtualRow(row, rowIndex),
|
|
34
|
+
isEditing
|
|
35
|
+
});
|
|
36
|
+
if (isEditing) return /* @__PURE__ */ jsx(SpreadsheetCellEditor, {
|
|
37
|
+
cellType: column.cellType,
|
|
38
|
+
value,
|
|
39
|
+
enumOptions: column.enumOptions,
|
|
40
|
+
onCommit,
|
|
41
|
+
onCancel
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [showStatusDot && /* @__PURE__ */ jsx(CellStatusDot, { $status: enrichmentStatus }), /* @__PURE__ */ jsx(Text, {
|
|
44
|
+
variant: TextVariant.PRIMARY,
|
|
45
|
+
size: TextSize.BODY_SM,
|
|
46
|
+
isEllipsis: true,
|
|
47
|
+
children: formatDisplayValue(value, column.cellType)
|
|
48
|
+
})] });
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ jsx(TableDataCell, {
|
|
51
|
+
$width: width,
|
|
52
|
+
$minWidth: column.minSize,
|
|
53
|
+
$maxWidth: column.maxSize,
|
|
54
|
+
$pin: pin,
|
|
55
|
+
$pinnedOffset: pinnedOffset,
|
|
56
|
+
$align: align,
|
|
57
|
+
$density: density,
|
|
58
|
+
$variant: variant,
|
|
59
|
+
$isPositioned: true,
|
|
60
|
+
$isEditable: isEditable,
|
|
61
|
+
"data-editable": isEditable ? "true" : void 0,
|
|
62
|
+
role: "gridcell",
|
|
63
|
+
"aria-colindex": columnIndex + 1,
|
|
64
|
+
"aria-readonly": isEditable ? void 0 : true,
|
|
65
|
+
onClick: handleClick,
|
|
66
|
+
children: renderContent()
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
var SpreadsheetCell = React.memo(SpreadsheetCellInner);
|
|
70
|
+
//#endregion
|
|
71
|
+
export { SpreadsheetCell as default };
|
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
1
|
import { SpreadsheetCellType } from "./types.js";
|
|
2
|
+
import { CellEditorWrapper } from "./SpreadsheetPrimitives.js";
|
|
3
3
|
import SelectInput from "../inputs/SelectInput.js";
|
|
4
4
|
import DateInput from "../inputs/DateInput.js";
|
|
5
5
|
import NumberInput from "../inputs/NumberInput.js";
|
|
6
6
|
import TextInput from "../inputs/TextInput.js";
|
|
7
7
|
import ToggleInput from "../inputs/ToggleInput.js";
|
|
8
|
-
/* empty css */
|
|
9
|
-
import { styled } from "@linaria/react";
|
|
10
8
|
import { match } from "ts-pattern";
|
|
11
9
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
12
10
|
import { jsx } from "react/jsx-runtime";
|
|
13
|
-
//#region src/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}));
|
|
11
|
+
//#region src/table/SpreadsheetCellEditor.tsx
|
|
12
|
+
/**
|
|
13
|
+
* `Dropdown` renders through a Tippy portal on `document.body`, so an option
|
|
14
|
+
* list is not a DOM descendant of the editor. Tippy marks its portal root with
|
|
15
|
+
* this attribute — without the check, pressing an option counts as an outside
|
|
16
|
+
* press, commits, and unmounts the editor before the click can land.
|
|
17
|
+
*/
|
|
18
|
+
var TIPPY_PORTAL_SELECTOR = "[data-tippy-root]";
|
|
19
|
+
function isInsidePortal(target) {
|
|
20
|
+
return target instanceof Element && target.closest(TIPPY_PORTAL_SELECTOR) !== null;
|
|
21
|
+
}
|
|
25
22
|
function SpreadsheetCellEditor({ cellType, value, enumOptions, onCommit, onCancel }) {
|
|
26
23
|
const wrapperRef = useRef(null);
|
|
27
24
|
const [localValue, setLocalValue] = useState(value);
|
|
25
|
+
const commitRef = useRef(() => {});
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
commitRef.current = () => onCommit(localValue);
|
|
28
|
+
});
|
|
28
29
|
useEffect(() => {
|
|
29
|
-
const
|
|
30
|
-
|
|
30
|
+
const onPointerDown = (event) => {
|
|
31
|
+
const wrapper = wrapperRef.current;
|
|
32
|
+
if (!wrapper) return;
|
|
33
|
+
const target = event.target;
|
|
34
|
+
if (target && wrapper.contains(target)) return;
|
|
35
|
+
if (isInsidePortal(event.target)) return;
|
|
36
|
+
commitRef.current();
|
|
31
37
|
};
|
|
32
|
-
document.addEventListener("
|
|
33
|
-
return () => document.removeEventListener("
|
|
34
|
-
}, [
|
|
38
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
39
|
+
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
40
|
+
}, []);
|
|
35
41
|
const handleKeyDown = useCallback((e) => {
|
|
36
42
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
37
43
|
e.preventDefault();
|
|
@@ -48,7 +54,7 @@ function SpreadsheetCellEditor({ cellType, value, enumOptions, onCommit, onCance
|
|
|
48
54
|
onCommit,
|
|
49
55
|
onCancel
|
|
50
56
|
]);
|
|
51
|
-
return /* @__PURE__ */ jsx(
|
|
57
|
+
return /* @__PURE__ */ jsx(CellEditorWrapper, {
|
|
52
58
|
ref: wrapperRef,
|
|
53
59
|
children: match(cellType).with(SpreadsheetCellType.TEXT, () => /* @__PURE__ */ jsx(TextInput, {
|
|
54
60
|
value: String(localValue ?? ""),
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TableDensity, TableVariant, type SpreadsheetColumnDef, type SpreadsheetRowsContext } from "./types";
|
|
3
|
+
export interface SpreadsheetHeaderCellProps<TData> {
|
|
4
|
+
column: SpreadsheetColumnDef<TData, unknown>;
|
|
5
|
+
columnIndex: number;
|
|
6
|
+
width?: number;
|
|
7
|
+
pinnedOffset?: number;
|
|
8
|
+
density: TableDensity;
|
|
9
|
+
variant: TableVariant;
|
|
10
|
+
rowsContext: SpreadsheetRowsContext<TData>;
|
|
11
|
+
isResizable: boolean;
|
|
12
|
+
isResizing: boolean;
|
|
13
|
+
resizeBounds: {
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
current: number | undefined;
|
|
17
|
+
};
|
|
18
|
+
onResizeStart: (columnId: string, clientX: number, measuredWidth?: number) => void;
|
|
19
|
+
onResizeKeyDown: (columnId: string, event: React.KeyboardEvent) => void;
|
|
20
|
+
}
|
|
21
|
+
declare function SpreadsheetHeaderCellInner<TData>({ column, columnIndex, width, pinnedOffset, density, variant, rowsContext, isResizable, isResizing, resizeBounds, onResizeStart, onResizeKeyDown, }: SpreadsheetHeaderCellProps<TData>): React.JSX.Element;
|
|
22
|
+
declare const SpreadsheetHeaderCell: typeof SpreadsheetHeaderCellInner;
|
|
23
|
+
export default SpreadsheetHeaderCell;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import Icon, { IconVariant } from "../icons/Icon.js";
|
|
2
|
+
import FlexWrapper, { FlexDirection } from "../containers/FlexWrapper.js";
|
|
3
|
+
import { TableHeaderCell } from "./TablePrimitives.js";
|
|
4
|
+
import TableHeaderCellContent from "./TableHeaderCellContent.js";
|
|
5
|
+
import Dropdown, { DropdownPosition } from "../dropdown/Dropdown.js";
|
|
6
|
+
import SpreadsheetMenuItem from "./SpreadsheetMenuItem.js";
|
|
7
|
+
import { HeaderMenuTrigger } from "./SpreadsheetPrimitives.js";
|
|
8
|
+
import React, { useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { DotsThreeVerticalIcon } from "@phosphor-icons/react";
|
|
11
|
+
//#region src/table/SpreadsheetHeaderCell.tsx
|
|
12
|
+
function SpreadsheetHeaderCellInner({ column, columnIndex, width, pinnedOffset, density, variant, rowsContext, isResizable, isResizing, resizeBounds, onResizeStart, onResizeKeyDown }) {
|
|
13
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
14
|
+
const headerActions = column.headerActions ?? [];
|
|
15
|
+
const enrichmentActions = column.enrichmentActions ?? [];
|
|
16
|
+
const hasMenu = headerActions.length > 0 || enrichmentActions.length > 0;
|
|
17
|
+
const label = column.header ?? column.id;
|
|
18
|
+
const menu = hasMenu ? /* @__PURE__ */ jsx(Dropdown, {
|
|
19
|
+
body: /* @__PURE__ */ jsxs(FlexWrapper, {
|
|
20
|
+
direction: FlexDirection.COLUMN,
|
|
21
|
+
gap: 2,
|
|
22
|
+
children: [enrichmentActions.map((action) => /* @__PURE__ */ jsx(SpreadsheetMenuItem, {
|
|
23
|
+
icon: action.icon,
|
|
24
|
+
label: action.label,
|
|
25
|
+
onClick: () => {
|
|
26
|
+
action.onAction(column.id, rowsContext);
|
|
27
|
+
setIsMenuOpen(false);
|
|
28
|
+
}
|
|
29
|
+
}, `enrich-${action.id}`)), headerActions.map((action) => /* @__PURE__ */ jsx(SpreadsheetMenuItem, {
|
|
30
|
+
icon: action.icon,
|
|
31
|
+
label: action.label,
|
|
32
|
+
variant: action.variant,
|
|
33
|
+
onClick: () => {
|
|
34
|
+
action.onAction(column.id);
|
|
35
|
+
setIsMenuOpen(false);
|
|
36
|
+
}
|
|
37
|
+
}, `action-${action.id}`))]
|
|
38
|
+
}),
|
|
39
|
+
position: DropdownPosition.BOTTOM_END,
|
|
40
|
+
offset: [0, 4],
|
|
41
|
+
isOpen: isMenuOpen,
|
|
42
|
+
onClose: () => setIsMenuOpen(false),
|
|
43
|
+
minWidth: 160,
|
|
44
|
+
children: /* @__PURE__ */ jsx(HeaderMenuTrigger, {
|
|
45
|
+
type: "button",
|
|
46
|
+
"aria-label": `${label} column options`,
|
|
47
|
+
"aria-expanded": isMenuOpen,
|
|
48
|
+
"aria-haspopup": true,
|
|
49
|
+
onClick: (event) => {
|
|
50
|
+
event.stopPropagation();
|
|
51
|
+
setIsMenuOpen(!isMenuOpen);
|
|
52
|
+
},
|
|
53
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
54
|
+
component: DotsThreeVerticalIcon,
|
|
55
|
+
size: 12,
|
|
56
|
+
variant: IconVariant.TERTIARY
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
}) : void 0;
|
|
60
|
+
return /* @__PURE__ */ jsx(TableHeaderCell, {
|
|
61
|
+
$width: width,
|
|
62
|
+
$minWidth: column.minSize,
|
|
63
|
+
$maxWidth: column.maxSize,
|
|
64
|
+
$pin: column.pin,
|
|
65
|
+
$pinnedOffset: pinnedOffset,
|
|
66
|
+
$align: column.align,
|
|
67
|
+
$density: density,
|
|
68
|
+
$variant: variant,
|
|
69
|
+
role: "columnheader",
|
|
70
|
+
scope: "col",
|
|
71
|
+
"aria-colindex": columnIndex + 1,
|
|
72
|
+
"aria-label": column.headerAriaLabel,
|
|
73
|
+
children: /* @__PURE__ */ jsx(TableHeaderCellContent, {
|
|
74
|
+
content: label,
|
|
75
|
+
isSortable: false,
|
|
76
|
+
sortDirection: false,
|
|
77
|
+
trailing: menu,
|
|
78
|
+
resize: isResizable ? {
|
|
79
|
+
columnId: column.id,
|
|
80
|
+
columnLabel: label,
|
|
81
|
+
isResizing,
|
|
82
|
+
bounds: resizeBounds,
|
|
83
|
+
onResizeStart,
|
|
84
|
+
onResizeKeyDown
|
|
85
|
+
} : void 0
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
var SpreadsheetHeaderCell = React.memo(SpreadsheetHeaderCellInner);
|
|
90
|
+
//#endregion
|
|
91
|
+
export { SpreadsheetHeaderCell as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { TextVariant } from "../text/Text";
|
|
3
|
+
export interface SpreadsheetMenuItemProps {
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
label: string;
|
|
6
|
+
variant?: TextVariant;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* One row of a spreadsheet dropdown — shared by the column header menu and the
|
|
11
|
+
* row action menu, which previously carried byte-identical copies.
|
|
12
|
+
*/
|
|
13
|
+
declare const SpreadsheetMenuItem: ({ icon, label, variant, onClick }: SpreadsheetMenuItemProps) => import("react").JSX.Element;
|
|
14
|
+
export default SpreadsheetMenuItem;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
|
+
import Text, { TextSize, TextWeight } from "../text/Text.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { styled } from "@linaria/react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/table/SpreadsheetMenuItem.tsx
|
|
7
|
+
var _exp = () => ({ theme }) => theme.color.background.secondary;
|
|
8
|
+
var _exp2 = () => ({ theme }) => theme.color.border.selected;
|
|
9
|
+
var MenuItemButton = withTheme(/*#__PURE__*/ styled("button")({
|
|
10
|
+
name: "MenuItemButton",
|
|
11
|
+
class: "m16ywplt",
|
|
12
|
+
propsAsIs: false,
|
|
13
|
+
vars: {
|
|
14
|
+
"m16ywplt-0": [_exp()],
|
|
15
|
+
"m16ywplt-1": [_exp2()]
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
/**
|
|
19
|
+
* One row of a spreadsheet dropdown — shared by the column header menu and the
|
|
20
|
+
* row action menu, which previously carried byte-identical copies.
|
|
21
|
+
*/
|
|
22
|
+
var SpreadsheetMenuItem = ({ icon, label, variant, onClick }) => /* @__PURE__ */ jsxs(MenuItemButton, {
|
|
23
|
+
type: "button",
|
|
24
|
+
onClick,
|
|
25
|
+
children: [icon, /* @__PURE__ */ jsx(Text, {
|
|
26
|
+
size: TextSize.BODY_SM,
|
|
27
|
+
weight: TextWeight.MEDIUM,
|
|
28
|
+
variant,
|
|
29
|
+
children: label
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { SpreadsheetMenuItem as default };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { CellEnrichmentStatus, TableVariant } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Styled leaves with no equivalent in `TablePrimitives` — the trailing action
|
|
4
|
+
* column, the enrichment status dot, and the inline editor overlay.
|
|
5
|
+
*
|
|
6
|
+
* Everything here is non-generic: `withTheme` erases type parameters, so the
|
|
7
|
+
* generic row/cell components compose these rather than being wrapped.
|
|
8
|
+
*/
|
|
9
|
+
/** Trailing sticky header cell holding the add-column control. */
|
|
10
|
+
export declare const ActionColumnHeaderCell: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLTableHeaderCellElement> & import("react").ThHTMLAttributes<HTMLTableHeaderCellElement> & {
|
|
11
|
+
$variant?: TableVariant;
|
|
12
|
+
} & {
|
|
13
|
+
theme: import("../theme").Theme;
|
|
14
|
+
} & {
|
|
15
|
+
as?: React.ElementType;
|
|
16
|
+
}, "as" | "$variant" | keyof import("react").ClassAttributes<HTMLTableHeaderCellElement> | keyof import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>> & {
|
|
17
|
+
theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
|
|
18
|
+
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLTableHeaderCellElement> & import("react").ThHTMLAttributes<HTMLTableHeaderCellElement> & {
|
|
19
|
+
$variant?: TableVariant;
|
|
20
|
+
} & {
|
|
21
|
+
theme: import("../theme").Theme;
|
|
22
|
+
} & {
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
}> & {
|
|
25
|
+
__wyw_meta: unknown;
|
|
26
|
+
} & import("react").FunctionComponent<import("react").ClassAttributes<HTMLTableHeaderCellElement> & import("react").ThHTMLAttributes<HTMLTableHeaderCellElement> & {
|
|
27
|
+
$variant?: TableVariant;
|
|
28
|
+
} & {
|
|
29
|
+
theme: import("../theme").Theme;
|
|
30
|
+
} & {
|
|
31
|
+
as?: React.ElementType;
|
|
32
|
+
}>, {}>;
|
|
33
|
+
/** Trailing sticky body cell holding the row action menu. */
|
|
34
|
+
export declare const ActionColumnCell: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLTableDataCellElement> & import("react").TdHTMLAttributes<HTMLTableDataCellElement> & {
|
|
35
|
+
$variant?: TableVariant;
|
|
36
|
+
$pinnedOffset?: number;
|
|
37
|
+
} & {
|
|
38
|
+
theme: import("../theme").Theme;
|
|
39
|
+
} & {
|
|
40
|
+
as?: React.ElementType;
|
|
41
|
+
}, "as" | "$variant" | "$pinnedOffset" | keyof import("react").ClassAttributes<HTMLTableDataCellElement> | keyof import("react").TdHTMLAttributes<HTMLTableDataCellElement>> & {
|
|
42
|
+
theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
|
|
43
|
+
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLTableDataCellElement> & import("react").TdHTMLAttributes<HTMLTableDataCellElement> & {
|
|
44
|
+
$variant?: TableVariant;
|
|
45
|
+
$pinnedOffset?: number;
|
|
46
|
+
} & {
|
|
47
|
+
theme: import("../theme").Theme;
|
|
48
|
+
} & {
|
|
49
|
+
as?: React.ElementType;
|
|
50
|
+
}> & {
|
|
51
|
+
__wyw_meta: unknown;
|
|
52
|
+
} & import("react").FunctionComponent<import("react").ClassAttributes<HTMLTableDataCellElement> & import("react").TdHTMLAttributes<HTMLTableDataCellElement> & {
|
|
53
|
+
$variant?: TableVariant;
|
|
54
|
+
$pinnedOffset?: number;
|
|
55
|
+
} & {
|
|
56
|
+
theme: import("../theme").Theme;
|
|
57
|
+
} & {
|
|
58
|
+
as?: React.ElementType;
|
|
59
|
+
}>, {}>;
|
|
60
|
+
/** Keeps the trailing column's width when a row has no actions. */
|
|
61
|
+
export declare const ActionColumnSpacerCell: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLTableDataCellElement> & import("react").TdHTMLAttributes<HTMLTableDataCellElement> & {
|
|
62
|
+
$variant?: TableVariant;
|
|
63
|
+
} & {
|
|
64
|
+
theme: import("../theme").Theme;
|
|
65
|
+
} & {
|
|
66
|
+
as?: React.ElementType;
|
|
67
|
+
}, "as" | "$variant" | keyof import("react").ClassAttributes<HTMLTableDataCellElement> | keyof import("react").TdHTMLAttributes<HTMLTableDataCellElement>> & {
|
|
68
|
+
theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
|
|
69
|
+
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLTableDataCellElement> & import("react").TdHTMLAttributes<HTMLTableDataCellElement> & {
|
|
70
|
+
$variant?: TableVariant;
|
|
71
|
+
} & {
|
|
72
|
+
theme: import("../theme").Theme;
|
|
73
|
+
} & {
|
|
74
|
+
as?: React.ElementType;
|
|
75
|
+
}> & {
|
|
76
|
+
__wyw_meta: unknown;
|
|
77
|
+
} & import("react").FunctionComponent<import("react").ClassAttributes<HTMLTableDataCellElement> & import("react").TdHTMLAttributes<HTMLTableDataCellElement> & {
|
|
78
|
+
$variant?: TableVariant;
|
|
79
|
+
} & {
|
|
80
|
+
theme: import("../theme").Theme;
|
|
81
|
+
} & {
|
|
82
|
+
as?: React.ElementType;
|
|
83
|
+
}>, {}>;
|
|
84
|
+
/**
|
|
85
|
+
* Column header menu trigger.
|
|
86
|
+
*
|
|
87
|
+
* Deliberately chrome-less rather than a `Button`: it should read as a peer of
|
|
88
|
+
* the table's sort caret — a bare 12px tertiary icon — not as a control sitting
|
|
89
|
+
* in the header. It stays a real `button` so it remains focusable and announced.
|
|
90
|
+
*/
|
|
91
|
+
export declare const HeaderMenuTrigger: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
92
|
+
theme: import("../theme").Theme;
|
|
93
|
+
} & {
|
|
94
|
+
as?: React.ElementType;
|
|
95
|
+
}, "as" | keyof import("react").ClassAttributes<HTMLButtonElement> | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
96
|
+
theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
|
|
97
|
+
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
98
|
+
theme: import("../theme").Theme;
|
|
99
|
+
} & {
|
|
100
|
+
as?: React.ElementType;
|
|
101
|
+
}> & {
|
|
102
|
+
__wyw_meta: unknown;
|
|
103
|
+
} & import("react").FunctionComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
104
|
+
theme: import("../theme").Theme;
|
|
105
|
+
} & {
|
|
106
|
+
as?: React.ElementType;
|
|
107
|
+
}>, {}>;
|
|
108
|
+
export declare const CellStatusDot: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
109
|
+
$status: CellEnrichmentStatus;
|
|
110
|
+
} & {
|
|
111
|
+
theme: import("../theme").Theme;
|
|
112
|
+
} & {
|
|
113
|
+
as?: React.ElementType;
|
|
114
|
+
}, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement> | "as" | "$status"> & {
|
|
115
|
+
theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
|
|
116
|
+
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
117
|
+
$status: CellEnrichmentStatus;
|
|
118
|
+
} & {
|
|
119
|
+
theme: import("../theme").Theme;
|
|
120
|
+
} & {
|
|
121
|
+
as?: React.ElementType;
|
|
122
|
+
}> & {
|
|
123
|
+
__wyw_meta: unknown;
|
|
124
|
+
} & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
125
|
+
$status: CellEnrichmentStatus;
|
|
126
|
+
} & {
|
|
127
|
+
theme: import("../theme").Theme;
|
|
128
|
+
} & {
|
|
129
|
+
as?: React.ElementType;
|
|
130
|
+
}>, {}>;
|
|
131
|
+
/**
|
|
132
|
+
* Inline editor overlay.
|
|
133
|
+
*
|
|
134
|
+
* `inset: 0` resolves against the cell only because the cell is rendered with
|
|
135
|
+
* `$isPositioned` — otherwise the nearest positioned ancestor is the row, which
|
|
136
|
+
* is `position: absolute` in a virtualized body.
|
|
137
|
+
*/
|
|
138
|
+
export declare const CellEditorWrapper: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
139
|
+
theme: import("../theme").Theme;
|
|
140
|
+
} & {
|
|
141
|
+
as?: React.ElementType;
|
|
142
|
+
}, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement> | "as"> & {
|
|
143
|
+
theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
|
|
144
|
+
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
145
|
+
theme: import("../theme").Theme;
|
|
146
|
+
} & {
|
|
147
|
+
as?: React.ElementType;
|
|
148
|
+
}> & {
|
|
149
|
+
__wyw_meta: unknown;
|
|
150
|
+
} & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
151
|
+
theme: import("../theme").Theme;
|
|
152
|
+
} & {
|
|
153
|
+
as?: React.ElementType;
|
|
154
|
+
}>, {}>;
|
|
155
|
+
/** Skeleton block shown in a loading cell. */
|
|
156
|
+
export declare const CellLoadingSkeleton: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
157
|
+
theme: import("../theme").Theme;
|
|
158
|
+
} & {
|
|
159
|
+
as?: React.ElementType;
|
|
160
|
+
}, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement> | "as"> & {
|
|
161
|
+
theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
|
|
162
|
+
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
163
|
+
theme: import("../theme").Theme;
|
|
164
|
+
} & {
|
|
165
|
+
as?: React.ElementType;
|
|
166
|
+
}> & {
|
|
167
|
+
__wyw_meta: unknown;
|
|
168
|
+
} & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
169
|
+
theme: import("../theme").Theme;
|
|
170
|
+
} & {
|
|
171
|
+
as?: React.ElementType;
|
|
172
|
+
}>, {}>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
|
+
import { CellEnrichmentStatus } from "./types.js";
|
|
3
|
+
import { getVariantBackgroundColor } from "./utils.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { styled } from "@linaria/react";
|
|
6
|
+
import { match } from "ts-pattern";
|
|
7
|
+
//#region src/table/SpreadsheetPrimitives.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Styled leaves with no equivalent in `TablePrimitives` — the trailing action
|
|
10
|
+
* column, the enrichment status dot, and the inline editor overlay.
|
|
11
|
+
*
|
|
12
|
+
* Everything here is non-generic: `withTheme` erases type parameters, so the
|
|
13
|
+
* generic row/cell components compose these rather than being wrapped.
|
|
14
|
+
*/
|
|
15
|
+
/** Trailing sticky header cell holding the add-column control. */
|
|
16
|
+
var _exp2 = () => ({ $variant, theme }) => getVariantBackgroundColor(theme, $variant);
|
|
17
|
+
var _exp4 = () => ({ theme }) => theme.color.border.primary;
|
|
18
|
+
var ActionColumnHeaderCell = withTheme(/*#__PURE__*/ styled("th")({
|
|
19
|
+
name: "ActionColumnHeaderCell",
|
|
20
|
+
class: "a1wb3h41",
|
|
21
|
+
propsAsIs: false,
|
|
22
|
+
vars: {
|
|
23
|
+
"a1wb3h41-0": [_exp2()],
|
|
24
|
+
"a1wb3h41-1": [_exp4()]
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
/** Trailing sticky body cell holding the row action menu. */
|
|
28
|
+
var _exp5 = () => ({ $pinnedOffset }) => $pinnedOffset !== void 0 ? `${$pinnedOffset}px` : "0";
|
|
29
|
+
var _exp7 = () => ({ $variant, theme }) => getVariantBackgroundColor(theme, $variant);
|
|
30
|
+
var _exp8 = () => ({ theme }) => theme.color.border.primary;
|
|
31
|
+
var ActionColumnCell = withTheme(/*#__PURE__*/ styled("td")({
|
|
32
|
+
name: "ActionColumnCell",
|
|
33
|
+
class: "an0h7xt",
|
|
34
|
+
propsAsIs: false,
|
|
35
|
+
vars: {
|
|
36
|
+
"an0h7xt-0": [_exp5()],
|
|
37
|
+
"an0h7xt-1": [_exp7()],
|
|
38
|
+
"an0h7xt-2": [_exp8()]
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
/** Keeps the trailing column's width when a row has no actions. */
|
|
42
|
+
var _exp0 = () => ({ $variant, theme }) => getVariantBackgroundColor(theme, $variant);
|
|
43
|
+
var _exp1 = () => ({ theme }) => theme.color.border.primary;
|
|
44
|
+
var ActionColumnSpacerCell = withTheme(/*#__PURE__*/ styled("td")({
|
|
45
|
+
name: "ActionColumnSpacerCell",
|
|
46
|
+
class: "asyqbtk",
|
|
47
|
+
propsAsIs: false,
|
|
48
|
+
vars: {
|
|
49
|
+
"asyqbtk-0": [_exp0()],
|
|
50
|
+
"asyqbtk-1": [_exp1()]
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
/**
|
|
54
|
+
* Column header menu trigger.
|
|
55
|
+
*
|
|
56
|
+
* Deliberately chrome-less rather than a `Button`: it should read as a peer of
|
|
57
|
+
* the table's sort caret — a bare 12px tertiary icon — not as a control sitting
|
|
58
|
+
* in the header. It stays a real `button` so it remains focusable and announced.
|
|
59
|
+
*/
|
|
60
|
+
var _exp10 = () => ({ theme }) => theme.color.border.selected;
|
|
61
|
+
var HeaderMenuTrigger = withTheme(/*#__PURE__*/ styled("button")({
|
|
62
|
+
name: "HeaderMenuTrigger",
|
|
63
|
+
class: "hykjqu1",
|
|
64
|
+
propsAsIs: false,
|
|
65
|
+
vars: { "hykjqu1-0": [_exp10()] }
|
|
66
|
+
}));
|
|
67
|
+
var _exp13 = () => ({ $status, theme }) => match($status).with(CellEnrichmentStatus.PENDING, () => theme.color.text.tertiary).with(CellEnrichmentStatus.RUNNING, () => theme.color.background.galaxy).with(CellEnrichmentStatus.COMPLETE, () => theme.color.icon.success).with(CellEnrichmentStatus.ERROR, () => theme.color.text.error).otherwise(() => "transparent");
|
|
68
|
+
var _exp14 = () => ({ $status }) => $status === CellEnrichmentStatus.RUNNING ? "enrichPulse 1.2s ease-in-out infinite" : "none";
|
|
69
|
+
var CellStatusDot = withTheme(/*#__PURE__*/ styled("div")({
|
|
70
|
+
name: "CellStatusDot",
|
|
71
|
+
class: "c1yt5ynl",
|
|
72
|
+
propsAsIs: false,
|
|
73
|
+
vars: {
|
|
74
|
+
"c1yt5ynl-0": [_exp13()],
|
|
75
|
+
"c1yt5ynl-1": [_exp14()]
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
/**
|
|
79
|
+
* Inline editor overlay.
|
|
80
|
+
*
|
|
81
|
+
* `inset: 0` resolves against the cell only because the cell is rendered with
|
|
82
|
+
* `$isPositioned` — otherwise the nearest positioned ancestor is the row, which
|
|
83
|
+
* is `position: absolute` in a virtualized body.
|
|
84
|
+
*/
|
|
85
|
+
var _exp15 = () => ({ theme }) => theme.color.background.primary;
|
|
86
|
+
var _exp16 = () => ({ theme }) => theme.color.border.galaxy;
|
|
87
|
+
var CellEditorWrapper = withTheme(/*#__PURE__*/ styled("div")({
|
|
88
|
+
name: "CellEditorWrapper",
|
|
89
|
+
class: "c1kvxq2r",
|
|
90
|
+
propsAsIs: false,
|
|
91
|
+
vars: {
|
|
92
|
+
"c1kvxq2r-0": [_exp15()],
|
|
93
|
+
"c1kvxq2r-1": [_exp16()]
|
|
94
|
+
}
|
|
95
|
+
}));
|
|
96
|
+
/** Skeleton block shown in a loading cell. */
|
|
97
|
+
var _exp17 = () => ({ theme }) => theme.color.background.tertiary;
|
|
98
|
+
var CellLoadingSkeleton = withTheme(/*#__PURE__*/ styled("div")({
|
|
99
|
+
name: "CellLoadingSkeleton",
|
|
100
|
+
class: "cz6gl36",
|
|
101
|
+
propsAsIs: false,
|
|
102
|
+
vars: { "cz6gl36-0": [_exp17()] }
|
|
103
|
+
}));
|
|
104
|
+
//#endregion
|
|
105
|
+
export { ActionColumnCell, ActionColumnHeaderCell, ActionColumnSpacerCell, CellEditorWrapper, CellLoadingSkeleton, CellStatusDot, HeaderMenuTrigger };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TableDensity, TableVariant, type EditingCell, type SpreadsheetColumnDef, type SpreadsheetRowAction } from "./types";
|
|
3
|
+
export interface SpreadsheetRowProps<TData> {
|
|
4
|
+
rowData: TData | undefined;
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
translateY: number;
|
|
7
|
+
rowHeight: number;
|
|
8
|
+
isLastRow: boolean;
|
|
9
|
+
density: TableDensity;
|
|
10
|
+
variant: TableVariant;
|
|
11
|
+
columns: SpreadsheetColumnDef<TData, unknown>[];
|
|
12
|
+
pinnedOffsets: Map<string, number>;
|
|
13
|
+
getColumnWidth: (col: SpreadsheetColumnDef<TData, unknown>) => number | undefined;
|
|
14
|
+
editingCell: EditingCell | null;
|
|
15
|
+
onStartEditing: (rowIndex: number, columnId: string) => void;
|
|
16
|
+
onCommitEditing: () => void;
|
|
17
|
+
onCancelEditing: () => void;
|
|
18
|
+
rowActions?: SpreadsheetRowAction<TData>[];
|
|
19
|
+
rowActionsAriaLabel?: string;
|
|
20
|
+
showActionColumn?: boolean;
|
|
21
|
+
tabIndex?: number;
|
|
22
|
+
onFocus?: () => void;
|
|
23
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
24
|
+
}
|
|
25
|
+
declare function SpreadsheetRowInner<TData>({ rowData, rowIndex, translateY, rowHeight, isLastRow, density, variant, columns, pinnedOffsets, getColumnWidth, editingCell, onStartEditing, onCommitEditing, onCancelEditing, rowActions, rowActionsAriaLabel, showActionColumn, tabIndex, onFocus, onKeyDown, }: SpreadsheetRowProps<TData>): React.JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Default shallow comparison: `columns`, `getColumnWidth` and `pinnedOffsets`
|
|
28
|
+
* are all memoized upstream, so every prop that affects the output takes part.
|
|
29
|
+
* A hand-written comparator here previously dropped `rowHeight`, which left
|
|
30
|
+
* mounted rows at a stale height whenever density changed.
|
|
31
|
+
*/
|
|
32
|
+
declare const SpreadsheetRow: typeof SpreadsheetRowInner;
|
|
33
|
+
export default SpreadsheetRow;
|